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 d1f29d808402..3d60b139e858 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -56,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' @@ -138,13 +138,14 @@ 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 }}" \ --base latest-release \ + --label "maintenance" --head version-patch-from-${{ steps.versions.outputs.current }} \ --body "${{ steps.description.outputs.description }}" fi @@ -157,13 +158,14 @@ 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)" \ --base latest-release \ + --label "build" \ --head version-patch-from-${{ steps.versions.outputs.current }} \ --body "${{ steps.description.outputs.description }}" fi 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/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 112671c1f5e6..1071ead4c05c 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,9 @@ +## 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)! diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index 09c0adc750ee..3a5665ec8602 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/addon-highlight": "7.1.0-alpha.36", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "axe-core": "^4.2.0", "lodash": "^4.17.21", "react-resize-detector": "^7.1.2" diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index d0ae451278d2..e1c8462b1e0e 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "dequal": "^2.0.2", "lodash": "^4.17.21", "polished": "^4.2.2", diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 3ff83bdfdb0e..e0ac0673d88e 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "memoizerific": "^1.11.3", "ts-dedent": "^2.0.0" }, diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 6388108c5975..81012f2c3c8c 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/blocks": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "lodash": "^4.17.21", "ts-dedent": "^2.0.0" }, diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 8a781dd40a4a..cdd686524647 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/csf-plugin": "7.1.0-alpha.35", - "@storybook/csf-tools": "7.1.0-alpha.35", + "@storybook/blocks": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/csf-plugin": "7.1.0-alpha.36", + "@storybook/csf-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", "@storybook/mdx2-csf": "^1.0.0", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/postinstall": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/react-dom-shim": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/postinstall": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/react-dom-shim": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "fs-extra": "^11.1.0", "remark-external-links": "^8.0.0", "remark-slug": "^6.0.0", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index a9e7b19fc743..a8cbde041461 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/addon-backgrounds": "7.1.0-alpha.35", - "@storybook/addon-controls": "7.1.0-alpha.35", - "@storybook/addon-docs": "7.1.0-alpha.35", - "@storybook/addon-highlight": "7.1.0-alpha.35", - "@storybook/addon-measure": "7.1.0-alpha.35", - "@storybook/addon-outline": "7.1.0-alpha.35", - "@storybook/addon-toolbars": "7.1.0-alpha.35", - "@storybook/addon-viewport": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", + "@storybook/addon-actions": "7.1.0-alpha.36", + "@storybook/addon-backgrounds": "7.1.0-alpha.36", + "@storybook/addon-controls": "7.1.0-alpha.36", + "@storybook/addon-docs": "7.1.0-alpha.36", + "@storybook/addon-highlight": "7.1.0-alpha.36", + "@storybook/addon-measure": "7.1.0-alpha.36", + "@storybook/addon-outline": "7.1.0-alpha.36", + "@storybook/addon-toolbars": "7.1.0-alpha.36", + "@storybook/addon-viewport": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", "ts-dedent": "^2.0.0" }, "devDependencies": { - "@storybook/vue": "7.1.0-alpha.35", + "@storybook/vue": "7.1.0-alpha.36", "typescript": "^4.9.3" }, "peerDependencies": { diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index f7fd3d9cf563..bb779e0daa01 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.35", + "version": "7.1.0-alpha.36", "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.35", + "@storybook/node-logger": "7.1.0-alpha.36", "remark-gfm": "^3.0.1", "ts-dedent": "^2.0.0" }, diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 172e77f62d11..68a527fea47b 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.35", + "version": "7.1.0-alpha.36", "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.35", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35" + "@storybook/preview-api": "7.1.0-alpha.36" }, "devDependencies": { "@types/webpack-env": "^1.16.0", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index f2ae12055250..22947391e884 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/instrumenter": "7.1.0-alpha.35", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/instrumenter": "7.1.0-alpha.36", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "jest-mock": "^29.5.0", "polished": "^4.2.2", "ts-dedent": "^2.2.0" diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 9b7b9c2b513c..395e82c77df3 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", "react-resize-detector": "^7.1.2", "tiny-invariant": "^1.3.1", "upath": "^2.0.1" diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 7727ff578693..7f82bdc64046 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/csf": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/router": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/router": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "prop-types": "^15.7.2", "ts-dedent": "^2.0.0" }, diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 2dedc46d59f6..6d08e4fcb178 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "tiny-invariant": "^1.3.1" }, "devDependencies": { diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index b392a3385d87..f369a2b18723 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/code/addons/storyshots-core/package.json b/code/addons/storyshots-core/package.json index da965355fdc9..e90c5141197b 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/core-webpack": "7.1.0-alpha.35", + "@storybook/client-api": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/core-webpack": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@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.35", - "@storybook/angular": "7.1.0-alpha.35", - "@storybook/react": "7.1.0-alpha.35", - "@storybook/vue": "7.1.0-alpha.35", - "@storybook/vue3": "7.1.0-alpha.35", + "@storybook/addon-docs": "7.1.0-alpha.36", + "@storybook/angular": "7.1.0-alpha.36", + "@storybook/react": "7.1.0-alpha.36", + "@storybook/vue": "7.1.0-alpha.36", + "@storybook/vue3": "7.1.0-alpha.36", "babel-loader": "^9.1.2", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.5", diff --git a/code/addons/storyshots-puppeteer/package.json b/code/addons/storyshots-puppeteer/package.json index a59c5026860e..990289d11315 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@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.35", + "@storybook/addon-storyshots": "7.1.0-alpha.36", "puppeteer": ">=2.0.0" }, "peerDependenciesMeta": { diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 64a1f1a5d5eb..cc6c8ffef446 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/router": "7.1.0-alpha.35", - "@storybook/source-loader": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/router": "7.1.0-alpha.36", + "@storybook/source-loader": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", "estraverse": "^5.2.0", "prop-types": "^15.7.2", "react-syntax-highlighter": "^15.5.0", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index 7065047210c1..8a609a808d0f 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35" + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36" }, "devDependencies": { "typescript": "~4.9.3" diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 2fc378e4f6e2..abe22b56ddfc 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", "memoizerific": "^1.11.3", "prop-types": "^15.7.2" }, diff --git a/code/builders/builder-manager/package.json b/code/builders/builder-manager/package.json index 6552053a6bde..6a3aae476b05 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.35", + "version": "7.1.0-alpha.36", "description": "Storybook manager builder", "keywords": [ "storybook" @@ -44,9 +44,9 @@ }, "dependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/manager": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/manager": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", "@types/ejs": "^3.1.1", "@types/find-cache-dir": "^3.2.1", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10", diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index 909155f513fe..5d2da72ab56f 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.35", + "version": "7.1.0-alpha.36", "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,15 +42,15 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/csf-plugin": "7.1.0-alpha.35", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/csf-plugin": "7.1.0-alpha.36", "@storybook/mdx2-csf": "^1.0.0", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/preview": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/preview": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/find-cache-dir": "^3.2.1", "browser-assert": "^1.2.1", "es-module-lexer": "^0.9.3", diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 6ab41156c3a4..b2c1cf809ae3 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.35", + "version": "7.1.0-alpha.36", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -56,24 +56,24 @@ }, "dependencies": { "@babel/core": "^7.22.0", - "@storybook/addons": "7.1.0-alpha.35", - "@storybook/api": "7.1.0-alpha.35", - "@storybook/channel-postmessage": "7.1.0-alpha.35", - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-api": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", - "@storybook/core-webpack": "7.1.0-alpha.35", + "@storybook/addons": "7.1.0-alpha.36", + "@storybook/api": "7.1.0-alpha.36", + "@storybook/channel-postmessage": "7.1.0-alpha.36", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-api": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", + "@storybook/core-webpack": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/preview": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/router": "7.1.0-alpha.35", - "@storybook/store": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/preview": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/router": "7.1.0-alpha.36", + "@storybook/store": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", "@swc/core": "^1.3.49", "@types/node": "^16.0.0", "@types/semver": "^7.3.4", diff --git a/code/deprecated/addons/package.json b/code/deprecated/addons/package.json index 48ab897bb400..f6214ab4b14f 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.35", + "version": "7.1.0-alpha.36", "description": "Storybook addons store", "keywords": [ "storybook" @@ -44,9 +44,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35" + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/code/deprecated/channel-postmessage/package.json b/code/deprecated/channel-postmessage/package.json index e3d6c7a36f94..f9277d9a0078 100644 --- a/code/deprecated/channel-postmessage/package.json +++ b/code/deprecated/channel-postmessage/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-postmessage", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" @@ -43,8 +43,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35" + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36" }, "devDependencies": { "typescript": "~4.9.3" diff --git a/code/deprecated/channel-websocket/package.json b/code/deprecated/channel-websocket/package.json index eaec8a605bd5..1670c5932e0f 100644 --- a/code/deprecated/channel-websocket/package.json +++ b/code/deprecated/channel-websocket/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-websocket", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" @@ -43,8 +43,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35" + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36" }, "devDependencies": { "typescript": "~4.9.3" diff --git a/code/deprecated/client-api/package.json b/code/deprecated/client-api/package.json index 9a41a50a7d18..062bf82f636a 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.35", + "version": "7.1.0-alpha.36", "description": "Storybook Client API", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35" + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36" }, "publishConfig": { "access": "public" diff --git a/code/deprecated/core-client/package.json b/code/deprecated/core-client/package.json index d0c69e75759c..32f64788ed31 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.35", + "version": "7.1.0-alpha.36", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -35,8 +35,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35" + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36" }, "publishConfig": { "access": "public" diff --git a/code/deprecated/manager-api-shim/package.json b/code/deprecated/manager-api-shim/package.json index 8d8bf29f729c..ec91b7bece3e 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.35", + "version": "7.1.0-alpha.36", "description": "Storybook Manager API (facade)", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/manager-api": "7.1.0-alpha.35" + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/manager-api": "7.1.0-alpha.36" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/code/deprecated/preview-web/package.json b/code/deprecated/preview-web/package.json index f7475a0ff523..5212af1811a3 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.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35" + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36" }, "publishConfig": { "access": "public" diff --git a/code/deprecated/store/package.json b/code/deprecated/store/package.json index 1d014544a5cc..683eb9d464e9 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.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35" + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36" }, "publishConfig": { "access": "public" diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 5a93e03b20ce..3a4224c52e8f 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/cli": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", - "@storybook/core-server": "7.1.0-alpha.35", - "@storybook/core-webpack": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/cli": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", + "@storybook/core-server": "7.1.0-alpha.36", + "@storybook/core-webpack": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/telemetry": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/telemetry": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/node": "^16.0.0", "@types/react": "^16.14.34", "@types/react-dom": "^16.9.14", diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index e7f03e134bb5..740fc21852c9 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index e81ab99a0c19..c0c14a2a9440 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.35", + "version": "7.1.0-alpha.36", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,14 +47,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.1.0-alpha.35", - "@storybook/builder-vite": "7.1.0-alpha.35", - "@storybook/channel-postmessage": "7.1.0-alpha.35", - "@storybook/client-api": "7.1.0-alpha.35", - "@storybook/core-server": "7.1.0-alpha.35", - "@storybook/html": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/preview-web": "7.1.0-alpha.35", + "@storybook/addons": "7.1.0-alpha.36", + "@storybook/builder-vite": "7.1.0-alpha.36", + "@storybook/channel-postmessage": "7.1.0-alpha.36", + "@storybook/client-api": "7.1.0-alpha.36", + "@storybook/core-server": "7.1.0-alpha.36", + "@storybook/html": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/preview-web": "7.1.0-alpha.36", "magic-string": "^0.30.0" }, "devDependencies": { diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 9182cbd028f0..e9825d35b282 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/core-common": "7.1.0-alpha.35", + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/html": "7.1.0-alpha.35", - "@storybook/preset-html-webpack": "7.1.0-alpha.35", + "@storybook/html": "7.1.0-alpha.36", + "@storybook/preset-html-webpack": "7.1.0-alpha.36", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index 9ea65588abc7..c087138f3ec6 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.35", + "version": "7.1.0-alpha.36", "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.35", - "@storybook/builder-webpack5": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/preset-react-webpack": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/react": "7.1.0-alpha.35", + "@storybook/addon-actions": "7.1.0-alpha.36", + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/preset-react-webpack": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/react": "7.1.0-alpha.36", "@types/node": "^16.0.0", "css-loader": "^6.7.3", "find-up": "^5.0.0", 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/preact-vite/package.json b/code/frameworks/preact-vite/package.json index 7b035b608475..37c0ac5db03d 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-vite", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,8 +47,8 @@ }, "dependencies": { "@preact/preset-vite": "^2.0.0", - "@storybook/builder-vite": "7.1.0-alpha.35", - "@storybook/preact": "7.1.0-alpha.35" + "@storybook/builder-vite": "7.1.0-alpha.36", + "@storybook/preact": "7.1.0-alpha.36" }, "devDependencies": { "@types/node": "^16.0.0", diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index 009767dfb686..d1ba20fed705 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-webpack5", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" @@ -47,10 +47,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/preact": "7.1.0-alpha.35", - "@storybook/preset-preact-webpack": "7.1.0-alpha.35", + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/preact": "7.1.0-alpha.36", + "@storybook/preset-preact-webpack": "7.1.0-alpha.36", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 918c4730a45a..841dd5ad97cb 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-vite", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -49,8 +49,8 @@ "dependencies": { "@joshwooding/vite-plugin-react-docgen-typescript": "0.2.1", "@rollup/pluginutils": "^5.0.2", - "@storybook/builder-vite": "7.1.0-alpha.35", - "@storybook/react": "7.1.0-alpha.35", + "@storybook/builder-vite": "7.1.0-alpha.36", + "@storybook/react": "7.1.0-alpha.36", "@vitejs/plugin-react": "^3.0.1", "ast-types": "^0.14.2", "magic-string": "^0.30.0", diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index ee360aa528f6..a6f170361a92 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-webpack5", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,9 +47,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.1.0-alpha.35", - "@storybook/preset-react-webpack": "7.1.0-alpha.35", - "@storybook/react": "7.1.0-alpha.35", + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/preset-react-webpack": "7.1.0-alpha.36", + "@storybook/react": "7.1.0-alpha.36", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index 9c2bd6090e25..d4b61994ec39 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server-webpack5", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,10 +47,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/preset-server-webpack": "7.1.0-alpha.35", - "@storybook/server": "7.1.0-alpha.35", + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/preset-server-webpack": "7.1.0-alpha.36", + "@storybook/server": "7.1.0-alpha.36", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index ea6a531cd8f0..475efd9bac19 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-vite", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,9 +47,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/svelte": "7.1.0-alpha.35", + "@storybook/builder-vite": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/svelte": "7.1.0-alpha.36", "@sveltejs/vite-plugin-svelte": "^2.0.0", "magic-string": "^0.30.0", "svelte": "^3.0.0", diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index f6957537839e..d17180ce7681 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-webpack5", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,10 +47,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/preset-svelte-webpack": "7.1.0-alpha.35", - "@storybook/svelte": "7.1.0-alpha.35" + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/preset-svelte-webpack": "7.1.0-alpha.36", + "@storybook/svelte": "7.1.0-alpha.36" }, "devDependencies": { "svelte": "^3.48.0", diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 0969be403f74..e49db612eb27 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for SvelteKit", "keywords": [ "storybook", @@ -50,9 +50,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.1.0-alpha.35", - "@storybook/svelte": "7.1.0-alpha.35", - "@storybook/svelte-vite": "7.1.0-alpha.35" + "@storybook/builder-vite": "7.1.0-alpha.36", + "@storybook/svelte": "7.1.0-alpha.36", + "@storybook/svelte-vite": "7.1.0-alpha.36" }, "devDependencies": { "@types/node": "^16.0.0", diff --git a/code/frameworks/vue-vite/package.json b/code/frameworks/vue-vite/package.json index c23b175d98a0..9b5df38c1b40 100644 --- a/code/frameworks/vue-vite/package.json +++ b/code/frameworks/vue-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue-vite", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Vue2 and Vite: Develop Vue2 Components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,10 +47,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/core-server": "7.1.0-alpha.35", - "@storybook/vue": "7.1.0-alpha.35", + "@storybook/builder-vite": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/core-server": "7.1.0-alpha.36", + "@storybook/vue": "7.1.0-alpha.36", "magic-string": "^0.30.0", "vue-docgen-api": "^4.40.0" }, diff --git a/code/frameworks/vue-webpack5/package.json b/code/frameworks/vue-webpack5/package.json index 7f01d9f325ae..6b55868b81fb 100644 --- a/code/frameworks/vue-webpack5/package.json +++ b/code/frameworks/vue-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue-webpack5", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,10 +47,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/preset-vue-webpack": "7.1.0-alpha.35", - "@storybook/vue": "7.1.0-alpha.35", + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/preset-vue-webpack": "7.1.0-alpha.36", + "@storybook/vue": "7.1.0-alpha.36", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 4e5fe7055c63..40f915fc1b78 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-vite", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,9 +47,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.1.0-alpha.35", - "@storybook/core-server": "7.1.0-alpha.35", - "@storybook/vue3": "7.1.0-alpha.35", + "@storybook/builder-vite": "7.1.0-alpha.36", + "@storybook/core-server": "7.1.0-alpha.36", + "@storybook/vue3": "7.1.0-alpha.36", "@vitejs/plugin-vue": "^4.0.0", "magic-string": "^0.30.0", "vue-docgen-api": "^4.40.0" diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 4fab0ddb4e8f..ea047320bcca 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-webpack5", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,10 +47,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/preset-vue3-webpack": "7.1.0-alpha.35", - "@storybook/vue3": "7.1.0-alpha.35", + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/preset-vue3-webpack": "7.1.0-alpha.36", + "@storybook/vue3": "7.1.0-alpha.36", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 5b45bf69ff58..f5bee4af29b4 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-vite", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,10 +47,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.1.0-alpha.35", - "@storybook/core-server": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/web-components": "7.1.0-alpha.35", + "@storybook/builder-vite": "7.1.0-alpha.36", + "@storybook/core-server": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/web-components": "7.1.0-alpha.36", "magic-string": "^0.30.0" }, "devDependencies": { diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index f0f6569b8f7e..54b643a1a61c 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components-webpack5", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", @@ -51,10 +51,10 @@ }, "dependencies": { "@babel/preset-env": "^7.22.0", - "@storybook/builder-webpack5": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/preset-web-components-webpack": "7.1.0-alpha.35", - "@storybook/web-components": "7.1.0-alpha.35", + "@storybook/builder-webpack5": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/preset-web-components-webpack": "7.1.0-alpha.36", + "@storybook/web-components": "7.1.0-alpha.36", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/lib/channels/package.json b/code/lib/channels/package.json index 7ba9d3fb3391..2fbdb4ffb607 100644 --- a/code/lib/channels/package.json +++ b/code/lib/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" @@ -68,9 +68,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", "qs": "^6.10.0", "telejson": "^7.0.3", diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index 200eb043536a..00a37a8c3dac 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook CLI", "keywords": [ "storybook" @@ -21,7 +21,7 @@ "license": "MIT", "bin": "./index.js", "dependencies": { - "@storybook/cli": "7.1.0-alpha.35" + "@storybook/cli": "7.1.0-alpha.36" }, "publishConfig": { "access": "public" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index fee99117d3de..1304f7fedfcc 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook CLI", "keywords": [ "storybook" @@ -24,7 +24,7 @@ "storybook": "./index.js" }, "dependencies": { - "@storybook/cli": "7.1.0-alpha.35" + "@storybook/cli": "7.1.0-alpha.36" }, "publishConfig": { "access": "public" diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index 6b478afef040..fea87e912468 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook's CLI - easiest method of adding storybook to your projects", "keywords": [ "cli", @@ -57,15 +57,16 @@ "@babel/core": "^7.22.0", "@babel/preset-env": "^7.22.0", "@ndelangen/get-tarball": "^3.0.7", - "@storybook/codemod": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/core-server": "7.1.0-alpha.35", - "@storybook/csf-tools": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/telemetry": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/codemod": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/core-server": "7.1.0-alpha.36", + "@storybook/csf-tools": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/telemetry": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/semver": "^7.3.4", - "boxen": "^5.1.2", + "@yarnpkg/fslib": "^2.10.3", + "@yarnpkg/libzip": "^2.3.0", "chalk": "^4.1.0", "commander": "^6.2.1", "cross-spawn": "^7.0.3", @@ -94,12 +95,13 @@ "util-deprecate": "^1.0.2" }, "devDependencies": { - "@storybook/client-api": "7.1.0-alpha.35", + "@storybook/client-api": "7.1.0-alpha.36", "@types/cross-spawn": "^6.0.2", "@types/prompts": "^2.0.9", "@types/puppeteer-core": "^2.1.0", "@types/semver": "^7.3.4", "@types/util-deprecate": "^1.0.0", + "boxen": "^5.1.2", "slash": "^5.0.0", "strip-json-comments": "^3.1.1", "typescript": "~4.9.3" diff --git a/code/lib/cli/src/add.ts b/code/lib/cli/src/add.ts index efced649c957..7b9aca413e16 100644 --- a/code/lib/cli/src/add.ts +++ b/code/lib/cli/src/add.ts @@ -11,6 +11,7 @@ import { useNpmWarning, type PackageManagerName, } from './js-package-manager'; +import { getStorybookVersion } from './utils'; const logger = console; @@ -83,7 +84,7 @@ export async function add( const packageJson = await packageManager.retrievePackageJson(); const [addonName, versionSpecifier] = getVersionSpecifier(addon); - const { mainConfig, version: storybookVersion } = getStorybookInfo(packageJson); + const { mainConfig } = getStorybookInfo(packageJson); if (!mainConfig) { logger.error('Unable to find storybook main.js config'); return; @@ -97,8 +98,9 @@ export async function add( // add to package.json const isStorybookAddon = addonName.startsWith('@storybook/'); + const storybookVersion = await getStorybookVersion(packageManager); const version = versionSpecifier || (isStorybookAddon ? storybookVersion : latestVersion); - const addonWithVersion = `${addonName}@${version}`; + const addonWithVersion = `${addonName}@^${version}`; logger.log(`Installing ${addonWithVersion}`); await packageManager.addDependencies({ installAsDevDependencies: true }, [addonWithVersion]); diff --git a/code/lib/cli/src/automigrate/fixes/add-react.test.ts b/code/lib/cli/src/automigrate/fixes/add-react.test.ts index 42bb20b60e2e..4602a30d3ecd 100644 --- a/code/lib/cli/src/automigrate/fixes/add-react.test.ts +++ b/code/lib/cli/src/automigrate/fixes/add-react.test.ts @@ -1,3 +1,4 @@ +import type { StorybookConfig } from '@storybook/types'; import type { JsPackageManager, PackageJson } from '../../js-package-manager'; import { addReact } from './add-react'; @@ -5,7 +6,12 @@ const checkAddReact = async (packageJson: PackageJson) => { const packageManager = { retrievePackageJson: async () => ({ dependencies: {}, devDependencies: {}, ...packageJson }), } as JsPackageManager; - return addReact.check({ packageManager }); + + return addReact.check({ + packageManager, + mainConfig: {} as StorybookConfig, + storybookVersion: '7.0.0', + }); }; describe('addReact fix', () => { diff --git a/code/lib/cli/src/automigrate/fixes/angular-builders-multiproject.test.ts b/code/lib/cli/src/automigrate/fixes/angular-builders-multiproject.test.ts index b376cca15a30..b9066b9c48f2 100644 --- a/code/lib/cli/src/automigrate/fixes/angular-builders-multiproject.test.ts +++ b/code/lib/cli/src/automigrate/fixes/angular-builders-multiproject.test.ts @@ -1,25 +1,20 @@ import type { StorybookConfig } from '@storybook/types'; -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; +import type { JsPackageManager } from '../../js-package-manager'; import { angularBuildersMultiproject } from './angular-builders-multiproject'; import * as helpers from '../../helpers'; import * as angularHelpers from '../../generators/ANGULAR/helpers'; const checkAngularBuilders = async ({ - packageJson, - main: mainConfig = {}, - storybookVersion = '7.0.0', + packageManager, + mainConfig = {}, }: { - packageJson: PackageJson; - main?: Partial & Record; - storybookVersion?: string; + packageManager: Partial; + mainConfig?: Partial; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - - // mock file system (look at eslint plugin test) - return angularBuildersMultiproject.check({ - packageManager: makePackageManager(packageJson), + packageManager: packageManager as any, + mainConfig: mainConfig as any, + storybookVersion: '7.0.0', }); }; @@ -34,51 +29,69 @@ jest.mock('../../generators/ANGULAR/helpers', () => ({ })); describe('is Nx project', () => { + const packageManager = { + getPackageVersion: () => { + return null; + }, + } as Partial; + beforeEach(() => { - (helpers.isNxProject as any as jest.SpyInstance).mockReturnValue(true); + (helpers.isNxProject as any as jest.SpyInstance).mockResolvedValue(true); }); it('should return null', async () => { - const packageJson = { - dependencies: { '@storybook/angular': '^7.0.0-alpha.0' }, - }; - - await expect(checkAngularBuilders({ packageJson })).resolves.toBeNull(); + await expect(checkAngularBuilders({ packageManager })).resolves.toBeNull(); }); }); describe('is not Nx project', () => { beforeEach(() => { - (helpers.isNxProject as any as jest.SpyInstance).mockReturnValue(false); + (helpers.isNxProject as any as jest.SpyInstance).mockResolvedValue(false); }); describe('angular builders', () => { afterEach(jest.restoreAllMocks); describe('Angular not found', () => { - const packageJson = { - dependencies: { '@storybook/angular': '^7.0.0-alpha.0' }, - }; + const packageManager = { + getPackageVersion: jest.fn().mockResolvedValue(null), + } as Partial; it('should return null', async () => { - await expect(checkAngularBuilders({ packageJson })).resolves.toBeNull(); + await expect( + checkAngularBuilders({ packageManager, mainConfig: { framework: '@storybook/angular' } }) + ).resolves.toBeNull(); }); }); describe('Angular < 14.0.0', () => { - const packageJson = { - dependencies: { '@storybook/angular': '^7.0.0-alpha.0', '@angular/core': '^12.0.0' }, - }; + const packageManager = { + getPackageVersion: (packageName) => { + if (packageName === '@angular/core') { + return Promise.resolve('12.0.0'); + } + + return null; + }, + } as Partial; it('should return null', async () => { - await expect(checkAngularBuilders({ packageJson })).resolves.toBeNull(); + await expect( + checkAngularBuilders({ packageManager, mainConfig: { framework: '@storybook/angular' } }) + ).resolves.toBeNull(); }); }); describe('Angular >= 14.0.0', () => { - const packageJson = { - dependencies: { '@storybook/angular': '^7.0.0-alpha.0', '@angular/core': '^15.0.0' }, - }; + const packageManager = { + getPackageVersion: (packageName) => { + if (packageName === '@angular/core') { + return Promise.resolve('15.0.0'); + } + + return null; + }, + } as Partial; describe('has one Storybook builder defined', () => { beforeEach(() => { @@ -89,7 +102,12 @@ describe('is not Nx project', () => { }); it('should return null', async () => { - await expect(checkAngularBuilders({ packageJson })).resolves.toBeNull(); + await expect( + checkAngularBuilders({ + packageManager, + mainConfig: { framework: '@storybook/angular' }, + }) + ).resolves.toBeNull(); }); }); @@ -106,7 +124,12 @@ describe('is not Nx project', () => { }); it('should return null', async () => { - await expect(checkAngularBuilders({ packageJson })).resolves.toBeNull(); + await expect( + checkAngularBuilders({ + packageManager, + mainConfig: { framework: '@storybook/angular' }, + }) + ).resolves.toBeNull(); }); }); @@ -124,7 +147,12 @@ describe('is not Nx project', () => { }); it('should return an empty object', async () => { - await expect(checkAngularBuilders({ packageJson })).resolves.toMatchObject({}); + await expect( + checkAngularBuilders({ + packageManager, + mainConfig: { framework: '@storybook/angular' }, + }) + ).resolves.toMatchObject({}); }); }); }); diff --git a/code/lib/cli/src/automigrate/fixes/angular-builders-multiproject.ts b/code/lib/cli/src/automigrate/fixes/angular-builders-multiproject.ts index 2cd0a42fa987..1c543f1a5504 100644 --- a/code/lib/cli/src/automigrate/fixes/angular-builders-multiproject.ts +++ b/code/lib/cli/src/automigrate/fixes/angular-builders-multiproject.ts @@ -4,6 +4,7 @@ import chalk from 'chalk'; import type { Fix } from '../types'; import { isNxProject } from '../../helpers'; import { AngularJSON } from '../../generators/ANGULAR/helpers'; +import { getFrameworkPackageName } from '../helpers/mainConfigFile'; // eslint-disable-next-line @typescript-eslint/no-empty-interface interface AngularBuildersMultiprojectRunOptions {} @@ -12,25 +13,17 @@ export const angularBuildersMultiproject: Fix throw an error (only supports ng 14) - if (semver.lt(angularCoerced, '14.0.0')) { + const angularVersion = await packageManager.getPackageVersion('@angular/core'); + const frameworkPackageName = getFrameworkPackageName(mainConfig); + + if ( + (await isNxProject(packageManager)) || + frameworkPackageName !== '@storybook/angular' || + !angularVersion || + semver.lt(angularVersion, '14.0.0') + ) { return null; } diff --git a/code/lib/cli/src/automigrate/fixes/angular-builders.test.ts b/code/lib/cli/src/automigrate/fixes/angular-builders.test.ts index d7505da9e567..8f1f0650deb6 100644 --- a/code/lib/cli/src/automigrate/fixes/angular-builders.test.ts +++ b/code/lib/cli/src/automigrate/fixes/angular-builders.test.ts @@ -1,25 +1,22 @@ import type { StorybookConfig } from '@storybook/types'; -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; import { angularBuilders } from './angular-builders'; import * as helpers from '../../helpers'; import * as angularHelpers from '../../generators/ANGULAR/helpers'; +import type { JsPackageManager } from '../../js-package-manager'; const checkAngularBuilders = async ({ - packageJson, - main: mainConfig = {}, + packageManager, + mainConfig = {}, storybookVersion = '7.0.0', }: { - packageJson: PackageJson; - main?: Partial & Record; + packageManager: Partial; + mainConfig?: Partial; storybookVersion?: string; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - - // mock file system (look at eslint plugin test) - return angularBuilders.check({ - packageManager: makePackageManager(packageJson), + packageManager: packageManager as any, + storybookVersion, + mainConfig: mainConfig as any, }); }; @@ -35,50 +32,70 @@ jest.mock('../../generators/ANGULAR/helpers', () => ({ describe('is Nx project', () => { beforeEach(() => { - (helpers.isNxProject as any as jest.SpyInstance).mockReturnValue(true); + (helpers.isNxProject as any as jest.SpyInstance).mockResolvedValue(true); }); - it('should return null', async () => { - const packageJson = { - dependencies: { '@storybook/angular': '^7.0.0-alpha.0' }, - }; + const packageManager = { + getPackageVersion: jest.fn().mockImplementation((packageName) => { + if (packageName === '@angular/core') { + return '12.0.0'; + } + + return null; + }), + } as Partial; - await expect(checkAngularBuilders({ packageJson })).resolves.toBeNull(); + it('should return null', async () => { + await expect(checkAngularBuilders({ packageManager })).resolves.toBeNull(); }); }); describe('is not Nx project', () => { beforeEach(() => { - (helpers.isNxProject as any as jest.SpyInstance).mockReturnValue(false); + (helpers.isNxProject as any as jest.SpyInstance).mockResolvedValue(false); }); describe('angular builders', () => { afterEach(jest.restoreAllMocks); describe('Angular not found', () => { - const packageJson = { - dependencies: { '@storybook/angular': '^7.0.0-alpha.0' }, - }; + const packageManager = { + getPackageVersion: jest.fn().mockReturnValue(null), + } as Partial; it('should return null', async () => { - await expect(checkAngularBuilders({ packageJson })).resolves.toBeNull(); + await expect(checkAngularBuilders({ packageManager })).resolves.toBeNull(); }); }); describe('Angular < 14.0.0', () => { - const packageJson = { - dependencies: { '@storybook/angular': '^7.0.0-alpha.0', '@angular/core': '^12.0.0' }, - }; + const packageManager = { + getPackageVersion: (packageName: string) => { + if (packageName === '@angular/core') { + return Promise.resolve('12.0.0'); + } + + return null; + }, + } as Partial; it('should throw an Error', async () => { - await expect(checkAngularBuilders({ packageJson })).rejects.toThrowErrorMatchingSnapshot(); + await expect( + checkAngularBuilders({ packageManager, mainConfig: { framework: '@storybook/angular' } }) + ).rejects.toThrowErrorMatchingSnapshot(); }); }); describe('Angular >= 14.0.0', () => { - const packageJson = { - dependencies: { '@storybook/angular': '^7.0.0-alpha.0', '@angular/core': '^15.0.0' }, - }; + const packageManager = { + getPackageVersion: (packageName) => { + if (packageName === '@angular/core') { + return Promise.resolve('15.0.0'); + } + + return null; + }, + } as Partial; describe('has one Storybook builder defined', () => { beforeEach(() => { @@ -89,7 +106,12 @@ describe('is not Nx project', () => { }); it('should return null', async () => { - await expect(checkAngularBuilders({ packageJson })).resolves.toBeNull(); + await expect( + checkAngularBuilders({ + packageManager, + mainConfig: { framework: '@storybook/angular' }, + }) + ).resolves.toBeNull(); }); }); @@ -107,7 +129,12 @@ describe('is not Nx project', () => { }); it('should return null', async () => { - await expect(checkAngularBuilders({ packageJson })).resolves.toBeNull(); + await expect( + checkAngularBuilders({ + packageManager, + mainConfig: { framework: '@storybook/angular' }, + }) + ).resolves.toBeNull(); }); }); @@ -124,7 +151,12 @@ describe('is not Nx project', () => { }); it('should proceed and return data', async () => { - await expect(checkAngularBuilders({ packageJson })).resolves.toMatchObject({ + await expect( + checkAngularBuilders({ + packageManager, + mainConfig: { framework: '@storybook/angular' }, + }) + ).resolves.toMatchObject({ mainConfig: {}, packageManager: {}, }); diff --git a/code/lib/cli/src/automigrate/fixes/angular-builders.ts b/code/lib/cli/src/automigrate/fixes/angular-builders.ts index 884db5e9f0b6..7063fcc8dcb3 100644 --- a/code/lib/cli/src/automigrate/fixes/angular-builders.ts +++ b/code/lib/cli/src/automigrate/fixes/angular-builders.ts @@ -4,10 +4,10 @@ import type { StorybookConfig } from '@storybook/types'; import chalk from 'chalk'; import prompts from 'prompts'; import type { Fix } from '../types'; -import { getStorybookData } from '../helpers/mainConfigFile'; import { isNxProject } from '../../helpers'; import { AngularJSON } from '../../generators/ANGULAR/helpers'; import type { JsPackageManager } from '../../js-package-manager'; +import { getFrameworkPackageName } from '../helpers/mainConfigFile'; interface AngularBuildersRunOptions { mainConfig: StorybookConfig; @@ -17,25 +17,21 @@ interface AngularBuildersRunOptions { export const angularBuilders: Fix = { id: 'angular-builders', - async check({ packageManager, configDir }) { - const packageJSON = await packageManager.retrievePackageJson(); + async check({ packageManager, mainConfig }) { + const angularVersion = await packageManager.getPackageVersion('@angular/core'); - // Skip in case of NX - if (isNxProject(packageJSON)) { - return null; - } - const allDependencies = await packageManager.getAllDependencies(); + const framewworkPackageName = getFrameworkPackageName(mainConfig); - const angularVersion = allDependencies['@angular/core']; - const angularCoerced = semver.coerce(angularVersion)?.version; - - // skip non-angular projects - if (!angularCoerced) { + // Skip in case of NX + if ( + !angularVersion || + (await isNxProject(packageManager)) || + framewworkPackageName !== '@storybook/angular' + ) { return null; } - // Is Angular version lower than 14? -> throw an error (only supports ng 14) - if (semver.lt(angularCoerced, '14.0.0')) { + if (semver.lt(angularVersion, '14.0.0')) { throw new Error(dedent` ❌ Your project uses Angular < 14.0.0. Storybook 7.0 for Angular requires Angular 14.0.0 or higher. Please upgrade your Angular version to at least version 14.0.0 to use Storybook 7.0 in your project. @@ -55,8 +51,6 @@ export const angularBuilders: Fix = { return null; } - const { mainConfig } = await getStorybookData({ configDir, packageManager }); - return { mainConfig, packageManager, diff --git a/code/lib/cli/src/automigrate/fixes/angular12.test.ts b/code/lib/cli/src/automigrate/fixes/angular12.test.ts deleted file mode 100644 index f0aaaf774b0a..000000000000 --- a/code/lib/cli/src/automigrate/fixes/angular12.test.ts +++ /dev/null @@ -1,130 +0,0 @@ -import type { StorybookConfig } from '@storybook/types'; -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; -import { angular12 } from './angular12'; - -const checkAngular12 = async ({ - packageJson, - main: mainConfig = {}, - storybookVersion = '7.0.0', -}: { - packageJson: PackageJson; - main?: Partial & Record; - storybookVersion?: string; -}) => { - mockStorybookData({ mainConfig, storybookVersion }); - - return angular12.check({ - packageManager: makePackageManager(packageJson), - configDir: '', - }); -}; - -describe('angular12 fix', () => { - afterEach(jest.restoreAllMocks); - - describe('sb < 6.3', () => { - describe('angular12 dependency', () => { - const packageJson = { - dependencies: { '@storybook/angular': '^6.2.0', '@angular/core': '^12.0.0' }, - }; - it('should fail', async () => { - await expect( - checkAngular12({ - packageJson, - storybookVersion: '6.2.0', - }) - ).rejects.toThrow(); - }); - }); - describe('no angular dependency', () => { - const packageJson = { dependencies: { '@storybook/angular': '^6.2.0' } }; - it('should no-op', async () => { - await expect( - checkAngular12({ - packageJson, - main: {}, - }) - ).resolves.toBeFalsy(); - }); - }); - }); - describe('sb 6.3 - 7.0', () => { - describe('angular12 dependency', () => { - const packageJson = { - dependencies: { '@storybook/angular': '^6.3.0', '@angular/core': '^12.0.0' }, - }; - describe('webpack5 builder', () => { - it('should no-op', async () => { - await expect( - checkAngular12({ - packageJson, - main: { core: { builder: 'webpack5' } }, - storybookVersion: '6.3.0', - }) - ).resolves.toBeFalsy(); - }); - }); - describe('custom builder', () => { - it('should no-op', async () => { - await expect( - checkAngular12({ - packageJson, - main: { core: { builder: 'storybook-builder-vite' } }, - }) - ).resolves.toBeFalsy(); - }); - }); - describe('webpack4 builder', () => { - it('should add webpack5 builder', async () => { - await expect( - checkAngular12({ - packageJson, - main: { core: { builder: 'webpack4' } }, - storybookVersion: '6.3.0', - }) - ).resolves.toMatchObject({ - angularVersion: '^12.0.0', - storybookVersion: '6.3.0', - }); - }); - }); - describe('no builder', () => { - it('should add webpack5 builder', async () => { - await expect( - checkAngular12({ - packageJson, - storybookVersion: '6.3.0', - }) - ).resolves.toMatchObject({ - angularVersion: '^12.0.0', - storybookVersion: '6.3.0', - }); - }); - }); - }); - describe('no angular dependency', () => { - it('should no-op', async () => { - await expect( - checkAngular12({ - packageJson: {}, - }) - ).resolves.toBeFalsy(); - }); - }); - }); - describe('sb 7.0+', () => { - describe('angular12 dependency', () => { - const packageJson = { - dependencies: { '@storybook/angular': '^7.0.0-alpha.0', '@angular/core': '^12.0.0' }, - }; - it('should no-op', async () => { - await expect( - checkAngular12({ - packageJson, - }) - ).resolves.toBeFalsy(); - }); - }); - }); -}); diff --git a/code/lib/cli/src/automigrate/fixes/angular12.ts b/code/lib/cli/src/automigrate/fixes/angular12.ts deleted file mode 100644 index c8b98e6b0f00..000000000000 --- a/code/lib/cli/src/automigrate/fixes/angular12.ts +++ /dev/null @@ -1,59 +0,0 @@ -import chalk from 'chalk'; -import { dedent } from 'ts-dedent'; -import semver from 'semver'; -import type { Fix } from '../types'; -import { webpack5 } from './webpack5'; -import { checkWebpack5Builder } from '../helpers/checkWebpack5Builder'; - -interface Angular12RunOptions { - angularVersion: string; - // FIXME angularPresetVersion: string; - storybookVersion: string; -} - -/** - * Is the user upgrading to Angular12? - * - * If so: - * - Run webpack5 fix - */ -export const angular12: Fix = { - id: 'angular12', - - async check({ packageManager, configDir }) { - const allDependencies = await packageManager.getAllDependencies(); - const angularVersion = allDependencies['@angular/core']; - const angularCoerced = semver.coerce(angularVersion)?.version; - - if (!angularCoerced || semver.lt(angularCoerced, '12.0.0')) { - return null; - } - - const builderInfo = await checkWebpack5Builder({ packageManager, configDir }); - return builderInfo ? { angularVersion, ...builderInfo } : null; - }, - - prompt({ angularVersion }) { - const angularFormatted = chalk.cyan(`Angular ${angularVersion}`); - - return dedent` - We've detected you are running ${angularFormatted} which is powered by webpack5. - Your Storybook's main.js files specifies webpack4, which is incompatible. - - In order to work with your version of Angular, we need to install Storybook's ${chalk.cyan( - '@storybook/builder-webpack5' - )}. - - More info: ${chalk.yellow( - 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#angular12-upgrade' - )} - `; - }, - - async run(options) { - return webpack5.run({ - ...options, - result: { webpackVersion: null, ...options.result }, - }); - }, -}; diff --git a/code/lib/cli/src/automigrate/fixes/autodocs-true.test.ts b/code/lib/cli/src/automigrate/fixes/autodocs-true.test.ts index 1876ea7f1e0b..c21de1bd9727 100644 --- a/code/lib/cli/src/automigrate/fixes/autodocs-true.test.ts +++ b/code/lib/cli/src/automigrate/fixes/autodocs-true.test.ts @@ -1,21 +1,19 @@ import type { StorybookConfig } from '@storybook/types'; import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; +import { makePackageManager } from '../helpers/testing-helpers'; import { autodocsTrue } from './autodocs-true'; const checkAutodocs = async ({ packageJson = {}, main: mainConfig, - storybookVersion = '7.0.0', }: { packageJson?: PackageJson; main: Partial & Record; - storybookVersion?: string; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - return autodocsTrue.check({ packageManager: makePackageManager(packageJson), + mainConfig: mainConfig as StorybookConfig, + storybookVersion: '7.0.0', }); }; diff --git a/code/lib/cli/src/automigrate/fixes/autodocs-true.ts b/code/lib/cli/src/automigrate/fixes/autodocs-true.ts index 238c44ebec61..336bd111d39a 100644 --- a/code/lib/cli/src/automigrate/fixes/autodocs-true.ts +++ b/code/lib/cli/src/automigrate/fixes/autodocs-true.ts @@ -4,7 +4,7 @@ import { dedent } from 'ts-dedent'; import type { StorybookConfig } from '@storybook/types'; import type { Fix } from '../types'; -import { getStorybookData, updateMainConfig } from '../helpers/mainConfigFile'; +import { updateMainConfig } from '../helpers/mainConfigFile'; const logger = console; @@ -18,9 +18,7 @@ interface AutodocsTrueFrameworkRunOptions { export const autodocsTrue: Fix = { id: 'autodocsTrue', - async check({ packageManager, configDir }) { - const { mainConfig } = await getStorybookData({ packageManager, configDir }); - + async check({ mainConfig }) { const { docs } = mainConfig; const docsPageToAutodocsMapping = { diff --git a/code/lib/cli/src/automigrate/fixes/bare-mdx-stories-glob.test.ts b/code/lib/cli/src/automigrate/fixes/bare-mdx-stories-glob.test.ts index 38025e609e32..04f6b770f380 100644 --- a/code/lib/cli/src/automigrate/fixes/bare-mdx-stories-glob.test.ts +++ b/code/lib/cli/src/automigrate/fixes/bare-mdx-stories-glob.test.ts @@ -3,7 +3,7 @@ import type { StorybookConfig } from '@storybook/types'; import type { PackageJson } from '../../js-package-manager'; import { ansiRegex } from '../helpers/cleanLog'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; +import { makePackageManager } from '../helpers/testing-helpers'; import type { BareMdxStoriesGlobRunOptions } from './bare-mdx-stories-glob'; import { bareMdxStoriesGlob } from './bare-mdx-stories-glob'; @@ -16,10 +16,10 @@ const checkBareMdxStoriesGlob = async ({ main?: Partial & Record; storybookVersion?: string; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - return bareMdxStoriesGlob.check({ + mainConfig: mainConfig as StorybookConfig, packageManager: makePackageManager(packageJson), + storybookVersion, }); }; diff --git a/code/lib/cli/src/automigrate/fixes/bare-mdx-stories-glob.ts b/code/lib/cli/src/automigrate/fixes/bare-mdx-stories-glob.ts index 4091ee9f7ed9..b4f81f08a8fb 100644 --- a/code/lib/cli/src/automigrate/fixes/bare-mdx-stories-glob.ts +++ b/code/lib/cli/src/automigrate/fixes/bare-mdx-stories-glob.ts @@ -2,7 +2,7 @@ import chalk from 'chalk'; import dedent from 'ts-dedent'; import semver from 'semver'; import type { StoriesEntry } from '@storybook/types'; -import { getStorybookData, updateMainConfig } from '../helpers/mainConfigFile'; +import { updateMainConfig } from '../helpers/mainConfigFile'; import type { Fix } from '../types'; const logger = console; @@ -31,12 +31,7 @@ const getNextGlob = (glob: string) => { export const bareMdxStoriesGlob: Fix = { id: 'bare-mdx-stories-glob', - async check({ packageManager, configDir }) { - const { storybookVersion, mainConfig } = await getStorybookData({ - configDir, - packageManager, - }); - + async check({ storybookVersion, mainConfig }) { if (!semver.gte(storybookVersion, '7.0.0')) { return null; } diff --git a/code/lib/cli/src/automigrate/fixes/builder-vite.test.ts b/code/lib/cli/src/automigrate/fixes/builder-vite.test.ts index 2f54eb0dce7e..20b8f935c0e7 100644 --- a/code/lib/cli/src/automigrate/fixes/builder-vite.test.ts +++ b/code/lib/cli/src/automigrate/fixes/builder-vite.test.ts @@ -1,21 +1,19 @@ import type { StorybookConfig } from '@storybook/types'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; +import { makePackageManager } from '../helpers/testing-helpers'; import type { PackageJson } from '../../js-package-manager'; import { builderVite } from './builder-vite'; const checkBuilderVite = async ({ packageJson = {}, main: mainConfig, - storybookVersion = '7.0.0', }: { packageJson?: PackageJson; main: Partial & Record; - storybookVersion?: string; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - return builderVite.check({ + mainConfig: mainConfig as StorybookConfig, packageManager: makePackageManager(packageJson), + storybookVersion: '7.0.0', }); }; diff --git a/code/lib/cli/src/automigrate/fixes/builder-vite.ts b/code/lib/cli/src/automigrate/fixes/builder-vite.ts index 9fef70b8b9d6..b7ee1317957c 100644 --- a/code/lib/cli/src/automigrate/fixes/builder-vite.ts +++ b/code/lib/cli/src/automigrate/fixes/builder-vite.ts @@ -5,7 +5,7 @@ import { writeConfig } from '@storybook/csf-tools'; import type { Fix } from '../types'; import type { PackageJson } from '../../js-package-manager'; -import { getStorybookData, updateMainConfig } from '../helpers/mainConfigFile'; +import { updateMainConfig } from '../helpers/mainConfigFile'; const logger = console; @@ -26,9 +26,8 @@ interface BuilderViteOptions { export const builderVite: Fix = { id: 'builder-vite', - async check({ configDir, packageManager }) { + async check({ packageManager, mainConfig }) { const packageJson = await packageManager.retrievePackageJson(); - const { mainConfig } = await getStorybookData({ configDir, packageManager }); const builder = mainConfig.core?.builder; const builderName = typeof builder === 'string' ? builder : builder?.name; diff --git a/code/lib/cli/src/automigrate/fixes/cra5.test.ts b/code/lib/cli/src/automigrate/fixes/cra5.test.ts index 24efd73fbc31..15ef6485851d 100644 --- a/code/lib/cli/src/automigrate/fixes/cra5.test.ts +++ b/code/lib/cli/src/automigrate/fixes/cra5.test.ts @@ -1,21 +1,20 @@ import type { StorybookConfig } from '@storybook/types'; -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; +import type { JsPackageManager } from '../../js-package-manager'; import { cra5 } from './cra5'; const checkCra5 = async ({ - packageJson, + packageManager, main: mainConfig, storybookVersion = '7.0.0', }: { - packageJson: PackageJson; + packageManager: any; main?: Partial & Record; storybookVersion?: string; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - return cra5.check({ - packageManager: makePackageManager(packageJson), + packageManager, + mainConfig: mainConfig as StorybookConfig, + storybookVersion, }); }; @@ -24,24 +23,28 @@ describe('cra5 fix', () => { describe('sb < 6.3', () => { describe('cra5 dependency', () => { - const packageJson = { - dependencies: { '@storybook/react': '^6.2.0', 'react-scripts': '^5.0.0' }, - }; + const packageManager = { + getPackageVersion: jest.fn().mockResolvedValue('5.0.0'), + } as Partial; + it('should fail', async () => { await expect( checkCra5({ - packageJson, + packageManager, storybookVersion: '6.2.0', }) ).rejects.toThrow(); }); }); describe('no cra5 dependency', () => { - const packageJson = { dependencies: { '@storybook/react': '^6.2.0' } }; + const packageManager = { + getPackageVersion: jest.fn().mockResolvedValue(null), + } as Partial; + it('should no-op', async () => { await expect( checkCra5({ - packageJson, + packageManager, main: {}, }) ).resolves.toBeFalsy(); @@ -50,14 +53,17 @@ describe('cra5 fix', () => { }); describe('sb 6.3 - 7.0', () => { describe('cra5 dependency', () => { - const packageJson = { - dependencies: { '@storybook/react': '^6.3.0', 'react-scripts': '^5.0.0' }, - }; + const packageManager = { + getPackageVersion: () => { + return Promise.resolve('5.0.0'); + }, + } as Partial; + describe('webpack5 builder', () => { it('should no-op', async () => { await expect( checkCra5({ - packageJson, + packageManager, main: { core: { builder: 'webpack5' } }, }) ).resolves.toBeFalsy(); @@ -67,7 +73,7 @@ describe('cra5 fix', () => { it('should no-op', async () => { await expect( checkCra5({ - packageJson, + packageManager, main: { core: { builder: 'storybook-builder-vite' } }, }) ).resolves.toBeFalsy(); @@ -77,12 +83,12 @@ describe('cra5 fix', () => { it('should add webpack5 builder', async () => { await expect( checkCra5({ - packageJson, + packageManager, main: { core: { builder: 'webpack4' } }, storybookVersion: '6.3.0', }) ).resolves.toMatchObject({ - craVersion: '^5.0.0', + craVersion: '5.0.0', storybookVersion: '6.3.0', }); }); @@ -91,36 +97,44 @@ describe('cra5 fix', () => { it('should add webpack5 builder', async () => { await expect( checkCra5({ - packageJson, + packageManager, main: {}, storybookVersion: '6.3.0', }) ).resolves.toMatchObject({ - craVersion: '^5.0.0', + craVersion: '5.0.0', storybookVersion: '6.3.0', }); }); }); }); describe('no cra dependency', () => { + const packageManager = { + getPackageVersion: () => { + return null; + }, + } as Partial; + it('should no-op', async () => { await expect( checkCra5({ - packageJson: {}, + packageManager, main: {}, }) ).resolves.toBeFalsy(); }); }); describe('cra4 dependency', () => { + const packageManager = { + getPackageVersion: () => { + return Promise.resolve('4.0.0'); + }, + } as Partial; + it('should no-op', async () => { await expect( checkCra5({ - packageJson: { - dependencies: { - 'react-scripts': '4', - }, - }, + packageManager, main: {}, }) ).resolves.toBeFalsy(); @@ -129,13 +143,16 @@ describe('cra5 fix', () => { }); describe('sb 7.0+', () => { describe('cra5 dependency', () => { - const packageJson = { - dependencies: { '@storybook/react': '^7.0.0-alpha.0', 'react-scripts': '^5.0.0' }, - }; + const packageManager = { + getPackageVersion: () => { + return Promise.resolve('5.0.0'); + }, + } as Partial; + it('should no-op', async () => { await expect( checkCra5({ - packageJson, + packageManager, main: {}, }) ).resolves.toBeFalsy(); diff --git a/code/lib/cli/src/automigrate/fixes/cra5.ts b/code/lib/cli/src/automigrate/fixes/cra5.ts index 1280a5de3155..d3786cd2d00f 100644 --- a/code/lib/cli/src/automigrate/fixes/cra5.ts +++ b/code/lib/cli/src/automigrate/fixes/cra5.ts @@ -20,16 +20,14 @@ interface CRA5RunOptions { export const cra5: Fix = { id: 'cra5', - async check({ packageManager, configDir }) { - const allDependencies = await packageManager.getAllDependencies(); - const craVersion = allDependencies['react-scripts']; - const craCoerced = semver.coerce(craVersion)?.version; + async check({ packageManager, mainConfig, storybookVersion }) { + const craVersion = await packageManager.getPackageVersion('react-scripts'); - if (!craCoerced || semver.lt(craCoerced, '5.0.0')) { + if (!craVersion || semver.lt(craVersion, '5.0.0')) { return null; } - const builderInfo = await checkWebpack5Builder({ configDir, packageManager }); + const builderInfo = await checkWebpack5Builder({ mainConfig, storybookVersion }); return builderInfo ? { craVersion, ...builderInfo } : null; }, diff --git a/code/lib/cli/src/automigrate/fixes/eslint-plugin.test.ts b/code/lib/cli/src/automigrate/fixes/eslint-plugin.test.ts index cb242c9b0626..54a527848ae6 100644 --- a/code/lib/cli/src/automigrate/fixes/eslint-plugin.test.ts +++ b/code/lib/cli/src/automigrate/fixes/eslint-plugin.test.ts @@ -41,6 +41,8 @@ const checkEslint = async ({ }); return eslintPlugin.check({ packageManager: makePackageManager(packageJson), + mainConfig: {} as any, + storybookVersion: '7.0.0', }); }; diff --git a/code/lib/cli/src/automigrate/fixes/incompatible-addons.test.ts b/code/lib/cli/src/automigrate/fixes/incompatible-addons.test.ts index 122cb7f7e4f7..46978eba8396 100644 --- a/code/lib/cli/src/automigrate/fixes/incompatible-addons.test.ts +++ b/code/lib/cli/src/automigrate/fixes/incompatible-addons.test.ts @@ -1,27 +1,23 @@ /// ; import type { StorybookConfig } from '@storybook/types'; -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; import { incompatibleAddons } from './incompatible-addons'; -import * as packageVersions from '../helpers/getActualPackageVersions'; - -jest.mock('../helpers/getActualPackageVersions'); +import type { JsPackageManager } from '../../js-package-manager'; const check = async ({ - packageJson, + packageManager, main: mainConfig = {}, storybookVersion = '7.0.0', }: { - packageJson: PackageJson; + packageManager: Partial; main?: Partial & Record; storybookVersion?: string; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - return incompatibleAddons.check({ - packageManager: makePackageManager(packageJson), + packageManager: packageManager as any, configDir: '', + mainConfig: mainConfig as any, + storybookVersion, }); }; @@ -29,27 +25,22 @@ describe('incompatible-addons fix', () => { afterEach(jest.restoreAllMocks); it('should show incompatible addons', async () => { - jest.spyOn(packageVersions, 'getActualPackageVersions').mockReturnValueOnce( - Promise.resolve([ - { - name: '@storybook/addon-essentials', - version: '7.0.0', - }, - { - name: '@storybook/addon-info', - version: '5.3.21', - }, - ]) - ); - - const packageJson = { - dependencies: { - '@storybook/addon-essentials': '^7.0.0', - '@storybook/addon-info': '^6.0.0', - }, - }; await expect( - check({ packageJson, main: { addons: ['@storybook/essentials', '@storybook/addon-info'] } }) + check({ + packageManager: { + getPackageVersion(packageName, basePath) { + switch (packageName) { + case '@storybook/addon-essentials': + return Promise.resolve('7.0.0'); + case '@storybook/addon-info': + return Promise.resolve('5.3.21'); + default: + return Promise.resolve(null); + } + }, + }, + main: { addons: ['@storybook/essentials', '@storybook/addon-info'] }, + }) ).resolves.toEqual({ incompatibleAddonList: [ { @@ -61,20 +52,20 @@ describe('incompatible-addons fix', () => { }); it('no-op when there are no incompatible addons', async () => { - jest.spyOn(packageVersions, 'getActualPackageVersions').mockReturnValueOnce( - Promise.resolve([ - { - name: '@storybook/addon-essentials', - version: '7.0.0', - }, - ]) - ); - - const packageJson = { - dependencies: { '@storybook/addon-essentials': '^7.0.0' }, - }; await expect( - check({ packageJson, main: { addons: ['@storybook/essentials'] } }) + check({ + packageManager: { + getPackageVersion(packageName, basePath) { + switch (packageName) { + case '@storybook/addon-essentials': + return Promise.resolve('7.0.0'); + default: + return Promise.resolve(null); + } + }, + }, + main: { addons: ['@storybook/essentials'] }, + }) ).resolves.toBeNull(); }); }); diff --git a/code/lib/cli/src/automigrate/fixes/incompatible-addons.ts b/code/lib/cli/src/automigrate/fixes/incompatible-addons.ts index 5620da7d45e1..3455408f279d 100644 --- a/code/lib/cli/src/automigrate/fixes/incompatible-addons.ts +++ b/code/lib/cli/src/automigrate/fixes/incompatible-addons.ts @@ -1,7 +1,6 @@ import chalk from 'chalk'; import dedent from 'ts-dedent'; import type { Fix } from '../types'; -import { getStorybookData } from '../helpers/mainConfigFile'; import { getIncompatibleAddons } from '../helpers/getIncompatibleAddons'; interface IncompatibleAddonsOptions { @@ -12,13 +11,8 @@ export const incompatibleAddons: Fix = { id: 'incompatible-addons', promptOnly: true, - async check({ packageManager, configDir }) { - const { mainConfig } = await getStorybookData({ - packageManager, - configDir, - }); - - const incompatibleAddonList = await getIncompatibleAddons(mainConfig); + async check({ mainConfig, packageManager }) { + const incompatibleAddonList = await getIncompatibleAddons(mainConfig, packageManager); return incompatibleAddonList.length > 0 ? { incompatibleAddonList } : null; }, diff --git a/code/lib/cli/src/automigrate/fixes/index.ts b/code/lib/cli/src/automigrate/fixes/index.ts index e1f02b510afc..4de0e7d63689 100644 --- a/code/lib/cli/src/automigrate/fixes/index.ts +++ b/code/lib/cli/src/automigrate/fixes/index.ts @@ -2,7 +2,6 @@ import type { Fix } from '../types'; import { cra5 } from './cra5'; import { webpack5 } from './webpack5'; -import { angular12 } from './angular12'; import { vue3 } from './vue3'; import { mdxgfm } from './mdx-gfm'; import { eslintPlugin } from './eslint-plugin'; @@ -24,15 +23,14 @@ export * from '../types'; export const allFixes: Fix[] = [ nodeJsRequirement, + newFrameworks, cra5, webpack5, - angular12, vue3, eslintPlugin, builderVite, sbBinary, sbScripts, - newFrameworks, incompatibleAddons, removedGlobalClientAPIs, mdx1to2, diff --git a/code/lib/cli/src/automigrate/fixes/mdx-gfm.test.ts b/code/lib/cli/src/automigrate/fixes/mdx-gfm.test.ts index 55ec1971e7c3..e7d7f0c2a30a 100644 --- a/code/lib/cli/src/automigrate/fixes/mdx-gfm.test.ts +++ b/code/lib/cli/src/automigrate/fixes/mdx-gfm.test.ts @@ -1,6 +1,4 @@ import type { StorybookConfig } from '@storybook/types'; -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; import { mdxgfm } from './mdx-gfm'; jest.mock('globby', () => ({ @@ -9,28 +7,27 @@ jest.mock('globby', () => ({ })); const check = async ({ - packageJson, + packageManager, main: mainConfig, storybookVersion = '7.0.0', }: { - packageJson: PackageJson; + packageManager: any; main: Partial & Record; storybookVersion?: string; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - return mdxgfm.check({ - packageManager: makePackageManager(packageJson), + packageManager, configDir: '', + mainConfig: mainConfig as any, + storybookVersion, }); }; describe('no-ops', () => { - const packageJson = {}; test('sb > 7.0', async () => { await expect( check({ - packageJson, + packageManager: {}, main: {}, storybookVersion: '6.2.0', }) @@ -39,7 +36,7 @@ describe('no-ops', () => { test('legacyMdx1', async () => { await expect( check({ - packageJson, + packageManager: {}, main: { features: { legacyMdx1: true, @@ -51,7 +48,7 @@ describe('no-ops', () => { test('with addon docs setup', async () => { await expect( check({ - packageJson, + packageManager: {}, main: { addons: [ { @@ -78,7 +75,7 @@ describe('no-ops', () => { test('with addon migration assistant addon added', async () => { await expect( check({ - packageJson, + packageManager: {}, main: { addons: ['@storybook/addon-mdx-gfm'], }, @@ -88,11 +85,10 @@ describe('no-ops', () => { }); describe('continue', () => { - const packageJson = {}; test('nothing configured at all', async () => { await expect( check({ - packageJson, + packageManager: {}, main: { stories: ['**/*.stories.mdx'], }, @@ -102,7 +98,7 @@ describe('continue', () => { test('unconfigured addon-docs', async () => { await expect( check({ - packageJson, + packageManager: {}, main: { stories: ['**/*.stories.mdx'], addons: [ @@ -124,7 +120,7 @@ describe('continue', () => { test('unconfigured addon-essentials', async () => { await expect( check({ - packageJson, + packageManager: {}, main: { stories: ['**/*.stories.mdx'], addons: ['@storybook/addon-essentials'], diff --git a/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts b/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts index b8c215feef06..d138f9578f47 100644 --- a/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts +++ b/code/lib/cli/src/automigrate/fixes/mdx-gfm.ts @@ -4,7 +4,7 @@ import { join } from 'path'; import slash from 'slash'; import glob from 'globby'; import { commonGlobOptions } from '@storybook/core-common'; -import { getStorybookData, updateMainConfig } from '../helpers/mainConfigFile'; +import { updateMainConfig } from '../helpers/mainConfigFile'; import type { Fix } from '../types'; import { getStorybookVersionSpecifier } from '../../helpers'; @@ -19,9 +19,7 @@ interface Options { export const mdxgfm: Fix = { id: 'github-flavored-markdown-mdx', - async check({ configDir, packageManager }) { - const { mainConfig, storybookVersion } = await getStorybookData({ packageManager, configDir }); - + async check({ configDir, mainConfig, storybookVersion }) { if (!semver.gte(storybookVersion, '7.0.0')) { return null; } diff --git a/code/lib/cli/src/automigrate/fixes/missing-babelrc.test.ts b/code/lib/cli/src/automigrate/fixes/missing-babelrc.test.ts index 6ce9aa71cab2..a325bb471926 100644 --- a/code/lib/cli/src/automigrate/fixes/missing-babelrc.test.ts +++ b/code/lib/cli/src/automigrate/fixes/missing-babelrc.test.ts @@ -2,9 +2,8 @@ /// ; import type { StorybookConfig } from '@storybook/types'; -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; import { missingBabelRc } from './missing-babelrc'; +import type { JsPackageManager } from '../../js-package-manager'; // eslint-disable-next-line global-require, jest/no-mocks-import jest.mock('fs-extra', () => require('../../../../../__mocks__/fs-extra')); @@ -27,12 +26,14 @@ const babelContent = JSON.stringify({ }); const check = async ({ - packageJson = {}, - main: mainConfig, + packageManager = { + retrievePackageJson: () => ({}), + }, + main: mainConfig = {}, storybookVersion = '7.0.0', extraFiles, }: { - packageJson?: PackageJson; + packageManager?: any; main?: Partial & Record; storybookVersion?: string; extraFiles?: Record; @@ -42,11 +43,30 @@ const check = async ({ require('fs-extra').__setMockFiles(extraFiles); } - mockStorybookData({ mainConfig, storybookVersion }); - - return missingBabelRc.check({ packageManager: makePackageManager(packageJson) }); + return missingBabelRc.check({ + packageManager, + mainConfig: mainConfig as any, + storybookVersion, + }); }; +const packageManager = { + retrievePackageJson: () => + Promise.resolve({ + devDependencies: {}, + dependencies: {}, + }), +} as Partial; + +const packageManagerWithBabelField = { + retrievePackageJson: () => + Promise.resolve({ + devDependencies: {}, + dependencies: {}, + babel: babelContent, + }), +} as Partial; + describe('missing-babelrc fix', () => { afterEach(jest.restoreAllMocks); @@ -55,84 +75,58 @@ describe('missing-babelrc fix', () => { }); it('skips when babelrc config is present', async () => { - const packageJson = { - devDependencies: { - '@storybook/react': '^7.0.0', - '@storybook/react-webpack5': '^7.0.0', - }, - }; - // different babel extensions await expect( check({ + packageManager, extraFiles: { '.babelrc': babelContent }, - packageJson, main: { framework: '@storybook/react' }, }) ).resolves.toBeNull(); await expect( check({ + packageManager, extraFiles: { '.babelrc.json': babelContent }, - packageJson, main: { framework: '@storybook/react' }, }) ).resolves.toBeNull(); await expect( check({ + packageManager, extraFiles: { 'babel.config.json': babelContent }, - packageJson, main: { framework: '@storybook/react' }, }) ).resolves.toBeNull(); - // babel field in package.json await expect( check({ - packageJson: { ...packageJson, babel: babelContent }, + packageManager: packageManagerWithBabelField, main: { framework: '@storybook/react' }, }) ).resolves.toBeNull(); }); it('skips when using a framework that provides babel config', async () => { - const packageJson = { - devDependencies: { - '@storybook/react': '^7.0.0', - '@storybook/nextjs': '^7.0.0', - }, - }; - await expect( - check({ packageJson, main: { framework: '@storybook/nextjs' } }) + check({ main: { framework: '@storybook/nextjs' }, packageManager }) ).resolves.toBeNull(); }); it('skips when using CRA preset', async () => { - const packageJson = { - devDependencies: { - '@storybook/react': '^7.0.0', - '@storybook/react-webpack5': '^7.0.0', - }, - }; - await expect( check({ - packageJson, main: { framework: '@storybook/react', addons: ['@storybook/preset-create-react-app'] }, + packageManager, }) ).resolves.toBeNull(); }); it('prompts when babelrc file is missing and framework does not provide babel config', async () => { - const packageJson = { - devDependencies: { - '@storybook/react': '^7.0.0', - '@storybook/react-webpack5': '^7.0.0', - }, - }; - await expect( - check({ main: { framework: '@storybook/react-webpack5' }, packageJson }) + check({ + packageManager, + main: { framework: '@storybook/react-webpack5' }, + }) ).resolves.toEqual({ needsBabelRc: true, }); diff --git a/code/lib/cli/src/automigrate/fixes/missing-babelrc.ts b/code/lib/cli/src/automigrate/fixes/missing-babelrc.ts index 1b403a6b0d4b..5c70808657a6 100644 --- a/code/lib/cli/src/automigrate/fixes/missing-babelrc.ts +++ b/code/lib/cli/src/automigrate/fixes/missing-babelrc.ts @@ -4,7 +4,7 @@ import semver from 'semver'; import { loadPartialConfigAsync } from '@babel/core'; import type { Fix } from '../types'; import { generateStorybookBabelConfigInCWD } from '../../babel-config'; -import { getStorybookData } from '../helpers/mainConfigFile'; +import { getFrameworkPackageName } from '../helpers/mainConfigFile'; interface MissingBabelRcOptions { needsBabelRc: boolean; @@ -23,24 +23,28 @@ const frameworksThatNeedBabelConfig = [ export const missingBabelRc: Fix = { id: 'missing-babelrc', - async check({ configDir, packageManager }) { + async check({ packageManager, mainConfig, storybookVersion }) { const packageJson = await packageManager.retrievePackageJson(); - const { mainConfig, storybookVersion } = await getStorybookData({ configDir, packageManager }); if (!semver.gte(storybookVersion, '7.0.0')) { return null; } - const { framework, addons } = mainConfig; - - const frameworkPackage = typeof framework === 'string' ? framework : framework.name; + const { addons } = mainConfig; const hasCraPreset = - addons && addons.find((addon) => addon === '@storybook/preset-create-react-app'); + addons && + addons.find((addon) => + typeof addon === 'string' + ? addon.endsWith('@storybook/preset-create-react-app') + : addon.name.endsWith('@storybook/preset-create-react-app') + ); + + const frameworkPackageName = getFrameworkPackageName(mainConfig); if ( - frameworkPackage && - frameworksThatNeedBabelConfig.includes(frameworkPackage) && + frameworkPackageName && + frameworksThatNeedBabelConfig.includes(frameworkPackageName) && !hasCraPreset ) { const config = await loadPartialConfigAsync({ diff --git a/code/lib/cli/src/automigrate/fixes/new-frameworks.test.ts b/code/lib/cli/src/automigrate/fixes/new-frameworks.test.ts index 0938511e53cf..441af07c311f 100644 --- a/code/lib/cli/src/automigrate/fixes/new-frameworks.test.ts +++ b/code/lib/cli/src/automigrate/fixes/new-frameworks.test.ts @@ -1,9 +1,8 @@ import type { StorybookConfig } from '@storybook/types'; import * as findUp from 'find-up'; -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; import * as rendererHelpers from '../helpers/detectRenderer'; import { newFrameworks } from './new-frameworks'; +import type { JsPackageManager } from '../../js-package-manager'; jest.mock('find-up'); jest.mock('../helpers/detectRenderer', () => ({ @@ -11,40 +10,70 @@ jest.mock('../helpers/detectRenderer', () => ({ })); const checkNewFrameworks = async ({ - packageJson, + packageManager = {}, main: mainConfig, storybookVersion = '7.0.0', + rendererPackage, }: { - packageJson: PackageJson; - main: Partial & Record; + packageManager?: any; + main?: Partial & Record; storybookVersion?: string; + rendererPackage?: string; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - return newFrameworks.check({ - packageManager: makePackageManager(packageJson), + packageManager, + mainConfig: mainConfig as any, + storybookVersion, + rendererPackage, configDir: '', }); }; +const getPackageManager = (packages: Record) => { + return { + getPackageVersion(packageName) { + return new Promise((resolve) => { + Object.entries(packages).forEach(([name, version]) => { + if (packageName === name) { + resolve(version); + } + }); + + resolve(null); + }); + }, + retrievePackageJson: () => + Promise.resolve({ + dependencies: {}, + devDependencies: packages, + }), + getAllDependencies: () => Promise.resolve(packages), + } as Partial; +}; + describe('new-frameworks fix', () => { describe('should no-op', () => { it('in sb < 7', async () => { - const packageJson = { dependencies: { '@storybook/vue': '^6.2.0' } }; + const packageManager = getPackageManager({ + '@storybook/vue': '6.2.0', + }); + await expect( checkNewFrameworks({ - packageJson, - main: {}, + packageManager, storybookVersion: '6.2.0', }) ).resolves.toBeFalsy(); }); it('in sb 7 with correct structure already', async () => { - const packageJson = { dependencies: { '@storybook/angular': '^7.0.0' } }; + const packageManager = getPackageManager({ + '@storybook/angular': '7.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { framework: '@storybook/angular', }, @@ -55,26 +84,24 @@ describe('new-frameworks fix', () => { describe('should throw an error', () => { it('in sb 7 with no main.js', async () => { - const packageJson = { dependencies: { '@storybook/vue': '^7.0.0' } }; await expect(() => checkNewFrameworks({ - packageJson, main: undefined, }) ).rejects.toBeTruthy(); }); it('in sb 7 with vite < 3', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0', - '@storybook/builder-vite': 'x.y.z', - vite: '^2.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0', + '@storybook/builder-vite': 'x.y.z', + vite: '2.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, + rendererPackage: '@storybook/react', main: { framework: '@storybook/react', core: { @@ -88,16 +115,15 @@ describe('new-frameworks fix', () => { describe('generic new-frameworks migration', () => { it('should update to @storybook/react-webpack5', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', - '@storybook/builder-webpack5': '^6.5.9', - '@storybook/manager-webpack5': '^6.5.9', - }, - }; + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0-alpha.0', + '@storybook/builder-webpack5': '6.5.9', + '@storybook/manager-webpack5': '6.5.9', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { framework: '@storybook/react', core: { @@ -133,16 +159,15 @@ describe('new-frameworks fix', () => { }); it('should update to @storybook/react-vite', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', - '@storybook/builder-vite': '^0.0.2', - vite: '3.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0-alpha.0', + '@storybook/builder-vite': '0.0.2', + vite: '3.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { framework: '@storybook/react', core: { @@ -160,16 +185,15 @@ describe('new-frameworks fix', () => { }); it('should update only builders in @storybook/angular', async () => { - const packageJson = { - dependencies: { - '@storybook/angular': '^7.0.0-alpha.0', - '@storybook/builder-webpack5': '^6.5.9', - '@storybook/manager-webpack5': '^6.5.9', - }, - }; + const packageManager = getPackageManager({ + '@storybook/angular': '7.0.0-alpha.0', + '@storybook/builder-webpack5': '6.5.9', + '@storybook/manager-webpack5': '6.5.9', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { framework: '@storybook/angular', core: { @@ -206,16 +230,15 @@ describe('new-frameworks fix', () => { }); it('should update to @storybook/preact-vite', async () => { - const packageJson = { - dependencies: { - '@storybook/preact': '^7.0.0-alpha.0', - '@storybook/builder-vite': '^0.0.2', - vite: '3.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/preact': '7.0.0-alpha.0', + '@storybook/builder-vite': '0.0.2', + vite: '3.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { framework: '@storybook/preact', core: { @@ -233,12 +256,14 @@ describe('new-frameworks fix', () => { }); it('should update correctly when there is no builder', async () => { - const packageJson = { - dependencies: { '@storybook/vue': '^7.0.0', '@storybook/builder-webpack5': '^7.0.0' }, - }; + const packageManager = getPackageManager({ + '@storybook/vue': '7.0.0', + '@storybook/builder-webpack5': '7.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { framework: '@storybook/vue', }, @@ -253,12 +278,14 @@ describe('new-frameworks fix', () => { }); it('should update when there is no framework field in main', async () => { - const packageJson = { - dependencies: { '@storybook/vue': '^7.0.0', '@storybook/manager-webpack5': '^7.0.0' }, - }; + const packageManager = getPackageManager({ + '@storybook/vue': '7.0.0', + '@storybook/manager-webpack5': '7.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: {}, }) ).resolves.toEqual( @@ -272,12 +299,14 @@ describe('new-frameworks fix', () => { }); it('should update when the framework field has a legacy value', async () => { - const packageJson = { - dependencies: { '@storybook/vue': '^7.0.0', '@storybook/manager-webpack5': '^7.0.0' }, - }; + const packageManager = getPackageManager({ + '@storybook/vue': '7.0.0', + '@storybook/manager-webpack5': '7.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { framework: 'vue', }, @@ -296,16 +325,16 @@ describe('new-frameworks fix', () => { // there should be a prompt, which we mock the response const detectRendererSpy = jest.spyOn(rendererHelpers, 'detectRenderer'); detectRendererSpy.mockReturnValueOnce(Promise.resolve('@storybook/react')); - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0', - '@storybook/vue': '^7.0.0', - '@storybook/builder-vite': 'x.y.z', - }, - }; + + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0', + '@storybook/vue': '7.0.0', + '@storybook/builder-vite': 'x.y.z', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { core: { builder: '@storybook/builder-vite', @@ -322,18 +351,16 @@ describe('new-frameworks fix', () => { }); it('should add framework field in main.js when everything is properly configured, but framework field in main.js is missing', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', - '@storybook/react-vite': '^7.0.0-alpha.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0-alpha.0', + '@storybook/react-vite': '7.0.0-alpha.0', + }); // project contains vite.config.js jest.spyOn(findUp, 'default').mockReturnValueOnce(Promise.resolve('vite.config.js')); await expect( checkNewFrameworks({ - packageJson, + packageManager, main: {}, }) ).resolves.toEqual( @@ -348,21 +375,21 @@ describe('new-frameworks fix', () => { jest .spyOn(rendererHelpers, 'detectRenderer') .mockReturnValueOnce(Promise.resolve('@storybook/web-components')); - const packageJson = { - dependencies: { - '@storybook/addon-essentials': '^7.0.0-beta.48', - '@storybook/vue': '^7.0.0-beta.48', - '@storybook/builder-vite': '^7.0.0-beta.48', - '@storybook/builder-webpack5': '^7.0.0-beta.48', - '@storybook/core-server': '^7.0.0-beta.48', - '@storybook/manager-webpack5': '^6.5.15', - '@storybook/react': '^7.0.0-beta.48', - '@storybook/web-components': '^7.0.0-beta.48', - }, - }; + + const packageManager = getPackageManager({ + '@storybook/addon-essentials': '7.0.0-beta.48', + '@storybook/vue': '7.0.0-beta.48', + '@storybook/builder-vite': '7.0.0-beta.48', + '@storybook/builder-webpack5': '7.0.0-beta.48', + '@storybook/core-server': '7.0.0-beta.48', + '@storybook/manager-webpack5': '6.5.15', + '@storybook/react': '7.0.0-beta.48', + '@storybook/web-components': '7.0.0-beta.48', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { core: { builder: 'webpack5' }, }, @@ -378,61 +405,57 @@ describe('new-frameworks fix', () => { describe('nextjs migration', () => { it('skips in non-Next.js projects', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0', - '@storybook/react-vite': '^7.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0', + '@storybook/react-vite': '7.0.0', + }); + const main = { framework: '@storybook/react-vite', }; - await expect(checkNewFrameworks({ packageJson, main })).resolves.toBeFalsy(); + await expect(checkNewFrameworks({ packageManager, main })).resolves.toBeFalsy(); }); it('skips if project uses Next.js < 12.0.0', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0', - '@storybook/react-webpack5': '^7.0.0', - next: '^11.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0', + '@storybook/react-webpack5': '7.0.0', + next: '11.0.0', + }); + const main = { framework: '@storybook/react', }; - await expect(checkNewFrameworks({ packageJson, main })).resolves.toBeFalsy(); + await expect(checkNewFrameworks({ packageManager, main })).resolves.toBeFalsy(); }); it('skips if project already has @storybook/nextjs set up', async () => { jest.spyOn(findUp, 'default').mockReturnValueOnce(Promise.resolve('next.config.js')); - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0', - '@storybook/nextjs': '^7.0.0', - next: '^12.0.0', - }, - }; + + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0', + '@storybook/nextjs': '7.0.0', + next: '12.0.0', + }); + const main = { framework: '@storybook/nextjs', }; - await expect(checkNewFrameworks({ packageJson, main })).resolves.toBeFalsy(); + await expect(checkNewFrameworks({ packageManager, main })).resolves.toBeFalsy(); }); it('should update from @storybook/react-webpack5 to @storybook/nextjs', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', - '@storybook/react-webpack5': '^7.0.0-alpha.0', - '@storybook/builder-webpack5': '^7.0.0-alpha.0', - next: '^12.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0-alpha.0', + '@storybook/react-webpack5': '7.0.0-alpha.0', + '@storybook/builder-webpack5': '7.0.0-alpha.0', + next: '12.0.0', + }); jest.spyOn(findUp, 'default').mockReturnValueOnce(Promise.resolve('next.config.js')); await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { framework: { name: '@storybook/react-webpack5', options: {} }, }, @@ -448,18 +471,17 @@ describe('new-frameworks fix', () => { it('should remove legacy addons', async () => { jest.spyOn(findUp, 'default').mockReturnValueOnce(Promise.resolve('next.config.js')); - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', - '@storybook/react-webpack5': '^7.0.0-alpha.0', - next: '^12.0.0', - 'storybook-addon-next': '^1.0.0', - 'storybook-addon-next-router': '^1.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0-alpha.0', + '@storybook/react-webpack5': '7.0.0-alpha.0', + next: '12.0.0', + 'storybook-addon-next': '1.0.0', + 'storybook-addon-next-router': '1.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { framework: '@storybook/react-webpack5', addons: ['storybook-addon-next', 'storybook-addon-next-router'], @@ -479,17 +501,17 @@ describe('new-frameworks fix', () => { it('should move storybook-addon-next options and reactOptions to frameworkOptions', async () => { jest.spyOn(findUp, 'default').mockReturnValueOnce(Promise.resolve('next.config.js')); - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', - '@storybook/react-webpack5': '^7.0.0-alpha.0', - next: '^12.0.0', - 'storybook-addon-next': '^1.0.0', - }, - }; + + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0-alpha.0', + '@storybook/react-webpack5': '7.0.0-alpha.0', + next: '12.0.0', + 'storybook-addon-next': '1.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { framework: { name: '@storybook/react-webpack5', options: { fastRefresh: true } }, addons: [ @@ -528,17 +550,17 @@ describe('new-frameworks fix', () => { it('should migrate to @storybook/react-vite in Next.js project that uses vite builder', async () => { jest.spyOn(findUp, 'default').mockReturnValueOnce(Promise.resolve('next.config.js')); - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', - '@storybook/builder-vite': '^7.0.0-alpha.0', - next: '^12.0.0', - 'storybook-addon-next': '^1.0.0', - }, - }; + + const packageManager = getPackageManager({ + '@storybook/react': '7.0.0-alpha.0', + '@storybook/builder-vite': '7.0.0-alpha.0', + next: '12.0.0', + 'storybook-addon-next': '1.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { core: { builder: '@storybook/builder-vite', @@ -558,59 +580,55 @@ describe('new-frameworks fix', () => { describe('SvelteKit migration', () => { it('skips in non-SvelteKit projects', async () => { - const packageJson = { - dependencies: { - svelte: '^3.53.1', - '@storybook/svelte': '^7.0.0', - '@storybook/svelte-vite': '^7.0.0', - }, - }; + const packageManager = getPackageManager({ + svelte: '3.53.1', + '@storybook/svelte': '7.0.0', + '@storybook/svelte-vite': '7.0.0', + }); + const main = { framework: '@storybook/svelte-vite', }; - await expect(checkNewFrameworks({ packageJson, main })).resolves.toBeFalsy(); + await expect(checkNewFrameworks({ packageManager, main })).resolves.toBeFalsy(); }); it('skips if project uses SvelteKit < 1.0.0', async () => { - const packageJson = { - dependencies: { - '@storybook/svelte': '^7.0.0', - '@storybook/svelte-vite': '^7.0.0', - '@sveltejs/kit': '^0.9.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/svelte': '7.0.0', + '@storybook/svelte-vite': '7.0.0', + '@sveltejs/kit': '0.9.0', + }); + const main = { framework: '@storybook/svelte-vite', }; - await expect(checkNewFrameworks({ packageJson, main })).resolves.toBeFalsy(); + await expect(checkNewFrameworks({ packageManager, main })).resolves.toBeFalsy(); }); it('skips if project already has @storybook/sveltekit set up', async () => { - const packageJson = { - dependencies: { - '@storybook/svelte': '^7.0.0', - '@storybook/sveltekit': '^7.0.0', - '@sveltejs/kit': '^1.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/svelte': '7.0.0', + '@storybook/sveltekit': '7.0.0', + '@sveltejs/kit': '1.0.0', + }); + const main = { framework: '@storybook/svelte-vite', }; - await expect(checkNewFrameworks({ packageJson, main })).resolves.toBeFalsy(); + await expect(checkNewFrameworks({ packageManager, main })).resolves.toBeFalsy(); }); it('from @storybook/svelte-vite', async () => { - const packageJson = { - dependencies: { - '@storybook/svelte': '^7.0.0', - '@storybook/svelte-vite': '^7.0.0', - '@sveltejs/kit': '^1.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/svelte': '7.0.0', + '@storybook/svelte-vite': '7.0.0', + '@sveltejs/kit': '1.0.0', + }); + const main = { framework: '@storybook/svelte-vite', }; - await expect(checkNewFrameworks({ packageJson, main })).resolves.toEqual( + await expect(checkNewFrameworks({ packageManager, main })).resolves.toEqual( expect.objectContaining({ dependenciesToAdd: ['@storybook/sveltekit'], dependenciesToRemove: ['@storybook/svelte-vite'], @@ -620,18 +638,17 @@ describe('new-frameworks fix', () => { }); it('from @storybook/svelte framework and @storybook/builder-vite builder', async () => { - const packageJson = { - dependencies: { - '@storybook/svelte': '^7.0.0', - '@storybook/builder-vite': '^7.0.0', - '@sveltejs/kit': '^1.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/svelte': '7.0.0', + '@storybook/builder-vite': '7.0.0', + '@sveltejs/kit': '1.0.0', + }); + const main = { framework: '@storybook/svelte', core: { builder: '@storybook/builder-vite' }, }; - await expect(checkNewFrameworks({ packageJson, main })).resolves.toEqual( + await expect(checkNewFrameworks({ packageManager, main })).resolves.toEqual( expect.objectContaining({ dependenciesToAdd: ['@storybook/sveltekit'], dependenciesToRemove: ['@storybook/builder-vite'], @@ -641,18 +658,17 @@ describe('new-frameworks fix', () => { }); it('from @storybook/svelte framework and storybook-builder-vite builder', async () => { - const packageJson = { - dependencies: { - '@storybook/svelte': '^7.0.0', - 'storybook-builder-vite': '^0.2.5', - '@sveltejs/kit': '^1.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/svelte': '7.0.0', + 'storybook-builder-vite': '0.2.5', + '@sveltejs/kit': '1.0.0', + }); + const main = { framework: '@storybook/svelte', core: { builder: 'storybook-builder-vite' }, }; - await expect(checkNewFrameworks({ packageJson, main })).resolves.toEqual( + await expect(checkNewFrameworks({ packageManager, main })).resolves.toEqual( expect.objectContaining({ dependenciesToAdd: ['@storybook/sveltekit'], dependenciesToRemove: ['storybook-builder-vite'], @@ -662,19 +678,18 @@ describe('new-frameworks fix', () => { }); it('should migrate and remove svelteOptions', async () => { - const packageJson = { - dependencies: { - '@storybook/svelte': '^7.0.0', - 'storybook-builder-vite': '^0.2.5', - '@sveltejs/kit': '^1.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/svelte': '7.0.0', + 'storybook-builder-vite': '0.2.5', + '@sveltejs/kit': '1.0.0', + }); + const main = { framework: '@storybook/svelte', core: { builder: 'storybook-builder-vite' }, svelteOptions: { preprocess: 'preprocess' }, }; - await expect(checkNewFrameworks({ packageJson, main })).resolves.toEqual( + await expect(checkNewFrameworks({ packageManager, main })).resolves.toEqual( expect.objectContaining({ dependenciesToAdd: ['@storybook/sveltekit'], dependenciesToRemove: ['storybook-builder-vite'], @@ -685,16 +700,15 @@ describe('new-frameworks fix', () => { }); it('should migrate to @storybook/svelte-webpack5 in SvelteKit project that uses Webpack5 builder', async () => { - const packageJson = { - dependencies: { - '@storybook/svelte': '^7.0.0-alpha.0', - '@storybook/builder-webpack5': '^7.0.0-alpha.0', - '@sveltejs/kit': '^1.0.0', - }, - }; + const packageManager = getPackageManager({ + '@storybook/svelte': '7.0.0-alpha.0', + '@storybook/builder-webpack5': '7.0.0-alpha.0', + '@sveltejs/kit': '1.0.0', + }); + await expect( checkNewFrameworks({ - packageJson, + packageManager, main: { core: { builder: '@storybook/builder-webpack5', diff --git a/code/lib/cli/src/automigrate/fixes/new-frameworks.ts b/code/lib/cli/src/automigrate/fixes/new-frameworks.ts index d2be64bf877a..cecf3f852df3 100644 --- a/code/lib/cli/src/automigrate/fixes/new-frameworks.ts +++ b/code/lib/cli/src/automigrate/fixes/new-frameworks.ts @@ -1,32 +1,27 @@ import chalk from 'chalk'; import dedent from 'ts-dedent'; -import findUp from 'find-up'; import semver from 'semver'; import { frameworkPackages, rendererPackages } from '@storybook/core-common'; import type { Preset } from '@storybook/types'; import type { Fix } from '../types'; -import type { PackageJsonWithDepsAndDevDeps } from '../../js-package-manager'; import { getStorybookVersionSpecifier } from '../../helpers'; -import { detectRenderer } from '../helpers/detectRenderer'; import { getNextjsAddonOptions, detectBuilderInfo, packagesMap, } from '../helpers/new-frameworks-utils'; -import { getStorybookData, updateMainConfig } from '../helpers/mainConfigFile'; +import { + getFrameworkPackageName, + getRendererPackageNameFromFramework, + updateMainConfig, +} from '../helpers/mainConfigFile'; +import { detectRenderer } from '../helpers/detectRenderer'; const logger = console; -const nextJsConfigFiles = [ - 'next.config.js', - 'next.config.cjs', - 'next.config.mjs', - 'next.config.ts', -]; interface NewFrameworkRunOptions { mainConfigPath: string; - packageJson: PackageJsonWithDepsAndDevDeps; dependenciesToAdd: string[]; dependenciesToRemove: string[]; hasFrameworkInMainConfig: boolean; @@ -63,48 +58,37 @@ export const newFrameworks: Fix = { id: 'new-frameworks', async check({ - rendererPackage: userDefinedRendererPackage, - configDir: userDefinedConfigDir, + configDir, packageManager, + storybookVersion, + mainConfig, + mainConfigPath, + rendererPackage, }) { - const packageJson = await packageManager.retrievePackageJson(); - const { storybookVersion, mainConfig, mainConfigPath, configDir } = await getStorybookData({ - packageManager, - configDir: userDefinedConfigDir, - }); - if (!semver.gte(storybookVersion, '7.0.0')) { return null; } - const frameworkPackage = - typeof mainConfig.framework === 'string' ? mainConfig.framework : mainConfig.framework?.name; - let hasFrameworkInMainConfig = !!frameworkPackage; - - // if --renderer is passed to the command, just use it. - // Useful for monorepo projects to automate the script without getting prompts - let rendererPackage = userDefinedRendererPackage; - if (!rendererPackage) { - if (frameworkPackage && Object.keys(rendererPackages).includes(frameworkPackage)) { - // at some point in 6.4 we introduced a framework field, but filled with a renderer package - rendererPackage = frameworkPackage; - } else if (frameworkPackage && Object.values(rendererPackages).includes(frameworkPackage)) { - // for scenarios where the value is e.g. "react" instead of "@storybook/react" - rendererPackage = Object.keys(rendererPackages).find( - (k) => rendererPackages[k] === frameworkPackage - ); - hasFrameworkInMainConfig = false; - } else { - // detect the renderer package from the user's dependencies, and if multiple are there (monorepo), prompt the user to choose - rendererPackage = await detectRenderer(packageJson); - } + const packageJson = await packageManager.retrievePackageJson(); + + const frameworkPackageName = getFrameworkPackageName(mainConfig); + + const rendererPackageName = + rendererPackage ?? + (await getRendererPackageNameFromFramework(frameworkPackageName)) ?? + (await detectRenderer(packageJson)); + + let hasFrameworkInMainConfig = !!frameworkPackageName; + + if (frameworkPackageName && !!Object.values(rendererPackages).includes(frameworkPackageName)) { + hasFrameworkInMainConfig = false; } const builderConfig = mainConfig.core?.builder; // bail if we can't detect an official renderer const supportedPackages = Object.keys(packagesMap); - if (!supportedPackages.includes(rendererPackage)) { + if (!supportedPackages.includes(rendererPackageName)) { return null; } @@ -113,17 +97,16 @@ export const newFrameworks: Fix = { const builderInfo = await detectBuilderInfo({ mainConfig, configDir, - packageDependencies: allDependencies, + packageManager, }); // if the user has a new framework already, use it let newFrameworkPackage = Object.keys(frameworkPackages).find( - (pkg) => pkg === frameworkPackage + (pkg) => pkg === frameworkPackageName ); if (!newFrameworkPackage) { - newFrameworkPackage = - packagesMap[rendererPackage] && packagesMap[rendererPackage][builderInfo.name]; + newFrameworkPackage = packagesMap[rendererPackageName]?.[builderInfo.name]; } // bail if there is no framework that matches the renderer + builder @@ -131,7 +114,7 @@ export const newFrameworks: Fix = { return null; } - const renderer = rendererPackages[rendererPackage]; + const renderer = rendererPackages[rendererPackageName]; // @ts-expect-error account for renderer options for packages that supported it: reactOptions, angularOptions. (svelteOptions got removed) let rendererOptions = mainConfig[`${renderer}Options`] || {}; @@ -151,11 +134,15 @@ export const newFrameworks: Fix = { let addonOptions: Record = {}; let metaFramework: string | undefined; - if (rendererPackage === '@storybook/react' && allDependencies.next) { - const nextConfigFile = await findUp(nextJsConfigFiles, { cwd: configDir }); + const nextVersion = await packageManager.getPackageVersion('next'); + const svelteKitVersion = await packageManager.getPackageVersion('@sveltejs/kit'); + const viteVersion = await packageManager.getPackageVersion('vite'); + + if (rendererPackageName === '@storybook/react' && nextVersion) { const nextAddonOptions = getNextjsAddonOptions(mainConfig.addons); + const isNextJsCandidate = - (semver.gte(semver.coerce(allDependencies.next).version, '12.0.0') && nextConfigFile) || + (nextVersion && semver.gte(nextVersion, '12.0.0')) || Object.keys(nextAddonOptions).length > 0; if (isNextJsCandidate) { @@ -184,9 +171,9 @@ export const newFrameworks: Fix = { } } } else if ( - rendererPackage === '@storybook/svelte' && - allDependencies['@sveltejs/kit'] && - semver.gte(semver.coerce(allDependencies['@sveltejs/kit']).version, '1.0.0') + rendererPackageName === '@storybook/svelte' && + svelteKitVersion && + semver.gte(svelteKitVersion, '1.0.0') ) { metaFramework = 'sveltekit'; if (newFrameworkPackage === '@storybook/svelte-vite') { @@ -221,12 +208,12 @@ export const newFrameworks: Fix = { return null; } - if (allDependencies.vite && semver.lt(semver.coerce(allDependencies.vite).version, '3.0.0')) { + if (viteVersion && semver.lt(viteVersion, '3.0.0')) { throw new Error(dedent` ❌ Your project should be upgraded to use the framework package ${chalk.bold( newFrameworkPackage )}, but we detected that you are using Vite ${chalk.bold( - allDependencies.vite + viteVersion )}, which is unsupported in ${chalk.bold( 'Storybook 7.0' )}. Please upgrade Vite to ${chalk.bold('3.0.0 or higher')} and rerun this migration. @@ -248,7 +235,6 @@ export const newFrameworks: Fix = { addonOptions, addonsToRemove, builderInfo, - packageJson, renderer, builderConfig, metaFramework, @@ -436,7 +422,6 @@ export const newFrameworks: Fix = { frameworkPackage, frameworkOptions, builderInfo, - packageJson, renderer, addonsToRemove, }, @@ -445,6 +430,7 @@ export const newFrameworks: Fix = { mainConfigPath, skipInstall, }) { + const packageJson = await packageManager.retrievePackageJson(); if (dependenciesToRemove.length > 0) { logger.info(`βœ… Removing dependencies: ${dependenciesToRemove.join(', ')}`); if (!dryRun) { diff --git a/code/lib/cli/src/automigrate/fixes/nodejs-requirement.test.ts b/code/lib/cli/src/automigrate/fixes/nodejs-requirement.test.ts index 5a4f6327e657..d86b266b6081 100644 --- a/code/lib/cli/src/automigrate/fixes/nodejs-requirement.test.ts +++ b/code/lib/cli/src/automigrate/fixes/nodejs-requirement.test.ts @@ -1,15 +1,15 @@ /// ; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; import { nodeJsRequirement } from './nodejs-requirement'; // eslint-disable-next-line global-require, jest/no-mocks-import jest.mock('fs-extra', () => require('../../../../../__mocks__/fs-extra')); const check = async ({ storybookVersion = '7.0.0' }) => { - mockStorybookData({ mainConfig: {}, storybookVersion }); return nodeJsRequirement.check({ - packageManager: makePackageManager({}), + storybookVersion, + packageManager: {} as any, + mainConfig: {} as any, }); }; diff --git a/code/lib/cli/src/automigrate/fixes/nodejs-requirement.ts b/code/lib/cli/src/automigrate/fixes/nodejs-requirement.ts index 276d4b9e1ead..4c3006b7a367 100644 --- a/code/lib/cli/src/automigrate/fixes/nodejs-requirement.ts +++ b/code/lib/cli/src/automigrate/fixes/nodejs-requirement.ts @@ -2,7 +2,6 @@ import chalk from 'chalk'; import dedent from 'ts-dedent'; import semver from 'semver'; import type { Fix } from '../types'; -import { getStorybookData } from '../helpers/mainConfigFile'; interface NodeJsRequirementOptions { nodeVersion: string; @@ -12,9 +11,7 @@ export const nodeJsRequirement: Fix = { id: 'nodejs-requirement', promptOnly: true, - async check({ packageManager, configDir }) { - const { storybookVersion } = await getStorybookData({ packageManager, configDir }); - + async check({ storybookVersion }) { if (!semver.gte(storybookVersion, '7.0.0')) { return null; } diff --git a/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.test.ts b/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.test.ts index a8fa9d050b9c..27d6fe065f3f 100644 --- a/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.test.ts +++ b/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.test.ts @@ -8,7 +8,7 @@ import { RemovedAPIs, removedGlobalClientAPIs as migration } from './remove-glob // eslint-disable-next-line global-require, jest/no-mocks-import jest.mock('fs-extra', () => require('../../../../../__mocks__/fs-extra')); -const check = async ({ packageJson = {}, contents }: any) => { +const check = async ({ contents, previewConfigPath }: any) => { if (contents) { // eslint-disable-next-line global-require require('fs-extra').__setMockFiles({ @@ -16,9 +16,15 @@ const check = async ({ packageJson = {}, contents }: any) => { }); } const packageManager = { - retrievePackageJson: async () => ({ dependencies: {}, devDependencies: {}, ...packageJson }), + retrievePackageJson: async () => ({ dependencies: {}, devDependencies: {} }), } as JsPackageManager; - return migration.check({ packageManager }); + + return migration.check({ + packageManager, + mainConfig: {} as any, + storybookVersion: '7.0.0', + previewConfigPath, + }); }; describe('removedGlobalClientAPIs fix', () => { @@ -30,14 +36,18 @@ describe('removedGlobalClientAPIs fix', () => { const contents = ` export const parameters = {}; `; - await expect(check({ contents })).resolves.toBeNull(); + await expect( + check({ contents, previewConfigPath: path.join('.storybook', 'preview.js') }) + ).resolves.toBeNull(); }); it('uses 1 removed API', async () => { const contents = ` import { addParameters } from '@storybook/react'; addParameters({}); `; - await expect(check({ contents })).resolves.toEqual( + await expect( + check({ contents, previewConfigPath: path.join('.storybook', 'preview.js') }) + ).resolves.toEqual( expect.objectContaining({ usedAPIs: [RemovedAPIs.addParameters], }) @@ -49,7 +59,9 @@ describe('removedGlobalClientAPIs fix', () => { addParameters({}); addDecorator((storyFn) => storyFn()); `; - await expect(check({ contents })).resolves.toEqual( + await expect( + check({ contents, previewConfigPath: path.join('.storybook', 'preview.js') }) + ).resolves.toEqual( expect.objectContaining({ usedAPIs: expect.arrayContaining([RemovedAPIs.addParameters, RemovedAPIs.addDecorator]), }) diff --git a/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.ts b/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.ts index 9888b22a6be9..4a1304dae1a6 100644 --- a/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.ts +++ b/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.ts @@ -1,6 +1,5 @@ import chalk from 'chalk'; import dedent from 'ts-dedent'; -import { getStorybookInfo } from '@storybook/core-common'; import { readFile } from 'fs-extra'; import type { Fix } from '../types'; @@ -22,13 +21,9 @@ export const removedGlobalClientAPIs: Fix = { id: 'removedglobalclientapis', promptOnly: true, - async check({ packageManager, configDir }) { - const packageJson = await packageManager.retrievePackageJson(); - - const { previewConfig } = getStorybookInfo(packageJson, configDir); - - if (previewConfig) { - const contents = await readFile(previewConfig, 'utf8'); + async check({ previewConfigPath }) { + if (previewConfigPath) { + const contents = await readFile(previewConfigPath, 'utf8'); const usedAPIs = Object.values(RemovedAPIs).reduce((acc, item) => { if (contents.includes(item)) { @@ -40,7 +35,7 @@ export const removedGlobalClientAPIs: Fix = { if (usedAPIs.length) { return { usedAPIs, - previewPath: previewConfig, + previewPath: previewConfigPath, }; } } diff --git a/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts b/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts index b150dc424406..c0326a9620fe 100644 --- a/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts +++ b/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts @@ -1,26 +1,39 @@ -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; +import type { JsPackageManager } from '../../js-package-manager'; import { sbBinary } from './sb-binary'; const checkStorybookBinary = async ({ - packageJson, + packageManager, storybookVersion = '7.0.0', }: { - packageJson: PackageJson; + packageManager: Partial; storybookVersion?: string; }) => { - mockStorybookData({ mainConfig: {}, storybookVersion }); - return sbBinary.check({ packageManager: makePackageManager(packageJson) }); + return sbBinary.check({ + packageManager: packageManager as any, + storybookVersion, + mainConfig: {} as any, + }); }; describe('storybook-binary fix', () => { describe('sb < 7.0', () => { describe('does nothing', () => { - const packageJson = { dependencies: { '@storybook/react': '^6.2.0' } }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('6.2.0'); + default: + return null; + } + }, + retrievePackageJson: () => Promise.resolve({}), + } as Partial; + it('should no-op', async () => { await expect( checkStorybookBinary({ - packageJson, + packageManager, storybookVersion: '6.2.0', }) ).resolves.toBeFalsy(); @@ -30,25 +43,43 @@ describe('storybook-binary fix', () => { describe('sb >= 7.0', () => { it('should no-op in NX projects', async () => { - const packageJson = { - dependencies: { '@storybook/react': '^7.0.0', '@nrwl/storybook': '^15.7.1' }, - }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('7.0.0'); + case '@nrwl/storybook': + return Promise.resolve('15.7.1'); + default: + return null; + } + }, + retrievePackageJson: () => Promise.resolve({}), + } as Partial; + await expect( checkStorybookBinary({ - packageJson, + packageManager, }) ).resolves.toBeFalsy(); }); it('should add storybook dependency if not present', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('7.0.0-alpha.0'); + default: + return null; + } }, - }; + retrievePackageJson: () => Promise.resolve({}), + } as Partial; + await expect( checkStorybookBinary({ - packageJson, + packageManager, }) ).resolves.toEqual( expect.objectContaining({ @@ -59,15 +90,23 @@ describe('storybook-binary fix', () => { }); it('should remove sb dependency if it is present', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', - sb: '6.5.0', + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('7.0.0-alpha.0'); + case 'sb': + return Promise.resolve('6.5.0'); + default: + return null; + } }, - }; + retrievePackageJson: () => Promise.resolve({}), + } as Partial; + await expect( checkStorybookBinary({ - packageJson, + packageManager, }) ).resolves.toEqual( expect.objectContaining({ @@ -78,15 +117,23 @@ describe('storybook-binary fix', () => { }); it('should no op if storybook is present and sb is not present', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', - storybook: '^7.0.0-alpha.0', + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('7.0.0-alpha.0'); + case 'storybook': + return Promise.resolve('7.0.0-alpha.0'); + default: + return null; + } }, - }; + retrievePackageJson: () => Promise.resolve({}), + } as Partial; + await expect( checkStorybookBinary({ - packageJson, + packageManager, }) ).resolves.toBeNull(); }); diff --git a/code/lib/cli/src/automigrate/fixes/sb-binary.ts b/code/lib/cli/src/automigrate/fixes/sb-binary.ts index 22d0283e3de3..276d10c6178a 100644 --- a/code/lib/cli/src/automigrate/fixes/sb-binary.ts +++ b/code/lib/cli/src/automigrate/fixes/sb-binary.ts @@ -4,7 +4,6 @@ import semver from 'semver'; import type { Fix } from '../types'; import { getStorybookVersionSpecifier } from '../../helpers'; import type { PackageJsonWithDepsAndDevDeps } from '../../js-package-manager'; -import { getStorybookData } from '../helpers/mainConfigFile'; interface SbBinaryRunOptions { storybookVersion: string; @@ -25,18 +24,20 @@ const logger = console; export const sbBinary: Fix = { id: 'storybook-binary', - async check({ packageManager, configDir }) { + async check({ packageManager, storybookVersion }) { const packageJson = await packageManager.retrievePackageJson(); - const allDependencies = await packageManager.getAllDependencies(); - const { storybookVersion } = await getStorybookData({ packageManager, configDir }); + + const nrwlStorybookVersion = await packageManager.getPackageVersion('@nrwl/storybook'); + const sbBinaryVersion = await packageManager.getPackageVersion('sb'); + const storybookBinaryVersion = await packageManager.getPackageVersion('storybook'); // Nx provides their own binary, so we don't need to do anything - if (allDependencies['@nrwl/storybook'] || semver.lt(storybookVersion, '7.0.0')) { + if (nrwlStorybookVersion || semver.lt(storybookVersion, '7.0.0')) { return null; } - const hasSbBinary = !!allDependencies.sb; - const hasStorybookBinary = !!allDependencies.storybook; + const hasSbBinary = !!sbBinaryVersion; + const hasStorybookBinary = !!storybookBinaryVersion; if (!hasSbBinary && hasStorybookBinary) { return null; diff --git a/code/lib/cli/src/automigrate/fixes/sb-scripts.test.ts b/code/lib/cli/src/automigrate/fixes/sb-scripts.test.ts index 1e8d4edf71ca..036cb18ba098 100644 --- a/code/lib/cli/src/automigrate/fixes/sb-scripts.test.ts +++ b/code/lib/cli/src/automigrate/fixes/sb-scripts.test.ts @@ -1,16 +1,18 @@ -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; +import type { JsPackageManager } from '../../js-package-manager'; import { getStorybookScripts, sbScripts } from './sb-scripts'; const checkSbScripts = async ({ - packageJson, + packageManager, storybookVersion = '7.0.0', }: { - packageJson: PackageJson; + packageManager: Partial; storybookVersion?: string; }) => { - mockStorybookData({ mainConfig: {}, storybookVersion }); - return sbScripts.check({ packageManager: makePackageManager(packageJson) }); + return sbScripts.check({ + packageManager: packageManager as any, + storybookVersion, + mainConfig: {} as any, + }); }; describe('getStorybookScripts', () => { @@ -58,11 +60,22 @@ describe('getStorybookScripts', () => { describe('sb-scripts fix', () => { describe('sb < 7.0', () => { describe('does nothing', () => { - const packageJson = { dependencies: { '@storybook/react': '^6.2.0' } }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('6.2.0'); + default: + return null; + } + }, + retrievePackageJson: () => Promise.resolve({}), + } as Partial; + it('should no-op', async () => { await expect( checkSbScripts({ - packageJson, + packageManager, storybookVersion: '6.2.0', }) ).resolves.toBeFalsy(); @@ -72,19 +85,30 @@ describe('sb-scripts fix', () => { describe('sb >= 7.0', () => { describe('with old scripts', () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('7.0.0-alpha.0'); + default: + return null; + } }, - scripts: { - storybook: 'start-storybook -p 6006', - 'build-storybook': 'build-storybook -o build/storybook', - }, - }; + retrievePackageJson: () => + Promise.resolve({ + scripts: { + storybook: 'start-storybook -p 6006', + 'build-storybook': 'build-storybook -o build/storybook', + }, + dependencies: {}, + devDependencies: {}, + }), + } as Partial; + it('should update scripts to new format', async () => { await expect( checkSbScripts({ - packageJson, + packageManager, }) ).resolves.toEqual( expect.objectContaining({ @@ -105,22 +129,32 @@ describe('sb-scripts fix', () => { describe('with old custom scripts', () => { it('should update scripts to new format', async () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('7.0.0-alpha.0'); + default: + return null; + } }, - scripts: { - 'storybook:ci': 'yarn start-storybook --ci', - 'storybook:build': 'build-storybook -o build/storybook', - 'storybook:build-mocked': 'MOCKS=true yarn storybook:build', - 'test-storybook:ci': - 'concurrently -k -s first -n "SB,TEST" -c "magenta,blue" "CI=true build-storybook --quiet && npx http-server storybook-static --port 6006 --silent" "wait-on tcp:6006 && yarn test-storybook"', - }, - }; + retrievePackageJson: () => + Promise.resolve({ + scripts: { + 'storybook:ci': 'yarn start-storybook --ci', + 'storybook:build': 'build-storybook -o build/storybook', + 'storybook:build-mocked': 'MOCKS=true yarn storybook:build', + 'test-storybook:ci': + 'concurrently -k -s first -n "SB,TEST" -c "magenta,blue" "CI=true build-storybook --quiet && npx http-server storybook-static --port 6006 --silent" "wait-on tcp:6006 && yarn test-storybook"', + }, + dependencies: {}, + devDependencies: {}, + }), + } as Partial; await expect( checkSbScripts({ - packageJson, + packageManager, }) ).resolves.toEqual( expect.objectContaining({ @@ -142,19 +176,30 @@ describe('sb-scripts fix', () => { }); describe('already containing new scripts', () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('7.0.0-alpha.0'); + default: + return null; + } }, - scripts: { - storybook: 'storybook dev -p 6006', - 'build-storybook': 'storybook build -o build/storybook', - }, - }; + retrievePackageJson: () => + Promise.resolve({ + scripts: { + storybook: 'storybook dev -p 6006', + 'build-storybook': 'storybook build -o build/storybook', + }, + dependencies: {}, + devDependencies: {}, + }), + } as Partial; + it('should no-op', async () => { await expect( checkSbScripts({ - packageJson, + packageManager, }) ).resolves.toBeFalsy(); }); diff --git a/code/lib/cli/src/automigrate/fixes/sb-scripts.ts b/code/lib/cli/src/automigrate/fixes/sb-scripts.ts index b624d494af5a..8471d3c1a6c3 100644 --- a/code/lib/cli/src/automigrate/fixes/sb-scripts.ts +++ b/code/lib/cli/src/automigrate/fixes/sb-scripts.ts @@ -3,7 +3,6 @@ import { dedent } from 'ts-dedent'; import semver from 'semver'; import type { Fix } from '../types'; import type { PackageJsonWithDepsAndDevDeps } from '../../js-package-manager'; -import { getStorybookData } from '../helpers/mainConfigFile'; interface SbScriptsRunOptions { storybookScripts: Record; @@ -71,10 +70,9 @@ export const getStorybookScripts = (allScripts: Record) => { export const sbScripts: Fix = { id: 'sb-scripts', - async check({ packageManager, configDir }) { + async check({ packageManager, storybookVersion }) { const packageJson = await packageManager.retrievePackageJson(); const { scripts = {} } = packageJson; - const { storybookVersion } = await getStorybookData({ packageManager, configDir }); if (semver.lt(storybookVersion, '7.0.0')) { return null; diff --git a/code/lib/cli/src/automigrate/fixes/vue3.test.ts b/code/lib/cli/src/automigrate/fixes/vue3.test.ts index 6c4594d076df..6d7f61d77186 100644 --- a/code/lib/cli/src/automigrate/fixes/vue3.test.ts +++ b/code/lib/cli/src/automigrate/fixes/vue3.test.ts @@ -1,21 +1,21 @@ import type { StorybookConfig } from '@storybook/types'; -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; +import type { JsPackageManager } from '../../js-package-manager'; import { vue3 } from './vue3'; const checkVue3 = async ({ - packageJson, main: mainConfig = {}, storybookVersion = '7.0.0', + packageManager, }: { - packageJson: PackageJson; main?: Partial & Record; + mainConfig?: Partial; storybookVersion?: string; + packageManager?: Partial; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - return vue3.check({ - packageManager: makePackageManager(packageJson), + packageManager: packageManager as any, + storybookVersion, + mainConfig: mainConfig as any, }); }; @@ -24,24 +24,43 @@ describe('vue3 fix', () => { describe('sb < 6.3', () => { describe('vue3 dependency', () => { - const packageJson = { - dependencies: { '@storybook/vue': '^6.2.0', vue: '^3.0.0' }, - }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/vue': + return Promise.resolve('6.2.0'); + case 'vue': + return Promise.resolve('3.0.0'); + default: + return null; + } + }, + } as Partial; + it('should fail', async () => { await expect( checkVue3({ - packageJson, + packageManager, storybookVersion: '6.2.0', }) ).rejects.toThrow(); }); }); describe('no vue dependency', () => { - const packageJson = { dependencies: { '@storybook/vue': '^6.2.0' } }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/vue': + return Promise.resolve('6.2.0'); + default: + return null; + } + }, + } as Partial; it('should no-op', async () => { await expect( checkVue3({ - packageJson, + packageManager, storybookVersion: '6.2.0', }) ).resolves.toBeFalsy(); @@ -50,14 +69,24 @@ describe('vue3 fix', () => { }); describe('sb 6.3 - 7.0', () => { describe('vue3 dependency', () => { - const packageJson = { - dependencies: { '@storybook/vue': '^6.3.0', vue: '^3.0.0' }, - }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/vue': + return Promise.resolve('6.3.0'); + case 'vue': + return Promise.resolve('3.0.0'); + default: + return null; + } + }, + } as Partial; + describe('webpack5 builder', () => { it('should no-op', async () => { await expect( checkVue3({ - packageJson, + packageManager, main: { core: { builder: 'webpack5' } }, }) ).resolves.toBeFalsy(); @@ -67,7 +96,7 @@ describe('vue3 fix', () => { it('should no-op', async () => { await expect( checkVue3({ - packageJson, + packageManager, main: { core: { builder: 'storybook-builder-vite' } }, }) ).resolves.toBeFalsy(); @@ -77,12 +106,12 @@ describe('vue3 fix', () => { it('should add webpack5 builder', async () => { await expect( checkVue3({ - packageJson, + packageManager, main: { core: { builder: 'webpack4' } }, storybookVersion: '6.3.0', }) ).resolves.toMatchObject({ - vueVersion: '^3.0.0', + vueVersion: '3.0.0', storybookVersion: '6.3.0', }); }); @@ -91,12 +120,12 @@ describe('vue3 fix', () => { it('should add webpack5 builder', async () => { await expect( checkVue3({ - packageJson, + packageManager, main: {}, storybookVersion: '6.3.0', }) ).resolves.toMatchObject({ - vueVersion: '^3.0.0', + vueVersion: '3.0.0', storybookVersion: '6.3.0', }); }); @@ -104,23 +133,34 @@ describe('vue3 fix', () => { }); describe('no vue dependency', () => { it('should no-op', async () => { + const packageManager = { + getPackageVersion: (packageName) => { + return null; + }, + } as Partial; + await expect( checkVue3({ - packageJson: {}, + packageManager, main: {}, }) ).resolves.toBeFalsy(); }); }); describe('vue2 dependency', () => { + const packageManager = { + getPackageVersion: (packageName) => { + if (packageName === 'vue') { + return Promise.resolve('2.0.0'); + } + return null; + }, + } as Partial; + it('should no-op', async () => { await expect( checkVue3({ - packageJson: { - dependencies: { - vue: '2', - }, - }, + packageManager, main: {}, }) ).resolves.toBeFalsy(); @@ -129,13 +169,23 @@ describe('vue3 fix', () => { }); describe('sb 7.0+', () => { describe('vue3 dependency', () => { - const packageJson = { - dependencies: { '@storybook/vue': '^7.0.0-alpha.0', vue: '^3.0.0' }, - }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/vue': + return Promise.resolve('7.0.0-alpha.0'); + case 'vue': + return Promise.resolve('3.0.0'); + default: + return null; + } + }, + } as Partial; + it('should no-op', async () => { await expect( checkVue3({ - packageJson, + packageManager, main: {}, }) ).resolves.toBeFalsy(); diff --git a/code/lib/cli/src/automigrate/fixes/vue3.ts b/code/lib/cli/src/automigrate/fixes/vue3.ts index 0d3aaca104af..84bde42d6196 100644 --- a/code/lib/cli/src/automigrate/fixes/vue3.ts +++ b/code/lib/cli/src/automigrate/fixes/vue3.ts @@ -19,16 +19,14 @@ interface Vue3RunOptions { export const vue3: Fix = { id: 'vue3', - async check({ configDir, packageManager }) { - const allDependencies = await packageManager.getAllDependencies(); - const vueVersion = allDependencies.vue; - const vueCoerced = semver.coerce(vueVersion)?.version; + async check({ packageManager, mainConfig, storybookVersion }) { + const vueVersion = await packageManager.getPackageVersion('vue'); - if (!vueCoerced || semver.lt(vueCoerced, '3.0.0')) { + if (!vueVersion || semver.lt(vueVersion, '3.0.0')) { return null; } - const builderInfo = await checkWebpack5Builder({ configDir, packageManager }); + const builderInfo = await checkWebpack5Builder({ mainConfig, storybookVersion }); return builderInfo ? { vueVersion, ...builderInfo } : null; }, diff --git a/code/lib/cli/src/automigrate/fixes/webpack5.test.ts b/code/lib/cli/src/automigrate/fixes/webpack5.test.ts index 15fc94a76800..db03eeb57a08 100644 --- a/code/lib/cli/src/automigrate/fixes/webpack5.test.ts +++ b/code/lib/cli/src/automigrate/fixes/webpack5.test.ts @@ -1,22 +1,22 @@ import type { StorybookConfig } from '@storybook/types'; -import type { PackageJson } from '../../js-package-manager'; -import { makePackageManager, mockStorybookData } from '../helpers/testing-helpers'; +import type { JsPackageManager } from '../../js-package-manager'; import { webpack5 } from './webpack5'; const checkWebpack5 = async ({ - packageJson, + packageManager, main: mainConfig, storybookVersion = '6.3.0', }: { - packageJson: PackageJson; + packageManager: Partial; main?: Partial & Record; storybookVersion?: string; + mainConfig?: Partial; }) => { - mockStorybookData({ mainConfig, storybookVersion }); - return webpack5.check({ - packageManager: makePackageManager(packageJson), + packageManager: packageManager as any, configDir: '', + storybookVersion, + mainConfig: mainConfig as any, }); }; @@ -25,22 +25,44 @@ describe('webpack5 fix', () => { describe('sb < 6.3', () => { describe('webpack5 dependency', () => { - const packageJson = { dependencies: { '@storybook/react': '^6.2.0', webpack: '^5.0.0' } }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('6.2.0'); + case 'webpack': + return Promise.resolve('5.0.0'); + default: + return null; + } + }, + } as Partial; + it('should fail', async () => { await expect( checkWebpack5({ - packageJson, + packageManager, storybookVersion: '6.2.0', }) ).rejects.toThrow(); }); }); describe('no webpack5 dependency', () => { - const packageJson = { dependencies: { '@storybook/react': '^6.2.0' } }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('6.2.0'); + default: + return null; + } + }, + } as Partial; + it('should no-op', async () => { await expect( checkWebpack5({ - packageJson, + packageManager, storybookVersion: '6.2.0', }) ).resolves.toBeFalsy(); @@ -49,12 +71,24 @@ describe('webpack5 fix', () => { }); describe('sb 6.3 - 7.0', () => { describe('webpack5 dependency', () => { - const packageJson = { dependencies: { '@storybook/react': '^6.3.0', webpack: '^5.0.0' } }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('6.3.0'); + case 'webpack': + return Promise.resolve('5.0.0'); + default: + return null; + } + }, + } as Partial; + describe('webpack5 builder', () => { it('should no-op', async () => { await expect( checkWebpack5({ - packageJson, + packageManager, main: { core: { builder: 'webpack5' } }, }) ).resolves.toBeFalsy(); @@ -64,7 +98,7 @@ describe('webpack5 fix', () => { it('should no-op', async () => { await expect( checkWebpack5({ - packageJson, + packageManager, main: { core: { builder: 'storybook-builder-vite' } }, }) ).resolves.toBeFalsy(); @@ -74,11 +108,11 @@ describe('webpack5 fix', () => { it('should add webpack5 builder', async () => { await expect( checkWebpack5({ - packageJson, + packageManager, main: { core: { builder: 'webpack4' } }, }) ).resolves.toMatchObject({ - webpackVersion: '^5.0.0', + webpackVersion: '5.0.0', storybookVersion: '6.3.0', }); }); @@ -87,34 +121,47 @@ describe('webpack5 fix', () => { it('should add webpack5 builder', async () => { await expect( checkWebpack5({ - packageJson, + packageManager, main: {}, }) ).resolves.toMatchObject({ - webpackVersion: '^5.0.0', + webpackVersion: '5.0.0', storybookVersion: '6.3.0', }); }); }); }); describe('no webpack dependency', () => { + const packageManager = { + getPackageVersion: () => { + return null; + }, + } as Partial; + it('should no-op', async () => { await expect( checkWebpack5({ - packageJson: {}, + packageManager, }) ).resolves.toBeFalsy(); }); }); describe('webpack4 dependency', () => { + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case 'webpack': + return Promise.resolve('4.0.0'); + default: + return null; + } + }, + } as Partial; + it('should no-op', async () => { await expect( checkWebpack5({ - packageJson: { - dependencies: { - webpack: '4', - }, - }, + packageManager, }) ).resolves.toBeFalsy(); }); @@ -122,13 +169,23 @@ describe('webpack5 fix', () => { }); describe('sb 7.0+', () => { describe('webpack5 dependency', () => { - const packageJson = { - dependencies: { '@storybook/react': '^7.0.0-alpha.0', webpack: '^5.0.0' }, - }; + const packageManager = { + getPackageVersion: (packageName) => { + switch (packageName) { + case '@storybook/react': + return Promise.resolve('7.0.0-alpha.0'); + case 'webpack': + return Promise.resolve('5.0.0'); + default: + return null; + } + }, + } as Partial; + it('should no-op', async () => { await expect( checkWebpack5({ - packageJson, + packageManager, main: {}, storybookVersion: '7.0.0', }) diff --git a/code/lib/cli/src/automigrate/fixes/webpack5.ts b/code/lib/cli/src/automigrate/fixes/webpack5.ts index c60dc9f0eed1..bcae50749a1e 100644 --- a/code/lib/cli/src/automigrate/fixes/webpack5.ts +++ b/code/lib/cli/src/automigrate/fixes/webpack5.ts @@ -25,20 +25,17 @@ interface Webpack5RunOptions { export const webpack5: Fix = { id: 'webpack5', - async check({ configDir, packageManager }) { - const allDependencies = (await packageManager.retrievePackageJson()).dependencies; - - const webpackVersion = allDependencies.webpack; - const webpackCoerced = semver.coerce(webpackVersion)?.version; + async check({ configDir, packageManager, mainConfig, storybookVersion }) { + const webpackVersion = await packageManager.getPackageVersion('webpack'); if ( - !webpackCoerced || - semver.lt(webpackCoerced, '5.0.0') || - semver.gte(webpackCoerced, '6.0.0') + !webpackVersion || + semver.lt(webpackVersion, '5.0.0') || + semver.gte(webpackVersion, '6.0.0') ) return null; - const builderInfo = await checkWebpack5Builder({ configDir, packageManager }); + const builderInfo = await checkWebpack5Builder({ mainConfig, storybookVersion }); return builderInfo ? { webpackVersion, ...builderInfo } : null; }, diff --git a/code/lib/cli/src/automigrate/helpers/checkWebpack5Builder.test.ts b/code/lib/cli/src/automigrate/helpers/checkWebpack5Builder.test.ts new file mode 100644 index 000000000000..51cb622baf42 --- /dev/null +++ b/code/lib/cli/src/automigrate/helpers/checkWebpack5Builder.test.ts @@ -0,0 +1,78 @@ +import type { StorybookConfig } from '@storybook/types'; +import { checkWebpack5Builder } from './checkWebpack5Builder'; +import { getBuilderPackageName } from './mainConfigFile'; + +const mockMainConfig: StorybookConfig = { + framework: 'react', + addons: [], + stories: [], +}; + +jest.mock('./mainConfigFile'); + +describe('checkWebpack5Builder', () => { + let loggerWarnSpy: jest.SpyInstance; + let loggerInfoSpy: jest.SpyInstance; + + beforeEach(() => { + loggerWarnSpy = jest.spyOn(console, 'warn').mockImplementation(); + loggerInfoSpy = jest.spyOn(console, 'info').mockImplementation(); + }); + + afterEach(() => { + loggerWarnSpy.mockRestore(); + loggerInfoSpy.mockRestore(); + }); + + it('should return null and log a warning if storybook version is below 6.3.0', async () => { + const result = await checkWebpack5Builder({ + mainConfig: mockMainConfig, + storybookVersion: '6.2.9', + }); + expect(result).toBeNull(); + expect(loggerWarnSpy).toHaveBeenCalledWith(expect.any(String)); + }); + + it('should return null if storybook version is 7.0.0 or above', async () => { + const result = await checkWebpack5Builder({ + mainConfig: mockMainConfig, + storybookVersion: '7.0.0', + }); + expect(result).toBeNull(); + expect(loggerWarnSpy).not.toHaveBeenCalled(); + }); + + it('should return null and log a warning if mainConfig is missing', async () => { + const result = await checkWebpack5Builder({ + mainConfig: undefined, + storybookVersion: '6.3.0', + }); + expect(result).toBeNull(); + expect(loggerWarnSpy).toHaveBeenCalledWith(expect.any(String)); + }); + + it('should return null and log an info message if builderPackageName is found but not "webpack4"', async () => { + jest.mocked(getBuilderPackageName).mockReturnValueOnce('webpack5'); + + const result = await checkWebpack5Builder({ + mainConfig: mockMainConfig, + storybookVersion: '6.3.0', + }); + + expect(result).toBeNull(); + expect(loggerInfoSpy).toHaveBeenCalledWith(expect.any(String)); + }); + + it('should return { storybookVersion } if all checks pass', async () => { + jest.mocked(getBuilderPackageName).mockReturnValueOnce('webpack4'); + + const result = await checkWebpack5Builder({ + mainConfig: mockMainConfig, + storybookVersion: '6.3.0', + }); + + expect(result).toEqual({ storybookVersion: '6.3.0' }); + expect(loggerWarnSpy).not.toHaveBeenCalled(); + expect(loggerInfoSpy).not.toHaveBeenCalled(); + }); +}); diff --git a/code/lib/cli/src/automigrate/helpers/checkWebpack5Builder.ts b/code/lib/cli/src/automigrate/helpers/checkWebpack5Builder.ts index b900d40b89bd..8d59d62d0bcc 100644 --- a/code/lib/cli/src/automigrate/helpers/checkWebpack5Builder.ts +++ b/code/lib/cli/src/automigrate/helpers/checkWebpack5Builder.ts @@ -1,17 +1,18 @@ import chalk from 'chalk'; import semver from 'semver'; import dedent from 'ts-dedent'; -import type { GetStorybookData } from './mainConfigFile'; -import { getStorybookData } from './mainConfigFile'; +import type { StorybookConfig } from '@storybook/types'; +import { getBuilderPackageName } from './mainConfigFile'; const logger = console; export const checkWebpack5Builder = async ({ - configDir, - packageManager, -}: Parameters[0]) => { - const { mainConfig, storybookVersion } = await getStorybookData({ configDir, packageManager }); - + mainConfig, + storybookVersion, +}: { + mainConfig: StorybookConfig; + storybookVersion: string; +}) => { if (semver.lt(storybookVersion, '6.3.0')) { logger.warn( dedent` @@ -36,9 +37,9 @@ export const checkWebpack5Builder = async ({ return null; } - const builder = mainConfig.core?.builder; - if (builder && builder !== 'webpack4') { - logger.info(`Found builder ${builder}, skipping`); + const builderPackageName = getBuilderPackageName(mainConfig); + if (builderPackageName && builderPackageName !== 'webpack4') { + logger.info(`Found builder ${builderPackageName}, skipping`); return null; } diff --git a/code/lib/cli/src/automigrate/helpers/eslintPlugin.ts b/code/lib/cli/src/automigrate/helpers/eslintPlugin.ts index 3d31d1111498..548b0856a74c 100644 --- a/code/lib/cli/src/automigrate/helpers/eslintPlugin.ts +++ b/code/lib/cli/src/automigrate/helpers/eslintPlugin.ts @@ -54,7 +54,7 @@ export async function configureEslintPlugin(eslintFile: string, packageManager: const eslintConfig = (await readJson(eslintFile)) as { extends?: string[] }; const existingConfigValue = Array.isArray(eslintConfig.extends) ? eslintConfig.extends - : [eslintConfig.extends]; + : [eslintConfig.extends].filter(Boolean); eslintConfig.extends = [...(existingConfigValue || []), 'plugin:storybook/recommended']; const eslintFileContents = await readFile(eslintFile, 'utf8'); @@ -63,8 +63,13 @@ export async function configureEslintPlugin(eslintFile: string, packageManager: } else { const eslint = await readConfig(eslintFile); const extendsConfig = eslint.getFieldValue(['extends']) || []; - const existingConfigValue = Array.isArray(extendsConfig) ? extendsConfig : [extendsConfig]; - eslint.setFieldValue(['extends'], [...existingConfigValue, 'plugin:storybook/recommended']); + const existingConfigValue = Array.isArray(extendsConfig) + ? extendsConfig + : [extendsConfig].filter(Boolean); + eslint.setFieldValue( + ['extends'], + [...(existingConfigValue || []), 'plugin:storybook/recommended'] + ); await writeConfig(eslint); } diff --git a/code/lib/cli/src/automigrate/helpers/getActualPackageVersions.ts b/code/lib/cli/src/automigrate/helpers/getActualPackageVersions.ts deleted file mode 100644 index 77f741def3d6..000000000000 --- a/code/lib/cli/src/automigrate/helpers/getActualPackageVersions.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as fs from 'fs-extra'; -import path from 'path'; - -export const getActualPackageVersions = async (packages: string[]) => { - return Promise.all(packages.map(getActualPackageVersion)); -}; - -export const getActualPackageVersion = async (packageName: string) => { - try { - const packageJson = await getActualPackageJson(packageName); - return { - name: packageName, - version: packageJson.version, - }; - } catch (err) { - return { name: packageName, version: null }; - } -}; - -export const getActualPackageJson = async (packageName: string) => { - const resolvedPackageJson = require.resolve(path.join(packageName, 'package.json'), { - paths: [process.cwd()], - }); - const packageJson = await fs.readJson(resolvedPackageJson); - return packageJson; -}; diff --git a/code/lib/cli/src/automigrate/helpers/getIncompatibleAddons.ts b/code/lib/cli/src/automigrate/helpers/getIncompatibleAddons.ts index fcc4f79e9f4f..d6fc28ed776b 100644 --- a/code/lib/cli/src/automigrate/helpers/getIncompatibleAddons.ts +++ b/code/lib/cli/src/automigrate/helpers/getIncompatibleAddons.ts @@ -1,9 +1,12 @@ import type { StorybookConfig } from '@storybook/types'; import semver from 'semver'; -import { getActualPackageVersions } from './getActualPackageVersions'; import { getAddonNames } from './mainConfigFile'; +import { JsPackageManagerFactory } from '../../js-package-manager'; -export const getIncompatibleAddons = async (mainConfig: StorybookConfig) => { +export const getIncompatibleAddons = async ( + mainConfig: StorybookConfig, + packageManager = JsPackageManagerFactory.getPackageManager() +) => { // TODO: Keep this up to date with https://github.com/storybookjs/storybook/issues/20529 in case more addons get added const incompatibleList = { '@storybook/addon-knobs': '6.4.0', @@ -39,29 +42,29 @@ export const getIncompatibleAddons = async (mainConfig: StorybookConfig) => { return []; } - const addonVersions = await getActualPackageVersions(addons); + const addonVersions = await Promise.all( + addons.map( + async (addon) => + ({ + name: addon, + version: await packageManager.getPackageVersion(addon), + } as { name: keyof typeof incompatibleList; version: string }) + ) + ); const incompatibleAddons: { name: string; version: string }[] = []; - addonVersions.forEach( - ({ - name, - version: installedVersion, - }: { - name: keyof typeof incompatibleList; - version: string; - }) => { - if (installedVersion === null) return; + addonVersions.forEach(({ name, version: installedVersion }) => { + if (installedVersion === null) return; - const addonVersion = incompatibleList[name]; - try { - if (semver.lte(semver.coerce(installedVersion), semver.coerce(addonVersion))) { - incompatibleAddons.push({ name, version: installedVersion }); - } - } catch (err) { - // we tried our best but if we can't compare, we just no-op for that addon + const addonVersion = incompatibleList[name]; + try { + if (semver.lte(semver.coerce(installedVersion), semver.coerce(addonVersion))) { + incompatibleAddons.push({ name, version: installedVersion }); } + } catch (err) { + // we tried our best but if we can't compare, we just no-op for that addon } - ); + }); return incompatibleAddons; }; diff --git a/code/lib/cli/src/automigrate/helpers/mainConfigFile.test.ts b/code/lib/cli/src/automigrate/helpers/mainConfigFile.test.ts new file mode 100644 index 000000000000..f31ca41f0a0f --- /dev/null +++ b/code/lib/cli/src/automigrate/helpers/mainConfigFile.test.ts @@ -0,0 +1,157 @@ +import { + getBuilderPackageName, + getFrameworkPackageName, + getRendererPackageNameFromFramework, +} from './mainConfigFile'; + +describe('getBuilderPackageName', () => { + it('should return null when mainConfig is undefined or null', () => { + const packageName = getBuilderPackageName(undefined); + expect(packageName).toBeNull(); + + const packageName2 = getBuilderPackageName(null); + expect(packageName2).toBeNull(); + }); + + it('should return null when builder package name or path is not found', () => { + const mainConfig = {}; + + const packageName = getBuilderPackageName(mainConfig as any); + expect(packageName).toBeNull(); + }); + + it('should return builder package name when core.builder is a string', () => { + const builderPackage = '@storybook/builder-webpack5'; + const mainConfig = { + core: { + builder: builderPackage, + }, + }; + + const packageName = getBuilderPackageName(mainConfig as any); + expect(packageName).toBe(builderPackage); + }); + + it('should return builder package name when core.builder.name contains valid builder package name', () => { + const builderPackage = '@storybook/builder-webpack5'; + const packageNameOrPath = `/path/to/${builderPackage}`; + const mainConfig = { + core: { + builder: { name: packageNameOrPath }, + }, + }; + + const packageName = getBuilderPackageName(mainConfig as any); + expect(packageName).toBe(builderPackage); + }); + + it('should return builder package name when core.builder.name contains windows backslash paths', () => { + const builderPackage = '@storybook/builder-webpack5'; + const packageNameOrPath = 'c:\\path\\to\\@storybook\\builder-webpack5'; + const mainConfig = { + core: { + builder: { name: packageNameOrPath }, + }, + }; + + const packageName = getBuilderPackageName(mainConfig as any); + expect(packageName).toBe(builderPackage); + }); + + it(`should return package name or path when core.builder doesn't contain the name of a valid builder package`, () => { + const packageNameOrPath = '@my-org/storybook-builder'; + const mainConfig = { + core: { + builder: packageNameOrPath, + }, + }; + + const packageName = getBuilderPackageName(mainConfig as any); + expect(packageName).toBe(packageNameOrPath); + }); +}); + +describe('getFrameworkPackageName', () => { + it('should return null when mainConfig is undefined or null', () => { + const packageName = getFrameworkPackageName(undefined); + expect(packageName).toBeNull(); + + const packageName2 = getFrameworkPackageName(null); + expect(packageName2).toBeNull(); + }); + + it('should return null when framework package name or path is not found', () => { + const mainConfig = {}; + + const packageName = getFrameworkPackageName(mainConfig as any); + expect(packageName).toBeNull(); + }); + + it('should return framework package name when framework is a string', () => { + const frameworkPackage = '@storybook/react'; + const mainConfig = { + framework: frameworkPackage, + }; + + const packageName = getFrameworkPackageName(mainConfig as any); + expect(packageName).toBe(frameworkPackage); + }); + + it('should return framework package name when framework.name contains valid framework package name', () => { + const frameworkPackage = '@storybook/react-vite'; + const packageNameOrPath = `/path/to/${frameworkPackage}`; + const mainConfig = { + framework: { name: packageNameOrPath }, + }; + + const packageName = getFrameworkPackageName(mainConfig as any); + expect(packageName).toBe(frameworkPackage); + }); + + it('should return builder package name when framework.name contains windows backslash paths', () => { + const builderPackage = '@storybook/react-vite'; + const packageNameOrPath = 'c:\\path\\to\\@storybook\\react-vite'; + const mainConfig = { + framework: { name: packageNameOrPath }, + }; + + const packageName = getFrameworkPackageName(mainConfig as any); + expect(packageName).toBe(builderPackage); + }); + + it(`should return package name or path when framework does not contain the name of a valid framework package`, () => { + const packageNameOrPath = '@my-org/storybook-framework'; + const mainConfig = { + framework: packageNameOrPath, + }; + + const packageName = getFrameworkPackageName(mainConfig as any); + expect(packageName).toBe(packageNameOrPath); + }); +}); + +describe('getRendererPackageNameFromFramework', () => { + it('should return null when given no package name', () => { + const packageName = getRendererPackageNameFromFramework(undefined); + expect(packageName).toBeNull(); + }); + + it('should return the frameworkPackageName if it exists in rendererPackages', () => { + const frameworkPackageName = '@storybook/angular'; + const packageName = getRendererPackageNameFromFramework(frameworkPackageName); + expect(packageName).toBe(frameworkPackageName); + }); + + it('should return the corresponding key of rendererPackages if the value is the same as the frameworkPackageName', () => { + const frameworkPackageName = 'vue'; + const expectedPackageName = '@storybook/vue'; + const packageName = getRendererPackageNameFromFramework(frameworkPackageName); + expect(packageName).toBe(expectedPackageName); + }); + + it('should return null if a frameworkPackageName is known but not available in rendererPackages', () => { + const frameworkPackageName = '@storybook/unknown'; + const packageName = getRendererPackageNameFromFramework(frameworkPackageName); + expect(packageName).toBeNull(); + }); +}); diff --git a/code/lib/cli/src/automigrate/helpers/mainConfigFile.ts b/code/lib/cli/src/automigrate/helpers/mainConfigFile.ts index f843f57097f9..d1ccbff10d32 100644 --- a/code/lib/cli/src/automigrate/helpers/mainConfigFile.ts +++ b/code/lib/cli/src/automigrate/helpers/mainConfigFile.ts @@ -1,14 +1,84 @@ -import { getStorybookInfo, loadMainConfig } from '@storybook/core-common'; +import { + getStorybookInfo, + loadMainConfig, + rendererPackages, + frameworkPackages, + builderPackages, +} from '@storybook/core-common'; import type { StorybookConfig } from '@storybook/types'; import type { ConfigFile } from '@storybook/csf-tools'; import { readConfig, writeConfig as writeConfigFile } from '@storybook/csf-tools'; import chalk from 'chalk'; -import semver from 'semver'; import dedent from 'ts-dedent'; +import path from 'path'; import type { JsPackageManager } from '../../js-package-manager'; +import { getStorybookVersion } from '../../utils'; const logger = console; +/** + * Given a Storybook configuration object, retrieves the package name or file path of the framework. + * @param mainConfig - The main Storybook configuration object to lookup. + * @returns - The package name of the framework. If not found, returns null. + */ +export const getFrameworkPackageName = (mainConfig?: StorybookConfig) => { + const packageNameOrPath = + typeof mainConfig?.framework === 'string' ? mainConfig.framework : mainConfig?.framework?.name; + + if (!packageNameOrPath) { + return null; + } + + const normalizedPath = path.normalize(packageNameOrPath).replace(new RegExp(/\\/, 'g'), '/'); + + return ( + Object.keys(frameworkPackages).find((pkg) => normalizedPath.endsWith(pkg)) || packageNameOrPath + ); +}; + +/** + * Given a Storybook configuration object, retrieves the package name or file path of the builder. + * @param mainConfig - The main Storybook configuration object to lookup. + * @returns - The package name of the builder. If not found, returns null. + */ +export const getBuilderPackageName = (mainConfig?: StorybookConfig) => { + const packageNameOrPath = + typeof mainConfig?.core?.builder === 'string' + ? mainConfig.core.builder + : mainConfig?.core?.builder?.name; + + if (!packageNameOrPath) { + return null; + } + + const normalizedPath = path.normalize(packageNameOrPath).replace(new RegExp(/\\/, 'g'), '/'); + + return builderPackages.find((pkg) => normalizedPath.endsWith(pkg)) || packageNameOrPath; +}; + +/** + * Returns a renderer package name given a framework package name. + * @param frameworkPackageName - The package name of the framework to lookup. + * @returns - The corresponding package name in `rendererPackages`. If not found, returns null. + */ +export const getRendererPackageNameFromFramework = (frameworkPackageName: string) => { + if (frameworkPackageName) { + if (Object.keys(rendererPackages).includes(frameworkPackageName)) { + // at some point in 6.4 we introduced a framework field, but filled with a renderer package + return frameworkPackageName; + } + + if (Object.values(rendererPackages).includes(frameworkPackageName)) { + // for scenarios where the value is e.g. "react" instead of "@storybook/react" + return Object.keys(rendererPackages).find( + (k) => rendererPackages[k] === frameworkPackageName + ); + } + } + + return null; +}; + export const getStorybookData = async ({ packageManager, configDir: userDefinedConfigDir, @@ -23,8 +93,7 @@ export const getStorybookData = async ({ configDir: configDirFromScript, previewConfig: previewConfigPath, } = getStorybookInfo(packageJson, userDefinedConfigDir); - const storybookVersion = - storybookVersionSpecifier && semver.coerce(storybookVersionSpecifier)?.version; + const storybookVersion = await getStorybookVersion(packageManager); const configDir = userDefinedConfigDir || configDirFromScript || '.storybook'; diff --git a/code/lib/cli/src/automigrate/helpers/new-frameworks-utils.test.ts b/code/lib/cli/src/automigrate/helpers/new-frameworks-utils.test.ts index ee691d396f53..a112619717b3 100644 --- a/code/lib/cli/src/automigrate/helpers/new-frameworks-utils.test.ts +++ b/code/lib/cli/src/automigrate/helpers/new-frameworks-utils.test.ts @@ -3,6 +3,7 @@ import { detectBuilderInfo as _getBuilderInfo, getNextjsAddonOptions, } from './new-frameworks-utils'; +import type { JsPackageManager } from '../../js-package-manager'; jest.mock('find-up'); @@ -10,17 +11,17 @@ type GetBuilderInfoParams = Parameters[0]['mainConfig']; const getBuilderInfo = async ({ mainConfig = {}, - packageDependencies = {}, + packageManager = {}, configDir = '.storybook', }: { - mainConfig: Partial; - packageDependencies?: Record; + mainConfig?: Partial; + packageManager?: Partial; configDir?: string; }) => { return _getBuilderInfo({ mainConfig: mainConfig as any, configDir, - packageDependencies, + packageManager: packageManager as any, }); }; @@ -29,7 +30,9 @@ describe('getBuilderInfo', () => { await expect( getBuilderInfo({ mainConfig: { - core: { builder: '@storybook/builder-webpack5' }, + core: { + builder: '@storybook/builder-webpack5', + }, }, }) ).resolves.toEqual({ name: 'webpack5', options: {} }); @@ -54,6 +57,15 @@ describe('getBuilderInfo', () => { it('should infer webpack5 info from framework', async () => { await expect( getBuilderInfo({ + packageManager: { + getPackageVersion: (packageName) => { + if (packageName === '@storybook/react-webpack5') { + return Promise.resolve('1.0.0'); + } + + return Promise.resolve(null); + }, + }, mainConfig: { framework: '@storybook/react-webpack5', }, @@ -204,7 +216,14 @@ describe('getBuilderInfo', () => { await expect( getBuilderInfo({ mainConfig: {}, - packageDependencies: { '@storybook/builder-vite': '^7.0.0' }, + packageManager: { + getPackageVersion: (packageName) => { + if (packageName === '@storybook/builder-vite') { + return Promise.resolve('7.0.0'); + } + return Promise.resolve(null); + }, + }, }) ).resolves.toEqual({ name: 'vite', @@ -218,7 +237,14 @@ describe('getBuilderInfo', () => { await expect( getBuilderInfo({ mainConfig: {}, - packageDependencies: { '@storybook/builder-webpack5': '^7.0.0' }, + packageManager: { + getPackageVersion: (packageName) => { + if (packageName === '@storybook/builder-webpack5') { + return Promise.resolve('7.0.0'); + } + return Promise.resolve(null); + }, + }, }) ).resolves.toEqual({ name: 'webpack5', diff --git a/code/lib/cli/src/automigrate/helpers/new-frameworks-utils.ts b/code/lib/cli/src/automigrate/helpers/new-frameworks-utils.ts index a6640c8bb147..db84aaa3b245 100644 --- a/code/lib/cli/src/automigrate/helpers/new-frameworks-utils.ts +++ b/code/lib/cli/src/automigrate/helpers/new-frameworks-utils.ts @@ -1,6 +1,8 @@ import { frameworkPackages } from '@storybook/core-common'; import type { Preset, StorybookConfig } from '@storybook/types'; import findUp from 'find-up'; +import type { JsPackageManager } from '../../js-package-manager'; +import { getBuilderPackageName, getFrameworkPackageName } from './mainConfigFile'; const logger = console; @@ -62,32 +64,29 @@ type BuilderType = 'vite' | 'webpack5'; export const detectBuilderInfo = async ({ mainConfig, configDir, - packageDependencies, + packageManager, }: { mainConfig: StorybookConfig & { builder?: string | Preset }; configDir: string; - packageDependencies: Record; + packageManager: JsPackageManager; }): Promise<{ name: BuilderType; options: any }> => { - let builderOptions = {}; let builderName: BuilderType; let builderOrFrameworkName; const { core = {}, framework } = mainConfig; const { builder } = core; - if (builder) { - if (typeof builder === 'string') { - builderOrFrameworkName = builder; - } else { - builderOrFrameworkName = builder.name; + const builderPackageName = getBuilderPackageName(mainConfig); + const frameworkPackageName = getFrameworkPackageName(mainConfig); - builderOptions = builder.options || {}; - } + let builderOptions = typeof builder !== 'string' ? builder?.options ?? {} : {}; + + if (builderPackageName) { + builderOrFrameworkName = builderPackageName; } else if (framework) { - const frameworkName = typeof framework === 'string' ? framework : framework.name; - if (Object.keys(frameworkPackages).includes(frameworkName)) { - builderOrFrameworkName = frameworkName; - builderOptions = typeof framework === 'object' ? framework.options?.builder : {}; + if (Object.keys(frameworkPackages).includes(frameworkPackageName)) { + builderOrFrameworkName = frameworkPackageName; + builderOptions = typeof framework === 'object' ? framework.options?.builder ?? {} : {}; } } @@ -112,15 +111,22 @@ export const detectBuilderInfo = async ({ // if builder is still not detected, rely on package dependencies if (!builderOrFrameworkName) { - if ( - packageDependencies['@storybook/builder-vite'] || - packageDependencies['storybook-builder-vite'] - ) { + const storybookBuilderViteVersion = await packageManager.getPackageVersion( + '@storybook/builder-vite' + ); + const storybookBuilderVite2Version = await packageManager.getPackageVersion( + 'storybook-builder-vite' + ); + const storybookBuilderWebpack5Version = await packageManager.getPackageVersion( + '@storybook/builder-webpack5' + ); + const storybookBuilderManagerWebpack5Version = await packageManager.getPackageVersion( + '@storybook/manager-webpack5' + ); + + if (storybookBuilderViteVersion || storybookBuilderVite2Version) { builderOrFrameworkName = 'vite'; - } else if ( - packageDependencies['@storybook/builder-webpack5'] || - packageDependencies['@storybook/manager-webpack5'] - ) { + } else if (storybookBuilderWebpack5Version || storybookBuilderManagerWebpack5Version) { builderOrFrameworkName = 'webpack5'; } } diff --git a/code/lib/cli/src/automigrate/helpers/testing-helpers.ts b/code/lib/cli/src/automigrate/helpers/testing-helpers.ts index 3651fe472caf..f7b206ccb004 100644 --- a/code/lib/cli/src/automigrate/helpers/testing-helpers.ts +++ b/code/lib/cli/src/automigrate/helpers/testing-helpers.ts @@ -1,6 +1,4 @@ import type { JsPackageManager, PackageJson } from '../../js-package-manager'; -import type { GetStorybookData } from './mainConfigFile'; -import * as mainConfigFile from './mainConfigFile'; jest.mock('./mainConfigFile', () => ({ ...jest.requireActual('./mainConfigFile'), @@ -23,21 +21,3 @@ export const makePackageManager = (packageJson: PackageJson) => { }), } as JsPackageManager; }; - -type GetStorybookDataParams = Awaited>; -export const mockStorybookData = ( - mockData: { - mainConfig: Partial & Record; - storybookVersion: GetStorybookDataParams['storybookVersion']; - } & Partial> -) => { - const defaults: Partial = { - configDir: '', - mainConfigPath: '', - }; - - jest.spyOn(mainConfigFile, 'getStorybookData').mockResolvedValueOnce({ - ...defaults, - ...mockData, - } as GetStorybookDataParams); -}; diff --git a/code/lib/cli/src/automigrate/index.ts b/code/lib/cli/src/automigrate/index.ts index 01447e371cd4..3e8e5af0e461 100644 --- a/code/lib/cli/src/automigrate/index.ts +++ b/code/lib/cli/src/automigrate/index.ts @@ -8,7 +8,6 @@ import dedent from 'ts-dedent'; import { join } from 'path'; import { getStorybookInfo, loadMainConfig } from '@storybook/core-common'; -import semver from 'semver'; import { JsPackageManagerFactory, useNpmWarning } from '../js-package-manager'; import type { PackageManagerName } from '../js-package-manager'; @@ -16,6 +15,8 @@ import type { Fix, FixId, FixOptions, FixSummary } from './fixes'; import { FixStatus, PreCheckFailure, allFixes } from './fixes'; import { cleanLog } from './helpers/cleanLog'; import { getMigrationSummary } from './helpers/getMigrationSummary'; +import { getStorybookData } from './helpers/mainConfigFile'; +import { getStorybookVersion } from '../utils'; const logger = console; const LOG_FILE_NAME = 'migration-storybook.log'; @@ -157,14 +158,14 @@ export async function runFixes({ const fixResults = {} as Record; const fixSummary: FixSummary = { succeeded: [], failed: {}, manual: [], skipped: [] }; - const { - configDir: inferredConfigDir, - mainConfig: mainConfigPath, - version: storybookVersion, - } = getStorybookInfo(await packageManager.retrievePackageJson(), userSpecifiedConfigDir); + const { configDir: inferredConfigDir, mainConfig: mainConfigPath } = getStorybookInfo( + await packageManager.retrievePackageJson(), + userSpecifiedConfigDir + ); + + const storybookVersion = await getStorybookVersion(packageManager); - const sbVersionCoerced = storybookVersion && semver.coerce(storybookVersion)?.version; - if (!sbVersionCoerced) { + if (!storybookVersion) { logger.info(dedent` [Storybook automigrate] ❌ Unable to determine storybook version so the automigrations will be skipped. πŸ€” Are you running automigrate from your project directory? Please specify your Storybook config directory with the --config-dir flag. @@ -211,10 +212,19 @@ export async function runFixes({ let result; try { + const { mainConfig, previewConfigPath } = await getStorybookData({ + configDir, + packageManager, + }); + result = await f.check({ packageManager, configDir, rendererPackage, + mainConfig, + storybookVersion, + previewConfigPath, + mainConfigPath, }); } catch (error) { logger.info(`⚠️ failed to check fix ${chalk.bold(f.id)}`); diff --git a/code/lib/cli/src/automigrate/types.ts b/code/lib/cli/src/automigrate/types.ts index f172af777fc8..740dfa3a0451 100644 --- a/code/lib/cli/src/automigrate/types.ts +++ b/code/lib/cli/src/automigrate/types.ts @@ -1,9 +1,14 @@ +import type { StorybookConfig } from '@storybook/types'; import type { JsPackageManager, PackageManagerName } from '../js-package-manager'; export interface CheckOptions { packageManager: JsPackageManager; rendererPackage?: string; configDir?: string; + mainConfig: StorybookConfig; + storybookVersion: string; + previewConfigPath?: string; + mainConfigPath?: string; } export interface RunOptions { diff --git a/code/lib/cli/src/detect.test.ts b/code/lib/cli/src/detect.test.ts index 0136d4991377..85f29d884d41 100644 --- a/code/lib/cli/src/detect.test.ts +++ b/code/lib/cli/src/detect.test.ts @@ -1,13 +1,11 @@ import * as fs from 'fs'; import { logger } from '@storybook/node-logger'; -import { getBowerJson } from './helpers'; import { detect, detectFrameworkPreset, detectLanguage } from './detect'; import { ProjectType, SupportedLanguage } from './project_types'; -import type { PackageJsonWithMaybeDeps } from './js-package-manager'; +import type { JsPackageManager, PackageJsonWithMaybeDeps } from './js-package-manager'; jest.mock('./helpers', () => ({ isNxProject: jest.fn(), - getBowerJson: jest.fn(), })); jest.mock('fs', () => ({ @@ -235,54 +233,123 @@ const MOCK_FRAMEWORK_FILES: { ]; describe('Detect', () => { - it(`should return type HTML if html option is passed`, () => { - expect(detect({ dependencies: {} }, { html: true })).toBe(ProjectType.HTML); - }); + it(`should return type HTML if html option is passed`, async () => { + const packageManager = { + retrievePackageJson: () => Promise.resolve({ dependencies: {}, devDependencies: {} }), + getPackageVersion: () => Promise.resolve(null), + } as any as JsPackageManager; - it(`should return type UNDETECTED if neither packageJson or bowerJson exist`, () => { - (getBowerJson as jest.Mock).mockImplementation(() => false); - expect(detect(undefined)).toBe(ProjectType.UNDETECTED); + await expect(detect(packageManager, { html: true })).resolves.toBe(ProjectType.HTML); }); - it(`should return language javascript if the TS dependency is present but less than minimum supported`, () => { + it(`should return language javascript if the TS dependency is present but less than minimum supported`, async () => { (logger.warn as jest.MockedFunction).mockClear(); - expect(detectLanguage({ dependencies: { typescript: '1.0.0' } })).toBe( - SupportedLanguage.JAVASCRIPT - ); + + const packageManager = { + retrievePackageJson: () => Promise.resolve({ dependencies: {}, devDependencies: {} }), + getPackageVersion: (packageName) => { + switch (packageName) { + case 'typescript': + return Promise.resolve('1.0.0'); + default: + return Promise.resolve(null); + } + }, + } as Partial; + + await expect(detectLanguage(packageManager as any)).resolves.toBe(SupportedLanguage.JAVASCRIPT); expect(logger.warn).toHaveBeenCalledWith( 'Detected TypeScript < 3.8, populating with JavaScript examples' ); }); - it(`should return language typescript-3-8 if the TS dependency is >=3.8 and <4.9`, () => { - expect(detectLanguage({ dependencies: { typescript: '3.8.0' } })).toBe( - SupportedLanguage.TYPESCRIPT_3_8 - ); - expect(detectLanguage({ dependencies: { typescript: '4.8.0' } })).toBe( - SupportedLanguage.TYPESCRIPT_3_8 - ); + it(`should return language typescript-3-8 if the TS dependency is >=3.8 and <4.9`, async () => { + await expect( + detectLanguage({ + retrievePackageJson: () => Promise.resolve({ dependencies: {}, devDependencies: {} }), + getPackageVersion: (packageName: string) => { + switch (packageName) { + case 'typescript': + return Promise.resolve('3.8.0'); + default: + return Promise.resolve(null); + } + }, + } as Partial as JsPackageManager) + ).resolves.toBe(SupportedLanguage.TYPESCRIPT_3_8); + + await expect( + detectLanguage({ + retrievePackageJson: () => Promise.resolve({ dependencies: {}, devDependencies: {} }), + getPackageVersion: (packageName: string) => { + switch (packageName) { + case 'typescript': + return Promise.resolve('4.8.0'); + default: + return Promise.resolve(null); + } + }, + } as Partial as JsPackageManager) + ).resolves.toBe(SupportedLanguage.TYPESCRIPT_3_8); }); - it(`should return language typescript-4-9 if the dependency is >TS4.9`, () => { - expect(detectLanguage({ dependencies: { typescript: '4.9.1' } })).toBe( - SupportedLanguage.TYPESCRIPT_4_9 - ); + it(`should return language typescript-4-9 if the dependency is >TS4.9`, async () => { + await expect( + detectLanguage({ + retrievePackageJson: () => Promise.resolve({ dependencies: {}, devDependencies: {} }), + getPackageVersion: (packageName: string) => { + switch (packageName) { + case 'typescript': + return Promise.resolve('4.9.1'); + default: + return Promise.resolve(null); + } + }, + } as Partial as JsPackageManager) + ).resolves.toBe(SupportedLanguage.TYPESCRIPT_4_9); }); - it(`should return language typescript if the dependency is =TS4.9`, () => { - expect(detectLanguage({ dependencies: { typescript: '4.9.0' } })).toBe( - SupportedLanguage.TYPESCRIPT_4_9 - ); + it(`should return language typescript if the dependency is =TS4.9`, async () => { + await expect( + detectLanguage({ + retrievePackageJson: () => Promise.resolve({ dependencies: {}, devDependencies: {} }), + getPackageVersion: (packageName: string) => { + switch (packageName) { + case 'typescript': + return Promise.resolve('4.9.0'); + default: + return Promise.resolve(null); + } + }, + } as Partial as JsPackageManager) + ).resolves.toBe(SupportedLanguage.TYPESCRIPT_4_9); }); - it(`should return language typescript if the dependency is =TS4.9beta`, () => { - expect(detectLanguage({ dependencies: { typescript: '^4.9.0-beta' } })).toBe( - SupportedLanguage.TYPESCRIPT_4_9 - ); + it(`should return language typescript if the dependency is =TS4.9beta`, async () => { + await expect( + detectLanguage({ + retrievePackageJson: () => Promise.resolve({ dependencies: {}, devDependencies: {} }), + getPackageVersion: (packageName: string) => { + switch (packageName) { + case 'typescript': + return Promise.resolve('4.9.0-beta'); + default: + return Promise.resolve(null); + } + }, + } as Partial as JsPackageManager) + ).resolves.toBe(SupportedLanguage.TYPESCRIPT_3_8); }); - it(`should return language javascript by default`, () => { - expect(detectLanguage()).toBe(SupportedLanguage.JAVASCRIPT); + it(`should return language javascript by default`, async () => { + await expect( + detectLanguage({ + retrievePackageJson: () => Promise.resolve({ dependencies: {}, devDependencies: {} }), + getPackageVersion: () => { + return Promise.resolve(null); + }, + } as Partial as JsPackageManager) + ).resolves.toBe(SupportedLanguage.JAVASCRIPT); }); describe('detectFrameworkPreset should return', () => { diff --git a/code/lib/cli/src/detect.ts b/code/lib/cli/src/detect.ts index f6306ad45ec1..fa3cda1135f5 100644 --- a/code/lib/cli/src/detect.ts +++ b/code/lib/cli/src/detect.ts @@ -3,8 +3,7 @@ import findUp from 'find-up'; import semver from 'semver'; import { logger } from '@storybook/node-logger'; -import { pathExistsSync } from 'fs-extra'; -import { join, resolve } from 'path'; +import { resolve } from 'path'; import prompts from 'prompts'; import type { TemplateConfiguration, TemplateMatcher } from './project_types'; import { @@ -14,8 +13,8 @@ import { unsupportedTemplate, CoreBuilder, } from './project_types'; -import { commandLog, getBowerJson, isNxProject } from './helpers'; -import type { JsPackageManager, PackageJson, PackageJsonWithMaybeDeps } from './js-package-manager'; +import { commandLog, isNxProject } from './helpers'; +import type { JsPackageManager, PackageJsonWithMaybeDeps } from './js-package-manager'; const viteConfigFiles = ['vite.config.ts', 'vite.config.js', 'vite.config.mjs']; const webpackConfigFiles = ['webpack.config.js']; @@ -155,69 +154,60 @@ export function isStorybookInstantiated(configDir = resolve(process.cwd(), '.sto return fs.existsSync(configDir); } -export function detectPnp() { - return pathExistsSync(join(process.cwd(), '.pnp.cjs')); +export async function detectPnp() { + return !!findUp.sync(['.pnp.js', '.pnp.cjs']); } -export function detectLanguage(packageJson?: PackageJson) { +export async function detectLanguage(packageManager: JsPackageManager) { let language = SupportedLanguage.JAVASCRIPT; - // TODO: we may need to also detect whether a jsconfig.json file is present - // in a monorepo root directory - if (!packageJson || fs.existsSync('jsconfig.json')) { + if (fs.existsSync('jsconfig.json')) { return language; } + const typescriptVersion = await packageManager.getPackageVersion('typescript'); + const prettierVersion = await packageManager.getPackageVersion('prettier'); + const babelPluginTransformTypescriptVersion = await packageManager.getPackageVersion( + '@babel/plugin-transform-typescript' + ); + const typescriptEslintParserVersion = await packageManager.getPackageVersion( + '@typescript-eslint/parser' + ); + + const eslintPluginStorybookVersion = await packageManager.getPackageVersion( + 'eslint-plugin-storybook' + ); + if ( - hasDependency(packageJson, 'typescript', (version) => - semver.gte(semver.coerce(version), '4.9.0') - ) && - (!hasDependency(packageJson, 'prettier') || - hasDependency(packageJson, 'prettier', (version) => - semver.gte(semver.coerce(version), '2.8.0') - )) && - (!hasDependency(packageJson, '@babel/plugin-transform-typescript') || - hasDependency(packageJson, '@babel/plugin-transform-typescript', (version) => - semver.gte(semver.coerce(version), '7.20.0') - )) && - (!hasDependency(packageJson, '@typescript-eslint/parser') || - hasDependency(packageJson, '@typescript-eslint/parser', (version) => - semver.gte(semver.coerce(version), '5.44.0') - )) && - (!hasDependency(packageJson, 'eslint-plugin-storybook') || - hasDependency(packageJson, 'eslint-plugin-storybook', (version) => - semver.gte(semver.coerce(version), '0.6.8') - )) + typescriptVersion && + semver.gte(typescriptVersion, '4.9.0') && + (!prettierVersion || semver.gte(prettierVersion, '2.8.0')) && + (!babelPluginTransformTypescriptVersion || + semver.gte(babelPluginTransformTypescriptVersion, '7.20.0')) && + (!typescriptEslintParserVersion || semver.gte(typescriptEslintParserVersion, '5.44.0')) && + (!eslintPluginStorybookVersion || semver.gte(eslintPluginStorybookVersion, '0.6.8')) ) { language = SupportedLanguage.TYPESCRIPT_4_9; - } else if ( - hasDependency(packageJson, 'typescript', (version) => - semver.gte(semver.coerce(version), '3.8.0') - ) - ) { + } else if (typescriptVersion && semver.gte(typescriptVersion, '3.8.0')) { language = SupportedLanguage.TYPESCRIPT_3_8; - } else if ( - hasDependency(packageJson, 'typescript', (version) => - semver.lt(semver.coerce(version), '3.8.0') - ) - ) { + } else if (typescriptVersion && semver.lt(typescriptVersion, '3.8.0')) { logger.warn('Detected TypeScript < 3.8, populating with JavaScript examples'); } return language; } -export function detect( - packageJson: PackageJson, +export async function detect( + packageManager: JsPackageManager, options: { force?: boolean; html?: boolean } = {} ) { - const bowerJson = getBowerJson(); + const packageJson = await packageManager.retrievePackageJson(); - if (!packageJson && !bowerJson) { + if (!packageJson) { return ProjectType.UNDETECTED; } - if (isNxProject(packageJson)) { + if (await isNxProject(packageManager)) { return ProjectType.NX; } @@ -225,5 +215,5 @@ export function detect( return ProjectType.HTML; } - return detectFrameworkPreset(packageJson || bowerJson); + return detectFrameworkPreset(packageJson); } diff --git a/code/lib/cli/src/generators/ANGULAR/index.ts b/code/lib/cli/src/generators/ANGULAR/index.ts index 62ba7f0fb41b..3c4d9a1f0ca9 100644 --- a/code/lib/cli/src/generators/ANGULAR/index.ts +++ b/code/lib/cli/src/generators/ANGULAR/index.ts @@ -13,16 +13,8 @@ const generator: Generator<{ projectName: string }> = async ( options, commandOptions ) => { - const angularVersionFromDependencies = semver.coerce( - (await packageManager.retrievePackageJson()).dependencies['@angular/core'] - )?.version; - - const angularVersionFromDevDependencies = semver.coerce( - (await packageManager.retrievePackageJson()).devDependencies['@angular/core'] - )?.version; - - const angularVersion = angularVersionFromDependencies || angularVersionFromDevDependencies; - const isWebpack5 = semver.gte(angularVersion, '12.0.0'); + const angularVersion = await packageManager.getPackageVersion('@angular/core'); + const isWebpack5 = angularVersion && semver.gte(angularVersion, '12.0.0'); const updatedOptions = isWebpack5 ? { ...options, builder: CoreBuilder.Webpack5 } : options; const angularJSON = new AngularJSON(); @@ -79,7 +71,7 @@ const generator: Generator<{ projectName: string }> = async ( }, 'angular', { - ...(useCompodoc && { extraPackages: ['@compodoc/compodoc'] }), + ...(useCompodoc && { extraPackages: ['@compodoc/compodoc', '@storybook/addon-docs'] }), addScripts: false, componentsDestinationPath: root ? `${root}/src/stories` : undefined, storybookConfigFolder: storybookFolder, diff --git a/code/lib/cli/src/generators/REACT/index.ts b/code/lib/cli/src/generators/REACT/index.ts index c37ebc323f99..86fcd790a312 100644 --- a/code/lib/cli/src/generators/REACT/index.ts +++ b/code/lib/cli/src/generators/REACT/index.ts @@ -5,7 +5,7 @@ import type { Generator } from '../types'; const generator: Generator = async (packageManager, npmOptions, options) => { // Add prop-types dependency if not using TypeScript - const language = detectLanguage(); + const language = await detectLanguage(packageManager); const extraPackages = language === SupportedLanguage.JAVASCRIPT ? ['prop-types'] : []; await baseGenerator(packageManager, npmOptions, options, 'react', { diff --git a/code/lib/cli/src/generators/REACT_SCRIPTS/index.ts b/code/lib/cli/src/generators/REACT_SCRIPTS/index.ts index 8948aea95500..46846ccc1bc5 100644 --- a/code/lib/cli/src/generators/REACT_SCRIPTS/index.ts +++ b/code/lib/cli/src/generators/REACT_SCRIPTS/index.ts @@ -25,8 +25,7 @@ const generator: Generator = async (packageManager, npmOptions, options) => { } : {}; - const packageJson = await packageManager.retrievePackageJson(); - const craVersion = semver.coerce(packageJson.dependencies['react-scripts'])?.version; + const craVersion = await packageManager.getPackageVersion('react-scripts'); const isCra5OrHigher = craVersion && semver.gte(craVersion, '5.0.0'); const updatedOptions = isCra5OrHigher ? { ...options, builder: CoreBuilder.Webpack5 } : options; diff --git a/code/lib/cli/src/generators/baseGenerator.ts b/code/lib/cli/src/generators/baseGenerator.ts index 512e6dca5c9b..636448b8dd45 100644 --- a/code/lib/cli/src/generators/baseGenerator.ts +++ b/code/lib/cli/src/generators/baseGenerator.ts @@ -246,7 +246,7 @@ export async function baseGenerator( addons.push('@storybook/addon-interactions'); addonPackages.push( '@storybook/addon-interactions', - '@storybook/testing-library@^0.0.14-next.1' + '@storybook/testing-library@^0.1.1-future.2' ); } diff --git a/code/lib/cli/src/helpers.test.ts b/code/lib/cli/src/helpers.test.ts index 4f5c3d37afee..22b737b8e310 100644 --- a/code/lib/cli/src/helpers.test.ts +++ b/code/lib/cli/src/helpers.test.ts @@ -22,6 +22,10 @@ jest.mock('fs-extra', () => ({ pathExists: jest.fn(), })); +jest.mock('find-up', () => ({ + sync: jest.fn(), +})); + jest.mock('path', () => { const path = jest.requireActual('path'); return { diff --git a/code/lib/cli/src/helpers.ts b/code/lib/cli/src/helpers.ts index f928fe2c9983..c86abe299bf2 100644 --- a/code/lib/cli/src/helpers.ts +++ b/code/lib/cli/src/helpers.ts @@ -6,6 +6,7 @@ import chalk from 'chalk'; import { satisfies } from 'semver'; import stripJsonComments from 'strip-json-comments'; +import findUp from 'find-up'; import { getCliDir, getRendererDir } from './dirs'; import type { JsPackageManager, @@ -18,16 +19,6 @@ import storybookMonorepoPackages from './versions'; const logger = console; -export function getBowerJson() { - const bowerJsonPath = path.resolve('bower.json'); - if (!fs.existsSync(bowerJsonPath)) { - return false; - } - - const jsonContent = fs.readFileSync(bowerJsonPath, 'utf8'); - return JSON.parse(jsonContent); -} - export function readFileAsJson(jsonPath: string, allowComments?: boolean) { const filePath = path.resolve(jsonPath); if (!fs.existsSync(filePath)) { @@ -274,6 +265,7 @@ export function getStorybookVersionSpecifier(packageJson: PackageJsonWithDepsAnd return allDeps[storybookPackage]; } -export function isNxProject(packageJSON: PackageJson) { - return !!packageJSON.devDependencies?.nx || fs.existsSync('nx.json'); +export async function isNxProject(packageManager: JsPackageManager) { + const nxVersion = await packageManager.getPackageVersion('nx'); + return !!nxVersion ?? findUp.sync('nx.json'); } diff --git a/code/lib/cli/src/initiate.ts b/code/lib/cli/src/initiate.ts index 0f74d3c21609..105f89a25b5b 100644 --- a/code/lib/cli/src/initiate.ts +++ b/code/lib/cli/src/initiate.ts @@ -52,15 +52,8 @@ const installStorybook = async ( skipInstall: options.skipInstall, }; - let packageJson; - try { - packageJson = await packageManager.readPackageJson(); - } catch (err) { - // - } - - const language = detectLanguage(packageJson); - const pnp = detectPnp(); + const language = await detectLanguage(packageManager); + const pnp = await detectPnp(); const generatorOptions = { language, @@ -265,8 +258,6 @@ async function doInitiate(options: CommandOptions, pkg: PackageJson): Promise; + + public abstract getPackageVersion(packageName: string, basePath?: string): Promise; + // NOTE: for some reason yarn prefers the npm registry in // local development, so always use npm async setRegistryURL(url: string) { @@ -66,7 +73,7 @@ export abstract class JsPackageManager { } constructor(options?: JsPackageManagerOptions) { - this.cwd = options?.cwd; + this.cwd = options?.cwd || process.cwd(); } /** @@ -90,7 +97,7 @@ export abstract class JsPackageManager { } packageJsonPath(): string { - return this.cwd ? path.resolve(this.cwd, 'package.json') : path.resolve('package.json'); + return path.resolve(this.cwd, 'package.json'); } async readPackageJson(): Promise { @@ -236,13 +243,13 @@ export abstract class JsPackageManager { * `@storybook/addon-actions`, * ]); */ - public removeDependencies( + public async removeDependencies( options: { skipInstall?: boolean; packageJson?: PackageJson; }, dependencies: string[] - ): void { + ): Promise { const { skipInstall } = options; if (skipInstall) { @@ -257,10 +264,10 @@ export abstract class JsPackageManager { } }); - this.writePackageJson(packageJson); + await this.writePackageJson(packageJson); } else { try { - this.runRemoveDeps(dependencies); + await this.runRemoveDeps(dependencies); } catch (e) { logger.error('An error occurred while removing dependencies.'); logger.log(e.message); diff --git a/code/lib/cli/src/js-package-manager/NPMProxy.ts b/code/lib/cli/src/js-package-manager/NPMProxy.ts index 47827adfd153..519030d34a59 100644 --- a/code/lib/cli/src/js-package-manager/NPMProxy.ts +++ b/code/lib/cli/src/js-package-manager/NPMProxy.ts @@ -1,6 +1,10 @@ import sort from 'semver/functions/sort'; import { platform } from 'os'; import dedent from 'ts-dedent'; +import { sync as findUpSync } from 'find-up'; +import { existsSync, readFileSync } from 'fs'; +import path from 'path'; +import semver from 'semver'; import { JsPackageManager } from './JsPackageManager'; import type { PackageJson } from './PackageJson'; import type { InstallationMetadata, PackageMetadata } from './types'; @@ -77,6 +81,31 @@ export class NPMProxy extends JsPackageManager { return this.executeCommand({ command: 'npm', args: ['--version'] }); } + public async getPackageJSON( + packageName: string, + basePath = this.cwd + ): Promise { + const packageJsonPath = await findUpSync( + (dir) => { + const possiblePath = path.join(dir, 'node_modules', packageName, 'package.json'); + return existsSync(possiblePath) ? possiblePath : undefined; + }, + { cwd: basePath } + ); + + if (!packageJsonPath) { + return null; + } + + const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')); + return packageJson; + } + + public async getPackageVersion(packageName: string, basePath = this.cwd): Promise { + const packageJson = await this.getPackageJSON(packageName, basePath); + return packageJson ? semver.coerce(packageJson.version)?.version ?? null : null; + } + getInstallArgs(): string[] { if (!this.installArgs) { this.installArgs = []; diff --git a/code/lib/cli/src/js-package-manager/PNPMProxy.ts b/code/lib/cli/src/js-package-manager/PNPMProxy.ts index 098bbfd7a4be..4ddaeb6fcda3 100644 --- a/code/lib/cli/src/js-package-manager/PNPMProxy.ts +++ b/code/lib/cli/src/js-package-manager/PNPMProxy.ts @@ -1,5 +1,9 @@ import { pathExistsSync } from 'fs-extra'; import dedent from 'ts-dedent'; +import { sync as findUpSync } from 'find-up'; +import path from 'path'; +import fs from 'fs'; +import semver from 'semver'; import { JsPackageManager } from './JsPackageManager'; import type { PackageJson } from './PackageJson'; import type { InstallationMetadata, PackageMetadata } from './types'; @@ -107,6 +111,56 @@ export class PNPMProxy extends JsPackageManager { } } + public async getPackageJSON( + packageName: string, + basePath = this.cwd + ): Promise { + const pnpapiPath = findUpSync(['.pnp.js', '.pnp.cjs'], { cwd: basePath }); + + if (pnpapiPath) { + try { + // eslint-disable-next-line import/no-dynamic-require, global-require + const pnpApi = require(pnpapiPath); + + const resolvedPath = await pnpApi.resolveToUnqualified(packageName, basePath, { + considerBuiltins: false, + }); + + const pkgLocator = pnpApi.findPackageLocator(resolvedPath); + const pkg = pnpApi.getPackageInformation(pkgLocator); + + const packageJSON = JSON.parse( + fs.readFileSync(path.join(pkg.packageLocation, 'package.json'), 'utf-8') + ); + + return packageJSON; + } catch (error) { + console.error('Error while fetching package version in PNPM PnP mode:', error); + return null; + } + } + + const packageJsonPath = await findUpSync( + (dir) => { + const possiblePath = path.join(dir, 'node_modules', packageName, 'package.json'); + return fs.existsSync(possiblePath) ? possiblePath : undefined; + }, + { cwd: basePath } + ); + + if (!packageJsonPath) { + return null; + } + + return JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')); + } + + async getPackageVersion(packageName: string, basePath = this.cwd): Promise { + const packageJSON = await this.getPackageJSON(packageName, basePath); + + return packageJSON ? semver.coerce(packageJSON.version)?.version ?? null : null; + } + protected getResolutions(packageJson: PackageJson, versions: Record) { return { overrides: { diff --git a/code/lib/cli/src/js-package-manager/Yarn1Proxy.ts b/code/lib/cli/src/js-package-manager/Yarn1Proxy.ts index be7103d47a36..3793b7f54528 100644 --- a/code/lib/cli/src/js-package-manager/Yarn1Proxy.ts +++ b/code/lib/cli/src/js-package-manager/Yarn1Proxy.ts @@ -1,4 +1,8 @@ import dedent from 'ts-dedent'; +import { sync as findUpSync } from 'find-up'; +import { existsSync, readFileSync } from 'fs'; +import path from 'path'; +import semver from 'semver'; import { createLogStream } from '../utils'; import { JsPackageManager } from './JsPackageManager'; import type { PackageJson } from './PackageJson'; @@ -59,6 +63,30 @@ export class Yarn1Proxy extends JsPackageManager { return this.executeCommand({ command: `yarn`, args: [command, ...args], cwd }); } + public async getPackageJSON( + packageName: string, + basePath = this.cwd + ): Promise { + const packageJsonPath = await findUpSync( + (dir) => { + const possiblePath = path.join(dir, 'node_modules', packageName, 'package.json'); + return existsSync(possiblePath) ? possiblePath : undefined; + }, + { cwd: basePath } + ); + + if (!packageJsonPath) { + return null; + } + + return JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as Record; + } + + public async getPackageVersion(packageName: string, basePath = this.cwd): Promise { + const packageJson = await this.getPackageJSON(packageName, basePath); + return packageJson ? semver.coerce(packageJson.version)?.version ?? null : null; + } + public async findInstallations(pattern: string[]) { const commandResult = await this.executeCommand({ command: 'yarn', diff --git a/code/lib/cli/src/js-package-manager/Yarn2Proxy.ts b/code/lib/cli/src/js-package-manager/Yarn2Proxy.ts index f6675b57574c..742bcf4a8fd3 100644 --- a/code/lib/cli/src/js-package-manager/Yarn2Proxy.ts +++ b/code/lib/cli/src/js-package-manager/Yarn2Proxy.ts @@ -1,4 +1,10 @@ import dedent from 'ts-dedent'; +import { sync as findUpSync, sync as syncFindUp } from 'find-up'; +import fs, { existsSync, readFileSync } from 'fs'; +import path from 'path'; +import { NodeFS, VirtualFS, ZipOpenFS } from '@yarnpkg/fslib'; +import { getLibzipSync } from '@yarnpkg/libzip'; +import semver from 'semver'; import { createLogStream } from '../utils'; import { JsPackageManager } from './JsPackageManager'; import type { PackageJson } from './PackageJson'; @@ -117,6 +123,64 @@ export class Yarn2Proxy extends JsPackageManager { } } + async getPackageJSON(packageName: string, basePath = this.cwd): Promise { + const pnpapiPath = findUpSync(['.pnp.js', '.pnp.cjs'], { cwd: basePath }); + + if (pnpapiPath) { + try { + // eslint-disable-next-line import/no-dynamic-require, global-require + const pnpApi = require(pnpapiPath); + + const resolvedPath = await pnpApi.resolveToUnqualified(packageName, basePath, { + considerBuiltins: false, + }); + + const pkgLocator = pnpApi.findPackageLocator(resolvedPath); + const pkg = pnpApi.getPackageInformation(pkgLocator); + + const localFs: typeof fs = { ...fs }; + const nodeFs = new NodeFS(localFs); + + const zipOpenFs = new ZipOpenFS({ + libzip: getLibzipSync(), + baseFs: nodeFs, + readOnlyArchives: true, + }); + + const virtualFs = new VirtualFS({ + baseFs: zipOpenFs, + }); + + return virtualFs.readJsonSync(path.join(pkg.packageLocation, 'package.json') as any); + } catch (error) { + if (error.code !== 'MODULE_NOT_FOUND') { + console.error('Error while fetching package version in Yarn PnP mode:', error); + } + return null; + } + } + + const packageJsonPath = await syncFindUp( + (dir) => { + const possiblePath = path.join(dir, 'node_modules', packageName, 'package.json'); + return existsSync(possiblePath) ? possiblePath : undefined; + }, + { cwd: basePath } + ); + + if (!packageJsonPath) { + return null; + } + + const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')); + return packageJson; + } + + async getPackageVersion(packageName: string, basePath = this.cwd): Promise { + const packageJSON = await this.getPackageJSON(packageName, basePath); + return packageJSON ? semver.coerce(packageJSON.version)?.version ?? null : null; + } + protected getResolutions(packageJson: PackageJson, versions: Record) { return { resolutions: { diff --git a/code/lib/cli/src/utils.ts b/code/lib/cli/src/utils.ts index 4ae92e61ad66..1aedbe047d59 100644 --- a/code/lib/cli/src/utils.ts +++ b/code/lib/cli/src/utils.ts @@ -2,6 +2,8 @@ import type { WriteStream } from 'fs-extra'; import { move, remove, writeFile, readFile, createWriteStream } from 'fs-extra'; import { join } from 'path'; import tempy from 'tempy'; +import { rendererPackages } from '@storybook/core-common'; +import type { JsPackageManager } from './js-package-manager'; export function parseList(str: string): string[] { return str @@ -10,6 +12,19 @@ export function parseList(str: string): string[] { .filter((item) => item.length > 0); } +export async function getStorybookVersion(packageManager: JsPackageManager) { + const packages = ( + await Promise.all( + Object.keys(rendererPackages).map(async (pkg) => ({ + name: pkg, + version: await packageManager.getPackageVersion(pkg), + })) + ) + ).filter(({ version }) => !!version); + + return packages[0]?.version; +} + export function getEnvConfig(program: Record, configEnv: Record): void { Object.keys(configEnv).forEach((fieldName) => { const envVarName = configEnv[fieldName]; diff --git a/code/lib/cli/src/versions.ts b/code/lib/cli/src/versions.ts index 1f31146db191..d104b9c5da8a 100644 --- a/code/lib/cli/src/versions.ts +++ b/code/lib/cli/src/versions.ts @@ -1,96 +1,96 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '7.1.0-alpha.35', - '@storybook/addon-actions': '7.1.0-alpha.35', - '@storybook/addon-backgrounds': '7.1.0-alpha.35', - '@storybook/addon-controls': '7.1.0-alpha.35', - '@storybook/addon-docs': '7.1.0-alpha.35', - '@storybook/addon-essentials': '7.1.0-alpha.35', - '@storybook/addon-highlight': '7.1.0-alpha.35', - '@storybook/addon-interactions': '7.1.0-alpha.35', - '@storybook/addon-jest': '7.1.0-alpha.35', - '@storybook/addon-links': '7.1.0-alpha.35', - '@storybook/addon-mdx-gfm': '7.1.0-alpha.35', - '@storybook/addon-measure': '7.1.0-alpha.35', - '@storybook/addon-outline': '7.1.0-alpha.35', - '@storybook/addon-storyshots': '7.1.0-alpha.35', - '@storybook/addon-storyshots-puppeteer': '7.1.0-alpha.35', - '@storybook/addon-storysource': '7.1.0-alpha.35', - '@storybook/addon-toolbars': '7.1.0-alpha.35', - '@storybook/addon-viewport': '7.1.0-alpha.35', - '@storybook/addons': '7.1.0-alpha.35', - '@storybook/angular': '7.1.0-alpha.35', - '@storybook/api': '7.1.0-alpha.35', - '@storybook/blocks': '7.1.0-alpha.35', - '@storybook/builder-manager': '7.1.0-alpha.35', - '@storybook/builder-vite': '7.1.0-alpha.35', - '@storybook/builder-webpack5': '7.1.0-alpha.35', - '@storybook/channel-postmessage': '7.1.0-alpha.35', - '@storybook/channel-websocket': '7.1.0-alpha.35', - '@storybook/channels': '7.1.0-alpha.35', - '@storybook/cli': '7.1.0-alpha.35', - '@storybook/client-api': '7.1.0-alpha.35', - '@storybook/client-logger': '7.1.0-alpha.35', - '@storybook/codemod': '7.1.0-alpha.35', - '@storybook/components': '7.1.0-alpha.35', - '@storybook/core-client': '7.1.0-alpha.35', - '@storybook/core-common': '7.1.0-alpha.35', - '@storybook/core-events': '7.1.0-alpha.35', - '@storybook/core-server': '7.1.0-alpha.35', - '@storybook/core-webpack': '7.1.0-alpha.35', - '@storybook/csf-plugin': '7.1.0-alpha.35', - '@storybook/csf-tools': '7.1.0-alpha.35', - '@storybook/docs-tools': '7.1.0-alpha.35', - '@storybook/ember': '7.1.0-alpha.35', - '@storybook/html': '7.1.0-alpha.35', - '@storybook/html-vite': '7.1.0-alpha.35', - '@storybook/html-webpack5': '7.1.0-alpha.35', - '@storybook/instrumenter': '7.1.0-alpha.35', - '@storybook/manager': '7.1.0-alpha.35', - '@storybook/manager-api': '7.1.0-alpha.35', - '@storybook/nextjs': '7.1.0-alpha.35', - '@storybook/node-logger': '7.1.0-alpha.35', - '@storybook/postinstall': '7.1.0-alpha.35', - '@storybook/preact': '7.1.0-alpha.35', - '@storybook/preact-vite': '7.1.0-alpha.35', - '@storybook/preact-webpack5': '7.1.0-alpha.35', - '@storybook/preset-create-react-app': '7.1.0-alpha.35', - '@storybook/preset-html-webpack': '7.1.0-alpha.35', - '@storybook/preset-preact-webpack': '7.1.0-alpha.35', - '@storybook/preset-react-webpack': '7.1.0-alpha.35', - '@storybook/preset-server-webpack': '7.1.0-alpha.35', - '@storybook/preset-svelte-webpack': '7.1.0-alpha.35', - '@storybook/preset-vue-webpack': '7.1.0-alpha.35', - '@storybook/preset-vue3-webpack': '7.1.0-alpha.35', - '@storybook/preset-web-components-webpack': '7.1.0-alpha.35', - '@storybook/preview': '7.1.0-alpha.35', - '@storybook/preview-api': '7.1.0-alpha.35', - '@storybook/preview-web': '7.1.0-alpha.35', - '@storybook/react': '7.1.0-alpha.35', - '@storybook/react-dom-shim': '7.1.0-alpha.35', - '@storybook/react-vite': '7.1.0-alpha.35', - '@storybook/react-webpack5': '7.1.0-alpha.35', - '@storybook/router': '7.1.0-alpha.35', - '@storybook/server': '7.1.0-alpha.35', - '@storybook/server-webpack5': '7.1.0-alpha.35', - '@storybook/source-loader': '7.1.0-alpha.35', - '@storybook/store': '7.1.0-alpha.35', - '@storybook/svelte': '7.1.0-alpha.35', - '@storybook/svelte-vite': '7.1.0-alpha.35', - '@storybook/svelte-webpack5': '7.1.0-alpha.35', - '@storybook/sveltekit': '7.1.0-alpha.35', - '@storybook/telemetry': '7.1.0-alpha.35', - '@storybook/theming': '7.1.0-alpha.35', - '@storybook/types': '7.1.0-alpha.35', - '@storybook/vue': '7.1.0-alpha.35', - '@storybook/vue-vite': '7.1.0-alpha.35', - '@storybook/vue-webpack5': '7.1.0-alpha.35', - '@storybook/vue3': '7.1.0-alpha.35', - '@storybook/vue3-vite': '7.1.0-alpha.35', - '@storybook/vue3-webpack5': '7.1.0-alpha.35', - '@storybook/web-components': '7.1.0-alpha.35', - '@storybook/web-components-vite': '7.1.0-alpha.35', - '@storybook/web-components-webpack5': '7.1.0-alpha.35', - sb: '7.1.0-alpha.35', - storybook: '7.1.0-alpha.35', + '@storybook/addon-a11y': '7.1.0-alpha.36', + '@storybook/addon-actions': '7.1.0-alpha.36', + '@storybook/addon-backgrounds': '7.1.0-alpha.36', + '@storybook/addon-controls': '7.1.0-alpha.36', + '@storybook/addon-docs': '7.1.0-alpha.36', + '@storybook/addon-essentials': '7.1.0-alpha.36', + '@storybook/addon-highlight': '7.1.0-alpha.36', + '@storybook/addon-interactions': '7.1.0-alpha.36', + '@storybook/addon-jest': '7.1.0-alpha.36', + '@storybook/addon-links': '7.1.0-alpha.36', + '@storybook/addon-mdx-gfm': '7.1.0-alpha.36', + '@storybook/addon-measure': '7.1.0-alpha.36', + '@storybook/addon-outline': '7.1.0-alpha.36', + '@storybook/addon-storyshots': '7.1.0-alpha.36', + '@storybook/addon-storyshots-puppeteer': '7.1.0-alpha.36', + '@storybook/addon-storysource': '7.1.0-alpha.36', + '@storybook/addon-toolbars': '7.1.0-alpha.36', + '@storybook/addon-viewport': '7.1.0-alpha.36', + '@storybook/addons': '7.1.0-alpha.36', + '@storybook/angular': '7.1.0-alpha.36', + '@storybook/api': '7.1.0-alpha.36', + '@storybook/blocks': '7.1.0-alpha.36', + '@storybook/builder-manager': '7.1.0-alpha.36', + '@storybook/builder-vite': '7.1.0-alpha.36', + '@storybook/builder-webpack5': '7.1.0-alpha.36', + '@storybook/channel-postmessage': '7.1.0-alpha.36', + '@storybook/channel-websocket': '7.1.0-alpha.36', + '@storybook/channels': '7.1.0-alpha.36', + '@storybook/cli': '7.1.0-alpha.36', + '@storybook/client-api': '7.1.0-alpha.36', + '@storybook/client-logger': '7.1.0-alpha.36', + '@storybook/codemod': '7.1.0-alpha.36', + '@storybook/components': '7.1.0-alpha.36', + '@storybook/core-client': '7.1.0-alpha.36', + '@storybook/core-common': '7.1.0-alpha.36', + '@storybook/core-events': '7.1.0-alpha.36', + '@storybook/core-server': '7.1.0-alpha.36', + '@storybook/core-webpack': '7.1.0-alpha.36', + '@storybook/csf-plugin': '7.1.0-alpha.36', + '@storybook/csf-tools': '7.1.0-alpha.36', + '@storybook/docs-tools': '7.1.0-alpha.36', + '@storybook/ember': '7.1.0-alpha.36', + '@storybook/html': '7.1.0-alpha.36', + '@storybook/html-vite': '7.1.0-alpha.36', + '@storybook/html-webpack5': '7.1.0-alpha.36', + '@storybook/instrumenter': '7.1.0-alpha.36', + '@storybook/manager': '7.1.0-alpha.36', + '@storybook/manager-api': '7.1.0-alpha.36', + '@storybook/nextjs': '7.1.0-alpha.36', + '@storybook/node-logger': '7.1.0-alpha.36', + '@storybook/postinstall': '7.1.0-alpha.36', + '@storybook/preact': '7.1.0-alpha.36', + '@storybook/preact-vite': '7.1.0-alpha.36', + '@storybook/preact-webpack5': '7.1.0-alpha.36', + '@storybook/preset-create-react-app': '7.1.0-alpha.36', + '@storybook/preset-html-webpack': '7.1.0-alpha.36', + '@storybook/preset-preact-webpack': '7.1.0-alpha.36', + '@storybook/preset-react-webpack': '7.1.0-alpha.36', + '@storybook/preset-server-webpack': '7.1.0-alpha.36', + '@storybook/preset-svelte-webpack': '7.1.0-alpha.36', + '@storybook/preset-vue-webpack': '7.1.0-alpha.36', + '@storybook/preset-vue3-webpack': '7.1.0-alpha.36', + '@storybook/preset-web-components-webpack': '7.1.0-alpha.36', + '@storybook/preview': '7.1.0-alpha.36', + '@storybook/preview-api': '7.1.0-alpha.36', + '@storybook/preview-web': '7.1.0-alpha.36', + '@storybook/react': '7.1.0-alpha.36', + '@storybook/react-dom-shim': '7.1.0-alpha.36', + '@storybook/react-vite': '7.1.0-alpha.36', + '@storybook/react-webpack5': '7.1.0-alpha.36', + '@storybook/router': '7.1.0-alpha.36', + '@storybook/server': '7.1.0-alpha.36', + '@storybook/server-webpack5': '7.1.0-alpha.36', + '@storybook/source-loader': '7.1.0-alpha.36', + '@storybook/store': '7.1.0-alpha.36', + '@storybook/svelte': '7.1.0-alpha.36', + '@storybook/svelte-vite': '7.1.0-alpha.36', + '@storybook/svelte-webpack5': '7.1.0-alpha.36', + '@storybook/sveltekit': '7.1.0-alpha.36', + '@storybook/telemetry': '7.1.0-alpha.36', + '@storybook/theming': '7.1.0-alpha.36', + '@storybook/types': '7.1.0-alpha.36', + '@storybook/vue': '7.1.0-alpha.36', + '@storybook/vue-vite': '7.1.0-alpha.36', + '@storybook/vue-webpack5': '7.1.0-alpha.36', + '@storybook/vue3': '7.1.0-alpha.36', + '@storybook/vue3-vite': '7.1.0-alpha.36', + '@storybook/vue3-webpack5': '7.1.0-alpha.36', + '@storybook/web-components': '7.1.0-alpha.36', + '@storybook/web-components-vite': '7.1.0-alpha.36', + '@storybook/web-components-webpack5': '7.1.0-alpha.36', + sb: '7.1.0-alpha.36', + storybook: '7.1.0-alpha.36', }; diff --git a/code/lib/client-logger/package.json b/code/lib/client-logger/package.json index f667285c6ce2..f4e7b6b0ee48 100644 --- a/code/lib/client-logger/package.json +++ b/code/lib/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index ea5cc0aeebbc..725f238d0e26 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" @@ -49,9 +49,9 @@ "@babel/preset-env": "^7.22.0", "@babel/types": "^7.22.0", "@storybook/csf": "^0.1.0", - "@storybook/csf-tools": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/csf-tools": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/cross-spawn": "^6.0.2", "cross-spawn": "^7.0.3", "globby": "^11.0.2", diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index ca1a801195e0..9ccc062671d2 100644 --- a/code/lib/core-common/package.json +++ b/code/lib/core-common/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-common", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -43,8 +43,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/find-cache-dir": "^3.2.1", "@types/node": "^16.0.0", "@types/node-fetch": "^2.6.4", diff --git a/code/lib/core-common/src/utils/get-storybook-info.ts b/code/lib/core-common/src/utils/get-storybook-info.ts index e19ccdda9b21..bcdb4eee3970 100644 --- a/code/lib/core-common/src/utils/get-storybook-info.ts +++ b/code/lib/core-common/src/utils/get-storybook-info.ts @@ -45,22 +45,24 @@ export const frameworkPackages: Record = { 'storybook-solidjs-vite': 'solid', }; +export const builderPackages = ['@storybook/builder-webpack5', '@storybook/builder-vite']; + const logger = console; const findDependency = ( { dependencies, devDependencies, peerDependencies }: PackageJson, predicate: (entry: [string, string | undefined]) => string -) => [ - Object.entries(dependencies || {}).find(predicate), - Object.entries(devDependencies || {}).find(predicate), - Object.entries(peerDependencies || {}).find(predicate), -]; +) => + [ + Object.entries(dependencies || {}).find(predicate), + Object.entries(devDependencies || {}).find(predicate), + Object.entries(peerDependencies || {}).find(predicate), + ] as const; const getRendererInfo = (packageJson: PackageJson) => { // Pull the viewlayer from dependencies in package.json const [dep, devDep, peerDep] = findDependency(packageJson, ([key]) => rendererPackages[key]); const [pkg, version] = dep || devDep || peerDep || []; - const renderer = pkg ? rendererPackages[pkg] : undefined; if (dep && devDep && dep[0] === devDep[0]) { logger.warn( @@ -75,10 +77,7 @@ const getRendererInfo = (packageJson: PackageJson) => { return { version, - framework: renderer, frameworkPackage: pkg, - renderer, - rendererPackage: pkg, }; }; diff --git a/code/lib/core-events/package.json b/code/lib/core-events/package.json index 47dfa28fbd1c..1c83b1002fe4 100644 --- a/code/lib/core-events/package.json +++ b/code/lib/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Event names used in storybook core", "keywords": [ "storybook" diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index 58a01ebd9f4f..f77d81f4f8d3 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-server", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -56,25 +56,24 @@ "dependencies": { "@aw-web-design/x-default-browser": "1.4.126", "@discoveryjs/json-ext": "^0.5.3", - "@storybook/builder-manager": "7.1.0-alpha.35", - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/builder-manager": "7.1.0-alpha.36", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/csf": "^0.1.0", - "@storybook/csf-tools": "7.1.0-alpha.35", + "@storybook/csf-tools": "7.1.0-alpha.36", "@storybook/docs-mdx": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/manager": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/telemetry": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/telemetry": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/detect-port": "^1.3.0", "@types/node": "^16.0.0", "@types/pretty-hrtime": "^1.0.0", "@types/semver": "^7.3.4", "better-opn": "^3.0.2", - "boxen": "^5.1.2", "chalk": "^4.1.0", "cli-table3": "^0.6.1", "compression": "^1.7.4", @@ -104,6 +103,7 @@ "@types/node-fetch": "^2.5.7", "@types/serve-favicon": "^2.5.2", "@types/ws": "^8", + "boxen": "^5.1.2", "jest-os-detection": "^1.3.1", "jest-specific-snapshot": "^8.0.0", "node-fetch": "^3.3.1", diff --git a/code/lib/core-server/src/utils/summarizeIndex.test.ts b/code/lib/core-server/src/utils/summarizeIndex.test.ts index 71fb515a005f..8662b0e45716 100644 --- a/code/lib/core-server/src/utils/summarizeIndex.test.ts +++ b/code/lib/core-server/src/utils/summarizeIndex.test.ts @@ -139,6 +139,66 @@ describe('summarizeIndex', () => { "exampleDocsCount": 3, "exampleStoryCount": 8, "mdxCount": 0, + "onboardingDocsCount": 0, + "onboardingStoryCount": 0, + "pageStoryCount": 0, + "playStoryCount": 0, + "storiesMdxCount": 0, + "storyCount": 0, + "version": 4, + } + `); + }); + it('onboarding stories', () => { + expect( + summarizeIndex({ + v: 4, + entries: { + 'example-introduction--docs': { + id: 'example-introduction--docs', + title: 'Example/Introduction', + name: 'Docs', + importPath: './src/stories/Introduction.mdx', + storiesImports: [], + type: 'docs', + tags: ['docs'], + }, + 'example-button--docs': { + id: 'example-button--docs', + title: 'Example/Button', + name: 'Docs', + importPath: './src/stories/Button.stories.ts', + type: 'docs', + tags: ['autodocs', 'docs'], + storiesImports: [], + }, + 'example-button--primary': { + id: 'example-button--primary', + title: 'Example/Button', + name: 'Primary', + importPath: './src/stories/Button.stories.ts', + tags: ['autodocs', 'story'], + type: 'story', + }, + 'example-button--warning': { + id: 'example-button--warning', + title: 'Example/Button', + name: 'Warning', + importPath: './src/stories/Button.stories.ts', + tags: ['autodocs', 'story'], + type: 'story', + }, + }, + }) + ).toMatchInlineSnapshot(` + Object { + "autodocsCount": 0, + "componentCount": 0, + "exampleDocsCount": 2, + "exampleStoryCount": 1, + "mdxCount": 0, + "onboardingDocsCount": 0, + "onboardingStoryCount": 1, "pageStoryCount": 0, "playStoryCount": 0, "storiesMdxCount": 0, @@ -193,6 +253,8 @@ describe('summarizeIndex', () => { "exampleDocsCount": 0, "exampleStoryCount": 0, "mdxCount": 0, + "onboardingDocsCount": 0, + "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, "storiesMdxCount": 0, @@ -248,6 +310,8 @@ describe('summarizeIndex', () => { "exampleDocsCount": 0, "exampleStoryCount": 2, "mdxCount": 0, + "onboardingDocsCount": 0, + "onboardingStoryCount": 0, "pageStoryCount": 1, "playStoryCount": 1, "storiesMdxCount": 0, @@ -303,6 +367,8 @@ describe('summarizeIndex', () => { "exampleDocsCount": 0, "exampleStoryCount": 0, "mdxCount": 0, + "onboardingDocsCount": 0, + "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, "storiesMdxCount": 1, @@ -359,6 +425,8 @@ describe('summarizeIndex', () => { "exampleDocsCount": 1, "exampleStoryCount": 2, "mdxCount": 0, + "onboardingDocsCount": 0, + "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, "storiesMdxCount": 0, @@ -408,6 +476,8 @@ describe('summarizeIndex', () => { "exampleDocsCount": 1, "exampleStoryCount": 0, "mdxCount": 2, + "onboardingDocsCount": 0, + "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, "storiesMdxCount": 0, diff --git a/code/lib/core-server/src/utils/summarizeIndex.ts b/code/lib/core-server/src/utils/summarizeIndex.ts index 601455bcfcba..091038cdaccf 100644 --- a/code/lib/core-server/src/utils/summarizeIndex.ts +++ b/code/lib/core-server/src/utils/summarizeIndex.ts @@ -7,11 +7,12 @@ const PAGE_REGEX = /(page|screen)/i; export const isPageStory = (storyId: string) => PAGE_REGEX.test(storyId); /** - * Filter out example stories that are generated by the CLI + * Is this story generated by the CLI */ -const isExampleEntry = (entry: IndexEntry) => { - return [ +const isCLIExampleEntry = (entry: IndexEntry) => + [ 'example-introduction--docs', + 'configure-your-project--docs', 'example-button--docs', 'example-button--primary', 'example-button--secondary', @@ -23,12 +24,22 @@ const isExampleEntry = (entry: IndexEntry) => { 'example-page--logged-in', 'example-page--logged-out', ].includes(entry.id); -}; + +/** + * Is this story part of the CLI generated examples, + * including user-created stories in those files + */ +const isAnyExampleEntry = (entry: IndexEntry) => + entry.id.startsWith('example-button--') || + entry.id.startsWith('example-header--') || + entry.id.startsWith('example-page--'); export function summarizeIndex(storyIndex: StoryIndex) { let storyCount = 0; const componentTitles = new Set(); let exampleStoryCount = 0; + let onboardingStoryCount = 0; + let onboardingDocsCount = 0; let exampleDocsCount = 0; let pageStoryCount = 0; let playStoryCount = 0; @@ -36,9 +47,12 @@ export function summarizeIndex(storyIndex: StoryIndex) { let storiesMdxCount = 0; let mdxCount = 0; Object.values(storyIndex.entries).forEach((entry) => { - if (isExampleEntry(entry)) { + if (isCLIExampleEntry(entry)) { if (entry.type === 'story') exampleStoryCount += 1; if (entry.type === 'docs') exampleDocsCount += 1; + } else if (isAnyExampleEntry(entry)) { + if (entry.type === 'story') onboardingStoryCount += 1; + if (entry.type === 'docs') onboardingDocsCount += 1; } else if (entry.type === 'story') { storyCount += 1; componentTitles.add(entry.title); @@ -69,6 +83,8 @@ export function summarizeIndex(storyIndex: StoryIndex) { mdxCount, exampleStoryCount, exampleDocsCount, + onboardingStoryCount, + onboardingDocsCount, version: storyIndex.v, }; } diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index cad7c4fd13f3..5d0f6553d7f0 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-webpack", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -43,9 +43,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/node": "^16.0.0", "ts-dedent": "^2.0.0" }, diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index abad4542f728..0194e440ad69 100644 --- a/code/lib/csf-plugin/package.json +++ b/code/lib/csf-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-plugin", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Enrich CSF files via static analysis", "keywords": [ "storybook" @@ -43,7 +43,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/csf-tools": "7.1.0-alpha.35", + "@storybook/csf-tools": "7.1.0-alpha.36", "unplugin": "^1.3.1" }, "devDependencies": { diff --git a/code/lib/csf-tools/package.json b/code/lib/csf-tools/package.json index 2536ba9b611c..79057093c7e6 100644 --- a/code/lib/csf-tools/package.json +++ b/code/lib/csf-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-tools", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Parse and manipulate CSF and Storybook config files", "keywords": [ "storybook" @@ -46,7 +46,7 @@ "@babel/traverse": "^7.22.0", "@babel/types": "^7.22.0", "@storybook/csf": "^0.1.0", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/types": "7.1.0-alpha.36", "fs-extra": "^11.1.0", "recast": "^0.23.1", "ts-dedent": "^2.0.0" diff --git a/code/lib/docs-tools/package.json b/code/lib/docs-tools/package.json index 74676cc225c0..a731b8c9b5c8 100644 --- a/code/lib/docs-tools/package.json +++ b/code/lib/docs-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/docs-tools", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Shared utility functions for frameworks to implement docs", "keywords": [ "storybook" @@ -43,9 +43,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-common": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/core-common": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/doctrine": "^0.0.3", "doctrine": "^3.0.0", "lodash": "^4.17.21" diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 1ad0931e0e97..0f24bbe3fd41 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" @@ -43,11 +43,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35" + "@storybook/preview-api": "7.1.0-alpha.36" }, "devDependencies": { "typescript": "~4.9.3" diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index aab026b789db..aaedc89c99c3 100644 --- a/code/lib/manager-api/package.json +++ b/code/lib/manager-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager-api", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Core Storybook Manager API & Context", "keywords": [ "storybook" @@ -42,14 +42,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/csf": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/router": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/router": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "dequal": "^2.0.2", "lodash": "^4.17.21", "memoizerific": "^1.11.3", diff --git a/code/lib/manager-api/src/version.ts b/code/lib/manager-api/src/version.ts index f0ef0205a7b0..061383e26693 100644 --- a/code/lib/manager-api/src/version.ts +++ b/code/lib/manager-api/src/version.ts @@ -1 +1 @@ -export const version = '7.1.0-alpha.35'; +export const version = '7.1.0-alpha.36'; diff --git a/code/lib/node-logger/package.json b/code/lib/node-logger/package.json index 08c88437a24d..37adf9313214 100644 --- a/code/lib/node-logger/package.json +++ b/code/lib/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" diff --git a/code/lib/postinstall/package.json b/code/lib/postinstall/package.json index 7eb031ffcfcb..a22d374ad564 100644 --- a/code/lib/postinstall/package.json +++ b/code/lib/postinstall/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/postinstall", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook addons postinstall utilities", "keywords": [ "api", diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index 89227bfca501..aa4dff52b90c 100644 --- a/code/lib/preview-api/package.json +++ b/code/lib/preview-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-api", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" @@ -67,13 +67,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channel-postmessage": "7.1.0-alpha.35", - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/channel-postmessage": "7.1.0-alpha.36", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/csf": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/types": "7.1.0-alpha.36", "@types/qs": "^6.9.5", "dequal": "^2.0.2", "lodash": "^4.17.21", @@ -85,7 +85,7 @@ }, "devDependencies": { "@jest/globals": "^29.5.0", - "@storybook/core-common": "7.1.0-alpha.35", + "@storybook/core-common": "7.1.0-alpha.36", "ansi-to-html": "^0.6.11", "react": "^16.14.0", "slash": "^5.0.0" diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index 8245a76ee481..49ff9c09fedd 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" @@ -55,10 +55,10 @@ "prep": "../../../scripts/prepare/esm-bundle.ts" }, "devDependencies": { - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", "typescript": "~4.9.3" }, "publishConfig": { diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json index 46915f1269fd..c11b2112773f 100644 --- a/code/lib/react-dom-shim/package.json +++ b/code/lib/react-dom-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-dom-shim", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "", "keywords": [ "storybook" @@ -53,7 +53,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "devDependencies": { - "@storybook/types": "7.1.0-alpha.35", + "@storybook/types": "7.1.0-alpha.36", "typescript": "~4.9.3" }, "peerDependencies": { diff --git a/code/lib/router/package.json b/code/lib/router/package.json index cbc24f7d296c..c715694cb5c6 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Core Storybook Router", "keywords": [ "storybook" @@ -48,7 +48,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", "memoizerific": "^1.11.3", "qs": "^6.10.0" }, diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 9c85702be0c7..a9f2cc6b2ffe 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Source loader", "keywords": [ "lib", @@ -45,7 +45,7 @@ }, "dependencies": { "@storybook/csf": "^0.1.0", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/types": "7.1.0-alpha.36", "estraverse": "^5.2.0", "lodash": "^4.17.21", "prettier": "^2.8.0" diff --git a/code/lib/telemetry/package.json b/code/lib/telemetry/package.json index 890571422ed6..5608e73a5b1e 100644 --- a/code/lib/telemetry/package.json +++ b/code/lib/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" @@ -43,8 +43,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-common": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-common": "7.1.0-alpha.36", "chalk": "^4.1.0", "detect-package-manager": "^2.0.1", "fetch-retry": "^5.0.2", diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index 18893c2e39a4..9e7c025db129 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Core Storybook Components", "keywords": [ "storybook" @@ -49,7 +49,7 @@ }, "dependencies": { "@emotion/use-insertion-effect-with-fallbacks": "^1.0.0", - "@storybook/client-logger": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", "memoizerific": "^1.11.3" }, diff --git a/code/lib/types/package.json b/code/lib/types/package.json index a4a2d92d780e..55d903554221 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Core Storybook TS Types", "keywords": [ "storybook" @@ -43,7 +43,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0-alpha.35", + "@storybook/channels": "7.1.0-alpha.36", "@types/babel__core": "^7.0.0", "@types/express": "^4.7.0", "file-system-cache": "^2.0.0" diff --git a/code/package.json b/code/package.json index 474c9be781fc..6dfd66866ed3 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index d12fbd5af949..aaf5d0bdca41 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-create-react-app", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Create React App preset", "keywords": [ "storybook" @@ -50,14 +50,14 @@ "dependencies": { "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1", "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/types": "7.1.0-alpha.36", "@types/babel__core": "^7.1.7", "babel-plugin-react-docgen": "^4.1.0", "pnp-webpack-plugin": "^1.7.0", "semver": "^7.3.5" }, "devDependencies": { - "@storybook/node-logger": "7.1.0-alpha.35", + "@storybook/node-logger": "7.1.0-alpha.36", "@types/node": "^16.0.0", "typescript": "~4.9.3" }, diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index b26569c13e2d..4e9717fe96dd 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-html-webpack", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,7 +48,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-webpack": "7.1.0-alpha.35", + "@storybook/core-webpack": "7.1.0-alpha.36", "@types/node": "^16.0.0", "html-loader": "^3.1.0", "webpack": "5" diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index 8feb9b67715e..dd00f7b6c836 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-preact-webpack", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" @@ -50,7 +50,7 @@ "dependencies": { "@babel/plugin-transform-react-jsx": "^7.21.0", "@babel/preset-typescript": "^7.21.0", - "@storybook/core-webpack": "7.1.0-alpha.35", + "@storybook/core-webpack": "7.1.0-alpha.36", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index 7260af37ffdf..ef1a4bdafa82 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-react-webpack", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading", "keywords": [ "storybook" @@ -66,10 +66,10 @@ "@babel/preset-flow": "^7.21.0", "@babel/preset-react": "^7.22.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", - "@storybook/core-webpack": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", - "@storybook/react": "7.1.0-alpha.35", + "@storybook/core-webpack": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", + "@storybook/react": "7.1.0-alpha.36", "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0", "@types/node": "^16.0.0", "@types/semver": "^7.3.4", diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 69201e4d9102..29f4c0e2bff8 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-server-webpack", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -53,10 +53,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-server": "7.1.0-alpha.35", - "@storybook/core-webpack": "7.1.0-alpha.35", + "@storybook/core-server": "7.1.0-alpha.36", + "@storybook/core-webpack": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/server": "7.1.0-alpha.35", + "@storybook/server": "7.1.0-alpha.36", "@types/node": "^16.0.0", "safe-identifier": "^0.4.1", "ts-dedent": "^2.0.0", diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index 7de8e6ff5aa0..a58d7ba6ffca 100644 --- a/code/presets/svelte-webpack/package.json +++ b/code/presets/svelte-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-svelte-webpack", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -63,8 +63,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-webpack": "7.1.0-alpha.35", - "@storybook/node-logger": "7.1.0-alpha.35", + "@storybook/core-webpack": "7.1.0-alpha.36", + "@storybook/node-logger": "7.1.0-alpha.36", "sveltedoc-parser": "^4.2.1", "ts-dedent": "^2.0.0" }, diff --git a/code/presets/vue-webpack/package.json b/code/presets/vue-webpack/package.json index af0c18f4b7cf..7354b3a58465 100644 --- a/code/presets/vue-webpack/package.json +++ b/code/presets/vue-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue-webpack", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -58,8 +58,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-webpack": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/core-webpack": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", "@types/node": "^16.0.0", "ts-loader": "^9.2.8", "vue-docgen-api": "^4.44.23", diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index ec0d586df3f4..bebee2d69332 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-vue3-webpack", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -58,8 +58,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-webpack": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/core-webpack": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", "@types/node": "^16.0.0", "ts-loader": "^9.2.8", "vue-docgen-api": "^4.46.0", diff --git a/code/presets/web-components-webpack/package.json b/code/presets/web-components-webpack/package.json index acc84f8b5873..97aa697a6a42 100644 --- a/code/presets/web-components-webpack/package.json +++ b/code/presets/web-components-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-web-components-webpack", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", @@ -54,7 +54,7 @@ "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/preset-env": "^7.22.0", - "@storybook/core-webpack": "7.1.0-alpha.35", + "@storybook/core-webpack": "7.1.0-alpha.36", "@types/node": "^16.0.0", "babel-loader": "^7.0.0 || ^8.0.0 || ^9.0.0", "babel-plugin-bundled-import-meta": "^0.3.1" diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index a7478a8b9bbc..db3fad4e54d7 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook HTML renderer", "keywords": [ "storybook" @@ -48,11 +48,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/core-client": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index e0d03b795b76..8e7f50683574 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook Preact renderer", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.1.0-alpha.35", + "@storybook/core-client": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 46661d814ccd..b2b0c9c868bc 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook React renderer", "keywords": [ "storybook" @@ -52,13 +52,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-client": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-client": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/react-dom-shim": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/react-dom-shim": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/escodegen": "^0.0.6", "@types/estree": "^0.0.51", "@types/node": "^16.0.0", diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 8a93c9847843..022a0dd8d7ce 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook Server renderer", "keywords": [ "storybook" @@ -53,12 +53,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.1.0-alpha.35", + "@storybook/core-client": "7.1.0-alpha.36", "@storybook/csf": "^0.1.0", - "@storybook/csf-tools": "7.1.0-alpha.35", + "@storybook/csf-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/fs-extra": "^11.0.1", "fs-extra": "^11.1.0", "ts-dedent": "^2.0.0", diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index c37ebe17b5f8..df7b740488dc 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook Svelte renderer", "keywords": [ "storybook" @@ -52,13 +52,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-client": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-client": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "sveltedoc-parser": "^4.2.1", "type-fest": "^3.11.0" }, diff --git a/code/renderers/vue/package.json b/code/renderers/vue/package.json index 069755b7391c..2cebbe55b58b 100644 --- a/code/renderers/vue/package.json +++ b/code/renderers/vue/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook Vue renderer", "keywords": [ "storybook" @@ -48,12 +48,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-client": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-client": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "ts-dedent": "^2.0.0", "type-fest": "^3.11.0" }, diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index aaaa9730ebe5..36754f16a605 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" @@ -48,11 +48,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/core-client": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "lodash": "^4.17.21", "ts-dedent": "^2.0.0", "type-fest": "^3.11.0", diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index b66e7d2f3452..a62c99d9e905 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook web-components renderer", "keywords": [ "lit", @@ -51,13 +51,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/core-client": "7.1.0-alpha.35", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/core-client": "7.1.0-alpha.36", + "@storybook/docs-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "tiny-invariant": "^1.3.1", "ts-dedent": "^2.0.0" }, diff --git a/code/ui/blocks/package.json b/code/ui/blocks/package.json index 9b25edab865f..6762d5c63903 100644 --- a/code/ui/blocks/package.json +++ b/code/ui/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Storybook Doc Blocks", "keywords": [ "storybook" @@ -43,17 +43,17 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/csf": "^0.1.0", - "@storybook/docs-tools": "7.1.0-alpha.35", + "@storybook/docs-tools": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/preview-api": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/preview-api": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@types/lodash": "^4.14.167", "color-convert": "^2.0.1", "dequal": "^2.0.2", @@ -67,7 +67,7 @@ "util-deprecate": "^1.0.2" }, "devDependencies": { - "@storybook/addon-actions": "7.1.0-alpha.35", + "@storybook/addon-actions": "7.1.0-alpha.36", "@types/color-convert": "^2.0.0" }, "peerDependencies": { diff --git a/code/ui/components/package.json b/code/ui/components/package.json index a587ab2684ab..3c5da754cc23 100644 --- a/code/ui/components/package.json +++ b/code/ui/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Core Storybook Components", "keywords": [ "storybook" @@ -48,11 +48,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0-alpha.35", + "@storybook/client-logger": "7.1.0-alpha.36", "@storybook/csf": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/theming": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/theming": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "memoizerific": "^1.11.3", "use-resize-observer": "^9.1.0", "util-deprecate": "^1.0.2" diff --git a/code/ui/manager/package.json b/code/ui/manager/package.json index 677d517ffae9..fe3bc18e08d8 100644 --- a/code/ui/manager/package.json +++ b/code/ui/manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager", - "version": "7.1.0-alpha.35", + "version": "7.1.0-alpha.36", "description": "Core Storybook UI", "keywords": [ "storybook" @@ -51,18 +51,18 @@ }, "devDependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", - "@storybook/addons": "7.1.0-alpha.35", - "@storybook/api": "7.1.0-alpha.35", - "@storybook/channel-postmessage": "7.1.0-alpha.35", - "@storybook/channels": "7.1.0-alpha.35", - "@storybook/client-logger": "7.1.0-alpha.35", - "@storybook/components": "7.1.0-alpha.35", - "@storybook/core-events": "7.1.0-alpha.35", + "@storybook/addons": "7.1.0-alpha.36", + "@storybook/api": "7.1.0-alpha.36", + "@storybook/channel-postmessage": "7.1.0-alpha.36", + "@storybook/channels": "7.1.0-alpha.36", + "@storybook/client-logger": "7.1.0-alpha.36", + "@storybook/components": "7.1.0-alpha.36", + "@storybook/core-events": "7.1.0-alpha.36", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0-alpha.35", - "@storybook/router": "7.1.0-alpha.35", - "@storybook/theming": "7.1.0-alpha.35", - "@storybook/types": "7.1.0-alpha.35", + "@storybook/manager-api": "7.1.0-alpha.36", + "@storybook/router": "7.1.0-alpha.36", + "@storybook/theming": "7.1.0-alpha.36", + "@storybook/types": "7.1.0-alpha.36", "@testing-library/react": "^11.2.2", "@types/semver": "^7.3.4", "copy-to-clipboard": "^3.3.1", diff --git a/code/yarn.lock b/code/yarn.lock index ed58cb6b7b81..999aecc6286b 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5124,16 +5124,16 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-a11y@workspace:addons/a11y" dependencies: - "@storybook/addon-highlight": 7.1.0-alpha.35 - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/addon-highlight": 7.1.0-alpha.36 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@testing-library/react": ^11.2.2 axe-core: ^4.2.0 lodash: ^4.17.21 @@ -5151,18 +5151,18 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-actions@7.1.0-alpha.35, @storybook/addon-actions@workspace:*, @storybook/addon-actions@workspace:addons/actions": +"@storybook/addon-actions@7.1.0-alpha.36, @storybook/addon-actions@workspace:*, @storybook/addon-actions@workspace:addons/actions": version: 0.0.0-use.local resolution: "@storybook/addon-actions@workspace:addons/actions" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/lodash": ^4.14.167 "@types/uuid": ^9.0.1 dequal: ^2.0.2 @@ -5185,18 +5185,18 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-backgrounds@7.1.0-alpha.35, @storybook/addon-backgrounds@workspace:*, @storybook/addon-backgrounds@workspace:addons/backgrounds": +"@storybook/addon-backgrounds@7.1.0-alpha.36, @storybook/addon-backgrounds@workspace:*, @storybook/addon-backgrounds@workspace:addons/backgrounds": version: 0.0.0-use.local resolution: "@storybook/addon-backgrounds@workspace:addons/backgrounds" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 memoizerific: ^1.11.3 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -5211,19 +5211,19 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-controls@7.1.0-alpha.35, @storybook/addon-controls@workspace:*, @storybook/addon-controls@workspace:addons/controls": +"@storybook/addon-controls@7.1.0-alpha.36, @storybook/addon-controls@workspace:*, @storybook/addon-controls@workspace:addons/controls": version: 0.0.0-use.local resolution: "@storybook/addon-controls@workspace:addons/controls" dependencies: - "@storybook/blocks": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/blocks": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 lodash: ^4.17.21 ts-dedent: ^2.0.0 peerDependencies: @@ -5237,25 +5237,25 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-docs@7.1.0-alpha.35, @storybook/addon-docs@workspace:*, @storybook/addon-docs@workspace:addons/docs": +"@storybook/addon-docs@7.1.0-alpha.36, @storybook/addon-docs@workspace:*, @storybook/addon-docs@workspace:addons/docs": version: 0.0.0-use.local resolution: "@storybook/addon-docs@workspace:addons/docs" dependencies: "@jest/transform": ^29.3.1 "@mdx-js/react": ^2.1.5 - "@storybook/blocks": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/csf-plugin": 7.1.0-alpha.35 - "@storybook/csf-tools": 7.1.0-alpha.35 + "@storybook/blocks": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/csf-plugin": 7.1.0-alpha.36 + "@storybook/csf-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 "@storybook/mdx2-csf": ^1.0.0 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/postinstall": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/react-dom-shim": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/postinstall": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/react-dom-shim": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 fs-extra: ^11.1.0 react: ^16.14.0 react-dom: ^16.8.0 @@ -5273,20 +5273,20 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-essentials@workspace:addons/essentials" dependencies: - "@storybook/addon-actions": 7.1.0-alpha.35 - "@storybook/addon-backgrounds": 7.1.0-alpha.35 - "@storybook/addon-controls": 7.1.0-alpha.35 - "@storybook/addon-docs": 7.1.0-alpha.35 - "@storybook/addon-highlight": 7.1.0-alpha.35 - "@storybook/addon-measure": 7.1.0-alpha.35 - "@storybook/addon-outline": 7.1.0-alpha.35 - "@storybook/addon-toolbars": 7.1.0-alpha.35 - "@storybook/addon-viewport": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/vue": 7.1.0-alpha.35 + "@storybook/addon-actions": 7.1.0-alpha.36 + "@storybook/addon-backgrounds": 7.1.0-alpha.36 + "@storybook/addon-controls": 7.1.0-alpha.36 + "@storybook/addon-docs": 7.1.0-alpha.36 + "@storybook/addon-highlight": 7.1.0-alpha.36 + "@storybook/addon-measure": 7.1.0-alpha.36 + "@storybook/addon-outline": 7.1.0-alpha.36 + "@storybook/addon-toolbars": 7.1.0-alpha.36 + "@storybook/addon-viewport": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/vue": 7.1.0-alpha.36 ts-dedent: ^2.0.0 typescript: ^4.9.3 peerDependencies: @@ -5295,13 +5295,13 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-highlight@7.1.0-alpha.35, @storybook/addon-highlight@workspace:*, @storybook/addon-highlight@workspace:addons/highlight": +"@storybook/addon-highlight@7.1.0-alpha.36, @storybook/addon-highlight@workspace:*, @storybook/addon-highlight@workspace:addons/highlight": version: 0.0.0-use.local resolution: "@storybook/addon-highlight@workspace:addons/highlight" dependencies: - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 "@types/webpack-env": ^1.16.0 typescript: ~4.9.3 languageName: unknown @@ -5312,18 +5312,18 @@ __metadata: resolution: "@storybook/addon-interactions@workspace:addons/interactions" dependencies: "@devtools-ds/object-inspector": ^1.1.2 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/instrumenter": 7.1.0-alpha.35 + "@storybook/instrumenter": 7.1.0-alpha.36 "@storybook/jest": future - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 "@storybook/testing-library": future - "@storybook/theming": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/theming": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/node": ^16.0.0 formik: ^2.2.9 jest-mock: ^29.5.0 @@ -5345,13 +5345,13 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-jest@workspace:addons/jest" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 react-resize-detector: ^7.1.2 tiny-invariant: ^1.3.1 typescript: ~4.9.3 @@ -5371,14 +5371,14 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-links@workspace:addons/links" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/csf": ^0.1.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/router": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/router": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 fs-extra: ^11.1.0 prop-types: ^15.7.2 ts-dedent: ^2.0.0 @@ -5398,24 +5398,24 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-mdx-gfm@workspace:addons/gfm" dependencies: - "@storybook/node-logger": 7.1.0-alpha.35 + "@storybook/node-logger": 7.1.0-alpha.36 remark-gfm: ^3.0.1 ts-dedent: ^2.0.0 typescript: ~4.9.3 languageName: unknown linkType: soft -"@storybook/addon-measure@7.1.0-alpha.35, @storybook/addon-measure@workspace:*, @storybook/addon-measure@workspace:addons/measure": +"@storybook/addon-measure@7.1.0-alpha.36, @storybook/addon-measure@workspace:*, @storybook/addon-measure@workspace:addons/measure": version: 0.0.0-use.local resolution: "@storybook/addon-measure@workspace:addons/measure" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 tiny-invariant: ^1.3.1 typescript: ~4.9.3 peerDependencies: @@ -5429,17 +5429,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-outline@7.1.0-alpha.35, @storybook/addon-outline@workspace:*, @storybook/addon-outline@workspace:addons/outline": +"@storybook/addon-outline@7.1.0-alpha.36, @storybook/addon-outline@workspace:*, @storybook/addon-outline@workspace:addons/outline": version: 0.0.0-use.local resolution: "@storybook/addon-outline@workspace:addons/outline" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 ts-dedent: ^2.0.0 typescript: ~4.9.3 peerDependencies: @@ -5459,8 +5459,8 @@ __metadata: dependencies: "@axe-core/puppeteer": ^4.2.0 "@storybook/csf": ^0.1.0 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/jest-image-snapshot": ^6.0.0 "@types/puppeteer": ^5.4.0 enzyme: ^3.11.0 @@ -5468,7 +5468,7 @@ __metadata: jest-image-snapshot: ^6.0.0 puppeteer: ^2.0.0 || ^3.0.0 peerDependencies: - "@storybook/addon-storyshots": 7.1.0-alpha.35 + "@storybook/addon-storyshots": 7.1.0-alpha.36 puppeteer: ">=2.0.0" peerDependenciesMeta: puppeteer: @@ -5484,18 +5484,18 @@ __metadata: "@angular/platform-browser-dynamic": ^16.0.0-rc.4 "@emotion/jest": ^11.8.0 "@jest/transform": ^29.3.1 - "@storybook/addon-docs": 7.1.0-alpha.35 - "@storybook/angular": 7.1.0-alpha.35 + "@storybook/addon-docs": 7.1.0-alpha.36 + "@storybook/angular": 7.1.0-alpha.36 "@storybook/babel-plugin-require-context-hook": 1.0.1 - "@storybook/client-api": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/core-webpack": 7.1.0-alpha.35 + "@storybook/client-api": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/core-webpack": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/react": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 - "@storybook/vue": 7.1.0-alpha.35 - "@storybook/vue3": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/react": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 + "@storybook/vue": 7.1.0-alpha.36 + "@storybook/vue3": 7.1.0-alpha.36 "@types/jest-specific-snapshot": ^0.5.6 babel-loader: ^9.1.2 enzyme: ^3.11.0 @@ -5567,13 +5567,13 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-storysource@workspace:addons/storysource" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/router": 7.1.0-alpha.35 - "@storybook/source-loader": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/router": 7.1.0-alpha.36 + "@storybook/source-loader": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 "@types/react": ^16.14.34 "@types/react-syntax-highlighter": 11.0.5 estraverse: ^5.2.0 @@ -5592,15 +5592,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-toolbars@7.1.0-alpha.35, @storybook/addon-toolbars@workspace:*, @storybook/addon-toolbars@workspace:addons/toolbars": +"@storybook/addon-toolbars@7.1.0-alpha.36, @storybook/addon-toolbars@workspace:*, @storybook/addon-toolbars@workspace:addons/toolbars": version: 0.0.0-use.local resolution: "@storybook/addon-toolbars@workspace:addons/toolbars" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 typescript: ~4.9.3 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -5613,17 +5613,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-viewport@7.1.0-alpha.35, @storybook/addon-viewport@workspace:*, @storybook/addon-viewport@workspace:addons/viewport": +"@storybook/addon-viewport@7.1.0-alpha.36, @storybook/addon-viewport@workspace:*, @storybook/addon-viewport@workspace:addons/viewport": version: 0.0.0-use.local resolution: "@storybook/addon-viewport@workspace:addons/viewport" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 memoizerific: ^1.11.3 prop-types: ^15.7.2 typescript: ~4.9.3 @@ -5638,20 +5638,20 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addons@7.1.0-alpha.35, @storybook/addons@workspace:*, @storybook/addons@workspace:deprecated/addons": +"@storybook/addons@7.1.0-alpha.36, @storybook/addons@workspace:*, @storybook/addons@workspace:deprecated/addons": version: 0.0.0-use.local resolution: "@storybook/addons@workspace:deprecated/addons" dependencies: - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft -"@storybook/angular@7.1.0-alpha.35, @storybook/angular@workspace:*, @storybook/angular@workspace:frameworks/angular": +"@storybook/angular@7.1.0-alpha.36, @storybook/angular@workspace:*, @storybook/angular@workspace:frameworks/angular": version: 0.0.0-use.local resolution: "@storybook/angular@workspace:frameworks/angular" dependencies: @@ -5667,20 +5667,20 @@ __metadata: "@angular/forms": ^16.0.0-rc.4 "@angular/platform-browser": ^16.0.0-rc.4 "@angular/platform-browser-dynamic": ^16.0.0-rc.4 - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/cli": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 - "@storybook/core-server": 7.1.0-alpha.35 - "@storybook/core-webpack": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/cli": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 + "@storybook/core-server": 7.1.0-alpha.36 + "@storybook/core-webpack": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/telemetry": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/telemetry": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/cross-spawn": ^6.0.2 "@types/node": ^16.0.0 "@types/react": ^16.14.34 @@ -5727,12 +5727,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/api@7.1.0-alpha.35, @storybook/api@workspace:*, @storybook/api@workspace:deprecated/manager-api-shim": +"@storybook/api@7.1.0-alpha.36, @storybook/api@workspace:*, @storybook/api@workspace:deprecated/manager-api-shim": version: 0.0.0-use.local resolution: "@storybook/api@workspace:deprecated/manager-api-shim" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/manager-api": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/manager-api": 7.1.0-alpha.36 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -5776,22 +5776,22 @@ __metadata: languageName: node linkType: hard -"@storybook/blocks@7.1.0-alpha.35, @storybook/blocks@workspace:*, @storybook/blocks@workspace:ui/blocks": +"@storybook/blocks@7.1.0-alpha.36, @storybook/blocks@workspace:*, @storybook/blocks@workspace:ui/blocks": version: 0.0.0-use.local resolution: "@storybook/blocks@workspace:ui/blocks" dependencies: - "@storybook/addon-actions": 7.1.0-alpha.35 - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/addon-actions": 7.1.0-alpha.36 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/csf": ^0.1.0 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/docs-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/color-convert": ^2.0.0 "@types/lodash": ^4.14.167 color-convert: ^2.0.1 @@ -5810,14 +5810,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/builder-manager@7.1.0-alpha.35, @storybook/builder-manager@workspace:*, @storybook/builder-manager@workspace:builders/builder-manager": +"@storybook/builder-manager@7.1.0-alpha.36, @storybook/builder-manager@workspace:*, @storybook/builder-manager@workspace:builders/builder-manager": version: 0.0.0-use.local resolution: "@storybook/builder-manager@workspace:builders/builder-manager" dependencies: "@fal-works/esbuild-plugin-global-externals": ^2.1.2 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/manager": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/manager": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 "@types/ejs": ^3.1.1 "@types/find-cache-dir": ^3.2.1 "@yarnpkg/esbuild-plugin-pnp": ^3.0.0-rc.10 @@ -5835,19 +5835,19 @@ __metadata: languageName: unknown linkType: soft -"@storybook/builder-vite@7.1.0-alpha.35, @storybook/builder-vite@workspace:*, @storybook/builder-vite@workspace:builders/builder-vite": +"@storybook/builder-vite@7.1.0-alpha.36, @storybook/builder-vite@workspace:*, @storybook/builder-vite@workspace:builders/builder-vite": version: 0.0.0-use.local resolution: "@storybook/builder-vite@workspace:builders/builder-vite" dependencies: - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/csf-plugin": 7.1.0-alpha.35 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/csf-plugin": 7.1.0-alpha.36 "@storybook/mdx2-csf": ^1.0.0 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/preview": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/preview": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/express": ^4.17.13 "@types/find-cache-dir": ^3.2.1 "@types/node": ^16.0.0 @@ -5879,29 +5879,29 @@ __metadata: languageName: unknown linkType: soft -"@storybook/builder-webpack5@7.1.0-alpha.35, @storybook/builder-webpack5@workspace:*, @storybook/builder-webpack5@workspace:builders/builder-webpack5": +"@storybook/builder-webpack5@7.1.0-alpha.36, @storybook/builder-webpack5@workspace:*, @storybook/builder-webpack5@workspace:builders/builder-webpack5": version: 0.0.0-use.local resolution: "@storybook/builder-webpack5@workspace:builders/builder-webpack5" dependencies: "@babel/core": ^7.22.0 - "@storybook/addons": 7.1.0-alpha.35 - "@storybook/api": 7.1.0-alpha.35 - "@storybook/channel-postmessage": 7.1.0-alpha.35 - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-api": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 - "@storybook/core-webpack": 7.1.0-alpha.35 + "@storybook/addons": 7.1.0-alpha.36 + "@storybook/api": 7.1.0-alpha.36 + "@storybook/channel-postmessage": 7.1.0-alpha.36 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-api": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 + "@storybook/core-webpack": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/preview": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/router": 7.1.0-alpha.35 - "@storybook/store": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/preview": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/router": 7.1.0-alpha.36 + "@storybook/store": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 "@swc/core": ^1.3.49 "@types/node": ^16.0.0 "@types/pretty-hrtime": ^1.0.0 @@ -5945,12 +5945,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/channel-postmessage@7.1.0-alpha.35, @storybook/channel-postmessage@workspace:*, @storybook/channel-postmessage@workspace:deprecated/channel-postmessage": +"@storybook/channel-postmessage@7.1.0-alpha.36, @storybook/channel-postmessage@workspace:*, @storybook/channel-postmessage@workspace:deprecated/channel-postmessage": version: 0.0.0-use.local resolution: "@storybook/channel-postmessage@workspace:deprecated/channel-postmessage" dependencies: - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 typescript: ~4.9.3 languageName: unknown linkType: soft @@ -5974,19 +5974,19 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/channel-websocket@workspace:deprecated/channel-websocket" dependencies: - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 typescript: ~4.9.3 languageName: unknown linkType: soft -"@storybook/channels@7.1.0-alpha.35, @storybook/channels@workspace:*, @storybook/channels@workspace:lib/channels": +"@storybook/channels@7.1.0-alpha.36, @storybook/channels@workspace:*, @storybook/channels@workspace:lib/channels": version: 0.0.0-use.local resolution: "@storybook/channels@workspace:lib/channels" dependencies: - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 qs: ^6.10.0 telejson: ^7.0.3 @@ -6002,26 +6002,28 @@ __metadata: languageName: node linkType: hard -"@storybook/cli@7.1.0-alpha.35, @storybook/cli@workspace:*, @storybook/cli@workspace:lib/cli": +"@storybook/cli@7.1.0-alpha.36, @storybook/cli@workspace:*, @storybook/cli@workspace:lib/cli": version: 0.0.0-use.local resolution: "@storybook/cli@workspace:lib/cli" dependencies: "@babel/core": ^7.22.0 "@babel/preset-env": ^7.22.0 "@ndelangen/get-tarball": ^3.0.7 - "@storybook/client-api": 7.1.0-alpha.35 - "@storybook/codemod": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/core-server": 7.1.0-alpha.35 - "@storybook/csf-tools": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/telemetry": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/client-api": 7.1.0-alpha.36 + "@storybook/codemod": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/core-server": 7.1.0-alpha.36 + "@storybook/csf-tools": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/telemetry": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/cross-spawn": ^6.0.2 "@types/prompts": ^2.0.9 "@types/puppeteer-core": ^2.1.0 "@types/semver": ^7.3.4 "@types/util-deprecate": ^1.0.0 + "@yarnpkg/fslib": ^2.10.3 + "@yarnpkg/libzip": ^2.3.0 boxen: ^5.1.2 chalk: ^4.1.0 commander: ^6.2.1 @@ -6057,16 +6059,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/client-api@7.1.0-alpha.35, @storybook/client-api@workspace:*, @storybook/client-api@workspace:deprecated/client-api": +"@storybook/client-api@7.1.0-alpha.36, @storybook/client-api@workspace:*, @storybook/client-api@workspace:deprecated/client-api": version: 0.0.0-use.local resolution: "@storybook/client-api@workspace:deprecated/client-api" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 languageName: unknown linkType: soft -"@storybook/client-logger@7.1.0-alpha.35, @storybook/client-logger@workspace:*, @storybook/client-logger@workspace:lib/client-logger": +"@storybook/client-logger@7.1.0-alpha.36, @storybook/client-logger@workspace:*, @storybook/client-logger@workspace:lib/client-logger": version: 0.0.0-use.local resolution: "@storybook/client-logger@workspace:lib/client-logger" dependencies: @@ -6084,7 +6086,7 @@ __metadata: languageName: node linkType: hard -"@storybook/codemod@7.1.0-alpha.35, @storybook/codemod@workspace:*, @storybook/codemod@workspace:lib/codemod": +"@storybook/codemod@7.1.0-alpha.36, @storybook/codemod@workspace:*, @storybook/codemod@workspace:lib/codemod": version: 0.0.0-use.local resolution: "@storybook/codemod@workspace:lib/codemod" dependencies: @@ -6092,9 +6094,9 @@ __metadata: "@babel/preset-env": ^7.22.0 "@babel/types": ^7.22.0 "@storybook/csf": ^0.1.0 - "@storybook/csf-tools": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/csf-tools": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/cross-spawn": ^6.0.2 "@types/jscodeshift": ^0.11.6 ansi-regex: ^5.0.1 @@ -6120,16 +6122,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/components@7.1.0-alpha.35, @storybook/components@workspace:*, @storybook/components@workspace:ui/components": +"@storybook/components@7.1.0-alpha.36, @storybook/components@workspace:*, @storybook/components@workspace:ui/components": version: 0.0.0-use.local resolution: "@storybook/components@workspace:ui/components" dependencies: "@popperjs/core": ^2.6.0 - "@storybook/client-logger": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 "@storybook/csf": ^0.1.0 "@storybook/global": ^5.0.0 - "@storybook/theming": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/theming": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/react-syntax-highlighter": 11.0.5 "@types/util-deprecate": ^1.0.0 css: ^3.0.0 @@ -6151,21 +6153,21 @@ __metadata: languageName: unknown linkType: soft -"@storybook/core-client@7.1.0-alpha.35, @storybook/core-client@workspace:*, @storybook/core-client@workspace:deprecated/core-client": +"@storybook/core-client@7.1.0-alpha.36, @storybook/core-client@workspace:*, @storybook/core-client@workspace:deprecated/core-client": version: 0.0.0-use.local resolution: "@storybook/core-client@workspace:deprecated/core-client" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 languageName: unknown linkType: soft -"@storybook/core-common@7.1.0-alpha.35, @storybook/core-common@workspace:*, @storybook/core-common@workspace:lib/core-common": +"@storybook/core-common@7.1.0-alpha.36, @storybook/core-common@workspace:*, @storybook/core-common@workspace:lib/core-common": version: 0.0.0-use.local resolution: "@storybook/core-common@workspace:lib/core-common" dependencies: - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/find-cache-dir": ^3.2.1 "@types/mock-fs": ^4.13.1 "@types/node": ^16.0.0 @@ -6195,7 +6197,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/core-events@7.1.0-alpha.35, @storybook/core-events@workspace:*, @storybook/core-events@workspace:lib/core-events": +"@storybook/core-events@7.1.0-alpha.36, @storybook/core-events@workspace:*, @storybook/core-events@workspace:lib/core-events": version: 0.0.0-use.local resolution: "@storybook/core-events@workspace:lib/core-events" dependencies: @@ -6210,25 +6212,25 @@ __metadata: languageName: node linkType: hard -"@storybook/core-server@7.1.0-alpha.35, @storybook/core-server@workspace:*, @storybook/core-server@workspace:lib/core-server": +"@storybook/core-server@7.1.0-alpha.36, @storybook/core-server@workspace:*, @storybook/core-server@workspace:lib/core-server": version: 0.0.0-use.local resolution: "@storybook/core-server@workspace:lib/core-server" dependencies: "@aw-web-design/x-default-browser": 1.4.126 "@discoveryjs/json-ext": ^0.5.3 - "@storybook/builder-manager": 7.1.0-alpha.35 - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/builder-manager": 7.1.0-alpha.36 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/csf": ^0.1.0 - "@storybook/csf-tools": 7.1.0-alpha.35 + "@storybook/csf-tools": 7.1.0-alpha.36 "@storybook/docs-mdx": ^0.1.0 "@storybook/global": ^5.0.0 - "@storybook/manager": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/telemetry": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/telemetry": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/compression": ^1.7.0 "@types/detect-port": ^1.3.0 "@types/ip": ^1.1.0 @@ -6270,13 +6272,13 @@ __metadata: languageName: unknown linkType: soft -"@storybook/core-webpack@7.1.0-alpha.35, @storybook/core-webpack@workspace:*, @storybook/core-webpack@workspace:lib/core-webpack": +"@storybook/core-webpack@7.1.0-alpha.36, @storybook/core-webpack@workspace:*, @storybook/core-webpack@workspace:lib/core-webpack": version: 0.0.0-use.local resolution: "@storybook/core-webpack@workspace:lib/core-webpack" dependencies: - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/node": ^16.0.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -6284,17 +6286,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/csf-plugin@7.1.0-alpha.35, @storybook/csf-plugin@workspace:*, @storybook/csf-plugin@workspace:lib/csf-plugin": +"@storybook/csf-plugin@7.1.0-alpha.36, @storybook/csf-plugin@workspace:*, @storybook/csf-plugin@workspace:lib/csf-plugin": version: 0.0.0-use.local resolution: "@storybook/csf-plugin@workspace:lib/csf-plugin" dependencies: - "@storybook/csf-tools": 7.1.0-alpha.35 + "@storybook/csf-tools": 7.1.0-alpha.36 typescript: ~4.9.3 unplugin: ^1.3.1 languageName: unknown linkType: soft -"@storybook/csf-tools@7.1.0-alpha.35, @storybook/csf-tools@workspace:*, @storybook/csf-tools@workspace:lib/csf-tools": +"@storybook/csf-tools@7.1.0-alpha.36, @storybook/csf-tools@workspace:*, @storybook/csf-tools@workspace:lib/csf-tools": version: 0.0.0-use.local resolution: "@storybook/csf-tools@workspace:lib/csf-tools" dependencies: @@ -6303,7 +6305,7 @@ __metadata: "@babel/traverse": ^7.22.0 "@babel/types": ^7.22.0 "@storybook/csf": ^0.1.0 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/types": 7.1.0-alpha.36 "@types/fs-extra": ^11.0.1 "@types/js-yaml": ^4.0.5 fs-extra: ^11.1.0 @@ -6339,14 +6341,14 @@ __metadata: languageName: node linkType: hard -"@storybook/docs-tools@7.1.0-alpha.35, @storybook/docs-tools@workspace:*, @storybook/docs-tools@workspace:lib/docs-tools": +"@storybook/docs-tools@7.1.0-alpha.36, @storybook/docs-tools@workspace:*, @storybook/docs-tools@workspace:lib/docs-tools": version: 0.0.0-use.local resolution: "@storybook/docs-tools@workspace:lib/docs-tools" dependencies: "@babel/core": ^7.22.0 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/doctrine": ^0.0.3 doctrine: ^3.0.0 jest-specific-snapshot: ^8.0.0 @@ -6360,12 +6362,12 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/ember@workspace:frameworks/ember" dependencies: - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 ember-source: ~3.28.1 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -6409,14 +6411,14 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/html-vite@workspace:frameworks/html-vite" dependencies: - "@storybook/addons": 7.1.0-alpha.35 - "@storybook/builder-vite": 7.1.0-alpha.35 - "@storybook/channel-postmessage": 7.1.0-alpha.35 - "@storybook/client-api": 7.1.0-alpha.35 - "@storybook/core-server": 7.1.0-alpha.35 - "@storybook/html": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/preview-web": 7.1.0-alpha.35 + "@storybook/addons": 7.1.0-alpha.36 + "@storybook/builder-vite": 7.1.0-alpha.36 + "@storybook/channel-postmessage": 7.1.0-alpha.36 + "@storybook/client-api": 7.1.0-alpha.36 + "@storybook/core-server": 7.1.0-alpha.36 + "@storybook/html": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/preview-web": 7.1.0-alpha.36 "@types/node": ^16.0.0 magic-string: ^0.30.0 typescript: ~4.9.3 @@ -6427,11 +6429,11 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/html-webpack5@workspace:frameworks/html-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/html": 7.1.0-alpha.35 - "@storybook/preset-html-webpack": 7.1.0-alpha.35 + "@storybook/html": 7.1.0-alpha.36 + "@storybook/preset-html-webpack": 7.1.0-alpha.36 "@types/node": ^16.0.0 typescript: ~4.9.3 peerDependencies: @@ -6441,15 +6443,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/html@7.1.0-alpha.35, @storybook/html@workspace:*, @storybook/html@workspace:renderers/html": +"@storybook/html@7.1.0-alpha.36, @storybook/html@workspace:*, @storybook/html@workspace:renderers/html": version: 0.0.0-use.local resolution: "@storybook/html@workspace:renderers/html" dependencies: - "@storybook/core-client": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/core-client": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 ts-dedent: ^2.0.0 typescript: ~4.9.3 peerDependencies: @@ -6457,15 +6459,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/instrumenter@7.1.0-alpha.35, @storybook/instrumenter@workspace:*, @storybook/instrumenter@workspace:lib/instrumenter": +"@storybook/instrumenter@7.1.0-alpha.36, @storybook/instrumenter@workspace:*, @storybook/instrumenter@workspace:lib/instrumenter": version: 0.0.0-use.local resolution: "@storybook/instrumenter@workspace:lib/instrumenter" dependencies: - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 typescript: ~4.9.3 languageName: unknown linkType: soft @@ -6522,19 +6524,19 @@ __metadata: languageName: node linkType: hard -"@storybook/manager-api@7.1.0-alpha.35, @storybook/manager-api@workspace:*, @storybook/manager-api@workspace:lib/manager-api": +"@storybook/manager-api@7.1.0-alpha.36, @storybook/manager-api@workspace:*, @storybook/manager-api@workspace:lib/manager-api": version: 0.0.0-use.local resolution: "@storybook/manager-api@workspace:lib/manager-api" dependencies: "@jest/globals": ^29.3.1 - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/csf": ^0.1.0 "@storybook/global": ^5.0.0 - "@storybook/router": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/router": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/lodash": ^4.14.167 "@types/qs": ^6 dequal: ^2.0.2 @@ -6553,23 +6555,23 @@ __metadata: languageName: unknown linkType: soft -"@storybook/manager@7.1.0-alpha.35, @storybook/manager@workspace:*, @storybook/manager@workspace:ui/manager": +"@storybook/manager@7.1.0-alpha.36, @storybook/manager@workspace:*, @storybook/manager@workspace:ui/manager": version: 0.0.0-use.local resolution: "@storybook/manager@workspace:ui/manager" dependencies: "@fal-works/esbuild-plugin-global-externals": ^2.1.2 - "@storybook/addons": 7.1.0-alpha.35 - "@storybook/api": 7.1.0-alpha.35 - "@storybook/channel-postmessage": 7.1.0-alpha.35 - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/components": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/addons": 7.1.0-alpha.36 + "@storybook/api": 7.1.0-alpha.36 + "@storybook/channel-postmessage": 7.1.0-alpha.36 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/components": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/router": 7.1.0-alpha.35 - "@storybook/theming": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/router": 7.1.0-alpha.36 + "@storybook/theming": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@testing-library/react": ^11.2.2 "@types/semver": ^7.3.4 copy-to-clipboard: ^3.3.1 @@ -6619,13 +6621,13 @@ __metadata: "@babel/preset-typescript": ^7.21.0 "@babel/runtime": ^7.22.0 "@babel/types": ^7.22.0 - "@storybook/addon-actions": 7.1.0-alpha.35 - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/preset-react-webpack": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/react": 7.1.0-alpha.35 + "@storybook/addon-actions": 7.1.0-alpha.36 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/preset-react-webpack": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/react": 7.1.0-alpha.36 "@types/babel__core": ^7 "@types/babel__plugin-transform-runtime": ^7 "@types/babel__preset-env": ^7 @@ -6671,7 +6673,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/node-logger@7.1.0-alpha.35, @storybook/node-logger@workspace:*, @storybook/node-logger@workspace:lib/node-logger": +"@storybook/node-logger@7.1.0-alpha.36, @storybook/node-logger@workspace:*, @storybook/node-logger@workspace:lib/node-logger": version: 0.0.0-use.local resolution: "@storybook/node-logger@workspace:lib/node-logger" dependencies: @@ -6684,7 +6686,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/postinstall@7.1.0-alpha.35, @storybook/postinstall@workspace:*, @storybook/postinstall@workspace:lib/postinstall": +"@storybook/postinstall@7.1.0-alpha.36, @storybook/postinstall@workspace:*, @storybook/postinstall@workspace:lib/postinstall": version: 0.0.0-use.local resolution: "@storybook/postinstall@workspace:lib/postinstall" dependencies: @@ -6700,8 +6702,8 @@ __metadata: resolution: "@storybook/preact-vite@workspace:frameworks/preact-vite" dependencies: "@preact/preset-vite": ^2.0.0 - "@storybook/builder-vite": 7.1.0-alpha.35 - "@storybook/preact": 7.1.0-alpha.35 + "@storybook/builder-vite": 7.1.0-alpha.36 + "@storybook/preact": 7.1.0-alpha.36 "@types/node": ^16.0.0 typescript: ~4.9.3 vite: ^4.0.0 @@ -6715,10 +6717,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/preact-webpack5@workspace:frameworks/preact-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/preact": 7.1.0-alpha.35 - "@storybook/preset-preact-webpack": 7.1.0-alpha.35 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/preact": 7.1.0-alpha.36 + "@storybook/preset-preact-webpack": 7.1.0-alpha.36 "@types/node": ^16.0.0 preact: ^10.5.13 typescript: ~4.9.3 @@ -6730,14 +6732,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preact@7.1.0-alpha.35, @storybook/preact@workspace:*, @storybook/preact@workspace:renderers/preact": +"@storybook/preact@7.1.0-alpha.36, @storybook/preact@workspace:*, @storybook/preact@workspace:renderers/preact": version: 0.0.0-use.local resolution: "@storybook/preact@workspace:renderers/preact" dependencies: - "@storybook/core-client": 7.1.0-alpha.35 + "@storybook/core-client": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 preact: ^10.5.13 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -6751,9 +6753,9 @@ __metadata: resolution: "@storybook/preset-create-react-app@workspace:presets/create-react-app" dependencies: "@pmmmwh/react-refresh-webpack-plugin": ^0.5.1 - "@storybook/node-logger": 7.1.0-alpha.35 + "@storybook/node-logger": 7.1.0-alpha.36 "@storybook/react-docgen-typescript-plugin": 1.0.6--canary.9.0c3f3b7.0 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/types": 7.1.0-alpha.36 "@types/babel__core": ^7.1.7 "@types/node": ^16.0.0 babel-plugin-react-docgen: ^4.1.0 @@ -6766,11 +6768,11 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-html-webpack@7.1.0-alpha.35, @storybook/preset-html-webpack@workspace:*, @storybook/preset-html-webpack@workspace:presets/html-webpack": +"@storybook/preset-html-webpack@7.1.0-alpha.36, @storybook/preset-html-webpack@workspace:*, @storybook/preset-html-webpack@workspace:presets/html-webpack": version: 0.0.0-use.local resolution: "@storybook/preset-html-webpack@workspace:presets/html-webpack" dependencies: - "@storybook/core-webpack": 7.1.0-alpha.35 + "@storybook/core-webpack": 7.1.0-alpha.36 "@types/node": ^16.0.0 html-loader: ^3.1.0 typescript: ~4.9.3 @@ -6780,13 +6782,13 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-preact-webpack@7.1.0-alpha.35, @storybook/preset-preact-webpack@workspace:*, @storybook/preset-preact-webpack@workspace:presets/preact-webpack": +"@storybook/preset-preact-webpack@7.1.0-alpha.36, @storybook/preset-preact-webpack@workspace:*, @storybook/preset-preact-webpack@workspace:presets/preact-webpack": version: 0.0.0-use.local resolution: "@storybook/preset-preact-webpack@workspace:presets/preact-webpack" dependencies: "@babel/plugin-transform-react-jsx": ^7.21.0 "@babel/preset-typescript": ^7.21.0 - "@storybook/core-webpack": 7.1.0-alpha.35 + "@storybook/core-webpack": 7.1.0-alpha.36 "@types/node": ^16.0.0 preact: ^10.5.13 typescript: ~4.9.3 @@ -6796,17 +6798,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-react-webpack@7.1.0-alpha.35, @storybook/preset-react-webpack@workspace:*, @storybook/preset-react-webpack@workspace:presets/react-webpack": +"@storybook/preset-react-webpack@7.1.0-alpha.36, @storybook/preset-react-webpack@workspace:*, @storybook/preset-react-webpack@workspace:presets/react-webpack": version: 0.0.0-use.local resolution: "@storybook/preset-react-webpack@workspace:presets/react-webpack" dependencies: "@babel/preset-flow": ^7.21.0 "@babel/preset-react": ^7.22.0 "@pmmmwh/react-refresh-webpack-plugin": ^0.5.5 - "@storybook/core-webpack": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/react": 7.1.0-alpha.35 + "@storybook/core-webpack": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/react": 7.1.0-alpha.36 "@storybook/react-docgen-typescript-plugin": 1.0.6--canary.9.0c3f3b7.0 "@types/node": ^16.0.0 "@types/semver": ^7.3.4 @@ -6829,14 +6831,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-server-webpack@7.1.0-alpha.35, @storybook/preset-server-webpack@workspace:*, @storybook/preset-server-webpack@workspace:presets/server-webpack": +"@storybook/preset-server-webpack@7.1.0-alpha.36, @storybook/preset-server-webpack@workspace:*, @storybook/preset-server-webpack@workspace:presets/server-webpack": version: 0.0.0-use.local resolution: "@storybook/preset-server-webpack@workspace:presets/server-webpack" dependencies: - "@storybook/core-server": 7.1.0-alpha.35 - "@storybook/core-webpack": 7.1.0-alpha.35 + "@storybook/core-server": 7.1.0-alpha.36 + "@storybook/core-webpack": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/server": 7.1.0-alpha.35 + "@storybook/server": 7.1.0-alpha.36 "@types/node": ^16.0.0 fs-extra: ^11.1.0 jest-specific-snapshot: ^8.0.0 @@ -6848,12 +6850,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-svelte-webpack@7.1.0-alpha.35, @storybook/preset-svelte-webpack@workspace:*, @storybook/preset-svelte-webpack@workspace:presets/svelte-webpack": +"@storybook/preset-svelte-webpack@7.1.0-alpha.36, @storybook/preset-svelte-webpack@workspace:*, @storybook/preset-svelte-webpack@workspace:presets/svelte-webpack": version: 0.0.0-use.local resolution: "@storybook/preset-svelte-webpack@workspace:presets/svelte-webpack" dependencies: - "@storybook/core-webpack": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 + "@storybook/core-webpack": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 svelte: ^3.31.2 svelte-loader: ^3.1.2 sveltedoc-parser: ^4.2.1 @@ -6866,12 +6868,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-vue-webpack@7.1.0-alpha.35, @storybook/preset-vue-webpack@workspace:*, @storybook/preset-vue-webpack@workspace:presets/vue-webpack": +"@storybook/preset-vue-webpack@7.1.0-alpha.36, @storybook/preset-vue-webpack@workspace:*, @storybook/preset-vue-webpack@workspace:presets/vue-webpack": version: 0.0.0-use.local resolution: "@storybook/preset-vue-webpack@workspace:presets/vue-webpack" dependencies: - "@storybook/core-webpack": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/core-webpack": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 "@types/node": ^16.0.0 ts-loader: ^9.2.8 typescript: ~4.9.3 @@ -6891,12 +6893,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-vue3-webpack@7.1.0-alpha.35, @storybook/preset-vue3-webpack@workspace:*, @storybook/preset-vue3-webpack@workspace:presets/vue3-webpack": +"@storybook/preset-vue3-webpack@7.1.0-alpha.36, @storybook/preset-vue3-webpack@workspace:*, @storybook/preset-vue3-webpack@workspace:presets/vue3-webpack": version: 0.0.0-use.local resolution: "@storybook/preset-vue3-webpack@workspace:presets/vue3-webpack" dependencies: - "@storybook/core-webpack": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/core-webpack": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 "@types/node": ^16.0.0 "@vue/compiler-sfc": ^3.2.33 ts-loader: ^9.2.8 @@ -6914,14 +6916,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-web-components-webpack@7.1.0-alpha.35, @storybook/preset-web-components-webpack@workspace:*, @storybook/preset-web-components-webpack@workspace:presets/web-components-webpack": +"@storybook/preset-web-components-webpack@7.1.0-alpha.36, @storybook/preset-web-components-webpack@workspace:*, @storybook/preset-web-components-webpack@workspace:presets/web-components-webpack": version: 0.0.0-use.local resolution: "@storybook/preset-web-components-webpack@workspace:presets/web-components-webpack" dependencies: "@babel/plugin-syntax-dynamic-import": ^7.8.3 "@babel/plugin-syntax-import-meta": ^7.10.4 "@babel/preset-env": ^7.22.0 - "@storybook/core-webpack": 7.1.0-alpha.35 + "@storybook/core-webpack": 7.1.0-alpha.36 "@types/node": ^16.0.0 babel-loader: ^7.0.0 || ^8.0.0 || ^9.0.0 babel-plugin-bundled-import-meta: ^0.3.1 @@ -6932,19 +6934,19 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preview-api@7.1.0-alpha.35, @storybook/preview-api@workspace:*, @storybook/preview-api@workspace:lib/preview-api": +"@storybook/preview-api@7.1.0-alpha.36, @storybook/preview-api@workspace:*, @storybook/preview-api@workspace:lib/preview-api": version: 0.0.0-use.local resolution: "@storybook/preview-api@workspace:lib/preview-api" dependencies: "@jest/globals": ^29.5.0 - "@storybook/channel-postmessage": 7.1.0-alpha.35 - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 + "@storybook/channel-postmessage": 7.1.0-alpha.36 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 "@storybook/csf": ^0.1.0 "@storybook/global": ^5.0.0 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/types": 7.1.0-alpha.36 "@types/qs": ^6.9.5 ansi-to-html: ^0.6.11 dequal: ^2.0.2 @@ -6982,23 +6984,23 @@ __metadata: languageName: node linkType: hard -"@storybook/preview-web@7.1.0-alpha.35, @storybook/preview-web@workspace:*, @storybook/preview-web@workspace:deprecated/preview-web": +"@storybook/preview-web@7.1.0-alpha.36, @storybook/preview-web@workspace:*, @storybook/preview-web@workspace:deprecated/preview-web": version: 0.0.0-use.local resolution: "@storybook/preview-web@workspace:deprecated/preview-web" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 languageName: unknown linkType: soft -"@storybook/preview@7.1.0-alpha.35, @storybook/preview@workspace:*, @storybook/preview@workspace:lib/preview": +"@storybook/preview@7.1.0-alpha.36, @storybook/preview@workspace:*, @storybook/preview@workspace:lib/preview": version: 0.0.0-use.local resolution: "@storybook/preview@workspace:lib/preview" dependencies: - "@storybook/channels": 7.1.0-alpha.35 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 + "@storybook/channels": 7.1.0-alpha.36 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 typescript: ~4.9.3 languageName: unknown linkType: soft @@ -7021,11 +7023,11 @@ __metadata: languageName: node linkType: hard -"@storybook/react-dom-shim@7.1.0-alpha.35, @storybook/react-dom-shim@workspace:lib/react-dom-shim": +"@storybook/react-dom-shim@7.1.0-alpha.36, @storybook/react-dom-shim@workspace:lib/react-dom-shim": version: 0.0.0-use.local resolution: "@storybook/react-dom-shim@workspace:lib/react-dom-shim" dependencies: - "@storybook/types": 7.1.0-alpha.35 + "@storybook/types": 7.1.0-alpha.36 typescript: ~4.9.3 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -7039,8 +7041,8 @@ __metadata: dependencies: "@joshwooding/vite-plugin-react-docgen-typescript": 0.2.1 "@rollup/pluginutils": ^5.0.2 - "@storybook/builder-vite": 7.1.0-alpha.35 - "@storybook/react": 7.1.0-alpha.35 + "@storybook/builder-vite": 7.1.0-alpha.36 + "@storybook/react": 7.1.0-alpha.36 "@types/node": ^16.0.0 "@vitejs/plugin-react": ^3.0.1 ast-types: ^0.14.2 @@ -7059,9 +7061,9 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/react-webpack5@workspace:frameworks/react-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/preset-react-webpack": 7.1.0-alpha.35 - "@storybook/react": 7.1.0-alpha.35 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/preset-react-webpack": 7.1.0-alpha.36 + "@storybook/react": 7.1.0-alpha.36 "@types/node": ^16.0.0 jest-specific-snapshot: ^8.0.0 typescript: ~4.9.3 @@ -7077,18 +7079,18 @@ __metadata: languageName: unknown linkType: soft -"@storybook/react@7.1.0-alpha.35, @storybook/react@workspace:*, @storybook/react@workspace:renderers/react": +"@storybook/react@7.1.0-alpha.36, @storybook/react@workspace:*, @storybook/react@workspace:renderers/react": version: 0.0.0-use.local resolution: "@storybook/react@workspace:renderers/react" dependencies: "@babel/core": ^7.22.0 - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-client": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-client": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/react-dom-shim": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/react-dom-shim": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/escodegen": ^0.0.6 "@types/estree": ^0.0.51 "@types/node": ^16.0.0 @@ -7308,11 +7310,11 @@ __metadata: languageName: unknown linkType: soft -"@storybook/router@7.1.0-alpha.35, @storybook/router@workspace:*, @storybook/router@workspace:lib/router": +"@storybook/router@7.1.0-alpha.36, @storybook/router@workspace:*, @storybook/router@workspace:lib/router": version: 0.0.0-use.local resolution: "@storybook/router@workspace:lib/router" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 dequal: ^2.0.2 lodash: ^4.17.21 @@ -7331,10 +7333,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/server-webpack5@workspace:frameworks/server-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/preset-server-webpack": 7.1.0-alpha.35 - "@storybook/server": 7.1.0-alpha.35 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/preset-server-webpack": 7.1.0-alpha.36 + "@storybook/server": 7.1.0-alpha.36 "@types/node": ^16.0.0 typescript: ~4.9.3 peerDependencies: @@ -7343,16 +7345,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/server@7.1.0-alpha.35, @storybook/server@workspace:*, @storybook/server@workspace:renderers/server": +"@storybook/server@7.1.0-alpha.36, @storybook/server@workspace:*, @storybook/server@workspace:renderers/server": version: 0.0.0-use.local resolution: "@storybook/server@workspace:renderers/server" dependencies: - "@storybook/core-client": 7.1.0-alpha.35 + "@storybook/core-client": 7.1.0-alpha.36 "@storybook/csf": ^0.1.0 - "@storybook/csf-tools": 7.1.0-alpha.35 + "@storybook/csf-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/fs-extra": ^11.0.1 fs-extra: ^11.1.0 ts-dedent: ^2.0.0 @@ -7361,12 +7363,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/source-loader@7.1.0-alpha.35, @storybook/source-loader@workspace:*, @storybook/source-loader@workspace:lib/source-loader": +"@storybook/source-loader@7.1.0-alpha.36, @storybook/source-loader@workspace:*, @storybook/source-loader@workspace:lib/source-loader": version: 0.0.0-use.local resolution: "@storybook/source-loader@workspace:lib/source-loader" dependencies: "@storybook/csf": ^0.1.0 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/types": 7.1.0-alpha.36 estraverse: ^5.2.0 jest-specific-snapshot: ^8.0.0 lodash: ^4.17.21 @@ -7378,22 +7380,22 @@ __metadata: languageName: unknown linkType: soft -"@storybook/store@7.1.0-alpha.35, @storybook/store@workspace:*, @storybook/store@workspace:deprecated/store": +"@storybook/store@7.1.0-alpha.36, @storybook/store@workspace:*, @storybook/store@workspace:deprecated/store": version: 0.0.0-use.local resolution: "@storybook/store@workspace:deprecated/store" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 languageName: unknown linkType: soft -"@storybook/svelte-vite@7.1.0-alpha.35, @storybook/svelte-vite@workspace:frameworks/svelte-vite": +"@storybook/svelte-vite@7.1.0-alpha.36, @storybook/svelte-vite@workspace:frameworks/svelte-vite": version: 0.0.0-use.local resolution: "@storybook/svelte-vite@workspace:frameworks/svelte-vite" dependencies: - "@storybook/builder-vite": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/svelte": 7.1.0-alpha.35 + "@storybook/builder-vite": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/svelte": 7.1.0-alpha.36 "@sveltejs/vite-plugin-svelte": ^2.0.0 "@types/node": ^16.0.0 magic-string: ^0.30.0 @@ -7413,10 +7415,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/svelte-webpack5@workspace:frameworks/svelte-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/preset-svelte-webpack": 7.1.0-alpha.35 - "@storybook/svelte": 7.1.0-alpha.35 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/preset-svelte-webpack": 7.1.0-alpha.36 + "@storybook/svelte": 7.1.0-alpha.36 svelte: ^3.48.0 svelte-loader: ^3.1.2 typescript: ~4.9.3 @@ -7429,17 +7431,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/svelte@7.1.0-alpha.35, @storybook/svelte@workspace:*, @storybook/svelte@workspace:renderers/svelte": +"@storybook/svelte@7.1.0-alpha.36, @storybook/svelte@workspace:*, @storybook/svelte@workspace:renderers/svelte": version: 0.0.0-use.local resolution: "@storybook/svelte@workspace:renderers/svelte" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-client": 7.1.0-alpha.35 - "@storybook/core-events": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-client": 7.1.0-alpha.36 + "@storybook/core-events": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 expect-type: ^0.15.0 svelte: ^3.59.1 svelte-check: ^3.4.3 @@ -7455,9 +7457,9 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/sveltekit@workspace:frameworks/sveltekit" dependencies: - "@storybook/builder-vite": 7.1.0-alpha.35 - "@storybook/svelte": 7.1.0-alpha.35 - "@storybook/svelte-vite": 7.1.0-alpha.35 + "@storybook/builder-vite": 7.1.0-alpha.36 + "@storybook/svelte": 7.1.0-alpha.36 + "@storybook/svelte-vite": 7.1.0-alpha.36 "@types/node": ^16.0.0 typescript: ^4.9.3 vite: ^4.0.0 @@ -7466,12 +7468,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/telemetry@7.1.0-alpha.35, @storybook/telemetry@workspace:*, @storybook/telemetry@workspace:lib/telemetry": +"@storybook/telemetry@7.1.0-alpha.36, @storybook/telemetry@workspace:*, @storybook/telemetry@workspace:lib/telemetry": version: 0.0.0-use.local resolution: "@storybook/telemetry@workspace:lib/telemetry" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 chalk: ^4.1.0 detect-package-manager: ^2.0.1 fetch-retry: ^5.0.2 @@ -7494,7 +7496,7 @@ __metadata: languageName: node linkType: hard -"@storybook/theming@7.1.0-alpha.35, @storybook/theming@workspace:*, @storybook/theming@workspace:lib/theming": +"@storybook/theming@7.1.0-alpha.36, @storybook/theming@workspace:*, @storybook/theming@workspace:lib/theming": version: 0.0.0-use.local resolution: "@storybook/theming@workspace:lib/theming" dependencies: @@ -7503,7 +7505,7 @@ __metadata: "@emotion/react": ^11.10.4 "@emotion/styled": ^11.10.4 "@emotion/use-insertion-effect-with-fallbacks": ^1.0.0 - "@storybook/client-logger": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 "@types/fs-extra": ^11.0.1 "@types/node": ^16.0.0 @@ -7519,11 +7521,11 @@ __metadata: languageName: unknown linkType: soft -"@storybook/types@7.1.0-alpha.35, @storybook/types@workspace:*, @storybook/types@workspace:lib/types": +"@storybook/types@7.1.0-alpha.36, @storybook/types@workspace:*, @storybook/types@workspace:lib/types": version: 0.0.0-use.local resolution: "@storybook/types@workspace:lib/types" dependencies: - "@storybook/channels": 7.1.0-alpha.35 + "@storybook/channels": 7.1.0-alpha.36 "@storybook/csf": ^0.1.0 "@types/babel__core": ^7.0.0 "@types/express": ^4.7.0 @@ -7549,10 +7551,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue-vite@workspace:frameworks/vue-vite" dependencies: - "@storybook/builder-vite": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/core-server": 7.1.0-alpha.35 - "@storybook/vue": 7.1.0-alpha.35 + "@storybook/builder-vite": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/core-server": 7.1.0-alpha.36 + "@storybook/vue": 7.1.0-alpha.36 magic-string: ^0.30.0 typescript: ~4.9.3 vite: ^4.0.0 @@ -7570,10 +7572,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue-webpack5@workspace:frameworks/vue-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/preset-vue-webpack": 7.1.0-alpha.35 - "@storybook/vue": 7.1.0-alpha.35 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/preset-vue-webpack": 7.1.0-alpha.36 + "@storybook/vue": 7.1.0-alpha.36 "@types/node": ^16.0.0 typescript: ~4.9.3 vue: ^2.6.12 @@ -7595,9 +7597,9 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue3-vite@workspace:frameworks/vue3-vite" dependencies: - "@storybook/builder-vite": 7.1.0-alpha.35 - "@storybook/core-server": 7.1.0-alpha.35 - "@storybook/vue3": 7.1.0-alpha.35 + "@storybook/builder-vite": 7.1.0-alpha.36 + "@storybook/core-server": 7.1.0-alpha.36 + "@storybook/vue3": 7.1.0-alpha.36 "@types/node": ^16.0.0 "@vitejs/plugin-vue": ^4.0.0 magic-string: ^0.30.0 @@ -7615,10 +7617,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue3-webpack5@workspace:frameworks/vue3-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/preset-vue3-webpack": 7.1.0-alpha.35 - "@storybook/vue3": 7.1.0-alpha.35 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/preset-vue3-webpack": 7.1.0-alpha.36 + "@storybook/vue3": 7.1.0-alpha.36 "@types/node": ^16.0.0 "@vue/compiler-sfc": 3.0.0 typescript: ~4.9.3 @@ -7633,16 +7635,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/vue3@7.1.0-alpha.35, @storybook/vue3@workspace:*, @storybook/vue3@workspace:renderers/vue3": +"@storybook/vue3@7.1.0-alpha.36, @storybook/vue3@workspace:*, @storybook/vue3@workspace:renderers/vue3": version: 0.0.0-use.local resolution: "@storybook/vue3@workspace:renderers/vue3" dependencies: "@digitak/esrun": ^3.2.2 - "@storybook/core-client": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/core-client": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/prettier": 2.7.2 "@vue/compiler-core": ^3.3.4 "@vue/vue3-jest": 29 @@ -7659,16 +7661,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/vue@7.1.0-alpha.35, @storybook/vue@workspace:*, @storybook/vue@workspace:renderers/vue": +"@storybook/vue@7.1.0-alpha.36, @storybook/vue@workspace:*, @storybook/vue@workspace:renderers/vue": version: 0.0.0-use.local resolution: "@storybook/vue@workspace:renderers/vue" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-client": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-client": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 ts-dedent: ^2.0.0 type-fest: ^3.11.0 typescript: ~4.9.3 @@ -7689,10 +7691,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/web-components-vite@workspace:frameworks/web-components-vite" dependencies: - "@storybook/builder-vite": 7.1.0-alpha.35 - "@storybook/core-server": 7.1.0-alpha.35 - "@storybook/node-logger": 7.1.0-alpha.35 - "@storybook/web-components": 7.1.0-alpha.35 + "@storybook/builder-vite": 7.1.0-alpha.36 + "@storybook/core-server": 7.1.0-alpha.36 + "@storybook/node-logger": 7.1.0-alpha.36 + "@storybook/web-components": 7.1.0-alpha.36 "@types/node": ^16.0.0 magic-string: ^0.30.0 typescript: ~4.9.3 @@ -7707,10 +7709,10 @@ __metadata: resolution: "@storybook/web-components-webpack5@workspace:frameworks/web-components-webpack5" dependencies: "@babel/preset-env": ^7.22.0 - "@storybook/builder-webpack5": 7.1.0-alpha.35 - "@storybook/core-common": 7.1.0-alpha.35 - "@storybook/preset-web-components-webpack": 7.1.0-alpha.35 - "@storybook/web-components": 7.1.0-alpha.35 + "@storybook/builder-webpack5": 7.1.0-alpha.36 + "@storybook/core-common": 7.1.0-alpha.36 + "@storybook/preset-web-components-webpack": 7.1.0-alpha.36 + "@storybook/web-components": 7.1.0-alpha.36 "@types/node": ^16.0.0 lit: 2.3.1 typescript: ~4.9.3 @@ -7721,17 +7723,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/web-components@7.1.0-alpha.35, @storybook/web-components@workspace:*, @storybook/web-components@workspace:renderers/web-components": +"@storybook/web-components@7.1.0-alpha.36, @storybook/web-components@workspace:*, @storybook/web-components@workspace:renderers/web-components": version: 0.0.0-use.local resolution: "@storybook/web-components@workspace:renderers/web-components" dependencies: - "@storybook/client-logger": 7.1.0-alpha.35 - "@storybook/core-client": 7.1.0-alpha.35 - "@storybook/docs-tools": 7.1.0-alpha.35 + "@storybook/client-logger": 7.1.0-alpha.36 + "@storybook/core-client": 7.1.0-alpha.36 + "@storybook/docs-tools": 7.1.0-alpha.36 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0-alpha.35 - "@storybook/preview-api": 7.1.0-alpha.35 - "@storybook/types": 7.1.0-alpha.35 + "@storybook/manager-api": 7.1.0-alpha.36 + "@storybook/preview-api": 7.1.0-alpha.36 + "@storybook/types": 7.1.0-alpha.36 "@types/cross-spawn": ^6.0.2 "@types/node": ^16.0.0 cross-spawn: ^7.0.3 @@ -8253,6 +8255,13 @@ __metadata: languageName: node linkType: hard +"@types/emscripten@npm:^1.39.6": + version: 1.39.6 + resolution: "@types/emscripten@npm:1.39.6" + checksum: cb1ea8ccddada1d304bdf11a54daa0d1e87f29cea947eceff54c1e0a752d2cc185eeffdcf52042f24420aa8e1fa9bbfdbab1231fb2531eefcfdc788199fee2de + languageName: node + linkType: hard + "@types/escodegen@npm:^0.0.6": version: 0.0.6 resolution: "@types/escodegen@npm:0.0.6" @@ -9785,6 +9794,26 @@ __metadata: languageName: node linkType: hard +"@yarnpkg/fslib@npm:^2.10.3": + version: 2.10.3 + resolution: "@yarnpkg/fslib@npm:2.10.3" + dependencies: + "@yarnpkg/libzip": ^2.3.0 + tslib: ^1.13.0 + checksum: c4fbbed99e801f17c381204e9699d9ea4fb51b14e99968985f477bdbc7b02b61e026860173f3f46bd60d9f46ae6a06f420a3edb3c02c3a45ae83779095928094 + languageName: node + linkType: hard + +"@yarnpkg/libzip@npm:^2.3.0": + version: 2.3.0 + resolution: "@yarnpkg/libzip@npm:2.3.0" + dependencies: + "@types/emscripten": ^1.39.6 + tslib: ^1.13.0 + checksum: 0c2361ccb002e28463ed98541f3bdaab54f52aad6a2080666c2a9ea605ebd9cdfb7b0340b1db6f105820d05bcb803cdfb3ce755a8f6034657298c291bf884f81 + languageName: node + linkType: hard + "@yarnpkg/lockfile@npm:1.1.0, @yarnpkg/lockfile@npm:^1.1.0": version: 1.1.0 resolution: "@yarnpkg/lockfile@npm:1.1.0" @@ -27275,7 +27304,7 @@ __metadata: version: 0.0.0-use.local resolution: "sb@workspace:lib/cli-sb" dependencies: - "@storybook/cli": 7.1.0-alpha.35 + "@storybook/cli": 7.1.0-alpha.36 bin: sb: ./index.js languageName: unknown @@ -28217,7 +28246,7 @@ __metadata: version: 0.0.0-use.local resolution: "storybook@workspace:lib/cli-storybook" dependencies: - "@storybook/cli": 7.1.0-alpha.35 + "@storybook/cli": 7.1.0-alpha.36 bin: sb: ./index.js storybook: ./index.js @@ -29459,7 +29488,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^1.10.0, tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.3": +"tslib@npm:^1.10.0, tslib@npm:^1.13.0, tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.3": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: 69ae09c49eea644bc5ebe1bca4fa4cc2c82b7b3e02f43b84bd891504edf66dbc6b2ec0eef31a957042de2269139e4acff911e6d186a258fb14069cd7f6febce2 diff --git a/scripts/release/__tests__/generate-pr-description.test.ts b/scripts/release/__tests__/generate-pr-description.test.ts index b84c7a5d8dae..5323f6bc2a87 100644 --- a/scripts/release/__tests__/generate-pr-description.test.ts +++ b/scripts/release/__tests__/generate-pr-description.test.ts @@ -10,10 +10,11 @@ describe('Generate PR Description', () => { const changes: Change[] = [ { user: 'JReinhold', + id: 'pr-id-42', title: 'Some PR title for a bug', labels: ['bug', 'build', 'other label', 'patch'], commit: 'abc123', - pull: '42', + pull: 42, links: { commit: '[abc123](https://github.com/storybookjs/storybook/commit/abc123)', pull: '[#42](https://github.com/storybookjs/storybook/pull/42)', @@ -22,6 +23,7 @@ describe('Generate PR Description', () => { }, { // this Bump version commit should be ignored + id: null, user: 'github-actions[bot]', pull: null, commit: '012b58140c3606efeacbe99c0c410624b0a1ed1f', @@ -35,6 +37,7 @@ describe('Generate PR Description', () => { }, }, { + id: null, user: 'shilman', title: 'Some title for a "direct commit"', labels: null, @@ -47,11 +50,12 @@ describe('Generate PR Description', () => { }, }, { + id: 'pr-id-11', user: 'shilman', title: 'Another PR `title` for docs', labels: ['another label', 'documentation', 'patch'], commit: 'ddd222', - pull: '11', + pull: 11, links: { commit: '[ddd222](https://github.com/storybookjs/storybook/commit/ddd222)', pull: '[#11](https://github.com/storybookjs/storybook/pull/11)', @@ -59,11 +63,12 @@ describe('Generate PR Description', () => { }, }, { + id: 'pr-id-48', user: 'JReinhold', title: "Some PR title for a 'new' feature", labels: ['feature request', 'other label'], commit: 'wow1337', - pull: '48', + pull: 48, links: { commit: '[wow1337](https://github.com/storybookjs/storybook/commit/wow1337)', pull: '[#48](https://github.com/storybookjs/storybook/pull/48)', @@ -71,11 +76,12 @@ describe('Generate PR Description', () => { }, }, { + id: 'pr-id-77', user: 'JReinhold', title: 'Some PR title with a missing label', labels: ['incorrect label', 'other label'], commit: 'bad999', - pull: '77', + pull: 77, links: { commit: '[bad999](https://github.com/storybookjs/storybook/commit/bad999)', pull: '[#77](https://github.com/storybookjs/storybook/pull/77)', @@ -84,35 +90,22 @@ describe('Generate PR Description', () => { }, ]; describe('mapToChangelist', () => { - it('should return a correct string for releases', () => { - expect(mapToChangelist({ changes, isRelease: true })).toMatchInlineSnapshot(` - "- **πŸ› Bug**: Some PR title for a bug [#42](https://github.com/storybookjs/storybook/pull/42) - - [ ] The change is appropriate for the version bump - - [ ] The PR is labeled correctly - - [ ] The PR title is correct - - **⚠️ Direct commit**: Some title for a "direct commit" [22bb11](https://github.com/storybookjs/storybook/commit/22bb11) - - [ ] The change is appropriate for the version bump - - **πŸ“ Documentation**: Another PR \`title\` for docs [#11](https://github.com/storybookjs/storybook/pull/11) - - [ ] The change is appropriate for the version bump - - [ ] The PR is labeled correctly - - [ ] The PR title is correct - - **✨ Feature Request**: Some PR title for a 'new' feature [#48](https://github.com/storybookjs/storybook/pull/48) - - [ ] The change is appropriate for the version bump - - [ ] The PR is labeled correctly - - [ ] The PR title is correct - - **❔ Missing Label**: Some PR title with a missing label [#77](https://github.com/storybookjs/storybook/pull/77) - - [ ] The change is appropriate for the version bump - - [ ] The PR is labeled correctly - - [ ] The PR title is correct" + it('should return a correct string for patch PRs', () => { + expect(mapToChangelist({ changes, unpickedPatches: true })).toMatchInlineSnapshot(` + "- [ ] **πŸ› Bug**: Some PR title for a bug [#42](https://github.com/storybookjs/storybook/pull/42) + - [ ] **✨ Feature Request**: Some PR title for a 'new' feature [#48](https://github.com/storybookjs/storybook/pull/48) + - [ ] **⚠️ Direct commit**: Some title for a "direct commit" [22bb11](https://github.com/storybookjs/storybook/commit/22bb11) + - [ ] **πŸ“ Documentation**: Another PR \`title\` for docs [#11](https://github.com/storybookjs/storybook/pull/11) + - [ ] **❔ Missing Label**: Some PR title with a missing label [#77](https://github.com/storybookjs/storybook/pull/77)" `); }); - it('should return a correct string for non-releases', () => { - expect(mapToChangelist({ changes, isRelease: false })).toMatchInlineSnapshot(` - "- **πŸ› Bug**: Some PR title for a bug [#42](https://github.com/storybookjs/storybook/pull/42) - - **⚠️ Direct commit**: Some title for a "direct commit" [22bb11](https://github.com/storybookjs/storybook/commit/22bb11) - - **πŸ“ Documentation**: Another PR \`title\` for docs [#11](https://github.com/storybookjs/storybook/pull/11) - - **✨ Feature Request**: Some PR title for a 'new' feature [#48](https://github.com/storybookjs/storybook/pull/48) - - **❔ Missing Label**: Some PR title with a missing label [#77](https://github.com/storybookjs/storybook/pull/77)" + it('should return a correct string for prerelease PRs', () => { + expect(mapToChangelist({ changes, unpickedPatches: false })).toMatchInlineSnapshot(` + "- [ ] **πŸ› Bug**: Some PR title for a bug [#42](https://github.com/storybookjs/storybook/pull/42) (will also be patched) + - [ ] **✨ Feature Request**: Some PR title for a 'new' feature [#48](https://github.com/storybookjs/storybook/pull/48) + - [ ] **⚠️ Direct commit**: Some title for a "direct commit" [22bb11](https://github.com/storybookjs/storybook/commit/22bb11) + - [ ] **πŸ“ Documentation**: Another PR \`title\` for docs [#11](https://github.com/storybookjs/storybook/pull/11) (will also be patched) + - [ ] **❔ Missing Label**: Some PR title with a missing label [#77](https://github.com/storybookjs/storybook/pull/77)" `); }); }); @@ -222,8 +215,8 @@ For each pull request below, you need to either manually cherry pick it, or disc If you\\'ve made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-prerelease.yml) and wait for it to finish. It will wipe your progress in this to do, which is expected. When everything above is done: - - [ ] Merge this PR - - [ ] [Follow the publish workflow run and see it finishes succesfully](https://github.com/storybookjs/storybook/actions/workflows/publish.yml) + - Merge this PR + - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml) --- @@ -273,8 +266,8 @@ For each pull request below, you need to either manually cherry pick it, or disc If you\\'ve made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-prerelease.yml) and wait for it to finish. When everything above is done: - - [ ] Merge this PR - - [ ] [Approve the publish workflow run](https://github.com/storybookjs/storybook/actions/workflows/publish.yml)" + - Merge this PR + - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml)" `); }); @@ -337,8 +330,8 @@ For each pull request below, you need to either manually cherry pick it, or disc If you\\'ve made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-prerelease.yml) and wait for it to finish. It will wipe your progress in this to do, which is expected. When everything above is done: - - [ ] Merge this PR - - [ ] [Follow the publish workflow run and see it finishes succesfully](https://github.com/storybookjs/storybook/actions/workflows/publish.yml) + - Merge this PR + - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml) --- @@ -383,8 +376,8 @@ For each pull request below, you need to either manually cherry pick it, or disc If you\\'ve made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-prerelease.yml) and wait for it to finish. When everything above is done: - - [ ] Merge this PR - - [ ] [Approve the publish workflow run](https://github.com/storybookjs/storybook/actions/workflows/publish.yml)" + - Merge this PR + - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml)" `); }); }); diff --git a/scripts/release/__tests__/label-patches.test.ts b/scripts/release/__tests__/label-patches.test.ts index 31203529a0ca..0ee57a2dbe0e 100644 --- a/scripts/release/__tests__/label-patches.test.ts +++ b/scripts/release/__tests__/label-patches.test.ts @@ -112,22 +112,26 @@ test('it should label the PR associated with cheery picks in the current branch' ] `); - expect.addSnapshotSerializer({ - serialize: (value) => { - const stripAnsi = value.map((it: string) => it.replace(ansiRegex(), '')); - return JSON.stringify(stripAnsi, null, 2); - }, - test: () => true, - }); + const stderrCalls = writeStderr.mock.calls + .map(([text]) => + typeof text === 'string' + ? text + .replace(ansiRegex(), '') + .replace(/[^\x20-\x7E]/g, '') + .replaceAll('-', '') + .trim() + : text + ) + .filter((it) => it !== ''); - expect(writeStderr.mock.calls.map(([text]) => text)).toMatchInlineSnapshot(` + expect(stderrCalls).toMatchInlineSnapshot(` [ - "- Looking for latest tag\\n", - "βœ” Found latest tag: v7.2.1\\n", - "- Looking at cherry pick commits since v7.2.1\\n", - "βœ” Found the following picks πŸ’:\\n Commit: 930b47f011f750c44a1782267d698ccdd3c04da3\\n PR: [#55](https://github.com/storybookjs/storybook/pull/55)\\n", - "- Labeling the PRs with the picked label...\\n", - "βœ” Successfully labeled all PRs with the picked label.\\n" + "Looking for latest tag", + "Found latest tag: v7.2.1", + "Looking at cherry pick commits since v7.2.1", + "Found the following picks : Commit: 930b47f011f750c44a1782267d698ccdd3c04da3 PR: [#55](https://github.com/storybookjs/storybook/pull/55)", + "Labeling the PRs with the picked label...", + "Successfully labeled all PRs with the picked label.", ] `); }); diff --git a/scripts/release/generate-pr-description.ts b/scripts/release/generate-pr-description.ts index 35654d9d601c..f326ddb259a5 100644 --- a/scripts/release/generate-pr-description.ts +++ b/scripts/release/generate-pr-description.ts @@ -5,8 +5,9 @@ import { z } from 'zod'; import dedent from 'ts-dedent'; import { setOutput } from '@actions/core'; import type { Change } from './utils/get-changes'; -import { getChanges, LABELS_BY_IMPORTANCE } from './utils/get-changes'; +import { getChanges, LABELS_BY_IMPORTANCE, RELEASED_LABELS } from './utils/get-changes'; import { getCurrentVersion } from './get-current-version'; +import type { PullRequestInfo } from './utils/get-github-info'; program .name('generate-pr-description') @@ -48,14 +49,15 @@ const CHANGE_TITLES_TO_IGNORE = [ /^merge branch.*/i, /\[skip ci\]/i, /\[ci skip\]/i, + /^Update CHANGELOG\.md for.*/i, ]; export const mapToChangelist = ({ changes, - isRelease, + unpickedPatches, }: { changes: Change[]; - isRelease: boolean; + unpickedPatches: boolean; }): string => { return changes .filter((change) => { @@ -67,14 +69,14 @@ export const mapToChangelist = ({ } return true; }) + .sort((a, b) => { + const isReleasable = (pr: PullRequestInfo) => + (pr.labels ?? []).some((label) => Object.keys(RELEASED_LABELS).includes(label)); + return Number(isReleasable(b)) - Number(isReleasable(a)); + }) .map((change) => { - const lines: string[] = []; if (!change.pull) { - lines.push(`- **⚠️ Direct commit**: ${change.title} ${change.links.commit}`); - if (isRelease) { - lines.push('\t- [ ] The change is appropriate for the version bump'); - } - return lines.join('\n'); + return `- [ ] **⚠️ Direct commit**: ${change.title} ${change.links.commit}`; } const label = (change.labels @@ -85,14 +87,9 @@ export const mapToChangelist = ({ Object.keys(LABELS_BY_IMPORTANCE).indexOf(b) )[0] || 'unknown') as keyof typeof LABELS_BY_IMPORTANCE; - lines.push(`- **${LABELS_BY_IMPORTANCE[label]}**: ${change.title} ${change.links.pull}`); - - if (isRelease) { - lines.push('\t- [ ] The change is appropriate for the version bump'); - lines.push('\t- [ ] The PR is labeled correctly'); - lines.push('\t- [ ] The PR title is correct'); - } - return lines.join('\n'); + return `- [ ] **${LABELS_BY_IMPORTANCE[label]}**: ${change.title} ${change.links.pull}${ + !unpickedPatches && change.labels.includes('patch') ? ' (will also be patched)' : '' + }`; }) .join('\n'); }; @@ -171,10 +168,10 @@ export const generateReleaseDescription = ({ ${manualCherryPicks || ''} If you've made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-prerelease.yml) and wait for it to finish. It will wipe your progress in this to do, which is expected. - + When everything above is done: - - [ ] Merge this PR - - [ ] [Follow the publish workflow run and see it finishes succesfully](https://github.com/storybookjs/storybook/actions/workflows/publish.yml) + - Merge this PR + - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml) --- @@ -206,8 +203,8 @@ export const generateNonReleaseDescription = ( If you've made any changes (change PR titles, revert PRs), manually trigger a re-generation of this PR with [this workflow](https://github.com/storybookjs/storybook/actions/workflows/prepare-prerelease.yml) and wait for it to finish. When everything above is done: - - [ ] Merge this PR - - [ ] [Approve the publish workflow run](https://github.com/storybookjs/storybook/actions/workflows/publish.yml)` + - Merge this PR + - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml)` // don't mention contributors in the release PR, to avoid spamming them .replaceAll('[@', '[@ ') .replaceAll('"', '\\"') @@ -248,7 +245,7 @@ export const run = async (rawOptions: unknown) => { ? generateReleaseDescription({ currentVersion, nextVersion, - changeList: mapToChangelist({ changes, isRelease: true }), + changeList: mapToChangelist({ changes, unpickedPatches }), changelogText, ...(hasCherryPicks && { manualCherryPicks: mapCherryPicksToTodo({ @@ -259,7 +256,7 @@ export const run = async (rawOptions: unknown) => { }), }) : generateNonReleaseDescription( - mapToChangelist({ changes, isRelease: false }), + mapToChangelist({ changes, unpickedPatches }), hasCherryPicks ? mapCherryPicksToTodo({ commits: manualCherryPicks, diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 4f75a49037f2..65b88986777b 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -372,10 +372,13 @@ export const addStories: Task['run'] = async ( const storiesPath = await findFirstPath([join('src', 'stories'), 'stories'], { cwd }); const mainConfig = await readMainConfig({ cwd }); + const packageManager = JsPackageManagerFactory.getPackageManager({}, sandboxDir); // Ensure that we match the right stories in the stories directory - const packageJson = await import(join(cwd, 'package.json')); - updateStoriesField(mainConfig, detectLanguage(packageJson) === SupportedLanguage.JAVASCRIPT); + updateStoriesField( + mainConfig, + (await detectLanguage(packageManager)) === SupportedLanguage.JAVASCRIPT + ); const isCoreRenderer = template.expected.renderer.startsWith('@storybook/') &&