diff --git a/.github/workflows/canary-release-pr.yml b/.github/workflows/canary-release-pr.yml index 5461d36af7bd..f8398ae65f69 100644 --- a/.github/workflows/canary-release-pr.yml +++ b/.github/workflows/canary-release-pr.yml @@ -63,7 +63,6 @@ jobs: - uses: oven-sh/setup-bun@v1 with: bun-version: 1.1.12 - - name: Cache dependencies uses: actions/cache@v4 with: diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index c8c8a4c0af9c..66bcc0f1a7ce 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -4,7 +4,7 @@ on: # Use pull_request_target, as we don't need to check out the actual code of the fork in this script. # And this is the only way to trigger the Circle CI API on forks as well. pull_request_target: - types: [opened, synchronize, labeled, unlabeled, reopened, converted_to_draft, ready_for_review] + types: [opened, synchronize, labeled, reopened] push: branches: - next @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:normal') + if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:docs') + if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - name: Trigger docs tests run: > @@ -77,7 +77,7 @@ jobs: trigger-merged-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:merged') + if: github.event_name == 'push' || (github.event.action == 'labeled' && github.event.label.name == 'ci:merged') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:merged')) steps: - name: Trigger merged tests run: > @@ -96,7 +96,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:daily') + if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) steps: - name: Trigger the daily tests run: > diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index 7bcf905f3bc2..f15a15ea9b0e 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,13 @@ +## 8.2.0-alpha.6 + +- Addon-actions: Only log spies with names - [#28091](https://github.com/storybookjs/storybook/pull/28091), thanks @kasperpeulen! +- Build: Change require/import order, so that import has higher prio if both are specified - [#27730](https://github.com/storybookjs/storybook/pull/27730), thanks @kasperpeulen! +- CLI: Only log the UpgradeStorybookToSameVersionError but continue the upgrade as normal - [#27217](https://github.com/storybookjs/storybook/pull/27217), thanks @kasperpeulen! +- Core: Replace ip function with a small helper function to address security concerns - [#27529](https://github.com/storybookjs/storybook/pull/27529), thanks @tony19! +- Portable Stories: Add tags to composed story - [#27708](https://github.com/storybookjs/storybook/pull/27708), thanks @yannbf! +- Test: Upgrade deps of @storybook/test - [#27862](https://github.com/storybookjs/storybook/pull/27862), thanks @kasperpeulen! +- Vite: Fix stats-plugin to normalize file names with posix paths - [#27218](https://github.com/storybookjs/storybook/pull/27218), thanks @AlexAtVista! + ## 8.2.0-alpha.5 - Angular: Fix wrong detection of standalone components - [#27353](https://github.com/storybookjs/storybook/pull/27353), thanks @dario-baumberger! diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5674925296b0..dff116afafbf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,6 +70,19 @@ yarn build --watch react core-server api addon-docs yarn task --task dev --template --start-from=publish ``` +### Making code changes when working on Angular-specific code + +If you are working on Angular-specific code, you will need to append `--prod` to the above mentioned commands to ensure that the Angular compiler is able to pick up the changes appropriately and doesn't fail. This will build all the packages in production mode. + +```sh +yarn task --prod +``` + +```bash +cd code +yarn build --prod --watch angular core-server api addon-docs +``` + ## Contributing to Storybook For further advice on how to contribute, please refer to our [NEW contributing guide on the Storybook website](https://storybook.js.org/docs/contribute). diff --git a/code/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch b/code/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch similarity index 94% rename from code/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch rename to code/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch index b2028a85b1ff..04c3bd5cfd7a 100644 --- a/code/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch +++ b/code/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch @@ -1,5 +1,5 @@ diff --git a/dist/index.js b/dist/index.js -index 640839e4b9fef0f25d08d055d4350845a8a29791..844f3d5834147848b5fa54276e96e665bcc675f9 100644 +index 13af149aa3c44f52dd5c5a80db3bf5689dfe15ea..1d111032c3fdc104723e19dea49db62be8b79b94 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6,26 +6,32 @@ import { processError } from '@vitest/utils/error'; diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index f798b6e82401..98c6dc6f3abe 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-a11y", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Test component compliance with web accessibility standards", "keywords": [ "a11y", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index 1bcd908e9377..a9389aecd362 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-actions", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Get UI feedback when an action is performed on an interactive element", "keywords": [ "storybook", diff --git a/code/addons/actions/src/loaders.ts b/code/addons/actions/src/loaders.ts index eebb09acb71b..a2d479367f9a 100644 --- a/code/addons/actions/src/loaders.ts +++ b/code/addons/actions/src/loaders.ts @@ -20,6 +20,7 @@ const logActionsWhenMockCalled: LoaderFunction = (context) => { const onMockCall = global.__STORYBOOK_TEST_ON_MOCK_CALL__ as typeof onMockCallType; onMockCall((mock, args) => { const name = mock.getMockName(); + if (name === 'spy') return; // TODO: Make this a configurable API in 8.2 if ( diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index fa6402313b09..68d6d3a97517 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-backgrounds", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Switch backgrounds to view components in different settings", "keywords": [ "addon", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 91b84365dfe9..d5f966de67eb 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-controls", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Interact with component inputs dynamically in the Storybook UI", "keywords": [ "addon", diff --git a/code/addons/docs/docs/recipes.md b/code/addons/docs/docs/recipes.md index 20faa8fba1a7..e98c89145b78 100644 --- a/code/addons/docs/docs/recipes.md +++ b/code/addons/docs/docs/recipes.md @@ -269,8 +269,8 @@ export const parameters = { transform: (src, storyContext) => { const match = SOURCE_REGEX.exec(src); return match ? match[1] : src; - } - } + }, + }, }, }; ``` diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index afe6ecc75dfa..667ae3311754 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-docs", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Document component usage and properties in Markdown", "keywords": [ "addon", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index d4d25d6b4b88..3deaac715ae6 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-essentials", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Curated addons to bring out the best of Storybook", "keywords": [ "addon", diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index 2c1acb0ea2a1..fe67a0813a4a 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-mdx-gfm", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "GitHub Flavored Markdown in Storybook", "keywords": [ "addon", diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 1b16a4b58f4d..6dbb90466b94 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-highlight", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Highlight DOM nodes within your stories", "keywords": [ "storybook-addons", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index b8b4ec51f868..d5a53d1f9335 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-interactions", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Automate, test and debug user interactions", "keywords": [ "storybook-addons", diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 69ebc3f50d17..d48ba2d653e3 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-jest", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "React storybook addon that show component jest report", "keywords": [ "addon", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index a8c141aecd44..1c08dc9d6874 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-links", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Link stories together to build demos and prototypes with your UI components", "keywords": [ "addon", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 28b18e6cd0f6..9715b782285d 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-measure", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Inspect layouts by visualizing the box model", "keywords": [ "storybook-addons", diff --git a/code/addons/onboarding/package.json b/code/addons/onboarding/package.json index 2d1fcdc83594..ecdf6a057eb5 100644 --- a/code/addons/onboarding/package.json +++ b/code/addons/onboarding/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-onboarding", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Addon Onboarding - Introduces a new onboarding experience", "keywords": [ "storybook-addons", diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index d324c8167494..07048e5598fd 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-outline", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Outline all elements with CSS to help with layout placement and alignment", "keywords": [ "storybook-addons", diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index ac4bc31bfd9b..17bd0fac7963 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-storysource", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "View a story’s source code to see how it works and paste into your app", "keywords": [ "addon", diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index cb0d2323a1c7..64f3064109ba 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-themes", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Switch between multiple themes for you components in Storybook", "keywords": [ "css", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index b7820f9c86da..c932829575a3 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-toolbars", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Create your own toolbar items that control story rendering", "keywords": [ "addon", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 5cf79091bc8b..ad8a6f9bbc86 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/addon-viewport", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Build responsive components by adjusting Storybook’s viewport size and orientation", "keywords": [ "addon", diff --git a/code/builders/builder-manager/package.json b/code/builders/builder-manager/package.json index 10bd33285b3f..f14fed2ad72c 100644 --- a/code/builders/builder-manager/package.json +++ b/code/builders/builder-manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-manager", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook manager builder", "keywords": [ "storybook" diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index aae112d759e0..fed519098fc6 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "A plugin to run and build Storybooks with Vite", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme", "bugs": { diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index a8441092ee95..300830db877a 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/builder-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 4faa6b912800..33702a5ea44c 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/angular", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.", "keywords": [ "storybook", diff --git a/code/frameworks/angular/src/builders/build-storybook/index.ts b/code/frameworks/angular/src/builders/build-storybook/index.ts index 25f7faeb5268..892547aabe80 100644 --- a/code/frameworks/angular/src/builders/build-storybook/index.ts +++ b/code/frameworks/angular/src/builders/build-storybook/index.ts @@ -40,6 +40,7 @@ export type StorybookBuilderOptions = JsonObject & { enableProdMode?: boolean; styles?: StyleElement[]; stylePreprocessorOptions?: StylePreprocessorOptions; + preserveSymlinks?: boolean; assets?: AssetPattern[]; sourceMap?: SourceMapUnion; } & Pick< @@ -102,6 +103,7 @@ const commandBuilder: BuilderHandlerFn = ( assets, previewUrl, sourceMap = false, + preserveSymlinks = false, } = options; const standaloneOptions: StandaloneBuildOptions = { @@ -121,6 +123,7 @@ const commandBuilder: BuilderHandlerFn = ( ...(styles ? { styles } : {}), ...(assets ? { assets } : {}), sourceMap, + preserveSymlinks, }, tsConfig, webpackStatsJson, diff --git a/code/frameworks/angular/src/builders/build-storybook/schema.json b/code/frameworks/angular/src/builders/build-storybook/schema.json index 6b614e574172..dbc2a734417e 100644 --- a/code/frameworks/angular/src/builders/build-storybook/schema.json +++ b/code/frameworks/angular/src/builders/build-storybook/schema.json @@ -19,6 +19,11 @@ "description": "Directory where to store built files.", "default": "storybook-static" }, + "preserveSymlinks": { + "type": "boolean", + "description": "Do not use the real path when resolving modules. If true, symlinks are resolved to their real path, if false, symlinks are resolved to their symlinked path.", + "default": false + }, "configDir": { "type": "string", "description": "Directory where to load Storybook configurations from.", diff --git a/code/frameworks/angular/src/builders/start-storybook/index.ts b/code/frameworks/angular/src/builders/start-storybook/index.ts index 2ecbb63c8a0f..7700cc3acdbc 100644 --- a/code/frameworks/angular/src/builders/start-storybook/index.ts +++ b/code/frameworks/angular/src/builders/start-storybook/index.ts @@ -37,6 +37,7 @@ export type StorybookBuilderOptions = JsonObject & { styles?: StyleElement[]; stylePreprocessorOptions?: StylePreprocessorOptions; assets?: AssetPattern[]; + preserveSymlinks?: boolean; sourceMap?: SourceMapUnion; } & Pick< // makes sure the option exists @@ -118,6 +119,7 @@ const commandBuilder: BuilderHandlerFn = (options, cont statsJson, previewUrl, sourceMap = false, + preserveSymlinks = false, } = options; const standaloneOptions: StandaloneOptions = { @@ -141,6 +143,7 @@ const commandBuilder: BuilderHandlerFn = (options, cont ...(stylePreprocessorOptions ? { stylePreprocessorOptions } : {}), ...(styles ? { styles } : {}), ...(assets ? { assets } : {}), + preserveSymlinks, sourceMap, }, tsConfig, diff --git a/code/frameworks/angular/src/builders/start-storybook/schema.json b/code/frameworks/angular/src/builders/start-storybook/schema.json index 2b98bab9039c..a2eef03e4b08 100644 --- a/code/frameworks/angular/src/builders/start-storybook/schema.json +++ b/code/frameworks/angular/src/builders/start-storybook/schema.json @@ -19,6 +19,11 @@ "type": "string", "description": "The full path for the TypeScript configuration file, relative to the current workspace." }, + "preserveSymlinks": { + "type": "boolean", + "description": "Do not use the real path when resolving modules. If true, symlinks are resolved to their real path, if false, symlinks are resolved to their symlinked path.", + "default": false + }, "port": { "type": "number", "description": "Port to listen on.", diff --git a/code/frameworks/angular/src/builders/utils/standalone-options.ts b/code/frameworks/angular/src/builders/utils/standalone-options.ts index ef73d78f01b5..83fc0090985c 100644 --- a/code/frameworks/angular/src/builders/utils/standalone-options.ts +++ b/code/frameworks/angular/src/builders/utils/standalone-options.ts @@ -18,6 +18,7 @@ export type StandaloneOptions = CLIOptions & stylePreprocessorOptions?: StylePreprocessorOptions; assets?: AssetPattern[]; sourceMap?: SourceMapUnion; + preserveSymlinks?: boolean; }; angularBuilderContext?: BuilderContext | null; tsConfig?: string; diff --git a/code/frameworks/angular/src/server/angular-cli-webpack.js b/code/frameworks/angular/src/server/angular-cli-webpack.js index 621680125536..f4e667fee6ee 100644 --- a/code/frameworks/angular/src/server/angular-cli-webpack.js +++ b/code/frameworks/angular/src/server/angular-cli-webpack.js @@ -68,6 +68,10 @@ exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext } styles: builderOptions.styles ?.map((style) => (typeof style === 'string' ? style : style.input)) .filter((style) => typeof style === 'string' || style.inject !== false), + outputPath: + typeof builderOptions.outputPath === 'string' + ? builderOptions.outputPath + : builderOptions.outputPath?.base, // Fixed options optimization: false, diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 853660cb4a92..8b75c0745994 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/ember", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.", "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember", "bugs": { diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index 0ecdb9b434ce..345a10d8a3b4 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index ba4a2280b9c8..00b58d37a4cd 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index 0df64e8b9a80..787eec5bf71a 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/nextjs", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Next.js", "keywords": [ "storybook", diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index dbe0f9c41734..61e2febcc654 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index 6baadf3b6648..efb8b009365d 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 286fcec565a5..866623f3abc3 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index ce878557c82d..ea2c69cbe331 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index dac4e44976ff..aa9ba2f01364 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index f3d4c3c34c5e..0a77eab289de 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 9ce49600b0f3..24fc7d697a6d 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 0e73220ed023..2cea5347c870 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/sveltekit", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for SvelteKit", "keywords": [ "storybook", diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 9912c3069dd8..fb0b55c407a2 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-vite", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 09296d2c545c..fb75b82687c9 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3-webpack5", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index ea383e2f20e8..68ecfa925019 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": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index d46c42d8f0d5..3b89531a3a57 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": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.", "keywords": [ "lit", diff --git a/code/lib/channels/package.json b/code/lib/channels/package.json index 77f0b958cb55..dce466cdf260 100644 --- a/code/lib/channels/package.json +++ b/code/lib/channels/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/channels", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index c9ea662ba9de..6a4ea600af4e 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -1,6 +1,6 @@ { "name": "sb", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index 3720a8c341ce..85d88756d72c 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook CLI", "keywords": [ "storybook" diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index c442915fe174..d85956d5704d 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/cli", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook's CLI - install, dev, build, upgrade, and more", "keywords": [ "cli", diff --git a/code/lib/cli/src/automigrate/fixes/react-docgen.ts b/code/lib/cli/src/automigrate/fixes/react-docgen.ts index 41e0875f475d..9359a96bacd9 100644 --- a/code/lib/cli/src/automigrate/fixes/react-docgen.ts +++ b/code/lib/cli/src/automigrate/fixes/react-docgen.ts @@ -62,7 +62,7 @@ export const reactDocgen: Fix = { For known "react-docgen" limitations, see: ${chalk.yellow('https://github.com/storybookjs/storybook/issues/26606')} - Press Y to revert to ${chalk.cyan('react-docgen-typesript')}, press N to use ${chalk.cyan( + Press Y to revert to ${chalk.cyan('react-docgen-typescript')}, press N to use ${chalk.cyan( 'react-docgen' )} `; diff --git a/code/lib/client-logger/package.json b/code/lib/client-logger/package.json index 16912db1c5bc..7ff03e0eab1e 100644 --- a/code/lib/client-logger/package.json +++ b/code/lib/client-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/client-logger", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 60f840e29cf1..5a3d3f033266 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/codemod", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "A collection of codemod scripts written with JSCodeshift", "keywords": [ "storybook" diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index 1e2c1c99b8a5..33df867f6050 100644 --- a/code/lib/core-common/package.json +++ b/code/lib/core-common/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-common", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts b/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts index 8bf64a548ed5..9cefd9052bf4 100644 --- a/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts +++ b/code/lib/core-common/src/utils/__tests__/normalize-stories.test.ts @@ -42,172 +42,172 @@ const options = { describe('normalizeStoriesEntry', () => { it('direct file path', () => { - const specifier = normalizeStoriesEntry('../path/to/file.stories.mdx', options); + const specifier = normalizeStoriesEntry('../path/to/file.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": "./path/to", - "files": "file.stories.mdx", + "files": "file.stories.jsx", "importPathMatcher": {} } `); - expect(specifier.importPathMatcher).toMatchPaths(['./path/to/file.stories.mdx']); + expect(specifier.importPathMatcher).toMatchPaths(['./path/to/file.stories.jsx']); expect(specifier.importPathMatcher).not.toMatchPaths([ './path/to/file.stories.js', - './file.stories.mdx', - '../file.stories.mdx', + './file.stories.jsx', + '../file.stories.jsx', ]); }); it('story in config dir', () => { - const specifier = normalizeStoriesEntry('./file.stories.mdx', options); + const specifier = normalizeStoriesEntry('./file.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": "./.storybook", - "files": "file.stories.mdx", + "files": "file.stories.jsx", "importPathMatcher": {} } `); - expect(specifier.importPathMatcher).toMatchPaths(['./.storybook/file.stories.mdx']); + expect(specifier.importPathMatcher).toMatchPaths(['./.storybook/file.stories.jsx']); expect(specifier.importPathMatcher).not.toMatchPaths([ - '.storybook/file.stories.mdx', - './file.stories.mdx', - '../file.stories.mdx', + '.storybook/file.stories.jsx', + './file.stories.jsx', + '../file.stories.jsx', ]); }); it('non-recursive files glob', () => { - const specifier = normalizeStoriesEntry('../*/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../*/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "*/*.stories.mdx", + "files": "*/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './path/file.stories.mdx', - './second-path/file.stories.mdx', + './path/file.stories.jsx', + './second-path/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ './path/file.stories.js', - './path/to/file.stories.mdx', - './file.stories.mdx', - '../file.stories.mdx', + './path/to/file.stories.jsx', + './file.stories.jsx', + '../file.stories.jsx', ]); }); it('double non-recursive directory/files glob', () => { - const specifier = normalizeStoriesEntry('../*/*/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../*/*/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "*/*/*.stories.mdx", + "files": "*/*/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './path/to/file.stories.mdx', - './second-path/to/file.stories.mdx', + './path/to/file.stories.jsx', + './second-path/to/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ - './file.stories.mdx', - './path/file.stories.mdx', - './path/to/third/file.stories.mdx', + './file.stories.jsx', + './path/file.stories.jsx', + './path/to/third/file.stories.jsx', './path/to/file.stories.js', - '../file.stories.mdx', + '../file.stories.jsx', ]); }); it('directory/files glob', () => { - const specifier = normalizeStoriesEntry('../**/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../**/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "**/*.stories.mdx", + "files": "**/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './file.stories.mdx', - './path/file.stories.mdx', - './path/to/file.stories.mdx', - './path/to/third/file.stories.mdx', + './file.stories.jsx', + './path/file.stories.jsx', + './path/to/file.stories.jsx', + './path/to/third/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ './file.stories.js', - '../file.stories.mdx', + '../file.stories.jsx', ]); }); it('double stars glob', () => { - const specifier = normalizeStoriesEntry('../**/foo/**/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../**/foo/**/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "**/foo/**/*.stories.mdx", + "files": "**/foo/**/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './foo/file.stories.mdx', - './path/to/foo/file.stories.mdx', - './path/to/foo/third/fourth/file.stories.mdx', + './foo/file.stories.jsx', + './path/to/foo/file.stories.jsx', + './path/to/foo/third/fourth/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ - './file.stories.mdx', + './file.stories.jsx', './file.stories.js', - '../file.stories.mdx', + '../file.stories.jsx', ]); }); it('intermediate directory glob', () => { - const specifier = normalizeStoriesEntry('../**/foo/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../**/foo/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "**/foo/*.stories.mdx", + "files": "**/foo/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './path/to/foo/file.stories.mdx', - './foo/file.stories.mdx', + './path/to/foo/file.stories.jsx', + './foo/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ - './file.stories.mdx', + './file.stories.jsx', './file.stories.js', - './path/to/foo/third/fourth/file.stories.mdx', - '../file.stories.mdx', + './path/to/foo/third/fourth/file.stories.jsx', + '../file.stories.jsx', ]); }); it('directory outside of working dir', () => { - const specifier = normalizeStoriesEntry('../../src/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../../src/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": "../src", - "files": "*.stories.mdx", + "files": "*.stories.jsx", "importPathMatcher": {} } `); - expect(specifier.importPathMatcher).toMatchPaths(['../src/file.stories.mdx']); + expect(specifier.importPathMatcher).toMatchPaths(['../src/file.stories.jsx']); expect(specifier.importPathMatcher).not.toMatchPaths([ - './src/file.stories.mdx', + './src/file.stories.jsx', '../src/file.stories.js', ]); }); @@ -237,11 +237,11 @@ describe('normalizeStoriesEntry', () => { }); it('directory/files specifier', () => { - const specifier = normalizeStoriesEntry({ directory: '..', files: '*.stories.mdx' }, options); + const specifier = normalizeStoriesEntry({ directory: '..', files: '*.stories.jsx' }, options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", - "files": "*.stories.mdx", + "files": "*.stories.jsx", "directory": ".", "importPathMatcher": {} } @@ -262,13 +262,13 @@ describe('normalizeStoriesEntry', () => { it('directory/titlePrefix/files specifier', () => { const specifier = normalizeStoriesEntry( - { directory: '..', titlePrefix: 'atoms', files: '*.stories.mdx' }, + { directory: '..', titlePrefix: 'atoms', files: '*.stories.jsx' }, options ); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "atoms", - "files": "*.stories.mdx", + "files": "*.stories.jsx", "directory": ".", "importPathMatcher": {} } @@ -276,25 +276,25 @@ describe('normalizeStoriesEntry', () => { }); it('globs with negation', () => { - const specifier = normalizeStoriesEntry('../!(negation)/*.stories.mdx', options); + const specifier = normalizeStoriesEntry('../!(negation)/*.stories.jsx', options); expect(specifier).toMatchInlineSnapshot(` { "titlePrefix": "", "directory": ".", - "files": "!(negation)/*.stories.mdx", + "files": "!(negation)/*.stories.jsx", "importPathMatcher": {} } `); expect(specifier.importPathMatcher).toMatchPaths([ - './path/file.stories.mdx', - './second-path/file.stories.mdx', + './path/file.stories.jsx', + './second-path/file.stories.jsx', ]); expect(specifier.importPathMatcher).not.toMatchPaths([ './path/file.stories.js', - './path/to/file.stories.mdx', - './file.stories.mdx', - '../file.stories.mdx', + './path/to/file.stories.jsx', + './file.stories.jsx', + '../file.stories.jsx', ]); }); }); diff --git a/code/lib/core-common/src/versions.ts b/code/lib/core-common/src/versions.ts index 1e098af7355a..938bb031fdb6 100644 --- a/code/lib/core-common/src/versions.ts +++ b/code/lib/core-common/src/versions.ts @@ -1,83 +1,83 @@ // auto generated file, do not edit export default { - '@storybook/addon-a11y': '8.2.0-alpha.5', - '@storybook/addon-actions': '8.2.0-alpha.5', - '@storybook/addon-backgrounds': '8.2.0-alpha.5', - '@storybook/addon-controls': '8.2.0-alpha.5', - '@storybook/addon-docs': '8.2.0-alpha.5', - '@storybook/addon-essentials': '8.2.0-alpha.5', - '@storybook/addon-highlight': '8.2.0-alpha.5', - '@storybook/addon-interactions': '8.2.0-alpha.5', - '@storybook/addon-jest': '8.2.0-alpha.5', - '@storybook/addon-links': '8.2.0-alpha.5', - '@storybook/addon-mdx-gfm': '8.2.0-alpha.5', - '@storybook/addon-measure': '8.2.0-alpha.5', - '@storybook/addon-onboarding': '8.2.0-alpha.5', - '@storybook/addon-outline': '8.2.0-alpha.5', - '@storybook/addon-storysource': '8.2.0-alpha.5', - '@storybook/addon-themes': '8.2.0-alpha.5', - '@storybook/addon-toolbars': '8.2.0-alpha.5', - '@storybook/addon-viewport': '8.2.0-alpha.5', - '@storybook/angular': '8.2.0-alpha.5', - '@storybook/blocks': '8.2.0-alpha.5', - '@storybook/builder-manager': '8.2.0-alpha.5', - '@storybook/builder-vite': '8.2.0-alpha.5', - '@storybook/builder-webpack5': '8.2.0-alpha.5', - '@storybook/channels': '8.2.0-alpha.5', - '@storybook/cli': '8.2.0-alpha.5', - '@storybook/client-logger': '8.2.0-alpha.5', - '@storybook/codemod': '8.2.0-alpha.5', - '@storybook/components': '8.2.0-alpha.5', - '@storybook/core-common': '8.2.0-alpha.5', - '@storybook/core-events': '8.2.0-alpha.5', - '@storybook/core-server': '8.2.0-alpha.5', - '@storybook/core-webpack': '8.2.0-alpha.5', - '@storybook/csf-plugin': '8.2.0-alpha.5', - '@storybook/csf-tools': '8.2.0-alpha.5', - '@storybook/docs-tools': '8.2.0-alpha.5', - '@storybook/ember': '8.2.0-alpha.5', - '@storybook/html': '8.2.0-alpha.5', - '@storybook/html-vite': '8.2.0-alpha.5', - '@storybook/html-webpack5': '8.2.0-alpha.5', - '@storybook/instrumenter': '8.2.0-alpha.5', - '@storybook/manager': '8.2.0-alpha.5', - '@storybook/manager-api': '8.2.0-alpha.5', - '@storybook/nextjs': '8.2.0-alpha.5', - '@storybook/node-logger': '8.2.0-alpha.5', - '@storybook/preact': '8.2.0-alpha.5', - '@storybook/preact-vite': '8.2.0-alpha.5', - '@storybook/preact-webpack5': '8.2.0-alpha.5', - '@storybook/preset-create-react-app': '8.2.0-alpha.5', - '@storybook/preset-html-webpack': '8.2.0-alpha.5', - '@storybook/preset-preact-webpack': '8.2.0-alpha.5', - '@storybook/preset-react-webpack': '8.2.0-alpha.5', - '@storybook/preset-server-webpack': '8.2.0-alpha.5', - '@storybook/preset-svelte-webpack': '8.2.0-alpha.5', - '@storybook/preset-vue3-webpack': '8.2.0-alpha.5', - '@storybook/preview': '8.2.0-alpha.5', - '@storybook/preview-api': '8.2.0-alpha.5', - '@storybook/react': '8.2.0-alpha.5', - '@storybook/react-dom-shim': '8.2.0-alpha.5', - '@storybook/react-vite': '8.2.0-alpha.5', - '@storybook/react-webpack5': '8.2.0-alpha.5', - '@storybook/router': '8.2.0-alpha.5', - '@storybook/server': '8.2.0-alpha.5', - '@storybook/server-webpack5': '8.2.0-alpha.5', - '@storybook/source-loader': '8.2.0-alpha.5', - '@storybook/svelte': '8.2.0-alpha.5', - '@storybook/svelte-vite': '8.2.0-alpha.5', - '@storybook/svelte-webpack5': '8.2.0-alpha.5', - '@storybook/sveltekit': '8.2.0-alpha.5', - '@storybook/telemetry': '8.2.0-alpha.5', - '@storybook/test': '8.2.0-alpha.5', - '@storybook/theming': '8.2.0-alpha.5', - '@storybook/types': '8.2.0-alpha.5', - '@storybook/vue3': '8.2.0-alpha.5', - '@storybook/vue3-vite': '8.2.0-alpha.5', - '@storybook/vue3-webpack5': '8.2.0-alpha.5', - '@storybook/web-components': '8.2.0-alpha.5', - '@storybook/web-components-vite': '8.2.0-alpha.5', - '@storybook/web-components-webpack5': '8.2.0-alpha.5', - sb: '8.2.0-alpha.5', - storybook: '8.2.0-alpha.5', + '@storybook/addon-a11y': '8.2.0-alpha.6', + '@storybook/addon-actions': '8.2.0-alpha.6', + '@storybook/addon-backgrounds': '8.2.0-alpha.6', + '@storybook/addon-controls': '8.2.0-alpha.6', + '@storybook/addon-docs': '8.2.0-alpha.6', + '@storybook/addon-essentials': '8.2.0-alpha.6', + '@storybook/addon-highlight': '8.2.0-alpha.6', + '@storybook/addon-interactions': '8.2.0-alpha.6', + '@storybook/addon-jest': '8.2.0-alpha.6', + '@storybook/addon-links': '8.2.0-alpha.6', + '@storybook/addon-mdx-gfm': '8.2.0-alpha.6', + '@storybook/addon-measure': '8.2.0-alpha.6', + '@storybook/addon-onboarding': '8.2.0-alpha.6', + '@storybook/addon-outline': '8.2.0-alpha.6', + '@storybook/addon-storysource': '8.2.0-alpha.6', + '@storybook/addon-themes': '8.2.0-alpha.6', + '@storybook/addon-toolbars': '8.2.0-alpha.6', + '@storybook/addon-viewport': '8.2.0-alpha.6', + '@storybook/angular': '8.2.0-alpha.6', + '@storybook/blocks': '8.2.0-alpha.6', + '@storybook/builder-manager': '8.2.0-alpha.6', + '@storybook/builder-vite': '8.2.0-alpha.6', + '@storybook/builder-webpack5': '8.2.0-alpha.6', + '@storybook/channels': '8.2.0-alpha.6', + '@storybook/cli': '8.2.0-alpha.6', + '@storybook/client-logger': '8.2.0-alpha.6', + '@storybook/codemod': '8.2.0-alpha.6', + '@storybook/components': '8.2.0-alpha.6', + '@storybook/core-common': '8.2.0-alpha.6', + '@storybook/core-events': '8.2.0-alpha.6', + '@storybook/core-server': '8.2.0-alpha.6', + '@storybook/core-webpack': '8.2.0-alpha.6', + '@storybook/csf-plugin': '8.2.0-alpha.6', + '@storybook/csf-tools': '8.2.0-alpha.6', + '@storybook/docs-tools': '8.2.0-alpha.6', + '@storybook/ember': '8.2.0-alpha.6', + '@storybook/html': '8.2.0-alpha.6', + '@storybook/html-vite': '8.2.0-alpha.6', + '@storybook/html-webpack5': '8.2.0-alpha.6', + '@storybook/instrumenter': '8.2.0-alpha.6', + '@storybook/manager': '8.2.0-alpha.6', + '@storybook/manager-api': '8.2.0-alpha.6', + '@storybook/nextjs': '8.2.0-alpha.6', + '@storybook/node-logger': '8.2.0-alpha.6', + '@storybook/preact': '8.2.0-alpha.6', + '@storybook/preact-vite': '8.2.0-alpha.6', + '@storybook/preact-webpack5': '8.2.0-alpha.6', + '@storybook/preset-create-react-app': '8.2.0-alpha.6', + '@storybook/preset-html-webpack': '8.2.0-alpha.6', + '@storybook/preset-preact-webpack': '8.2.0-alpha.6', + '@storybook/preset-react-webpack': '8.2.0-alpha.6', + '@storybook/preset-server-webpack': '8.2.0-alpha.6', + '@storybook/preset-svelte-webpack': '8.2.0-alpha.6', + '@storybook/preset-vue3-webpack': '8.2.0-alpha.6', + '@storybook/preview': '8.2.0-alpha.6', + '@storybook/preview-api': '8.2.0-alpha.6', + '@storybook/react': '8.2.0-alpha.6', + '@storybook/react-dom-shim': '8.2.0-alpha.6', + '@storybook/react-vite': '8.2.0-alpha.6', + '@storybook/react-webpack5': '8.2.0-alpha.6', + '@storybook/router': '8.2.0-alpha.6', + '@storybook/server': '8.2.0-alpha.6', + '@storybook/server-webpack5': '8.2.0-alpha.6', + '@storybook/source-loader': '8.2.0-alpha.6', + '@storybook/svelte': '8.2.0-alpha.6', + '@storybook/svelte-vite': '8.2.0-alpha.6', + '@storybook/svelte-webpack5': '8.2.0-alpha.6', + '@storybook/sveltekit': '8.2.0-alpha.6', + '@storybook/telemetry': '8.2.0-alpha.6', + '@storybook/test': '8.2.0-alpha.6', + '@storybook/theming': '8.2.0-alpha.6', + '@storybook/types': '8.2.0-alpha.6', + '@storybook/vue3': '8.2.0-alpha.6', + '@storybook/vue3-vite': '8.2.0-alpha.6', + '@storybook/vue3-webpack5': '8.2.0-alpha.6', + '@storybook/web-components': '8.2.0-alpha.6', + '@storybook/web-components-vite': '8.2.0-alpha.6', + '@storybook/web-components-webpack5': '8.2.0-alpha.6', + sb: '8.2.0-alpha.6', + storybook: '8.2.0-alpha.6', }; diff --git a/code/lib/core-events/package.json b/code/lib/core-events/package.json index d67015b3f68f..3a8017ec9d4d 100644 --- a/code/lib/core-events/package.json +++ b/code/lib/core-events/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-events", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Event names used in storybook core", "keywords": [ "storybook" diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index 6b37d0efb369..22c89a0e6323 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-server", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" @@ -96,6 +96,7 @@ "telejson": "^7.2.0", "tiny-invariant": "^1.3.1", "ts-dedent": "^2.0.0", + "tsconfig-paths": "^4.2.0", "util": "^0.12.4", "util-deprecate": "^1.0.2", "watchpack": "^2.2.0", diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts index ccce3fe481bc..ca89c4a861a8 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.test.ts @@ -75,6 +75,7 @@ describe('StoryIndexGenerator', () => { { "entries": { "a--story-one": { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -107,6 +108,7 @@ describe('StoryIndexGenerator', () => { { "entries": { "f--story-one": { + "componentPath": undefined, "id": "f--story-one", "importPath": "./src/F.story.ts", "name": "Story One", @@ -138,6 +140,7 @@ describe('StoryIndexGenerator', () => { { "entries": { "stories--story-one": { + "componentPath": undefined, "id": "stories--story-one", "importPath": "./src/stories.ts", "name": "Story One", @@ -168,7 +171,44 @@ describe('StoryIndexGenerator', () => { expect(await generator.getIndex()).toMatchInlineSnapshot(` { "entries": { + "componentpath-extension--story-one": { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/package", + "type": "story", + }, "nested-button--story-one": { + "componentPath": undefined, "id": "nested-button--story-one", "importPath": "./src/nested/Button.stories.ts", "name": "Story One", @@ -181,6 +221,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "second-nested-g--story-one": { + "componentPath": undefined, "id": "second-nested-g--story-one", "importPath": "./src/second-nested/G.stories.ts", "name": "Story One", @@ -211,6 +252,7 @@ describe('StoryIndexGenerator', () => { { "entries": { "a--story-one": { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -224,6 +266,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "b--story-one": { + "componentPath": undefined, "id": "b--story-one", "importPath": "./src/B.stories.ts", "name": "Story One", @@ -235,7 +278,44 @@ describe('StoryIndexGenerator', () => { "title": "B", "type": "story", }, + "componentpath-extension--story-one": { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/package", + "type": "story", + }, "d--story-one": { + "componentPath": undefined, "id": "d--story-one", "importPath": "./src/D.stories.jsx", "name": "Story One", @@ -248,6 +328,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "first-nested-deeply-f--story-one": { + "componentPath": undefined, "id": "first-nested-deeply-f--story-one", "importPath": "./src/first-nested/deeply/F.stories.js", "name": "Story One", @@ -259,6 +340,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "h--story-one": { + "componentPath": undefined, "id": "h--story-one", "importPath": "./src/H.stories.mjs", "name": "Story One", @@ -271,6 +353,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "nested-button--story-one": { + "componentPath": undefined, "id": "nested-button--story-one", "importPath": "./src/nested/Button.stories.ts", "name": "Story One", @@ -283,6 +366,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "second-nested-g--story-one": { + "componentPath": undefined, "id": "second-nested-g--story-one", "importPath": "./src/second-nested/G.stories.ts", "name": "Story One", @@ -318,6 +402,7 @@ describe('StoryIndexGenerator', () => { { "entries": { "a--story-one": { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -344,6 +429,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "b--story-one": { + "componentPath": undefined, "id": "b--story-one", "importPath": "./src/B.stories.ts", "name": "Story One", @@ -355,6 +441,42 @@ describe('StoryIndexGenerator', () => { "title": "B", "type": "story", }, + "componentpath-extension--story-one": { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/package", + "type": "story", + }, "d--docs": { "id": "d--docs", "importPath": "./src/D.stories.jsx", @@ -369,6 +491,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "d--story-one": { + "componentPath": undefined, "id": "d--story-one", "importPath": "./src/D.stories.jsx", "name": "Story One", @@ -381,6 +504,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "first-nested-deeply-f--story-one": { + "componentPath": undefined, "id": "first-nested-deeply-f--story-one", "importPath": "./src/first-nested/deeply/F.stories.js", "name": "Story One", @@ -405,6 +529,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "h--story-one": { + "componentPath": undefined, "id": "h--story-one", "importPath": "./src/H.stories.mjs", "name": "Story One", @@ -417,6 +542,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "nested-button--story-one": { + "componentPath": undefined, "id": "nested-button--story-one", "importPath": "./src/nested/Button.stories.ts", "name": "Story One", @@ -429,6 +555,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "second-nested-g--story-one": { + "componentPath": undefined, "id": "second-nested-g--story-one", "importPath": "./src/second-nested/G.stories.ts", "name": "Story One", @@ -471,6 +598,12 @@ describe('StoryIndexGenerator', () => { "d--story-one", "h--docs", "h--story-one", + "componentpath-extension--docs", + "componentpath-extension--story-one", + "componentpath-noextension--docs", + "componentpath-noextension--story-one", + "componentpath-package--docs", + "componentpath-package--story-one", "first-nested-deeply-f--docs", "first-nested-deeply-f--story-one", "nested-button--docs", @@ -581,6 +714,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "b--story-one": { + "componentPath": undefined, "id": "b--story-one", "importPath": "./src/B.stories.ts", "name": "Story One", @@ -644,6 +778,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "b--story-one": { + "componentPath": undefined, "id": "b--story-one", "importPath": "./src/B.stories.ts", "name": "Story One", @@ -700,6 +835,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "a--story-one": { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -747,6 +883,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "duplicate-a--story-one": { + "componentPath": undefined, "id": "duplicate-a--story-one", "importPath": "./duplicate/A.stories.js", "name": "Story One", @@ -759,6 +896,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "duplicate-a--story-two": { + "componentPath": undefined, "id": "duplicate-a--story-two", "importPath": "./duplicate/SecondA.stories.js", "name": "Story Two", @@ -820,6 +958,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "my-component-a--story-one": { + "componentPath": undefined, "id": "my-component-a--story-one", "importPath": "./docs-id-generation/A.stories.jsx", "name": "Story One", @@ -881,6 +1020,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "a--story-one": { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -1014,6 +1154,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "a--story-one": { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -1085,6 +1226,7 @@ describe('StoryIndexGenerator', () => { { "entries": { "a--story-one": { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "name": "Story One", @@ -1098,6 +1240,7 @@ describe('StoryIndexGenerator', () => { "type": "story", }, "b--story-one": { + "componentPath": undefined, "id": "b--story-one", "importPath": "./src/B.stories.ts", "name": "Story One", @@ -1165,6 +1308,7 @@ describe('StoryIndexGenerator', () => { "type": "docs", }, "my-component-b--story-one": { + "componentPath": undefined, "id": "my-component-b--story-one", "importPath": "./docs-id-generation/B.stories.jsx", "name": "Story One", @@ -1349,6 +1493,9 @@ describe('StoryIndexGenerator', () => { "componentreference--docs", "notitle--docs", "h--story-one", + "componentpath-extension--story-one", + "componentpath-noextension--story-one", + "componentpath-package--story-one", "first-nested-deeply-f--story-one", ] `); @@ -1367,7 +1514,7 @@ describe('StoryIndexGenerator', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(readCsfMock).toHaveBeenCalledTimes(7); + expect(readCsfMock).toHaveBeenCalledTimes(10); readCsfMock.mockClear(); await generator.getIndex(); @@ -1424,7 +1571,7 @@ describe('StoryIndexGenerator', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(readCsfMock).toHaveBeenCalledTimes(7); + expect(readCsfMock).toHaveBeenCalledTimes(10); generator.invalidate(specifier, './src/B.stories.ts', false); @@ -1509,7 +1656,7 @@ describe('StoryIndexGenerator', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(readCsfMock).toHaveBeenCalledTimes(7); + expect(readCsfMock).toHaveBeenCalledTimes(10); generator.invalidate(specifier, './src/B.stories.ts', true); @@ -1548,7 +1695,7 @@ describe('StoryIndexGenerator', () => { const generator = new StoryIndexGenerator([specifier], options); await generator.initialize(); await generator.getIndex(); - expect(readCsfMock).toHaveBeenCalledTimes(7); + expect(readCsfMock).toHaveBeenCalledTimes(10); generator.invalidate(specifier, './src/B.stories.ts', true); diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.ts index 3330a7e21a54..487447d18f4f 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.ts @@ -3,6 +3,8 @@ import chalk from 'chalk'; import fs from 'fs-extra'; import slash from 'slash'; import invariant from 'tiny-invariant'; +import * as TsconfigPaths from 'tsconfig-paths'; +import findUp from 'find-up'; import type { IndexEntry, @@ -52,9 +54,8 @@ export type StoryIndexGeneratorOptions = { }; export const AUTODOCS_TAG = 'autodocs'; -export const STORIES_MDX_TAG = 'stories-mdx'; -export const UNATTACHED_MDX_TAG = 'unattached-mdx'; export const ATTACHED_MDX_TAG = 'attached-mdx'; +export const UNATTACHED_MDX_TAG = 'unattached-mdx'; export const PLAY_FN_TAG = 'play-fn'; /** Was this docs entry generated by a .mdx file? (see discussion below) */ @@ -82,12 +83,11 @@ const makeAbsolute = (otherImport: Path, normalizedPath: Path, workingDir: Path) * * A stories file is indexed by an indexer (passed in), which produces a list of stories. * - If the stories have the `parameters.docsOnly` setting, they are disregarded. - * - If the stories have the 'stories-mdx' tag (i.e. were generated by a .stories.mdx file), - * OR autodocs is enabled, a docs entry is added pointing to the story file. + * - If the stories have autodocs enabled, a docs entry is added pointing to the story file. * * A (modern) docs (.mdx) file is indexed, a docs entry is added. * - * In the preview, a docs entry with either the `autodocs` or `stories-mdx` tags will be rendered + * In the preview, a docs entry with the `autodocs` tag will be rendered * as a CSF file that exports an MDX template on the `docs.page` parameter, whereas * other docs entries are rendered as MDX files directly. * @@ -278,6 +278,35 @@ export class StoryIndexGenerator { ); } + /** + * Try to find the component path from a raw import string and return it in + * the same format as `importPath`. Respect tsconfig paths if available. + * + * If no such file exists, assume that the import is from a package and + * return the raw path. + */ + resolveComponentPath( + rawComponentPath: Path, + absolutePath: Path, + matchPath: TsconfigPaths.MatchPath | undefined + ) { + let rawPath = rawComponentPath; + if (matchPath) { + rawPath = matchPath(rawPath) ?? rawPath; + } + + const absoluteComponentPath = path.resolve(path.dirname(absolutePath), rawPath); + const existing = ['', '.js', '.ts', '.jsx', '.tsx', '.mjs', '.mts'] + .map((ext) => `${absoluteComponentPath}${ext}`) + .find((candidate) => fs.existsSync(candidate)); + if (existing) { + const relativePath = path.relative(this.options.workingDir, existing); + return slash(normalizeStoryPath(relativePath)); + } + + return rawComponentPath; + } + async extractStories( specifier: NormalizedStoriesSpecifier, absolutePath: Path, @@ -299,11 +328,25 @@ export class StoryIndexGenerator { invariant(indexer, `No matching indexer found for ${absolutePath}`); const indexInputs = await indexer.createIndex(absolutePath, { makeTitle: defaultMakeTitle }); + const tsconfigPath = await findUp('tsconfig.json', { cwd: this.options.workingDir }); + const tsconfig = TsconfigPaths.loadConfig(tsconfigPath); + let matchPath: TsconfigPaths.MatchPath | undefined; + if (tsconfig.resultType === 'success') { + matchPath = TsconfigPaths.createMatchPath(tsconfig.absoluteBaseUrl, tsconfig.paths, [ + 'browser', + 'module', + 'main', + ]); + } const entries: ((StoryIndexEntryWithMetaId | DocsCacheEntry) & { tags: Tag[] })[] = indexInputs.map((input) => { const name = input.name ?? storyNameFromExport(input.exportName); + const componentPath = + input.rawComponentPath && + this.resolveComponentPath(input.rawComponentPath, absolutePath, matchPath); const title = input.title ?? defaultMakeTitle(); + // eslint-disable-next-line no-underscore-dangle const id = input.__id ?? toId(input.metaId ?? title, storyNameFromExport(input.exportName)); const tags = combineTags(...projectTags, ...(input.tags ?? [])); @@ -315,16 +358,16 @@ export class StoryIndexGenerator { name, title, importPath, + componentPath, tags, }; }); // We need a docs entry attached to the CSF file if either: - // a) we have autodocs enabled for this file - // b) it is a stories.mdx transpiled to CSF + // a) autodocs is globally enabled + // b) we have autodocs enabled for this file const hasAutodocsTag = entries.some((entry) => entry.tags.includes(AUTODOCS_TAG)); - const isStoriesMdx = entries.some((entry) => entry.tags.includes(STORIES_MDX_TAG)); - const createDocEntry = (hasAutodocsTag && this.options.docs.autodocs !== false) || isStoriesMdx; + const createDocEntry = hasAutodocsTag && this.options.docs.autodocs !== false; if (createDocEntry && this.options.build?.test?.disableAutoDocs !== true) { const name = this.options.docs.defaultName ?? 'Docs'; @@ -344,12 +387,8 @@ export class StoryIndexGenerator { }); } - const entriesWithoutDocsOnlyStories = entries.filter( - (entry) => !(entry.type === 'story' && entry.tags.includes('stories-mdx-docsOnly')) - ); - return { - entries: entriesWithoutDocsOnlyStories, + entries, dependents: [], type: 'stories', }; diff --git a/code/lib/core-server/src/utils/__mockdata__/src/componentPath/component.js b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/component.js new file mode 100644 index 000000000000..ff8b4c56321a --- /dev/null +++ b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/component.js @@ -0,0 +1 @@ +export default {}; diff --git a/code/lib/core-server/src/utils/__mockdata__/src/componentPath/extension.stories.js b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/extension.stories.js new file mode 100644 index 000000000000..8a2b7cff9b7e --- /dev/null +++ b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/extension.stories.js @@ -0,0 +1,7 @@ +import component from './component.js'; + +export default { + component, +}; + +export const StoryOne = {}; diff --git a/code/lib/core-server/src/utils/__mockdata__/src/componentPath/noExtension.stories.js b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/noExtension.stories.js new file mode 100644 index 000000000000..4bb5febc075f --- /dev/null +++ b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/noExtension.stories.js @@ -0,0 +1,7 @@ +import component from './component'; + +export default { + component, +}; + +export const StoryOne = {}; diff --git a/code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js new file mode 100644 index 000000000000..20509edcf2be --- /dev/null +++ b/code/lib/core-server/src/utils/__mockdata__/src/componentPath/package.stories.js @@ -0,0 +1,8 @@ +// eslint-disable-next-line import/no-unresolved +import component from 'component-package'; + +export default { + component, +}; + +export const StoryOne = {}; diff --git a/code/lib/core-server/src/utils/__tests__/autoName.test.ts b/code/lib/core-server/src/utils/__tests__/autoName.test.ts index 9aefb7ec3eed..64954fc55d17 100644 --- a/code/lib/core-server/src/utils/__tests__/autoName.test.ts +++ b/code/lib/core-server/src/utils/__tests__/autoName.test.ts @@ -2,9 +2,9 @@ import { it, expect } from 'vitest'; import { autoName } from '../autoName'; it('pulls name from named MDX files', () => { - expect(autoName('Conventions.mdx', 'Button.stories.mdx', 'Docs')).toEqual('Conventions'); + expect(autoName('Conventions.mdx', 'Button.mdx', 'Docs')).toEqual('Conventions'); }); it('falls back for default named MDX files', () => { - expect(autoName('Button.mdx', 'Button.stories.mdx', 'Docs')).toEqual('Docs'); + expect(autoName('Button.mdx', 'Button.stories.jsx', 'Docs')).toEqual('Docs'); }); diff --git a/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts b/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts index a7bc19ae8ab9..9ab35f518034 100644 --- a/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts +++ b/code/lib/core-server/src/utils/__tests__/index-extraction.test.ts @@ -8,7 +8,7 @@ import { normalizeStoriesEntry } from '@storybook/core-common'; import type { NormalizedStoriesSpecifier } from '@storybook/types'; import type { StoryIndexGeneratorOptions } from '../StoryIndexGenerator'; -import { AUTODOCS_TAG, STORIES_MDX_TAG, StoryIndexGenerator } from '../StoryIndexGenerator'; +import { AUTODOCS_TAG, StoryIndexGenerator } from '../StoryIndexGenerator'; vi.mock('@storybook/node-logger'); @@ -64,6 +64,7 @@ describe('story extraction', () => { "dependents": [], "entries": [ { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": "a", @@ -75,6 +76,7 @@ describe('story extraction', () => { "type": "story", }, { + "componentPath": undefined, "id": "some-fully-custom-id", "importPath": "./src/A.stories.js", "metaId": "custom-id", @@ -118,6 +120,7 @@ describe('story extraction', () => { "dependents": [], "entries": [ { + "componentPath": undefined, "id": "f--story-one", "importPath": "./src/first-nested/deeply/F.stories.js", "metaId": undefined, @@ -163,6 +166,7 @@ describe('story extraction', () => { "dependents": [], "entries": [ { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/first-nested/deeply/F.stories.js", "metaId": "a", @@ -210,6 +214,7 @@ describe('story extraction', () => { "dependents": [], "entries": [ { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": "a", @@ -275,6 +280,7 @@ describe('story extraction', () => { "dependents": [], "entries": [ { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -286,6 +292,7 @@ describe('story extraction', () => { "type": "story", }, { + "componentPath": undefined, "id": "custom-title--story-two", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -297,6 +304,7 @@ describe('story extraction', () => { "type": "story", }, { + "componentPath": undefined, "id": "custom-meta-id--story-three", "importPath": "./src/A.stories.js", "metaId": "custom-meta-id", @@ -341,6 +349,7 @@ describe('story extraction', () => { "dependents": [], "entries": [ { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -390,6 +399,7 @@ describe('docs entries from story extraction', () => { "dependents": [], "entries": [ { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -449,6 +459,7 @@ describe('docs entries from story extraction', () => { "type": "docs", }, { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -497,6 +508,7 @@ describe('docs entries from story extraction', () => { "dependents": [], "entries": [ { + "componentPath": undefined, "id": "a--story-one", "importPath": "./src/A.stories.js", "metaId": undefined, @@ -513,64 +525,4 @@ describe('docs entries from story extraction', () => { } `); }); - it(`adds docs entry when an entry has the "${STORIES_MDX_TAG}" tag`, async () => { - const relativePath = './src/A.stories.js'; - const absolutePath = path.join(options.workingDir, relativePath); - const specifier: NormalizedStoriesSpecifier = normalizeStoriesEntry(relativePath, options); - - const generator = new StoryIndexGenerator([specifier], { - ...options, - docs: { defaultName: 'docs', autodocs: false }, - indexers: [ - { - test: /\.stories\.(m?js|ts)x?$/, - createIndex: async (fileName) => [ - { - exportName: 'StoryOne', - __id: 'a--story-one', - name: 'Story One', - title: 'A', - tags: [STORIES_MDX_TAG, 'story-tag-from-indexer'], - importPath: fileName, - type: 'story', - }, - ], - }, - ], - }); - const result = await generator.extractStories(specifier, absolutePath); - - expect(result).toMatchInlineSnapshot(` - { - "dependents": [], - "entries": [ - { - "id": "a--docs", - "importPath": "./src/A.stories.js", - "name": "docs", - "storiesImports": [], - "tags": [ - "stories-mdx", - "story-tag-from-indexer", - ], - "title": "A", - "type": "docs", - }, - { - "id": "a--story-one", - "importPath": "./src/A.stories.js", - "metaId": undefined, - "name": "Story One", - "tags": [ - "stories-mdx", - "story-tag-from-indexer", - ], - "title": "A", - "type": "story", - }, - ], - "type": "stories", - } - `); - }); }); diff --git a/code/lib/core-server/src/utils/stories-json.test.ts b/code/lib/core-server/src/utils/stories-json.test.ts index 0a7a2f4a3b5c..5ba134673c83 100644 --- a/code/lib/core-server/src/utils/stories-json.test.ts +++ b/code/lib/core-server/src/utils/stories-json.test.ts @@ -165,6 +165,42 @@ describe('useStoriesJson', () => { "title": "B", "type": "story", }, + "componentpath-extension--story-one": { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-extension--story-one", + "importPath": "./src/componentPath/extension.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/extension", + "type": "story", + }, + "componentpath-noextension--story-one": { + "componentPath": "./src/componentPath/component.js", + "id": "componentpath-noextension--story-one", + "importPath": "./src/componentPath/noExtension.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/noExtension", + "type": "story", + }, + "componentpath-package--story-one": { + "componentPath": "component-package", + "id": "componentpath-package--story-one", + "importPath": "./src/componentPath/package.stories.js", + "name": "Story One", + "tags": [ + "dev", + "test", + ], + "title": "componentPath/package", + "type": "story", + }, "d--story-one": { "id": "d--story-one", "importPath": "./src/D.stories.jsx", diff --git a/code/lib/core-server/src/utils/summarizeIndex.test.ts b/code/lib/core-server/src/utils/summarizeIndex.test.ts index 8d71317f3918..e1be61027c22 100644 --- a/code/lib/core-server/src/utils/summarizeIndex.test.ts +++ b/code/lib/core-server/src/utils/summarizeIndex.test.ts @@ -144,7 +144,6 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, - "storiesMdxCount": 0, "storyCount": 0, "version": 5, } @@ -202,7 +201,6 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 1, "pageStoryCount": 0, "playStoryCount": 0, - "storiesMdxCount": 0, "storyCount": 0, "version": 5, } @@ -258,7 +256,6 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, - "storiesMdxCount": 0, "storyCount": 4, "version": 5, } @@ -315,69 +312,11 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 0, "pageStoryCount": 1, "playStoryCount": 1, - "storiesMdxCount": 0, "storyCount": 1, "version": 5, } `); }); - it('storiesMdx', () => { - expect( - summarizeIndex({ - v: 5, - entries: { - 'stories-renderers-react-react-mdx--docs': { - id: 'stories-renderers-react-react-mdx--docs', - title: 'stories/renderers/react/react-mdx', - name: 'Docs', - importPath: './src/stories/renderers/react/react-mdx.stories.mdx', - type: 'docs', - tags: ['stories-mdx', 'docs'], - storiesImports: [], - }, - 'stories-renderers-react-react-mdx--primary': { - id: 'stories-renderers-react-react-mdx--primary', - title: 'stories/renderers/react/react-mdx', - name: 'Primary', - importPath: './src/stories/renderers/react/react-mdx.stories.mdx', - tags: ['stories-mdx', 'story'], - type: 'story', - }, - 'stories-renderers-react-react-mdx--secondary': { - id: 'stories-renderers-react-react-mdx--secondary', - title: 'stories/renderers/react/react-mdx', - name: 'Secondary', - importPath: './src/stories/renderers/react/react-mdx.stories.mdx', - tags: ['stories-mdx', 'story'], - type: 'story', - }, - 'stories-renderers-react-react-mdx--from-template': { - id: 'stories-renderers-react-react-mdx--from-template', - title: 'stories/renderers/react/react-mdx', - name: 'From Template', - importPath: './src/stories/renderers/react/react-mdx.stories.mdx', - tags: ['stories-mdx', 'story'], - type: 'story', - }, - }, - }) - ).toMatchInlineSnapshot(` - { - "autodocsCount": 0, - "componentCount": 1, - "exampleDocsCount": 0, - "exampleStoryCount": 0, - "mdxCount": 0, - "onboardingDocsCount": 0, - "onboardingStoryCount": 0, - "pageStoryCount": 0, - "playStoryCount": 0, - "storiesMdxCount": 1, - "storyCount": 3, - "version": 5, - } - `); - }); it('autodocs', () => { expect( summarizeIndex({ @@ -430,7 +369,6 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, - "storiesMdxCount": 0, "storyCount": 0, "version": 5, } @@ -481,7 +419,6 @@ describe('summarizeIndex', () => { "onboardingStoryCount": 0, "pageStoryCount": 0, "playStoryCount": 0, - "storiesMdxCount": 0, "storyCount": 0, "version": 5, } diff --git a/code/lib/core-server/src/utils/summarizeIndex.ts b/code/lib/core-server/src/utils/summarizeIndex.ts index 091038cdaccf..8b74ad8b7f5f 100644 --- a/code/lib/core-server/src/utils/summarizeIndex.ts +++ b/code/lib/core-server/src/utils/summarizeIndex.ts @@ -1,6 +1,6 @@ import type { IndexEntry, StoryIndex } from '@storybook/types'; -import { STORIES_MDX_TAG, isMdxEntry, AUTODOCS_TAG, PLAY_FN_TAG } from './StoryIndexGenerator'; +import { isMdxEntry, AUTODOCS_TAG, PLAY_FN_TAG } from './StoryIndexGenerator'; const PAGE_REGEX = /(page|screen)/i; @@ -44,7 +44,6 @@ export function summarizeIndex(storyIndex: StoryIndex) { let pageStoryCount = 0; let playStoryCount = 0; let autodocsCount = 0; - let storiesMdxCount = 0; let mdxCount = 0; Object.values(storyIndex.entries).forEach((entry) => { if (isCLIExampleEntry(entry)) { @@ -65,8 +64,6 @@ export function summarizeIndex(storyIndex: StoryIndex) { } else if (entry.type === 'docs') { if (isMdxEntry(entry)) { mdxCount += 1; - } else if (entry.tags?.includes(STORIES_MDX_TAG)) { - storiesMdxCount += 1; } else if (entry.tags?.includes(AUTODOCS_TAG)) { autodocsCount += 1; } @@ -79,7 +76,6 @@ export function summarizeIndex(storyIndex: StoryIndex) { pageStoryCount, playStoryCount, autodocsCount, - storiesMdxCount, mdxCount, exampleStoryCount, exampleDocsCount, diff --git a/code/lib/core-server/src/utils/watch-story-specifiers.test.ts b/code/lib/core-server/src/utils/watch-story-specifiers.test.ts index 22d3e0901de8..4026de15fa11 100644 --- a/code/lib/core-server/src/utils/watch-story-specifiers.test.ts +++ b/code/lib/core-server/src/utils/watch-story-specifiers.test.ts @@ -83,7 +83,7 @@ describe('watchStorySpecifiers', () => { }); it('watches single file globs', async () => { - const specifier = normalizeStoriesEntry('../src/nested/Button.stories.mdx', options); + const specifier = normalizeStoriesEntry('../src/nested/Button.mdx', options); const onInvalidate = vi.fn(); close = watchStorySpecifiers([specifier], { workingDir }, onInvalidate); @@ -98,33 +98,33 @@ describe('watchStorySpecifiers', () => { // File changed, matching onInvalidate.mockClear(); - await onChange('src/nested/Button.stories.mdx', 1234); - expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.stories.mdx`, false); + await onChange('src/nested/Button.mdx', 1234); + expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.mdx`, false); // File changed, NOT matching onInvalidate.mockClear(); - await onChange('src/nested/Button.mdx', 1234); + await onChange('src/nested/Button.tsx', 1234); expect(onInvalidate).not.toHaveBeenCalled(); // File removed, matching onInvalidate.mockClear(); - await onRemove('src/nested/Button.stories.mdx'); - expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.stories.mdx`, true); + await onRemove('src/nested/Button.mdx'); + expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.mdx`, true); // File removed, NOT matching onInvalidate.mockClear(); - await onRemove('src/nested/Button.mdx'); + await onRemove('src/nested/Button.tsx'); expect(onInvalidate).not.toHaveBeenCalled(); // File moved out, matching onInvalidate.mockClear(); - await onChange('src/nested/Button.stories.mdx', null); - expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.stories.mdx`, true); + await onChange('src/nested/Button.mdx', null); + expect(onInvalidate).toHaveBeenCalledWith(specifier, `./src/nested/Button.mdx`, true); }); it('multiplexes between two specifiers on the same directory', async () => { const globSpecifier = normalizeStoriesEntry('../src/**/*.stories.@(ts|js)', options); - const fileSpecifier = normalizeStoriesEntry('../src/nested/Button.stories.mdx', options); + const fileSpecifier = normalizeStoriesEntry('../src/nested/Button.mdx', options); const onInvalidate = vi.fn(); close = watchStorySpecifiers([globSpecifier, fileSpecifier], { workingDir }, onInvalidate); @@ -145,11 +145,7 @@ describe('watchStorySpecifiers', () => { ); onInvalidate.mockClear(); - await onChange('src/nested/Button.stories.mdx', 1234); - expect(onInvalidate).toHaveBeenCalledWith( - fileSpecifier, - `./src/nested/Button.stories.mdx`, - false - ); + await onChange('src/nested/Button.mdx', 1234); + expect(onInvalidate).toHaveBeenCalledWith(fileSpecifier, `./src/nested/Button.mdx`, false); }); }); diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index a2aba0551023..50cd8d71d0b2 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/core-webpack", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook framework-agnostic API", "keywords": [ "storybook" diff --git a/code/lib/core-webpack/src/to-require-context.test.ts b/code/lib/core-webpack/src/to-require-context.test.ts index 90fab1d15f97..e6dbd3c8a90a 100644 --- a/code/lib/core-webpack/src/to-require-context.test.ts +++ b/code/lib/core-webpack/src/to-require-context.test.ts @@ -61,21 +61,21 @@ const testCases = [ }, // INVALID GLOB { - glob: '../src/stories/**/*.stories.(js|mdx)', + glob: '../src/stories/**/*.stories.(js|ts)', recursive: true, validPaths: [ '../src/stories/components/Icon.stories.js', '../src/stories/Icon.stories.js', - '../src/stories/Icon.stories.mdx', + '../src/stories/Icon.stories.ts', '../src/stories/components/Icon/Icon.stories.js', - '../src/stories/components/Icon.stories/Icon.stories.mdx', + '../src/stories/components/Icon.stories/Icon.stories.ts', ], invalidPaths: [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', - '../src/stories/components/Icon/Icon.stories.ts', + '../src/Icon.stories.ts', + '../src/stories/components/Icon/Icon.stories.tsx', '../src/stories/components/Icon/Icon.mdx', ], }, @@ -89,59 +89,59 @@ const testCases = [ invalidPaths: ['./dirname/../stories.js', './dirname/../App.stories.js'], }, { - glob: '../src/stories/**/@(*.stories.js|*.stories.mdx)', + glob: '../src/stories/**/@(*.stories.js|*.stories.ts)', recursive: true, validPaths: [ '../src/stories/components/Icon.stories.js', '../src/stories/Icon.stories.js', - '../src/stories/Icon.stories.mdx', + '../src/stories/Icon.stories.ts', '../src/stories/components/Icon/Icon.stories.js', - '../src/stories/components/Icon.stories/Icon.stories.mdx', + '../src/stories/components/Icon.stories/Icon.stories.ts', ], invalidPaths: [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', - '../src/stories/components/Icon/Icon.stories.ts', + '../src/Icon.stories.ts', + '../src/stories/components/Icon/Icon.stories.tsx', '../src/stories/components/Icon/Icon.mdx', ], }, { - glob: '../src/stories/**/*.stories.+(js|mdx)', + glob: '../src/stories/**/*.stories.+(js|ts)', recursive: true, validPaths: [ '../src/stories/components/Icon.stories.js', '../src/stories/Icon.stories.js', - '../src/stories/Icon.stories.mdx', + '../src/stories/Icon.stories.ts', '../src/stories/components/Icon/Icon.stories.js', - '../src/stories/components/Icon.stories/Icon.stories.mdx', + '../src/stories/components/Icon.stories/Icon.stories.ts', ], invalidPaths: [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', - '../src/stories/components/Icon/Icon.stories.ts', + '../src/Icon.stories.tsx', + '../src/stories/components/Icon/Icon.stories.tsx', '../src/stories/components/Icon/Icon.mdx', ], }, { - glob: '../src/stories/**/*.stories.*(js|mdx)', + glob: '../src/stories/**/*.stories.*(js|ts)', recursive: true, validPaths: [ '../src/stories/components/Icon.stories.js', '../src/stories/Icon.stories.js', - '../src/stories/Icon.stories.mdx', + '../src/stories/Icon.stories.ts', '../src/stories/components/Icon/Icon.stories.js', - '../src/stories/components/Icon.stories/Icon.stories.mdx', + '../src/stories/components/Icon.stories/Icon.stories.ts', ], invalidPaths: [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', - '../src/stories/components/Icon/Icon.stories.ts', + '../src/Icon.stories.ts', + '../src/stories/components/Icon/Icon.stories.tsx', '../src/stories/components/Icon/Icon.mdx', ], }, @@ -150,13 +150,13 @@ const testCases = [ recursive: false, validPaths: ['../src/stories/components/Icon.stories.js'], invalidPaths: [ - '../src/Icon.stories.mdx', - '../src/stories/components/Icon.stories/Icon.stories.mdx', + '../src/Icon.stories.tsx', + '../src/stories/components/Icon.stories/Icon.stories.tsx', '../src/stories/components/Icon/Icon.mdx', '../src/stories/components/Icon/Icon.stories.js', '../src/stories/components/Icon/Icon.stories.ts', '../src/stories/Icon.stories.js', - '../src/stories/Icon.stories.mdx', + '../src/stories/Icon.stories.tsx', './Icon.stories.js', './src/stories/Icon.stories.js', './stories.js', @@ -191,7 +191,7 @@ const testCases = [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', + '../src/Icon.stories.tsx', '../src/stories/components/Icon/Icon.stories.ts', '../src/stories/components/Icon/Icon.mdx', ], @@ -205,7 +205,7 @@ const testCases = [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', + '../src/Icon.stories.tsx', '../src/stories/components/Icon/Icon.stories.ts', '../src/stories/components/Icon/Icon.mdx', ], @@ -219,7 +219,7 @@ const testCases = [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', + '../src/Icon.stories.tsx', '../components/icon/Icon.stories.js', '../components/basics/simple/icon/Icon.stories.js', '../src/stories/components/Icon/Icon.stories.ts', @@ -235,7 +235,7 @@ const testCases = [ './stories.js', './src/stories/Icon.stories.js', './Icon.stories.js', - '../src/Icon.stories.mdx', + '../src/Icon.stories.tsx', '../src/stories/components/Icon/Icon.stories.ts', '../src/stories/components/Icon/Icon.mdx', ], diff --git a/code/lib/csf-plugin/package.json b/code/lib/csf-plugin/package.json index 3c3e25ac952d..946f99ec028c 100644 --- a/code/lib/csf-plugin/package.json +++ b/code/lib/csf-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-plugin", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Enrich CSF files via static analysis", "keywords": [ "storybook" diff --git a/code/lib/csf-tools/package.json b/code/lib/csf-tools/package.json index 2b467e447c6d..dfe637f07abd 100644 --- a/code/lib/csf-tools/package.json +++ b/code/lib/csf-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/csf-tools", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Parse and manipulate CSF and Storybook config files", "keywords": [ "storybook" diff --git a/code/lib/csf-tools/src/CsfFile.test.ts b/code/lib/csf-tools/src/CsfFile.test.ts index 669109d268ac..4c87576d2474 100644 --- a/code/lib/csf-tools/src/CsfFile.test.ts +++ b/code/lib/csf-tools/src/CsfFile.test.ts @@ -442,7 +442,7 @@ describe('CsfFile', () => { export const TestControl = () => _jsx("p", { children: "Hello" }); - export default { title: 'foo/bar', tags: ['stories-mdx'], includeStories: ["__page"] }; + export default { title: 'foo/bar', includeStories: ["__page"] }; export const __page = () => {}; __page.parameters = { docsOnly: true }; `, @@ -451,8 +451,6 @@ describe('CsfFile', () => { ).toMatchInlineSnapshot(` meta: title: foo/bar - tags: - - stories-mdx includeStories: - __page stories: @@ -1203,4 +1201,116 @@ describe('CsfFile', () => { `); }); }); + + describe('componenent paths', () => { + it('no component', () => { + const { indexInputs } = loadCsf( + dedent` + import { Component } from '../src/Component.js'; + export default { + title: 'custom foo title', + }; + + export const A = { + render: () => {}, + }; + `, + { makeTitle, fileName: 'foo/bar.stories.js' } + ).parse(); + + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + exportName: A + name: A + title: custom foo title + tags: [] + __id: custom-foo-title--a + `); + }); + + it('local component', () => { + const { indexInputs } = loadCsf( + dedent` + const Component = (props) =>
hello
; + + export default { + title: 'custom foo title', + component: Component, + }; + + export const A = { + render: () => {}, + }; + `, + { makeTitle, fileName: 'foo/bar.stories.js' } + ).parse(); + + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + exportName: A + name: A + title: custom foo title + tags: [] + __id: custom-foo-title--a + `); + }); + + it('imported component from file', () => { + const { indexInputs } = loadCsf( + dedent` + import { Component } from '../src/Component.js'; + export default { + title: 'custom foo title', + component: Component, + }; + + export const A = { + render: () => {}, + }; + `, + { makeTitle, fileName: 'foo/bar.stories.js' } + ).parse(); + + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + rawComponentPath: ../src/Component.js + exportName: A + name: A + title: custom foo title + tags: [] + __id: custom-foo-title--a + `); + }); + + it('imported component from library', () => { + const { indexInputs } = loadCsf( + dedent` + import { Component } from 'some-library'; + export default { + title: 'custom foo title', + component: Component, + }; + + export const A = { + render: () => {}, + }; + `, + { makeTitle, fileName: 'foo/bar.stories.js' } + ).parse(); + + expect(indexInputs).toMatchInlineSnapshot(` + - type: story + importPath: foo/bar.stories.js + rawComponentPath: some-library + exportName: A + name: A + title: custom foo title + tags: [] + __id: custom-foo-title--a + `); + }); + }); }); diff --git a/code/lib/csf-tools/src/CsfFile.ts b/code/lib/csf-tools/src/CsfFile.ts index ce0db70e3393..8e2757733545 100644 --- a/code/lib/csf-tools/src/CsfFile.ts +++ b/code/lib/csf-tools/src/CsfFile.ts @@ -142,6 +142,8 @@ export class CsfFile { _fileName: string; + _rawComponentPath?: string; + _makeTitle: (title: string) => string; _meta?: StaticMeta; @@ -202,6 +204,21 @@ export class CsfFile { } else if (['includeStories', 'excludeStories'].includes(p.key.name)) { (meta as any)[p.key.name] = parseIncludeExclude(p.value); } else if (p.key.name === 'component') { + const n = p.value; + if (t.isIdentifier(n)) { + const id = n.name; + const importStmt = program.body.find( + (stmt) => + t.isImportDeclaration(stmt) && + stmt.specifiers.find((spec) => spec.local.name === id) + ) as t.ImportDeclaration; + if (importStmt) { + const { source } = importStmt; + if (t.isStringLiteral(source)) { + this._rawComponentPath = source.value; + } + } + } const { code } = recast.print(p.value, {}); meta.component = code; } else if (p.key.name === 'tags') { @@ -564,6 +581,7 @@ export class CsfFile { return { type: 'story', importPath: this._fileName, + rawComponentPath: this._rawComponentPath, exportName, name: story.name, title: this.meta?.title, diff --git a/code/lib/docs-tools/package.json b/code/lib/docs-tools/package.json index 285f056bbd8a..ec9775ddfa9d 100644 --- a/code/lib/docs-tools/package.json +++ b/code/lib/docs-tools/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/docs-tools", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Shared utility functions for frameworks to implement docs", "keywords": [ "storybook" diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index 11dd6efba30c..640ffea57bc9 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/instrumenter", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index ca6d294ae93b..71c8496f6224 100644 --- a/code/lib/manager-api/package.json +++ b/code/lib/manager-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager-api", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook Manager API & Context", "keywords": [ "storybook" diff --git a/code/lib/manager-api/src/tests/mockStoriesEntries.ts b/code/lib/manager-api/src/tests/mockStoriesEntries.ts index 703b6e6efb76..a820307f4ef2 100644 --- a/code/lib/manager-api/src/tests/mockStoriesEntries.ts +++ b/code/lib/manager-api/src/tests/mockStoriesEntries.ts @@ -53,7 +53,6 @@ export const docsEntries: StoryIndex['entries'] = { name: 'Docs', importPath: './path/to/component-b.ts', storiesImports: [], - tags: ['stories-mdx'], }, 'component-c--story-4': { type: 'story', diff --git a/code/lib/manager-api/src/version.ts b/code/lib/manager-api/src/version.ts index 6b3f64cd9cd3..e93b3f36000a 100644 --- a/code/lib/manager-api/src/version.ts +++ b/code/lib/manager-api/src/version.ts @@ -1 +1 @@ -export const version = '8.2.0-alpha.5'; +export const version = '8.2.0-alpha.6'; diff --git a/code/lib/node-logger/package.json b/code/lib/node-logger/package.json index 9af71342d39c..979175f0d8e9 100644 --- a/code/lib/node-logger/package.json +++ b/code/lib/node-logger/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/node-logger", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index aae788273cd4..40e4b57ae0ac 100644 --- a/code/lib/preview-api/package.json +++ b/code/lib/preview-api/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview-api", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/preview-api/src/modules/preview-web/PreviewWithSelection.tsx b/code/lib/preview-api/src/modules/preview-web/PreviewWithSelection.tsx index 193a5f52358a..9b1a8ed9348a 100644 --- a/code/lib/preview-api/src/modules/preview-web/PreviewWithSelection.tsx +++ b/code/lib/preview-api/src/modules/preview-web/PreviewWithSelection.tsx @@ -53,7 +53,6 @@ function focusInInput(event: Event) { } export const AUTODOCS_TAG = 'autodocs'; -export const STORIES_MDX_TAG = 'stories-mdx'; export const ATTACHED_MDX_TAG = 'attached-mdx'; export const UNATTACHED_MDX_TAG = 'unattached-mdx'; diff --git a/code/lib/preview-api/src/modules/preview-web/render/CsfDocsRender.ts b/code/lib/preview-api/src/modules/preview-web/render/CsfDocsRender.ts index 019d43d97893..0be1ce5821c3 100644 --- a/code/lib/preview-api/src/modules/preview-web/render/CsfDocsRender.ts +++ b/code/lib/preview-api/src/modules/preview-web/render/CsfDocsRender.ts @@ -25,8 +25,6 @@ import { DocsContext } from '../docs-context/DocsContext'; * * Use cases: * - Autodocs, where there is no story, and we fall back to the globally defined template. - * - *.stories.mdx files, where the MDX compiler produces a CSF file with a `.parameter.docs.page` - * parameter containing the compiled content of the MDX file. */ export class CsfDocsRender implements Render { public readonly type: RenderType = 'docs'; diff --git a/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts b/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts index 6babf08285ec..425e2162c425 100644 --- a/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts +++ b/code/lib/preview-api/src/modules/store/csf/portable-stories.test.ts @@ -23,6 +23,7 @@ describe('composeStory', () => { label: 'Hello World', primary: true, }, + tags: ['metaTag'], }; it('should compose project annotations in all module formats', () => { @@ -40,15 +41,16 @@ describe('composeStory', () => { it('should return story with composed annotations from story, meta and project', () => { const decoratorFromProjectAnnotations = vi.fn((StoryFn) => StoryFn()); const decoratorFromStoryAnnotations = vi.fn((StoryFn) => StoryFn()); - setProjectAnnotations([ - { - parameters: { injected: true }, - globalTypes: { - locale: { defaultValue: 'en' }, - }, - decorators: [decoratorFromProjectAnnotations], + const projectAnnotations = { + parameters: { injected: true }, + globalTypes: { + locale: { defaultValue: 'en' }, }, - ]); + decorators: [decoratorFromProjectAnnotations], + tags: ['projectTag'], + }; + + setProjectAnnotations(projectAnnotations); const Story: Story = { render: () => {}, @@ -57,6 +59,7 @@ describe('composeStory', () => { secondAddon: true, }, decorators: [decoratorFromStoryAnnotations], + tags: ['storyTag'], }; const composedStory = composeStory(Story, meta); @@ -64,6 +67,7 @@ describe('composeStory', () => { expect(composedStory.parameters).toEqual( expect.objectContaining({ ...Story.parameters, ...meta.parameters }) ); + expect(composedStory.tags).toEqual(['dev', 'test', 'projectTag', 'metaTag', 'storyTag']); composedStory(); diff --git a/code/lib/preview-api/src/modules/store/csf/portable-stories.ts b/code/lib/preview-api/src/modules/store/csf/portable-stories.ts index 056daa5dcbcb..987240ecab66 100644 --- a/code/lib/preview-api/src/modules/store/csf/portable-stories.ts +++ b/code/lib/preview-api/src/modules/store/csf/portable-stories.ts @@ -172,6 +172,7 @@ export function composeStory, play: playFunction as ComposedStoryPlayFn | undefined, + tags: story.tags, } ); diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index 95dde420557e..b0e70d1d1fd1 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preview", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/react-dom-shim/package.json b/code/lib/react-dom-shim/package.json index 454e8538edb8..d6a4618f23f2 100644 --- a/code/lib/react-dom-shim/package.json +++ b/code/lib/react-dom-shim/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react-dom-shim", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" diff --git a/code/lib/router/package.json b/code/lib/router/package.json index 9e2188d7cc8d..ae30caf449ef 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/router", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook Router", "keywords": [ "storybook" diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 5b223943e60d..acdb5d095449 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/source-loader", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Source loader", "keywords": [ "lib", diff --git a/code/lib/telemetry/package.json b/code/lib/telemetry/package.json index 60474dd72707..7fe29e2e0e9c 100644 --- a/code/lib/telemetry/package.json +++ b/code/lib/telemetry/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/telemetry", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Telemetry logging for crash reports and usage statistics", "keywords": [ "storybook" diff --git a/code/lib/test/package.json b/code/lib/test/package.json index d1428eb7f3e6..21ba24aa4bd7 100644 --- a/code/lib/test/package.json +++ b/code/lib/test/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/test", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "", "keywords": [ "storybook" @@ -23,9 +23,10 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "node": "./dist/index.js", "import": "./dist/index.mjs", - "require": "./dist/index.js" + "require": "./dist/index.js", + "node": "./dist/index.js", + "default": "./dist/index.mjs" }, "./package.json": "./package.json" }, @@ -47,11 +48,11 @@ "@storybook/core-events": "workspace:*", "@storybook/instrumenter": "workspace:*", "@storybook/preview-api": "workspace:*", - "@testing-library/dom": "^9.3.4", - "@testing-library/jest-dom": "^6.4.2", - "@testing-library/user-event": "^14.5.2", - "@vitest/expect": "1.3.1", - "@vitest/spy": "^1.3.1", + "@testing-library/dom": "10.1.0", + "@testing-library/jest-dom": "6.4.5", + "@testing-library/user-event": "14.5.2", + "@vitest/expect": "1.6.0", + "@vitest/spy": "1.6.0", "util": "^0.12.4" }, "devDependencies": { diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index 780d36d0b644..14206aa54cd7 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/theming", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/lib/theming/src/convert.ts b/code/lib/theming/src/convert.ts index fc23399d4a38..9765adc03d61 100644 --- a/code/lib/theming/src/convert.ts +++ b/code/lib/theming/src/convert.ts @@ -178,7 +178,7 @@ export const convert = (inherit: ThemeVars = themes[getPreferredColorScheme()]): }), // Addon actions theme - // API example https://github.com/xyc/react-inspector/blob/master/src/styles/themes/chromeLight.js + // API example https://github.com/storybookjs/react-inspector/blob/master/src/styles/themes/chromeLight.tsx addonActionsTheme: { ...(base === 'light' ? chromeLight : chromeDark), diff --git a/code/lib/types/package.json b/code/lib/types/package.json index e1b372b72fa9..5f6133c97b84 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/types", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook TS Types", "keywords": [ "storybook" diff --git a/code/lib/types/src/modules/composedStory.ts b/code/lib/types/src/modules/composedStory.ts index f670b1ef12a0..f4b49f24793a 100644 --- a/code/lib/types/src/modules/composedStory.ts +++ b/code/lib/types/src/modules/composedStory.ts @@ -6,6 +6,7 @@ import type { Renderer, StoryId, StrictArgTypes, + Tag, } from '@storybook/csf'; import type { @@ -56,6 +57,7 @@ export type ComposedStoryFn< storyName: string; parameters: Parameters; argTypes: StrictArgTypes; + tags: Tag[]; }; /** * Based on a module of stories, it returns all stories within it, filtering non-stories diff --git a/code/lib/types/src/modules/indexer.ts b/code/lib/types/src/modules/indexer.ts index 56d435cdb533..a34a2422766c 100644 --- a/code/lib/types/src/modules/indexer.ts +++ b/code/lib/types/src/modules/indexer.ts @@ -93,6 +93,8 @@ export type IndexEntry = StoryIndexEntry | DocsIndexEntry; export type BaseIndexInput = { /** The file to import from e.g. the story file. */ importPath: Path; + /** The raw path/package of the file that provides meta.component, if one exists */ + rawComponentPath?: Path; /** The name of the export to import. */ exportName: ExportName; /** The name of the entry, auto-generated from {@link exportName} if unspecified. */ diff --git a/code/package.json b/code/package.json index 147d84c8bcb1..e9414600048a 100644 --- a/code/package.json +++ b/code/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/root", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "private": true, "description": "Storybook root", "homepage": "https://storybook.js.org/", @@ -80,9 +80,8 @@ "resolutions": { "@playwright/test": "1.36.0", "@storybook/theming": "workspace:*", - "@testing-library/jest-dom/aria-query": "5.1.3", "@types/node": "^18.0.0", - "@vitest/expect": "patch:@vitest/expect@npm%3A1.3.1#~/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch", + "@vitest/expect": "patch:@vitest/expect@npm%3A1.6.0#~/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch", "esbuild": "^0.20.1", "playwright": "1.36.0", "playwright-core": "1.36.0", diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index 617471ef0462..eb12c3cc2c56 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preset-create-react-app", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Create React App preset", "keywords": [ "storybook" diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index 9f7351361637..7cc0ba55e84a 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": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index c3f310b4855b..b7beebe45fb7 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": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Preact: Develop Preact Component in isolation.", "keywords": [ "storybook" diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index 3179e13b2742..7afd1d1e33f3 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": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for React: Develop React Component in isolation with Hot Reloading", "keywords": [ "storybook" diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 8ef9d7d4a110..883cd1212ede 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": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index d8e63467adf2..f8f2d938d4b7 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": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index cd1769c10575..5ce828b8d3df 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": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.", "keywords": [ "storybook" diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index 19491a734873..8f7d12967b58 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/html", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook HTML renderer", "keywords": [ "storybook" diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index 94844f043fc1..bd2c3c40486e 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/preact", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Preact renderer", "keywords": [ "storybook" diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 992c52b40310..087738b5eb9e 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/react", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook React renderer", "keywords": [ "storybook" diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 9297fdd2a660..2027c2413f77 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/server", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Server renderer", "keywords": [ "storybook" diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index d6505a80370a..cc4616c38ec6 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/svelte", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Svelte renderer", "keywords": [ "storybook" diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index 1d4100e08a9d..83cc05d43579 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/vue3", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Vue 3 renderer", "keywords": [ "storybook" diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index 1e31ed978972..5afbb6550de6 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/web-components", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook web-components renderer", "keywords": [ "lit", diff --git a/code/ui/blocks/package.json b/code/ui/blocks/package.json index cbdbb474c6b5..4ad38b1953fe 100644 --- a/code/ui/blocks/package.json +++ b/code/ui/blocks/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/blocks", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Storybook Doc Blocks", "keywords": [ "storybook" diff --git a/code/ui/components/package.json b/code/ui/components/package.json index 456dbb101086..81657ca6026a 100644 --- a/code/ui/components/package.json +++ b/code/ui/components/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/components", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook Components", "keywords": [ "storybook" diff --git a/code/ui/manager/package.json b/code/ui/manager/package.json index 6e3ac33a8fad..ac9e956bbba2 100644 --- a/code/ui/manager/package.json +++ b/code/ui/manager/package.json @@ -1,6 +1,6 @@ { "name": "@storybook/manager", - "version": "8.2.0-alpha.5", + "version": "8.2.0-alpha.6", "description": "Core Storybook UI", "keywords": [ "storybook" diff --git a/code/yarn.lock b/code/yarn.lock index 60936fb56b7a..b1ddfe6b5077 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -501,7 +501,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.24.1, @babel/helper-create-class-features-plugin@npm:^7.24.4": +"@babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.21.0, @babel/helper-create-class-features-plugin@npm:^7.24.0, @babel/helper-create-class-features-plugin@npm:^7.24.1, @babel/helper-create-class-features-plugin@npm:^7.24.4": version: 7.24.4 resolution: "@babel/helper-create-class-features-plugin@npm:7.24.4" dependencies: @@ -520,25 +520,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.24.0": - version: 7.24.0 - resolution: "@babel/helper-create-class-features-plugin@npm:7.24.0" - dependencies: - "@babel/helper-annotate-as-pure": "npm:^7.22.5" - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-function-name": "npm:^7.23.0" - "@babel/helper-member-expression-to-functions": "npm:^7.23.0" - "@babel/helper-optimise-call-expression": "npm:^7.22.5" - "@babel/helper-replace-supers": "npm:^7.22.20" - "@babel/helper-skip-transparent-expression-wrappers": "npm:^7.22.5" - "@babel/helper-split-export-declaration": "npm:^7.22.6" - semver: "npm:^6.3.1" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/341548496df202805489422a160bba75b111d994c64d788a397c35f01784632af48bf06023af8aa2fe72c2c254f8c885b4e0f7f3df5ef17a37370f2feaf80328 - languageName: node - linkType: hard - "@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.22.15, @babel/helper-create-regexp-features-plugin@npm:^7.22.5": version: 7.22.15 resolution: "@babel/helper-create-regexp-features-plugin@npm:7.22.15" @@ -567,21 +548,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-define-polyfill-provider@npm:^0.6.0": - version: 0.6.0 - resolution: "@babel/helper-define-polyfill-provider@npm:0.6.0" - dependencies: - "@babel/helper-compilation-targets": "npm:^7.22.6" - "@babel/helper-plugin-utils": "npm:^7.22.5" - debug: "npm:^4.1.1" - lodash.debounce: "npm:^4.0.8" - resolve: "npm:^1.14.2" - peerDependencies: - "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10c0/bf6af52fadbbebc5bf71166b91eac4fc21431ec9b0d2a94063f3a3d900ed44aa1384ad23e920a85e7a657fcf3e80edb2eaaac9d902bd1e632f3b50c836b45c53 - languageName: node - linkType: hard - "@babel/helper-define-polyfill-provider@npm:^0.6.1, @babel/helper-define-polyfill-provider@npm:^0.6.2": version: 0.6.2 resolution: "@babel/helper-define-polyfill-provider@npm:0.6.2" @@ -623,7 +589,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-member-expression-to-functions@npm:^7.22.15, @babel/helper-member-expression-to-functions@npm:^7.23.0": +"@babel/helper-member-expression-to-functions@npm:^7.23.0": version: 7.23.0 resolution: "@babel/helper-member-expression-to-functions@npm:7.23.0" dependencies: @@ -632,16 +598,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.22.15, @babel/helper-module-imports@npm:^7.8.3": - version: 7.22.15 - resolution: "@babel/helper-module-imports@npm:7.22.15" - dependencies: - "@babel/types": "npm:^7.22.15" - checksum: 10c0/4e0d7fc36d02c1b8c8b3006dfbfeedf7a367d3334a04934255de5128115ea0bafdeb3e5736a2559917f0653e4e437400d54542da0468e08d3cbc86d3bbfa8f30 - languageName: node - linkType: hard - -"@babel/helper-module-imports@npm:^7.24.1, @babel/helper-module-imports@npm:^7.24.3": +"@babel/helper-module-imports@npm:^7.16.7, @babel/helper-module-imports@npm:^7.22.15, @babel/helper-module-imports@npm:^7.24.1, @babel/helper-module-imports@npm:^7.24.3, @babel/helper-module-imports@npm:^7.8.3": version: 7.24.3 resolution: "@babel/helper-module-imports@npm:7.24.3" dependencies: @@ -694,19 +651,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-replace-supers@npm:^7.22.20": - version: 7.22.20 - resolution: "@babel/helper-replace-supers@npm:7.22.20" - dependencies: - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-member-expression-to-functions": "npm:^7.22.15" - "@babel/helper-optimise-call-expression": "npm:^7.22.5" - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 10c0/6b0858811ad46873817c90c805015d63300e003c5a85c147a17d9845fa2558a02047c3cc1f07767af59014b2dd0fa75b503e5bc36e917f360e9b67bb6f1e79f4 - languageName: node - linkType: hard - "@babel/helper-replace-supers@npm:^7.24.1": version: 7.24.1 resolution: "@babel/helper-replace-supers@npm:7.24.1" @@ -802,16 +746,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.11.5, @babel/parser@npm:^7.13.16, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.4, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.23.5, @babel/parser@npm:^7.23.6, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.4.5, @babel/parser@npm:^7.6.0, @babel/parser@npm:^7.9.6": - version: 7.24.0 - resolution: "@babel/parser@npm:7.24.0" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/77593d0b9de9906823c4d653bb6cda1c7593837598516330f655f70cba6224a37def7dbe5b4dad0038482d407d8d209eb8be5f48ca9a13357d769f829c5adb8e - languageName: node - linkType: hard - -"@babel/parser@npm:^7.24.1, @babel/parser@npm:^7.24.4": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.11.5, @babel/parser@npm:^7.13.16, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.4, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.23.5, @babel/parser@npm:^7.23.6, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.24.4, @babel/parser@npm:^7.4.5, @babel/parser@npm:^7.6.0, @babel/parser@npm:^7.9.6": version: 7.24.4 resolution: "@babel/parser@npm:7.24.4" bin: @@ -1283,18 +1218,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.23.4, @babel/plugin-transform-block-scoping@npm:^7.8.3": - version: 7.23.4 - resolution: "@babel/plugin-transform-block-scoping@npm:7.23.4" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.22.5" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 10c0/83006804dddf980ab1bcd6d67bc381e24b58c776507c34f990468f820d0da71dba3697355ca4856532fa2eeb2a1e3e73c780f03760b5507a511cbedb0308e276 - languageName: node - linkType: hard - -"@babel/plugin-transform-block-scoping@npm:^7.24.4": +"@babel/plugin-transform-block-scoping@npm:^7.23.4, @babel/plugin-transform-block-scoping@npm:^7.24.4, @babel/plugin-transform-block-scoping@npm:^7.8.3": version: 7.24.4 resolution: "@babel/plugin-transform-block-scoping@npm:7.24.4" dependencies: @@ -6078,6 +6002,7 @@ __metadata: telejson: "npm:^7.2.0" tiny-invariant: "npm:^1.3.1" ts-dedent: "npm:^2.0.0" + tsconfig-paths: "npm:^4.2.0" typescript: "npm:^5.3.2" util: "npm:^0.12.4" util-deprecate: "npm:^1.0.2" @@ -7140,11 +7065,11 @@ __metadata: "@storybook/core-events": "workspace:*" "@storybook/instrumenter": "workspace:*" "@storybook/preview-api": "workspace:*" - "@testing-library/dom": "npm:^9.3.4" - "@testing-library/jest-dom": "npm:^6.4.2" - "@testing-library/user-event": "npm:^14.5.2" - "@vitest/expect": "npm:1.3.1" - "@vitest/spy": "npm:^1.3.1" + "@testing-library/dom": "npm:10.1.0" + "@testing-library/jest-dom": "npm:6.4.5" + "@testing-library/user-event": "npm:14.5.2" + "@vitest/expect": "npm:1.6.0" + "@vitest/spy": "npm:1.6.0" chai: "npm:^4.4.1" tinyspy: "npm:^2.2.0" ts-dedent: "npm:^2.2.0" @@ -7401,6 +7326,22 @@ __metadata: languageName: node linkType: hard +"@testing-library/dom@npm:10.1.0": + version: 10.1.0 + resolution: "@testing-library/dom@npm:10.1.0" + dependencies: + "@babel/code-frame": "npm:^7.10.4" + "@babel/runtime": "npm:^7.12.5" + "@types/aria-query": "npm:^5.0.1" + aria-query: "npm:5.3.0" + chalk: "npm:^4.1.0" + dom-accessibility-api: "npm:^0.5.9" + lz-string: "npm:^1.5.0" + pretty-format: "npm:^27.0.2" + checksum: 10c0/81f0e0a510d24e458c3af17777960ed678fb4fe464903ef8ec9ed816c9794fc69a673ea94f87b9e054b181383c51814605451dbf4fd9df93d0d8f24b4859990d + 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" @@ -7417,7 +7358,7 @@ __metadata: languageName: node linkType: hard -"@testing-library/dom@npm:^9.0.0, @testing-library/dom@npm:^9.3.1, @testing-library/dom@npm:^9.3.3, @testing-library/dom@npm:^9.3.4": +"@testing-library/dom@npm:^9.0.0, @testing-library/dom@npm:^9.3.1, @testing-library/dom@npm:^9.3.3": version: 9.3.4 resolution: "@testing-library/dom@npm:9.3.4" dependencies: @@ -7463,9 +7404,9 @@ __metadata: languageName: node linkType: hard -"@testing-library/jest-dom@npm:^6.4.1, @testing-library/jest-dom@npm:^6.4.2": - version: 6.4.2 - resolution: "@testing-library/jest-dom@npm:6.4.2" +"@testing-library/jest-dom@npm:6.4.5, @testing-library/jest-dom@npm:^6.4.1": + version: 6.4.5 + resolution: "@testing-library/jest-dom@npm:6.4.5" dependencies: "@adobe/css-tools": "npm:^4.3.2" "@babel/runtime": "npm:^7.9.2" @@ -7473,7 +7414,7 @@ __metadata: chalk: "npm:^3.0.0" css.escape: "npm:^1.5.1" dom-accessibility-api: "npm:^0.6.3" - lodash: "npm:^4.17.15" + lodash: "npm:^4.17.21" redent: "npm:^3.0.0" peerDependencies: "@jest/globals": ">= 28" @@ -7492,7 +7433,7 @@ __metadata: optional: true vitest: optional: true - checksum: 10c0/e7eba527b34ce30cde94424d2ec685bdfed51daaafb7df9b68b51aec6052e99a50c8bfe654612dacdf857a1eb81d68cf294fc89de558ee3a992bf7a6019fffcc + checksum: 10c0/4cfdd44e2abab2b9d399c47cbfe686729bb65160d7df0f9e2329aaaea7702f6e852a9eefb29b468f00c1e5a5274b684f8cac76959d33299dfa909ba007ea191d languageName: node linkType: hard @@ -7545,7 +7486,7 @@ __metadata: languageName: node linkType: hard -"@testing-library/user-event@npm:^14.4.3, @testing-library/user-event@npm:^14.5.2": +"@testing-library/user-event@npm:14.5.2, @testing-library/user-event@npm:^14.4.3": version: 14.5.2 resolution: "@testing-library/user-event@npm:14.5.2" peerDependencies: @@ -8935,25 +8876,25 @@ __metadata: languageName: node linkType: hard -"@vitest/expect@npm:1.3.1": - version: 1.3.1 - resolution: "@vitest/expect@npm:1.3.1" +"@vitest/expect@npm:1.6.0": + version: 1.6.0 + resolution: "@vitest/expect@npm:1.6.0" dependencies: - "@vitest/spy": "npm:1.3.1" - "@vitest/utils": "npm:1.3.1" + "@vitest/spy": "npm:1.6.0" + "@vitest/utils": "npm:1.6.0" chai: "npm:^4.3.10" - checksum: 10c0/ea66a1e912d896a481a27631b68089b885af7e8ed62ba8aaa119c37a9beafe6c094fd672775a20e6e23460af66e294f9ca259e6e0562708d1b7724eaaf53c7bb + checksum: 10c0/a4351f912a70543e04960f5694f1f1ac95f71a856a46e87bba27d3eb72a08c5d11d35021cbdc6077452a152e7d93723fc804bba76c2cc53c8896b7789caadae3 languageName: node linkType: hard -"@vitest/expect@patch:@vitest/expect@npm%3A1.3.1#~/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch": - version: 1.3.1 - resolution: "@vitest/expect@patch:@vitest/expect@npm%3A1.3.1#~/.yarn/patches/@vitest-expect-npm-1.3.1-973071a540.patch::version=1.3.1&hash=9dbd39" +"@vitest/expect@patch:@vitest/expect@npm%3A1.6.0#~/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch": + version: 1.6.0 + resolution: "@vitest/expect@patch:@vitest/expect@npm%3A1.6.0#~/.yarn/patches/@vitest-expect-npm-1.6.0-0e382f8212.patch::version=1.6.0&hash=7cb178" dependencies: - "@vitest/spy": "npm:1.3.1" - "@vitest/utils": "npm:1.3.1" + "@vitest/spy": "npm:1.6.0" + "@vitest/utils": "npm:1.6.0" chai: "npm:^4.3.10" - checksum: 10c0/f54446b97ffac9d64653ed771b883e4d733dc4f3bb6d4b161a583a8c5ef0461383f3d457174af71baf5b2d3c92e1b75495f0c1d0cca75644ad4a6f0df8f4ec55 + checksum: 10c0/073cfd09bfe6934408d0041be5a7251c2f80563a655f9387b8cd16a802752b47f1084de921ad6b5c45a48b5447773c52358c1cf68bb7e3b665b44c8cba19d8d3 languageName: node linkType: hard @@ -8988,12 +8929,12 @@ __metadata: languageName: node linkType: hard -"@vitest/spy@npm:1.3.1, @vitest/spy@npm:^1.3.1": - version: 1.3.1 - resolution: "@vitest/spy@npm:1.3.1" +"@vitest/spy@npm:1.6.0": + version: 1.6.0 + resolution: "@vitest/spy@npm:1.6.0" dependencies: tinyspy: "npm:^2.2.0" - checksum: 10c0/efc42f679d2a51fc6583ca3136ccd47581cb27c923ed3cb0500f5dee9aac99b681bfdd400c16ef108f2e0761daa642bc190816a6411931a2aba99ebf8b213dd4 + checksum: 10c0/df66ea6632b44fb76ef6a65c1abbace13d883703aff37cd6d062add6dcd1b883f19ce733af8e0f7feb185b61600c6eb4042a518e4fb66323d0690ec357f9401c languageName: node linkType: hard @@ -9009,15 +8950,15 @@ __metadata: languageName: node linkType: hard -"@vitest/utils@npm:1.3.1, @vitest/utils@npm:^1.3.1": - version: 1.3.1 - resolution: "@vitest/utils@npm:1.3.1" +"@vitest/utils@npm:1.6.0, @vitest/utils@npm:^1.3.1": + version: 1.6.0 + resolution: "@vitest/utils@npm:1.6.0" dependencies: diff-sequences: "npm:^29.6.3" estree-walker: "npm:^3.0.3" loupe: "npm:^2.3.7" pretty-format: "npm:^29.7.0" - checksum: 10c0/d604c8ad3b1aee30d4dcd889098f591407bfe18547ff96485b1d1ed54eff58219c756a9544a7fbd4e37886863abacd7a89a76334cb3ea7f84c3d496bb757db23 + checksum: 10c0/8b0d19835866455eb0b02b31c5ca3d8ad45f41a24e4c7e1f064b480f6b2804dc895a70af332f14c11ed89581011b92b179718523f55f5b14787285a0321b1301 languageName: node linkType: hard @@ -10075,6 +10016,15 @@ __metadata: languageName: node linkType: hard +"aria-query@npm:5.3.0, aria-query@npm:^5.0.0, aria-query@npm:^5.3.0": + version: 5.3.0 + resolution: "aria-query@npm:5.3.0" + dependencies: + dequal: "npm:^2.0.3" + checksum: 10c0/2bff0d4eba5852a9dd578ecf47eaef0e82cc52569b48469b0aac2db5145db0b17b7a58d9e01237706d1e14b7a1b0ac9b78e9c97027ad97679dd8f91b85da1469 + languageName: node + linkType: hard + "aria-query@npm:^4.2.2": version: 4.2.2 resolution: "aria-query@npm:4.2.2" @@ -10085,15 +10035,6 @@ __metadata: languageName: node linkType: hard -"aria-query@npm:^5.3.0": - version: 5.3.0 - resolution: "aria-query@npm:5.3.0" - dependencies: - dequal: "npm:^2.0.3" - checksum: 10c0/2bff0d4eba5852a9dd578ecf47eaef0e82cc52569b48469b0aac2db5145db0b17b7a58d9e01237706d1e14b7a1b0ac9b78e9c97027ad97679dd8f91b85da1469 - languageName: node - linkType: hard - "arr-diff@npm:^4.0.0": version: 4.0.0 resolution: "arr-diff@npm:4.0.0" @@ -10636,7 +10577,7 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs2@npm:^0.4.10": +"babel-plugin-polyfill-corejs2@npm:^0.4.10, babel-plugin-polyfill-corejs2@npm:^0.4.8": version: 0.4.11 resolution: "babel-plugin-polyfill-corejs2@npm:0.4.11" dependencies: @@ -10649,19 +10590,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs2@npm:^0.4.8": - version: 0.4.9 - resolution: "babel-plugin-polyfill-corejs2@npm:0.4.9" - dependencies: - "@babel/compat-data": "npm:^7.22.6" - "@babel/helper-define-polyfill-provider": "npm:^0.6.0" - semver: "npm:^6.3.1" - peerDependencies: - "@babel/core": ^7.4.0 || ^8.0.0-0 <8.0.0 - checksum: 10c0/2cd47af763eb40aa41f1d6d9cbf1bdd217ff6c28f614b057c0328ee42a4d82cbcdcbc7d081d93e2a2d80446c899f25c3ebec048a63d260ef65a0a364134f71cd - languageName: node - linkType: hard - "babel-plugin-polyfill-corejs3@npm:^0.10.1, babel-plugin-polyfill-corejs3@npm:^0.10.4": version: 0.10.4 resolution: "babel-plugin-polyfill-corejs3@npm:0.10.4" @@ -10901,26 +10829,6 @@ __metadata: languageName: node linkType: hard -"body-parser@npm:1.20.1": - version: 1.20.1 - resolution: "body-parser@npm:1.20.1" - dependencies: - bytes: "npm:3.1.2" - content-type: "npm:~1.0.4" - debug: "npm:2.6.9" - depd: "npm:2.0.0" - destroy: "npm:1.2.0" - http-errors: "npm:2.0.0" - iconv-lite: "npm:0.4.24" - on-finished: "npm:2.4.1" - qs: "npm:6.11.0" - raw-body: "npm:2.5.1" - type-is: "npm:~1.6.18" - unpipe: "npm:1.0.0" - checksum: 10c0/a202d493e2c10a33fb7413dac7d2f713be579c4b88343cd814b6df7a38e5af1901fc31044e04de176db56b16d9772aa25a7723f64478c20f4d91b1ac223bf3b8 - languageName: node - linkType: hard - "body-parser@npm:1.20.2": version: 1.20.2 resolution: "body-parser@npm:1.20.2" @@ -12482,13 +12390,6 @@ __metadata: languageName: node linkType: hard -"cookie@npm:0.5.0": - version: 0.5.0 - resolution: "cookie@npm:0.5.0" - checksum: 10c0/c01ca3ef8d7b8187bae434434582288681273b5a9ed27521d4d7f9f7928fe0c920df0decd9f9d3bbd2d14ac432b8c8cf42b98b3bdd5bfe0e6edddeebebe8b61d - languageName: node - linkType: hard - "cookie@npm:0.6.0": version: 0.6.0 resolution: "cookie@npm:0.6.0" @@ -15150,46 +15051,7 @@ __metadata: languageName: node linkType: hard -"express@npm:^4.17.3": - version: 4.18.2 - resolution: "express@npm:4.18.2" - dependencies: - accepts: "npm:~1.3.8" - array-flatten: "npm:1.1.1" - body-parser: "npm:1.20.1" - content-disposition: "npm:0.5.4" - content-type: "npm:~1.0.4" - cookie: "npm:0.5.0" - cookie-signature: "npm:1.0.6" - debug: "npm:2.6.9" - depd: "npm:2.0.0" - encodeurl: "npm:~1.0.2" - escape-html: "npm:~1.0.3" - etag: "npm:~1.8.1" - finalhandler: "npm:1.2.0" - fresh: "npm:0.5.2" - http-errors: "npm:2.0.0" - merge-descriptors: "npm:1.0.1" - methods: "npm:~1.1.2" - on-finished: "npm:2.4.1" - parseurl: "npm:~1.3.3" - path-to-regexp: "npm:0.1.7" - proxy-addr: "npm:~2.0.7" - qs: "npm:6.11.0" - range-parser: "npm:~1.2.1" - safe-buffer: "npm:5.2.1" - send: "npm:0.18.0" - serve-static: "npm:1.15.0" - setprototypeof: "npm:1.2.0" - statuses: "npm:2.0.1" - type-is: "npm:~1.6.18" - utils-merge: "npm:1.0.1" - vary: "npm:~1.1.2" - checksum: 10c0/75af556306b9241bc1d7bdd40c9744b516c38ce50ae3210658efcbf96e3aed4ab83b3432f06215eae5610c123bc4136957dc06e50dfc50b7d4d775af56c4c59c - languageName: node - linkType: hard - -"express@npm:^4.19.2": +"express@npm:^4.17.3, express@npm:^4.19.2": version: 4.19.2 resolution: "express@npm:4.19.2" dependencies: @@ -24000,18 +23862,6 @@ __metadata: languageName: node linkType: hard -"raw-body@npm:2.5.1": - version: 2.5.1 - resolution: "raw-body@npm:2.5.1" - dependencies: - bytes: "npm:3.1.2" - http-errors: "npm:2.0.0" - iconv-lite: "npm:0.4.24" - unpipe: "npm:1.0.0" - checksum: 10c0/5dad5a3a64a023b894ad7ab4e5c7c1ce34d3497fc7138d02f8c88a3781e68d8a55aa7d4fd3a458616fa8647cc228be314a1c03fb430a07521de78b32c4dd09d2 - languageName: node - linkType: hard - "raw-body@npm:2.5.2": version: 2.5.2 resolution: "raw-body@npm:2.5.2" @@ -28049,23 +27899,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.0.3, typescript@npm:^5.3.2, typescript@npm:~5.3.2": - version: 5.3.3 - resolution: "typescript@npm:5.3.3" +"typescript@npm:^5.0.3, typescript@npm:^5.3.2, typescript@npm:^5.4.3": + version: 5.4.3 + resolution: "typescript@npm:5.4.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/e33cef99d82573624fc0f854a2980322714986bc35b9cb4d1ce736ed182aeab78e2cb32b385efa493b2a976ef52c53e20d6c6918312353a91850e2b76f1ea44f + checksum: 10c0/22443a8760c3668e256c0b34b6b45c359ef6cecc10c42558806177a7d500ab1a7d7aac1f976d712e26989ddf6731d2fbdd3212b7c73290a45127c1c43ba2005a languageName: node linkType: hard -"typescript@npm:^5.4.3": - version: 5.4.3 - resolution: "typescript@npm:5.4.3" +"typescript@npm:~5.3.2": + version: 5.3.3 + resolution: "typescript@npm:5.3.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/22443a8760c3668e256c0b34b6b45c359ef6cecc10c42558806177a7d500ab1a7d7aac1f976d712e26989ddf6731d2fbdd3212b7c73290a45127c1c43ba2005a + checksum: 10c0/e33cef99d82573624fc0f854a2980322714986bc35b9cb4d1ce736ed182aeab78e2cb32b385efa493b2a976ef52c53e20d6c6918312353a91850e2b76f1ea44f languageName: node linkType: hard @@ -28079,23 +27929,23 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.0.3#optional!builtin, typescript@patch:typescript@npm%3A^5.3.2#optional!builtin, typescript@patch:typescript@npm%3A~5.3.2#optional!builtin": - version: 5.3.3 - resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7" +"typescript@patch:typescript@npm%3A^5.0.3#optional!builtin, typescript@patch:typescript@npm%3A^5.3.2#optional!builtin, typescript@patch:typescript@npm%3A^5.4.3#optional!builtin": + version: 5.4.3 + resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin::version=5.4.3&hash=5adc0c" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/1d0a5f4ce496c42caa9a30e659c467c5686eae15d54b027ee7866744952547f1be1262f2d40de911618c242b510029d51d43ff605dba8fb740ec85ca2d3f9500 + checksum: 10c0/6e51f8b7e6ec55b897b9e56b67e864fe8f44e30f4a14357aad5dc0f7432db2f01efc0522df0b6c36d361c51f2dc3dcac5c832efd96a404cfabf884e915d38828 languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.4.3#optional!builtin": - version: 5.4.3 - resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin::version=5.4.3&hash=5adc0c" +"typescript@patch:typescript@npm%3A~5.3.2#optional!builtin": + version: 5.3.3 + resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/6e51f8b7e6ec55b897b9e56b67e864fe8f44e30f4a14357aad5dc0f7432db2f01efc0522df0b6c36d361c51f2dc3dcac5c832efd96a404cfabf884e915d38828 + checksum: 10c0/1d0a5f4ce496c42caa9a30e659c467c5686eae15d54b027ee7866744952547f1be1262f2d40de911618c242b510029d51d43ff605dba8fb740ec85ca2d3f9500 languageName: node linkType: hard diff --git a/docs/api/main-config-indexers.md b/docs/api/main-config-indexers.md index 79e7fa2f2651..a2b17648ed40 100644 --- a/docs/api/main-config-indexers.md +++ b/docs/api/main-config-indexers.md @@ -97,6 +97,7 @@ Type: exportName: string; importPath: string; type: 'story'; + rawComponentPath?: string; metaId?: string; name?: string; tags?: string[]; @@ -133,6 +134,12 @@ Type: `'story'` The type of entry. +##### `rawComponentPath` + +Type: `string` + +The raw path/package of the file that provides `meta.component`, if one exists. + ##### `metaId` Type: `string` diff --git a/docs/configure/telemetry.md b/docs/configure/telemetry.md index 291fa53e18d3..bd86f613ff0a 100644 --- a/docs/configure/telemetry.md +++ b/docs/configure/telemetry.md @@ -71,7 +71,6 @@ Will generate the following output: "pageStoryCount": 0, "playStoryCount": 0, "autodocsCount": 0, - "storiesMdxCount": 0, "mdxCount": 0, "exampleStoryCount": 8, "exampleDocsCount": 3, diff --git a/docs/configure/theming.md b/docs/configure/theming.md index 5ac07a9b5a61..f1e745646594 100644 --- a/docs/configure/theming.md +++ b/docs/configure/theming.md @@ -196,7 +196,7 @@ Here's how you might insert a custom `` block: Some addons require specific theme variables that a Storybook user must add. If you share your theme with the community, make sure to support the official API and other popular addons, so your users have a consistent experience. -For example, the popular Actions addon uses [react-inspector](https://github.com/xyc/react-inspector/blob/master/src/styles/themes/chromeLight.js), which has themes of its own. Supply additional theme variables to style it like so: +For example, the popular Actions addon uses [react-inspector](https://github.com/storybookjs/react-inspector/blob/master/src/styles/themes/chromeLight.tsx), which has themes of its own. Supply additional theme variables to style it like so: diff --git a/docs/versions/next.json b/docs/versions/next.json index 467a20f42b4c..26523a287829 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"8.2.0-alpha.5","info":{"plain":"- Angular: Fix wrong detection of standalone components - [#27353](https://github.com/storybookjs/storybook/pull/27353), thanks @dario-baumberger!\n- Dependency: Bump Express.js - [#26680](https://github.com/storybookjs/storybook/pull/26680), thanks @valentinpalkovic!\n- Tags: Fix unsafe project-level tags lookup - [#27511](https://github.com/storybookjs/storybook/pull/27511), thanks @shilman!"}} +{"version":"8.2.0-alpha.6","info":{"plain":"- Addon-actions: Only log spies with names - [#28091](https://github.com/storybookjs/storybook/pull/28091), thanks @kasperpeulen!\n- Build: Change require/import order, so that import has higher prio if both are specified - [#27730](https://github.com/storybookjs/storybook/pull/27730), thanks @kasperpeulen!\n- CLI: Only log the UpgradeStorybookToSameVersionError but continue the upgrade as normal - [#27217](https://github.com/storybookjs/storybook/pull/27217), thanks @kasperpeulen!\n- Core: Replace ip function with a small helper function to address security concerns - [#27529](https://github.com/storybookjs/storybook/pull/27529), thanks @tony19!\n- Portable Stories: Add tags to composed story - [#27708](https://github.com/storybookjs/storybook/pull/27708), thanks @yannbf!\n- Test: Upgrade deps of @storybook/test - [#27862](https://github.com/storybookjs/storybook/pull/27862), thanks @kasperpeulen!\n- Vite: Fix stats-plugin to normalize file names with posix paths - [#27218](https://github.com/storybookjs/storybook/pull/27218), thanks @AlexAtVista!"}} diff --git a/scripts/task.ts b/scripts/task.ts index 8604db9bf88d..fd0af6e360e6 100644 --- a/scripts/task.ts +++ b/scripts/task.ts @@ -158,6 +158,11 @@ export const options = createOptions({ inverse: true, promptType: false, }, + prod: { + type: 'boolean', + description: 'Build code for production', + promptType: false, + }, dryRun: { type: 'boolean', description: "Don't execute commands, just list them (dry run)?", diff --git a/scripts/tasks/compile.ts b/scripts/tasks/compile.ts index af220b9f27a4..0275a363e222 100644 --- a/scripts/tasks/compile.ts +++ b/scripts/tasks/compile.ts @@ -33,9 +33,9 @@ export const compile: Task = { return false; } }, - async run({ codeDir }, { link, dryRun, debug }) { + async run({ codeDir }, { link, dryRun, debug, prod }) { return exec( - link ? linkCommand : noLinkCommand, + link && !prod ? linkCommand : noLinkCommand, { cwd: codeDir }, { startMessage: '🥾 Bootstrapping', diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index ecc8f4241335..c9d5e50097dc 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -620,18 +620,24 @@ export async function setImportMap(cwd: string) { await writeJson(join(cwd, 'package.json'), packageJson, { spaces: 2 }); } -/** - * Sets compodoc option in angular.json projects to false. We have to generate compodoc - * manually to avoid symlink issues related to the template-stories folder. - * In a second step a docs:json script is placed into the package.json to generate the - * Compodoc documentation.json, which respects symlinks - * */ async function prepareAngularSandbox(cwd: string, templateName: string) { const angularJson = await readJson(join(cwd, 'angular.json')); Object.keys(angularJson.projects).forEach((projectName: string) => { + /** + * Sets compodoc option in angular.json projects to false. We have to generate compodoc + * manually to avoid symlink issues related to the template-stories folder. + * In a second step a docs:json script is placed into the package.json to generate the + * Compodoc documentation.json, which respects symlinks + */ angularJson.projects[projectName].architect.storybook.options.compodoc = false; angularJson.projects[projectName].architect['build-storybook'].options.compodoc = false; + /** + * Sets preserveSymlinks option in angular.json projects to true. This is necessary to + * respect symlinks so that Angular doesn't complain about wrong types in @storybook/* packages + */ + angularJson.projects[projectName].architect.storybook.options.preserveSymlinks = true; + angularJson.projects[projectName].architect['build-storybook'].options.preserveSymlinks = true; }); await writeJson(join(cwd, 'angular.json'), angularJson, { spaces: 2 }); diff --git a/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json b/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json index 072270485f6a..9f6c1133c07d 100644 --- a/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/nextjs/package.json @@ -26,7 +26,7 @@ "@storybook/nextjs": "^8.0.0", "@storybook/react": "^8.0.0", "@storybook/test": "^8.0.0", - "@testing-library/jest-dom": "^6.4.2", + "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^14.2.1", "@types/react": "^18.2.55", "@types/react-dom": "^18.2.19", diff --git a/test-storybooks/portable-stories-kitchen-sink/react/package.json b/test-storybooks/portable-stories-kitchen-sink/react/package.json index 591c4bbf2771..22536659e00c 100644 --- a/test-storybooks/portable-stories-kitchen-sink/react/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/react/package.json @@ -28,7 +28,7 @@ "@storybook/test": "^8.0.0", "@swc/core": "^1.4.2", "@swc/jest": "^0.2.36", - "@testing-library/jest-dom": "^6.4.2", + "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^14.2.1", "@types/identity-obj-proxy": "^3", "@types/react": "^18.2.55", diff --git a/test-storybooks/portable-stories-kitchen-sink/vue3/package.json b/test-storybooks/portable-stories-kitchen-sink/vue3/package.json index f576b4dd3ee8..537062cf9f74 100644 --- a/test-storybooks/portable-stories-kitchen-sink/vue3/package.json +++ b/test-storybooks/portable-stories-kitchen-sink/vue3/package.json @@ -24,7 +24,7 @@ "@storybook/test": "^8.0.0", "@storybook/vue3": "^8.0.0", "@storybook/vue3-vite": "^8.0.0", - "@testing-library/jest-dom": "^6.4.2", + "@testing-library/jest-dom": "^6.4.5", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", "@vitejs/plugin-vue": "^5.0.4",