-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19452 from storybookjs/cli/old-framework-error
Core: Throw an error if renderer is used as framework
- Loading branch information
Showing
4 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { dedent } from 'ts-dedent'; | ||
|
||
const rendererNames = [ | ||
'@storybook/html', | ||
'@storybook/preact', | ||
'@storybook/react', | ||
'@storybook/server', | ||
'@storybook/svelte', | ||
'@storybook/vue', | ||
'@storybook/vue3', | ||
'@storybook/web-components', | ||
]; | ||
|
||
// Checks that the framework name is not a renderer | ||
export function validateFrameworkName(frameworkName: string) { | ||
if (rendererNames.includes(frameworkName)) { | ||
throw new Error(dedent` | ||
Invalid value of ${frameworkName} in the 'framework' field of Storybook config. | ||
Please run 'npx sb@next automigrate' | ||
See the v7 Migration guide for more information: | ||
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-field-mandatory | ||
`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
code/lib/core-server/src/build-dev.test.ts → ...src/utils/__tests__/release-notes.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters