Skip to content

Commit

Permalink
fix(storybook): update version check
Browse files Browse the repository at this point in the history
Previously the check would see if the version of storybook is less than 7 and would throw an error. This causes an issue when testing canary releases of storybook since they are labeled 0.0.0-[pr-info...]

Update pleaseUpgrade text

One of the checks is to see if storybook is less than 7. The text is updated so it matches for the very unlikely scenario that someone with version 5 and lower runs this plugin.
  • Loading branch information
abcdmku committed Aug 2, 2024
1 parent 97d4184 commit afa3fa4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/storybook/src/executors/storybook/storybook.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ export default async function* storybookExecutor(
success: boolean;
info?: { port: number; baseUrl?: string };
}> {
const storybook7 = storybookMajorVersion() >= 7;
if (!storybook7) {
const sbVersion = storybookMajorVersion();
const sbLessThan7 = sbVersion >= 7 && sbVersion > 0;

if (!sbLessThan7) {
throw pleaseUpgrade();
}
storybookConfigExistsCheck(options.configDir, context.projectName);
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/src/utils/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export function getTsSourceFile(host: Tree, path: string): ts.SourceFile {

export function pleaseUpgrade(): string {
return `
Storybook 6 is no longer maintained, and not supported in Nx.
Storybook 6 and lower are no longer maintained, and not supported in Nx.
Please upgrade to Storybook 7.
Here is a guide on how to upgrade:
Expand Down

0 comments on commit afa3fa4

Please sign in to comment.