diff --git a/.circleci/config.yml b/.circleci/config.yml index d6fd64f957e..dc7a22fcf33 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,8 +4,8 @@ parameters: workflow: description: Which workflow to run type: enum - enum: ["ci", "pr", "merged", "daily"] - default: "ci" + enum: ['ci', 'pr', 'merged', 'daily'] + default: 'ci' executors: sb_node_16_classic: @@ -13,8 +13,8 @@ executors: class: description: The Resource class type: enum - enum: ["small", "medium", "medium+", "large", "xlarge"] - default: "small" + enum: ['small', 'medium', 'medium+', 'large', 'xlarge'] + default: 'small' working_directory: /tmp/storybook docker: - image: cimg/node:16.17.1 @@ -26,8 +26,8 @@ executors: class: description: The Resource class type: enum - enum: ["small", "medium", "medium+", "large", "xlarge"] - default: "small" + enum: ['small', 'medium', 'medium+', 'large', 'xlarge'] + default: 'small' working_directory: /tmp/storybook docker: - image: cimg/node:16.17.1-browsers @@ -39,11 +39,11 @@ executors: class: description: The Resource class type: enum - enum: ["small", "medium", "medium+", "large", "xlarge"] - default: "small" + enum: ['small', 'medium', 'medium+', 'large', 'xlarge'] + default: 'small' working_directory: /tmp/storybook docker: - - image: mcr.microsoft.com/playwright:v1.28.0-focal + - image: mcr.microsoft.com/playwright:v1.29.0-focal environment: NODE_OPTIONS: --max_old_space_size=6144 resource_class: <> @@ -55,7 +55,7 @@ orbs: commands: cancel-workflow-on-failure: - description: "Cancels the entire workflow in case the previous step has failed" + description: 'Cancels the entire workflow in case the previous step has failed' steps: - run: name: Cancel current workflow @@ -65,13 +65,13 @@ commands: echo "To execute all checks locally, please run yarn ci-tests" curl -X POST --header "Content-Type: application/json" "https://circleci.com/api/v2/workflow/${CIRCLE_WORKFLOW_ID}/cancel?circle-token=${WORKFLOW_CANCELER}" report-workflow-on-failure: - description: "Reports failures to discord" + description: 'Reports failures to discord' parameters: template: description: | Which template to report in discord. Applicable for parallel sandbox jobs type: string - default: "none" + default: 'none' steps: - run: when: on_fail @@ -87,7 +87,11 @@ jobs: name: sb_node_16_classic steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' + - restore_cache: + name: Restore Yarn cache + keys: + - build-yarn-2-cache-v4--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }} - run: name: Prettier command: | @@ -100,7 +104,7 @@ jobs: name: sb_node_16_classic steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - restore_cache: name: Restore Yarn cache keys: @@ -142,7 +146,7 @@ jobs: working_directory: /tmp/storybook steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -183,7 +187,7 @@ jobs: working_directory: /tmp/storybook steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -223,7 +227,7 @@ jobs: name: sb_node_16_classic steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -239,7 +243,7 @@ jobs: name: sb_node_16_classic steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -253,7 +257,7 @@ jobs: executor: sb_node_16_browsers steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -271,7 +275,7 @@ jobs: name: sb_node_16_browsers steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -293,7 +297,7 @@ jobs: name: sb_node_16_browsers steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -334,7 +338,7 @@ jobs: parallelism: << parameters.parallelism >> steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -359,7 +363,7 @@ jobs: parallelism: << parameters.parallelism >> steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -380,7 +384,7 @@ jobs: parallelism: << parameters.parallelism >> steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -414,7 +418,7 @@ jobs: parallelism: << parameters.parallelism >> steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -455,7 +459,7 @@ jobs: parallelism: << parameters.parallelism >> steps: - git-shallow-clone/checkout_advanced: - clone_options: "--depth 1 --verbose" + clone_options: '--depth 1 --verbose' - attach_workspace: at: . - run: @@ -536,23 +540,23 @@ workflows: requires: - build - create-sandboxes: - parallelism: 8 + parallelism: 9 requires: - build - build-sandboxes: - parallelism: 8 + parallelism: 9 requires: - create-sandboxes - test-runner-sandboxes: - parallelism: 8 + parallelism: 9 requires: - build-sandboxes - chromatic-sandboxes: - parallelism: 8 + parallelism: 9 requires: - build-sandboxes - e2e-sandboxes: - parallelism: 8 + parallelism: 9 requires: - build-sandboxes merged: @@ -586,23 +590,23 @@ workflows: requires: - build - create-sandboxes: - parallelism: 14 + parallelism: 15 requires: - build - build-sandboxes: - parallelism: 14 + parallelism: 15 requires: - create-sandboxes - test-runner-sandboxes: - parallelism: 14 + parallelism: 15 requires: - build-sandboxes - chromatic-sandboxes: - parallelism: 14 + parallelism: 15 requires: - build-sandboxes - e2e-sandboxes: - parallelism: 14 + parallelism: 15 requires: - build-sandboxes daily: @@ -611,25 +615,25 @@ workflows: jobs: - build - create-sandboxes: - parallelism: 23 + parallelism: 26 requires: - build # - smoke-test-sandboxes: # disabled for now # requires: # - create-sandboxes - build-sandboxes: - parallelism: 23 + parallelism: 26 requires: - create-sandboxes - test-runner-sandboxes: - parallelism: 23 + parallelism: 26 requires: - build-sandboxes - chromatic-sandboxes: - parallelism: 23 + parallelism: 26 requires: - build-sandboxes - e2e-sandboxes: - parallelism: 23 + parallelism: 26 requires: - build-sandboxes diff --git a/CHANGELOG.md b/CHANGELOG.md index 37bc4138dbe..15ad1a1aa74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,189 @@ +## 7.0.0-beta.12 (December 16, 2022) + +#### Other + +- Revert "Core: Wrap manager entries to handle exports" [#20311](https://github.com/storybooks/storybook/pull/20311) + +## 7.0.0-beta.11 (December 16, 2022) + +#### Features + +- CLI: Improve automigration to show prompt-only migrations [#20292](https://github.com/storybooks/storybook/pull/20292) + +#### Bug Fixes + +- Angular: Fix webpackStatsJson types in angular-builder [#20296](https://github.com/storybooks/storybook/pull/20296) +- Fix: addon-storysource has no managerEntry, but defines a register and preset [#20304](https://github.com/storybooks/storybook/pull/20304) + +#### Maintenance + +- Core: Wrap manager entries to handle exports [#20308](https://github.com/storybooks/storybook/pull/20308) +- Core: improve manager-entries failure message [#20306](https://github.com/storybooks/storybook/pull/20306) +- Telemetry: Fix flakey test [#20282](https://github.com/storybooks/storybook/pull/20282) + +#### Dependency Upgrades + +- Vite: Make vite a peer dependency, update plugins [#20281](https://github.com/storybooks/storybook/pull/20281) +- Vite/Svelte: Remove addon-svelte-csf dep [#20280](https://github.com/storybooks/storybook/pull/20280) + +## 7.0.0-beta.10 (December 16, 2022) + +#### Build + +- Build: compile detection was using a non-conforming package, causing cache to miss always. [#20297](https://github.com/storybooks/storybook/pull/20297) + +#### Dependency Upgrades + +- React-vite: Pin react-docgen version [#20300](https://github.com/storybooks/storybook/pull/20300) + +## 7.0.0-beta.9 (December 16, 2022) + +#### Features + +- CLI: Add interactive babel config file generation [#20234](https://github.com/storybooks/storybook/pull/20234) +- CLI: Add automigration summary [#20276](https://github.com/storybooks/storybook/pull/20276) + +#### Bug Fixes + +- UI: Fix `enableShortcuts` support in `manager.ts` [#20264](https://github.com/storybooks/storybook/pull/20264) +- UI: Ensure manager entries load even if preceding ones failed [#20286](https://github.com/storybooks/storybook/pull/20286) +- Addon-viewport: Fix composition support [#20289](https://github.com/storybooks/storybook/pull/20289) +- Support Angular 15.0.4 [#20287](https://github.com/storybooks/storybook/pull/20287) +- Fix: peerDependencies issues reported [#20279](https://github.com/storybooks/storybook/pull/20279) + +#### Build + +- Build: ui/.storybook should not import from dist [#20284](https://github.com/storybooks/storybook/pull/20284) +- Build: bundle script a bit less repetitive, add a completion indicator [#20277](https://github.com/storybooks/storybook/pull/20277) +- Build: regen lockfiles [#20278](https://github.com/storybooks/storybook/pull/20278) + +## 7.0.0-beta.8 (December 14, 2022) + +#### Features + +- Addon-docs: Use jsxOptions instead of mdxBabelOptions [#20271](https://github.com/storybooks/storybook/pull/20271) + +#### Maintenance + +- Svelte-vite: remove `svelteOptions` in automigration [#20270](https://github.com/storybooks/storybook/pull/20270) + +#### Build + +- Fix handling of inverted yes flag in `task` steps [#20268](https://github.com/storybooks/storybook/pull/20268) + +## 7.0.0-beta.7 (December 14, 2022) + +#### Features + +- CLI: Add Next.js framework automigration [#19574](https://github.com/storybooks/storybook/pull/19574) + +#### Bug Fixes + +- Don't export renderer from framework [#20259](https://github.com/storybooks/storybook/pull/20259) +- Upgrade sb dep as well in sb upgrade [#20258](https://github.com/storybooks/storybook/pull/20258) +- Vite: Make the bail function work if the server fails to start [#20243](https://github.com/storybooks/storybook/pull/20243) +- Csf-tools: Fix local vars handling in MDX-generated CSF [#20255](https://github.com/storybooks/storybook/pull/20255) +- Csf-plugin: Fix spurious storiesOf warnings [#20256](https://github.com/storybooks/storybook/pull/20256) +- Core: Remove unnecessary peer deps [#20231](https://github.com/storybooks/storybook/pull/20231) +- Fix issues with running SSv6 [#20253](https://github.com/storybooks/storybook/pull/20253) +- Core: Fix config.base relative paths [#20232](https://github.com/storybooks/storybook/pull/20232) +- Fix: vite devmode with storyStoreV6 by ensuring singleton via global [#20207](https://github.com/storybooks/storybook/pull/20207) + +#### Maintenance + +- Addon-docs: Upgrade mdx2-csf and use its JSX handling [#20261](https://github.com/storybooks/storybook/pull/20261) +- Vite: Use mdx2 babel pre-processing [#20241](https://github.com/storybooks/storybook/pull/20241) +- Addon-docs: Restore deprecated blocks entry point [#20246](https://github.com/storybooks/storybook/pull/20246) + +#### Build + +- Add Next 12 sandbox [#20092](https://github.com/storybooks/storybook/pull/20092) + +#### Dependency Upgrades + +- Add optional TypeScript peer dependency [#20244](https://github.com/storybooks/storybook/pull/20244) + +## 7.0.0-beta.6 (December 14, 2022) + +#### Dependency Upgrades + +- Vite: Use Vite 3 (temporarily) [#20216](https://github.com/storybooks/storybook/pull/20216) + +## 7.0.0-beta.5 (December 13, 2022) + +#### Features + +- CLI: Split sb-scripts into two different migrations [#20223](https://github.com/storybooks/storybook/pull/20223) + +#### Bug Fixes + +- Vite: Support async Vite plugins [#20194](https://github.com/storybooks/storybook/pull/20194) +- Telemetry: Don't send boot event when cliOptions.disableTelemetry is passed [#20144](https://github.com/storybooks/storybook/pull/20144) + +#### Maintenance + +- CLI: Add React peer dep runtime check [#20206](https://github.com/storybooks/storybook/pull/20206) + +#### Dependency Upgrades + +- Upgrade esbuild [#20199](https://github.com/storybooks/storybook/pull/20199) + +## 7.0.0-beta.4 (December 13, 2022) + +#### Features + +- Re-enable TS 4.9 CLI templates [#20159](https://github.com/storybooks/storybook/pull/20159) + +#### Bug Fixes + +- CLI: execute automigrations when pressing enter in the prompts [#20208](https://github.com/storybooks/storybook/pull/20208) +- Interactions: Fix storyId access in instrumenter [#20201](https://github.com/storybooks/storybook/pull/20201) +- Typescript: Fix bug with meta not working well as generic parameter for StoryObj [#20165](https://github.com/storybooks/storybook/pull/20165) +- SvelteKit: Support `v1.0.0-next.574` and above [#20181](https://github.com/storybooks/storybook/pull/20181) + +#### Build + +- Svelte: Fix argTypes inference in Button component [#20212](https://github.com/storybooks/storybook/pull/20212) +- React-Vite: Ignore React MDX stories in sandbox [#20210](https://github.com/storybooks/storybook/pull/20210) + +## 7.0.0-beta.3 (December 10, 2022) + +#### Bug Fixes + +- CLI: Fix sb migrate codemods [#20191](https://github.com/storybooks/storybook/pull/20191) +- Measure: Fix measure not working on disabled elements [#19985](https://github.com/storybooks/storybook/pull/19985) + +#### Maintenance + +- SvelteKit: Automigration [#20094](https://github.com/storybooks/storybook/pull/20094) +- Tech: change `package.json` engines fields, set to minimal node16 and up [#20170](https://github.com/storybooks/storybook/pull/20170) + +## 7.0.0-beta.2 (December 9, 2022) + +#### Bug Fixes + +- Core: Catch and do nothing to avoid triggering unhandled exception problems [#20177](https://github.com/storybooks/storybook/pull/20177) +- Controls: Fix color control not resetting when initial value is defined [#20049](https://github.com/storybooks/storybook/pull/20049) +- Core: Fix typescript.checkOptions not a valid interface [#20166](https://github.com/storybooks/storybook/pull/20166) +- NextJS: Fixlogic around `next/future/image` [#20173](https://github.com/storybooks/storybook/pull/20173) + +#### Maintenance + +- Revert "Revert "Telemetry: Add precedingUpgrade data to dev/build/error events"" [#20176](https://github.com/storybooks/storybook/pull/20176) +- Telemetry: Add `chromatic` to addons list [#20143](https://github.com/storybooks/storybook/pull/20143) +- Vite: Support vite 4 [#20139](https://github.com/storybooks/storybook/pull/20139) + +## 7.0.0-beta.1 (December 9, 2022) + +#### Bug Fixes + +- Revert "Telemetry: Add precedingUpgrade data to dev/build/error events" [#20168](https://github.com/storybooks/storybook/pull/20168) +- Controls: Fix file controls not resetting [#19998](https://github.com/storybooks/storybook/pull/19998) + +#### Dependency Upgrades + +- Upgrade express to fix security warning [#20152](https://github.com/storybooks/storybook/pull/20152) + ## 7.0.0-beta.0 (December 8, 2022) We made it to beta, folks! 🎉 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 28168c64250..77e310a21bf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Getting started -- Ensure you have node version 14 installed (suggestion: v14.18.1). +- Ensure you have node version 16 installed (suggestion: v16.5). - Ensure if you are using Windows to use the Windows Subsystem for Linux (WSL). - Run `yarn start` directory to run a basic test Storybook "sandbox". diff --git a/MIGRATION.md b/MIGRATION.md index eef9f812750..27aaacc41ca 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -23,10 +23,10 @@ - [7.0 feature flags removed](#70-feature-flags-removed) - [CLI option `--use-npm` deprecated](#cli-option---use-npm-deprecated) - [Vite builder uses vite config automatically](#vite-builder-uses-vite-config-automatically) - - [Vite cache moved to node\_modules/.cache/.vite-storybook](#vite-cache-moved-to-node_modulescachevite-storybook) + - [Vite cache moved to node_modules/.cache/.vite-storybook](#vite-cache-moved-to-node_modulescachevite-storybook) - [SvelteKit needs the `@storybook/sveltekit` framework](#sveltekit-needs-the-storybooksveltekit-framework) - [Removed docs.getContainer and getPage parameters](#removed-docsgetcontainer-and-getpage-parameters) - - [Removed STORYBOOK\_REACT\_CLASSES global](#removed-storybook_react_classes-global) + - [Removed STORYBOOK_REACT_CLASSES global](#removed-storybook_react_classes-global) - [Icons API changed](#icons-api-changed) - ['config' preset entry replaced with 'previewAnnotations'](#config-preset-entry-replaced-with-previewannotations) - [Dropped support for Angular 12 and below](#dropped-support-for-angular-12-and-below) @@ -34,6 +34,7 @@ - [Addon-docs: Removed deprecated blocks.js entry](#addon-docs-removed-deprecated-blocksjs-entry) - [Addon-a11y: Removed deprecated withA11y decorator](#addon-a11y-removed-deprecated-witha11y-decorator) - [Stories glob matches MDX files](#stories-glob-matches-mdx-files) + - [Add strict mode](#add-strict-mode) - [Docs Changes](#docs-changes) - [Standalone docs files](#standalone-docs-files) - [Referencing stories in docs files](#referencing-stories-in-docs-files) @@ -44,6 +45,7 @@ - [Default docs styles will leak into non-story user components](#default-docs-styles-will-leak-into-non-story-user-components) - [Explicit `` elements are no longer syntax highlighted](#explicit-code-elements-are-no-longer-syntax-highlighted) - [Dropped source loader / storiesOf static snippets](#dropped-source-loader--storiesof-static-snippets) + - [Dropped addon-docs manual babel configuration](#dropped-addon-docs-manual-babel-configuration) - [Dropped addon-docs manual configuration](#dropped-addon-docs-manual-configuration) - [Autoplay in docs](#autoplay-in-docs) - [7.0 Deprecations](#70-deprecations) @@ -275,6 +277,7 @@ To upgrade manually, add any version of `react` and `react-dom` as devDependenci ``` npm add react react-dom --dev ``` + #### Postcss removed Storybook 6.x installed postcss by default. In 7.0 built-in support has been removed. IF you need it, you can add it back using [`@storybook/addon-postcss`](https://github.com/storybookjs/addon-postcss). @@ -586,6 +589,8 @@ When using a [Vite-based framework](#framework-field-mandatory), Storybook will Some settings will be overridden by storybook so that it can function properly, and the merged settings can be modified using `viteFinal` in `.storybook/main.js` (see the [Storybook Vite configuration docs](https://storybook.js.org/docs/react/builders/vite#configuration)). If you were using `viteFinal` in 6.5 to simply merge in your project's standard vite config, you can now remove it. +For Svelte projects this means that the `svelteOptions` property in the `main.js` config should be omitted, as it will be loaded automatically via the project's `vite.config.js`. An exception to this is when the project needs different Svelte options for Storybook than the Vite config provides for the application itself. + #### Vite cache moved to node_modules/.cache/.vite-storybook Previously, Storybook's Vite builder placed cache files in node_modules/.vite-storybook. However, it's more common for tools to place cached files into `node_modules/.cache`, and putting them there makes it quick and easy to clear the cache for multiple tools at once. We don't expect this change will cause any problems, but it's something that users of Storybook Vite projects should know about. It can be configured by setting `cacheDir` in `viteFinal` within `.storybook/main.js` [Storybook Vite configuration docs](https://storybook.js.org/docs/react/builders/vite#configuration)). @@ -601,6 +606,8 @@ export default { }; ``` +Also see the note in [Vite builder uses vite config automatically](#vite-builder-uses-vite-config-automatically) about removing `svelteOptions`. + #### Removed docs.getContainer and getPage parameters It is no longer possible to set `parameters.docs.getContainer()` and `getPage()`. Instead use `parameters.docs.container` or `parameters.docs.page` directly. @@ -643,7 +650,7 @@ Starting in 7.0 the `grid.cellSize` parameter should now be `backgrounds.grid.ce #### Addon-docs: Removed deprecated blocks.js entry -Removed `@storybook/addon-docs/blocks` entry. Import directly from `@storybook/addon-docs` instead. This was [deprecated in SB 6.3](#deprecated-scoped-blocks-imports). +Removed `@storybook/addon-docs/blocks` entry. Import directly from `@storybook/blocks` instead. This was [deprecated in SB 6.3](#deprecated-scoped-blocks-imports). #### Addon-a11y: Removed deprecated withA11y decorator @@ -673,6 +680,12 @@ export default { }; ``` +#### Add strict mode + +Starting in 7.0, Storybook's build tools add [`"use strict"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) to the compiled JS output. + +If user code in `.storybook/preview.js` or stories relies on "sloppy" mode behavior, it will need to be updated. As a workaround, it is sometimes possible to move the sloppy mode code inside a script tag in `.storybook/preview-head.html`. + ### Docs Changes The information hierarchy of docs in Storybook has changed in 7.0. The main difference is that each docs is listed in the sidebar as a separate entry, rather than attached to individual stories. @@ -900,6 +913,10 @@ module.exports = { }; ``` +#### Dropped addon-docs manual babel configuration + +Addon-docs previously accepted `configureJsx` and `mdxBabelOptions` options, which allowed full customization of the babel options used to process markdown and mdx files. This has been simplified in 7.0, with a new option, `jsxOptions`, which can be used to customize the behavior of `@babel/preset-react`. + #### Dropped addon-docs manual configuration Storybook Docs 5.x shipped with instructions for how to manually configure webpack and storybook without the use of Storybook's "presets" feature. Over time, these docs went out of sync. Now in Storybook 7 we have removed support for manual configuration entirely. diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index 1e8735a1795..f1812f7d4fa 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", @@ -63,22 +63,23 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addon-highlight": "7.0.0-beta.0", - "@storybook/channels": "7.0.0-beta.0", - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/addon-highlight": "7.0.0-beta.12", + "@storybook/channels": "7.0.0-beta.12", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "axe-core": "^4.2.0", "global": "^4.4.0", "lodash": "^4.17.21", - "react-sizeme": "^3.0.1" + "react-resize-detector": "^7.1.2" }, "devDependencies": { "@testing-library/react": "^11.2.2", + "resize-observer-polyfill": "^1.5.1", "typescript": "~4.9.3" }, "peerDependencies": { @@ -103,7 +104,7 @@ "./src/preview.tsx" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Accessibility", "icon": "https://user-images.githubusercontent.com/263385/101991665-47042f80-3c7c-11eb-8f00-64b5a18f498a.png", diff --git a/code/addons/a11y/src/components/A11YPanel.test.tsx b/code/addons/a11y/src/components/A11YPanel.test.tsx index 4aa43f866eb..cb1be531cad 100644 --- a/code/addons/a11y/src/components/A11YPanel.test.tsx +++ b/code/addons/a11y/src/components/A11YPanel.test.tsx @@ -8,6 +8,9 @@ import { A11YPanel } from './A11YPanel'; import { EVENTS } from '../constants'; jest.mock('@storybook/manager-api'); + +global.ResizeObserver = require('resize-observer-polyfill'); + const mockedApi = api as jest.Mocked; const axeResult = { diff --git a/code/addons/a11y/src/components/Report/Rules.tsx b/code/addons/a11y/src/components/Report/Rules.tsx index 7bbffcc73c1..fa7bb73ea8f 100644 --- a/code/addons/a11y/src/components/Report/Rules.tsx +++ b/code/addons/a11y/src/components/Report/Rules.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { styled } from '@storybook/theming'; import { Badge } from '@storybook/components'; import type { CheckResult } from 'axe-core'; -import { SizeMe } from 'react-sizeme'; +import ReactResizeDetector from 'react-resize-detector'; const List = styled.div({ display: 'flex', @@ -71,14 +71,14 @@ const Rule: FC = ({ rule }) => { break; } return ( - - {({ size }) => ( + + {(size) => ( {formatSeverityText(rule.impact)} {rule.message} )} - + ); }; diff --git a/code/addons/a11y/src/components/Tabs.tsx b/code/addons/a11y/src/components/Tabs.tsx index 913988d776e..aef69aafaac 100644 --- a/code/addons/a11y/src/components/Tabs.tsx +++ b/code/addons/a11y/src/components/Tabs.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { styled } from '@storybook/theming'; import type { NodeResult, Result } from 'axe-core'; -import { SizeMe } from 'react-sizeme'; +import ReactResizeDetector from 'react-resize-detector'; import HighlightToggle from './Report/HighlightToggle'; import type { RuleType } from './A11YPanel'; @@ -111,8 +111,8 @@ export const Tabs: React.FC = ({ tabs }) => { const highlightToggleId = `${tabs[activeTab].type}-global-checkbox`; const highlightLabel = `Highlight results`; return ( - - {({ size }) => ( + + {(size) => ( @@ -143,6 +143,6 @@ export const Tabs: React.FC = ({ tabs }) => { {tabs[activeTab].panel} )} - + ); }; diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index 5511312c635..fa8373392b9 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", @@ -77,13 +77,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "dequal": "^2.0.2", "global": "^4.4.0", "lodash": "^4.17.21", @@ -121,7 +121,7 @@ "./src/preview.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Actions", "unsupportedFrameworks": [ diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 5c2eed0ed3d..cf5d58c76c1 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", @@ -76,13 +76,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "memoizerific": "^1.11.3", "ts-dedent": "^2.0.0" @@ -112,7 +112,7 @@ "./src/preview.tsx" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Backgrounds", "icon": "https://user-images.githubusercontent.com/263385/101991667-479cc600-3c7c-11eb-96d3-410e936252e7.png", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 57be193499c..0192d7aa82e 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "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.0.0-beta.0", - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/blocks": "7.0.0-beta.12", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "lodash": "^4.17.21", "ts-dedent": "^2.0.0" }, @@ -102,7 +102,7 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Controls", "icon": "https://user-images.githubusercontent.com/263385/101991669-479cc600-3c7c-11eb-93d9-38b67e8371f2.png", diff --git a/code/addons/docs/README.md b/code/addons/docs/README.md index a1309f736b1..d1c70d818f9 100644 --- a/code/addons/docs/README.md +++ b/code/addons/docs/README.md @@ -4,13 +4,13 @@ # Storybook Docs -> migration guide: This page documents the method to configure storybook introduced recently in 5.3.0, consult the [migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md) if you want to migrate to this format of configuring storybook. +> migration guide: This page documents the method to configure Storybook introduced recently in 7.0.0, consult the [migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md) if you want to migrate to this format of configuring Storybook. Storybook Docs transforms your Storybook stories into world-class component documentation. **DocsPage.** Out of the box, all your stories get a `DocsPage`. `DocsPage` is a zero-config aggregation of your component stories, text descriptions, docgen comments, props tables, and code examples into clean, readable pages. -**MDX.** If you want more control, `MDX` allows you to write long-form markdown documentation and stories in one file. You can also use it to write pure documentation pages and embed them inside your Storybook alongside your stories. +**MDX.** If you want more control, `MDX` allows you to write long-form markdown documentation and include stories in one file. You can also use it to write pure documentation pages and embed them inside your Storybook alongside your stories. Just like Storybook, Docs supports every major view layer including React, Vue, Angular, HTML, Web components, Svelte, and many more. @@ -40,32 +40,30 @@ For more information on how it works, see the [`DocsPage` reference](https://git ## MDX -`MDX` is a syntax for writing long-form documentation and stories side-by-side in the same file. In contrast to `DocsPage`, which provides smart documentation out of the box, `MDX` gives you full control over your component documentation. +`MDX` is a syntax for writing long-form documentation with stories side-by-side in the same file. In contrast to `DocsPage`, which provides smart documentation out of the box, `MDX` gives you full control over your component documentation. Here's an example file: -```md -import { Meta, Story, Canvas } from '@storybook/addon-docs'; -import { Checkbox } from './Checkbox'; + - +```md +import { Meta, Story, Canvas } from '@storybook/blocks'; +import * as CheckboxStories from './Checkbox.stories'; + + # Checkbox -With `MDX` we can define a story for `Checkbox` right in the middle of our +With `MDX` we can include a story for `Checkbox` right in the middle of our markdown documentation. - -
- - - - -
+
``` + + And here's how that's rendered in Storybook:
@@ -102,8 +100,13 @@ Then add the following to your `.storybook/main.js`: ```js module.exports = { - stories: ['../src/**/*.stories.@(js|mdx)'], - addons: ['@storybook/addon-docs'], + stories: [ + '../src/**/*.mdx)', // 👈 Add this, to match your project's structure + '../src/**/*.stories.@(js|jsx|ts|tsx)', + ], + addons: [ + '@storybook/addon-docs', // 👈 Also add this + ], }; ``` @@ -140,8 +143,7 @@ module.exports = { { name: '@storybook/addon-docs', options: { - configureJSX: true, - babelOptions: {}, + jsxOptions: {}, csfPluginOptions: null, transcludeMarkdown: true, }, @@ -150,7 +152,7 @@ module.exports = { }; ``` -The `configureJSX` option is useful when you're writing your docs in MDX and your project's babel config isn't already set up to handle JSX files. `babelOptions` is a way to further configure the babel processor when you're using `configureJSX`. +`jsxOptions` are options that will be passed to `@babel/preset-react` for `.md` and `.mdx` files. `csfPluginOptions` is an object for configuring `@storybook/csf-plugin`. When set to `null` it tells docs not to run the `csf-plugin` at all, which can be used as an optimization, or if you're already using `csf-plugin` in your `main.js`. diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 5f7551f7707..0dee7e2450f 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", @@ -41,6 +41,11 @@ "import": "./dist/preset.mjs", "types": "./dist/preset.d.ts" }, + "./blocks": { + "require": "./dist/blocks.js", + "import": "./dist/blocks.mjs", + "types": "./dist/blocks.d.ts" + }, "./dist/preview": { "require": "./dist/preview.js", "import": "./dist/preview.mjs", @@ -98,16 +103,16 @@ "@babel/plugin-transform-react-jsx": "^7.19.0", "@jest/transform": "^29.3.1", "@mdx-js/react": "^2.1.5", - "@storybook/blocks": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/csf-plugin": "7.0.0-beta.0", - "@storybook/csf-tools": "7.0.0-beta.0", + "@storybook/blocks": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/csf-plugin": "7.0.0-beta.12", + "@storybook/csf-tools": "7.0.0-beta.12", "@storybook/mdx2-csf": "next", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/postinstall": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/postinstall": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "fs-extra": "^9.0.1", "global": "^4.4.0", "remark-external-links": "^8.0.0", @@ -131,10 +136,11 @@ "./src/index.ts", "./src/preset.ts", "./src/preview.ts", + "./src/blocks.ts", "./src/shims/mdx-react-shim.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Docs", "icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png", diff --git a/code/addons/docs/postinstall/presets.js b/code/addons/docs/postinstall/presets.js index e503cacc839..dd08ffa240b 100644 --- a/code/addons/docs/postinstall/presets.js +++ b/code/addons/docs/postinstall/presets.js @@ -24,9 +24,7 @@ export default function transformer(file, api) { ((dependencies && dependencies['react-scripts']) || (devDependencies && devDependencies['react-scripts'])) ) { - presetOptions = { - configureJSX: true, - }; + presetOptions = {}; } const j = api.jscodeshift; diff --git a/code/addons/docs/src/blocks.ts b/code/addons/docs/src/blocks.ts new file mode 100644 index 00000000000..34260b6785c --- /dev/null +++ b/code/addons/docs/src/blocks.ts @@ -0,0 +1,7 @@ +import { deprecate } from '@storybook/client-logger'; + +deprecate( + "Import from '@storybook/addon-docs/blocks' is deprecated. Please import from '@storybook/blocks' instead." +); + +export * from '@storybook/blocks'; diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index 6908afe4a03..5e1ce614619 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -5,64 +5,42 @@ import { dedent } from 'ts-dedent'; import type { IndexerOptions, StoryIndexer, DocsOptions, Options } from '@storybook/types'; import type { CsfPluginOptions } from '@storybook/csf-plugin'; +import type { JSXOptions } from '@storybook/mdx2-csf'; import { loadCsf } from '@storybook/csf-tools'; -// for frameworks that are not working with react, we need to configure -// the jsx to transpile mdx, for now there will be a flag for that -// for more complex solutions we can find alone that we need to add '@babel/plugin-transform-react-jsx' -type BabelParams = { - mdxBabelOptions?: any; - configureJSX?: boolean; -}; -function createBabelOptions({ mdxBabelOptions, configureJSX }: BabelParams) { - const babelPlugins = mdxBabelOptions?.plugins || []; - - const filteredBabelPlugins = babelPlugins.filter((p: any) => { - const name = Array.isArray(p) ? p[0] : p; - if (typeof name === 'string') { - return !name.includes('plugin-transform-react-jsx'); - } - return true; - }); - - const jsxPlugin = [ - require.resolve('@babel/plugin-transform-react-jsx'), - { pragma: 'React.createElement', pragmaFrag: 'React.Fragment' }, - ]; - const plugins = configureJSX ? [...filteredBabelPlugins, jsxPlugin] : babelPlugins; - return { - // don't use the root babelrc by default (users can override this in mdxBabelOptions) - babelrc: false, - configFile: false, - ...mdxBabelOptions, - plugins, - }; -} - async function webpack( webpackConfig: any = {}, - options: Options & - BabelParams & { - /** @deprecated */ - sourceLoaderOptions: any; - csfPluginOptions: CsfPluginOptions | null; - transcludeMarkdown: boolean; - } /* & Parameters< + options: Options & { + /** + * @deprecated + * Use `jsxOptions` to customize options used by @babel/preset-react + */ + configureJsx: boolean; + /** + * @deprecated + * Use `jsxOptions` to customize options used by @babel/preset-react + */ + mdxBabelOptions?: any; + /** @deprecated */ + sourceLoaderOptions: any; + csfPluginOptions: CsfPluginOptions | null; + transcludeMarkdown: boolean; + jsxOptions?: JSXOptions; + } /* & Parameters< typeof createCompiler >[0] */ ) { - const resolvedBabelLoader = await options.presets.apply('babelLoaderRef'); - const { module = {} } = webpackConfig; // it will reuse babel options that are already in use in storybook // also, these babel options are chained with other presets. const { - mdxBabelOptions, - configureJSX = true, csfPluginOptions = {}, - sourceLoaderOptions = null, + jsxOptions = {}, transcludeMarkdown = false, + sourceLoaderOptions = null, + configureJsx, + mdxBabelOptions, } = options; const mdxLoaderOptions = await options.presets.apply('mdxLoaderOptions', { @@ -71,6 +49,7 @@ async function webpack( providerImportSource: '@storybook/addon-docs/mdx-react-shim', remarkPlugins: [remarkSlug, remarkExternalLinks], }, + jsxOptions, }); if (sourceLoaderOptions) { @@ -83,6 +62,16 @@ async function webpack( `); } + if (mdxBabelOptions || configureJsx) { + throw new Error(dedent` + Addon-docs no longer uses configureJsx or mdxBabelOptions in 7.0. + + To update your configuration, please see migration instructions here: + + https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#dropped-addon-docs-manual-babel-configuration + `); + } + const mdxLoader = require.resolve('@storybook/mdx2-csf/loader'); let rules = module.rules || []; @@ -92,10 +81,6 @@ async function webpack( { test: /\.md$/, use: [ - { - loader: resolvedBabelLoader, - options: createBabelOptions({ mdxBabelOptions, configureJSX }), - }, { loader: mdxLoader, options: mdxLoaderOptions, @@ -120,10 +105,6 @@ async function webpack( { test: /(stories|story)\.mdx$/, use: [ - { - loader: resolvedBabelLoader, - options: createBabelOptions({ mdxBabelOptions, configureJSX }), - }, { loader: mdxLoader, options: { @@ -137,10 +118,6 @@ async function webpack( test: /\.mdx$/, exclude: /(stories|story)\.mdx$/, use: [ - { - loader: resolvedBabelLoader, - options: createBabelOptions({ mdxBabelOptions, configureJSX }), - }, { loader: mdxLoader, options: mdxLoaderOptions, diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index d26fcb75601..d596db98fd2 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "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.0.0-beta.0", - "@storybook/addon-backgrounds": "7.0.0-beta.0", - "@storybook/addon-controls": "7.0.0-beta.0", - "@storybook/addon-docs": "7.0.0-beta.0", - "@storybook/addon-highlight": "7.0.0-beta.0", - "@storybook/addon-measure": "7.0.0-beta.0", - "@storybook/addon-outline": "7.0.0-beta.0", - "@storybook/addon-toolbars": "7.0.0-beta.0", - "@storybook/addon-viewport": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", + "@storybook/addon-actions": "7.0.0-beta.12", + "@storybook/addon-backgrounds": "7.0.0-beta.12", + "@storybook/addon-controls": "7.0.0-beta.12", + "@storybook/addon-docs": "7.0.0-beta.12", + "@storybook/addon-highlight": "7.0.0-beta.12", + "@storybook/addon-measure": "7.0.0-beta.12", + "@storybook/addon-outline": "7.0.0-beta.12", + "@storybook/addon-toolbars": "7.0.0-beta.12", + "@storybook/addon-viewport": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", "ts-dedent": "^2.0.0" }, "devDependencies": { - "@storybook/vue": "7.0.0-beta.0", + "@storybook/vue": "7.0.0-beta.12", "typescript": "^4.9.3" }, "peerDependencies": { @@ -166,5 +166,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index ed0e29e063e..0c0b284858a 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", @@ -61,8 +61,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", "global": "^4.4.0" }, "devDependencies": { @@ -78,7 +78,7 @@ "./src/preview.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "sbmodern": "dist/modern/index.js", "storybook": { "displayName": "Highlight", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 6bf239c6139..de57e5f5d38 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", @@ -72,15 +72,15 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/instrumenter": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/instrumenter": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "jest-mock": "^27.0.6", "polished": "^4.2.2", @@ -118,7 +118,7 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Interactions", "unsupportedFrameworks": [ diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 3d46eb7a6e8..5d51346046d 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "React storybook addon that show component jest report", "keywords": [ "addon", @@ -70,14 +70,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", "global": "^4.4.0", - "react-sizeme": "^3.0.1", + "react-resize-detector": "^7.1.2", "upath": "^1.2.0" }, "devDependencies": { @@ -105,7 +105,7 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Jest", "icon": "https://pbs.twimg.com/profile_images/821713465245102080/mMtKIMax_400x400.jpg", diff --git a/code/addons/jest/src/components/Panel.tsx b/code/addons/jest/src/components/Panel.tsx index 2202b05210f..cba956f1ec0 100644 --- a/code/addons/jest/src/components/Panel.tsx +++ b/code/addons/jest/src/components/Panel.tsx @@ -2,10 +2,10 @@ import type { FC } from 'react'; import React, { Fragment } from 'react'; import { styled, themes, convert } from '@storybook/theming'; import { ScrollArea, TabsState, Link, Placeholder } from '@storybook/components'; -import { SizeMe } from 'react-sizeme'; -import Result from './Result'; +import ResizeObserver from 'react-resize-detector'; +import { Result } from './Result'; import type { Test } from '../hoc/provideJestResult'; -import provideJestResult from '../hoc/provideJestResult'; +import { provideTests as provideJestResult } from '../hoc/provideJestResult'; const StatusTypes = { PASSED_TYPE: 'passed', @@ -134,8 +134,8 @@ const Content = styled(({ tests, className }: ContentProps) => ( const sortedTestsByCount = [...entries].sort((a, b) => a[1].length - b[1].length); return ( - - {({ size }: { size: any }) => { + + {(size) => { const { width } = size; return (
@@ -259,7 +259,7 @@ const Content = styled(({ tests, className }: ContentProps) => (
); }} -
+ ); })} diff --git a/code/addons/jest/src/components/Result.tsx b/code/addons/jest/src/components/Result.tsx index 054118a804e..c40d15b522d 100644 --- a/code/addons/jest/src/components/Result.tsx +++ b/code/addons/jest/src/components/Result.tsx @@ -86,5 +86,3 @@ export function Result(props: ResultProps) { ); } - -export default Result; diff --git a/code/addons/jest/src/hoc/provideJestResult.tsx b/code/addons/jest/src/hoc/provideJestResult.tsx index d74f100c7ac..d1cad23b25f 100644 --- a/code/addons/jest/src/hoc/provideJestResult.tsx +++ b/code/addons/jest/src/hoc/provideJestResult.tsx @@ -37,7 +37,7 @@ export interface HocState { tests?: Test[]; } -const provideTests = (Component: ComponentType) => +export const provideTests = (Component: ComponentType) => class TestProvider extends ReactComponent { state: HocState = {}; @@ -82,5 +82,3 @@ const provideTests = (Component: ComponentType) => return active ? : null; } }; - -export default provideTests; diff --git a/code/addons/links/package.json b/code/addons/links/package.json index b3eeb1692e8..42f17d52782 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "addon", @@ -77,13 +77,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", "@storybook/csf": "next", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/router": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/router": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "prop-types": "^15.7.2", "ts-dedent": "^2.0.0" @@ -114,7 +114,7 @@ "./src/react/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Links", "icon": "https://user-images.githubusercontent.com/263385/101991673-48355c80-3c7c-11eb-9b6e-b627c96a75f6.png", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 2c3b1d03b38..8e9e12cb9cb 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", @@ -75,12 +75,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0" }, "devDependencies": { @@ -108,7 +108,7 @@ "./src/preview.tsx" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Measure", "unsupportedFrameworks": [ diff --git a/code/addons/measure/src/withMeasure.ts b/code/addons/measure/src/withMeasure.ts index e821e6f8c90..8a6b2a41489 100644 --- a/code/addons/measure/src/withMeasure.ts +++ b/code/addons/measure/src/withMeasure.ts @@ -17,7 +17,7 @@ export const withMeasure = (StoryFn: StoryFunction, context: StoryCont const { measureEnabled } = context.globals; useEffect(() => { - const onMouseMove = (event: MouseEvent) => { + const onPointerMove = (event: MouseEvent) => { window.requestAnimationFrame(() => { event.stopPropagation(); pointer.x = event.clientX; @@ -25,15 +25,15 @@ export const withMeasure = (StoryFn: StoryFunction, context: StoryCont }); }; - document.addEventListener('mousemove', onMouseMove); + document.addEventListener('pointermove', onPointerMove); return () => { - document.removeEventListener('mousemove', onMouseMove); + document.removeEventListener('pointermove', onPointerMove); }; }, []); useEffect(() => { - const onMouseOver = (event: MouseEvent) => { + const onPointerOver = (event: MouseEvent) => { window.requestAnimationFrame(() => { event.stopPropagation(); findAndDrawElement(event.clientX, event.clientY); @@ -47,7 +47,7 @@ export const withMeasure = (StoryFn: StoryFunction, context: StoryCont }; if (measureEnabled) { - document.addEventListener('mouseover', onMouseOver); + document.addEventListener('pointerover', onPointerOver); init(); window.addEventListener('resize', onResize); // Draw the element below the pointer when first enabled diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index d76c5d7a5f3..e226b997566 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", @@ -78,12 +78,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "ts-dedent": "^2.0.0" }, @@ -112,7 +112,7 @@ "./src/preview.tsx" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Outline", "unsupportedFrameworks": [ diff --git a/code/addons/storyshots/storyshots-core/package.json b/code/addons/storyshots/storyshots-core/package.json index cf681dab1f9..ca9476ddafd 100644 --- a/code/addons/storyshots/storyshots-core/package.json +++ b/code/addons/storyshots/storyshots-core/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Take a code snapshot of every story automatically with Jest", "keywords": [ "addon", @@ -36,11 +36,11 @@ "dependencies": { "@jest/transform": "^29.3.1", "@storybook/babel-plugin-require-context-hook": "1.0.1", - "@storybook/client-api": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/core-webpack": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/client-api": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/core-webpack": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "@types/glob": "^7.1.3", "@types/jest-specific-snapshot": "^0.5.6", "core-js": "^3.8.2", @@ -57,11 +57,11 @@ "@angular/core": "^13.3.6", "@angular/platform-browser-dynamic": "^13.3.6", "@emotion/jest": "^11.8.0", - "@storybook/addon-docs": "7.0.0-beta.0", - "@storybook/angular": "7.0.0-beta.0", - "@storybook/react": "7.0.0-beta.0", - "@storybook/vue": "7.0.0-beta.0", - "@storybook/vue3": "7.0.0-beta.0", + "@storybook/addon-docs": "7.0.0-beta.12", + "@storybook/angular": "7.0.0-beta.12", + "@storybook/react": "7.0.0-beta.12", + "@storybook/vue": "7.0.0-beta.12", + "@storybook/vue3": "7.0.0-beta.12", "babel-loader": "^8.3.0", "enzyme": "^3.11.0", "enzyme-to-json": "^3.6.1", @@ -140,7 +140,7 @@ "publishConfig": { "access": "public" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Storyshots", "icon": "https://user-images.githubusercontent.com/263385/101991676-48cdf300-3c7c-11eb-8aa1-944dab6ab29b.png", diff --git a/code/addons/storyshots/storyshots-puppeteer/package.json b/code/addons/storyshots/storyshots-puppeteer/package.json index dd55e397b0a..6d3dbdf7f92 100644 --- a/code/addons/storyshots/storyshots-puppeteer/package.json +++ b/code/addons/storyshots/storyshots-puppeteer/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storyshots-puppeteer", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Image snapshots addition to StoryShots based on puppeteer", "keywords": [ "addon", @@ -35,8 +35,8 @@ "dependencies": { "@axe-core/puppeteer": "^4.2.0", "@storybook/csf": "next", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "@types/jest-image-snapshot": "^5.1.0", "jest-image-snapshot": "^6.0.0" }, @@ -46,7 +46,7 @@ "rimraf": "^3.0.2" }, "peerDependencies": { - "@storybook/addon-storyshots": "7.0.0-beta.0", + "@storybook/addon-storyshots": "7.0.0-beta.12", "puppeteer": ">=2.0.0" }, "peerDependenciesMeta": { @@ -57,5 +57,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/addons/storysource/register.js b/code/addons/storysource/manager.js similarity index 100% rename from code/addons/storysource/register.js rename to code/addons/storysource/manager.js diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 323308a1622..a55a3013e13 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", @@ -33,7 +33,7 @@ "import": "./dist/preset.mjs", "types": "./dist/preset.d.ts" }, - "./register": { + "./manager": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" @@ -54,13 +54,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/router": "7.0.0-beta.0", - "@storybook/source-loader": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/router": "7.0.0-beta.12", + "@storybook/source-loader": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", "estraverse": "^5.2.0", "prop-types": "^15.7.2", "react-syntax-highlighter": "^15.5.0" @@ -92,7 +92,7 @@ "./src/preset.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Storysource", "icon": "https://user-images.githubusercontent.com/263385/101991675-48cdf300-3c7c-11eb-9400-58de5ac6daa7.png", diff --git a/code/addons/storysource/src/preset.ts b/code/addons/storysource/src/preset.ts index dfad91976c5..37778acf34a 100644 --- a/code/addons/storysource/src/preset.ts +++ b/code/addons/storysource/src/preset.ts @@ -29,8 +29,4 @@ function webpack( }; } -function managerEntries(entry = [] as Array) { - return [...entry, require.resolve('./manager')]; -} - -export { webpack, managerEntries }; +export { webpack }; diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index 5df93d927d5..620e30d680f 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "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.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0" + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12" }, "devDependencies": { "typescript": "~4.9.3" @@ -99,7 +99,7 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Toolbars", "icon": "https://user-images.githubusercontent.com/263385/101991677-48cdf300-3c7c-11eb-93b4-19b0e3366959.png", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 2a99ea70d2a..04e73accc2a 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", @@ -73,12 +73,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", "global": "^4.4.0", "memoizerific": "^1.11.3", "prop-types": "^15.7.2" @@ -109,7 +109,7 @@ "./src/preview.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70", + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957", "storybook": { "displayName": "Viewport", "icon": "https://user-images.githubusercontent.com/263385/101991678-48cdf300-3c7c-11eb-9764-f8af293c1b28.png", diff --git a/code/addons/viewport/src/Tool.tsx b/code/addons/viewport/src/Tool.tsx index 10c2a4dfadd..ec14c0740fa 100644 --- a/code/addons/viewport/src/Tool.tsx +++ b/code/addons/viewport/src/Tool.tsx @@ -58,7 +58,6 @@ const toLinks = memoize(50)((list: ViewportItem[], active: LinkBase, set, state, .filter(Boolean); }); -const iframeId = 'storybook-preview-iframe'; const wrapperId = 'storybook-preview-wrapper'; interface LinkBase { @@ -208,7 +207,7 @@ export const ViewportTool: FC = memo( =10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" }, "builders": "dist/builders/builders.json", - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/angular/src/builders/build-storybook/schema.json b/code/frameworks/angular/src/builders/build-storybook/schema.json index 2fa4edad3f2..1640a3f986d 100644 --- a/code/frameworks/angular/src/builders/build-storybook/schema.json +++ b/code/frameworks/angular/src/builders/build-storybook/schema.json @@ -53,7 +53,7 @@ } }, "webpackStatsJson": { - "type": "boolean", + "type": ["boolean", "string"], "description": "Write Webpack Stats JSON to disk", "default": false }, diff --git a/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts b/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts index 06d0f37a522..0ec053879ee 100644 --- a/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts +++ b/code/frameworks/angular/src/builders/utils/run-compodoc.spec.ts @@ -79,4 +79,73 @@ describe('runCompodoc', () => { } ); }); + + it('should run compodoc with default output folder.', async () => { + runCompodoc( + { + compodocArgs: [], + tsconfig: 'path/to/tsconfig.json', + }, + { + workspaceRoot: 'path/to/project', + logger: builderContextLoggerMock, + } as BuilderContext + ) + .pipe(take(1)) + .subscribe(); + + expect(cpSpawnMock.spawn).toHaveBeenCalledWith( + 'npx', + ['compodoc', '-p', 'path/to/tsconfig.json', '-d', 'path/to/project'], + { + cwd: 'path/to/project', + } + ); + }); + + it('should run with custom output folder specified with --output compodocArgs', async () => { + runCompodoc( + { + compodocArgs: ['--output', 'path/to/customFolder'], + tsconfig: 'path/to/tsconfig.json', + }, + { + workspaceRoot: 'path/to/project', + logger: builderContextLoggerMock, + } as BuilderContext + ) + .pipe(take(1)) + .subscribe(); + + expect(cpSpawnMock.spawn).toHaveBeenCalledWith( + 'npx', + ['compodoc', '-p', 'path/to/tsconfig.json', '--output', 'path/to/customFolder'], + { + cwd: 'path/to/project', + } + ); + }); + + it('should run with custom output folder specified with -d compodocArgs', async () => { + runCompodoc( + { + compodocArgs: ['-d', 'path/to/customFolder'], + tsconfig: 'path/to/tsconfig.json', + }, + { + workspaceRoot: 'path/to/project', + logger: builderContextLoggerMock, + } as BuilderContext + ) + .pipe(take(1)) + .subscribe(); + + expect(cpSpawnMock.spawn).toHaveBeenCalledWith( + 'npx', + ['compodoc', '-p', 'path/to/tsconfig.json', '-d', 'path/to/customFolder'], + { + cwd: 'path/to/project', + } + ); + }); }); diff --git a/code/frameworks/angular/src/builders/utils/run-compodoc.ts b/code/frameworks/angular/src/builders/utils/run-compodoc.ts index dc6e541b58d..2d9c9927991 100644 --- a/code/frameworks/angular/src/builders/utils/run-compodoc.ts +++ b/code/frameworks/angular/src/builders/utils/run-compodoc.ts @@ -4,6 +4,8 @@ import { Observable } from 'rxjs'; import * as path from 'path'; const hasTsConfigArg = (args: string[]) => args.indexOf('-p') !== -1; +const hasOutputArg = (args: string[]) => + args.indexOf('-d') !== -1 || args.indexOf('--output') !== -1; // path.relative is necessary to workaround a compodoc issue with // absolute paths on windows machines @@ -21,8 +23,7 @@ export const runCompodoc = ( 'compodoc', // Default options ...(hasTsConfigArg(compodocArgs) ? [] : ['-p', tsConfigPath]), - '-d', - `${context.workspaceRoot}`, + ...(hasOutputArg(compodocArgs) ? [] : ['-d', `${context.workspaceRoot}`]), ...compodocArgs, ]; diff --git a/code/frameworks/angular/src/server/framework-preset-angular-cli.ts b/code/frameworks/angular/src/server/framework-preset-angular-cli.ts index 30fb420b0d0..0af9a9217bf 100644 --- a/code/frameworks/angular/src/server/framework-preset-angular-cli.ts +++ b/code/frameworks/angular/src/server/framework-preset-angular-cli.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-shadow */ import webpack from 'webpack'; import { logger } from '@storybook/node-logger'; import { BuilderContext, Target, targetFromTargetString } from '@angular-devkit/architect'; diff --git a/code/frameworks/angular/src/server/plugins/storybook-normalize-angular-entry-plugin.js b/code/frameworks/angular/src/server/plugins/storybook-normalize-angular-entry-plugin.js index a390d0e4b93..9d36fc8893e 100644 --- a/code/frameworks/angular/src/server/plugins/storybook-normalize-angular-entry-plugin.js +++ b/code/frameworks/angular/src/server/plugins/storybook-normalize-angular-entry-plugin.js @@ -25,23 +25,28 @@ export default class StorybookNormalizeAngularEntryPlugin { } apply(compiler) { - const webpackOptions = compiler.options; - const entry = - typeof webpackOptions.entry === 'function' ? webpackOptions.entry() : webpackOptions.entry; + compiler.hooks.environment.tap(PLUGIN_NAME, () => { + const webpackOptions = compiler.options; + const entry = + typeof webpackOptions.entry === 'function' ? webpackOptions.entry() : webpackOptions.entry; - webpackOptions.entry = async () => { - const entryResult = await entry; + webpackOptions.entry = async () => { + const entryResult = await entry; - if (entryResult.main && entryResult.styles) { - return { - main: { - import: Array.from(new Set([...entryResult.main.import, ...entryResult.styles.import])), - }, - }; - } + if (entryResult.main && entryResult.styles) { + return { + main: { + import: Array.from( + new Set([...entryResult.main.import, ...entryResult.styles.import]) + ), + }, + }; + } + + return entry; + }; + }); - return entry; - }; compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => { this.compilation = compilation; }); diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index a38aff1ba91..085f973c30c 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/ember", "bugs": { @@ -31,11 +31,11 @@ "prep": "node ../../../scripts/prepare.js" }, "dependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/docs-tools": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/builder-webpack5": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/docs-tools": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "read-pkg-up": "^7.0.1", "ts-dedent": "^2.0.0" @@ -54,10 +54,10 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index 57df09e26d7..caed14bfd01 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,22 +48,20 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-beta.0", - "@storybook/builder-vite": "7.0.0-beta.0", - "@storybook/channel-postmessage": "7.0.0-beta.0", - "@storybook/channel-websocket": "7.0.0-beta.0", - "@storybook/client-api": "7.0.0-beta.0", - "@storybook/core-server": "7.0.0-beta.0", - "@storybook/html": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/preview-web": "7.0.0-beta.0", - "magic-string": "^0.26.1", - "vite": "3" + "@storybook/addons": "7.0.0-beta.12", + "@storybook/builder-vite": "7.0.0-beta.12", + "@storybook/channel-postmessage": "7.0.0-beta.12", + "@storybook/channel-websocket": "7.0.0-beta.12", + "@storybook/client-api": "7.0.0-beta.12", + "@storybook/core-server": "7.0.0-beta.12", + "@storybook/html": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/preview-web": "7.0.0-beta.12", + "magic-string": "^0.26.1" }, "devDependencies": { "@types/node": "^16.0.0", - "typescript": "~4.9.3", - "vite": "^3.1.0" + "typescript": "~4.9.3" }, "engines": { "node": "^14.18 || >=16" @@ -78,5 +76,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 30a56a27e22..0000d5da372 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/html": "7.0.0-beta.0", - "@storybook/preset-html-webpack": "7.0.0-beta.0", + "@storybook/builder-webpack5": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/html": "7.0.0-beta.12", + "@storybook/preset-html-webpack": "7.0.0-beta.12", "@types/node": "^16.0.0", "global": "^4.4.0" }, @@ -64,7 +64,7 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -76,5 +76,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/nextjs/README.md b/code/frameworks/nextjs/README.md index 38f532ed312..af6d5950afa 100644 --- a/code/frameworks/nextjs/README.md +++ b/code/frameworks/nextjs/README.md @@ -7,19 +7,30 @@ - [Getting Started](#getting-started) - [In a project without Storybook](#in-a-project-without-storybook) - [In a project with Storybook](#in-a-project-with-storybook) + - [Automatic migration](#automatic-migration) + - [Manual migration](#manual-migration) - [Documentation](#documentation) - [Options](#options) - [Next.js's Image Component](#nextjss-image-component) - [Local Images](#local-images) - [Remote Images](#remote-images) - - [Optimization](#optimization) - [AVIF](#avif) - - [Next.js Navigation](#nextjs-navigation) + - [Next.js Font Optimization](#nextjs-font-optimization) + - [@next/font/google](#nextfontgoogle) + - [@next/font/local](#nextfontlocal) + - [Not supported features of @next/font](#not-supported-features-of-nextfont) - [Next.js Routing](#nextjs-routing) - [Overriding defaults](#overriding-defaults) - [Global Defaults](#global-defaults) - [Default Router](#default-router) - [Actions Integration Caveats](#actions-integration-caveats) + - [Next.js Navigation](#nextjs-navigation) + - [Set `nextjs.appDirectory` to `true`](#set-nextjsappdirectory-to-true) + - [Overriding defaults](#overriding-defaults-1) + - [Global Defaults](#global-defaults-1) + - [`useSelectedLayoutSegment` and `useSelectedLayoutSegments` hook](#useselectedlayoutsegment-and-useselectedlayoutsegments-hook) + - [Default Navigation Context](#default-navigation-context) + - [Actions Integration Caveats](#actions-integration-caveats-1) - [Sass/Scss](#sassscss) - [Css/Sass/Scss Modules](#csssassscss-modules) - [Styled JSX](#styled-jsx) @@ -30,15 +41,17 @@ - [Typescript](#typescript) - [Notes for Yarn v2 and v3 users](#notes-for-yarn-v2-and-v3-users) - [FAQ](#faq) - - [Stories for pages](#stories-for-pages) + - [Stories for pages/components which fetch data](#stories-for-pagescomponents-which-fetch-data) - [Statically imported images won't load](#statically-imported-images-wont-load) - - [Module not found: Error: Can't resolve [package name]](#module-not-found-error-cant-resolve-package-name) + - [Module not found: Error: Can't resolve \[package name\]](#module-not-found-error-cant-resolve-package-name) - [Acknowledgements](#acknowledgements) ## Supported Features 👉 [Next.js's Image Component](#nextjss-image-component) +👉 [Next.js Font Optimization](#nextjs-font-optimization) + 👉 [Next.js Routing (next/router)](#nextjs-routing) 👉 [Next.js Navigation (next/navigation)](#nextjs-navigation) @@ -71,29 +84,58 @@ Follow the prompts after running this command in your Next.js project's root directory: ```bash -npx storybook init +npx storybook@next init ``` -[More on getting started with Storybook](https://storybook.js.org/docs/react/get-started/introduction) +[More on getting started with Storybook](https://storybook.js.org/docs/react/get-started/install) ### In a project with Storybook -Update your `main.js` to look something like this: +This framework is designed to work with Storybook 7. If you’re not already using v7, upgrade with this command: + +```bash +npx storybook@next upgrade --prerelease +``` + +#### Automatic migration + +When running the `upgrade` command above, you should get a prompt asking you to migrate to `@storybook/nextjs`, which should handle everything for you. In case that auto-migration does not work for your project, refer to the manual migration below. + +#### Manual migration Install the framework: ```bash -yarn install @storybook/nextjs +yarn add --dev @storybook/nextjs@next ``` +Update your `main.js` to change the framework property: + ```js // .storybook/main.js module.exports = { + // ... framework: { - name: '@storybook/nextjs', - options: {}; - } -} + // name: '@storybook/react-webpack5', // Remove this + name: '@storybook/nextjs', // Add this + options: {}, + }, +}; +``` + +If you were using Storybook plugins to integrate with Next.js, those are no longer necessary when using this framework and can be removed: + +```js +// .storybook/main.js +module.exports = { + // ... + addons: [ + // ... + // These can both be removed + // 'storybook-addon-next', + // 'storybook-addon-next-router', + ], +}; ``` ## Documentation @@ -109,14 +151,13 @@ For example: const path = require('path'); module.exports = { - // other config ommited for brevity + // ... framework: { name: '@storybook/nextjs', options: { nextConfigPath: path.resolve(__dirname, '../next.config.js'), }, }, - // ... }; ``` @@ -174,175 +215,63 @@ export default function Home() { This format is not supported by this framework yet. Feel free to [open up an issue](https://github.com/storybookjs/storybook/issues) if this is something you want to see. -### Next.js Navigation +### Next.js Font Optimization -Please note that [next/navigation](https://beta.nextjs.org/docs/upgrade-guide#step-5-migrating-routing-hooks) can only be used in components/pages of the `app` directory of Next.js v13 or higher. +[@next/font](https://nextjs.org/docs/basic-features/font-optimization) is partially supported in Storybook. The packages `@next/font/google` and `@next/font/local` are supported. -#### Set `nextjs.appDirectory` to `true` +#### @next/font/google -If your story imports components that use `next/navigation`, you need to set the parameter `nextjs.appDirectory` to `true` in your Story: +You don't have to do anything. `@next/font/google` is supported out of the box. + +#### @next/font/local + +For local fonts you have to define the [src](https://nextjs.org/docs/api-reference/next/font#src) property. +The path is relative to the directory where the font loader function is called. + +If the following component defines your localFont like this: ```js -// SomeComponentThatUsesTheRouter.stories.js -import SomeComponentThatUsesTheNavigation from './SomeComponentThatUsesTheNavigation'; +// src/components/MyComponent.js +import localFont from '@next/font/local'; -export default { - component: SomeComponentThatUsesTheNavigation, -}; - -// if you have the actions addon -// you can click the links and see the route change events there -export const Example = { - parameters: { - nextjs: { - appDirectory: true, - }, - }, -}, +const localRubikStorm = localFont({ src: './fonts/RubikStorm-Regular.ttf' }); ``` -If your Next.js project uses the `app` directory for every page (in other words, it does not have a `pages` directory), you can set the parameter `nextjs.appDirectory` to `true` in the [preview.js](https://storybook.js.org/docs/react/configure/overview#configure-story-rendering) file to apply it to all stories. +You have to tell Storybook where the `fonts` directory is located. The `from` value is relative to the `.storybook` directory. The `to` value is relative to the execution context of Storybook. Very likely it is the root of your project. ```js -// .storybook/preview.js - -export const parameters = { - nextjs: { - appDirectory: true, - }, -}; +// .storybook/main.js +module.exports = { + ... + "staticDirs": [ + { + from: '../src/components/fonts', + to: 'src/components/fonts' + } + ], +} ``` -The parameter `nextjs.appDirectory` defaults to `false` if not set. +#### Not supported features of @next/font -#### Overriding defaults +The following features are not supported (yet). Support for these features might be planned for the future: -Per-story overrides can be done by adding a `nextjs.navigation` property onto the story [parameters](https://storybook.js.org/docs/react/writing-stories/parameters). The framework will shallowly merge whatever you put here into the router. - -```js -// SomeComponentThatUsesTheNavigation.stories.js -import SomeComponentThatUsesTheNavigation from './SomeComponentThatUsesTheNavigation'; - -export default { - component: SomeComponentThatUsesTheNavigation, -}; - -// if you have the actions addon -// you can click the links and see the route change events there -export const Example = { - parameters: { - nextjs: { - appDirectory: true, - navigation: { - pathname: '/some-default-path', - query: { - foo: 'bar', - }, - }, - }, - }, -}; -``` - -#### Global Defaults - -Global defaults can be set in [preview.js](https://storybook.js.org/docs/react/configure/overview#configure-story-rendering) and will be shallowly merged with the default router. - -```js -// .storybook/preview.js - -export const parameters = { - nextjs: { - appDirectory: true, - navigation: { - pathname: '/some-default-path', - query: { - foo: 'bar', - }, - }, - }, -}; -``` - -#### Default Navigation Context - -The default values on the stubbed navigation context are as follows: - -```ts -const defaultNavigationContext = { - push(...args) { - action('nextNavigation.push')(...args); - }, - replace(...args) { - action('nextNavigation.replace')(...args); - }, - forward(...args) { - action('nextNavigation.forward')(...args); - }, - back(...args) { - action('nextNavigation.back')(...args); - }, - prefetch(...args) { - action('nextNavigation.prefetch')(...args); - }, - refresh: () => { - action('nextNavigation.refresh')(); - }, - pathname: '/', - query: {}, -}; -``` - -#### Actions Integration Caveats - -If you override a function, you lose the automatic action tab integration and have to build it out yourself. - -```js -// .storybook/preview.js - -export const parameters = { - nextjs: { - appDirectory: true, - navigation: { - push() { - // The default implementation that logs the action into the action tab is lost - }, - }, - }, -}; -``` - -Doing this yourself looks something like this (make sure you install the `@storybook/addon-actions` package): - -```js -// .storybook/preview.js -import { action } from '@storybook/addon-actions'; - -export const parameters = { - nextjs: { - appDirectory: true, - navigation: { - push(...args) { - // custom logic can go here - // this logs to the actions tab - action('nextNavigation.push')(...args); - // return whatever you want here - return Promise.resolve(true); - }, - }, - }, -}; -``` +- [Support font loaders configuration in next.config.js](https://nextjs.org/docs/basic-features/font-optimization#specifying-a-subset) +- [fallback](https://nextjs.org/docs/api-reference/next/font#fallback) option +- [adjustFontFallback](https://nextjs.org/docs/api-reference/next/font#adjustfontfallback) option +- [declarations](https://nextjs.org/docs/api-reference/next/font#declarations) option +- [preload](https://nextjs.org/docs/api-reference/next/font#preload) option gets ignored. Storybook handles Font loading its own way. +- [display](https://nextjs.org/docs/api-reference/next/font#display) option gets ignored. All fonts are loaded with display set to "block" to make Storybook load the font properly. ### Next.js Routing -[Next.js's router](https://nextjs.org/docs/routing/introduction) is automatically stubbed for you so that when the router is interacted with, all of its interactions are automatically logged to the [Storybook actions tab](https://storybook.js.org/docs/react/essentials/actions) if you have the actions addon. +[Next.js's router](https://nextjs.org/docs/routing/introduction) is automatically stubbed for you so that when the router is interacted with, all of its interactions are automatically logged to the Actions ctions panel if you have the [Storybook actions addon](https://storybook.js.org/docs/react/essentials/actions). -You should only use `next/router` in the `pages` directory of Next.js v13 or higher. In the `app` directory, it is necessary to use `next/navigation`. +> When using Next.js 13+, you should only use `next/router` in the `pages` directory. In the `app` directory, it is necessary to use `next/navigation`. #### Overriding defaults -Per-story overrides can be done by adding a `nextRouter` property onto the story [parameters](https://storybook.js.org/docs/react/writing-stories/parameters). The framework will shallowly merge whatever you put here into the router. +Per-story overrides can be done by adding a `nextjs.router` property onto the story [parameters](https://storybook.js.org/docs/react/writing-stories/parameters). The framework will shallowly merge whatever you put here into the router. ```js // SomeComponentThatUsesTheRouter.stories.js @@ -352,16 +281,16 @@ export default { component: SomeComponentThatUsesTheRouter, }; -// if you have the actions addon -// you can click the links and see the route change events there +// If you have the actions addon, +// you can interact with the links and see the route change events there export const Example = { parameters: { nextjs: { router: { path: '/profile/[id]', - asPath: '/profile/ryanclementshax', + asPath: '/profile/1', query: { - id: 'ryanclementshax', + id: '1', }, }, }, @@ -444,7 +373,7 @@ const defaultRouter = { #### Actions Integration Caveats -If you override a function, you lose the automatic action tab integration and have to build it out yourself. +If you override a function, you lose the automatic actions integration and have to build it out yourself. ```js // .storybook/preview.js @@ -453,7 +382,7 @@ export const parameters = { nextjs: { router: { push() { - // The default implementation that logs the action into the action tab is lost + // The default implementation that logs the action into the Actions panel is lost }, }, }, @@ -470,10 +399,199 @@ export const parameters = { nextjs: { router: { push(...args) { - // custom logic can go here - // this logs to the actions tab + // Custom logic can go here + // This logs to the Actions panel action('nextRouter.push')(...args); - // return whatever you want here + // Return whatever you want here + return Promise.resolve(true); + }, + }, + }, +}; +``` + +### Next.js Navigation + +> Please note that [next/navigation](https://beta.nextjs.org/docs/upgrade-guide#step-5-migrating-routing-hooks) can only be used in components/pages in the `app` directory of Next.js 13+. + +#### Set `nextjs.appDirectory` to `true` + +If your story imports components that use `next/navigation`, you need to set the parameter `nextjs.appDirectory` to `true` in your Story: + +```js +// SomeComponentThatUsesTheRouter.stories.js +import SomeComponentThatUsesTheNavigation from './SomeComponentThatUsesTheNavigation'; + +export default { + component: SomeComponentThatUsesTheNavigation, +}; + +export const Example = { + parameters: { + nextjs: { + appDirectory: true, + }, + }, +}, +``` + +If your Next.js project uses the `app` directory for every page (in other words, it does not have a `pages` directory), you can set the parameter `nextjs.appDirectory` to `true` in the [preview.js](https://storybook.js.org/docs/react/configure/overview#configure-story-rendering) file to apply it to all stories. + +```js +// .storybook/preview.js + +export const parameters = { + nextjs: { + appDirectory: true, + }, +}; +``` + +The parameter `nextjs.appDirectory` defaults to `false` if not set. + +#### Overriding defaults + +Per-story overrides can be done by adding a `nextjs.navigation` property onto the story [parameters](https://storybook.js.org/docs/react/writing-stories/parameters). The framework will shallowly merge whatever you put here into the router. + +```js +// SomeComponentThatUsesTheNavigation.stories.js +import SomeComponentThatUsesTheNavigation from './SomeComponentThatUsesTheNavigation'; + +export default { + component: SomeComponentThatUsesTheNavigation, +}; + +// If you have the actions addon, +// you can interact with the links and see the route change events there +export const Example = { + parameters: { + nextjs: { + appDirectory: true, + navigation: { + pathname: '/profile', + query: { + user: '1', + }, + }, + }, + }, +}; +``` + +#### Global Defaults + +Global defaults can be set in [preview.js](https://storybook.js.org/docs/react/configure/overview#configure-story-rendering) and will be shallowly merged with the default router. + +```js +// .storybook/preview.js + +export const parameters = { + nextjs: { + appDirectory: true, + navigation: { + pathname: '/some-default-path', + }, + }, +}; +``` + +#### `useSelectedLayoutSegment` and `useSelectedLayoutSegments` hook + +The `useSelectedLayoutSegment` and `useSelectedLayoutSegments` hooks are supported in Storybook. You have to set the `nextjs.navigation.segments` parameter to return the segments you want to use. + +```js +// SomeComponentThatUsesTheNavigation.stories.js +import SomeComponentThatUsesTheNavigation from './SomeComponentThatUsesTheNavigation'; + +export default { + component: SomeComponentThatUsesTheNavigation, + parameters: { + nextjs: { + appDirectory: true, + navigation: { + segments: ['dashboard', 'analytics'] + }, + }, + }, +}; + +export const Example = {}; + +// SomeComponentThatUsesTheNavigation.js +import { useSelectedLayoutSegment, useSelectedLayoutSegments } from 'next/navigation'; + +export default function SomeComponentThatUsesTheNavigation() { + const segment = useSelectedLayoutSegment(); // dashboard + const segments = useSelectedLayoutSegments(); // ["dashboard", "analytics"] + ... +} +``` + +The default value of `nextjs.navigation.segments` is `[]` if not set. + +#### Default Navigation Context + +The default values on the stubbed navigation context are as follows: + +```ts +const defaultNavigationContext = { + push(...args) { + action('nextNavigation.push')(...args); + }, + replace(...args) { + action('nextNavigation.replace')(...args); + }, + forward(...args) { + action('nextNavigation.forward')(...args); + }, + back(...args) { + action('nextNavigation.back')(...args); + }, + prefetch(...args) { + action('nextNavigation.prefetch')(...args); + }, + refresh: () => { + action('nextNavigation.refresh')(); + }, + pathname: '/', + query: {}, +}; +``` + +#### Actions Integration Caveats + +If you override a function, you lose the automatic action tab integration and have to build it out yourself. + +```js +// .storybook/preview.js + +export const parameters = { + nextjs: { + appDirectory: true, + navigation: { + push() { + // The default implementation that logs the action into the Actions panel is lost + }, + }, + }, +}; +``` + +Doing this yourself looks something like this (make sure you install the `@storybook/addon-actions` package): + +```js +// .storybook/preview.js +import { action } from '@storybook/addon-actions'; + +export const parameters = { + nextjs: { + appDirectory: true, + navigation: { + push(...args) { + // Custom logic can go here + // This logs to the Actions panel + action('nextNavigation.push')(...args); + // Return whatever you want here return Promise.resolve(true); }, }, @@ -496,7 +614,7 @@ This will automatically include any of your [custom sass configurations](https:/ const path = require('path'); module.exports = { - // any options here are included in sass compilation for your stories + // Any options here are included in Sass compilation for your stories sassOptions: { includePaths: [path.join(__dirname, 'styles')], }, @@ -508,7 +626,7 @@ module.exports = { [css modules](https://nextjs.org/docs/basic-features/built-in-css-support#adding-component-level-css) work as expected. ```js -// this import works just fine in Storybook now +// This import works just fine in Storybook now import styles from './Button.module.css'; // sass/scss is also supported // import styles from './Button.module.scss' @@ -603,10 +721,11 @@ export default function HomePage() { } ``` -```js -// preview.js +Also OK for global styles in `preview.js`! + +```js +// .storybook/preview.js -// Also ok in preview.js! import 'styles/globals.scss'; // ... @@ -659,14 +778,14 @@ Below is an example of how to add svgr support to Storybook with this framework. ```js // .storybook/main.js module.exports = { - // other config omitted for brevity + // ... webpackFinal: async (config) => { - // this modifies the existing image rule to exclude .svg files + // This modifies the existing image rule to exclude .svg files // since you want to handle those files with @svgr/webpack const imageRule = config.module.rules.find((rule) => rule.test.test('.svg')); imageRule.exclude = /\.svg$/; - // configure .svg files to be loaded with @svgr/webpack + // Configure .svg files to be loaded with @svgr/webpack config.module.rules.push({ test: /\.svg$/, use: ['@svgr/webpack'], @@ -703,9 +822,9 @@ This is because those versions of Yarn have different package resolution rules t ### FAQ -#### Stories for pages +#### Stories for pages/components which fetch data -Next.js page files can contain imports to modules meant to run in a node environment (for use in data fetching functions). If you import from a Next.js page file containing those node module imports in your stories, your Storybook's Webpack will crash because those modules will not run in a browser. To get around this, you can extract the component in your page file into a separate file and import that component in your stories. Or, if that's not feasible for some reason, you can [polyfill those modules](https://webpack.js.org/configuration/node/) in your Storybook's [`webpackFinal` configuration](https://storybook.js.org/docs/react/builders/webpack#extending-storybooks-webpack-config). +Next.js page files can contain imports to modules meant to run in a node environment (for use in data fetching functions). If you import from a Next.js page file containing those node module imports in your stories, your Storybook's Webpack will crash because those modules will not run in a browser. To get around this, you can extract the component in your page file into a separate file and import that pure component in your stories. Or, if that's not feasible for some reason, you can [polyfill those modules](https://webpack.js.org/configuration/node/) in your Storybook's [`webpackFinal` configuration](https://storybook.js.org/docs/react/builders/webpack#extending-storybooks-webpack-config). **Before** @@ -713,9 +832,10 @@ Next.js page files can contain imports to modules meant to run in a node environ // ./pages/my-page.jsx import fs from 'fs'; -export default MyPage = (props) => ( - // ... -); +// Using this component in your stories will break the Storybook build +export default function Page(props) { + return; // ... +} export const getStaticProps = async () => { // Logic that uses `fs` @@ -728,15 +848,57 @@ export const getStaticProps = async () => { // ./pages/my-page.jsx import fs from 'fs'; +// Use this pure component in your stories instead import MyPage from 'components/MyPage'; -export default MyPage; +export default function Page(props) { + return ; +} export const getStaticProps = async () => { // Logic that uses `fs` }; ``` +Starting with Next.js 13, you can also fetch data directly within server components in the `app` directory. This does not (currently) work within Storybook for similar reasons as above. It can be worked around similarly as well, by extracting a pure component to a separate file and importing that component in your stories. + +**Before** + +```jsx +// ./app/my-page/index.jsx +async function getData() { + const res = await fetch(...); + // ... +} + +// Using this component in your stories will break the Storybook build +export default async function Page() { + const data = await getData(); + + return // ... +} +``` + +**After** + +```jsx +// ./app/my-page/index.jsx + +// Use this component in your stories +import MyPage from './components/MyPage'; + +async function getData() { + const res = await fetch(...); + // ... +} + +export default async function Page() { + const data = await getData(); + + return ; +} +``` + #### Statically imported images won't load Make sure you are treating image imports the same way you treat them when using `next/image` in normal development. diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index 028f273ebb0..47549660658 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Next.js", "keywords": [ "storybook", @@ -59,12 +59,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/preset-react-webpack": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/react": "7.0.0-beta.0", + "@next/font": "^13.0.7", + "@storybook/addon-actions": "7.0.0-beta.12", + "@storybook/builder-webpack5": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/preset-react-webpack": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/react": "7.0.0-beta.12", "@types/node": "^16.0.0", "find-up": "^5.0.0", "fs-extra": "^9.0.1", @@ -80,14 +82,16 @@ "tsconfig-paths-webpack-plugin": "^3.5.2" }, "devDependencies": { - "@storybook/addon-actions": "7.0.0-beta.0", + "@babel/core": "^7.20.5", + "@babel/types": "^7.20.5", + "@storybook/addon-actions": "7.0.0-beta.12", + "@types/babel__core": "^7", "next": "^13.0.5", "typescript": "^4.9.3", "webpack": "^5.65.0" }, "peerDependencies": { "@babel/core": "^7.11.5", - "@storybook/addon-actions": "7.0.0-alpha.43", "next": "^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", @@ -105,7 +109,7 @@ } }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -115,9 +119,10 @@ "./src/index.ts", "./src/preset.ts", "./src/preview.tsx", - "./src/next-image-loader-stub.ts" + "./src/next-image-loader-stub.ts", + "./src/font/webpack/loader/storybook-nextjs-font-loader.ts" ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/nextjs/src/font/babel/helpers.ts b/code/frameworks/nextjs/src/font/babel/helpers.ts new file mode 100644 index 00000000000..ba66d2df401 --- /dev/null +++ b/code/frameworks/nextjs/src/font/babel/helpers.ts @@ -0,0 +1,319 @@ +import type * as BabelTypesNamespace from '@babel/types'; +import type * as BabelCoreNamespace from '@babel/core'; + +type BabelTypes = typeof BabelTypesNamespace; +type PrimaryTypes = Record | string | number | boolean | undefined | null; + +export type JSReturnValue = PrimaryTypes | Array; + +export type VariableMeta = { + /** + * Variable Declaration name of the assigned function call + * @example + * import { Roboto } from '@next/font/google' + * const robotoName = Roboto({ + * weight: '400' + * }) + * + * // identifierName = 'robotName' + */ + identifierName: string; + /** + * Properties of the assigned function call + * @example + * import { Roboto } from '@next/font/google' + * const robotoName = Roboto({ + * weight: '400' + * }) + * + * // properties = { weight: '400' } + */ + properties: JSReturnValue; + /** + * Function name of the imported @next/font/google function + * @example + * import { Roboto } from '@next/font/google' + * const robotoName = Roboto({ + * weight: '400' + * }) + * + * // functionName = Roboto + */ + functionName: string; +}; + +function convertNodeToJSON(types: BabelTypes, node: any): JSReturnValue { + if (types.isBooleanLiteral(node) || types.isStringLiteral(node) || types.isNumericLiteral(node)) { + return node.value; + } + + if (node.name === 'undefined' && !node.value) { + return undefined; + } + + if (types.isNullLiteral(node)) { + return null; + } + + if (types.isObjectExpression(node)) { + return computeProps(types, node.properties); + } + + if (types.isArrayExpression(node)) { + return node.elements.reduce( + (acc, element) => [ + ...acc, + ...(element?.type === 'SpreadElement' + ? (convertNodeToJSON(types, element.argument) as PrimaryTypes[]) + : [convertNodeToJSON(types, element)]), + ], + [] as PrimaryTypes[] + ); + } + + return {}; +} + +function computeProps( + types: BabelTypes, + props: ( + | BabelTypesNamespace.ObjectMethod + | BabelTypesNamespace.ObjectProperty + | BabelTypesNamespace.SpreadElement + )[] +) { + return props.reduce((acc, prop) => { + if (prop.type === 'SpreadElement') { + return { + ...acc, + ...(convertNodeToJSON(types, prop.argument) as Record), + }; + } + if (prop.type !== 'ObjectMethod') { + const val = convertNodeToJSON(types, prop.value); + if (val !== undefined && types.isIdentifier(prop.key)) { + return { + ...acc, + [prop.key.name]: val, + }; + } + } + return acc; + }, {}); +} + +export function isDefined(value: T): value is Exclude { + return value !== undefined; +} + +/** + * Removes transformed variable declarations, which were already replaced with parameterized imports + * @example + * // AST + * import { Roboto, Inter } from '@next/font/google' + * const interName = Inter({ + * subsets: ['latin'], + * }) + * const robotoName = Roboto({ + * weight: '400' + * }) + * + * // Result + * import { Roboto, Inter } from '@next/font/google' + * + * // Variable declarations are removed + */ +export function removeTransformedVariableDeclarations( + path: BabelCoreNamespace.NodePath, + types: BabelTypes, + metas: VariableMeta[] +) { + path.parentPath.traverse({ + ExportNamedDeclaration(declaratorPath) { + if (!declaratorPath.parentPath?.isProgram()) { + return; + } + + metas.forEach((meta) => { + if ( + types.isVariableDeclaration(declaratorPath.node.declaration) && + declaratorPath.node.declaration.declarations.length === 1 && + types.isVariableDeclarator(declaratorPath.node.declaration.declarations[0]) && + types.isIdentifier(declaratorPath.node.declaration.declarations[0].id) && + meta.identifierName === declaratorPath.node.declaration.declarations[0].id.name + ) { + declaratorPath.replaceWith( + types.exportNamedDeclaration(null, [ + types.exportSpecifier( + types.identifier(meta.identifierName), + types.identifier(meta.identifierName) + ), + ]) + ); + } + }); + }, + VariableDeclarator(declaratorPath) { + if (!declaratorPath.parentPath.parentPath?.isProgram()) { + return; + } + + if ( + metas.some( + (meta) => + types.isIdentifier(declaratorPath.node.id) && + meta.identifierName === declaratorPath.node.id.name + ) + ) { + declaratorPath.remove(); + } + }, + }); +} + +/** + * Replaces `@next/font` import with a parameterized import + * @example + * // AST of src/example.js + * import { Roboto, Inter } from '@next/font/google' + * const interName = Inter({ + * subsets: ['latin'], + * }) + * const robotoName = Roboto({ + * weight: '400' + * }) + * + * // Result + * import interName from 'storybook-nextjs-font-loader?{filename: "src/example.js", source: "@next/font/google", fontFamily: "Inter", props: {"subsets":["latin"]}}!@next/font/google' + * import robotoName from 'storybook-nextjs-font-loader?{filename: "src/example.js", source: "@next/font/google", fontFamily: "Roboto", props: {"weight": "400"}}!@next/font/google' + * + * // Following code will be removed from removeUnusedVariableDeclarations function + * const interName = Inter({ + * subsets: ['latin'], + * }) + * + * const robotoName = Roboto({ + * weight: '400' + * }) + */ +export function replaceImportWithParamterImport( + path: BabelCoreNamespace.NodePath, + types: BabelTypes, + source: BabelCoreNamespace.types.StringLiteral, + metas: Array, + filename: string +) { + // Add an import for each specifier with parameters + path.replaceWithMultiple([ + ...metas.map((meta) => { + return types.importDeclaration( + [types.importDefaultSpecifier(types.identifier(meta.identifierName))], + types.stringLiteral( + `storybook-nextjs-font-loader?${JSON.stringify({ + source: source.value, + props: meta.properties, + fontFamily: meta.functionName, + filename, + })}!${source.value}` + ) + ); + }), + ]); +} + +/** + * Get meta information for the provided import specifier + * @example + * // AST + * import { Roboto, Inter } from '@next/font/google' + * const interName = Inter({ + * subsets: ['latin'], + * }) + * const robotoName = Roboto({ + * weight: '400' + * }) + * + * // Return value + * const variableMetas = [{ + * identifierName: 'interName', + * properties: { subsets: ['latin'] }, + * functionName: 'Inter' + * }, { + * identifierName: 'robotoName', + * properties: { weight: '400' }, + * functionName: 'Roboto' + * }] + */ +export function getVariableMetasBySpecifier( + program: BabelCoreNamespace.NodePath, + types: BabelTypes, + specifier: + | BabelCoreNamespace.types.ImportDefaultSpecifier + | BabelCoreNamespace.types.ImportNamespaceSpecifier + | BabelCoreNamespace.types.ImportSpecifier +) { + return program.node.body + .map((statement) => { + if (!types.isVariableDeclaration(statement) && !types.isExportNamedDeclaration(statement)) { + return undefined; + } + + const exportedNamedDeclaration = + !types.isVariableDeclaration(statement) && + types.isVariableDeclaration(statement.declaration) && + statement.declaration.declarations.length === 1 + ? statement.declaration.declarations[0] + : null; + + const declaration = types.isVariableDeclaration(statement) + ? statement.declarations[0] + : exportedNamedDeclaration; + + if (!declaration) { + return undefined; + } + + if (!types.isIdentifier(declaration.id)) { + return undefined; + } + + if (!types.isCallExpression(declaration.init)) { + return undefined; + } + + if ( + (!types.isIdentifier(declaration.init.callee) || + specifier.type !== 'ImportSpecifier' || + specifier.imported.type !== 'Identifier' || + declaration.init.callee.name !== specifier.imported.name) && + (!types.isIdentifier(declaration.init.callee) || + specifier.type !== 'ImportDefaultSpecifier' || + declaration.init.callee.name !== specifier.local.name) + ) { + return undefined; + } + + const options = declaration.init.arguments[0]; + + if (!types.isObjectExpression(options)) { + throw program.buildCodeFrameError( + 'Please pass an options object to the call expression of @next/font functions' + ); + } + + options.properties.forEach((property) => { + if (types.isSpreadElement(property)) { + throw program.buildCodeFrameError( + 'Please do not use spread elements in the options object in @next/font function calls' + ); + } + }); + + const identifierName = declaration.id.name; + const properties = convertNodeToJSON(types, options); + const functionName = declaration.init.callee.name; + + return { identifierName, properties, functionName }; + }) + .filter(isDefined); +} diff --git a/code/frameworks/nextjs/src/font/babel/index.test.ts b/code/frameworks/nextjs/src/font/babel/index.test.ts new file mode 100644 index 00000000000..3fc81f33876 --- /dev/null +++ b/code/frameworks/nextjs/src/font/babel/index.test.ts @@ -0,0 +1,30 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +import { transform } from '@babel/core'; +import TransformFontImports from '.'; + +const example = ` +import { Inter, Roboto } from '@next/font/google' +import localFont from '@next/font/local' + +const myFont = localFont({ src: './my-font.woff2' }) + +const roboto = Roboto({ + weight: '400', +}) + +const inter = Inter({ + subsets: ['latin'], +}); + +const randomObj = {} +`; + +it('should transform AST properly', () => { + const { code } = transform(example, { plugins: [TransformFontImports] })!; + expect(code).toMatchInlineSnapshot(` + "import inter from \\"storybook-nextjs-font-loader?{\\\\\\"source\\\\\\":\\\\\\"@next/font/google\\\\\\",\\\\\\"props\\\\\\":{\\\\\\"subsets\\\\\\":[\\\\\\"latin\\\\\\"]},\\\\\\"fontFamily\\\\\\":\\\\\\"Inter\\\\\\",\\\\\\"filename\\\\\\":\\\\\\"\\\\\\"}!@next/font/google\\"; + import roboto from \\"storybook-nextjs-font-loader?{\\\\\\"source\\\\\\":\\\\\\"@next/font/google\\\\\\",\\\\\\"props\\\\\\":{\\\\\\"weight\\\\\\":\\\\\\"400\\\\\\"},\\\\\\"fontFamily\\\\\\":\\\\\\"Roboto\\\\\\",\\\\\\"filename\\\\\\":\\\\\\"\\\\\\"}!@next/font/google\\"; + import myFont from \\"storybook-nextjs-font-loader?{\\\\\\"source\\\\\\":\\\\\\"@next/font/local\\\\\\",\\\\\\"props\\\\\\":{\\\\\\"src\\\\\\":\\\\\\"./my-font.woff2\\\\\\"},\\\\\\"fontFamily\\\\\\":\\\\\\"localFont\\\\\\",\\\\\\"filename\\\\\\":\\\\\\"\\\\\\"}!@next/font/local\\"; + const randomObj = {};" + `); +}); diff --git a/code/frameworks/nextjs/src/font/babel/index.ts b/code/frameworks/nextjs/src/font/babel/index.ts new file mode 100644 index 00000000000..2685ff8257d --- /dev/null +++ b/code/frameworks/nextjs/src/font/babel/index.ts @@ -0,0 +1,84 @@ +import type * as BabelCoreNamespace from '@babel/core'; +import { + getVariableMetasBySpecifier, + isDefined, + removeTransformedVariableDeclarations, + replaceImportWithParamterImport, +} from './helpers'; + +type Babel = typeof BabelCoreNamespace; + +/** + * Transforms "@next/font" imports and usages to a webpack loader friendly format with parameters + * @example + * // src/example.js + * // Turns this code: + * import { Inter, Roboto } from '@next/font/google' + * import localFont from '@next/font/local' + * + * const myFont = localFont({ src: './my-font.woff2' }) + * const roboto = Roboto({ + * weight: '400', + * }) + * + * const inter = Inter({ + * subsets: ['latin'], + * }); + * + * // Into this code: + * import inter from 'storybook-nextjs-font-loader?{filename: "src/example.js", source: "@next/font/google", fontFamily: "Inter", props: {"subsets":["latin"]}}!@next/font/google' + * import roboto from 'storybook-nextjs-font-loader?{filename: "src/example.js", source: "@next/font/google", fontFamily: "Roboto", props: {"weight": "400"}}!@next/font/google' + * import myFont from 'storybook-nextjs-font-loader?{filename: "src/example.js", source: "@next/font/local", props: {"src": "./my-font.woff2"}}!@next/font/local' + * + * This Plugin tries to adopt the functionality which is provided by the nextjs swc plugin + * https://github.com/vercel/next.js/pull/40221 + */ +export default function TransformFontImports({ types }: Babel): BabelCoreNamespace.PluginObj { + return { + name: 'storybook-nextjs-font-imports', + visitor: { + ImportDeclaration(path, state) { + const { node } = path; + const { source } = node; + const { filename = '' } = state; + + if (source.value === '@next/font/local') { + const { specifiers } = node; + + // @next/font/local only provides a default export + const specifier = specifiers[0]; + + if (!path.parentPath.isProgram()) { + return; + } + + const program = path.parentPath; + + const variableMetas = getVariableMetasBySpecifier(program, types, specifier); + + removeTransformedVariableDeclarations(path, types, variableMetas); + replaceImportWithParamterImport(path, types, source, variableMetas, filename); + } + + if (source.value === '@next/font/google') { + const { specifiers } = node; + + const variableMetas = specifiers + .flatMap((specifier) => { + if (!path.parentPath.isProgram()) { + return []; + } + + const program = path.parentPath; + + return getVariableMetasBySpecifier(program, types, specifier); + }) + .filter(isDefined); + + removeTransformedVariableDeclarations(path, types, variableMetas); + replaceImportWithParamterImport(path, types, source, variableMetas, filename); + } + }, + }, + }; +} diff --git a/code/frameworks/nextjs/src/font/webpack/configureNextFont.ts b/code/frameworks/nextjs/src/font/webpack/configureNextFont.ts new file mode 100644 index 00000000000..47723fed403 --- /dev/null +++ b/code/frameworks/nextjs/src/font/webpack/configureNextFont.ts @@ -0,0 +1,14 @@ +import type { Configuration } from 'webpack'; + +export function configureNextFont(baseConfig: Configuration) { + baseConfig.plugins = [...(baseConfig.plugins || [])]; + baseConfig.resolveLoader = { + ...baseConfig.resolveLoader, + alias: { + ...baseConfig.resolveLoader?.alias, + 'storybook-nextjs-font-loader': require.resolve( + './font/webpack/loader/storybook-nextjs-font-loader' + ), + }, + }; +} diff --git a/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts b/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts new file mode 100644 index 00000000000..77098c446eb --- /dev/null +++ b/code/frameworks/nextjs/src/font/webpack/loader/google/get-font-face-declarations.ts @@ -0,0 +1,49 @@ +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-expect-error +import loaderUtils from 'next/dist/compiled/loader-utils3'; +import { + fetchCSSFromGoogleFonts, + getFontAxes, + getUrl, + validateData, +} from '@next/font/dist/google/utils'; + +import type { LoaderOptions } from '../types'; + +const cssCache = new Map>(); + +export async function getFontFaceDeclarations(options: LoaderOptions) { + const { fontFamily, weights, styles, selectedVariableAxes, display, variable } = validateData( + options.fontFamily, + [options.props] + ); + + const fontAxes = getFontAxes(fontFamily, weights, styles, selectedVariableAxes); + const url = getUrl(fontFamily, fontAxes, display); + + try { + const hasCachedCSS = cssCache.has(url); + const fontFaceCSS = hasCachedCSS + ? cssCache.get(url) + : await fetchCSSFromGoogleFonts(url, fontFamily).catch(() => null); + if (!hasCachedCSS) { + cssCache.set(url, fontFaceCSS); + } else { + cssCache.delete(url); + } + if (fontFaceCSS === null) { + throw Error(`Failed to fetch \`${fontFamily}\` from Google Fonts.`); + } + + return { + id: loaderUtils.getHashDigest(url, 'md5', 'hex', 6), + fontFamily, + fontFaceCSS, + weights, + styles, + variable, + }; + } catch (error) { + throw new Error("Google Fonts couldn't be loaded."); + } +} 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 new file mode 100644 index 00000000000..a690d1e060e --- /dev/null +++ b/code/frameworks/nextjs/src/font/webpack/loader/local/get-font-face-declarations.ts @@ -0,0 +1,57 @@ +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-expect-error +import loaderUtils from 'next/dist/compiled/loader-utils3'; +import { validateData } from '@next/font/dist/local/utils'; +import path from 'path'; + +import type { LoaderOptions } from '../types'; + +type LocalFontSrc = string | Array<{ path: string; weight?: string; style?: string }>; + +export async function getFontFaceDeclarations(options: LoaderOptions, rootContext: string) { + const localFontSrc = options.props.src as LocalFontSrc; + + // Parent folder relative to the root context + const parentFolder = options.filename.split('/').slice(0, -1).join('/').replace(rootContext, ''); + + const { weight, style, variable } = validateData('', options.props); + + const id = `font-${loaderUtils.getHashDigest( + Buffer.from(JSON.stringify(localFontSrc)), + 'md5', + 'hex', + 6 + )}`; + + const getFontFaceCSS = () => { + if (typeof localFontSrc === 'string') { + const localFontPath = path.join(parentFolder, localFontSrc); + + return `@font-face { + font-family: ${id}; + src: url(${localFontPath}); + }`; + } + return localFontSrc + .map((font) => { + const localFontPath = path.join(parentFolder, font.path); + + return `@font-face { + font-family: ${id}; + src: url(${localFontPath}); + ${font.weight ? `font-weight: ${font.weight};` : ''} + ${font.style ? `font-style: ${font.style};` : ''} + }`; + }) + .join(''); + }; + + return { + id, + fontFamily: id, + fontFaceCSS: getFontFaceCSS(), + weights: weight ? [weight] : [], + styles: style ? [style] : [], + variable, + }; +} diff --git a/code/frameworks/nextjs/src/font/webpack/loader/storybook-nextjs-font-loader.ts b/code/frameworks/nextjs/src/font/webpack/loader/storybook-nextjs-font-loader.ts new file mode 100644 index 00000000000..b25f2857a75 --- /dev/null +++ b/code/frameworks/nextjs/src/font/webpack/loader/storybook-nextjs-font-loader.ts @@ -0,0 +1,51 @@ +import { getFontFaceDeclarations as getGoogleFontFaceDeclarations } from './google/get-font-face-declarations'; +import { getFontFaceDeclarations as getLocalFontFaceDeclarations } from './local/get-font-face-declarations'; +import type { LoaderOptions } from './types'; +import { getCSSMeta } from './utils/get-css-meta'; +import { setFontDeclarationsInHead } from './utils/set-font-declarations-in-head'; + +type FontFaceDeclaration = { + id: string; + fontFamily: string; + fontFaceCSS: any; + weights: string[]; + styles: string[]; + variable?: string; +}; + +export default async function storybookNextjsFontLoader(this: any) { + const options = this.getOptions() as LoaderOptions; + + // get execution context + const rootCtx = this.rootContext; + + let fontFaceDeclaration: FontFaceDeclaration | undefined; + + if (options.source === '@next/font/google') { + fontFaceDeclaration = await getGoogleFontFaceDeclarations(options); + } + + if (options.source === '@next/font/local') { + fontFaceDeclaration = await getLocalFontFaceDeclarations(options, rootCtx); + } + + if (typeof fontFaceDeclaration !== 'undefined') { + const cssMeta = getCSSMeta(fontFaceDeclaration); + + return ` + ${setFontDeclarationsInHead({ + fontFaceCSS: cssMeta.fontFaceCSS, + id: fontFaceDeclaration.id, + classNamesCSS: cssMeta.classNamesCSS, + })} + + module.exports = { + className: "${cssMeta.className}", + style: ${JSON.stringify(cssMeta.style)} + ${cssMeta.variableClassName ? `, variable: "${cssMeta.variableClassName}"` : ''} + } + `; + } + + return `module.exports = {}`; +} diff --git a/code/frameworks/nextjs/src/font/webpack/loader/types.ts b/code/frameworks/nextjs/src/font/webpack/loader/types.ts new file mode 100644 index 00000000000..237e0cfb942 --- /dev/null +++ b/code/frameworks/nextjs/src/font/webpack/loader/types.ts @@ -0,0 +1,18 @@ +export type LoaderOptions = { + /** + * Initial import name. Can be `@next/font/google` or `@next/font/local` + */ + source: string; + /** + * Props passed to the `@next/font` function call + */ + props: Record; + /** + * Font Family name + */ + fontFamily: string; + /** + * Filename of the issuer file, which imports `@next/font/google` or `@next/font/local + */ + filename: string; +}; diff --git a/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts b/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts new file mode 100644 index 00000000000..aa816e05faf --- /dev/null +++ b/code/frameworks/nextjs/src/font/webpack/loader/utils/get-css-meta.ts @@ -0,0 +1,66 @@ +type Options = { + fontFamily: string; + styles: string[]; + weights: string[]; + fontFaceCSS: string; + variable?: string; +}; + +export function getCSSMeta(options: Options) { + const className = getClassName(options); + const style = getStylesObj(options); + const variableClassName = `__variable_${className}`; + + const classNamesCSS = ` + .${className} { + font-family: ${options.fontFamily}; + ${isNextCSSPropertyValid(options.styles) ? `font-style: ${options.styles[0]};` : ''} + ${isNextCSSPropertyValid(options.weights) ? `font-weight: ${options.weights[0]};` : ''} + } + + ${ + options.variable + ? `.${variableClassName} { ${options.variable}: '${options.fontFamily}'; }` + : '' + } + `; + + const fontFaceCSS = `${changeFontDisplayToSwap(options.fontFaceCSS)}`; + + return { + className, + fontFaceCSS, + classNamesCSS, + style, + ...(options.variable ? { variableClassName } : {}), + }; +} + +function getClassName({ styles, weights, fontFamily }: Options) { + const font = fontFamily.replace(' ', '-').toLowerCase(); + const style = isNextCSSPropertyValid(styles) ? styles[0] : null; + const weight = isNextCSSPropertyValid(weights) ? weights[0] : null; + + return `${font}${style ? `-${style}` : ''}${weight ? `-${weight}` : ''}`; +} + +function getStylesObj({ styles, weights, fontFamily }: Options) { + return { + fontFamily, + ...(isNextCSSPropertyValid(styles) ? { fontStyle: styles[0] } : {}), + ...(isNextCSSPropertyValid(weights) ? { fontWeight: weights[0] } : {}), + }; +} + +function isNextCSSPropertyValid(prop: string[]) { + return prop.length === 1 && prop[0] !== 'variable'; +} + +/** + * This step is necessary, because otherwise the font-display: optional; property + * blocks Storybook from rendering the font, because the @font-face declaration + * is not loaded in time. + */ +function changeFontDisplayToSwap(css: string) { + return css.replaceAll('font-display: optional;', 'font-display: block;'); +} diff --git a/code/frameworks/nextjs/src/font/webpack/loader/utils/set-font-declarations-in-head.ts b/code/frameworks/nextjs/src/font/webpack/loader/utils/set-font-declarations-in-head.ts new file mode 100644 index 00000000000..cccaeaf9dbf --- /dev/null +++ b/code/frameworks/nextjs/src/font/webpack/loader/utils/set-font-declarations-in-head.ts @@ -0,0 +1,24 @@ +type Props = { + id: string; + fontFaceCSS: string; + classNamesCSS: string; +}; + +export function setFontDeclarationsInHead({ id, fontFaceCSS, classNamesCSS }: Props) { + return ` + if (!document.getElementById('id-${id}')) { + const fontDeclarations = \`${fontFaceCSS}\`; + const style = document.createElement('style'); + style.setAttribute('id', 'font-face-${id}'); + style.innerHTML = fontDeclarations; + document.head.appendChild(style); + + const classNamesCSS = \`${classNamesCSS}\`; + const classNamesStyle = document.createElement('style'); + classNamesStyle.setAttribute('id', 'classnames-${id}'); + classNamesStyle.innerHTML = classNamesCSS; + document.head.appendChild(classNamesStyle); + + } + `; +} diff --git a/code/frameworks/nextjs/src/index.ts b/code/frameworks/nextjs/src/index.ts index c3a049105c1..fcb073fefcd 100644 --- a/code/frameworks/nextjs/src/index.ts +++ b/code/frameworks/nextjs/src/index.ts @@ -1,2 +1 @@ -export * from '@storybook/react'; export * from './types'; diff --git a/code/frameworks/nextjs/src/nextImport/webpack.ts b/code/frameworks/nextjs/src/nextImport/webpack.ts index 1e8f40d2256..b017462ae25 100644 --- a/code/frameworks/nextjs/src/nextImport/webpack.ts +++ b/code/frameworks/nextjs/src/nextImport/webpack.ts @@ -8,6 +8,7 @@ export function configureNextImport(baseConfig: WebpackConfig) { const isNext12 = semver.satisfies(nextJSVersion, '~12'); const isNext13 = semver.satisfies(nextJSVersion, '~13'); + const isNextVersionSmallerThan12dot2 = semver.lt(nextJSVersion, '12.2.0'); const isNextVersionSmallerThan13 = semver.lt(nextJSVersion, '13.0.0'); baseConfig.plugins = baseConfig.plugins ?? []; @@ -20,7 +21,7 @@ export function configureNextImport(baseConfig: WebpackConfig) { ); } - if (!isNext12) { + if (!isNext12 || isNextVersionSmallerThan12dot2) { baseConfig.plugins.push( new IgnorePlugin({ resourceRegExp: /next\/future\/image$/, @@ -36,7 +37,7 @@ export function configureNextImport(baseConfig: WebpackConfig) { ); } - if (semver.lt(nextJSVersion, '12.2.0')) { + if (isNextVersionSmallerThan12dot2) { baseConfig.plugins.push( new IgnorePlugin({ resourceRegExp: /next\/dist\/shared\/lib\/app-router-context$/, diff --git a/code/frameworks/nextjs/src/preset.ts b/code/frameworks/nextjs/src/preset.ts index d479189ae34..82e5b58d2bb 100644 --- a/code/frameworks/nextjs/src/preset.ts +++ b/code/frameworks/nextjs/src/preset.ts @@ -13,6 +13,8 @@ import { configureImages } from './images/webpack'; import { configureRuntimeNextjsVersionResolution } from './utils'; import type { FrameworkOptions, StorybookConfig } from './types'; import { configureNextImport } from './nextImport/webpack'; +import TransformFontImports from './font/babel'; +import { configureNextFont } from './font/webpack/configureNextFont'; export const addons: PresetProperty<'addons', StorybookConfig> = [ dirname(require.resolve(join('@storybook/preset-react-webpack', 'package.json'))), @@ -103,8 +105,11 @@ export const babel = async (baseConfig: TransformOptions): Promise): FlightRouterState => { + const segment = segmentsList.shift(); + + if (segment) { + return [segment, { children: getParallelRoutes(segmentsList) }]; + } + + return [] as any; +}; + const AppRouterProvider: React.FC = ({ children, action, routeParams }) => { - const { pathname, query, ...restRouteParams } = routeParams; + const { pathname, query, segments = [], ...restRouteParams } = routeParams; + return ( = ({ children, action, }} > - {children} + + {children} + ); diff --git a/code/frameworks/nextjs/src/utils.ts b/code/frameworks/nextjs/src/utils.ts index bafa8d1d827..9ba051ab7e9 100644 --- a/code/frameworks/nextjs/src/utils.ts +++ b/code/frameworks/nextjs/src/utils.ts @@ -3,7 +3,6 @@ import { DefinePlugin } from 'webpack'; import { PHASE_DEVELOPMENT_SERVER } from 'next/constants'; import findUp from 'find-up'; import { pathExists } from 'fs-extra'; -import dedent from 'ts-dedent'; import type { Configuration as WebpackConfig } from 'webpack'; import type { NextConfig } from 'next'; import { pathToFileURL } from 'node:url'; @@ -45,13 +44,7 @@ export const resolveNextConfig = async ({ const nextConfigFile = nextConfigPath || (await findNextConfigFile(configDir)); if (!nextConfigFile || (await pathExists(nextConfigFile)) === false) { - throw new Error( - dedent` - Could not find or resolve your Next config file. Please provide the next config file path as a framework option. - - More info: https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#options - ` - ); + return {}; } const nextConfigExport = await import(pathToFileURL(nextConfigFile).href); diff --git a/code/frameworks/nextjs/template/stories_default-js/Font.jsx b/code/frameworks/nextjs/template/stories_default-js/Font.jsx new file mode 100644 index 00000000000..228c81efc03 --- /dev/null +++ b/code/frameworks/nextjs/template/stories_default-js/Font.jsx @@ -0,0 +1,64 @@ +/* eslint-disable react/prop-types */ +import { Rubik_Puddles } from '@next/font/google'; +import localFont from '@next/font/local'; + +import React from 'react'; + +const rubik = Rubik_Puddles({ + subsets: ['latin'], + variable: '--font-latin-rubik', + weight: '400', +}); + +export const localRubikStorm = localFont({ + src: '/fonts/RubikStorm-Regular.ttf', + variable: '--font-rubik-storm', +}); + +export default function Font({ variant }) { + switch (variant) { + case 'className': + return ( +
+

Google Rubik Puddles

+

Google Local Rubik Storm

+
+ ); + case 'style': + return ( +
+

Google Rubik Puddles

+

Google Local Rubik Storm

+
+ ); + case 'variable': + return ( +
+
+

+ Google Rubik Puddles +

+
+
+

+ Google Local Rubik Storm +

+
+
+ ); + default: + return null; + } +} diff --git a/code/frameworks/nextjs/template/stories_default-js/Font.stories.jsx b/code/frameworks/nextjs/template/stories_default-js/Font.stories.jsx new file mode 100644 index 00000000000..b851661dd43 --- /dev/null +++ b/code/frameworks/nextjs/template/stories_default-js/Font.stories.jsx @@ -0,0 +1,23 @@ +import Font from './Font'; + +export default { + component: Font, +}; + +export const WithClassName = { + args: { + variant: 'className', + }, +}; + +export const WithStyle = { + args: { + variant: 'style', + }, +}; + +export const WithVariable = { + args: { + variant: 'variable', + }, +}; diff --git a/code/frameworks/nextjs/template/stories_default-js/Navigation.stories.jsx b/code/frameworks/nextjs/template/stories_default-js/Navigation.stories.jsx index 5335fa098ae..f43167da2c1 100644 --- a/code/frameworks/nextjs/template/stories_default-js/Navigation.stories.jsx +++ b/code/frameworks/nextjs/template/stories_default-js/Navigation.stories.jsx @@ -1,10 +1,18 @@ -import { useRouter, usePathname, useSearchParams } from 'next/navigation'; +import { + useRouter, + usePathname, + useSearchParams, + useSelectedLayoutSegment, + useSelectedLayoutSegments, +} from 'next/navigation'; import React from 'react'; function Component() { const router = useRouter(); const pathname = usePathname(); const searchParams = useSearchParams(); + const segment = useSelectedLayoutSegment(); + const segments = useSelectedLayoutSegments(); const searchParamsList = Array.from(searchParams.entries()); @@ -38,6 +46,8 @@ function Component() { return (
pathname: {pathname}
+
segment: {segment}
+
segments: {segments.join(',')}
searchparams:{' '}
    @@ -75,3 +85,14 @@ export default { }; export const Default = {}; + +export const WithSegmentDefined = { + parameters: { + nextjs: { + appDirectory: true, + navigation: { + segments: ['dashboard', 'settings'], + }, + }, + }, +}; diff --git a/code/frameworks/nextjs/template/stories_default-js/fonts/OFL.txt b/code/frameworks/nextjs/template/stories_default-js/fonts/OFL.txt new file mode 100644 index 00000000000..36d2f6f3feb --- /dev/null +++ b/code/frameworks/nextjs/template/stories_default-js/fonts/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2020 The Rubik Filtered Project Authors (https://https://github.com/NaN-xyz/Rubik-Filtered) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/code/frameworks/nextjs/template/stories_default-js/fonts/RubikStorm-Regular.ttf b/code/frameworks/nextjs/template/stories_default-js/fonts/RubikStorm-Regular.ttf new file mode 100644 index 00000000000..2304ee84a07 Binary files /dev/null and b/code/frameworks/nextjs/template/stories_default-js/fonts/RubikStorm-Regular.ttf differ diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index 527b419e307..d5175d7043d 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/preact": "7.0.0-beta.0", - "@storybook/preset-preact-webpack": "7.0.0-beta.0", + "@storybook/builder-webpack5": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/preact": "7.0.0-beta.12", + "@storybook/preset-preact-webpack": "7.0.0-beta.12", "@types/node": "^16.0.0" }, "devDependencies": { @@ -65,7 +65,7 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -77,5 +77,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index c4020a64fc3..009d9969f93 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,24 +48,24 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@joshwooding/vite-plugin-react-docgen-typescript": "^0.0.5", + "@joshwooding/vite-plugin-react-docgen-typescript": "0.0.0-20221218231544", "@rollup/pluginutils": "^4.2.0", - "@storybook/builder-vite": "7.0.0-beta.0", - "@storybook/react": "7.0.0-beta.0", - "@vitejs/plugin-react": "^2.0.0", + "@storybook/builder-vite": "7.0.0-beta.12", + "@storybook/react": "7.0.0-beta.12", + "@vitejs/plugin-react": "^3.0.0", "ast-types": "^0.14.2", "magic-string": "^0.26.1", - "react-docgen": "^6.0.0-alpha.3", - "vite": "^3.1.3" + "react-docgen": "6.0.0-alpha.3" }, "devDependencies": { "@types/node": "^16.0.0", "typescript": "~4.9.3", - "vite": "^3.1.3" + "vite": "^4.0.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", + "vite": "^3.0.0 || ^4.0.0" }, "engines": { "node": "^14.18 || >=16" @@ -80,5 +80,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/react-vite/src/preset.ts b/code/frameworks/react-vite/src/preset.ts index 99f7f12b0e3..6f89d4dd61f 100644 --- a/code/frameworks/react-vite/src/preset.ts +++ b/code/frameworks/react-vite/src/preset.ts @@ -1,6 +1,6 @@ /* eslint-disable global-require */ import type { StorybookConfig } from '@storybook/builder-vite'; -import { hasPlugin } from './utils'; +import { hasVitePlugins } from '@storybook/builder-vite'; export const core: StorybookConfig['core'] = { builder: '@storybook/builder-vite', @@ -11,7 +11,7 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets const { plugins = [] } = config; // Add react plugin if not present - if (!hasPlugin(plugins, 'vite:react-babel')) { + if (!(await hasVitePlugins(plugins, ['vite:react-babel', 'vite:react-swc']))) { const { default: react } = await import('@vitejs/plugin-react'); plugins.push(react()); } diff --git a/code/frameworks/react-vite/src/utils.ts b/code/frameworks/react-vite/src/utils.ts index 780d0e599ec..805a30a728e 100644 --- a/code/frameworks/react-vite/src/utils.ts +++ b/code/frameworks/react-vite/src/utils.ts @@ -1,6 +1,5 @@ import path from 'path'; import fs from 'fs'; -import type { PluginOption } from 'vite'; export function readPackageJson(): Record | false { const packageJsonPath = path.resolve('package.json'); @@ -11,18 +10,3 @@ export function readPackageJson(): Record | false { const jsonContent = fs.readFileSync(packageJsonPath, 'utf8'); return JSON.parse(jsonContent); } - -function checkName(plugin: PluginOption, name: string) { - return typeof plugin === 'object' && 'name' in plugin && plugin.name === name; -} - -export function hasPlugin(plugins: PluginOption[], name: string) { - return Boolean( - plugins.find((p): boolean => { - if (Array.isArray(p)) { - return Boolean(hasPlugin(p, name)); - } - return checkName(p, name); - }) - ); -} diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index 5a616e847e0..a24693404dd 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,9 +48,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.0", - "@storybook/preset-react-webpack": "7.0.0-beta.0", - "@storybook/react": "7.0.0-beta.0", + "@storybook/builder-webpack5": "7.0.0-beta.12", + "@storybook/preset-react-webpack": "7.0.0-beta.12", + "@storybook/react": "7.0.0-beta.12", "@types/node": "^16.0.0" }, "devDependencies": { @@ -71,7 +71,7 @@ } }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -83,5 +83,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index 5ad84bf40c8..8819ea9dcca 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/preset-server-webpack": "7.0.0-beta.0", - "@storybook/server": "7.0.0-beta.0", + "@storybook/builder-webpack5": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/preset-server-webpack": "7.0.0-beta.12", + "@storybook/server": "7.0.0-beta.12", "@types/node": "^16.0.0" }, "devDependencies": { @@ -62,7 +62,7 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -74,5 +74,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 12c41c15cd3..833a9bfe29e 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,30 +48,24 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addon-svelte-csf": "^2.0.0", - "@storybook/builder-vite": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/svelte": "7.0.0-beta.0", - "@sveltejs/vite-plugin-svelte": "^1.0.0", + "@storybook/builder-vite": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/svelte": "7.0.0-beta.12", + "@sveltejs/vite-plugin-svelte": "^2.0.0", "magic-string": "^0.26.1", "svelte": "^3.0.0", "sveltedoc-parser": "^4.2.1", - "vite": "^3.1.3" + "ts-dedent": "^2.2.0" }, "devDependencies": { "@types/node": "^16.0.0", "typescript": "~4.9.3", - "vite": "^3.1.3" + "vite": "^4.0.0" }, "peerDependencies": { - "@storybook/addon-svelte-csf": "^2.0.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@storybook/addon-svelte-csf": { - "optional": true - } + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", + "vite": "^3.0.0 || ^4.0.0" }, "engines": { "node": "^14.18 || >=16" @@ -86,5 +80,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/svelte-vite/src/plugins/csf-plugin.ts b/code/frameworks/svelte-vite/src/plugins/csf-plugin.ts deleted file mode 100644 index c52bd89583f..00000000000 --- a/code/frameworks/svelte-vite/src/plugins/csf-plugin.ts +++ /dev/null @@ -1,64 +0,0 @@ -// @ts-expect-error (TODO) -import { getNameFromFilename } from '@storybook/addon-svelte-csf/dist/cjs/parser/svelte-stories-loader'; -import { readFileSync } from 'fs'; -// @ts-expect-error (TODO) -import { extractStories } from '@storybook/addon-svelte-csf/dist/cjs/parser/extract-stories'; -import type { Options } from '@sveltejs/vite-plugin-svelte'; -import * as svelte from 'svelte/compiler'; -import MagicString from 'magic-string'; -import { createFilter } from 'vite'; -import type { PluginOption } from 'vite'; - -const parser = require - .resolve('@storybook/addon-svelte-csf/dist/esm/parser/collect-stories') - .replace(/[/\\]/g, '/'); - -export default function csfPlugin(svelteOptions?: Options): PluginOption { - const include = /\.stories\.svelte$/; - const filter = createFilter(include); - - return { - name: 'storybook:addon-svelte-csf-plugin', - enforce: 'post', - async transform(code: string, id: string) { - if (!filter(id)) return undefined; - - const s = new MagicString(code); - const component = getNameFromFilename(id); - let source = readFileSync(id).toString(); - if (svelteOptions && svelteOptions.preprocess) { - source = (await svelte.preprocess(source, svelteOptions.preprocess, { filename: id })).code; - } - const all = extractStories(source); - const { stories } = all; - const storyDef = Object.entries(stories) - .filter(([, def]) => !def.template) - // eslint-disable-next-line @typescript-eslint/no-shadow - .map(([id]) => `export const ${id} = __storiesMetaData.stories[${JSON.stringify(id)}];`) - .join('\n'); - - s.replace('export default', '// export default'); - - const namedExportsOrder = Object.entries(stories) - .filter(([, def]) => !def.template) - // eslint-disable-next-line @typescript-eslint/no-shadow - .map(([id]) => id); - - const output = [ - '', - `import parser from '${parser}';`, - `const __storiesMetaData = parser(${component}, ${JSON.stringify(all)});`, - 'export default __storiesMetaData.meta;', - `export const __namedExportsOrder = ${JSON.stringify(namedExportsOrder)};`, - storyDef, - ].join('\n'); - - s.append(output); - - return { - code: s.toString(), - map: s.generateMap({ hires: true, source: id }), - }; - }, - }; -} diff --git a/code/frameworks/svelte-vite/src/preset.ts b/code/frameworks/svelte-vite/src/preset.ts index 669473bfa35..0d459212ada 100644 --- a/code/frameworks/svelte-vite/src/preset.ts +++ b/code/frameworks/svelte-vite/src/preset.ts @@ -1,5 +1,5 @@ -import { type StorybookConfig } from '@storybook/builder-vite'; -import { handleSvelteKit, hasPlugin } from './utils'; +import { type StorybookConfig, hasVitePlugins } from '@storybook/builder-vite'; +import { handleSvelteKit } from './utils'; import { svelteDocgen } from './plugins/svelte-docgen'; export const core: StorybookConfig['core'] = { @@ -8,7 +8,9 @@ export const core: StorybookConfig['core'] = { }; export const viteFinal: NonNullable = async (config, options) => { - let { plugins = [] } = config; + const { plugins = [] } = config; + // TODO: set up eslint import to use typescript resolver + // eslint-disable-next-line import/no-unresolved const { svelte, loadSvelteConfig } = await import('@sveltejs/vite-plugin-svelte'); const svelteOptions: Record = await options.presets.apply( 'svelteOptions', @@ -18,28 +20,14 @@ export const viteFinal: NonNullable = async (confi const svelteConfig = { ...(await loadSvelteConfig()), ...svelteOptions }; // Add svelte plugin if not present - if (!hasPlugin(plugins, 'vite-plugin-svelte')) { + if (!(await hasVitePlugins(plugins, ['vite-plugin-svelte']))) { plugins.push(svelte()); } // Add docgen plugin plugins.push(svelteDocgen(svelteConfig)); - // temporarily support SvelteKit - plugins = await handleSvelteKit(plugins, options); - - // TODO: temporary until/unless https://github.com/storybookjs/addon-svelte-csf/issues/64 is fixed - // Wrapping in try-catch in case `@storybook/addon-svelte-csf is not installed - try { - const { default: svelteCsfPlugin } = await import('./plugins/csf-plugin'); - plugins.push(svelteCsfPlugin(svelteConfig)); - } catch (err) { - // Not all projects use `.stories.svelte` for stories, and by default 6.5+ does not auto-install @storybook/addon-svelte-csf. - // If it's any other kind of error, re-throw. - if ((err as NodeJS.ErrnoException).code !== 'MODULE_NOT_FOUND') { - throw err; - } - } + await handleSvelteKit(plugins, options); return { ...config, diff --git a/code/frameworks/svelte-vite/src/utils.ts b/code/frameworks/svelte-vite/src/utils.ts index 5d6e3b21d6b..154587f852f 100644 --- a/code/frameworks/svelte-vite/src/utils.ts +++ b/code/frameworks/svelte-vite/src/utils.ts @@ -1,54 +1,41 @@ import type { PluginOption } from 'vite'; -import { deprecate } from '@storybook/node-logger'; -import { withoutVitePlugins } from '@storybook/builder-vite'; import type { Options } from '@storybook/types'; - -function checkName(plugin: PluginOption, name: string) { - return typeof plugin === 'object' && 'name' in plugin && plugin.name === name; -} - -export function hasPlugin(plugins: PluginOption[], name: string) { - return Boolean( - plugins.find((p): boolean => { - if (Array.isArray(p)) { - return Boolean(hasPlugin(p, name)); - } - return checkName(p, name); - }) - ); -} +import dedent from 'ts-dedent'; +import { logger } from '@storybook/node-logger'; +import { hasVitePlugins } from '@storybook/builder-vite'; /** * A migration step that ensures the svelte-vite framework still supports SvelteKit, * but warns the user that they should use the sveltekit framework instead. * Should be removed when we decide to remove support completely for SvelteKit in svelte-vite */ -export async function handleSvelteKit( - plugins: PluginOption[], - options: Options -): Promise { - if (!hasPlugin(plugins, 'vite-plugin-svelte-kit')) { - // this is not a SvelteKit project ✅ - return plugins; - } - +export async function handleSvelteKit(plugins: PluginOption[], options: Options) { /* the sveltekit framework uses this svelte-vite framework under the hood - so we have to take extra care of only warning when the user is actually using + so we have to take extra care of only throwing when the user is actually using svelte-vite directly and not just through sveltekit */ - const frameworkPreset = await options.presets.apply('framework', {}, options); const framework = typeof frameworkPreset === 'string' ? frameworkPreset : frameworkPreset.name; - if (framework === '@storybook/sveltekit') { - // this uses @storybook/sveltekit, so everything is fine ✅ - return plugins; - } + const hasSvelteKitPlugins = await hasVitePlugins(plugins, [ + 'vite-plugin-svelte-kit', + 'vite-plugin-sveltekit-setup', + 'vite-plugin-sveltekit-compile', + ]); - // this is a SvelteKit project but doesn't use @storybook/sveltekit, warn user about this and remove vite-plugin-svelte-kit ❌ - deprecate( - 'SvelteKit support in @storybook/svelte-vite is deprecated in Storybook 7.0, use @storybook/sveltekit instead.' - ); - return withoutVitePlugins(plugins, ['vite-plugin-svelte-kit']); + if (hasSvelteKitPlugins && framework !== '@storybook/sveltekit') { + logger.error( + dedent` + We've detected a SvelteKit project using the @storybook/svelte-vite framework, which is not supported in Storybook 7.0 + Please use the @storybook/sveltekit framework instead. + You can migrate automatically by running + + npx sb@next automigrate sveltekitFramework + + See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#sveltekit-needs-the-storybooksveltekit-framework + ` + ); + throw new Error(); + } } diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 8602b9b1a74..561ea8df7dd 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/preset-svelte-webpack": "7.0.0-beta.0", - "@storybook/svelte": "7.0.0-beta.0" + "@storybook/builder-webpack5": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/preset-svelte-webpack": "7.0.0-beta.12", + "@storybook/svelte": "7.0.0-beta.12" }, "devDependencies": { "svelte": "^3.48.0", @@ -66,7 +66,7 @@ "svelte-loader": "*" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -78,5 +78,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/sveltekit/README.md b/code/frameworks/sveltekit/README.md index d9243c63d0a..016efd01f3e 100644 --- a/code/frameworks/sveltekit/README.md +++ b/code/frameworks/sveltekit/README.md @@ -1 +1,116 @@ -# Storybook for SvelteKit +# Storybook for SvelteKit + +Our goal is to help you use the tools you love together with Storybook. That’s why Storybook has zero-config support for SvelteKit with the `@storybook/sveltekit` package. + +Check out our [Frameworks API](https://storybook.js.org/blog/framework-api/) announcement for what this all means for you and our continued efforts to make Storybook a seamless integration for any project. + +## Table of Contents + +- [Supported features](#supported-features) +- [Requirements](#requirements) +- [Getting Started](#getting-started) + - [In a project without Storybook](#in-a-project-without-storybook) + - [In a project with Storybook](#in-a-project-with-storybook) + - [Automatic migration](#automatic-migration) + - [Manual migration](#manual-migration) +- [Troubleshooting](#troubleshooting) + - [Error: `ERR! SyntaxError: Identifier '__esbuild_register_import_meta_url__' has already been declared` when starting Storybook](#error-err-syntaxerror-identifier-__esbuild_register_import_meta_url__-has-already-been-declared-when-starting-storybook) +- [Acknowledgements](#acknowledgements) + +## Supported features + +All Svelte language features are supported out of the box, as Storybook uses the Svelte compiler underneath. +However SvelteKit has some [Kit-specific modules](https://kit.svelte.dev/docs/modules) that currently aren't supported. It's on our roadmap to support most of them soon: + +| **Module** | **Status** | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| [`$app/environment`](https://kit.svelte.dev/docs/modules#$app-environment) | 🔜 Coming in 7.0 | +| [`$app/forms`](https://kit.svelte.dev/docs/modules#$app-forms) | ⏳ Planned for 7.1 | +| [`$app/navigation`](https://kit.svelte.dev/docs/modules#$app-navigation) | ⏳ Planned for 7.1. With mocks so the Actions addon will display when the hooks are being called. | +| [`$app/paths`](https://kit.svelte.dev/docs/modules#$app-paths) | ⏳ Planned for 7.1 | +| [`$app/stores`](https://kit.svelte.dev/docs/modules#$app-stores) | 🔜 Coming in 7.0. Mocks are planned for 7.1 so you can set different store values per story. | +| [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private) | ⛔ Not supported. They are meant to only be available server-side, and Storybook renders all components on the client. | +| [`$env/dynamic/public`](https://kit.svelte.dev/docs/modules#$env-dynamic-public) | 🔜 Coming in 7.0 | +| [`$env/static/private`](https://kit.svelte.dev/docs/modules#$env-static-private) | ⛔ Not supported. They are meant to only be available server-side, and Storybook renders all components on the client. | +| [`$env/static/public`](https://kit.svelte.dev/docs/modules#$env-static-public) | 🔜 Coming in 7.0 | +| [`$lib`](https://kit.svelte.dev/docs/modules#$lib) | 🔜 Coming in 7.0 | +| [`$service-worker`](https://kit.svelte.dev/docs/modules#$service-worker) | ⛔ Not supported. They are only meant to be used in service workers | +| [`@sveltejs/kit/*`](https://kit.svelte.dev/docs/modules#sveltejs-kit) | ✅ Supported | + +This is just the beginning. We're close to adding basic support for many of the SvelteKit features. Longer term we're planning on making it an even better experience to [build](https://storybook.js.org/docs/7.0/react/writing-stories/introduction), [test](https://storybook.js.org/docs/7.0/react/writing-tests/introduction) and [document](https://storybook.js.org/docs/7.0/react/writing-docs/introduction) all the SvelteKit goodies like [pages](https://kit.svelte.dev/docs/routing), [forms](https://kit.svelte.dev/docs/form-actions) and [layouts](https://kit.svelte.dev/docs/routing#layout) in Storybook, while still integrating with all the addons and workflows you know and love. + +## Requirements + +- [SvelteKit](https://kit.svelte.dev/) >= 1.0.0 (not including beta versions) +- [Storybook](https://storybook.js.org/) >= 7.x + +## Getting Started + +### In a project without Storybook + +Run the following command in your SvelteKit project's root directory, and follow the prompts: + +```bash +npx storybook@next init +``` + +[More on getting started with Storybook](https://storybook.js.org/docs/7.0/svelte/get-started/install) + +### In a project with Storybook + +This framework is designed to work with Storybook 7. If you’re not already using v7, upgrade with this command: + +```bash +npx storybook@next upgrade --prerelease +``` + +#### Automatic migration + +When running the `upgrade` command above you should get a prompt asking you to migrate to `@storybook/sveltekit`, which should handle everything for you. In some cases it can't migrate for you, eg. if your existing Storybook setup is based on Webpack. In such cases, refer to the manual migration below. + +Storybook 7.0 automatically loads your Vite config, and by extension your Svelte config. If you had a `svelteOptions` property in `.storybook/main.cjs` the automigration will have removed it, as it is no longer supported. + +#### Manual migration + +Install the framework: + +```bash +yarn add -D @storybook/sveltekit@next +``` + +Update your `main.cjs` to change the framework property: + +```js +// .storybook/main.cjs +module.exports = { + ... + framework: '@storybook/sveltekit', +}; +``` + +Storybook 7.0 automatically loads your Vite config, and by extension your Svelte config. If you have a `svelteOptions` property in `.storybook/main.cjs` you need to remove that. See [Troubleshooting](#error-about-__esbuild_register_import_meta_url__-when-starting-storybook) below. + +Remove any redundant dependencies, if you have them: + +```bash +yarn remove @storybook/svelte-vite +yarn remove @storybook/svelte-webpack5 +yarn remove storybook-builder-vite +yarn remove @storybook/builder-vite +``` + +## Troubleshooting + +### Error: `ERR! SyntaxError: Identifier '__esbuild_register_import_meta_url__' has already been declared` when starting Storybook + +> When starting Storybook after upgrading to v7.0, it breaks with the following error: +> +> ``` +> ERR! SyntaxError: Identifier '__esbuild_register_import_meta_url__' has already been declared +> ``` + +You'll get this error when manually upgrading from 6.5 to 7.0. You need to remove the `svelteOptions` property in `.storybook/main.cjs`, as that is not supported by Storybook 7.0 + SvelteKit. The property is also not necessary anymore because the Vite and Svelte configurations are loaded automatically in Storybook 7.0. + +## Acknowledgements + +Integrating with SvelteKit would not have been possible if it weren't for the fantastic efforts by the Svelte core team - especially [Ben McCann](https://twitter.com/benjaminmccann) - to make integrations with the wider ecosystem possible. diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index a9e30c0070c..00ba6be1058 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for SvelteKit", "keywords": [ "storybook", @@ -51,21 +51,17 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.0.0-beta.0", - "@storybook/svelte-vite": "7.0.0-beta.0" + "@storybook/builder-vite": "7.0.0-beta.12", + "@storybook/svelte": "7.0.0-beta.12", + "@storybook/svelte-vite": "7.0.0-beta.12" }, "devDependencies": { "@types/node": "^16.0.0", "typescript": "^4.9.3", - "vite": "^3.1.3" + "vite": "^4.0.0" }, "peerDependencies": { - "@storybook/addon-svelte-csf": "^2.0.0" - }, - "peerDependenciesMeta": { - "@storybook/addon-svelte-csf": { - "optional": true - } + "vite": "^4.0.0" }, "engines": { "node": "^14.18 || >=16" @@ -80,5 +76,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/sveltekit/src/preset.ts b/code/frameworks/sveltekit/src/preset.ts index 2719f02b7b5..308eacabf2d 100644 --- a/code/frameworks/sveltekit/src/preset.ts +++ b/code/frameworks/sveltekit/src/preset.ts @@ -15,7 +15,13 @@ export const viteFinal: NonNullable = async (confi // Remove vite-plugin-svelte-kit from plugins if using SvelteKit // see https://github.com/storybookjs/storybook/issues/19280#issuecomment-1281204341 - plugins = withoutVitePlugins(plugins, ['vite-plugin-svelte-kit']); + plugins = await withoutVitePlugins(plugins, [ + // pre @sveltejs/kit@1.0.0-next.574 + 'vite-plugin-svelte-kit', + // @sveltejs/kit@1.0.0-next.582 and later + 'vite-plugin-sveltekit-setup', + 'vite-plugin-sveltekit-compile', + ]); return { ...baseConfig, plugins }; }; diff --git a/code/frameworks/sveltekit/template/cli/Button.stories.js b/code/frameworks/sveltekit/template/cli/Button.stories.js deleted file mode 100644 index 6377b5dda3d..00000000000 --- a/code/frameworks/sveltekit/template/cli/Button.stories.js +++ /dev/null @@ -1,39 +0,0 @@ -import Button from './Button.svelte'; - -// More on how to set up stories at: https://storybook.js.org/docs/7.0/svelte/writing-stories/introduction -export default { - title: 'Example/Button', - component: Button, - tags: ['docsPage'], - argTypes: { - backgroundColor: { control: 'color' }, - }, -}; - -// More on writing stories with args: https://storybook.js.org/docs/7.0/svelte/writing-stories/args -export const Primary = { - args: { - primary: true, - label: 'Button', - }, -}; - -export const Secondary = { - args: { - label: 'Button', - }, -}; - -export const Large = { - args: { - size: 'large', - label: 'Button', - }, -}; - -export const Small = { - args: { - size: 'small', - label: 'Button', - }, -}; diff --git a/code/frameworks/sveltekit/template/cli/Button.svelte b/code/frameworks/sveltekit/template/cli/Button.svelte deleted file mode 100644 index cdf77abadac..00000000000 --- a/code/frameworks/sveltekit/template/cli/Button.svelte +++ /dev/null @@ -1,34 +0,0 @@ - - - diff --git a/code/frameworks/vue-vite/package.json b/code/frameworks/vue-vite/package.json index 7290db14739..93ab7f981de 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Vue2 and Vite: Develop Vue2 Components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,25 +48,26 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/core-server": "7.0.0-beta.0", - "@storybook/vue": "7.0.0-beta.0", + "@storybook/builder-vite": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/core-server": "7.0.0-beta.12", + "@storybook/vue": "7.0.0-beta.12", "magic-string": "^0.26.1", - "vite": "^3.1.3", "vue-docgen-api": "^4.40.0" }, "devDependencies": { "typescript": "~4.9.3", + "vite": "^4.0.0", "vue": "^2.7.10" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", + "vite": "^3.0.0 || ^4.0.0", "vue": "^2.7.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -78,5 +79,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/vue-webpack5/package.json b/code/frameworks/vue-webpack5/package.json index 2abbedfdf5c..553b1f7eb68 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/preset-vue-webpack": "7.0.0-beta.0", - "@storybook/vue": "7.0.0-beta.0", + "@storybook/builder-webpack5": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/preset-vue-webpack": "7.0.0-beta.12", + "@storybook/vue": "7.0.0-beta.12", "@types/node": "^16.0.0" }, "devDependencies": { @@ -71,7 +71,7 @@ "vue-template-compiler": "^2.6.8" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -83,5 +83,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 58c55fd5164..91f6a9aa283 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,22 +48,22 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.0.0-beta.0", - "@storybook/core-server": "7.0.0-beta.0", - "@storybook/vue3": "7.0.0-beta.0", - "@vitejs/plugin-vue": "^3.0.0", + "@storybook/builder-vite": "7.0.0-beta.12", + "@storybook/core-server": "7.0.0-beta.12", + "@storybook/vue3": "7.0.0-beta.12", + "@vitejs/plugin-vue": "^4.0.0", "magic-string": "^0.26.1", - "vite": "^3.1.3", "vue-docgen-api": "^4.40.0" }, "devDependencies": { "@types/node": "^16.0.0", "typescript": "~4.9.3", - "vite": "^3.1.3" + "vite": "^4.0.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", + "vite": "^3.0.0 || ^4.0.0" }, "engines": { "node": "^14.18 || >=16" @@ -78,5 +78,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/vue3-vite/src/preset.ts b/code/frameworks/vue3-vite/src/preset.ts index 8f44b0c3695..b4ea232db70 100644 --- a/code/frameworks/vue3-vite/src/preset.ts +++ b/code/frameworks/vue3-vite/src/preset.ts @@ -1,6 +1,6 @@ import type { StorybookConfig } from '@storybook/builder-vite'; +import { hasVitePlugins } from '@storybook/builder-vite'; import { vueDocgen } from './plugins/vue-docgen'; -import { hasPlugin } from './utils'; export const core: StorybookConfig['core'] = { builder: '@storybook/builder-vite', @@ -11,7 +11,7 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (config, { presets const { plugins = [] } = config; // Add vue plugin if not present - if (!hasPlugin(plugins, 'vite:vue')) { + if (!(await hasVitePlugins(plugins, ['vite:vue']))) { const { default: vue } = await import('@vitejs/plugin-vue'); plugins.push(vue()); } diff --git a/code/frameworks/vue3-vite/src/utils.ts b/code/frameworks/vue3-vite/src/utils.ts deleted file mode 100644 index 3672cededa2..00000000000 --- a/code/frameworks/vue3-vite/src/utils.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { PluginOption } from 'vite'; - -function checkName(plugin: PluginOption, name: string) { - return typeof plugin === 'object' && 'name' in plugin && plugin.name === name; -} - -export function hasPlugin(plugins: PluginOption[], name: string) { - return Boolean( - plugins.find((p): boolean => { - if (Array.isArray(p)) { - return Boolean(hasPlugin(p, name)); - } - return checkName(p, name); - }) - ); -} diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 4e9e2e305c8..d2d524aa64c 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/preset-vue3-webpack": "7.0.0-beta.0", - "@storybook/vue3": "7.0.0-beta.0", + "@storybook/builder-webpack5": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/preset-vue3-webpack": "7.0.0-beta.12", + "@storybook/vue3": "7.0.0-beta.12", "@types/node": "^16.0.0" }, "devDependencies": { @@ -68,7 +68,7 @@ "vue": "^3.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -80,5 +80,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 0a432958ba2..a88800da580 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -48,17 +48,15 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/builder-vite": "7.0.0-beta.0", - "@storybook/core-server": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/web-components": "7.0.0-beta.0", - "magic-string": "^0.26.1", - "vite": "3" + "@storybook/builder-vite": "7.0.0-beta.12", + "@storybook/core-server": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/web-components": "7.0.0-beta.12", + "magic-string": "^0.26.1" }, "devDependencies": { "@types/node": "^16.0.0", - "typescript": "~4.9.3", - "vite": "^3.1.0" + "typescript": "~4.9.3" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", @@ -77,5 +75,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 2ed870ea2a3..a867cfafce0 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit-html", @@ -51,10 +51,10 @@ }, "dependencies": { "@babel/preset-env": "^7.20.2", - "@storybook/builder-webpack5": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/preset-web-components-webpack": "7.0.0-beta.0", - "@storybook/web-components": "7.0.0-beta.0", + "@storybook/builder-webpack5": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/preset-web-components-webpack": "7.0.0-beta.12", + "@storybook/web-components": "7.0.0-beta.12", "@types/node": "^16.0.0" }, "devDependencies": { @@ -67,7 +67,7 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -79,5 +79,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lerna.json b/code/lerna.json index 43194251227..e850d2dc382 100644 --- a/code/lerna.json +++ b/code/lerna.json @@ -2,5 +2,5 @@ "npmClient": "yarn", "useWorkspaces": true, "registry": "https://registry.npmjs.org", - "version": "7.0.0-beta.0" + "version": "7.0.0-beta.12" } diff --git a/code/lib/addons/package.json b/code/lib/addons/package.json index af9c4b988e9..1e228c7c9ed 100644 --- a/code/lib/addons/package.json +++ b/code/lib/addons/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addons", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook addons store", "keywords": [ "storybook" @@ -44,9 +44,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0" + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", @@ -60,5 +60,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/builder-manager/package.json b/code/lib/builder-manager/package.json index dd9880e4f01..bc9a41d27db 100644 --- a/code/lib/builder-manager/package.json +++ b/code/lib/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook manager builder", "keywords": [ "storybook" @@ -44,14 +44,14 @@ }, "dependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/manager": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/manager": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", "@types/ejs": "^3.1.1", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10", "browser-assert": "^1.2.1", "ejs": "^3.1.8", - "esbuild": "^0.14.48", + "esbuild": "^0.16.4", "esbuild-plugin-alias": "^0.2.1", "express": "^4.17.3", "fs-extra": "^9.0.1", @@ -71,5 +71,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/builder-manager/src/index.ts b/code/lib/builder-manager/src/index.ts index bf3179f1494..008944391ca 100644 --- a/code/lib/builder-manager/src/index.ts +++ b/code/lib/builder-manager/src/index.ts @@ -77,6 +77,14 @@ export const getConfig: ManagerBuilder['getConfig'] = async (options) => { globalExternals(definitions), pnpPlugin(), ], + + banner: { + js: 'try{', + }, + footer: { + js: '}catch(e){ console.error("[Storybook] One of your manager-entries failed: " + import.meta.url, e); }', + }, + define: { 'process.env.NODE_ENV': "'production'", 'process.env': '{}', diff --git a/code/lib/builder-manager/templates/template.ejs b/code/lib/builder-manager/templates/template.ejs index 70484955230..296f0a8fca8 100644 --- a/code/lib/builder-manager/templates/template.ejs +++ b/code/lib/builder-manager/templates/template.ejs @@ -8,7 +8,6 @@ - <% if (typeof head !== 'undefined') { %> <%- head %> <% } %> @@ -39,8 +38,10 @@ import './sb-manager/runtime.mjs'; <% files.js.forEach(file => { %> - import './<%= file %>'; - <% }); %> + import '<%= file %>'; + <% }); %> + + diff --git a/code/lib/builder-vite/input/iframe.html b/code/lib/builder-vite/input/iframe.html index 5e522dda6c4..874cf855e9a 100644 --- a/code/lib/builder-vite/input/iframe.html +++ b/code/lib/builder-vite/input/iframe.html @@ -25,7 +25,7 @@
    - + diff --git a/code/lib/builder-vite/package.json b/code/lib/builder-vite/package.json index 996fb79f7ed..94588cb9c14 100644 --- a/code/lib/builder-vite/package.json +++ b/code/lib/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "A plugin to run and build Storybooks with Vite", "homepage": "https://github.com/storybookjs/storybook/tree/main/code/lib/builder-vite/#readme", "bugs": { @@ -43,16 +43,14 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@joshwooding/vite-plugin-react-docgen-typescript": "0.0.5", - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/csf-plugin": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/csf-plugin": "7.0.0-beta.12", "@storybook/mdx2-csf": "next", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/preview": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", - "@vitejs/plugin-react": "^2.0.0", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/preview": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "browser-assert": "^1.2.1", "es-module-lexer": "^0.9.3", "express": "^4.17.3", @@ -62,24 +60,28 @@ "magic-string": "^0.26.1", "rollup": "^2.25.0 || ^3.3.0", "rollup-plugin-external-globals": "^0.7.1", - "slash": "^3.0.0", - "vite": "^3.1.3" + "slash": "^3.0.0" }, "devDependencies": { "@types/express": "^4.17.13", "@types/node": "^16.0.0", "rollup": "^3.0.0", "typescript": "~4.9.3", - "vite": "^3.1.3" + "vite": "^4.0.0" }, "peerDependencies": { "@preact/preset-vite": "*", + "typescript": ">= 4.3.x", + "vite": "^3.0.0 || ^4.0.0", "vite-plugin-glimmerx": "*" }, "peerDependenciesMeta": { "@preact/preset-vite": { "optional": true }, + "typescript": { + "optional": true + }, "vite-plugin-glimmerx": { "optional": true } @@ -93,5 +95,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/builder-vite/src/build.ts b/code/lib/builder-vite/src/build.ts index a9ba1a37b01..dbb6feefb01 100644 --- a/code/lib/builder-vite/src/build.ts +++ b/code/lib/builder-vite/src/build.ts @@ -15,7 +15,7 @@ export async function build(options: ExtendedOptions) { sourcemap: true, rollupOptions: { // Do not try to bundle the storybook runtime, it is copied into the output dir after the build. - external: ['/sb-preview/runtime.mjs'], + external: ['./sb-preview/runtime.mjs'], }, }, }).build; diff --git a/code/lib/builder-vite/src/codegen-iframe-script.ts b/code/lib/builder-vite/src/codegen-iframe-script.ts index 8f986e9ca26..a5818c1a170 100644 --- a/code/lib/builder-vite/src/codegen-iframe-script.ts +++ b/code/lib/builder-vite/src/codegen-iframe-script.ts @@ -30,7 +30,7 @@ export async function generateIframeScriptCode(options: ExtendedOptions) { import { configure } from '${rendererName}'; import { logger } from '@storybook/client-logger'; - import * as clientApi from "@storybook/preview-api"; + import * as previewApi from "@storybook/preview-api"; ${filesToImport(configEntries, 'config')} import * as preview from '${virtualPreviewFile}'; diff --git a/code/lib/builder-vite/src/declarations/extract-stories.d.ts b/code/lib/builder-vite/src/declarations/extract-stories.d.ts deleted file mode 100644 index 2731f657cc5..00000000000 --- a/code/lib/builder-vite/src/declarations/extract-stories.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @see https://github.com/storybookjs/addon-svelte-csf/blob/f72b8f28dabbb99c92e12d0170d3c1db4397ee7c/src/parser/extract-stories.ts - */ -declare module '@storybook/addon-svelte-csf/dist/cjs/parser/extract-stories' { - interface StoryDef { - name: string; - template: boolean; - source: string; - hasArgs: boolean; - } - - interface StoriesDef { - stories: Record; - allocatedIds: string[]; - } - - function extractStories(component: string): { stories: StoriesDef; allocatedIds: string[] }; -} diff --git a/code/lib/builder-vite/src/declarations/svetle-stories-loader.d.ts b/code/lib/builder-vite/src/declarations/svetle-stories-loader.d.ts deleted file mode 100644 index 1ae04708af5..00000000000 --- a/code/lib/builder-vite/src/declarations/svetle-stories-loader.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * @see https://github.com/storybookjs/addon-svelte-csf/blob/f72b8f28dabbb99c92e12d0170d3c1db4397ee7c/src/parser/svelte-stories-loader.ts - * @see https://github.com/sveltejs/svelte/blob/deed340cf5d9c278f9a0605297ad6e4a3a1579d9/src/compiler/compile/utils/get_name_from_filename.ts - */ -declare module '@storybook/addon-svelte-csf/dist/cjs/parser/svelte-stories-loader' { - function getNameFromFilename(filename: string): string; -} diff --git a/code/lib/builder-vite/src/index.ts b/code/lib/builder-vite/src/index.ts index e55dd1d3669..b9535c4a5e0 100644 --- a/code/lib/builder-vite/src/index.ts +++ b/code/lib/builder-vite/src/index.ts @@ -12,6 +12,7 @@ import { build as viteBuild } from './build'; import type { ExtendedOptions } from './types'; export { withoutVitePlugins } from './utils/without-vite-plugins'; +export { hasVitePlugins } from './utils/has-vite-plugins'; // TODO remove export type { TypescriptOptions } from '@storybook/types'; @@ -68,14 +69,8 @@ function iframeMiddleware(options: ExtendedOptions, server: ViteDevServer): Requ let server: ViteDevServer; -export async function bail(e?: Error): Promise { - try { - return await server.close(); - } catch (err) { - console.warn('unable to close vite server'); - } - - throw e; +export async function bail(): Promise { + return server?.close(); } export const start: ViteBuilder['start'] = async ({ diff --git a/code/lib/builder-vite/src/optimizeDeps.ts b/code/lib/builder-vite/src/optimizeDeps.ts index 7cc35166433..9546c6fa295 100644 --- a/code/lib/builder-vite/src/optimizeDeps.ts +++ b/code/lib/builder-vite/src/optimizeDeps.ts @@ -114,11 +114,12 @@ export async function getOptimizeDeps(config: ViteInlineConfig, options: Extende const include = await asyncFilter(INCLUDE_CANDIDATES, async (id) => Boolean(await resolve(id))); const optimizeDeps: UserConfig['optimizeDeps'] = { + ...config.optimizeDeps, // We don't need to resolve the glob since vite supports globs for entries. entries: stories, // We need Vite to precompile these dependencies, because they contain non-ESM code that would break // if we served it directly to the browser. - include, + include: [...include, ...(config.optimizeDeps?.include || [])], }; return optimizeDeps; diff --git a/code/lib/builder-vite/src/plugins/mdx-plugin.ts b/code/lib/builder-vite/src/plugins/mdx-plugin.ts index 2527921004f..deedf25fa82 100644 --- a/code/lib/builder-vite/src/plugins/mdx-plugin.ts +++ b/code/lib/builder-vite/src/plugins/mdx-plugin.ts @@ -1,16 +1,9 @@ -import type { Options } from '@storybook/types'; +import type { Options, StorybookConfig } from '@storybook/types'; import type { Plugin } from 'vite'; import { createFilter } from 'vite'; const isStorybookMdx = (id: string) => id.endsWith('stories.mdx') || id.endsWith('story.mdx'); -function injectRenderer(code: string) { - return ` - import React from 'react'; - ${code} - `; -} - /** * Storybook uses two different loaders when dealing with MDX: * @@ -19,30 +12,18 @@ function injectRenderer(code: string) { * * @see https://github.com/storybookjs/storybook/blob/next/addons/docs/docs/recipes.md#csf-stories-with-arbitrary-mdx */ -export function mdxPlugin(options: Options): Plugin { - let reactRefresh: Plugin | undefined; +export async function mdxPlugin(options: Options): Promise { const include = /\.mdx?$/; const filter = createFilter(include); + const addons = await options.presets.apply('addons', []); + const docsOptions = + // @ts-expect-error - not sure what type to use here + addons.find((a) => [a, a.name].includes('@storybook/addon-docs'))?.options ?? {}; return { name: 'storybook:mdx-plugin', enforce: 'pre', - configResolved({ plugins }) { - // @vitejs/plugin-react-refresh has been upgraded to @vitejs/plugin-react, - // and the name of the plugin performing `transform` has been changed from 'react-refresh' to 'vite:react-babel', - // to be compatible, we need to look for both plugin name. - // We should also look for the other plugins names exported from @vitejs/plugin-react in case there are some internal refactors. - const reactRefreshPlugins = plugins.filter( - (p) => - p.name === 'react-refresh' || - p.name === 'vite:react-babel' || - p.name === 'vite:react-refresh' || - p.name === 'vite:react-jsx' - ); - reactRefresh = reactRefreshPlugins.find((p) => p.transform); - }, - - async transform(src, id, transformOptions) { + async transform(src, id) { if (!filter(id)) return undefined; const { compile } = await import('@storybook/mdx2-csf'); @@ -51,35 +32,19 @@ export function mdxPlugin(options: Options): Plugin { mdxCompileOptions: { providerImportSource: '@storybook/addon-docs/mdx-react-shim', }, + jsxOptions: docsOptions.jsxOptions, }); - const mdxCode = String( + const code = String( await compile(src, { skipCsf: !isStorybookMdx(id), ...mdxLoaderOptions, }) ); - const modifiedCode = injectRenderer(mdxCode); - - // Hooks in recent rollup versions can be functions or objects, and though react hasn't changed, the typescript defs have - const rTransform = reactRefresh?.transform; - const transform = rTransform && 'handler' in rTransform ? rTransform.handler : rTransform; - - // It's safe to disable this, because we know it'll be there, since we added it ourselves. - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const result = await transform!.call(this, modifiedCode, `${id}.jsx`, transformOptions); - - if (!result) return modifiedCode; - - if (typeof result === 'string') return result; - - const { code, map: resultMap } = result; - return { code, - map: - !resultMap || typeof resultMap === 'string' ? resultMap : { ...resultMap, sources: [id] }, + map: null, // TODO: update mdx2-csf to return the map }; }, }; diff --git a/code/lib/builder-vite/src/utils/has-vite-plugins.test.ts b/code/lib/builder-vite/src/utils/has-vite-plugins.test.ts new file mode 100644 index 00000000000..d82211fba6b --- /dev/null +++ b/code/lib/builder-vite/src/utils/has-vite-plugins.test.ts @@ -0,0 +1,69 @@ +import { hasVitePlugins } from './has-vite-plugins'; + +describe('hasVitePlugins', () => { + describe('should return true for', () => { + it('plugin in root', async () => { + const plugins = [{ name: 'vite-plugin-to-find' }, { name: 'vite-plugin-other' }]; + const names = ['vite-plugin-to-find']; + expect(await hasVitePlugins(plugins, names)).toBeTruthy(); + }); + it('plugin in nested array', async () => { + const plugins = [[{ name: 'vite-plugin-to-find' }], { name: 'vite-plugin-other' }]; + const names = ['vite-plugin-to-find']; + expect(await hasVitePlugins(plugins, names)).toBeTruthy(); + }); + it('plugin in nested async array', async () => { + const plugins = [ + { name: 'vite-plugin-other' }, + Promise.resolve([{ name: 'vite-plugin-to-find' }]), + ]; + const names = ['vite-plugin-to-find']; + expect(await hasVitePlugins(plugins, names)).toBeTruthy(); + }); + + it('async plugin in root', async () => { + const plugins = [ + Promise.resolve({ name: 'vite-plugin-to-find' }), + { name: 'vite-plugin-other' }, + ]; + const names = ['vite-plugin-to-find']; + expect(await hasVitePlugins(plugins, names)).toBeTruthy(); + }); + it('async plugin in nested array', async () => { + const plugins = [ + [Promise.resolve({ name: 'vite-plugin-to-find' })], + { name: 'vite-plugin-other' }, + ]; + const names = ['vite-plugin-to-find']; + expect(await hasVitePlugins(plugins, names)).toBeTruthy(); + }); + it('async plugin in nested async array', async () => { + const plugins = [ + { name: 'vite-plugin-other' }, + Promise.resolve([Promise.resolve({ name: 'vite-plugin-to-find' })]), + ]; + const names = ['vite-plugin-to-find']; + expect(await hasVitePlugins(plugins, names)).toBeTruthy(); + }); + it('multiple plugins in root', async () => { + const plugins = [ + { name: 'vite-plugin-other' }, + { name: 'vite-plugin-to-find-first' }, + { name: 'vite-plugin-to-find-second' }, + ]; + const names = ['vite-plugin-to-find-first', 'vite-plugin-to-find-second']; + expect(await hasVitePlugins(plugins, names)).toBeTruthy(); + }); + }); + it('should return false with all types of plugin structures', async () => { + const plugins = [ + { name: 'vite-plugin-root' }, + [{ name: 'vite-plugin-in-nested-array' }], + Promise.resolve({ name: 'vite-plugin-async-root' }), + Promise.resolve([{ name: 'vite-plugin-in-nested-async-array' }]), + Promise.resolve([Promise.resolve({ name: 'vite-plugin-async-in-nested-async-array' })]), + ]; + const names = ['vite-plugin-to-find-first', 'vite-plugin-to-find-second']; + expect(await hasVitePlugins(plugins, names)).toBeFalsy(); + }); +}); diff --git a/code/lib/builder-vite/src/utils/has-vite-plugins.ts b/code/lib/builder-vite/src/utils/has-vite-plugins.ts new file mode 100644 index 00000000000..97f958aa3d7 --- /dev/null +++ b/code/lib/builder-vite/src/utils/has-vite-plugins.ts @@ -0,0 +1,26 @@ +import type { PluginOption } from 'vite'; + +function checkName(plugin: PluginOption, names: string[]) { + return ( + plugin !== null && typeof plugin === 'object' && 'name' in plugin && names.includes(plugin.name) + ); +} + +/** + * Returns true if ANY of the plugins in the array have a name that matches one of the names in the names array. + * Will resolve any promises in the array. + */ +export async function hasVitePlugins(plugins: PluginOption[], names: string[]) { + const resolvedPlugins = await Promise.all(plugins); + // eslint-disable-next-line no-restricted-syntax -- we need to await in the loop + for (const plugin of resolvedPlugins) { + // eslint-disable-next-line no-await-in-loop -- we need to await in the loop + if (Array.isArray(plugin) && Boolean(await hasVitePlugins(plugin, names))) { + return true; + } + if (checkName(plugin, names)) { + return true; + } + } + return false; +} diff --git a/code/lib/builder-vite/src/utils/without-vite-plugins.test.ts b/code/lib/builder-vite/src/utils/without-vite-plugins.test.ts new file mode 100644 index 00000000000..c53422cc69e --- /dev/null +++ b/code/lib/builder-vite/src/utils/without-vite-plugins.test.ts @@ -0,0 +1,200 @@ +import { withoutVitePlugins } from './without-vite-plugins'; + +describe('withoutVitePlugins', () => { + describe('should remove', () => { + it('plugin in root', async () => { + const plugins = [{ name: 'vite-plugin-root-to-remove' }, { name: 'vite-plugin-root-keep' }]; + const names = ['vite-plugin-root-to-remove']; + + expect(await withoutVitePlugins(plugins, names)).toMatchInlineSnapshot(` + Array [ + Object { + "name": "vite-plugin-root-keep", + }, + ] + `); + }); + + it('plugin in nested array', async () => { + const plugins = [ + [{ name: 'vite-plugin-nested-to-remove' }, { name: 'vite-plugin-nested-keep' }], + { name: 'vite-plugin-root-keep' }, + ]; + const names = ['vite-plugin-nested-to-remove']; + + expect(await withoutVitePlugins(plugins, names)).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "name": "vite-plugin-nested-keep", + }, + ], + Object { + "name": "vite-plugin-root-keep", + }, + ] + `); + }); + + it('plugin in nested async array', async () => { + const plugins = [ + Promise.resolve([ + { name: 'vite-plugin-nested-async-to-remove' }, + { name: 'vite-plugin-nested-async-keep' }, + ]), + ]; + const names = ['vite-plugin-nested-async-to-remove']; + + expect(await withoutVitePlugins(plugins, names)).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "name": "vite-plugin-nested-async-keep", + }, + ], + ] + `); + }); + + it('async plugin in root', async () => { + const plugins = [ + Promise.resolve({ name: 'vite-plugin-async-root-to-remove' }), + Promise.resolve({ name: 'vite-plugin-async-root-keep' }), + ]; + const names = ['vite-plugin-async-root-to-remove']; + + expect(await withoutVitePlugins(plugins, names)).toMatchInlineSnapshot(` + Array [ + Object { + "name": "vite-plugin-async-root-keep", + }, + ] + `); + }); + + it('async plugin in nested array', async () => { + const plugins = [ + [ + Promise.resolve({ name: 'vite-plugin-async-nested-to-remove' }), + Promise.resolve({ name: 'vite-plugin-async-nested-keep' }), + ], + Promise.resolve({ name: 'vite-plugin-async-root-keep' }), + ]; + const names = ['vite-plugin-async-nested-to-remove']; + + expect(await withoutVitePlugins(plugins, names)).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "name": "vite-plugin-async-nested-keep", + }, + ], + Object { + "name": "vite-plugin-async-root-keep", + }, + ] + `); + }); + it('async plugin in nested async array', async () => { + const plugins = [ + Promise.resolve([ + Promise.resolve({ name: 'vite-plugin-async-nested-async-to-remove' }), + Promise.resolve({ name: 'vite-plugin-async-nested-async-keep' }), + ]), + ]; + const names = ['vite-plugin-async-nested-async-to-remove']; + + expect(await withoutVitePlugins(plugins, names)).toMatchInlineSnapshot(` + Array [ + Array [ + Object { + "name": "vite-plugin-async-nested-async-keep", + }, + ], + ] + `); + }); + + it('multiple plugins in root', async () => { + const plugins = [ + { name: 'vite-plugin-root-first-to-remove' }, + { name: 'vite-plugin-root-keep' }, + { name: 'vite-plugin-root-second-to-remove' }, + ]; + const names = ['vite-plugin-root-first-to-remove', 'vite-plugin-root-second-to-remove']; + + expect(await withoutVitePlugins(plugins, names)).toMatchInlineSnapshot(` + Array [ + Object { + "name": "vite-plugin-root-keep", + }, + ] + `); + }); + + it('multiple plugins in all cases', async () => { + const plugins = [ + { name: 'vite-plugin-root-to-remove' }, + Promise.resolve({ name: 'vite-plugin-async-root-to-remove' }), + [{ name: 'vite-plugin-nested-to-remove' }], + Promise.resolve([{ name: 'vite-plugin-async-nested-to-remove' }]), + [Promise.resolve({ name: 'vite-plugin-nested-async-to-remove' })], + Promise.resolve([Promise.resolve({ name: 'vite-plugin-async-nested-async-to-remove' })]), + ]; + const names = [ + 'vite-plugin-root-to-remove', + 'vite-plugin-async-root-to-remove', + 'vite-plugin-nested-to-remove', + 'vite-plugin-async-nested-to-remove', + 'vite-plugin-nested-async-to-remove', + 'vite-plugin-async-nested-async-to-remove', + ]; + + expect(await withoutVitePlugins(plugins, names)).toMatchInlineSnapshot(` + Array [ + Array [], + Array [], + Array [], + Array [], + ] + `); + }); + }); + + it('should no-op if plugins are not found', async () => { + const plugins = [ + { name: 'vite-plugin-root' }, + [{ name: 'vite-plugin-in-nested-array' }], + Promise.resolve({ name: 'vite-plugin-async-root' }), + Promise.resolve([{ name: 'vite-plugin-in-nested-async-array' }]), + Promise.resolve([Promise.resolve({ name: 'vite-plugin-async-in-nested-async-array' })]), + ]; + const names = ['vite-plugin-to-remove-first', 'vite-plugin-to-remove-second']; + + expect(await withoutVitePlugins(plugins, names)).toMatchInlineSnapshot(` + Array [ + Object { + "name": "vite-plugin-root", + }, + Array [ + Object { + "name": "vite-plugin-in-nested-array", + }, + ], + Object { + "name": "vite-plugin-async-root", + }, + Array [ + Object { + "name": "vite-plugin-in-nested-async-array", + }, + ], + Array [ + Object { + "name": "vite-plugin-async-in-nested-async-array", + }, + ], + ] + `); + }); +}); diff --git a/code/lib/builder-vite/src/utils/without-vite-plugins.ts b/code/lib/builder-vite/src/utils/without-vite-plugins.ts index fe7396aa083..33f0dc5633e 100644 --- a/code/lib/builder-vite/src/utils/without-vite-plugins.ts +++ b/code/lib/builder-vite/src/utils/without-vite-plugins.ts @@ -1,16 +1,24 @@ import type { PluginOption } from 'vite'; -// recursively remove all plugins with the given names -export const withoutVitePlugins = ( +/** + * Recursively removes all plugins with the names given + * Resolves async plugins + */ +export const withoutVitePlugins = async ( plugins: PluginOption[] = [], namesToRemove: string[] -): PluginOption[] => - plugins.map((plugin) => { +): Promise => { + const result = []; + const resolvedPlugins = await Promise.all(plugins); + // eslint-disable-next-line no-restricted-syntax -- we need to await in the loop + for (const plugin of resolvedPlugins) { if (Array.isArray(plugin)) { - return withoutVitePlugins(plugin, namesToRemove); + // eslint-disable-next-line no-await-in-loop + result.push(await withoutVitePlugins(plugin, namesToRemove)); } - if (plugin && 'name' in plugin && namesToRemove.includes(plugin.name)) { - return false; + if (plugin && 'name' in plugin && !namesToRemove.includes(plugin.name)) { + result.push(plugin); } - return plugin; - }); + } + return result; +}; diff --git a/code/lib/builder-vite/src/vite-config.ts b/code/lib/builder-vite/src/vite-config.ts index 9ed95d120b8..8d9b1a2bb77 100644 --- a/code/lib/builder-vite/src/vite-config.ts +++ b/code/lib/builder-vite/src/vite-config.ts @@ -7,7 +7,6 @@ import type { UserConfig as ViteConfig, InlineConfig, } from 'vite'; -import viteReact from '@vitejs/plugin-react'; import externalGlobals from 'rollup-plugin-external-globals'; import { isPreservingSymlinks, getFrameworkName } from '@storybook/core-common'; import { globals } from '@storybook/preview/globals'; @@ -95,11 +94,6 @@ export async function pluginConfig(options: ExtendedOptions) { externalGlobals(globals), ] as PluginOption[]; - // We need the react plugin here to support MDX in non-react projects. - if (frameworkName !== '@storybook/react-vite') { - plugins.push(viteReact({ exclude: [/\.stories\.([tj])sx?$/, /node_modules/, /\.([tj])sx?$/] })); - } - // TODO: framework doesn't exist, should move into framework when/if built if (frameworkName === '@storybook/preact-vite') { // eslint-disable-next-line global-require diff --git a/code/lib/builder-webpack5/package.json b/code/lib/builder-webpack5/package.json index db310ed4c07..846b1839ec9 100644 --- a/code/lib/builder-webpack5/package.json +++ b/code/lib/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -58,24 +58,24 @@ }, "dependencies": { "@babel/core": "^7.12.10", - "@storybook/addons": "7.0.0-beta.0", - "@storybook/api": "7.0.0-beta.0", - "@storybook/channel-postmessage": "7.0.0-beta.0", - "@storybook/channel-websocket": "7.0.0-beta.0", - "@storybook/channels": "7.0.0-beta.0", - "@storybook/client-api": "7.0.0-beta.0", - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/core-webpack": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/preview": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/router": "7.0.0-beta.0", - "@storybook/store": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", + "@storybook/addons": "7.0.0-beta.12", + "@storybook/api": "7.0.0-beta.12", + "@storybook/channel-postmessage": "7.0.0-beta.12", + "@storybook/channel-websocket": "7.0.0-beta.12", + "@storybook/channels": "7.0.0-beta.12", + "@storybook/client-api": "7.0.0-beta.12", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/core-webpack": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/preview": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/router": "7.0.0-beta.12", + "@storybook/store": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", "@types/node": "^16.0.0", "@types/semver": "^7.3.4", "babel-loader": "^8.3.0", @@ -130,5 +130,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/builder-webpack5/src/presets/preview-preset.ts b/code/lib/builder-webpack5/src/presets/preview-preset.ts index 9614abcb2d1..eba1e361bbd 100644 --- a/code/lib/builder-webpack5/src/presets/preview-preset.ts +++ b/code/lib/builder-webpack5/src/presets/preview-preset.ts @@ -29,7 +29,5 @@ export const babel = async (config: any, options: any) => ({ ], }); -export const babelLoaderRef = () => require.resolve('babel-loader'); - export const previewMainTemplate = () => require.resolve('@storybook/builder-webpack5/templates/preview.ejs'); diff --git a/code/lib/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/lib/builder-webpack5/src/preview/iframe-webpack.config.ts index a8de0de4baa..ecb620baa29 100644 --- a/code/lib/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/lib/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -147,8 +147,6 @@ export default async ( previewAnnotations.forEach((previewAnnotationFilename: string | undefined) => { if (!previewAnnotationFilename) return; - const previewApi = storybookPaths['@storybook/preview-api']; - const clientLogger = storybookPaths['@storybook/client-logger']; // Ensure that relative paths end up mapped to a filename in the cwd, so a later import // of the `previewAnnotationFilename` in the template works. @@ -159,8 +157,6 @@ export default async ( // file, see https://github.com/storybookjs/storybook/pull/16727#issuecomment-986485173 virtualModuleMapping[entryFilename] = interpolate(entryTemplate, { previewAnnotationFilename, - previewApi, - clientLogger, }); entries.push(entryFilename); }); diff --git a/code/lib/builder-webpack5/src/types.ts b/code/lib/builder-webpack5/src/types.ts index 6b13b02adf9..6e55f145ca2 100644 --- a/code/lib/builder-webpack5/src/types.ts +++ b/code/lib/builder-webpack5/src/types.ts @@ -16,7 +16,7 @@ export interface TypescriptOptions extends TypeScriptOptionsBase { /** * Configures `fork-ts-checker-webpack-plugin` */ - checkOptions?: ForkTsCheckerWebpackPlugin['options']; + checkOptions?: ConstructorParameters[0]; } export interface StorybookConfigWebpack extends Pick { diff --git a/code/lib/builder-webpack5/templates/virtualModuleEntry.template.js b/code/lib/builder-webpack5/templates/virtualModuleEntry.template.js index d25b289bb40..d078efc3eb5 100644 --- a/code/lib/builder-webpack5/templates/virtualModuleEntry.template.js +++ b/code/lib/builder-webpack5/templates/virtualModuleEntry.template.js @@ -9,7 +9,7 @@ import { addArgsEnhancer, addArgTypesEnhancer, setGlobalRender, -} from '{{previewApi}}'; +} from '@storybook/preview-api'; import * as previewAnnotations from '{{previewAnnotationFilename}}'; Object.keys(previewAnnotations).forEach((key) => { diff --git a/code/lib/channel-postmessage/package.json b/code/lib/channel-postmessage/package.json index 6f0d2e8161a..6653923b926 100644 --- a/code/lib/channel-postmessage/package.json +++ b/code/lib/channel-postmessage/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-postmessage", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -43,9 +43,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.0.0-beta.0", - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", + "@storybook/channels": "7.0.0-beta.12", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", "global": "^4.4.0", "qs": "^6.10.0", "telejson": "^7.0.3" @@ -61,5 +61,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/channel-websocket/package.json b/code/lib/channel-websocket/package.json index 23a7d0a385b..4fa79e5ef1d 100644 --- a/code/lib/channel-websocket/package.json +++ b/code/lib/channel-websocket/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channel-websocket", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -43,8 +43,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.0.0-beta.0", - "@storybook/client-logger": "7.0.0-beta.0", + "@storybook/channels": "7.0.0-beta.12", + "@storybook/client-logger": "7.0.0-beta.12", "global": "^4.4.0", "telejson": "^7.0.3" }, @@ -59,5 +59,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/channels/package.json b/code/lib/channels/package.json index 3840d9ec93a..16f6e7e7b05 100644 --- a/code/lib/channels/package.json +++ b/code/lib/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -53,5 +53,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index 7f19e4ed9fc..177514072df 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook CLI", "keywords": [ "storybook" @@ -21,10 +21,10 @@ "license": "MIT", "bin": "./index.js", "dependencies": { - "@storybook/cli": "7.0.0-beta.0" + "@storybook/cli": "7.0.0-beta.12" }, "publishConfig": { "access": "public" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index f66d38951f7..5e7ca55603a 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook CLI", "keywords": [ "storybook" @@ -24,10 +24,10 @@ "storybook": "./index.js" }, "dependencies": { - "@storybook/cli": "7.0.0-beta.0" + "@storybook/cli": "7.0.0-beta.12" }, "publishConfig": { "access": "public" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index 236863b4b7c..2ad49543f1b 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook's CLI - easiest method of adding storybook to your projects", "keywords": [ "cli", @@ -43,13 +43,13 @@ "dependencies": { "@babel/core": "^7.20.2", "@babel/preset-env": "^7.20.2", - "@storybook/codemod": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/core-server": "7.0.0-beta.0", - "@storybook/csf-tools": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/telemetry": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/codemod": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/core-server": "7.0.0-beta.12", + "@storybook/csf-tools": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/telemetry": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "@types/semver": "^7.3.4", "boxen": "^5.1.2", "chalk": "^4.1.0", @@ -71,23 +71,21 @@ "read-pkg-up": "^7.0.1", "semver": "^7.3.7", "shelljs": "^0.8.5", + "simple-update-notifier": "^1.0.0", "strip-json-comments": "^3.0.1", "ts-dedent": "^2.0.0", - "update-notifier": "^6.0.2", "util-deprecate": "^1.0.2" }, "devDependencies": { - "@storybook/client-api": "7.0.0-beta.0", + "@storybook/client-api": "7.0.0-beta.12", "@types/cross-spawn": "^6.0.2", "@types/prompts": "^2.0.9", "@types/puppeteer-core": "^2.1.0", "@types/semver": "^7.3.4", "@types/shelljs": "^0.8.7", - "@types/update-notifier": "^6.0.1", "@types/util-deprecate": "^1.0.0", "strip-json-comments": "^3.1.1", - "typescript": "~4.9.3", - "update-notifier": "^6.0.2" + "typescript": "~4.9.3" }, "publishConfig": { "access": "public" @@ -98,5 +96,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/cli/src/automigrate/fixes/index.ts b/code/lib/cli/src/automigrate/fixes/index.ts index 2ed72676b06..a65b8b2993a 100644 --- a/code/lib/cli/src/automigrate/fixes/index.ts +++ b/code/lib/cli/src/automigrate/fixes/index.ts @@ -8,10 +8,13 @@ import { mainjsFramework } from './mainjsFramework'; import { eslintPlugin } from './eslint-plugin'; import { builderVite } from './builder-vite'; import { sbScripts } from './sb-scripts'; +import { sbBinary } from './sb-binary'; +import { nextjsFramework } from './nextjs-framework'; import { newFrameworks } from './new-frameworks'; import { removedGlobalClientAPIs } from './remove-global-client-apis'; import { mdx1to2 } from './mdx-1-to-2'; import { docsPageAutomatic } from './docsPage-automatic'; +import { sveltekitFramework } from './sveltekit-framework'; import { addReact } from './add-react'; export * from '../types'; @@ -23,9 +26,12 @@ export const fixes: Fix[] = [ vue3, mainjsFramework, eslintPlugin, + sveltekitFramework, builderVite, + sbBinary, sbScripts, newFrameworks, + nextjsFramework, removedGlobalClientAPIs, mdx1to2, docsPageAutomatic, diff --git a/code/lib/cli/src/automigrate/fixes/mainjsFramework.ts b/code/lib/cli/src/automigrate/fixes/mainjsFramework.ts index 69cad36afe6..b08460602cf 100644 --- a/code/lib/cli/src/automigrate/fixes/mainjsFramework.ts +++ b/code/lib/cli/src/automigrate/fixes/mainjsFramework.ts @@ -31,11 +31,10 @@ export const mainjsFramework: Fix = { const storybookCoerced = storybookVersion && semver.coerce(storybookVersion)?.version; if (!storybookCoerced) { - logger.warn(dedent` - ❌ Unable to determine storybook version, skipping ${chalk.cyan('mainjsFramework')} fix. + throw new Error(dedent` + ❌ Unable to determine storybook version. 🤔 Are you running automigrate from your project directory? `); - return null; } const main = await readConfig(mainConfig); diff --git a/code/lib/cli/src/automigrate/fixes/new-frameworks.ts b/code/lib/cli/src/automigrate/fixes/new-frameworks.ts index cc3c03bef1f..dee016f5780 100644 --- a/code/lib/cli/src/automigrate/fixes/new-frameworks.ts +++ b/code/lib/cli/src/automigrate/fixes/new-frameworks.ts @@ -113,11 +113,10 @@ export const newFrameworks: Fix = { const storybookCoerced = storybookVersion && semver.coerce(storybookVersion)?.version; if (!storybookCoerced) { - logger.warn(dedent` - ❌ Unable to determine storybook version, skipping ${chalk.cyan('newFrameworks')} fix. + throw new Error(dedent` + ❌ Unable to determine storybook version. 🤔 Are you running automigrate from your project directory? `); - return null; } if (!semver.gte(storybookCoerced, '7.0.0')) { @@ -151,19 +150,9 @@ export const newFrameworks: Fix = { return null; } - if (allDeps.vite && semver.lt(semver.coerce(allDeps.vite).version, '3.0.0')) { - logger.warn(dedent` - ❌ Detected Vite ${ - allDeps.vite - }, which is unsupported in Storybook 7.0, so the ${chalk.cyan( - 'newFrameworks' - )} fix will be skipped. - Please upgrade vite to 3.0.0 or higher and rerun this automigration with "npx storybook@future automigrate". - `); - return null; - } - - const frameworkOptions = getFrameworkOptions(framework, main); + const frameworkOptions = + // svelte-vite doesn't support svelteOptions so there's no need to move them + newFrameworkPackage === '@storybook/svelte-vite' ? {} : getFrameworkOptions(framework, main); const dependenciesToRemove = [ '@storybook/builder-webpack5', @@ -181,6 +170,18 @@ export const newFrameworks: Fix = { dependenciesToAdd.push(newFrameworkPackage); } + if (allDeps.vite && semver.lt(semver.coerce(allDeps.vite).version, '3.0.0')) { + throw new Error(dedent` + ❌ Your project should be upgraded to use the framework package ${chalk.bold( + newFrameworkPackage + )}, but we detected that you are using Vite ${chalk.bold( + allDeps.vite + )}, which is unsupported in ${chalk.bold( + 'Storybook 7.0' + )}. Please upgrade Vite to ${chalk.bold('3.0.0 or higher')} and rerun this migration. + `); + } + return { main, dependenciesToAdd, @@ -192,13 +193,17 @@ export const newFrameworks: Fix = { }; }, - prompt() { + prompt({ frameworkPackage, dependenciesToRemove }) { return dedent` We've detected you are using an older format of Storybook frameworks and builders. In Storybook 7, frameworks also specify the builder to be used. - We can remove the dependencies that are no longer needed and install the new framework that already includes the builder. + We can remove the dependencies that are no longer needed: ${chalk.yellow( + dependenciesToRemove.join(', ') + )} + + And set up the ${chalk.magenta(frameworkPackage)} framework that already includes the builder. To learn more about the framework field, see: ${chalk.yellow( 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-field-mandatory' @@ -209,7 +214,7 @@ export const newFrameworks: Fix = { Unless you're using Storybook's Vite builder, this automigration will install a Webpack5-based framework. If you were using Storybook's Webpack4 builder (default in 6.x, discontinued in 7.0), this could be a breaking - change--especially if your project has a custom webpack configuration. + change -- especially if your project has a custom webpack configuration. To learn more about migrating from Webpack4, see: ${chalk.yellow( 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#webpack4-support-discontinued' @@ -256,14 +261,18 @@ export const newFrameworks: Fix = { delete currentCore.builder; } + if (frameworkPackage === '@storybook/svelte-vite' && main.getFieldNode(['svelteOptions'])) { + logger.info(`✅ Removing svelteOptions field in main.js`); + main.removeField(['svelteOptions']); + } + if (Object.keys(builderInfo.options).length > 0) { main.setFieldValue(['framework', 'options', 'builder'], builderInfo.options); } if (currentCore) { if (Object.keys(currentCore).length === 0) { - // TODO: this should delete the field instead - main.setFieldValue(['core'], {}); + main.removeField(['core']); } else { main.setFieldValue(['core'], currentCore); } diff --git a/code/lib/cli/src/automigrate/fixes/nextjs-framework.test.ts b/code/lib/cli/src/automigrate/fixes/nextjs-framework.test.ts new file mode 100644 index 00000000000..2f8d57bbfee --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/nextjs-framework.test.ts @@ -0,0 +1,183 @@ +/* eslint-disable no-underscore-dangle */ +import path from 'path'; +import type { JsPackageManager } from '../../js-package-manager'; +import { nextjsFramework } from './nextjs-framework'; + +// eslint-disable-next-line global-require, jest/no-mocks-import +jest.mock('fs-extra', () => require('../../../../../__mocks__/fs-extra')); + +const checkNextjsFramework = async ({ packageJson, main }: any) => { + if (main) { + // eslint-disable-next-line global-require + require('fs-extra').__setMockFiles({ + [path.join('.storybook', 'main.js')]: `module.exports = ${JSON.stringify(main)};`, + }); + } + const packageManager = { + retrievePackageJson: () => ({ dependencies: {}, devDependencies: {}, ...packageJson }), + } as JsPackageManager; + return nextjsFramework.check({ packageManager }); +}; + +describe('nextjs-framework fix', () => { + describe('should no-op', () => { + it('in sb < 7', async () => { + const packageJson = { dependencies: { '@storybook/react': '^6.2.0' } }; + await expect( + checkNextjsFramework({ + packageJson, + main: {}, + }) + ).resolves.toBeFalsy(); + }); + + it('in sb 7 with no main', async () => { + const packageJson = { dependencies: { '@storybook/react': '^7.0.0' } }; + await expect( + checkNextjsFramework({ + packageJson, + main: undefined, + }) + ).resolves.toBeFalsy(); + }); + + it('in sb 7 with no framework field in main', async () => { + const packageJson = { dependencies: { '@storybook/react': '^7.0.0' } }; + await expect( + checkNextjsFramework({ + packageJson, + main: {}, + }) + ).resolves.toBeFalsy(); + }); + + it('in sb 7 in non-nextjs projects', async () => { + const packageJson = { dependencies: { '@storybook/react': '^7.0.0' } }; + await expect( + checkNextjsFramework({ + packageJson, + main: { + framework: '@storybook/react', + }, + }) + ).resolves.toBeFalsy(); + }); + + it('in sb 7 with unsupported package', async () => { + const packageJson = { dependencies: { '@storybook/riot': '^7.0.0' } }; + await expect( + checkNextjsFramework({ + packageJson, + main: { + framework: '@storybook/riot', + core: { + builder: 'webpack5', + }, + }, + }) + ).resolves.toBeFalsy(); + }); + }); + + describe('sb >= 7', () => { + it('should update from @storybook/react-webpack5 to @storybook/nextjs', async () => { + const packageJson = { + dependencies: { + '@storybook/react': '^7.0.0-alpha.0', + '@storybook/react-webpack5': '^7.0.0-alpha.0', + next: '^12.0.0', + }, + }; + await expect( + checkNextjsFramework({ + packageJson, + main: { + framework: '@storybook/react-webpack5', + }, + }) + ).resolves.toEqual(expect.objectContaining({})); + }); + + it('should remove legacy addons', async () => { + const packageJson = { + dependencies: { + '@storybook/react': '^7.0.0-alpha.0', + '@storybook/react-webpack5': '^7.0.0-alpha.0', + next: '^12.0.0', + 'storybook-addon-next': '^1.0.0', + 'storybook-addon-next-router': '^1.0.0', + }, + }; + await expect( + checkNextjsFramework({ + packageJson, + main: { + framework: '@storybook/react-webpack5', + addons: ['storybook-addon-next', 'storybook-addon-next-router'], + }, + }) + ).resolves.toEqual( + expect.objectContaining({ + addonsToRemove: ['storybook-addon-next', 'storybook-addon-next-router'], + }) + ); + }); + + it('should move nextjs addon options to frameworkOptions', async () => { + const packageJson = { + dependencies: { + '@storybook/react': '^7.0.0-alpha.0', + '@storybook/react-webpack5': '^7.0.0-alpha.0', + next: '^12.0.0', + 'storybook-addon-next': '^1.0.0', + }, + }; + await expect( + checkNextjsFramework({ + packageJson, + main: { + framework: { name: '@storybook/react-webpack5', options: { fastRefresh: true } }, + addons: [ + { + name: 'storybook-addon-next', + options: { + nextConfigPath: '../next.config.js', + }, + }, + ], + }, + }) + ).resolves.toEqual( + expect.objectContaining({ + addonsToRemove: ['storybook-addon-next'], + frameworkOptions: { + fastRefresh: true, + nextConfigPath: '../next.config.js', + }, + }) + ); + }); + + it('should warn for @storybook/react-vite users', async () => { + const consoleSpy = jest.spyOn(console, 'info'); + const packageJson = { + dependencies: { + '@storybook/react': '^7.0.0-alpha.0', + '@storybook/react-vite': '^7.0.0-alpha.0', + next: '^12.0.0', + 'storybook-addon-next': '^1.0.0', + }, + }; + await expect( + checkNextjsFramework({ + packageJson, + main: { + framework: { name: '@storybook/react-vite' }, + }, + }) + ).resolves.toBeFalsy(); + + expect(consoleSpy).toHaveBeenCalledWith(expect.stringContaining('Vite builder')); + }); + }); +}); diff --git a/code/lib/cli/src/automigrate/fixes/nextjs-framework.ts b/code/lib/cli/src/automigrate/fixes/nextjs-framework.ts new file mode 100644 index 00000000000..5dbe0f5b22c --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/nextjs-framework.ts @@ -0,0 +1,198 @@ +import chalk from 'chalk'; +import dedent from 'ts-dedent'; +import semver from 'semver'; +import type { ConfigFile } from '@storybook/csf-tools'; +import { readConfig, writeConfig } from '@storybook/csf-tools'; +import { getStorybookInfo } from '@storybook/core-common'; + +import type { Fix } from '../types'; +import type { PackageJsonWithDepsAndDevDeps } from '../../js-package-manager'; +import { getStorybookVersionSpecifier } from '../../helpers'; + +const logger = console; + +interface NextjsFrameworkRunOptions { + main: ConfigFile; + packageJson: PackageJsonWithDepsAndDevDeps; + addonsToRemove: string[]; + frameworkOptions: Record; +} + +type Addon = string | { name: string; options?: Record }; + +export const getNextjsAddonOptions = (addons: Addon[]) => { + const nextjsAddon = addons?.find((addon) => + typeof addon === 'string' + ? addon === 'storybook-addon-next' + : addon.name === 'storybook-addon-next' + ); + + if (!nextjsAddon || typeof nextjsAddon === 'string') { + return {}; + } + + return nextjsAddon.options || {}; +}; + +/** + * Does the user have a nextjs project but is not using the @storybook/nextjs framework package? + * + * If so: + * - Remove the dependencies if webpack (@storybook/react-webpack5) + * - Install the nextjs package (@storybook/nextjs) + * - Uninstall existing legacy addons: storybook-addon-next and storybook-addon-next-router + * - Update StorybookConfig type import (if it exists) from react-webpack5 to nextjs + * - Update the main config to use the new framework + * -- removing legacy addons: storybook-addon-next and storybook-addon-next-router + * -- moving storybook-addon-next options into frameworkOptions + */ +export const nextjsFramework: Fix = { + id: 'nextjsFramework', + + async check({ packageManager }) { + const packageJson = packageManager.retrievePackageJson(); + const allDeps = { ...packageJson.dependencies, ...packageJson.devDependencies }; + + if (!allDeps.next) { + return null; + } + + const { mainConfig, version: storybookVersion } = getStorybookInfo(packageJson); + if (!mainConfig) { + logger.warn('Unable to find storybook main.js config, skipping'); + return null; + } + + const storybookCoerced = storybookVersion && semver.coerce(storybookVersion)?.version; + if (!storybookCoerced) { + throw new Error(dedent` + ❌ Unable to determine storybook version. + 🤔 Are you running automigrate from your project directory? + `); + } + + if (!semver.gte(storybookCoerced, '7.0.0')) { + return null; + } + + const main = await readConfig(mainConfig); + + const frameworkPackage = main.getFieldValue(['framework']); + + if (!frameworkPackage) { + return null; + } + + const frameworkPackageName = + typeof frameworkPackage === 'string' ? frameworkPackage : frameworkPackage.name; + + if (frameworkPackageName === '@storybook/react-vite') { + logger.info(dedent` + We've detected you are using Storybook in a Next.js project. + + In Storybook 7, we introduced a new framework package for Next.js projects: @storybook/nextjs. + + This package provides a better experience for Next.js users, however it is only compatible with the webpack 5 builder, so we can't automigrate for you, as you are using the Vite builder. + + If you are interested in using this package, see: ${chalk.yellow( + 'https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md' + )} + `); + + return null; + } + + // we only migrate from react-webpack5 projects + if (frameworkPackageName !== '@storybook/react-webpack5') { + return null; + } + + const addonOptions = getNextjsAddonOptions(main.getFieldValue(['addons'])); + const frameworkOptions = main.getFieldValue(['framework', 'options']) || {}; + + const addonsToRemove = ['storybook-addon-next', 'storybook-addon-next-router'].filter( + (dep) => allDeps[dep] + ); + + return { + main, + addonsToRemove, + frameworkOptions: { + ...frameworkOptions, + ...addonOptions, + }, + packageJson, + }; + }, + + prompt({ addonsToRemove }) { + let addonsMessage = ''; + + if (addonsToRemove.length > 0) { + addonsMessage = ` + This package also supports features provided by the following packages, which can now be removed: + ${addonsToRemove.map((dep) => `- ${chalk.cyan(dep)}`).join(', ')} + `; + } + + return dedent` + We've detected you are using Storybook in a ${chalk.bold('Next.js')} project. + + In Storybook 7, we introduced a new framework package for Next.js projects: ${chalk.magenta( + '@storybook/nextjs' + )}. + + This package is a replacement for ${chalk.magenta( + '@storybook/react-webpack5' + )} and provides a better experience for Next.js users. + ${addonsMessage} + To learn more about it, see: ${chalk.yellow( + 'https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md' + )} + `; + }, + + async run({ + result: { addonsToRemove, main, frameworkOptions, packageJson }, + packageManager, + dryRun, + }) { + const dependenciesToRemove = [...addonsToRemove, '@storybook/react-webpack5']; + if (dependenciesToRemove.length > 0) { + logger.info(`✅ Removing redundant packages: ${dependenciesToRemove.join(', ')}`); + if (!dryRun) { + packageManager.removeDependencies({ skipInstall: true, packageJson }, dependenciesToRemove); + + const existingAddons = main.getFieldValue(['addons']) as Addon[]; + const updatedAddons = existingAddons.filter((addon) => { + if (typeof addon === 'string') { + return !addonsToRemove.includes(addon); + } + + if (addon.name) { + return !addonsToRemove.includes(addon.name); + } + + return false; + }); + main.setFieldValue(['addons'], updatedAddons); + } + } + + logger.info(`✅ Installing new dependencies: @storybook/nextjs`); + if (!dryRun) { + const versionToInstall = getStorybookVersionSpecifier(packageJson); + packageManager.addDependencies({ installAsDevDependencies: true, packageJson }, [ + `@storybook/nextjs@${versionToInstall}`, + ]); + } + + logger.info(`✅ Updating framework field in main.js`); + if (!dryRun) { + main.setFieldValue(['framework', 'options'], frameworkOptions); + main.setFieldValue(['framework', 'name'], '@storybook/nextjs'); + + await writeConfig(main); + } + }, +}; diff --git a/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.ts b/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.ts index 4962eae63d3..793d0c9aa80 100644 --- a/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.ts +++ b/code/lib/cli/src/automigrate/fixes/remove-global-client-apis.ts @@ -20,6 +20,7 @@ interface GlobalClientAPIOptions { export const removedGlobalClientAPIs: Fix = { id: 'removedglobalclientapis', + promptOnly: true, async check({ packageManager }) { const packageJson = packageManager.retrievePackageJson(); @@ -48,19 +49,18 @@ export const removedGlobalClientAPIs: Fix = { }, prompt({ usedAPIs, previewPath }) { return dedent` + ${chalk.bold( + chalk.red('Attention') + )}: We could not automatically make this change. You'll need to do it manually. + The following APIs (used in "${chalk.yellow(previewPath)}") have been removed from Storybook: ${usedAPIs.map((api) => `- ${chalk.cyan(api)}`).join('\n')} - You'll need to update "${chalk.yellow(previewPath)}" manually. - Please see the migration guide for more information: ${chalk.yellow( 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#removed-global-client-apis' )} `; }, - async run() { - console.log('Skipping automatic fix for removed global client APIs'); - }, }; diff --git a/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts b/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts new file mode 100644 index 00000000000..a3d68cf6dfa --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/sb-binary.test.ts @@ -0,0 +1,77 @@ +import type { JsPackageManager, PackageJson } from '../../js-package-manager'; +import { sbBinary } from './sb-binary'; + +const checkStorybookBinary = async ({ packageJson }: { packageJson: PackageJson }) => { + const packageManager = { + retrievePackageJson: () => ({ dependencies: {}, devDependencies: {}, ...packageJson }), + } as JsPackageManager; + return sbBinary.check({ packageManager }); +}; + +describe('storybook-binary fix', () => { + describe('sb < 7.0', () => { + describe('does nothing', () => { + const packageJson = { dependencies: { '@storybook/react': '^6.2.0' } }; + it('should no-op', async () => { + await expect( + checkStorybookBinary({ + packageJson, + }) + ).resolves.toBeFalsy(); + }); + }); + }); + + describe('sb >= 7.0', () => { + it('should add storybook dependency if not present', async () => { + const packageJson = { + dependencies: { + '@storybook/react': '^7.0.0-alpha.0', + }, + }; + await expect( + checkStorybookBinary({ + packageJson, + }) + ).resolves.toEqual( + expect.objectContaining({ + hasSbBinary: false, + hasStorybookBinary: false, + }) + ); + }); + + it('should remove sb dependency if it is present', async () => { + const packageJson = { + dependencies: { + '@storybook/react': '^7.0.0-alpha.0', + sb: '6.5.0', + }, + }; + await expect( + checkStorybookBinary({ + packageJson, + }) + ).resolves.toEqual( + expect.objectContaining({ + hasSbBinary: true, + hasStorybookBinary: false, + }) + ); + }); + + it('should no op if storybook is present and sb is not present', async () => { + const packageJson = { + dependencies: { + '@storybook/react': '^7.0.0-alpha.0', + storybook: '^7.0.0-alpha.0', + }, + }; + await expect( + checkStorybookBinary({ + packageJson, + }) + ).resolves.toBeNull(); + }); + }); +}); diff --git a/code/lib/cli/src/automigrate/fixes/sb-binary.ts b/code/lib/cli/src/automigrate/fixes/sb-binary.ts new file mode 100644 index 00000000000..91f647ba7a5 --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/sb-binary.ts @@ -0,0 +1,107 @@ +import chalk from 'chalk'; +import { dedent } from 'ts-dedent'; +import semver from 'semver'; +import { getStorybookInfo } from '@storybook/core-common'; +import type { Fix } from '../types'; +import { getStorybookVersionSpecifier } from '../../helpers'; +import type { PackageJsonWithDepsAndDevDeps } from '../../js-package-manager'; + +interface SbBinaryRunOptions { + storybookVersion: string; + hasSbBinary: boolean; + hasStorybookBinary: boolean; + packageJson: PackageJsonWithDepsAndDevDeps; +} + +const logger = console; + +/** + * Does the user not have storybook dependency? + * + * If so: + * - Add storybook dependency + * - If they are using sb dependency, remove it + */ +export const sbBinary: Fix = { + id: 'storybook-binary', + + async check({ packageManager }) { + const packageJson = packageManager.retrievePackageJson(); + const { devDependencies, dependencies } = packageJson; + const { version: storybookVersion } = getStorybookInfo(packageJson); + + const allDeps = { ...dependencies, ...devDependencies }; + + const storybookCoerced = storybookVersion && semver.coerce(storybookVersion)?.version; + if (!storybookCoerced) { + throw new Error(dedent` + ❌ Unable to determine storybook version. + 🤔 Are you running automigrate from your project directory? + `); + } + + if (semver.lt(storybookCoerced, '7.0.0')) { + return null; + } + + const hasSbBinary = !!allDeps.sb; + const hasStorybookBinary = !!allDeps.storybook; + + if (!hasSbBinary && hasStorybookBinary) { + return null; + } + + return { + hasSbBinary, + hasStorybookBinary, + storybookVersion, + packageJson, + }; + }, + + prompt({ storybookVersion, hasSbBinary, hasStorybookBinary }) { + const sbFormatted = chalk.cyan(`Storybook ${storybookVersion}`); + + const storybookBinaryMessage = !hasStorybookBinary + ? `We've detected you are using ${sbFormatted} without Storybook's ${chalk.magenta( + 'storybook' + )} binary. Starting in Storybook 7.0, it has to be installed.` + : ''; + + const extraMessage = hasSbBinary + ? "You're using the 'sb' binary and it should be replaced, as 'storybook' is the recommended way to run Storybook.\n" + : ''; + + return dedent` + ${storybookBinaryMessage} + ${extraMessage} + + More info: ${chalk.yellow( + 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#start-storybook--build-storybook-binaries-removed' + )} + `; + }, + + async run({ result: { packageJson, hasSbBinary, hasStorybookBinary }, packageManager, dryRun }) { + if (hasSbBinary) { + logger.info(`✅ Removing 'sb' dependency`); + if (!dryRun) { + packageManager.removeDependencies({ skipInstall: !hasStorybookBinary, packageJson }, [ + 'sb', + ]); + } + } + + if (!hasStorybookBinary) { + logger.log(); + logger.info(`✅ Adding 'storybook' as dev dependency`); + logger.log(); + if (!dryRun) { + const versionToInstall = getStorybookVersionSpecifier(packageJson); + packageManager.addDependencies({ installAsDevDependencies: true }, [ + `storybook@${versionToInstall}`, + ]); + } + } + }, +}; diff --git a/code/lib/cli/src/automigrate/fixes/sb-scripts.test.ts b/code/lib/cli/src/automigrate/fixes/sb-scripts.test.ts index a57e26953eb..eb8b827a89a 100644 --- a/code/lib/cli/src/automigrate/fixes/sb-scripts.test.ts +++ b/code/lib/cli/src/automigrate/fixes/sb-scripts.test.ts @@ -12,6 +12,7 @@ describe('getStorybookScripts', () => { it('detects default storybook scripts', () => { expect( getStorybookScripts({ + 'sb:upgrade': 'sb upgrade', storybook: 'start-storybook', 'build-storybook': 'build-storybook', }) @@ -24,6 +25,10 @@ describe('getStorybookScripts', () => { before: 'start-storybook', after: 'storybook dev', }, + 'sb:upgrade': { + before: 'sb upgrade', + after: 'storybook upgrade', + }, }); }); @@ -135,7 +140,6 @@ describe('sb-scripts fix', () => { const packageJson = { dependencies: { '@storybook/react': '^7.0.0-alpha.0', - storybook: '^7.0.0-alpha.0', }, scripts: { storybook: 'storybook dev -p 6006', @@ -150,21 +154,5 @@ describe('sb-scripts fix', () => { ).resolves.toBeFalsy(); }); }); - - describe('with storybook lib installed', () => { - const packageJson = { - dependencies: { - '@storybook/react': '^7.0.0-alpha.0', - storybook: '^7.0.0-alpha.0', - }, - }; - it('should no-op', async () => { - await expect( - checkSbScripts({ - packageJson, - }) - ).resolves.toBeFalsy(); - }); - }); }); }); diff --git a/code/lib/cli/src/automigrate/fixes/sb-scripts.ts b/code/lib/cli/src/automigrate/fixes/sb-scripts.ts index 7752bb0c420..73dd8ac3977 100644 --- a/code/lib/cli/src/automigrate/fixes/sb-scripts.ts +++ b/code/lib/cli/src/automigrate/fixes/sb-scripts.ts @@ -3,7 +3,6 @@ import { dedent } from 'ts-dedent'; import semver from 'semver'; import { getStorybookInfo } from '@storybook/core-common'; import type { Fix } from '../types'; -import { getStorybookVersionSpecifier } from '../../helpers'; import type { PackageJsonWithDepsAndDevDeps } from '../../js-package-manager'; interface SbScriptsRunOptions { @@ -29,7 +28,10 @@ export const getStorybookScripts = (allScripts: Record) => { const previousWord = allWordsFromScript[index - 1]; // full word check, rather than regex which could be faulty - const isSbBinary = currentWord === 'build-storybook' || currentWord === 'start-storybook'; + const isSbBinary = + currentWord === 'build-storybook' || + currentWord === 'start-storybook' || + currentWord === 'sb'; // in case people have scripts like `yarn start-storybook` const isPrependedByPkgManager = @@ -38,6 +40,7 @@ export const getStorybookScripts = (allScripts: Record) => { if (isSbBinary && !isPrependedByPkgManager) { isStorybookScript = true; return currentWord + .replace('sb', 'storybook') .replace('start-storybook', 'storybook dev') .replace('build-storybook', 'storybook build'); } @@ -58,32 +61,29 @@ export const getStorybookScripts = (allScripts: Record) => { }; /** - * Is the user using start-storybook + * Is the user using start-storybook or build-storybook in its scripts * * If so: - * - Add storybook dependency - * - Change start-storybook and build-storybook scripts + * - Change start-storybook and build-storybook scripts to storybook dev and storybook build + * - Change sb to storybook if they are using sb */ export const sbScripts: Fix = { id: 'sb-scripts', async check({ packageManager }) { const packageJson = packageManager.retrievePackageJson(); - const { scripts = {}, devDependencies, dependencies } = packageJson; + const { scripts = {} } = packageJson; const { version: storybookVersion } = getStorybookInfo(packageJson); - const allDeps = { ...dependencies, ...devDependencies }; - const storybookCoerced = storybookVersion && semver.coerce(storybookVersion)?.version; if (!storybookCoerced) { - logger.warn(dedent` - ❌ Unable to determine storybook version, skipping ${chalk.cyan('sb-scripts')} fix. + throw new Error(dedent` + ❌ Unable to determine storybook version. 🤔 Are you running automigrate from your project directory? `); - return null; } - if (allDeps.sb || allDeps.storybook) { + if (semver.lt(storybookCoerced, '7.0.0')) { return null; } @@ -93,9 +93,7 @@ export const sbScripts: Fix = { return null; } - return semver.gte(storybookCoerced, '7.0.0') - ? { packageJson, storybookScripts, storybookVersion } - : null; + return { packageJson, storybookScripts, storybookVersion }; }, prompt({ storybookVersion, storybookScripts }) { @@ -121,9 +119,7 @@ export const sbScripts: Fix = { )} binaries have changed to ${chalk.magenta('storybook dev')} and ${chalk.magenta( 'storybook build' )} respectively. - In order to work with ${sbFormatted}, Storybook's ${chalk.magenta( - 'storybook' - )} binary has to be installed and your storybook scripts have to be adjusted to use the binary. We can install the storybook binary and adjust your scripts for you: + In order to work with ${sbFormatted}, your storybook scripts have to be adjusted to use the binary. We can adjust them for you: ${newScriptsMessage.join('\n\n')} @@ -133,19 +129,8 @@ export const sbScripts: Fix = { `; }, - async run({ result: { storybookScripts, packageJson }, packageManager, dryRun }) { - logger.log(); - logger.info(`Adding 'storybook' as dev dependency`); - logger.log(); - - if (!dryRun) { - const versionToInstall = getStorybookVersionSpecifier(packageJson); - packageManager.addDependencies({ installAsDevDependencies: true }, [ - `storybook@${versionToInstall}`, - ]); - } - - logger.info(`Updating scripts in package.json`); + async run({ result: { storybookScripts }, packageManager, dryRun }) { + logger.info(`✅ Updating scripts in package.json`); logger.log(); if (!dryRun) { const newScripts = Object.keys(storybookScripts).reduce((acc, scriptKey) => { diff --git a/code/lib/cli/src/automigrate/fixes/sveltekit-framework.test.ts b/code/lib/cli/src/automigrate/fixes/sveltekit-framework.test.ts new file mode 100644 index 00000000000..de14f93b9ef --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/sveltekit-framework.test.ts @@ -0,0 +1,171 @@ +/* eslint-disable no-underscore-dangle */ +import type { StorybookConfig } from 'lib/types/src'; +import path from 'path'; +import type { JsPackageManager, PackageJson } from '../../js-package-manager'; +import { sveltekitFramework } from './sveltekit-framework'; + +// eslint-disable-next-line global-require, jest/no-mocks-import +jest.mock('fs-extra', () => require('../../../../../__mocks__/fs-extra')); + +const checkSvelteKitFramework = async ({ + packageJson, + main, +}: { + packageJson: PackageJson; + main?: Partial; +}) => { + if (main) { + // eslint-disable-next-line global-require + require('fs-extra').__setMockFiles({ + [path.join('.storybook', 'main.js')]: `module.exports = ${JSON.stringify(main)};`, + }); + } else { + // eslint-disable-next-line global-require + require('fs-extra').__setMockFiles({}); + } + const packageManager = { + retrievePackageJson: () => ({ dependencies: {}, devDependencies: {}, ...packageJson }), + } as JsPackageManager; + + return sveltekitFramework.check({ packageManager }); +}; + +describe('SvelteKit framework fix', () => { + describe('should no-op', () => { + it('in SB < v7.0.0', async () => { + const packageJson = { + dependencies: { '@sveltejs/kit': '^1.0.0-next.571', '@storybook/svelte': '^6.2.0' }, + }; + const main = { framework: '@storybook/svelte-vite' }; + await expect(checkSvelteKitFramework({ packageJson, main })).resolves.toBeFalsy(); + }); + + describe('in SB >= v7.0.0', () => { + it('in non-SvelteKit projects', async () => { + const packageJson = { + dependencies: { svelte: '^3.53.1', '@storybook/svelte-vite': '^7.0.0' }, + }; + const main = { + framework: '@storybook/svelte-vite', + }; + await expect(checkSvelteKitFramework({ packageJson, main })).resolves.toBeFalsy(); + }); + + it('without main', async () => { + const packageJson = { + dependencies: { '@sveltejs/kit': '^1.0.0-next.571', '@storybook/svelte': '^7.0.0' }, + }; + await expect(checkSvelteKitFramework({ packageJson })).rejects.toThrow(); + }); + + it('without framework field in main', async () => { + const packageJson = { + dependencies: { '@sveltejs/kit': '^1.0.0-next.571', '@storybook/svelte': '^7.0.0' }, + }; + const main = {}; + await expect(checkSvelteKitFramework({ packageJson, main })).rejects.toThrow(); + }); + + it('with unsupported framework', async () => { + const packageJson = { + dependencies: { + '@sveltejs/kit': '^1.0.0-next.571', + '@storybook/svelte-vite': '^7.0.0', + '@storybook/html': '^7.0.0', + }, + }; + const main = { + framework: '@storybook/html', + }; + await expect(checkSvelteKitFramework({ packageJson, main })).rejects.toThrow(); + }); + + it('with unsupported framework+builder from SB 6.5', async () => { + const packageJson = { + dependencies: { + '@sveltejs/kit': '^1.0.0-next.571', + '@storybook/svelte-webpack5': '^7.0.0', + '@storybook/svelte': '^7.0.0', + }, + }; + const main = { + framework: '@storybook/svelte', + core: { builder: '@storybook/builder-webpack5' }, + }; + await expect(checkSvelteKitFramework({ packageJson, main })).rejects.toThrow(); + }); + + it('with @storybook/svelte-webpack5 framework', async () => { + const packageJson = { + dependencies: { + '@storybook/svelte': '^7.0.0', + '@storybook/svelte-webpack5': '^7.0.0', + '@sveltejs/kit': '^1.0.0-next.571', + }, + }; + const main = { + framework: '@storybook/svelte-webpack5', + }; + await expect(checkSvelteKitFramework({ packageJson, main })).rejects.toThrow(); + }); + }); + }); + + describe('should migrate', () => { + it('from @storybook/svelte-vite', async () => { + const packageJson = { + dependencies: { + '@storybook/svelte': '^7.0.0', + '@storybook/svelte-vite': '^7.0.0', + '@sveltejs/kit': '^1.0.0-next.571', + }, + }; + const main = { + framework: '@storybook/svelte-vite', + }; + await expect(checkSvelteKitFramework({ packageJson, main })).resolves.toMatchObject({ + packageJson, + main: expect.objectContaining({}), + dependenciesToRemove: ['@storybook/svelte-vite'], + }); + }); + + it('from @storybook/svelte framework and @storybook/builder-vite builder', async () => { + const packageJson = { + dependencies: { + '@storybook/svelte': '^7.0.0', + '@storybook/builder-vite': '^7.0.0', + '@sveltejs/kit': '^1.0.0-next.571', + }, + }; + const main = { + framework: '@storybook/svelte', + core: { builder: '@storybook/builder-vite' }, + }; + await expect(checkSvelteKitFramework({ packageJson, main })).resolves.toMatchObject({ + packageJson, + main: expect.objectContaining({}), + dependenciesToRemove: ['@storybook/builder-vite'], + }); + }); + + it('from @storybook/svelte framework and storybook-builder-vite builder', async () => { + const packageJson = { + dependencies: { + '@storybook/svelte': '^7.0.0', + 'storybook-builder-vite': '^0.2.5', + '@sveltejs/kit': '^1.0.0-next.571', + }, + }; + const main = { + framework: '@storybook/svelte', + core: { builder: 'storybook-builder-vite' }, + }; + await expect(checkSvelteKitFramework({ packageJson, main })).resolves.toMatchObject({ + packageJson, + main: expect.objectContaining({}), + dependenciesToRemove: ['storybook-builder-vite'], + }); + }); + }); +}); diff --git a/code/lib/cli/src/automigrate/fixes/sveltekit-framework.ts b/code/lib/cli/src/automigrate/fixes/sveltekit-framework.ts new file mode 100644 index 00000000000..3422da2cfc6 --- /dev/null +++ b/code/lib/cli/src/automigrate/fixes/sveltekit-framework.ts @@ -0,0 +1,182 @@ +import chalk from 'chalk'; +import dedent from 'ts-dedent'; +import semver from 'semver'; +import type { ConfigFile } from '@storybook/csf-tools'; +import { readConfig, writeConfig } from '@storybook/csf-tools'; +import { getStorybookInfo } from '@storybook/core-common'; + +import type { Fix } from '../types'; +import type { PackageJsonWithDepsAndDevDeps } from '../../js-package-manager'; +import { getStorybookVersionSpecifier } from '../../helpers'; + +const logger = console; + +interface SvelteKitFrameworkRunOptions { + main: ConfigFile; + packageJson: PackageJsonWithDepsAndDevDeps; + dependenciesToRemove: string[]; +} + +const fixId = 'sveltekitFramework'; + +/** + * Does the user have a SvelteKit project but is using a Svelte+Vite setup instead of the @storybook/sveltekit framework? + * + * If so: + * - Remove the dependencies (@storybook/svelte-vite, @storybook/builder-vite, storybook-builder-vite) + * - Add the dependencies (@storybook/sveltekit) + * - Update the main config to use the new framework + */ +export const sveltekitFramework: Fix = { + id: fixId, + + async check({ packageManager }) { + const packageJson = packageManager.retrievePackageJson(); + const allDeps = { ...packageJson.dependencies, ...packageJson.devDependencies }; + + if (!allDeps['@sveltejs/kit']) { + return null; + } + + const { mainConfig, version: storybookVersion } = getStorybookInfo(packageJson); + if (!mainConfig) { + logger.warn('Unable to find storybook main.js config, skipping'); + return null; + } + + const sbVersionCoerced = storybookVersion && semver.coerce(storybookVersion)?.version; + if (!sbVersionCoerced) { + throw new Error(dedent` + ❌ Unable to determine storybook version. + 🤔 Are you running automigrate from your project directory? + `); + } + + if (!semver.gte(sbVersionCoerced, '7.0.0')) { + return null; + } + + const main = await readConfig(mainConfig); + const frameworkConfig = main.getFieldValue(['framework']); + + if (!frameworkConfig) { + logger.warn(dedent` + ❌ Unable to determine Storybook framework, skipping ${chalk.cyan(fixId)} fix. + 🤔 Are you running automigrate from your project directory? + `); + return null; + } + + const framework = typeof frameworkConfig === 'string' ? frameworkConfig : frameworkConfig.name; + + if (framework === '@storybook/sveltekit') { + // already using the new framework + return null; + } + + if (framework === '@storybook/svelte-vite') { + // direct migration from svelte-vite projects + return { + main, + packageJson, + dependenciesToRemove: ['@storybook/svelte-vite'], + }; + } + + if (framework !== '@storybook/svelte') { + // migration from projects using Svelte but with an unrecognized framework+builder setup - not supported + logger.warn(dedent` + We've detected you are using Storybook in a SvelteKit project. + + In Storybook 7, we introduced a new framework package for SvelteKit projects: @storybook/sveltekit. + + This package provides a better experience for SvelteKit users, however it is only compatible with the Svelte framework and the Vite builder, so we can't automigrate for you, as you are using another framework and builder combination. + + If you are interested in using this package, see: ${chalk.yellow( + 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#sveltekit-needs-the-storybooksveltekit-framework' + )} + `); + return null; + } + + const builder = main.getFieldValue(['core', 'builder']); + + if (!['@storybook/builder-vite', 'storybook-builder-vite'].includes(builder)) { + // migration from 6.x projects using Svelte with the Webpack builder - not supported + logger.warn(dedent` + We've detected you are using Storybook in a SvelteKit project. + + In Storybook 7, we introduced a new framework package for SvelteKit projects: @storybook/sveltekit. + + This package provides a better experience for SvelteKit users, however it is only compatible with the Vite builder, so we can't automigrate for you, as you are using another builder. + + If you are interested in using this package, see: ${chalk.yellow( + 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#sveltekit-needs-the-storybooksveltekit-framework' + )} + `); + + return null; + } + + // migration from 6.x projects using Svelte with the Vite builder + return { + main, + packageJson, + dependenciesToRemove: [builder], + }; + }, + + prompt() { + return dedent` + We've detected you are using Storybook in a SvelteKit project. + + In Storybook 7, we introduced a new framework package for SvelteKit projects: @storybook/sveltekit + This package is a replacement for @storybook/svelte-vite and provides a better experience for SvelteKit users. + + We can automatically migrate your project to use the new SvelteKit framework package. + + To learn more about this change, see: ${chalk.yellow( + 'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#sveltekit-needs-the-storybooksveltekit-framework' + )} + `; + }, + + async run({ result: { main, packageJson, dependenciesToRemove }, packageManager, dryRun }) { + logger.info(`✅ Removing redundant packages: ${dependenciesToRemove.join(', ')}`); + if (!dryRun) { + packageManager.removeDependencies({ skipInstall: true, packageJson }, dependenciesToRemove); + } + + logger.info(`✅ Installing new dependencies: @storybook/sveltekit`); + if (!dryRun) { + const versionToInstall = getStorybookVersionSpecifier(packageJson); + packageManager.addDependencies({ installAsDevDependencies: true, packageJson }, [ + `@storybook/sveltekit@${versionToInstall}`, + ]); + } + + logger.info(`✅ Updating framework field in main.js`); + main.setFieldValue(['framework'], '@storybook/sveltekit'); + + const currentCore = main.getFieldValue(['core']); + if (currentCore.builder) { + logger.info(`✅ Updating core field in main.js`); + const { builder, ...core } = currentCore; + + if (Object.keys(core).length === 0) { + main.removeField(['core']); + } else { + main.setFieldValue(['core'], core); + } + } + + if (main.getFieldNode(['svelteOptions'])) { + logger.info(`✅ Removing svelteOptions field in main.js`); + main.removeField(['svelteOptions']); + } + + if (!dryRun) { + await writeConfig(main); + } + }, +}; diff --git a/code/lib/cli/src/automigrate/fixes/webpack5.ts b/code/lib/cli/src/automigrate/fixes/webpack5.ts index ee6052edac7..9cd2839d598 100644 --- a/code/lib/cli/src/automigrate/fixes/webpack5.ts +++ b/code/lib/cli/src/automigrate/fixes/webpack5.ts @@ -39,11 +39,10 @@ export const webpack5: Fix & CheckBuilder = { const storybookCoerced = storybookVersion && semver.coerce(storybookVersion)?.version; if (!storybookCoerced) { - logger.warn(dedent` - ❌ Unable to determine storybook version, skipping ${chalk.cyan('webpack5')} fix. + throw new Error(dedent` + ❌ Unable to determine storybook version. 🤔 Are you running automigrate from your project directory? `); - return null; } if (semver.lt(storybookCoerced, '6.3.0')) { diff --git a/code/lib/cli/src/automigrate/index.ts b/code/lib/cli/src/automigrate/index.ts index 7e899863643..a77e12b9a75 100644 --- a/code/lib/cli/src/automigrate/index.ts +++ b/code/lib/cli/src/automigrate/index.ts @@ -2,10 +2,11 @@ import prompts from 'prompts'; import chalk from 'chalk'; import boxen from 'boxen'; +import dedent from 'ts-dedent'; import { JsPackageManagerFactory, type PackageManagerName } from '../js-package-manager'; import type { Fix } from './fixes'; -import { fixes } from './fixes'; +import { fixes as allFixes } from './fixes'; const logger = console; @@ -13,6 +14,7 @@ type FixId = string; interface FixOptions { fixId?: FixId; + list?: boolean; yes?: boolean; dryRun?: boolean; useNpm?: boolean; @@ -22,80 +24,227 @@ interface FixOptions { enum FixStatus { CHECK_FAILED = 'check_failed', UNNECESSARY = 'unnecessary', + MANUAL_SUCCEEDED = 'manual_succeeded', + MANUAL_SKIPPED = 'manual_skipped', SKIPPED = 'skipped', SUCCEEDED = 'succeeded', FAILED = 'failed', } -export const automigrate = async ({ fixId, dryRun, yes, useNpm, force }: FixOptions = {}) => { +type FixSummary = { + skipped: FixId[]; + manual: FixId[]; + succeeded: FixId[]; + failed: Record; +}; + +const logAvailableMigrations = () => { + const availableFixes = allFixes.map((f) => chalk.yellow(f.id)).join(', '); + logger.info(`\nThe following migrations are available: ${availableFixes}`); +}; + +export const automigrate = async ({ fixId, dryRun, yes, useNpm, force, list }: FixOptions = {}) => { + if (list) { + logAvailableMigrations(); + return null; + } + + const fixes = fixId ? allFixes.filter((f) => f.id === fixId) : allFixes; + + if (fixId && fixes.length === 0) { + logger.info(`📭 No migrations found for ${chalk.magenta(fixId)}.`); + logAvailableMigrations(); + return null; + } + const packageManager = JsPackageManagerFactory.getPackageManager({ useNpm, force }); - const filtered = fixId ? fixes.filter((f) => f.id === fixId) : fixes; logger.info('🔎 checking possible migrations..'); const fixResults = {} as Record; + const fixSummary: FixSummary = { succeeded: [], failed: {}, manual: [], skipped: [] }; - for (let i = 0; i < filtered.length; i += 1) { + for (let i = 0; i < fixes.length; i += 1) { const f = fixes[i] as Fix; let result; - let fixStatus; + try { result = await f.check({ packageManager }); - } catch (e) { - fixStatus = FixStatus.CHECK_FAILED; - logger.info(`failed to check fix: ${f.id}`); + } catch (error) { + logger.info(`⚠️ failed to check fix ${chalk.bold(f.id)}`); + fixSummary.failed[f.id] = error.message; + fixResults[f.id] = FixStatus.CHECK_FAILED; } - if (!result) { - fixStatus = FixStatus.UNNECESSARY; - } else { - logger.info(`🔎 found a '${chalk.cyan(f.id)}' migration:`); - logger.info(); + + if (result) { + logger.info(`\n🔎 found a '${chalk.cyan(f.id)}' migration:`); const message = f.prompt(result); logger.info( - boxen(message, { borderStyle: 'round', padding: 1, borderColor: '#F1618C' } as any) + boxen(message, { + borderStyle: 'round', + padding: 1, + borderColor: '#F1618C', + title: f.promptOnly ? 'Manual migration detected' : 'Automigration detected', + }) ); let runAnswer: { fix: boolean }; - if (dryRun) { - runAnswer = { fix: false }; - } else if (yes) { - runAnswer = { fix: true }; - } else { - runAnswer = await prompts({ - type: 'confirm', - name: 'fix', - message: `Do you want to run the '${chalk.cyan(f.id)}' migration on your project?`, - }); - } + try { + if (dryRun) { + runAnswer = { fix: false }; + } else if (yes) { + runAnswer = { fix: true }; + } else if (f.promptOnly) { + fixResults[f.id] = FixStatus.MANUAL_SUCCEEDED; + fixSummary.manual.push(f.id); - if (runAnswer.fix) { - try { - await f.run({ result, packageManager, dryRun }); - logger.info(`✅ ran ${chalk.cyan(f.id)} migration`); - fixStatus = FixStatus.SUCCEEDED; - } catch (error) { - fixStatus = FixStatus.FAILED; - logger.info(`❌ error when running ${chalk.cyan(f.id)} migration:`); - logger.info(error); logger.info(); - } - } else { - fixStatus = FixStatus.SKIPPED; - logger.info(`Skipping the ${chalk.cyan(f.id)} migration.`); - logger.info(); - logger.info( - `If you change your mind, run '${chalk.cyan('npx storybook@next automigrate')}'` - ); - } - } + const { shouldContinue } = await prompts( + { + type: 'toggle', + name: 'shouldContinue', + message: + 'Select continue once you have made the required changes, or quit to exit the migration process', + initial: true, + active: 'continue', + inactive: 'quit', + }, + { + onCancel: () => { + throw new Error(); + }, + } + ); - fixResults[f.id] = fixStatus; + if (!shouldContinue) { + fixResults[f.id] = FixStatus.MANUAL_SKIPPED; + break; + } + } else { + runAnswer = await prompts( + { + type: 'confirm', + name: 'fix', + message: `Do you want to run the '${chalk.cyan(f.id)}' migration on your project?`, + initial: true, + }, + { + onCancel: () => { + throw new Error(); + }, + } + ); + } + } catch (err) { + break; + } + + if (!f.promptOnly) { + if (runAnswer.fix) { + try { + await f.run({ result, packageManager, dryRun }); + logger.info(`✅ ran ${chalk.cyan(f.id)} migration`); + + fixResults[f.id] = FixStatus.SUCCEEDED; + fixSummary.succeeded.push(f.id); + } catch (error) { + fixResults[f.id] = FixStatus.FAILED; + fixSummary.failed[f.id] = error.message; + + logger.info(`❌ error when running ${chalk.cyan(f.id)} migration`); + logger.info(error); + logger.info(); + } + } else { + fixResults[f.id] = FixStatus.SKIPPED; + fixSummary.skipped.push(f.id); + } + } + } else { + fixResults[f.id] ||= FixStatus.UNNECESSARY; + } } logger.info(); - logger.info('✅ migration check successfully ran'); + logger.info(getMigrationSummary(fixResults, fixSummary)); logger.info(); return fixResults; }; + +function getMigrationSummary(fixResults: Record, fixSummary: FixSummary) { + const hasNoFixes = Object.values(fixResults).every((r) => r === FixStatus.UNNECESSARY); + const hasFailures = Object.values(fixResults).some( + (r) => r === FixStatus.FAILED || r === FixStatus.CHECK_FAILED + ); + // eslint-disable-next-line no-nested-ternary + const title = hasNoFixes + ? 'No migrations were applicable to your project' + : hasFailures + ? 'Migration check ran with failures' + : 'Migration check ran successfully'; + + const successfulFixesMessage = + fixSummary.succeeded.length > 0 + ? ` + ${chalk.bold('Successful migrations:')}\n\n ${fixSummary.succeeded + .map((m) => chalk.green(m)) + .join(', ')} + ` + : ''; + + const failedFixesMessage = + Object.keys(fixSummary.failed).length > 0 + ? ` + ${chalk.bold('Failed migrations:')}\n ${Object.entries(fixSummary.failed).reduce( + (acc, [id, error]) => { + return `${acc}\n${chalk.redBright(id)}:\n${error}\n`; + }, + '' + )} + ` + : ''; + + const manualFixesMessage = + fixSummary.manual.length > 0 + ? ` + ${chalk.bold('Manual migrations:')}\n\n ${fixSummary.manual + .map((m) => + fixResults[m] === FixStatus.MANUAL_SUCCEEDED ? chalk.green(m) : chalk.blue(m) + ) + .join(', ')} + ` + : ''; + + const skippedFixesMessage = + fixSummary.skipped.length > 0 + ? ` + ${chalk.bold('Skipped migrations:')}\n\n ${fixSummary.skipped + .map((m) => chalk.cyan(m)) + .join(', ')} + ` + : ''; + + const divider = hasNoFixes ? '' : '\n─────────────────────────────────────────────────\n\n'; + + const summaryMessage = dedent` + ${successfulFixesMessage}${manualFixesMessage}${failedFixesMessage}${skippedFixesMessage}${divider}If you'd like to run the migrations again, you can do so by running '${chalk.cyan( + 'npx storybook@next automigrate' + )}' + + The automigrations try to migrate common patterns in your project, but might not contain everything needed to migrate to the latest version of Storybook. + + Please check the changelog and migration guide for manual migrations and more information: ${chalk.yellow( + 'https://storybook.js.org/migration-guides/7.0' + )} + And reach out on Discord if you need help: ${chalk.yellow('https://discord.gg/storybook')} + `; + + return boxen(summaryMessage, { + borderStyle: 'round', + padding: 1, + title, + borderColor: hasFailures ? 'red' : 'green', + }); +} diff --git a/code/lib/cli/src/automigrate/types.ts b/code/lib/cli/src/automigrate/types.ts index 42baddc3ba3..c86292a4d68 100644 --- a/code/lib/cli/src/automigrate/types.ts +++ b/code/lib/cli/src/automigrate/types.ts @@ -12,7 +12,8 @@ export interface RunOptions { export interface Fix { id: string; + promptOnly?: boolean; check: (options: CheckOptions) => Promise; prompt: (result: ResultType) => string; - run: (options: RunOptions) => Promise; + run?: (options: RunOptions) => Promise; } diff --git a/code/lib/cli/src/babel-config.ts b/code/lib/cli/src/babel-config.ts index 31d02439039..9a2b288e080 100644 --- a/code/lib/cli/src/babel-config.ts +++ b/code/lib/cli/src/babel-config.ts @@ -1,7 +1,8 @@ -import { writeFile, access } from 'fs-extra'; +import { writeFile, pathExists } from 'fs-extra'; import { logger } from '@storybook/node-logger'; import path from 'path'; import prompts from 'prompts'; +import { JsPackageManagerFactory } from './js-package-manager'; export const generateStorybookBabelConfigInCWD = async () => { const target = process.cwd(); @@ -10,23 +11,10 @@ export const generateStorybookBabelConfigInCWD = async () => { export const generateStorybookBabelConfig = async ({ target }: { target: string }) => { logger.info(`Generating the storybook default babel config at ${target}`); - const contents = JSON.stringify( - { - sourceType: 'unambiguous', - presets: [], - plugins: [], - }, - null, - 2 - ); - const fileName = '.babelrc.json'; const location = path.join(target, fileName); - const exists = await access(location).then( - () => true, - () => false - ); + const exists = await pathExists(location); if (exists) { const { overwrite } = await prompts({ @@ -42,6 +30,59 @@ export const generateStorybookBabelConfig = async ({ target }: { target: string } } + const { typescript, jsx } = await prompts([ + { + type: 'confirm', + initial: true, + name: 'typescript', + message: `Do you want to add the TypeScript preset?`, + }, + { + type: 'confirm', + initial: true, + name: 'jsx', + message: `Do you want to add the React preset?`, + }, + ]); + + const added = ['@babel/preset-env']; + const presets: (string | [string, any])[] = [['@babel/preset-env', { targets: { chrome: 100 } }]]; + + if (typescript) { + added.push('@babel/preset-typescript'); + presets.push('@babel/preset-typescript'); + } + + if (jsx) { + added.push('@babel/preset-react'); + presets.push('@babel/preset-react'); + } + + const contents = JSON.stringify( + { + sourceType: 'unambiguous', + presets, + plugins: [], + }, + null, + 2 + ); + logger.info(`Writing file to ${location}`); await writeFile(location, contents); + + const { runInstall } = await prompts({ + type: 'confirm', + initial: true, + name: 'runInstall', + message: `Shall we install the required dependencies now? (${added.join(', ')})`, + }); + + if (runInstall) { + logger.info(`Installing dependencies...`); + + const packageManager = JsPackageManagerFactory.getPackageManager(); + + packageManager.addDependencies({ installAsDevDependencies: true }, added); + } }; diff --git a/code/lib/cli/src/build.ts b/code/lib/cli/src/build.ts index f9b9c2ca1dd..e7e98899606 100644 --- a/code/lib/cli/src/build.ts +++ b/code/lib/cli/src/build.ts @@ -2,8 +2,11 @@ import { sync as readUpSync } from 'read-pkg-up'; import { logger } from '@storybook/node-logger'; import { buildStaticStandalone, withTelemetry } from '@storybook/core-server'; import { cache } from '@storybook/core-common'; +import { ensureReactPeerDeps } from './ensure-react-peer-deps'; export const build = async (cliOptions: any) => { + ensureReactPeerDeps(); + try { const options = { ...cliOptions, @@ -15,7 +18,9 @@ export const build = async (cliOptions: any) => { cache, packageJson: readUpSync({ cwd: __dirname }).packageJson, }; - await withTelemetry('build', { presetOptions: options }, () => buildStaticStandalone(options)); + await withTelemetry('build', { cliOptions, presetOptions: options }, () => + buildStaticStandalone(options) + ); } catch (err) { logger.error(err); process.exit(1); diff --git a/code/lib/cli/src/detect.test.ts b/code/lib/cli/src/detect.test.ts index b18f7c5a5a8..597e2fc7818 100644 --- a/code/lib/cli/src/detect.test.ts +++ b/code/lib/cli/src/detect.test.ts @@ -296,22 +296,19 @@ describe('Detect', () => { it(`should return language typescript if the dependency is >TS4.9`, () => { expect(detectLanguage({ dependencies: { typescript: '4.9.1' } })).toBe( - // TODO: switch to TYPESCRIPT once csf-tools and eslint-plugin-storybook support `satisfies` operator - SupportedLanguage.TYPESCRIPT_LEGACY + SupportedLanguage.TYPESCRIPT ); }); it(`should return language typescript if the dependency is =TS4.9`, () => { expect(detectLanguage({ dependencies: { typescript: '4.9.0' } })).toBe( - // TODO: switch to TYPESCRIPT once csf-tools and eslint-plugin-storybook support `satisfies` operator - SupportedLanguage.TYPESCRIPT_LEGACY + SupportedLanguage.TYPESCRIPT ); }); it(`should return language typescript if the dependency is =TS4.9beta`, () => { expect(detectLanguage({ dependencies: { typescript: '^4.9.0-beta' } })).toBe( - // TODO: switch to TYPESCRIPT once csf-tools and eslint-plugin-storybook support `satisfies` operator - SupportedLanguage.TYPESCRIPT_LEGACY + SupportedLanguage.TYPESCRIPT ); }); diff --git a/code/lib/cli/src/detect.ts b/code/lib/cli/src/detect.ts index b9eb40c672c..bf5e9efb38e 100644 --- a/code/lib/cli/src/detect.ts +++ b/code/lib/cli/src/detect.ts @@ -170,10 +170,13 @@ export function detectLanguage(packageJson?: PackageJson) { (!hasDependency(packageJson, '@typescript-eslint/parser') || hasDependency(packageJson, '@typescript-eslint/parser', (version) => semver.gte(semver.coerce(version), '5.44.0') + )) && + (!hasDependency(packageJson, 'eslint-plugin-storybook') || + hasDependency(packageJson, 'eslint-plugin-storybook', (version) => + semver.gte(semver.coerce(version), '0.6.8') )) ) { - // TODO: switch to TYPESCRIPT once csf-tools and eslint-plugin-storybook support `satisfies` operator - language = SupportedLanguage.TYPESCRIPT_LEGACY; + language = SupportedLanguage.TYPESCRIPT; } else if (hasDependency(packageJson, 'typescript')) { language = SupportedLanguage.TYPESCRIPT_LEGACY; } diff --git a/code/lib/cli/src/dev.ts b/code/lib/cli/src/dev.ts index a6aa573c16b..9f32b4547f5 100644 --- a/code/lib/cli/src/dev.ts +++ b/code/lib/cli/src/dev.ts @@ -3,10 +3,13 @@ import { sync as readUpSync } from 'read-pkg-up'; import { logger, instance as npmLog } from '@storybook/node-logger'; import { buildDevStandalone, withTelemetry } from '@storybook/core-server'; import { cache } from '@storybook/core-common'; +import { ensureReactPeerDeps } from './ensure-react-peer-deps'; export const dev = async (cliOptions: any) => { process.env.NODE_ENV = process.env.NODE_ENV || 'development'; + ensureReactPeerDeps(); + try { const options = { ...cliOptions, @@ -17,7 +20,9 @@ export const dev = async (cliOptions: any) => { cache, packageJson: readUpSync({ cwd: __dirname }).packageJson, }; - await withTelemetry('dev', { presetOptions: options }, () => buildDevStandalone(options)); + await withTelemetry('dev', { cliOptions, presetOptions: options }, () => + buildDevStandalone(options) + ); } catch (error) { // this is a weird bugfix, somehow 'node-pre-gyp' is polluting the npmLog header npmLog.heading = ''; diff --git a/code/lib/cli/src/ensure-react-peer-deps.ts b/code/lib/cli/src/ensure-react-peer-deps.ts new file mode 100644 index 00000000000..6958b7e4065 --- /dev/null +++ b/code/lib/cli/src/ensure-react-peer-deps.ts @@ -0,0 +1,39 @@ +import { logger } from '@storybook/node-logger'; +import dedent from 'ts-dedent'; + +export function ensureReactPeerDeps() { + try { + require.resolve('react'); + require.resolve('react-dom'); + } catch (e) { + logger.error(dedent` + Starting in 7.0, react and react-dom are now required peer dependencies of Storybook. + https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#react-peer-dependencies-required + + It seems that you haven't run Storybook's CLI to upgrade to the latest version. + The upgrade command will install the required peer dependencies for you and will take + care of other important auto migrations as well. + + If you want to upgrade to the latest prerelease version, please run: + + $ npx storybook@next upgrade --prerelease + + Otherwise, please run: + + $ npx storybook upgrade + + If you do not want to use the upgrade commands, + please install react and react-dom in your project manually. + + npm: + $ npm add react react-dom --dev + + yarn: + $ yarn add react react-dom --dev + + pnpm: + $ pnpm add react react-dom --dev + `); + process.exit(1); + } +} diff --git a/code/lib/cli/src/generate.ts b/code/lib/cli/src/generate.ts index 63b4f788fde..5637d5ffb09 100644 --- a/code/lib/cli/src/generate.ts +++ b/code/lib/cli/src/generate.ts @@ -191,6 +191,7 @@ program .option('-n --dry-run', 'Only check for fixes, do not actually run them') .option('--package-manager ', 'Force package manager') .option('-N --use-npm', 'Use npm as package manager (deprecated)') + .option('-l --list', 'List available migrations') .action(async (fixId, options) => { await automigrate({ fixId, ...options }).catch((e) => { logger.error(e); diff --git a/code/lib/cli/src/generators/baseGenerator.ts b/code/lib/cli/src/generators/baseGenerator.ts index 3d8d82d4f0e..a8b134ef5a1 100644 --- a/code/lib/cli/src/generators/baseGenerator.ts +++ b/code/lib/cli/src/generators/baseGenerator.ts @@ -101,7 +101,7 @@ const hasInteractiveStories = (rendererId: SupportedRenderers) => ['react', 'angular', 'preact', 'svelte', 'vue', 'vue3', 'html'].includes(rendererId); const hasFrameworkTemplates = (framework?: SupportedFrameworks) => - ['angular', 'nextjs', 'sveltekit'].includes(framework); + ['angular', 'nextjs'].includes(framework); export async function baseGenerator( packageManager: JsPackageManager, diff --git a/code/lib/cli/src/initiate.ts b/code/lib/cli/src/initiate.ts index d9138f8c6a6..90c2bba9c7f 100644 --- a/code/lib/cli/src/initiate.ts +++ b/code/lib/cli/src/initiate.ts @@ -1,4 +1,4 @@ -import type { Package } from 'update-notifier'; +import type { PackageJson } from 'read-pkg-up'; import chalk from 'chalk'; import prompts from 'prompts'; import { telemetry } from '@storybook/telemetry'; @@ -265,7 +265,7 @@ const projectTypeInquirer = async ( return Promise.resolve(); }; -async function doInitiate(options: CommandOptions, pkg: Package): Promise { +async function doInitiate(options: CommandOptions, pkg: PackageJson): Promise { const { useNpm, packageManager: pkgMgr } = options; if (useNpm) { useNpmWarning(); @@ -275,11 +275,11 @@ async function doInitiate(options: CommandOptions, pkg: Package): Promise logger.log(chalk.inverse(`\n ${welcomeMessage} \n`)); // Update notify code. - const { default: updateNotifier } = await import('update-notifier'); - updateNotifier({ - pkg, + const { default: updateNotifier } = await import('simple-update-notifier'); + await updateNotifier({ + pkg: pkg as any, updateCheckInterval: 1000 * 60 * 60, // every hour (we could increase this later on.) - }).notify(); + }); let projectType; const projectTypeProvided = options.type; @@ -349,6 +349,6 @@ async function doInitiate(options: CommandOptions, pkg: Package): Promise logger.log(); } -export async function initiate(options: CommandOptions, pkg: Package): Promise { +export async function initiate(options: CommandOptions, pkg: PackageJson): Promise { await withTelemetry('init', { cliOptions: options }, () => doInitiate(options, pkg)); } diff --git a/code/lib/cli/src/link.ts b/code/lib/cli/src/link.ts index f52ad93bd75..bfb45e17161 100644 --- a/code/lib/cli/src/link.ts +++ b/code/lib/cli/src/link.ts @@ -63,7 +63,7 @@ export const link = async ({ target, local, start }: LinkOptions) => { `Magic stuff related to @storybook/preset-create-react-app, we need to fix peerDependencies` ); - if (!reproPackageJson.devDependencies.vite) { + if (!reproPackageJson.devDependencies?.vite) { await exec(`yarn add -D webpack-hot-middleware`, { cwd: reproDir }); } diff --git a/code/lib/cli/src/migrate.ts b/code/lib/cli/src/migrate.ts index 89e3e6759fa..0e4ab495a74 100644 --- a/code/lib/cli/src/migrate.ts +++ b/code/lib/cli/src/migrate.ts @@ -1,13 +1,10 @@ import { listCodemods, runCodemod } from '@storybook/codemod'; -export async function migrate( - migration: any, - { configDir, glob, dryRun, list, rename, logger, parser }: any -) { +export async function migrate(migration: any, { glob, dryRun, list, rename, logger, parser }: any) { if (list) { listCodemods().forEach((key: any) => logger.log(key)); } else if (migration) { - await runCodemod(migration, { configDir, glob, dryRun, logger, rename, parser }); + await runCodemod(migration, { glob, dryRun, logger, rename, parser }); } else { throw new Error('Migrate: please specify a migration name or --list'); } diff --git a/code/lib/cli/src/repro-templates.ts b/code/lib/cli/src/repro-templates.ts index a3b36ed04e5..4a7c2953734 100644 --- a/code/lib/cli/src/repro-templates.ts +++ b/code/lib/cli/src/repro-templates.ts @@ -235,10 +235,9 @@ export const allTemplates: Record = { }, }, 'svelte-kit/skeleton-js': { - inDevelopment: true, name: 'Svelte Kit (JS)', script: - 'yarn create svelte-with-args --name=svelte-kit/skeleton-js --directory=. --template=skeleton --types=null --no-prettier --no-eslint --no-playwright', + 'yarn create svelte-with-args --name=svelte-kit/skeleton-js --directory=. --template=skeleton --types=null --no-prettier --no-eslint --no-playwright --no-vitest', expected: { framework: '@storybook/sveltekit', renderer: '@storybook/svelte', @@ -246,10 +245,9 @@ export const allTemplates: Record = { }, }, 'svelte-kit/skeleton-ts': { - inDevelopment: true, name: 'Svelte Kit (TS)', script: - 'yarn create svelte-with-args --name=svelte-kit/skeleton-ts --directory=. --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright', + 'yarn create svelte-with-args --name=svelte-kit/skeleton-ts --directory=. --template=skeleton --types=typescript --no-prettier --no-eslint --no-playwright --no-vitest', expected: { framework: '@storybook/sveltekit', renderer: '@storybook/svelte', @@ -355,6 +353,7 @@ export const daily: TemplateKey[] = [ 'lit-vite/default-js', 'svelte-kit/skeleton-js', 'svelte-vite/default-js', + 'nextjs/12-js', 'nextjs/default-js', 'preact-webpack5/default-js', ]; diff --git a/code/lib/cli/src/typings.d.ts b/code/lib/cli/src/typings.d.ts index 75cb2ee2221..409993b0710 100644 --- a/code/lib/cli/src/typings.d.ts +++ b/code/lib/cli/src/typings.d.ts @@ -1,2 +1 @@ -declare module '@storybook/codemod'; declare module 'envinfo'; diff --git a/code/lib/cli/src/upgrade.ts b/code/lib/cli/src/upgrade.ts index 7e88d22f5fa..957b986c3ac 100644 --- a/code/lib/cli/src/upgrade.ts +++ b/code/lib/cli/src/upgrade.ts @@ -192,6 +192,12 @@ export const doUpgrade = async ({ }).output.toString(); logger.info(check); + const checkSb = spawnSync('npx', ['npm-check-updates@latest', 'sb', ...flags], { + stdio: 'pipe', + shell: true, + }).output.toString(); + logger.info(checkSb); + if (!dryRun) { commandLog(`Installing upgrades`); packageManager.installDependencies(); diff --git a/code/lib/cli/src/versions.ts b/code/lib/cli/src/versions.ts index 0c9c1d07274..2c9a1f168ba 100644 --- a/code/lib/cli/src/versions.ts +++ b/code/lib/cli/src/versions.ts @@ -1,89 +1,89 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '7.0.0-beta.0', - '@storybook/addon-actions': '7.0.0-beta.0', - '@storybook/addon-backgrounds': '7.0.0-beta.0', - '@storybook/addon-controls': '7.0.0-beta.0', - '@storybook/addon-docs': '7.0.0-beta.0', - '@storybook/addon-essentials': '7.0.0-beta.0', - '@storybook/addon-highlight': '7.0.0-beta.0', - '@storybook/addon-interactions': '7.0.0-beta.0', - '@storybook/addon-jest': '7.0.0-beta.0', - '@storybook/addon-links': '7.0.0-beta.0', - '@storybook/addon-measure': '7.0.0-beta.0', - '@storybook/addon-outline': '7.0.0-beta.0', - '@storybook/addon-storyshots': '7.0.0-beta.0', - '@storybook/addon-storyshots-puppeteer': '7.0.0-beta.0', - '@storybook/addon-storysource': '7.0.0-beta.0', - '@storybook/addon-toolbars': '7.0.0-beta.0', - '@storybook/addon-viewport': '7.0.0-beta.0', - '@storybook/addons': '7.0.0-beta.0', - '@storybook/angular': '7.0.0-beta.0', - '@storybook/manager-api': '7.0.0-beta.0', - '@storybook/blocks': '7.0.0-beta.0', - '@storybook/builder-manager': '7.0.0-beta.0', - '@storybook/builder-vite': '7.0.0-beta.0', - '@storybook/builder-webpack5': '7.0.0-beta.0', - '@storybook/channel-postmessage': '7.0.0-beta.0', - '@storybook/channel-websocket': '7.0.0-beta.0', - '@storybook/channels': '7.0.0-beta.0', - '@storybook/cli': '7.0.0-beta.0', - '@storybook/client-api': '7.0.0-beta.0', - '@storybook/client-logger': '7.0.0-beta.0', - '@storybook/codemod': '7.0.0-beta.0', - '@storybook/components': '7.0.0-beta.0', - '@storybook/core-client': '7.0.0-beta.0', - '@storybook/core-common': '7.0.0-beta.0', - '@storybook/core-events': '7.0.0-beta.0', - '@storybook/core-server': '7.0.0-beta.0', - '@storybook/core-webpack': '7.0.0-beta.0', - '@storybook/csf-tools': '7.0.0-beta.0', - '@storybook/docs-tools': '7.0.0-beta.0', - '@storybook/ember': '7.0.0-beta.0', - '@storybook/html': '7.0.0-beta.0', - '@storybook/html-webpack5': '7.0.0-beta.0', - '@storybook/html-vite': '7.0.0-beta.0', - '@storybook/instrumenter': '7.0.0-beta.0', - '@storybook/nextjs': '7.0.0-beta.0', - '@storybook/node-logger': '7.0.0-beta.0', - '@storybook/postinstall': '7.0.0-beta.0', - '@storybook/preact': '7.0.0-beta.0', - '@storybook/preact-webpack5': '7.0.0-beta.0', - '@storybook/preset-html-webpack': '7.0.0-beta.0', - '@storybook/preset-preact-webpack': '7.0.0-beta.0', - '@storybook/preset-react-webpack': '7.0.0-beta.0', - '@storybook/preset-server-webpack': '7.0.0-beta.0', - '@storybook/preset-svelte-webpack': '7.0.0-beta.0', - '@storybook/preset-vue-webpack': '7.0.0-beta.0', - '@storybook/preset-vue3-webpack': '7.0.0-beta.0', - '@storybook/preset-web-components-webpack': '7.0.0-beta.0', - '@storybook/preview': '7.0.0-beta.0', - '@storybook/preview-api': '7.0.0-beta.0', - '@storybook/preview-web': '7.0.0-beta.0', - '@storybook/react': '7.0.0-beta.0', - '@storybook/react-vite': '7.0.0-beta.0', - '@storybook/react-webpack5': '7.0.0-beta.0', - '@storybook/router': '7.0.0-beta.0', - '@storybook/server': '7.0.0-beta.0', - '@storybook/server-webpack5': '7.0.0-beta.0', - '@storybook/source-loader': '7.0.0-beta.0', - '@storybook/store': '7.0.0-beta.0', - '@storybook/svelte': '7.0.0-beta.0', - '@storybook/sveltekit': '7.0.0-beta.0', - '@storybook/svelte-vite': '7.0.0-beta.0', - '@storybook/svelte-webpack5': '7.0.0-beta.0', - '@storybook/telemetry': '7.0.0-beta.0', - '@storybook/theming': '7.0.0-beta.0', - '@storybook/manager': '7.0.0-beta.0', - '@storybook/vue': '7.0.0-beta.0', - '@storybook/vue-vite': '7.0.0-beta.0', - '@storybook/vue-webpack5': '7.0.0-beta.0', - '@storybook/vue3': '7.0.0-beta.0', - '@storybook/vue3-vite': '7.0.0-beta.0', - '@storybook/vue3-webpack5': '7.0.0-beta.0', - '@storybook/web-components': '7.0.0-beta.0', - '@storybook/web-components-webpack5': '7.0.0-beta.0', - '@storybook/web-components-vite': '7.0.0-beta.0', - sb: '7.0.0-beta.0', - storybook: '7.0.0-beta.0', + '@storybook/addon-a11y': '7.0.0-beta.12', + '@storybook/addon-actions': '7.0.0-beta.12', + '@storybook/addon-backgrounds': '7.0.0-beta.12', + '@storybook/addon-controls': '7.0.0-beta.12', + '@storybook/addon-docs': '7.0.0-beta.12', + '@storybook/addon-essentials': '7.0.0-beta.12', + '@storybook/addon-highlight': '7.0.0-beta.12', + '@storybook/addon-interactions': '7.0.0-beta.12', + '@storybook/addon-jest': '7.0.0-beta.12', + '@storybook/addon-links': '7.0.0-beta.12', + '@storybook/addon-measure': '7.0.0-beta.12', + '@storybook/addon-outline': '7.0.0-beta.12', + '@storybook/addon-storyshots': '7.0.0-beta.12', + '@storybook/addon-storyshots-puppeteer': '7.0.0-beta.12', + '@storybook/addon-storysource': '7.0.0-beta.12', + '@storybook/addon-toolbars': '7.0.0-beta.12', + '@storybook/addon-viewport': '7.0.0-beta.12', + '@storybook/addons': '7.0.0-beta.12', + '@storybook/angular': '7.0.0-beta.12', + '@storybook/manager-api': '7.0.0-beta.12', + '@storybook/blocks': '7.0.0-beta.12', + '@storybook/builder-manager': '7.0.0-beta.12', + '@storybook/builder-vite': '7.0.0-beta.12', + '@storybook/builder-webpack5': '7.0.0-beta.12', + '@storybook/channel-postmessage': '7.0.0-beta.12', + '@storybook/channel-websocket': '7.0.0-beta.12', + '@storybook/channels': '7.0.0-beta.12', + '@storybook/cli': '7.0.0-beta.12', + '@storybook/client-api': '7.0.0-beta.12', + '@storybook/client-logger': '7.0.0-beta.12', + '@storybook/codemod': '7.0.0-beta.12', + '@storybook/components': '7.0.0-beta.12', + '@storybook/core-client': '7.0.0-beta.12', + '@storybook/core-common': '7.0.0-beta.12', + '@storybook/core-events': '7.0.0-beta.12', + '@storybook/core-server': '7.0.0-beta.12', + '@storybook/core-webpack': '7.0.0-beta.12', + '@storybook/csf-tools': '7.0.0-beta.12', + '@storybook/docs-tools': '7.0.0-beta.12', + '@storybook/ember': '7.0.0-beta.12', + '@storybook/html': '7.0.0-beta.12', + '@storybook/html-webpack5': '7.0.0-beta.12', + '@storybook/html-vite': '7.0.0-beta.12', + '@storybook/instrumenter': '7.0.0-beta.12', + '@storybook/nextjs': '7.0.0-beta.12', + '@storybook/node-logger': '7.0.0-beta.12', + '@storybook/postinstall': '7.0.0-beta.12', + '@storybook/preact': '7.0.0-beta.12', + '@storybook/preact-webpack5': '7.0.0-beta.12', + '@storybook/preset-html-webpack': '7.0.0-beta.12', + '@storybook/preset-preact-webpack': '7.0.0-beta.12', + '@storybook/preset-react-webpack': '7.0.0-beta.12', + '@storybook/preset-server-webpack': '7.0.0-beta.12', + '@storybook/preset-svelte-webpack': '7.0.0-beta.12', + '@storybook/preset-vue-webpack': '7.0.0-beta.12', + '@storybook/preset-vue3-webpack': '7.0.0-beta.12', + '@storybook/preset-web-components-webpack': '7.0.0-beta.12', + '@storybook/preview': '7.0.0-beta.12', + '@storybook/preview-api': '7.0.0-beta.12', + '@storybook/preview-web': '7.0.0-beta.12', + '@storybook/react': '7.0.0-beta.12', + '@storybook/react-vite': '7.0.0-beta.12', + '@storybook/react-webpack5': '7.0.0-beta.12', + '@storybook/router': '7.0.0-beta.12', + '@storybook/server': '7.0.0-beta.12', + '@storybook/server-webpack5': '7.0.0-beta.12', + '@storybook/source-loader': '7.0.0-beta.12', + '@storybook/store': '7.0.0-beta.12', + '@storybook/svelte': '7.0.0-beta.12', + '@storybook/sveltekit': '7.0.0-beta.12', + '@storybook/svelte-vite': '7.0.0-beta.12', + '@storybook/svelte-webpack5': '7.0.0-beta.12', + '@storybook/telemetry': '7.0.0-beta.12', + '@storybook/theming': '7.0.0-beta.12', + '@storybook/manager': '7.0.0-beta.12', + '@storybook/vue': '7.0.0-beta.12', + '@storybook/vue-vite': '7.0.0-beta.12', + '@storybook/vue-webpack5': '7.0.0-beta.12', + '@storybook/vue3': '7.0.0-beta.12', + '@storybook/vue3-vite': '7.0.0-beta.12', + '@storybook/vue3-webpack5': '7.0.0-beta.12', + '@storybook/web-components': '7.0.0-beta.12', + '@storybook/web-components-webpack5': '7.0.0-beta.12', + '@storybook/web-components-vite': '7.0.0-beta.12', + sb: '7.0.0-beta.12', + storybook: '7.0.0-beta.12', }; diff --git a/code/lib/client-api/package.json b/code/lib/client-api/package.json index b7f02c2e391..08477f6b844 100644 --- a/code/lib/client-api/package.json +++ b/code/lib/client-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-api", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook Client API", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0" + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12" }, "publishConfig": { "access": "public" @@ -54,5 +54,5 @@ ], "shim": "@storybook/preview-api/dist/client-api" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/client-logger/package.json b/code/lib/client-logger/package.json index 19d1a3aba9c..67147a82292 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -56,5 +56,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 5c27bc84c79..d1962f0bfdc 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" @@ -27,22 +27,31 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, + "./dist/transforms/add-component-parameters.js": "./dist/transforms/add-component-parameters.js", + "./dist/transforms/csf-2-to-3.js": "./dist/transforms/csf-2-to-3.js", + "./dist/transforms/csf-hoist-story-annotations.js": "./dist/transforms/csf-hoist-story-annotations.js", + "./dist/transforms/csf-to-mdx.js": "./dist/transforms/csf-to-mdx.js", + "./dist/transforms/move-builtin-addons.js": "./dist/transforms/move-builtin-addons.js", + "./dist/transforms/storiesof-to-csf.js": "./dist/transforms/storiesof-to-csf.js", + "./dist/transforms/update-addon-info.js": "./dist/transforms/update-addon-info.js", + "./dist/transforms/update-organisation-name.js": "./dist/transforms/update-organisation-name.js", + "./dist/transforms/upgrade-hierarchy-separators.js": "./dist/transforms/upgrade-hierarchy-separators.js", "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", - "jsnext:main": "src/index.js", "types": "dist/index.d.ts", "scripts": { "check": "../../../scripts/node_modules/.bin/tsc --noEmit", "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "@babel/preset-env": "^7.20.2", "@babel/types": "^7.20.2", "@storybook/csf": "next", - "@storybook/csf-tools": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/csf-tools": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "cross-spawn": "^7.0.3", "globby": "^11.0.2", "jscodeshift": "^0.13.1", @@ -52,6 +61,7 @@ "util": "^0.12.4" }, "devDependencies": { + "@types/jscodeshift": "^0.11.6", "jest": "^29.3.1", "jest-specific-snapshot": "^7.0.0", "typescript": "~4.9.3" @@ -62,8 +72,17 @@ "bundler": { "platform": "node", "entries": [ - "./src/index.js" + "./src/index.js", + "./src/transforms/add-component-parameters.js", + "./src/transforms/csf-2-to-3.ts", + "./src/transforms/csf-hoist-story-annotations.js", + "./src/transforms/csf-to-mdx.js", + "./src/transforms/move-builtin-addons.js", + "./src/transforms/storiesof-to-csf.js", + "./src/transforms/update-addon-info.js", + "./src/transforms/update-organisation-name.js", + "./src/transforms/upgrade-hierarchy-separators.js" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/codemod/src/index.js b/code/lib/codemod/src/index.js index 5d44b44210d..14c91d924f0 100644 --- a/code/lib/codemod/src/index.js +++ b/code/lib/codemod/src/index.js @@ -59,7 +59,17 @@ export async function runCodemod(codemod, { glob, logger, dryRun, rename, parser const parserArgs = inferredParser ? ['--parser', inferredParser] : []; spawnSync( 'npx', - ['jscodeshift', '-t', `${TRANSFORM_DIR}/${codemod}.js`, ...parserArgs, ...files], + [ + 'jscodeshift', + // this makes sure codeshift doesn't transform our own source code with babel + // which is faster, and also makes sure the user won't see babel messages such as: + // [BABEL] Note: The code generator has deoptimised the styling of repo/node_modules/prettier/index.js as it exceeds the max of 500KB. + '--no-babel', + '-t', + `${TRANSFORM_DIR}/${codemod}.js`, + ...parserArgs, + ...files, + ], { stdio: 'inherit', shell: true, diff --git a/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/basic.input.js b/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/basic.input.mdx similarity index 100% rename from code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/basic.input.js rename to code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/basic.input.mdx diff --git a/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/component-id.input.js b/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/component-id.input.mdx similarity index 100% rename from code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/component-id.input.js rename to code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/component-id.input.mdx diff --git a/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/decorators.input.js b/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/decorators.input.mdx similarity index 100% rename from code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/decorators.input.js rename to code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/decorators.input.mdx diff --git a/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/exclude-stories.input.js b/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/exclude-stories.input.mdx similarity index 100% rename from code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/exclude-stories.input.js rename to code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/exclude-stories.input.mdx diff --git a/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/parameters.input.js b/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/parameters.input.mdx similarity index 100% rename from code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/parameters.input.js rename to code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/parameters.input.mdx diff --git a/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/plaintext.input.js b/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/plaintext.input.mdx similarity index 100% rename from code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/plaintext.input.js rename to code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/plaintext.input.mdx diff --git a/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-function.input.js b/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-function.input.mdx similarity index 100% rename from code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-function.input.js rename to code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-function.input.mdx diff --git a/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-parameters.input.js b/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-parameters.input.mdx similarity index 100% rename from code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-parameters.input.js rename to code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-parameters.input.mdx diff --git a/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-refs.input.js b/code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-refs.input.mdx similarity index 100% rename from code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-refs.input.js rename to code/lib/codemod/src/transforms/__testfixtures__/mdx-to-csf/story-refs.input.mdx diff --git a/code/lib/codemod/src/transforms/__tests__/csf-2-to-3.test.ts b/code/lib/codemod/src/transforms/__tests__/csf-2-to-3.test.ts index 0905da1ea0a..3bf91f5b830 100644 --- a/code/lib/codemod/src/transforms/__tests__/csf-2-to-3.test.ts +++ b/code/lib/codemod/src/transforms/__tests__/csf-2-to-3.test.ts @@ -7,8 +7,10 @@ expect.addSnapshotSerializer({ test: () => true, }); -const jsTransform = (source: string) => _transform({ source }, null, {}).trim(); -const tsTransform = (source: string) => _transform({ source }, null, { parser: 'tsx' }).trim(); +const jsTransform = (source: string) => + _transform({ source, path: 'Component.stories.js' }, null, {}).trim(); +const tsTransform = (source: string) => + _transform({ source, path: 'Component.stories.ts' }, null, { parser: 'tsx' }).trim(); describe('csf-2-to-3', () => { describe('javascript', () => { diff --git a/code/lib/codemod/src/transforms/csf-2-to-3.ts b/code/lib/codemod/src/transforms/csf-2-to-3.ts index 7520b7d8582..8a2a5c85074 100644 --- a/code/lib/codemod/src/transforms/csf-2-to-3.ts +++ b/code/lib/codemod/src/transforms/csf-2-to-3.ts @@ -3,7 +3,7 @@ import prettier from 'prettier'; import * as t from '@babel/types'; import type { CsfFile } from '@storybook/csf-tools'; import { formatCsf, loadCsf } from '@storybook/csf-tools'; -import { jscodeshiftToPrettierParser } from '../lib/utils'; +import type { API, FileInfo, Options } from 'jscodeshift'; const logger = console; @@ -89,7 +89,7 @@ const isReactGlobalRenderFn = (csf: CsfFile, storyFn: t.Expression) => { const isSimpleCSFStory = (init: t.Expression, annotations: t.ObjectProperty[]) => annotations.length === 0 && t.isArrowFunctionExpression(init) && init.params.length === 0; -function transform({ source }: { source: string }, api: any, options: { parser?: string }) { +export default function transform({ source, path }: FileInfo, api: API, options: Options) { const makeTitle = (userTitle?: string) => { return userTitle || 'FIXME'; }; @@ -165,20 +165,27 @@ function transform({ source }: { source: string }, api: any, options: { parser?: return acc; }, []); csf._ast.program.body = updatedBody; - const output = formatCsf(csf); + let output = formatCsf(csf); - const prettierConfig = prettier.resolveConfig.sync('.', { editorconfig: true }) || { - printWidth: 100, - tabWidth: 2, - bracketSpacing: true, - trailingComma: 'es5', - singleQuote: true, - }; + try { + const prettierConfig = prettier.resolveConfig.sync('.', { editorconfig: true }) || { + printWidth: 100, + tabWidth: 2, + bracketSpacing: true, + trailingComma: 'es5', + singleQuote: true, + }; - return prettier.format(output, { - ...prettierConfig, - parser: jscodeshiftToPrettierParser(options?.parser), - }); + output = prettier.format(output, { + ...prettierConfig, + // This will infer the parser from the filename. + filepath: path, + }); + } catch (e) { + logger.log(`Failed applying prettier to ${path}.`); + } + + return output; } -export default transform; +export const parser = 'tsx'; diff --git a/code/lib/codemod/tsconfig.json b/code/lib/codemod/tsconfig.json index cf1e0996590..b00caeb5450 100644 --- a/code/lib/codemod/tsconfig.json +++ b/code/lib/codemod/tsconfig.json @@ -1,7 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "skipLibCheck": true + "skipLibCheck": true, + "allowJs": true }, - "include": ["src/**/*"] + "include": ["src/**/*"], + "exclude": ["node_modules", "__testfixtures__", "__tests__"] } diff --git a/code/lib/core-client/package.json b/code/lib/core-client/package.json index 55018107457..25c88ab9af5 100644 --- a/code/lib/core-client/package.json +++ b/code/lib/core-client/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-client", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -35,8 +35,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0" + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12" }, "publishConfig": { "access": "public" @@ -47,5 +47,5 @@ ], "shim": "@storybook/preview-api/dist/core-client" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index e523ceb2b1d..124c3566e8a 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -44,14 +44,14 @@ }, "dependencies": { "@babel/core": "^7.20.2", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "@types/babel__core": "^7.1.20", "@types/express": "^4.7.0", "@types/node": "^16.0.0", "@types/pretty-hrtime": "^1.0.0", "chalk": "^4.1.0", - "esbuild": "^0.14.48", + "esbuild": "^0.16.4", "esbuild-register": "^3.3.3", "express": "^4.17.3", "file-system-cache": "^2.0.0", @@ -74,11 +74,6 @@ "type-fest": "^2.19.0", "typescript": "~4.9.3" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - }, "publishConfig": { "access": "public" }, @@ -88,5 +83,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/core-events/package.json b/code/lib/core-events/package.json index 7eabc1b9866..c7bcd68f3a4 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Event names used in storybook core", "keywords": [ "storybook" @@ -53,5 +53,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index 604630416ad..ce19fa9c9ac 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -58,16 +58,16 @@ "dependencies": { "@aw-web-design/x-default-browser": "1.4.88", "@discoveryjs/json-ext": "^0.5.3", - "@storybook/builder-manager": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", + "@storybook/builder-manager": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", "@storybook/csf": "next", - "@storybook/csf-tools": "7.0.0-beta.0", + "@storybook/csf-tools": "7.0.0-beta.12", "@storybook/docs-mdx": "next", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/telemetry": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/telemetry": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "@types/node": "^16.0.0", "@types/node-fetch": "^2.5.7", "@types/pretty-hrtime": "^1.0.0", @@ -99,27 +99,13 @@ "ws": "^8.2.3" }, "devDependencies": { - "@storybook/builder-webpack5": "7.0.0-beta.0", "@types/compression": "^1.7.0", "@types/ip": "^1.1.0", "@types/serve-favicon": "^2.5.2", "@types/ws": "^8", "jest-os-detection": "^1.3.1", "jest-specific-snapshot": "^7.0.0", - "typescript": "~4.9.3", - "webpack": "5" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@storybook/builder-webpack5": { - "optional": true - }, - "typescript": { - "optional": true - } + "typescript": "~4.9.3" }, "publishConfig": { "access": "public" @@ -132,5 +118,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/core-server/src/dev-server.ts b/code/lib/core-server/src/dev-server.ts index 86e9c756283..906c39b4362 100644 --- a/code/lib/core-server/src/dev-server.ts +++ b/code/lib/core-server/src/dev-server.ts @@ -109,7 +109,9 @@ export async function storybookDevServer(options: Options) { // this is a preview route, the builder has to be started before we can serve it // this handler keeps request to that route pending until the builder is ready to serve it, preventing a 404 router.get('/iframe.html', (req, res, next) => { - previewStarted.then(() => next()); + // We need to catch here or node will treat any errors thrown by `previewStarted` as + // unhandled and exit (even though they are very much handled below) + previewStarted.catch(() => {}).then(() => next()); }); Promise.all([initializedStoryIndexGenerator, listening, usingStatics]).then(async () => { diff --git a/code/lib/core-server/src/withTelemetry.test.ts b/code/lib/core-server/src/withTelemetry.test.ts index 121b60718af..a63df263dea 100644 --- a/code/lib/core-server/src/withTelemetry.test.ts +++ b/code/lib/core-server/src/withTelemetry.test.ts @@ -10,15 +10,25 @@ jest.mock('prompts'); jest.mock('@storybook/core-common'); jest.mock('@storybook/telemetry'); +const cliOptions = {}; + it('works in happy path', async () => { const run = jest.fn(); - await withTelemetry('dev', {}, run); + await withTelemetry('dev', { cliOptions }, run); expect(telemetry).toHaveBeenCalledTimes(1); expect(telemetry).toHaveBeenCalledWith('boot', { eventType: 'dev' }, { stripMetadata: true }); }); +it('does not send boot when cli option is passed', async () => { + const run = jest.fn(); + + await withTelemetry('dev', { cliOptions: { disableTelemetry: true } }, run); + + expect(telemetry).toHaveBeenCalledTimes(0); +}); + describe('when command fails', () => { const error = new Error('An Error!'); const run = jest.fn(async () => { @@ -26,13 +36,21 @@ describe('when command fails', () => { }); it('sends boot message', async () => { - await expect(async () => withTelemetry('dev', {}, run)).rejects.toThrow(error); + await expect(async () => withTelemetry('dev', { cliOptions }, run)).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledWith('boot', { eventType: 'dev' }, { stripMetadata: true }); }); + it('does not send boot when cli option is passed', async () => { + await expect(async () => + withTelemetry('dev', { cliOptions: { disableTelemetry: true } }, run) + ).rejects.toThrow(error); + + expect(telemetry).toHaveBeenCalledTimes(0); + }); + it('sends error message when no options are passed', async () => { - await expect(async () => withTelemetry('dev', {}, run)).rejects.toThrow(error); + await expect(async () => withTelemetry('dev', { cliOptions }, run)).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledTimes(2); expect(telemetry).toHaveBeenCalledWith( @@ -47,7 +65,7 @@ describe('when command fails', () => { withTelemetry('dev', { cliOptions: { disableTelemetry: true } }, run) ).rejects.toThrow(error); - expect(telemetry).toHaveBeenCalledTimes(1); + expect(telemetry).toHaveBeenCalledTimes(0); expect(telemetry).not.toHaveBeenCalledWith( 'error', { eventType: 'dev', error }, @@ -60,7 +78,7 @@ describe('when command fails', () => { apply: async () => ({ enableCrashReports: false } as any), }); await expect(async () => - withTelemetry('dev', { presetOptions: {} as any }, run) + withTelemetry('dev', { cliOptions: {} as any, presetOptions: {} as any }, run) ).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledTimes(2); @@ -77,7 +95,7 @@ describe('when command fails', () => { }); await expect(async () => - withTelemetry('dev', { presetOptions: {} as any }, run) + withTelemetry('dev', { cliOptions: {} as any, presetOptions: {} as any }, run) ).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledTimes(2); @@ -94,7 +112,7 @@ describe('when command fails', () => { }); await expect(async () => - withTelemetry('dev', { presetOptions: {} as any }, run) + withTelemetry('dev', { cliOptions: {} as any, presetOptions: {} as any }, run) ).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledTimes(1); @@ -111,7 +129,7 @@ describe('when command fails', () => { }); await expect(async () => - withTelemetry('dev', { presetOptions: {} as any }, run) + withTelemetry('dev', { cliOptions: {} as any, presetOptions: {} as any }, run) ).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledTimes(2); @@ -129,7 +147,7 @@ describe('when command fails', () => { jest.mocked(cache.get).mockResolvedValueOnce(false); await expect(async () => - withTelemetry('dev', { presetOptions: {} as any }, run) + withTelemetry('dev', { cliOptions: {} as any, presetOptions: {} as any }, run) ).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledTimes(2); @@ -147,7 +165,7 @@ describe('when command fails', () => { jest.mocked(cache.get).mockResolvedValueOnce(true); await expect(async () => - withTelemetry('dev', { presetOptions: {} as any }, run) + withTelemetry('dev', { cliOptions: {} as any, presetOptions: {} as any }, run) ).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledTimes(2); @@ -166,7 +184,7 @@ describe('when command fails', () => { jest.mocked(prompts).mockResolvedValueOnce({ enableCrashReports: false }); await expect(async () => - withTelemetry('dev', { presetOptions: {} as any }, run) + withTelemetry('dev', { cliOptions: {} as any, presetOptions: {} as any }, run) ).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledTimes(2); @@ -185,7 +203,7 @@ describe('when command fails', () => { jest.mocked(prompts).mockResolvedValueOnce({ enableCrashReports: true }); await expect(async () => - withTelemetry('dev', { presetOptions: {} as any }, run) + withTelemetry('dev', { cliOptions: {} as any, presetOptions: {} as any }, run) ).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledTimes(2); @@ -201,7 +219,7 @@ describe('when command fails', () => { jest.mocked(loadAllPresets).mockRejectedValueOnce(error); await expect(async () => - withTelemetry('dev', { presetOptions: {} as any }, run) + withTelemetry('dev', { cliOptions: {} as any, presetOptions: {} as any }, run) ).rejects.toThrow(error); expect(telemetry).toHaveBeenCalledTimes(1); diff --git a/code/lib/core-server/src/withTelemetry.ts b/code/lib/core-server/src/withTelemetry.ts index 5fcd9c61495..053f2846fa7 100644 --- a/code/lib/core-server/src/withTelemetry.ts +++ b/code/lib/core-server/src/withTelemetry.ts @@ -5,7 +5,7 @@ import { telemetry, getPrecedingUpgrade } from '@storybook/telemetry'; import type { EventType } from '@storybook/telemetry'; type TelemetryOptions = { - cliOptions?: CLIOptions; + cliOptions: CLIOptions; presetOptions?: Parameters[0]; }; @@ -29,7 +29,7 @@ const promptCrashReports = async () => { type ErrorLevel = 'none' | 'error' | 'full'; async function getErrorLevel({ cliOptions, presetOptions }: TelemetryOptions): Promise { - if (cliOptions?.disableTelemetry) return 'none'; + if (cliOptions.disableTelemetry) return 'none'; // If we are running init or similar, we just have to go with true here if (!presetOptions) return 'full'; @@ -63,7 +63,8 @@ export async function withTelemetry( options: TelemetryOptions, run: () => Promise ) { - telemetry('boot', { eventType }, { stripMetadata: true }); + if (!options.cliOptions.disableTelemetry) + telemetry('boot', { eventType }, { stripMetadata: true }); try { await run(); @@ -78,7 +79,7 @@ export async function withTelemetry( { eventType, precedingUpgrade, error: errorLevel === 'full' ? error : undefined }, { immediate: true, - configDir: options.cliOptions?.configDir || options.presetOptions?.configDir, + configDir: options.cliOptions.configDir || options.presetOptions?.configDir, enableCrashReports: errorLevel === 'full', } ); diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index c00fa651f37..0df0af30fed 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -43,9 +43,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "@types/node": "^16.0.0", "ts-dedent": "^2.0.0" }, @@ -62,5 +62,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index 0d565255ab5..6fca7b9dd08 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Enrich CSF files via static analysis", "keywords": [ "storybook" @@ -43,7 +43,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/csf-tools": "7.0.0-beta.0", + "@storybook/csf-tools": "7.0.0-beta.12", "unplugin": "^0.10.2" }, "devDependencies": { @@ -64,5 +64,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/csf-plugin/src/index.ts b/code/lib/csf-plugin/src/index.ts index 74e215e6d47..397daf274aa 100644 --- a/code/lib/csf-plugin/src/index.ts +++ b/code/lib/csf-plugin/src/index.ts @@ -23,7 +23,11 @@ export const unplugin = createUnplugin((options) => { enrichCsf(csf, options); return formatCsf(csf); } catch (err: any) { - logger.warn(err.message); + // This can be called on legacy storiesOf files, so just ignore + // those errors. But warn about other errors. + if (!err.message?.startsWith('CSF:')) { + logger.warn(err.message); + } return code; } }, diff --git a/code/lib/csf-tools/package.json b/code/lib/csf-tools/package.json index de8e98a79b5..7d61fe5ec28 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -45,7 +45,7 @@ "dependencies": { "@babel/types": "^7.20.2", "@storybook/csf": "next", - "@storybook/types": "7.0.0-beta.0", + "@storybook/types": "7.0.0-beta.12", "fs-extra": "^9.0.1", "ts-dedent": "^2.0.0" }, @@ -65,5 +65,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/csf-tools/src/ConfigFile.test.ts b/code/lib/csf-tools/src/ConfigFile.test.ts index 757ed1b0567..0c528a694cd 100644 --- a/code/lib/csf-tools/src/ConfigFile.test.ts +++ b/code/lib/csf-tools/src/ConfigFile.test.ts @@ -19,6 +19,12 @@ const setField = (path: string[], value: any, source: string) => { return formatConfig(config); }; +const removeField = (path: string[], source: string) => { + const config = loadConfig(source).parse(); + config.removeField(path); + return formatConfig(config); +}; + describe('ConfigFile', () => { describe('getField', () => { describe('named exports', () => { @@ -432,4 +438,313 @@ describe('ConfigFile', () => { }); }); }); + + describe('removeField', () => { + describe('named exports', () => { + it('missing export', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + export const addons = []; + ` + ) + ).toMatchInlineSnapshot(`export const addons = [];`); + }); + it('missing field', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + export const core = { foo: 'bar' }; + ` + ) + ).toMatchInlineSnapshot(` + export const core = { + foo: 'bar' + }; + `); + }); + it('found scalar', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + export const core = { builder: 'webpack4' }; + ` + ) + ).toMatchInlineSnapshot(`export const core = {};`); + }); + it('found object', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + export const core = { builder: { name: 'webpack4' } }; + ` + ) + ).toMatchInlineSnapshot(`export const core = {};`); + }); + it('nested object', () => { + expect( + removeField( + ['core', 'builder', 'name'], + dedent` + export const core = { builder: { name: 'webpack4' } }; + ` + ) + ).toMatchInlineSnapshot(` + export const core = { + builder: {} + }; + `); + }); + it('string literal key', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + export const core = { 'builder': 'webpack4' }; + ` + ) + ).toMatchInlineSnapshot(`export const core = {};`); + }); + it('variable export', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + const coreVar = { builder: 'webpack4' }; + export const core = coreVar; + ` + ) + ).toMatchInlineSnapshot(` + const coreVar = {}; + export const core = coreVar; + `); + }); + it('root export variable', () => { + expect( + removeField( + ['core'], + dedent` + export const core = { builder: { name: 'webpack4' } }; + + export const addons = []; + ` + ) + ).toMatchInlineSnapshot(`export const addons = [];`); + }); + }); + + describe('module exports', () => { + it('missing export', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + module.exports = { addons: [] }; + ` + ) + ).toMatchInlineSnapshot(` + module.exports = { + addons: [] + }; + `); + }); + it('missing field', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + module.exports = { core: { foo: 'bar' }}; + ` + ) + ).toMatchInlineSnapshot(` + module.exports = { + core: { + foo: 'bar' + } + }; + `); + }); + it('found scalar', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + module.exports = { core: { builder: 'webpack4' } }; + ` + ) + ).toMatchInlineSnapshot(` + module.exports = { + core: {} + }; + `); + }); + it('nested scalar', () => { + expect( + removeField( + ['core', 'builder', 'name'], + dedent` + module.exports = { core: { builder: { name: 'webpack4' } } }; + ` + ) + ).toMatchInlineSnapshot(` + module.exports = { + core: { + builder: {} + } + }; + `); + }); + it('string literal key', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + module.exports = { 'core': { 'builder': 'webpack4' } }; + ` + ) + ).toMatchInlineSnapshot(` + module.exports = { + 'core': {} + }; + `); + }); + it('root property', () => { + expect( + removeField( + ['core'], + dedent` + module.exports = { core: { builder: { name: 'webpack4' } }, addons: [] }; + ` + ) + ).toMatchInlineSnapshot(` + module.exports = { + addons: [] + }; + `); + }); + }); + + describe('default export', () => { + it('missing export', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + export default { addons: [] }; + ` + ) + ).toMatchInlineSnapshot(` + export default { + addons: [] + }; + `); + }); + it('missing field', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + export default { core: { foo: 'bar' }}; + ` + ) + ).toMatchInlineSnapshot(` + export default { + core: { + foo: 'bar' + } + }; + `); + }); + it('found scalar', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + export default { core: { builder: 'webpack4' } }; + ` + ) + ).toMatchInlineSnapshot(` + export default { + core: {} + }; + `); + }); + it('nested scalar', () => { + expect( + removeField( + ['core', 'builder', 'name'], + dedent` + export default { core: { builder: { name: 'webpack4' } } }; + ` + ) + ).toMatchInlineSnapshot(` + export default { + core: { + builder: {} + } + }; + `); + }); + it('string literal key', () => { + expect( + removeField( + ['core', 'builder'], + dedent` + export default { 'core': { 'builder': 'webpack4' } }; + ` + ) + ).toMatchInlineSnapshot(` + export default { + 'core': {} + }; + `); + }); + it('root property', () => { + expect( + removeField( + ['core'], + dedent` + export default { core: { builder: { name: 'webpack4' } }, addons: [] }; + ` + ) + ).toMatchInlineSnapshot(` + export default { + addons: [] + }; + `); + }); + }); + + describe('quotes', () => { + it('no quotes', () => { + expect(setField(['foo', 'bar'], 'baz', '')).toMatchInlineSnapshot(` + export const foo = { + bar: "baz" + }; + `); + }); + it('more single quotes', () => { + expect(setField(['foo', 'bar'], 'baz', `export const stories = ['a', 'b', "c"]`)) + .toMatchInlineSnapshot(` + export const stories = ['a', 'b', "c"]; + export const foo = { + bar: 'baz' + }; + `); + }); + it('more double quotes', () => { + expect(setField(['foo', 'bar'], 'baz', `export const stories = ['a', "b", "c"]`)) + .toMatchInlineSnapshot(` + export const stories = ['a', "b", "c"]; + export const foo = { + bar: "baz" + }; + `); + }); + }); + }); }); diff --git a/code/lib/csf-tools/src/ConfigFile.ts b/code/lib/csf-tools/src/ConfigFile.ts index e9fde5c61b1..37e1cb6c3e8 100644 --- a/code/lib/csf-tools/src/ConfigFile.ts +++ b/code/lib/csf-tools/src/ConfigFile.ts @@ -31,6 +31,27 @@ const _getPath = (path: string[], node: t.Node): t.Node | undefined => { return undefined; }; +// eslint-disable-next-line @typescript-eslint/naming-convention +const _getPathProperties = (path: string[], node: t.Node): t.ObjectProperty[] | undefined => { + if (path.length === 0) { + if (t.isObjectExpression(node)) { + return node.properties as t.ObjectProperty[]; + } + throw new Error('Expected object expression'); + } + if (t.isObjectExpression(node)) { + const [first, ...rest] = path; + const field = node.properties.find((p: t.ObjectProperty) => propKey(p) === first); + if (field) { + // FXIME handle spread etc. + if (rest.length === 0) return node.properties as t.ObjectProperty[]; + + return _getPathProperties(rest, (field as t.ObjectProperty).value); + } + } + return undefined; +}; + // eslint-disable-next-line @typescript-eslint/naming-convention const _findVarInitialization = (identifier: string, program: t.Program) => { let init: t.Expression | null | undefined = null; @@ -196,6 +217,13 @@ export class ConfigFile { return _getPath(rest, exported); } + getFieldProperties(path: string[]) { + const [root, ...rest] = path; + const exported = this._exports[root]; + if (!exported) return undefined; + return _getPathProperties(rest, exported); + } + getFieldValue(path: string[]) { const node = this.getFieldNode(path); if (node) { @@ -226,6 +254,63 @@ export class ConfigFile { } } + removeField(path: string[]) { + const removeProperty = (properties: t.ObjectProperty[], prop: string) => { + const index = properties.findIndex( + (p) => + (t.isIdentifier(p.key) && p.key.name === prop) || + (t.isStringLiteral(p.key) && p.key.value === prop) + ); + if (index >= 0) { + properties.splice(index, 1); + } + }; + // the structure of this._exports doesn't work for this use case + // so we have to manually bypass it here + if (path.length === 1) { + let removedRootProperty = false; + // removing the root export + this._ast.program.body.forEach((node) => { + // named export + if (t.isExportNamedDeclaration(node) && t.isVariableDeclaration(node.declaration)) { + const decl = node.declaration.declarations[0]; + if (t.isIdentifier(decl.id) && decl.id.name === path[0]) { + this._ast.program.body.splice(this._ast.program.body.indexOf(node), 1); + removedRootProperty = true; + } + } + // default export + if (t.isExportDefaultDeclaration(node) && t.isObjectExpression(node.declaration)) { + const properties = node.declaration.properties as t.ObjectProperty[]; + removeProperty(properties, path[0]); + removedRootProperty = true; + } + // module.exports + if ( + t.isExpressionStatement(node) && + t.isAssignmentExpression(node.expression) && + t.isMemberExpression(node.expression.left) && + t.isIdentifier(node.expression.left.object) && + node.expression.left.object.name === 'module' && + t.isIdentifier(node.expression.left.property) && + node.expression.left.property.name === 'exports' && + t.isObjectExpression(node.expression.right) + ) { + const properties = node.expression.right.properties as t.ObjectProperty[]; + removeProperty(properties, path[0]); + removedRootProperty = true; + } + }); + if (removedRootProperty) return; + } + + const properties = this.getFieldProperties(path) as t.ObjectProperty[]; + if (properties) { + const lastPath = path.at(-1); + removeProperty(properties, lastPath); + } + } + _inferQuotes() { if (!this._quotes) { // first 500 tokens for efficiency diff --git a/code/lib/csf-tools/src/CsfFile.test.ts b/code/lib/csf-tools/src/CsfFile.test.ts index 7a2ac4a6a2c..c2178ec658f 100644 --- a/code/lib/csf-tools/src/CsfFile.test.ts +++ b/code/lib/csf-tools/src/CsfFile.test.ts @@ -378,6 +378,36 @@ describe('CsfFile', () => { `); }); + it('docs-only story with local vars', () => { + expect( + parse( + dedent` + export const TestControl = () => _jsx("p", { + children: "Hello" + }); + export default { title: 'foo/bar', tags: ['mdx'], includeStories: ["__page"] }; + export const __page = () => {}; + __page.parameters = { docsOnly: true }; + `, + true + ) + ).toMatchInlineSnapshot(` + meta: + title: foo/bar + tags: + - mdx + includeStories: + - __page + stories: + - id: foo-bar--page + name: Page + parameters: + __isArgsStory: false + __id: foo-bar--page + docsOnly: true + `); + }); + it('title variable', () => { expect( parse( diff --git a/code/lib/csf-tools/src/CsfFile.ts b/code/lib/csf-tools/src/CsfFile.ts index fbc167c90a6..7527ded87ec 100644 --- a/code/lib/csf-tools/src/CsfFile.ts +++ b/code/lib/csf-tools/src/CsfFile.ts @@ -458,7 +458,11 @@ export class CsfFile { if (isExportStory(key, self._meta)) { const id = toId(self._meta.id || self._meta.title, storyNameFromExport(key)); const parameters: Record = { ...story.parameters, __id: id }; - if (entries.length === 1 && key === '__page') { + const { includeStories } = self._meta || {}; + if ( + key === '__page' && + (entries.length === 1 || (Array.isArray(includeStories) && includeStories.length === 1)) + ) { parameters.docsOnly = true; } acc[key] = { ...story, id, parameters }; diff --git a/code/lib/docs-tools/package.json b/code/lib/docs-tools/package.json index 61e06e77bd3..74e08037d8a 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Shared utility functions for frameworks to implement docs", "keywords": [ "storybook" @@ -44,9 +44,9 @@ }, "dependencies": { "@babel/core": "^7.12.10", - "@storybook/core-common": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/core-common": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "doctrine": "^3.0.0", "lodash": "^4.17.21" }, @@ -63,5 +63,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 001880ae99d..bef3da0701c 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -43,10 +43,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.0.0-beta.0", - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", + "@storybook/channels": "7.0.0-beta.12", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", "core-js": "^3.8.2", "global": "^4.4.0" }, @@ -61,5 +61,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/instrumenter/src/instrumenter.ts b/code/lib/instrumenter/src/instrumenter.ts index c29b1a6fbd9..480e47b3404 100644 --- a/code/lib/instrumenter/src/instrumenter.ts +++ b/code/lib/instrumenter/src/instrumenter.ts @@ -334,7 +334,7 @@ export class Instrumenter { track(method: string, fn: Function, args: any[], options: Options) { const storyId: StoryId = args?.[0]?.__storyId__ || - global.window.__STORYBOOK_PREVIEW__.selectionStore.selection.storyId; + global.window.__STORYBOOK_PREVIEW__?.selectionStore?.selection?.storyId; const { cursor, ancestors } = this.getState(storyId); this.setState(storyId, { cursor: cursor + 1 }); const id = `${ancestors.slice(-1)[0] || storyId} [${cursor}] ${method}`; diff --git a/code/lib/manager-api-shim/package.json b/code/lib/manager-api-shim/package.json index da08a2b24f3..f5fb0fd8d52 100644 --- a/code/lib/manager-api-shim/package.json +++ b/code/lib/manager-api-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/api", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook Manager API (facade)", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0" + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12" }, "publishConfig": { "access": "public" @@ -54,5 +54,5 @@ ], "shim": "@storybook/manager-api" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index 1ed48c3b095..6c63a86743f 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Core Storybook API & Context", "keywords": [ "storybook" @@ -42,13 +42,13 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.0.0-beta.0", - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", + "@storybook/channels": "7.0.0-beta.12", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", "@storybook/csf": "next", - "@storybook/router": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/router": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "dequal": "^2.0.2", "global": "^4.4.0", "lodash": "^4.17.21", @@ -78,5 +78,5 @@ "./src/index.tsx" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/manager-api/src/modules/layout.ts b/code/lib/manager-api/src/modules/layout.ts index 1f33ebe2c3c..8c81d8d0166 100644 --- a/code/lib/manager-api/src/modules/layout.ts +++ b/code/lib/manager-api/src/modules/layout.ts @@ -213,12 +213,14 @@ export const init: ModuleFn = ({ store, provider, singleStory, fullAPI }) => { if (options) { const updatedLayout = { ...layout, + ...options.layout, ...pick(options, Object.keys(layout)), ...(singleStory && { showNav: false }), }; const updatedUi = { ...ui, + ...options.ui, ...pick(options, Object.keys(ui)), }; diff --git a/code/lib/manager-api/src/version.ts b/code/lib/manager-api/src/version.ts index 017bfa89bba..9b295d4858c 100644 --- a/code/lib/manager-api/src/version.ts +++ b/code/lib/manager-api/src/version.ts @@ -1 +1 @@ -export const version = '7.0.0-beta.0'; +export const version = '7.0.0-beta.12'; diff --git a/code/lib/node-logger/package.json b/code/lib/node-logger/package.json index bd0f3195fcc..da5c4b0cead 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -60,5 +60,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/postinstall/package.json b/code/lib/postinstall/package.json index d4227e24efc..20c6f8a086a 100644 --- a/code/lib/postinstall/package.json +++ b/code/lib/postinstall/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/postinstall", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook addons postinstall utilities", "keywords": [ "api", @@ -57,5 +57,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index ade912eff27..cbfa3523f33 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -67,12 +67,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channel-postmessage": "7.0.0-beta.0", - "@storybook/channels": "7.0.0-beta.0", - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", + "@storybook/channel-postmessage": "7.0.0-beta.12", + "@storybook/channels": "7.0.0-beta.12", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", "@storybook/csf": "next", - "@storybook/types": "7.0.0-beta.0", + "@storybook/types": "7.0.0-beta.12", "@types/qs": "^6.9.5", "dequal": "^2.0.2", "global": "^4.4.0", @@ -86,7 +86,7 @@ }, "devDependencies": { "@jest/globals": "^26.6.2", - "@storybook/core-common": "7.0.0-beta.0", + "@storybook/core-common": "7.0.0-beta.12", "ansi-to-html": "^0.6.11", "react": "^16.14.0" }, @@ -103,5 +103,5 @@ "./src/store.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/preview-api/src/index.ts b/code/lib/preview-api/src/index.ts index 29f6d8cd56e..872b4f1a691 100644 --- a/code/lib/preview-api/src/index.ts +++ b/code/lib/preview-api/src/index.ts @@ -70,6 +70,7 @@ export { setProjectAnnotations, inferControls, userOrAutoTitleFromSpecifier, + userOrAutoTitle, sortStoriesV7, } from './store'; diff --git a/code/lib/preview-api/src/modules/client-api/ClientApi.ts b/code/lib/preview-api/src/modules/client-api/ClientApi.ts index f2d8eb35874..e918378a305 100644 --- a/code/lib/preview-api/src/modules/client-api/ClientApi.ts +++ b/code/lib/preview-api/src/modules/client-api/ClientApi.ts @@ -1,4 +1,4 @@ -/// +/* eslint-disable no-underscore-dangle */ import { dedent } from 'ts-dedent'; import global from 'global'; @@ -29,9 +29,7 @@ import { combineParameters, composeStepRunners, normalizeInputTypes } from '../. import { StoryStoreFacade } from './StoryStoreFacade'; -// ClientApi (and StoreStore) are really singletons. However they are not created until the -// relevant framework instanciates them via `start.js`. The good news is this happens right away. -let singleton: ClientApi; +const { window: globalWindow } = global; const warningAlternatives = { addDecorator: `Instead, use \`export const decorators = [];\` in your \`preview.js\`.`, @@ -47,7 +45,7 @@ const warningAlternatives = { }; const checkMethod = (method: keyof typeof warningAlternatives) => { - if (global.FEATURES?.storyStoreV7) { + if (globalWindow.FEATURES?.storyStoreV7) { throw new Error( dedent`You cannot use \`${method}\` with the new Story Store. @@ -55,61 +53,61 @@ const checkMethod = (method: keyof typeof warningAlternatives) => { ); } - if (!singleton) { + if (!globalWindow.__STORYBOOK_CLIENT_API__) { throw new Error(`Singleton client API not yet initialized, cannot call \`${method}\`.`); } }; export const addDecorator = (decorator: DecoratorFunction) => { checkMethod('addDecorator'); - singleton.addDecorator(decorator); + globalWindow.__STORYBOOK_CLIENT_API__?.addDecorator(decorator); }; export const addParameters = (parameters: Parameters) => { checkMethod('addParameters'); - singleton.addParameters(parameters); + globalWindow.__STORYBOOK_CLIENT_API__?.addParameters(parameters); }; export const addLoader = (loader: LoaderFunction) => { checkMethod('addLoader'); - singleton.addLoader(loader); + globalWindow.__STORYBOOK_CLIENT_API__?.addLoader(loader); }; export const addArgs = (args: Args) => { checkMethod('addArgs'); - singleton.addArgs(args); + globalWindow.__STORYBOOK_CLIENT_API__?.addArgs(args); }; export const addArgTypes = (argTypes: ArgTypes) => { checkMethod('addArgTypes'); - singleton.addArgTypes(argTypes); + globalWindow.__STORYBOOK_CLIENT_API__?.addArgTypes(argTypes); }; export const addArgsEnhancer = (enhancer: ArgsEnhancer) => { checkMethod('addArgsEnhancer'); - singleton.addArgsEnhancer(enhancer); + globalWindow.__STORYBOOK_CLIENT_API__?.addArgsEnhancer(enhancer); }; export const addArgTypesEnhancer = (enhancer: ArgTypesEnhancer) => { checkMethod('addArgTypesEnhancer'); - singleton.addArgTypesEnhancer(enhancer); + globalWindow.__STORYBOOK_CLIENT_API__?.addArgTypesEnhancer(enhancer); }; export const addStepRunner = (stepRunner: StepRunner) => { checkMethod('addStepRunner'); - singleton.addStepRunner(stepRunner); + globalWindow.__STORYBOOK_CLIENT_API__?.addStepRunner(stepRunner); }; export const getGlobalRender = () => { checkMethod('getGlobalRender'); - return singleton.facade.projectAnnotations.render; + return globalWindow.__STORYBOOK_CLIENT_API__?.facade.projectAnnotations.render; }; -export const setGlobalRender = ( - render: typeof singleton['facade']['projectAnnotations']['render'] -) => { +export const setGlobalRender = (render: StoryStoreFacade['projectAnnotations']['render']) => { checkMethod('setGlobalRender'); - singleton.facade.projectAnnotations.render = render; + if (globalWindow.__STORYBOOK_CLIENT_API__) { + globalWindow.__STORYBOOK_CLIENT_API__.facade.projectAnnotations.render = render; + } }; const invalidStoryTypes = new Set(['string', 'number', 'boolean', 'symbol']); @@ -132,8 +130,6 @@ export class ClientApi { this.addons = {}; this.storyStore = storyStore; - - singleton = this as any; } importFn(path: Path) { @@ -213,7 +209,6 @@ export class ClientApi { _addedExports = {} as Record; _loadAddedExports() { - // eslint-disable-next-line no-underscore-dangle Object.entries(this._addedExports).forEach(([fileName, fileExports]) => this.facade.addStoriesFromExports(fileName, fileExports) ); @@ -247,7 +242,7 @@ export class ClientApi { let i = 1; // Deal with `storiesOf()` being called twice in the same file. // On HMR, we clear _addedExports[fileName] below. - // eslint-disable-next-line no-underscore-dangle + while (this._addedExports[fileName]) { i += 1; fileName = `${baseFilename}-${i}`; @@ -259,7 +254,7 @@ export class ClientApi { m.hot.accept(); m.hot.dispose(() => { this.facade.clearFilenameExports(fileName); - // eslint-disable-next-line no-underscore-dangle + delete this._addedExports[fileName]; // We need to update the importFn as soon as the module re-evaluates @@ -268,7 +263,6 @@ export class ClientApi { // debounce it somehow for initial startup. Instead, we'll take advantage of // the fact that the evaluation of the module happens immediately in the same tick setTimeout(() => { - // eslint-disable-next-line no-underscore-dangle this._loadAddedExports(); this.onImportFnChanged?.({ importFn: this.importFn.bind(this) }); }, 0); @@ -301,7 +295,7 @@ export class ClientApi { parameters: {}, }; // We map these back to a simple default export, even though we have type guarantees at this point - // eslint-disable-next-line no-underscore-dangle + this._addedExports[fileName] = { default: meta }; let counter = 0; @@ -320,10 +314,8 @@ export class ClientApi { const { decorators, loaders, component, args, argTypes, ...storyParameters } = parameters; - // eslint-disable-next-line no-underscore-dangle const storyId = parameters.__id || toId(kind, storyName); - // eslint-disable-next-line no-underscore-dangle const csfExports = this._addedExports[fileName]; // Whack a _ on the front incase it is "default" csfExports[`story${counter}`] = { diff --git a/code/lib/preview-web/package.json b/code/lib/preview-web/package.json index 7c402f7c402..8e7f0ed5a7d 100644 --- a/code/lib/preview-web/package.json +++ b/code/lib/preview-web/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-web", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0" + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12" }, "publishConfig": { "access": "public" @@ -54,5 +54,5 @@ ], "shim": "@storybook/preview-api/dist/preview-web" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index 11a26e4857b..ff6e6dadcca 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -57,12 +57,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "devDependencies": { - "@storybook/channel-postmessage": "7.0.0-beta.0", - "@storybook/channel-websocket": "7.0.0-beta.0", - "@storybook/channels": "7.0.0-beta.0", - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", + "@storybook/channel-postmessage": "7.0.0-beta.12", + "@storybook/channel-websocket": "7.0.0-beta.12", + "@storybook/channels": "7.0.0-beta.12", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", "typescript": "~4.9.3" }, "publishConfig": { @@ -74,5 +74,5 @@ "./src/globals.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/router/package.json b/code/lib/router/package.json index c5e4d42a2e1..0f0c51cc37c 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Core Storybook Router", "keywords": [ "storybook" @@ -48,7 +48,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", "memoizerific": "^1.11.3", "qs": "^6.10.0" }, @@ -58,7 +58,6 @@ "lodash": "^4.17.21", "react-router-dom": "6.0.2", "ts-dedent": "^2.0.0", - "ts-node": "^10.4.0", "typescript": "~4.9.3" }, "peerDependencies": { @@ -75,5 +74,5 @@ "./src/utils.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 9b76ac1746c..c567719b91e 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Source loader", "keywords": [ "lib", @@ -45,7 +45,7 @@ }, "dependencies": { "@storybook/csf": "next", - "@storybook/types": "7.0.0-beta.0", + "@storybook/types": "7.0.0-beta.12", "estraverse": "^5.2.0", "lodash": "^4.17.21", "prettier": "^2.8.0" @@ -67,5 +67,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/store/package.json b/code/lib/store/package.json index 1d09776a8b4..242d9518f5f 100644 --- a/code/lib/store/package.json +++ b/code/lib/store/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/store", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "", "keywords": [ "storybook" @@ -42,8 +42,8 @@ "prep": "../../../scripts/prepare/facade.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0" + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12" }, "publishConfig": { "access": "public" @@ -55,5 +55,5 @@ "platform": "node", "shim": "@storybook/preview-api/dist/store" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/telemetry/package.json b/code/lib/telemetry/package.json index ab9009629c4..3d24c2b1b23 100644 --- a/code/lib/telemetry/package.json +++ b/code/lib/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" @@ -43,8 +43,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-common": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-common": "7.0.0-beta.12", "chalk": "^4.1.0", "detect-package-manager": "^2.0.1", "fetch-retry": "^5.0.2", @@ -65,5 +65,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/telemetry/src/get-chromatic-version.test.ts b/code/lib/telemetry/src/get-chromatic-version.test.ts new file mode 100644 index 00000000000..9ee07f3d45e --- /dev/null +++ b/code/lib/telemetry/src/get-chromatic-version.test.ts @@ -0,0 +1,15 @@ +import { getChromaticVersionSpecifier } from './get-chromatic-version'; + +it('works for dependencies', () => { + expect(getChromaticVersionSpecifier({ dependencies: { chromatic: '^6.11.4' } })).toBe('^6.11.4'); +}); + +it('works for scripts', () => { + expect(getChromaticVersionSpecifier({ scripts: { chromatic: 'npx chromatic -t abc123' } })).toBe( + 'latest' + ); +}); + +it('fails otherwise', () => { + expect(getChromaticVersionSpecifier({})).toBeUndefined(); +}); diff --git a/code/lib/telemetry/src/get-chromatic-version.ts b/code/lib/telemetry/src/get-chromatic-version.ts new file mode 100644 index 00000000000..c9f8db06cfe --- /dev/null +++ b/code/lib/telemetry/src/get-chromatic-version.ts @@ -0,0 +1,15 @@ +import type { PackageJson } from '@storybook/types'; + +export function getChromaticVersionSpecifier(packageJson: PackageJson) { + const dependency = + packageJson.dependencies?.chromatic || + packageJson.devDependencies?.chromatic || + packageJson.peerDependencies?.chromatic; + if (dependency) return dependency; + + // Chromatic isn't necessarily installed in dependencies, it can be run from npx + return packageJson.scripts && + Object.values(packageJson.scripts).find((s) => s?.match(/chromatic/)) + ? 'latest' + : undefined; +} diff --git a/code/lib/telemetry/src/storybook-metadata.ts b/code/lib/telemetry/src/storybook-metadata.ts index 54a98ce8917..6973345880e 100644 --- a/code/lib/telemetry/src/storybook-metadata.ts +++ b/code/lib/telemetry/src/storybook-metadata.ts @@ -13,6 +13,7 @@ import { getActualPackageVersion, getActualPackageVersions } from './package-jso import { getMonorepoType } from './get-monorepo-type'; import { cleanPaths } from './sanitize'; import { getFrameworkInfo } from './get-framework-info'; +import { getChromaticVersionSpecifier } from './get-chromatic-version'; export const metaFrameworks = { next: 'Next', @@ -123,6 +124,15 @@ export const computeStorybookMetadata = async ({ }); } + const chromaticVersionSpecifier = getChromaticVersionSpecifier(packageJson); + if (chromaticVersionSpecifier) { + addons.chromatic = { + version: undefined, + versionSpecifier: chromaticVersionSpecifier, + options: undefined, + }; + } + const addonVersions = await getActualPackageVersions(addons); addonVersions.forEach(({ name, version }) => { addons[name].version = version; diff --git a/code/lib/telemetry/src/telemetry.test.ts b/code/lib/telemetry/src/telemetry.test.ts index 24cda35ae8f..821848d1fc7 100644 --- a/code/lib/telemetry/src/telemetry.test.ts +++ b/code/lib/telemetry/src/telemetry.test.ts @@ -1,6 +1,5 @@ /// ; -/* eslint-disable no-plusplus */ import fetch from 'isomorphic-unfetch'; import { sendTelemetry } from './telemetry'; @@ -54,6 +53,12 @@ it('gives up if fetch repeatedly fails', async () => { it('await all pending telemetry when passing in immediate = true', async () => { let numberOfResolvedTasks = 0; + fetchMock.mockImplementation(async () => { + await Promise.resolve(null); + numberOfResolvedTasks += 1; + return { status: 200 }; + }); + // when we call sendTelemetry with immediate = true // all pending tasks will be awaited // to test this we add a few telemetry tasks that will be in the 'queue' @@ -61,16 +66,15 @@ it('await all pending telemetry when passing in immediate = true', async () => { sendTelemetry({ eventType: 'init', payload: { foo: 'bar' }, - }).then(() => { - numberOfResolvedTasks++; }); sendTelemetry({ eventType: 'dev', payload: { foo: 'bar' }, - }).then(() => { - numberOfResolvedTasks++; }); + expect(fetch).toHaveBeenCalledTimes(2); + expect(numberOfResolvedTasks).toBe(0); + // here we await await sendTelemetry( { @@ -78,9 +82,7 @@ it('await all pending telemetry when passing in immediate = true', async () => { payload: { foo: 'bar' }, }, { retryDelay: 0, immediate: true } - ).then(() => { - numberOfResolvedTasks++; - }); + ); expect(fetch).toHaveBeenCalledTimes(3); expect(numberOfResolvedTasks).toBe(3); diff --git a/code/lib/telemetry/src/types.ts b/code/lib/telemetry/src/types.ts index 6011282a8c5..d33b8967734 100644 --- a/code/lib/telemetry/src/types.ts +++ b/code/lib/telemetry/src/types.ts @@ -15,6 +15,7 @@ export type EventType = export interface Dependency { version: string | undefined; + versionSpecifier?: string; } export interface StorybookAddon extends Dependency { diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index 349e62d992a..c7d0086c194 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Core Storybook Components", "keywords": [ "storybook" @@ -49,7 +49,7 @@ }, "dependencies": { "@emotion/use-insertion-effect-with-fallbacks": "^1.0.0", - "@storybook/client-logger": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", "memoizerific": "^1.11.3" }, "devDependencies": { @@ -80,5 +80,5 @@ ], "post": "./scripts/fix-theme-type-export.ts" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/types/package.json b/code/lib/types/package.json index 79f75b3c638..3136e767ebd 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Core Storybook Types", "keywords": [ "storybook" @@ -44,7 +44,7 @@ }, "dependencies": { "@babel/core": "^7.12.10", - "@storybook/channels": "7.0.0-beta.0", + "@storybook/channels": "7.0.0-beta.12", "@types/babel__core": "^7.0.0", "@types/express": "^4.7.0", "express": "^4.17.3", @@ -63,5 +63,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index 94fa3b310c0..61dc1826649 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -341,7 +341,7 @@ export interface StorybookConfig { /** * References external Storybooks */ - refs?: CoreCommon_StorybookRefs | ((config: any, options: Options) => CoreCommon_StorybookRefs); + refs?: PresetValue; /** * Modify or return babel config. @@ -364,17 +364,17 @@ export interface StorybookConfig { * * @deprecated use `previewAnnotations` or `/preview.js` file instead */ - config?: (entries: Entry[], options: Options) => Entry[]; + config?: PresetValue; /** * Add additional scripts to run in the preview a la `.storybook/preview.js` */ - previewAnnotations?: (entries: Entry[], options: Options) => Entry[]; + previewAnnotations?: PresetValue; /** * Process CSF files for the story index. */ - storyIndexers?: (indexers: StoryIndexer[], options: Options) => StoryIndexer[]; + storyIndexers?: PresetValue; /** * Docs related features in index generation @@ -386,11 +386,13 @@ export interface StorybookConfig { * The previewHead and previewBody functions accept a string, * which is the existing head/body, and return a modified string. */ - previewHead?: (head: string, options: Options) => string; + previewHead?: PresetValue; - previewBody?: (body: string, options: Options) => string; + previewBody?: PresetValue; } +export type PresetValue = T | ((config: T, options: Options) => T | Promise); + export type PresetProperty = | TStorybookConfig[K extends keyof TStorybookConfig ? K : never] | PresetPropertyFn; diff --git a/code/package.json b/code/package.json index d36099cedc2..5f0b154e1ee 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "private": true, "description": "Storybook is an open source tool for developing UI components in isolation for React, Vue and Angular. It makes building stunning UIs organized and efficient.", "keywords": [ @@ -61,9 +61,9 @@ "coverage": "codecov", "danger": "danger", "generate-repros": "zx ../scripts/repros-generator/index.mjs", - "generate-repros-next": "ts-node ../scripts/next-repro-generators/generate-repros.ts", + "generate-repros-next": "ts-node --swc ../scripts/next-repro-generators/generate-repros.ts", "github-release": "github-release-from-changelog", - "linear-export": "ts-node --project=../scripts/tsconfig.json ../scripts/linear-export.ts", + "linear-export": "ts-node --swc --project=../scripts/tsconfig.json ../scripts/linear-export.ts", "lint": "yarn lint:js && yarn lint:md", "lint:ejs": "ejslint **/*.ejs", "lint:js": "yarn lint:js:cmd . --quiet", @@ -71,8 +71,8 @@ "lint:md": "remark -q .", "lint:other": "prettier --write '**/*.{css,html,json,md,yml}'", "lint:package": "sort-package-json", - "local-registry": "ts-node --project=../scripts/tsconfig.json ../scripts/run-registry.ts --port 6001", - "publish-repros": "ts-node ../scripts/next-repro-generators/publish.ts", + "local-registry": "ts-node --swc --project=../scripts/tsconfig.json ../scripts/run-registry.ts --port 6001", + "publish-repros": "ts-node --swc ../scripts/next-repro-generators/publish.ts", "publish:debug": "npm run publish:latest -- --npm-tag=debug --no-push", "publish:latest": "lerna publish --exact --concurrency 1 --force-publish", "publish:next": "npm run publish:latest -- --npm-tag=next", @@ -114,7 +114,7 @@ "@typescript-eslint/experimental-utils": "^5.45.0", "@typescript-eslint/parser": "^5.45.0", "boxen": "^5.1.2", - "esbuild": "^0.14.48", + "esbuild": "^0.16.4", "eslint": "^8.28.0", "serialize-javascript": "^3.1.0", "webpack": "5" @@ -145,7 +145,7 @@ "@nrwl/cli": "14.6.1", "@nrwl/nx-cloud": "14.6.0", "@nrwl/workspace": "14.6.1", - "@playwright/test": "1.28.0", + "@playwright/test": "1.29.0", "@storybook/addon-a11y": "workspace:*", "@storybook/addon-actions": "workspace:*", "@storybook/addon-backgrounds": "workspace:*", @@ -236,6 +236,7 @@ "@storybook/web-components": "workspace:*", "@storybook/web-components-vite": "workspace:*", "@storybook/web-components-webpack5": "workspace:*", + "@swc/core": "^1.3.23", "@testing-library/dom": "^7.29.4", "@testing-library/jest-dom": "^5.11.9", "@testing-library/react": "^11.2.2", @@ -280,7 +281,7 @@ "ejs-lint": "^1.2.2", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.5", - "esbuild": "^0.14.48", + "esbuild": "^0.16.4", "esbuild-loader": "^2.19.0", "esbuild-plugin-alias": "^0.2.1", "eslint": "^8.28.0", @@ -314,7 +315,7 @@ "npmlog": "^5.0.1", "nx": "14.6.1", "p-limit": "^3.1.0", - "playwright": "1.28.0", + "playwright": "1.29.0", "prettier": "2.8.0", "process": "^0.11.10", "prompts": "^2.4.0", @@ -334,11 +335,11 @@ "terser-webpack-plugin": "^5.3.1", "trash": "^7.0.0", "ts-dedent": "^2.0.0", - "ts-node": "^10.4.0", + "ts-node": "^10.9.1", "tsup": "^6.2.2", "typescript": "~4.9.3", "util": "^0.12.4", - "vite": "^3.1.7", + "vite": "^4.0.0", "vite-plugin-turbosnap": "^1.0.1", "wait-on": "^5.2.1", "web-component-analyzer": "^1.1.6", @@ -386,8 +387,7 @@ }, "packageManager": "yarn@3.3.0", "engines": { - "node": ">=10.13.0", - "yarn": ">=1.3.2" + "node": ">=16.0.0" }, "collective": { "type": "opencollective", diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index e185e32f79e..c04b1de8b5e 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.0.0-beta.0", + "version": "7.0.0-beta.12", "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.0.0-beta.0", + "@storybook/core-webpack": "7.0.0-beta.12", "@types/node": "^16.0.0", "html-loader": "^3.1.0", "webpack": "5" @@ -60,7 +60,7 @@ "@babel/core": "*" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -71,5 +71,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index 2189f6ea4f0..9cd5d6bc8cd 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" @@ -49,7 +49,7 @@ }, "dependencies": { "@babel/plugin-transform-react-jsx": "^7.19.0", - "@storybook/core-webpack": "7.0.0-beta.0", + "@storybook/core-webpack": "7.0.0-beta.12", "@types/node": "^16.0.0" }, "devDependencies": { @@ -61,7 +61,7 @@ "preact": "^8.0.0||^10.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -72,5 +72,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index 187facbc46c..673ef702412 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -71,10 +71,10 @@ "@babel/preset-flow": "^7.18.6", "@babel/preset-react": "^7.18.6", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", - "@storybook/core-webpack": "7.0.0-beta.0", - "@storybook/docs-tools": "7.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", - "@storybook/react": "7.0.0-beta.0", + "@storybook/core-webpack": "7.0.0-beta.12", + "@storybook/docs-tools": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", + "@storybook/react": "7.0.0-beta.12", "@storybook/react-docgen-typescript-plugin": "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0", "@types/node": "^16.0.0", "@types/semver": "^7.3.4", @@ -102,7 +102,7 @@ } }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -117,5 +117,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 43dbf2a348d..03cb03b84d5 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" @@ -53,9 +53,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-server": "7.0.0-beta.0", - "@storybook/core-webpack": "7.0.0-beta.0", - "@storybook/server": "7.0.0-beta.0", + "@storybook/core-server": "7.0.0-beta.12", + "@storybook/core-webpack": "7.0.0-beta.12", + "@storybook/server": "7.0.0-beta.12", "@types/node": "^16.0.0", "global": "^4.4.0", "safe-identifier": "^0.4.1", @@ -69,7 +69,7 @@ "yaml": "^1.10.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -81,5 +81,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index 0821bcda474..f6de275d24c 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.0.0-beta.0", + "version": "7.0.0-beta.12", "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.0.0-beta.0", - "@storybook/node-logger": "7.0.0-beta.0", + "@storybook/core-webpack": "7.0.0-beta.12", + "@storybook/node-logger": "7.0.0-beta.12", "sveltedoc-parser": "^4.2.1", "ts-dedent": "^2.0.0" }, @@ -79,7 +79,7 @@ "svelte-loader": "*" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -93,5 +93,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/presets/vue-webpack/package.json b/code/presets/vue-webpack/package.json index a71c644a8eb..51a7fa8a44e 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.0.0-beta.0", + "version": "7.0.0-beta.12", "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.0.0-beta.0", - "@storybook/docs-tools": "7.0.0-beta.0", + "@storybook/core-webpack": "7.0.0-beta.12", + "@storybook/docs-tools": "7.0.0-beta.12", "@types/node": "^16.0.0", "ts-loader": "^9.2.8", "vue-docgen-api": "^4.44.23", @@ -82,7 +82,7 @@ "vue-template-compiler": "^2.6.14" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -95,5 +95,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index 206ae940e7f..407e17d5346 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.0.0-beta.0", + "version": "7.0.0-beta.12", "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.0.0-beta.0", - "@storybook/docs-tools": "7.0.0-beta.0", + "@storybook/core-webpack": "7.0.0-beta.12", + "@storybook/docs-tools": "7.0.0-beta.12", "@types/node": "^16.0.0", "ts-loader": "^9.2.8", "vue-docgen-api": "^4.46.0", @@ -79,7 +79,7 @@ "vue": "^3.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -92,5 +92,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/presets/web-components-webpack/package.json b/code/presets/web-components-webpack/package.json index 229a13e5e0c..5d8959fb2d0 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit-html", @@ -53,7 +53,7 @@ "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/preset-env": "^7.20.2", - "@storybook/core-webpack": "7.0.0-beta.0", + "@storybook/core-webpack": "7.0.0-beta.12", "@types/node": "^16.0.0", "babel-loader": "^7.0.0 || ^8.0.0", "babel-plugin-bundled-import-meta": "^0.3.1" @@ -66,7 +66,7 @@ "lit-html": "^1.4.1 || ^2.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -77,5 +77,5 @@ ], "platform": "node" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index 10a6f2c10f0..55fe23e4f67 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook HTML renderer", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.0.0-beta.0", - "@storybook/docs-tools": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/core-client": "7.0.0-beta.12", + "@storybook/docs-tools": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "ts-dedent": "^2.0.0" }, @@ -62,7 +62,7 @@ "@babel/core": "*" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -74,5 +74,5 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index f52e06eeb4a..ce5218f6790 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook Preact renderer", "keywords": [ "storybook" @@ -48,9 +48,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/core-client": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "ts-dedent": "^2.0.0" }, @@ -62,7 +62,7 @@ "preact": "^8.0.0||^10.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -74,5 +74,5 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index f030017bcea..fee0c975c94 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook React renderer", "keywords": [ "storybook" @@ -48,11 +48,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-client": "7.0.0-beta.0", - "@storybook/docs-tools": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-client": "7.0.0-beta.12", + "@storybook/docs-tools": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "@types/estree": "^0.0.51", "@types/node": "^16.0.0", "acorn": "^7.4.1", @@ -86,7 +86,7 @@ } }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -98,5 +98,5 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/renderers/react/src/public-types.test.tsx b/code/renderers/react/src/public-types.test.tsx index 68b68fd23b2..c955c6b59fb 100644 --- a/code/renderers/react/src/public-types.test.tsx +++ b/code/renderers/react/src/public-types.test.tsx @@ -200,3 +200,31 @@ describe('Story args can be inferred', () => { expectTypeOf(Basic).toEqualTypeOf(); }); }); + +test('StoryObj is allowed when meta is upcasted to Meta', () => { + expectTypeOf>>().toEqualTypeOf< + ReactStory< + ButtonProps & { children?: ReactNode }, + Partial + > + >(); +}); + +test('StoryObj is allowed when meta is upcasted to Meta', () => { + expectTypeOf>>().toEqualTypeOf< + ReactStory< + ButtonProps & { children?: ReactNode }, + Partial + > + >(); +}); + +test('StoryObj is allowed when all arguments are optional', () => { + expectTypeOf>>().toEqualTypeOf< + ReactStory<{ label?: string; children?: ReactNode }, { label?: string; children?: ReactNode }> + >(); +}); + +test('Meta can be used without generic', () => { + expectTypeOf({ component: Button }).toMatchTypeOf(); +}); diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 684f8899db1..6867f159302 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook Server renderer", "keywords": [ "storybook" @@ -48,9 +48,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/core-client": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "ts-dedent": "^2.0.0" }, @@ -58,7 +58,7 @@ "typescript": "~4.9.3" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -70,5 +70,5 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index 3eac561d421..384abd310dc 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook Svelte renderer", "keywords": [ "storybook" @@ -52,11 +52,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-client": "7.0.0-beta.0", - "@storybook/docs-tools": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-client": "7.0.0-beta.12", + "@storybook/docs-tools": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "sveltedoc-parser": "^4.2.1", "type-fest": "2.19.0" @@ -72,7 +72,7 @@ "svelte": "^3.1.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -84,5 +84,5 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/renderers/svelte/template/cli/ts/Button.svelte b/code/renderers/svelte/template/cli/ts/Button.svelte index ea573d86529..f590a0aff55 100644 --- a/code/renderers/svelte/template/cli/ts/Button.svelte +++ b/code/renderers/svelte/template/cli/ts/Button.svelte @@ -17,7 +17,7 @@ /** * Button contents */ - export let label: string; + export let label: string = ''; $: mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'; diff --git a/code/renderers/vue/package.json b/code/renderers/vue/package.json index 1a1c2272870..159d02ff949 100644 --- a/code/renderers/vue/package.json +++ b/code/renderers/vue/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook Vue renderer", "keywords": [ "storybook" @@ -48,11 +48,11 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-client": "7.0.0-beta.0", - "@storybook/docs-tools": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-client": "7.0.0-beta.12", + "@storybook/docs-tools": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "ts-dedent": "^2.0.0", "type-fest": "2.19.0" @@ -74,7 +74,7 @@ } }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -86,5 +86,5 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index 177cb727be4..87018db8dce 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" @@ -48,10 +48,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/core-client": "7.0.0-beta.0", - "@storybook/docs-tools": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/core-client": "7.0.0-beta.12", + "@storybook/docs-tools": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "ts-dedent": "^2.0.0", "type-fest": "2.19.0" @@ -67,7 +67,7 @@ "vue": "^3.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -79,5 +79,5 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index 399eccd9dc1..2dde1c1779b 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.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook web-components renderer", "keywords": [ "lit-html", @@ -50,12 +50,12 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/core-client": "7.0.0-beta.0", - "@storybook/docs-tools": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/core-client": "7.0.0-beta.12", + "@storybook/docs-tools": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "global": "^4.4.0", "ts-dedent": "^2.0.0" }, @@ -68,7 +68,7 @@ "lit-html": "^1.4.1 || ^2.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" @@ -80,5 +80,5 @@ ], "platform": "browser" }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/ui/.storybook/main.ts b/code/ui/.storybook/main.ts index 3a5bfda16f3..85d924a0490 100644 --- a/code/ui/.storybook/main.ts +++ b/code/ui/.storybook/main.ts @@ -1,5 +1,5 @@ import pluginTurbosnap from 'vite-plugin-turbosnap'; -import type { StorybookConfig } from '../../frameworks/react-vite/dist'; +import type { StorybookConfig } from '../../frameworks/react-vite'; const isBlocksOnly = process.env.STORYBOOK_BLOCKS_ONLY === 'true'; diff --git a/code/ui/blocks/package.json b/code/ui/blocks/package.json index 6b95b443cd6..ddc546fcc4a 100644 --- a/code/ui/blocks/package.json +++ b/code/ui/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "7.0.0-beta.0", + "version": "7.0.0-beta.12", "description": "Storybook Doc Blocks", "keywords": [ "storybook" @@ -43,16 +43,16 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.0.0-beta.0", - "@storybook/client-logger": "7.0.0-beta.0", - "@storybook/components": "7.0.0-beta.0", - "@storybook/core-events": "7.0.0-beta.0", + "@storybook/channels": "7.0.0-beta.12", + "@storybook/client-logger": "7.0.0-beta.12", + "@storybook/components": "7.0.0-beta.12", + "@storybook/core-events": "7.0.0-beta.12", "@storybook/csf": "next", - "@storybook/docs-tools": "7.0.0-beta.0", - "@storybook/manager-api": "7.0.0-beta.0", - "@storybook/preview-api": "7.0.0-beta.0", - "@storybook/theming": "7.0.0-beta.0", - "@storybook/types": "7.0.0-beta.0", + "@storybook/docs-tools": "7.0.0-beta.12", + "@storybook/manager-api": "7.0.0-beta.12", + "@storybook/preview-api": "7.0.0-beta.12", + "@storybook/theming": "7.0.0-beta.12", + "@storybook/types": "7.0.0-beta.12", "@types/lodash": "^4.14.167", "color-convert": "^2.0.1", "dequal": "^2.0.2", @@ -66,7 +66,7 @@ "util-deprecate": "^1.0.2" }, "devDependencies": { - "@storybook/addon-actions": "7.0.0-beta.0", + "@storybook/addon-actions": "7.0.0-beta.12", "@types/color-convert": "^2.0.0" }, "peerDependencies": { @@ -81,5 +81,5 @@ "./src/index.ts" ] }, - "gitHead": "2e4ddde6a0a291266d91fe6a5ecda767bf119e70" + "gitHead": "dd52c7e8853bc40791deb55e36473c0c18ab5957" } diff --git a/code/ui/blocks/src/blocks/Canvas.stories.tsx b/code/ui/blocks/src/blocks/Canvas.stories.tsx index 764ccd3225c..d54dbb6e6bf 100644 --- a/code/ui/blocks/src/blocks/Canvas.stories.tsx +++ b/code/ui/blocks/src/blocks/Canvas.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { Canvas } from './Canvas'; +import { Canvas, SourceState } from './Canvas'; import { Story as StoryComponent } from './Story'; import * as BooleanStories from '../controls/Boolean.stories'; @@ -25,12 +25,12 @@ export const BasicStory: Story = {}; export const WithSourceOpen: Story = { args: { - withSource: 'open', + withSource: SourceState.OPEN, }, }; export const WithSourceClosed: Story = { args: { - withSource: 'closed', + withSource: SourceState.CLOSED, }, }; @@ -38,7 +38,7 @@ export const WithSourceClosed: Story = { export const WithMdxSource: Story = { name: 'With MDX Source', args: { - withSource: 'open', + withSource: SourceState.OPEN, mdxSource: `const thisIsCustomSource = true; if (isSyntaxHighlighted) { console.log('syntax highlighting is working'); @@ -48,7 +48,7 @@ if (isSyntaxHighlighted) { export const WithoutSource: Story = { args: { - withSource: 'none', + withSource: SourceState.NONE, }, }; diff --git a/code/ui/blocks/src/controls/Color.tsx b/code/ui/blocks/src/controls/Color.tsx index 3fa5a655e22..7f63d74adea 100644 --- a/code/ui/blocks/src/controls/Color.tsx +++ b/code/ui/blocks/src/controls/Color.tsx @@ -214,12 +214,13 @@ const useColorInput = ( const [color, setColor] = useState(() => parseValue(value)); const [colorSpace, setColorSpace] = useState(color?.colorSpace || ColorSpace.HEX); - // Reset state when initialValue becomes undefined (when resetting controls) + // Reset state when initialValue changes (when resetting controls) useEffect(() => { - if (initialValue !== undefined) return; - setValue(''); - setColor(undefined); - setColorSpace(ColorSpace.HEX); + const nextValue = initialValue || ''; + const nextColor = parseValue(nextValue); + setValue(nextValue); + setColor(nextColor); + setColorSpace(nextColor?.colorSpace || ColorSpace.HEX); }, [initialValue]); const realValue = useMemo( diff --git a/code/ui/blocks/src/controls/Files.tsx b/code/ui/blocks/src/controls/Files.tsx index 2354703c291..7daee0082c4 100644 --- a/code/ui/blocks/src/controls/Files.tsx +++ b/code/ui/blocks/src/controls/Files.tsx @@ -1,5 +1,5 @@ +import React, { useEffect, useRef } from 'react'; import type { ChangeEvent, FC } from 'react'; -import React from 'react'; import { styled } from '@storybook/theming'; import { Form } from '@storybook/components'; @@ -39,6 +39,8 @@ export const FilesControl: FC = ({ accept = 'image/*', value, }) => { + const inputElement = useRef(null); + function handleFileChange(e: ChangeEvent) { if (!e.target.files) { return; @@ -48,8 +50,16 @@ export const FilesControl: FC = ({ revokeOldUrls(value); } + // Added useEffect hook to reset the file value when value is null + useEffect(() => { + if (value == null && inputElement.current) { + inputElement.current.value = null; + } + }, [value, name]); + return ( ( - ({ viewMode, layout, panelCount, size: { width, height } }) => { + ({ viewMode, layout, panelCount, width, height }) => { let content; const props = useMemo( @@ -109,7 +107,11 @@ const App = React.memo( } ); -const SizedApp = sizeMe({ monitorHeight: true })(App); +const SizedApp = (props: Omit) => ( + + {({ width, height }) => } + +); App.displayName = 'App'; diff --git a/code/ui/manager/src/components/preview/preview.tsx b/code/ui/manager/src/components/preview/preview.tsx index 41f3f64dcc7..4e1b0c57df2 100644 --- a/code/ui/manager/src/components/preview/preview.tsx +++ b/code/ui/manager/src/components/preview/preview.tsx @@ -71,11 +71,15 @@ const createCanvas = (id: string, baseUrl = 'iframe.html', withLoader = true): A useEffect(() => { if (global.CONFIG_TYPE === 'DEVELOPMENT') { - const channel = addons.getServerChannel(); + try { + const channel = addons.getServerChannel(); - channel.on(PREVIEW_BUILDER_PROGRESS, (options) => { - setProgress(options); - }); + channel.on(PREVIEW_BUILDER_PROGRESS, (options) => { + setProgress(options); + }); + } catch { + // + } } }, []); diff --git a/code/ui/manager/src/components/sidebar/SearchResults.tsx b/code/ui/manager/src/components/sidebar/SearchResults.tsx index 70900134095..fa3afdf1d90 100644 --- a/code/ui/manager/src/components/sidebar/SearchResults.tsx +++ b/code/ui/manager/src/components/sidebar/SearchResults.tsx @@ -199,7 +199,7 @@ export const SearchResults: FC<{ document.addEventListener('keydown', handleEscape); return () => document.removeEventListener('keydown', handleEscape); - }, [enableShortcuts, isLoading]); + }, [closeMenu, enableShortcuts, isLoading]); const mouseOverHandler = useCallback((event: MouseEvent) => { const currentTarget = event.currentTarget as HTMLElement; diff --git a/code/ui/manager/src/settings/index.tsx b/code/ui/manager/src/settings/index.tsx index 6af005aa3c5..3bc72763f72 100644 --- a/code/ui/manager/src/settings/index.tsx +++ b/code/ui/manager/src/settings/index.tsx @@ -74,7 +74,7 @@ const Pages: FC<{ }; document.addEventListener('keydown', handleEscape); return () => document.removeEventListener('keydown', handleEscape); - }, []); + }, [enableShortcuts, onClose]); return ( diff --git a/code/yarn.lock b/code/yarn.lock index b437cbb8c85..11bd752485b 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -431,7 +431,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.0, @babel/core@npm:^7.12.10, @babel/core@npm:^7.12.3, @babel/core@npm:^7.13.16, @babel/core@npm:^7.17.2, @babel/core@npm:^7.17.5, @babel/core@npm:^7.19.6, @babel/core@npm:^7.20.2, @babel/core@npm:^7.3.4, @babel/core@npm:^7.7.5": +"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.0, @babel/core@npm:^7.12.10, @babel/core@npm:^7.12.3, @babel/core@npm:^7.13.16, @babel/core@npm:^7.17.2, @babel/core@npm:^7.17.5, @babel/core@npm:^7.19.6, @babel/core@npm:^7.20.2, @babel/core@npm:^7.20.5, @babel/core@npm:^7.3.4, @babel/core@npm:^7.7.5": version: 7.20.5 resolution: "@babel/core@npm:7.20.5" dependencies: @@ -2369,15 +2369,16 @@ __metadata: linkType: hard "@digitak/esrun@npm:^3.2.2": - version: 3.2.14 - resolution: "@digitak/esrun@npm:3.2.14" + version: 3.2.15 + resolution: "@digitak/esrun@npm:3.2.15" dependencies: "@digitak/grubber": ^3.1.3 chokidar: ^3.5.1 + cuid: ^2.1.8 esbuild: ^0.14.47 bin: esrun: bin.js - checksum: 73bd10e39100476d378fb82174c0d8e32ec5127267079197f0c74ef359f10244efc66a6cea7149d51c25ed9075d277cc01823ea65d035439a868c7a00adbe4bd + checksum: 4fdd9b9687a48272172be0efa8abf4c3913037db941593ce55ed335f6fa5a8796722e87d177ea47cbc8aaf708b0268da8a7cfafed43e5aeb33f4da361409e238 languageName: node linkType: hard @@ -2602,27 +2603,174 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.14.54": - version: 0.14.54 - resolution: "@esbuild/linux-loong64@npm:0.14.54" +"@esbuild/android-arm64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/android-arm64@npm:0.16.10" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/android-arm@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/android-arm@npm:0.16.10" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@esbuild/android-x64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/android-x64@npm:0.16.10" + conditions: os=android & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/darwin-arm64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/darwin-arm64@npm:0.16.10" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/darwin-x64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/darwin-x64@npm:0.16.10" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/freebsd-arm64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/freebsd-arm64@npm:0.16.10" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/freebsd-x64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/freebsd-x64@npm:0.16.10" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/linux-arm64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/linux-arm64@npm:0.16.10" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/linux-arm@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/linux-arm@npm:0.16.10" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@esbuild/linux-ia32@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/linux-ia32@npm:0.16.10" + conditions: os=linux & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/linux-loong64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/linux-loong64@npm:0.16.10" conditions: os=linux & cpu=loong64 languageName: node linkType: hard -"@eslint/eslintrc@npm:^1.3.3": - version: 1.3.3 - resolution: "@eslint/eslintrc@npm:1.3.3" +"@esbuild/linux-mips64el@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/linux-mips64el@npm:0.16.10" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + +"@esbuild/linux-ppc64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/linux-ppc64@npm:0.16.10" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/linux-riscv64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/linux-riscv64@npm:0.16.10" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + +"@esbuild/linux-s390x@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/linux-s390x@npm:0.16.10" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + +"@esbuild/linux-x64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/linux-x64@npm:0.16.10" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/netbsd-x64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/netbsd-x64@npm:0.16.10" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/openbsd-x64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/openbsd-x64@npm:0.16.10" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/sunos-x64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/sunos-x64@npm:0.16.10" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/win32-arm64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/win32-arm64@npm:0.16.10" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/win32-ia32@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/win32-ia32@npm:0.16.10" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/win32-x64@npm:0.16.10": + version: 0.16.10 + resolution: "@esbuild/win32-x64@npm:0.16.10" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@eslint/eslintrc@npm:^1.4.0": + version: 1.4.0 + resolution: "@eslint/eslintrc@npm:1.4.0" dependencies: ajv: ^6.12.4 debug: ^4.3.2 espree: ^9.4.0 - globals: ^13.15.0 + globals: ^13.19.0 ignore: ^5.2.0 import-fresh: ^3.2.1 js-yaml: ^4.1.0 minimatch: ^3.1.2 strip-json-comments: ^3.1.1 - checksum: 78fe61ae304362df50ae20f00cd41744f20b8ee58d59dddbd6db58a6241238217b7ee9591c315ac9f7737075c0277e551f586d44927eb2e84e643c477db8386f + checksum: 88a9161cc4b5abea34cbb1adc5ad8a992b00ece533b25381f4e43348bb917cc01b99f9cb3bd628531fb4ee5e80d700181b28d2a4c7aa92d9d311edb098de9877 languageName: node linkType: hard @@ -2804,14 +2952,14 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.6": - version: 0.11.7 - resolution: "@humanwhocodes/config-array@npm:0.11.7" +"@humanwhocodes/config-array@npm:^0.11.8": + version: 0.11.8 + resolution: "@humanwhocodes/config-array@npm:0.11.8" dependencies: "@humanwhocodes/object-schema": ^1.2.1 debug: ^4.1.1 minimatch: ^3.0.5 - checksum: 88b24aa7ff7ba7f4313de530b7c162cb4bcd75451a7765eb2810b2841c61989f184a1f7ef76f3160df8a8735615fda64075e9da83273190731e5a26e03c6920c + checksum: 441223496cc5ae3ae443e11e2ba05f03f6418d1e0233e3d160b027dda742d7a957fa9e1d56125d5829079419c797c13e1ae8ffe3454f268901ac18f68e0198f1 languageName: node linkType: hard @@ -3343,19 +3491,21 @@ __metadata: languageName: node linkType: hard -"@joshwooding/vite-plugin-react-docgen-typescript@npm:0.0.5, @joshwooding/vite-plugin-react-docgen-typescript@npm:^0.0.5": - version: 0.0.5 - resolution: "@joshwooding/vite-plugin-react-docgen-typescript@npm:0.0.5" +"@joshwooding/vite-plugin-react-docgen-typescript@npm:0.0.0-20221218231544": + version: 0.0.0-20221218231544 + resolution: "@joshwooding/vite-plugin-react-docgen-typescript@npm:0.0.0-20221218231544" dependencies: - "@rollup/pluginutils": ^4.2.1 glob: ^7.2.0 glob-promise: ^4.2.0 magic-string: ^0.26.1 react-docgen-typescript: ^2.1.1 peerDependencies: typescript: ">= 4.3.x" - vite: ">2.0.0-0" - checksum: 075dc5a98122e66ef4203550fb4050a283a0c889d55cce729219b0707ddc703162c07dafd188363e398bdbd5c3604aa9b310d845c37402dffb284ff1669394e1 + vite: ^3.0.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 98e96b97f3020ce56924d0fea3fbab728bdda92b7958c54cbfe508e996fc59020ac5b4a865603cc11ed876e5366133e75875f8664ac2d962aeedf62e732a9e3d languageName: node linkType: hard @@ -3404,7 +3554,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.10": +"@jridgewell/sourcemap-codec@npm:1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.13": version: 1.4.14 resolution: "@jridgewell/sourcemap-codec@npm:1.4.14" checksum: 3fbaff1387c1338b097eeb6ff92890d7838f7de0dde259e4983763b44540bfd5ca6a1f7644dc8ad003a57f7e80670d5b96a8402f1386ba9aee074743ae9bad51 @@ -4246,21 +4396,21 @@ __metadata: linkType: hard "@lit/reactive-element@npm:^1.3.0, @lit/reactive-element@npm:^1.4.0": - version: 1.4.2 - resolution: "@lit/reactive-element@npm:1.4.2" - checksum: 97e73098a9e6d13b65d7df7b8de1bdea752f128dc260923c38ef8e02a849068c4cacca48bac1abf6ef2db56b75b373ae6d1757fb36ba6a6d743bb3014e28005d + version: 1.5.0 + resolution: "@lit/reactive-element@npm:1.5.0" + checksum: fd2cb311ea3f7981abdcaa2e433b9f16bb26f6a507ab86a1185117997ea300988dad3f9d0690199f5559349d492b81d21cfbc81f623cfb07ee155ce424ed9306 languageName: node linkType: hard "@mdx-js/react@npm:^2.1.5": - version: 2.1.5 - resolution: "@mdx-js/react@npm:2.1.5" + version: 2.2.1 + resolution: "@mdx-js/react@npm:2.2.1" dependencies: "@types/mdx": ^2.0.0 "@types/react": ">=16" peerDependencies: react: ">=16" - checksum: dd054aded70f9f098f01fe3daf8234f92b36e2a7e0dca9c918c0fdddd3eac91d1e84e5faf4a227b551143a262ff610edeb2db6367e011fcbf32c265b1c31cce6 + checksum: 897e0a0bb87699db280ef0c2096fd00ea6918dd34084916475104fdc8fbe7f06cc54e7202b2e01c73a8680072454f7c91682cf2f125e088b1f0ac20be7ad3928 languageName: node linkType: hard @@ -4274,100 +4424,107 @@ __metadata: languageName: node linkType: hard -"@next/env@npm:13.0.5": - version: 13.0.5 - resolution: "@next/env@npm:13.0.5" - checksum: 9384acc57a9dcef8817af0d860910bfb0aeac94f29114da47ea3935ca74899a0e1b89afa96cd4b5d7c0dba2db5cd4f1384e05b105ab84b0cb4c266b636173b10 +"@next/env@npm:13.0.7": + version: 13.0.7 + resolution: "@next/env@npm:13.0.7" + checksum: 624a65538d6b459da4fb27b9f714b97e47c03730fd6a876f0adcb278d9888ddae9a46495d9fd1aeb1e8e9084cce0320fb0f0647d122d78b3e16675c07a788eb9 languageName: node linkType: hard -"@next/swc-android-arm-eabi@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-android-arm-eabi@npm:13.0.5" +"@next/font@npm:^13.0.7": + version: 13.0.7 + resolution: "@next/font@npm:13.0.7" + checksum: 16969448435900703df9ee9847ff26d00dd27dd26464786e291b13343cb22f11e394f0a7311ea4d3638dd14cac5ffb98a6f90aea0b75d56f5fc0b8e22c35740f + languageName: node + linkType: hard + +"@next/swc-android-arm-eabi@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-android-arm-eabi@npm:13.0.7" conditions: os=android & cpu=arm languageName: node linkType: hard -"@next/swc-android-arm64@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-android-arm64@npm:13.0.5" +"@next/swc-android-arm64@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-android-arm64@npm:13.0.7" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-arm64@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-darwin-arm64@npm:13.0.5" +"@next/swc-darwin-arm64@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-darwin-arm64@npm:13.0.7" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@next/swc-darwin-x64@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-darwin-x64@npm:13.0.5" +"@next/swc-darwin-x64@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-darwin-x64@npm:13.0.7" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@next/swc-freebsd-x64@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-freebsd-x64@npm:13.0.5" +"@next/swc-freebsd-x64@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-freebsd-x64@npm:13.0.7" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@next/swc-linux-arm-gnueabihf@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-linux-arm-gnueabihf@npm:13.0.5" +"@next/swc-linux-arm-gnueabihf@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-linux-arm-gnueabihf@npm:13.0.7" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@next/swc-linux-arm64-gnu@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-linux-arm64-gnu@npm:13.0.5" +"@next/swc-linux-arm64-gnu@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-linux-arm64-gnu@npm:13.0.7" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-arm64-musl@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-linux-arm64-musl@npm:13.0.5" +"@next/swc-linux-arm64-musl@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-linux-arm64-musl@npm:13.0.7" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@next/swc-linux-x64-gnu@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-linux-x64-gnu@npm:13.0.5" +"@next/swc-linux-x64-gnu@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-linux-x64-gnu@npm:13.0.7" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@next/swc-linux-x64-musl@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-linux-x64-musl@npm:13.0.5" +"@next/swc-linux-x64-musl@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-linux-x64-musl@npm:13.0.7" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@next/swc-win32-arm64-msvc@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-win32-arm64-msvc@npm:13.0.5" +"@next/swc-win32-arm64-msvc@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-win32-arm64-msvc@npm:13.0.7" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@next/swc-win32-ia32-msvc@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-win32-ia32-msvc@npm:13.0.5" +"@next/swc-win32-ia32-msvc@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-win32-ia32-msvc@npm:13.0.7" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@next/swc-win32-x64-msvc@npm:13.0.5": - version: 13.0.5 - resolution: "@next/swc-win32-x64-msvc@npm:13.0.5" +"@next/swc-win32-x64-msvc@npm:13.0.7": + version: 13.0.7 + resolution: "@next/swc-win32-x64-msvc@npm:13.0.7" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -4941,15 +5098,15 @@ __metadata: languageName: node linkType: hard -"@playwright/test@npm:1.28.0": - version: 1.28.0 - resolution: "@playwright/test@npm:1.28.0" +"@playwright/test@npm:1.29.0": + version: 1.29.0 + resolution: "@playwright/test@npm:1.29.0" dependencies: "@types/node": "*" - playwright-core: 1.28.0 + playwright-core: 1.29.0 bin: playwright: cli.js - checksum: f4ec34e050516f250c489499563d767b604d9c219e20abb296e127eb8d891cda4cb4b53205e6e2d0813e98dd18361e0c141d3c1fde1ba521d7a2d24af04723ee + checksum: 272a7d230ba939ee4718d37c83c922af092138eb95605dd4c14c83a90e5f46b4392dbfdca81e53a7192a9f6f0703f99bff6d907a2c780727c5c1af14fc3f3b5f languageName: node linkType: hard @@ -4992,25 +5149,6 @@ __metadata: languageName: node linkType: hard -"@pnpm/network.ca-file@npm:^1.0.1": - version: 1.0.2 - resolution: "@pnpm/network.ca-file@npm:1.0.2" - dependencies: - graceful-fs: 4.2.10 - checksum: 95f6e0e38d047aca3283550719155ce7304ac00d98911e4ab026daedaf640a63bd83e3d13e17c623fa41ac72f3801382ba21260bcce431c14fbbc06430ecb776 - languageName: node - linkType: hard - -"@pnpm/npm-conf@npm:^1.0.4": - version: 1.0.5 - resolution: "@pnpm/npm-conf@npm:1.0.5" - dependencies: - "@pnpm/network.ca-file": ^1.0.1 - config-chain: ^1.1.11 - checksum: b19ff4a1de7f8b6716e27fdf6ff11bf5bd7b8732d1acc22df26a6e274c321ba925bdec4d054241287f3e606475660c98bed09e7eec42846a82670d9533c9333c - languageName: node - linkType: hard - "@popperjs/core@npm:^2.5.4, @popperjs/core@npm:^2.6.0": version: 2.11.6 resolution: "@popperjs/core@npm:2.11.6" @@ -5018,7 +5156,7 @@ __metadata: languageName: node linkType: hard -"@rollup/pluginutils@npm:^4.2.0, @rollup/pluginutils@npm:^4.2.1": +"@rollup/pluginutils@npm:^4.2.0": version: 4.2.1 resolution: "@rollup/pluginutils@npm:4.2.1" dependencies: @@ -5065,9 +5203,9 @@ __metadata: linkType: hard "@sideway/formula@npm:^3.0.0": - version: 3.0.0 - resolution: "@sideway/formula@npm:3.0.0" - checksum: 129cbb01786f0560f58990ba34e352d0f890c5b49fcd27a0c34ccd44ee3c0d8fdc88772cd3e6465e4bc5acd5f7fdd81ad7467ee305f9b02c52f3f7af47354c89 + version: 3.0.1 + resolution: "@sideway/formula@npm:3.0.1" + checksum: 3fe81fa9662efc076bf41612b060eb9b02e846ea4bea5bd114f1662b7f1541e9dedcf98aff0d24400bcb92f113964a50e0290b86e284edbdf6346fa9b7e2bf2c languageName: node linkType: hard @@ -5101,13 +5239,6 @@ __metadata: languageName: node linkType: hard -"@sindresorhus/is@npm:^5.2.0": - version: 5.3.0 - resolution: "@sindresorhus/is@npm:5.3.0" - checksum: 1d9e7d4f5756df7ed18391208abf44a15901aa5d1539ae929636da561e1d75d8dd3dda14a0b49c0df69fb9c3e5dfcaa91cbbb4c6709ea3a9516c2fe1fc5e0ba6 - languageName: node - linkType: hard - "@sinonjs/commons@npm:^1.7.0": version: 1.8.6 resolution: "@sinonjs/commons@npm:1.8.6" @@ -5139,20 +5270,21 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-a11y@workspace:addons/a11y" dependencies: - "@storybook/addon-highlight": 7.0.0-beta.0 - "@storybook/channels": 7.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/addon-highlight": 7.0.0-beta.12 + "@storybook/channels": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@testing-library/react": ^11.2.2 axe-core: ^4.2.0 global: ^4.4.0 lodash: ^4.17.21 - react-sizeme: ^3.0.1 + react-resize-detector: ^7.1.2 + resize-observer-polyfill: ^1.5.1 typescript: ~4.9.3 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -5165,17 +5297,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-actions@7.0.0-beta.0, @storybook/addon-actions@workspace:*, @storybook/addon-actions@workspace:addons/actions": +"@storybook/addon-actions@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/lodash": ^4.14.167 dequal: ^2.0.2 global: ^4.4.0 @@ -5198,17 +5330,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-backgrounds@7.0.0-beta.0, @storybook/addon-backgrounds@workspace:*, @storybook/addon-backgrounds@workspace:addons/backgrounds": +"@storybook/addon-backgrounds@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 global: ^4.4.0 memoizerific: ^1.11.3 ts-dedent: ^2.0.0 @@ -5224,19 +5356,19 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-controls@7.0.0-beta.0, @storybook/addon-controls@workspace:*, @storybook/addon-controls@workspace:addons/controls": +"@storybook/addon-controls@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/blocks": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 lodash: ^4.17.21 ts-dedent: ^2.0.0 peerDependencies: @@ -5250,7 +5382,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-docs@7.0.0-beta.0, @storybook/addon-docs@workspace:*, @storybook/addon-docs@workspace:addons/docs": +"@storybook/addon-docs@7.0.0-beta.12, @storybook/addon-docs@workspace:*, @storybook/addon-docs@workspace:addons/docs": version: 0.0.0-use.local resolution: "@storybook/addon-docs@workspace:addons/docs" dependencies: @@ -5258,16 +5390,16 @@ __metadata: "@babel/plugin-transform-react-jsx": ^7.19.0 "@jest/transform": ^29.3.1 "@mdx-js/react": ^2.1.5 - "@storybook/blocks": 7.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/csf-plugin": 7.0.0-beta.0 - "@storybook/csf-tools": 7.0.0-beta.0 + "@storybook/blocks": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/csf-plugin": 7.0.0-beta.12 + "@storybook/csf-tools": 7.0.0-beta.12 "@storybook/mdx2-csf": next - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/postinstall": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/postinstall": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 fs-extra: ^9.0.1 global: ^4.4.0 react: ^16.14.0 @@ -5286,20 +5418,20 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-essentials@workspace:addons/essentials" dependencies: - "@storybook/addon-actions": 7.0.0-beta.0 - "@storybook/addon-backgrounds": 7.0.0-beta.0 - "@storybook/addon-controls": 7.0.0-beta.0 - "@storybook/addon-docs": 7.0.0-beta.0 - "@storybook/addon-highlight": 7.0.0-beta.0 - "@storybook/addon-measure": 7.0.0-beta.0 - "@storybook/addon-outline": 7.0.0-beta.0 - "@storybook/addon-toolbars": 7.0.0-beta.0 - "@storybook/addon-viewport": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/vue": 7.0.0-beta.0 + "@storybook/addon-actions": 7.0.0-beta.12 + "@storybook/addon-backgrounds": 7.0.0-beta.12 + "@storybook/addon-controls": 7.0.0-beta.12 + "@storybook/addon-docs": 7.0.0-beta.12 + "@storybook/addon-highlight": 7.0.0-beta.12 + "@storybook/addon-measure": 7.0.0-beta.12 + "@storybook/addon-outline": 7.0.0-beta.12 + "@storybook/addon-toolbars": 7.0.0-beta.12 + "@storybook/addon-viewport": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/vue": 7.0.0-beta.12 ts-dedent: ^2.0.0 typescript: ^4.9.3 peerDependencies: @@ -5308,12 +5440,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-highlight@7.0.0-beta.0, @storybook/addon-highlight@workspace:*, @storybook/addon-highlight@workspace:addons/highlight": +"@storybook/addon-highlight@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 "@types/webpack-env": ^1.16.0 global: ^4.4.0 typescript: ~4.9.3 @@ -5325,17 +5457,17 @@ __metadata: resolution: "@storybook/addon-interactions@workspace:addons/interactions" dependencies: "@devtools-ds/object-inspector": ^1.1.2 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/instrumenter": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/instrumenter": 7.0.0-beta.12 "@storybook/jest": ^0.0.10 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 "@storybook/testing-library": 0.0.14-next.0 - "@storybook/theming": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/theming": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/node": ^16.0.0 formik: ^2.2.9 global: ^4.4.0 @@ -5358,14 +5490,14 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-jest@workspace:addons/jest" dependencies: - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 global: ^4.4.0 - react-sizeme: ^3.0.1 + react-resize-detector: ^7.1.2 typescript: ~4.9.3 upath: ^1.2.0 peerDependencies: @@ -5383,13 +5515,13 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-links@workspace:addons/links" dependencies: - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 "@storybook/csf": next - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/router": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/router": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 global: ^4.4.0 prop-types: ^15.7.2 ts-dedent: ^2.0.0 @@ -5405,16 +5537,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-measure@7.0.0-beta.0, @storybook/addon-measure@workspace:*, @storybook/addon-measure@workspace:addons/measure": +"@storybook/addon-measure@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 global: ^4.4.0 typescript: ~4.9.3 peerDependencies: @@ -5428,16 +5560,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-outline@7.0.0-beta.0, @storybook/addon-outline@workspace:*, @storybook/addon-outline@workspace:addons/outline": +"@storybook/addon-outline@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 global: ^4.4.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -5458,15 +5590,15 @@ __metadata: dependencies: "@axe-core/puppeteer": ^4.2.0 "@storybook/csf": next - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/jest-image-snapshot": ^5.1.0 "@types/puppeteer": ^5.4.0 jest-image-snapshot: ^6.0.0 puppeteer: ^2.0.0 || ^3.0.0 rimraf: ^3.0.2 peerDependencies: - "@storybook/addon-storyshots": 7.0.0-beta.0 + "@storybook/addon-storyshots": 7.0.0-beta.12 puppeteer: ">=2.0.0" peerDependenciesMeta: puppeteer: @@ -5482,17 +5614,17 @@ __metadata: "@angular/platform-browser-dynamic": ^13.3.6 "@emotion/jest": ^11.8.0 "@jest/transform": ^29.3.1 - "@storybook/addon-docs": 7.0.0-beta.0 - "@storybook/angular": 7.0.0-beta.0 + "@storybook/addon-docs": 7.0.0-beta.12 + "@storybook/angular": 7.0.0-beta.12 "@storybook/babel-plugin-require-context-hook": 1.0.1 - "@storybook/client-api": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/core-webpack": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/react": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 - "@storybook/vue": 7.0.0-beta.0 - "@storybook/vue3": 7.0.0-beta.0 + "@storybook/client-api": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/core-webpack": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/react": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 + "@storybook/vue": 7.0.0-beta.12 + "@storybook/vue3": 7.0.0-beta.12 "@types/glob": ^7.1.3 "@types/jest-specific-snapshot": ^0.5.6 babel-loader: ^8.3.0 @@ -5567,13 +5699,13 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-storysource@workspace:addons/storysource" dependencies: - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/router": 7.0.0-beta.0 - "@storybook/source-loader": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/router": 7.0.0-beta.12 + "@storybook/source-loader": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 "@types/react": ^16.14.34 "@types/react-syntax-highlighter": 11.0.5 estraverse: ^5.2.0 @@ -5591,31 +5723,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-svelte-csf@npm:^2.0.0": - version: 2.0.10 - resolution: "@storybook/addon-svelte-csf@npm:2.0.10" - dependencies: - ts-dedent: ^2.0.0 - peerDependencies: - "@storybook/svelte": ">=6.4.20" - svelte: ^3.46.6 - svelte-loader: ^3.1.2 - peerDependenciesMeta: - svelte-loader: - optional: true - checksum: fc128896f0d7416fd671d7e392a11ced20f150dbddbac39a2e9f9948145409fdba1380d800a40ffc663a664829e01cffa71d2ec1ec4845c18f804117025a9d85 - languageName: node - linkType: hard - -"@storybook/addon-toolbars@7.0.0-beta.0, @storybook/addon-toolbars@workspace:*, @storybook/addon-toolbars@workspace:addons/toolbars": +"@storybook/addon-toolbars@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 typescript: ~4.9.3 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -5628,16 +5744,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-viewport@7.0.0-beta.0, @storybook/addon-viewport@workspace:*, @storybook/addon-viewport@workspace:addons/viewport": +"@storybook/addon-viewport@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 global: ^4.4.0 memoizerific: ^1.11.3 prop-types: ^15.7.2 @@ -5653,30 +5769,30 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addons@7.0.0-beta.0, @storybook/addons@workspace:*, @storybook/addons@workspace:lib/addons": +"@storybook/addons@7.0.0-beta.12, @storybook/addons@workspace:*, @storybook/addons@workspace:lib/addons": version: 0.0.0-use.local resolution: "@storybook/addons@workspace:lib/addons" dependencies: - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 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/addons@npm:6.5.13": - version: 6.5.13 - resolution: "@storybook/addons@npm:6.5.13" +"@storybook/addons@npm:6.5.14": + version: 6.5.14 + resolution: "@storybook/addons@npm:6.5.14" dependencies: - "@storybook/api": 6.5.13 - "@storybook/channels": 6.5.13 - "@storybook/client-logger": 6.5.13 - "@storybook/core-events": 6.5.13 + "@storybook/api": 6.5.14 + "@storybook/channels": 6.5.14 + "@storybook/client-logger": 6.5.14 + "@storybook/core-events": 6.5.14 "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/router": 6.5.13 - "@storybook/theming": 6.5.13 + "@storybook/router": 6.5.14 + "@storybook/theming": 6.5.14 "@types/webpack-env": ^1.16.0 core-js: ^3.8.2 global: ^4.4.0 @@ -5684,11 +5800,11 @@ __metadata: peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 7700696b40cc692b9827af560351c007a007bc3a309afebaba2c6b6267c9a3305e76c9a5827a70520817e7027f1d58bd92b6377682fb48155282bd237e15c5b3 + checksum: bc4dc3e40252e38d411e59c31bab1de2e298c3b133aabacb47ed8400cae45d0bd77a9987d3c80fdaed565ff3dcfd4df8b47aeb80632fb8d6fbe2a4db782c55f2 languageName: node linkType: hard -"@storybook/angular@7.0.0-beta.0, @storybook/angular@workspace:*, @storybook/angular@workspace:frameworks/angular": +"@storybook/angular@7.0.0-beta.12, @storybook/angular@workspace:*, @storybook/angular@workspace:frameworks/angular": version: 0.0.0-use.local resolution: "@storybook/angular@workspace:frameworks/angular" dependencies: @@ -5704,18 +5820,18 @@ __metadata: "@angular/platform-browser": ^13.3.6 "@angular/platform-browser-dynamic": ^13.3.6 "@nrwl/workspace": 14.6.1 - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/core-client": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/core-server": 7.0.0-beta.0 - "@storybook/core-webpack": 7.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-client": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/core-server": 7.0.0-beta.12 + "@storybook/core-webpack": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/node": ^16.0.0 "@types/react": ^16.14.34 "@types/react-dom": ^16.9.14 @@ -5768,26 +5884,26 @@ __metadata: languageName: unknown linkType: soft -"@storybook/api@7.0.0-beta.0, @storybook/api@workspace:*, @storybook/api@workspace:lib/manager-api-shim": +"@storybook/api@7.0.0-beta.12, @storybook/api@workspace:*, @storybook/api@workspace:lib/manager-api-shim": version: 0.0.0-use.local resolution: "@storybook/api@workspace:lib/manager-api-shim" dependencies: - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 languageName: unknown linkType: soft -"@storybook/api@npm:6.5.13": - version: 6.5.13 - resolution: "@storybook/api@npm:6.5.13" +"@storybook/api@npm:6.5.14": + version: 6.5.14 + resolution: "@storybook/api@npm:6.5.14" dependencies: - "@storybook/channels": 6.5.13 - "@storybook/client-logger": 6.5.13 - "@storybook/core-events": 6.5.13 + "@storybook/channels": 6.5.14 + "@storybook/client-logger": 6.5.14 + "@storybook/core-events": 6.5.14 "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/router": 6.5.13 + "@storybook/router": 6.5.14 "@storybook/semver": ^7.3.2 - "@storybook/theming": 6.5.13 + "@storybook/theming": 6.5.14 core-js: ^3.8.2 fast-deep-equal: ^3.1.3 global: ^4.4.0 @@ -5801,7 +5917,7 @@ __metadata: peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: c30816e95845876694ccca3cc6e37fe2493027447fc607e56709bd55d610ae6b925233566150f09c891ecd1ba04bb6b0d7c0ad928f676b0aa4ca5cf2b11f3f4c + checksum: 38ff67de3ac82ce7dca76c3f5f5dab8f788b935cbd3b65ec7a733509257d7383ebc5988e8e25097b66ad60218dede9165c8963402421a6daa2d5612a14515377 languageName: node linkType: hard @@ -5812,21 +5928,21 @@ __metadata: languageName: node linkType: hard -"@storybook/blocks@7.0.0-beta.0, @storybook/blocks@workspace:*, @storybook/blocks@workspace:ui/blocks": +"@storybook/blocks@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/channels": 7.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 + "@storybook/addon-actions": 7.0.0-beta.12 + "@storybook/channels": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 "@storybook/csf": next - "@storybook/docs-tools": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/docs-tools": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/color-convert": ^2.0.0 "@types/lodash": ^4.14.167 color-convert: ^2.0.1 @@ -5845,19 +5961,19 @@ __metadata: languageName: unknown linkType: soft -"@storybook/builder-manager@7.0.0-beta.0, @storybook/builder-manager@workspace:*, @storybook/builder-manager@workspace:lib/builder-manager": +"@storybook/builder-manager@7.0.0-beta.12, @storybook/builder-manager@workspace:*, @storybook/builder-manager@workspace:lib/builder-manager": version: 0.0.0-use.local resolution: "@storybook/builder-manager@workspace:lib/builder-manager" dependencies: "@fal-works/esbuild-plugin-global-externals": ^2.1.2 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/manager": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/manager": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 "@types/ejs": ^3.1.1 "@yarnpkg/esbuild-plugin-pnp": ^3.0.0-rc.10 browser-assert: ^1.2.1 ejs: ^3.1.8 - esbuild: ^0.14.48 + esbuild: ^0.16.4 esbuild-plugin-alias: ^0.2.1 express: ^4.17.3 fs-extra: ^9.0.1 @@ -5868,22 +5984,20 @@ __metadata: languageName: unknown linkType: soft -"@storybook/builder-vite@7.0.0-beta.0, @storybook/builder-vite@workspace:*, @storybook/builder-vite@workspace:lib/builder-vite": +"@storybook/builder-vite@7.0.0-beta.12, @storybook/builder-vite@workspace:*, @storybook/builder-vite@workspace:lib/builder-vite": version: 0.0.0-use.local resolution: "@storybook/builder-vite@workspace:lib/builder-vite" dependencies: - "@joshwooding/vite-plugin-react-docgen-typescript": 0.0.5 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/csf-plugin": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/csf-plugin": 7.0.0-beta.12 "@storybook/mdx2-csf": next - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/preview": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/preview": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/express": ^4.17.13 "@types/node": ^16.0.0 - "@vitejs/plugin-react": ^2.0.0 browser-assert: ^1.2.1 es-module-lexer: ^0.9.3 express: ^4.17.3 @@ -5895,41 +6009,45 @@ __metadata: rollup-plugin-external-globals: ^0.7.1 slash: ^3.0.0 typescript: ~4.9.3 - vite: ^3.1.3 + vite: ^4.0.0 peerDependencies: "@preact/preset-vite": "*" + typescript: ">= 4.3.x" + vite: ^3.0.0 || ^4.0.0 vite-plugin-glimmerx: "*" peerDependenciesMeta: "@preact/preset-vite": optional: true + typescript: + optional: true vite-plugin-glimmerx: optional: true languageName: unknown linkType: soft -"@storybook/builder-webpack5@7.0.0-beta.0, @storybook/builder-webpack5@workspace:*, @storybook/builder-webpack5@workspace:lib/builder-webpack5": +"@storybook/builder-webpack5@7.0.0-beta.12, @storybook/builder-webpack5@workspace:*, @storybook/builder-webpack5@workspace:lib/builder-webpack5": version: 0.0.0-use.local resolution: "@storybook/builder-webpack5@workspace:lib/builder-webpack5" dependencies: "@babel/core": ^7.12.10 - "@storybook/addons": 7.0.0-beta.0 - "@storybook/api": 7.0.0-beta.0 - "@storybook/channel-postmessage": 7.0.0-beta.0 - "@storybook/channel-websocket": 7.0.0-beta.0 - "@storybook/channels": 7.0.0-beta.0 - "@storybook/client-api": 7.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/core-webpack": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/preview": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/router": 7.0.0-beta.0 - "@storybook/store": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 + "@storybook/addons": 7.0.0-beta.12 + "@storybook/api": 7.0.0-beta.12 + "@storybook/channel-postmessage": 7.0.0-beta.12 + "@storybook/channel-websocket": 7.0.0-beta.12 + "@storybook/channels": 7.0.0-beta.12 + "@storybook/client-api": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/core-webpack": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/preview": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/router": 7.0.0-beta.12 + "@storybook/store": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 "@types/node": ^16.0.0 "@types/pretty-hrtime": ^1.0.0 "@types/semver": ^7.3.4 @@ -5970,13 +6088,13 @@ __metadata: languageName: unknown linkType: soft -"@storybook/channel-postmessage@7.0.0-beta.0, @storybook/channel-postmessage@workspace:*, @storybook/channel-postmessage@workspace:lib/channel-postmessage": +"@storybook/channel-postmessage@7.0.0-beta.12, @storybook/channel-postmessage@workspace:*, @storybook/channel-postmessage@workspace:lib/channel-postmessage": version: 0.0.0-use.local resolution: "@storybook/channel-postmessage@workspace:lib/channel-postmessage" dependencies: - "@storybook/channels": 7.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 + "@storybook/channels": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 global: ^4.4.0 qs: ^6.10.0 telejson: ^7.0.3 @@ -5984,19 +6102,19 @@ __metadata: languageName: unknown linkType: soft -"@storybook/channel-websocket@7.0.0-beta.0, @storybook/channel-websocket@workspace:*, @storybook/channel-websocket@workspace:lib/channel-websocket": +"@storybook/channel-websocket@7.0.0-beta.12, @storybook/channel-websocket@workspace:*, @storybook/channel-websocket@workspace:lib/channel-websocket": version: 0.0.0-use.local resolution: "@storybook/channel-websocket@workspace:lib/channel-websocket" dependencies: - "@storybook/channels": 7.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 + "@storybook/channels": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 global: ^4.4.0 telejson: ^7.0.3 typescript: ~4.9.3 languageName: unknown linkType: soft -"@storybook/channels@7.0.0-beta.0, @storybook/channels@workspace:*, @storybook/channels@workspace:lib/channels": +"@storybook/channels@7.0.0-beta.12, @storybook/channels@workspace:*, @storybook/channels@workspace:lib/channels": version: 0.0.0-use.local resolution: "@storybook/channels@workspace:lib/channels" dependencies: @@ -6004,37 +6122,36 @@ __metadata: languageName: unknown linkType: soft -"@storybook/channels@npm:6.5.13": - version: 6.5.13 - resolution: "@storybook/channels@npm:6.5.13" +"@storybook/channels@npm:6.5.14": + version: 6.5.14 + resolution: "@storybook/channels@npm:6.5.14" dependencies: core-js: ^3.8.2 ts-dedent: ^2.0.0 util-deprecate: ^1.0.2 - checksum: 0d1c58a3e528272d066996a232f3693ed8fbdbcd7c8e5e8b2ae211a22ac7b0359f43f234f0df453cd6aab6aa0cdfc227e7e953cbe2a584e2395f36604ede7fd1 + checksum: c047318f7f2b08e60e4f0fde5b68f88214c2ef070d32fd3fc8ea9734c7deefd6e83c5b274a1176f2fda6523b1e9ce7bcac632559fb20bb14c58d2099d664353d languageName: node linkType: hard -"@storybook/cli@7.0.0-beta.0, @storybook/cli@workspace:*, @storybook/cli@workspace:lib/cli": +"@storybook/cli@7.0.0-beta.12, @storybook/cli@workspace:*, @storybook/cli@workspace:lib/cli": version: 0.0.0-use.local resolution: "@storybook/cli@workspace:lib/cli" dependencies: "@babel/core": ^7.20.2 "@babel/preset-env": ^7.20.2 - "@storybook/client-api": 7.0.0-beta.0 - "@storybook/codemod": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/core-server": 7.0.0-beta.0 - "@storybook/csf-tools": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/telemetry": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/client-api": 7.0.0-beta.12 + "@storybook/codemod": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/core-server": 7.0.0-beta.12 + "@storybook/csf-tools": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/telemetry": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/cross-spawn": ^6.0.2 "@types/prompts": ^2.0.9 "@types/puppeteer-core": ^2.1.0 "@types/semver": ^7.3.4 "@types/shelljs": ^0.8.7 - "@types/update-notifier": ^6.0.1 "@types/util-deprecate": ^1.0.0 boxen: ^5.1.2 chalk: ^4.1.0 @@ -6056,10 +6173,10 @@ __metadata: read-pkg-up: ^7.0.1 semver: ^7.3.7 shelljs: ^0.8.5 + simple-update-notifier: ^1.0.0 strip-json-comments: ^3.1.1 ts-dedent: ^2.0.0 typescript: ~4.9.3 - update-notifier: ^6.0.2 util-deprecate: ^1.0.2 bin: getstorybook: ./bin/index.js @@ -6067,16 +6184,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/client-api@7.0.0-beta.0, @storybook/client-api@workspace:*, @storybook/client-api@workspace:lib/client-api": +"@storybook/client-api@7.0.0-beta.12, @storybook/client-api@workspace:*, @storybook/client-api@workspace:lib/client-api": version: 0.0.0-use.local resolution: "@storybook/client-api@workspace:lib/client-api" dependencies: - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 languageName: unknown linkType: soft -"@storybook/client-logger@7.0.0-beta.0, @storybook/client-logger@workspace:*, @storybook/client-logger@workspace:lib/client-logger": +"@storybook/client-logger@7.0.0-beta.12, @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: @@ -6085,25 +6202,27 @@ __metadata: languageName: unknown linkType: soft -"@storybook/client-logger@npm:6.5.13, @storybook/client-logger@npm:^6.4.0": - version: 6.5.13 - resolution: "@storybook/client-logger@npm:6.5.13" +"@storybook/client-logger@npm:6.5.14, @storybook/client-logger@npm:^6.4.0": + version: 6.5.14 + resolution: "@storybook/client-logger@npm:6.5.14" dependencies: core-js: ^3.8.2 global: ^4.4.0 - checksum: 54f2e2738b4e07b0a9ad4e37f45461311ad9db1dd4a5e89bddbbd93363ae91f4f801fd49064e548185cb4683c44e564c5f77e3ea28319d8cc5bd4e75794c26fc + checksum: 5e12f1fcdc5547236324fcd86d5009827f033ae37ad3006ad269a285fd9a9ba904420ce71f382b5c46ae65d7125d9b7ed1201123e243a0395245aec17a049330 languageName: node linkType: hard -"@storybook/codemod@7.0.0-beta.0, @storybook/codemod@workspace:*, @storybook/codemod@workspace:lib/codemod": +"@storybook/codemod@7.0.0-beta.12, @storybook/codemod@workspace:*, @storybook/codemod@workspace:lib/codemod": version: 0.0.0-use.local resolution: "@storybook/codemod@workspace:lib/codemod" dependencies: + "@babel/preset-env": ^7.20.2 "@babel/types": ^7.20.2 "@storybook/csf": next - "@storybook/csf-tools": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/csf-tools": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 + "@types/jscodeshift": ^0.11.6 cross-spawn: ^7.0.3 globby: ^11.0.2 jest: ^29.3.1 @@ -6117,15 +6236,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/components@7.0.0-beta.0, @storybook/components@workspace:*, @storybook/components@workspace:ui/components": +"@storybook/components@7.0.0-beta.12, @storybook/components@workspace:*, @storybook/components@workspace:ui/components": version: 0.0.0-use.local resolution: "@storybook/components@workspace:ui/components" dependencies: "@popperjs/core": ^2.6.0 - "@storybook/client-logger": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 "@storybook/csf": next - "@storybook/theming": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/theming": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/overlayscrollbars": ^1.12.0 "@types/react-syntax-highlighter": 11.0.5 "@types/util-deprecate": ^1.0.0 @@ -6147,22 +6266,22 @@ __metadata: languageName: unknown linkType: soft -"@storybook/core-client@7.0.0-beta.0, @storybook/core-client@workspace:*, @storybook/core-client@workspace:lib/core-client": +"@storybook/core-client@7.0.0-beta.12, @storybook/core-client@workspace:*, @storybook/core-client@workspace:lib/core-client": version: 0.0.0-use.local resolution: "@storybook/core-client@workspace:lib/core-client" dependencies: - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 languageName: unknown linkType: soft -"@storybook/core-common@7.0.0-beta.0, @storybook/core-common@workspace:*, @storybook/core-common@workspace:lib/core-common": +"@storybook/core-common@7.0.0-beta.12, @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: "@babel/core": ^7.20.2 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/babel__core": ^7.1.20 "@types/express": ^4.7.0 "@types/mock-fs": ^4.13.1 @@ -6170,7 +6289,7 @@ __metadata: "@types/picomatch": ^2.3.0 "@types/pretty-hrtime": ^1.0.0 chalk: ^4.1.0 - esbuild: ^0.14.48 + esbuild: ^0.16.4 esbuild-register: ^3.3.3 express: ^4.17.3 file-system-cache: ^2.0.0 @@ -6188,13 +6307,10 @@ __metadata: ts-dedent: ^2.0.0 type-fest: ^2.19.0 typescript: ~4.9.3 - peerDependenciesMeta: - typescript: - optional: true languageName: unknown linkType: soft -"@storybook/core-events@7.0.0-beta.0, @storybook/core-events@workspace:*, @storybook/core-events@workspace:lib/core-events": +"@storybook/core-events@7.0.0-beta.12, @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: @@ -6202,32 +6318,31 @@ __metadata: languageName: unknown linkType: soft -"@storybook/core-events@npm:6.5.13": - version: 6.5.13 - resolution: "@storybook/core-events@npm:6.5.13" +"@storybook/core-events@npm:6.5.14": + version: 6.5.14 + resolution: "@storybook/core-events@npm:6.5.14" dependencies: core-js: ^3.8.2 - checksum: 35333de8a10765609b0a4eb6fe1e5c3d93913b7284233852d6aa9564967118e54eb6fe237fdbb7040da3e255d7a8f3e8243e4bf38381afd0ac0107166bf57870 + checksum: 497e60a6063ce5ffa35781dafc28d57a63b0d8dda6f91d2ee20b2d1729450cabbd6e6e945c5ef104cbf7710577214f4decc7388cd348fb556c1cc19a143d9b77 languageName: node linkType: hard -"@storybook/core-server@7.0.0-beta.0, @storybook/core-server@workspace:*, @storybook/core-server@workspace:lib/core-server": +"@storybook/core-server@7.0.0-beta.12, @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.88 "@discoveryjs/json-ext": ^0.5.3 - "@storybook/builder-manager": 7.0.0-beta.0 - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 + "@storybook/builder-manager": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 "@storybook/csf": next - "@storybook/csf-tools": 7.0.0-beta.0 + "@storybook/csf-tools": 7.0.0-beta.12 "@storybook/docs-mdx": next - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/telemetry": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/telemetry": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/compression": ^1.7.0 "@types/ip": ^1.1.0 "@types/node": ^16.0.0 @@ -6263,26 +6378,17 @@ __metadata: typescript: ~4.9.3 util-deprecate: ^1.0.2 watchpack: ^2.2.0 - webpack: 5 ws: ^8.2.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - "@storybook/builder-webpack5": - optional: true - typescript: - optional: true languageName: unknown linkType: soft -"@storybook/core-webpack@7.0.0-beta.0, @storybook/core-webpack@workspace:*, @storybook/core-webpack@workspace:lib/core-webpack": +"@storybook/core-webpack@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/node": ^16.0.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -6290,17 +6396,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/csf-plugin@7.0.0-beta.0, @storybook/csf-plugin@workspace:*, @storybook/csf-plugin@workspace:lib/csf-plugin": +"@storybook/csf-plugin@7.0.0-beta.12, @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.0.0-beta.0 + "@storybook/csf-tools": 7.0.0-beta.12 typescript: ~4.9.3 unplugin: ^0.10.2 languageName: unknown linkType: soft -"@storybook/csf-tools@7.0.0-beta.0, @storybook/csf-tools@workspace:*, @storybook/csf-tools@workspace:lib/csf-tools": +"@storybook/csf-tools@7.0.0-beta.12, @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: @@ -6309,7 +6415,7 @@ __metadata: "@babel/traverse": ^7.20.1 "@babel/types": ^7.20.2 "@storybook/csf": next - "@storybook/types": 7.0.0-beta.0 + "@storybook/types": 7.0.0-beta.12 "@types/fs-extra": ^9.0.6 fs-extra: ^9.0.1 js-yaml: ^3.14.1 @@ -6337,31 +6443,31 @@ __metadata: linkType: hard "@storybook/csf@npm:next": - version: 0.0.2-next.7 - resolution: "@storybook/csf@npm:0.0.2-next.7" + version: 0.0.2-next.8 + resolution: "@storybook/csf@npm:0.0.2-next.8" dependencies: expect-type: ^0.14.2 lodash: ^4.17.15 type-fest: ^2.19.0 - checksum: 3920626fdd6dc4875ba95ae46fa0776051f544a479029ee7d561b87602511010161750a42b0d5e1371ec336b47262e1098524c834805ca686d9bc2de5cae0e4e + checksum: 86f5599c030b87cbab6fa5e4b4a9ef1aeed5e838b993b2bae5f0fc50d79ae80d5cfbf2590a05bae0a95068ef77eec88d8c102072d63c77745afe74f91cfa03a3 languageName: node linkType: hard "@storybook/docs-mdx@npm:next": - version: 0.0.1-next.4 - resolution: "@storybook/docs-mdx@npm:0.0.1-next.4" - checksum: 111cc2948feb94800b3b245689c6595049f8a0dcc7bcc17d33676cbb48759bee9470980224d8f4a9600c840ae908f2f95f44c79f1b53f4a41990344ab32be545 + version: 0.0.1-next.5 + resolution: "@storybook/docs-mdx@npm:0.0.1-next.5" + checksum: ef2a477fc9a23e6d8b27af365510d5a4a4f2a71ce89f12562eaf8d12df5393faad6f6e35673fc183aa117f61c068beea6f323f3f7a4cdf7d67d12f064340e151 languageName: node linkType: hard -"@storybook/docs-tools@7.0.0-beta.0, @storybook/docs-tools@workspace:*, @storybook/docs-tools@workspace:lib/docs-tools": +"@storybook/docs-tools@7.0.0-beta.12, @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.12.10 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 doctrine: ^3.0.0 jest-specific-snapshot: ^7.0.0 lodash: ^4.17.21 @@ -6374,11 +6480,11 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/ember@workspace:frameworks/ember" dependencies: - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 ember-source: ~3.28.1 global: ^4.4.0 read-pkg-up: ^7.0.1 @@ -6417,19 +6523,18 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/html-vite@workspace:frameworks/html-vite" dependencies: - "@storybook/addons": 7.0.0-beta.0 - "@storybook/builder-vite": 7.0.0-beta.0 - "@storybook/channel-postmessage": 7.0.0-beta.0 - "@storybook/channel-websocket": 7.0.0-beta.0 - "@storybook/client-api": 7.0.0-beta.0 - "@storybook/core-server": 7.0.0-beta.0 - "@storybook/html": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/preview-web": 7.0.0-beta.0 + "@storybook/addons": 7.0.0-beta.12 + "@storybook/builder-vite": 7.0.0-beta.12 + "@storybook/channel-postmessage": 7.0.0-beta.12 + "@storybook/channel-websocket": 7.0.0-beta.12 + "@storybook/client-api": 7.0.0-beta.12 + "@storybook/core-server": 7.0.0-beta.12 + "@storybook/html": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/preview-web": 7.0.0-beta.12 "@types/node": ^16.0.0 magic-string: ^0.26.1 typescript: ~4.9.3 - vite: ^3.1.0 languageName: unknown linkType: soft @@ -6437,10 +6542,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/html-webpack5@workspace:frameworks/html-webpack5" dependencies: - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/html": 7.0.0-beta.0 - "@storybook/preset-html-webpack": 7.0.0-beta.0 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/html": 7.0.0-beta.12 + "@storybook/preset-html-webpack": 7.0.0-beta.12 "@types/node": ^16.0.0 global: ^4.4.0 typescript: ~4.9.3 @@ -6451,14 +6556,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/html@7.0.0-beta.0, @storybook/html@workspace:*, @storybook/html@workspace:renderers/html": +"@storybook/html@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/core-client": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 global: ^4.4.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 @@ -6467,14 +6572,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/instrumenter@7.0.0-beta.0, @storybook/instrumenter@workspace:*, @storybook/instrumenter@workspace:lib/instrumenter": +"@storybook/instrumenter@7.0.0-beta.12, @storybook/instrumenter@workspace:*, @storybook/instrumenter@workspace:lib/instrumenter": version: 0.0.0-use.local resolution: "@storybook/instrumenter@workspace:lib/instrumenter" dependencies: - "@storybook/channels": 7.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 + "@storybook/channels": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 core-js: ^3.8.2 global: ^4.4.0 typescript: ~4.9.3 @@ -6482,15 +6587,15 @@ __metadata: linkType: soft "@storybook/instrumenter@npm:^6.4.0": - version: 6.5.13 - resolution: "@storybook/instrumenter@npm:6.5.13" + version: 6.5.14 + resolution: "@storybook/instrumenter@npm:6.5.14" dependencies: - "@storybook/addons": 6.5.13 - "@storybook/client-logger": 6.5.13 - "@storybook/core-events": 6.5.13 + "@storybook/addons": 6.5.14 + "@storybook/client-logger": 6.5.14 + "@storybook/core-events": 6.5.14 core-js: ^3.8.2 global: ^4.4.0 - checksum: 506a8a90906df864bee3d0fef9a84ea5a635fc3758829c220822fff8ebd21b6504e2f49b15c5afb22e164dd558f1cca63d258d35830ec269d9f03077c8db3ec6 + checksum: b0f49d2a0c24ab959d75cffe5d9a18a4ee1b77f25b6452c6557c55a832fb80698c12da9f76148527b5705bf1136350fa16cd8964f287bc87316e47e27e0ccd50 languageName: node linkType: hard @@ -6561,18 +6666,18 @@ __metadata: languageName: node linkType: hard -"@storybook/manager-api@7.0.0-beta.0, @storybook/manager-api@workspace:*, @storybook/manager-api@workspace:lib/manager-api": +"@storybook/manager-api@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 + "@storybook/channels": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 "@storybook/csf": next - "@storybook/router": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/router": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/lodash": ^4.14.167 "@types/qs": ^6 dequal: ^2.0.2 @@ -6592,23 +6697,23 @@ __metadata: languageName: unknown linkType: soft -"@storybook/manager@7.0.0-beta.0, @storybook/manager@workspace:*, @storybook/manager@workspace:ui/manager": +"@storybook/manager@7.0.0-beta.12, @storybook/manager@workspace:*, @storybook/manager@workspace:ui/manager": version: 0.0.0-use.local resolution: "@storybook/manager@workspace:ui/manager" dependencies: "@fal-works/esbuild-plugin-global-externals": ^2.1.2 - "@storybook/addons": 7.0.0-beta.0 - "@storybook/api": 7.0.0-beta.0 - "@storybook/channel-postmessage": 7.0.0-beta.0 - "@storybook/channel-websocket": 7.0.0-beta.0 - "@storybook/channels": 7.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/components": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/router": 7.0.0-beta.0 - "@storybook/theming": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/addons": 7.0.0-beta.12 + "@storybook/api": 7.0.0-beta.12 + "@storybook/channel-postmessage": 7.0.0-beta.12 + "@storybook/channel-websocket": 7.0.0-beta.12 + "@storybook/channels": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/components": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/router": 7.0.0-beta.12 + "@storybook/theming": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@testing-library/react": ^11.2.2 "@types/semver": ^7.3.4 copy-to-clipboard: ^3.3.1 @@ -6626,7 +6731,7 @@ __metadata: react-dom: ^16.8.0 react-draggable: ^4.4.3 react-helmet-async: ^1.0.7 - react-sizeme: ^3.0.1 + react-resize-detector: ^7.1.2 resolve-from: ^5.0.0 semver: ^7.3.7 store2: ^2.14.2 @@ -6636,11 +6741,9 @@ __metadata: linkType: soft "@storybook/mdx2-csf@npm:next": - version: 0.1.0-next.7 - resolution: "@storybook/mdx2-csf@npm:0.1.0-next.7" - dependencies: - loader-utils: ^2.0.4 - checksum: c0d3b6c5d2261079ac8db0e2bb8e773ab11f6f363c60f4d4b76332c1361c981d5abffd49ea6f2e1b67f5d1fbdfc121e207044fe52b8be1e8322cacc42e41f747 + version: 1.0.0-next.2 + resolution: "@storybook/mdx2-csf@npm:1.0.0-next.2" + checksum: ebf285ee9bb27912c7e3795ef2d155d555c0f7ade15fa38b2c9e15cd590143299b890663bb2e22438ba806aaba232ead1e025ba566540d6f86047c1c2b2b44ec languageName: node linkType: hard @@ -6648,13 +6751,17 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/nextjs@workspace:frameworks/nextjs" dependencies: - "@storybook/addon-actions": 7.0.0-beta.0 - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/preset-react-webpack": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/react": 7.0.0-beta.0 + "@babel/core": ^7.20.5 + "@babel/types": ^7.20.5 + "@next/font": ^13.0.7 + "@storybook/addon-actions": 7.0.0-beta.12 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/preset-react-webpack": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/react": 7.0.0-beta.12 + "@types/babel__core": ^7 "@types/node": ^16.0.0 find-up: ^5.0.0 fs-extra: ^9.0.1 @@ -6673,7 +6780,6 @@ __metadata: webpack: ^5.65.0 peerDependencies: "@babel/core": ^7.11.5 - "@storybook/addon-actions": 7.0.0-alpha.43 next: ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -6688,7 +6794,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/node-logger@7.0.0-beta.0, @storybook/node-logger@workspace:*, @storybook/node-logger@workspace:lib/node-logger": +"@storybook/node-logger@7.0.0-beta.12, @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: @@ -6701,7 +6807,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/postinstall@7.0.0-beta.0, @storybook/postinstall@workspace:*, @storybook/postinstall@workspace:lib/postinstall": +"@storybook/postinstall@7.0.0-beta.12, @storybook/postinstall@workspace:*, @storybook/postinstall@workspace:lib/postinstall": version: 0.0.0-use.local resolution: "@storybook/postinstall@workspace:lib/postinstall" dependencies: @@ -6716,10 +6822,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/preact-webpack5@workspace:frameworks/preact-webpack5" dependencies: - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/preact": 7.0.0-beta.0 - "@storybook/preset-preact-webpack": 7.0.0-beta.0 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/preact": 7.0.0-beta.12 + "@storybook/preset-preact-webpack": 7.0.0-beta.12 "@types/node": ^16.0.0 preact: ^10.5.13 typescript: ~4.9.3 @@ -6731,13 +6837,13 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preact@7.0.0-beta.0, @storybook/preact@workspace:*, @storybook/preact@workspace:renderers/preact": +"@storybook/preact@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/core-client": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 global: ^4.4.0 preact: ^10.5.13 ts-dedent: ^2.0.0 @@ -6747,11 +6853,11 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-html-webpack@7.0.0-beta.0, @storybook/preset-html-webpack@workspace:*, @storybook/preset-html-webpack@workspace:presets/html-webpack": +"@storybook/preset-html-webpack@7.0.0-beta.12, @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.0.0-beta.0 + "@storybook/core-webpack": 7.0.0-beta.12 "@types/node": ^16.0.0 html-loader: ^3.1.0 typescript: ~4.9.3 @@ -6761,12 +6867,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-preact-webpack@7.0.0-beta.0, @storybook/preset-preact-webpack@workspace:*, @storybook/preset-preact-webpack@workspace:presets/preact-webpack": +"@storybook/preset-preact-webpack@7.0.0-beta.12, @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.19.0 - "@storybook/core-webpack": 7.0.0-beta.0 + "@storybook/core-webpack": 7.0.0-beta.12 "@types/node": ^16.0.0 preact: ^10.5.13 typescript: ~4.9.3 @@ -6776,17 +6882,17 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-react-webpack@7.0.0-beta.0, @storybook/preset-react-webpack@workspace:*, @storybook/preset-react-webpack@workspace:presets/react-webpack": +"@storybook/preset-react-webpack@7.0.0-beta.12, @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.18.6 "@babel/preset-react": ^7.18.6 "@pmmmwh/react-refresh-webpack-plugin": ^0.5.5 - "@storybook/core-webpack": 7.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/react": 7.0.0-beta.0 + "@storybook/core-webpack": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/react": 7.0.0-beta.12 "@storybook/react-docgen-typescript-plugin": 1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0 "@types/node": ^16.0.0 "@types/semver": ^7.3.4 @@ -6809,13 +6915,13 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-server-webpack@7.0.0-beta.0, @storybook/preset-server-webpack@workspace:*, @storybook/preset-server-webpack@workspace:presets/server-webpack": +"@storybook/preset-server-webpack@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/core-webpack": 7.0.0-beta.0 - "@storybook/server": 7.0.0-beta.0 + "@storybook/core-server": 7.0.0-beta.12 + "@storybook/core-webpack": 7.0.0-beta.12 + "@storybook/server": 7.0.0-beta.12 "@types/node": ^16.0.0 fs-extra: ^9.0.1 global: ^4.4.0 @@ -6828,12 +6934,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-svelte-webpack@7.0.0-beta.0, @storybook/preset-svelte-webpack@workspace:*, @storybook/preset-svelte-webpack@workspace:presets/svelte-webpack": +"@storybook/preset-svelte-webpack@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 + "@storybook/core-webpack": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 svelte: ^3.31.2 svelte-loader: ^3.1.2 sveltedoc-parser: ^4.2.1 @@ -6846,12 +6952,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-vue-webpack@7.0.0-beta.0, @storybook/preset-vue-webpack@workspace:*, @storybook/preset-vue-webpack@workspace:presets/vue-webpack": +"@storybook/preset-vue-webpack@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 + "@storybook/core-webpack": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 "@types/node": ^16.0.0 ts-loader: ^9.2.8 typescript: ~4.9.3 @@ -6871,12 +6977,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-vue3-webpack@7.0.0-beta.0, @storybook/preset-vue3-webpack@workspace:*, @storybook/preset-vue3-webpack@workspace:presets/vue3-webpack": +"@storybook/preset-vue3-webpack@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 + "@storybook/core-webpack": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 "@types/node": ^16.0.0 "@vue/compiler-sfc": ^3.2.33 ts-loader: ^9.2.8 @@ -6894,14 +7000,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preset-web-components-webpack@7.0.0-beta.0, @storybook/preset-web-components-webpack@workspace:*, @storybook/preset-web-components-webpack@workspace:presets/web-components-webpack": +"@storybook/preset-web-components-webpack@7.0.0-beta.12, @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.20.2 - "@storybook/core-webpack": 7.0.0-beta.0 + "@storybook/core-webpack": 7.0.0-beta.12 "@types/node": ^16.0.0 babel-loader: ^7.0.0 || ^8.0.0 babel-plugin-bundled-import-meta: ^0.3.1 @@ -6912,18 +7018,18 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preview-api@7.0.0-beta.0, @storybook/preview-api@workspace:*, @storybook/preview-api@workspace:lib/preview-api": +"@storybook/preview-api@7.0.0-beta.12, @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": ^26.6.2 - "@storybook/channel-postmessage": 7.0.0-beta.0 - "@storybook/channels": 7.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 + "@storybook/channel-postmessage": 7.0.0-beta.12 + "@storybook/channels": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 "@storybook/csf": next - "@storybook/types": 7.0.0-beta.0 + "@storybook/types": 7.0.0-beta.12 "@types/qs": ^6.9.5 ansi-to-html: ^0.6.11 dequal: ^2.0.2 @@ -6939,25 +7045,25 @@ __metadata: languageName: unknown linkType: soft -"@storybook/preview-web@7.0.0-beta.0, @storybook/preview-web@workspace:*, @storybook/preview-web@workspace:lib/preview-web": +"@storybook/preview-web@7.0.0-beta.12, @storybook/preview-web@workspace:*, @storybook/preview-web@workspace:lib/preview-web": version: 0.0.0-use.local resolution: "@storybook/preview-web@workspace:lib/preview-web" dependencies: - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 languageName: unknown linkType: soft -"@storybook/preview@7.0.0-beta.0, @storybook/preview@workspace:*, @storybook/preview@workspace:lib/preview": +"@storybook/preview@7.0.0-beta.12, @storybook/preview@workspace:*, @storybook/preview@workspace:lib/preview": version: 0.0.0-use.local resolution: "@storybook/preview@workspace:lib/preview" dependencies: - "@storybook/channel-postmessage": 7.0.0-beta.0 - "@storybook/channel-websocket": 7.0.0-beta.0 - "@storybook/channels": 7.0.0-beta.0 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/core-events": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 + "@storybook/channel-postmessage": 7.0.0-beta.12 + "@storybook/channel-websocket": 7.0.0-beta.12 + "@storybook/channels": 7.0.0-beta.12 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-events": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 typescript: ~4.9.3 languageName: unknown linkType: soft @@ -6984,20 +7090,21 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/react-vite@workspace:frameworks/react-vite" dependencies: - "@joshwooding/vite-plugin-react-docgen-typescript": ^0.0.5 + "@joshwooding/vite-plugin-react-docgen-typescript": 0.0.0-20221218231544 "@rollup/pluginutils": ^4.2.0 - "@storybook/builder-vite": 7.0.0-beta.0 - "@storybook/react": 7.0.0-beta.0 + "@storybook/builder-vite": 7.0.0-beta.12 + "@storybook/react": 7.0.0-beta.12 "@types/node": ^16.0.0 - "@vitejs/plugin-react": ^2.0.0 + "@vitejs/plugin-react": ^3.0.0 ast-types: ^0.14.2 magic-string: ^0.26.1 - react-docgen: ^6.0.0-alpha.3 + react-docgen: 6.0.0-alpha.3 typescript: ~4.9.3 - vite: ^3.1.3 + vite: ^4.0.0 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + vite: ^3.0.0 || ^4.0.0 languageName: unknown linkType: soft @@ -7005,9 +7112,9 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/react-webpack5@workspace:frameworks/react-webpack5" dependencies: - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/preset-react-webpack": 7.0.0-beta.0 - "@storybook/react": 7.0.0-beta.0 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/preset-react-webpack": 7.0.0-beta.12 + "@storybook/react": 7.0.0-beta.12 "@types/node": ^16.0.0 jest-specific-snapshot: ^7.0.0 typescript: ~4.9.3 @@ -7023,16 +7130,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/react@7.0.0-beta.0, @storybook/react@workspace:*, @storybook/react@workspace:renderers/react": +"@storybook/react@7.0.0-beta.12, @storybook/react@workspace:*, @storybook/react@workspace:renderers/react": version: 0.0.0-use.local resolution: "@storybook/react@workspace:renderers/react" dependencies: "@babel/core": ^7.20.2 - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/core-client": 7.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-client": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@types/estree": ^0.0.51 "@types/node": ^16.0.0 "@types/util-deprecate": ^1.0.0 @@ -7090,7 +7197,7 @@ __metadata: "@nrwl/cli": 14.6.1 "@nrwl/nx-cloud": 14.6.0 "@nrwl/workspace": 14.6.1 - "@playwright/test": 1.28.0 + "@playwright/test": 1.29.0 "@storybook/addon-a11y": "workspace:*" "@storybook/addon-actions": "workspace:*" "@storybook/addon-backgrounds": "workspace:*" @@ -7181,6 +7288,7 @@ __metadata: "@storybook/web-components": "workspace:*" "@storybook/web-components-vite": "workspace:*" "@storybook/web-components-webpack5": "workspace:*" + "@swc/core": ^1.3.23 "@testing-library/dom": ^7.29.4 "@testing-library/jest-dom": ^5.11.9 "@testing-library/react": ^11.2.2 @@ -7225,7 +7333,7 @@ __metadata: ejs-lint: ^1.2.2 enzyme: ^3.11.0 enzyme-adapter-react-16: ^1.15.5 - esbuild: ^0.14.48 + esbuild: ^0.16.4 esbuild-loader: ^2.19.0 esbuild-plugin-alias: ^0.2.1 eslint: ^8.28.0 @@ -7261,7 +7369,7 @@ __metadata: npmlog: ^5.0.1 nx: 14.6.1 p-limit: ^3.1.0 - playwright: 1.28.0 + playwright: 1.29.0 prettier: 2.8.0 process: ^0.11.10 prompts: ^2.4.0 @@ -7283,13 +7391,13 @@ __metadata: trash: ^7.0.0 ts-dedent: ^2.0.0 ts-loader: ^9.2.8 - ts-node: ^10.4.0 + ts-node: ^10.9.1 tsup: ^6.2.2 typescript: ~4.9.3 util: ^0.12.4 verdaccio: ^4.10.0 verdaccio-auth-memory: ^9.7.2 - vite: ^3.1.7 + vite: ^4.0.0 vite-plugin-turbosnap: ^1.0.1 wait-on: ^5.2.1 web-component-analyzer: ^1.1.6 @@ -7326,11 +7434,11 @@ __metadata: languageName: unknown linkType: soft -"@storybook/router@7.0.0-beta.0, @storybook/router@workspace:*, @storybook/router@workspace:lib/router": +"@storybook/router@7.0.0-beta.12, @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.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 dequal: ^2.0.2 global: ^4.4.0 lodash: ^4.17.21 @@ -7338,7 +7446,6 @@ __metadata: qs: ^6.10.0 react-router-dom: 6.0.2 ts-dedent: ^2.0.0 - ts-node: ^10.4.0 typescript: ~4.9.3 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -7346,11 +7453,11 @@ __metadata: languageName: unknown linkType: soft -"@storybook/router@npm:6.5.13": - version: 6.5.13 - resolution: "@storybook/router@npm:6.5.13" +"@storybook/router@npm:6.5.14": + version: 6.5.14 + resolution: "@storybook/router@npm:6.5.14" dependencies: - "@storybook/client-logger": 6.5.13 + "@storybook/client-logger": 6.5.14 core-js: ^3.8.2 memoizerific: ^1.11.3 qs: ^6.10.0 @@ -7358,7 +7465,7 @@ __metadata: peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: a1c904b59603b776c76e5786c0c744ca99a61302b388d5585153dddfa9e64d278e560d09847453c0eb1a47eb6c621035314cc4519ff484c8f926e96ec9bd50a2 + checksum: bb390cc8d274be2c40cfc5be0c8bfbe67c170f000cfcf6f6498770dd33bd3a9246a0ad852143192c0ca90d484af52cfcc41c69435cd8f7cdb2866d944437ee6b languageName: node linkType: hard @@ -7378,10 +7485,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/server-webpack5@workspace:frameworks/server-webpack5" dependencies: - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/preset-server-webpack": 7.0.0-beta.0 - "@storybook/server": 7.0.0-beta.0 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/preset-server-webpack": 7.0.0-beta.12 + "@storybook/server": 7.0.0-beta.12 "@types/node": ^16.0.0 typescript: ~4.9.3 peerDependencies: @@ -7390,25 +7497,25 @@ __metadata: languageName: unknown linkType: soft -"@storybook/server@7.0.0-beta.0, @storybook/server@workspace:*, @storybook/server@workspace:renderers/server": +"@storybook/server@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/core-client": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 global: ^4.4.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 languageName: unknown linkType: soft -"@storybook/source-loader@7.0.0-beta.0, @storybook/source-loader@workspace:*, @storybook/source-loader@workspace:lib/source-loader": +"@storybook/source-loader@7.0.0-beta.12, @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": next - "@storybook/types": 7.0.0-beta.0 + "@storybook/types": 7.0.0-beta.12 estraverse: ^5.2.0 jest-specific-snapshot: ^7.0.0 lodash: ^4.17.21 @@ -7420,37 +7527,34 @@ __metadata: languageName: unknown linkType: soft -"@storybook/store@7.0.0-beta.0, @storybook/store@workspace:*, @storybook/store@workspace:lib/store": +"@storybook/store@7.0.0-beta.12, @storybook/store@workspace:*, @storybook/store@workspace:lib/store": version: 0.0.0-use.local resolution: "@storybook/store@workspace:lib/store" dependencies: - "@storybook/client-logger": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 languageName: unknown linkType: soft -"@storybook/svelte-vite@7.0.0-beta.0, @storybook/svelte-vite@workspace:frameworks/svelte-vite": +"@storybook/svelte-vite@7.0.0-beta.12, @storybook/svelte-vite@workspace:frameworks/svelte-vite": version: 0.0.0-use.local resolution: "@storybook/svelte-vite@workspace:frameworks/svelte-vite" dependencies: - "@storybook/addon-svelte-csf": ^2.0.0 - "@storybook/builder-vite": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/svelte": 7.0.0-beta.0 - "@sveltejs/vite-plugin-svelte": ^1.0.0 + "@storybook/builder-vite": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/svelte": 7.0.0-beta.12 + "@sveltejs/vite-plugin-svelte": ^2.0.0 "@types/node": ^16.0.0 magic-string: ^0.26.1 svelte: ^3.0.0 sveltedoc-parser: ^4.2.1 + ts-dedent: ^2.2.0 typescript: ~4.9.3 - vite: ^3.1.3 + vite: ^4.0.0 peerDependencies: - "@storybook/addon-svelte-csf": ^2.0.0 react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - "@storybook/addon-svelte-csf": - optional: true + vite: ^3.0.0 || ^4.0.0 languageName: unknown linkType: soft @@ -7458,10 +7562,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/svelte-webpack5@workspace:frameworks/svelte-webpack5" dependencies: - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/preset-svelte-webpack": 7.0.0-beta.0 - "@storybook/svelte": 7.0.0-beta.0 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/preset-svelte-webpack": 7.0.0-beta.12 + "@storybook/svelte": 7.0.0-beta.12 svelte: ^3.48.0 svelte-loader: ^3.1.2 typescript: ~4.9.3 @@ -7474,15 +7578,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/svelte@7.0.0-beta.0, @storybook/svelte@workspace:*, @storybook/svelte@workspace:renderers/svelte": +"@storybook/svelte@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/core-client": 7.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-client": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 expect-type: ^0.14.2 global: ^4.4.0 svelte: ^3.31.2 @@ -7500,25 +7604,23 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/sveltekit@workspace:frameworks/sveltekit" dependencies: - "@storybook/builder-vite": 7.0.0-beta.0 - "@storybook/svelte-vite": 7.0.0-beta.0 + "@storybook/builder-vite": 7.0.0-beta.12 + "@storybook/svelte": 7.0.0-beta.12 + "@storybook/svelte-vite": 7.0.0-beta.12 "@types/node": ^16.0.0 typescript: ^4.9.3 - vite: ^3.1.3 + vite: ^4.0.0 peerDependencies: - "@storybook/addon-svelte-csf": ^2.0.0 - peerDependenciesMeta: - "@storybook/addon-svelte-csf": - optional: true + vite: ^4.0.0 languageName: unknown linkType: soft -"@storybook/telemetry@7.0.0-beta.0, @storybook/telemetry@workspace:*, @storybook/telemetry@workspace:lib/telemetry": +"@storybook/telemetry@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 chalk: ^4.1.0 detect-package-manager: ^2.0.1 fetch-retry: ^5.0.2 @@ -7543,7 +7645,7 @@ __metadata: languageName: node linkType: hard -"@storybook/theming@7.0.0-beta.0, @storybook/theming@workspace:*, @storybook/theming@workspace:lib/theming": +"@storybook/theming@7.0.0-beta.12, @storybook/theming@workspace:*, @storybook/theming@workspace:lib/theming": version: 0.0.0-use.local resolution: "@storybook/theming@workspace:lib/theming" dependencies: @@ -7552,7 +7654,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.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 "@types/fs-extra": ^9.0.6 "@types/node": ^16.0.0 deep-object-diff: ^1.1.0 @@ -7568,27 +7670,27 @@ __metadata: languageName: unknown linkType: soft -"@storybook/theming@npm:6.5.13": - version: 6.5.13 - resolution: "@storybook/theming@npm:6.5.13" +"@storybook/theming@npm:6.5.14": + version: 6.5.14 + resolution: "@storybook/theming@npm:6.5.14" dependencies: - "@storybook/client-logger": 6.5.13 + "@storybook/client-logger": 6.5.14 core-js: ^3.8.2 memoizerific: ^1.11.3 regenerator-runtime: ^0.13.7 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 8bf458d40a66979aba1f2ed03d77dade107f69cf8ed6caebaf7b98fe4a9870e74afee86f8da9724d528e5c4e129ce51ad8bff65ea4304d50a299f5e89bc6ce99 + checksum: 94cb7ff6b7881159a6cf9adc56ab310e67a8c2e89cbbb50517815871c45324354d0be584d23951c9a5a8e9e0d21172bf3eb9e0bd927feee04fbe9c0b054307eb languageName: node linkType: hard -"@storybook/types@7.0.0-beta.0, @storybook/types@workspace:*, @storybook/types@workspace:lib/types": +"@storybook/types@7.0.0-beta.12, @storybook/types@workspace:*, @storybook/types@workspace:lib/types": version: 0.0.0-use.local resolution: "@storybook/types@workspace:lib/types" dependencies: "@babel/core": ^7.12.10 - "@storybook/channels": 7.0.0-beta.0 + "@storybook/channels": 7.0.0-beta.12 "@storybook/csf": next "@types/babel__core": ^7.0.0 "@types/express": ^4.7.0 @@ -7603,18 +7705,19 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue-vite@workspace:frameworks/vue-vite" dependencies: - "@storybook/builder-vite": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/core-server": 7.0.0-beta.0 - "@storybook/vue": 7.0.0-beta.0 + "@storybook/builder-vite": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/core-server": 7.0.0-beta.12 + "@storybook/vue": 7.0.0-beta.12 magic-string: ^0.26.1 typescript: ~4.9.3 - vite: ^3.1.3 + vite: ^4.0.0 vue: ^2.7.10 vue-docgen-api: ^4.40.0 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + vite: ^3.0.0 || ^4.0.0 vue: ^2.7.0 languageName: unknown linkType: soft @@ -7623,10 +7726,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue-webpack5@workspace:frameworks/vue-webpack5" dependencies: - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/preset-vue-webpack": 7.0.0-beta.0 - "@storybook/vue": 7.0.0-beta.0 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/preset-vue-webpack": 7.0.0-beta.12 + "@storybook/vue": 7.0.0-beta.12 "@types/node": ^16.0.0 typescript: ~4.9.3 vue: ^2.6.12 @@ -7648,18 +7751,19 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue3-vite@workspace:frameworks/vue3-vite" dependencies: - "@storybook/builder-vite": 7.0.0-beta.0 - "@storybook/core-server": 7.0.0-beta.0 - "@storybook/vue3": 7.0.0-beta.0 + "@storybook/builder-vite": 7.0.0-beta.12 + "@storybook/core-server": 7.0.0-beta.12 + "@storybook/vue3": 7.0.0-beta.12 "@types/node": ^16.0.0 - "@vitejs/plugin-vue": ^3.0.0 + "@vitejs/plugin-vue": ^4.0.0 magic-string: ^0.26.1 typescript: ~4.9.3 - vite: ^3.1.3 + vite: ^4.0.0 vue-docgen-api: ^4.40.0 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + vite: ^3.0.0 || ^4.0.0 languageName: unknown linkType: soft @@ -7667,10 +7771,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue3-webpack5@workspace:frameworks/vue3-webpack5" dependencies: - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/preset-vue3-webpack": 7.0.0-beta.0 - "@storybook/vue3": 7.0.0-beta.0 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/preset-vue3-webpack": 7.0.0-beta.12 + "@storybook/vue3": 7.0.0-beta.12 "@types/node": ^16.0.0 "@vue/compiler-sfc": 3.0.0 typescript: ~4.9.3 @@ -7685,15 +7789,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/vue3@7.0.0-beta.0, @storybook/vue3@workspace:*, @storybook/vue3@workspace:renderers/vue3": +"@storybook/vue3@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/core-client": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 "@vue/vue3-jest": 29 global: ^4.4.0 ts-dedent: ^2.0.0 @@ -7706,15 +7810,15 @@ __metadata: languageName: unknown linkType: soft -"@storybook/vue@7.0.0-beta.0, @storybook/vue@workspace:*, @storybook/vue@workspace:renderers/vue": +"@storybook/vue@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/core-client": 7.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-client": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 global: ^4.4.0 ts-dedent: ^2.0.0 type-fest: 2.19.0 @@ -7736,14 +7840,13 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/web-components-vite@workspace:frameworks/web-components-vite" dependencies: - "@storybook/builder-vite": 7.0.0-beta.0 - "@storybook/core-server": 7.0.0-beta.0 - "@storybook/node-logger": 7.0.0-beta.0 - "@storybook/web-components": 7.0.0-beta.0 + "@storybook/builder-vite": 7.0.0-beta.12 + "@storybook/core-server": 7.0.0-beta.12 + "@storybook/node-logger": 7.0.0-beta.12 + "@storybook/web-components": 7.0.0-beta.12 "@types/node": ^16.0.0 magic-string: ^0.26.1 typescript: ~4.9.3 - vite: ^3.1.0 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -7755,10 +7858,10 @@ __metadata: resolution: "@storybook/web-components-webpack5@workspace:frameworks/web-components-webpack5" dependencies: "@babel/preset-env": ^7.20.2 - "@storybook/builder-webpack5": 7.0.0-beta.0 - "@storybook/core-common": 7.0.0-beta.0 - "@storybook/preset-web-components-webpack": 7.0.0-beta.0 - "@storybook/web-components": 7.0.0-beta.0 + "@storybook/builder-webpack5": 7.0.0-beta.12 + "@storybook/core-common": 7.0.0-beta.12 + "@storybook/preset-web-components-webpack": 7.0.0-beta.12 + "@storybook/web-components": 7.0.0-beta.12 "@types/node": ^16.0.0 lit-html: 2.0.2 typescript: ~4.9.3 @@ -7769,16 +7872,16 @@ __metadata: languageName: unknown linkType: soft -"@storybook/web-components@7.0.0-beta.0, @storybook/web-components@workspace:*, @storybook/web-components@workspace:renderers/web-components": +"@storybook/web-components@7.0.0-beta.12, @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.0.0-beta.0 - "@storybook/core-client": 7.0.0-beta.0 - "@storybook/docs-tools": 7.0.0-beta.0 - "@storybook/manager-api": 7.0.0-beta.0 - "@storybook/preview-api": 7.0.0-beta.0 - "@storybook/types": 7.0.0-beta.0 + "@storybook/client-logger": 7.0.0-beta.12 + "@storybook/core-client": 7.0.0-beta.12 + "@storybook/docs-tools": 7.0.0-beta.12 + "@storybook/manager-api": 7.0.0-beta.12 + "@storybook/preview-api": 7.0.0-beta.12 + "@storybook/types": 7.0.0-beta.12 global: ^4.4.0 lit: 2.3.1 lit-html: 2.0.2 @@ -7796,24 +7899,131 @@ __metadata: languageName: node linkType: hard -"@sveltejs/vite-plugin-svelte@npm:^1.0.0": - version: 1.3.1 - resolution: "@sveltejs/vite-plugin-svelte@npm:1.3.1" +"@sveltejs/vite-plugin-svelte@npm:^2.0.0": + version: 2.0.2 + resolution: "@sveltejs/vite-plugin-svelte@npm:2.0.2" dependencies: debug: ^4.3.4 deepmerge: ^4.2.2 kleur: ^4.1.5 - magic-string: ^0.26.7 + magic-string: ^0.27.0 svelte-hmr: ^0.15.1 - vitefu: ^0.2.2 + vitefu: ^0.2.3 peerDependencies: - diff-match-patch: ^1.0.5 - svelte: ^3.44.0 - vite: ^3.0.0 - peerDependenciesMeta: - diff-match-patch: + svelte: ^3.54.0 + vite: ^4.0.0 + checksum: 467fbb99dc3f94c37e94ae062eb049ff264828fc09f03facce9ef5948867eec342dd9a852d92ad1c8fc4ac116d91f1c8327628c8c4409949aa8969754a2e70da + languageName: node + linkType: hard + +"@swc/core-darwin-arm64@npm:1.3.23": + version: 1.3.23 + resolution: "@swc/core-darwin-arm64@npm:1.3.23" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@swc/core-darwin-x64@npm:1.3.23": + version: 1.3.23 + resolution: "@swc/core-darwin-x64@npm:1.3.23" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@swc/core-linux-arm-gnueabihf@npm:1.3.23": + version: 1.3.23 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.23" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@swc/core-linux-arm64-gnu@npm:1.3.23": + version: 1.3.23 + resolution: "@swc/core-linux-arm64-gnu@npm:1.3.23" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@swc/core-linux-arm64-musl@npm:1.3.23": + version: 1.3.23 + resolution: "@swc/core-linux-arm64-musl@npm:1.3.23" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@swc/core-linux-x64-gnu@npm:1.3.23": + version: 1.3.23 + resolution: "@swc/core-linux-x64-gnu@npm:1.3.23" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@swc/core-linux-x64-musl@npm:1.3.23": + version: 1.3.23 + resolution: "@swc/core-linux-x64-musl@npm:1.3.23" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@swc/core-win32-arm64-msvc@npm:1.3.23": + version: 1.3.23 + resolution: "@swc/core-win32-arm64-msvc@npm:1.3.23" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@swc/core-win32-ia32-msvc@npm:1.3.23": + version: 1.3.23 + resolution: "@swc/core-win32-ia32-msvc@npm:1.3.23" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@swc/core-win32-x64-msvc@npm:1.3.23": + version: 1.3.23 + resolution: "@swc/core-win32-x64-msvc@npm:1.3.23" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@swc/core@npm:^1.3.23": + version: 1.3.23 + resolution: "@swc/core@npm:1.3.23" + dependencies: + "@swc/core-darwin-arm64": 1.3.23 + "@swc/core-darwin-x64": 1.3.23 + "@swc/core-linux-arm-gnueabihf": 1.3.23 + "@swc/core-linux-arm64-gnu": 1.3.23 + "@swc/core-linux-arm64-musl": 1.3.23 + "@swc/core-linux-x64-gnu": 1.3.23 + "@swc/core-linux-x64-musl": 1.3.23 + "@swc/core-win32-arm64-msvc": 1.3.23 + "@swc/core-win32-ia32-msvc": 1.3.23 + "@swc/core-win32-x64-msvc": 1.3.23 + dependenciesMeta: + "@swc/core-darwin-arm64": optional: true - checksum: c10695e84a057d96d056082cd77f2c0ae0e88b309cce38fcab76f807674bf0b8b982d805f0c0c5b9dd29996336750c2d414d89cc173de46f6e023384423aaee0 + "@swc/core-darwin-x64": + optional: true + "@swc/core-linux-arm-gnueabihf": + optional: true + "@swc/core-linux-arm64-gnu": + optional: true + "@swc/core-linux-arm64-musl": + optional: true + "@swc/core-linux-x64-gnu": + optional: true + "@swc/core-linux-x64-musl": + optional: true + "@swc/core-win32-arm64-msvc": + optional: true + "@swc/core-win32-ia32-msvc": + optional: true + "@swc/core-win32-x64-msvc": + optional: true + bin: + swcx: run_swcx.js + checksum: 70f9e17350a136713ee97c9fb80de7a0e0fca4cae339e64f22475634d6b35fe24e7456309361cf69a4ded88f1ad64ff86f5181507119ff6b17da54f30f509287 languageName: node linkType: hard @@ -7826,15 +8036,6 @@ __metadata: languageName: node linkType: hard -"@szmarczak/http-timer@npm:^5.0.1": - version: 5.0.1 - resolution: "@szmarczak/http-timer@npm:5.0.1" - dependencies: - defer-to-connect: ^2.0.1 - checksum: 4629d2fbb2ea67c2e9dc03af235c0991c79ebdddcbc19aed5d5732fb29ce01c13331e9b1a491584b9069bd6ecde6581dcbf871f11b7eefdebbab34de6cf2197e - languageName: node - linkType: hard - "@testing-library/dom@npm:^7.28.1, @testing-library/dom@npm:^7.29.4": version: 7.31.2 resolution: "@testing-library/dom@npm:7.31.2" @@ -7969,7 +8170,7 @@ __metadata: languageName: node linkType: hard -"@types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14, @types/babel__core@npm:^7.1.20": +"@types/babel__core@npm:^7, @types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14, @types/babel__core@npm:^7.1.20": version: 7.1.20 resolution: "@types/babel__core@npm:7.1.20" dependencies: @@ -8063,13 +8264,6 @@ __metadata: languageName: node linkType: hard -"@types/configstore@npm:*": - version: 6.0.0 - resolution: "@types/configstore@npm:6.0.0" - checksum: 167bf467c6e85d567f2f1209175907bb189db470d77beb9e748a17cc3c92a81bcd20351a50542700526b66429f4519ea4578df94b4cd171d28220150b2c8bf37 - languageName: node - linkType: hard - "@types/connect-history-api-fallback@npm:^1.3.5": version: 1.3.5 resolution: "@types/connect-history-api-fallback@npm:1.3.5" @@ -8170,7 +8364,7 @@ __metadata: languageName: node linkType: hard -"@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^4.17.18": +"@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^4.17.31": version: 4.17.31 resolution: "@types/express-serve-static-core@npm:4.17.31" dependencies: @@ -8182,14 +8376,14 @@ __metadata: linkType: hard "@types/express@npm:*, @types/express@npm:^4.17.11, @types/express@npm:^4.17.13, @types/express@npm:^4.7.0": - version: 4.17.14 - resolution: "@types/express@npm:4.17.14" + version: 4.17.15 + resolution: "@types/express@npm:4.17.15" dependencies: "@types/body-parser": "*" - "@types/express-serve-static-core": ^4.17.18 + "@types/express-serve-static-core": ^4.17.31 "@types/qs": "*" "@types/serve-static": "*" - checksum: 616e3618dfcbafe387bf2213e1e40f77f101685f3e9efff47c66fd2da611b7578ed5f4e61e1cdb1f2a32c8f01eff4ee74f93c52ad56d45e69b7154da66b3443a + checksum: a230500a0bcf47d090a6a254873325145ad29fb7513c1688aa7376d3ac3cddf4e6478e77e7c0273349260f26b2767ff403368b8ec4e3e72a6dc17159ba1bddb2 languageName: node linkType: hard @@ -8256,13 +8450,6 @@ __metadata: languageName: node linkType: hard -"@types/http-cache-semantics@npm:^4.0.1": - version: 4.0.1 - resolution: "@types/http-cache-semantics@npm:4.0.1" - checksum: 6d6068110a04cac213bdc0fff9c7bac028b5a2da390492204328987d8ddc500adc10d9cf5747a6333dab261712655dcfe120ea1d5527c205d012a39cdccc2a7b - languageName: node - linkType: hard - "@types/http-proxy@npm:^1.17.8": version: 1.17.9 resolution: "@types/http-proxy@npm:1.17.9" @@ -8334,12 +8521,12 @@ __metadata: linkType: hard "@types/jest@npm:*, @types/jest@npm:>=26.0.0": - version: 29.2.3 - resolution: "@types/jest@npm:29.2.3" + version: 29.2.4 + resolution: "@types/jest@npm:29.2.4" dependencies: expect: ^29.0.0 pretty-format: ^29.0.0 - checksum: fffd007edfb13f80ca5da3385922fafed807a00d7f3236377d90b27314c811f4ef8c0089ec37e8049ae33fb3ce3b75d9fc32f92261a5782fb4e3920beca86042 + checksum: d4e35aa1f96bbf228b8d31d1cd987becdac0bacf46b6fd879fefef61dc2cc18a8b4075dc9fc664d588ff8fd410641c3cae087d8396ee1cf18369579e4a1eb846 languageName: node linkType: hard @@ -8350,6 +8537,16 @@ __metadata: languageName: node linkType: hard +"@types/jscodeshift@npm:^0.11.6": + version: 0.11.6 + resolution: "@types/jscodeshift@npm:0.11.6" + dependencies: + ast-types: ^0.14.1 + recast: ^0.20.3 + checksum: 1d204a4c3d9f52669e315dfbc1e65434ec55ee884574306d35048b89ef83b625c64d510228b6aabbd4248af566e02e0ce9de0aa8ccdfff696c69fbaced7007e7 + languageName: node + linkType: hard + "@types/jsdom@npm:^16.2.4": version: 16.2.15 resolution: "@types/jsdom@npm:16.2.15" @@ -8471,16 +8668,16 @@ __metadata: linkType: hard "@types/node@npm:*, @types/node@npm:>= 8, @types/node@npm:^18.7.20": - version: 18.11.10 - resolution: "@types/node@npm:18.11.10" - checksum: 29fcbfa60c7fd32c36eb444f419e4eae391fb7a7e383c6fd7f9dac8ac5a11b0e2aa810b945a05b83daaaa2db11b3f3bdec61984962315959e5b5cd93b35f724b + version: 18.11.17 + resolution: "@types/node@npm:18.11.17" + checksum: db7f096acdcf8912e7212eaa94b452bd94f9c8e76514b780705c1080f05a0d7cb055f158a552cb7f7f9967a06b4f31c48f3cdc53ae39d45bb837c5a82d21dacd languageName: node linkType: hard "@types/node@npm:^16.0.0": - version: 16.18.4 - resolution: "@types/node@npm:16.18.4" - checksum: ab6d44e3715b3cdf32d6bf3f0c77001dcaf85d79a7de294a978bd9c8f433e0a93558b12f2407f8bb5f436408c5ea25f060b51b4995e6fb093a8c5a22420bd1c4 + version: 16.18.10 + resolution: "@types/node@npm:16.18.10" + checksum: ffb6632945f1342e514cae0dafff081e2f6590ef06c3f19cfb650cccb6058496f9d5bb4dc05c3b22c6c0755aca0134cd9189c1d98bef25745f16bbb16b614d66 languageName: node linkType: hard @@ -8536,9 +8733,9 @@ __metadata: linkType: hard "@types/prettier@npm:^2.1.5": - version: 2.7.1 - resolution: "@types/prettier@npm:2.7.1" - checksum: 1acbc69eb6f36cf04256ab2a7a05737b670a81d96de9f5f4d765d8c1f5f68978a6a5800dc059968075ef2492a26a39f6ccdff72a4d8639144297235548b789cc + version: 2.7.2 + resolution: "@types/prettier@npm:2.7.2" + checksum: 16ffbd1135c10027f118517d3b12aaaf3936be1f3c6e4c6c9c03d26d82077c2d86bf0dcad545417896f29e7d90faf058aae5c9db2e868be64298c644492ea29e languageName: node linkType: hard @@ -8559,11 +8756,12 @@ __metadata: linkType: hard "@types/prompts@npm:^2.0.9": - version: 2.4.1 - resolution: "@types/prompts@npm:2.4.1" + version: 2.4.2 + resolution: "@types/prompts@npm:2.4.2" dependencies: "@types/node": "*" - checksum: e00281339b716d7635ab0dc5f52f9a012daca9ed21346887fa1def85febfd16e937908d62602a34158eb613f6738ac15b85f3012f9993c0664a8f368385f6109 + kleur: ^3.0.3 + checksum: f6fbd91a6a23017ee9a8da870f1354aaa5052a7907d17c41a2364ca4c546f4bad952c7bb6dfe824f0a7385aad4d9f2faf284cc7239e99c2f7675dea3bc2cdcc4 languageName: node linkType: hard @@ -8852,16 +9050,6 @@ __metadata: languageName: node linkType: hard -"@types/update-notifier@npm:^6.0.1": - version: 6.0.1 - resolution: "@types/update-notifier@npm:6.0.1" - dependencies: - "@types/configstore": "*" - boxen: ^7.0.0 - checksum: 930901fb768caee412f56f162e285b688c9244037067b95da21312b6faa774021cadff4952e2910220654ad83cf7e49d3bf27be42bc7aaf3dd847e5009493d8a - languageName: node - linkType: hard - "@types/util-deprecate@npm:^1.0.0": version: 1.0.0 resolution: "@types/util-deprecate@npm:1.0.0" @@ -8972,11 +9160,11 @@ __metadata: linkType: hard "@types/yargs@npm:^17.0.8": - version: 17.0.15 - resolution: "@types/yargs@npm:17.0.15" + version: 17.0.17 + resolution: "@types/yargs@npm:17.0.17" dependencies: "@types/yargs-parser": "*" - checksum: a329c9b4f0157fcb3b7b4cb440a3f99f868006ce5cbdcc8739b640b25042cd7c7e3a27aae73c0255d34d0a6b6325115d49f259acf00dd30adc03a94ac3bc901d + checksum: 4a95d254292c7a688685afed4d75f6e99826ccb08a669e8fc9867b2d97342a696fc9bdb874b8631311a0d8c42d0b12ed7f5bd994aa75cd916ec88183985c2092 languageName: node linkType: hard @@ -8990,12 +9178,12 @@ __metadata: linkType: hard "@typescript-eslint/eslint-plugin@npm:^5.45.0": - version: 5.45.0 - resolution: "@typescript-eslint/eslint-plugin@npm:5.45.0" + version: 5.47.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.47.0" dependencies: - "@typescript-eslint/scope-manager": 5.45.0 - "@typescript-eslint/type-utils": 5.45.0 - "@typescript-eslint/utils": 5.45.0 + "@typescript-eslint/scope-manager": 5.47.0 + "@typescript-eslint/type-utils": 5.47.0 + "@typescript-eslint/utils": 5.47.0 debug: ^4.3.4 ignore: ^5.2.0 natural-compare-lite: ^1.4.0 @@ -9008,54 +9196,54 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 14d5f591564b8688e8d99f69732f97955b7aeefa0893c2df95f9dee9c4105d5ca82bfcf819a4edab3110cd0aa0de234ecda254e41668b7bab1cd2992b805612c + checksum: 481f267b9627f27caff84fa194bd6ea5baf8c2825e60d345ca74ed63f9ff7c9f0ac5abe114b774cd3936b221de0e0a0e3a7961c76837aeb72305012b73d6a478 languageName: node linkType: hard "@typescript-eslint/experimental-utils@npm:^5.45.0": - version: 5.45.0 - resolution: "@typescript-eslint/experimental-utils@npm:5.45.0" + version: 5.47.0 + resolution: "@typescript-eslint/experimental-utils@npm:5.47.0" dependencies: - "@typescript-eslint/utils": 5.45.0 + "@typescript-eslint/utils": 5.47.0 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 0e377cdc617f55ee4a1d58500acb67a38895e56cf3f6ce13a0d1190f97494f183ed28ae3a7a4621d82319ef7ae1a652e348ece2404b0205d5a19c0c8a23ad423 + checksum: 9a09123c31d194aa3b69a8d692342698fc8450c187a5d31e449445fd436f32c730b4ee59c515b0d9bddb2d7bf60079b480abe31201219aaad905a785a979ca55 languageName: node linkType: hard "@typescript-eslint/parser@npm:^5.45.0": - version: 5.45.0 - resolution: "@typescript-eslint/parser@npm:5.45.0" + version: 5.47.0 + resolution: "@typescript-eslint/parser@npm:5.47.0" dependencies: - "@typescript-eslint/scope-manager": 5.45.0 - "@typescript-eslint/types": 5.45.0 - "@typescript-eslint/typescript-estree": 5.45.0 + "@typescript-eslint/scope-manager": 5.47.0 + "@typescript-eslint/types": 5.47.0 + "@typescript-eslint/typescript-estree": 5.47.0 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 1a2be775577836436b59f8812ab6a58f208cdaf7a49a651461eb937b6afcc8ead14fd08c94664bba8708b277a4c7a2a5e32cb96a4f7cd8a40aab3ff7db46333d + checksum: d896b0f2a841a423a1c8b6b3b1723f337c53b210eb32a6630cf8f4a30ab83a0d63be193f4692bbcc431002e49f1654717131c99f5a49bcd81d1e2224599df473 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.45.0": - version: 5.45.0 - resolution: "@typescript-eslint/scope-manager@npm:5.45.0" +"@typescript-eslint/scope-manager@npm:5.47.0": + version: 5.47.0 + resolution: "@typescript-eslint/scope-manager@npm:5.47.0" dependencies: - "@typescript-eslint/types": 5.45.0 - "@typescript-eslint/visitor-keys": 5.45.0 - checksum: 79ccc74424b015568e122239fbd1d395c6c9da6c3c1569455f4c81ee1a036f3c8cee30e8b68e4aefe580e09a1026de365a65bd2a257039a3e5d767f88b9ae0a0 + "@typescript-eslint/types": 5.47.0 + "@typescript-eslint/visitor-keys": 5.47.0 + checksum: 5bbc824ad3e85421f8bac48ea55d79796f39ea63259e96facfbb2f7ec93789a8fd9836ea80bc76e8034524d559a2dd202d5b75cf44d7040d5eeba45d0848725b languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.45.0": - version: 5.45.0 - resolution: "@typescript-eslint/type-utils@npm:5.45.0" +"@typescript-eslint/type-utils@npm:5.47.0": + version: 5.47.0 + resolution: "@typescript-eslint/type-utils@npm:5.47.0" dependencies: - "@typescript-eslint/typescript-estree": 5.45.0 - "@typescript-eslint/utils": 5.45.0 + "@typescript-eslint/typescript-estree": 5.47.0 + "@typescript-eslint/utils": 5.47.0 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -9063,23 +9251,23 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 0e9ea982f622ae9bb705723a5434428f08a232303019e43e53b8008837cdd3f2e7a262dbab53967b5aa99fee00be87cd1ba118dc5ae682a836b0993fa296927a + checksum: ab65df55cf5dfa5ecc06cae7bbb703ad142c148daea4d242e8736061346980e8841a6cd2780b36b11e0fab317009617565ee7a0df26f4b26080c96cf49741aae languageName: node linkType: hard -"@typescript-eslint/types@npm:5.45.0": - version: 5.45.0 - resolution: "@typescript-eslint/types@npm:5.45.0" - checksum: ef23914e289415732194db747fbdfd88c04f6c1bf7d4b32d74c7d02078cab85492d14f2fc59dc95fe046abe26b4643243ffac927b9078d8fb1794cc7858876b5 +"@typescript-eslint/types@npm:5.47.0": + version: 5.47.0 + resolution: "@typescript-eslint/types@npm:5.47.0" + checksum: 1a05c06f7fe8ffa96268d82386f78cfc0f563e03fbd6c1a2f209600b1b3eafe3ef09340adfbd19e68809b8db0f50e3d93e30d17521f0fde040a0b1efe2f20e66 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.45.0": - version: 5.45.0 - resolution: "@typescript-eslint/typescript-estree@npm:5.45.0" +"@typescript-eslint/typescript-estree@npm:5.47.0": + version: 5.47.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.47.0" dependencies: - "@typescript-eslint/types": 5.45.0 - "@typescript-eslint/visitor-keys": 5.45.0 + "@typescript-eslint/types": 5.47.0 + "@typescript-eslint/visitor-keys": 5.47.0 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -9088,35 +9276,35 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 1148d0491efc4eb180e205f52f62f8f6f5f204162de28eb122565a367aa61ad538c51b241d98e3c02019da9e03b93c6b3fd8c2fa10577c5831cd6f42abc3c7f6 + checksum: 3e4438205a8682373d4fc193abff491986d53e59d0d19153fe8eaf68171515dd37d9fba8b962d42ac3f867276569bf1539e4fe7d530b033332f38a6fd979cad8 languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.45.0": - version: 5.45.0 - resolution: "@typescript-eslint/utils@npm:5.45.0" +"@typescript-eslint/utils@npm:5.47.0, @typescript-eslint/utils@npm:^5.45.0": + version: 5.47.0 + resolution: "@typescript-eslint/utils@npm:5.47.0" dependencies: "@types/json-schema": ^7.0.9 "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.45.0 - "@typescript-eslint/types": 5.45.0 - "@typescript-eslint/typescript-estree": 5.45.0 + "@typescript-eslint/scope-manager": 5.47.0 + "@typescript-eslint/types": 5.47.0 + "@typescript-eslint/typescript-estree": 5.47.0 eslint-scope: ^5.1.1 eslint-utils: ^3.0.0 semver: ^7.3.7 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 022ef5c81b4986f87a186bdff384c7dcc6ff08884935401b6c05e82554e404bc8010a7fb2f6413c0e6aad01ced667a221ed8d115bca4f97c21a002bbfefb66f0 + checksum: a0e44450e9395ef52def9f2ccf705fd894a49c39808693713628b34e35b880261fae649e2e343aa9c708c1a6b16a71b305a117b222eee9229d622f99fe9f76e1 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.45.0": - version: 5.45.0 - resolution: "@typescript-eslint/visitor-keys@npm:5.45.0" +"@typescript-eslint/visitor-keys@npm:5.47.0": + version: 5.47.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.47.0" dependencies: - "@typescript-eslint/types": 5.45.0 + "@typescript-eslint/types": 5.47.0 eslint-visitor-keys: ^3.3.0 - checksum: 47cde8f55f41d73e3df205e7ba2de9ab83f36a2cf3fe9aa7f24605cddfc914d9f4af2f16a7e36b348d1d990b3200c4c8e2b623332bc5eaf0c337afd18f6bd775 + checksum: 927b0ed4eaa0a717f926f07816df6f78d2eef2550c3ab64594cdea5fc266961895c3f3b8ec199f245977f984e8b805dc68664a40294fac2f76bf047f3c5fbcf3 languageName: node linkType: hard @@ -9179,7 +9367,7 @@ __metadata: languageName: node linkType: hard -"@vitejs/plugin-react@npm:^2.0.0, @vitejs/plugin-react@npm:^2.1.0": +"@vitejs/plugin-react@npm:^2.1.0": version: 2.2.0 resolution: "@vitejs/plugin-react@npm:2.2.0" dependencies: @@ -9196,68 +9384,83 @@ __metadata: languageName: node linkType: hard -"@vitejs/plugin-vue@npm:^3.0.0": - version: 3.2.0 - resolution: "@vitejs/plugin-vue@npm:3.2.0" +"@vitejs/plugin-react@npm:^3.0.0": + version: 3.0.0 + resolution: "@vitejs/plugin-react@npm:3.0.0" + dependencies: + "@babel/core": ^7.20.5 + "@babel/plugin-transform-react-jsx-self": ^7.18.6 + "@babel/plugin-transform-react-jsx-source": ^7.19.6 + magic-string: ^0.27.0 + react-refresh: ^0.14.0 peerDependencies: - vite: ^3.0.0 - vue: ^3.2.25 - checksum: a2583817306e7a8ae8d3224a97f3a0b302e474a7f2b1174d3b79a9b92bc4c846825a797162fdc70b36be96d637533c25f3f8cf6e66e3787f3105ec60304695cd + vite: ^4.0.0 + checksum: f2802415ac56bfb02bae783616b41147335b33d0cb2f8d7f15e5de30e6cb9603a7d327ee592a031d6c6c008d42404301058533d00222fc989f8d7553f31a5577 languageName: node linkType: hard -"@volar/language-core@npm:1.0.10": - version: 1.0.10 - resolution: "@volar/language-core@npm:1.0.10" +"@vitejs/plugin-vue@npm:^4.0.0": + version: 4.0.0 + resolution: "@vitejs/plugin-vue@npm:4.0.0" + peerDependencies: + vite: ^4.0.0 + vue: ^3.2.25 + checksum: 966a37579c6ed93b907622f7db2034993eab512dca46f0e819ef872adfc00a1c71625dc1bf116dd61f0869444bd91e20c2a5f2573de8e3ae72a6e4c2b7e725ea + languageName: node + linkType: hard + +"@volar/language-core@npm:1.0.16": + version: 1.0.16 + resolution: "@volar/language-core@npm:1.0.16" dependencies: - "@volar/source-map": 1.0.10 + "@volar/source-map": 1.0.16 "@vue/reactivity": ^3.2.45 muggle-string: ^0.1.0 - checksum: 94b30cf474f1ddffd5c06a1b1d85d3df2f3bbc069c5a8dfc4e7fdde2e812391aa4c422f902922546d0447bdde61f2e15a5e0b2ae5d62247894f44c980feddff4 + checksum: e7ac9b0e2b92b568e32fb9d392db0d04435eeefeefb12fc88e2df605885775971d87150c138ecef8906d5d8960771e4f647caf2c045d216bc719d69bc4764023 languageName: node linkType: hard -"@volar/source-map@npm:1.0.10": - version: 1.0.10 - resolution: "@volar/source-map@npm:1.0.10" +"@volar/source-map@npm:1.0.16": + version: 1.0.16 + resolution: "@volar/source-map@npm:1.0.16" dependencies: muggle-string: ^0.1.0 - checksum: 08a0e0d8dd3346b704860c1d9994856bea2ae9024d3fd0d37f9b5c7b01f0cdf458ebeb4f6ba07fc6a4a3c11327a43b6598c1ba9764fc860a57e7a40128c92bd9 + checksum: 8e2e960365b7749c6935e85db37e2d736a8c5ab572ed746a29873b0224d9071add49caf6e2ae956f99f1950fa34ecf9a6e47368a035d2186450b531348fed000 languageName: node linkType: hard -"@volar/typescript@npm:1.0.10": - version: 1.0.10 - resolution: "@volar/typescript@npm:1.0.10" +"@volar/typescript@npm:1.0.16": + version: 1.0.16 + resolution: "@volar/typescript@npm:1.0.16" dependencies: - "@volar/language-core": 1.0.10 - checksum: 39136ed93e1f49ab63df55938161a61b0fcf5d3f7552fbc2cb7b53d62aa0e2a3263e00b0a036cc47304bc534637fb6e6392926e67f35b2c9e7454c43e0538393 + "@volar/language-core": 1.0.16 + checksum: 9893a57bd7e960892f29b293a12702249494bc3eadca2bccefe46ab6e846be7d83bb94b0138afd64be252fda2496a35cf36c09f43c9deaf9b98b9be4627db784 languageName: node linkType: hard -"@volar/vue-language-core@npm:1.0.10": - version: 1.0.10 - resolution: "@volar/vue-language-core@npm:1.0.10" +"@volar/vue-language-core@npm:1.0.16": + version: 1.0.16 + resolution: "@volar/vue-language-core@npm:1.0.16" dependencies: - "@volar/language-core": 1.0.10 - "@volar/source-map": 1.0.10 + "@volar/language-core": 1.0.16 + "@volar/source-map": 1.0.16 "@vue/compiler-dom": ^3.2.45 "@vue/compiler-sfc": ^3.2.45 "@vue/reactivity": ^3.2.45 "@vue/shared": ^3.2.45 - minimatch: ^5.1.0 + minimatch: ^5.1.1 vue-template-compiler: ^2.7.14 - checksum: 5b7de9146a4390f61bbc41b0be1708f55611faf0870f65b85535b82a809610bc7a2082d1ced62c672e823cfda406200238c44ac4a98c0eae43325e8a62acce77 + checksum: 776878afe6997c7f22875d3faf36042086afb4b6281704c3c7fa6fc82d30699efada7c7f92953954a707c05de938e4a308a10fe035d085829419722f55f15e32 languageName: node linkType: hard -"@volar/vue-typescript@npm:1.0.10": - version: 1.0.10 - resolution: "@volar/vue-typescript@npm:1.0.10" +"@volar/vue-typescript@npm:1.0.16": + version: 1.0.16 + resolution: "@volar/vue-typescript@npm:1.0.16" dependencies: - "@volar/typescript": 1.0.10 - "@volar/vue-language-core": 1.0.10 - checksum: 0b0475c0504133ad71cd45afb3b2d76107c91150ef372609cc735356c5574a7fa25bd932e5110fbab28e3a4f8900998746fc4893b7ab2711222ad24cdf99f154 + "@volar/typescript": 1.0.16 + "@volar/vue-language-core": 1.0.16 + checksum: 92cf8014e2ea89d5371ededae75b485e6f38c840af3e3d9b993dce2d379f9a6d019a3f3935e9ba02a2c68b97bf7a68ff491b67a8ca12672bb58bfbe761833aee languageName: node linkType: hard @@ -9501,8 +9704,8 @@ __metadata: linkType: hard "@vue/vue3-jest@npm:29": - version: 29.2.1 - resolution: "@vue/vue3-jest@npm:29.2.1" + version: 29.2.2 + resolution: "@vue/vue3-jest@npm:29.2.2" dependencies: "@babel/plugin-transform-modules-commonjs": ^7.2.0 chalk: ^2.1.0 @@ -9519,7 +9722,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 440df6efa65bc899458b38e538dbef26f8e3370160b749bde983eafa9c72a382f7b72abdac969fe1864b4e754cd6c85490fa1b7fa39e515a2e3da0092bdb1002 + checksum: 1d3116d02f642b9aca74b4392bbf088001da04b00e0a50853e0f84a77144d7361fa42412c7eeeb9c61b55847c1a36f04dce7a93670759cfad9ddd73fecbb715f languageName: node linkType: hard @@ -9906,9 +10109,9 @@ __metadata: linkType: hard "address@npm:^1.0.1": - version: 1.2.1 - resolution: "address@npm:1.2.1" - checksum: 64096b80207588684ec47f106a29205e58f3cda6fcc70bc4e1c141c1f166d0df8868e104687455b46e82c71efc5b38abb5095cf9e75cbba54128250422ea519b + version: 1.2.2 + resolution: "address@npm:1.2.2" + checksum: 1c8056b77fb124456997b78ed682ecc19d2fd7ea8bd5850a2aa8c3e3134c913847c57bcae418622efd32ba858fa1e242a40a251ac31da0515664fc0ac03a047d languageName: node linkType: hard @@ -10640,7 +10843,7 @@ __metadata: languageName: node linkType: hard -"ast-types@npm:0.14.2, ast-types@npm:^0.14.2": +"ast-types@npm:0.14.2, ast-types@npm:^0.14.1, ast-types@npm:^0.14.2": version: 0.14.2 resolution: "ast-types@npm:0.14.2" dependencies: @@ -10813,9 +11016,9 @@ __metadata: linkType: hard "axe-core@npm:^4.2.0, axe-core@npm:^4.4.3, axe-core@npm:^4.5.2": - version: 4.5.2 - resolution: "axe-core@npm:4.5.2" - checksum: 8f6e12fe08daacb875d471a6860eaf93dcac0e08bd26438b0c52751b826c130288f03b18b1e71ed6e15a9318df6d7a7e9522501ea50433c85a383b1e4dc9cdbc + version: 4.6.1 + resolution: "axe-core@npm:4.6.1" + checksum: 47ccf84b0c1575a326711dc893d39f7f3f11c5ca6332d30f636286b5e4288049fb9cab5c8e0fa45af453169506d74350c12ca23338bc8f9b5e3045681e3cb31f languageName: node linkType: hard @@ -11262,13 +11465,6 @@ __metadata: languageName: node linkType: hard -"batch-processor@npm:1.0.0": - version: 1.0.0 - resolution: "batch-processor@npm:1.0.0" - checksum: 048b868811bed4cd03a0eec35264055f0f3fe4ab62f501809dce4a8a7b845d905fa5051b4af8b3c5123181116b1e2b6dfabf608829043b60cf61f4da3a359b60 - languageName: node - linkType: hard - "batch@npm:0.6.1": version: 0.6.1 resolution: "batch@npm:0.6.1" @@ -12024,28 +12220,6 @@ __metadata: languageName: node linkType: hard -"cacheable-lookup@npm:^7.0.0": - version: 7.0.0 - resolution: "cacheable-lookup@npm:7.0.0" - checksum: 63a9c144c5b45cb5549251e3ea774c04d63063b29e469f7584171d059d3a88f650f47869a974e2d07de62116463d742c287a81a625e791539d987115cb081635 - languageName: node - linkType: hard - -"cacheable-request@npm:^10.2.1": - version: 10.2.3 - resolution: "cacheable-request@npm:10.2.3" - dependencies: - "@types/http-cache-semantics": ^4.0.1 - get-stream: ^6.0.1 - http-cache-semantics: ^4.1.0 - keyv: ^4.5.2 - mimic-response: ^4.0.0 - normalize-url: ^8.0.0 - responselike: ^3.0.0 - checksum: 437570efb4fdc511497a6379d801c003ab6aa7e10605fec425177c95fb597c43ceb5fb3614d1f2f56bbe5d7d0467ada7ebbe0f39b4c174f27f1ac296f0db1e46 - languageName: node - linkType: hard - "calculate-cache-key-for-tree@npm:^2.0.0": version: 2.0.0 resolution: "calculate-cache-key-for-tree@npm:2.0.0" @@ -12193,9 +12367,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001299, caniuse-lite@npm:^1.0.30001400, caniuse-lite@npm:^1.0.30001406, caniuse-lite@npm:^1.0.30001426": - version: 1.0.30001435 - resolution: "caniuse-lite@npm:1.0.30001435" - checksum: 8cb36babb5b33f537b86fa06274671bfd521047915a964f8106004d17c99b3d5952b0f61ae88d34aaab811b8c9e9254fabbd9184a358569872e80a0b38851332 + version: 1.0.30001439 + resolution: "caniuse-lite@npm:1.0.30001439" + checksum: 0467711704bef4e1ef1bca40fa3b32c7d6376060bd2f1eda5d9a00014101535123960e19a9039c01de612db11ab34a2a470964991f1d7c62e39e1c9fa2e701d9 languageName: node linkType: hard @@ -12262,9 +12436,9 @@ __metadata: linkType: hard "chalk@npm:^5.0.1": - version: 5.1.2 - resolution: "chalk@npm:5.1.2" - checksum: 7ce3d213b339ae54322e0b15f82967f01ed36bcd261fdf021a7dd3ebaf48f27f1d3dcc7af898acee73e19fd0caa52006325b12e229af76087ae7a87978f06751 + version: 5.2.0 + resolution: "chalk@npm:5.2.0" + checksum: 8a519b35c239f96e041b7f1ed8fdd79d3ca2332a8366cb957378b8a1b8a4cdfb740d19628e8bf74654d4c0917aa10cf39c20752e177a1304eac29a1168a740e9 languageName: node linkType: hard @@ -12966,19 +13140,6 @@ __metadata: languageName: node linkType: hard -"configstore@npm:^6.0.0": - version: 6.0.0 - resolution: "configstore@npm:6.0.0" - dependencies: - dot-prop: ^6.0.1 - graceful-fs: ^4.2.6 - unique-string: ^3.0.0 - write-file-atomic: ^3.0.3 - xdg-basedir: ^5.0.1 - checksum: 6681a96038ab3e0397cbdf55e6e1624ac3dfa3afe955e219f683df060188a418bda043c9114a59a337e7aec9562b0a0c838ed7db24289e6d0c266bc8313b9580 - languageName: node - linkType: hard - "confusing-browser-globals@npm:^1.0.10": version: 1.0.11 resolution: "confusing-browser-globals@npm:1.0.11" @@ -13424,15 +13585,6 @@ __metadata: languageName: node linkType: hard -"crypto-random-string@npm:^4.0.0": - version: 4.0.0 - resolution: "crypto-random-string@npm:4.0.0" - dependencies: - type-fest: ^1.0.1 - checksum: 16e11a3c8140398f5408b7fded35a961b9423c5dac39a60cbbd08bd3f0e07d7de130e87262adea7db03ec1a7a4b7551054e0db07ee5408b012bac5400cfc07a5 - languageName: node - linkType: hard - "css-blank-pseudo@npm:^3.0.2": version: 3.0.3 resolution: "css-blank-pseudo@npm:3.0.3" @@ -13478,11 +13630,11 @@ __metadata: linkType: hard "css-loader@npm:^6.7.1": - version: 6.7.2 - resolution: "css-loader@npm:6.7.2" + version: 6.7.3 + resolution: "css-loader@npm:6.7.3" dependencies: icss-utils: ^5.1.0 - postcss: ^8.4.18 + postcss: ^8.4.19 postcss-modules-extract-imports: ^3.0.0 postcss-modules-local-by-default: ^4.0.0 postcss-modules-scope: ^3.0.0 @@ -13491,7 +13643,7 @@ __metadata: semver: ^7.3.8 peerDependencies: webpack: ^5.0.0 - checksum: 41e8246c7ccc9507ace5bdfed902c4d0b6db59038b933f70d477d2b010827da3e78ec58a44444d8ad22c46470f188194c7aeaf9fb9afb21e881bd704ce8f605a + checksum: 20f435f73d6d776ade4b8dd6c83e7eee65a139f510b2c7575e45d7500ce1b72618b408f4841afc7f34e1aaeef25603ddd10fd4920461907483e1e1e4472bff1f languageName: node linkType: hard @@ -13533,12 +13685,12 @@ __metadata: linkType: hard "css-tree@npm:^2.0.1": - version: 2.3.0 - resolution: "css-tree@npm:2.3.0" + version: 2.3.1 + resolution: "css-tree@npm:2.3.1" dependencies: mdn-data: 2.0.30 source-map-js: ^1.0.1 - checksum: 330555bdb51ca547a1d5a1f07a054af11ba70f782a9641c9a9ddc4f1063cbd10bda19dcb7077bbcb122ba69de270666c1232ed5ed933a393285c7723576498bb + checksum: 6f8c1a11d5e9b14bf02d10717fc0351b66ba12594166f65abfbd8eb8b5b490dd367f5c7721db241a3c792d935fc6751fbc09f7e1598d421477ad9fadc30f4f24 languageName: node linkType: hard @@ -13639,6 +13791,13 @@ __metadata: languageName: node linkType: hard +"cuid@npm:^2.1.8": + version: 2.1.8 + resolution: "cuid@npm:2.1.8" + checksum: 6514d247c6de3e5cd32f485821365f4816ee14b777841fa717d37b7a8f791f3cb268be9e37ca54b110f6f5f625e4f0af581c3226aa14f259790539ba20fdaf61 + languageName: node + linkType: hard + "currently-unhandled@npm:^0.4.1": version: 0.4.1 resolution: "currently-unhandled@npm:0.4.1" @@ -13893,25 +14052,16 @@ __metadata: linkType: hard "decimal.js@npm:^10.3.1, decimal.js@npm:^10.4.2": - version: 10.4.2 - resolution: "decimal.js@npm:10.4.2" - checksum: 2f50de33c9c9fcd4c7ffd74cd02edecadeaa4d954e14ef721ee1d381d293c9237b1a90f54198b91f06fd5d3bb8b97079bba54fbc9ccd205d9e6bc8ffa82f6202 + version: 10.4.3 + resolution: "decimal.js@npm:10.4.3" + checksum: 6d60206689ff0911f0ce968d40f163304a6c1bc739927758e6efc7921cfa630130388966f16bf6ef6b838cb33679fbe8e7a78a2f3c478afce841fd55ac8fb8ee languageName: node linkType: hard "decode-uri-component@npm:^0.2.0": - version: 0.2.0 - resolution: "decode-uri-component@npm:0.2.0" - checksum: dbc3c72e4a740703f76fb3f51e35bb81546aa3e8c7897e015b8bc289813d3044ad6eaa6048fbb43f6b7b34ef005527b7511da50399caa78b91ee39266a341822 - languageName: node - linkType: hard - -"decompress-response@npm:^6.0.0": - version: 6.0.0 - resolution: "decompress-response@npm:6.0.0" - dependencies: - mimic-response: ^3.1.0 - checksum: bd89d23141b96d80577e70c54fb226b2f40e74a6817652b80a116d7befb8758261ad073a8895648a29cc0a5947021ab66705cb542fa9c143c82022b27c5b175e + version: 0.2.2 + resolution: "decode-uri-component@npm:0.2.2" + checksum: 1f4fa54eb740414a816b3f6c24818fbfcabd74ac478391e9f4e2282c994127db02010ce804f3d08e38255493cfe68608b3f5c8e09fd6efc4ae46c807691f7a31 languageName: node linkType: hard @@ -13959,13 +14109,6 @@ __metadata: languageName: node linkType: hard -"deep-extend@npm:^0.6.0": - version: 0.6.0 - resolution: "deep-extend@npm:0.6.0" - checksum: 1c6b0abcdb901e13a44c7d699116d3d4279fdb261983122a3783e7273844d5f2537dc2e1c454a23fcf645917f93fbf8d07101c1d03c015a87faa662755212566 - languageName: node - linkType: hard - "deep-is@npm:^0.1.3, deep-is@npm:~0.1.3": version: 0.1.4 resolution: "deep-is@npm:0.1.4" @@ -14022,13 +14165,6 @@ __metadata: languageName: node linkType: hard -"defer-to-connect@npm:^2.0.1": - version: 2.0.1 - resolution: "defer-to-connect@npm:2.0.1" - checksum: 625ce28e1b5ad10cf77057b9a6a727bf84780c17660f6644dab61dd34c23de3001f03cedc401f7d30a4ed9965c2e8a7336e220a329146f2cf85d4eddea429782 - languageName: node - linkType: hard - "deferred-leveldown@npm:~5.3.0": version: 5.3.0 resolution: "deferred-leveldown@npm:5.3.0" @@ -14547,15 +14683,6 @@ __metadata: languageName: node linkType: hard -"dot-prop@npm:^6.0.1": - version: 6.0.1 - resolution: "dot-prop@npm:6.0.1" - dependencies: - is-obj: ^2.0.0 - checksum: 30e51ec6408978a6951b21e7bc4938aad01a86f2fdf779efe52330205c6bb8a8ea12f35925c2029d6dc9d1df22f916f32f828ce1e9b259b1371c580541c22b5a - languageName: node - linkType: hard - "dot@npm:^1.1.3": version: 1.1.3 resolution: "dot@npm:1.1.3" @@ -14740,15 +14867,6 @@ __metadata: languageName: node linkType: hard -"element-resize-detector@npm:^1.2.2": - version: 1.2.4 - resolution: "element-resize-detector@npm:1.2.4" - dependencies: - batch-processor: 1.0.0 - checksum: 8c180c8c2a6d5b83678f994e937890f06db6355009cce2bde3c690a45510c92f53f927431926b27db416739aa7b661c7d3afe237d17cd16491ecccfa740cda08 - languageName: node - linkType: hard - "ember-cli-babel-plugin-helpers@npm:^1.1.1": version: 1.1.1 resolution: "ember-cli-babel-plugin-helpers@npm:1.1.1" @@ -15209,8 +15327,8 @@ __metadata: linkType: hard "es-abstract@npm:^1.19.0, es-abstract@npm:^1.20.4": - version: 1.20.4 - resolution: "es-abstract@npm:1.20.4" + version: 1.20.5 + resolution: "es-abstract@npm:1.20.5" dependencies: call-bind: ^1.0.2 es-to-primitive: ^1.2.1 @@ -15218,6 +15336,7 @@ __metadata: function.prototype.name: ^1.1.5 get-intrinsic: ^1.1.3 get-symbol-description: ^1.0.0 + gopd: ^1.0.1 has: ^1.0.3 has-property-descriptors: ^1.0.0 has-symbols: ^1.0.3 @@ -15233,10 +15352,10 @@ __metadata: object.assign: ^4.1.4 regexp.prototype.flags: ^1.4.3 safe-regex-test: ^1.0.0 - string.prototype.trimend: ^1.0.5 - string.prototype.trimstart: ^1.0.5 + string.prototype.trimend: ^1.0.6 + string.prototype.trimstart: ^1.0.6 unbox-primitive: ^1.0.2 - checksum: 724a6db288e5c2596a169939eb7750d1542c1516fc5a7100b9785fcd955bac9f7f8a35010e20ab4b5c6b2bc228573b82033f4d61ad926f1081d7953f61398c2e + checksum: c99f8a3e9ac15890cde5bf78d1910d72758d3e79c710bd1ad2ab6b595d39ad07209626befaa7c18591bd935a02f6a3bdba3a7e9c8dd6a01146e655df09dc4353 languageName: node linkType: hard @@ -15373,104 +15492,6 @@ __metadata: languageName: node linkType: hard -"esbuild-android-64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-android-64@npm:0.14.54" - conditions: os=android & cpu=x64 - languageName: node - linkType: hard - -"esbuild-android-arm64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-android-arm64@npm:0.14.54" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - -"esbuild-darwin-64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-darwin-64@npm:0.14.54" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"esbuild-darwin-arm64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-darwin-arm64@npm:0.14.54" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"esbuild-freebsd-64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-freebsd-64@npm:0.14.54" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - -"esbuild-freebsd-arm64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-freebsd-arm64@npm:0.14.54" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - -"esbuild-linux-32@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-linux-32@npm:0.14.54" - conditions: os=linux & cpu=ia32 - languageName: node - linkType: hard - -"esbuild-linux-64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-linux-64@npm:0.14.54" - conditions: os=linux & cpu=x64 - languageName: node - linkType: hard - -"esbuild-linux-arm64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-linux-arm64@npm:0.14.54" - conditions: os=linux & cpu=arm64 - languageName: node - linkType: hard - -"esbuild-linux-arm@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-linux-arm@npm:0.14.54" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - -"esbuild-linux-mips64le@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-linux-mips64le@npm:0.14.54" - conditions: os=linux & cpu=mips64el - languageName: node - linkType: hard - -"esbuild-linux-ppc64le@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-linux-ppc64le@npm:0.14.54" - conditions: os=linux & cpu=ppc64 - languageName: node - linkType: hard - -"esbuild-linux-riscv64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-linux-riscv64@npm:0.14.54" - conditions: os=linux & cpu=riscv64 - languageName: node - linkType: hard - -"esbuild-linux-s390x@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-linux-s390x@npm:0.14.54" - conditions: os=linux & cpu=s390x - languageName: node - linkType: hard - "esbuild-loader@npm:^2.19.0": version: 2.20.0 resolution: "esbuild-loader@npm:2.20.0" @@ -15487,20 +15508,6 @@ __metadata: languageName: node linkType: hard -"esbuild-netbsd-64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-netbsd-64@npm:0.14.54" - conditions: os=netbsd & cpu=x64 - languageName: node - linkType: hard - -"esbuild-openbsd-64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-openbsd-64@npm:0.14.54" - conditions: os=openbsd & cpu=x64 - languageName: node - linkType: hard - "esbuild-plugin-alias@npm:^0.2.1": version: 0.2.1 resolution: "esbuild-plugin-alias@npm:0.2.1" @@ -15509,20 +15516,13 @@ __metadata: linkType: hard "esbuild-register@npm:^3.3.3": - version: 3.4.1 - resolution: "esbuild-register@npm:3.4.1" + version: 3.4.2 + resolution: "esbuild-register@npm:3.4.2" dependencies: debug: ^4.3.4 peerDependencies: esbuild: ">=0.12 <1" - checksum: 6364c96f83fc4720d907d6342605f5891986c2a30fbc0a249047195ea5b02c0f7e4e698aa262875b37088f44ca741331d35c026d2606778d114fe082d560957d - languageName: node - linkType: hard - -"esbuild-sunos-64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-sunos-64@npm:0.14.54" - conditions: os=sunos & cpu=x64 + checksum: a7cb278126cf46fee04dad05e362c47e586aaa4bbaa43fc74931f85929b756077a01ee30ebec05c4096c915a980d2d2e75ec7df55685de5a58fa90595a0a1153 languageName: node linkType: hard @@ -15536,106 +15536,88 @@ __metadata: linkType: hard "esbuild-wasm@npm:>=0.13.8": - version: 0.15.16 - resolution: "esbuild-wasm@npm:0.15.16" + version: 0.16.10 + resolution: "esbuild-wasm@npm:0.16.10" bin: esbuild: bin/esbuild - checksum: eeddd3f33e33f66d17f765383ad1de990bacf7eac44527b3674d2dd1720c6151fcb6aa4587f05934f80866f99e0ecea1d6ec26f86564c3871c2e0c6f516a968b + checksum: 227cd31969198f630896096a89cf1eaae36f8a607c80e4d2dfa815e454113fc4a84fcbdf3ee0530b715dc1be61e8d442c879f3ef1914498c96d89baa853a86d3 languageName: node linkType: hard -"esbuild-windows-32@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-windows-32@npm:0.14.54" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - -"esbuild-windows-64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-windows-64@npm:0.14.54" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - -"esbuild-windows-arm64@npm:0.14.54": - version: 0.14.54 - resolution: "esbuild-windows-arm64@npm:0.14.54" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"esbuild@npm:^0.14.48": - version: 0.14.54 - resolution: "esbuild@npm:0.14.54" +"esbuild@npm:^0.16.4": + version: 0.16.10 + resolution: "esbuild@npm:0.16.10" dependencies: - "@esbuild/linux-loong64": 0.14.54 - esbuild-android-64: 0.14.54 - esbuild-android-arm64: 0.14.54 - esbuild-darwin-64: 0.14.54 - esbuild-darwin-arm64: 0.14.54 - esbuild-freebsd-64: 0.14.54 - esbuild-freebsd-arm64: 0.14.54 - esbuild-linux-32: 0.14.54 - esbuild-linux-64: 0.14.54 - esbuild-linux-arm: 0.14.54 - esbuild-linux-arm64: 0.14.54 - esbuild-linux-mips64le: 0.14.54 - esbuild-linux-ppc64le: 0.14.54 - esbuild-linux-riscv64: 0.14.54 - esbuild-linux-s390x: 0.14.54 - esbuild-netbsd-64: 0.14.54 - esbuild-openbsd-64: 0.14.54 - esbuild-sunos-64: 0.14.54 - esbuild-windows-32: 0.14.54 - esbuild-windows-64: 0.14.54 - esbuild-windows-arm64: 0.14.54 + "@esbuild/android-arm": 0.16.10 + "@esbuild/android-arm64": 0.16.10 + "@esbuild/android-x64": 0.16.10 + "@esbuild/darwin-arm64": 0.16.10 + "@esbuild/darwin-x64": 0.16.10 + "@esbuild/freebsd-arm64": 0.16.10 + "@esbuild/freebsd-x64": 0.16.10 + "@esbuild/linux-arm": 0.16.10 + "@esbuild/linux-arm64": 0.16.10 + "@esbuild/linux-ia32": 0.16.10 + "@esbuild/linux-loong64": 0.16.10 + "@esbuild/linux-mips64el": 0.16.10 + "@esbuild/linux-ppc64": 0.16.10 + "@esbuild/linux-riscv64": 0.16.10 + "@esbuild/linux-s390x": 0.16.10 + "@esbuild/linux-x64": 0.16.10 + "@esbuild/netbsd-x64": 0.16.10 + "@esbuild/openbsd-x64": 0.16.10 + "@esbuild/sunos-x64": 0.16.10 + "@esbuild/win32-arm64": 0.16.10 + "@esbuild/win32-ia32": 0.16.10 + "@esbuild/win32-x64": 0.16.10 dependenciesMeta: + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true "@esbuild/linux-loong64": optional: true - esbuild-android-64: + "@esbuild/linux-mips64el": optional: true - esbuild-android-arm64: + "@esbuild/linux-ppc64": optional: true - esbuild-darwin-64: + "@esbuild/linux-riscv64": optional: true - esbuild-darwin-arm64: + "@esbuild/linux-s390x": optional: true - esbuild-freebsd-64: + "@esbuild/linux-x64": optional: true - esbuild-freebsd-arm64: + "@esbuild/netbsd-x64": optional: true - esbuild-linux-32: + "@esbuild/openbsd-x64": optional: true - esbuild-linux-64: + "@esbuild/sunos-x64": optional: true - esbuild-linux-arm: + "@esbuild/win32-arm64": optional: true - esbuild-linux-arm64: + "@esbuild/win32-ia32": optional: true - esbuild-linux-mips64le: - optional: true - esbuild-linux-ppc64le: - optional: true - esbuild-linux-riscv64: - optional: true - esbuild-linux-s390x: - optional: true - esbuild-netbsd-64: - optional: true - esbuild-openbsd-64: - optional: true - esbuild-sunos-64: - optional: true - esbuild-windows-32: - optional: true - esbuild-windows-64: - optional: true - esbuild-windows-arm64: + "@esbuild/win32-x64": optional: true bin: esbuild: bin/esbuild - checksum: 1df3cf7c5175ebee284fd027f287385a07ce8a0f0460a4412881aeff707577d91e55302f220ee8397b3b5aa17f4ceeb80eac16f36fc676532ff1b744e5965f2d + checksum: 60e26fb2f68a19d5fca3b720dde52246ec8f477cf88674abfede42ba96ab08dfcea5bc1c3afd2d50e721aa387f2bf216ddb10b16806dd3edc8b57f29f8308c97 languageName: node linkType: hard @@ -15646,13 +15628,6 @@ __metadata: languageName: node linkType: hard -"escape-goat@npm:^4.0.0": - version: 4.0.0 - resolution: "escape-goat@npm:4.0.0" - checksum: 9d2a8314e2370f2dd9436d177f6b3b1773525df8f895c8f3e1acb716f5fd6b10b336cb1cd9862d4709b36eb207dbe33664838deca9c6d55b8371be4eebb972f6 - languageName: node - linkType: hard - "escape-html@npm:~1.0.3": version: 1.0.3 resolution: "escape-html@npm:1.0.3" @@ -15927,8 +15902,8 @@ __metadata: linkType: hard "eslint-plugin-json-files@npm:^1.1.0": - version: 1.3.0 - resolution: "eslint-plugin-json-files@npm:1.3.0" + version: 1.4.0 + resolution: "eslint-plugin-json-files@npm:1.4.0" dependencies: ajv: ^8.2.0 requireindex: ^1.2.0 @@ -15936,7 +15911,7 @@ __metadata: sort-package-json: ^1.22.1 peerDependencies: eslint: ">=5" - checksum: 2a1c1b3542ba9a78692c1d6fd5333742301c7a3aaf1894a23bf216aec92461d99660032305ad731f7d8c2a38b165a368eb320db2eac2e2afe1baabfd5cbbfdca + checksum: 60811518ac540d08eb2ae089ab065bd952c32a3cf3c9d0f109151b56d99ccdbfff63c350b57a365e1d0c2ab535fc44b5d9245c6102e367f1f6a4ccef3ebb31d0 languageName: node linkType: hard @@ -16040,16 +16015,16 @@ __metadata: linkType: hard "eslint-plugin-storybook@npm:^0.6.6": - version: 0.6.7 - resolution: "eslint-plugin-storybook@npm:0.6.7" + version: 0.6.8 + resolution: "eslint-plugin-storybook@npm:0.6.8" dependencies: "@storybook/csf": ^0.0.1 - "@typescript-eslint/experimental-utils": ^5.3.0 + "@typescript-eslint/utils": ^5.45.0 requireindex: ^1.1.0 ts-dedent: ^2.2.0 peerDependencies: eslint: ">=6" - checksum: 55b7ac0acfb088824db475863ba2f488865cbd7fc5d23acb30e2d7fc8bc044e15b79e1ec307abc8d97c5f207f87012f74fae7b85dc0e623575b40bea137b1e21 + checksum: 0782b8dc57a26e91385a4dbff8aa8f0b0b8730b671c28de766aa9d2c907ee77662b4f42e26b1ee08f51c0304dad8c248c965ad459712ffb0126ee2a2a7c8db49 languageName: node linkType: hard @@ -16106,11 +16081,11 @@ __metadata: linkType: hard "eslint@npm:^8.28.0": - version: 8.28.0 - resolution: "eslint@npm:8.28.0" + version: 8.30.0 + resolution: "eslint@npm:8.30.0" dependencies: - "@eslint/eslintrc": ^1.3.3 - "@humanwhocodes/config-array": ^0.11.6 + "@eslint/eslintrc": ^1.4.0 + "@humanwhocodes/config-array": ^0.11.8 "@humanwhocodes/module-importer": ^1.0.1 "@nodelib/fs.walk": ^1.2.8 ajv: ^6.10.0 @@ -16129,7 +16104,7 @@ __metadata: file-entry-cache: ^6.0.1 find-up: ^5.0.0 glob-parent: ^6.0.2 - globals: ^13.15.0 + globals: ^13.19.0 grapheme-splitter: ^1.0.4 ignore: ^5.2.0 import-fresh: ^3.0.0 @@ -16150,7 +16125,7 @@ __metadata: text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: 5378ee96346cf0c59e9a1de002f7bd19c2c0642ad8010f18254936563fa3cfd1d34fd420de5a31866aab1fa586875d39e4cef6b9367c2a361f2106723f900db2 + checksum: 124e3e96148dfd7838c669222ab29b02265473fd9d800d1ae01f709991bbc680d53e68e986aee257fa0c31d1cdd135c45faf94d2cfeebea5c02fea41e7df1eb0 languageName: node linkType: hard @@ -16836,11 +16811,11 @@ __metadata: linkType: hard "fastq@npm:^1.6.0": - version: 1.13.0 - resolution: "fastq@npm:1.13.0" + version: 1.14.0 + resolution: "fastq@npm:1.14.0" dependencies: reusify: ^1.0.4 - checksum: 76c7b5dafb93c7e74359a3e6de834ce7a7c2e3a3184050ed4cb652661de55cf8d4895178d8d3ccd23069395056c7bb15450660d38fb382ca88c142b22694d7c9 + checksum: 11d27499021965f51db44f258085d84686920318f9a7f778567b097729c01a8e96ecd2ccfca33f1dbc0e01e26a4e48188a2d772c789071abd43d3ad96cdac3ec languageName: node linkType: hard @@ -17168,9 +17143,9 @@ __metadata: linkType: hard "flow-parser@npm:0.*": - version: 0.194.0 - resolution: "flow-parser@npm:0.194.0" - checksum: 5befabfd4ec9e57a0f1923226dcbe5d593f1704a5aca2208ad0590d0e832c7bf73e7b66ee1dd867b94057ac0f21c138e5ff589bfea1becd9030276bdc97e9afe + version: 0.196.1 + resolution: "flow-parser@npm:0.196.1" + checksum: d725af6e9b7796bcd823e64b0672427dc4af1cbddd5ba5c6f47e8dde3bf2ebf0591ee42e1d7c9eb06c59694a979aa02cca3f93ca1dfbc1358a0a60b75ae89240 languageName: node linkType: hard @@ -17244,8 +17219,8 @@ __metadata: linkType: hard "fork-ts-checker-webpack-plugin@npm:^7.2.8": - version: 7.2.13 - resolution: "fork-ts-checker-webpack-plugin@npm:7.2.13" + version: 7.2.14 + resolution: "fork-ts-checker-webpack-plugin@npm:7.2.14" dependencies: "@babel/code-frame": ^7.16.7 chalk: ^4.1.2 @@ -17266,14 +17241,7 @@ __metadata: peerDependenciesMeta: vue-template-compiler: optional: true - checksum: e6ca712c818956e5ed0837cef5e0bbf9ce453c7a82e2efa56a01343d566b330580c6d3bbbfed33705df2987e71398a46c4af901dfcdffe09edfece3f195f6ebd - languageName: node - linkType: hard - -"form-data-encoder@npm:^2.1.2": - version: 2.1.4 - resolution: "form-data-encoder@npm:2.1.4" - checksum: 4c06ae2b79ad693a59938dc49ebd020ecb58e4584860a90a230f80a68b026483b022ba5e4143cff06ae5ac8fd446a0b500fabc87bbac3d1f62f2757f8dabcaf7 + checksum: b635e9376f9233554627352f7e4ac6c41393b439b1468fb5d410dfecb346eb6e39f4273bf9fc84ac316c760f8a7226c9ded679bb2d20d99d9f48cd3243f40c84 languageName: node linkType: hard @@ -17804,7 +17772,7 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:^6.0.0, get-stream@npm:^6.0.1": +"get-stream@npm:^6.0.0": version: 6.0.1 resolution: "get-stream@npm:6.0.1" checksum: 49825d57d3fd6964228e6200a58169464b8e8970489b3acdc24906c782fb7f01f9f56f8e6653c4a50713771d6658f7cfe051e5eb8c12e334138c9c918b296341 @@ -18126,15 +18094,6 @@ __metadata: languageName: node linkType: hard -"global-dirs@npm:^3.0.0": - version: 3.0.1 - resolution: "global-dirs@npm:3.0.1" - dependencies: - ini: 2.0.0 - checksum: ef65e2241a47ff978f7006a641302bc7f4c03dfb98783d42bf7224c136e3a06df046e70ee3a010cf30214114755e46c9eb5eb1513838812fbbe0d92b14c25080 - languageName: node - linkType: hard - "global@npm:^4.4.0": version: 4.4.0 resolution: "global@npm:4.4.0" @@ -18152,12 +18111,12 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.15.0": - version: 13.18.0 - resolution: "globals@npm:13.18.0" +"globals@npm:^13.19.0": + version: 13.19.0 + resolution: "globals@npm:13.19.0" dependencies: type-fest: ^0.20.2 - checksum: 38f675c62cc1564508c970c1bfe1aa38f605041ccac6d2d862a726f8107dec5d66e0deddf7eb2c0a5c0da414b5f63c4ffd87ebc1947c54a387fa513e6f3775e3 + checksum: d2bb3164ed9f5ec82b91e96d6a5ffc1cca3cb10f6c41df9687cd7712ba82f5534ed028b11c5717d71c938403bf8ffc97bb06f5f2eab8c1b91e6273b08b33b5e6 languageName: node linkType: hard @@ -18213,15 +18172,15 @@ __metadata: linkType: hard "globby@npm:^13.1.2": - version: 13.1.2 - resolution: "globby@npm:13.1.2" + version: 13.1.3 + resolution: "globby@npm:13.1.3" dependencies: dir-glob: ^3.0.1 fast-glob: ^3.2.11 ignore: ^5.2.0 merge2: ^1.4.1 slash: ^4.0.0 - checksum: 3366575f4de8862558bfd931cae2c7ed5192f8ce9488e4c65da5aadedcadae36f7625bd85ada77aad3ba93ca0627b424e53f07172f7d12e67eec419694357d33 + checksum: 34199932fad67ae6a4cca764eaad8e7678efabd4321f553bfb8a52046e03f8e8e2f9c14216a6734b692b7c26c4da1b1cfe9ce23733d28d1777d73f4bf34b09c7 languageName: node linkType: hard @@ -18278,26 +18237,7 @@ __metadata: languageName: node linkType: hard -"got@npm:^12.1.0": - version: 12.5.3 - resolution: "got@npm:12.5.3" - dependencies: - "@sindresorhus/is": ^5.2.0 - "@szmarczak/http-timer": ^5.0.1 - cacheable-lookup: ^7.0.0 - cacheable-request: ^10.2.1 - decompress-response: ^6.0.0 - form-data-encoder: ^2.1.2 - get-stream: ^6.0.1 - http2-wrapper: ^2.1.10 - lowercase-keys: ^3.0.0 - p-cancelable: ^3.0.0 - responselike: ^3.0.0 - checksum: 8e1230242e56393c27296e53293e039b9171e938ad842ea54912b1e1be0dbaf3396f830081c3e2a03e77c2cca05e06c9b1db615fa4ff8de6507fb57f2a45d12c - languageName: node - linkType: hard - -"graceful-fs@npm:4.2.10, graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.3, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.2, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.3, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.2, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.10 resolution: "graceful-fs@npm:4.2.10" checksum: 4223a833e38e1d0d2aea630c2433cfb94ddc07dfc11d511dbd6be1d16688c5be848acc31f9a5d0d0ddbfb56d2ee5a6ae0278aceeb0ca6a13f27e06b9956fb952 @@ -18489,13 +18429,6 @@ __metadata: languageName: node linkType: hard -"has-yarn@npm:^3.0.0": - version: 3.0.0 - resolution: "has-yarn@npm:3.0.0" - checksum: 38c76618cb764e4a98ea114a3938e0bed6ceafb6bacab2ffb32e7c7d1e18b5e09cd03387d507ee87072388e1f20b1f80947fee62c41fc450edfbbdc02a665787 - languageName: node - linkType: hard - "has@npm:^1.0.1, has@npm:^1.0.3": version: 1.0.3 resolution: "has@npm:1.0.3" @@ -19034,16 +18967,6 @@ __metadata: languageName: node linkType: hard -"http2-wrapper@npm:^2.1.10": - version: 2.2.0 - resolution: "http2-wrapper@npm:2.2.0" - dependencies: - quick-lru: ^5.1.1 - resolve-alpn: ^1.2.0 - checksum: cb4a41a9b4948a607bb27b4e745af5396e01a5e074da4c7ea0d3ce41acd9cef69de373a67d321728bb651fd9701a23c80e8991c9ad5128dab10e9da28a8b6c72 - languageName: node - linkType: hard - "https-proxy-agent@npm:5.0.0": version: 5.0.0 resolution: "https-proxy-agent@npm:5.0.0" @@ -19259,9 +19182,9 @@ __metadata: linkType: hard "ignore@npm:^5.0.0, ignore@npm:^5.0.4, ignore@npm:^5.0.5, ignore@npm:^5.1.1, ignore@npm:^5.1.9, ignore@npm:^5.2.0": - version: 5.2.1 - resolution: "ignore@npm:5.2.1" - checksum: 79dc9700d077feadee6f0c9d3b6f942e1255b5671e788de9900cbfb1cba8b2679f7b4fff27a5e63b6b8693b65e1890426729ed0847a313b929f1b62e17be00fa + version: 5.2.4 + resolution: "ignore@npm:5.2.4" + checksum: 7c7cd90edd9fea6e037f9b9da4b01bf0a86b198ce78345f9bbd983929d68ff14830be31111edc5d70c264921f4962404d75b7262b4d9cc3bc12381eccbd03096 languageName: node linkType: hard @@ -19326,13 +19249,6 @@ __metadata: languageName: node linkType: hard -"import-lazy@npm:^4.0.0": - version: 4.0.0 - resolution: "import-lazy@npm:4.0.0" - checksum: a3520313e2c31f25c0b06aa66d167f329832b68a4f957d7c9daf6e0fa41822b6e84948191648b9b9d8ca82f94740cdf15eecf2401a5b42cd1c33fd84f2225cca - languageName: node - linkType: hard - "import-local@npm:^2.0.0": version: 2.0.0 resolution: "import-local@npm:2.0.0" @@ -19432,7 +19348,7 @@ __metadata: languageName: node linkType: hard -"ini@npm:^1.3.2, ini@npm:^1.3.4, ini@npm:^1.3.5, ini@npm:~1.3.0": +"ini@npm:^1.3.2, ini@npm:^1.3.4, ini@npm:^1.3.5": version: 1.3.8 resolution: "ini@npm:1.3.8" checksum: ec93838d2328b619532e4f1ff05df7909760b6f66d9c9e2ded11e5c1897d6f2f9980c54dd638f88654b00919ce31e827040631eab0a3969e4d1abefa0719516a @@ -19506,13 +19422,13 @@ __metadata: linkType: hard "internal-slot@npm:^1.0.3": - version: 1.0.3 - resolution: "internal-slot@npm:1.0.3" + version: 1.0.4 + resolution: "internal-slot@npm:1.0.4" dependencies: - get-intrinsic: ^1.1.0 + get-intrinsic: ^1.1.3 has: ^1.0.3 side-channel: ^1.0.4 - checksum: bb41342a474c1b607458b0c716c742d779a6ed9dfaf7986e5d20d1e7f55b7f3676e4d9f416bc253af4fd78d367e1f83e586f74840302bcf2e60c424f9284dde5 + checksum: 37e320dcb66c764d77d84ce2589ce4891ed97461f4cb0c0e0b71e191e00de5a87c7528a9fec2942e1eda5b891b364895cd423a233c58b5197a00e23a70b71924 languageName: node linkType: hard @@ -19700,17 +19616,6 @@ __metadata: languageName: node linkType: hard -"is-ci@npm:^3.0.1": - version: 3.0.1 - resolution: "is-ci@npm:3.0.1" - dependencies: - ci-info: ^3.2.0 - bin: - is-ci: bin.js - checksum: 0e81caa62f4520d4088a5bef6d6337d773828a88610346c4b1119fb50c842587ed8bef1e5d9a656835a599e7209405b5761ddf2339668f2d0f4e889a92fe6051 - languageName: node - linkType: hard - "is-core-module@npm:^2.10.0, is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0": version: 2.11.0 resolution: "is-core-module@npm:2.11.0" @@ -19910,16 +19815,6 @@ __metadata: languageName: node linkType: hard -"is-installed-globally@npm:^0.4.0": - version: 0.4.0 - resolution: "is-installed-globally@npm:0.4.0" - dependencies: - global-dirs: ^3.0.0 - is-path-inside: ^3.0.2 - checksum: f3e6220ee5824b845c9ed0d4b42c24272701f1f9926936e30c0e676254ca5b34d1b92c6205cae11b283776f9529212c0cdabb20ec280a6451677d6493ca9c22d - languageName: node - linkType: hard - "is-interactive@npm:^1.0.0": version: 1.0.0 resolution: "is-interactive@npm:1.0.0" @@ -19948,13 +19843,6 @@ __metadata: languageName: node linkType: hard -"is-npm@npm:^6.0.0": - version: 6.0.0 - resolution: "is-npm@npm:6.0.0" - checksum: 1f064c66325cba6e494783bee4e635caa2655aad7f853a0e045d086e0bb7d83d2d6cdf1745dc9a7c7c93dacbf816fbee1f8d9179b02d5d01674d4f92541dc0d9 - languageName: node - linkType: hard - "is-number-object@npm:^1.0.4": version: 1.0.7 resolution: "is-number-object@npm:1.0.7" @@ -20255,13 +20143,6 @@ __metadata: languageName: node linkType: hard -"is-yarn-global@npm:^0.4.0": - version: 0.4.1 - resolution: "is-yarn-global@npm:0.4.1" - checksum: 8ff66f33454614f8e913ad91cc4de0d88d519a46c1ed41b3f589da79504ed0fcfa304064fe3096dda9360c5f35aa210cb8e978fd36798f3118cb66a4de64d365 - languageName: node - linkType: hard - "isarray@npm:0.0.1": version: 0.0.1 resolution: "isarray@npm:0.0.1" @@ -20794,8 +20675,8 @@ __metadata: linkType: hard "jest-image-snapshot@npm:^6.0.0": - version: 6.0.0 - resolution: "jest-image-snapshot@npm:6.0.0" + version: 6.1.0 + resolution: "jest-image-snapshot@npm:6.1.0" dependencies: chalk: ^4.0.0 get-stdin: ^5.0.1 @@ -20808,7 +20689,7 @@ __metadata: ssim.js: ^3.1.1 peerDependencies: jest: ">=20 <=29" - checksum: 2ec7ab03f0857d603b272aedf6fb2d18c85eb3cda43c2388f9f9f51b43b0fe1a18ec1d84c8a3598b11506bbc941caab9a49ab19309ce865d86bcc32ff6a1920e + checksum: 5426ec5fd96eab7657e2cc63fda173210d7b27f83bb9415945a714d66ba05b05e8fee7227025bb95a49115cbad2c3c0fc0f9042cec461f98f66707a9964d1ba8 languageName: node linkType: hard @@ -21541,9 +21422,9 @@ __metadata: linkType: hard "jquery@npm:^3.5.1": - version: 3.6.1 - resolution: "jquery@npm:3.6.1" - checksum: 5867ba6c9f4eecb8e55965288799b2569f83cdac5f97602d6ae17959c3ff17e728dc7c6f75e607e00d235bfb41d6c730b61953a0052046e67784e2fb5edd151c + version: 3.6.2 + resolution: "jquery@npm:3.6.2" + checksum: 4746ca404f56ab5abe21ba49d05fe809491d618ed2b2a37ed0a745f0744af88fe34e525bdb85335d239425f87161acef7b8ea917727f5fa9f9700e9e72047f3e languageName: node linkType: hard @@ -21774,13 +21655,6 @@ __metadata: languageName: node linkType: hard -"json-buffer@npm:3.0.1": - version: 3.0.1 - resolution: "json-buffer@npm:3.0.1" - checksum: 0d1c91569d9588e7eef2b49b59851f297f3ab93c7b35c7c221e288099322be6b562767d11e4821da500f3219542b9afd2e54c5dc573107c1126ed1080f8e96d7 - languageName: node - linkType: hard - "json-parse-better-errors@npm:^1.0.0, json-parse-better-errors@npm:^1.0.1": version: 1.0.2 resolution: "json-parse-better-errors@npm:1.0.2" @@ -21840,11 +21714,11 @@ __metadata: linkType: hard "json5@npm:2.x, json5@npm:^2.0.0, json5@npm:^2.1.0, json5@npm:^2.1.2, json5@npm:^2.2.0, json5@npm:^2.2.1": - version: 2.2.1 - resolution: "json5@npm:2.2.1" + version: 2.2.2 + resolution: "json5@npm:2.2.2" bin: json5: lib/cli.js - checksum: a7174bc4e146613750a04a8a7fe2bc4ab6f4cad20486f8d7026cc4546b3ee1dc3762fc5e7377557ae99414745aac782486e409f31c363084a455e05cb495ce7a + checksum: 3e145dd8a0aa96c305904539817b6564e776e26672b0e6107cd65cfb65fd452b8aa7f322fb17f395d0256834a0c68bbfdece503975e90f97fa8a2111e1af8932 languageName: node linkType: hard @@ -22017,15 +21891,6 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.5.2": - version: 4.5.2 - resolution: "keyv@npm:4.5.2" - dependencies: - json-buffer: 3.0.1 - checksum: b633bf53a5afa5591f383d326746226e110e59f13c7e1e8d3e3c9580d2c2345c5eefc21cce168cd5be7fa34b9163e391927146fbd2b7ee7aa2f3aa02b7f0a7de - languageName: node - linkType: hard - "kind-of@npm:^3.0.2, kind-of@npm:^3.0.3, kind-of@npm:^3.2.0": version: 3.2.2 resolution: "kind-of@npm:3.2.2" @@ -22105,7 +21970,7 @@ __metadata: languageName: node linkType: hard -"language-subtag-registry@npm:~0.3.2": +"language-subtag-registry@npm:^0.3.20": version: 0.3.22 resolution: "language-subtag-registry@npm:0.3.22" checksum: d1e09971260a7cd3b9fdeb190d33af0b6e99c8697013537d9aaa15f7856d9d83aee128ba8078e219df0a7cf4b8dd18d1a0c188f6543b500d92a2689d2d114b70 @@ -22113,20 +21978,11 @@ __metadata: linkType: hard "language-tags@npm:^1.0.5": - version: 1.0.5 - resolution: "language-tags@npm:1.0.5" + version: 1.0.7 + resolution: "language-tags@npm:1.0.7" dependencies: - language-subtag-registry: ~0.3.2 - checksum: 04215e821af9a8f1bc6c99ab5aa0a316c3fe1912ca3337eb28596316064bddd8edd22f2883d866069ebdf01b2002e504a760a336b2c728b6d30514e86744f76c - languageName: node - linkType: hard - -"latest-version@npm:^7.0.0": - version: 7.0.0 - resolution: "latest-version@npm:7.0.0" - dependencies: - package-json: ^8.1.0 - checksum: 68045f5e419e005c12e595ae19687dd88317dd0108b83a8773197876622c7e9d164fe43aacca4f434b2cba105c92848b89277f658eabc5d50e81fb743bbcddb1 + language-subtag-registry: ^0.3.20 + checksum: 2bd351e950c4503d6680da9668f8bb42a6d291e84a5d90f52d17c6411c33fd9f25e197e965d9df49b7fdb5146bec8fea17bdfac174618985ba89dcae8ccc2f4e languageName: node linkType: hard @@ -22462,11 +22318,11 @@ __metadata: linkType: hard "lit-html@npm:^2.2.0, lit-html@npm:^2.3.0": - version: 2.4.0 - resolution: "lit-html@npm:2.4.0" + version: 2.5.0 + resolution: "lit-html@npm:2.5.0" dependencies: "@types/trusted-types": ^2.0.2 - checksum: ef7293f41ff6cbfed4e477a75720d866abe7cd88073bd6f623f5a58f42883475ff3c423bbd6bf6ead044c8ab71ef04606abfca2d4e0ffc885d8560bbab89ec68 + checksum: b74c6103df80ffc84c8d0140078c24c09d030cd0c8e13f21cc238fd10a6b4e54ed66da4a037009ae16ba5706cd98de056c167226a3eeb4d7663ed8c768e3c16f languageName: node linkType: hard @@ -22914,13 +22770,6 @@ __metadata: languageName: node linkType: hard -"lowercase-keys@npm:^3.0.0": - version: 3.0.0 - resolution: "lowercase-keys@npm:3.0.0" - checksum: ef62b9fa5690ab0a6e4ef40c94efce68e3ed124f583cc3be38b26ff871da0178a28b9a84ce0c209653bb25ca135520ab87fea7cd411a54ac4899cb2f30501430 - languageName: node - linkType: hard - "lowlight@npm:^1.17.0": version: 1.20.0 resolution: "lowlight@npm:1.20.0" @@ -23041,6 +22890,15 @@ __metadata: languageName: node linkType: hard +"magic-string@npm:^0.27.0": + version: 0.27.0 + resolution: "magic-string@npm:0.27.0" + dependencies: + "@jridgewell/sourcemap-codec": ^1.4.13 + checksum: cddacfea14441ca57ae8a307bc3cf90bac69efaa4138dd9a80804cffc2759bf06f32da3a293fb13eaa96334b7d45b7768a34f1d226afae25d2f05b05a3bb37d8 + languageName: node + linkType: hard + "make-dir@npm:^1.0.0": version: 1.3.0 resolution: "make-dir@npm:1.3.0" @@ -23234,11 +23092,11 @@ __metadata: linkType: hard "markdown-to-jsx@npm:^7.1.3": - version: 7.1.7 - resolution: "markdown-to-jsx@npm:7.1.7" + version: 7.1.8 + resolution: "markdown-to-jsx@npm:7.1.8" peerDependencies: react: ">= 0.14.0" - checksum: 2473c94cebf93503bfc62662614c511b1e21893cbd7f2a4d64d77f186ae0d9febfabfe620a25dc4311e98eaaa3c1956d9139a0e4dd8636aaa83060aa7d5d89c5 + checksum: a83bea16a4ac4053d3dcd4a3feed5a7fdd8f8e03ac4c7439b1b214fb797216e1712a690a3f03d5fc850027ca911ba4b243a7b8c97471ed870889184321f41d43 languageName: node linkType: hard @@ -23261,11 +23119,11 @@ __metadata: linkType: hard "marked@npm:^4.0.12": - version: 4.2.3 - resolution: "marked@npm:4.2.3" + version: 4.2.4 + resolution: "marked@npm:4.2.4" bin: marked: bin/marked.js - checksum: 5926ad8971d2e7be16a0a24e0fea1d2ab6dda2694b54acabfe9a35641e0db7ca5324bf3032f09874f1a92a6dadb6d95719a0c3cdc6c2c6e3a026813144ce8f47 + checksum: ce34555b993825eae46d4a51cf9d69b5af093e9f539a6db0277d12cabe1440eb4ebef60cf2880ae12934d1d70c3c97cd1df2b06c0882c252b0c55ece1e7539e4 languageName: node linkType: hard @@ -23619,20 +23477,6 @@ __metadata: languageName: node linkType: hard -"mimic-response@npm:^3.1.0": - version: 3.1.0 - resolution: "mimic-response@npm:3.1.0" - checksum: 0d6f07ce6e03e9e4445bee655202153bdb8a98d67ee8dc965ac140900d7a2688343e6b4c9a72cfc9ef2f7944dfd76eef4ab2482eb7b293a68b84916bac735362 - languageName: node - linkType: hard - -"mimic-response@npm:^4.0.0": - version: 4.0.0 - resolution: "mimic-response@npm:4.0.0" - checksum: 761d788d2668ae9292c489605ffd4fad220f442fbae6832adce5ebad086d691e906a6d5240c290293c7a11e99fbdbbef04abbbed498bf8699a4ee0f31315e3fb - languageName: node - linkType: hard - "min-document@npm:^2.19.0": version: 2.19.0 resolution: "min-document@npm:2.19.0" @@ -23694,7 +23538,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^5.0.1, minimatch@npm:^5.1.0": +"minimatch@npm:^5.0.1, minimatch@npm:^5.1.1": version: 5.1.1 resolution: "minimatch@npm:5.1.1" dependencies: @@ -23826,6 +23670,15 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^4.0.0": + version: 4.0.0 + resolution: "minipass@npm:4.0.0" + dependencies: + yallist: ^4.0.0 + checksum: ea9a3eee82a33899693db3c25333ce15d1a900bb7ef47aa97d44db91d293bcbd9a3c5127da617b92844411fcaf6270c37f79755bbcbe11e5d329f60bad6d7229 + languageName: node + linkType: hard + "minizlib@npm:^1.3.3": version: 1.3.3 resolution: "minizlib@npm:1.3.3" @@ -24237,23 +24090,23 @@ __metadata: linkType: hard "next@npm:^13.0.5": - version: 13.0.5 - resolution: "next@npm:13.0.5" + version: 13.0.7 + resolution: "next@npm:13.0.7" dependencies: - "@next/env": 13.0.5 - "@next/swc-android-arm-eabi": 13.0.5 - "@next/swc-android-arm64": 13.0.5 - "@next/swc-darwin-arm64": 13.0.5 - "@next/swc-darwin-x64": 13.0.5 - "@next/swc-freebsd-x64": 13.0.5 - "@next/swc-linux-arm-gnueabihf": 13.0.5 - "@next/swc-linux-arm64-gnu": 13.0.5 - "@next/swc-linux-arm64-musl": 13.0.5 - "@next/swc-linux-x64-gnu": 13.0.5 - "@next/swc-linux-x64-musl": 13.0.5 - "@next/swc-win32-arm64-msvc": 13.0.5 - "@next/swc-win32-ia32-msvc": 13.0.5 - "@next/swc-win32-x64-msvc": 13.0.5 + "@next/env": 13.0.7 + "@next/swc-android-arm-eabi": 13.0.7 + "@next/swc-android-arm64": 13.0.7 + "@next/swc-darwin-arm64": 13.0.7 + "@next/swc-darwin-x64": 13.0.7 + "@next/swc-freebsd-x64": 13.0.7 + "@next/swc-linux-arm-gnueabihf": 13.0.7 + "@next/swc-linux-arm64-gnu": 13.0.7 + "@next/swc-linux-arm64-musl": 13.0.7 + "@next/swc-linux-x64-gnu": 13.0.7 + "@next/swc-linux-x64-musl": 13.0.7 + "@next/swc-win32-arm64-msvc": 13.0.7 + "@next/swc-win32-ia32-msvc": 13.0.7 + "@next/swc-win32-x64-msvc": 13.0.7 "@swc/helpers": 0.4.14 caniuse-lite: ^1.0.30001406 postcss: 8.4.14 @@ -24300,7 +24153,7 @@ __metadata: optional: true bin: next: dist/bin/next - checksum: b0cf0079977c610cc99389744f2085f27b2c707e2ab27d39a5c07f411febdf9dd3e54a57d9d5db8c495b041dd1f1660c23e0d65d8e3c519fa1425e4a9f77f65a + checksum: 3571a3e6fc7a7cb66b944cc61a94028049b6940a79438426e4d147538819259ee31fb376591c1a4cec78feda44c97227dccc7166886510019bfcfb91fd64c1ba languageName: node linkType: hard @@ -24485,8 +24338,8 @@ __metadata: linkType: hard "node-gyp@npm:latest": - version: 9.3.0 - resolution: "node-gyp@npm:9.3.0" + version: 9.3.1 + resolution: "node-gyp@npm:9.3.1" dependencies: env-paths: ^2.2.0 glob: ^7.1.4 @@ -24500,7 +24353,7 @@ __metadata: which: ^2.0.2 bin: node-gyp: bin/node-gyp.js - checksum: 3b326bc3accca849c62503820c13d9362d142dbe4189a5a3a2f2b6de4e872303f2d6cc2dd59e044bf4ca967bfd3eeb3d0c5d8d3b77e28e4e4f8d909697ff5a7e + checksum: 3285c110768eb65aadd9aa1d056f917e594ea22611d21fd535ab3677ea433d0a281e7f09bc73d53e64b02214f4379dbca476dc33faffe455b0ac1d5ba92802f4 languageName: node linkType: hard @@ -24519,9 +24372,9 @@ __metadata: linkType: hard "node-releases@npm:^2.0.6": - version: 2.0.6 - resolution: "node-releases@npm:2.0.6" - checksum: 25b08960cdf6a85075baf312f7cdcb4f9190c87abf42649ac441448a02486df3798363896bf2f0f9c6a1c7e26b3ca298c8a9295f7dd5e5eff6b6a78574a88350 + version: 2.0.8 + resolution: "node-releases@npm:2.0.8" + checksum: 4b58f44de428b630fae7e8bcd7bf8e4030dab628122acff3ce2df6bb480c00b97319bb9408e3be23b258329350c31e1cb27a232ba548c35f3bce2d647717be58 languageName: node linkType: hard @@ -24604,13 +24457,6 @@ __metadata: languageName: node linkType: hard -"normalize-url@npm:^8.0.0": - version: 8.0.0 - resolution: "normalize-url@npm:8.0.0" - checksum: 09582d56acd562d89849d9239852c2aff225c72be726556d6883ff36de50006803d32a023c10e917bcc1c55f73f3bb16434f67992fe9b61906a3db882192753c - languageName: node - linkType: hard - "npm-bundled@npm:^1.0.1, npm-bundled@npm:^1.1.1": version: 1.1.2 resolution: "npm-bundled@npm:1.1.2" @@ -25227,13 +25073,6 @@ __metadata: languageName: node linkType: hard -"p-cancelable@npm:^3.0.0": - version: 3.0.0 - resolution: "p-cancelable@npm:3.0.0" - checksum: 948fd4f8e87b956d9afc2c6c7392de9113dac817cb1cecf4143f7a3d4c57ab5673614a80be3aba91ceec5e4b69fd8c869852d7e8048bc3d9273c4c36ce14b9aa - languageName: node - linkType: hard - "p-finally@npm:^1.0.0": version: 1.0.0 resolution: "p-finally@npm:1.0.0" @@ -25392,18 +25231,6 @@ __metadata: languageName: node linkType: hard -"package-json@npm:^8.1.0": - version: 8.1.0 - resolution: "package-json@npm:8.1.0" - dependencies: - got: ^12.1.0 - registry-auth-token: ^5.0.1 - registry-url: ^6.0.0 - semver: ^7.3.7 - checksum: 521005d98fbd1203fea191a727d4685aac7764e09022adb66c60b3b5d4dd68b29231910129c437060b6216cdd0146c1c8fa2be31a968b63f45a70deb91718238 - languageName: node - linkType: hard - "pacote@npm:12.0.3": version: 12.0.3 resolution: "pacote@npm:12.0.3" @@ -25842,14 +25669,14 @@ __metadata: linkType: hard "pdfmake@npm:^0.2.4": - version: 0.2.6 - resolution: "pdfmake@npm:0.2.6" + version: 0.2.7 + resolution: "pdfmake@npm:0.2.7" dependencies: "@foliojs-fork/linebreak": ^1.1.1 "@foliojs-fork/pdfkit": ^0.13.0 iconv-lite: ^0.6.3 xmldoc: ^1.1.2 - checksum: d6af91cf4b052cc2ae9509afa1e0740ab9ff153d6ec94f5056b75177bf758710c914556422bdc615e42e063e52195cd1db437cc22653e5f5717d94d8ec086c71 + checksum: d42e0c6dee186d4b25685dc6fc02d5a6269b74c6443cda9853e3e0c9e50d6e8b3d29aa742023082fec00f0cffb284204eead5abae856ef81b66477803decfa31 languageName: node linkType: hard @@ -26008,23 +25835,23 @@ __metadata: languageName: node linkType: hard -"playwright-core@npm:1.28.0": - version: 1.28.0 - resolution: "playwright-core@npm:1.28.0" +"playwright-core@npm:1.29.0": + version: 1.29.0 + resolution: "playwright-core@npm:1.29.0" bin: playwright: cli.js - checksum: c0b1172bcfc7efd9ac91b166679d84b0b86b69d7cd1b199c1951665dc4632d1afb3225cd0df2eda549ae14461689b6a826fb4901c0a39b25161f781ab8dd94a3 + checksum: 9fc6260985b71f99fc701c0411ab76cb7a67a381623ccb518a4ac67d116d7dd9d72de6ed3f8fb0a7f951c7ba3b5c521b9762677f9c052a1c084925f493356ac1 languageName: node linkType: hard -"playwright@npm:1.28.0": - version: 1.28.0 - resolution: "playwright@npm:1.28.0" +"playwright@npm:1.29.0": + version: 1.29.0 + resolution: "playwright@npm:1.29.0" dependencies: - playwright-core: 1.28.0 + playwright-core: 1.29.0 bin: playwright: cli.js - checksum: 3c72e2106ae954b1f5db9b9f9abdba1b9c994fb77b72076371f7231ba7b01de096bdefea9c1010c949930d497ba325abc17d4f8df0274e315bbf2ee9f3350133 + checksum: 3c93fa1f80de5de37600dbe7dc76e2d10718a67a65a209c04fab9367d87c68b1caf14c1cdb44e7edc15f289aa32e469c38c019eceb67a839b43044517f1b9437 languageName: node linkType: hard @@ -26164,13 +25991,13 @@ __metadata: linkType: hard "postcss-custom-properties@npm:^12.1.2": - version: 12.1.10 - resolution: "postcss-custom-properties@npm:12.1.10" + version: 12.1.11 + resolution: "postcss-custom-properties@npm:12.1.11" dependencies: postcss-value-parser: ^4.2.0 peerDependencies: postcss: ^8.2 - checksum: 567245deb152d4b390aa13b45c0801abf14a549d8c44140229dd3411ed8a7b68c9da233260dd27aef863040079ff18509bba0447fd128eaa905279d523be72d5 + checksum: 99ad5a9f9a69590141157e447f48d9d6da74f0e83bf552cd5a4e74db7a03222f1e9e37df7ee442a7b97f5c6c824c1018667ee27ac64e0bc6ee7e67e89bc552c5 languageName: node linkType: hard @@ -26622,14 +26449,14 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.1.10, postcss@npm:^8.2.14, postcss@npm:^8.2.15, postcss@npm:^8.3.7, postcss@npm:^8.4.14, postcss@npm:^8.4.18": - version: 8.4.19 - resolution: "postcss@npm:8.4.19" +"postcss@npm:^8.1.10, postcss@npm:^8.2.14, postcss@npm:^8.2.15, postcss@npm:^8.3.7, postcss@npm:^8.4.14, postcss@npm:^8.4.19, postcss@npm:^8.4.20": + version: 8.4.20 + resolution: "postcss@npm:8.4.20" dependencies: nanoid: ^3.3.4 picocolors: ^1.0.0 source-map-js: ^1.0.2 - checksum: f33594fa0a2b629043deada34171744891054255baa49150d77f08f68edec1fa7eb9740e64c3a32e6f476c16e9e592af942fcf55f93051673dd208c0aee1d60b + checksum: 12b0b65d51a69673c4c5a5270c45a1c8b303601b17b7f373ce4319e900248e9c8923367616c5c5f6df39411e5af5a7df772bdf889959a52b58c53fc715d624dd languageName: node linkType: hard @@ -26674,7 +26501,7 @@ __metadata: languageName: node linkType: hard -"prettier@npm:2.8.0, prettier@npm:^1.18.2 || ^2.0.0, prettier@npm:^2.8.0": +"prettier@npm:2.8.0": version: 2.8.0 resolution: "prettier@npm:2.8.0" bin: @@ -26683,6 +26510,15 @@ __metadata: languageName: node linkType: hard +"prettier@npm:^1.18.2 || ^2.0.0, prettier@npm:^2.8.0": + version: 2.8.1 + resolution: "prettier@npm:2.8.1" + bin: + prettier: bin-prettier.js + checksum: 66a2967780f7ebb724e0470c61b97ac19d2e91258f26288e4920138621a845958d86df23ec37c9342ddf475872396f2c458e9fbabb095631b03e436f315002b2 + languageName: node + linkType: hard + "pretty-bytes@npm:^5.3.0": version: 5.6.0 resolution: "pretty-bytes@npm:5.6.0" @@ -27174,15 +27010,6 @@ __metadata: languageName: node linkType: hard -"pupa@npm:^3.1.0": - version: 3.1.0 - resolution: "pupa@npm:3.1.0" - dependencies: - escape-goat: ^4.0.0 - checksum: 02afa6e4547a733484206aaa8f8eb3fbfb12d3dd17d7ca4fa1ea390a7da2cb8f381e38868bbf68009c4d372f8f6059f553171b6a712d8f2802c7cd43d513f06c - languageName: node - linkType: hard - "puppeteer-core@npm:^2.1.1": version: 2.1.1 resolution: "puppeteer-core@npm:2.1.1" @@ -27323,13 +27150,6 @@ __metadata: languageName: node linkType: hard -"quick-lru@npm:^5.1.1": - version: 5.1.1 - resolution: "quick-lru@npm:5.1.1" - checksum: a24cba5da8cec30d70d2484be37622580f64765fb6390a928b17f60cd69e8dbd32a954b3ff9176fa1b86d86ff2ba05252fae55dc4d40d0291c60412b0ad096da - languageName: node - linkType: hard - "quick-temp@npm:^0.1.3, quick-temp@npm:^0.1.5, quick-temp@npm:^0.1.8": version: 0.1.8 resolution: "quick-temp@npm:0.1.8" @@ -27427,20 +27247,6 @@ __metadata: languageName: node linkType: hard -"rc@npm:1.2.8": - version: 1.2.8 - resolution: "rc@npm:1.2.8" - dependencies: - deep-extend: ^0.6.0 - ini: ~1.3.0 - minimist: ^1.2.0 - strip-json-comments: ~2.0.1 - bin: - rc: ./cli.js - checksum: 24a07653150f0d9ac7168e52943cc3cb4b7a22c0e43c7dff3219977c2fdca5a2760a304a029c20811a0e79d351f57d46c9bde216193a0f73978496afc2b85b15 - languageName: node - linkType: hard - "react-colorful@npm:^5.1.2": version: 5.6.1 resolution: "react-colorful@npm:5.6.1" @@ -27460,6 +27266,26 @@ __metadata: languageName: node linkType: hard +"react-docgen@npm:6.0.0-alpha.3": + version: 6.0.0-alpha.3 + resolution: "react-docgen@npm:6.0.0-alpha.3" + dependencies: + "@babel/core": ^7.7.5 + "@babel/generator": ^7.12.11 + ast-types: ^0.14.2 + commander: ^2.19.0 + doctrine: ^3.0.0 + estree-to-babel: ^3.1.0 + neo-async: ^2.6.1 + node-dir: ^0.1.10 + resolve: ^1.17.0 + strip-indent: ^3.0.0 + bin: + react-docgen: bin/react-docgen.js + checksum: 284bba5528d5e9084c3ed36b2d2fec8fc5d55f3fb8ca544ec3a0d1ab98c39001ecb7db6e03a1088b82eb3d750c1343cde2fc9b7729540277eda40e10f38912d8 + languageName: node + linkType: hard + "react-docgen@npm:^5.0.0": version: 5.4.3 resolution: "react-docgen@npm:5.4.3" @@ -27480,26 +27306,6 @@ __metadata: languageName: node linkType: hard -"react-docgen@npm:^6.0.0-alpha.3": - version: 6.0.0-alpha.3 - resolution: "react-docgen@npm:6.0.0-alpha.3" - dependencies: - "@babel/core": ^7.7.5 - "@babel/generator": ^7.12.11 - ast-types: ^0.14.2 - commander: ^2.19.0 - doctrine: ^3.0.0 - estree-to-babel: ^3.1.0 - neo-async: ^2.6.1 - node-dir: ^0.1.10 - resolve: ^1.17.0 - strip-indent: ^3.0.0 - bin: - react-docgen: bin/react-docgen.js - checksum: 284bba5528d5e9084c3ed36b2d2fec8fc5d55f3fb8ca544ec3a0d1ab98c39001ecb7db6e03a1088b82eb3d750c1343cde2fc9b7729540277eda40e10f38912d8 - languageName: node - linkType: hard - "react-dom@npm:^16.8.0": version: 16.14.0 resolution: "react-dom@npm:16.14.0" @@ -27657,6 +27463,18 @@ __metadata: languageName: node linkType: hard +"react-resize-detector@npm:^7.1.2": + version: 7.1.2 + resolution: "react-resize-detector@npm:7.1.2" + dependencies: + lodash: ^4.17.21 + peerDependencies: + react: ^16.0.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 + checksum: 2285b0024bcc736c7d5e80279e819835a5e8bef0899778100d2434b1c4b10971e6ae253df073ca96a20cacc47b3c249bc675479e5fc4ec1f6652fcca7f48ec22 + languageName: node + linkType: hard + "react-router-dom@npm:6.0.2": version: 6.0.2 resolution: "react-router-dom@npm:6.0.2" @@ -27681,18 +27499,6 @@ __metadata: languageName: node linkType: hard -"react-sizeme@npm:^3.0.1": - version: 3.0.2 - resolution: "react-sizeme@npm:3.0.2" - dependencies: - element-resize-detector: ^1.2.2 - invariant: ^2.2.4 - shallowequal: ^1.1.0 - throttle-debounce: ^3.0.1 - checksum: e6b336bbc1e9de78de5c7177afd398f6ea14c4284af698475f08d34389e9307cbc36c0125a61b158e026f182ae4dd17b13c28683bbc1a371792bccd1e51cccff - languageName: node - linkType: hard - "react-syntax-highlighter@npm:^15.4.5, react-syntax-highlighter@npm:^15.5.0": version: 15.5.0 resolution: "react-syntax-highlighter@npm:15.5.0" @@ -28001,7 +27807,7 @@ __metadata: languageName: node linkType: hard -"recast@npm:^0.20.4": +"recast@npm:^0.20.3, recast@npm:^0.20.4": version: 0.20.5 resolution: "recast@npm:0.20.5" dependencies: @@ -28172,24 +27978,6 @@ __metadata: languageName: node linkType: hard -"registry-auth-token@npm:^5.0.1": - version: 5.0.1 - resolution: "registry-auth-token@npm:5.0.1" - dependencies: - "@pnpm/npm-conf": ^1.0.4 - checksum: e14aca7344168d4662d18ad66caf58585c1af516067a419c8a5b31376c1b192a63f1d29dee3ed45d4eee783f9c93ca1d1253ddf28281472e08cc3807c47ef153 - languageName: node - linkType: hard - -"registry-url@npm:^6.0.0": - version: 6.0.1 - resolution: "registry-url@npm:6.0.1" - dependencies: - rc: 1.2.8 - checksum: 66e2221c8113fc35ee9d23fe58cb516fc8d556a189fb8d6f1011a02efccc846c4c9b5075b4027b99a5d5c9ad1345ac37f297bea3c0ca30d607ec8084bf561b90 - languageName: node - linkType: hard - "regjsgen@npm:^0.7.1": version: 0.7.1 resolution: "regjsgen@npm:0.7.1" @@ -28832,10 +28620,10 @@ __metadata: languageName: node linkType: hard -"resolve-alpn@npm:^1.2.0": - version: 1.2.1 - resolution: "resolve-alpn@npm:1.2.1" - checksum: b70b29c1843bc39781ef946c8cd4482e6d425976599c0f9c138cec8209e4e0736161bf39319b01676a847000085dfdaf63583c6fb4427bf751a10635bd2aa0c4 +"resize-observer-polyfill@npm:^1.5.1": + version: 1.5.1 + resolution: "resize-observer-polyfill@npm:1.5.1" + checksum: 5e882475067f0b97dc07e0f37c3e335ac5bc3520d463f777cec7e894bb273eddbfecb857ae668e6fb6881fd6f6bb7148246967172139302da50fa12ea3a15d95 languageName: node linkType: hard @@ -29027,15 +28815,6 @@ __metadata: languageName: node linkType: hard -"responselike@npm:^3.0.0": - version: 3.0.0 - resolution: "responselike@npm:3.0.0" - dependencies: - lowercase-keys: ^3.0.0 - checksum: 8af27153f7e47aa2c07a5f2d538cb1e5872995f0e9ff77def858ecce5c3fe677d42b824a62cde502e56d275ab832b0a8bd350d5cd6b467ac0425214ac12ae658 - languageName: node - linkType: hard - "restore-cursor@npm:^2.0.0": version: 2.0.0 resolution: "restore-cursor@npm:2.0.0" @@ -29156,9 +28935,9 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^2.79.1": - version: 2.79.1 - resolution: "rollup@npm:2.79.1" +"rollup@npm:^3.0.0, rollup@npm:^3.2.5, rollup@npm:^3.7.0": + version: 3.7.5 + resolution: "rollup@npm:3.7.5" dependencies: fsevents: ~2.3.2 dependenciesMeta: @@ -29166,21 +28945,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 421418687f5dcd7324f4387f203c6bfc7118b7ace789e30f5da022471c43e037a76f5fd93837052754eeeae798a4fb266ac05ccee1e594406d912a59af98dde9 - languageName: node - linkType: hard - -"rollup@npm:^3.0.0, rollup@npm:^3.2.5": - version: 3.5.1 - resolution: "rollup@npm:3.5.1" - dependencies: - fsevents: ~2.3.2 - dependenciesMeta: - fsevents: - optional: true - bin: - rollup: dist/bin/rollup - checksum: 6e9621f169e79df96e6c22780a579c274f5be2b8fee3d5bffe29dda989263b6800ec8b276939ce6feab46aa0f5980a71505e1f80b2552fb90c848669c61907a7 + checksum: 32ff1b7a8fd0d0b1acc338627e66bd689a44953dd2d270382c4a51b05a07ca9a7b61a5b03073f3f2eb357ac91cefba3dbd0c7145f5902bd4bed542e9fd34edfb languageName: node linkType: hard @@ -29250,11 +29015,11 @@ __metadata: linkType: hard "rxjs@npm:^7.2.0, rxjs@npm:^7.5.1": - version: 7.5.7 - resolution: "rxjs@npm:7.5.7" + version: 7.8.0 + resolution: "rxjs@npm:7.8.0" dependencies: tslib: ^2.1.0 - checksum: 283620b3c90b85467c3549f7cda0dd768bc18719cccbbdd9aacadb0f0946827ab20d036f1a00d78066d769764e73070bfee8706091d77b8d971975598f6cbbd4 + checksum: c48833638ae5d339332f8b792e716c3c662950ba95ba04e9e97a8cfd4628d8f009129672793c6c067c872a4dab5757231d41d7256a2114a5fabbf30d8a5b9d67 languageName: node linkType: hard @@ -29439,7 +29204,7 @@ __metadata: version: 0.0.0-use.local resolution: "sb@workspace:lib/cli-sb" dependencies: - "@storybook/cli": 7.0.0-beta.0 + "@storybook/cli": 7.0.0-beta.12 bin: sb: ./index.js languageName: unknown @@ -29534,15 +29299,6 @@ __metadata: languageName: node linkType: hard -"semver-diff@npm:^4.0.0": - version: 4.0.0 - resolution: "semver-diff@npm:4.0.0" - dependencies: - semver: ^7.3.5 - checksum: 3ed1bb22f39b4b6e98785bb066e821eabb9445d3b23e092866c50e7df8b9bd3eda617b242f81db4159586e0e39b0deb908dd160a24f783bd6f52095b22cd68ea - languageName: node - linkType: hard - "semver-regex@npm:^3.1.2": version: 3.1.4 resolution: "semver-regex@npm:3.1.4" @@ -29601,6 +29357,15 @@ __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.17.1": version: 0.17.1 resolution: "send@npm:0.17.1" @@ -29851,6 +29616,15 @@ __metadata: languageName: node linkType: hard +"simple-update-notifier@npm:^1.0.0": + version: 1.1.0 + resolution: "simple-update-notifier@npm:1.1.0" + dependencies: + semver: ~7.0.0 + checksum: 3cbbbc71a5d9a2924f0e3f42fbf3cbe1854bfe142203456b00d5233bdbbdeb5091b8067cd34fb00f81dbfbc29fc30dbb6e026b3d58ea0551e3f26c0e64082092 + languageName: node + linkType: hard + "sisteransi@npm:^1.0.5": version: 1.0.5 resolution: "sisteransi@npm:1.0.5" @@ -30547,7 +30321,7 @@ __metadata: version: 0.0.0-use.local resolution: "storybook@workspace:lib/cli-storybook" dependencies: - "@storybook/cli": 7.0.0-beta.0 + "@storybook/cli": 7.0.0-beta.12 bin: sb: ./index.js storybook: ./index.js @@ -30710,7 +30484,7 @@ __metadata: languageName: node linkType: hard -"string.prototype.trimend@npm:^1.0.5": +"string.prototype.trimend@npm:^1.0.6": version: 1.0.6 resolution: "string.prototype.trimend@npm:1.0.6" dependencies: @@ -30721,7 +30495,7 @@ __metadata: languageName: node linkType: hard -"string.prototype.trimstart@npm:^1.0.5": +"string.prototype.trimstart@npm:^1.0.6": version: 1.0.6 resolution: "string.prototype.trimstart@npm:1.0.6" dependencies: @@ -30888,7 +30662,7 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:^2.0.0, strip-json-comments@npm:~2.0.1": +"strip-json-comments@npm:^2.0.0": version: 2.0.1 resolution: "strip-json-comments@npm:2.0.1" checksum: b509231cbdee45064ff4f9fd73609e2bcc4e84a4d508e9dd0f31f70356473fde18abfb5838c17d56fb236f5a06b102ef115438de0600b749e818a35fbbc48c43 @@ -31065,8 +30839,8 @@ __metadata: linkType: hard "svelte-check@npm:^2.9.2": - version: 2.10.0 - resolution: "svelte-check@npm:2.10.0" + version: 2.10.2 + resolution: "svelte-check@npm:2.10.2" dependencies: "@jridgewell/trace-mapping": ^0.3.9 chokidar: ^3.4.1 @@ -31080,7 +30854,7 @@ __metadata: svelte: ^3.24.0 bin: svelte-check: bin/svelte-check - checksum: d9ea563b513afe75d09e5c8fd867e5c17887b976db293130e9e5e2da4a1c0f2287846cccdd8e2ad42c17bd421c830babeee0cc7d3f2c41a882d76e78d74ce0b7 + checksum: 568401af63080517ec91d91d16e51ed33acba9953c3e6e56336c6ec13bfcff3ce8e6e17cadc064f15e6ff24b060c0ff5b41e3307f204ecd5a732ef072450984a languageName: node linkType: hard @@ -31172,9 +30946,9 @@ __metadata: linkType: hard "svelte@npm:^3.0.0, svelte@npm:^3.31.2, svelte@npm:^3.48.0": - version: 3.53.1 - resolution: "svelte@npm:3.53.1" - checksum: 4e0d389acbf4805f5247380f22311151a194532bd1d9742c418d981928a12cd9450220778a563c7c1cae9ef59b05ff0c960d20dae7f73b7057b7d5bd203202fe + version: 3.55.0 + resolution: "svelte@npm:3.55.0" + checksum: b880453dc9131d49d589f9567adfc57708357daa9bb91fd764be200b0e5e675875b305144e8757810f409ca4cb4a7445c0e98d2d1e63d9a2e316b0c7d7cf5cc2 languageName: node linkType: hard @@ -31311,16 +31085,16 @@ __metadata: linkType: hard "tar@npm:^6.0.2, tar@npm:^6.1.0, tar@npm:^6.1.11, tar@npm:^6.1.12, tar@npm:^6.1.2": - version: 6.1.12 - resolution: "tar@npm:6.1.12" + version: 6.1.13 + resolution: "tar@npm:6.1.13" dependencies: chownr: ^2.0.0 fs-minipass: ^2.0.0 - minipass: ^3.0.0 + minipass: ^4.0.0 minizlib: ^2.1.1 mkdirp: ^1.0.3 yallist: ^4.0.0 - checksum: 183a858baba2eabfb1589ea9030601865190a074597bf0926de2460b6fe8adee9278509ac1c8460c05af7a0c8794db62c4e8cc395589470103946c55bf68e6cc + checksum: eee5f264f3f3c27cd8d4934f80c568470f92811c416144ab671bb36b45a8ed55fbfbbd31f0146f3eddaca91fd564c9a7ec4d2086940968b836f4a2c54146c060 languageName: node linkType: hard @@ -31439,8 +31213,8 @@ __metadata: linkType: hard "terser@npm:^5.10.0, terser@npm:^5.14.1": - version: 5.16.0 - resolution: "terser@npm:5.16.0" + version: 5.16.1 + resolution: "terser@npm:5.16.1" dependencies: "@jridgewell/source-map": ^0.3.2 acorn: ^8.5.0 @@ -31448,7 +31222,7 @@ __metadata: source-map-support: ~0.5.20 bin: terser: bin/terser - checksum: 3c70287e8007617739cc461b12286ad0e921050cd543c706cdc43bc37df906e50a983144d60fd02e76300f3960ab75b4e91a02ddf598a91155021a49a5ef9262 + checksum: 30acd72a0b9e6159396eb59138eb99e812a9f279813aaec1287128380ce3b7420bb51a261f2b682eeadb732517149dbcb8a7c79c4c7f9aa95ffadfb5f61d994c languageName: node linkType: hard @@ -31502,13 +31276,6 @@ __metadata: languageName: node linkType: hard -"throttle-debounce@npm:^3.0.1": - version: 3.0.1 - resolution: "throttle-debounce@npm:3.0.1" - checksum: c8e558479463b7ed8bac30d6b10cc87abd1c9fc64edfce2db4109be1a04acaef5d2d0557f49c1a3845ea07d9f79e6e0389b1b60db0a77c44e5b7a1216596f285 - languageName: node - linkType: hard - "through2@npm:^2.0.0, through2@npm:^2.0.2, through2@npm:~2.0.3": version: 2.0.5 resolution: "through2@npm:2.0.5" @@ -31966,7 +31733,7 @@ __metadata: languageName: node linkType: hard -"ts-node@npm:^10.4.0": +"ts-node@npm:^10.9.1": version: 10.9.1 resolution: "ts-node@npm:10.9.1" dependencies: @@ -32232,17 +31999,10 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^1.0.1": - version: 1.4.0 - resolution: "type-fest@npm:1.4.0" - checksum: a3c0f4ee28ff6ddf800d769eafafcdeab32efa38763c1a1b8daeae681920f6e345d7920bf277245235561d8117dab765cb5f829c76b713b4c9de0998a5397141 - languageName: node - linkType: hard - "type-fest@npm:^3.0.0": - version: 3.3.0 - resolution: "type-fest@npm:3.3.0" - checksum: e3479b4832731d149f2482457d2e1fa4ea59d93b875a859088104142685ee4e0c538ca269525cd5df0ee9cad663b8ab25de7e64db55d3a87c4493866cf9f4e73 + version: 3.4.0 + resolution: "type-fest@npm:3.4.0" + checksum: 68e9c9db8df9e7310f6f4a4711bf743905522fb741cfe2746e3d412671e9b9e11e47ceb01973f765d5ee2774ce2655792562e1678e5d341f93f404a64660f943 languageName: node linkType: hard @@ -32277,7 +32037,7 @@ __metadata: languageName: node linkType: hard -"typedarray-to-buffer@npm:^3.1.5, typedarray-to-buffer@npm:~3.1.5": +"typedarray-to-buffer@npm:~3.1.5": version: 3.1.5 resolution: "typedarray-to-buffer@npm:3.1.5" dependencies: @@ -32294,12 +32054,12 @@ __metadata: linkType: hard "typescript@npm:*, typescript@npm:^4.0.3, typescript@npm:^4.9.3, typescript@npm:~4.9.3": - version: 4.9.3 - resolution: "typescript@npm:4.9.3" + version: 4.9.4 + resolution: "typescript@npm:4.9.4" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: bddcb0794f2b8aa52094b9de9d70848fdf46ccecac68403e1c407dc9f1a4e4e28979887acd648e1917b1144e5d8fbfb4c824309d8806d393b4194aa39c71fe5e + checksum: 5008b97a2a3afdbe57ea70e504ebc8ec98f18d888059dfb7932a41f566a1360a28afc8de2a440fd6143b4014cc6d2616079931dc690c7513c2d21fa53957e0ec languageName: node linkType: hard @@ -32314,12 +32074,12 @@ __metadata: linkType: hard "typescript@patch:typescript@*#~builtin, typescript@patch:typescript@^4.0.3#~builtin, typescript@patch:typescript@^4.9.3#~builtin, typescript@patch:typescript@~4.9.3#~builtin": - version: 4.9.3 - resolution: "typescript@patch:typescript@npm%3A4.9.3#~builtin::version=4.9.3&hash=d73830" + version: 4.9.4 + resolution: "typescript@patch:typescript@npm%3A4.9.4#~builtin::version=4.9.4&hash=d73830" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 26a1e4c75656e1d8d912d16bf9d2c0fa76b6339d9288681cb999577209e8f73e79c2a91631ed5104c69bbcd565d2451ea0c6beef5119acfe127ed4a88b34cf08 + checksum: b8cba6ab3ee30218578663352bcd74220ef20c42544fd1cc1382f24dee385002e784702b176c451da9c14c39965c035815902ef43b06eeefd5faae18ee700cea languageName: node linkType: hard @@ -32587,15 +32347,6 @@ __metadata: languageName: node linkType: hard -"unique-string@npm:^3.0.0": - version: 3.0.0 - resolution: "unique-string@npm:3.0.0" - dependencies: - crypto-random-string: ^4.0.0 - checksum: b35ea034b161b2a573666ec16c93076b4b6106b8b16c2415808d747ab3a0566b5db0c4be231d4b11cfbc16d7fd915c9d8a45884bff0e2db11b799775b2e1e017 - languageName: node - linkType: hard - "unist-util-generated@npm:^1.0.0, unist-util-generated@npm:^1.1.0": version: 1.1.6 resolution: "unist-util-generated@npm:1.1.6" @@ -32785,28 +32536,6 @@ __metadata: languageName: node linkType: hard -"update-notifier@npm:^6.0.2": - version: 6.0.2 - resolution: "update-notifier@npm:6.0.2" - dependencies: - boxen: ^7.0.0 - chalk: ^5.0.1 - configstore: ^6.0.0 - has-yarn: ^3.0.0 - import-lazy: ^4.0.0 - is-ci: ^3.0.1 - is-installed-globally: ^0.4.0 - is-npm: ^6.0.0 - is-yarn-global: ^0.4.0 - latest-version: ^7.0.0 - pupa: ^3.1.0 - semver: ^7.3.7 - semver-diff: ^4.0.0 - xdg-basedir: ^5.1.0 - checksum: ad3980073312df904133a6e6c554a7f9d0832ed6275e55f5a546313fe77a0f20f23a7b1b4aeb409e20a78afb06f4d3b2b28b332d9cfb55745b5d1ea155810bcc - languageName: node - linkType: hard - "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -33174,15 +32903,15 @@ __metadata: languageName: node linkType: hard -"vite@npm:^3.1.0, vite@npm:^3.1.3, vite@npm:^3.1.7": - version: 3.2.4 - resolution: "vite@npm:3.2.4" +"vite@npm:^4.0.0": + version: 4.0.2 + resolution: "vite@npm:4.0.2" dependencies: - esbuild: ^0.15.9 + esbuild: ^0.16.3 fsevents: ~2.3.2 - postcss: ^8.4.18 + postcss: ^8.4.20 resolve: ^1.22.1 - rollup: ^2.79.1 + rollup: ^3.7.0 peerDependencies: "@types/node": ">= 14" less: "*" @@ -33208,19 +32937,19 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: c3b6a1643e6436e4628db1fe183a3eb7db970bf8cf20104540079b9e97b6f5ce1ea33c498373f130ddee7259a96cc3f9ce96d5e43a8b23f7484e35ac8634bcc7 + checksum: 6d6e099dc5a3f0fcfe2ca01c473851670b372d4d706cdbf8d62736ecbf4c2fb1c232a7cf6f605e929377e51a31307ee27c88a1969f630fe1981c4b92035083d4 languageName: node linkType: hard -"vitefu@npm:^0.2.2": - version: 0.2.2 - resolution: "vitefu@npm:0.2.2" +"vitefu@npm:^0.2.3": + version: 0.2.4 + resolution: "vitefu@npm:0.2.4" peerDependencies: - vite: ^3.0.0 + vite: ^3.0.0 || ^4.0.0 peerDependenciesMeta: vite: optional: true - checksum: 0016b133eb78eea71004c4848260848d5c95ec57deba0264f7a49df97753d1850f6ce6846586acb1b1ac3e8dfbd52f5cb6ed42b38fe98293dc0dda7f71242d05 + checksum: 78d5e7071c0c4fdfc010f15a3e5bac2d31090ddd48789446fce5b7d0f01496fc6a041b65d3add904365bb0ac6576bb93635f700971c16ffd27cd7c0bee9eb1ae languageName: node linkType: hard @@ -33258,9 +32987,9 @@ __metadata: linkType: hard "vscode-languageserver-textdocument@npm:^1.0.1, vscode-languageserver-textdocument@npm:^1.0.3": - version: 1.0.7 - resolution: "vscode-languageserver-textdocument@npm:1.0.7" - checksum: 6bda397d117b3d5bdf636a5fa29bdfc29c288dd748eb6636722caa1408cfc38d51d522a96a9162c529e9c33cb4b9c55cc8b4c5e417b00297ff0e5a1f21fe0ce6 + version: 1.0.8 + resolution: "vscode-languageserver-textdocument@npm:1.0.8" + checksum: 2981b4d0935c47d76fda9d80840b71de414990a2976840106a462277a26002c7abe2453ab872a00861803cf62ed6b340c6ecbc7a3549788309e28096b73a4d52 languageName: node linkType: hard @@ -33293,9 +33022,9 @@ __metadata: linkType: hard "vscode-uri@npm:^3.0.3": - version: 3.0.6 - resolution: "vscode-uri@npm:3.0.6" - checksum: 705ee25ee75665e0daa0bc5e04150747c043e2f32811254531211b9bd6f54cddaf85616c3467b43f2e42e4c2dca0713d541a8ebe3a5467ee73efd472822e6d32 + version: 3.0.7 + resolution: "vscode-uri@npm:3.0.7" + checksum: 67bc15bc9c9bd2d70dae8b27f2a3164281c6ee8f6484e6c5945a44d89871da93d52f2ba339ebc12ab0c10991d4576171b5d85e49a542454329c16faf977e4c59 languageName: node linkType: hard @@ -33309,8 +33038,8 @@ __metadata: linkType: hard "vue-docgen-api@npm:^4.40.0, vue-docgen-api@npm:^4.44.23, vue-docgen-api@npm:^4.46.0": - version: 4.54.2 - resolution: "vue-docgen-api@npm:4.54.2" + version: 4.56.0 + resolution: "vue-docgen-api@npm:4.56.0" dependencies: "@babel/parser": ^7.13.12 "@babel/types": ^7.18.8 @@ -33323,7 +33052,7 @@ __metadata: recast: 0.21.5 ts-map: ^1.0.3 vue-inbrowser-compiler-independent-utils: ^4.52.0 - checksum: e42440d80b3cc08bde6fbb6a4c61e14768fb1e98781fe8305df50d9d74143a6a323184e4c2ffe839283ea2f932b8a3b92c77c119e512f9c49bef50af55b85374 + checksum: b322b9c4ea808dbf09fa5bd9df7b113a4af255fa688cf7ea30227eba119e4245df1f714d676c91dd458ed273d54b9381845971ec5dba89cce6e017ea2138897e languageName: node linkType: hard @@ -33455,16 +33184,16 @@ __metadata: linkType: hard "vue-tsc@npm:^1.0.8, vue-tsc@npm:^1.0.9": - version: 1.0.10 - resolution: "vue-tsc@npm:1.0.10" + version: 1.0.16 + resolution: "vue-tsc@npm:1.0.16" dependencies: - "@volar/vue-language-core": 1.0.10 - "@volar/vue-typescript": 1.0.10 + "@volar/vue-language-core": 1.0.16 + "@volar/vue-typescript": 1.0.16 peerDependencies: typescript: "*" bin: vue-tsc: bin/vue-tsc.js - checksum: 32ee61fcae68f1270b4de9e47d0315cc961b9b5af80bd33074993ccf743398dbb3c49a7747cc9b6c54d9e8f7563d1cd25aa3676fca235b2694dbf6b5ab89baa0 + checksum: 272f65bc006a378811491922d75926a1df9ffcc16f44b6b1e4ec2418c8270a2d11cb0a48930e934daecc9f59088f2d80e168db5da75ddff13a2c8644cd1c5658 languageName: node linkType: hard @@ -34189,18 +33918,6 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^3.0.3": - version: 3.0.3 - resolution: "write-file-atomic@npm:3.0.3" - dependencies: - imurmurhash: ^0.1.4 - is-typedarray: ^1.0.0 - signal-exit: ^3.0.2 - typedarray-to-buffer: ^3.1.5 - checksum: 7fb67affd811c7a1221bed0c905c26e28f0041e138fb19ccf02db57a0ef93ea69220959af3906b920f9b0411d1914474cdd90b93a96e5cd9e8368d9777caac0e - languageName: node - linkType: hard - "write-file-atomic@npm:^4.0.1": version: 4.0.2 resolution: "write-file-atomic@npm:4.0.2" @@ -34295,13 +34012,6 @@ __metadata: languageName: node linkType: hard -"xdg-basedir@npm:^5.0.1, xdg-basedir@npm:^5.1.0": - version: 5.1.0 - resolution: "xdg-basedir@npm:5.1.0" - checksum: c88efabc71ffd996ba9ad8923a8cc1c7c020a03e2c59f0ffa72e06be9e724ad2a0fccef488757bc6ed3d8849d753dd25082d1035d95cb179e79eae4d034d0b80 - languageName: node - linkType: hard - "xdg-trashdir@npm:^3.1.0": version: 3.1.0 resolution: "xdg-trashdir@npm:3.1.0" diff --git a/docs/integrations/integration-catalog.md b/docs/addons/integration-catalog.md similarity index 100% rename from docs/integrations/integration-catalog.md rename to docs/addons/integration-catalog.md diff --git a/docs/addons/writing-addons.md b/docs/addons/writing-addons.md index edc1592f6d5..842dbad749c 100644 --- a/docs/addons/writing-addons.md +++ b/docs/addons/writing-addons.md @@ -246,7 +246,7 @@ Now that you've seen how to create a bare-bones addon let's see how to share it Reference the [storybook-addon-outline](https://www.npmjs.com/package/storybook-addon-outline) to see a project that meets these requirements. -Learn how to [add to the addon catalog](../integrations/integration-catalog.md#addons). +Learn how to [add to the addon catalog](../addons/integration-catalog.md#addons). ### More guides and tutorials diff --git a/docs/api/mdx-documentation-only.png b/docs/api/mdx-documentation-only.png deleted file mode 100644 index 0ed39ccb9a8..00000000000 Binary files a/docs/api/mdx-documentation-only.png and /dev/null differ diff --git a/docs/api/mdx-page.png b/docs/api/mdx-page.png deleted file mode 100644 index 195b39eefda..00000000000 Binary files a/docs/api/mdx-page.png and /dev/null differ diff --git a/docs/api/mdx-simple.png b/docs/api/mdx-simple.png deleted file mode 100644 index 2dfaf66b4ed..00000000000 Binary files a/docs/api/mdx-simple.png and /dev/null differ diff --git a/docs/api/mdx.md b/docs/api/mdx.md deleted file mode 100644 index b2ba3842fd8..00000000000 --- a/docs/api/mdx.md +++ /dev/null @@ -1,152 +0,0 @@ ---- -title: 'MDX Format' ---- - -`MDX` is the syntax [Storybook Docs](../writing-docs/introduction.md) uses to capture long-form Markdown documentation and stories in one file. You can also write pure documentation pages in `MDX` and add them to Storybook alongside your stories. [Read the announcement](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) to learn more about how and why it came to be. - -## Basic example - -Let's get started with an example that combines Markdown with a single story: - - - - - - - -And here's how it renders in Storybook: - -![Show a simple mdx example](./mdx-simple.png) - -As you can see, a lot is going on here. We're writing Markdown, we're writing JSX, and somehow we're also defining Storybook stories that are drop-in compatible with the entire Storybook ecosystem. - -Let's break it down. - -## MDX-Flavored CSF - -[MDX](https://mdxjs.com/) is a standard file format that combines Markdown with JSX. It means you can use Markdown’s terse syntax (such as `# heading`) for your documentation and freely embed JSX component blocks at any point in the file. - -MDX-flavored [Component Story Format (CSF)](https://medium.com/storybookjs/component-story-format-66f4c32366df) includes a collection of components called **"Doc Blocks"**, that allow Storybook to translate MDX files into Storybook stories. MDX-defined stories are identical to regular Storybook stories, so they can be used with Storybook's entire ecosystem of addons and view layers. - -For example, here's the story from the `Checkbox` example above, rewritten in CSF: - - - - - - - -There's a one-to-one mapping from the code in `MDX` to `CSF`, which in turn directly corresponds to Storybook's internal `storiesOf` API. As a user, this means your existing Storybook knowledge should translate between the three constructs. And technically, this means that the transformations that happen under the hood are predictable and straightforward. - -## Writing stories - -Now let's look at a more realistic example to see a few more things we can do: - - - - - - - -And here's how that gets rendered in Storybook: - -![Display mdx page](./mdx-page.png) - -### Embedding stories - -Suppose you have an existing story and want to embed it into your docs. Here's how to show a story with ID `some--id` (check the browser URL in Storybook v5+ to see a story's ID): - - - - - - - -You can also use the rest of the MDX features in conjunction with embedding. That includes source, preview, and prop tables. - -### Decorators and parameters - -To add [decorators](../writing-docs/mdx.md#decorators-and-parameters) and [parameters](../writing-docs/mdx.md#decorators-and-parameters) in MDX: - - - - - - - -In addition, global decorators work just like before, e.g., adding the following to your [`.storybook/preview.js`](../configure/overview.md#configure-story-rendering): - - - - - - - -### Play function - -Storybook's `play` functions are small snippets of code that run after the story loads. They're helpful methods to help test scenarios that otherwise would require user intervention. For example, if you're working on a login component and want to interact with it and verify the component's workflow, you could write the following story: - - - - - - - -## Documentation-only MDX - -Typically, when you use the MDX format, you define your stories and are automatically generated by Storybook. But what if you want to write Markdown-style documentation and have it show up in your Storybook? - -Suppose you don't define stories in your MDX. In that case, you can write MDX documentation and associate it with an existing story or embed that MDX as its documentation node in your Storybook's navigation. - -If you don't define a `Meta`, you can write Markdown and associate it with an existing story. See ["CSF Stories with MDX Docs"](../writing-docs/mdx.md). - -To get a "documentation-only story" in your UI, define a `` as you usually would, but don't define any stories. It will show up in your UI as a documentation node: - -![Show documentation](./mdx-documentation-only.png) - -## MDX file names - -Unless you use a custom webpack configuration, all of your `MDX` files should have the suffix `*.stories.mdx`. It tells Storybook to apply its special processing to the `` and `` elements in the file. - -Be sure to update your Storybook config file to load `.stories.mdx` stories, as per the [`addon-docs` installation instructions](https://github.com/storybookjs/storybook/tree/master/addons/docs#installation). diff --git a/docs/configure/telemetry.md b/docs/configure/telemetry.md index 17abc3f6d6e..74f6253851a 100644 --- a/docs/configure/telemetry.md +++ b/docs/configure/telemetry.md @@ -150,6 +150,12 @@ You may opt-out of the telemetry by setting Storybook's configuration element `d +
    + 💡 There is a boot event that contains no metadata at all (simply used to ensure the telemetry is working). It is sent prior to evaluating your main.js, so it is unaffected by the disableTelemetry option. If you want to ensure that event is not sent, be sure to use the STORYBOOK_DISABLE_TELEMETRY environment variable. +
    + + + ## Crash reports (disabled by default) In addition to general usage telemetry, you may also choose to share crash reports. Storybook will then sanitize the error object (removing all user paths) and append it to the telemetry event. To enable crash reporting, you can set the `enableCrashReports` configuration element to `true`, using the `--enable-crash-reports` flag, or set the `STORYBOOK_ENABLE_CRASH_REPORTS` environment variable to `1`. For example: diff --git a/docs/faq.md b/docs/faq.md index f6295c55956..f792e661fb3 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -4,36 +4,35 @@ title: 'Frequently Asked Questions' Here are some answers to frequently asked questions. If you have a question, you can ask it by opening an issue on the [Storybook Repository](https://github.com/storybookjs/storybook/). -* [How can I opt-out of Angular Ivy?](#how-can-i-opt-out-of-angular-ivy) -* [How can I opt-out of Angular ngcc?](#how-can-i-opt-out-of-angular-ngcc) -* [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 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) -* [Why aren't Controls visible in the Canvas panel but visible in the Docs panel?](#why-arent-controls-visible-in-the-canvas-panel-but-visible-in-the-docs-panel) -* [Why aren't the addons working in a composed Storybook?](#why-arent-the-addons-working-in-a-composed-storybook) -* [Which community addons are compatible with the latest version of Storybook?](#which-community-addons-are-compatible-with-the-latest-version-of-storybook) -* [Is it possible to browse the documentation for past versions of Storybook?](#is-it-possible-to-browse-the-documentation-for-past-versions-of-storybook) -* [What icons are available for my toolbar or my addon?](#what-icons-are-available-for-my-toolbar-or-my-addon) -* [I see a "No Preview" error with a Storybook production build](#i-see-a-no-preview-error-with-a-storybook-production-build) -* [Can I use Storybook with Vue 3?](#can-i-use-storybook-with-vue-3) -* [Is snapshot testing with Storyshots supported for Vue 3?](#is-snapshot-testing-with-storyshots-supported-for-vue-3) -* [Why are my MDX stories not working in IE11?](#why-are-my-mdx-stories-not-working-in-ie11) -* [Why aren't my code blocks highlighted with Storybook MDX](#why-arent-my-code-blocks-highlighted-with-storybook-mdx) -* [Why aren't my MDX 2 stories working in Storybook?](#why-arent-my-mdx-2-stories-working-in-storybook) -* [Why can't I import my own stories into MDX 2?](#why-cant-i-import-my-own-stories-into-mdx-2) -* [Why are my mocked GraphQL queries failing with Storybook's MSW addon?](#why-are-my-mocked-graphql-queries-failing-with-storybooks-msw-addon) -* [Can I use other GraphQL providers with Storybook's MSW addon?](#can-i-use-other-graphql-providers-with-storybooks-msw-addon) -* [Can I mock GraphQL mutations with Storybook's MSW addon?](#can-i-mock-graphql-mutations-with-storybooks-msw-addon) -* [How can my code detect if it is running in Storybook?](#how-can-my-code-detect-if-it-is-running-in-storybook) -* [Why are my stories not showing up correctly when using certain characters?](#why-are-my-stories-not-showing-up-correctly-when-using-certain-characters) -* [Why are the TypeScript examples and documentation using `as` for type safety?](#why-are-the-typescript-examples-and-documentation-using-as-for-type-safety) -* [Why is Storybook's source loader returning undefined with curried functions?](#why-is-storybooks-source-loader-returning-undefined-with-curried-functions) -* [Why are my args no longer displaying the default values?](#why-are-my-args-no-longer-displaying-the-default-values) -* [Why isn't Storybook's test runner working?](#why-isnt-storybooks-test-runner-working) -* [How does Storybook handle environment variables?](#how-does-storybook-handle-environment-variables) +- [How can I opt-out of Angular Ivy?](#how-can-i-opt-out-of-angular-ivy) +- [How can I opt-out of Angular ngcc?](#how-can-i-opt-out-of-angular-ngcc) +- [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 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) +- [Why aren't Controls visible in the Canvas panel but visible in Docs?](#why-arent-controls-visible-in-the-canvas-panel-but-visible-in-docs) +- [Why aren't the addons working in a composed Storybook?](#why-arent-the-addons-working-in-a-composed-storybook) +- [Which community addons are compatible with the latest version of Storybook?](#which-community-addons-are-compatible-with-the-latest-version-of-storybook) +- [Is it possible to browse the documentation for past versions of Storybook?](#is-it-possible-to-browse-the-documentation-for-past-versions-of-storybook) +- [What icons are available for my toolbar or my addon?](#what-icons-are-available-for-my-toolbar-or-my-addon) +- [I see a "No Preview" error with a Storybook production build](#i-see-a-no-preview-error-with-a-storybook-production-build) +- [Can I use Storybook with Vue 3?](#can-i-use-storybook-with-vue-3) +- [Is snapshot testing with Storyshots supported for Vue 3?](#is-snapshot-testing-with-storyshots-supported-for-vue-3) +- [Why aren't my code blocks highlighted with Storybook MDX](#why-arent-my-code-blocks-highlighted-with-storybook-mdx) +- [Why aren't my MDX 2 stories working in Storybook?](#why-arent-my-mdx-2-stories-working-in-storybook) +- [Why can't I import my own stories into MDX 2?](#why-cant-i-import-my-own-stories-into-mdx-2) +- [Why are my mocked GraphQL queries failing with Storybook's MSW addon?](#why-are-my-mocked-graphql-queries-failing-with-storybooks-msw-addon) +- [Can I use other GraphQL providers with Storybook's MSW addon?](#can-i-use-other-graphql-providers-with-storybooks-msw-addon) +- [Can I mock GraphQL mutations with Storybook's MSW addon?](#can-i-mock-graphql-mutations-with-storybooks-msw-addon) +- [How can my code detect if it is running in Storybook?](#how-can-my-code-detect-if-it-is-running-in-storybook) +- [Why are my stories not showing up correctly when using certain characters?](#why-are-my-stories-not-showing-up-correctly-when-using-certain-characters) +- [Why are the TypeScript examples and documentation using `as` for type safety?](#why-are-the-typescript-examples-and-documentation-using-as-for-type-safety) +- [Why is Storybook's source loader returning undefined with curried functions?](#why-is-storybooks-source-loader-returning-undefined-with-curried-functions) +- [Why are my args no longer displaying the default values?](#why-are-my-args-no-longer-displaying-the-default-values) +- [Why isn't Storybook's test runner working?](#why-isnt-storybooks-test-runner-working) +- [How does Storybook handle environment variables?](#how-does-storybook-handle-environment-variables) ### How can I opt-out of Angular Ivy? @@ -55,6 +54,7 @@ module.exports = { }, }; ``` + ### How can I opt-out of Angular ngcc? In case you postinstall ngcc, you can disable it: @@ -171,7 +171,7 @@ A common error is that an addon tries to access the "channel", but the channel i 2. In React Native, it's a special case documented in [#1192](https://github.com/storybookjs/storybook/issues/1192) -### Why aren't Controls visible in the Canvas panel but visible in the Docs panel? +### Why aren't Controls visible in the Canvas panel but visible in Docs? If you're adding Storybook's dependencies manually, make sure you include the [`@storybook/addon-controls`](https://www.npmjs.com/package/@storybook/addon-controls) dependency in your project and reference it in your `.storybook/main.js` as follows: @@ -218,7 +218,7 @@ We're only covering versions 5.3 and 5.0 as they were important milestones for S | | Naming components and hierarchy | [See current documentation](./writing-stories/naming-components-and-hierarchy.md) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/basics/writing-stories) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.0/docs/src/pages/basics/writing-stories) | | | Build pages and screens | [See current documentation](./writing-stories/build-pages-with-storybook.md) | Non existing feature or undocumented | Non existing feature or undocumented | | | Stories for multiple components | [See current documentation](./writing-stories/stories-for-multiple-components.md) | Non existing feature or undocumented | Non existing feature or undocumented | -| Write docs | DocsPage | [See current documentation](./writing-docs/docs-page.md) | See versioned addon documentation | Non existing feature or undocumented | +| Write docs | Automatic Docs | [See current documentation](./writing-docs/docs-page.md) | See versioned addon documentation | Non existing feature or undocumented | | | MDX | [See current documentation](./writing-docs/mdx.md) | See versioned addon documentation | Non existing feature or undocumented | | | Doc Blocks/Argstable | [See current documentation](./writing-docs/doc-block-argstable.md) | [See versioned addon documentation](https://github.com/storybookjs/storybook/tree/release/5.3/addons/docs/) | Non existing feature or undocumented | | | Doc Blocks/Canvas | [See current documentation](./writing-docs/doc-block-canvas.md) | [See versioned addon documentation](https://github.com/storybookjs/storybook/tree/release/5.3/addons/docs/) | Non existing feature or undocumented | @@ -266,7 +266,7 @@ We're only covering versions 5.3 and 5.0 as they were important milestones for S | | Types of addons | [See current documentation](./addons/addon-types.md) | Non existing feature or undocumented | Non existing feature or undocumented | | | Addons API | [See current documentation](./addons/addons-api.md) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/addons/api) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.0/docs/src/pages/addons/api) | | API | Stories/Component Story Format | [See current documentation](./api/csf.md) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/formats/component-story-format) | Non existing feature or undocumented | -| | Stories/MDX syntax | [See current documentation](./api/mdx.md) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/formats/mdx-syntax) | Non existing feature or undocumented | +| | Stories/MDX syntax | [See current documentation](./writing-docs/mdx.md) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/formats/mdx-syntax) | Non existing feature or undocumented | | | Stories/StoriesOF format (see note below) | [See current documentation](https://github.com/storybookjs/storybook/blob/main/lib/core/docs/storiesOf.md) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/formats/storiesof-api) | Non existing feature or undocumented | | | Frameworks | [See current documentation](./api/new-frameworks.md) | Non existing feature or undocumented | Non existing feature or undocumented | | | CLI options | [See current documentation](./api/cli-options.md) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/configurations/cli-options) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.0/docs/src/pages/configurations/cli-options) | @@ -308,10 +308,6 @@ If you run into a situation where this is not the case, you can adjust the `conf See our documentation on how to customize the [Storyshots configuration](./writing-tests/snapshot-testing.md). -### Why are my MDX stories not working in IE11? - -Currently there's an issue when using MDX stories with IE11. This issue does not apply to [DocsPage](./writing-docs/docs-page.md). If you're interested in helping us fix this issue, read our Contribution guidelines and submit a pull request. - ### Why aren't my code blocks highlighted with Storybook MDX Out of the box, Storybook provides syntax highlighting for a set of languages (e.g., Javascript, Markdown, CSS, HTML, Typescript, GraphQL) that you can use with your code blocks. If you're writing your custom code blocks with MDX, you'll need to import the syntax highlighter manually. For example, if you're adding a code block for SCSS, adjust your story to the following: @@ -332,6 +328,30 @@ Out of the box, Storybook provides syntax highlighting for a set of languages (e Applying this small change will enable you to add syntax highlight for SCSS or any other language available. +You can also update your [`.storybook/preview.js`](../configure/overview.md#configure-story-rendering) and enable syntax highlighting globally. For example, to add support for SCSS, update your configuration to the following: + + + + + + + +Write your documentation as you usually would, and your existing SCSS code blocks will automatically be highlighted when Storybook reloads. For example: + + + + + + + ### Why aren't my MDX 2 stories working in Storybook? MDX 2 introduced some changes to how the code is rendered. For example, if you enabled it in your Storybook and you have the following code block: diff --git a/docs/frameworks.js b/docs/frameworks.js index 8d2e1156f7b..ce957e01d08 100644 --- a/docs/frameworks.js +++ b/docs/frameworks.js @@ -88,7 +88,7 @@ module.exports = { { name: 'Storyshots', unsupported: ['ember'], - path: 'workflows/unit-testing', + path: 'writing-tests/snapshot-testing', }, { name: 'storysource', diff --git a/docs/get-started/installation-problems/angular.mdx b/docs/get-started/installation-problems/angular.mdx index af6939fe2e9..b2a0a78ba37 100644 --- a/docs/get-started/installation-problems/angular.mdx +++ b/docs/get-started/installation-problems/angular.mdx @@ -42,4 +42,4 @@ | `"styles"` | Provide the location of the [application's styles](../configure/styling-and-css.md#importing-css-files) to be used with Storybook.
    `"styles": ["src/styles.css", "src/styles.scss"]`
    | | `"stylePreprocessorOptions"` | Provides further customization for style preprocessors resolved to the workspace root.
    `"stylePreprocessorOptions": { "includePaths": ["src/styles"] }` | -- For other installation issues, check the [Angular README](../../app/angular/README.md) for additional instructions. +- For other installation issues, check the [Angular README](https://github.com/storybookjs/storybook/tree/next/code/frameworks/angular) for additional instructions. diff --git a/docs/get-started/installation-problems/ember.mdx b/docs/get-started/installation-problems/ember.mdx index f1d494f0586..b477a3f3e62 100644 --- a/docs/get-started/installation-problems/ember.mdx +++ b/docs/get-started/installation-problems/ember.mdx @@ -20,4 +20,4 @@ Update the [`@storybook/ember-cli-storybook`](https://www.npmjs.com/package/@sto npx storybook init --package-manager=npm ``` -- For other installation issues, check the [Ember README](../../app/ember/README.md) for additional instructions. +- For other installation issues, check the [Ember README](https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember) for additional instructions. diff --git a/docs/get-started/installation-problems/html.mdx b/docs/get-started/installation-problems/html.mdx index 8bd4eae77ab..709dcf82436 100644 --- a/docs/get-started/installation-problems/html.mdx +++ b/docs/get-started/installation-problems/html.mdx @@ -4,4 +4,6 @@ npx storybook init --type html ``` -- For other installation issues, check the [Html README](../../app/html/README.md) for additional instructions. \ No newline at end of file +- For other installation issues, check the React README files for additional instructions: + - [HTML with Webpack]( https://github.com/storybookjs/storybook/tree/next/code/frameworks/html-webpack5) + - [HTML with Vite](https://github.com/storybookjs/storybook/tree/next/code/frameworks/html-vite) diff --git a/docs/get-started/installation-problems/preact.mdx b/docs/get-started/installation-problems/preact.mdx index 10db561f96c..ab781154c1e 100644 --- a/docs/get-started/installation-problems/preact.mdx +++ b/docs/get-started/installation-problems/preact.mdx @@ -10,4 +10,4 @@ npx storybook init --package-manager=npm ``` -- For other installation issues, check the [Preact README](../../app/preact/README.md) for additional instructions. +- For other installation issues, check the [Preact README](https://github.com/storybookjs/storybook/tree/next/code/frameworks/preact-webpack5) for additional instructions. diff --git a/docs/get-started/installation-problems/react.mdx b/docs/get-started/installation-problems/react.mdx index 7993718555b..6829da4d213 100644 --- a/docs/get-started/installation-problems/react.mdx +++ b/docs/get-started/installation-problems/react.mdx @@ -16,6 +16,8 @@ npx storybook@next automigrate ``` - Check the [Migration Guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#cra5-upgrade) for more information on how to set up Webpack 5. +Check the [Migration Guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#cra5-upgrade) for more information on how to set up Webpack 5. -- For other installation issues, check the [React README](../../app/react/README.md) for additional instructions. +- For other installation issues, check the React README files for additional instructions: + - [React with Webpack](https://github.com/storybookjs/storybook/tree/next/code/frameworks/react-webpack5) + - [React with Vite](https://github.com/storybookjs/storybook/tree/next/code/frameworks/react-vite) diff --git a/docs/get-started/installation-problems/svelte.mdx b/docs/get-started/installation-problems/svelte.mdx index fc13ced5eea..28c60ce77dd 100644 --- a/docs/get-started/installation-problems/svelte.mdx +++ b/docs/get-started/installation-problems/svelte.mdx @@ -10,5 +10,16 @@ npx storybook init --package-manager=npm ``` +### Svelte Native + +To enable support for Svelte Native story format you'll need to make the following changes your Storybook configuration: +- Add the [`@storybook/addon-svelte-csf`](https://storybook.js.org/addons/@storybook/addon-svelte-csf/) addon as development dependency. +- Enable the addon in your Storybook configuration file (e.g., `.storybook/main.js`). +- Disable on demand story loading configuration property (e.g., `storyStoreV7`) in your Storybook configuration file. - For issues with Svelte Native Story Format, check the [Svelte Story Format addon repository](https://github.com/storybookjs/addon-svelte-csf) for instructions. -- For other installation issues, check the [Svelte README](../../app/svelte/README.md) for additional instructions. + + +- For other installation issues, check the Svelte README files for additional instructions: + - [Svelte with Webpack](https://github.com/storybookjs/storybook/tree/next/code/frameworks/svelte-webpack5) + - [Svelte with Vite](https://github.com/storybookjs/storybook/tree/next/code/frameworks/svelte-vite) + - [SvelteKit](https://github.com/storybookjs/storybook/tree/next/code/frameworks/sveltekit) diff --git a/docs/get-started/installation-problems/vue.mdx b/docs/get-started/installation-problems/vue.mdx index cfd752e0f8b..ec6d98d4bbb 100644 --- a/docs/get-started/installation-problems/vue.mdx +++ b/docs/get-started/installation-problems/vue.mdx @@ -14,5 +14,8 @@ npx storybook init --package-manager=npm ``` -- For other installation issues, check the [Vue 2 README](../../app/vue/README.md), or the [Vue 3 README](../../app/vue3/README.md) for additional instructions. -- Vue 3 support is under active development, and we encourage feedback and improvements. Check the [contribution guidelines to help us improve it](../../CONTRIBUTING.md). +- For other installation issues, check the Vue README files for additional instructions: + - [Vue 2 with Webpack](https://github.com/storybookjs/storybook/tree/next/code/frameworks/vue-webpack5) + - [Vue 2 with Vite](https://github.com/storybookjs/storybook/tree/next/code/frameworks/vue-vite) + - [Vue 3 with Webpack](https://github.com/storybookjs/storybook/tree/next/code/frameworks/vue3-webpack5) + - [Vue 3 with Vite](https://github.com/storybookjs/storybook/tree/next/code/frameworks/vue3-vite) diff --git a/docs/get-started/installation-problems/web-components.mdx b/docs/get-started/installation-problems/web-components.mdx index 09841ea1934..4a212340616 100644 --- a/docs/get-started/installation-problems/web-components.mdx +++ b/docs/get-started/installation-problems/web-components.mdx @@ -4,4 +4,6 @@ npx storybook init --type web_components ``` -- For other installation issues, check the [Web Components README](../../app/web-components/README.md) for additional instructions. \ No newline at end of file +- For other installation issues, check the Web Components README files for additional instructions: + - [Web Components with Webpack](https://github.com/storybookjs/storybook/tree/next/code/frameworks/web-components-webpack5) + - [Web Components with Vite](https://github.com/storybookjs/storybook/tree/next/code/frameworks/web-components-vite) diff --git a/docs/snippets/angular/badge-story-starter-example.mdx.mdx b/docs/snippets/angular/badge-story-starter-example.mdx.mdx deleted file mode 100644 index b57a56f5d24..00000000000 --- a/docs/snippets/angular/badge-story-starter-example.mdx.mdx +++ /dev/null @@ -1,78 +0,0 @@ -```md - - -import { Canvas, Meta, Story } from '@storybook/addon-docs'; - -import { moduleMetadata } from '@storybook/angular'; - -import { CommonModule } from '@angular/common'; - -import { Badge } from './badge.component'; -import { Icon } from './icon.component'; - - - - - -# Badge - -Let's define a story for our `Badge` component: - - ({ - template:`Positive`, - })} /> - -We can drop it in a `Canvas` to get a code snippet: - - - ({ - template: `Negative`, - })} /> - - -We can even preview multiple stories in a block. This -gets rendered as a group, but defines individual stories -with unique URLs and isolated snapshot tests. - - - ({ - template: `Warning`, - })} /> - ({ - template: `Neutral`, - })} /> - ({ - template: `Error`, - })} /> - ({ - template: ` - - - with icon - - `, - })} /> - -``` \ No newline at end of file diff --git a/docs/snippets/angular/button-story-auto-docs.ts.mdx b/docs/snippets/angular/button-story-auto-docs.ts.mdx new file mode 100644 index 00000000000..bbeeef5e65c --- /dev/null +++ b/docs/snippets/angular/button-story-auto-docs.ts.mdx @@ -0,0 +1,34 @@ +```ts +// Button.stories.ts + +import type { Meta, StoryObj } from '@storybook/angular'; + +import { Button } from './button.component'; + +const meta: Meta