diff --git a/.circleci/config.yml b/.circleci/config.yml index 6709cc29daf3..726de8a63c20 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -459,6 +459,11 @@ jobs: template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench) workflows: + docs: + when: + equal: [docs, << pipeline.parameters.workflow >>] + jobs: + - pretty-docs normal: when: equal: [normal, << pipeline.parameters.workflow >>] diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1019b82b38ef..f24147199aeb 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -37,3 +37,13 @@ Closes # Everybody: Please submit all PRs to the `next` branch unless they are specific to the current release. Storybook maintainers cherry-pick bug and documentation fixes into the `main` branch as part of the release process, so you shouldn't need to worry about this. For additional guidance: https://storybook.js.org/docs/react/contribute/how-to-contribute --> + +### 🦋 Canary release + + + +This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the `@storybookjs/core` team here. + +_core team members can create a canary release [here](https://github.com/storybookjs/storybook/actions/workflows/canary-release-pr.yml) or locally with `gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=`_ + + diff --git a/.github/workflows/canary-release-pr.yml b/.github/workflows/canary-release-pr.yml index c12b0ca566b6..1d405499f25b 100644 --- a/.github/workflows/canary-release-pr.yml +++ b/.github/workflows/canary-release-pr.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: inputs: pr: - description: 'Which pull request number to create a canary release for' + description: 'Pull request number to create a canary release for' required: true type: number @@ -14,7 +14,7 @@ env: PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 concurrency: - group: ${{ github.workflow }}-${{ inputs.pr }} + group: ${{ github.workflow }}-${{ github.event.inputs.pr }} cancel-in-progress: true permissions: @@ -25,9 +25,100 @@ jobs: name: Release canary version runs-on: ubuntu-latest environment: release - defaults: - run: - working-directory: scripts steps: - - name: Do nothing - run: echo "I'm not doing anything" + - name: Fail if triggering actor is not administrator + uses: prince-chrismc/check-actor-permissions-action@v2.0.4 + with: + permission: admin + + - name: Get pull request information + id: info + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: | + PR_INFO=$(gh pr view ${{ inputs.pr }} --repo ${{ github.repository }} --json isCrossRepository,headRefOid,headRefName,headRepository,headRepositoryOwner --jq '{isFork: .isCrossRepository, owner: .headRepositoryOwner.login, repoName: .headRepository.name, branch: .headRefName, sha: .headRefOid}') + echo $PR_INFO + # Loop through each key-value pair in PR_INFO and set as step output + for key in $(echo "$PR_INFO" | jq -r 'keys[]'); do + value=$(echo "$PR_INFO" | jq -r ".$key") + echo "$key=$value" >> "$GITHUB_OUTPUT" + done + echo "repository=$(echo "$PR_INFO" | jq -r ".owner")/$(echo "$PR_INFO" | jq -r ".repoName")" >> $GITHUB_OUTPUT + echo "shortSha=$(echo "$PR_INFO" | jq -r ".sha" | cut -c 1-8)" >> $GITHUB_OUTPUT + echo "date=$(date)" >> $GITHUB_OUTPUT + echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT + + - name: Checkout + uses: actions/checkout@v3 + with: + repository: ${{ steps.info.outputs.isFork == 'true' && steps.info.outputs.repository || null }} + ref: ${{ steps.info.outputs.sha }} + token: ${{ secrets.GH_TOKEN }} + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: | + ~/.yarn/berry/cache + key: yarn-v1-${{ hashFiles('scripts/yarn.lock') }}-${{ hashFiles('code/yarn.lock') }} + restore-keys: | + yarn-v1-${{ hashFiles('scripts/yarn.lock') }}-${{ hashFiles('code/yarn.lock') }} + yarn-v1-${{ hashFiles('scripts/yarn.lock') }} + yarn-v1 + + - name: Install dependencies + run: yarn task --task=install --start-from=install + + - name: Set version + id: version + working-directory: scripts + run: | + yarn release:version --release-type prerelease --pre-id canary-${{ inputs.pr }}-${{ steps.info.outputs.timestamp }}-${{ steps.info.outputs.shortSha }} --verbose + + - name: Publish v${{ steps.version.outputs.next-version }} + env: + YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + working-directory: scripts + run: yarn release:publish --tag canary --verbose + + - name: Replace Pull Request Body + # TODO: replace with ivangabriele/find-and-replace-pull-request-body@vX when https://github.com/ivangabriele/find-and-replace-pull-request-body/pull/11 has been released + uses: mcky/find-and-replace-pull-request-body@v1.1.6-mcky + with: + githubToken: ${{ secrets.GH_TOKEN }} + prNumber: ${{ inputs.pr }} + find: 'CANARY_RELEASE_SECTION' + isHtmlCommentTag: true + replace: | + This pull request has been released as version [`${{ steps.version.outputs.next-version }}`](https://npmjs.com/package/@storybook/cli/v/${{ steps.version.outputs.next-version }}). Install it by pinning all your Storybook dependencies to that version. +
+ More information + + | | | + | --- | --- | + | **Published version** | [`${{ steps.version.outputs.next-version }}`](https://npmjs.com/package/@storybook/cli/v/${{ steps.version.outputs.next-version }}) | + | **Triggered by** | @${{ github.triggering_actor }} | + | **Repository** | [${{ steps.info.outputs.repository }}](https://github.com/${{ steps.info.outputs.repository }}) | + | **Branch** | [`${{ steps.info.outputs.branch }}`](https://github.com/${{ steps.info.outputs.repository }}/tree/${{ steps.info.outputs.branch }}) | + | **Commit** | [`${{ steps.info.outputs.shortSha }}`](https://github.com/${{ steps.info.outputs.repository }}/commit/${{ steps.info.outputs.sha }}) | + | **Datetime** | ${{ steps.info.outputs.date }} (`${{ steps.info.outputs.timestamp }}`) | + | **Workflow run** | [${{ github.run_id }}](https://github.com/storybookjs/storybook/actions/runs/${{ github.run_id }}) | + + To request a new release of this pull request, mention the `@storybookjs/core` team. + + _core team members can create a new canary release [here](https://github.com/storybookjs/storybook/actions/workflows/canary-release-pr.yml) or locally with `gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=${{ inputs.pr }}`_ +
+ + - name: Create failing comment on PR + if: failure() + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: | + gh pr comment ${{ inputs.pr }}\ + --repo "${{github.repository }}"\ + --body "Failed to publish canary version of this pull request, triggered by @${{ github.triggering_actor }}. See the failed workflow run at: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d319a540c376..3a6eeebd8248 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -121,11 +121,13 @@ jobs: if: github.ref_name == 'latest-release' run: git fetch --tags origin + # when this is a patch release from main, label any patch PRs included in the release + # when this is a stable release from next, label ALL patch PRs found, as they will per definition be "patched" now - name: Label patch PRs as picked - if: github.ref_name == 'latest-release' + if: github.ref_name == 'latest-release' || (steps.publish-needed.outputs.published == 'false' && steps.target.outputs.target == 'next' && !steps.is-prerelease.outputs.prerelease) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: yarn release:label-patches + run: yarn release:label-patches ${{ steps.target.outputs.target == 'next' && '--all' || '' }} - name: Create GitHub Release if: steps.publish-needed.outputs.published == 'false' @@ -161,25 +163,43 @@ jobs: git commit -m "Update CHANGELOG.md for v${{ steps.version.outputs.current-version }} [skip ci]" git push origin next - - name: Sync versions/next.json from `next` to `main` + - name: Sync version JSONs from `next-release` to `main` if: github.ref_name == 'next-release' working-directory: . run: | + VERSION_FILE="./docs/versions/${{ steps.is-prerelease.outputs.prerelease == 'true' && 'next' || 'latest' }}.json" git fetch origin main git checkout main git pull - git checkout origin/next ./docs/versions/next.json - git add ./docs/versions/next.json - git commit -m "Update versions/next.json for v${{ steps.version.outputs.current-version }}" + git checkout origin/next-release $VERSION_FILE + git add $VERSION_FILE + git commit -m "Update $VERSION_FILE for v${{ steps.version.outputs.current-version }}" git push origin main - # Force push from next to main if it is not a prerelease, and this release is from next-release + # TODO: this is currently disabled, because we may have a better strategy that we want to try out manually first before comitting to it: + # - create a branch "release-" from HEAD of main + # - git push --force origin ${{ steps.target.outputs.target }}:main + # - ... this will keep the "main" history in the new release branch, and then overwrite main's history with next's + + # Sync next-release 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 - # - name: Force push ${{ steps.target.outputs.target }} to main + # This will keep next-release, next and main all tracking v7.1.0 + # See "Alternative merge strategies" in https://stackoverflow.com/a/36321787 + # - name: Sync next-release to main # if: steps.publish-needed.outputs.published == 'false' && steps.target.outputs.target == 'next' && !steps.is-prerelease.outputs.prerelease + # working-directory: . # run: | - # git push --force origin ${{ steps.target.outputs.target }}:main + # git fetch origin next-release + # git checkout next-release + # git pull + # git fetch origin main + # git checkout main + # git pull + # git merge --no-commit -s ours next-release + # git rm -rf . + # git checkout next-release -- . + # git commit -m "Sync next-release to main" + # git push origin main - name: Report job failure to Discord if: failure() diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index 2547a08218a3..c8c8a4c0af9c 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -55,6 +55,25 @@ jobs: env: CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }} BRANCH: ${{ needs.get-branch.outputs.branch }} + trigger-docs-tests: + runs-on: ubuntu-latest + needs: get-branch + if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:docs') + steps: + - name: Trigger docs tests + run: > + curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \ + -H "Content-Type: application/json" \ + -H "Circle-Token: $CIRCLE_CI_TOKEN" \ + -d '{ + "branch": "'"$BRANCH"'", + "parameters": { + "workflow": "docs" + } + }' + env: + CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }} + BRANCH: ${{ needs.get-branch.outputs.branch }} trigger-merged-tests: runs-on: ubuntu-latest needs: get-branch diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eaae9f6ddc9..d6d0a33f1f89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.1.1 + +- Angular: Make enableProdMode optional - [#23489](https://github.com/storybookjs/storybook/pull/23489), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- CLI: Gracefully shutdown and cleanup execa child processes - [#23538](https://github.com/storybookjs/storybook/pull/23538), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- CLI: Improve support of mono repositories - [#23458](https://github.com/storybookjs/storybook/pull/23458), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! + ## 7.1.0 (July 18, 2023) Storybook 7.1 is here! 🎉 diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index b9fdc7be99cf..89b57f4aec60 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,19 @@ +## 7.2.0-alpha.0 + +- Angular: Make enableProdMode optional - [#23489](https://github.com/storybookjs/storybook/pull/23489), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- Router: Support RegExp in Route component - [#23292](https://github.com/storybookjs/storybook/pull/23292), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: Improve tabs component, more type correct, allow for FC as title - [#23288](https://github.com/storybookjs/storybook/pull/23288), thanks [@ndelangen](https://github.com/ndelangen)! +- Addons: Improve code quality by using title as FC & sharing state via useAddonState - [#23298](https://github.com/storybookjs/storybook/pull/23298), thanks [@ndelangen](https://github.com/ndelangen)! +- InteractionsAddon: Improve code quality by using title as FC & sharing state via useAddonState - [#23291](https://github.com/storybookjs/storybook/pull/23291), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: Add storyStatus to sidebar UI - [#23342](https://github.com/storybookjs/storybook/pull/23342), thanks [@ndelangen](https://github.com/ndelangen)! +- Addon API: Add experimental page addon type - [#23307](https://github.com/storybookjs/storybook/pull/23307), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: refactor Canvas component so we can improve types for PREVIEW addons and TAB addons - [#23311](https://github.com/storybookjs/storybook/pull/23311), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: Improve Button layout and props - [#23356](https://github.com/storybookjs/storybook/pull/23356), thanks [@cdedreuille](https://github.com/cdedreuille)! +- Dependencies: Remove references to api and the 2 deprecated channel packages - [#23384](https://github.com/storybookjs/storybook/pull/23384), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: Show the story status in the search results - [#23441](https://github.com/storybookjs/storybook/pull/23441), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: Create new form elements in the new Core UI (Input, TextArea, Select) - [#23469](https://github.com/storybookjs/storybook/pull/23469), thanks [@cdedreuille](https://github.com/cdedreuille)! +- CLI: Improve support of mono repositories - [#23458](https://github.com/storybookjs/storybook/pull/23458), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! + ## 7.1.0-rc.2 - CLI: Exit when user does not select a storybook project type - [#23201](https://github.com/storybookjs/storybook/pull/23201), thanks [@yannbf](https://github.com/yannbf)! @@ -149,460 +165,460 @@ Promote beta to rc without any changes. 🎉 #### 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) +- 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) ## 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) +- 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 to minify using swc [#22843](https://github.com/storybooks/storybook/pull/22843) +- Webpack: Add option to minify using swc [#22843](https://github.com/storybooks/storybook/pull/22843) #### 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) +- 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) #### 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) +- 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) #### 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) +- 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) ## 7.1.0-alpha.26 (May 31, 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) +- 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) +- 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 -- 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) +- 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) #### Bug Fixes -- Vue3: Fix TS 5.0 compat with vue-component-type-helpers [#22814](https://github.com/storybooks/storybook/pull/22814) +- Vue3: Fix TS 5.0 compat with vue-component-type-helpers [#22814](https://github.com/storybooks/storybook/pull/22814) #### 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 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) ## 7.1.0-alpha.24 (May 26, 2023) #### Bug Fixes -- Vue3: Fix reactive args updates in decorators [#22717](https://github.com/storybooks/storybook/pull/22717) +- Vue3: Fix reactive args updates in decorators [#22717](https://github.com/storybooks/storybook/pull/22717) #### Build -- Build: Update Nx to latest version [#22694](https://github.com/storybooks/storybook/pull/22694) +- Build: Update Nx to latest version [#22694](https://github.com/storybooks/storybook/pull/22694) ## 7.1.0-alpha.23 (May 24, 2023) #### Bug Fixes -- Core: Fix `managerHead` preset in `main.ts` [#22701](https://github.com/storybooks/storybook/pull/22701) +- Core: Fix `managerHead` preset in `main.ts` [#22701](https://github.com/storybooks/storybook/pull/22701) ## 7.1.0-alpha.22 (May 24, 2023) #### Bug Fixes -- Vite: Fix pnpm support by replacing @storybook/global with `window` [#22709](https://github.com/storybooks/storybook/pull/22709) +- Vite: Fix pnpm support by replacing @storybook/global with `window` [#22709](https://github.com/storybooks/storybook/pull/22709) ## 7.1.0-alpha.21 (May 23, 2023) #### Features -- Webpack: Add option to use swc instead of babel [#22075](https://github.com/storybooks/storybook/pull/22075) +- Webpack: Add option to use swc instead of babel [#22075](https://github.com/storybooks/storybook/pull/22075) #### 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) -- 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) +- 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) +- 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) -- Webpack: Remove the alias for `global` [#22393](https://github.com/storybooks/storybook/pull/22393) +- 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) +- Webpack: Remove the alias for `global` [#22393](https://github.com/storybooks/storybook/pull/22393) #### Maintenance -- 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: 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) #### 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: Fix sandbox generation scripts [#22620](https://github.com/storybooks/storybook/pull/22620) +- 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) +- 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) #### Bug Fixes -- 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) +- 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) #### Maintenance -- CLI: Detach automigrate command from storybook init [#22523](https://github.com/storybooks/storybook/pull/22523) +- CLI: Detach automigrate command from storybook init [#22523](https://github.com/storybooks/storybook/pull/22523) ## 7.1.0-alpha.17 (May 12, 2023) #### Bug Fixes -- 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) +- 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) +- 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) +- 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) +- 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) +- 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) ## 7.1.0-alpha.14 (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) -- 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) +- 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) +- 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) #### 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) +- 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) ## 7.1.0-alpha.13 (May 5, 2023) #### Bug Fixes -- Core: Fix virtual modules excluded for babel-loader [#22331](https://github.com/storybooks/storybook/pull/22331) +- Core: Fix virtual modules excluded for babel-loader [#22331](https://github.com/storybooks/storybook/pull/22331) #### 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) +- 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) +- Add Angular Prerelease sandbox [#22379](https://github.com/storybooks/storybook/pull/22379) ## 7.1.0-alpha.12 (May 3, 2023) #### Bug Fixes -- 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) +- 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) +- 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) +- 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) +- 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) +- 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) +- 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) +- 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) -- 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) +- 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) +- 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) +- 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) +- 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) +- 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) #### Maintenance -- 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) +- 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) +- 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 -- Core: Support custom hosts using window.location server channel URL [#22055](https://github.com/storybooks/storybook/pull/22055) +- Core: Support custom hosts using window.location server channel URL [#22055](https://github.com/storybooks/storybook/pull/22055) #### Bug Fixes -- 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) +- 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) #### 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) +- 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) #### 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) +- 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) +- 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: Improve sandboxes commit message [#22136](https://github.com/storybooks/storybook/pull/22136) ## 7.1.0-alpha.6 (April 18, 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) +- 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) +- 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) +- 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) +- 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) +- Revert "Build: Update dangerfile temporarily to check for patch label" [#22108](https://github.com/storybooks/storybook/pull/22108) ## 7.1.0-alpha.4 (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) +- 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) ## 7.1.0-alpha.3 (April 13, 2023) #### Bug Fixes -- 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) +- 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) ## 7.1.0-alpha.2 (April 12, 2023) #### Features -- UI: Add remount story shortcut [#21401](https://github.com/storybooks/storybook/pull/21401) +- UI: Add remount story shortcut [#21401](https://github.com/storybooks/storybook/pull/21401) #### Bug Fixes -- CLI: Catch errors thrown on sanity check of SB installs [#22039](https://github.com/storybooks/storybook/pull/22039) +- CLI: Catch errors thrown on sanity check of SB installs [#22039](https://github.com/storybooks/storybook/pull/22039) #### Maintenance -- 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) +- 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) +- 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) #### Bug Fixes -- React: Fix default export docgen for React.FC and forwardRef [#22024](https://github.com/storybooks/storybook/pull/22024) -- Viewport: Remove transitions when switching viewports [#21963](https://github.com/storybooks/storybook/pull/21963) -- 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) +- React: Fix default export docgen for React.FC and forwardRef [#22024](https://github.com/storybooks/storybook/pull/22024) +- Viewport: Remove transitions when switching viewports [#21963](https://github.com/storybooks/storybook/pull/21963) +- 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) +- 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) +- 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) -- 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) +- 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) +- 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 -- 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) +- 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) #### Dependency Upgrades -- Update `@emotion/cache` version [#21941](https://github.com/storybooks/storybook/pull/21941) \ No newline at end of file +- Update `@emotion/cache` version [#21941](https://github.com/storybooks/storybook/pull/21941) diff --git a/CONTRIBUTING/RELEASING.md b/CONTRIBUTING/RELEASING.md index 19822e849d74..df105255f951 100644 --- a/CONTRIBUTING/RELEASING.md +++ b/CONTRIBUTING/RELEASING.md @@ -315,6 +315,10 @@ It's possible and valid to push manual changes directly on the release branch wh It's recommended to use the automated process as much as possible to ensure that the information in GitHub is the single source of truth, and that pull requests and changelogs are in sync. +> **Warning** +> If you make manual changes to the changelog, you also need to make those changes in either [`./docs/versions/latest.json`](../docs/versions/latest.json) or [`./docs/versions/next.json`](../docs/versions/next.json). The `"plain"` property should match the changelog entry, **without the heading** and with all new lines replaces with `\n`. +> This is common for custom release notes when releasing majors and minors. + ### 6. Merge When the pull request was frozen, a CI run was triggered on the branch. If it's green, it's time to merge the pull request. If CI is failing for some reason, consult with the rest of the core team. These release pull requests are almost exact copies of `next|main` so CI should only fail if they fail too. @@ -381,7 +385,52 @@ Before you start you should make sure that your working tree is clean and the re ## Canary Releases -Not implemented yet. Still work in progress, stay tuned. +It's possible to release any pull request as a canary release multiple times during development. This is an effective way to try out changes in standalone projects without linking projects together via package managers. + +To create a canary release, a core team member (or anyone else with administrator privileges) must manually trigger the canary release workflow. + +**Before creating a canary release from contributors, the core team member must ensure that the code being released is not malicious.** + +Creating a canary release can either be done via GitHub's UI or the [CLI](https://cli.github.com/): + +### With GitHub UI + +1. Open the workflow UI at https://github.com/storybookjs/storybook/actions/workflows/canary-release-pr.yml +2. On the top right corner, click "Run workflow" +3. For "branch", **always select `next`**, regardless of which branch your pull request is on +4. For the pull request number, input the number for the pull request **without a leading #** + +### With the CLI + +The following command will trigger a workflow run - replace `` with the actual pull request number: + +```bash +gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr= +``` + +When the release succeeds, it will update the "Canary release" section of the pull request with information about the release and how to use it (see example [here](https://github.com/storybookjs/storybook/pull/23508)). If it fails, it will create a comment on the pull request, tagging the triggering actor to let them know that it failed (see example [here](https://github.com/storybookjs/storybook/pull/23508#issuecomment-1642850467)). + +The canary release will have the following version format: `-canary---.0`, e.g., `7.1.1-canary-23508-1689802571-5ec8c1c3.0`. + +- The current version has no actual meaning but softly indicates which version the pull request is based on (e.g., a pull request based on v7.1.0 will get released as a canary version of v7.1.1). +- The timestamp ensures that any subsequent releases are always considered newer. +- The commit hash indicates which exact code has been released. + +> ** Note ** +> All canary releases are released under the same "canary" dist tag. This means you'll technically be able to install it with `npm install @storybook/cli@canary`. However, this doesn't make sense, as releases from subsequent pull requests will overwrite that tag quickly. Therefore you should always install the specific version string, e.g., `npm install @storybook/cli@7.1.1-canary-23508-1689802571-5ec8c1c3.0. + +
+ Isn't there a simpler/smarter way to do this? + +The simple approach would be to release canaries for all pull requests automatically; however, this would be insecure as any contributor with Write privileges to the repository (200+ users) could create a malicious pull request that alters the release script to release a malicious release (e.g., release a patch version that adds a crypto miner). + +To alleviate this, we only allow the "Release" GitHub environment that contains the npm token to be accessible from workflows running on the protected branches (`next`, `main`, etc.). + +You could also be tempted to require approval from admins before running the workflows. However, this would spam the core team with GitHub notifications for workflow runs seeking approval - even when a core team member triggered the workflow. Therefore we are doing it the other way around, requiring contributors and maintainers to ask for a canary release to be created explicitly. + +Instead of triggering the workflow manually, you could also do something smart, like trigger it when there's a specific label on the pull request or when someone writes a specific comment on the pull request. However, this would create a lot of unnecessary workflow runs because there isn't a way to filter workflow runs based on labels or comment content. The only way to achieve this would be to trigger the workflow on every comment/labeling, then cancel it if it didn't contain the expected content, which is inefficient. + +
## Versioning Scenarios diff --git a/MIGRATION.md b/MIGRATION.md index b6f6b6196679..6fa7d0c5d300 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,7 +1,7 @@

Migration

- [From version 7.0.0 to 7.2.0](#from-version-700-to-720) - - [Addon API are more type-strict](#addon-api-are-more-type-strict) + - [Addon API is more type-strict](#addon-api-is-more-type-strict) - [From version 6.5.x to 7.0.0](#from-version-65x-to-700) - [7.0 breaking changes](#70-breaking-changes) - [Dropped support for Node 15 and below](#dropped-support-for-node-15-and-below) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index 612a0d5ff0a5..7f05dab7739c 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/channels": "7.1.0", - "@storybook/client-logger": "7.1.0", - "@storybook/components": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/addon-highlight": "7.2.0-alpha.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/theming": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "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 04b698d8f97d..25160e6afd3d 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/components": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/theming": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "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 26128a713df0..b77f1f57ebb9 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/components": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/theming": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "memoizerific": "^1.11.3", "ts-dedent": "^2.0.0" }, diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index e76a33702e1c..07dc164e1502 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/client-logger": "7.1.0", - "@storybook/components": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/manager-api": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/theming": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/blocks": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "lodash": "^4.17.21", "ts-dedent": "^2.0.0" }, diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index d27003bf434d..cc4d0f454fc3 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/client-logger": "7.1.0", - "@storybook/components": "7.1.0", - "@storybook/csf-plugin": "7.1.0", - "@storybook/csf-tools": "7.1.0", + "@storybook/blocks": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/csf-plugin": "7.2.0-alpha.0", + "@storybook/csf-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", "@storybook/mdx2-csf": "^1.0.0", - "@storybook/node-logger": "7.1.0", - "@storybook/postinstall": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/react-dom-shim": "7.1.0", - "@storybook/theming": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/postinstall": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/react-dom-shim": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "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 bfdc135d190b..2dcbd3ac99c9 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/addon-backgrounds": "7.1.0", - "@storybook/addon-controls": "7.1.0", - "@storybook/addon-docs": "7.1.0", - "@storybook/addon-highlight": "7.1.0", - "@storybook/addon-measure": "7.1.0", - "@storybook/addon-outline": "7.1.0", - "@storybook/addon-toolbars": "7.1.0", - "@storybook/addon-viewport": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/manager-api": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/preview-api": "7.1.0", + "@storybook/addon-actions": "7.2.0-alpha.0", + "@storybook/addon-backgrounds": "7.2.0-alpha.0", + "@storybook/addon-controls": "7.2.0-alpha.0", + "@storybook/addon-docs": "7.2.0-alpha.0", + "@storybook/addon-highlight": "7.2.0-alpha.0", + "@storybook/addon-measure": "7.2.0-alpha.0", + "@storybook/addon-outline": "7.2.0-alpha.0", + "@storybook/addon-toolbars": "7.2.0-alpha.0", + "@storybook/addon-viewport": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", "ts-dedent": "^2.0.0" }, "devDependencies": { - "@storybook/vue": "7.1.0", + "@storybook/vue": "7.2.0-alpha.0", "typescript": "^4.9.3" }, "peerDependencies": { diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index bc607631eec0..b7a724a7bc5c 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", + "version": "7.2.0-alpha.0", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", @@ -51,7 +51,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/node-logger": "7.1.0", + "@storybook/node-logger": "7.2.0-alpha.0", "remark-gfm": "^3.0.1", "ts-dedent": "^2.0.0" }, diff --git a/code/addons/highlight/README.md b/code/addons/highlight/README.md index f6bf3fa293e3..4713f3aae058 100644 --- a/code/addons/highlight/README.md +++ b/code/addons/highlight/README.md @@ -30,7 +30,7 @@ Highlight DOM nodes by emitting the `HIGHLIGHT` event from within a story or an import React, { useEffect } from 'react'; import { useChannel } from '@storybook/preview-api'; import { HIGHLIGHT, RESET_HIGHLIGHT } from '@storybook/addon-highlight'; -import { MyComponent } form './MyComponent'; +import { MyComponent } from './MyComponent'; export default { component: MyComponent }; diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 38b1300a7d80..ae39c332ecd6 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", + "version": "7.2.0-alpha.0", "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", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0" + "@storybook/preview-api": "7.2.0-alpha.0" }, "devDependencies": { "@types/webpack-env": "^1.16.0", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index b3d131ffbb74..7c908a9fa483 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", + "version": "7.2.0-alpha.0", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", @@ -72,17 +72,17 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/components": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/instrumenter": "7.1.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/theming": "7.1.0", - "@storybook/types": "7.1.0", - "jest-mock": "^29.5.0", + "@storybook/instrumenter": "7.2.0-alpha.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", + "jest-mock": "^27.0.6", "polished": "^4.2.2", "ts-dedent": "^2.2.0" }, diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 506d4881525a..ebea2aec3e4d 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/components": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/theming": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", "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 94f818a247df..ddf59e42f7cc 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-events": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/csf": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/router": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/router": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "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 d640f1b8eabe..d2dcccbeec9b 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/components": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "tiny-invariant": "^1.3.1" }, "devDependencies": { diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index 0d8ea3410553..934d14a68c59 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/components": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/code/addons/storyshots-core/package.json b/code/addons/storyshots-core/package.json index d36cf2a0db03..05acd3732b07 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-common": "7.1.0", - "@storybook/core-webpack": "7.1.0", + "@storybook/client-api": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/core-webpack": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@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", - "@storybook/angular": "7.1.0", - "@storybook/react": "7.1.0", - "@storybook/vue": "7.1.0", - "@storybook/vue3": "7.1.0", + "@storybook/addon-docs": "7.2.0-alpha.0", + "@storybook/angular": "7.2.0-alpha.0", + "@storybook/react": "7.2.0-alpha.0", + "@storybook/vue": "7.2.0-alpha.0", + "@storybook/vue3": "7.2.0-alpha.0", "babel-loader": "^9.1.2", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.5", diff --git a/code/addons/storyshots-core/src/frameworks/angular/renderTree.ts b/code/addons/storyshots-core/src/frameworks/angular/renderTree.ts index 9de180774184..3c501c70dcc5 100644 --- a/code/addons/storyshots-core/src/frameworks/angular/renderTree.ts +++ b/code/addons/storyshots-core/src/frameworks/angular/renderTree.ts @@ -2,7 +2,7 @@ import AngularSnapshotSerializer from 'jest-preset-angular/build/serializers/ng- import HTMLCommentSerializer from 'jest-preset-angular/build/serializers/html-comment'; import { TestBed } from '@angular/core/testing'; import { addSerializer } from 'jest-specific-snapshot'; -import { getApplication, storyPropsProvider } from '@storybook/angular/renderer'; +import { getApplication, storyPropsProvider, PropertyExtractor } from '@storybook/angular/renderer'; import { BehaviorSubject } from 'rxjs'; addSerializer(HTMLCommentSerializer); @@ -11,11 +11,14 @@ addSerializer(AngularSnapshotSerializer); function getRenderedTree(story: any) { const currentStory = story.render(); + const analyzedMetadata = new PropertyExtractor(currentStory.moduleMetadata, story.component); + const application = getApplication({ storyFnAngular: currentStory, component: story.component, // TODO : To change with the story Id in v7. Currently keep with static id to avoid changes in snapshots targetSelector: 'storybook-wrapper', + analyzedMetadata, }); TestBed.configureTestingModule({ diff --git a/code/addons/storyshots-puppeteer/package.json b/code/addons/storyshots-puppeteer/package.json index f28ad08e21a5..ff66cfce3ca9 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/types": "7.1.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@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", + "@storybook/addon-storyshots": "7.2.0-alpha.0", "puppeteer": ">=2.0.0" }, "peerDependenciesMeta": { diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 392d06446a5b..f31a3868c351 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/components": "7.1.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/router": "7.1.0", - "@storybook/source-loader": "7.1.0", - "@storybook/theming": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/router": "7.2.0-alpha.0", + "@storybook/source-loader": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", "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 f431300582db..4d5ec481a93b 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/components": "7.1.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/theming": "7.1.0" + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0" }, "devDependencies": { "typescript": "~4.9.3" diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index e1a658fe67c5..8087b555c7c1 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/components": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/theming": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", "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 71a5d5d82456..9c8a237c2758 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/manager": "7.1.0", - "@storybook/node-logger": "7.1.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/manager": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", "@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 d5aa2768e19d..75c91a613c50 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/client-logger": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/csf-plugin": "7.1.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/csf-plugin": "7.2.0-alpha.0", "@storybook/mdx2-csf": "^1.0.0", - "@storybook/node-logger": "7.1.0", - "@storybook/preview": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/preview": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@types/find-cache-dir": "^3.2.1", "browser-assert": "^1.2.1", "es-module-lexer": "^0.9.3", diff --git a/code/builders/builder-vite/src/index.ts b/code/builders/builder-vite/src/index.ts index 614dc87bc561..80b1ac875377 100644 --- a/code/builders/builder-vite/src/index.ts +++ b/code/builders/builder-vite/src/index.ts @@ -25,7 +25,8 @@ export * from './types'; */ export type StorybookViteConfig = StorybookBaseConfig & StorybookConfigVite; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; function iframeMiddleware(options: Options, server: ViteDevServer): RequestHandler { return async (req, res, next) => { @@ -66,7 +67,7 @@ export const start: ViteBuilder['start'] = async ({ }) => { server = await createViteServer(options as Options, devServer); - const previewResolvedDir = wrapForPnP('@storybook/preview'); + const previewResolvedDir = getAbsolutePath('@storybook/preview'); const previewDirOrigin = join(previewResolvedDir, 'dist'); router.use(`/sb-preview`, express.static(previewDirOrigin, { immutable: true, maxAge: '5m' })); @@ -84,7 +85,7 @@ export const start: ViteBuilder['start'] = async ({ export const build: ViteBuilder['build'] = async ({ options }) => { const viteCompilation = viteBuild(options as Options); - const previewResolvedDir = wrapForPnP('@storybook/preview'); + const previewResolvedDir = getAbsolutePath('@storybook/preview'); const previewDirOrigin = join(previewResolvedDir, 'dist'); const previewDirTarget = join(options.outputDir || '', `sb-preview`); diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 4abf9073ca54..551e44d30325 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", + "version": "7.2.0-alpha.0", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -56,22 +56,22 @@ }, "dependencies": { "@babel/core": "^7.22.9", - "@storybook/addons": "7.1.0", - "@storybook/channels": "7.1.0", - "@storybook/client-api": "7.1.0", - "@storybook/client-logger": "7.1.0", - "@storybook/components": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/core-events": "7.1.0", - "@storybook/core-webpack": "7.1.0", + "@storybook/addons": "7.2.0-alpha.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-api": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", + "@storybook/core-webpack": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/preview": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/router": "7.1.0", - "@storybook/store": "7.1.0", - "@storybook/theming": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/preview": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/router": "7.2.0-alpha.0", + "@storybook/store": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", "@swc/core": "^1.3.49", "@types/node": "^16.0.0", "@types/semver": "^7.3.4", diff --git a/code/builders/builder-webpack5/src/index.ts b/code/builders/builder-webpack5/src/index.ts index 35f1fea6c81f..0106cfea091d 100644 --- a/code/builders/builder-webpack5/src/index.ts +++ b/code/builders/builder-webpack5/src/index.ts @@ -20,7 +20,8 @@ export const printDuration = (startTime: [number, number]) => .replace(' s', ' seconds') .replace(' m', ' minutes'); -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; let compilation: ReturnType | undefined; let reject: (reason?: any) => void; @@ -175,7 +176,7 @@ const starter: StarterFunction = async function* starterGeneratorFn({ compilation = webpackDevMiddleware(compiler, middlewareOptions); - const previewResolvedDir = wrapForPnP('@storybook/preview'); + const previewResolvedDir = getAbsolutePath('@storybook/preview'); const previewDirOrigin = join(previewResolvedDir, 'dist'); router.use(`/sb-preview`, express.static(previewDirOrigin, { immutable: true, maxAge: '5m' })); @@ -288,7 +289,7 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime, }); }); - const previewResolvedDir = wrapForPnP('@storybook/preview'); + const previewResolvedDir = getAbsolutePath('@storybook/preview'); const previewDirOrigin = join(previewResolvedDir, 'dist'); const previewDirTarget = join(options.outputDir || '', `sb-preview`); diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 44ec4e92c8e5..d2f6ec6affbc 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -27,7 +27,8 @@ import { dedent } from 'ts-dedent'; import type { BuilderOptions, TypescriptOptions } from '../types'; import { createBabelLoader, createSWCLoader } from './loaders'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; const storybookPaths: Record = { ...[ @@ -40,12 +41,12 @@ const storybookPaths: Record = { ].reduce( (acc, sbPackage) => ({ ...acc, - [`@storybook/${sbPackage}`]: wrapForPnP(`@storybook/${sbPackage}`), + [`@storybook/${sbPackage}`]: getAbsolutePath(`@storybook/${sbPackage}`), }), {} ), // deprecated, remove in 8.0 - [`@storybook/api`]: wrapForPnP(`@storybook/manager-api`), + [`@storybook/api`]: getAbsolutePath(`@storybook/manager-api`), }; export default async ( diff --git a/code/deprecated/addons/package.json b/code/deprecated/addons/package.json index 01bf737806e0..3f77fc1241b8 100644 --- a/code/deprecated/addons/package.json +++ b/code/deprecated/addons/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addons", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook addons store", "keywords": [ "storybook" @@ -44,9 +44,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0" + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0" }, "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 0b389b0fd790..81b4cd75b81e 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", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" @@ -43,8 +43,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0", - "@storybook/client-logger": "7.1.0" + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0" }, "devDependencies": { "typescript": "~4.9.3" diff --git a/code/deprecated/channel-websocket/package.json b/code/deprecated/channel-websocket/package.json index 2eec52fe94ac..7be6d9f5ddda 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", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" @@ -43,8 +43,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/channels": "7.1.0", - "@storybook/client-logger": "7.1.0" + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0" }, "devDependencies": { "typescript": "~4.9.3" diff --git a/code/deprecated/client-api/package.json b/code/deprecated/client-api/package.json index 946d814f2d5a..be33d61c1e57 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", + "version": "7.2.0-alpha.0", "description": "Storybook Client API", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/preview-api": "7.1.0" + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0" }, "publishConfig": { "access": "public" diff --git a/code/deprecated/core-client/package.json b/code/deprecated/core-client/package.json index 64a7614f8099..1ed082dff5fb 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", + "version": "7.2.0-alpha.0", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -35,8 +35,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/preview-api": "7.1.0" + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0" }, "publishConfig": { "access": "public" diff --git a/code/deprecated/manager-api-shim/package.json b/code/deprecated/manager-api-shim/package.json index 45e71ba4e257..f175fe31352f 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", + "version": "7.2.0-alpha.0", "description": "Storybook Manager API (facade)", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/manager-api": "7.1.0" + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/manager-api": "7.2.0-alpha.0" }, "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 056f7782a0fa..cb63f7acc82e 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", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/preview-api": "7.1.0" + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0" }, "publishConfig": { "access": "public" diff --git a/code/deprecated/store/package.json b/code/deprecated/store/package.json index 7ceca5494b6b..e05ea79ebcaa 100644 --- a/code/deprecated/store/package.json +++ b/code/deprecated/store/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/store", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/preview-api": "7.1.0" + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0" }, "publishConfig": { "access": "public" diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 2fbfa9d325d7..bd971a6973e3 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "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", - "@storybook/cli": "7.1.0", - "@storybook/client-logger": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/core-events": "7.1.0", - "@storybook/core-server": "7.1.0", - "@storybook/core-webpack": "7.1.0", - "@storybook/docs-tools": "7.1.0", + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/cli": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", + "@storybook/core-server": "7.2.0-alpha.0", + "@storybook/core-webpack": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/telemetry": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/telemetry": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@types/node": "^16.0.0", "@types/react": "^16.14.34", "@types/react-dom": "^16.9.14", diff --git a/code/frameworks/angular/src/client/angular-beta/StorybookModule.ts b/code/frameworks/angular/src/client/angular-beta/StorybookModule.ts index f4c01547b734..3535a85c6988 100644 --- a/code/frameworks/angular/src/client/angular-beta/StorybookModule.ts +++ b/code/frameworks/angular/src/client/angular-beta/StorybookModule.ts @@ -12,7 +12,7 @@ export const getApplication = ({ storyFnAngular: StoryFnAngularReturnType; component?: any; targetSelector: string; - analyzedMetadata?: PropertyExtractor; + analyzedMetadata: PropertyExtractor; }) => { const { props, styles, moduleMetadata = {} } = storyFnAngular; let { template } = storyFnAngular; diff --git a/code/frameworks/angular/src/client/angular-beta/StorybookWrapperComponent.ts b/code/frameworks/angular/src/client/angular-beta/StorybookWrapperComponent.ts index ea4a8767556a..aa5bd589d123 100644 --- a/code/frameworks/angular/src/client/angular-beta/StorybookWrapperComponent.ts +++ b/code/frameworks/angular/src/client/angular-beta/StorybookWrapperComponent.ts @@ -52,7 +52,7 @@ export const createStorybookWrapperComponent = ({ styles: string[]; moduleMetadata: NgModuleMetadata; initialProps?: ICollection; - analyzedMetadata?: PropertyExtractor; + analyzedMetadata: PropertyExtractor; }): Type => { // In ivy, a '' selector is not allowed, therefore we need to just set it to anything if // storyComponent was not provided. diff --git a/code/frameworks/angular/src/preset.ts b/code/frameworks/angular/src/preset.ts index 6e359b452138..ce5796d0c222 100644 --- a/code/frameworks/angular/src/preset.ts +++ b/code/frameworks/angular/src/preset.ts @@ -3,7 +3,8 @@ import { PresetProperty } from '@storybook/types'; import { StorybookConfig } from './types'; import { StandaloneOptions } from './builders/utils/standalone-options'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const addons: PresetProperty<'addons', StorybookConfig> = [ require.resolve('./server/framework-preset-angular-cli'), @@ -30,7 +31,7 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti return { ...config, builder: { - name: wrapForPnP('@storybook/builder-webpack5') as '@storybook/builder-webpack5', + name: getAbsolutePath('@storybook/builder-webpack5'), options: typeof framework === 'string' ? {} : framework.options.builder || {}, }, }; diff --git a/code/frameworks/angular/src/renderer.ts b/code/frameworks/angular/src/renderer.ts index 11d729059f2f..a88691381c84 100644 --- a/code/frameworks/angular/src/renderer.ts +++ b/code/frameworks/angular/src/renderer.ts @@ -3,3 +3,4 @@ export { computesTemplateSourceFromComponent } from './client/angular-beta/Compu export { rendererFactory } from './client/render'; export { AbstractRenderer } from './client/angular-beta/AbstractRenderer'; export { getApplication } from './client/angular-beta/StorybookModule'; +export { PropertyExtractor } from './client/angular-beta/utils/PropertyExtractor'; diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 6d46043864bf..564cedeeb356 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-common": "7.1.0", - "@storybook/docs-tools": "7.1.0", + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/code/frameworks/ember/src/preset.ts b/code/frameworks/ember/src/preset.ts index bedd1cdb3ebd..6524132780e5 100644 --- a/code/frameworks/ember/src/preset.ts +++ b/code/frameworks/ember/src/preset.ts @@ -2,7 +2,8 @@ import { dirname, join } from 'path'; import type { PresetProperty } from '@storybook/types'; import type { StorybookConfig } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const addons: PresetProperty<'addons', StorybookConfig> = [ require.resolve('./server/framework-preset-babel-ember'), @@ -15,7 +16,7 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti return { ...config, builder: { - name: wrapForPnP('@storybook/builder-webpack5') as '@storybook/builder-webpack5', + name: getAbsolutePath('@storybook/builder-webpack5'), options: typeof framework === 'string' ? {} : framework.options.builder || {}, }, }; diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index 4ffc4d335fc7..14f92733f68a 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", + "version": "7.2.0-alpha.0", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -47,13 +47,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.1.0", - "@storybook/builder-vite": "7.1.0", - "@storybook/client-api": "7.1.0", - "@storybook/core-server": "7.1.0", - "@storybook/html": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/preview-web": "7.1.0", + "@storybook/addons": "7.2.0-alpha.0", + "@storybook/builder-vite": "7.2.0-alpha.0", + "@storybook/client-api": "7.2.0-alpha.0", + "@storybook/core-server": "7.2.0-alpha.0", + "@storybook/html": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/preview-web": "7.2.0-alpha.0", "magic-string": "^0.30.0" }, "devDependencies": { diff --git a/code/frameworks/html-vite/src/preset.ts b/code/frameworks/html-vite/src/preset.ts index 814831785a39..4ae871b6e589 100644 --- a/code/frameworks/html-vite/src/preset.ts +++ b/code/frameworks/html-vite/src/preset.ts @@ -1,7 +1,12 @@ import type { PresetProperty } from '@storybook/types'; +import { dirname, join } from 'path'; import type { StorybookConfig } from './types'; +function getAbsolutePath(value: I): I { + return dirname(require.resolve(join(value, 'package.json'))) as any; +} + export const core: PresetProperty<'core', StorybookConfig> = { - builder: '@storybook/builder-vite', - renderer: '@storybook/html', + builder: getAbsolutePath('@storybook/builder-vite'), + renderer: getAbsolutePath('@storybook/html'), }; diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index d971e2c4e966..bed5ce012b43 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-common": "7.1.0", + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/html": "7.1.0", - "@storybook/preset-html-webpack": "7.1.0", + "@storybook/html": "7.2.0-alpha.0", + "@storybook/preset-html-webpack": "7.2.0-alpha.0", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/html-webpack5/src/preset.ts b/code/frameworks/html-webpack5/src/preset.ts index 57093fdba5d3..969bee1b1e63 100644 --- a/code/frameworks/html-webpack5/src/preset.ts +++ b/code/frameworks/html-webpack5/src/preset.ts @@ -2,10 +2,11 @@ import { dirname, join } from 'path'; import type { PresetProperty } from '@storybook/types'; import type { StorybookConfig } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const addons: PresetProperty<'addons', StorybookConfig> = [ - wrapForPnP('@storybook/preset-html-webpack'), + getAbsolutePath('@storybook/preset-html-webpack'), ]; export const core: PresetProperty<'core', StorybookConfig> = async (config, options) => { @@ -14,9 +15,9 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti return { ...config, builder: { - name: wrapForPnP('@storybook/builder-webpack5') as '@storybook/builder-webpack5', + name: getAbsolutePath('@storybook/builder-webpack5'), options: typeof framework === 'string' ? {} : framework.options.builder || {}, }, - renderer: wrapForPnP('@storybook/html'), + renderer: getAbsolutePath('@storybook/html'), }; }; diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index 2561afafbf32..33158d630de3 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook for Next.js", "keywords": [ "storybook", @@ -71,13 +71,13 @@ "@babel/preset-react": "^7.22.5", "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", - "@storybook/addon-actions": "7.1.0", - "@storybook/builder-webpack5": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/preset-react-webpack": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/react": "7.1.0", + "@storybook/addon-actions": "7.2.0-alpha.0", + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/preset-react-webpack": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/react": "7.2.0-alpha.0", "@types/node": "^16.0.0", "css-loader": "^6.7.3", "find-up": "^5.0.0", diff --git a/code/frameworks/nextjs/src/font/webpack/loader/local/get-font-face-declarations.ts b/code/frameworks/nextjs/src/font/webpack/loader/local/get-font-face-declarations.ts index 2e0ddeefc53c..20e1df8deeb2 100644 --- a/code/frameworks/nextjs/src/font/webpack/loader/local/get-font-face-declarations.ts +++ b/code/frameworks/nextjs/src/font/webpack/loader/local/get-font-face-declarations.ts @@ -29,7 +29,7 @@ export async function getFontFaceDeclarations(options: LoaderOptions, rootContex return `@font-face { font-family: ${id}; - src: url(${localFontPath}); + src: url(.${localFontPath}); }`; } return localFontSrc @@ -38,7 +38,7 @@ export async function getFontFaceDeclarations(options: LoaderOptions, rootContex return `@font-face { font-family: ${id}; - src: url(${localFontPath}); + src: url(.${localFontPath}); ${font.weight ? `font-weight: ${font.weight};` : ''} ${font.style ? `font-style: ${font.style};` : ''} }`; diff --git a/code/frameworks/nextjs/template/stories/Image.stories.jsx b/code/frameworks/nextjs/template/stories/Image.stories.jsx index e11cc228b0d6..46ef28363830 100644 --- a/code/frameworks/nextjs/template/stories/Image.stories.jsx +++ b/code/frameworks/nextjs/template/stories/Image.stories.jsx @@ -61,6 +61,10 @@ export const Lazy = { width: 50, height: 50, }, + parameters: { + // ignoring in Chromatic to avoid inconsistent snapshots since the image is sometimes not loaded in time + chromatic: { disableSnapshot: true }, + }, decorators: [ (Story) => ( <> @@ -69,30 +73,13 @@ export const Lazy = { ), ], - loaders: [ - async () => { - // make sure we start at the top to test the scrolling into view functionality every time the story renders - // eslint-disable-next-line no-undef - window.scrollTo({ top: 0 }); - await new Promise((res) => { - setTimeout(res, 16); - }); - return {}; - }, - ], - play: async ({ canvasElement, step }) => { - await step('scroll image into view', () => { - canvasElement.scrollIntoView(false); - }); - await step('wait for images to load', async () => { - await waitFor(waitForImagesToLoad); - }); - }, }; export const Eager = { ...Lazy, parameters: { + // ignoring in Chromatic to avoid inconsistent snapshots since the image is sometimes not loaded in time + chromatic: { disableSnapshot: true }, nextjs: { image: { loading: 'eager', @@ -100,19 +87,3 @@ export const Eager = { }, }, }; - -async function waitForImagesToLoad() { - // eslint-disable-next-line no-undef - const images = Array.from(document.getElementsByTagName('img')); - - await Promise.all( - images.map((image) => { - if (image.complete) { - return Promise.resolve(); - } - return new Promise((resolve) => { - image.addEventListener('load', resolve); - }); - }) - ); -} diff --git a/code/frameworks/nextjs/template/stories_nextjs-default-js/ImageLegacy.stories.jsx b/code/frameworks/nextjs/template/stories_nextjs-default-js/ImageLegacy.stories.jsx index d3c1a2accbb2..b8a781499bd1 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-default-js/ImageLegacy.stories.jsx +++ b/code/frameworks/nextjs/template/stories_nextjs-default-js/ImageLegacy.stories.jsx @@ -28,4 +28,9 @@ export const BlurredAbsolutePlaceholder = { 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABP5JREFUWEeNlwtz2zgMhEGKsv/k9XFp82xe11763yOJVGcXC4m2czM3GYa0E2s/LACSTi+vv1czM/7CvPpqxY/ejPeS3khmFiPHOiVLHKaZi4ux4j18GpMlS6cALupEQBCKQM4BdnGzjIcJgs//QBxAPQAem55f3yL4PWJIdyCyhlMfPdYZot0cwj3Ayg/5JwHA13paen7pADphxr/n5VI8JQsHCCGQ3gVGLLsxQ3h/LYSn5383B05rwNOws3Z576LOTOduvwfrOd5FtVat4akx0uPTrw8BNuUz23vLsY7hmg7i4ipqM2saiAdruNuirh4ff0bNdb3Qy3vkvfAQwrkHoDxTTZtDCOKrC1bMEkdnsQh/PLyetOGHkXeRAgQAQ84efQcBdUhvFofoulpdm9WGGTA+AJEe7l+i37a2c371tCFKs5zzJjxQNBMi1im7OCudP2aNghJuzZaGdSMEZjpwf/t0UgNdg9DOyLGLnY0BUHlzwVtNDkgEQhBeKkb1tUDgQrq7frwAiIJi5BKAeIFgHk5mOpPzvgltOfcoK0Rrs7lWHwsgqtXarK3N0u23h5Ne8+3Cqxn5RYSMfHCAMgDAx4CBWlA9RAGw0GA/ol0gvFB4WjAvBAFUa83SzdUdAbYMqp28uHpxCRefxwAYhksAFBlthxCiXig+zT4TYqkC+Hq7OdAfJv8lPpZiZShWBBIuRP+jspDb2lwcDkzz7OLzbO/zvAHAoXTz5eYMQL0t2yHAiCFcfPY1QDwNFylA5bPoFpsV9fsEiMl8dhcc4PP1CYD3drYcBYdIKQrx0cbRxd2JHSDcQ297/vvoZ5smRC+AyV2AQ+nm03evge08Tyy4jGqXzWWEoIvTgXHU38pWiNgH4ixB/ukAcy/xycXfp4kwdAAAt399W+OCgMjxILQacxvRQ3gEwHgKUIr/rz53CuDFNyP/Eob4+/vEWkBq6AAA/HIi62n/Lk67Q7wDYQ0UpQB7hc54T4E6gACLTYxeAwB0YKZL6U4ATEGIBwCs7qPfQJCCHkCnoK50noJKcXcAojsEAJZZKXhgCoziGKxqWV8IMNp4kP2aC+oB0TMFvhGxDQHQfIPhDrilwKOm/YCZASAHfgBABQjr3f7CyAkA0cPB03AQULRhKd4xAIjzHymo2Gp7gN0FAMAVOoA2fPz03a9ssh/RM7Iz8QKIzYF9HyB0XEZ1xJ4DzNoDOAfAslhDDTyjDfv8A2AcBeCiu/jBHQEgxnYW6Kp6BlCVAkQM8VnieF2Xyr0ivXy+XvsCzKOihwNHCCryw8HrQXVB8dgFeRfAVQiXjMbIIgXINQYB2H7Kf5wF/2Ar7h0AgKKGuAP4zOjhzlkLbpcRXKRZhNUjxG6HIQDOjN47gCn4+fWW3xVS9urPESEEwwHMo9IhAGxS2ISiA1iEnQOoA4hXRAwItp7WzL9Ow18ESJaw/ar4NgeOR49cAHCAnaH8swBhv+6CBGjeBSxEOUAI7HyKHkD4O9xKb3/feQouAI4uLBciHRRHmgbfA7h/xFc9AngNBADthvii1sMOiPwDAFeyt6s7FSFS4PmnA1v0vQvqDqQKAAPE/weAUuEgsj8c+H11Twdw/AKANXA82EDr5cJBEEzB3oI4Mb0AdR3nNw8vQnegWuvqAABwJFJEBwDgNdA7IOs3gL0LhuJdwBY8c4BfNnDdVgooHiOqn/b7JoSW/QODjTHXhU7hMQAAAABJRU5ErkJggg==', placeholder: 'blur', }, + parameters: { + // ignoring in Chromatic to avoid inconsistent snapshots + // given that the switch from blur to image is quite fast + chromatic: { disableSnapshot: true }, + }, }; diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index 84a4b395ab8d..62e56aee3e7f 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/preact": "7.1.0" + "@storybook/builder-vite": "7.2.0-alpha.0", + "@storybook/preact": "7.2.0-alpha.0" }, "devDependencies": { "@types/node": "^16.0.0", diff --git a/code/frameworks/preact-vite/src/preset.ts b/code/frameworks/preact-vite/src/preset.ts index aecc5b9a904a..2d4e18d77e90 100644 --- a/code/frameworks/preact-vite/src/preset.ts +++ b/code/frameworks/preact-vite/src/preset.ts @@ -1,11 +1,15 @@ import { hasVitePlugins } from '@storybook/builder-vite'; import type { PresetProperty } from '@storybook/types'; import preact from '@preact/preset-vite'; +import { dirname, join } from 'path'; import type { StorybookConfig } from './types'; +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; + export const core: PresetProperty<'core', StorybookConfig> = { - builder: '@storybook/builder-vite', - renderer: '@storybook/preact', + builder: getAbsolutePath('@storybook/builder-vite'), + renderer: getAbsolutePath('@storybook/preact'), }; export const viteFinal: StorybookConfig['viteFinal'] = async (config) => { diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index e994102da998..64917cfe7e80 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-common": "7.1.0", - "@storybook/preact": "7.1.0", - "@storybook/preset-preact-webpack": "7.1.0", + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/preact": "7.2.0-alpha.0", + "@storybook/preset-preact-webpack": "7.2.0-alpha.0", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/preact-webpack5/src/preset.ts b/code/frameworks/preact-webpack5/src/preset.ts index 5808ca929166..e815e7884248 100644 --- a/code/frameworks/preact-webpack5/src/preset.ts +++ b/code/frameworks/preact-webpack5/src/preset.ts @@ -2,10 +2,11 @@ import { dirname, join } from 'path'; import type { PresetProperty } from '@storybook/types'; import type { StorybookConfig } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const addons: PresetProperty<'addons', StorybookConfig> = [ - wrapForPnP('@storybook/preset-preact-webpack'), + getAbsolutePath('@storybook/preset-preact-webpack'), ]; export const core: PresetProperty<'core', StorybookConfig> = async (config, options) => { @@ -14,9 +15,9 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti return { ...config, builder: { - name: wrapForPnP('@storybook/builder-webpack5') as '@storybook/builder-webpack5', + name: getAbsolutePath('@storybook/builder-webpack5'), options: typeof framework === 'string' ? {} : framework.options.builder || {}, }, - renderer: wrapForPnP('@storybook/preact'), + renderer: getAbsolutePath('@storybook/preact'), }; }; diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 2eecf2e3881c..05c050851efc 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/react": "7.1.0", + "@storybook/builder-vite": "7.2.0-alpha.0", + "@storybook/react": "7.2.0-alpha.0", "@vitejs/plugin-react": "^3.0.1", "ast-types": "^0.14.2", "magic-string": "^0.30.0", diff --git a/code/frameworks/react-vite/src/preset.ts b/code/frameworks/react-vite/src/preset.ts index 26a577af7900..207f60988ebc 100644 --- a/code/frameworks/react-vite/src/preset.ts +++ b/code/frameworks/react-vite/src/preset.ts @@ -4,11 +4,12 @@ import { hasVitePlugins } from '@storybook/builder-vite'; import { dirname, join } from 'path'; import type { StorybookConfig } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const core: PresetProperty<'core', StorybookConfig> = { - builder: wrapForPnP('@storybook/builder-vite') as '@storybook/builder-vite', - renderer: wrapForPnP('@storybook/react'), + builder: getAbsolutePath('@storybook/builder-vite'), + renderer: getAbsolutePath('@storybook/react'), }; export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets }) => { diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index 0547c32c072b..944407d7b1cb 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/preset-react-webpack": "7.1.0", - "@storybook/react": "7.1.0", + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/preset-react-webpack": "7.2.0-alpha.0", + "@storybook/react": "7.2.0-alpha.0", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/react-webpack5/src/preset.ts b/code/frameworks/react-webpack5/src/preset.ts index b03832ae272f..873d214c597c 100644 --- a/code/frameworks/react-webpack5/src/preset.ts +++ b/code/frameworks/react-webpack5/src/preset.ts @@ -4,10 +4,11 @@ import { dirname, join } from 'path'; import type { PresetProperty, Options } from '@storybook/types'; import type { FrameworkOptions, StorybookConfig } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const addons: PresetProperty<'addons', StorybookConfig> = [ - wrapForPnP('@storybook/preset-react-webpack'), + getAbsolutePath('@storybook/preset-react-webpack'), ]; const defaultFrameworkOptions: FrameworkOptions = { @@ -28,7 +29,7 @@ export const frameworkOptions = async ( } if (typeof config === 'undefined') { return { - name: wrapForPnP('@storybook/react-webpack5') as '@storybook/react-webpack5', + name: getAbsolutePath('@storybook/react-webpack5'), options: defaultFrameworkOptions, }; } @@ -48,10 +49,10 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti return { ...config, builder: { - name: wrapForPnP('@storybook/builder-webpack5') as '@storybook/builder-webpack5', + name: getAbsolutePath('@storybook/builder-webpack5'), options: typeof framework === 'string' ? {} : framework.options.builder || {}, }, - renderer: wrapForPnP('@storybook/react'), + renderer: getAbsolutePath('@storybook/react'), }; }; @@ -60,7 +61,7 @@ export const webpack: StorybookConfig['webpack'] = async (config) => { config.resolve.alias = { ...config.resolve?.alias, - '@storybook/react': wrapForPnP('@storybook/react'), + '@storybook/react': getAbsolutePath('@storybook/react'), }; return config; }; diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index e2bb618fcf4c..a20b5505786c 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-common": "7.1.0", - "@storybook/preset-server-webpack": "7.1.0", - "@storybook/server": "7.1.0", + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/preset-server-webpack": "7.2.0-alpha.0", + "@storybook/server": "7.2.0-alpha.0", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/server-webpack5/src/preset.ts b/code/frameworks/server-webpack5/src/preset.ts index 852c2a9c9409..0dd7d63814f0 100644 --- a/code/frameworks/server-webpack5/src/preset.ts +++ b/code/frameworks/server-webpack5/src/preset.ts @@ -2,10 +2,11 @@ import { dirname, join } from 'path'; import type { PresetProperty } from '@storybook/types'; import type { StorybookConfig } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const addons: PresetProperty<'addons', StorybookConfig> = [ - wrapForPnP('@storybook/preset-server-webpack'), + getAbsolutePath('@storybook/preset-server-webpack'), ]; export const core: PresetProperty<'core', StorybookConfig> = async (config, options) => { @@ -14,9 +15,9 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti return { ...config, builder: { - name: wrapForPnP('@storybook/builder-webpack5') as '@storybook/builder-webpack5', + name: getAbsolutePath('@storybook/builder-webpack5'), options: typeof framework === 'string' ? {} : framework.options.builder || {}, }, - renderer: wrapForPnP('@storybook/server'), + renderer: getAbsolutePath('@storybook/server'), }; }; diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 9c6e9871c7d2..981a9585227a 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/node-logger": "7.1.0", - "@storybook/svelte": "7.1.0", + "@storybook/builder-vite": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/svelte": "7.2.0-alpha.0", "@sveltejs/vite-plugin-svelte": "^2.4.2", "magic-string": "^0.30.0", "sveltedoc-parser": "^4.2.1", diff --git a/code/frameworks/svelte-vite/src/preset.ts b/code/frameworks/svelte-vite/src/preset.ts index bf7a7f742511..220812cf7c5a 100644 --- a/code/frameworks/svelte-vite/src/preset.ts +++ b/code/frameworks/svelte-vite/src/preset.ts @@ -1,12 +1,16 @@ import { hasVitePlugins } from '@storybook/builder-vite'; import type { PresetProperty } from '@storybook/types'; +import { dirname, join } from 'path'; import type { StorybookConfig } from './types'; import { handleSvelteKit } from './utils'; import { svelteDocgen } from './plugins/svelte-docgen'; +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; + export const core: PresetProperty<'core', StorybookConfig> = { - builder: '@storybook/builder-vite', - renderer: '@storybook/svelte', + builder: getAbsolutePath('@storybook/builder-vite'), + renderer: getAbsolutePath('@storybook/svelte'), }; export const viteFinal: NonNullable = async (config, options) => { diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 4b46ec53c038..2166c8b4647d 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-common": "7.1.0", - "@storybook/preset-svelte-webpack": "7.1.0", - "@storybook/svelte": "7.1.0" + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/preset-svelte-webpack": "7.2.0-alpha.0", + "@storybook/svelte": "7.2.0-alpha.0" }, "devDependencies": { "svelte": "^4.0.0", diff --git a/code/frameworks/svelte-webpack5/src/preset.ts b/code/frameworks/svelte-webpack5/src/preset.ts index 7486869f3b61..176bce0c0bc5 100644 --- a/code/frameworks/svelte-webpack5/src/preset.ts +++ b/code/frameworks/svelte-webpack5/src/preset.ts @@ -2,10 +2,11 @@ import { dirname, join } from 'path'; import type { PresetProperty } from '@storybook/types'; import type { StorybookConfig } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const addons: PresetProperty<'addons', StorybookConfig> = [ - wrapForPnP('@storybook/preset-svelte-webpack'), + getAbsolutePath('@storybook/preset-svelte-webpack'), ]; export const core: PresetProperty<'core', StorybookConfig> = async (config, options) => { @@ -14,9 +15,9 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti return { ...config, builder: { - name: wrapForPnP('@storybook/builder-webpack5') as '@storybook/builder-webpack5', + name: getAbsolutePath('@storybook/builder-webpack5'), options: typeof framework === 'string' ? {} : framework.options.builder || {}, }, - renderer: wrapForPnP('@storybook/svelte'), + renderer: getAbsolutePath('@storybook/svelte'), }; }; diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 981736171b17..ea58cd14fa10 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook for SvelteKit", "keywords": [ "storybook", @@ -50,9 +50,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.1.0", - "@storybook/svelte": "7.1.0", - "@storybook/svelte-vite": "7.1.0" + "@storybook/builder-vite": "7.2.0-alpha.0", + "@storybook/svelte": "7.2.0-alpha.0", + "@storybook/svelte-vite": "7.2.0-alpha.0" }, "devDependencies": { "@types/node": "^16.0.0", diff --git a/code/frameworks/sveltekit/src/preset.ts b/code/frameworks/sveltekit/src/preset.ts index 6c98e344eff4..e92e45079f63 100644 --- a/code/frameworks/sveltekit/src/preset.ts +++ b/code/frameworks/sveltekit/src/preset.ts @@ -2,12 +2,16 @@ import { viteFinal as svelteViteFinal } from '@storybook/svelte-vite/preset'; import type { PresetProperty } from '@storybook/types'; import { withoutVitePlugins } from '@storybook/builder-vite'; +import { dirname, join } from 'path'; import { configOverrides } from './plugins/config-overrides'; import { type StorybookConfig } from './types'; +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; + export const core: PresetProperty<'core', StorybookConfig> = { - builder: '@storybook/builder-vite', - renderer: '@storybook/svelte', + builder: getAbsolutePath('@storybook/builder-vite'), + renderer: getAbsolutePath('@storybook/svelte'), }; export const viteFinal: NonNullable = async (config, options) => { diff --git a/code/frameworks/vue-vite/package.json b/code/frameworks/vue-vite/package.json index 5c8159b0d32f..94e78f2af0c2 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-common": "7.1.0", - "@storybook/core-server": "7.1.0", - "@storybook/vue": "7.1.0", + "@storybook/builder-vite": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/core-server": "7.2.0-alpha.0", + "@storybook/vue": "7.2.0-alpha.0", "magic-string": "^0.30.0", "vue-docgen-api": "^4.40.0" }, diff --git a/code/frameworks/vue-vite/src/preset.ts b/code/frameworks/vue-vite/src/preset.ts index f047581dd797..bf5b7d45ea5b 100644 --- a/code/frameworks/vue-vite/src/preset.ts +++ b/code/frameworks/vue-vite/src/preset.ts @@ -1,21 +1,22 @@ -import path from 'path'; +import { dirname, join } from 'path'; import type { PresetProperty } from '@storybook/types'; import { mergeConfig } from 'vite'; import type { StorybookConfig } from './types'; import { vueDocgen } from './plugins/vue-docgen'; +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; + export const core: PresetProperty<'core', StorybookConfig> = async (config, options) => { const framework = await options.presets.apply('framework'); return { ...config, builder: { - name: path.dirname( - require.resolve(path.join('@storybook/builder-vite', 'package.json')) - ) as '@storybook/builder-vite', + name: getAbsolutePath('@storybook/builder-vite'), options: typeof framework === 'string' ? {} : framework?.options.builder || {}, }, - renderer: '@storybook/vue', + renderer: getAbsolutePath('@storybook/vue'), }; }; diff --git a/code/frameworks/vue-webpack5/package.json b/code/frameworks/vue-webpack5/package.json index c34a564037dc..1b49341c1694 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-common": "7.1.0", - "@storybook/preset-vue-webpack": "7.1.0", - "@storybook/vue": "7.1.0", + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/preset-vue-webpack": "7.2.0-alpha.0", + "@storybook/vue": "7.2.0-alpha.0", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/vue-webpack5/src/preset.ts b/code/frameworks/vue-webpack5/src/preset.ts index 911ea437f8bd..661053fddefb 100644 --- a/code/frameworks/vue-webpack5/src/preset.ts +++ b/code/frameworks/vue-webpack5/src/preset.ts @@ -2,10 +2,11 @@ import { dirname, join } from 'path'; import type { PresetProperty } from '@storybook/types'; import type { StorybookConfig } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const addons: PresetProperty<'addons', StorybookConfig> = [ - wrapForPnP('@storybook/preset-vue-webpack'), + getAbsolutePath('@storybook/preset-vue-webpack'), ]; export const core: PresetProperty<'core', StorybookConfig> = async (config, options) => { @@ -14,10 +15,10 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti return { ...config, builder: { - name: wrapForPnP('@storybook/builder-webpack5') as '@storybook/builder-webpack5', + name: getAbsolutePath('@storybook/builder-webpack5'), options: typeof framework === 'string' ? {} : framework.options.builder || {}, }, - renderer: wrapForPnP('@storybook/vue'), + renderer: getAbsolutePath('@storybook/vue'), }; }; diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 269facaf2121..966fab84f62c 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-server": "7.1.0", - "@storybook/vue3": "7.1.0", + "@storybook/builder-vite": "7.2.0-alpha.0", + "@storybook/core-server": "7.2.0-alpha.0", + "@storybook/vue3": "7.2.0-alpha.0", "@vitejs/plugin-vue": "^4.0.0", "magic-string": "^0.30.0", "vue-docgen-api": "^4.40.0" diff --git a/code/frameworks/vue3-vite/src/preset.ts b/code/frameworks/vue3-vite/src/preset.ts index 7af3f31056e7..b987f0381c0b 100644 --- a/code/frameworks/vue3-vite/src/preset.ts +++ b/code/frameworks/vue3-vite/src/preset.ts @@ -1,19 +1,23 @@ import { hasVitePlugins } from '@storybook/builder-vite'; import type { PresetProperty } from '@storybook/types'; import { mergeConfig, type PluginOption } from 'vite'; +import { dirname, join } from 'path'; import type { StorybookConfig } from './types'; import { vueDocgen } from './plugins/vue-docgen'; +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; + export const core: PresetProperty<'core', StorybookConfig> = { - builder: '@storybook/builder-vite', - renderer: '@storybook/vue3', + builder: getAbsolutePath('@storybook/builder-vite'), + renderer: getAbsolutePath('@storybook/vue3'), }; export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets }) => { const plugins: PluginOption[] = []; // Add vue plugin if not present - if (!(await hasVitePlugins(config.plugins, ['vite:vue']))) { + if (!(config.plugins && (await hasVitePlugins(config.plugins, ['vite:vue'])))) { const { default: vue } = await import('@vitejs/plugin-vue'); plugins.push(vue()); } diff --git a/code/frameworks/vue3-vite/tsconfig.json b/code/frameworks/vue3-vite/tsconfig.json index 5a2a397f2eb4..bbd5d9a38f99 100644 --- a/code/frameworks/vue3-vite/tsconfig.json +++ b/code/frameworks/vue3-vite/tsconfig.json @@ -5,7 +5,7 @@ "types": ["node"], "skipLibCheck": true, "resolveJsonModule": true, - "strict": false + "strict": true }, "include": ["src/**/*"] } diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index cbf532add8ff..4b2cc469b8a2 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-common": "7.1.0", - "@storybook/preset-vue3-webpack": "7.1.0", - "@storybook/vue3": "7.1.0", + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/preset-vue3-webpack": "7.2.0-alpha.0", + "@storybook/vue3": "7.2.0-alpha.0", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/vue3-webpack5/src/preset.ts b/code/frameworks/vue3-webpack5/src/preset.ts index 1ace38e86044..0dd1e931ddd4 100644 --- a/code/frameworks/vue3-webpack5/src/preset.ts +++ b/code/frameworks/vue3-webpack5/src/preset.ts @@ -2,10 +2,11 @@ import { dirname, join } from 'path'; import type { PresetProperty } from '@storybook/types'; import type { StorybookConfig } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const addons: PresetProperty<'addons', StorybookConfig> = [ - wrapForPnP('@storybook/preset-vue3-webpack'), + getAbsolutePath('@storybook/preset-vue3-webpack'), ]; export const core: PresetProperty<'core', StorybookConfig> = async (config, options) => { @@ -14,10 +15,10 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti return { ...config, builder: { - name: wrapForPnP('@storybook/builder-webpack5') as '@storybook/builder-webpack5', + name: getAbsolutePath('@storybook/builder-webpack5'), options: typeof framework === 'string' ? {} : framework.options.builder || {}, }, - renderer: wrapForPnP('@storybook/vue3'), + renderer: getAbsolutePath('@storybook/vue3'), }; }; diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 2f1b85942297..750a25a0872a 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-server": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/web-components": "7.1.0", + "@storybook/builder-vite": "7.2.0-alpha.0", + "@storybook/core-server": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/web-components": "7.2.0-alpha.0", "magic-string": "^0.30.0" }, "devDependencies": { diff --git a/code/frameworks/web-components-vite/src/preset.ts b/code/frameworks/web-components-vite/src/preset.ts index cd53f7d76283..a3bb7c4d66a2 100644 --- a/code/frameworks/web-components-vite/src/preset.ts +++ b/code/frameworks/web-components-vite/src/preset.ts @@ -1,7 +1,11 @@ import type { PresetProperty } from '@storybook/types'; +import { dirname, join } from 'path'; import type { StorybookConfig } from './types'; +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; + export const core: PresetProperty<'core', StorybookConfig> = { - builder: '@storybook/builder-vite', - renderer: '@storybook/web-components', + builder: getAbsolutePath('@storybook/builder-vite'), + renderer: getAbsolutePath('@storybook/web-components'), }; diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index f92bbf8d382e..50fc89094971 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", + "version": "7.2.0-alpha.0", "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.9", - "@storybook/builder-webpack5": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/preset-web-components-webpack": "7.1.0", - "@storybook/web-components": "7.1.0", + "@storybook/builder-webpack5": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/preset-web-components-webpack": "7.2.0-alpha.0", + "@storybook/web-components": "7.2.0-alpha.0", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/frameworks/web-components-webpack5/src/preset.ts b/code/frameworks/web-components-webpack5/src/preset.ts index 930e7d3f906b..101539931f27 100644 --- a/code/frameworks/web-components-webpack5/src/preset.ts +++ b/code/frameworks/web-components-webpack5/src/preset.ts @@ -2,10 +2,11 @@ import { dirname, join } from 'path'; import type { PresetProperty } from '@storybook/types'; import type { StorybookConfig } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const addons: PresetProperty<'addons', StorybookConfig> = [ - wrapForPnP('@storybook/preset-web-components-webpack'), + getAbsolutePath('@storybook/preset-web-components-webpack'), ]; export const core: PresetProperty<'core', StorybookConfig> = async (config, options) => { @@ -14,9 +15,9 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti return { ...config, builder: { - name: wrapForPnP('@storybook/builder-webpack5') as '@storybook/builder-webpack5', + name: getAbsolutePath('@storybook/builder-webpack5'), options: typeof framework === 'string' ? {} : framework.options.builder || {}, }, - renderer: wrapForPnP('@storybook/web-components'), + renderer: getAbsolutePath('@storybook/web-components'), }; }; diff --git a/code/jest.config.base.js b/code/jest.config.base.js index 77a03b8b082b..9fdc75f588a9 100644 --- a/code/jest.config.base.js +++ b/code/jest.config.base.js @@ -87,6 +87,8 @@ module.exports = { '/prebuilt/', '/generators/', '/template/', + // The export format used in the following file is not supported by jest. + '/code/frameworks/nextjs/src/next-image-loader-stub.ts', '/__mocks__ /', '/__mockdata__/', '/__mocks-ng-workspace__/', diff --git a/code/lib/channels/package.json b/code/lib/channels/package.json index 3dd3368cbd38..ecf72f5967ac 100644 --- a/code/lib/channels/package.json +++ b/code/lib/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" @@ -68,9 +68,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0", - "@storybook/client-logger": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@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 d24181b7f9ca..7371a70fdf96 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", + "version": "7.2.0-alpha.0", "description": "Storybook CLI", "keywords": [ "storybook" @@ -21,7 +21,7 @@ "license": "MIT", "bin": "./index.js", "dependencies": { - "@storybook/cli": "7.1.0" + "@storybook/cli": "7.2.0-alpha.0" }, "publishConfig": { "access": "public" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index 2685922f5814..246ff3840054 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", + "version": "7.2.0-alpha.0", "description": "Storybook CLI", "keywords": [ "storybook" @@ -24,7 +24,7 @@ "storybook": "./index.js" }, "dependencies": { - "@storybook/cli": "7.1.0" + "@storybook/cli": "7.2.0-alpha.0" }, "publishConfig": { "access": "public" diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index 5789a2a3b7a9..45efe474e41e 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook's CLI - easiest method of adding storybook to your projects", "keywords": [ "cli", @@ -56,14 +56,15 @@ "dependencies": { "@babel/core": "^7.22.9", "@babel/preset-env": "^7.22.9", + "@babel/types": "^7.22.5", "@ndelangen/get-tarball": "^3.0.7", - "@storybook/codemod": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/core-server": "7.1.0", - "@storybook/csf-tools": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/telemetry": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/codemod": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/core-server": "7.2.0-alpha.0", + "@storybook/csf-tools": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/telemetry": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@types/semver": "^7.3.4", "@yarnpkg/fslib": "2.10.3", "@yarnpkg/libzip": "2.3.0", @@ -88,14 +89,14 @@ "puppeteer-core": "^2.1.1", "read-pkg-up": "^7.0.1", "semver": "^7.3.7", - "simple-update-notifier": "^1.0.0", + "simple-update-notifier": "^2.0.0", "strip-json-comments": "^3.0.1", "tempy": "^1.0.1", "ts-dedent": "^2.0.0", "util-deprecate": "^1.0.2" }, "devDependencies": { - "@storybook/client-api": "7.1.0", + "@storybook/client-api": "7.2.0-alpha.0", "@types/cross-spawn": "^6.0.2", "@types/prompts": "^2.0.9", "@types/puppeteer-core": "^2.1.0", diff --git a/code/lib/cli/src/automigrate/fixes/__test__/main-config-with-wrappers.js b/code/lib/cli/src/automigrate/fixes/__test__/main-config-with-wrappers.js new file mode 100644 index 000000000000..7e6280732df5 --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/__test__/main-config-with-wrappers.js @@ -0,0 +1,21 @@ +import path from 'path'; + +const wrapForPnp = (packageName) => + path.dirname(require.resolve(path.join(packageName, 'package.json'))); + +const config = { + stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], + addons: [ + wrapForPnp('@storybook/addon-links'), + wrapForPnp('@storybook/addon-essentials'), + wrapForPnp('@storybook/addon-interactions'), + ], + framework: { + name: wrapForPnp('@storybook/angular'), + options: {}, + }, + docs: { + autodocs: 'tag', + }, +}; +export default config; diff --git a/code/lib/cli/src/automigrate/fixes/__test__/main-config-without-wrappers.js b/code/lib/cli/src/automigrate/fixes/__test__/main-config-without-wrappers.js new file mode 100644 index 000000000000..0979ef60ff60 --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/__test__/main-config-without-wrappers.js @@ -0,0 +1,16 @@ +const config = { + stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], + addons: [ + '@storybook/addon-links', + '@storybook/addon-essentials', + '@storybook/addon-interactions', + ], + framework: { + name: '@storybook/angular', + options: {}, + }, + docs: { + autodocs: 'tag', + }, +}; +export default config; diff --git a/code/lib/cli/src/automigrate/fixes/index.ts b/code/lib/cli/src/automigrate/fixes/index.ts index 4de0e7d63689..2becfe0b156a 100644 --- a/code/lib/cli/src/automigrate/fixes/index.ts +++ b/code/lib/cli/src/automigrate/fixes/index.ts @@ -18,6 +18,7 @@ import { missingBabelRc } from './missing-babelrc'; import { angularBuilders } from './angular-builders'; import { incompatibleAddons } from './incompatible-addons'; import { angularBuildersMultiproject } from './angular-builders-multiproject'; +import { wrapRequire } from './wrap-require'; export * from '../types'; @@ -40,6 +41,7 @@ export const allFixes: Fix[] = [ missingBabelRc, angularBuildersMultiproject, angularBuilders, + wrapRequire, ]; export const initFixes: Fix[] = [missingBabelRc, eslintPlugin]; diff --git a/code/lib/cli/src/automigrate/fixes/wrap-require-utils.ts b/code/lib/cli/src/automigrate/fixes/wrap-require-utils.ts new file mode 100644 index 000000000000..c1a33b3119f6 --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/wrap-require-utils.ts @@ -0,0 +1,187 @@ +/* eslint-disable no-param-reassign */ +import * as t from '@babel/types'; +import type { ConfigFile } from '@storybook/csf-tools'; + +const defaultRequireWrapperName = 'getAbsolutePath'; + +/** + * Checks if the following node declarations exists in the main config file. + * @example + * const = () => {}; + * function () {} + */ +function doesVariableOrFunctionDeclarationExist(node: t.Node, name: string) { + return ( + (t.isVariableDeclaration(node) && + node.declarations.length === 1 && + t.isVariableDeclarator(node.declarations[0]) && + t.isIdentifier(node.declarations[0].id) && + node.declarations[0].id?.name === name) || + (t.isFunctionDeclaration(node) && t.isIdentifier(node.id) && node.id.name === name) + ); +} + +/** + * Wrap a value with require wrapper. + * @example + * // Before + * { framework: 'react' } + * + * // After + * { framework: wrapForPnp('react') } + */ +function getReferenceToRequireWrapper(config: ConfigFile, value: string) { + return t.callExpression( + t.identifier(getRequireWrapperName(config) ?? defaultRequireWrapperName), + [t.stringLiteral(value)] + ); +} + +/** + * Returns the name of the require wrapper function if it exists in the main config file. + * @returns Name of the require wrapper function. + */ +export function getRequireWrapperName(config: ConfigFile) { + const declarationName = config.getBodyDeclarations().flatMap((node) => + // eslint-disable-next-line no-nested-ternary + doesVariableOrFunctionDeclarationExist(node, 'wrapForPnp') + ? ['wrapForPnp'] + : doesVariableOrFunctionDeclarationExist(node, defaultRequireWrapperName) + ? [defaultRequireWrapperName] + : [] + ); + + if (declarationName.length) { + return declarationName[0]; + } + + return null; +} + +/** + * Check if the node needs to be wrapped with require wrapper. + */ +export function isRequireWrapperNecessary( + node: t.Node, + cb: (node: t.StringLiteral | t.ObjectProperty | t.ArrayExpression) => void = () => {} +) { + if (t.isStringLiteral(node)) { + // value will be converted from StringLiteral to CallExpression. + cb(node); + return true; + } + + if (t.isObjectExpression(node)) { + const nameProperty = node.properties.find( + (property) => + t.isObjectProperty(property) && t.isIdentifier(property.key) && property.key.name === 'name' + ) as t.ObjectProperty; + + if (nameProperty && t.isStringLiteral(nameProperty.value)) { + cb(nameProperty); + return true; + } + } + + if ( + t.isArrayExpression(node) && + node.elements.some((element) => isRequireWrapperNecessary(element)) + ) { + cb(node); + return true; + } + + return false; +} + +/** + * Get all fields that need to be wrapped with require wrapper. + * @returns Array of fields that need to be wrapped with require wrapper. + */ +export function getFieldsForRequireWrapper(config: ConfigFile) { + const frameworkNode = config.getFieldNode(['framework']); + const builderNode = config.getFieldNode(['core', 'builder']); + const rendererNode = config.getFieldNode(['core', 'renderer']); + const addons = config.getFieldNode(['addons']); + + const fieldsWithRequireWrapper = [ + ...(frameworkNode ? [frameworkNode] : []), + ...(builderNode ? [builderNode] : []), + ...(rendererNode ? [rendererNode] : []), + ...(addons && t.isArrayExpression(addons) ? [addons] : []), + ]; + + return fieldsWithRequireWrapper; +} + +/** + * Returns AST for the following function + * @example + * function getAbsolutePath(value) { + * return dirname(require.resolve(join(value, 'package.json'))) + * } + */ +export function getRequireWrapperAsCallExpression( + isConfigTypescript: boolean +): t.FunctionDeclaration { + const functionDeclaration = { + ...t.functionDeclaration( + t.identifier(defaultRequireWrapperName), + [ + { + ...t.identifier('value'), + ...(isConfigTypescript + ? { typeAnnotation: t.tsTypeAnnotation(t.tSStringKeyword()) } + : {}), + }, + ], + t.blockStatement([ + t.returnStatement( + t.callExpression(t.identifier('dirname'), [ + t.callExpression(t.memberExpression(t.identifier('require'), t.identifier('resolve')), [ + t.callExpression(t.identifier('join'), [ + t.identifier('value'), + t.stringLiteral('package.json'), + ]), + ]), + ]) + ), + ]) + ), + ...(isConfigTypescript ? { returnType: t.tSTypeAnnotation(t.tsAnyKeyword()) } : {}), + }; + + t.addComment( + functionDeclaration, + 'leading', + '*\n * This function is used to resolve the absolute path of a package.\n * It is needed in projects that use Yarn PnP or are set up within a monorepo.\n' + ); + + return functionDeclaration; +} + +export function wrapValueWithRequireWrapper(config: ConfigFile, node: t.Node) { + isRequireWrapperNecessary(node, (n) => { + if (t.isStringLiteral(n)) { + const wrapperNode = getReferenceToRequireWrapper(config, n.value); + Object.keys(n).forEach((k: keyof typeof n) => { + delete n[k]; + }); + Object.keys(wrapperNode).forEach((k: keyof typeof wrapperNode) => { + (n as any)[k] = wrapperNode[k]; + }); + } + + if (t.isObjectProperty(n) && t.isStringLiteral(n.value)) { + n.value = getReferenceToRequireWrapper(config, n.value.value) as any; + } + + if (t.isArrayExpression(n)) { + n.elements.forEach((element, index, elements) => { + if (t.isStringLiteral(element)) { + elements[index] = getReferenceToRequireWrapper(config, element.value); + } + }); + } + }); +} diff --git a/code/lib/cli/src/automigrate/fixes/wrap-require.test.ts b/code/lib/cli/src/automigrate/fixes/wrap-require.test.ts new file mode 100644 index 000000000000..e040eb6e29f7 --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/wrap-require.test.ts @@ -0,0 +1,77 @@ +import { wrapRequire } from './wrap-require'; +import * as detect from '../../detect'; + +jest.mock('../../detect', () => ({ + ...jest.requireActual('../../detect'), + detectPnp: jest.fn(), +})); + +describe('wrapRequire', () => { + describe('check', () => { + it('should return null if not in a monorepo and pnp is not enabled', async () => { + (detect.detectPnp as any as jest.SpyInstance).mockResolvedValue(false); + + const check = wrapRequire.check({ + packageManager: { + isStorybookInMonorepo: () => false, + }, + storybookVersion: '7.0.0', + mainConfigPath: require.resolve('./__test__/main-config-without-wrappers.js'), + } as any); + + await expect(check).resolves.toBeNull(); + }); + + it('should return the configuration object if in a pnp environment', async () => { + (detect.detectPnp as any as jest.SpyInstance).mockResolvedValue(true); + + const check = wrapRequire.check({ + packageManager: { + isStorybookInMonorepo: () => false, + }, + storybookVersion: '7.0.0', + mainConfigPath: require.resolve('./__test__/main-config-without-wrappers.js'), + } as any); + + await expect(check).resolves.toEqual({ + isConfigTypescript: false, + isPnp: true, + isStorybookInMonorepo: false, + storybookVersion: '7.0.0', + }); + }); + + it('should return the configuration object if in a monorepo environment', async () => { + (detect.detectPnp as any as jest.SpyInstance).mockResolvedValue(false); + + const check = wrapRequire.check({ + packageManager: { + isStorybookInMonorepo: () => true, + }, + storybookVersion: '7.0.0', + mainConfigPath: require.resolve('./__test__/main-config-without-wrappers.js'), + } as any); + + await expect(check).resolves.toEqual({ + isConfigTypescript: false, + isPnp: false, + isStorybookInMonorepo: true, + storybookVersion: '7.0.0', + }); + }); + + it('should return null, if all fields have the require wrapper', async () => { + (detect.detectPnp as any as jest.SpyInstance).mockResolvedValue(true); + + const check = wrapRequire.check({ + packageManager: { + isStorybookInMonorepo: () => true, + }, + storybookVersion: '7.0.0', + mainConfigPath: require.resolve('./__test__/main-config-with-wrappers.js'), + } as any); + + await expect(check).resolves.toBeNull(); + }); + }); +}); diff --git a/code/lib/cli/src/automigrate/fixes/wrap-require.ts b/code/lib/cli/src/automigrate/fixes/wrap-require.ts new file mode 100644 index 000000000000..5cbe883a4948 --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/wrap-require.ts @@ -0,0 +1,77 @@ +import chalk from 'chalk'; +import { dedent } from 'ts-dedent'; +import { readConfig } from '@storybook/csf-tools'; +import type { Fix } from '../types'; +import { detectPnp } from '../../detect'; +import { updateMainConfig } from '../helpers/mainConfigFile'; +import { + getFieldsForRequireWrapper, + getRequireWrapperAsCallExpression, + getRequireWrapperName, + isRequireWrapperNecessary, + wrapValueWithRequireWrapper, +} from './wrap-require-utils'; + +interface WrapRequireRunOptions { + storybookVersion: string; + isStorybookInMonorepo: boolean; + isPnp: boolean; + isConfigTypescript: boolean; +} + +export const wrapRequire: Fix = { + id: 'wrap-require', + + async check({ packageManager, storybookVersion, mainConfigPath }) { + const isStorybookInMonorepo = await packageManager.isStorybookInMonorepo(); + const isPnp = await detectPnp(); + + const config = await readConfig(mainConfigPath); + + if (!isStorybookInMonorepo && !isPnp) { + return null; + } + + if (!getFieldsForRequireWrapper(config).some((node) => isRequireWrapperNecessary(node))) { + return null; + } + + const isConfigTypescript = mainConfigPath.endsWith('.ts') || mainConfigPath.endsWith('.tsx'); + + return { storybookVersion, isStorybookInMonorepo, isPnp, isConfigTypescript }; + }, + + prompt({ storybookVersion, isStorybookInMonorepo }) { + const sbFormatted = chalk.cyan(`Storybook ${storybookVersion}`); + + return dedent`We have detected that you're using ${sbFormatted} in a ${ + isStorybookInMonorepo ? 'monorepo' : 'PnP' + } project. + For Storybook to work correctly, some fields in your main config must be updated. We can do this for you automatically. + + More info: https://storybook.js.org/docs/react/faq#how-do-i-fix-module-resolution-in-special-environments`; + }, + + async run({ dryRun, mainConfigPath, result }) { + return new Promise((resolve, reject) => { + updateMainConfig({ dryRun, mainConfigPath }, (mainConfig) => { + try { + getFieldsForRequireWrapper(mainConfig).forEach((node) => { + wrapValueWithRequireWrapper(mainConfig, node); + }); + + if (getRequireWrapperName(mainConfig) === null) { + mainConfig.setImport(['dirname', 'join'], 'path'); + mainConfig.setBodyDeclaration( + getRequireWrapperAsCallExpression(result.isConfigTypescript) + ); + } + + resolve(); + } catch (e) { + reject(e); + } + }); + }); + }, +}; diff --git a/code/lib/cli/src/automigrate/helpers/mainConfigFile.ts b/code/lib/cli/src/automigrate/helpers/mainConfigFile.ts index d1ccbff10d32..b5325df31ac2 100644 --- a/code/lib/cli/src/automigrate/helpers/mainConfigFile.ts +++ b/code/lib/cli/src/automigrate/helpers/mainConfigFile.ts @@ -133,7 +133,7 @@ export type GetStorybookData = typeof getStorybookData; */ export const updateMainConfig = async ( { mainConfigPath, dryRun }: { mainConfigPath: string; dryRun: boolean }, - callback: (main: ConfigFile) => Promise + callback: (main: ConfigFile) => Promise | void ) => { try { const main = await readConfig(mainConfigPath); diff --git a/code/lib/cli/src/generators/baseGenerator.ts b/code/lib/cli/src/generators/baseGenerator.ts index 03c667e9dac2..4ac1cd2f8f6f 100644 --- a/code/lib/cli/src/generators/baseGenerator.ts +++ b/code/lib/cli/src/generators/baseGenerator.ts @@ -17,7 +17,6 @@ import { extractEslintInfo, suggestESLintPlugin, } from '../automigrate/helpers/eslintPlugin'; -import { HandledError } from '../HandledError'; const logger = console; @@ -99,14 +98,15 @@ const getRendererPackage = (framework: string, renderer: string) => { return `@storybook/${renderer}`; }; -const wrapForPnp = (packageName: string) => - `%%path.dirname(require.resolve(path.join('${packageName}', 'package.json')))%%`; +const applyRequireWrapper = (packageName: string) => `%%getAbsolutePath('${packageName}')%%`; const getFrameworkDetails = ( renderer: SupportedRenderers, builder: Builder, pnp: boolean, - framework?: SupportedFrameworks + language: SupportedLanguage, + framework?: SupportedFrameworks, + shouldApplyRequireWrapperOnPackageNames?: boolean ): { type: 'framework' | 'renderer'; packages: string[]; @@ -117,13 +117,19 @@ const getFrameworkDetails = ( } => { const frameworkPackage = getFrameworkPackage(framework, renderer, builder); - const frameworkPackagePath = pnp ? wrapForPnp(frameworkPackage) : frameworkPackage; + const frameworkPackagePath = shouldApplyRequireWrapperOnPackageNames + ? applyRequireWrapper(frameworkPackage) + : frameworkPackage; const rendererPackage = getRendererPackage(framework, renderer); - const rendererPackagePath = pnp ? wrapForPnp(rendererPackage) : rendererPackage; + const rendererPackagePath = shouldApplyRequireWrapperOnPackageNames + ? applyRequireWrapper(rendererPackage) + : rendererPackage; const builderPackage = getBuilderDetails(builder); - const builderPackagePath = pnp ? wrapForPnp(builderPackage) : builderPackage; + const builderPackagePath = shouldApplyRequireWrapperOnPackageNames + ? applyRequireWrapper(builderPackage) + : builderPackage; const isExternalFramework = !!getExternalFramework(frameworkPackage); const isKnownFramework = @@ -178,30 +184,8 @@ export async function baseGenerator( options: FrameworkOptions = defaultOptions, framework?: SupportedFrameworks ) { - // This is added so that we can handle the scenario where the user presses Ctrl+C and report a canceled event. - // Given that there are subprocesses running as part of this function, we need to handle the signal ourselves otherwise it might run into race conditions. - // TODO: This should be revisited once we have a better way to handle this. - let isNodeProcessExiting = false; - const setNodeProcessExiting = () => { - isNodeProcessExiting = true; - }; - process.on('SIGINT', setNodeProcessExiting); - - const stopIfExiting = async (callback: () => Promise) => { - if (isNodeProcessExiting) { - throw new HandledError('Canceled by the user'); - } - - try { - return await callback(); - } catch (error) { - if (isNodeProcessExiting) { - throw new HandledError('Canceled by the user'); - } - - throw error; - } - }; + const isStorybookInMonorepository = packageManager.isStorybookInMonorepo(); + const shouldApplyRequireWrapperOnPackageNames = isStorybookInMonorepository || pnp; const { extraAddons: extraAddonPackages, @@ -226,7 +210,14 @@ export async function baseGenerator( rendererId, framework: frameworkInclude, builder: builderInclude, - } = getFrameworkDetails(renderer, builder, pnp, framework); + } = getFrameworkDetails( + renderer, + builder, + pnp, + language, + framework, + shouldApplyRequireWrapperOnPackageNames + ); // added to main.js const addons = [ @@ -291,9 +282,7 @@ export async function baseGenerator( indent: 2, text: `Getting the correct version of ${packages.length} packages`, }).start(); - const versionedPackages = await stopIfExiting(async () => - packageManager.getVersionedPackages(packages) - ); + const versionedPackages = await packageManager.getVersionedPackages(packages); versionedPackagesSpinner.succeed(); const depsToInstall = [...versionedPackages]; @@ -352,20 +341,42 @@ export async function baseGenerator( indent: 2, text: 'Installing Storybook dependencies', }).start(); - await stopIfExiting(async () => - packageManager.addDependencies({ ...npmOptions, packageJson }, depsToInstall) - ); + await packageManager.addDependencies({ ...npmOptions, packageJson }, depsToInstall); addDependenciesSpinner.succeed(); } await fse.ensureDir(`./${storybookConfigFolder}`); if (addMainFile) { + const prefixes = shouldApplyRequireWrapperOnPackageNames + ? [ + 'import { join, dirname } from "path"', + language === SupportedLanguage.JAVASCRIPT + ? dedent`/** + * This function is used to resolve the absolute path of a package. + * It is needed in projects that use Yarn PnP or are set up within a monorepo. + */ + function getAbsolutePath(value) { + return dirname(require.resolve(join(value, 'package.json'))) + }` + : dedent`/** + * This function is used to resolve the absolute path of a package. + * It is needed in projects that use Yarn PnP or are set up within a monorepo. + */ + function getAbsolutePath(value: string): any { + return dirname(require.resolve(join(value, 'package.json'))) + }`, + ] + : []; + await configureMain({ framework: { name: frameworkInclude, options: options.framework || {} }, + prefixes, storybookConfigFolder, docs: { autodocs: 'tag' }, - addons: pnp ? addons.map(wrapForPnp) : addons, + addons: shouldApplyRequireWrapperOnPackageNames + ? addons.map((addon) => applyRequireWrapper(addon)) + : addons, extensions, language, ...(staticDir ? { staticDirs: [path.join('..', staticDir)] } : null), @@ -380,27 +391,26 @@ export async function baseGenerator( }); } - await configurePreview({ frameworkPreviewParts, storybookConfigFolder, language, rendererId }); + await configurePreview({ + frameworkPreviewParts, + storybookConfigFolder, + language, + rendererId, + }); if (addScripts) { - await stopIfExiting(async () => - packageManager.addStorybookCommandInScripts({ - port: 6006, - }) - ); + await packageManager.addStorybookCommandInScripts({ + port: 6006, + }); } if (addComponents) { const templateLocation = hasFrameworkTemplates(framework) ? framework : rendererId; - await stopIfExiting(async () => - copyTemplateFiles({ - renderer: templateLocation, - packageManager, - language, - destination: componentsDestinationPath, - }) - ); + await copyTemplateFiles({ + renderer: templateLocation, + packageManager, + language, + destination: componentsDestinationPath, + }); } - - process.off('SIGINT', setNodeProcessExiting); } diff --git a/code/lib/cli/src/generators/configure.test.ts b/code/lib/cli/src/generators/configure.test.ts index 78a2ebb6eb3f..c79eea9a253c 100644 --- a/code/lib/cli/src/generators/configure.test.ts +++ b/code/lib/cli/src/generators/configure.test.ts @@ -14,6 +14,7 @@ describe('configureMain', () => { await configureMain({ language: SupportedLanguage.JAVASCRIPT, addons: [], + prefixes: [], storybookConfigFolder: '.storybook', framework: { name: '@storybook/react-vite', @@ -42,6 +43,7 @@ describe('configureMain', () => { await configureMain({ language: SupportedLanguage.TYPESCRIPT_4_9, addons: [], + prefixes: [], storybookConfigFolder: '.storybook', framework: { name: '@storybook/react-vite', @@ -54,6 +56,7 @@ describe('configureMain', () => { expect(mainConfigPath).toEqual('./.storybook/main.ts'); expect(mainConfigContent).toMatchInlineSnapshot(` "import type { StorybookConfig } from '@storybook/react-vite'; + const config: StorybookConfig = { stories: ['../stories/**/*.mdx', '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'], addons: [], @@ -69,6 +72,7 @@ describe('configureMain', () => { test('should handle resolved paths in pnp', async () => { await configureMain({ language: SupportedLanguage.JAVASCRIPT, + prefixes: [], addons: [ "%%path.dirname(require.resolve(path.join('@storybook/addon-links', 'package.json')))%%", "%%path.dirname(require.resolve(path.join('@storybook/addon-essentials', 'package.json')))%%", diff --git a/code/lib/cli/src/generators/configure.ts b/code/lib/cli/src/generators/configure.ts index 569c8cbc52f3..6001a17b6024 100644 --- a/code/lib/cli/src/generators/configure.ts +++ b/code/lib/cli/src/generators/configure.ts @@ -9,6 +9,7 @@ interface ConfigureMainOptions { staticDirs?: string[]; storybookConfigFolder: string; language: SupportedLanguage; + prefixes: string[]; /** * Extra values for main.js * @@ -54,6 +55,7 @@ export async function configureMain({ extensions = ['js', 'jsx', 'mjs', 'ts', 'tsx'], storybookConfigFolder, language, + prefixes = [], ...custom }: ConfigureMainOptions) { const srcPath = path.resolve(storybookConfigFolder, '../src'); @@ -67,7 +69,7 @@ export async function configureMain({ const isTypescript = language === SupportedLanguage.TYPESCRIPT_4_9 || language === SupportedLanguage.TYPESCRIPT_3_8; - let mainConfigTemplate = dedent`<>const config<> = <>; + let mainConfigTemplate = dedent`<><>const config<> = <>; export default config;`; const frameworkPackage = sanitizeFramework(custom.framework?.name); @@ -82,6 +84,7 @@ export async function configureMain({ .replace(/%%['"]/g, ''); const imports = []; + const finalPrefixes = [...prefixes]; if (custom.framework?.name.includes('path.dirname(')) { imports.push(`import path from 'path';`); @@ -90,11 +93,12 @@ export async function configureMain({ if (isTypescript) { imports.push(`import type { StorybookConfig } from '${frameworkPackage}';`); } else { - imports.push(`/** @type { import('${frameworkPackage}').StorybookConfig } */`); + finalPrefixes.push(`/** @type { import('${frameworkPackage}').StorybookConfig } */`); } const mainJsContents = mainConfigTemplate - .replace('<>', `${imports.join('\n\n')}\n`) + .replace('<>', `${imports.join('\n\n')}\n\n`) + .replace('<>', finalPrefixes.length > 0 ? `${finalPrefixes.join('\n\n')}\n` : '') .replace('<>', isTypescript ? ': StorybookConfig' : '') .replace('<>', mainContents); diff --git a/code/lib/cli/src/initiate.ts b/code/lib/cli/src/initiate.ts index 7922004d6d66..0b2a75a4a488 100644 --- a/code/lib/cli/src/initiate.ts +++ b/code/lib/cli/src/initiate.ts @@ -239,7 +239,18 @@ const projectTypeInquirer = async ( process.exit(0); }; -async function doInitiate(options: CommandOptions, pkg: PackageJson): Promise { +async function doInitiate( + options: CommandOptions, + pkg: PackageJson +): Promise< + | { + shouldRunDev: true; + projectType: ProjectType; + packageManager: JsPackageManager; + storybookCommand: string; + } + | { shouldRunDev: false } +> { let { packageManager: pkgMgr } = options; if (options.useNpm) { useNpmWarning(); @@ -317,7 +328,7 @@ async function doInitiate(options: CommandOptions, pkg: PackageJson): Promise { - await withTelemetry( + const initiateResult = await withTelemetry( 'init', { cliOptions: options, @@ -407,4 +381,43 @@ export async function initiate(options: CommandOptions, pkg: PackageJson): Promi }, () => doInitiate(options, pkg) ); + + if (initiateResult.shouldRunDev) { + const { projectType, packageManager, storybookCommand } = initiateResult; + logger.log('\nRunning Storybook'); + + try { + const isReactWebProject = + projectType === ProjectType.REACT_SCRIPTS || + projectType === ProjectType.REACT || + projectType === ProjectType.WEBPACK_REACT || + projectType === ProjectType.REACT_PROJECT || + projectType === ProjectType.NEXTJS; + + const flags = []; + + // npm needs extra -- to pass flags to the command + if (packageManager.type === 'npm') { + flags.push('--'); + } + + if (isReactWebProject) { + flags.push('--initial-path=/onboarding'); + } + + flags.push('--quiet'); + + // instead of calling 'dev' automatically, we spawn a subprocess so that it gets + // executed directly in the user's project directory. This avoid potential issues + // with packages running in npxs' node_modules + packageManager.runPackageCommandSync( + storybookCommand.replace(/^yarn /, ''), + flags, + undefined, + 'inherit' + ); + } catch (e) { + // Do nothing here, as the command above will spawn a `storybook dev` process which does the error handling already. Else, the error will get bubbled up and sent to crash reports twice + } + } } diff --git a/code/lib/cli/src/js-package-manager/JsPackageManager.ts b/code/lib/cli/src/js-package-manager/JsPackageManager.ts index aea7bf07f17f..1cb3d93ba8c7 100644 --- a/code/lib/cli/src/js-package-manager/JsPackageManager.ts +++ b/code/lib/cli/src/js-package-manager/JsPackageManager.ts @@ -6,7 +6,7 @@ import path from 'path'; import fs from 'fs'; import dedent from 'ts-dedent'; -import { readFile, writeFile } from 'fs-extra'; +import { readFile, readFileSync, writeFile } from 'fs-extra'; import { commandLog } from '../helpers'; import type { PackageJson, PackageJsonWithDepsAndDevDeps } from './PackageJson'; import storybookPackagesVersions from '../versions'; @@ -76,6 +76,51 @@ export abstract class JsPackageManager { this.cwd = options?.cwd || process.cwd(); } + /** Detect whether Storybook gets initialized in a monorepository/workspace environment + * The cwd doesn't have to be the root of the monorepo, it can be a subdirectory + * @returns true, if Storybook is initialized inside a monorepository/workspace + */ + public isStorybookInMonorepo() { + let cwd = process.cwd(); + + // eslint-disable-next-line no-constant-condition + while (true) { + try { + const turboJsonPath = `${cwd}/turbo.json`; + const rushJsonPath = `${cwd}/rush.json`; + + if (fs.existsSync(turboJsonPath) || fs.existsSync(rushJsonPath)) { + return true; + } + + const packageJsonPath = require.resolve(`${cwd}/package.json`); + + // read packagejson with readFileSync + const packageJsonFile = readFileSync(packageJsonPath, 'utf8'); + const packageJson = JSON.parse(packageJsonFile) as PackageJsonWithDepsAndDevDeps; + + if (packageJson.workspaces) { + return true; + } + } catch (err) { + // Package.json not found or invalid in current directory + } + + // Move up to the parent directory + const parentDir = path.dirname(cwd); + + // Check if we have reached the root of the filesystem + if (parentDir === cwd) { + break; + } + + // Update cwd to the parent directory + cwd = parentDir; + } + + return false; + } + /** * Install dependencies listed in `package.json` */ @@ -451,6 +496,7 @@ export abstract class JsPackageManager { stdio: stdio ?? 'pipe', encoding: 'utf-8', shell: true, + cleanup: true, env, ...execaOptions, }); @@ -484,6 +530,7 @@ export abstract class JsPackageManager { stdio: stdio ?? 'pipe', encoding: 'utf-8', shell: true, + cleanup: true, env, ...execaOptions, }); diff --git a/code/lib/cli/src/repro-generators/scripts.ts b/code/lib/cli/src/repro-generators/scripts.ts index fc601a6c7ece..2aa59fc2ee40 100644 --- a/code/lib/cli/src/repro-generators/scripts.ts +++ b/code/lib/cli/src/repro-generators/scripts.ts @@ -105,7 +105,10 @@ const addLocalPackageResolutions = async ({ cwd }: Options) => { const packageJsonPath = path.join(cwd, 'package.json'); const packageJson = await readJSON(packageJsonPath); const workspaceDir = path.join(__dirname, '..', '..', '..', '..', '..'); - const { stdout } = await command('yarn workspaces list --json', { cwd: workspaceDir }); + const { stdout } = await command('yarn workspaces list --json', { + cwd: workspaceDir, + cleanup: true, + }); const workspaces = JSON.parse(`[${stdout.split('\n').join(',')}]`); diff --git a/code/lib/cli/src/versions.ts b/code/lib/cli/src/versions.ts index 390b116084d9..3c655591f8dc 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', - '@storybook/addon-actions': '7.1.0', - '@storybook/addon-backgrounds': '7.1.0', - '@storybook/addon-controls': '7.1.0', - '@storybook/addon-docs': '7.1.0', - '@storybook/addon-essentials': '7.1.0', - '@storybook/addon-highlight': '7.1.0', - '@storybook/addon-interactions': '7.1.0', - '@storybook/addon-jest': '7.1.0', - '@storybook/addon-links': '7.1.0', - '@storybook/addon-mdx-gfm': '7.1.0', - '@storybook/addon-measure': '7.1.0', - '@storybook/addon-outline': '7.1.0', - '@storybook/addon-storyshots': '7.1.0', - '@storybook/addon-storyshots-puppeteer': '7.1.0', - '@storybook/addon-storysource': '7.1.0', - '@storybook/addon-toolbars': '7.1.0', - '@storybook/addon-viewport': '7.1.0', - '@storybook/addons': '7.1.0', - '@storybook/angular': '7.1.0', - '@storybook/api': '7.1.0', - '@storybook/blocks': '7.1.0', - '@storybook/builder-manager': '7.1.0', - '@storybook/builder-vite': '7.1.0', - '@storybook/builder-webpack5': '7.1.0', - '@storybook/channel-postmessage': '7.1.0', - '@storybook/channel-websocket': '7.1.0', - '@storybook/channels': '7.1.0', - '@storybook/cli': '7.1.0', - '@storybook/client-api': '7.1.0', - '@storybook/client-logger': '7.1.0', - '@storybook/codemod': '7.1.0', - '@storybook/components': '7.1.0', - '@storybook/core-client': '7.1.0', - '@storybook/core-common': '7.1.0', - '@storybook/core-events': '7.1.0', - '@storybook/core-server': '7.1.0', - '@storybook/core-webpack': '7.1.0', - '@storybook/csf-plugin': '7.1.0', - '@storybook/csf-tools': '7.1.0', - '@storybook/docs-tools': '7.1.0', - '@storybook/ember': '7.1.0', - '@storybook/html': '7.1.0', - '@storybook/html-vite': '7.1.0', - '@storybook/html-webpack5': '7.1.0', - '@storybook/instrumenter': '7.1.0', - '@storybook/manager': '7.1.0', - '@storybook/manager-api': '7.1.0', - '@storybook/nextjs': '7.1.0', - '@storybook/node-logger': '7.1.0', - '@storybook/postinstall': '7.1.0', - '@storybook/preact': '7.1.0', - '@storybook/preact-vite': '7.1.0', - '@storybook/preact-webpack5': '7.1.0', - '@storybook/preset-create-react-app': '7.1.0', - '@storybook/preset-html-webpack': '7.1.0', - '@storybook/preset-preact-webpack': '7.1.0', - '@storybook/preset-react-webpack': '7.1.0', - '@storybook/preset-server-webpack': '7.1.0', - '@storybook/preset-svelte-webpack': '7.1.0', - '@storybook/preset-vue-webpack': '7.1.0', - '@storybook/preset-vue3-webpack': '7.1.0', - '@storybook/preset-web-components-webpack': '7.1.0', - '@storybook/preview': '7.1.0', - '@storybook/preview-api': '7.1.0', - '@storybook/preview-web': '7.1.0', - '@storybook/react': '7.1.0', - '@storybook/react-dom-shim': '7.1.0', - '@storybook/react-vite': '7.1.0', - '@storybook/react-webpack5': '7.1.0', - '@storybook/router': '7.1.0', - '@storybook/server': '7.1.0', - '@storybook/server-webpack5': '7.1.0', - '@storybook/source-loader': '7.1.0', - '@storybook/store': '7.1.0', - '@storybook/svelte': '7.1.0', - '@storybook/svelte-vite': '7.1.0', - '@storybook/svelte-webpack5': '7.1.0', - '@storybook/sveltekit': '7.1.0', - '@storybook/telemetry': '7.1.0', - '@storybook/theming': '7.1.0', - '@storybook/types': '7.1.0', - '@storybook/vue': '7.1.0', - '@storybook/vue-vite': '7.1.0', - '@storybook/vue-webpack5': '7.1.0', - '@storybook/vue3': '7.1.0', - '@storybook/vue3-vite': '7.1.0', - '@storybook/vue3-webpack5': '7.1.0', - '@storybook/web-components': '7.1.0', - '@storybook/web-components-vite': '7.1.0', - '@storybook/web-components-webpack5': '7.1.0', - sb: '7.1.0', - storybook: '7.1.0', + '@storybook/addon-a11y': '7.2.0-alpha.0', + '@storybook/addon-actions': '7.2.0-alpha.0', + '@storybook/addon-backgrounds': '7.2.0-alpha.0', + '@storybook/addon-controls': '7.2.0-alpha.0', + '@storybook/addon-docs': '7.2.0-alpha.0', + '@storybook/addon-essentials': '7.2.0-alpha.0', + '@storybook/addon-highlight': '7.2.0-alpha.0', + '@storybook/addon-interactions': '7.2.0-alpha.0', + '@storybook/addon-jest': '7.2.0-alpha.0', + '@storybook/addon-links': '7.2.0-alpha.0', + '@storybook/addon-mdx-gfm': '7.2.0-alpha.0', + '@storybook/addon-measure': '7.2.0-alpha.0', + '@storybook/addon-outline': '7.2.0-alpha.0', + '@storybook/addon-storyshots': '7.2.0-alpha.0', + '@storybook/addon-storyshots-puppeteer': '7.2.0-alpha.0', + '@storybook/addon-storysource': '7.2.0-alpha.0', + '@storybook/addon-toolbars': '7.2.0-alpha.0', + '@storybook/addon-viewport': '7.2.0-alpha.0', + '@storybook/addons': '7.2.0-alpha.0', + '@storybook/angular': '7.2.0-alpha.0', + '@storybook/api': '7.2.0-alpha.0', + '@storybook/blocks': '7.2.0-alpha.0', + '@storybook/builder-manager': '7.2.0-alpha.0', + '@storybook/builder-vite': '7.2.0-alpha.0', + '@storybook/builder-webpack5': '7.2.0-alpha.0', + '@storybook/channel-postmessage': '7.2.0-alpha.0', + '@storybook/channel-websocket': '7.2.0-alpha.0', + '@storybook/channels': '7.2.0-alpha.0', + '@storybook/cli': '7.2.0-alpha.0', + '@storybook/client-api': '7.2.0-alpha.0', + '@storybook/client-logger': '7.2.0-alpha.0', + '@storybook/codemod': '7.2.0-alpha.0', + '@storybook/components': '7.2.0-alpha.0', + '@storybook/core-client': '7.2.0-alpha.0', + '@storybook/core-common': '7.2.0-alpha.0', + '@storybook/core-events': '7.2.0-alpha.0', + '@storybook/core-server': '7.2.0-alpha.0', + '@storybook/core-webpack': '7.2.0-alpha.0', + '@storybook/csf-plugin': '7.2.0-alpha.0', + '@storybook/csf-tools': '7.2.0-alpha.0', + '@storybook/docs-tools': '7.2.0-alpha.0', + '@storybook/ember': '7.2.0-alpha.0', + '@storybook/html': '7.2.0-alpha.0', + '@storybook/html-vite': '7.2.0-alpha.0', + '@storybook/html-webpack5': '7.2.0-alpha.0', + '@storybook/instrumenter': '7.2.0-alpha.0', + '@storybook/manager': '7.2.0-alpha.0', + '@storybook/manager-api': '7.2.0-alpha.0', + '@storybook/nextjs': '7.2.0-alpha.0', + '@storybook/node-logger': '7.2.0-alpha.0', + '@storybook/postinstall': '7.2.0-alpha.0', + '@storybook/preact': '7.2.0-alpha.0', + '@storybook/preact-vite': '7.2.0-alpha.0', + '@storybook/preact-webpack5': '7.2.0-alpha.0', + '@storybook/preset-create-react-app': '7.2.0-alpha.0', + '@storybook/preset-html-webpack': '7.2.0-alpha.0', + '@storybook/preset-preact-webpack': '7.2.0-alpha.0', + '@storybook/preset-react-webpack': '7.2.0-alpha.0', + '@storybook/preset-server-webpack': '7.2.0-alpha.0', + '@storybook/preset-svelte-webpack': '7.2.0-alpha.0', + '@storybook/preset-vue-webpack': '7.2.0-alpha.0', + '@storybook/preset-vue3-webpack': '7.2.0-alpha.0', + '@storybook/preset-web-components-webpack': '7.2.0-alpha.0', + '@storybook/preview': '7.2.0-alpha.0', + '@storybook/preview-api': '7.2.0-alpha.0', + '@storybook/preview-web': '7.2.0-alpha.0', + '@storybook/react': '7.2.0-alpha.0', + '@storybook/react-dom-shim': '7.2.0-alpha.0', + '@storybook/react-vite': '7.2.0-alpha.0', + '@storybook/react-webpack5': '7.2.0-alpha.0', + '@storybook/router': '7.2.0-alpha.0', + '@storybook/server': '7.2.0-alpha.0', + '@storybook/server-webpack5': '7.2.0-alpha.0', + '@storybook/source-loader': '7.2.0-alpha.0', + '@storybook/store': '7.2.0-alpha.0', + '@storybook/svelte': '7.2.0-alpha.0', + '@storybook/svelte-vite': '7.2.0-alpha.0', + '@storybook/svelte-webpack5': '7.2.0-alpha.0', + '@storybook/sveltekit': '7.2.0-alpha.0', + '@storybook/telemetry': '7.2.0-alpha.0', + '@storybook/theming': '7.2.0-alpha.0', + '@storybook/types': '7.2.0-alpha.0', + '@storybook/vue': '7.2.0-alpha.0', + '@storybook/vue-vite': '7.2.0-alpha.0', + '@storybook/vue-webpack5': '7.2.0-alpha.0', + '@storybook/vue3': '7.2.0-alpha.0', + '@storybook/vue3-vite': '7.2.0-alpha.0', + '@storybook/vue3-webpack5': '7.2.0-alpha.0', + '@storybook/web-components': '7.2.0-alpha.0', + '@storybook/web-components-vite': '7.2.0-alpha.0', + '@storybook/web-components-webpack5': '7.2.0-alpha.0', + sb: '7.2.0-alpha.0', + storybook: '7.2.0-alpha.0', }; diff --git a/code/lib/client-logger/package.json b/code/lib/client-logger/package.json index 5108f319b340..98aea1ffd3f4 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", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 1074906019e2..bc66b4294783 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" @@ -49,9 +49,9 @@ "@babel/preset-env": "^7.22.9", "@babel/types": "^7.22.5", "@storybook/csf": "^0.1.0", - "@storybook/csf-tools": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/csf-tools": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@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 425cd29259d2..bc37e1ef0c2f 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", + "version": "7.2.0-alpha.0", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -43,8 +43,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/node-logger": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@types/find-cache-dir": "^3.2.1", "@types/node": "^16.0.0", "@types/node-fetch": "^2.6.4", @@ -71,7 +71,7 @@ "@types/picomatch": "^2.3.0", "mock-fs": "^5.2.0", "slash": "^5.0.0", - "type-fest": "^3.11.0", + "type-fest": "~2.19", "typescript": "~4.9.3" }, "publishConfig": { diff --git a/code/lib/core-events/package.json b/code/lib/core-events/package.json index b593eabd8d5d..bb0becbb8a8f 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", + "version": "7.2.0-alpha.0", "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 503a76e6f54e..d8c849355d98 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", + "version": "7.2.0-alpha.0", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -56,19 +56,19 @@ "dependencies": { "@aw-web-design/x-default-browser": "1.4.126", "@discoveryjs/json-ext": "^0.5.3", - "@storybook/builder-manager": "7.1.0", - "@storybook/channels": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/builder-manager": "7.2.0-alpha.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/csf": "^0.1.0", - "@storybook/csf-tools": "7.1.0", + "@storybook/csf-tools": "7.2.0-alpha.0", "@storybook/docs-mdx": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/manager": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/telemetry": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/telemetry": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@types/detect-port": "^1.3.0", "@types/node": "^16.0.0", "@types/pretty-hrtime": "^1.0.0", diff --git a/code/lib/core-server/src/withTelemetry.ts b/code/lib/core-server/src/withTelemetry.ts index ef231fe83c24..82bd7488dd21 100644 --- a/code/lib/core-server/src/withTelemetry.ts +++ b/code/lib/core-server/src/withTelemetry.ts @@ -109,15 +109,20 @@ export async function withTelemetry( options: TelemetryOptions, run: () => Promise ): Promise { + let canceled = false; + + async function cancelTelemetry() { + canceled = true; + if (!options.cliOptions.disableTelemetry) { + await telemetry('canceled', { eventType }, { stripMetadata: true, immediate: true }); + } + + process.exit(0); + } + if (eventType === 'init') { // We catch Ctrl+C user interactions to be able to detect a cancel event - process.on('SIGINT', async () => { - if (!options.cliOptions.disableTelemetry) { - await telemetry('canceled', { eventType }, { stripMetadata: true, immediate: true }); - } - - process.exit(0); - }); + process.on('SIGINT', cancelTelemetry); } if (!options.cliOptions.disableTelemetry) @@ -126,7 +131,7 @@ export async function withTelemetry( try { return await run(); } catch (error) { - if (error?.message === 'Canceled by the user') { + if (canceled) { return undefined; } @@ -135,5 +140,7 @@ export async function withTelemetry( await sendTelemetryError(error, eventType, options); throw error; + } finally { + process.off('SIGINIT', cancelTelemetry); } } diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index e8b274475be0..9b5ab2c2b0e7 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", + "version": "7.2.0-alpha.0", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -43,9 +43,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-common": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@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 82bc6331bc7e..dbf8c89e22c3 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", + "version": "7.2.0-alpha.0", "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", + "@storybook/csf-tools": "7.2.0-alpha.0", "unplugin": "^1.3.1" }, "devDependencies": { diff --git a/code/lib/csf-tools/package.json b/code/lib/csf-tools/package.json index 087cb3117c0b..fd93ab01c3c8 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", + "version": "7.2.0-alpha.0", "description": "Parse and manipulate CSF and Storybook config files", "keywords": [ "storybook" @@ -46,7 +46,7 @@ "@babel/traverse": "^7.22.8", "@babel/types": "^7.22.5", "@storybook/csf": "^0.1.0", - "@storybook/types": "7.1.0", + "@storybook/types": "7.2.0-alpha.0", "fs-extra": "^11.1.0", "recast": "^0.23.1", "ts-dedent": "^2.0.0" diff --git a/code/lib/csf-tools/src/ConfigFile.test.ts b/code/lib/csf-tools/src/ConfigFile.test.ts index 86b6806638da..58df95ba4999 100644 --- a/code/lib/csf-tools/src/ConfigFile.test.ts +++ b/code/lib/csf-tools/src/ConfigFile.test.ts @@ -2,6 +2,7 @@ import { dedent } from 'ts-dedent'; import { formatConfig, loadConfig } from './ConfigFile'; +import { babelPrint } from './babelParse'; expect.addSnapshotSerializer({ print: (val: any) => val, @@ -1049,4 +1050,85 @@ describe('ConfigFile', () => { expect(config.getNamesFromPath(['addons'])).toBeUndefined(); }); }); + + describe('setImport', () => { + it(`supports setting a default import for a field that does not exist`, () => { + const source = dedent` + const config: StorybookConfig = { }; + export default config; + `; + + const config = loadConfig(source).parse(); + config.setImport('path', 'path'); + + // eslint-disable-next-line no-underscore-dangle + const parsed = babelPrint(config._ast); + + expect(parsed).toMatchInlineSnapshot(` + import path from 'path'; + const config: StorybookConfig = { }; + export default config; + `); + }); + + it(`supports setting a default import for a field that does exist`, () => { + const source = dedent` + const config: StorybookConfig = { }; + export default config; + `; + + const config = loadConfig(source).parse(); + config.setImport('path', 'path'); + + // eslint-disable-next-line no-underscore-dangle + const parsed = babelPrint(config._ast); + + expect(parsed).toMatchInlineSnapshot(` + import path from 'path'; + const config: StorybookConfig = { }; + export default config; + `); + }); + + it(`supports setting a named import for a field that does not exist`, () => { + const source = dedent` + const config: StorybookConfig = { }; + export default config; + `; + + const config = loadConfig(source).parse(); + config.setImport(['dirname'], 'path'); + + // eslint-disable-next-line no-underscore-dangle + const parsed = babelPrint(config._ast); + + expect(parsed).toMatchInlineSnapshot(` + import { dirname } from 'path'; + const config: StorybookConfig = { }; + export default config; + `); + }); + + it(`supports setting a named import for a field where the source already exists`, () => { + const source = dedent` + import { dirname } from 'path'; + + const config: StorybookConfig = { }; + export default config; + `; + + const config = loadConfig(source).parse(); + config.setImport(['dirname'], 'path'); + + // eslint-disable-next-line no-underscore-dangle + const parsed = babelPrint(config._ast); + + expect(parsed).toMatchInlineSnapshot(` + import { dirname } from 'path'; + + const config: StorybookConfig = { }; + export default config; + `); + }); + }); }); diff --git a/code/lib/csf-tools/src/ConfigFile.ts b/code/lib/csf-tools/src/ConfigFile.ts index 4f0db3e0d74f..7374d065f0e0 100644 --- a/code/lib/csf-tools/src/ConfigFile.ts +++ b/code/lib/csf-tools/src/ConfigFile.ts @@ -514,6 +514,97 @@ export class ConfigFile { } this.setFieldNode(path, valueNode); } + + getBodyDeclarations() { + return this._ast.program.body; + } + + setBodyDeclaration(declaration: t.Declaration) { + this._ast.program.body.push(declaration); + } + + /** + * Set import specifiers for a given import statement. + * @description Does not support setting type imports (yet) + * @param importSpecifiers - The import specifiers to set. If a string is passed in, a default import will be set. Otherwise, an array of named imports will be set + * @param fromImport - The module to import from + * @example + * // import { foo } from 'bar'; + * setImport(['foo'], 'bar'); + * + * // import foo from 'bar'; + * setImport('foo', 'bar'); + * + */ + setImport(importSpecifier: string[] | string, fromImport: string) { + const getNewImportSpecifier = (specifier: string) => + t.importSpecifier(t.identifier(specifier), t.identifier(specifier)); + + /** + * Returns true, when the given import declaration has the given import specifier + * @example + * // import { foo } from 'bar'; + * hasImportSpecifier(declaration, 'foo'); + */ + const hasImportSpecifier = (declaration: t.ImportDeclaration, name: string) => + declaration.specifiers.find( + (specifier) => + t.isImportSpecifier(specifier) && + t.isIdentifier(specifier.imported) && + specifier.imported.name === name + ); + + /** + * Returns true, when the given import declaration has the given default import specifier + * @example + * // import foo from 'bar'; + * hasImportSpecifier(declaration, 'foo'); + */ + const hasDefaultImportSpecifier = (declaration: t.ImportDeclaration, name: string) => + declaration.specifiers.find((specifier) => t.isImportDefaultSpecifier(specifier)); + + const importDeclaration = this._ast.program.body.find( + (node) => t.isImportDeclaration(node) && node.source.value === fromImport + ) as t.ImportDeclaration | undefined; + + // if the import specifier is a string, we're dealing with default imports + if (typeof importSpecifier === 'string') { + // If the import declaration with the given source exists + if (importDeclaration) { + if (!hasDefaultImportSpecifier(importDeclaration, importSpecifier)) { + // If the import declaration hasn't a default specifier, we add it + importDeclaration.specifiers.push( + t.importDefaultSpecifier(t.identifier(importSpecifier)) + ); + } + // If the import declaration with the given source doesn't exist + } else { + // Add the import declaration to the top of the file + this._ast.program.body.unshift( + t.importDeclaration( + [t.importDefaultSpecifier(t.identifier(importSpecifier))], + t.stringLiteral(fromImport) + ) + ); + } + // if the import specifier is an array, we're dealing with named imports + } else if (importDeclaration) { + importSpecifier.forEach((specifier) => { + if (!hasImportSpecifier(importDeclaration, specifier)) { + importDeclaration.specifiers.push(getNewImportSpecifier(specifier)); + } + }); + } else { + this._ast.program.body.unshift( + t.importDeclaration( + importSpecifier.map((specifier) => + t.importSpecifier(t.identifier(specifier), t.identifier(specifier)) + ), + t.stringLiteral(fromImport) + ) + ); + } + } } export const loadConfig = (code: string, fileName?: string) => { diff --git a/code/lib/csf-tools/src/babelParse.ts b/code/lib/csf-tools/src/babelParse.ts index 97c292ab21ca..43f49d4c166a 100644 --- a/code/lib/csf-tools/src/babelParse.ts +++ b/code/lib/csf-tools/src/babelParse.ts @@ -36,6 +36,16 @@ export const babelParse = (code: string) => { }); }; +export const babelPrint = (ast: recast.types.ASTNode) => { + return recast.print(ast, { + quote: 'single', + trailingComma: true, + tabWidth: 2, + wrapColumn: 80, + arrowParensAlways: true, + }).code; +}; + export const babelParseExpression = (code: string) => { return babelParser.parseExpression(code, parserOptions); }; diff --git a/code/lib/docs-tools/package.json b/code/lib/docs-tools/package.json index fbfa6ec0c09b..5cd6e3f7d38c 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@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 f31671949df3..403078a73fb0 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" @@ -43,11 +43,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0", - "@storybook/client-logger": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0" + "@storybook/preview-api": "7.2.0-alpha.0" }, "devDependencies": { "typescript": "~4.9.3" diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index 39e84326daf2..770eb53dc3e5 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", + "version": "7.2.0-alpha.0", "description": "Core Storybook Manager API & Context", "keywords": [ "storybook" @@ -42,14 +42,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0", - "@storybook/client-logger": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/csf": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/router": "7.1.0", - "@storybook/theming": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/router": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "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 d043c1f92212..94dd7a797158 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'; +export const version = '7.2.0-alpha.0'; diff --git a/code/lib/node-logger/package.json b/code/lib/node-logger/package.json index 1ccb73147a68..ee3dda8ef665 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", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" diff --git a/code/lib/postinstall/package.json b/code/lib/postinstall/package.json index 2703727f3f6a..524821ca96df 100644 --- a/code/lib/postinstall/package.json +++ b/code/lib/postinstall/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/postinstall", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook addons postinstall utilities", "keywords": [ "api", diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index 9838ce29c4a7..9f57a7811e54 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", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" @@ -67,12 +67,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0", - "@storybook/client-logger": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/csf": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/types": "7.1.0", + "@storybook/types": "7.2.0-alpha.0", "@types/qs": "^6.9.5", "dequal": "^2.0.2", "lodash": "^4.17.21", @@ -84,7 +84,7 @@ }, "devDependencies": { "@jest/globals": "^29.5.0", - "@storybook/core-common": "7.1.0", + "@storybook/core-common": "7.2.0-alpha.0", "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 7edc4bbc4e83..a2ff80d0de9d 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" @@ -55,10 +55,10 @@ "prep": "../../../scripts/prepare/esm-bundle.ts" }, "devDependencies": { - "@storybook/channels": "7.1.0", - "@storybook/client-logger": "7.1.0", - "@storybook/core-events": "7.1.0", - "@storybook/preview-api": "7.1.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", "typescript": "~4.9.3" }, "publishConfig": { diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json index 67f865a0e0b4..6894a92eb03c 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", + "version": "7.2.0-alpha.0", "description": "", "keywords": [ "storybook" @@ -53,7 +53,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "devDependencies": { - "@storybook/types": "7.1.0", + "@storybook/types": "7.2.0-alpha.0", "typescript": "~4.9.3" }, "peerDependencies": { diff --git a/code/lib/router/package.json b/code/lib/router/package.json index c9e3388b5568..948e3950f518 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Core Storybook Router", "keywords": [ "storybook" @@ -48,7 +48,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", "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 4243d210165f..4a4484545420 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", + "version": "7.2.0-alpha.0", "description": "Source loader", "keywords": [ "lib", @@ -45,7 +45,7 @@ }, "dependencies": { "@storybook/csf": "^0.1.0", - "@storybook/types": "7.1.0", + "@storybook/types": "7.2.0-alpha.0", "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 28bf90684709..232a2f7bd352 100644 --- a/code/lib/telemetry/package.json +++ b/code/lib/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" @@ -43,9 +43,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/core-common": "7.1.0", - "@storybook/csf-tools": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-common": "7.2.0-alpha.0", + "@storybook/csf-tools": "7.2.0-alpha.0", "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 cb6af6c14bb9..d2d0b83dfd53 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "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", + "@storybook/client-logger": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", "memoizerific": "^1.11.3" }, diff --git a/code/lib/types/package.json b/code/lib/types/package.json index 1676d89c5a73..c20646023936 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Core Storybook TS Types", "keywords": [ "storybook" @@ -43,7 +43,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0", + "@storybook/channels": "7.2.0-alpha.0", "@types/babel__core": "^7.0.0", "@types/express": "^4.7.0", "file-system-cache": "2.3.0" diff --git a/code/lib/types/src/modules/addons.ts b/code/lib/types/src/modules/addons.ts index b99778d85424..b5a4c2145d66 100644 --- a/code/lib/types/src/modules/addons.ts +++ b/code/lib/types/src/modules/addons.ts @@ -184,7 +184,7 @@ export interface Addon_BaseAnnotations< /** * ArgTypes encode basic metadata for args, such as `name`, `description`, `defaultValue` for an arg. These get automatically filled in by Storybook Docs. - * @see [Control annotations](https://github.com/storybookjs/storybook/blob/91e9dee33faa8eff0b342a366845de7100415367/addons/controls/README.md#control-annotations) + * @see [Arg types](https://storybook.js.org/docs/react/api/arg-types) */ argTypes?: Addons_ArgTypes; diff --git a/code/package.json b/code/package.json index 75645add176c..cbe436f7b86d 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", @@ -88,7 +88,7 @@ "playwright": "1.36.0", "playwright-core": "1.36.0", "serialize-javascript": "^3.1.0", - "type-fest": "^3.11.0" + "type-fest": "~2.19" }, "dependencies": { "@babel/core": "^7.22.9", diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index c8b67e478017..075a849a806c 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", + "version": "7.2.0-alpha.0", "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", + "@storybook/types": "7.2.0-alpha.0", "@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", + "@storybook/node-logger": "7.2.0-alpha.0", "@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 e1035a00238a..89cef454ca6c 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", + "version": "7.2.0-alpha.0", "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", + "@storybook/core-webpack": "7.2.0-alpha.0", "@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 bb4df40c8b46..109a6a8d70b1 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", + "version": "7.2.0-alpha.0", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" @@ -50,7 +50,7 @@ "dependencies": { "@babel/plugin-transform-react-jsx": "^7.22.5", "@babel/preset-typescript": "^7.22.5", - "@storybook/core-webpack": "7.1.0", + "@storybook/core-webpack": "7.2.0-alpha.0", "@types/node": "^16.0.0" }, "devDependencies": { diff --git a/code/presets/preact-webpack/src/index.ts b/code/presets/preact-webpack/src/index.ts index 76c50e0affb0..758012bf73ab 100644 --- a/code/presets/preact-webpack/src/index.ts +++ b/code/presets/preact-webpack/src/index.ts @@ -3,7 +3,8 @@ import type { StorybookConfig } from './types'; export * from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; export const babel: StorybookConfig['babelDefault'] = (config) => { return { @@ -38,10 +39,10 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = (config) => { ...config.resolve, alias: { ...(config.resolve?.alias || {}), - react: wrapForPnP('preact/compat'), - 'react-dom/test-utils': wrapForPnP('preact/test-utils'), - 'react-dom': wrapForPnP('preact/compat'), - 'react/jsx-runtime': wrapForPnP('preact/jsx-runtime'), + react: getAbsolutePath('preact/compat'), + 'react-dom/test-utils': getAbsolutePath('preact/test-utils'), + 'react-dom': getAbsolutePath('preact/compat'), + 'react/jsx-runtime': getAbsolutePath('preact/jsx-runtime'), }, }, }; diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index e5d9162d2d97..27360fbd7eed 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", + "version": "7.2.0-alpha.0", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading", "keywords": [ "storybook" @@ -66,10 +66,10 @@ "@babel/preset-flow": "^7.22.5", "@babel/preset-react": "^7.22.5", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", - "@storybook/core-webpack": "7.1.0", - "@storybook/docs-tools": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/react": "7.1.0", + "@storybook/core-webpack": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/react": "7.2.0-alpha.0", "@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/react-webpack/src/framework-preset-react.ts b/code/presets/react-webpack/src/framework-preset-react.ts index 9b0aeaad314d..e913a32b5332 100644 --- a/code/presets/react-webpack/src/framework-preset-react.ts +++ b/code/presets/react-webpack/src/framework-preset-react.ts @@ -6,7 +6,8 @@ import { logger } from '@storybook/node-logger'; import type { Options, Preset } from '@storybook/core-webpack'; import type { StorybookConfig, ReactOptions } from './types'; -const wrapForPnP = (input: string) => dirname(require.resolve(join(input, 'package.json'))); +const getAbsolutePath = (input: I): I => + dirname(require.resolve(join(input, 'package.json'))) as any; const applyFastRefresh = async (options: Options) => { const isDevelopment = options.configType === 'DEVELOPMENT'; @@ -26,7 +27,7 @@ export const babel: StorybookConfig['babel'] = async (config, options) => { ], }; }; -const storybookReactDirName = wrapForPnP('@storybook/preset-react-webpack'); +const storybookReactDirName = getAbsolutePath('@storybook/preset-react-webpack'); // TODO: improve node_modules detection const context = storybookReactDirName.includes('node_modules') ? join(storybookReactDirName, '../../') // Real life case, already in node_modules diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 5756f411daf2..ab0e7d6aa741 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/core-webpack": "7.1.0", + "@storybook/core-server": "7.2.0-alpha.0", + "@storybook/core-webpack": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/server": "7.1.0", + "@storybook/server": "7.2.0-alpha.0", "@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 45efb2ee01a2..4039d6d96fac 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/node-logger": "7.1.0", + "@storybook/core-webpack": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", "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 7820cc57fe1f..015c3007a436 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/docs-tools": "7.1.0", + "@storybook/core-webpack": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@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 0186a5b0def7..97450f1673ae 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", + "version": "7.2.0-alpha.0", "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", - "@storybook/docs-tools": "7.1.0", + "@storybook/core-webpack": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@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 f9f7c9e3392d..ed4b26f3c256 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", + "version": "7.2.0-alpha.0", "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.9", - "@storybook/core-webpack": "7.1.0", + "@storybook/core-webpack": "7.2.0-alpha.0", "@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 a036ef947ce4..debc3585fef5 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook HTML renderer", "keywords": [ "storybook" @@ -48,11 +48,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.1.0", - "@storybook/docs-tools": "7.1.0", + "@storybook/core-client": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index 3c050167faca..1f17b59cfb58 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook Preact renderer", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.1.0", + "@storybook/core-client": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 3397766ee669..c872893fde6d 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook React renderer", "keywords": [ "storybook" @@ -52,13 +52,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/core-client": "7.1.0", - "@storybook/docs-tools": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-client": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0", - "@storybook/react-dom-shim": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/react-dom-shim": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@types/escodegen": "^0.0.6", "@types/estree": "^0.0.51", "@types/node": "^16.0.0", @@ -71,7 +71,7 @@ "prop-types": "^15.7.2", "react-element-to-jsx-string": "^15.0.0", "ts-dedent": "^2.0.0", - "type-fest": "^3.11.0", + "type-fest": "~2.19", "util-deprecate": "^1.0.2" }, "devDependencies": { diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 6a4c231a3543..6ee9793eff90 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook Server renderer", "keywords": [ "storybook" @@ -53,12 +53,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.1.0", + "@storybook/core-client": "7.2.0-alpha.0", "@storybook/csf": "^0.1.0", - "@storybook/csf-tools": "7.1.0", + "@storybook/csf-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@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 a277a67fd7fb..fc10005e0d0e 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook Svelte renderer", "keywords": [ "storybook" @@ -52,15 +52,15 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/core-client": "7.1.0", - "@storybook/core-events": "7.1.0", - "@storybook/docs-tools": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-client": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "sveltedoc-parser": "^4.2.1", - "type-fest": "^3.11.0" + "type-fest": "~2.19" }, "devDependencies": { "expect-type": "^0.15.0", diff --git a/code/renderers/vue/package.json b/code/renderers/vue/package.json index a1e40bb6064d..9180544c40ee 100644 --- a/code/renderers/vue/package.json +++ b/code/renderers/vue/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook Vue renderer", "keywords": [ "storybook" @@ -48,14 +48,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/core-client": "7.1.0", - "@storybook/docs-tools": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-client": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "ts-dedent": "^2.0.0", - "type-fest": "^3.11.0" + "type-fest": "~2.19" }, "devDependencies": { "typescript": "~4.9.3", diff --git a/code/renderers/vue/src/docs/sourceDecorator.ts b/code/renderers/vue/src/docs/sourceDecorator.ts index 24c4fe3c4ddb..becc96802860 100644 --- a/code/renderers/vue/src/docs/sourceDecorator.ts +++ b/code/renderers/vue/src/docs/sourceDecorator.ts @@ -4,7 +4,7 @@ import { addons } from '@storybook/preview-api'; import { logger } from '@storybook/client-logger'; import { SourceType, SNIPPET_RENDERED } from '@storybook/docs-tools'; -import type { ComponentOptions } from 'vue'; +import { type ComponentOptions } from 'vue'; import type Vue from 'vue'; import type { StoryContext } from '../types'; @@ -24,46 +24,47 @@ export const skipSourceRender = (context: StoryContext) => { export const sourceDecorator = (storyFn: any, context: StoryContext) => { const story = storyFn(); + const source = ''; // See ../react/jsxDecorator.tsx - if (skipSourceRender(context)) { + const skip = skipSourceRender(context); + if (skip) { return story; } const channel = addons.getChannel(); const storyComponent = getStoryComponent(story.options.STORYBOOK_WRAPS); + const generateSource = (vueInstance: any) => { + try { + // console.log('updateSource():', vueInstance.$vnode); + const storyNode = lookupStoryInstance(vueInstance, storyComponent); + if (!storyNode) { + logger.warn(`Failed to find story component in the rendered tree: ${storyComponent}`); + return; + } + // eslint-disable-next-line no-param-reassign + vueInstance.source = vnodeToString(storyNode._vnode); + } catch (e) { + logger.warn(`Failed to generate dynamic story source: ${e}`); + } + }; return { components: { Story: story, }, - // We need to wait until the wrapper component to be mounted so Vue runtime - // struct VNode tree. We get `this._vnode == null` if switch to `created` - // lifecycle hook. + data() { + return { source }; + }, + updated() { + generateSource(this); + }, mounted() { - // Theoretically this does not happens but we need to check it. - // @ts-expect-error TS says it is called $vnode - if (!this._vnode) { - return; - } - - try { - const storyNode = lookupStoryInstance(this, storyComponent); - - // @ts-expect-error TS says it is called $vnode - const code = vnodeToString(storyNode._vnode); - - const { id, unmappedArgs } = context; - channel.emit(SNIPPET_RENDERED, { - id, - args: unmappedArgs, - source: ``, - format: 'vue', - }); - } catch (e) { - logger.warn(`Failed to generate dynamic story source: ${e}`); - } + this.$watch('source', (val) => + channel.emit(SNIPPET_RENDERED, context.id, ``, 'vue') + ); + generateSource(this); }, template: '', } as ComponentOptions & ThisType; diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index b30aa1846280..588fa4e756f3 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" @@ -48,14 +48,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.1.0", - "@storybook/docs-tools": "7.1.0", + "@storybook/core-client": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "lodash": "^4.17.21", "ts-dedent": "^2.0.0", - "type-fest": "^3.11.0", + "type-fest": "~2.19", "vue-component-type-helpers": "latest" }, "devDependencies": { diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index 1f6e5bf245fa..9700a87e6dc0 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", + "version": "7.2.0-alpha.0", "description": "Storybook web-components renderer", "keywords": [ "lit", @@ -51,13 +51,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.1.0", - "@storybook/core-client": "7.1.0", - "@storybook/docs-tools": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/core-client": "7.2.0-alpha.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "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 5f1326b58e35..69b2d953073a 100644 --- a/code/ui/blocks/package.json +++ b/code/ui/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Storybook Doc Blocks", "keywords": [ "storybook" @@ -43,17 +43,17 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.1.0", - "@storybook/client-logger": "7.1.0", - "@storybook/components": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/csf": "^0.1.0", - "@storybook/docs-tools": "7.1.0", + "@storybook/docs-tools": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/preview-api": "7.1.0", - "@storybook/theming": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/preview-api": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@types/lodash": "^4.14.167", "color-convert": "^2.0.1", "dequal": "^2.0.2", @@ -68,7 +68,7 @@ "util-deprecate": "^1.0.2" }, "devDependencies": { - "@storybook/addon-actions": "7.1.0", + "@storybook/addon-actions": "7.2.0-alpha.0", "@types/color-convert": "^2.0.0" }, "peerDependencies": { diff --git a/code/ui/components/package.json b/code/ui/components/package.json index f02bd1d1b5cb..3e1578cb8f4e 100644 --- a/code/ui/components/package.json +++ b/code/ui/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Core Storybook Components", "keywords": [ "storybook" @@ -68,11 +68,11 @@ }, "dependencies": { "@radix-ui/react-select": "^1.2.2", - "@storybook/client-logger": "7.1.0", + "@storybook/client-logger": "7.2.0-alpha.0", "@storybook/csf": "^0.1.0", "@storybook/global": "^5.0.0", - "@storybook/theming": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/theming": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "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 45ac1d41e38c..38d2227b41c1 100644 --- a/code/ui/manager/package.json +++ b/code/ui/manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "description": "Core Storybook UI", "keywords": [ "storybook" @@ -52,16 +52,16 @@ "devDependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", "@storybook/addon-designs": "^7.0.0", - "@storybook/addons": "7.1.0", - "@storybook/channels": "7.1.0", - "@storybook/client-logger": "7.1.0", - "@storybook/components": "7.1.0", - "@storybook/core-events": "7.1.0", + "@storybook/addons": "7.2.0-alpha.0", + "@storybook/channels": "7.2.0-alpha.0", + "@storybook/client-logger": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/core-events": "7.2.0-alpha.0", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "7.1.0", - "@storybook/router": "7.1.0", - "@storybook/theming": "7.1.0", - "@storybook/types": "7.1.0", + "@storybook/manager-api": "7.2.0-alpha.0", + "@storybook/router": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", + "@storybook/types": "7.2.0-alpha.0", "@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 6ec959145ef5..5ec6464dcff1 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -1,6 +1,3 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - __metadata: version: 6 cacheKey: 8c0 @@ -488,6 +485,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.22.5, @babel/generator@npm:^7.22.7, @babel/generator@npm:^7.22.9, @babel/generator@npm:^7.7.2, @babel/generator@npm:^7.8.7": + version: 7.22.9 + resolution: "@babel/generator@npm:7.22.9" + dependencies: + "@babel/types": ^7.22.5 + "@jridgewell/gen-mapping": ^0.3.2 + "@jridgewell/trace-mapping": ^0.3.17 + jsesc: ^2.5.1 + checksum: 6ef82c7f6dc8f749c0eb3a04fe35acab032a9221d82984e67cbbada449ca857dd981e08c129f9cf5d2f342ba00efcc683a99e46a470f233b0948edf197e35d26 + languageName: node + linkType: hard + "@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.22.7, @babel/generator@npm:^7.22.9, @babel/generator@npm:^7.7.2, @babel/generator@npm:^7.8.7": version: 7.22.9 resolution: "@babel/generator@npm:7.22.9" @@ -1221,7 +1230,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-async-generator-functions@npm:^7.22.5, @babel/plugin-transform-async-generator-functions@npm:^7.22.7": +"@babel/plugin-transform-async-generator-functions@npm:^7.22.7": version: 7.22.7 resolution: "@babel/plugin-transform-async-generator-functions@npm:7.22.7" dependencies: @@ -1295,7 +1304,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-classes@npm:^7.22.5, @babel/plugin-transform-classes@npm:^7.22.6": +"@babel/plugin-transform-classes@npm:^7.22.6": version: 7.22.6 resolution: "@babel/plugin-transform-classes@npm:7.22.6" dependencies: @@ -1787,10 +1796,10 @@ __metadata: dependencies: "@babel/helper-module-imports": ^7.22.5 "@babel/helper-plugin-utils": ^7.22.5 - babel-plugin-polyfill-corejs2: ^0.4.3 - babel-plugin-polyfill-corejs3: ^0.8.1 - babel-plugin-polyfill-regenerator: ^0.5.0 - semver: ^6.3.0 + babel-plugin-polyfill-corejs2: ^0.4.4 + babel-plugin-polyfill-corejs3: ^0.8.2 + babel-plugin-polyfill-regenerator: ^0.5.1 + semver: ^6.3.1 peerDependencies: "@babel/core": ^7.0.0-0 checksum: 2dcd59bbf14622c2cc088a311a16073b777e34abe733a940c4df6d48fd58900fb7cb22aa2a4645939162cc717618f8e55e96c227ad61f9ae9bca098078aa7345 @@ -1944,8 +1953,8 @@ __metadata: version: 7.22.5 resolution: "@babel/preset-env@npm:7.22.5" dependencies: - "@babel/compat-data": ^7.22.5 - "@babel/helper-compilation-targets": ^7.22.5 + "@babel/compat-data": ^7.22.9 + "@babel/helper-compilation-targets": ^7.22.9 "@babel/helper-plugin-utils": ^7.22.5 "@babel/helper-validator-option": ^7.22.5 "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.22.5 @@ -1970,13 +1979,13 @@ __metadata: "@babel/plugin-syntax-top-level-await": ^7.14.5 "@babel/plugin-syntax-unicode-sets-regex": ^7.18.6 "@babel/plugin-transform-arrow-functions": ^7.22.5 - "@babel/plugin-transform-async-generator-functions": ^7.22.5 + "@babel/plugin-transform-async-generator-functions": ^7.22.7 "@babel/plugin-transform-async-to-generator": ^7.22.5 "@babel/plugin-transform-block-scoped-functions": ^7.22.5 "@babel/plugin-transform-block-scoping": ^7.22.5 "@babel/plugin-transform-class-properties": ^7.22.5 "@babel/plugin-transform-class-static-block": ^7.22.5 - "@babel/plugin-transform-classes": ^7.22.5 + "@babel/plugin-transform-classes": ^7.22.6 "@babel/plugin-transform-computed-properties": ^7.22.5 "@babel/plugin-transform-destructuring": ^7.22.5 "@babel/plugin-transform-dotall-regex": ^7.22.5 @@ -2001,7 +2010,7 @@ __metadata: "@babel/plugin-transform-object-rest-spread": ^7.22.5 "@babel/plugin-transform-object-super": ^7.22.5 "@babel/plugin-transform-optional-catch-binding": ^7.22.5 - "@babel/plugin-transform-optional-chaining": ^7.22.5 + "@babel/plugin-transform-optional-chaining": ^7.22.6 "@babel/plugin-transform-parameters": ^7.22.5 "@babel/plugin-transform-private-methods": ^7.22.5 "@babel/plugin-transform-private-property-in-object": ^7.22.5 @@ -2019,11 +2028,11 @@ __metadata: "@babel/plugin-transform-unicode-sets-regex": ^7.22.5 "@babel/preset-modules": ^0.1.5 "@babel/types": ^7.22.5 - babel-plugin-polyfill-corejs2: ^0.4.3 - babel-plugin-polyfill-corejs3: ^0.8.1 - babel-plugin-polyfill-regenerator: ^0.5.0 - core-js-compat: ^3.30.2 - semver: ^6.3.0 + babel-plugin-polyfill-corejs2: ^0.4.4 + babel-plugin-polyfill-corejs3: ^0.8.2 + babel-plugin-polyfill-regenerator: ^0.5.1 + core-js-compat: ^3.31.0 + semver: ^6.3.1 peerDependencies: "@babel/core": ^7.0.0-0 checksum: dd2b70e96102fc2a64f57c3ab177abeb5aac3f71f47701787b6264d91d7d3ea3d38526d8e1133eb667ca88e87c997ed4a1b8d498ca8be2af07ae4995dfac1b83 @@ -2278,6 +2287,24 @@ __metadata: languageName: node linkType: hard +"@babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.22.5, @babel/traverse@npm:^7.22.6, @babel/traverse@npm:^7.22.8, @babel/traverse@npm:^7.4.5, @babel/traverse@npm:^7.7.0, @babel/traverse@npm:^7.8.6": + version: 7.22.8 + resolution: "@babel/traverse@npm:7.22.8" + dependencies: + "@babel/code-frame": ^7.22.5 + "@babel/generator": ^7.22.7 + "@babel/helper-environment-visitor": ^7.22.5 + "@babel/helper-function-name": ^7.22.5 + "@babel/helper-hoist-variables": ^7.22.5 + "@babel/helper-split-export-declaration": ^7.22.6 + "@babel/parser": ^7.22.7 + "@babel/types": ^7.22.5 + debug: ^4.1.0 + globals: ^11.1.0 + checksum: 839014824c210388ed46f92bf5265522bd5bbb4a9a03c700f9d79b151bdd0aa077c2f6448a0cef41132188cc2bc6d8cdcad98a297ba59983401e882bdc256b1f + languageName: node + linkType: hard + "@babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.22.6, @babel/traverse@npm:^7.22.8, @babel/traverse@npm:^7.4.5, @babel/traverse@npm:^7.7.0, @babel/traverse@npm:^7.8.6": version: 7.22.8 resolution: "@babel/traverse@npm:7.22.8" @@ -5527,16 +5554,16 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-a11y@workspace:addons/a11y" dependencies: - "@storybook/addon-highlight": 7.1.0 - "@storybook/channels": 7.1.0 - "@storybook/client-logger": 7.1.0 - "@storybook/components": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/addon-highlight": 7.2.0-alpha.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/theming": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@testing-library/react": ^11.2.2 axe-core: ^4.2.0 lodash: ^4.17.21 @@ -5554,18 +5581,18 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-actions@7.1.0, @storybook/addon-actions@workspace:*, @storybook/addon-actions@workspace:addons/actions": +"@storybook/addon-actions@7.2.0-alpha.0, @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 - "@storybook/components": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/theming": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/lodash": ^4.14.167 "@types/uuid": ^9.0.1 dequal: ^2.0.2 @@ -5588,18 +5615,18 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-backgrounds@7.1.0, @storybook/addon-backgrounds@workspace:*, @storybook/addon-backgrounds@workspace:addons/backgrounds": +"@storybook/addon-backgrounds@7.2.0-alpha.0, @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 - "@storybook/components": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/theming": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 memoizerific: ^1.11.3 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -5614,19 +5641,19 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-controls@7.1.0, @storybook/addon-controls@workspace:*, @storybook/addon-controls@workspace:addons/controls": +"@storybook/addon-controls@7.2.0-alpha.0, @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 - "@storybook/client-logger": 7.1.0 - "@storybook/components": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/manager-api": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/theming": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/blocks": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 lodash: ^4.17.21 ts-dedent: ^2.0.0 peerDependencies: @@ -5663,25 +5690,25 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-docs@7.1.0, @storybook/addon-docs@workspace:*, @storybook/addon-docs@workspace:addons/docs": +"@storybook/addon-docs@7.2.0-alpha.0, @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 - "@storybook/client-logger": 7.1.0 - "@storybook/components": 7.1.0 - "@storybook/csf-plugin": 7.1.0 - "@storybook/csf-tools": 7.1.0 + "@storybook/blocks": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/csf-plugin": 7.2.0-alpha.0 + "@storybook/csf-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 "@storybook/mdx2-csf": ^1.0.0 - "@storybook/node-logger": 7.1.0 - "@storybook/postinstall": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/react-dom-shim": 7.1.0 - "@storybook/theming": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/postinstall": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/react-dom-shim": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 fs-extra: ^11.1.0 react: ^16.14.0 react-dom: ^16.8.0 @@ -5699,20 +5726,20 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-essentials@workspace:addons/essentials" dependencies: - "@storybook/addon-actions": 7.1.0 - "@storybook/addon-backgrounds": 7.1.0 - "@storybook/addon-controls": 7.1.0 - "@storybook/addon-docs": 7.1.0 - "@storybook/addon-highlight": 7.1.0 - "@storybook/addon-measure": 7.1.0 - "@storybook/addon-outline": 7.1.0 - "@storybook/addon-toolbars": 7.1.0 - "@storybook/addon-viewport": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/manager-api": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/vue": 7.1.0 + "@storybook/addon-actions": 7.2.0-alpha.0 + "@storybook/addon-backgrounds": 7.2.0-alpha.0 + "@storybook/addon-controls": 7.2.0-alpha.0 + "@storybook/addon-docs": 7.2.0-alpha.0 + "@storybook/addon-highlight": 7.2.0-alpha.0 + "@storybook/addon-measure": 7.2.0-alpha.0 + "@storybook/addon-outline": 7.2.0-alpha.0 + "@storybook/addon-toolbars": 7.2.0-alpha.0 + "@storybook/addon-viewport": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/vue": 7.2.0-alpha.0 ts-dedent: ^2.0.0 typescript: ^4.9.3 peerDependencies: @@ -5721,13 +5748,13 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-highlight@7.1.0, @storybook/addon-highlight@workspace:*, @storybook/addon-highlight@workspace:addons/highlight": +"@storybook/addon-highlight@7.2.0-alpha.0, @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 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 "@types/webpack-env": ^1.16.0 typescript: ~4.9.3 languageName: unknown @@ -5738,21 +5765,21 @@ __metadata: resolution: "@storybook/addon-interactions@workspace:addons/interactions" dependencies: "@devtools-ds/object-inspector": ^1.1.2 - "@storybook/client-logger": 7.1.0 - "@storybook/components": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/instrumenter": 7.1.0 + "@storybook/instrumenter": 7.2.0-alpha.0 "@storybook/jest": next - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 "@storybook/testing-library": next - "@storybook/theming": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/theming": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/node": ^16.0.0 formik: ^2.2.9 - jest-mock: ^29.5.0 + jest-mock: ^27.0.6 polished: ^4.2.2 ts-dedent: ^2.2.0 typescript: ~4.9.3 @@ -5771,13 +5798,13 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-jest@workspace:addons/jest" dependencies: - "@storybook/client-logger": 7.1.0 - "@storybook/components": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/theming": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 react-resize-detector: ^7.1.2 tiny-invariant: ^1.3.1 typescript: ~4.9.3 @@ -5797,14 +5824,14 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-links@workspace:addons/links" dependencies: - "@storybook/client-logger": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/csf": ^0.1.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/router": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/router": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 fs-extra: ^11.1.0 prop-types: ^15.7.2 ts-dedent: ^2.0.0 @@ -5824,24 +5851,24 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-mdx-gfm@workspace:addons/gfm" dependencies: - "@storybook/node-logger": 7.1.0 + "@storybook/node-logger": 7.2.0-alpha.0 remark-gfm: ^3.0.1 ts-dedent: ^2.0.0 typescript: ~4.9.3 languageName: unknown linkType: soft -"@storybook/addon-measure@7.1.0, @storybook/addon-measure@workspace:*, @storybook/addon-measure@workspace:addons/measure": +"@storybook/addon-measure@7.2.0-alpha.0, @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 - "@storybook/components": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 tiny-invariant: ^1.3.1 typescript: ~4.9.3 peerDependencies: @@ -5855,17 +5882,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-outline@7.1.0, @storybook/addon-outline@workspace:*, @storybook/addon-outline@workspace:addons/outline": +"@storybook/addon-outline@7.2.0-alpha.0, @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 - "@storybook/components": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 peerDependencies: @@ -5885,8 +5912,8 @@ __metadata: dependencies: "@axe-core/puppeteer": ^4.2.0 "@storybook/csf": ^0.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/jest-image-snapshot": ^6.0.0 "@types/puppeteer": ^5.4.0 enzyme: ^3.11.0 @@ -5894,7 +5921,7 @@ __metadata: jest-image-snapshot: ^6.0.0 puppeteer: ^2.0.0 || ^3.0.0 peerDependencies: - "@storybook/addon-storyshots": 7.1.0 + "@storybook/addon-storyshots": 7.2.0-alpha.0 puppeteer: ">=2.0.0" peerDependenciesMeta: puppeteer: @@ -5910,18 +5937,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 - "@storybook/angular": 7.1.0 + "@storybook/addon-docs": 7.2.0-alpha.0 + "@storybook/angular": 7.2.0-alpha.0 "@storybook/babel-plugin-require-context-hook": 1.0.1 - "@storybook/client-api": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/core-webpack": 7.1.0 + "@storybook/client-api": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/core-webpack": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 - "@storybook/react": 7.1.0 - "@storybook/types": 7.1.0 - "@storybook/vue": 7.1.0 - "@storybook/vue3": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/react": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 + "@storybook/vue": 7.2.0-alpha.0 + "@storybook/vue3": 7.2.0-alpha.0 "@types/jest-specific-snapshot": ^0.5.6 babel-loader: ^9.1.2 enzyme: ^3.11.0 @@ -5993,13 +6020,13 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-storysource@workspace:addons/storysource" dependencies: - "@storybook/client-logger": 7.1.0 - "@storybook/components": 7.1.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/router": 7.1.0 - "@storybook/source-loader": 7.1.0 - "@storybook/theming": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/router": 7.2.0-alpha.0 + "@storybook/source-loader": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 "@types/react": ^16.14.34 "@types/react-syntax-highlighter": 11.0.5 estraverse: ^5.2.0 @@ -6018,15 +6045,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-toolbars@7.1.0, @storybook/addon-toolbars@workspace:*, @storybook/addon-toolbars@workspace:addons/toolbars": +"@storybook/addon-toolbars@7.2.0-alpha.0, @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 - "@storybook/components": 7.1.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/theming": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 typescript: ~4.9.3 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -6039,17 +6066,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-viewport@7.1.0, @storybook/addon-viewport@workspace:*, @storybook/addon-viewport@workspace:addons/viewport": +"@storybook/addon-viewport@7.2.0-alpha.0, @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 - "@storybook/components": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/theming": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 memoizerific: ^1.11.3 prop-types: ^15.7.2 typescript: ~4.9.3 @@ -6064,20 +6091,20 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addons@7.1.0, @storybook/addons@workspace:*, @storybook/addons@workspace:deprecated/addons": +"@storybook/addons@7.2.0-alpha.0, @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 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 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, @storybook/angular@workspace:*, @storybook/angular@workspace:frameworks/angular": +"@storybook/angular@7.2.0-alpha.0, @storybook/angular@workspace:*, @storybook/angular@workspace:frameworks/angular": version: 0.0.0-use.local resolution: "@storybook/angular@workspace:frameworks/angular" dependencies: @@ -6093,20 +6120,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 - "@storybook/cli": 7.1.0 - "@storybook/client-logger": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/core-events": 7.1.0 - "@storybook/core-server": 7.1.0 - "@storybook/core-webpack": 7.1.0 - "@storybook/docs-tools": 7.1.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/cli": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 + "@storybook/core-server": 7.2.0-alpha.0 + "@storybook/core-webpack": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/telemetry": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/telemetry": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/cross-spawn": ^6.0.2 "@types/node": ^16.0.0 "@types/react": ^16.14.34 @@ -6157,8 +6184,8 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/api@workspace:deprecated/manager-api-shim" dependencies: - "@storybook/client-logger": 7.1.0 - "@storybook/manager-api": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/manager-api": 7.2.0-alpha.0 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -6202,22 +6229,22 @@ __metadata: languageName: node linkType: hard -"@storybook/blocks@7.1.0, @storybook/blocks@workspace:*, @storybook/blocks@workspace:ui/blocks": +"@storybook/blocks@7.2.0-alpha.0, @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 - "@storybook/channels": 7.1.0 - "@storybook/client-logger": 7.1.0 - "@storybook/components": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/addon-actions": 7.2.0-alpha.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/csf": ^0.1.0 - "@storybook/docs-tools": 7.1.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/theming": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/color-convert": ^2.0.0 "@types/lodash": ^4.14.167 color-convert: ^2.0.1 @@ -6237,14 +6264,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/builder-manager@7.1.0, @storybook/builder-manager@workspace:*, @storybook/builder-manager@workspace:builders/builder-manager": +"@storybook/builder-manager@7.2.0-alpha.0, @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 - "@storybook/manager": 7.1.0 - "@storybook/node-logger": 7.1.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/manager": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 "@types/ejs": ^3.1.1 "@types/find-cache-dir": ^3.2.1 "@yarnpkg/esbuild-plugin-pnp": ^3.0.0-rc.10 @@ -6262,19 +6289,19 @@ __metadata: languageName: unknown linkType: soft -"@storybook/builder-vite@7.1.0, @storybook/builder-vite@workspace:*, @storybook/builder-vite@workspace:builders/builder-vite": +"@storybook/builder-vite@7.2.0-alpha.0, @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 - "@storybook/client-logger": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/csf-plugin": 7.1.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/csf-plugin": 7.2.0-alpha.0 "@storybook/mdx2-csf": ^1.0.0 - "@storybook/node-logger": 7.1.0 - "@storybook/preview": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/preview": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/express": ^4.17.13 "@types/find-cache-dir": ^3.2.1 "@types/node": ^16.0.0 @@ -6306,27 +6333,27 @@ __metadata: languageName: unknown linkType: soft -"@storybook/builder-webpack5@7.1.0, @storybook/builder-webpack5@workspace:*, @storybook/builder-webpack5@workspace:builders/builder-webpack5": +"@storybook/builder-webpack5@7.2.0-alpha.0, @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.9 - "@storybook/addons": 7.1.0 - "@storybook/channels": 7.1.0 - "@storybook/client-api": 7.1.0 - "@storybook/client-logger": 7.1.0 - "@storybook/components": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/core-events": 7.1.0 - "@storybook/core-webpack": 7.1.0 + "@storybook/addons": 7.2.0-alpha.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-api": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 + "@storybook/core-webpack": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/preview": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/router": 7.1.0 - "@storybook/store": 7.1.0 - "@storybook/theming": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/preview": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/router": 7.2.0-alpha.0 + "@storybook/store": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 "@swc/core": ^1.3.49 "@types/node": ^16.0.0 "@types/pretty-hrtime": ^1.0.0 @@ -6374,8 +6401,8 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/channel-postmessage@workspace:deprecated/channel-postmessage" dependencies: - "@storybook/channels": 7.1.0 - "@storybook/client-logger": 7.1.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 typescript: ~4.9.3 languageName: unknown linkType: soft @@ -6384,19 +6411,19 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/channel-websocket@workspace:deprecated/channel-websocket" dependencies: - "@storybook/channels": 7.1.0 - "@storybook/client-logger": 7.1.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 typescript: ~4.9.3 languageName: unknown linkType: soft -"@storybook/channels@7.1.0, @storybook/channels@workspace:*, @storybook/channels@workspace:lib/channels": +"@storybook/channels@7.2.0-alpha.0, @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 - "@storybook/client-logger": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 qs: ^6.10.0 telejson: ^7.0.3 @@ -6405,21 +6432,22 @@ __metadata: languageName: unknown linkType: soft -"@storybook/cli@7.1.0, @storybook/cli@workspace:*, @storybook/cli@workspace:lib/cli": +"@storybook/cli@7.2.0-alpha.0, @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.9 "@babel/preset-env": ^7.22.9 + "@babel/types": ^7.22.5 "@ndelangen/get-tarball": ^3.0.7 - "@storybook/client-api": 7.1.0 - "@storybook/codemod": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/core-server": 7.1.0 - "@storybook/csf-tools": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/telemetry": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/client-api": 7.2.0-alpha.0 + "@storybook/codemod": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/core-server": 7.2.0-alpha.0 + "@storybook/csf-tools": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/telemetry": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/cross-spawn": ^6.0.2 "@types/prompts": ^2.0.9 "@types/puppeteer-core": ^2.1.0 @@ -6449,7 +6477,7 @@ __metadata: puppeteer-core: ^2.1.1 read-pkg-up: ^7.0.1 semver: ^7.3.7 - simple-update-notifier: ^1.0.0 + simple-update-notifier: ^2.0.0 slash: ^5.0.0 strip-json-comments: ^3.1.1 tempy: ^1.0.1 @@ -6462,16 +6490,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/client-api@7.1.0, @storybook/client-api@workspace:*, @storybook/client-api@workspace:deprecated/client-api": +"@storybook/client-api@7.2.0-alpha.0, @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 - "@storybook/preview-api": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 languageName: unknown linkType: soft -"@storybook/client-logger@7.1.0, @storybook/client-logger@workspace:*, @storybook/client-logger@workspace:lib/client-logger": +"@storybook/client-logger@7.2.0-alpha.0, @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: @@ -6480,7 +6508,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/codemod@7.1.0, @storybook/codemod@workspace:*, @storybook/codemod@workspace:lib/codemod": +"@storybook/codemod@7.2.0-alpha.0, @storybook/codemod@workspace:*, @storybook/codemod@workspace:lib/codemod": version: 0.0.0-use.local resolution: "@storybook/codemod@workspace:lib/codemod" dependencies: @@ -6488,9 +6516,9 @@ __metadata: "@babel/preset-env": ^7.22.9 "@babel/types": ^7.22.5 "@storybook/csf": ^0.1.0 - "@storybook/csf-tools": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/csf-tools": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/cross-spawn": ^6.0.2 "@types/jscodeshift": ^0.11.6 ansi-regex: ^5.0.1 @@ -6516,17 +6544,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/components@7.1.0, @storybook/components@workspace:*, @storybook/components@workspace:ui/components": +"@storybook/components@7.2.0-alpha.0, @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 "@radix-ui/react-select": ^1.2.2 - "@storybook/client-logger": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 "@storybook/csf": ^0.1.0 "@storybook/global": ^5.0.0 - "@storybook/theming": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/theming": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/react-syntax-highlighter": 11.0.5 "@types/util-deprecate": ^1.0.0 css: ^3.0.0 @@ -6548,21 +6576,21 @@ __metadata: languageName: unknown linkType: soft -"@storybook/core-client@7.1.0, @storybook/core-client@workspace:*, @storybook/core-client@workspace:deprecated/core-client": +"@storybook/core-client@7.2.0-alpha.0, @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 - "@storybook/preview-api": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 languageName: unknown linkType: soft -"@storybook/core-common@7.1.0, @storybook/core-common@workspace:*, @storybook/core-common@workspace:lib/core-common": +"@storybook/core-common@7.2.0-alpha.0, @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 - "@storybook/types": 7.1.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/find-cache-dir": ^3.2.1 "@types/mock-fs": ^4.13.1 "@types/node": ^16.0.0 @@ -6587,12 +6615,12 @@ __metadata: resolve-from: ^5.0.0 slash: ^5.0.0 ts-dedent: ^2.0.0 - type-fest: ^3.11.0 + type-fest: ~2.19 typescript: ~4.9.3 languageName: unknown linkType: soft -"@storybook/core-events@7.1.0, @storybook/core-events@workspace:*, @storybook/core-events@workspace:lib/core-events": +"@storybook/core-events@7.2.0-alpha.0, @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: @@ -6600,25 +6628,25 @@ __metadata: languageName: unknown linkType: soft -"@storybook/core-server@7.1.0, @storybook/core-server@workspace:*, @storybook/core-server@workspace:lib/core-server": +"@storybook/core-server@7.2.0-alpha.0, @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 - "@storybook/channels": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/builder-manager": 7.2.0-alpha.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/csf": ^0.1.0 - "@storybook/csf-tools": 7.1.0 + "@storybook/csf-tools": 7.2.0-alpha.0 "@storybook/docs-mdx": ^0.1.0 "@storybook/global": ^5.0.0 - "@storybook/manager": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/telemetry": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/telemetry": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/compression": ^1.7.0 "@types/detect-port": ^1.3.0 "@types/ip": ^1.1.0 @@ -6660,13 +6688,13 @@ __metadata: languageName: unknown linkType: soft -"@storybook/core-webpack@7.1.0, @storybook/core-webpack@workspace:*, @storybook/core-webpack@workspace:lib/core-webpack": +"@storybook/core-webpack@7.2.0-alpha.0, @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 - "@storybook/node-logger": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/node": ^16.0.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -6674,17 +6702,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/csf-plugin@7.1.0, @storybook/csf-plugin@workspace:*, @storybook/csf-plugin@workspace:lib/csf-plugin": +"@storybook/csf-plugin@7.2.0-alpha.0, @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 + "@storybook/csf-tools": 7.2.0-alpha.0 typescript: ~4.9.3 unplugin: ^1.3.1 languageName: unknown linkType: soft -"@storybook/csf-tools@7.1.0, @storybook/csf-tools@workspace:*, @storybook/csf-tools@workspace:lib/csf-tools": +"@storybook/csf-tools@7.2.0-alpha.0, @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: @@ -6693,7 +6721,7 @@ __metadata: "@babel/traverse": ^7.22.8 "@babel/types": ^7.22.5 "@storybook/csf": ^0.1.0 - "@storybook/types": 7.1.0 + "@storybook/types": 7.2.0-alpha.0 "@types/fs-extra": ^11.0.1 "@types/js-yaml": ^4.0.5 fs-extra: ^11.1.0 @@ -6729,14 +6757,14 @@ __metadata: languageName: node linkType: hard -"@storybook/docs-tools@7.1.0, @storybook/docs-tools@workspace:*, @storybook/docs-tools@workspace:lib/docs-tools": +"@storybook/docs-tools@7.2.0-alpha.0, @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.9 - "@storybook/core-common": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/doctrine": ^0.0.3 doctrine: ^3.0.0 jest-specific-snapshot: ^8.0.0 @@ -6750,12 +6778,12 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/ember@workspace:frameworks/ember" dependencies: - "@storybook/builder-webpack5": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/docs-tools": 7.1.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 ember-source: ~3.28.1 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -6799,13 +6827,13 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/html-vite@workspace:frameworks/html-vite" dependencies: - "@storybook/addons": 7.1.0 - "@storybook/builder-vite": 7.1.0 - "@storybook/client-api": 7.1.0 - "@storybook/core-server": 7.1.0 - "@storybook/html": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/preview-web": 7.1.0 + "@storybook/addons": 7.2.0-alpha.0 + "@storybook/builder-vite": 7.2.0-alpha.0 + "@storybook/client-api": 7.2.0-alpha.0 + "@storybook/core-server": 7.2.0-alpha.0 + "@storybook/html": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/preview-web": 7.2.0-alpha.0 "@types/node": ^16.0.0 magic-string: ^0.30.0 typescript: ~4.9.3 @@ -6816,11 +6844,11 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/html-webpack5@workspace:frameworks/html-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0 - "@storybook/core-common": 7.1.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/html": 7.1.0 - "@storybook/preset-html-webpack": 7.1.0 + "@storybook/html": 7.2.0-alpha.0 + "@storybook/preset-html-webpack": 7.2.0-alpha.0 "@types/node": ^16.0.0 typescript: ~4.9.3 peerDependencies: @@ -6830,15 +6858,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/html@7.1.0, @storybook/html@workspace:*, @storybook/html@workspace:renderers/html": +"@storybook/html@7.2.0-alpha.0, @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 - "@storybook/docs-tools": 7.1.0 + "@storybook/core-client": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 peerDependencies: @@ -6846,15 +6874,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/instrumenter@7.1.0, @storybook/instrumenter@workspace:*, @storybook/instrumenter@workspace:lib/instrumenter": +"@storybook/instrumenter@7.2.0-alpha.0, @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 - "@storybook/client-logger": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 typescript: ~4.9.3 languageName: unknown linkType: soft @@ -6897,19 +6925,19 @@ __metadata: languageName: node linkType: hard -"@storybook/manager-api@7.1.0, @storybook/manager-api@workspace:*, @storybook/manager-api@workspace:lib/manager-api": +"@storybook/manager-api@7.2.0-alpha.0, @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 - "@storybook/client-logger": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/csf": ^0.1.0 "@storybook/global": ^5.0.0 - "@storybook/router": 7.1.0 - "@storybook/theming": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/router": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/lodash": ^4.14.167 "@types/qs": ^6 dequal: ^2.0.2 @@ -6928,22 +6956,22 @@ __metadata: languageName: unknown linkType: soft -"@storybook/manager@7.1.0, @storybook/manager@workspace:*, @storybook/manager@workspace:ui/manager": +"@storybook/manager@7.2.0-alpha.0, @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/addon-designs": ^7.0.0 - "@storybook/addons": 7.1.0 - "@storybook/channels": 7.1.0 - "@storybook/client-logger": 7.1.0 - "@storybook/components": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/addons": 7.2.0-alpha.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/components": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/router": 7.1.0 - "@storybook/theming": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/router": 7.2.0-alpha.0 + "@storybook/theming": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@testing-library/react": ^11.2.2 "@types/semver": ^7.3.4 copy-to-clipboard: ^3.3.1 @@ -6993,13 +7021,13 @@ __metadata: "@babel/preset-typescript": ^7.22.5 "@babel/runtime": ^7.22.6 "@babel/types": ^7.22.5 - "@storybook/addon-actions": 7.1.0 - "@storybook/builder-webpack5": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/preset-react-webpack": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/react": 7.1.0 + "@storybook/addon-actions": 7.2.0-alpha.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/preset-react-webpack": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/react": 7.2.0-alpha.0 "@types/babel__core": ^7 "@types/babel__plugin-transform-runtime": ^7 "@types/babel__preset-env": ^7 @@ -7042,7 +7070,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/node-logger@7.1.0, @storybook/node-logger@workspace:*, @storybook/node-logger@workspace:lib/node-logger": +"@storybook/node-logger@7.2.0-alpha.0, @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: @@ -7055,7 +7083,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/postinstall@7.1.0, @storybook/postinstall@workspace:*, @storybook/postinstall@workspace:lib/postinstall": +"@storybook/postinstall@7.2.0-alpha.0, @storybook/postinstall@workspace:*, @storybook/postinstall@workspace:lib/postinstall": version: 0.0.0-use.local resolution: "@storybook/postinstall@workspace:lib/postinstall" dependencies: @@ -7071,8 +7099,8 @@ __metadata: resolution: "@storybook/preact-vite@workspace:frameworks/preact-vite" dependencies: "@preact/preset-vite": ^2.0.0 - "@storybook/builder-vite": 7.1.0 - "@storybook/preact": 7.1.0 + "@storybook/builder-vite": 7.2.0-alpha.0 + "@storybook/preact": 7.2.0-alpha.0 "@types/node": ^16.0.0 typescript: ~4.9.3 vite: ^4.0.0 @@ -7086,10 +7114,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/preact-webpack5@workspace:frameworks/preact-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/preact": 7.1.0 - "@storybook/preset-preact-webpack": 7.1.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/preact": 7.2.0-alpha.0 + "@storybook/preset-preact-webpack": 7.2.0-alpha.0 "@types/node": ^16.0.0 preact: ^10.5.13 typescript: ~4.9.3 @@ -7101,14 +7129,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preact@7.1.0, @storybook/preact@workspace:*, @storybook/preact@workspace:renderers/preact": +"@storybook/preact@7.2.0-alpha.0, @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 + "@storybook/core-client": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 preact: ^10.5.13 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -7122,9 +7150,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 + "@storybook/node-logger": 7.2.0-alpha.0 "@storybook/react-docgen-typescript-plugin": 1.0.6--canary.9.0c3f3b7.0 - "@storybook/types": 7.1.0 + "@storybook/types": 7.2.0-alpha.0 "@types/babel__core": ^7.1.7 "@types/node": ^16.0.0 babel-plugin-react-docgen: ^4.1.0 @@ -7137,11 +7165,11 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-html-webpack@7.1.0, @storybook/preset-html-webpack@workspace:*, @storybook/preset-html-webpack@workspace:presets/html-webpack": +"@storybook/preset-html-webpack@7.2.0-alpha.0, @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 + "@storybook/core-webpack": 7.2.0-alpha.0 "@types/node": ^16.0.0 html-loader: ^3.1.0 typescript: ~4.9.3 @@ -7151,13 +7179,13 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-preact-webpack@7.1.0, @storybook/preset-preact-webpack@workspace:*, @storybook/preset-preact-webpack@workspace:presets/preact-webpack": +"@storybook/preset-preact-webpack@7.2.0-alpha.0, @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.22.5 "@babel/preset-typescript": ^7.22.5 - "@storybook/core-webpack": 7.1.0 + "@storybook/core-webpack": 7.2.0-alpha.0 "@types/node": ^16.0.0 preact: ^10.5.13 typescript: ~4.9.3 @@ -7167,17 +7195,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-react-webpack@7.1.0, @storybook/preset-react-webpack@workspace:*, @storybook/preset-react-webpack@workspace:presets/react-webpack": +"@storybook/preset-react-webpack@7.2.0-alpha.0, @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.22.5 "@babel/preset-react": ^7.22.5 "@pmmmwh/react-refresh-webpack-plugin": ^0.5.5 - "@storybook/core-webpack": 7.1.0 - "@storybook/docs-tools": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/react": 7.1.0 + "@storybook/core-webpack": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/react": 7.2.0-alpha.0 "@storybook/react-docgen-typescript-plugin": 1.0.6--canary.9.0c3f3b7.0 "@types/node": ^16.0.0 "@types/semver": ^7.3.4 @@ -7200,14 +7228,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-server-webpack@7.1.0, @storybook/preset-server-webpack@workspace:*, @storybook/preset-server-webpack@workspace:presets/server-webpack": +"@storybook/preset-server-webpack@7.2.0-alpha.0, @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 - "@storybook/core-webpack": 7.1.0 + "@storybook/core-server": 7.2.0-alpha.0 + "@storybook/core-webpack": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/server": 7.1.0 + "@storybook/server": 7.2.0-alpha.0 "@types/node": ^16.0.0 fs-extra: ^11.1.0 jest-specific-snapshot: ^8.0.0 @@ -7219,12 +7247,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-svelte-webpack@7.1.0, @storybook/preset-svelte-webpack@workspace:*, @storybook/preset-svelte-webpack@workspace:presets/svelte-webpack": +"@storybook/preset-svelte-webpack@7.2.0-alpha.0, @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 - "@storybook/node-logger": 7.1.0 + "@storybook/core-webpack": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 svelte: ^4.0.0 svelte-loader: ^3.1.9 sveltedoc-parser: ^4.2.1 @@ -7237,12 +7265,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-vue-webpack@7.1.0, @storybook/preset-vue-webpack@workspace:*, @storybook/preset-vue-webpack@workspace:presets/vue-webpack": +"@storybook/preset-vue-webpack@7.2.0-alpha.0, @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 - "@storybook/docs-tools": 7.1.0 + "@storybook/core-webpack": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@types/node": ^16.0.0 ts-loader: ^9.2.8 typescript: ~4.9.3 @@ -7262,12 +7290,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-vue3-webpack@7.1.0, @storybook/preset-vue3-webpack@workspace:*, @storybook/preset-vue3-webpack@workspace:presets/vue3-webpack": +"@storybook/preset-vue3-webpack@7.2.0-alpha.0, @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 - "@storybook/docs-tools": 7.1.0 + "@storybook/core-webpack": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@types/node": ^16.0.0 "@vue/compiler-sfc": ^3.2.33 ts-loader: ^9.2.8 @@ -7285,14 +7313,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-web-components-webpack@7.1.0, @storybook/preset-web-components-webpack@workspace:*, @storybook/preset-web-components-webpack@workspace:presets/web-components-webpack": +"@storybook/preset-web-components-webpack@7.2.0-alpha.0, @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.9 - "@storybook/core-webpack": 7.1.0 + "@storybook/core-webpack": 7.2.0-alpha.0 "@types/node": ^16.0.0 babel-loader: ^7.0.0 || ^8.0.0 || ^9.0.0 babel-plugin-bundled-import-meta: ^0.3.1 @@ -7303,18 +7331,18 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preview-api@7.1.0, @storybook/preview-api@workspace:*, @storybook/preview-api@workspace:lib/preview-api": +"@storybook/preview-api@7.2.0-alpha.0, @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/channels": 7.1.0 - "@storybook/client-logger": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/core-events": 7.1.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 "@storybook/csf": ^0.1.0 "@storybook/global": ^5.0.0 - "@storybook/types": 7.1.0 + "@storybook/types": 7.2.0-alpha.0 "@types/qs": ^6.9.5 ansi-to-html: ^0.6.11 dequal: ^2.0.2 @@ -7329,23 +7357,23 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preview-web@7.1.0, @storybook/preview-web@workspace:*, @storybook/preview-web@workspace:deprecated/preview-web": +"@storybook/preview-web@7.2.0-alpha.0, @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 - "@storybook/preview-api": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 languageName: unknown linkType: soft -"@storybook/preview@7.1.0, @storybook/preview@workspace:*, @storybook/preview@workspace:lib/preview": +"@storybook/preview@7.2.0-alpha.0, @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 - "@storybook/client-logger": 7.1.0 - "@storybook/core-events": 7.1.0 - "@storybook/preview-api": 7.1.0 + "@storybook/channels": 7.2.0-alpha.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 typescript: ~4.9.3 languageName: unknown linkType: soft @@ -7368,11 +7396,11 @@ __metadata: languageName: node linkType: hard -"@storybook/react-dom-shim@7.1.0, @storybook/react-dom-shim@workspace:lib/react-dom-shim": +"@storybook/react-dom-shim@7.2.0-alpha.0, @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 + "@storybook/types": 7.2.0-alpha.0 typescript: ~4.9.3 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -7386,8 +7414,8 @@ __metadata: dependencies: "@joshwooding/vite-plugin-react-docgen-typescript": 0.2.1 "@rollup/pluginutils": ^5.0.2 - "@storybook/builder-vite": 7.1.0 - "@storybook/react": 7.1.0 + "@storybook/builder-vite": 7.2.0-alpha.0 + "@storybook/react": 7.2.0-alpha.0 "@types/node": ^16.0.0 "@vitejs/plugin-react": ^3.0.1 ast-types: ^0.14.2 @@ -7406,9 +7434,9 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/react-webpack5@workspace:frameworks/react-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0 - "@storybook/preset-react-webpack": 7.1.0 - "@storybook/react": 7.1.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/preset-react-webpack": 7.2.0-alpha.0 + "@storybook/react": 7.2.0-alpha.0 "@types/node": ^16.0.0 jest-specific-snapshot: ^8.0.0 peerDependencies: @@ -7424,18 +7452,18 @@ __metadata: languageName: unknown linkType: soft -"@storybook/react@7.1.0, @storybook/react@workspace:*, @storybook/react@workspace:renderers/react": +"@storybook/react@7.2.0-alpha.0, @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.9 - "@storybook/client-logger": 7.1.0 - "@storybook/core-client": 7.1.0 - "@storybook/docs-tools": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-client": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 - "@storybook/react-dom-shim": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/react-dom-shim": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/escodegen": ^0.0.6 "@types/estree": ^0.0.51 "@types/node": ^16.0.0 @@ -7452,7 +7480,7 @@ __metadata: react-element-to-jsx-string: ^15.0.0 require-from-string: ^2.0.2 ts-dedent: ^2.0.0 - type-fest: ^3.11.0 + type-fest: ~2.19 util-deprecate: ^1.0.2 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -7655,11 +7683,11 @@ __metadata: languageName: unknown linkType: soft -"@storybook/router@7.1.0, @storybook/router@workspace:*, @storybook/router@workspace:lib/router": +"@storybook/router@7.2.0-alpha.0, @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 + "@storybook/client-logger": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 dequal: ^2.0.2 lodash: ^4.17.21 @@ -7678,10 +7706,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/server-webpack5@workspace:frameworks/server-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/preset-server-webpack": 7.1.0 - "@storybook/server": 7.1.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/preset-server-webpack": 7.2.0-alpha.0 + "@storybook/server": 7.2.0-alpha.0 "@types/node": ^16.0.0 typescript: ~4.9.3 peerDependencies: @@ -7690,16 +7718,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/server@7.1.0, @storybook/server@workspace:*, @storybook/server@workspace:renderers/server": +"@storybook/server@7.2.0-alpha.0, @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 + "@storybook/core-client": 7.2.0-alpha.0 "@storybook/csf": ^0.1.0 - "@storybook/csf-tools": 7.1.0 + "@storybook/csf-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/fs-extra": ^11.0.1 fs-extra: ^11.1.0 ts-dedent: ^2.0.0 @@ -7708,12 +7736,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/source-loader@7.1.0, @storybook/source-loader@workspace:*, @storybook/source-loader@workspace:lib/source-loader": +"@storybook/source-loader@7.2.0-alpha.0, @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 + "@storybook/types": 7.2.0-alpha.0 estraverse: ^5.2.0 jest-specific-snapshot: ^8.0.0 lodash: ^4.17.21 @@ -7725,22 +7753,22 @@ __metadata: languageName: unknown linkType: soft -"@storybook/store@7.1.0, @storybook/store@workspace:*, @storybook/store@workspace:deprecated/store": +"@storybook/store@7.2.0-alpha.0, @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 - "@storybook/preview-api": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 languageName: unknown linkType: soft -"@storybook/svelte-vite@7.1.0, @storybook/svelte-vite@workspace:frameworks/svelte-vite": +"@storybook/svelte-vite@7.2.0-alpha.0, @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 - "@storybook/node-logger": 7.1.0 - "@storybook/svelte": 7.1.0 + "@storybook/builder-vite": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/svelte": 7.2.0-alpha.0 "@sveltejs/vite-plugin-svelte": ^2.4.2 "@types/node": ^16.0.0 magic-string: ^0.30.0 @@ -7759,10 +7787,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/svelte-webpack5@workspace:frameworks/svelte-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/preset-svelte-webpack": 7.1.0 - "@storybook/svelte": 7.1.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/preset-svelte-webpack": 7.2.0-alpha.0 + "@storybook/svelte": 7.2.0-alpha.0 svelte: ^4.0.0 svelte-loader: ^3.1.9 typescript: ~4.9.3 @@ -7775,22 +7803,22 @@ __metadata: languageName: unknown linkType: soft -"@storybook/svelte@7.1.0, @storybook/svelte@workspace:*, @storybook/svelte@workspace:renderers/svelte": +"@storybook/svelte@7.2.0-alpha.0, @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 - "@storybook/core-client": 7.1.0 - "@storybook/core-events": 7.1.0 - "@storybook/docs-tools": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-client": 7.2.0-alpha.0 + "@storybook/core-events": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 expect-type: ^0.15.0 svelte: ^4.0.0 svelte-check: ^3.4.3 sveltedoc-parser: ^4.2.1 - type-fest: ^3.11.0 + type-fest: ~2.19 typescript: ^5.0.4 peerDependencies: svelte: ^3.1.0 || ^4.0.0 @@ -7801,9 +7829,9 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/sveltekit@workspace:frameworks/sveltekit" dependencies: - "@storybook/builder-vite": 7.1.0 - "@storybook/svelte": 7.1.0 - "@storybook/svelte-vite": 7.1.0 + "@storybook/builder-vite": 7.2.0-alpha.0 + "@storybook/svelte": 7.2.0-alpha.0 + "@storybook/svelte-vite": 7.2.0-alpha.0 "@types/node": ^16.0.0 typescript: ^4.9.3 vite: ^4.0.0 @@ -7813,13 +7841,13 @@ __metadata: languageName: unknown linkType: soft -"@storybook/telemetry@7.1.0, @storybook/telemetry@workspace:*, @storybook/telemetry@workspace:lib/telemetry": +"@storybook/telemetry@7.2.0-alpha.0, @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 - "@storybook/core-common": 7.1.0 - "@storybook/csf-tools": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/csf-tools": 7.2.0-alpha.0 chalk: ^4.1.0 detect-package-manager: ^2.0.1 fetch-retry: ^5.0.2 @@ -7842,7 +7870,7 @@ __metadata: languageName: node linkType: hard -"@storybook/theming@7.1.0, @storybook/theming@workspace:*, @storybook/theming@workspace:lib/theming": +"@storybook/theming@7.2.0-alpha.0, @storybook/theming@workspace:*, @storybook/theming@workspace:lib/theming": version: 0.0.0-use.local resolution: "@storybook/theming@workspace:lib/theming" dependencies: @@ -7851,7 +7879,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 + "@storybook/client-logger": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 "@types/fs-extra": ^11.0.1 "@types/node": ^16.0.0 @@ -7867,11 +7895,11 @@ __metadata: languageName: unknown linkType: soft -"@storybook/types@7.1.0, @storybook/types@workspace:*, @storybook/types@workspace:lib/types": +"@storybook/types@7.2.0-alpha.0, @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 + "@storybook/channels": 7.2.0-alpha.0 "@storybook/csf": ^0.1.0 "@types/babel__core": ^7.0.0 "@types/express": ^4.7.0 @@ -7885,10 +7913,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue-vite@workspace:frameworks/vue-vite" dependencies: - "@storybook/builder-vite": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/core-server": 7.1.0 - "@storybook/vue": 7.1.0 + "@storybook/builder-vite": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/core-server": 7.2.0-alpha.0 + "@storybook/vue": 7.2.0-alpha.0 magic-string: ^0.30.0 typescript: ~4.9.3 vite: ^4.0.0 @@ -7906,10 +7934,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue-webpack5@workspace:frameworks/vue-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/preset-vue-webpack": 7.1.0 - "@storybook/vue": 7.1.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/preset-vue-webpack": 7.2.0-alpha.0 + "@storybook/vue": 7.2.0-alpha.0 "@types/node": ^16.0.0 typescript: ~4.9.3 vue: ^2.6.12 @@ -7931,9 +7959,9 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue3-vite@workspace:frameworks/vue3-vite" dependencies: - "@storybook/builder-vite": 7.1.0 - "@storybook/core-server": 7.1.0 - "@storybook/vue3": 7.1.0 + "@storybook/builder-vite": 7.2.0-alpha.0 + "@storybook/core-server": 7.2.0-alpha.0 + "@storybook/vue3": 7.2.0-alpha.0 "@types/node": ^16.0.0 "@vitejs/plugin-vue": ^4.0.0 magic-string: ^0.30.0 @@ -7951,10 +7979,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue3-webpack5@workspace:frameworks/vue3-webpack5" dependencies: - "@storybook/builder-webpack5": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/preset-vue3-webpack": 7.1.0 - "@storybook/vue3": 7.1.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/preset-vue3-webpack": 7.2.0-alpha.0 + "@storybook/vue3": 7.2.0-alpha.0 "@types/node": ^16.0.0 "@vue/compiler-sfc": 3.0.0 typescript: ~4.9.3 @@ -7969,22 +7997,22 @@ __metadata: languageName: unknown linkType: soft -"@storybook/vue3@7.1.0, @storybook/vue3@workspace:*, @storybook/vue3@workspace:renderers/vue3": +"@storybook/vue3@7.2.0-alpha.0, @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 - "@storybook/docs-tools": 7.1.0 + "@storybook/core-client": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/prettier": 2.7.2 "@vue/compiler-core": ^3.3.4 "@vue/vue3-jest": 29 lodash: ^4.17.21 ts-dedent: ^2.0.0 - type-fest: ^3.11.0 + type-fest: ~2.19 typescript: ~4.9.3 vue: ^3.2.47 vue-component-type-helpers: latest @@ -7995,18 +8023,18 @@ __metadata: languageName: unknown linkType: soft -"@storybook/vue@7.1.0, @storybook/vue@workspace:*, @storybook/vue@workspace:renderers/vue": +"@storybook/vue@7.2.0-alpha.0, @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 - "@storybook/core-client": 7.1.0 - "@storybook/docs-tools": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-client": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 ts-dedent: ^2.0.0 - type-fest: ^3.11.0 + type-fest: ~2.19 typescript: ~4.9.3 vue: 2.6.14 vue-tsc: latest @@ -8025,10 +8053,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 - "@storybook/core-server": 7.1.0 - "@storybook/node-logger": 7.1.0 - "@storybook/web-components": 7.1.0 + "@storybook/builder-vite": 7.2.0-alpha.0 + "@storybook/core-server": 7.2.0-alpha.0 + "@storybook/node-logger": 7.2.0-alpha.0 + "@storybook/web-components": 7.2.0-alpha.0 "@types/node": ^16.0.0 magic-string: ^0.30.0 typescript: ~4.9.3 @@ -8043,10 +8071,10 @@ __metadata: resolution: "@storybook/web-components-webpack5@workspace:frameworks/web-components-webpack5" dependencies: "@babel/preset-env": ^7.22.9 - "@storybook/builder-webpack5": 7.1.0 - "@storybook/core-common": 7.1.0 - "@storybook/preset-web-components-webpack": 7.1.0 - "@storybook/web-components": 7.1.0 + "@storybook/builder-webpack5": 7.2.0-alpha.0 + "@storybook/core-common": 7.2.0-alpha.0 + "@storybook/preset-web-components-webpack": 7.2.0-alpha.0 + "@storybook/web-components": 7.2.0-alpha.0 "@types/node": ^16.0.0 lit: 2.3.1 typescript: ~4.9.3 @@ -8057,17 +8085,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/web-components@7.1.0, @storybook/web-components@workspace:*, @storybook/web-components@workspace:renderers/web-components": +"@storybook/web-components@7.2.0-alpha.0, @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 - "@storybook/core-client": 7.1.0 - "@storybook/docs-tools": 7.1.0 + "@storybook/client-logger": 7.2.0-alpha.0 + "@storybook/core-client": 7.2.0-alpha.0 + "@storybook/docs-tools": 7.2.0-alpha.0 "@storybook/global": ^5.0.0 - "@storybook/manager-api": 7.1.0 - "@storybook/preview-api": 7.1.0 - "@storybook/types": 7.1.0 + "@storybook/manager-api": 7.2.0-alpha.0 + "@storybook/preview-api": 7.2.0-alpha.0 + "@storybook/types": 7.2.0-alpha.0 "@types/cross-spawn": ^6.0.2 "@types/node": ^16.0.0 cross-spawn: ^7.0.3 @@ -11304,6 +11332,19 @@ __metadata: languageName: node linkType: hard +"babel-plugin-polyfill-corejs2@npm:^0.4.4": + version: 0.4.4 + resolution: "babel-plugin-polyfill-corejs2@npm:0.4.4" + dependencies: + "@babel/compat-data": ^7.22.6 + "@babel/helper-define-polyfill-provider": ^0.4.2 + semver: ^6.3.1 + peerDependencies: + "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 + checksum: 89e12f24aac8bfae90001371cb3ed4d2e73b9acf723d8cce9bc7546424249d02163d883c9be436073210365abcbc0876ae3140b1f312839f37f824c8ba96ae03 + languageName: node + linkType: hard + "babel-plugin-polyfill-corejs3@npm:^0.8.1, babel-plugin-polyfill-corejs3@npm:^0.8.2": version: 0.8.3 resolution: "babel-plugin-polyfill-corejs3@npm:0.8.3" @@ -11316,6 +11357,18 @@ __metadata: languageName: node linkType: hard +"babel-plugin-polyfill-corejs3@npm:^0.8.2": + version: 0.8.2 + resolution: "babel-plugin-polyfill-corejs3@npm:0.8.2" + dependencies: + "@babel/helper-define-polyfill-provider": ^0.4.2 + core-js-compat: ^3.31.0 + peerDependencies: + "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 + checksum: b5cbfad6d3695a1ea65ef62e34de7f9c6f717cd5cc6d64bde726528168ba1d0a81e09a385d9283a489aab9739fbe206f2192fd9f0f60a37a0577de6526553a8d + languageName: node + linkType: hard + "babel-plugin-polyfill-regenerator@npm:^0.5.0, babel-plugin-polyfill-regenerator@npm:^0.5.1": version: 0.5.2 resolution: "babel-plugin-polyfill-regenerator@npm:0.5.2" @@ -11327,6 +11380,17 @@ __metadata: languageName: node linkType: hard +"babel-plugin-polyfill-regenerator@npm:^0.5.1": + version: 0.5.1 + resolution: "babel-plugin-polyfill-regenerator@npm:0.5.1" + dependencies: + "@babel/helper-define-polyfill-provider": ^0.4.2 + peerDependencies: + "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 + checksum: 31358bc030d99599fa1f7f0399b2cf7a5872495672bff779ecb49d6bbdb990378a1a5640789c247e248a481b6f298a2223d4396544ac79de4dc77fe3946bfe2c + languageName: node + linkType: hard + "babel-plugin-react-docgen@npm:^4.1.0, babel-plugin-react-docgen@npm:^4.2.1": version: 4.2.1 resolution: "babel-plugin-react-docgen@npm:4.2.1" @@ -13370,7 +13434,7 @@ __metadata: languageName: node linkType: hard -"core-js-compat@npm:^3.30.2, core-js-compat@npm:^3.31.0": +"core-js-compat@npm:^3.31.0": version: 3.31.1 resolution: "core-js-compat@npm:3.31.1" dependencies: @@ -19774,7 +19838,7 @@ __metadata: languageName: node linkType: hard -"jest-mock@npm:^27.3.0": +"jest-mock@npm:^27.0.6, jest-mock@npm:^27.3.0": version: 27.5.1 resolution: "jest-mock@npm:27.5.1" dependencies: @@ -19784,7 +19848,7 @@ __metadata: languageName: node linkType: hard -"jest-mock@npm:^29.5.0, jest-mock@npm:^29.6.1": +"jest-mock@npm:^29.6.1": version: 29.6.1 resolution: "jest-mock@npm:29.6.1" dependencies: @@ -27732,7 +27796,7 @@ __metadata: version: 0.0.0-use.local resolution: "sb@workspace:lib/cli-sb" dependencies: - "@storybook/cli": 7.1.0 + "@storybook/cli": 7.2.0-alpha.0 bin: sb: ./index.js languageName: unknown @@ -27870,15 +27934,6 @@ __metadata: languageName: node linkType: hard -"semver@npm:~7.0.0": - version: 7.0.0 - resolution: "semver@npm:7.0.0" - bin: - semver: bin/semver.js - checksum: 7fd341680a967a0abfd66f3a7d36ba44e52ff5d3e799e9a6cdb01a68160b64ef09be82b4af05459effeecdd836f002c2462555d2821cd890dfdfe36a0d9f56a5 - languageName: node - linkType: hard - "send@npm:0.18.0": version: 0.18.0 resolution: "send@npm:0.18.0" @@ -28103,12 +28158,12 @@ __metadata: languageName: node linkType: hard -"simple-update-notifier@npm:^1.0.0": - version: 1.1.0 - resolution: "simple-update-notifier@npm:1.1.0" +"simple-update-notifier@npm:^2.0.0": + version: 2.0.0 + resolution: "simple-update-notifier@npm:2.0.0" dependencies: - semver: ~7.0.0 - checksum: 3cbbbc71a5d9a2924f0e3f42fbf3cbe1854bfe142203456b00d5233bdbbdeb5091b8067cd34fb00f81dbfbc29fc30dbb6e026b3d58ea0551e3f26c0e64082092 + semver: ^7.5.3 + checksum: 2a00bd03bfbcbf8a737c47ab230d7920f8bfb92d1159d421bdd194479f6d01ebc995d13fbe13d45dace23066a78a3dc6642999b4e3b38b847e6664191575b20c languageName: node linkType: hard @@ -28673,7 +28728,7 @@ __metadata: version: 0.0.0-use.local resolution: "storybook@workspace:lib/cli-storybook" dependencies: - "@storybook/cli": 7.1.0 + "@storybook/cli": 7.2.0-alpha.0 bin: sb: ./index.js storybook: ./index.js @@ -29995,10 +30050,10 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^3.11.0": - version: 3.13.1 - resolution: "type-fest@npm:3.13.1" - checksum: 547d22186f73a8c04590b70dcf63baff390078c75ea8acd366bbd510fd0646e348bd1970e47ecf795b7cff0b41d26e9c475c1fedd6ef5c45c82075fbf916b629 +"type-fest@npm:~2.19": + version: 2.19.0 + resolution: "type-fest@npm:2.19.0" + checksum: a5a7ecf2e654251613218c215c7493574594951c08e52ab9881c9df6a6da0aeca7528c213c622bc374b4e0cb5c443aa3ab758da4e3c959783ce884c3194e12cb languageName: node linkType: hard diff --git a/docs/faq.md b/docs/faq.md index be9c8d6491b9..03432b6ce3ed 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -10,7 +10,7 @@ Here are some answers to frequently asked questions. If you have a question, you - [How can I run coverage tests with Create React App and leave out stories?](#how-can-i-run-coverage-tests-with-create-react-app-and-leave-out-stories) - [I see `ReferenceError: React is not defined` when using Storybook with Next.js](#i-see-referenceerror-react-is-not-defined-when-using-storybook-with-nextjs) - [How do I setup Storybook to share Webpack configuration with Next.js?](#how-do-i-setup-storybook-to-share-webpack-configuration-with-nextjs) -- [How do I fix module resolution while using pnpm Plug-n-Play?](#how-do-i-fix-module-resolution-while-using-pnpm-plug-n-play) +- [How do I fix module resolution in special environments?](#how-do-i-fix-module-resolution-in-special-environments) - [How do I setup React Fast Refresh with Storybook?](#how-do-i-setup-react-fast-refresh-with-storybook) - [How do I setup the new React Context Root API with Storybook?](#how-do-i-setup-the-new-react-context-root-api-with-storybook) - [Why is there no addons channel?](#why-is-there-no-addons-channel) @@ -117,9 +117,9 @@ export default { }; ``` -## How do I fix module resolution while using pnpm Plug-n-Play? +## How do I fix module resolution in special environments? -In case you are using [pnpm](https://pnpm.io/), you might run into issues with module resolution similar to this when running Storybook: +In case you are using [yarn Plug-n-Play](https://yarnpkg.com/features/pnp) or your project is set up within a mono repository environment, you might run into issues with module resolution similar to this when running Storybook: ```shell WARN Failed to load preset: "@storybook/react-webpack5/preset"` diff --git a/docs/snippets/common/storybook-main-pnpm-with-module-resolution.js.mdx b/docs/snippets/common/storybook-main-pnpm-with-module-resolution.js.mdx index 7b70439e066a..4ffa05ad3ff6 100644 --- a/docs/snippets/common/storybook-main-pnpm-with-module-resolution.js.mdx +++ b/docs/snippets/common/storybook-main-pnpm-with-module-resolution.js.mdx @@ -3,19 +3,19 @@ import path from 'path'; -const wrapForPnp = (packageName) => +const getAbsolutePath = (packageName) => path.dirname(require.resolve(path.join(packageName, 'package.json'))); export default { framework: { // Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite) - name: wrapForPnp('@storybook/your-framework'), + name: getAbsolutePath('@storybook/your-framework'), options: {}, }, stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], addons: [ - //👇 Use wrapForPnp when referencing Storybook's addons and frameworks - wrapForPnp('@storybook/addon-essentials'), + //👇 Use getAbsolutePath when referencing Storybook's addons and frameworks + getAbsolutePath('@storybook/addon-essentials'), ], }; ``` diff --git a/docs/snippets/common/storybook-main-pnpm-with-module-resolution.ts.mdx b/docs/snippets/common/storybook-main-pnpm-with-module-resolution.ts.mdx index 9dfedba3d0c1..a7e750975b3d 100644 --- a/docs/snippets/common/storybook-main-pnpm-with-module-resolution.ts.mdx +++ b/docs/snippets/common/storybook-main-pnpm-with-module-resolution.ts.mdx @@ -6,19 +6,19 @@ import type { StorybookConfig } from '@storybook/your-framework'; import path from 'path'; -const wrapForPnp = (packageName: string) => +const getAbsolutePath = (packageName: string): any => path.dirname(require.resolve(path.join(packageName, 'package.json'))); const config: StorybookConfig = { framework: { // Replace your-framework with the same one you've imported above. - name: wrapForPnp('@storybook/your-framework'), + name: getAbsolutePath('@storybook/your-framework'), options: {}, }, stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], addons: [ - //👇 Use wrapForPnp when referencing Storybook's addons and frameworks - wrapForPnp('@storybook/addon-essentials'), + //👇 Use getAbsolutePath when referencing Storybook's addons and frameworks + getAbsolutePath('@storybook/addon-essentials'), ], }; diff --git a/docs/snippets/react/component-story-highlight-addon.js.mdx b/docs/snippets/react/component-story-highlight-addon.js.mdx index db3e9abfe4ce..b4779176d2c5 100644 --- a/docs/snippets/react/component-story-highlight-addon.js.mdx +++ b/docs/snippets/react/component-story-highlight-addon.js.mdx @@ -4,15 +4,15 @@ import React, { useEffect } from 'react'; import { useChannel } from '@storybook/preview-api'; import { HIGHLIGHT, RESET_HIGHLIGHT } from '@storybook/addon-highlight'; -import { Card } form './Card'; +import { Card } from './Card'; export default { /* 👇 The title prop is optional. - * See https://storybook.js.org/docs/react/configure/overview#configure-story-loading - * to learn how to generate automatic titles - */ + * See https://storybook.js.org/docs/react/configure/overview#configure-story-loading + * to learn how to generate automatic titles + */ title: 'Card', - component: Card + component: Card, }; export const Default = () => ; diff --git a/docs/snippets/vue/component-story-highlight-addon.js.mdx b/docs/snippets/vue/component-story-highlight-addon.js.mdx index 9acba2faa662..693c23ee9c1c 100644 --- a/docs/snippets/vue/component-story-highlight-addon.js.mdx +++ b/docs/snippets/vue/component-story-highlight-addon.js.mdx @@ -3,15 +3,15 @@ import { useChannel } from '@storybook/preview-api'; import { HIGHLIGHT, RESET_HIGHLIGHT } from '@storybook/addon-highlight'; -import { Card } form './Card.vue'; +import { Card } from './Card.vue'; export default { /* 👇 The title prop is optional. - * See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading - * to learn how to generate automatic titles - */ + * See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading + * to learn how to generate automatic titles + */ title: 'Card', - component: Card + component: Card, }; export const Default: Story = (args) => ({ diff --git a/docs/versions/next.json b/docs/versions/next.json index 7599b057700d..204c1ccdc10b 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1,6 @@ -{"version":"7.1.0-rc.2","info":{"plain":"- CLI: Exit when user does not select a storybook project type - [#23201](https://github.com/storybookjs/storybook/pull/23201), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Fix Javascript language detection - [#23426](https://github.com/storybookjs/storybook/pull/23426), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Core: Fix onboarding detection in what's new module - [#23424](https://github.com/storybookjs/storybook/pull/23424), thanks [@yannbf](https://github.com/yannbf)!\n- Dependencies: Bump `@sveltejs/vite-plugin-svelte` - [#23233](https://github.com/storybookjs/storybook/pull/23233), thanks [@JReinhold](https://github.com/JReinhold)!\n- Telemetry: Add globals usage to project.json - [#23431](https://github.com/storybookjs/storybook/pull/23431), thanks [@shilman](https://github.com/shilman)!"}} +{ + "version": "7.2.0-alpha.0", + "info": { + "plain": "- Angular: Make enableProdMode optional - [#23489](https://github.com/storybookjs/storybook/pull/23489), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Router: Support RegExp in Route component - [#23292](https://github.com/storybookjs/storybook/pull/23292), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Improve tabs component, more type correct, allow for FC as title - [#23288](https://github.com/storybookjs/storybook/pull/23288), thanks [@ndelangen](https://github.com/ndelangen)!\n- Addons: Improve code quality by using title as FC & sharing state via useAddonState - [#23298](https://github.com/storybookjs/storybook/pull/23298), thanks [@ndelangen](https://github.com/ndelangen)!\n- InteractionsAddon: Improve code quality by using title as FC & sharing state via useAddonState - [#23291](https://github.com/storybookjs/storybook/pull/23291), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add storyStatus to sidebar UI - [#23342](https://github.com/storybookjs/storybook/pull/23342), thanks [@ndelangen](https://github.com/ndelangen)!\n- Addon API: Add experimental page addon type - [#23307](https://github.com/storybookjs/storybook/pull/23307), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: refactor Canvas component so we can improve types for PREVIEW addons and TAB addons - [#23311](https://github.com/storybookjs/storybook/pull/23311), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Improve Button layout and props - [#23356](https://github.com/storybookjs/storybook/pull/23356), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- Dependencies: Remove references to api and the 2 deprecated channel packages - [#23384](https://github.com/storybookjs/storybook/pull/23384), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Show the story status in the search results - [#23441](https://github.com/storybookjs/storybook/pull/23441), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Create new form elements in the new Core UI (Input, TextArea, Select) - [#23469](https://github.com/storybookjs/storybook/pull/23469), thanks [@cdedreuille](https://github.com/cdedreuille)!\n- CLI: Improve support of mono repositories - [#23458](https://github.com/storybookjs/storybook/pull/23458), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n" + } +} diff --git a/docs/writing-docs/autodocs.md b/docs/writing-docs/autodocs.md index 67f8e562fd6d..45f886d0c770 100644 --- a/docs/writing-docs/autodocs.md +++ b/docs/writing-docs/autodocs.md @@ -48,7 +48,7 @@ By default, Storybook offers zero-config support for documentation and automatic | Option | Description | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `autodocs` | Configures auto-generated documentation pages. Available options: `true`, `false`,`tag` (default). `true`/`false` enable/disable autodocs globally. `tag` allows you to opt in per component by adding the `tags: ['autodocs']` annotation in the component's default export.
Default: `docs: { autodocs: false }` | +| `autodocs` | Configures auto-generated documentation pages. Available options: `true`, `false`,`tag` (default). `true`/`false` enable/disable autodocs globally. `tag` allows you to opt in per component by adding the `tags: ['autodocs']` annotation in the component's default export.
Default: `docs: { autodocs: 'tag' }` | | `defaultName` | Renames the auto-generated documentation page
Default: `docs: { defaultName: 'Documentation' }` | ### Write a custom template diff --git a/scripts/build-package.js b/scripts/build-package.js index 93c480891a59..584d765a21e1 100644 --- a/scripts/build-package.js +++ b/scripts/build-package.js @@ -132,6 +132,7 @@ async function run() { cwd, buffer: false, shell: true, + cleanup: true, env: { NODE_ENV: 'production', }, diff --git a/scripts/check-package.js b/scripts/check-package.js index bf2d95a8fbd7..7fc8bc88f198 100644 --- a/scripts/check-package.js +++ b/scripts/check-package.js @@ -103,6 +103,7 @@ async function run() { cwd, buffer: false, shell: true, + cleanup: true, env: { NODE_ENV: 'production', }, diff --git a/scripts/dangerfile.ts b/scripts/dangerfile.ts index 6e8c5a2536ae..7b87377c0cd3 100644 --- a/scripts/dangerfile.ts +++ b/scripts/dangerfile.ts @@ -17,7 +17,7 @@ const Versions = { MAJOR: 'MAJOR', }; -const ciLabels = ['ci:normal', 'ci:merged', 'ci:daily']; +const ciLabels = ['ci:normal', 'ci:merged', 'ci:daily', 'ci:docs']; const branchVersion = Versions.MINOR; diff --git a/scripts/package.json b/scripts/package.json index 041e6b1b04e9..d551f204baef 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -51,7 +51,7 @@ "esbuild": "^0.18.0", "eslint": "^8.28.0", "serialize-javascript": "^3.1.0", - "type-fest": "^3.11.0" + "type-fest": "~2.19" }, "dependencies": { "@actions/core": "^1.10.0", @@ -179,7 +179,7 @@ "ts-dedent": "^2.0.0", "ts-node": "^10.9.1", "tsup": "^6.7.0", - "type-fest": "^3.11.0", + "type-fest": "~2.19", "typescript": "5.0.4", "util": "^0.12.4", "uuid": "^9.0.0", diff --git a/scripts/release/__tests__/generate-pr-description.test.ts b/scripts/release/__tests__/generate-pr-description.test.ts index 4a9dc04bcd4c..b0f1bbe89db5 100644 --- a/scripts/release/__tests__/generate-pr-description.test.ts +++ b/scripts/release/__tests__/generate-pr-description.test.ts @@ -215,6 +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. + Feel free to manually commit any changes necessary to this branch **after** you\\'ve done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs, *especially* if you\\'re making changes to the changelog. + When everything above is done: - Merge this PR - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml) @@ -273,6 +275,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-patch-release.yml) and wait for it to finish. + Feel free to manually commit any changes necessary to this branch **after** you\\'ve done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs. + When everything above is done: - Merge this PR - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml)" @@ -338,6 +342,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. + Feel free to manually commit any changes necessary to this branch **after** you\\'ve done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs, *especially* if you\\'re making changes to the changelog. + When everything above is done: - Merge this PR - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml) @@ -391,6 +397,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-patch-release.yml) and wait for it to finish. + Feel free to manually commit any changes necessary to this branch **after** you\\'ve done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs. + When everything above is done: - 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 ddfc0be15c50..d98abc7eb763 100644 --- a/scripts/release/__tests__/label-patches.test.ts +++ b/scripts/release/__tests__/label-patches.test.ts @@ -74,6 +74,22 @@ beforeEach(() => { gitClient.git.getRemotes.mockResolvedValue(remoteMock); githubInfo.getPullInfoFromCommit.mockResolvedValue(pullInfoMock); github.getLabelIds.mockResolvedValue({ 'patch:done': 'pick-id' }); + github.getUnpickedPRs.mockResolvedValue([ + { + number: 42, + id: 'some-id', + branch: 'some-patching-branch', + title: 'Fix: Patch this PR', + mergeCommit: 'abcd1234', + }, + { + number: 44, + id: 'other-id', + branch: 'other-patching-branch', + title: 'Fix: Also patch this PR', + mergeCommit: 'abcd1234', + }, + ]); }); test('it should fail early when no GH_TOKEN is set', async () => { @@ -130,8 +146,83 @@ test('it should label the PR associated with cheery picks in the current branch' "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 patch:done label...", + "Labeling 1 PRs with the patch:done label...", + "Successfully labeled all PRs with the patch:done label.", + ] + `); +}); + +test('it should label all PRs when the --all flag is passed', async () => { + process.env.GH_TOKEN = 'MY_SECRET'; + + // clear the git log, it shouldn't depend on it in --all mode + gitClient.git.log.mockResolvedValue({ + all: [], + latest: null!, + total: 0, + }); + + const writeStderr = jest.spyOn(process.stderr, 'write').mockImplementation(); + + await run({ all: true }); + expect(github.githubGraphQlClient.mock.calls).toMatchInlineSnapshot(` + [ + [ + " + mutation ($input: AddLabelsToLabelableInput!) { + addLabelsToLabelable(input: $input) { + clientMutationId + } + } + ", + { + "input": { + "clientMutationId": "39cffd21-7933-56e4-9d9c-1afeda9d5906", + "labelIds": [ + "pick-id", + ], + "labelableId": "some-id", + }, + }, + ], + [ + " + mutation ($input: AddLabelsToLabelableInput!) { + addLabelsToLabelable(input: $input) { + clientMutationId + } + } + ", + { + "input": { + "clientMutationId": "cc31033b-5da7-5c9e-adf2-80a2963e19a8", + "labelIds": [ + "pick-id", + ], + "labelableId": "other-id", + }, + }, + ], + ] + `); + + const stderrCalls = writeStderr.mock.calls + .map(([text]) => + typeof text === 'string' + ? text + .replace(ansiRegex(), '') + .replace(/[^\x20-\x7E]/g, '') + .replaceAll('-', '') + .trim() + : text + ) + .filter((it) => it !== ''); + + expect(stderrCalls).toMatchInlineSnapshot(` + [ + "Labeling 2 PRs with the patch:done label...", "Successfully labeled all PRs with the patch:done label.", ] `); + expect(github.getUnpickedPRs).toHaveBeenCalledTimes(1); }); diff --git a/scripts/release/generate-pr-description.ts b/scripts/release/generate-pr-description.ts index 1a10ca89197f..16a6928e994f 100644 --- a/scripts/release/generate-pr-description.ts +++ b/scripts/release/generate-pr-description.ts @@ -175,6 +175,8 @@ export const generateReleaseDescription = ({ 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](${workflowUrl}) and wait for it to finish. It will wipe your progress in this to do, which is expected. + Feel free to manually commit any changes necessary to this branch **after** you've done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs, *especially* if you're making changes to the changelog. + When everything above is done: - Merge this PR - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml) @@ -215,6 +217,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-patch-release.yml) and wait for it to finish. + Feel free to manually commit any changes necessary to this branch **after** you've done the last re-generation, following the [Make Manual Changes](https://github.com/storybookjs/storybook/blob/next/CONTRIBUTING/RELEASING.md#5-make-manual-changes) section in the docs. + When everything above is done: - Merge this PR - [Follow the run of the publish action](https://github.com/storybookjs/storybook/actions/workflows/publish.yml)` diff --git a/scripts/release/is-pr-frozen.ts b/scripts/release/is-pr-frozen.ts index 95c7defa0c5b..70289b5369d8 100644 --- a/scripts/release/is-pr-frozen.ts +++ b/scripts/release/is-pr-frozen.ts @@ -1,11 +1,11 @@ /* eslint-disable no-console */ import chalk from 'chalk'; import program from 'commander'; -import { simpleGit } from 'simple-git'; import { setOutput } from '@actions/core'; import path from 'path'; import { readJson } from 'fs-extra'; import { getPullInfoFromCommit } from './utils/get-github-info'; +import { git } from './utils/git-client'; program .name('is-pr-frozen') @@ -15,8 +15,6 @@ program .option('-P, --patch', 'Look for patch PR instead of prerelease PR', false) .option('-V, --verbose', 'Enable verbose logging', false); -const git = simpleGit(); - const CODE_DIR_PATH = path.join(__dirname, '..', '..', 'code'); const CODE_PACKAGE_JSON_PATH = path.join(CODE_DIR_PATH, 'package.json'); diff --git a/scripts/release/label-patches.ts b/scripts/release/label-patches.ts index dea8e62e469e..1e9305b9806c 100644 --- a/scripts/release/label-patches.ts +++ b/scripts/release/label-patches.ts @@ -1,13 +1,18 @@ import program from 'commander'; import { v4 as uuidv4 } from 'uuid'; import ora from 'ora'; -import { getLabelIds, githubGraphQlClient } from './utils/github-client'; +import { getLabelIds, githubGraphQlClient, getUnpickedPRs } from './utils/github-client'; import { getPullInfoFromCommits, getRepo } from './utils/get-changes'; import { getLatestTag, git } from './utils/git-client'; program .name('label-patches') - .description('Label all patches applied in current branch up to the latest release tag.'); + .description('Label all patches applied in current branch up to the latest release tag.') + .option( + '-A, --all', + 'Label all pull requests pending patches, iregardless if they are in the git log or not', + false + ); async function labelPR(id: string, labelId: string) { await githubGraphQlClient( @@ -22,11 +27,7 @@ async function labelPR(id: string, labelId: string) { ); } -export const run = async (_: unknown) => { - if (!process.env.GH_TOKEN) { - throw new Error('GH_TOKEN environment variable must be set, exiting.'); - } - +async function getPullRequestsFromLog({ repo }: { repo: string }) { const spinner = ora('Looking for latest tag').start(); const latestTag = await getLatestTag(); spinner.succeed(`Found latest tag: ${latestTag}`); @@ -41,10 +42,8 @@ export const run = async (_: unknown) => { if (cherryPicked.length === 0) { spinner2.fail('No cherry pick commits found to label.'); - return; + return []; } - - const repo = await getRepo(); const pullRequests = ( await getPullInfoFromCommits({ repo, @@ -56,17 +55,37 @@ export const run = async (_: unknown) => { spinner2.fail( `Found picks: ${cherryPicked.join(', ')}, but no associated pull request found to label.` ); - return; + return pullRequests; } const commitWithPr = pullRequests.map((pr) => `Commit: ${pr.commit}\n PR: ${pr.links.pull}`); spinner2.succeed(`Found the following picks 🍒:\n ${commitWithPr.join('\n')}`); - const spinner3 = ora(`Labeling the PRs with the patch:done label...`).start(); + return pullRequests; +} + +export const run = async (options: unknown) => { + if (!process.env.GH_TOKEN) { + throw new Error('GH_TOKEN environment variable must be set, exiting.'); + } + + const repo = await getRepo(); + const labelAll = typeof options === 'object' && 'all' in options && Boolean(options.all); + + const pullRequestsToLabel = labelAll + ? await getUnpickedPRs('next') + : await getPullRequestsFromLog({ repo }); + if (pullRequestsToLabel.length === 0) { + return; + } + + const spinner3 = ora( + `Labeling ${pullRequestsToLabel.length} PRs with the patch:done label...` + ).start(); try { const labelToId = await getLabelIds({ repo, labelNames: ['patch:done'] }); - await Promise.all(pullRequests.map((pr) => labelPR(pr.id, labelToId['patch:done']))); + await Promise.all(pullRequestsToLabel.map((pr) => labelPR(pr.id, labelToId['patch:done']))); spinner3.succeed(`Successfully labeled all PRs with the patch:done label.`); } catch (e) { spinner3.fail(`Something went wrong when labelling the PRs.`); @@ -75,7 +94,7 @@ export const run = async (_: unknown) => { }; if (require.main === module) { - const options = program.parse(process.argv); + const options = program.parse().opts(); run(options).catch((err) => { console.error(err); process.exit(1); diff --git a/scripts/release/pick-patches.ts b/scripts/release/pick-patches.ts index 8182ee3fad88..bbd90fb415e5 100644 --- a/scripts/release/pick-patches.ts +++ b/scripts/release/pick-patches.ts @@ -2,13 +2,10 @@ /* eslint-disable no-await-in-loop */ import program from 'commander'; import chalk from 'chalk'; -import { v4 as uuidv4 } from 'uuid'; -import type { GraphQlQueryResponseData } from '@octokit/graphql'; import ora from 'ora'; -import { simpleGit } from 'simple-git'; import { setOutput } from '@actions/core'; -import { getUnpickedPRs } from './utils/get-unpicked-prs'; -import { githubGraphQlClient } from './utils/github-client'; +import { git } from './utils/git-client'; +import { getUnpickedPRs } from './utils/github-client'; program.name('pick-patches').description('Cherry pick patch PRs back to main'); @@ -18,8 +15,6 @@ const OWNER = 'storybookjs'; const REPO = 'storybook'; const SOURCE_BRANCH = 'next'; -const git = simpleGit(); - interface PR { number: number; id: string; @@ -28,70 +23,12 @@ interface PR { mergeCommit: string; } -const LABEL = { - PATCH: 'patch:yes', - PICKED: 'patch:done', - DOCUMENTATION: 'documentation', -} as const; - function formatPR(pr: PR): string { return `https://github.com/${OWNER}/${REPO}/pull/${pr.number} "${pr.title}" ${chalk.yellow( pr.mergeCommit )}`; } -// @ts-expect-error not used atm -async function getLabelIds(labelNames: string[]) { - const query = labelNames.join('+'); - const result = await githubGraphQlClient( - ` - query ($owner: String!, $repo: String!, $q: String!) { - repository(owner: $owner, name: $repo) { - labels(query: $q, first: 10) { - nodes { - id - name - description - } - } - } - } - `, - { - owner: OWNER, - repo: REPO, - q: query, - } - ); - - const { labels } = result.repository; - const labelToId = {} as Record; - labels.nodes.forEach((label: { name: string; id: string }) => { - labelToId[label.name] = label.id; - }); - return labelToId; -} - -// @ts-expect-error not used atm -async function labelPR(id: string, labelToId: Record) { - await githubGraphQlClient( - ` - mutation ($input: AddLabelsToLabelableInput!) { - addLabelsToLabelable(input: $input) { - clientMutationId - } - } - `, - { - input: { - labelIds: [labelToId[LABEL.PICKED]], - labelableId: id, - clientMutationId: uuidv4(), - }, - } - ); -} - export const run = async (_: unknown) => { if (!process.env.GH_TOKEN) { logger.error('GH_TOKEN environment variable must be set, exiting.'); @@ -102,7 +39,6 @@ export const run = async (_: unknown) => { const spinner = ora('Searching for patch PRs to cherry-pick').start(); - // const labelToId = await getLabelIds(Object.values(LABEL)); const patchPRs = await getUnpickedPRs(sourceBranch); if (patchPRs.length > 0) { diff --git a/scripts/release/utils/get-changes.ts b/scripts/release/utils/get-changes.ts index 34586dfee2d0..1ad2a0759198 100644 --- a/scripts/release/utils/get-changes.ts +++ b/scripts/release/utils/get-changes.ts @@ -3,8 +3,8 @@ import chalk from 'chalk'; import semver from 'semver'; import type { PullRequestInfo } from './get-github-info'; import { getPullInfoFromCommit } from './get-github-info'; -import { getUnpickedPRs } from './get-unpicked-prs'; -import { git } from './git-client'; +import { getLatestTag, git } from './git-client'; +import { getUnpickedPRs } from './github-client'; export const RELEASED_LABELS = { 'BREAKING CHANGE': '❗ Breaking Change', @@ -42,8 +42,7 @@ export const getFromCommit = async (from?: string | undefined, verbose?: boolean let actualFrom = from; if (!from) { console.log(`🔍 No 'from' specified, finding latest version tag, fetching all of them...`); - // await git.fetch('origin', ['--all', '--tags']); - const { latest } = await git.tags(['v*', '--sort=-v:refname', '--merged']); + const latest = await getLatestTag(); if (!latest) { throw new Error( 'Could not automatically detect which commit to generate from, because no version tag was found in the history. Have you fetch tags?' diff --git a/scripts/release/utils/get-unpicked-prs.ts b/scripts/release/utils/get-unpicked-prs.ts deleted file mode 100644 index ade20ff68af3..000000000000 --- a/scripts/release/utils/get-unpicked-prs.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* eslint-disable no-console */ -import type { GraphQlQueryResponseData } from '@octokit/graphql'; -import { githubGraphQlClient } from './github-client'; - -export interface PR { - number: number; - id: string; - branch: string; - title: string; - mergeCommit: string; -} - -export async function getUnpickedPRs(baseBranch: string, verbose?: boolean): Promise> { - console.log(`💬 Getting unpicked patch pull requests...`); - const result = await githubGraphQlClient( - ` - query ($owner: String!, $repo: String!, $state: PullRequestState!, $order: IssueOrder!) { - repository(owner: $owner, name: $repo) { - pullRequests(states: [$state], labels: ["patch:yes"], orderBy: $order, first: 50, baseRefName: "next") { - nodes { - id - number - title - baseRefName - mergeCommit { - oid - } - labels(first: 20) { - nodes { - name - } - } - } - } - } - } - `, - { - owner: 'storybookjs', - repo: 'storybook', - order: { - field: 'UPDATED_AT', - direction: 'DESC', - }, - state: 'MERGED', - } - ); - - const { - pullRequests: { nodes }, - } = result.repository; - - const prs = nodes.map((node: any) => ({ - number: node.number, - id: node.id, - branch: node.baseRefName, - title: node.title, - mergeCommit: node.mergeCommit.oid, - labels: node.labels.nodes.map((l: any) => l.name), - })); - - const unpickedPRs = prs - .filter((pr: any) => !pr.labels.includes('patch:done')) - .filter((pr: any) => pr.branch === baseBranch) - .reverse(); - - if (verbose) { - console.log(`🔍 Found unpicked patch pull requests: - ${JSON.stringify(unpickedPRs, null, 2)}`); - } - return unpickedPRs; -} diff --git a/scripts/release/utils/git-client.ts b/scripts/release/utils/git-client.ts index 9b4e05144f8f..472ce6fbbe35 100644 --- a/scripts/release/utils/git-client.ts +++ b/scripts/release/utils/git-client.ts @@ -1,6 +1,33 @@ import { simpleGit } from 'simple-git'; -export const git = simpleGit(); +export const git = simpleGit({ + config: [ + /** + * ensures that prereleases are listed as earlier than stable releases. + * WITHOUT the config, this is the list of tags: + * v7.1.0-rc.2 + * v7.1.0-rc.1 + * v7.1.0-rc.0 + * v7.1.0-beta.3 + * ... + * v7.1.0 + * v7.0.2 + * + * WITH the config, v7.1.0 is correctly on the top: + * v7.1.0 + * v7.1.0-rc.2 + * v7.1.0-rc.1 + * v7.1.0-rc.0 + * v7.1.0-beta.3 + * ... + * v7.0.2 + * + * The top most tag is considered the "latest", which is used as a starting point for looking for changes for upcoming releases + * See https://stackoverflow.com/a/52680984 + */ + 'versionsort.suffix=-', + ], +}); export async function getLatestTag() { return (await git.tags(['v*', '--sort=-v:refname', '--merged'])).latest; diff --git a/scripts/release/utils/github-client.ts b/scripts/release/utils/github-client.ts index 3c6a2355e0dc..646ba1003986 100644 --- a/scripts/release/utils/github-client.ts +++ b/scripts/release/utils/github-client.ts @@ -1,10 +1,83 @@ +/* eslint-disable no-console */ import type { GraphQlQueryResponseData } from '@octokit/graphql'; import { graphql } from '@octokit/graphql'; +export interface PullRequest { + number: number; + id: string; + branch: string; + title: string; + mergeCommit: string; +} + export const githubGraphQlClient = graphql.defaults({ headers: { authorization: `token ${process.env.GH_TOKEN}` }, }); +export async function getUnpickedPRs( + baseBranch: string, + verbose?: boolean +): Promise> { + console.log(`💬 Getting unpicked patch pull requests...`); + const result = await githubGraphQlClient( + ` + query ($owner: String!, $repo: String!, $state: PullRequestState!, $order: IssueOrder!) { + repository(owner: $owner, name: $repo) { + pullRequests(states: [$state], labels: ["patch:yes"], orderBy: $order, first: 50, baseRefName: "next") { + nodes { + id + number + title + baseRefName + mergeCommit { + oid + } + labels(first: 20) { + nodes { + name + } + } + } + } + } + } + `, + { + owner: 'storybookjs', + repo: 'storybook', + order: { + field: 'UPDATED_AT', + direction: 'DESC', + }, + state: 'MERGED', + } + ); + + const { + pullRequests: { nodes }, + } = result.repository; + + const prs = nodes.map((node: any) => ({ + number: node.number, + id: node.id, + branch: node.baseRefName, + title: node.title, + mergeCommit: node.mergeCommit.oid, + labels: node.labels.nodes.map((l: any) => l.name), + })); + + const unpickedPRs = prs + .filter((pr: any) => !pr.labels.includes('patch:done')) + .filter((pr: any) => pr.branch === baseBranch) + .reverse(); + + if (verbose) { + console.log(`🔍 Found unpicked patch pull requests: + ${JSON.stringify(unpickedPRs, null, 2)}`); + } + return unpickedPRs; +} + export async function getLabelIds({ repo: fullRepo, labelNames, diff --git a/scripts/utils/exec.ts b/scripts/utils/exec.ts index cf2f5e4bd624..6280f65ff9cf 100644 --- a/scripts/utils/exec.ts +++ b/scripts/utils/exec.ts @@ -26,7 +26,10 @@ export const execaCommand = async ( const execa = await getExeca(); // We await here because execaCommand returns a promise, but that's not what the user expects // eslint-disable-next-line @typescript-eslint/return-await - return await execa.execaCommand(command, options); + return await execa.execaCommand(command, { + cleanup: true, + ...options, + }); }; export const exec = async ( diff --git a/scripts/utils/options.ts b/scripts/utils/options.ts index 230e697329f9..f5340c037a85 100644 --- a/scripts/utils/options.ts +++ b/scripts/utils/options.ts @@ -170,7 +170,7 @@ export function getOptions( .parse(argv); const intermediate = command.opts(); - if (intermediate.task === undefined && argv[2]) { + if (intermediate.task === undefined && argv[2] && !argv[2].startsWith('-')) { // eslint-disable-next-line prefer-destructuring intermediate.task = argv[2]; } diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 8c45344140b8..21dc69364812 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -3038,7 +3038,7 @@ __metadata: ts-loader: ^9.4.2 ts-node: ^10.9.1 tsup: ^6.7.0 - type-fest: ^3.11.0 + type-fest: ~2.19 typescript: 5.0.4 util: ^0.12.4 uuid: ^9.0.0 @@ -15996,10 +15996,10 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^3.11.0": - version: 3.13.1 - resolution: "type-fest@npm:3.13.1" - checksum: 547d22186f73a8c04590b70dcf63baff390078c75ea8acd366bbd510fd0646e348bd1970e47ecf795b7cff0b41d26e9c475c1fedd6ef5c45c82075fbf916b629 +"type-fest@npm:~2.19": + version: 2.19.0 + resolution: "type-fest@npm:2.19.0" + checksum: a5a7ecf2e654251613218c215c7493574594951c08e52ab9881c9df6a6da0aeca7528c213c622bc374b4e0cb5c443aa3ab758da4e3c959783ce884c3194e12cb languageName: node linkType: hard diff --git a/test-storybooks/ember-cli/package.json b/test-storybooks/ember-cli/package.json index f2cf2b5d8dfc..8e593b60f357 100644 --- a/test-storybooks/ember-cli/package.json +++ b/test-storybooks/ember-cli/package.json @@ -1,6 +1,6 @@ { "name": "ember-example", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "private": true, "scripts": { "--build-storybook": "yarn storybook-prebuild && NODE_OPTIONS=\"--preserve-symlinks --preserve-symlinks-main\" storybook build", @@ -98,19 +98,19 @@ "devDependencies": { "@babel/core": "^7.22.0", "@ember/optional-features": "^2.0.0", - "@storybook/addon-a11y": "7.1.0", - "@storybook/addon-actions": "7.1.0", - "@storybook/addon-backgrounds": "7.1.0", - "@storybook/addon-controls": "7.1.0", - "@storybook/addon-docs": "7.1.0", - "@storybook/addon-highlight": "7.1.0", - "@storybook/addon-links": "7.1.0", - "@storybook/addon-storysource": "7.1.0", - "@storybook/addon-viewport": "7.1.0", - "@storybook/addons": "7.1.0", - "@storybook/ember": "7.1.0", + "@storybook/addon-a11y": "7.2.0-alpha.0", + "@storybook/addon-actions": "7.2.0-alpha.0", + "@storybook/addon-backgrounds": "7.2.0-alpha.0", + "@storybook/addon-controls": "7.2.0-alpha.0", + "@storybook/addon-docs": "7.2.0-alpha.0", + "@storybook/addon-highlight": "7.2.0-alpha.0", + "@storybook/addon-links": "7.2.0-alpha.0", + "@storybook/addon-storysource": "7.2.0-alpha.0", + "@storybook/addon-viewport": "7.2.0-alpha.0", + "@storybook/addons": "7.2.0-alpha.0", + "@storybook/ember": "7.2.0-alpha.0", "@storybook/ember-cli-storybook": "^0.2.1", - "@storybook/source-loader": "7.1.0", + "@storybook/source-loader": "7.2.0-alpha.0", "babel-loader": "^8.2.5", "broccoli-asset-rev": "^3.0.0", "browserify-zlib": "^0.2.0", @@ -130,7 +130,7 @@ "loader.js": "^4.7.0", "os-browserify": "^0.3.0", "shx": "^0.3.2", - "storybook": "7.1.0", + "storybook": "7.2.0-alpha.0", "stream-browserify": "^3.0.0", "vm-browserify": "^1.1.2", "webpack": "5", diff --git a/test-storybooks/external-docs/package.json b/test-storybooks/external-docs/package.json index 24827e917ec1..b8e2add1be67 100644 --- a/test-storybooks/external-docs/package.json +++ b/test-storybooks/external-docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/external-docs", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "private": true, "scripts": { "build": "next build", @@ -93,14 +93,14 @@ "storybook": "portal:../../code/lib/cli-storybook" }, "dependencies": { - "@storybook/addon-docs": "7.1.0", - "@storybook/addon-essentials": "7.1.0", - "@storybook/blocks": "7.1.0", - "@storybook/components": "7.1.0", - "@storybook/preview-web": "7.1.0", - "@storybook/react": "7.1.0", - "@storybook/react-webpack5": "7.1.0", - "@storybook/theming": "7.1.0", + "@storybook/addon-docs": "7.2.0-alpha.0", + "@storybook/addon-essentials": "7.2.0-alpha.0", + "@storybook/blocks": "7.2.0-alpha.0", + "@storybook/components": "7.2.0-alpha.0", + "@storybook/preview-web": "7.2.0-alpha.0", + "@storybook/react": "7.2.0-alpha.0", + "@storybook/react-webpack5": "7.2.0-alpha.0", + "@storybook/theming": "7.2.0-alpha.0", "formik": "^2.2.9", "next": "^12.1.0", "nextra": "^1.1.0", @@ -119,7 +119,7 @@ "cross-env": "^7.0.3", "eslint": "8.7.0", "eslint-config-next": "12.0.8", - "storybook": "7.1.0", + "storybook": "7.2.0-alpha.0", "typescript": "~4.9.3", "webpack": "5" } diff --git a/test-storybooks/server-kitchen-sink/package.json b/test-storybooks/server-kitchen-sink/package.json index 8be6d8aabb7d..4e908a34f22e 100644 --- a/test-storybooks/server-kitchen-sink/package.json +++ b/test-storybooks/server-kitchen-sink/package.json @@ -1,6 +1,6 @@ { "name": "server-kitchen-sink", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "private": true, "description": "", "keywords": [], @@ -95,15 +95,15 @@ "storybook": "portal:../../code/lib/cli-storybook" }, "devDependencies": { - "@storybook/addon-a11y": "7.1.0", - "@storybook/addon-actions": "7.1.0", - "@storybook/addon-backgrounds": "7.1.0", - "@storybook/addon-controls": "7.1.0", - "@storybook/addon-highlight": "7.1.0", - "@storybook/addon-links": "7.1.0", - "@storybook/node-logger": "7.1.0", - "@storybook/server": "7.1.0", - "@storybook/server-webpack5": "7.1.0", + "@storybook/addon-a11y": "7.2.0-alpha.0", + "@storybook/addon-actions": "7.2.0-alpha.0", + "@storybook/addon-backgrounds": "7.2.0-alpha.0", + "@storybook/addon-controls": "7.2.0-alpha.0", + "@storybook/addon-highlight": "7.2.0-alpha.0", + "@storybook/addon-links": "7.2.0-alpha.0", + "@storybook/node-logger": "7.2.0-alpha.0", + "@storybook/server": "7.2.0-alpha.0", + "@storybook/server-webpack5": "7.2.0-alpha.0", "concurrently": "^5.3.0", "cors": "^2.8.5", "express": "^4.17.3", @@ -111,6 +111,6 @@ "nodemon": "^2.0.7", "pug": "^3.0.0", "safe-identifier": "^0.4.1", - "storybook": "7.1.0" + "storybook": "7.2.0-alpha.0" } } \ No newline at end of file diff --git a/test-storybooks/standalone-preview/package.json b/test-storybooks/standalone-preview/package.json index 6ae10e4c4a9c..0ff82a1af4f1 100644 --- a/test-storybooks/standalone-preview/package.json +++ b/test-storybooks/standalone-preview/package.json @@ -1,6 +1,6 @@ { "name": "standalone-preview", - "version": "7.1.0", + "version": "7.2.0-alpha.0", "private": true, "scripts": { "storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true NODE_OPTIONS=\"--preserve-symlinks --preserve-symlinks-main\" storybook dev -p 9011 -c ../official-storybook --preview-url=http://localhost:1337/external-iframe.html", @@ -88,14 +88,14 @@ "storybook": "portal:../../code/lib/cli-storybook" }, "devDependencies": { - "@storybook/addon-docs": "7.1.0", - "@storybook/cli": "7.1.0", - "@storybook/react": "7.1.0", - "@storybook/react-webpack5": "7.1.0", + "@storybook/addon-docs": "7.2.0-alpha.0", + "@storybook/cli": "7.2.0-alpha.0", + "@storybook/react": "7.2.0-alpha.0", + "@storybook/react-webpack5": "7.2.0-alpha.0", "cross-env": "^7.0.3", "parcel": "2.0.1", "react": "16.14.0", "react-dom": "16.14.0", - "storybook": "7.1.0" + "storybook": "7.2.0-alpha.0" } } \ No newline at end of file