Skip to content

Commit

Permalink
update npx storybook command references
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Mar 20, 2024
1 parent d708857 commit ac79433
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('getMigrationSummary', () => {
─────────────────────────────────────────────────
If you'd like to run the migrations again, you can do so by running 'npx storybook@next automigrate'
If you'd like to run the migrations again, you can do so by running 'npx storybook automigrate'
The automigrations try to migrate common patterns in your project, but might not contain everything needed to migrate to the latest version of Storybook.
Expand All @@ -124,7 +124,7 @@ describe('getMigrationSummary', () => {
expect(summary).toMatchInlineSnapshot(`
"No migrations were applicable to your project
If you'd like to run the migrations again, you can do so by running 'npx storybook@next automigrate'
If you'd like to run the migrations again, you can do so by running 'npx storybook automigrate'
The automigrations try to migrate common patterns in your project, but might not contain everything needed to migrate to the latest version of Storybook.
Expand All @@ -144,7 +144,7 @@ describe('getMigrationSummary', () => {
expect(summary).toMatchInlineSnapshot(`
"No migrations were applicable to your project
If you'd like to run the migrations again, you can do so by running 'npx storybook@next automigrate'
If you'd like to run the migrations again, you can do so by running 'npx storybook automigrate'
The automigrations try to migrate common patterns in your project, but might not contain everything needed to migrate to the latest version of Storybook.
Expand Down
6 changes: 1 addition & 5 deletions code/lib/cli/src/automigrate/helpers/getMigrationSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,11 @@ export function getMigrationSummary({
installationMetadata?: InstallationMetadata | null;
logFile: string;
}) {
const automigrateCommand = isPrerelease(versions.storybook)
? 'npx storybook@next automigrate'
: 'npx storybook@latest automigrate';

const messages = [];
messages.push(getGlossaryMessages(fixSummary, fixResults, logFile).join(messageDivider));

messages.push(dedent`If you'd like to run the migrations again, you can do so by running '${chalk.cyan(
automigrateCommand
'npx storybook automigrate'
)}'
The automigrations try to migrate common patterns in your project, but might not contain everything needed to migrate to the latest version of Storybook.
Expand Down
6 changes: 1 addition & 5 deletions code/lib/cli/src/doctor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,8 @@ export const doctor = async ({
}
}

const doctorCommand = isPrerelease(storybookVersion)
? 'npx storybook@next doctor'
: 'npx storybook@latest doctor';

const commandMessage = `You can always recheck the health of your project by running:\n${chalk.cyan(
doctorCommand
'npx storybook doctor'
)}`;
logger.info();

Expand Down
10 changes: 5 additions & 5 deletions code/lib/core-events/src/errors/server-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class MissingFrameworkFieldError extends StorybookError {
return dedent`
Could not find a 'framework' field in Storybook config.
Please run 'npx storybook@next automigrate' to automatically fix your config.
Please run 'npx storybook automigrate' to automatically fix your config.
`;
}
}
Expand All @@ -98,7 +98,7 @@ export class InvalidFrameworkNameError extends StorybookError {
return dedent`
Invalid value of '${this.data.frameworkName}' in the 'framework' field of Storybook config.
Please run 'npx storybook@next automigrate' to automatically fix your config.
Please run 'npx storybook automigrate' to automatically fix your config.
`;
}
}
Expand Down Expand Up @@ -276,7 +276,7 @@ export class AngularLegacyBuildOptionsError extends StorybookError {
Your Storybook startup script uses a solution that is not supported anymore.
You must use Angular builder to have an explicit configuration on the project used in angular.json.
Please run 'npx storybook@next automigrate' to automatically fix your config.
Please run 'npx storybook automigrate' to automatically fix your config.
`;
}
}
Expand Down Expand Up @@ -390,7 +390,7 @@ export class NoMatchingExportError extends StorybookError {
Correct example:
{ "@storybook/react": "7.5.3", "@storybook/react-vite": "7.5.3", "storybook": "7.5.3" }
Please run \`npx storybook@latest doctor\` for guidance on how to fix this issue.
Please run \`npx storybook doctor\` for guidance on how to fix this issue.
`;
}
}
Expand Down Expand Up @@ -557,7 +557,7 @@ export class UpgradeStorybookToSameVersionError extends StorybookError {
If you intended to re-run automigrations, you should run the "automigrate" command directly instead:
"npx storybook@${this.data.beforeVersion} automigrate"
"npx storybook automigrate"
`;
}
}
Expand Down

0 comments on commit ac79433

Please sign in to comment.