diff --git a/command/upgrade/provider/npm.ts b/command/upgrade/provider/npm.ts index 8e5a41e9..c9f66c8f 100644 --- a/command/upgrade/provider/npm.ts +++ b/command/upgrade/provider/npm.ts @@ -16,7 +16,7 @@ export class NpmProvider extends Provider { private readonly packageName?: string; private readonly packageScope?: string; - constructor({ main, logger, ...options }: NpmProviderOptions) { + constructor({ main, logger, ...options }: NpmProviderOptions = {}) { super({ main, logger }); if ("package" in options) { if (options.package.startsWith("@")) { diff --git a/command/upgrade/upgrade_command.ts b/command/upgrade/upgrade_command.ts index c670893e..8e542463 100644 --- a/command/upgrade/upgrade_command.ts +++ b/command/upgrade/upgrade_command.ts @@ -17,6 +17,7 @@ export interface UpgradeCommandOptions< > extends RuntimeOptions { provider: TProvider | Array; runtime?: RuntimeOptionsMap; + spinner?: boolean; } /** @@ -58,7 +59,8 @@ export class UpgradeCommand extends Command { private readonly providers: ReadonlyArray; constructor( - { provider, ...options }: UpgradeCommandOptions, + { provider, spinner: withSpinner = true, ...options }: + UpgradeCommandOptions, ) { super(); this.providers = Array.isArray(provider) ? provider : [provider]; @@ -108,7 +110,9 @@ export class UpgradeCommand extends Command { "-v, --verbose", "Log verbose output.", ) - .option("--no-spinner", "Disable spinner.") + .option("--no-spinner", "Disable spinner.", { + hidden: !withSpinner, + }) .complete("version", () => this.getAllVersions()) .action( async ( @@ -123,7 +127,7 @@ export class UpgradeCommand extends Command { const name: string = this.getMainCommand().getName(); const currentVersion: string | undefined = this.getVersion(); - const spinner = spinnerEnabled + const spinner = withSpinner && spinnerEnabled ? new Spinner({ message: brightBlue( `Upgrading ${bold(name)} from version ${