diff --git a/.circleci/config.yml b/.circleci/config.yml index c71bbbbae66b..72adc93ef564 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ parameters: default: "skipped" executors: - sb_node_16_classic: + sb_node_18_classic: parameters: class: description: The Resource class @@ -21,7 +21,7 @@ executors: environment: NODE_OPTIONS: --max_old_space_size=6144 resource_class: <> - sb_node_16_browsers: + sb_node_18_browsers: parameters: class: description: The Resource class @@ -99,7 +99,7 @@ jobs: pretty-docs: executor: class: medium - name: sb_node_16_classic + name: sb_node_18_classic steps: - git-shallow-clone/checkout_advanced: clone_options: "--depth 1 --verbose" @@ -125,7 +125,7 @@ jobs: build: executor: class: xlarge - name: sb_node_16_classic + name: sb_node_18_classic steps: - git-shallow-clone/checkout_advanced: clone_options: "--depth 1 --verbose" @@ -169,7 +169,7 @@ jobs: lint: executor: class: large - name: sb_node_16_classic + name: sb_node_18_classic steps: - git-shallow-clone/checkout_advanced: clone_options: "--depth 1 --verbose" @@ -185,7 +185,7 @@ jobs: check: executor: class: xlarge - name: sb_node_16_classic + name: sb_node_18_classic steps: - git-shallow-clone/checkout_advanced: clone_options: "--depth 1 --verbose" @@ -202,7 +202,7 @@ jobs: - report-workflow-on-failure - cancel-workflow-on-failure script-checks: - executor: sb_node_16_browsers + executor: sb_node_18_browsers steps: - git-shallow-clone/checkout_advanced: clone_options: "--depth 1 --verbose" @@ -230,7 +230,7 @@ jobs: unit-tests: executor: class: xlarge - name: sb_node_16_browsers + name: sb_node_18_browsers steps: - git-shallow-clone/checkout_advanced: clone_options: "--depth 1 --verbose" @@ -252,7 +252,7 @@ jobs: coverage: executor: class: small - name: sb_node_16_browsers + name: sb_node_18_browsers steps: - git-shallow-clone/checkout_advanced: clone_options: "--depth 1 --verbose" @@ -263,7 +263,7 @@ jobs: chromatic-internal-storybooks: executor: class: medium+ - name: sb_node_16_browsers + name: sb_node_18_browsers environment: NODE_OPTIONS: --max_old_space_size=6144 steps: @@ -287,13 +287,16 @@ jobs: type: integer executor: class: medium - name: sb_node_16_browsers + name: sb_node_18_browsers parallelism: << parameters.parallelism >> steps: - git-shallow-clone/checkout_advanced: clone_options: "--depth 1 --verbose" - attach_workspace: at: . + - run: + name: Enable Corepack + command: sudo corepack enable yarn - run: name: Creating Sandboxes command: yarn task --task sandbox --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task sandbox) --no-link --start-from=never --junit @@ -311,7 +314,7 @@ jobs: type: integer executor: class: medium - name: sb_node_16_browsers + name: sb_node_18_browsers parallelism: << parameters.parallelism >> steps: - git-shallow-clone/checkout_advanced: @@ -331,7 +334,7 @@ jobs: type: integer executor: class: large - name: sb_node_16_browsers + name: sb_node_18_browsers parallelism: << parameters.parallelism >> steps: - git-shallow-clone/checkout_advanced: @@ -410,7 +413,7 @@ jobs: type: integer executor: class: medium - name: sb_node_16_browsers + name: sb_node_18_browsers parallelism: << parameters.parallelism >> steps: - checkout @@ -493,7 +496,7 @@ jobs: test-empty-init: executor: class: medium - name: sb_node_16_browsers + name: sb_node_18_browsers parameters: packageManager: type: string diff --git a/.github/workflows/prepare-non-patch-release.yml b/.github/workflows/prepare-non-patch-release.yml index 3cbf8f8b1fc9..c495114d461e 100644 --- a/.github/workflows/prepare-non-patch-release.yml +++ b/.github/workflows/prepare-non-patch-release.yml @@ -113,10 +113,6 @@ jobs: run: | yarn release:version --deferred --release-type ${{ inputs.release-type || 'prerelease' }} ${{ inputs.pre-id && format('{0} {1}', '--pre-id', inputs.pre-id) || '' }} --verbose - - name: Check release vs prerelease - id: is-prerelease - run: yarn release:is-prerelease ${{ steps.bump-version.outputs.next-version }} --verbose - - name: Write changelog env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -133,19 +129,6 @@ jobs: git commit -m "Write changelog for ${{ steps.bump-version.outputs.next-version }} [skip ci]" || true git push --force origin version-non-patch-from-${{ steps.bump-version.outputs.current-version }} - - name: Resolve merge-conflicts with base branch - if: steps.is-prerelease.outputs.prerelease == 'false' - working-directory: . - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config pull.rebase false - git pull --no-commit --no-ff origin latest-release || true - git checkout --ours . - git add . - git commit --no-verify -m "Merge latest-release into version-non-patch-from-${{ steps.bump-version.outputs.current-version }} with conflicts resolved to ours [skip ci]" - git push origin version-non-patch-from-${{ steps.bump-version.outputs.current-version }} - - name: Generate PR description id: description env: @@ -162,14 +145,13 @@ jobs: gh pr edit \ --repo "${{github.repository }}" \ --title "Release: $CAPITALIZED_RELEASE_TYPE ${{ inputs.pre-id && format('{0} ', inputs.pre-id) }}${{ steps.bump-version.outputs.next-version }}" \ - --base ${{ steps.is-prerelease.outputs.prerelease == 'true' && 'next-release' || 'latest-release' }} \ --body "${{ steps.description.outputs.description }}" else gh pr create \ --repo "${{github.repository }}"\ --title "Release: $CAPITALIZED_RELEASE_TYPE ${{ inputs.pre-id && format('{0} ', inputs.pre-id) }}${{ steps.bump-version.outputs.next-version }}" \ --label "release" \ - --base ${{ steps.is-prerelease.outputs.prerelease == 'true' && 'next-release' || 'latest-release' }} \ + --base next-release \ --head version-non-patch-from-${{ steps.bump-version.outputs.current-version }} \ --body "${{ steps.description.outputs.description }}" fi diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8aa7928748bc..61566b49d5bb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -154,6 +154,14 @@ jobs: git merge ${{ github.ref_name }} git push origin ${{ steps.target.outputs.target }} + - name: Force push from 'next' to 'latest-release' and 'main' on minor/major releases + if: github.ref_name == 'next-release' && steps.is-prerelease.outputs.prerelease == 'false' + run: | + git checkout next + git pull + git push --force origin latest-release + git push --force origin main + - name: Sync CHANGELOG.md from `main` to `next` if: steps.target.outputs.target == 'main' working-directory: . diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fdbefeb9821..66d87cccc4c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 8.1.3 + +- Angular: Support v18 - [#27237](https://github.com/storybookjs/storybook/pull/27237), thanks @valentinpalkovic! +- Telemetry: Add test packages - [#27226](https://github.com/storybookjs/storybook/pull/27226), thanks @shilman! + +## 8.1.2 + +- Angular: Fix filtering of workspace config styles - [#27108](https://github.com/storybookjs/storybook/pull/27108), thanks @valentinpalkovic! +- Next.js: Avoid interfering with the svgr loader - [#27198](https://github.com/storybookjs/storybook/pull/27198), thanks @seanparmelee! + ## 8.1.1 - Docgen: Only add react-docgen info when a component is defined in the file - [#26967](https://github.com/storybookjs/storybook/pull/26967), thanks @glenjamin! diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index 11b40449bfff..c989504cf696 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,18 @@ +## 8.2.0-alpha.3 + +- Addon-A11y: Fix property default assignment - [#27224](https://github.com/storybookjs/storybook/pull/27224), thanks @valentinpalkovic! +- Angular: Revert style adjustments - [#27361](https://github.com/storybookjs/storybook/pull/27361), thanks @valentinpalkovic! +- Angular: Support v18 - [#27237](https://github.com/storybookjs/storybook/pull/27237), thanks @valentinpalkovic! +- Controls: Fix date picker control validation and assignment - [#26695](https://github.com/storybookjs/storybook/pull/26695), thanks @leeovictor! +- Next.js: Avoid interfering with the svgr loader - [#27198](https://github.com/storybookjs/storybook/pull/27198), thanks @seanparmelee! +- Svelte: Support latest prerelease - [#27378](https://github.com/storybookjs/storybook/pull/27378), thanks @valentinpalkovic! +- Tags: Fix composition with older storybooks - [#27358](https://github.com/storybookjs/storybook/pull/27358), thanks @shilman! +- Telemetry: Add test packages - [#27226](https://github.com/storybookjs/storybook/pull/27226), thanks @shilman! +- Types: Fix type implementation for `CompatibleString` - [#27180](https://github.com/storybookjs/storybook/pull/27180), thanks @sni-J! +- Vite: Fix HMR issue for Storybook preview files - [#27256](https://github.com/storybookjs/storybook/pull/27256), thanks @valentinpalkovic! +- Vite: Fix asset warning by externalizing sb-common-assets font - [#27110](https://github.com/storybookjs/storybook/pull/27110), thanks @valentinpalkovic! +- Webpack5/Vite: Fix sourcemaps - [#27171](https://github.com/storybookjs/storybook/pull/27171), thanks @valentinpalkovic! + ## 8.2.0-alpha.2 - Angular: Cleanup types - [#27189](https://github.com/storybookjs/storybook/pull/27189), thanks @valentinpalkovic! diff --git a/code/addons/a11y/src/a11yRunner.ts b/code/addons/a11y/src/a11yRunner.ts index ec33803558c3..82a851b89b05 100644 --- a/code/addons/a11y/src/a11yRunner.ts +++ b/code/addons/a11y/src/a11yRunner.ts @@ -17,9 +17,9 @@ const defaultParameters = { config: {}, options: {} }; * Handle A11yContext events. * Because the event are sent without manual check, we split calls */ -const handleRequest = async (storyId: string, input: A11yParameters = defaultParameters) => { +const handleRequest = async (storyId: string, input: A11yParameters | null) => { if (!input?.manual) { - await run(storyId, input); + await run(storyId, input ?? defaultParameters); } }; diff --git a/code/builders/builder-manager/templates/template.ejs b/code/builders/builder-manager/templates/template.ejs index af42859a0791..c1fa9310acd4 100644 --- a/code/builders/builder-manager/templates/template.ejs +++ b/code/builders/builder-manager/templates/template.ejs @@ -11,21 +11,39 @@ <% } else if (favicon.endsWith('.ico')) { %> <% } %> - - - + diff --git a/code/builders/builder-vite/input/iframe.html b/code/builders/builder-vite/input/iframe.html index 7720ef6b9482..23c280c02242 100644 --- a/code/builders/builder-vite/input/iframe.html +++ b/code/builders/builder-vite/input/iframe.html @@ -6,35 +6,39 @@ Storybook - - - - - + - + diff --git a/code/renderers/svelte/src/components/SlotDecorator.svelte b/code/renderers/svelte/src/components/SlotDecorator.svelte index 9de64db04c3d..cf5849113a25 100644 --- a/code/renderers/svelte/src/components/SlotDecorator.svelte +++ b/code/renderers/svelte/src/components/SlotDecorator.svelte @@ -1,6 +1,7 @@
{finalText}
diff --git a/code/renderers/svelte/template/stories/args.stories.js b/code/renderers/svelte/template/stories/args.stories.js index 71544066ecd1..c272310cb131 100644 --- a/code/renderers/svelte/template/stories/args.stories.js +++ b/code/renderers/svelte/template/stories/args.stories.js @@ -23,7 +23,10 @@ export const RemountOnResetStoryArgs = { await expect(button).toHaveTextContent('You clicked: 0'); await userEvent.click(button); - await expect(button).toHaveTextContent('You clicked: 1'); + + await waitFor(async () => { + await expect(button).toHaveTextContent('You clicked: 1'); + }); await step("Update story args with { text: 'Changed' }", async () => { await channel.emit(UPDATE_STORY_ARGS, { storyId: id, updatedArgs: { text: 'Changed' } }); diff --git a/code/ui/blocks/src/blocks/Story.stories.tsx b/code/ui/blocks/src/blocks/Story.stories.tsx index b3f8108feb23..6dcd2bfa9fb7 100644 --- a/code/ui/blocks/src/blocks/Story.stories.tsx +++ b/code/ui/blocks/src/blocks/Story.stories.tsx @@ -171,6 +171,9 @@ export const WithInteractionsAutoplayInParameters: Story = { export const ForceInitialArgs: Story = { ...StoryComponentStories.ForceInitialArgs, + parameters: { + chromatic: { disableSnapshot: true }, + }, args: { of: ButtonStories.Primary, storyExport: ButtonStories.Primary, diff --git a/code/ui/blocks/src/blocks/external/ExternalPreview.ts b/code/ui/blocks/src/blocks/external/ExternalPreview.ts index bb6fc24764f2..203ac14ee3a0 100644 --- a/code/ui/blocks/src/blocks/external/ExternalPreview.ts +++ b/code/ui/blocks/src/blocks/external/ExternalPreview.ts @@ -31,7 +31,7 @@ export class ExternalPreview extends Prev private titles = new ConstantMap('title-'); - private storyIndex: StoryIndex = { v: 4, entries: {} }; + private storyIndex: StoryIndex = { v: 5, entries: {} }; private moduleExportsByImportPath: Record = {}; diff --git a/code/ui/blocks/src/components/Story.stories.tsx b/code/ui/blocks/src/components/Story.stories.tsx index fa1767d747af..b393a7e4614d 100644 --- a/code/ui/blocks/src/components/Story.stories.tsx +++ b/code/ui/blocks/src/components/Story.stories.tsx @@ -82,6 +82,9 @@ export const ForceInitialArgs = { forceInitialArgs: true, renderStoryToElement, }, + parameters: { + chromatic: { disableSnapshot: true }, + }, // test that it ignores updated args by emitting an arg update and assert that it isn't reflected in the DOM play: async ({ args, canvasElement, loaded }: PlayFunctionContext) => { const docsContext = loaded.docsContext as DocsContextProps; diff --git a/code/ui/blocks/src/controls/Date.tsx b/code/ui/blocks/src/controls/Date.tsx index 53eedf56c50c..938fc8c8c33b 100644 --- a/code/ui/blocks/src/controls/Date.tsx +++ b/code/ui/blocks/src/controls/Date.tsx @@ -74,15 +74,16 @@ export const DateControl: FC = ({ name, value, onChange, onFocus, onB useEffect(() => { if (valid !== false) { if (dateRef && dateRef.current) { - dateRef.current.value = formatDate(value); + dateRef.current.value = value ? formatDate(value) : ''; } if (timeRef && timeRef.current) { - timeRef.current.value = formatTime(value); + timeRef.current.value = value ? formatTime(value) : ''; } } }, [value]); const onDateChange = (e: ChangeEvent) => { + if (!e.target.value) return onChange(); const parsed = parseDate(e.target.value); const result = new Date(value); result.setFullYear(parsed.getFullYear(), parsed.getMonth(), parsed.getDate()); @@ -92,6 +93,7 @@ export const DateControl: FC = ({ name, value, onChange, onFocus, onB }; const onTimeChange = (e: ChangeEvent) => { + if (!e.target.value) return onChange(); const parsed = parseTime(e.target.value); const result = new Date(value); result.setHours(parsed.getHours()); diff --git a/code/ui/blocks/src/controls/types.ts b/code/ui/blocks/src/controls/types.ts index 26460ff6184c..4da8dc198977 100644 --- a/code/ui/blocks/src/controls/types.ts +++ b/code/ui/blocks/src/controls/types.ts @@ -5,7 +5,7 @@ export interface ControlProps { value?: T; defaultValue?: T; argType?: ArgType; - onChange: (value: T) => T | void; + onChange: (value?: T) => T | void; onFocus?: (evt: any) => void; onBlur?: (evt: any) => void; } diff --git a/code/ui/manager/static/fonts.css b/code/ui/manager/static/fonts.css deleted file mode 100644 index 90050cc0bffa..000000000000 --- a/code/ui/manager/static/fonts.css +++ /dev/null @@ -1,31 +0,0 @@ -@font-face { - font-family: 'Nunito Sans'; - font-style: normal; - font-weight: 400; - font-display: swap; - src: url('./nunito-sans-regular.woff2') format('woff2'); -} - -@font-face { - font-family: 'Nunito Sans'; - font-style: italic; - font-weight: 400; - font-display: swap; - src: url('./nunito-sans-italic.woff2') format('woff2'); -} - -@font-face { - font-family: 'Nunito Sans'; - font-style: normal; - font-weight: 700; - font-display: swap; - src: url('./nunito-sans-bold.woff2') format('woff2'); -} - -@font-face { - font-family: 'Nunito Sans'; - font-style: italic; - font-weight: 700; - font-display: swap; - src: url('./nunito-sans-bold-italic.woff2') format('woff2'); -} diff --git a/code/yarn.lock b/code/yarn.lock index f12c511b2380..16d76a138946 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5537,17 +5537,17 @@ __metadata: webpack: "npm:5" zone.js: "npm:^0.14.2" peerDependencies: - "@angular-devkit/architect": ">=0.1500.0 < 0.1800.0" - "@angular-devkit/build-angular": ">=15.0.0 < 18.0.0" - "@angular-devkit/core": ">=15.0.0 < 18.0.0" - "@angular/cli": ">=15.0.0 < 18.0.0" - "@angular/common": ">=15.0.0 < 18.0.0" - "@angular/compiler": ">=15.0.0 < 18.0.0" - "@angular/compiler-cli": ">=15.0.0 < 18.0.0" - "@angular/core": ">=15.0.0 < 18.0.0" - "@angular/forms": ">=15.0.0 < 18.0.0" - "@angular/platform-browser": ">=15.0.0 < 18.0.0" - "@angular/platform-browser-dynamic": ">=15.0.0 < 18.0.0" + "@angular-devkit/architect": ">=0.1500.0 < 0.1900.0" + "@angular-devkit/build-angular": ">=15.0.0 < 19.0.0" + "@angular-devkit/core": ">=15.0.0 < 19.0.0" + "@angular/cli": ">=15.0.0 < 19.0.0" + "@angular/common": ">=15.0.0 < 19.0.0" + "@angular/compiler": ">=15.0.0 < 19.0.0" + "@angular/compiler-cli": ">=15.0.0 < 19.0.0" + "@angular/core": ">=15.0.0 < 19.0.0" + "@angular/forms": ">=15.0.0 < 19.0.0" + "@angular/platform-browser": ">=15.0.0 < 19.0.0" + "@angular/platform-browser-dynamic": ">=15.0.0 < 19.0.0" rxjs: ^6.0.0 || ^7.4.0 typescript: ^4.0.0 || ^5.0.0 zone.js: ">= 0.11.1 < 1.0.0" @@ -6811,7 +6811,6 @@ __metadata: "@storybook/svelte-webpack5": "workspace:*" "@storybook/telemetry": "workspace:*" "@storybook/test": "workspace:*" - "@storybook/testing-library": "npm:next" "@storybook/theming": "workspace:*" "@storybook/types": "workspace:*" "@storybook/vue3": "workspace:*" @@ -7081,17 +7080,6 @@ __metadata: languageName: unknown linkType: soft -"@storybook/testing-library@npm:next": - version: 0.2.2-next.0 - resolution: "@storybook/testing-library@npm:0.2.2-next.0" - dependencies: - "@testing-library/dom": "npm:^9.0.0" - "@testing-library/user-event": "npm:^14.4.0" - ts-dedent: "npm:^2.2.0" - checksum: 10c0/4350e73776cba8ab5037ee9a8b07b957c73540873f64097648ed96b93f086469eab475ad19b917e5e2eee4faec67891fa443d703b9b4aa28efc9a74243970a4e - languageName: node - linkType: hard - "@storybook/theming@workspace:*, @storybook/theming@workspace:lib/theming": version: 0.0.0-use.local resolution: "@storybook/theming@workspace:lib/theming" @@ -7483,7 +7471,7 @@ __metadata: languageName: node linkType: hard -"@testing-library/user-event@npm:^14.4.0, @testing-library/user-event@npm:^14.4.3, @testing-library/user-event@npm:^14.5.2": +"@testing-library/user-event@npm:^14.4.3, @testing-library/user-event@npm:^14.5.2": version: 14.5.2 resolution: "@testing-library/user-event@npm:14.5.2" peerDependencies: diff --git a/docs/configure/telemetry.md b/docs/configure/telemetry.md index ff3298ac86fd..291fa53e18d3 100644 --- a/docs/configure/telemetry.md +++ b/docs/configure/telemetry.md @@ -35,6 +35,7 @@ Specifically, we track the following information in our telemetry events: - Builder (e.g., Webpack5, Vite). - Meta framework (e.g., [Next](https://nextjs.org/), [Gatsby](https://www.gatsbyjs.com/), [CRA](https://create-react-app.dev/)). - [Addons](https://storybook.js.org/integrations) (e.g., [Essentials](../essentials/index.md), [Accessibility](https://storybook.js.org/addons/@storybook/addon-a11y/)). + - Testing tools (e.g. [Jest](https://jestjs.io/), [Vitest](https://vitest.dev/), [Playwright](https://playwright.dev/)). - Package manager information (e.g., `npm`, `yarn`). - Monorepo information (e.g., [NX](https://nx.dev/), [Turborepo](https://turborepo.org/)). - In-app events (e.g., [Storybook guided tour](https://github.com/storybookjs/addon-onboarding)). diff --git a/docs/contribute/RFC.md b/docs/contribute/RFC.md index 96b93158d07d..ecb3283b0946 100644 --- a/docs/contribute/RFC.md +++ b/docs/contribute/RFC.md @@ -32,7 +32,7 @@ _Details matter_: RFCs that do not present convincing motivation, demonstrate a RFCs tend to remain in this stage for a while, giving the community and core team members time to weigh in. During this period, the author of an RFC should be prepared to revise the proposal, integrate feedback, and build consensus. RFCs that have broad support are much more likely to make progress than those that don't receive any comments. -Every Monday at 11 a.m. (EST), the Storybook core team conducts a weekly triage meeting to review open RFCs as part of the meeting's agenda. The meeting is held in the [Storybook Discord's Watercooler channel](https://discord.com/channels/486522875931656193/486522876388704260). We invite the RFC author(s) and interested members of the community to participate and engage in a more detailed discussion of the RFC. If a core team member deems it necessary, they will be assigned as the "champion" of the RFC. The champion will collaborate with the RFC author and assist them throughout the RFC process. +Every week, the Storybook core team conducts a triage meeting to review open RFCs as part of the meeting's agenda. The event is publicly scheduled in the [Storybook Discord](https://discord.gg/storybook) and held in the [Storybook Discord's Watercooler channel](https://discord.com/channels/486522875931656193/486522876388704260). We invite the RFC author(s) and interested members of the community to participate and engage in a more detailed discussion of the RFC. If a core team member deems it necessary, they will be assigned as the "champion" of the RFC. The champion will collaborate with the RFC author and assist them throughout the RFC process. ### 3. `Status: accepted/rejected` diff --git a/docs/contribute/roadmap.md b/docs/contribute/roadmap.md new file mode 100644 index 000000000000..509f71b07164 --- /dev/null +++ b/docs/contribute/roadmap.md @@ -0,0 +1,43 @@ +--- +title: 'Roadmap' +hideRendererSelector: true +--- + +The Storybook team maintains a [public roadmap](https://github.com/orgs/storybookjs/projects/20/views/1) in the form of a GitHub project. This page explains what's in the roadmap, how to interpret it, and how to contribute to it. + +## What's in the roadmap? + +Each card represents a Storybook project. The columns represent how larger changes make their way from idea to shipped feature. Projects typically start as an [Request for Comment (RFC)](./RFC.md), then evolve into a [tracking issue](https://github.com/storybookjs/storybook/issues?q=is%3Aissue++sort%3Aupdated-desc+label%3ATracking+) once the team has fully scoped what it entails. We ship a Storybook [minor version](https://semver.org/) every eight weeks, and a major version once per year, typically in Feb/Mar. + +### Candidates + +These cards are ideas on our radar that we are considering for the current major release. For example, if `8.0` is the most recent major version, these would be ideas for `8.x` or `9.0`. The ideas in this column are the fuzziest and may come and go depending on our priorities. + +### Under consideration + +These are projects being discussed for the next dev cycle. For example, if the most recent minor version is `8.1`, and we are currently working on `8.2`, the projects in this column would be under consideration for `8.3`. Unlike the candidates column, which can contain any idea, the projects under consideration must be documented with an [RFC](./RFC.md). + +### In progress + +These are projects that we are currently working on. There are two kinds of projects in this column: + +1. **[Tracking issues](https://github.com/storybookjs/storybook/issues?q=is%3Aissue++sort%3Aupdated-desc+label%3ATracking+)**: Fully scoped projects expected to ship in the next minor release. For example, if the most recent minor is `8.1`, these should ship in `8.2`, eight weeks after `8.1`. +2. **Other projects**: Community projects facilitated by the core team and side projects. These don't have an ETA but we will push to have them ready as part of the current major. For example, if `8.0` is the most recent major version, these should ship in `8.x` or `9.0`. + +### Done + +These projects are completed, documented, and released. We follow a "fixed time, variable scope" policy for core projects, which means we scope a project into milestones to provide the most value to users as early as possible and cut scope if necessary to ship on time. If a feature has been scoped out of a project, we might try to fit it into a follow-up project, treat it as general maintenance work, or forget about it. Storybook is open source, so PR contributions are always welcome! + +## Frequently asked questions + +### When will project X be available? + +This roadmap is an estimation, not a commitment. In general, every tracking issue "in progress" should be available in the next two months. Everything else on the board has a decent chance of getting into the next major release. For example, if `8.0` is the most recent major release, we will try to ship everything on the board as part of `8.x` or `9.0`. If we don't think a project is likely for the next major, we will kick it off the board. + +### What about issue Y or discussion Z? + +The Storybook core team and our community members continuously contribute bug fix bugs and smaller product improvements. The projects here are larger chunks of work. In some cases they may close out certain issues, and when possible we will call those out in the RFC or project tracking issue. + +### How do I get something onto the board? + +If there's a significant product improvement that you want to see, and there is currently an issue or an [RFC](./RFC.md) for it, upvote that issue/discussion, and comment on it with more information about your need or use case if it's not currently captured. If you don't see anything that's quite right, please feel free to [submit an RFC](https://github.com/storybookjs/storybook/discussions/new?category=rfc). We prioritize based on a combination of user/contributor interest (upvotes, comments, [Discord](https://discord.gg/storybook) conversations, etc.) and our own strategic ambitions for the project. diff --git a/docs/snippets/angular/msw-addon-configure-handlers-graphql.ts.mdx b/docs/snippets/angular/msw-addon-configure-handlers-graphql.ts.mdx index 23599c6494de..cfbd8a0cb731 100644 --- a/docs/snippets/angular/msw-addon-configure-handlers-graphql.ts.mdx +++ b/docs/snippets/angular/msw-addon-configure-handlers-graphql.ts.mdx @@ -57,7 +57,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ graphql.query('AllInfoQuery', () => { - return new HttpResponse.json({ + return HttpResponse.json({ data: { allInfo: { ...TestData, @@ -76,7 +76,7 @@ export const MockedError: Story = { handlers: [ graphql.query('AllInfoQuery', async () => { await delay(800); - return new HttpResponse.json({ + return HttpResponse.json({ errors: [ { message: 'Access denied', diff --git a/docs/snippets/angular/msw-addon-configure-handlers-http.ts.mdx b/docs/snippets/angular/msw-addon-configure-handlers-http.ts.mdx index 820857b94b48..8ba674db76b5 100644 --- a/docs/snippets/angular/msw-addon-configure-handlers-http.ts.mdx +++ b/docs/snippets/angular/msw-addon-configure-handlers-http.ts.mdx @@ -43,7 +43,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ http.get('https://your-restful-endpoint/', () => { - return new HttpResponse.json(TestData); + return HttpResponse.json(TestData); }), ], }, diff --git a/docs/snippets/common/ghp-github-action.yml.mdx b/docs/snippets/common/ghp-github-action.yml.mdx index d4c9b83a6bb5..6efff5954e66 100644 --- a/docs/snippets/common/ghp-github-action.yml.mdx +++ b/docs/snippets/common/ghp-github-action.yml.mdx @@ -30,7 +30,7 @@ jobs: node-version: '16.x' #👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow - - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.1 + - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 with: install_command: yarn install # default: npm ci build_command: yarn build-storybook # default: npm run build-storybook diff --git a/docs/snippets/common/msw-addon-configure-handlers-http.js.mdx b/docs/snippets/common/msw-addon-configure-handlers-http.js.mdx index cd2138c50a0f..8311b919f53f 100644 --- a/docs/snippets/common/msw-addon-configure-handlers-http.js.mdx +++ b/docs/snippets/common/msw-addon-configure-handlers-http.js.mdx @@ -38,7 +38,7 @@ export const MockedSuccess = { msw: { handlers: [ http.get('https://your-restful-endpoint/', () => { - return new HttpResponse.json(TestData); + return HttpResponse.json(TestData); }), ], }, diff --git a/docs/snippets/common/msw-addon-configure-handlers-http.ts-4-9.mdx b/docs/snippets/common/msw-addon-configure-handlers-http.ts-4-9.mdx index 663a9fd0f1f2..fe6490665088 100644 --- a/docs/snippets/common/msw-addon-configure-handlers-http.ts-4-9.mdx +++ b/docs/snippets/common/msw-addon-configure-handlers-http.ts-4-9.mdx @@ -44,7 +44,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ http.get('https://your-restful-endpoint/', () => { - return new HttpResponse.json(TestData); + return HttpResponse.json(TestData); }), ], }, diff --git a/docs/snippets/common/msw-addon-configure-handlers-http.ts.mdx b/docs/snippets/common/msw-addon-configure-handlers-http.ts.mdx index 26d7ffaae623..935fef3b2ca4 100644 --- a/docs/snippets/common/msw-addon-configure-handlers-http.ts.mdx +++ b/docs/snippets/common/msw-addon-configure-handlers-http.ts.mdx @@ -44,7 +44,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ http.get('https://your-restful-endpoint/', () => { - return new HttpResponse.json(TestData); + return HttpResponse.json(TestData); }), ], }, diff --git a/docs/snippets/react/button-story-with-args.ts-4-9.mdx b/docs/snippets/react/button-story-with-args.ts-4-9.mdx index 32e4ac97662a..ddf531e2e8a8 100644 --- a/docs/snippets/react/button-story-with-args.ts-4-9.mdx +++ b/docs/snippets/react/button-story-with-args.ts-4-9.mdx @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { Button, ButtonProps } from './Button'; +import { Button } from './Button'; const meta = { component: Button, diff --git a/docs/snippets/react/button-story-with-args.ts.mdx b/docs/snippets/react/button-story-with-args.ts.mdx index 3464a9dc5c27..bc92ada612e2 100644 --- a/docs/snippets/react/button-story-with-args.ts.mdx +++ b/docs/snippets/react/button-story-with-args.ts.mdx @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { Button, ButtonProps } from './Button'; +import { Button } from './Button'; const meta: Meta = { component: Button, diff --git a/docs/snippets/react/msw-addon-configure-handlers-graphql.js.mdx b/docs/snippets/react/msw-addon-configure-handlers-graphql.js.mdx index b7964e2d4925..f8aa36d87880 100644 --- a/docs/snippets/react/msw-addon-configure-handlers-graphql.js.mdx +++ b/docs/snippets/react/msw-addon-configure-handlers-graphql.js.mdx @@ -61,7 +61,7 @@ export const MockedSuccess = { msw: { handlers: [ graphql.query('AllInfoQuery', () => { - return new HttpResponse.json({ + return HttpResponse.json({ data: { allInfo: { ...TestData, @@ -80,7 +80,7 @@ export const MockedError = { handlers: [ graphql.query('AllInfoQuery', async () => { await delay(800); - return new HttpResponse.json({ + return HttpResponse.json({ errors: [ { message: 'Access denied', diff --git a/docs/snippets/react/msw-addon-configure-handlers-graphql.ts-4-9.mdx b/docs/snippets/react/msw-addon-configure-handlers-graphql.ts-4-9.mdx index ab5786361bba..5d1047b2a30a 100644 --- a/docs/snippets/react/msw-addon-configure-handlers-graphql.ts-4-9.mdx +++ b/docs/snippets/react/msw-addon-configure-handlers-graphql.ts-4-9.mdx @@ -65,7 +65,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ graphql.query('AllInfoQuery', () => { - return new HttpResponse.json({ + return HttpResponse.json({ data: { allInfo: { ...TestData, @@ -84,7 +84,7 @@ export const MockedError: Story = { handlers: [ graphql.query('AllInfoQuery', async () => { await delay(800); - return new HttpResponse.json({ + return HttpResponse.json({ errors: [ { message: 'Access denied', diff --git a/docs/snippets/react/msw-addon-configure-handlers-graphql.ts.mdx b/docs/snippets/react/msw-addon-configure-handlers-graphql.ts.mdx index 4ffb616b0c66..7e28c12fb043 100644 --- a/docs/snippets/react/msw-addon-configure-handlers-graphql.ts.mdx +++ b/docs/snippets/react/msw-addon-configure-handlers-graphql.ts.mdx @@ -65,7 +65,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ graphql.query('AllInfoQuery', () => { - return new HttpResponse.json({ + return HttpResponse.json({ data: { allInfo: { ...TestData, @@ -84,7 +84,7 @@ export const MockedError: Story = { handlers: [ graphql.query('AllInfoQuery', async () => { await delay(800); - return new HttpResponse.json({ + return HttpResponse.json({ errors: [ { message: 'Access denied', diff --git a/docs/snippets/svelte/msw-addon-configure-handlers-graphql.js.mdx b/docs/snippets/svelte/msw-addon-configure-handlers-graphql.js.mdx index 6c9974f74e53..72ab24c05d6f 100644 --- a/docs/snippets/svelte/msw-addon-configure-handlers-graphql.js.mdx +++ b/docs/snippets/svelte/msw-addon-configure-handlers-graphql.js.mdx @@ -40,7 +40,7 @@ export const MockedSuccess = { msw: { handlers: [ graphql.query('AllInfoQuery', () => { - return new HttpResponse.json({ + return HttpResponse.json({ data: { allInfo: { ...TestData, @@ -59,7 +59,7 @@ export const MockedError = { handlers: [ graphql.query('AllInfoQuery', async () => { await delay(800); - return new HttpResponse.json({ + return HttpResponse.json({ errors: [ { message: 'Access denied', diff --git a/docs/snippets/svelte/msw-addon-configure-handlers-graphql.ts-4-9.mdx b/docs/snippets/svelte/msw-addon-configure-handlers-graphql.ts-4-9.mdx index a099095c28f8..440b47dc992d 100644 --- a/docs/snippets/svelte/msw-addon-configure-handlers-graphql.ts-4-9.mdx +++ b/docs/snippets/svelte/msw-addon-configure-handlers-graphql.ts-4-9.mdx @@ -45,7 +45,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ graphql.query('AllInfoQuery', () => { - return new HttpResponse.json({ + return HttpResponse.json({ data: { allInfo: { ...TestData, @@ -64,7 +64,7 @@ export const MockedError: Story = { handlers: [ graphql.query('AllInfoQuery', async () => { await delay(800); - return new HttpResponse.json({ + return HttpResponse.json({ errors: [ { message: 'Access denied', diff --git a/docs/snippets/svelte/msw-addon-configure-handlers-graphql.ts.mdx b/docs/snippets/svelte/msw-addon-configure-handlers-graphql.ts.mdx index cc9fef5e7cb9..a186c5183bf2 100644 --- a/docs/snippets/svelte/msw-addon-configure-handlers-graphql.ts.mdx +++ b/docs/snippets/svelte/msw-addon-configure-handlers-graphql.ts.mdx @@ -45,7 +45,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ graphql.query('AllInfoQuery', () => { - return new HttpResponse.json({ + return HttpResponse.json({ data: { allInfo: { ...TestData, @@ -64,7 +64,7 @@ export const MockedError: Story = { handlers: [ graphql.query('AllInfoQuery', async () => { await delay(800); - return new HttpResponse.json({ + return HttpResponse.json({ errors: [ { message: 'Access denied', diff --git a/docs/snippets/vue/msw-addon-configure-handlers-graphql.js.mdx b/docs/snippets/vue/msw-addon-configure-handlers-graphql.js.mdx index 137d1b9a37c4..407903cf95c4 100644 --- a/docs/snippets/vue/msw-addon-configure-handlers-graphql.js.mdx +++ b/docs/snippets/vue/msw-addon-configure-handlers-graphql.js.mdx @@ -43,7 +43,7 @@ export const MockedSuccess = { msw: { handlers: [ graphql.query('AllInfoQuery', () => { - return new HttpResponse.json({ + return HttpResponse.json({ data: { allInfo: { ...TestData, @@ -62,7 +62,7 @@ export const MockedError = { handlers: [ graphql.query('AllInfoQuery', async () => { await delay(800); - return new HttpResponse.json({ + return HttpResponse.json({ errors: [ { message: 'Access denied', diff --git a/docs/snippets/vue/msw-addon-configure-handlers-graphql.ts-4-9.mdx b/docs/snippets/vue/msw-addon-configure-handlers-graphql.ts-4-9.mdx index 701fc8dddd30..b85e3d507999 100644 --- a/docs/snippets/vue/msw-addon-configure-handlers-graphql.ts-4-9.mdx +++ b/docs/snippets/vue/msw-addon-configure-handlers-graphql.ts-4-9.mdx @@ -48,7 +48,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ graphql.query('AllInfoQuery', () => { - return new HttpResponse.json({ + return HttpResponse.json({ data: { allInfo: { ...TestData, @@ -67,7 +67,7 @@ export const MockedError: Story = { handlers: [ graphql.query('AllInfoQuery', async () => { await delay(800); - return new HttpResponse.json({ + return HttpResponse.json({ errors: [ { message: 'Access denied', diff --git a/docs/snippets/vue/msw-addon-configure-handlers-graphql.ts.mdx b/docs/snippets/vue/msw-addon-configure-handlers-graphql.ts.mdx index da7551e9474c..56559de2b65a 100644 --- a/docs/snippets/vue/msw-addon-configure-handlers-graphql.ts.mdx +++ b/docs/snippets/vue/msw-addon-configure-handlers-graphql.ts.mdx @@ -48,7 +48,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ graphql.query('AllInfoQuery', () => { - return new HttpResponse.json({ + return HttpResponse.json({ data: { allInfo: { ...TestData, @@ -67,7 +67,7 @@ export const MockedError: Story = { handlers: [ graphql.query('AllInfoQuery', async () => { await delay(800); - return new HttpResponse.json({ + return HttpResponse.json({ errors: [ { message: 'Access denied', diff --git a/docs/snippets/vue/storybook-preview-use-global-type.3.js.mdx b/docs/snippets/vue/storybook-preview-use-global-type.3.js.mdx index b95a6a0a5d05..d45c79dad770 100644 --- a/docs/snippets/vue/storybook-preview-use-global-type.3.js.mdx +++ b/docs/snippets/vue/storybook-preview-use-global-type.3.js.mdx @@ -1,11 +1,11 @@ ```js // .storybook/preview.js -import { setup } from "@storybook/vue3"; +import { setup } from '@storybook/vue3'; -import { VApp } from "vuetify/components"; +import { VApp } from 'vuetify/components'; -import { registerPlugins } from "../src/plugins"; +import { registerPlugins } from '../src/plugins'; setup((app) => { // Registers your app's plugins including Vuetify into Storybook @@ -15,7 +15,7 @@ setup((app) => { const preview = { decorators: [ (story, context) => { - const theme = context.globals.theme || 'light''; + const theme = context.globals.theme || 'light'; return { components: { story, VApp }, template: ` diff --git a/docs/snippets/vue/storybook-preview-use-global-type.3.ts.mdx b/docs/snippets/vue/storybook-preview-use-global-type.3.ts.mdx index 7486233502f4..7c8816faf8dc 100644 --- a/docs/snippets/vue/storybook-preview-use-global-type.3.ts.mdx +++ b/docs/snippets/vue/storybook-preview-use-global-type.3.ts.mdx @@ -1,12 +1,12 @@ ```ts // .storybook/preview.ts -import type { Preview } from "@storybook/vue3"; -import { setup } from "@storybook/vue3"; +import type { Preview } from '@storybook/vue3'; +import { setup } from '@storybook/vue3'; -import { VApp } from "vuetify/components"; +import { VApp } from 'vuetify/components'; -import { registerPlugins } from "../src/plugins"; +import { registerPlugins } from '../src/plugins'; setup((app) => { // Registers your app's plugins including Vuetify into Storybook @@ -16,7 +16,7 @@ setup((app) => { const preview: Preview = { decorators: [ (story, context) => { - const theme = context.globals.theme || 'light''; + const theme = context.globals.theme || 'light'; return { components: { story, VApp }, template: ` diff --git a/docs/snippets/vue/storybook-preview-use-global-type.ts-4-9.mdx b/docs/snippets/vue/storybook-preview-use-global-type.ts-4-9.mdx index 7486233502f4..7c8816faf8dc 100644 --- a/docs/snippets/vue/storybook-preview-use-global-type.ts-4-9.mdx +++ b/docs/snippets/vue/storybook-preview-use-global-type.ts-4-9.mdx @@ -1,12 +1,12 @@ ```ts // .storybook/preview.ts -import type { Preview } from "@storybook/vue3"; -import { setup } from "@storybook/vue3"; +import type { Preview } from '@storybook/vue3'; +import { setup } from '@storybook/vue3'; -import { VApp } from "vuetify/components"; +import { VApp } from 'vuetify/components'; -import { registerPlugins } from "../src/plugins"; +import { registerPlugins } from '../src/plugins'; setup((app) => { // Registers your app's plugins including Vuetify into Storybook @@ -16,7 +16,7 @@ setup((app) => { const preview: Preview = { decorators: [ (story, context) => { - const theme = context.globals.theme || 'light''; + const theme = context.globals.theme || 'light'; return { components: { story, VApp }, template: ` diff --git a/docs/snippets/web-components/msw-addon-configure-handlers-http.js.mdx b/docs/snippets/web-components/msw-addon-configure-handlers-http.js.mdx index d1c3cda8bc9f..fd212d46c43e 100644 --- a/docs/snippets/web-components/msw-addon-configure-handlers-http.js.mdx +++ b/docs/snippets/web-components/msw-addon-configure-handlers-http.js.mdx @@ -36,7 +36,7 @@ export const MockedSuccess = { msw: { handlers: [ http.get('https://your-restful-endpoint/', () => { - return new HttpResponse.json(TestData); + return HttpResponse.json(TestData); }), ], }, diff --git a/docs/snippets/web-components/msw-addon-configure-handlers-http.ts.mdx b/docs/snippets/web-components/msw-addon-configure-handlers-http.ts.mdx index b12fd8f93a41..f92501a7df63 100644 --- a/docs/snippets/web-components/msw-addon-configure-handlers-http.ts.mdx +++ b/docs/snippets/web-components/msw-addon-configure-handlers-http.ts.mdx @@ -41,7 +41,7 @@ export const MockedSuccess: Story = { msw: { handlers: [ http.get('https://your-restful-endpoint/', () => { - return new HttpResponse.json(TestData); + return HttpResponse.json(TestData); }), ], }, diff --git a/docs/toc.js b/docs/toc.js index 8915f1148f61..86e654d8f8f7 100644 --- a/docs/toc.js +++ b/docs/toc.js @@ -846,6 +846,11 @@ module.exports = { title: 'Reproduce', type: 'link', }, + { + pathSegment: 'roadmap', + title: 'Roadmap', + type: 'link', + }, ], }, { diff --git a/docs/versions/next.json b/docs/versions/next.json index 677eac93350d..79e2866d8d0c 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"8.2.0-alpha.2","info":{"plain":"- Angular: Cleanup types - [#27189](https://github.com/storybookjs/storybook/pull/27189), thanks @valentinpalkovic!\n- Angular: Fix filtering of workspace config styles - [#27108](https://github.com/storybookjs/storybook/pull/27108), thanks @valentinpalkovic!\n- Controls: Fix grouped Radio controls to have the same name - [#23374](https://github.com/storybookjs/storybook/pull/23374), thanks @srapilly!\n- Controls: Throttling makes Color control lagging - [#22615](https://github.com/storybookjs/storybook/pull/22615), thanks @gitstart!\n- Docs: Fix `Typeset` Doc block `fontSizes` type - [#26475](https://github.com/storybookjs/storybook/pull/26475), thanks @noranda!"}} +{"version":"8.2.0-alpha.3","info":{"plain":"- Addon-A11y: Fix property default assignment - [#27224](https://github.com/storybookjs/storybook/pull/27224), thanks @valentinpalkovic!\n- Angular: Revert style adjustments - [#27361](https://github.com/storybookjs/storybook/pull/27361), thanks @valentinpalkovic!\n- Angular: Support v18 - [#27237](https://github.com/storybookjs/storybook/pull/27237), thanks @valentinpalkovic!\n- Controls: Fix date picker control validation and assignment - [#26695](https://github.com/storybookjs/storybook/pull/26695), thanks @leeovictor!\n- Next.js: Avoid interfering with the svgr loader - [#27198](https://github.com/storybookjs/storybook/pull/27198), thanks @seanparmelee!\n- Svelte: Support latest prerelease - [#27378](https://github.com/storybookjs/storybook/pull/27378), thanks @valentinpalkovic!\n- Tags: Fix composition with older storybooks - [#27358](https://github.com/storybookjs/storybook/pull/27358), thanks @shilman!\n- Telemetry: Add test packages - [#27226](https://github.com/storybookjs/storybook/pull/27226), thanks @shilman!\n- Types: Fix type implementation for `CompatibleString` - [#27180](https://github.com/storybookjs/storybook/pull/27180), thanks @sni-J!\n- Vite: Fix HMR issue for Storybook preview files - [#27256](https://github.com/storybookjs/storybook/pull/27256), thanks @valentinpalkovic!\n- Vite: Fix asset warning by externalizing sb-common-assets font - [#27110](https://github.com/storybookjs/storybook/pull/27110), thanks @valentinpalkovic!\n- Webpack5/Vite: Fix sourcemaps - [#27171](https://github.com/storybookjs/storybook/pull/27171), thanks @valentinpalkovic!"}} diff --git a/docs/writing-tests/test-runner.md b/docs/writing-tests/test-runner.md index 6a39b2362ad3..759111e8ad9d 100644 --- a/docs/writing-tests/test-runner.md +++ b/docs/writing-tests/test-runner.md @@ -94,6 +94,7 @@ If you're already using any of those flags in your project, you should be able t | `--url` | Define the URL to run tests in. Useful for custom Storybook URLs
`test-storybook --url http://the-storybook-url-here.com` | | `--browsers` | Define browsers to run tests in. One or multiple of: chromium, firefox, webkit
`test-storybook --browsers firefox chromium` | | `--maxWorkers [amount]` | Specifies the maximum number of workers the worker-pool will spawn for running tests
`test-storybook --maxWorkers=2` | +| `--testTimeout [amount]` | Defines the maximum time in milliseconds that a test can run before it is automatically marked as failed. Useful for long-running tests
`test-storybook --testTimeout=60000` | | `--no-cache` | Disable the cache
`test-storybook --no-cache` | | `--clearCache` | Deletes the Jest cache directory and then exits without running tests
`test-storybook --clearCache` | | `--verbose` | Display individual test results with the test suite hierarchy
`test-storybook --verbose` | @@ -202,12 +203,12 @@ The test-runner renders a story and executes its [play function](../writing-stor The test-runner exports test hooks that can be overridden globally to enable use cases like visual or DOM snapshots. These hooks give you access to the test lifecycle _before_ and _after_ the story is rendered. Listed below are the available hooks and an overview of how to use them. -| Hook | Description | -| ----------- | ------------------------------------------------------------------------------------------------------------ | -| `prepare` | Prepares the browser for tests
`async prepare({ page, browserContext, testRunnerConfig }) {}` | -| `setup` | Executes once before all the tests run
`setup() {}` | +| Hook | Description | +| ----------- | --------------------------------------------------------------------------------------------------------------- | +| `prepare` | Prepares the browser for tests
`async prepare({ page, browserContext, testRunnerConfig }) {}` | +| `setup` | Executes once before all the tests run
`setup() {}` | | `preVisit` | Executes before a story is initially visited and rendered in the browser
`async preVisit(page, context) {}` | -| `postVisit` | Executes after the story is visited and fully rendered
`async postVisit(page, context) {}` | +| `postVisit` | Executes after the story is visited and fully rendered
`async postVisit(page, context) {}` | diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index bee4513a4326..b80c1d5e734b 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -282,6 +282,23 @@ function addStoriesEntry(mainConfig: ConfigFile, path: string, disableDocs: bool mainConfig.setFieldValue(['stories'], [...stories, entry]); } +// Add refs to older versions of storybook to test out composition +function addRefs(mainConfig: ConfigFile) { + const refs = mainConfig.getFieldValue(['refs']) as Record; + + mainConfig.setFieldValue(['refs'], { + ...refs, + 'storybook@8.0.0': { + title: 'Storybook 8.0.0', + url: 'https://635781f3500dd2c49e189caf-gckybvsekn.chromatic.com/', + }, + 'storybook@7.6.18': { + title: 'Storybook 7.6.18', + url: 'https://635781f3500dd2c49e189caf-oljwjdrftz.chromatic.com/', + }, + } as Record); +} + function getStoriesFolderWithVariant(variant?: string, folder = 'stories') { return variant ? `${folder}_${variant}` : folder; } @@ -352,8 +369,7 @@ export async function addExtraDependencies({ debug: boolean; extraDeps?: string[]; }) { - // web-components doesn't install '@storybook/testing-library' by default - const extraDevDeps = ['@storybook/testing-library@next', '@storybook/test-runner@next']; + const extraDevDeps = ['@storybook/test-runner@next']; if (debug) logger.log('🎁 Adding extra dev deps', extraDevDeps); let packageManager: JsPackageManager; if (!dryRun) { @@ -516,9 +532,14 @@ export const addStories: Task['run'] = async ( await writeConfig(mainConfig); }; -export const extendMain: Task['run'] = async ({ template, sandboxDir }, { disableDocs }) => { +export const extendMain: Task['run'] = async ({ template, sandboxDir, key }, { disableDocs }) => { logger.log('📝 Extending main.js'); const mainConfig = await readMainConfig({ cwd: sandboxDir }); + + if (key === 'react-vite/default-ts') { + addRefs(mainConfig); + } + const templateConfig = template.modifications?.mainConfig || {}; const configToAdd = { ...templateConfig,