Skip to content

CLI: improve spinner messages for clarity #426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions packages/add-manifest/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class MyCommand extends Command {
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const assetFolderPath = path.join(__dirname, '..', '..', 'assets')

const spinner = ora('Add Manifest to your project...').start()
const spinner = ora('Adding Manifest to your project...').start()

// * 1. Create a folder with the name `manifest`.
// Construct the folder path. This example creates the folder in the current working directory.
Expand Down Expand Up @@ -73,7 +73,7 @@ export class MyCommand extends Command {
fs.writeFileSync(newFilePath, content)

spinner.succeed()
spinner.start('Update package.json file...')
spinner.start('Updating package.json file...')

// Update package.json file.
const packagePath = path.join(process.cwd(), 'package.json')
Expand Down Expand Up @@ -109,7 +109,7 @@ export class MyCommand extends Command {
)

spinner.succeed()
spinner.start('Add settings...')
spinner.start('Adding settings...')

// Update .vscode/extensions.json file.
const vscodeDirPath: string = path.join(process.cwd(), '.vscode')
Expand Down Expand Up @@ -196,7 +196,7 @@ export class MyCommand extends Command {
}

// * 9. Install the new packages.
spinner.start('Install dependencies...')
spinner.start('Installing dependencies...')

// Install deps.
try {
Expand All @@ -208,7 +208,7 @@ export class MyCommand extends Command {
// Serve the new app.
spinner.succeed()

spinner.start('Add environment variables...')
spinner.start('Adding environment variables...')
// Add environment variables to .env file
const envFilePath = path.join(process.cwd(), '.env')
const envJWTSecret = `TOKEN_SECRET_KEY=${crypto
Expand All @@ -227,7 +227,7 @@ export class MyCommand extends Command {
fs.writeFileSync(envFilePath, envContent)

spinner.succeed()
spinner.start('Build the database...')
spinner.start('Building the database...')

let serveTask: PromiseWithChild<{ stdout: string; stderr: string }> | null =
null
Expand All @@ -242,7 +242,7 @@ export class MyCommand extends Command {
spinner.fail(`Execution error: ${error}`)
}

spinner.start('Seed initial data...')
spinner.start('Seeding initial data...')
try {
await exec('npm run manifest:seed')
} catch (error) {
Expand Down Expand Up @@ -323,3 +323,4 @@ export class MyCommand extends Command {
})
}
}