Skip to content

Commit

Permalink
Misc docs updates
Browse files Browse the repository at this point in the history
- Update story pipeline images
- Add TypeScript config disclaimer
  • Loading branch information
kylegach committed May 14, 2024
1 parent 1ae28db commit 640a84f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Binary file modified docs/api/story-pipeline-playwright-ct.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/api/story-pipeline.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/writing-stories/mocking-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ import { getUserFromSession } from '#lib/session';
// ... rest of the file
```

<Callout variant="info">

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.

</Callout>

## 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.
Expand Down

0 comments on commit 640a84f

Please sign in to comment.