-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation: API reference for portable stories #26081
Documentation: API reference for portable stories #26081
Conversation
docs/api/portable-stories.md
Outdated
// Replace <your-renderer> with your renderer, e.g. react, vue3 | ||
import { setProjectAnnotations } from '@storybook/<your-renderer>'; | ||
import * as addonAnnotations from 'my-addon/preview'; | ||
import * as previewAnnotations from './.storybook/preview'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda sucks, but if users have a preview file with default export, then you'd have to do import previewAnnotations
instead of import * as previewAnnotations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually let me try to do the following:
- support always using
* as
by adding a.default
check inside of setProjectAnnotations - support Typescript types inference as well
docs/snippets/vue/portable-stories-vitest-override-globals.ts.mdx
Outdated
Show resolved
Hide resolved
07d956a
to
8bdb60b
Compare
8bdb60b
to
ad564ea
Compare
Co-authored-by: Yann Braga <yannbf@gmail.com>
- Organizational and prose improvements - Remove Cypress, for now
- Improve `addonAnnotations` callout - Fix Playwright override globals snippet - Fix jest imports in snippets - Replace `globalTypes` with `globals` in snippets
59bfc92
to
6738ade
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, we need few minor adjustments to the Vue API though.
Would it make sense to collapse the Jest and Vitest pages into one, to make it easier to maintain? It feels like they are very similar to each other with only minor differences, maybe even just the snippets are different? Just a suggestion, I don't have the full overview of the docs' information architecture.
6933131
into
feature/portable-stories-improvements
Closes #25928, #26090, #25879
What I did
This PR introduces API references for the concept of portable stories in Jest, Playwright, and Vitest
Checklist for Contributors
Testing
Manual testing
api-ref-portable-stories
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>