diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index 11c0c137f628..0930b04e6a74 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,9 @@ +## 8.0.0-alpha.6 + +- NextJS: Autoconfigure public directory for new projects - [#25279](https://github.com/storybookjs/storybook/pull/25279), thanks [@shilman](https://github.com/shilman)! +- Vite: Fix pre-transform error in Vite 5 - [#25329](https://github.com/storybookjs/storybook/pull/25329), thanks [@yannbf](https://github.com/yannbf)! +- Vue3: Fix pnp by making compiler-core a dependency - [#25311](https://github.com/storybookjs/storybook/pull/25311), thanks [@shilman](https://github.com/shilman)! + ## 8.0.0-alpha.5 - Core: Remove the `-s` flag from build & dev - [#25266](https://github.com/storybookjs/storybook/pull/25266), thanks [@ndelangen](https://github.com/ndelangen)! diff --git a/MIGRATION.md b/MIGRATION.md index 787e893df979..c69c72a1fc66 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -549,7 +549,7 @@ To summarize: #### typescript.skipBabel deprecated -We will remove the `typescript.skipBabel` option in Storybook 8.0.0. Please use `typescirpt.skipCompiler` instead. +We will remove the `typescript.skipBabel` option in Storybook 8.0.0. Please use `typescript.skipCompiler` instead. #### Primary doc block accepts of prop diff --git a/code/addons/a11y/README.md b/code/addons/a11y/README.md index 7ff0d885ec0a..64730ef61033 100755 --- a/code/addons/a11y/README.md +++ b/code/addons/a11y/README.md @@ -193,6 +193,10 @@ export const inaccessible = () => ( ); ``` +## Automate accessibility tests with test runner + +The test runner does not apply any rules that you have set on your stories by default. You can configure the runner to correctly apply the rules by [following the guide on the Storybook docs](https://storybook.js.org/docs/writing-tests/accessibility-testing#automate-accessibility-tests-with-test-runner). + ## Roadmap - Make UI accessible diff --git a/code/builders/builder-vite/src/vite-server.ts b/code/builders/builder-vite/src/vite-server.ts index ce4631cabaed..0b1e80435027 100644 --- a/code/builders/builder-vite/src/vite-server.ts +++ b/code/builders/builder-vite/src/vite-server.ts @@ -11,6 +11,8 @@ export async function createViteServer(options: Options, devServer: Server) { const config = { ...commonCfg, + // Needed in Vite 5: https://github.com/storybookjs/storybook/issues/25256 + assetsInclude: ['/sb-preview/**'], // Set up dev server server: { middlewareMode: true, diff --git a/code/lib/cli/src/generators/NEXTJS/index.ts b/code/lib/cli/src/generators/NEXTJS/index.ts index 2588b387312a..27d220321dd1 100644 --- a/code/lib/cli/src/generators/NEXTJS/index.ts +++ b/code/lib/cli/src/generators/NEXTJS/index.ts @@ -1,14 +1,20 @@ +import { join } from 'path'; +import { existsSync } from 'fs'; import { CoreBuilder } from '../../project_types'; import { baseGenerator } from '../baseGenerator'; import type { Generator } from '../types'; const generator: Generator = async (packageManager, npmOptions, options) => { + let staticDir; + if (existsSync(join(process.cwd(), 'public'))) staticDir = 'public'; + await baseGenerator( packageManager, npmOptions, { ...options, builder: CoreBuilder.Webpack5 }, 'react', { + staticDir, extraAddons: ['@storybook/addon-onboarding'], }, 'nextjs' diff --git a/code/lib/csf-tools/src/CsfFile.test.ts b/code/lib/csf-tools/src/CsfFile.test.ts index 74b9676f3f96..c503cf795672 100644 --- a/code/lib/csf-tools/src/CsfFile.test.ts +++ b/code/lib/csf-tools/src/CsfFile.test.ts @@ -5,8 +5,8 @@ import yaml from 'js-yaml'; import { loadCsf } from './CsfFile'; expect.addSnapshotSerializer({ - print: (val: any) => yaml.dump(typeof val === 'string' ? val : val.toString()).trimEnd(), - test: (val) => typeof val !== 'string', + print: (val: any) => yaml.dump(val).trimEnd(), + test: (val) => typeof val !== 'string' && !(val instanceof Error), }); const makeTitle = (userTitle?: string) => { @@ -33,7 +33,21 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + parameters: + __isArgsStory: false + __id: foo-bar--a + - id: foo-bar--b + name: B + parameters: + __isArgsStory: true + __id: foo-bar--b + `); }); it('exported const stories', () => { @@ -47,7 +61,19 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + parameters: + __id: foo-bar--a + - id: foo-bar--b + name: B + parameters: + __id: foo-bar--b + `); }); it('underscores', () => { @@ -59,7 +85,16 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--basic + name: Basic + parameters: + __isArgsStory: false + __id: foo-bar--basic + `); }); it('exclude stories', () => { @@ -72,7 +107,16 @@ describe('CsfFile', () => { export const C = () => {}; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + excludeStories: + - B + - C + stories: + - id: foo-bar--a + name: A + `); }); it('include stories', () => { @@ -84,7 +128,15 @@ describe('CsfFile', () => { export const IncludeA = () => {}; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + includeStories: + - IncludeA + stories: + - id: foo-bar--include-a + name: Include A + `); }); it('storyName annotation', () => { @@ -96,7 +148,13 @@ describe('CsfFile', () => { A.storyName = 'Some story'; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: Some story + `); }); it('no title', () => { @@ -108,7 +166,16 @@ describe('CsfFile', () => { export const B = () => {}; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + component: '''foo''' + title: Default Title + stories: + - id: default-title--a + name: A + - id: default-title--b + name: B + `); }); it('custom component id', () => { @@ -120,7 +187,16 @@ describe('CsfFile', () => { export const B = () => {}; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + id: custom-id + stories: + - id: custom-id--a + name: A + - id: custom-id--b + name: B + `); }); it('custom parameters.__id', () => { @@ -132,7 +208,16 @@ describe('CsfFile', () => { export const CustomParemetersId = { parameters: { __id: 'custom-id' } }; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + id: custom-meta-id + stories: + - id: custom-meta-id--just-custom-meta-id + name: Just Custom Meta Id + - id: custom-id + name: Custom Paremeters Id + `); }); it('typescript', () => { @@ -146,7 +231,15 @@ describe('CsfFile', () => { export const B: StoryFn = () => <>B; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar/baz + stories: + - id: foo-bar-baz--a + name: A + - id: foo-bar-baz--b + name: B + `); }); it('typescript satisfies', () => { @@ -161,7 +254,21 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: AA + parameters: + __isArgsStory: true + __id: foo-bar--a + - id: foo-bar--b + name: B + parameters: + __isArgsStory: true + __id: foo-bar--b + `); }); it('typescript as', () => { @@ -176,7 +283,21 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: AA + parameters: + __isArgsStory: true + __id: foo-bar--a + - id: foo-bar--b + name: B + parameters: + __isArgsStory: true + __id: foo-bar--b + `); }); it('typescript meta var', () => { @@ -191,7 +312,15 @@ describe('CsfFile', () => { export const B: StoryFn = () => <>B; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar/baz + stories: + - id: foo-bar-baz--a + name: A + - id: foo-bar-baz--b + name: B + `); }); it('typescript satisfies meta var', () => { @@ -206,7 +335,15 @@ describe('CsfFile', () => { export const B: StoryFn = () => <>B; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar/baz + stories: + - id: foo-bar-baz--a + name: A + - id: foo-bar-baz--b + name: B + `); }); it('component object', () => { @@ -218,7 +355,16 @@ describe('CsfFile', () => { export const B = () => {}; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + component: '{}' + title: Default Title + stories: + - id: default-title--a + name: A + - id: default-title--b + name: B + `); }); it('template bind', () => { @@ -232,7 +378,16 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + parameters: + __isArgsStory: true + __id: foo-bar--a + `); }); it('meta variable', () => { @@ -245,7 +400,16 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + parameters: + __isArgsStory: false + __id: foo-bar--a + `); }); it('docs-only story', () => { @@ -258,7 +422,17 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--page + name: Page + parameters: + __isArgsStory: false + __id: foo-bar--page + docsOnly: true + `); }); it('docs-only story with local vars', () => { @@ -274,7 +448,21 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + tags: + - stories-mdx + includeStories: + - __page + stories: + - id: foo-bar--page + name: Page + parameters: + __isArgsStory: false + __id: foo-bar--page + docsOnly: true + `); }); it('title variable', () => { @@ -288,7 +476,21 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + parameters: + __isArgsStory: false + __id: foo-bar--a + - id: foo-bar--b + name: B + parameters: + __isArgsStory: true + __id: foo-bar--b + `); }); it('re-exported stories', () => { @@ -300,7 +502,15 @@ describe('CsfFile', () => { export { B } from './B'; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + - id: foo-bar--b + name: B + `); }); it('named exports order', () => { @@ -314,7 +524,21 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--b + name: B + parameters: + __isArgsStory: true + __id: foo-bar--b + - id: foo-bar--a + name: A + parameters: + __isArgsStory: false + __id: foo-bar--a + `); }); it('as default export', () => { @@ -330,7 +554,15 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + parameters: + __id: foo-bar--a + `); }); it('support for parameter decorators', () => { @@ -353,7 +585,11 @@ describe('CsfFile', () => { title: 'Chip', } `) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: Chip + stories: [] + `); }); }); @@ -429,7 +665,15 @@ describe('CsfFile', () => { export function B() {} ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + - id: foo-bar--b + name: B + `); }); }); @@ -488,7 +732,16 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + parameters: + __isArgsStory: false + __id: foo-bar--a + `); }); it('Object export with args render', () => { @@ -502,7 +755,16 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + parameters: + __isArgsStory: true + __id: foo-bar--a + `); }); it('Object export with default render', () => { @@ -514,7 +776,16 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: A + parameters: + __isArgsStory: true + __id: foo-bar--a + `); }); it('Object export with name', () => { @@ -528,7 +799,16 @@ describe('CsfFile', () => { `, true ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + stories: + - id: foo-bar--a + name: Apple + parameters: + __isArgsStory: true + __id: foo-bar--a + `); }); it('Object export with storyName', () => { @@ -559,7 +839,10 @@ describe('CsfFile', () => { export default { title: 'foo/bar', x: 1, y: 2 }; `; const csf = loadCsf(input, { makeTitle }).parse(); - expect(csf.imports).toMatchInlineSnapshot(`./Button,./Check`); + expect(csf.imports).toMatchInlineSnapshot(` + - ./Button + - ./Check + `); }); // eslint-disable-next-line jest/no-disabled-tests it.skip('dynamic imports', () => { @@ -591,7 +874,17 @@ describe('CsfFile', () => { A.tags = ['Y']; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + tags: + - X + stories: + - id: foo-bar--a + name: A + tags: + - 'Y' + `); }); it('csf3', () => { @@ -605,7 +898,17 @@ describe('CsfFile', () => { }; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + tags: + - X + stories: + - id: foo-bar--a + name: A + tags: + - 'Y' + `); }); it('variables', () => { @@ -621,7 +924,17 @@ describe('CsfFile', () => { }; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + tags: + - X + stories: + - id: foo-bar--a + name: A + tags: + - 'Y' + `); }); it('array error', () => { @@ -662,7 +975,18 @@ describe('CsfFile', () => { A.tags = ['Y']; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + tags: + - X + stories: + - id: foo-bar--a + name: A + tags: + - 'Y' + - play-fn + `); }); it('story csf3', () => { @@ -677,7 +1001,18 @@ describe('CsfFile', () => { }; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + tags: + - X + stories: + - id: foo-bar--a + name: A + tags: + - 'Y' + - play-fn + `); }); it('meta csf2', () => { @@ -691,7 +1026,18 @@ describe('CsfFile', () => { }; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + tags: + - X + - play-fn + stories: + - id: foo-bar--a + name: A + tags: + - 'Y' + `); }); it('meta csf3', () => { @@ -703,7 +1049,18 @@ describe('CsfFile', () => { A.tags = ['Y']; ` ) - ).toMatchInlineSnapshot(`'[object Object]'`); + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + tags: + - X + - play-fn + stories: + - id: foo-bar--a + name: A + tags: + - 'Y' + `); }); }); @@ -730,7 +1087,30 @@ describe('CsfFile', () => { { makeTitle, fileName: 'foo/bar.stories.js' } ).parse(); - expect(indexInputs).toMatchInlineSnapshot(`'[object Object],[object Object]'`); + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + exportName: A + name: A + title: custom foo title + metaId: component-id + tags: + - component-tag + - story-tag + - play-fn + __id: component-id--a + - type: story + importPath: foo/bar.stories.js + exportName: B + name: B + title: custom foo title + metaId: component-id + tags: + - component-tag + - story-tag + - play-fn + __id: component-id--b + `); }); it('supports custom parameters.__id', () => { @@ -749,7 +1129,17 @@ describe('CsfFile', () => { { makeTitle, fileName: 'foo/bar.stories.js' } ).parse(); - expect(indexInputs).toMatchInlineSnapshot(`'[object Object]'`); + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + exportName: A + name: A + title: custom foo title + metaId: component-id + tags: + - component-tag + __id: custom-story-id + `); }); it('removes duplicate tags', () => { @@ -767,7 +1157,20 @@ describe('CsfFile', () => { { makeTitle, fileName: 'foo/bar.stories.js' } ).parse(); - expect(indexInputs).toMatchInlineSnapshot(`'[object Object]'`); + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + exportName: A + name: A + title: custom foo title + tags: + - component-tag + - component-tag-dup + - inherit-tag-dup + - story-tag + - story-tag-dup + __id: custom-foo-title--a + `); }); it('throws if getting indexInputs without filename option', () => { @@ -786,13 +1189,9 @@ describe('CsfFile', () => { ).parse(); expect(() => csf.indexInputs).toThrowErrorMatchingInlineSnapshot(` - >- - Error: Cannot automatically create index inputs with CsfFile.indexInputs - because the CsfFile instance was created without a the fileName option. - - Either add the fileName option when creating the CsfFile instance, or create - the index inputs manually. -`); + [Error: Cannot automatically create index inputs with CsfFile.indexInputs because the CsfFile instance was created without a the fileName option. + Either add the fileName option when creating the CsfFile instance, or create the index inputs manually.] + `); }); }); }); diff --git a/code/package.json b/code/package.json index 6c3ff4745889..74611f227eda 100644 --- a/code/package.json +++ b/code/package.json @@ -308,5 +308,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "8.0.0-alpha.6" } diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index beccc0f8a1f6..58c06c654a51 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -51,6 +51,7 @@ "@storybook/global": "^5.0.0", "@storybook/preview-api": "workspace:*", "@storybook/types": "workspace:*", + "@vue/compiler-core": "^3.0.0", "lodash": "^4.17.21", "ts-dedent": "^2.0.0", "type-fest": "~2.19", @@ -60,13 +61,11 @@ "@digitak/esrun": "^3.2.2", "@types/prettier": "2.7.2", "@vitejs/plugin-vue": "^4.4.0", - "@vue/compiler-core": "^3.3.4", "typescript": "^5.3.2", "vue": "^3.2.47", "vue-tsc": "latest" }, "peerDependencies": { - "@vue/compiler-core": "^3.0.0", "vue": "^3.0.0" }, "engines": { diff --git a/code/yarn.lock b/code/yarn.lock index 6fe3d551d312..1a55377378c9 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6764,7 +6764,7 @@ __metadata: "@storybook/types": "workspace:*" "@types/prettier": "npm:2.7.2" "@vitejs/plugin-vue": "npm:^4.4.0" - "@vue/compiler-core": "npm:^3.3.4" + "@vue/compiler-core": "npm:^3.0.0" lodash: "npm:^4.17.21" ts-dedent: "npm:^2.0.0" type-fest: "npm:~2.19" @@ -6773,7 +6773,6 @@ __metadata: vue-component-type-helpers: "npm:latest" vue-tsc: "npm:latest" peerDependencies: - "@vue/compiler-core": ^3.0.0 vue: ^3.0.0 languageName: unknown linkType: soft @@ -8712,7 +8711,7 @@ __metadata: languageName: node linkType: hard -"@vue/compiler-core@npm:3.3.11, @vue/compiler-core@npm:^3.3.4": +"@vue/compiler-core@npm:3.3.11": version: 3.3.11 resolution: "@vue/compiler-core@npm:3.3.11" dependencies: @@ -8724,6 +8723,18 @@ __metadata: languageName: node linkType: hard +"@vue/compiler-core@npm:^3.0.0": + version: 3.3.13 + resolution: "@vue/compiler-core@npm:3.3.13" + dependencies: + "@babel/parser": "npm:^7.23.5" + "@vue/shared": "npm:3.3.13" + estree-walker: "npm:^2.0.2" + source-map-js: "npm:^1.0.2" + checksum: d0544ef5c12adb1f25523349dfb5468ee59928892c8476c491b66806840ab7de7a2c15b943ae3805dc8adcfd1a88435db08b97a0d23977eafe7e448a2a001754 + languageName: node + linkType: hard + "@vue/compiler-dom@npm:3.0.0": version: 3.0.0 resolution: "@vue/compiler-dom@npm:3.0.0" @@ -8928,6 +8939,13 @@ __metadata: languageName: node linkType: hard +"@vue/shared@npm:3.3.13": + version: 3.3.13 + resolution: "@vue/shared@npm:3.3.13" + checksum: 8f49e0ee51f7f1edce16aa7a97b5a7a36d8cf36dfd03c9dba194b6eb0e9685eb71335f0a2b17af17753b742fa2346f96ec371a3c0a56677a4e7eeb0f13426a56 + languageName: node + linkType: hard + "@vue/typescript@npm:1.8.15": version: 1.8.15 resolution: "@vue/typescript@npm:1.8.15" diff --git a/docs/api/main-config-build.md b/docs/api/main-config-build.md index a206662bae4a..e9c4c5adc001 100644 --- a/docs/api/main-config-build.md +++ b/docs/api/main-config-build.md @@ -25,11 +25,11 @@ Type: `TestBuildFlags` } ``` -Configures Storybook's production builds for performance testing purposes by disabling certain features from the build. When running ' build-storybook ', this feature is enabled by setting the `--test` [flag](./cli-options.md#build). +Configures Storybook's production builds for performance testing purposes by disabling certain features from the build. When running `build-storybook`, this feature is enabled by setting the `--test` [flag](./cli-options.md#build). -Enabling these features can cause build or runtime errors with Storybook. We recommend enabling only the features you need for your project. +The options documented on this page are automatically enabled when the `--test` flag is provided to the `build-storybook` command. We encourage you to override these options only if you need to disable a specific feature for your project or if you are debugging a build issue. diff --git a/docs/snippets/common/main-config-test-disable-autodocs.js.mdx b/docs/snippets/common/main-config-test-disable-autodocs.js.mdx index 86b7de8fb7b3..006903bad2ea 100644 --- a/docs/snippets/common/main-config-test-disable-autodocs.js.mdx +++ b/docs/snippets/common/main-config-test-disable-autodocs.js.mdx @@ -7,7 +7,7 @@ export default { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableAutoDocs: true, + disableAutoDocs: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-autodocs.ts.mdx b/docs/snippets/common/main-config-test-disable-autodocs.ts.mdx index 1eb9e7218197..4a1bd49e9bd1 100644 --- a/docs/snippets/common/main-config-test-disable-autodocs.ts.mdx +++ b/docs/snippets/common/main-config-test-disable-autodocs.ts.mdx @@ -9,7 +9,7 @@ const config: StorybookConfig = { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableAutoDocs: true, + disableAutoDocs: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-blocks.js.mdx b/docs/snippets/common/main-config-test-disable-blocks.js.mdx index 9b4aa8c9a478..2ebd0640731d 100644 --- a/docs/snippets/common/main-config-test-disable-blocks.js.mdx +++ b/docs/snippets/common/main-config-test-disable-blocks.js.mdx @@ -7,7 +7,7 @@ export default { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableBlocks: true, + disableBlocks: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-blocks.ts.mdx b/docs/snippets/common/main-config-test-disable-blocks.ts.mdx index 0cb4b4235bba..1a647bf092ec 100644 --- a/docs/snippets/common/main-config-test-disable-blocks.ts.mdx +++ b/docs/snippets/common/main-config-test-disable-blocks.ts.mdx @@ -9,7 +9,7 @@ const config: StorybookConfig = { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableBlocks: true, + disableBlocks: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-docgen.js.mdx b/docs/snippets/common/main-config-test-disable-docgen.js.mdx index ffe4bdc2f866..38d822c83bef 100644 --- a/docs/snippets/common/main-config-test-disable-docgen.js.mdx +++ b/docs/snippets/common/main-config-test-disable-docgen.js.mdx @@ -7,7 +7,7 @@ export default { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableDocgen: true, + disableDocgen: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-docgen.ts.mdx b/docs/snippets/common/main-config-test-disable-docgen.ts.mdx index 1d0eb3c10d9d..ed1df8facc77 100644 --- a/docs/snippets/common/main-config-test-disable-docgen.ts.mdx +++ b/docs/snippets/common/main-config-test-disable-docgen.ts.mdx @@ -9,7 +9,7 @@ const config: StorybookConfig = { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableDocgen: true, + disableDocgen: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-mdx.js.mdx b/docs/snippets/common/main-config-test-disable-mdx.js.mdx index f6204594c1ef..133f34d570bb 100644 --- a/docs/snippets/common/main-config-test-disable-mdx.js.mdx +++ b/docs/snippets/common/main-config-test-disable-mdx.js.mdx @@ -7,7 +7,7 @@ export default { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableMDXEntries: true, + disableMDXEntries: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-mdx.ts.mdx b/docs/snippets/common/main-config-test-disable-mdx.ts.mdx index e5327602aed8..5c364f466658 100644 --- a/docs/snippets/common/main-config-test-disable-mdx.ts.mdx +++ b/docs/snippets/common/main-config-test-disable-mdx.ts.mdx @@ -9,7 +9,7 @@ const config: StorybookConfig = { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableMDXEntries: true, + disableMDXEntries: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-sourcemaps.js.mdx b/docs/snippets/common/main-config-test-disable-sourcemaps.js.mdx index 9207b9317099..8e2772ca1f1f 100644 --- a/docs/snippets/common/main-config-test-disable-sourcemaps.js.mdx +++ b/docs/snippets/common/main-config-test-disable-sourcemaps.js.mdx @@ -7,7 +7,7 @@ export default { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableSourcemaps: true, + disableSourcemaps: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-sourcemaps.ts.mdx b/docs/snippets/common/main-config-test-disable-sourcemaps.ts.mdx index 79b0abab693d..2fa419b94976 100644 --- a/docs/snippets/common/main-config-test-disable-sourcemaps.ts.mdx +++ b/docs/snippets/common/main-config-test-disable-sourcemaps.ts.mdx @@ -9,7 +9,7 @@ const config: StorybookConfig = { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableSourcemaps: true, + disableSourcemaps: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-treeshaking.js.mdx b/docs/snippets/common/main-config-test-disable-treeshaking.js.mdx index f0957f7e5536..cbf3c7a29eaf 100644 --- a/docs/snippets/common/main-config-test-disable-treeshaking.js.mdx +++ b/docs/snippets/common/main-config-test-disable-treeshaking.js.mdx @@ -7,7 +7,7 @@ export default { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableTreeShaking: true, + disableTreeShaking: false, }, }, }; diff --git a/docs/snippets/common/main-config-test-disable-treeshaking.ts.mdx b/docs/snippets/common/main-config-test-disable-treeshaking.ts.mdx index b053cfa03435..eccb38910d1f 100644 --- a/docs/snippets/common/main-config-test-disable-treeshaking.ts.mdx +++ b/docs/snippets/common/main-config-test-disable-treeshaking.ts.mdx @@ -9,7 +9,7 @@ const config: StorybookConfig = { stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], build: { test: { - disableTreeShaking: true, + disableTreeShaking: false, }, }, }; diff --git a/docs/versions/next.json b/docs/versions/next.json index 5244617df4d6..9731c646282b 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"8.0.0-alpha.5","info":{"plain":"- Core: Remove the `-s` flag from build & dev - [#25266](https://github.com/storybookjs/storybook/pull/25266), thanks [@ndelangen](https://github.com/ndelangen)!\n- Core: Skip no-framework error when ignorePreview=true - [#25286](https://github.com/storybookjs/storybook/pull/25286), thanks [@ndelangen](https://github.com/ndelangen)!\n- Core: Unique outputDir/cacheDir for each configDir - [#25264](https://github.com/storybookjs/storybook/pull/25264), thanks [@ndelangen](https://github.com/ndelangen)!\n- Dependencies: Semver dependency fixes - [#25283](https://github.com/storybookjs/storybook/pull/25283), thanks [@ndelangen](https://github.com/ndelangen)!\n- NextJS: Mock out `server-only` package for RSC - [#25263](https://github.com/storybookjs/storybook/pull/25263), thanks [@shilman](https://github.com/shilman)!"}} +{"version":"8.0.0-alpha.6","info":{"plain":"- NextJS: Autoconfigure public directory for new projects - [#25279](https://github.com/storybookjs/storybook/pull/25279), thanks [@shilman](https://github.com/shilman)!\n- Vite: Fix pre-transform error in Vite 5 - [#25329](https://github.com/storybookjs/storybook/pull/25329), thanks [@yannbf](https://github.com/yannbf)!\n- Vue3: Fix pnp by making compiler-core a dependency - [#25311](https://github.com/storybookjs/storybook/pull/25311), thanks [@shilman](https://github.com/shilman)!"}}