@storybook/core-events
Version:
Event names used in storybook core
33 lines (25 loc) • 3.8 kB
JavaScript
import { StorybookError } from '../chunk-ZCWIJT6X.mjs';
import dedent from 'ts-dedent';
var Category=(Category2=>(Category2.CLI="CLI",Category2.CLI_INIT="CLI_INIT",Category2.CLI_AUTOMIGRATE="CLI_AUTOMIGRATE",Category2.CLI_UPGRADE="CLI_UPGRADE",Category2.CLI_ADD="CLI_ADD",Category2.CODEMOD="CODEMOD",Category2.CORE_SERVER="CORE-SERVER",Category2.CSF_PLUGIN="CSF-PLUGIN",Category2.CSF_TOOLS="CSF-TOOLS",Category2.CORE_COMMON="CORE-COMMON",Category2.NODE_LOGGER="NODE-LOGGER",Category2.TELEMETRY="TELEMETRY",Category2.BUILDER_MANAGER="BUILDER-MANAGER",Category2.BUILDER_VITE="BUILDER-VITE",Category2.BUILDER_WEBPACK5="BUILDER-WEBPACK5",Category2.SOURCE_LOADER="SOURCE-LOADER",Category2.POSTINSTALL="POSTINSTALL",Category2.DOCS_TOOLS="DOCS-TOOLS",Category2.CORE_WEBPACK="CORE-WEBPACK",Category2))(Category||{}),NxProjectDetectedError=class extends StorybookError{constructor(){super(...arguments);this.category="CLI_INIT";this.code=1;this.documentation="https://nx.dev/packages/storybook";}template(){return dedent`
We have detected Nx in your project. Nx has its own Storybook initializer, so please use it instead.
Run "nx g @nx/storybook:configuration" to add Storybook to your project.
`}},MissingFrameworkFieldError=class extends StorybookError{constructor(){super(...arguments);this.category="CORE-COMMON";this.code=1;this.documentation="https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-framework-api";}template(){return dedent`
Could not find a 'framework' field in Storybook config.
Please run 'npx storybook@next automigrate' to automatically fix your config.
`}},InvalidFrameworkNameError=class extends StorybookError{constructor(data){super();this.data=data;this.category="CORE-COMMON";this.code=2;this.documentation="https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-framework-api";}template(){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.
`}},CouldNotEvaluateFrameworkError=class extends StorybookError{constructor(data){super();this.data=data;this.category="CORE-COMMON";this.code=3;}template(){return dedent`
Could not evaluate the '${this.data.frameworkName}' package from the 'framework' field of Storybook config.
Are you sure it's a valid package and is installed?
`}},ConflictingStaticDirConfigError=class extends StorybookError{constructor(){super(...arguments);this.category="CORE-SERVER";this.code=1;this.documentation="https://storybook.js.org/docs/react/configure/images-and-assets#serving-static-files-via-storybook-configuration";}template(){return dedent`
Storybook encountered a conflict when trying to serve statics. You have configured both:
* Storybook's option in the config file: 'staticDirs'
* Storybook's (deprecated) CLI flag: '--staticDir' or '-s'
Please remove the CLI flag from your storybook script and use only the 'staticDirs' option instead.
`}},InvalidStoriesEntryError=class extends StorybookError{constructor(){super(...arguments);this.category="CORE-COMMON";this.code=4;this.documentation="https://storybook.js.org/docs/react/faq#can-i-have-a-storybook-with-no-local-stories";}template(){return dedent`
Storybook could not index your stories.
Your main configuration somehow does not contain a 'stories' field, or it resolved to an empty array.
Please check your main configuration file and make sure it exports a 'stories' field that is not an empty array.
`}};
export { Category, ConflictingStaticDirConfigError, CouldNotEvaluateFrameworkError, InvalidFrameworkNameError, InvalidStoriesEntryError, MissingFrameworkFieldError, NxProjectDetectedError };