diff --git a/code/addons/docs/docs/docspage.md b/code/addons/docs/docs/docspage.md index 603652331eb6..ea50050f6b94 100644 --- a/code/addons/docs/docs/docspage.md +++ b/code/addons/docs/docs/docspage.md @@ -166,9 +166,9 @@ You can override this default behavior in `.storybook/preview.js` (or in any of export const parameters = { docs: { canvas: { - sourceState: 'shown' - } - } + sourceState: 'shown', + }, + }, }; ``` diff --git a/docs/api/portable-stories-playwright.md b/docs/api/portable-stories-playwright.md index ae7d012b8445..38dc1502f0a4 100644 --- a/docs/api/portable-stories-playwright.md +++ b/docs/api/portable-stories-playwright.md @@ -1,5 +1,5 @@ --- -title: 'Portable stories in Playwright' +title: 'Portable stories in Playwright CT' --- export const SUPPORTED_RENDERERS = ['react', 'vue']; @@ -34,6 +34,8 @@ Normally, Storybook composes a story and its [annotations](#annotations) automat +Your project must be using React 18+ to use the portable stories API with Playwright CT. + **Using `Next.js`?** The portable stories API is not yet supported in Next.js with Playwright CT. diff --git a/docs/api/story-pipeline-playwright-ct.png b/docs/api/story-pipeline-playwright-ct.png index 615af79387b9..e90239dce803 100644 Binary files a/docs/api/story-pipeline-playwright-ct.png and b/docs/api/story-pipeline-playwright-ct.png differ diff --git a/docs/api/story-pipeline.png b/docs/api/story-pipeline.png index 21d059741855..a77dc956b313 100644 Binary files a/docs/api/story-pipeline.png and b/docs/api/story-pipeline.png differ diff --git a/docs/writing-stories/mocking-modules.md b/docs/writing-stories/mocking-modules.md index 0f165546a381..d80c3bfe1241 100644 --- a/docs/writing-stories/mocking-modules.md +++ b/docs/writing-stories/mocking-modules.md @@ -95,6 +95,16 @@ import { getUserFromSession } from '#lib/session'; // ... rest of the file ``` + + +Subpath imports will only be correctly resolved and typed when the [`moduleResolution` property](https://www.typescriptlang.org/tsconfig/#moduleResolution) is set to `'Bundler'`, `'NodeNext'`, or `'Node16'` in your TypeScript configuration. + +If you are currently using `'node'`, that is intended for projects using a Node.js version older than v10. Projects written with modern code likely do not need to use `'node'`. + +Storybook recommends the [TSConfig Cheat Sheet](https://www.totaltypescript.com/tsconfig-cheat-sheet) for guidance on setting up your TypeScript configuration. + + + ## Builder aliases If your project is unable to use [subpath imports](#subpath-imports), you can configure your Storybook builder to alias the module to the mock file. This will instruct the builder to replace the module with the mock file when bundling your Storybook stories.