diff --git a/.github/workflows/check-release-tasks.yml b/.github/workflows/check-release-tasks.yml deleted file mode 100644 index 4848ae35f07e..000000000000 --- a/.github/workflows/check-release-tasks.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Check release tasks -run-name: 'Check tasks for "${{ github.event.pull_request.title }}" PR' - -on: - pull_request: - types: - - opened - - edited - branches: - - 'latest-release' - - 'next-release' - -jobs: - task-check: - runs-on: ubuntu-latest - steps: - - uses: chromaui/task-completed-checker-action@main - with: - repo-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index d5a8ca655af6..95151155ebbc 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -19,6 +19,7 @@ jobs: prepare-patch-pull-request: name: Prepare patch pull request runs-on: ubuntu-latest + environment: release defaults: run: working-directory: scripts @@ -27,6 +28,7 @@ jobs: uses: actions/checkout@v3 with: ref: main + token: ${{ secrets.GH_TOKEN }} - name: Setup Node.js uses: actions/setup-node@v3 @@ -54,7 +56,7 @@ jobs: id: check-frozen env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: yarn release:is-pr-frozen + run: yarn release:is-pr-frozen --patch - name: Cancel when frozen if: steps.check-frozen.outputs.frozen == 'true' && github.event_name != 'workflow_dispatch' @@ -136,12 +138,13 @@ jobs: if PR_STATE=$(gh pr view --json state --jq .state 2>/dev/null) && [[ -n "$PR_STATE" && "$PR_STATE" == *"OPEN"* ]]; then gh pr edit \ --repo "${{github.repository }}" \ - --title "Bump version on \`main\`: patch from ${{ steps.versions.outputs.current }} to ${{ steps.versions.outputs.next }}" \ + --title "Release: Patch ${{ steps.versions.outputs.next }}" \ --body "${{ steps.description.outputs.description }}" else gh pr create \ --repo "${{github.repository }}" \ - --title "Bump version on \`main\`: patch from ${{ steps.versions.outputs.current }} to ${{ steps.versions.outputs.next }}" \ + --title "Release: Patch ${{ steps.versions.outputs.next }}" \ + --label "maintenance" \ --base latest-release \ --head version-patch-from-${{ steps.versions.outputs.current }} \ --body "${{ steps.description.outputs.description }}" @@ -155,12 +158,13 @@ jobs: if PR_STATE=$(gh pr view --json state --jq .state 2>/dev/null) && [[ -n "$PR_STATE" && "$PR_STATE" == *"OPEN"* ]]; then gh pr edit \ --repo "${{github.repository }}"\ - --title "Merge patches to \`main\`" \ + --title "Release: Merge patches to \`main\` (without version bump)" \ --body "${{ steps.description.outputs.description }}" else gh pr create \ --repo "${{github.repository }}"\ - --title "Merge patches to \`main\`" \ + --title "Release: Merge patches to \`main\` (without version bump)" \ + --label "build" \ --base latest-release \ --head version-patch-from-${{ steps.versions.outputs.current }} \ --body "${{ steps.description.outputs.description }}" diff --git a/.github/workflows/prepare-prerelease.yml b/.github/workflows/prepare-prerelease.yml index 932c4b31f64f..84bb8eaeca73 100644 --- a/.github/workflows/prepare-prerelease.yml +++ b/.github/workflows/prepare-prerelease.yml @@ -37,6 +37,7 @@ jobs: prepare-prerelease-pull-request: name: Prepare prerelease pull request runs-on: ubuntu-latest + environment: release defaults: run: working-directory: scripts @@ -48,6 +49,7 @@ jobs: # this needs to be set to a high enough number that it will contain the last version tag # as of May 2023, the whole repo had 55K commits fetch-depth: 10000 + token: ${{ secrets.GH_TOKEN }} - name: Setup Node.js uses: actions/setup-node@v3 @@ -136,15 +138,18 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + RELEASE_TYPE=${{ inputs.release-type || 'prerelease' }} + CAPITALIZED_RELEASE_TYPE=${RELEASE_TYPE^} if PR_STATE=$(gh pr view --json state --jq .state 2>/dev/null) && [[ -n "$PR_STATE" && "$PR_STATE" == *"OPEN"* ]]; then gh pr edit \ --repo "${{github.repository }}" \ - --title "Bump version on \`next\`: ${{ inputs.release-type || 'prerelease' }} ${{ inputs.pre-id && format('({0})', inputs.pre-id) }} from ${{ steps.bump-version.outputs.current-version }} to ${{ steps.bump-version.outputs.next-version }}" \ + --title "Release: $CAPITALIZED_RELEASE_TYPE ${{ inputs.pre-id && format('{0} ', inputs.pre-id) }}${{ steps.bump-version.outputs.next-version }}" \ --body "${{ steps.description.outputs.description }}" else gh pr create \ --repo "${{github.repository }}"\ - --title "Bump version on \`next\`: ${{ inputs.release-type || 'prerelease' }} ${{ inputs.pre-id && format('({0})', inputs.pre-id) }} from ${{ steps.bump-version.outputs.current-version }} to ${{ steps.bump-version.outputs.next-version }}" \ + --title "Release: $CAPITALIZED_RELEASE_TYPE ${{ inputs.pre-id && format('{0} ', inputs.pre-id) }}${{ steps.bump-version.outputs.next-version }}" \ + --label "maintenance" \ --base next-release \ --head version-prerelease-from-${{ steps.bump-version.outputs.current-version }} \ --body "${{ steps.description.outputs.description }}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c6c92b600c2d..0b8febd540b4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -88,11 +88,11 @@ jobs: # tags are needed to get list of patches to label as picked - name: Fetch git tags - if: github.ref_name == 'main-release' + if: github.ref_name == 'latest-release' run: git fetch --tags origin - name: Label patch PRs as picked - if: github.ref_name == 'main-release' + if: github.ref_name == 'latest-release' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: yarn release:label-patches @@ -119,6 +119,17 @@ jobs: git merge ${{ github.ref_name }} git push origin ${{ steps.target.outputs.target }} + - name: Sync CHANGELOG.md from `main` to `next` + if: github.ref_name == 'latest-release' + run: | + git fetch origin next + git checkout next + git pull + git checkout origin/main ./CHANGELOG.md + git add ./CHANGELOG.md + git commit -m "Update CHANGELOG.md for v${{ steps.version.outputs.current-version }}" + git push origin next + # Force push from next to main if it is not a prerelease, and this release is from next-release # This happens when eg. next has been tracking 7.1.0-alpha.X, and now we want to release 7.1.0 # This will keep release-next, next and main all tracking v7.1.0 diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index a54a57743175..78de059ad4e3 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -9,6 +9,8 @@ on: branches: - next - main + - version-prerelease-from-** + - version-patch-from-** jobs: get-branch: diff --git a/CHANGELOG.md b/CHANGELOG.md index 15c19827be03..940682e25a50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,120 +1,90 @@ -## 7.1.0-alpha.29 (June 6, 2023) +## 7.0.21 -#### Bug Fixes - -- CLI: Fix upgrade notification message [#22933](https://github.com/storybooks/storybook/pull/22933) -- Core: Fix indexing errors by excluding node_modules stories [#22873](https://github.com/storybooks/storybook/pull/22873) +- Angular: Fix 16.1 compatibility - [#23064](https://github.com/storybookjs/storybook/pull/23064), thanks [@ndelangen](https://github.com/ndelangen)! +- Angular: Fix ivy preset - [#23070](https://github.com/storybookjs/storybook/pull/23070), thanks [@ndelangen](https://github.com/ndelangen)! +- CLI: Improve steps in storybook init - [#22502](https://github.com/storybookjs/storybook/pull/22502), thanks [@yannbf](https://github.com/yannbf)! +- CLI: Skip builder selection for react native - [#23042](https://github.com/storybookjs/storybook/pull/23042), thanks [@dannyhw](https://github.com/dannyhw)! +- Core: Fix `builder-manager` adding multiple dashes to relative path - [#22974](https://github.com/storybookjs/storybook/pull/22974), thanks [@MarioCadenas](https://github.com/MarioCadenas)! +- Core: Improve `of={...}` DocBlock error in story index - [#22782](https://github.com/storybookjs/storybook/pull/22782), thanks [@shilman](https://github.com/shilman)! +- Dependencies: Set vue-component-type-helpers to latest - [#23015](https://github.com/storybookjs/storybook/pull/23015), thanks [@ndelangen](https://github.com/ndelangen)! +- Vue3: Fix source decorator to generate correct story code - [#22518](https://github.com/storybookjs/storybook/pull/22518), thanks [@chakAs3](https://github.com/chakAs3)! +- Web-components: Fix custom-elements order of property application - [#19183](https://github.com/storybookjs/storybook/pull/19183), thanks [@sonntag-philipp](https://github.com/sonntag-philipp)! -## 7.1.0-alpha.28 (June 6, 2023) - -#### Bug Fixes - -- Docs: E2E tests for Source block update fix [#22835](https://github.com/storybooks/storybook/pull/22835) -- Docs: Fix Source block snippet updates [#22807](https://github.com/storybooks/storybook/pull/22807) - -## 7.1.0-alpha.27 (June 4, 2023) - -#### Features - -- Webpack: Add option toinify using swc [#22843](https://github.com/storybooks/storybook/pull/22843) +## 7.0.20 (June 8, 2023) #### Bug Fixes - Server: Fix .stories.yml support [#22906](https://github.com/storybooks/storybook/pull/22906) -- Storysource: Fix StyledSyntaxHighlighter to wrap long lines [#22541](https://github.com/storybooks/storybook/pull/22541) +- Docs: Fix Source block snippet updates [#22835](https://github.com/storybooks/storybook/pull/22835) +- Core: Fix indexing errors by excluding node_modules stories [#22873](https://github.com/storybooks/storybook/pull/22873) +- CLI: Fix upgrade notification message [#22933](https://github.com/storybooks/storybook/pull/22933) +- Angular: Add --open/--no-open flag to dev command [#22964](https://github.com/storybooks/storybook/pull/22964) +- Angular: Silence compodoc when running storybook with --quiet [#22957](https://github.com/storybooks/storybook/pull/22957) #### Maintenance -- TS: Migrate @storybook/web-components to strict TS [#22399](https://github.com/storybooks/storybook/pull/22399) -- TS: Migrate @storybook/addon-storyshots-puppeteer to strict TS [#22407](https://github.com/storybooks/storybook/pull/22407) -- TS: Migrate @storybook/addon-jest to strict TS [#22389](https://github.com/storybooks/storybook/pull/22389) -- TS: Migrate @storybook/addon-mdx-gfm to strict TS [#22659](https://github.com/storybooks/storybook/pull/22659) -- TS: Migrate @storybook/addon-storyshots to strict TS [#22487](https://github.com/storybooks/storybook/pull/22487) +- Core: Improve MDX of error in story index [#22782](https://github.com/storybooks/storybook/pull/22782) #### Build -- Error on YN0060 - INCOMPATIBLE_PEER_DEPENDENCY [#22398](https://github.com/storybooks/storybook/pull/22398) -- Build: upgrade yarn [#22855](https://github.com/storybooks/storybook/pull/22855) -- Add CODEOWNERS [#22869](https://github.com/storybooks/storybook/pull/22869) +- Build: Fix the theme output during development [#22841](https://github.com/storybooks/storybook/pull/22841) +- Revert "Docs: E2E tests for Source block update fix" [#22934](https://github.com/storybookjs/storybook/pull/22934) -## 7.1.0-alpha.26 (May 31, 2023) +## 7.0.19 (June 8, 2023) -#### Bug Fixes - -- Addons: Fix `Addon_BaseAnnotations` type [#22771](https://github.com/storybooks/storybook/pull/22771) -- Viewport: Fix viewport menu [#22829](https://github.com/storybooks/storybook/pull/22829) - -#### Maintenance - -- NextJS: Fix types [#22836](https://github.com/storybooks/storybook/pull/22836) -- React: Update babel dependencies to fix sandbox creation [#22824](https://github.com/storybooks/storybook/pull/22824) - -#### Build +Bad release -- Build: sort package json files [#22847](https://github.com/storybooks/storybook/pull/22847) -- Build: cleanup the test-storybooks [#22846](https://github.com/storybooks/storybook/pull/22846) -- Build: fix the theme output during development [#22841](https://github.com/storybooks/storybook/pull/22841) -- Build: move deprecated packages [#22753](https://github.com/storybooks/storybook/pull/22753) -- Build: move builders [#22751](https://github.com/storybooks/storybook/pull/22751) - -## 7.1.0-alpha.25 (May 26, 2023) +## 7.0.18 (May 26, 2023) #### Bug Fixes - Vue3: Fix TS 5.0 compat with vue-component-type-helpers [#22814](https://github.com/storybooks/storybook/pull/22814) +- Vue3: Fix reactive args updates in decorators [#22717](https://github.com/storybooks/storybook/pull/22717) +- Vue3: Revert v7 breaking change, restore reactive v6-compat API [#22692](https://github.com/storybooks/storybook/pull/22692) #### Build -- Build: Fix the local storybook [#22805](https://github.com/storybooks/storybook/pull/22805) - Build: Add more checks to ci:daily workflow [#22815](https://github.com/storybooks/storybook/pull/22815) -- Build: Revert conditional decorator story and downgrade Typescript version [#22812](https://github.com/storybooks/storybook/pull/22812) +- Build: Fix Nextjs E2E tests [#22816](https://github.com/storybooks/storybook/pull/22816) +- Build: Bring back new Vue3 tests to main [#22685](https://github.com/storybooks/storybook/pull/22685) -## 7.1.0-alpha.24 (May 26, 2023) +## 7.0.17 (May 24, 2023) #### Bug Fixes -- Vue3: Fix reactive args updates in decorators [#22717](https://github.com/storybooks/storybook/pull/22717) +- Vite: Fix pnpm support by replacing @storybook/global with `window` [#22709](https://github.com/storybooks/storybook/pull/22709) +- Core: Fix `managerHead` preset in `main.ts` [#22701](https://github.com/storybooks/storybook/pull/22701) -#### Build +## 7.0.16 (May 24, 2023) -- Build: Update Nx to latest version [#22694](https://github.com/storybooks/storybook/pull/22694) +Accidental no-op -## 7.1.0-alpha.23 (May 24, 2023) +## 7.0.15 (May 24, 2023) #### Bug Fixes -- Core: Fix `managerHead` preset in `main.ts` [#22701](https://github.com/storybooks/storybook/pull/22701) +- UI: Fix `.mp3` support for builder-manager [#22699](https://github.com/storybooks/storybook/pull/22699) +- Vite: Fix missing @storybook/global dependency [#22700](https://github.com/storybooks/storybook/pull/22700) +- NextJS: Fix compatibility with Next 13.4.3 [#22697](https://github.com/storybooks/storybook/pull/22697) -## 7.1.0-alpha.22 (May 24, 2023) +## 7.0.14 (May 23, 2023) #### Bug Fixes -- Vite: Fix pnpm support by replacing @storybook/global with `window` [#22709](https://github.com/storybooks/storybook/pull/22709) +- Core: Only connect to serverChannel in development mode [#22575](https://github.com/storybooks/storybook/pull/22575) +- CLI: Fix error parsing on NPM proxy [#22690](https://github.com/storybooks/storybook/pull/22690) -## 7.1.0-alpha.21 (May 23, 2023) +#### Maintenance -#### Features +- Core: Create server channel from window.location [#22055](https://github.com/storybooks/storybook/pull/22055) -- Webpack: Add option to use swc instead of babel [#22075](https://github.com/storybooks/storybook/pull/22075) +## 7.0.13 (May 22, 2023) #### Bug Fixes -- UI: Fix `.mp3` support for builder-manager [#22699](https://github.com/storybooks/storybook/pull/22699) -- CLI: Fix support for BROWSER env var [#21473](https://github.com/storybooks/storybook/pull/21473) -- Vite: Fix missing @storybook/global dependency [#22700](https://github.com/storybooks/storybook/pull/22700) -- Next.js: Fix compatibility with Next 13.4.3 [#22697](https://github.com/storybooks/storybook/pull/22697) -- CLI: Fix error parsing on NPM proxy [#22690](https://github.com/storybooks/storybook/pull/22690) -- Core: Only connect to serverChannel in development mode [#22575](https://github.com/storybooks/storybook/pull/22575) +- Angular: Fix process I/O for compodoc command [#22441](https://github.com/storybooks/storybook/pull/22441) - CLI: Improve error handling when dealing with angular.json files [#22663](https://github.com/storybooks/storybook/pull/22663) - CLI: Skip prompting for eslint plugin with --yes flag [#22651](https://github.com/storybooks/storybook/pull/22651) -- CLI: Fix upgrade to not upgrade nx packages [#22419](https://github.com/storybooks/storybook/pull/22419) -- CLI: Only handle CTRL + C on init event [#22687](https://github.com/storybooks/storybook/pull/22687) -- Angular: Remove console.log [#22671](https://github.com/storybooks/storybook/pull/22671) - -## 7.1.0-alpha.20 (May 20, 2023) - -#### Bug Fixes - - CLI: Account for windows paths when copying templates [#22644](https://github.com/storybooks/storybook/pull/22644) - CLI: Fix pnpm init command [#22635](https://github.com/storybooks/storybook/pull/22635) - UI: Add legacy font formats [#22576](https://github.com/storybooks/storybook/pull/22576) @@ -122,25 +92,23 @@ #### Maintenance +- Angular: Enable unit tests [#22355](https://github.com/storybooks/storybook/pull/22355) - CLI: Reduce installation noise and improve error handling [#22554](https://github.com/storybooks/storybook/pull/22554) -- Actions: Fix type of withActions [#22455](https://github.com/storybooks/storybook/pull/22455) +- CLI: Only handle CTRL + C on init event [#22687](https://github.com/storybooks/storybook/pull/22687) +- CLI: Don't touch nx packages on upgrade [#22419](https://github.com/storybooks/storybook/pull/22419) #### Build -- Build: add discord notification when generating sandboxes fails [#22638](https://github.com/storybooks/storybook/pull/22638) -- Build: set correct ref on sandboxes Github action [#22625](https://github.com/storybooks/storybook/pull/22625) +- Build: Add discord notification when generating sandboxes fails [#22638](https://github.com/storybooks/storybook/pull/22638) +- Build: Set correct ref on sandboxes Github action [#22625](https://github.com/storybooks/storybook/pull/22625) - Build: Fix sandbox generation scripts [#22620](https://github.com/storybooks/storybook/pull/22620) -## 7.1.0-alpha.19 (May 16, 2023) - -#### Bug Fixes - -- Normalize paths exposed to vite-builder's `storybook-stories.js` file [#22327](https://github.com/storybooks/storybook/pull/22327) -## 7.1.0-alpha.18 (May 15, 2023) +## 7.0.12 (May 15, 2023) #### Bug Fixes +- Core: Fix source snippets for stories with mapped args [#22135](https://github.com/storybooks/storybook/pull/22135) - CLI: Fix `getFrameworkPackage` logic [#22559](https://github.com/storybooks/storybook/pull/22559) - CLI: Remove automigrate reference from init command [#22561](https://github.com/storybooks/storybook/pull/22561) @@ -148,69 +116,41 @@ - CLI: Detach automigrate command from storybook init [#22523](https://github.com/storybooks/storybook/pull/22523) -## 7.1.0-alpha.17 (May 12, 2023) +## 7.0.11 (May 12, 2023) #### Bug Fixes +- Toolbars: Fix title behavior in UI [#22496](https://github.com/storybooks/storybook/pull/22496) - CLI: Fix storybook upgrade precheckfailure object [#22517](https://github.com/storybooks/storybook/pull/22517) - CLI: Throw errors instead of rejecting promises [#22515](https://github.com/storybooks/storybook/pull/22515) -- CSF: Expose story id in composeStories [#22471](https://github.com/storybooks/storybook/pull/22471) - CLI: Remove unsupported frameworks/renderers and improve builder detection [#22492](https://github.com/storybooks/storybook/pull/22492) - -## 7.1.0-alpha.16 (May 11, 2023) - -#### Bug Fixes - - Web-components: Fix source decorator to handle document fragments [#22513](https://github.com/storybooks/storybook/pull/22513) -- Angular: Adjust child process I/O for compodoc command [#22441](https://github.com/storybooks/storybook/pull/22441) - Core: Fix windows path error in StoryStore v6 [#22512](https://github.com/storybooks/storybook/pull/22512) - -#### Maintenance - -- CLI: Prompt to force initialization when storybook is detected [#22392](https://github.com/storybooks/storybook/pull/22392) -- UI: Fix css inconsistency in Button and Icon components [#22497](https://github.com/storybooks/storybook/pull/22497) - -#### Build - -- Sandboxes: Pin @vitejs/plugin-react to avoid conflict [#22501](https://github.com/storybooks/storybook/pull/22501) - -## 7.1.0-alpha.15 (May 11, 2023) - -#### Bug Fixes - - CLI: Do not show a migration summary on sb init [#22109](https://github.com/storybooks/storybook/pull/22109) -- Toolbars: Fix title behavior in UI [#22496](https://github.com/storybooks/storybook/pull/22496) - UI: Show current search shortcut in search box sidebar [#21619](https://github.com/storybooks/storybook/pull/21619) -- Measure: Deactivate when switching to Docs mode [#21602](https://github.com/storybooks/storybook/pull/21602) - Outline: Fix additional outline border in docs mode [#21773](https://github.com/storybooks/storybook/pull/21773) +- Measure: Deactivate when switching to Docs mode [#21602](https://github.com/storybooks/storybook/pull/21602) +- CSF: Expose story id in composeStories [#22471](https://github.com/storybooks/storybook/pull/22471) +- CLI: Prompt to force initialization when storybook folder is detected [#22392](https://github.com/storybooks/storybook/pull/22392) +- UI: Fix css inconsistency in Button and Icon components [#22497](https://github.com/storybooks/storybook/pull/22497) -## 7.1.0-alpha.14 (May 9, 2023) +## 7.0.10 (May 9, 2023) #### Bug Fixes -- CLI: Scope styles in sample components from the CLI templates [#22162](https://github.com/storybooks/storybook/pull/22162) - CLI: Fix copyTemplate failures on `init` [#22375](https://github.com/storybooks/storybook/pull/22375) - CLI: Fix server init [#22443](https://github.com/storybooks/storybook/pull/22443) -- Server: Add json indexer [#22460](https://github.com/storybooks/storybook/pull/22460) +- CLI: Scope styles in sample components from the CLI templates [#22162](https://github.com/storybooks/storybook/pull/22162) - React: Use correct default annotations for composeStories [#22308](https://github.com/storybooks/storybook/pull/22308) -- UI: Fix opacity of list-item color [#22074](https://github.com/storybooks/storybook/pull/22074) +- Server: Add json indexer [#22460](https://github.com/storybooks/storybook/pull/22460) +- UI: Fix opacity from list-item color [#22074](https://github.com/storybooks/storybook/pull/22074) #### Maintenance - CLI: Refactor package manager methods to be async [#22401](https://github.com/storybooks/storybook/pull/22401) -- Angular: Improve Error message for angular.json not found [#22377](https://github.com/storybooks/storybook/pull/22377) -- TypeScript: Migrate @storybook/instrumenter to strict TS [#22370](https://github.com/storybooks/storybook/pull/22370) -- TypeScript: Migrate @storybook/core-events to strict TS [#22448](https://github.com/storybooks/storybook/pull/22448) -- TypeScript: Migrate @storybook/core-client to strict TS [#22447](https://github.com/storybooks/storybook/pull/22447) -- TypeScript: Migrate @storybook/react-vite and @storybook/preact-vite to strict TS [#22428](https://github.com/storybooks/storybook/pull/22428) -- TypeScript: Migrate @storybook/svelte-vite to strict TS [#22411](https://github.com/storybooks/storybook/pull/22411) -- TypeScript: Migrate @storybook/types to strict TS [#22397](https://github.com/storybooks/storybook/pull/22397) -- TypeScript: Migrate @storybook/addon-storysource to strict TS [#22367](https://github.com/storybooks/storybook/pull/22367) -- TypeScript: Migrate @storybook/client-api to strict TS [#22421](https://github.com/storybooks/storybook/pull/22421) -- TypeScript: Migrate @storybook/sveltekit to strict TS [#22412](https://github.com/storybooks/storybook/pull/22412) -- TypeScript: Migrate @storybook/source-loader to strict TS [#22420](https://github.com/storybooks/storybook/pull/22420) +- Improve Error message for Angular.json file not found [#22377](https://github.com/storybooks/storybook/pull/22377) -## 7.1.0-alpha.13 (May 5, 2023) +## 7.0.9 (May 5, 2023) #### Bug Fixes @@ -219,201 +159,104 @@ #### Maintenance - Angular: Allow TypeScript 4.0.0 and 5.0.0 [#22391](https://github.com/storybooks/storybook/pull/22391) -- Angular: Enable Angular Unit tests [#22355](https://github.com/storybooks/storybook/pull/22355) -- TypeScript: Migrate @storybook/theming to strict TS [#22376](https://github.com/storybooks/storybook/pull/22376) -- TypeScript: Migrate @storybook/channel-websocket to strict TS [#22364](https://github.com/storybooks/storybook/pull/22364) -- TypeScript: Migrate @storybook/addon-outline to strict TS [#22369](https://github.com/storybooks/storybook/pull/22369) -- TypeScript: Migrate @storybook/addon-viewbook to strict ts [#22339](https://github.com/storybooks/storybook/pull/22339) -- TypeScript: Migrate @storybook/channels to strict TS [#22365](https://github.com/storybooks/storybook/pull/22365) - -#### Build -- Add Angular Prerelease sandbox [#22379](https://github.com/storybooks/storybook/pull/22379) - -## 7.1.0-alpha.12 (May 3, 2023) +## 7.0.8 (May 3, 2023) #### Bug Fixes +- Typescript: Fix bad typings caused by tsup bug [#22261](https://github.com/storybooks/storybook/pull/22261) - Migrate: skip the automigration for gf markdown when user isn't using mdx [#22186](https://github.com/storybooks/storybook/pull/22186) - UI: Addon panel does not update after disabling/enabling an addon [#22258](https://github.com/storybooks/storybook/pull/22258) -- Typescript: Fix bad typings caused by tsup bug [#22261](https://github.com/storybooks/storybook/pull/22261) -- Core: Fix source snippets for stories with mapped args [#22135](https://github.com/storybooks/storybook/pull/22135) - -#### Maintenance - -- Telemetry: Persist sessionId across runs [#22325](https://github.com/storybooks/storybook/pull/22325) -- Packaging: Move `types` condition to the front in all `package.json.exports` maps [#22321](https://github.com/storybooks/storybook/pull/22321) -- Packaging: Don't generate ESM dist for preset files [#22330](https://github.com/storybooks/storybook/pull/22330) -- Typescript: Migrate `@storybook/csf-tools` to strict TS [#22312](https://github.com/storybooks/storybook/pull/22312) -- Typescript: Migrate @storybook/postinstall and @storybook/router to strict TS [#22200](https://github.com/storybooks/storybook/pull/22200) -- Maintenance: Fix urls for all packages in package.json [#22101](https://github.com/storybooks/storybook/pull/22101) -- Docs: Improve component typings [#22050](https://github.com/storybooks/storybook/pull/22050) - -#### Build - -- Build: Comment out flaky test [#22310](https://github.com/storybooks/storybook/pull/22310) -- Build: Migrate `@storybook/web-components-vite` to strict TS [#22309](https://github.com/storybooks/storybook/pull/22309) -- Build: Migrate `@storybook/html-vite` to strict TS [#22293](https://github.com/storybooks/storybook/pull/22293) -- Build: Migrate @storybook/preset-vue-webpack to strict TS [#22320](https://github.com/storybooks/storybook/pull/22320) -- Build: Use `next` branch for sandbox and repro commands [#22238](https://github.com/storybooks/storybook/pull/22238) - -## 7.1.0-alpha.11 (April 28, 2023) - -#### Features - -- Feature: Add support for Angular 16 [#22096](https://github.com/storybooks/storybook/pull/22096) - -#### Bug Fixes - -- Vue3: Rollback v7 breaking change and keep reactive v6-compatible API [#22229](https://github.com/storybooks/storybook/pull/22229) - -#### Maintenance - -- Core: Add tests for mapping behaviour in #22169 [#22301](https://github.com/storybooks/storybook/pull/22301) - -#### Dependency Upgrades - -- Update glob to v10.0.0 [#22171](https://github.com/storybooks/storybook/pull/22171) - -## 7.1.0-alpha.10 (April 28, 2023) - -#### Bug Fixes - - Vue3: Fix compiler error when there is double tag [#22286](https://github.com/storybooks/storybook/pull/22286) -- Args: Fix multiple mapped args return array of labels [#22169](https://github.com/storybooks/storybook/pull/22169) -- Angular: Fix storyshots by removing deprecated import [#22134](https://github.com/storybooks/storybook/pull/22134) -- Ember: Fix wrong path [#22203](https://github.com/storybooks/storybook/pull/22203) +- Args: Fix multiple mapped args return array of labels [#22169](https://github.com/storybooks/storybook/pull/22169) - CLI: Add web-components webpack5 to missing-babelrc automigration [#22202](https://github.com/storybooks/storybook/pull/22202) - Docs: Fix inline story style [#21870](https://github.com/storybooks/storybook/pull/21870) - -#### Build - -- Fix vue-cli/default-js sandbox [#22259](https://github.com/storybooks/storybook/pull/22259) -- Core: Fix `DOCS_RENDERED` test [#22255](https://github.com/storybooks/storybook/pull/22255) -- Add regex to ignore outdated Browserslist in Jest initialization base file [#22260](https://github.com/storybooks/storybook/pull/22260) - -## 7.1.0-alpha.9 (April 26, 2023) - -#### Features - -- NextJS: Allow disabling next/image lazy loading [#21909](https://github.com/storybooks/storybook/pull/21909) -- Core: Allow Flow syntax in stories [#21859](https://github.com/storybooks/storybook/pull/21859) - -#### Bug Fixes - -- Vue3: Support multiple setup functions [#22170](https://github.com/storybooks/storybook/pull/22170) - UI: Fix shift + 7 shortcut to focus search field [#22073](https://github.com/storybooks/storybook/pull/22073) - UI: Fix controls missing when navigating from story [#21967](https://github.com/storybooks/storybook/pull/21967) +- NextJS: Fix tsconfig resolution [#22160](https://github.com/storybooks/storybook/pull/22160) #### Maintenance +- Telemetry: Persist sessionId across runs [#22325](https://github.com/storybooks/storybook/pull/22325) +- Packaging: Move `types` condition to the front in all `package.json.exports` maps [#22321](https://github.com/storybooks/storybook/pull/22321) - Core: Rename manager UI mjs to js [#22247](https://github.com/storybooks/storybook/pull/22247) -- Remove dead code [#22019](https://github.com/storybooks/storybook/pull/22019) -- Vue3: Move TS stories into a separate folder [#22235](https://github.com/storybooks/storybook/pull/22235) - -#### Build - -- Build: Migrate @storybook/addon-docs to strict-ts [#22180](https://github.com/storybooks/storybook/pull/22180) -- Build: Migrate @storybook/highlight to strict TS [#22181](https://github.com/storybooks/storybook/pull/22181) -- Build: Enable strict TS by default [#22143](https://github.com/storybooks/storybook/pull/22143) - -## 7.1.0-alpha.8 (April 24, 2023) - -#### Features +- Angular: Add support for Angular 16 [#22096](https://github.com/storybooks/storybook/pull/22096) +- Packaging: Don't generate ESM dist for preset files [#22330](https://github.com/storybooks/storybook/pull/22330) +- Packaging: Fix url for all packages in package.json [#22101](https://github.com/storybooks/storybook/pull/22101) +- Add regex to ignore outdated Browserslist in Jest initialization base file [#22260](https://github.com/storybooks/storybook/pull/22260) -- Core: Support custom hosts using window.location server channel URL [#22055](https://github.com/storybooks/storybook/pull/22055) +## 7.0.7 (April 24, 2023) #### Bug Fixes +- Core: Pass parameters in `SET_INDEX` for docs entries [#22154](https://github.com/storybooks/storybook/pull/22154) - Addon-actions: Fix ESM by upgrading from uuid-browser to uuid [#22037](https://github.com/storybooks/storybook/pull/22037) - Addon-actions: Fix decorator type [#22175](https://github.com/storybooks/storybook/pull/22175) -- NextJS: Fix tsconfig resolution [#22160](https://github.com/storybooks/storybook/pull/22160) -- Core: Pass parameters in `SET_INDEX` for docs entries [#22154](https://github.com/storybooks/storybook/pull/22154) +- Core: Add new tags to distinguish docs attachment [#22120](https://github.com/storybooks/storybook/pull/22120) +- Core: Restore Docs `useParameter` using `DOCS_PREPARED` [#22118](https://github.com/storybooks/storybook/pull/22118) #### Maintenance - CSF: Improve error message for bad default export [#22190](https://github.com/storybooks/storybook/pull/22190) - CLI: Add addon query-params to list of SB7 incompatible addons [#22095](https://github.com/storybooks/storybook/pull/22095) +- UI: Add remount story shortcut [#21401](https://github.com/storybooks/storybook/pull/21401) #### Build -- Build: Fix sandbox publish script [#22206](https://github.com/storybooks/storybook/pull/22206) - Build: Fix lit sandboxes [#22201](https://github.com/storybooks/storybook/pull/22201) -- Vite sandboxes: use stable Vite 4.3 [#22183](https://github.com/storybooks/storybook/pull/22183) - -## 7.1.0-alpha.7 (April 19, 2023) - -#### Bug Fixes - -- Vue3: Fix reactive decorators [#21954](https://github.com/storybooks/storybook/pull/21954) - -#### Build - -- Build: Improve sandboxes commit message [#22136](https://github.com/storybooks/storybook/pull/22136) +- Build: Fix sandbox publish script [#22206](https://github.com/storybooks/storybook/pull/22206) -## 7.1.0-alpha.6 (April 18, 2023) +## 7.0.6 (April 19, 2023) #### Bug Fixes -- Core: Restore Docs `useParameter` using `DOCS_PREPARED` [#22118](https://github.com/storybooks/storybook/pull/22118) -- Core: Add new tags to distinguish docs attachment [#22120](https://github.com/storybooks/storybook/pull/22120) - Core: Fix `module` guard in non-webpack environments [#22085](https://github.com/storybooks/storybook/pull/22085) -#### Build - -- Build: Skip docs pages e2e tests for ssv6 examples [#22141](https://github.com/storybooks/storybook/pull/22141) -- Build: Upgrade Playwright to 1.32.3 [#22087](https://github.com/storybooks/storybook/pull/22087) - -#### Dependency Upgrades - -- Remove unused babel dependencies [#21984](https://github.com/storybooks/storybook/pull/21984) - -## 7.1.0-alpha.5 (April 17, 2023) - #### Maintenance - CLI: Mark qwik as using addon-interactions [#22000](https://github.com/storybooks/storybook/pull/22000) #### Build -- Revert "Build: Update dangerfile temporarily to check for patch label" [#22108](https://github.com/storybooks/storybook/pull/22108) +- Build: Upgrade Playwright to 1.32.3 [#22087](https://github.com/storybooks/storybook/pull/22087) -## 7.1.0-alpha.4 (April 15, 2023) +## 7.0.5 (April 15, 2023) #### Bug Fixes - Docs: Fix source snippets when parameters.docs.source.type = 'code' [#22048](https://github.com/storybooks/storybook/pull/22048) - CLI: Mention how to setup a monorepo manually in babelrc automigration [#22052](https://github.com/storybooks/storybook/pull/22052) +- UI: Fix upgrade command in about page [#22056](https://github.com/storybooks/storybook/pull/22056) +- CLI: Fix CLI sandbox command [#21977](https://github.com/storybooks/storybook/pull/21977) -## 7.1.0-alpha.3 (April 13, 2023) - -#### Bug Fixes +## 7.0.4 (April 12, 2023) -- UI: Fix upgrade command in about page [#22056](https://github.com/storybooks/storybook/pull/22056) -- CLI: Fix sandbox command [#21977](https://github.com/storybooks/storybook/pull/21977) +Storybook 7.0 is here! 🎉 -## 7.1.0-alpha.2 (April 12, 2023) +- ⚡️ [First-class Vite](https://storybook.js.org/blog/first-class-vite-support-in-storybook/) +- 🔼 [Zero-config NextJS](https://storybook.js.org/blog/integrate-nextjs-and-storybook-automatically/) +- 🇸 [Zero-config SvelteKit](https://storybook.js.org/blog/storybook-for-sveltekit/) +- 🏗️ [Frameworks API](https://storybook.js.org/blog/framework-api/) +- 3️⃣ [Component Story Format v3](https://storybook.js.org/blog/storybook-csf3-is-here/) +- 🛡️ [Improved type safety](https://storybook.js.org/blog/improved-type-safety-in-storybook-7/) +- 📚 [Docs overhaul with MDx2 support](https://storybook.js.org/blog/storybook-7-docs/) +- ☂️ [Code coverage for interaction testing](https://storybook.js.org/blog/code-coverage-with-the-storybook-test-runner/) +- 🖼️ [UI design refresh](https://storybook.js.org/blog/7-0-design-alpha/) +- 🏛️ [Improved stability](https://storybook.js.org/blog/storybook-ecosystem-ci/) -#### Features +7.0 contains hundreds more fixes, features, and tweaks. Browse the changelogs matching `7.0.0-alpha.*`, `7.0.0-beta.*`, and `7.0.0-rc.*` for the full list of changes. -- UI: Add remount story shortcut [#21401](https://github.com/storybooks/storybook/pull/21401) +See our [Migration guide](https://storybook.js.org/migration-guides/7.0) to upgrade from earlier versions of Storybook. #### Bug Fixes - CLI: Catch errors thrown on sanity check of SB installs [#22039](https://github.com/storybooks/storybook/pull/22039) -#### Maintenance +#### Dependency Upgrades - Addon-docs: Remove mdx1-csf as optional peer dep [#22038](https://github.com/storybooks/storybook/pull/22038) -- Telemetry: Add CLI version to context [#21999](https://github.com/storybooks/storybook/pull/21999) -#### Build - -- Build: Use vite@beta on sandboxes [#22030](https://github.com/storybooks/storybook/pull/22030) -- Fix e2e tests failing in Firefox [#22022](https://github.com/storybooks/storybook/pull/22022) -- Vite: Use vite 4.3 beta in sandboxes [#21986](https://github.com/storybooks/storybook/pull/21986) - -## 7.1.0-alpha.1 (April 11, 2023) +## 7.0.3 (April 12, 2023) #### Bug Fixes @@ -422,42 +265,23 @@ - CLI: Fix JsPackageManager typo [#22006](https://github.com/storybooks/storybook/pull/22006) - Viewport: Fix the `defaultOrientation` config option [#21962](https://github.com/storybooks/storybook/pull/21962) - UI: Fix story data access for broken About page [#21951](https://github.com/storybooks/storybook/pull/21951) - -#### Maintenance - -- CLI: Update template code references to 7.0 [#21845](https://github.com/storybooks/storybook/pull/21845) - -#### Dependency Upgrades - -- React-vite: Fix perf regression by pinning vite-plugin-react-docgen-ts [#22013](https://github.com/storybooks/storybook/pull/22013) -- Use future version of satellite repo dependencies [#22026](https://github.com/storybooks/storybook/pull/22026) - -## 7.1.0-alpha.0 (April 5, 2023) - -#### Bug Fixes - - Angular: Fix components disappearing on docs page on property change [#21944](https://github.com/storybooks/storybook/pull/21944) - React: Don't show decorators in JSX snippets [#21907](https://github.com/storybooks/storybook/pull/21907) -- Docs: Include decorators by default in source decorators [#21902](https://github.com/storybooks/storybook/pull/21902) +- Addon-docs: Include decorators by default in source decorators [#21902](https://github.com/storybooks/storybook/pull/21902) - CLI: Fix npm list command [#21947](https://github.com/storybooks/storybook/pull/21947) - Core: Revert Emotion `:first-child` (etc) workarounds [#21213](https://github.com/storybooks/storybook/pull/21213) -- Addon-actions: Fix non-included type file [#21922](https://github.com/storybooks/storybook/pull/21922) -- Addon GFM: Fix node-logger dependency [#21938](https://github.com/storybooks/storybook/pull/21938) -#### Build +#### Maintenance -- Build: Update trigger circle ci workflow to include main [#21888](https://github.com/storybooks/storybook/pull/21888) -- Build: Update dangerfile temporarily to check for patch label [#21945](https://github.com/storybooks/storybook/pull/21945) -- Build: Re-enable Vue2 Vite sandbox [#21940](https://github.com/storybooks/storybook/pull/21940) -- Build: Fix release badge on repros [#21923](https://github.com/storybooks/storybook/pull/21923) -- Build: fix the workflows to generate sandboxes [#21912](https://github.com/storybooks/storybook/pull/21912) -- Build: bump the node version in CI [#21917](https://github.com/storybooks/storybook/pull/21917) -- Build: no `pnp.cjs` in the root, regen lockfiles [#21908](https://github.com/storybooks/storybook/pull/21908) -- Build: remove pnp sandbox template [#21913](https://github.com/storybooks/storybook/pull/21913) -- Build: make the CI config ready for 7.0 release [#21808](https://github.com/storybooks/storybook/pull/21808) +- UI: Add remount story shortcut [#21401](https://github.com/storybooks/storybook/pull/21401) +- Telemetry: Add CLI version to context [#21999](https://github.com/storybooks/storybook/pull/21999) +- CLI: Update template code references to 7.0 [#21845](https://github.com/storybooks/storybook/pull/21845) +- Addon-actions: Fix non-included type file [#21922](https://github.com/storybooks/storybook/pull/21922) +- Addon GFM: Fix node-logger dependency [#21938](https://github.com/storybooks/storybook/pull/21938) #### Dependency Upgrades +- React-vite: Fix perf regression by pinning vite-plugin-react-docgen-ts [#22013](https://github.com/storybooks/storybook/pull/22013) - Update `@emotion/cache` version [#21941](https://github.com/storybooks/storybook/pull/21941) ## 7.0.2 (April 3, 2023) diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index abd6759ded4c..933aef14c663 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,42 @@ +## 7.1.0-alpha.37 + +- Ecosystem: Prebundle node-logger and make it CJS only - [#23109](https://github.com/storybookjs/storybook/pull/23109), thanks [@ndelangen](https://github.com/ndelangen)! +- NextJS: Fix `useParams` support - [#22946](https://github.com/storybookjs/storybook/pull/22946), thanks [@gitstart-storybook](https://github.com/gitstart-storybook)! +- NextJS: Fix fonts not loading with 3+ words in name - [#23121](https://github.com/storybookjs/storybook/pull/23121), thanks [@ygkn](https://github.com/ygkn)! +- Webpack: Fix channel format for loading status - [#23139](https://github.com/storybookjs/storybook/pull/23139), thanks [@ndelangen](https://github.com/ndelangen)! + +## 7.1.0-alpha.36 + +- CLI: Fix "Invalid version null" issues by improved version detection - [#22642](https://github.com/storybookjs/storybook/pull/22642), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- CLI: Prebundle boxen to resolve a ESM/CJS incompatibility - [#23080](https://github.com/storybookjs/storybook/pull/23080), thanks [@ndelangen](https://github.com/ndelangen)! +- Telemetry: Count onboarding stories - [#23092](https://github.com/storybookjs/storybook/pull/23092), thanks [@shilman](https://github.com/shilman)! + +## 7.1.0-alpha.35 + +- CLI: Skip builder selection for react native - [#23042](https://github.com/storybookjs/storybook/pull/23042), thanks [@dannyhw](https://github.com/dannyhw)! +- Core: Fix core-common to use node-fetch - [#23077](https://github.com/storybookjs/storybook/pull/23077), thanks [@ndelangen](https://github.com/ndelangen)! + +## 7.1.0-alpha.34 + +- Angular: Fix ivy preset - [#23070](https://github.com/storybookjs/storybook/pull/23070), thanks [@ndelangen](https://github.com/ndelangen)! +- CLI: Change Button stories layout for React starter templates - [#22951](https://github.com/storybookjs/storybook/pull/22951), thanks [@yannbf](https://github.com/yannbf)! + +## 7.1.0-alpha.33 + +- Bug: Fix for angular 16.1 compatibility - [#23064](https://github.com/storybookjs/storybook/pull/23064), thanks [@ndelangen](https://github.com/ndelangen)! +- Builder-vite: Fix lib/channels dependency - [#23049](https://github.com/storybookjs/storybook/pull/23049), thanks [@ndelangen](https://github.com/ndelangen)! +- CLI: Improve steps in storybook init - [#22502](https://github.com/storybookjs/storybook/pull/22502), thanks [@yannbf](https://github.com/yannbf)! +- CLI: Run `storybook dev` as part of `storybook init` - [#22928](https://github.com/storybookjs/storybook/pull/22928), thanks [@yannbf](https://github.com/yannbf)! +- Core: Merge channels into a single package - [#23032](https://github.com/storybookjs/storybook/pull/23032), thanks [@ndelangen](https://github.com/ndelangen)! +- Core: Unify cache location configurability - [#22079](https://github.com/storybookjs/storybook/pull/22079), thanks [@kubijo](https://github.com/kubijo)! + +## 7.1.0-alpha.32 + +- Build: Remove `babel-core` & upgrade `esbuild` - [#23017](https://github.com/storybookjs/storybook/pull/23017), thanks [@ndelangen](https://github.com/ndelangen)! +- Core: Disable esbuild on files imported from `node_modules` - [#23018](https://github.com/storybookjs/storybook/pull/23018), thanks [@tmeasday](https://github.com/tmeasday)! +- Core: Integrate serverChannel into channel - [#22940](https://github.com/storybookjs/storybook/pull/22940), thanks [@ndelangen](https://github.com/ndelangen)! +- React: Lazy import `react-docgen-typescript-plugin` - [#23019](https://github.com/storybookjs/storybook/pull/23019), thanks [@tmeasday](https://github.com/tmeasday)! + ## 7.1.0-alpha.31 - Dependencies: Set vue-component-type-helpers to latest - [#23015](https://github.com/storybookjs/storybook/pull/23015), thanks [@ndelangen](https://github.com/ndelangen)! diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index b6626f78d6c2..06d723db6352 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", @@ -63,16 +63,16 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addon-highlight": "7.1.0-alpha.31", - "@storybook/channels": "7.1.0-alpha.31", - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", + "@storybook/addon-highlight": "7.1.0-alpha.37", + "@storybook/channels": "7.1.0-alpha.37", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "axe-core": "^4.2.0", "lodash": "^4.17.21", "react-resize-detector": "^7.1.2" @@ -104,7 +104,7 @@ "./src/preview.tsx" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Accessibility", "icon": "https://user-images.githubusercontent.com/263385/101991665-47042f80-3c7c-11eb-8f00-64b5a18f498a.png", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index 3366a7d21343..891482ab4a9d 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", @@ -80,14 +80,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "dequal": "^2.0.2", "lodash": "^4.17.21", "polished": "^4.2.2", @@ -125,7 +125,7 @@ "./src/preview.ts" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Actions", "unsupportedFrameworks": [ diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 77ca072ab973..0960a6ba0228 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", @@ -76,14 +76,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "memoizerific": "^1.11.3", "ts-dedent": "^2.0.0" }, @@ -112,7 +112,7 @@ "./src/preview.tsx" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Backgrounds", "icon": "https://user-images.githubusercontent.com/263385/101991667-479cc600-3c7c-11eb-96d3-410e936252e7.png", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index e84463995d5e..87c1704ec194 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Interact with component inputs dynamically in the Storybook UI", "keywords": [ "addon", @@ -68,15 +68,15 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/blocks": "7.1.0-alpha.31", - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/core-common": "7.1.0-alpha.31", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/node-logger": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/blocks": "7.1.0-alpha.37", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/core-common": "7.1.0-alpha.37", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/node-logger": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "lodash": "^4.17.21", "ts-dedent": "^2.0.0" }, @@ -102,7 +102,7 @@ ], "platform": "browser" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Controls", "icon": "https://user-images.githubusercontent.com/263385/101991669-479cc600-3c7c-11eb-93d9-38b67e8371f2.png", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 2a8e03ad078a..57d26ce3f286 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", @@ -99,19 +99,19 @@ "dependencies": { "@jest/transform": "^29.3.1", "@mdx-js/react": "^2.1.5", - "@storybook/blocks": "7.1.0-alpha.31", - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/csf-plugin": "7.1.0-alpha.31", - "@storybook/csf-tools": "7.1.0-alpha.31", + "@storybook/blocks": "7.1.0-alpha.37", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/csf-plugin": "7.1.0-alpha.37", + "@storybook/csf-tools": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", "@storybook/mdx2-csf": "^1.0.0", - "@storybook/node-logger": "7.1.0-alpha.31", - "@storybook/postinstall": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/react-dom-shim": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/node-logger": "7.1.0-alpha.37", + "@storybook/postinstall": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/react-dom-shim": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "fs-extra": "^11.1.0", "remark-external-links": "^8.0.0", "remark-slug": "^6.0.0", @@ -141,7 +141,7 @@ "@storybook/mdx1-csf" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Docs", "icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index 0383a223b28b..b6c242dbb3ba 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Curated addons to bring out the best of Storybook", "keywords": [ "addon", @@ -119,23 +119,23 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addon-actions": "7.1.0-alpha.31", - "@storybook/addon-backgrounds": "7.1.0-alpha.31", - "@storybook/addon-controls": "7.1.0-alpha.31", - "@storybook/addon-docs": "7.1.0-alpha.31", - "@storybook/addon-highlight": "7.1.0-alpha.31", - "@storybook/addon-measure": "7.1.0-alpha.31", - "@storybook/addon-outline": "7.1.0-alpha.31", - "@storybook/addon-toolbars": "7.1.0-alpha.31", - "@storybook/addon-viewport": "7.1.0-alpha.31", - "@storybook/core-common": "7.1.0-alpha.31", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/node-logger": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", + "@storybook/addon-actions": "7.1.0-alpha.37", + "@storybook/addon-backgrounds": "7.1.0-alpha.37", + "@storybook/addon-controls": "7.1.0-alpha.37", + "@storybook/addon-docs": "7.1.0-alpha.37", + "@storybook/addon-highlight": "7.1.0-alpha.37", + "@storybook/addon-measure": "7.1.0-alpha.37", + "@storybook/addon-outline": "7.1.0-alpha.37", + "@storybook/addon-toolbars": "7.1.0-alpha.37", + "@storybook/addon-viewport": "7.1.0-alpha.37", + "@storybook/core-common": "7.1.0-alpha.37", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/node-logger": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", "ts-dedent": "^2.0.0" }, "devDependencies": { - "@storybook/vue": "7.1.0-alpha.31", + "@storybook/vue": "7.1.0-alpha.37", "typescript": "^4.9.3" }, "peerDependencies": { @@ -166,5 +166,5 @@ ], "platform": "node" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index 57b66ef4d1ee..e5b3a11170b6 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-mdx-gfm", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", @@ -51,7 +51,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/node-logger": "7.1.0-alpha.31", + "@storybook/node-logger": "7.1.0-alpha.37", "remark-gfm": "^3.0.1", "ts-dedent": "^2.0.0" }, @@ -69,5 +69,5 @@ "cjs" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 8148417435eb..75173ecf8a42 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", @@ -61,9 +61,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-events": "7.1.0-alpha.31", + "@storybook/core-events": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.31" + "@storybook/preview-api": "7.1.0-alpha.37" }, "devDependencies": { "@types/webpack-env": "^1.16.0", @@ -78,7 +78,7 @@ "./src/preview.ts" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "sbmodern": "dist/modern/index.js", "storybook": { "displayName": "Highlight", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index e950113b6d82..2ba5ed1f7826 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", @@ -72,16 +72,16 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/core-common": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/core-common": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/instrumenter": "7.1.0-alpha.31", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/instrumenter": "7.1.0-alpha.37", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "jest-mock": "^29.5.0", "polished": "^4.2.2", "ts-dedent": "^2.2.0" @@ -117,7 +117,7 @@ "./src/preset.ts" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Interactions", "unsupportedFrameworks": [ diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index e510c225faf9..d5fe04272685 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "React storybook addon that show component jest report", "keywords": [ "addon", @@ -70,13 +70,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37", "react-resize-detector": "^7.1.2", "tiny-invariant": "^1.3.1", "upath": "^2.0.1" @@ -106,7 +106,7 @@ ], "platform": "browser" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Jest", "icon": "https://pbs.twimg.com/profile_images/821713465245102080/mMtKIMax_400x400.jpg", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 72ef53dd835d..d8660c85aade 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "addon", @@ -80,14 +80,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", "@storybook/csf": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/router": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/router": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "prop-types": "^15.7.2", "ts-dedent": "^2.0.0" }, @@ -119,7 +119,7 @@ ], "post": "./scripts/fix-preview-api-reference.ts" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Links", "icon": "https://user-images.githubusercontent.com/263385/101991673-48355c80-3c7c-11eb-9b6e-b627c96a75f6.png", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index f9134ab9b23d..0677d2da0e42 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", @@ -75,13 +75,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "tiny-invariant": "^1.3.1" }, "devDependencies": { @@ -109,7 +109,7 @@ "./src/preview.tsx" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Measure", "unsupportedFrameworks": [ diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index 55130f3c8cd7..a53f417e719a 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", @@ -78,13 +78,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "ts-dedent": "^2.0.0" }, "devDependencies": { @@ -112,7 +112,7 @@ "./src/preview.tsx" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Outline", "unsupportedFrameworks": [ diff --git a/code/addons/storyshots-core/package.json b/code/addons/storyshots-core/package.json index b3a9873bd877..722d1e28b8ab 100644 --- a/code/addons/storyshots-core/package.json +++ b/code/addons/storyshots-core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Take a code snapshot of every story automatically with Jest", "keywords": [ "addon", @@ -38,12 +38,12 @@ "dependencies": { "@jest/transform": "^29.3.1", "@storybook/babel-plugin-require-context-hook": "1.0.1", - "@storybook/client-api": "7.1.0-alpha.31", - "@storybook/core-common": "7.1.0-alpha.31", - "@storybook/core-webpack": "7.1.0-alpha.31", + "@storybook/client-api": "7.1.0-alpha.37", + "@storybook/core-common": "7.1.0-alpha.37", + "@storybook/core-webpack": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "@types/jest-specific-snapshot": "^0.5.6", "glob": "^10.0.0", "jest-specific-snapshot": "^8.0.0", @@ -57,11 +57,11 @@ "@angular/core": "^16.0.0-rc.4", "@angular/platform-browser-dynamic": "^16.0.0-rc.4", "@emotion/jest": "^11.8.0", - "@storybook/addon-docs": "7.1.0-alpha.31", - "@storybook/angular": "7.1.0-alpha.31", - "@storybook/react": "7.1.0-alpha.31", - "@storybook/vue": "7.1.0-alpha.31", - "@storybook/vue3": "7.1.0-alpha.31", + "@storybook/addon-docs": "7.1.0-alpha.37", + "@storybook/angular": "7.1.0-alpha.37", + "@storybook/react": "7.1.0-alpha.37", + "@storybook/vue": "7.1.0-alpha.37", + "@storybook/vue3": "7.1.0-alpha.37", "babel-loader": "^9.1.2", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.5", @@ -141,7 +141,7 @@ "access": "public" }, "bundler": {}, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Storyshots", "icon": "https://user-images.githubusercontent.com/263385/101991676-48cdf300-3c7c-11eb-8aa1-944dab6ab29b.png", diff --git a/code/addons/storyshots-core/src/frameworks/configure.ts b/code/addons/storyshots-core/src/frameworks/configure.ts index c7b4f5f7b65f..5532a2dfea8c 100644 --- a/code/addons/storyshots-core/src/frameworks/configure.ts +++ b/code/addons/storyshots-core/src/frameworks/configure.ts @@ -108,6 +108,7 @@ function configure( } = getConfigPathParts(configPath); global.FEATURES = features; + global.CONFIG_TYPE = 'DEVELOPMENT'; global.STORIES = stories.map((specifier) => ({ ...specifier, importPathMatcher: specifier.importPathMatcher.source, diff --git a/code/addons/storyshots-core/src/typings.d.ts b/code/addons/storyshots-core/src/typings.d.ts index 1c68913a502c..02634df94986 100644 --- a/code/addons/storyshots-core/src/typings.d.ts +++ b/code/addons/storyshots-core/src/typings.d.ts @@ -9,6 +9,7 @@ declare module '@storybook/babel-plugin-require-context-hook/register'; declare var STORYBOOK_ENV: any; declare var STORIES: any; +declare var CONFIG_TYPE: 'DEVELOPMENT' | 'PRODUCTION'; declare var FEATURES: | { storyStoreV7?: boolean; diff --git a/code/addons/storyshots-puppeteer/package.json b/code/addons/storyshots-puppeteer/package.json index 7160783b3ffc..5756feca754c 100644 --- a/code/addons/storyshots-puppeteer/package.json +++ b/code/addons/storyshots-puppeteer/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots-puppeteer", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Image snapshots addition to StoryShots based on puppeteer", "keywords": [ "addon", @@ -37,8 +37,8 @@ "dependencies": { "@axe-core/puppeteer": "^4.2.0", "@storybook/csf": "^0.1.0", - "@storybook/node-logger": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/node-logger": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "@types/jest-image-snapshot": "^6.0.0", "jest-image-snapshot": "^6.0.0" }, @@ -49,7 +49,7 @@ "puppeteer": "^2.0.0 || ^3.0.0" }, "peerDependencies": { - "@storybook/addon-storyshots": "7.1.0-alpha.31", + "@storybook/addon-storyshots": "7.1.0-alpha.37", "puppeteer": ">=2.0.0" }, "peerDependenciesMeta": { @@ -61,5 +61,5 @@ "access": "public" }, "bundler": {}, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 688612df5268..9a0863ea79a4 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", @@ -53,13 +53,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/router": "7.1.0-alpha.31", - "@storybook/source-loader": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/router": "7.1.0-alpha.37", + "@storybook/source-loader": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37", "estraverse": "^5.2.0", "prop-types": "^15.7.2", "react-syntax-highlighter": "^15.5.0", @@ -92,7 +92,7 @@ "./src/preset.ts" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Storysource", "icon": "https://user-images.githubusercontent.com/263385/101991675-48cdf300-3c7c-11eb-9400-58de5ac6daa7.png", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index eeb3b72c59b8..c06aba374218 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Create your own toolbar items that control story rendering", "keywords": [ "addon", @@ -68,11 +68,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31" + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37" }, "devDependencies": { "typescript": "~4.9.3" @@ -99,7 +99,7 @@ ], "platform": "browser" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Toolbars", "icon": "https://user-images.githubusercontent.com/263385/101991677-48cdf300-3c7c-11eb-93b4-19b0e3366959.png", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index c25ee94cc307..0fe9f9dc96a0 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", @@ -73,13 +73,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37", "memoizerific": "^1.11.3", "prop-types": "^15.7.2" }, @@ -109,7 +109,7 @@ "./src/preview.ts" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16", + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { "displayName": "Viewport", "icon": "https://user-images.githubusercontent.com/263385/101991678-48cdf300-3c7c-11eb-9764-f8af293c1b28.png", diff --git a/code/builders/builder-manager/package.json b/code/builders/builder-manager/package.json index 8e5e9749227c..b857ca9c3199 100644 --- a/code/builders/builder-manager/package.json +++ b/code/builders/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook manager builder", "keywords": [ "storybook" @@ -44,15 +44,15 @@ }, "dependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", - "@storybook/core-common": "7.1.0-alpha.31", - "@storybook/manager": "7.1.0-alpha.31", - "@storybook/node-logger": "7.1.0-alpha.31", + "@storybook/core-common": "7.1.0-alpha.37", + "@storybook/manager": "7.1.0-alpha.37", + "@storybook/node-logger": "7.1.0-alpha.37", "@types/ejs": "^3.1.1", "@types/find-cache-dir": "^3.2.1", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10", "browser-assert": "^1.2.1", "ejs": "^3.1.8", - "esbuild": "^0.17.0", + "esbuild": "^0.18.0", "esbuild-plugin-alias": "^0.2.1", "express": "^4.17.3", "find-cache-dir": "^3.0.0", @@ -73,5 +73,5 @@ ], "platform": "node" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 81623e8846fb..3a6ee9d4f9bf 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "A plugin to run and build Storybooks with Vite", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme", "bugs": { @@ -42,19 +42,20 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channel-postmessage": "7.1.0-alpha.31", - "@storybook/channel-websocket": "7.1.0-alpha.31", - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/core-common": "7.1.0-alpha.31", - "@storybook/csf-plugin": "7.1.0-alpha.31", + "@storybook/channels": "7.1.0-alpha.37", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/core-common": "7.1.0-alpha.37", + "@storybook/csf-plugin": "7.1.0-alpha.37", "@storybook/mdx2-csf": "^1.0.0", - "@storybook/node-logger": "7.1.0-alpha.31", - "@storybook/preview": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/node-logger": "7.1.0-alpha.37", + "@storybook/preview": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", + "@types/find-cache-dir": "^3.2.1", "browser-assert": "^1.2.1", "es-module-lexer": "^0.9.3", "express": "^4.17.3", + "find-cache-dir": "^3.0.0", "fs-extra": "^11.1.0", "magic-string": "^0.30.0", "remark-external-links": "^8.0.0", @@ -99,5 +100,5 @@ ], "platform": "node" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/builders/builder-vite/src/codegen-set-addon-channel.ts b/code/builders/builder-vite/src/codegen-set-addon-channel.ts index aa866408415d..f5dc708f58b8 100644 --- a/code/builders/builder-vite/src/codegen-set-addon-channel.ts +++ b/code/builders/builder-vite/src/codegen-set-addon-channel.ts @@ -1,17 +1,14 @@ export async function generateAddonSetupCode() { return ` - import { createChannel as createPostMessageChannel } from '@storybook/channel-postmessage'; - import { createChannel as createWebSocketChannel } from '@storybook/channel-websocket'; + import { createBrowserChannel } from '@storybook/channels'; import { addons } from '@storybook/preview-api'; - const channel = createPostMessageChannel({ page: 'preview' }); + const channel = createBrowserChannel({ page: 'preview' }); addons.setChannel(channel); window.__STORYBOOK_ADDONS_CHANNEL__ = channel; if (window.CONFIG_TYPE === 'DEVELOPMENT'){ - const serverChannel = createWebSocketChannel({}); - addons.setServerChannel(serverChannel); - window.__STORYBOOK_SERVER_CHANNEL__ = serverChannel; + window.__STORYBOOK_SERVER_CHANNEL__ = channel; } `.trim(); } diff --git a/code/builders/builder-vite/src/optimizeDeps.ts b/code/builders/builder-vite/src/optimizeDeps.ts index 20fe4259ef37..e9639782547d 100644 --- a/code/builders/builder-vite/src/optimizeDeps.ts +++ b/code/builders/builder-vite/src/optimizeDeps.ts @@ -13,6 +13,7 @@ const INCLUDE_CANDIDATES = [ '@storybook/addon-docs > acorn-jsx', '@storybook/addon-docs', '@storybook/addon-essentials/docs/mdx-react-shim', + '@storybook/channels', '@storybook/channel-postmessage', '@storybook/channel-websocket', '@storybook/client-api', diff --git a/code/builders/builder-vite/src/plugins/external-globals-plugin.ts b/code/builders/builder-vite/src/plugins/external-globals-plugin.ts index fe5efe1bce4a..dd53ab4a4e56 100644 --- a/code/builders/builder-vite/src/plugins/external-globals-plugin.ts +++ b/code/builders/builder-vite/src/plugins/external-globals-plugin.ts @@ -1,7 +1,8 @@ import { join } from 'node:path'; +import findCacheDirectory from 'find-cache-dir'; import { init, parse } from 'es-module-lexer'; import MagicString from 'magic-string'; -import { emptyDir, ensureDir, ensureFile, writeFile } from 'fs-extra'; +import { ensureFile, writeFile } from 'fs-extra'; import { mergeAlias } from 'vite'; import type { Alias, Plugin } from 'vite'; @@ -47,9 +48,10 @@ export async function externalGlobalsPlugin(externals: Record) { } const newAlias = mergeAlias([], config.resolve?.alias) as Alias[]; - const cachePath = join(process.cwd(), 'node_modules', '.cache', 'vite-plugin-externals'); - await ensureDir(cachePath); - await emptyDir(cachePath); + const cachePath = findCacheDirectory({ + name: 'sb-vite-plugin-externals', + create: true, + }) as string; await Promise.all( (Object.keys(externals) as Array).map(async (externalKey) => { const externalCachePath = join(cachePath, `${externalKey}.js`); diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index e9ce254809b3..c7b363622bcc 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -1,5 +1,6 @@ import * as path from 'path'; import { loadConfigFromFile, mergeConfig } from 'vite'; +import findCacheDirectory from 'find-cache-dir'; import type { ConfigEnv, InlineConfig as ViteInlineConfig, @@ -51,7 +52,7 @@ export async function commonConfig( const sbConfig: InlineConfig = { configFile: false, - cacheDir: 'node_modules/.cache/.vite-storybook', + cacheDir: findCacheDirectory({ name: 'sb-vite' }), root: path.resolve(options.configDir, '..'), // Allow storybook deployed as subfolder. See https://github.com/storybookjs/builder-vite/issues/238 base: './', diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 84cbbb420fad..ef76a1f3e1b5 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -56,25 +56,24 @@ }, "dependencies": { "@babel/core": "^7.22.0", - "@storybook/addons": "7.1.0-alpha.31", - "@storybook/api": "7.1.0-alpha.31", - "@storybook/channel-postmessage": "7.1.0-alpha.31", - "@storybook/channel-websocket": "7.1.0-alpha.31", - "@storybook/channels": "7.1.0-alpha.31", - "@storybook/client-api": "7.1.0-alpha.31", - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/components": "7.1.0-alpha.31", - "@storybook/core-common": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", - "@storybook/core-webpack": "7.1.0-alpha.31", + "@storybook/addons": "7.1.0-alpha.37", + "@storybook/api": "7.1.0-alpha.37", + "@storybook/channel-postmessage": "7.1.0-alpha.37", + "@storybook/channels": "7.1.0-alpha.37", + "@storybook/client-api": "7.1.0-alpha.37", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/components": "7.1.0-alpha.37", + "@storybook/core-common": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", + "@storybook/core-webpack": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/node-logger": "7.1.0-alpha.31", - "@storybook/preview": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/router": "7.1.0-alpha.31", - "@storybook/store": "7.1.0-alpha.31", - "@storybook/theming": "7.1.0-alpha.31", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/node-logger": "7.1.0-alpha.37", + "@storybook/preview": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/router": "7.1.0-alpha.37", + "@storybook/store": "7.1.0-alpha.37", + "@storybook/theming": "7.1.0-alpha.37", "@swc/core": "^1.3.49", "@types/node": "^16.0.0", "@types/semver": "^7.3.4", @@ -132,5 +131,5 @@ ], "platform": "node" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index 3ae9c53e9a99..35f1fea6c81f 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -163,7 +163,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ } } - channel.emit(PREVIEW_BUILDER_PROGRESS, [progress]); + channel.emit(PREVIEW_BUILDER_PROGRESS, progress); }, modulesCount, }).apply(compiler); diff --git a/code/builders/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars b/code/builders/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars index 154c413e9404..0507ca9fbbd1 100644 --- a/code/builders/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars +++ b/code/builders/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars @@ -1,21 +1,18 @@ import { global } from '@storybook/global'; import { ClientApi, PreviewWeb, addons, composeConfigs } from '@storybook/preview-api'; -import { createChannel as createPostMessageChannel } from '@storybook/channel-postmessage'; -import { createChannel as createWebSocketChannel } from '@storybook/channel-websocket'; +import { createBrowserChannel } from '@storybook/channels'; import { importFn } from './{{storiesFilename}}'; const getProjectAnnotations = () => composeConfigs([{{#each previewAnnotations}}require('{{this}}'),{{/each}}]); -const channel = createPostMessageChannel({ page: 'preview' }); +const channel = createBrowserChannel({ page: 'preview' }); addons.setChannel(channel); if (global.CONFIG_TYPE === 'DEVELOPMENT'){ - const serverChannel = createWebSocketChannel({}); - addons.setServerChannel(serverChannel); - window.__STORYBOOK_SERVER_CHANNEL__ = serverChannel; + window.__STORYBOOK_SERVER_CHANNEL__ = channel; } const preview = new PreviewWeb(); diff --git a/code/deprecated/addons/package.json b/code/deprecated/addons/package.json index 5ba4b3e100b2..004c1cbbba83 100644 --- a/code/deprecated/addons/package.json +++ b/code/deprecated/addons/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addons", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook addons store", "keywords": [ "storybook" @@ -44,9 +44,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31" + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", @@ -60,5 +60,5 @@ "./src/index.ts" ] }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/lib/channel-postmessage/README.md b/code/deprecated/channel-postmessage/README.md similarity index 100% rename from code/lib/channel-postmessage/README.md rename to code/deprecated/channel-postmessage/README.md diff --git a/code/lib/channel-postmessage/jest.config.js b/code/deprecated/channel-postmessage/jest.config.js similarity index 100% rename from code/lib/channel-postmessage/jest.config.js rename to code/deprecated/channel-postmessage/jest.config.js diff --git a/code/lib/channel-postmessage/package.json b/code/deprecated/channel-postmessage/package.json similarity index 63% rename from code/lib/channel-postmessage/package.json rename to code/deprecated/channel-postmessage/package.json index be3a94477e63..2d3227fe8a36 100644 --- a/code/lib/channel-postmessage/package.json +++ b/code/deprecated/channel-postmessage/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-postmessage", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "", "keywords": [ "storybook" @@ -22,16 +22,16 @@ "sideEffects": false, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./dist/index.js", - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "types": "./dist/entry.d.ts", + "node": "./dist/entry.js", + "require": "./dist/entry.js", + "import": "./dist/entry.mjs" }, "./package.json": "./package.json" }, - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", + "main": "dist/entry.js", + "module": "dist/entry.mjs", + "types": "dist/entry.d.ts", "files": [ "dist/**/*", "README.md", @@ -43,13 +43,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0-alpha.31", - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", - "@storybook/global": "^5.0.0", - "qs": "^6.10.0", - "telejson": "^7.0.3", - "tiny-invariant": "^1.3.1" + "@storybook/channels": "7.1.0-alpha.37", + "@storybook/client-logger": "7.1.0-alpha.37" }, "devDependencies": { "typescript": "~4.9.3" @@ -59,8 +54,9 @@ }, "bundler": { "entries": [ - "./src/index.ts" - ] + "./src/entry.ts" + ], + "shim": "@storybook/channels/dist/postmessage/index" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/lib/channel-postmessage/project.json b/code/deprecated/channel-postmessage/project.json similarity index 100% rename from code/lib/channel-postmessage/project.json rename to code/deprecated/channel-postmessage/project.json diff --git a/code/deprecated/channel-postmessage/src/entry.ts b/code/deprecated/channel-postmessage/src/entry.ts new file mode 100644 index 000000000000..2190b9f5382e --- /dev/null +++ b/code/deprecated/channel-postmessage/src/entry.ts @@ -0,0 +1,7 @@ +import { deprecate } from '@storybook/client-logger'; + +deprecate( + 'importing from @storybook/channel-postmessage is deprecated and will be removed in 8.0, please import createPostmessageChannel from @storybook/channels' +); + +export * from '@storybook/channels/dist/postmessage/index'; diff --git a/code/lib/channel-postmessage/tsconfig.json b/code/deprecated/channel-postmessage/tsconfig.json similarity index 100% rename from code/lib/channel-postmessage/tsconfig.json rename to code/deprecated/channel-postmessage/tsconfig.json diff --git a/code/lib/channel-websocket/README.md b/code/deprecated/channel-websocket/README.md similarity index 100% rename from code/lib/channel-websocket/README.md rename to code/deprecated/channel-websocket/README.md diff --git a/code/lib/channel-websocket/jest.config.js b/code/deprecated/channel-websocket/jest.config.js similarity index 100% rename from code/lib/channel-websocket/jest.config.js rename to code/deprecated/channel-websocket/jest.config.js diff --git a/code/lib/channel-websocket/package.json b/code/deprecated/channel-websocket/package.json similarity index 62% rename from code/lib/channel-websocket/package.json rename to code/deprecated/channel-websocket/package.json index a292c42e940d..3c929c1f43a3 100644 --- a/code/lib/channel-websocket/package.json +++ b/code/deprecated/channel-websocket/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-websocket", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "", "keywords": [ "storybook" @@ -22,16 +22,16 @@ "sideEffects": false, "exports": { ".": { - "types": "./dist/index.d.ts", - "node": "./dist/index.js", - "require": "./dist/index.js", - "import": "./dist/index.mjs" + "types": "./dist/entry.d.ts", + "node": "./dist/entry.js", + "require": "./dist/entry.js", + "import": "./dist/entry.mjs" }, "./package.json": "./package.json" }, - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", + "main": "dist/entry.js", + "module": "dist/entry.mjs", + "types": "dist/entry.d.ts", "files": [ "dist/**/*", "README.md", @@ -40,14 +40,11 @@ ], "scripts": { "check": "../../../scripts/node_modules/.bin/tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/channels": "7.1.0-alpha.31", - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/global": "^5.0.0", - "telejson": "^7.0.3", - "tiny-invariant": "^1.3.1" + "@storybook/channels": "7.1.0-alpha.37", + "@storybook/client-logger": "7.1.0-alpha.37" }, "devDependencies": { "typescript": "~4.9.3" @@ -57,8 +54,9 @@ }, "bundler": { "entries": [ - "./src/index.ts" - ] + "./src/entry.ts" + ], + "shim": "@storybook/channels/dist/websocket/index" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/lib/channel-websocket/project.json b/code/deprecated/channel-websocket/project.json similarity index 100% rename from code/lib/channel-websocket/project.json rename to code/deprecated/channel-websocket/project.json diff --git a/code/deprecated/channel-websocket/src/entry.ts b/code/deprecated/channel-websocket/src/entry.ts new file mode 100644 index 000000000000..e5b6602e6120 --- /dev/null +++ b/code/deprecated/channel-websocket/src/entry.ts @@ -0,0 +1,7 @@ +import { deprecate } from '@storybook/client-logger'; + +deprecate( + 'importing from @storybook/channel-websocket is deprecated and will be removed in 8.0, please import createWebsocketChannel from @storybook/channels' +); + +export * from '@storybook/channels/dist/websocket/index'; diff --git a/code/lib/channel-websocket/tsconfig.json b/code/deprecated/channel-websocket/tsconfig.json similarity index 100% rename from code/lib/channel-websocket/tsconfig.json rename to code/deprecated/channel-websocket/tsconfig.json diff --git a/code/deprecated/client-api/package.json b/code/deprecated/client-api/package.json index df51cf8ca277..8956c6112ed2 100644 --- a/code/deprecated/client-api/package.json +++ b/code/deprecated/client-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-api", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook Client API", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31" + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37" }, "publishConfig": { "access": "public" @@ -54,5 +54,5 @@ ], "shim": "@storybook/preview-api/dist/client-api" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/deprecated/core-client/package.json b/code/deprecated/core-client/package.json index ae5e95397c92..877a0b1e457a 100644 --- a/code/deprecated/core-client/package.json +++ b/code/deprecated/core-client/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-client", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -35,8 +35,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31" + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37" }, "publishConfig": { "access": "public" @@ -47,5 +47,5 @@ ], "shim": "@storybook/preview-api/dist/core-client" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/deprecated/manager-api-shim/package.json b/code/deprecated/manager-api-shim/package.json index 834d6f543137..a992fd508bfe 100644 --- a/code/deprecated/manager-api-shim/package.json +++ b/code/deprecated/manager-api-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/api", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook Manager API (facade)", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/manager-api": "7.1.0-alpha.31" + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/manager-api": "7.1.0-alpha.37" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", @@ -66,5 +66,5 @@ ], "shim": "@storybook/manager-api" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/deprecated/preview-web/package.json b/code/deprecated/preview-web/package.json index 379684617291..78e1e7c1e3b6 100644 --- a/code/deprecated/preview-web/package.json +++ b/code/deprecated/preview-web/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-web", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31" + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37" }, "publishConfig": { "access": "public" @@ -54,5 +54,5 @@ ], "shim": "@storybook/preview-api/dist/preview-web" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/deprecated/store/package.json b/code/deprecated/store/package.json index 95127e796c1e..424b0c53f9e1 100644 --- a/code/deprecated/store/package.json +++ b/code/deprecated/store/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/store", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31" + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37" }, "publishConfig": { "access": "public" @@ -55,5 +55,5 @@ "platform": "node", "shim": "@storybook/preview-api/dist/store" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/e2e-tests/addon-viewport.spec.ts b/code/e2e-tests/addon-viewport.spec.ts index da66778a3708..ec96a3bd93ea 100644 --- a/code/e2e-tests/addon-viewport.spec.ts +++ b/code/e2e-tests/addon-viewport.spec.ts @@ -28,13 +28,13 @@ test.describe('addon-viewport', () => { await sbPage.navigateToStory('example/button', 'primary'); // Measure the original dimensions of previewRoot - const originalDimensions = await sbPage.previewRoot().boundingBox(); + const originalDimensions = await sbPage.getCanvasBodyElement().boundingBox(); await expect(originalDimensions?.width).toBeDefined(); await sbPage.selectToolbar('[title="Change the size of the preview"]', '#list-item-mobile1'); // Measure the adjusted dimensions of previewRoot after clicking the mobile item. - const adjustedDimensions = await sbPage.previewRoot().boundingBox(); + const adjustedDimensions = await sbPage.getCanvasBodyElement().boundingBox(); await expect(adjustedDimensions?.width).toBeDefined(); // Compare the two widths diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index e5d888c0cdfa..8652c6c18f02 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.", "keywords": [ "storybook", @@ -36,20 +36,20 @@ "prep": "../../../scripts/prepare/tsc.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.1.0-alpha.31", - "@storybook/cli": "7.1.0-alpha.31", - "@storybook/client-logger": "7.1.0-alpha.31", - "@storybook/core-common": "7.1.0-alpha.31", - "@storybook/core-events": "7.1.0-alpha.31", - "@storybook/core-server": "7.1.0-alpha.31", - "@storybook/core-webpack": "7.1.0-alpha.31", - "@storybook/docs-tools": "7.1.0-alpha.31", + "@storybook/builder-webpack5": "7.1.0-alpha.37", + "@storybook/cli": "7.1.0-alpha.37", + "@storybook/client-logger": "7.1.0-alpha.37", + "@storybook/core-common": "7.1.0-alpha.37", + "@storybook/core-events": "7.1.0-alpha.37", + "@storybook/core-server": "7.1.0-alpha.37", + "@storybook/core-webpack": "7.1.0-alpha.37", + "@storybook/docs-tools": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.31", - "@storybook/node-logger": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/telemetry": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/manager-api": "7.1.0-alpha.37", + "@storybook/node-logger": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/telemetry": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "@types/node": "^16.0.0", "@types/react": "^16.14.34", "@types/react-dom": "^16.9.14", @@ -122,5 +122,5 @@ "bundler": { "tsConfig": "tsconfig.build.json" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/frameworks/angular/src/builders/start-storybook/index.ts b/code/frameworks/angular/src/builders/start-storybook/index.ts index 3b44e0dea51f..642953dc4366 100644 --- a/code/frameworks/angular/src/builders/start-storybook/index.ts +++ b/code/frameworks/angular/src/builders/start-storybook/index.ts @@ -49,6 +49,7 @@ export type StorybookBuilderOptions = JsonObject & { | 'ci' | 'quiet' | 'disableTelemetry' + | 'initialPath' | 'open' | 'docs' >; @@ -98,6 +99,7 @@ const commandBuilder: BuilderHandlerFn = (options, cont sslKey, disableTelemetry, assets, + initialPath, open, } = options; @@ -123,6 +125,7 @@ const commandBuilder: BuilderHandlerFn = (options, cont ...(assets ? { assets } : {}), }, tsConfig, + initialPath, open, }; diff --git a/code/frameworks/angular/src/builders/start-storybook/schema.json b/code/frameworks/angular/src/builders/start-storybook/schema.json index 764143407b2d..d10d07d95d5d 100644 --- a/code/frameworks/angular/src/builders/start-storybook/schema.json +++ b/code/frameworks/angular/src/builders/start-storybook/schema.json @@ -114,6 +114,10 @@ "items": { "$ref": "#/definitions/assetPattern" } + }, + "initialPath": { + "type": "string", + "description": "URL path to be appended when visiting Storybook for the first time" } }, "additionalProperties": false, diff --git a/code/frameworks/angular/src/server/angular-cli-webpack.js b/code/frameworks/angular/src/server/angular-cli-webpack.js index feb510df501f..76d05ff55e72 100644 --- a/code/frameworks/angular/src/server/angular-cli-webpack.js +++ b/code/frameworks/angular/src/server/angular-cli-webpack.js @@ -1,19 +1,48 @@ +/* eslint-disable global-require */ // Private angular devkit stuff const { generateI18nBrowserWebpackConfigFromContext, } = require('@angular-devkit/build-angular/src/utils/webpack-browser-config'); -const { - getCommonConfig, - getStylesConfig, - getDevServerConfig, - getTypeScriptConfig, -} = require('@angular-devkit/build-angular/src/webpack/configs'); const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); const { filterOutStylingRules } = require('./utils/filter-out-styling-rules'); const { default: StorybookNormalizeAngularEntryPlugin, } = require('./plugins/storybook-normalize-angular-entry-plugin'); +const getAngularWebpackUtils = () => { + try { + // Angular < 16.1.0 + const { + getCommonConfig, + getStylesConfig, + getDevServerConfig, + getTypeScriptConfig, + } = require('@angular-devkit/build-angular/src/webpack/configs'); + + return { + getCommonConfig, + getStylesConfig, + getDevServerConfig, + getTypeScriptConfig, + }; + } catch (e) { + // Angular > 16.1.0 + const { + getCommonConfig, + getStylesConfig, + getDevServerConfig, + getTypeScriptConfig, + } = require('@angular-devkit/build-angular/src/tools/webpack/configs'); + + return { + getCommonConfig, + getStylesConfig, + getDevServerConfig, + getTypeScriptConfig, + }; + } +}; + /** * Extract webpack config from angular-cli 13.x.x * ⚠️ This file is in JavaScript to not use TypeScript. Because current storybook TypeScript version is not compatible with Angular CLI. @@ -26,6 +55,8 @@ exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext } /** * Get angular-cli Webpack config */ + const { getCommonConfig, getStylesConfig, getDevServerConfig, getTypeScriptConfig } = + getAngularWebpackUtils(); const { config: cliConfig } = await generateI18nBrowserWebpackConfigFromContext( { // Default options diff --git a/code/frameworks/angular/src/server/framework-preset-angular-ivy.ts b/code/frameworks/angular/src/server/framework-preset-angular-ivy.ts index 5d22cf4210cc..987df7f78005 100644 --- a/code/frameworks/angular/src/server/framework-preset-angular-ivy.ts +++ b/code/frameworks/angular/src/server/framework-preset-angular-ivy.ts @@ -1,5 +1,4 @@ import { Configuration } from 'webpack'; -import { VERSION } from '@angular/core'; import * as path from 'path'; import { Preset } from '@storybook/types'; @@ -50,6 +49,7 @@ export const runNgcc = async () => { }; export const webpack = async (webpackConfig: Configuration, options: PresetOptions) => { + const { VERSION } = await loadEsmModule('@angular/core'); const framework = await options.presets.apply('framework'); const angularOptions = (typeof framework === 'object' ? framework.options : {}) as AngularOptions; const isAngular16OrNewer = parseInt(VERSION.major, 10) >= 16; diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index b34ddacb12fa..a771cf04321c 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember", "bugs": { @@ -31,12 +31,12 @@ "prep": "../../../scripts/prepare/tsc.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.1.0-alpha.31", - "@storybook/core-common": "7.1.0-alpha.31", - "@storybook/docs-tools": "7.1.0-alpha.31", + "@storybook/builder-webpack5": "7.1.0-alpha.37", + "@storybook/core-common": "7.1.0-alpha.37", + "@storybook/docs-tools": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/types": "7.1.0-alpha.31", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/types": "7.1.0-alpha.37", "ts-dedent": "^2.0.0" }, "devDependencies": { @@ -59,5 +59,5 @@ "access": "public" }, "bundler": {}, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index ce851be1cbee..65df55e50bf1 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-vite", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,15 +47,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.1.0-alpha.31", - "@storybook/builder-vite": "7.1.0-alpha.31", - "@storybook/channel-postmessage": "7.1.0-alpha.31", - "@storybook/channel-websocket": "7.1.0-alpha.31", - "@storybook/client-api": "7.1.0-alpha.31", - "@storybook/core-server": "7.1.0-alpha.31", - "@storybook/html": "7.1.0-alpha.31", - "@storybook/node-logger": "7.1.0-alpha.31", - "@storybook/preview-web": "7.1.0-alpha.31", + "@storybook/addons": "7.1.0-alpha.37", + "@storybook/builder-vite": "7.1.0-alpha.37", + "@storybook/channel-postmessage": "7.1.0-alpha.37", + "@storybook/client-api": "7.1.0-alpha.37", + "@storybook/core-server": "7.1.0-alpha.37", + "@storybook/html": "7.1.0-alpha.37", + "@storybook/node-logger": "7.1.0-alpha.37", + "@storybook/preview-web": "7.1.0-alpha.37", "magic-string": "^0.30.0" }, "devDependencies": { @@ -75,5 +74,5 @@ ], "platform": "node" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 4ae143f4b335..b3b50536f425 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-webpack5", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,11 +47,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.1.0-alpha.31", - "@storybook/core-common": "7.1.0-alpha.31", + "@storybook/builder-webpack5": "7.1.0-alpha.37", + "@storybook/core-common": "7.1.0-alpha.37", "@storybook/global": "^5.0.0", - "@storybook/html": "7.1.0-alpha.31", - "@storybook/preset-html-webpack": "7.1.0-alpha.31", + "@storybook/html": "7.1.0-alpha.37", + "@storybook/preset-html-webpack": "7.1.0-alpha.37", "@types/node": "^16.0.0" }, "devDependencies": { @@ -75,5 +75,5 @@ ], "platform": "node" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/frameworks/nextjs/README.md b/code/frameworks/nextjs/README.md index 1989da90c05e..d15ad4d4a98a 100644 --- a/code/frameworks/nextjs/README.md +++ b/code/frameworks/nextjs/README.md @@ -28,7 +28,7 @@ - [Set `nextjs.appDirectory` to `true`](#set-nextjsappdirectory-to-true) - [Overriding defaults](#overriding-defaults-1) - [Global Defaults](#global-defaults-1) - - [`useSelectedLayoutSegment` and `useSelectedLayoutSegments` hook](#useselectedlayoutsegment-and-useselectedlayoutsegments-hook) + - [`useSelectedLayoutSegment` `useSelectedLayoutSegments` and `useParams` hook](#useselectedlayoutsegment-useselectedlayoutsegments-and-useparams-hook) - [Default Navigation Context](#default-navigation-context) - [Actions Integration Caveats](#actions-integration-caveats-1) - [Next.js Head](#nextjs-head) @@ -503,9 +503,9 @@ export const parameters = { }; ``` -#### `useSelectedLayoutSegment` and `useSelectedLayoutSegments` hook +#### `useSelectedLayoutSegment` `useSelectedLayoutSegments` and `useParams` hook -The `useSelectedLayoutSegment` and `useSelectedLayoutSegments` hooks are supported in Storybook. You have to set the `nextjs.navigation.segments` parameter to return the segments you want to use. +The `useSelectedLayoutSegment` `useSelectedLayoutSegments` and `useParams` hooks are supported in Storybook. You have to set the `nextjs.navigation.segments` parameter to return the segments or the params you want to use. ```js // SomeComponentThatUsesTheNavigation.stories.js @@ -526,11 +526,46 @@ export default { export const Example = {}; // SomeComponentThatUsesTheNavigation.js -import { useSelectedLayoutSegment, useSelectedLayoutSegments } from 'next/navigation'; +import { useSelectedLayoutSegment, useSelectedLayoutSegments, useParams } from 'next/navigation'; export default function SomeComponentThatUsesTheNavigation() { const segment = useSelectedLayoutSegment(); // dashboard const segments = useSelectedLayoutSegments(); // ["dashboard", "analytics"] + const params = useParams(); // {} + ... +} +``` + +To use `useParams`, you have to use a two string elements array for a segment, the first array element is the param key and the second array element is the param value. + +```js +// SomeComponentThatUsesParams.stories.js +import SomeComponentThatUsesParams from './SomeComponentThatUsesParams'; + +export default { + component: SomeComponentThatUsesParams, + parameters: { + nextjs: { + appDirectory: true, + navigation: { + segments: [ + ['slug', 'hello'], + ['framework', 'nextjs'], + ] + }, + }, + }, +}; + +export const Example = {}; + +// SomeComponentThatUsesParams.js +import { useSelectedLayoutSegment, useSelectedLayoutSegments, useParams } from 'next/navigation'; + +export default function SomeComponentThatUsesParams() { + const segment = useSelectedLayoutSegment(); // hello + const segments = useSelectedLayoutSegments(); // ["hello", "nextjs"] + const params = useParams(); // { slug: "hello", framework: "nextjs" } ... } ``` diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index b627a76589a2..2546ff76d45c 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "7.1.0-alpha.31", + "version": "7.1.0-alpha.37", "description": "Storybook for Next.js", "keywords": [ "storybook", @@ -70,13 +70,13 @@ "@babel/preset-react": "^7.22.0", "@babel/preset-typescript": "^7.21.0", "@babel/runtime": "^7.22.0", - "@storybook/addon-actions": "7.1.0-alpha.31", - "@storybook/builder-webpack5": "7.1.0-alpha.31", - "@storybook/core-common": "7.1.0-alpha.31", - "@storybook/node-logger": "7.1.0-alpha.31", - "@storybook/preset-react-webpack": "7.1.0-alpha.31", - "@storybook/preview-api": "7.1.0-alpha.31", - "@storybook/react": "7.1.0-alpha.31", + "@storybook/addon-actions": "7.1.0-alpha.37", + "@storybook/builder-webpack5": "7.1.0-alpha.37", + "@storybook/core-common": "7.1.0-alpha.37", + "@storybook/node-logger": "7.1.0-alpha.37", + "@storybook/preset-react-webpack": "7.1.0-alpha.37", + "@storybook/preview-api": "7.1.0-alpha.37", + "@storybook/react": "7.1.0-alpha.37", "@types/node": "^16.0.0", "css-loader": "^6.7.3", "find-up": "^5.0.0", @@ -147,5 +147,5 @@ ], "platform": "node" }, - "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae16" + "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts b/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts index aa816e05faf4..7be59c01c486 100644 --- a/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts +++ b/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts @@ -37,7 +37,7 @@ export function getCSSMeta(options: Options) { } function getClassName({ styles, weights, fontFamily }: Options) { - const font = fontFamily.replace(' ', '-').toLowerCase(); + const font = fontFamily.replaceAll(' ', '-').toLowerCase(); const style = isNextCSSPropertyValid(styles) ? styles[0] : null; const weight = isNextCSSPropertyValid(weights) ? weights[0] : null; diff --git a/code/frameworks/nextjs/src/routing/app-router-provider.tsx b/code/frameworks/nextjs/src/routing/app-router-provider.tsx index e285d5dbe2a1..ab09406a14d6 100644 --- a/code/frameworks/nextjs/src/routing/app-router-provider.tsx +++ b/code/frameworks/nextjs/src/routing/app-router-provider.tsx @@ -2,6 +2,7 @@ import React from 'react'; import type { LayoutRouterContext as TLayoutRouterContext, AppRouterContext as TAppRouterContext, + GlobalLayoutRouterContext as TGlobalLayoutRouterContext, } from 'next/dist/shared/lib/app-router-context'; import type { PathnameContext as TPathnameContext, @@ -21,17 +22,21 @@ let AppRouterContext: typeof TAppRouterContext; let LayoutRouterContext: typeof TLayoutRouterContext; let PathnameContext: typeof TPathnameContext; let SearchParamsContext: typeof TSearchParamsContext; +let GlobalLayoutRouterContext: typeof TGlobalLayoutRouterContext; try { AppRouterContext = require('next/dist/shared/lib/app-router-context').AppRouterContext; LayoutRouterContext = require('next/dist/shared/lib/app-router-context').LayoutRouterContext; PathnameContext = require('next/dist/shared/lib/hooks-client-context').PathnameContext; SearchParamsContext = require('next/dist/shared/lib/hooks-client-context').SearchParamsContext; + GlobalLayoutRouterContext = + require('next/dist/shared/lib/app-router-context').GlobalLayoutRouterContext; } catch { AppRouterContext = React.Fragment as any; LayoutRouterContext = React.Fragment as any; PathnameContext = React.Fragment as any; SearchParamsContext = React.Fragment as any; + GlobalLayoutRouterContext = React.Fragment as any; } type AppRouterProviderProps = { @@ -52,44 +57,62 @@ const getParallelRoutes = (segmentsList: Array): FlightRouterState => { const AppRouterProvider: React.FC = ({ children, action, routeParams }) => { const { pathname, query, segments = [], ...restRouteParams } = routeParams; + const tree: FlightRouterState = [pathname, { children: getParallelRoutes([...segments]) }]; + + // https://github.com/vercel/next.js/blob/canary/packages/next/src/client/components/app-router.tsx#L436 return ( - { - action('nextNavigation.refresh')(); - }, - ...restRouteParams, - }} - > + - - {children} - + { + action('nextNavigation.refresh')(); + }, + ...restRouteParams, + }} + > + + {children} + + + - + ); }; diff --git a/code/frameworks/nextjs/src/utils.ts b/code/frameworks/nextjs/src/utils.ts index 9ba051ab7e9e..c119db2dbff7 100644 --- a/code/frameworks/nextjs/src/utils.ts +++ b/code/frameworks/nextjs/src/utils.ts @@ -94,7 +94,15 @@ export const addScopedAlias = (baseConfig: WebpackConfig, name: string, alias?: * scopedResolve('styled-jsx') === '/some/path/node_modules/styled-jsx' */ export const scopedResolve = (id: string): string => { - const scopedModulePath = require.resolve(id, { paths: [path.resolve()] }); + let scopedModulePath; + + try { + // TODO: Remove in next major release (SB 8.0) and use the statement in the catch block per default instead + scopedModulePath = require.resolve(id, { paths: [path.resolve()] }); + } catch (e) { + scopedModulePath = require.resolve(id); + } + const moduleFolderStrPosition = scopedModulePath.lastIndexOf( id.replace(/\//g /* all '/' occurances */, path.sep) ); diff --git a/code/frameworks/nextjs/template/cli/js/Button.stories.js b/code/frameworks/nextjs/template/cli/js/Button.stories.js index 3bf4ad07b75d..e085f9ed312f 100644 --- a/code/frameworks/nextjs/template/cli/js/Button.stories.js +++ b/code/frameworks/nextjs/template/cli/js/Button.stories.js @@ -1,14 +1,18 @@ import { Button } from './Button'; -// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction +// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export export default { title: 'Example/Button', component: Button, + parameters: { + // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout + layout: 'centered', + }, + // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs tags: ['autodocs'], + // More on argTypes: https://storybook.js.org/docs/react/api/argtypes argTypes: { - backgroundColor: { - control: 'color', - }, + backgroundColor: { control: 'color' }, }, }; diff --git a/code/frameworks/nextjs/template/cli/ts-3-8/Button.stories.ts b/code/frameworks/nextjs/template/cli/ts-3-8/Button.stories.ts index eeb81284b442..7d049116d13f 100644 --- a/code/frameworks/nextjs/template/cli/ts-3-8/Button.stories.ts +++ b/code/frameworks/nextjs/template/cli/ts-3-8/Button.stories.ts @@ -2,15 +2,19 @@ import type { Meta, StoryObj } from '@storybook/react'; import { Button } from './Button'; -// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction +// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export const meta: Meta = { title: 'Example/Button', component: Button, + parameters: { + // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout + layout: 'centered', + }, + // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs tags: ['autodocs'], + // More on argTypes: https://storybook.js.org/docs/react/api/argtypes argTypes: { - backgroundColor: { - control: 'color', - }, + backgroundColor: { control: 'color' }, }, }; diff --git a/code/frameworks/nextjs/template/cli/ts-3-8/Introduction.mdx b/code/frameworks/nextjs/template/cli/ts-3-8/Introduction.mdx index 7055076a5273..2418db1e8772 100644 --- a/code/frameworks/nextjs/template/cli/ts-3-8/Introduction.mdx +++ b/code/frameworks/nextjs/template/cli/ts-3-8/Introduction.mdx @@ -16,7 +16,7 @@ import StackAlt from './assets/stackalt.svg'; {` .subheading { --mediumdark: '#999999'; - font-weight: 700; + font-weight: 900; font-size: 13px; color: #999; letter-spacing: 6px; diff --git a/code/frameworks/nextjs/template/cli/ts/Button.stories.ts b/code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts similarity index 55% rename from code/frameworks/nextjs/template/cli/ts/Button.stories.ts rename to code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts index eeb81284b442..7a68cbfec557 100644 --- a/code/frameworks/nextjs/template/cli/ts/Button.stories.ts +++ b/code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts @@ -2,20 +2,24 @@ import type { Meta, StoryObj } from '@storybook/react'; import { Button } from './Button'; -// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction -const meta: Meta = { +// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export +const meta = { title: 'Example/Button', component: Button, + parameters: { + // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout + layout: 'centered', + }, + // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs tags: ['autodocs'], + // More on argTypes: https://storybook.js.org/docs/react/api/argtypes argTypes: { - backgroundColor: { - control: 'color', - }, + backgroundColor: { control: 'color' }, }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args export const Primary: Story = { diff --git a/code/frameworks/nextjs/template/cli/ts/Button.tsx b/code/frameworks/nextjs/template/cli/ts-4-9/Button.tsx similarity index 100% rename from code/frameworks/nextjs/template/cli/ts/Button.tsx rename to code/frameworks/nextjs/template/cli/ts-4-9/Button.tsx diff --git a/code/frameworks/nextjs/template/cli/ts/Header.stories.ts b/code/frameworks/nextjs/template/cli/ts-4-9/Header.stories.ts similarity index 87% rename from code/frameworks/nextjs/template/cli/ts/Header.stories.ts rename to code/frameworks/nextjs/template/cli/ts-4-9/Header.stories.ts index 448685eab0eb..b0766a5a4839 100644 --- a/code/frameworks/nextjs/template/cli/ts/Header.stories.ts +++ b/code/frameworks/nextjs/template/cli/ts-4-9/Header.stories.ts @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { Header } from './Header'; -const meta: Meta = { +const meta = { title: 'Example/Header', component: Header, // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs @@ -10,10 +10,10 @@ const meta: Meta = { // More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout layout: 'fullscreen', }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const LoggedIn: Story = { args: { diff --git a/code/frameworks/nextjs/template/cli/ts/Header.tsx b/code/frameworks/nextjs/template/cli/ts-4-9/Header.tsx similarity index 100% rename from code/frameworks/nextjs/template/cli/ts/Header.tsx rename to code/frameworks/nextjs/template/cli/ts-4-9/Header.tsx diff --git a/code/frameworks/nextjs/template/cli/ts/Introduction.mdx b/code/frameworks/nextjs/template/cli/ts-4-9/Introduction.mdx similarity index 99% rename from code/frameworks/nextjs/template/cli/ts/Introduction.mdx rename to code/frameworks/nextjs/template/cli/ts-4-9/Introduction.mdx index 2418db1e8772..7055076a5273 100644 --- a/code/frameworks/nextjs/template/cli/ts/Introduction.mdx +++ b/code/frameworks/nextjs/template/cli/ts-4-9/Introduction.mdx @@ -16,7 +16,7 @@ import StackAlt from './assets/stackalt.svg'; {` .subheading { --mediumdark: '#999999'; - font-weight: 900; + font-weight: 700; font-size: 13px; color: #999; letter-spacing: 6px; diff --git a/code/frameworks/nextjs/template/cli/ts/Page.stories.ts b/code/frameworks/nextjs/template/cli/ts-4-9/Page.stories.ts similarity index 90% rename from code/frameworks/nextjs/template/cli/ts/Page.stories.ts rename to code/frameworks/nextjs/template/cli/ts-4-9/Page.stories.ts index 0e48941ab149..69852a2bdc00 100644 --- a/code/frameworks/nextjs/template/cli/ts/Page.stories.ts +++ b/code/frameworks/nextjs/template/cli/ts-4-9/Page.stories.ts @@ -3,17 +3,17 @@ import { within, userEvent } from '@storybook/testing-library'; import { Page } from './Page'; -const meta: Meta = { +const meta = { title: 'Example/Page', component: Page, parameters: { // More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout layout: 'fullscreen', }, -}; +} satisfies Meta; export default meta; -type Story = StoryObj; +type Story = StoryObj; export const LoggedOut: Story = {}; diff --git a/code/frameworks/nextjs/template/cli/ts/Page.tsx b/code/frameworks/nextjs/template/cli/ts-4-9/Page.tsx similarity index 100% rename from code/frameworks/nextjs/template/cli/ts/Page.tsx rename to code/frameworks/nextjs/template/cli/ts-4-9/Page.tsx diff --git a/code/frameworks/nextjs/template/stories_nextjs-default-js/Navigation.stories.jsx b/code/frameworks/nextjs/template/stories_nextjs-default-js/Navigation.stories.jsx index 12b66e3205d2..166567aa456c 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-default-js/Navigation.stories.jsx +++ b/code/frameworks/nextjs/template/stories_nextjs-default-js/Navigation.stories.jsx @@ -2,6 +2,7 @@ import { useRouter, usePathname, useSearchParams, + useParams, useSelectedLayoutSegment, useSelectedLayoutSegments, } from 'next/navigation'; @@ -11,6 +12,7 @@ function Component() { const router = useRouter(); const pathname = usePathname(); const searchParams = useSearchParams(); + const params = useParams(); const segment = useSelectedLayoutSegment(); const segments = useSelectedLayoutSegments(); @@ -58,6 +60,16 @@ function Component() { ))} +
+ params:{' '} +
    + {Object.entries(params).map(([key, value]) => ( +
  • + {key}: {value} +
  • + ))} +
+
{routerActions.map(({ cb, name }) => (