Tags: Add project tags, negation, dev/autodocs/test system tags#26634
Merged
Tags: Add project tags, negation, dev/autodocs/test system tags#26634
dev/autodocs/test system tags#26634Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 2dee030. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
tmeasday
approved these changes
Mar 24, 2024
Member
tmeasday
left a comment
There was a problem hiding this comment.
Again, LGTM, but need to see the CSF PR
dev/docs/test system tags
dev/docs/test system tagsdev/autodocs/test system tags
dev/autodocs/test system tagsdev/autodocs/test system tags
dev/autodocs/test system tagsdev/autodocs/test system tags
8 tasks
4 tasks
JReinhold
reviewed
May 7, 2024
| const tags = [...(storyAnnotations?.tags || componentAnnotations.tags || []), 'story']; | ||
| const defaultTags = ['dev', 'test']; | ||
| if (typeof globalThis.DOCS_OPTIONS?.autodocs !== 'undefined') { | ||
| once.warn(dedent` |
Contributor
There was a problem hiding this comment.
shouldn't this be a server-side warning in the terminal instead, given that this is a main.js API getting deprecated?
| const { title } = entries[0]; | ||
| const metaTags = indexInputs[0].metaTags || []; | ||
| const id = toId(metaId ?? title, name); | ||
| const tags = combineTags(...projectTags, ...(indexInputs[0].tags ?? [])); |
Contributor
There was a problem hiding this comment.
I think this reverses the fix you did in #25537
With this change, the autodocs entry will again inherit all the tags from the primary story.
I'm not sure there's a clean workaround for it though.
23 tasks
This was referenced May 15, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21085
Closes #9209
Based on ComponentDriven/csf#80
What I did
Project tags
Added project tags:
This means that we don't need the
docs.autodocsconfiguration anymore.autodocstag topreview.js!autodocsto the story metaautodocsto preview.js and selectively addautodocsto the components you want autodocs for.Tag negation
Add the ability to remove tags that have been added higher up in the hierarchy using
!tagsyntax:Updated system tags
Added dev/docs/test system tags
Added new "system" tags
devandtestthat automatically get applied to every store (and can be removed with!devetc.!devremoves a story/component from the sidebar!autodocsremoves a story from autodocs!testremoves a story from test runsRemoved story/docs system tags
Storybook was automatically adding the tag
storyto stories anddocsto docs nodes (autodocs, mdx, etc.).I've removed these, since the use case wasn't clear and since
docsnow means something else per above ☝️Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
docs.autodocssettings inmain.jsa. That they still work as before
b. That they give a deprecation warning in the browser console and that it makes sense.
docs.autodocssetting and restarta. no
autodocstag is added to.storybook/preview.jsb.
autodocstag is added to a component (opt-in case)c.
autodocstag is added to.storybook/preview.jsd.
!autodocstag is added to a component (opt-out case)d.
!autodocstag is added to a story (opt-out case of a story in autodocs)devtag. Note that thedevtag is added globally by default.a. Disable
devtag globally by adding!devto.storybook/preview.ts(opt-in case)b. Add
devtag to a component and verify that it appears in the sidebarc. Add
!devtag to a story within that component and verify that it disappears from the sidebard. Enable
devglobally by removing!devfrom.storybook/preview.jse. Add
!devto a component and verify that it disappears from the sidebar (opt-out case)test-runnerwith--includeTags=testand verify that only those stories get testedDocumentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.tsMake 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/coreteam 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>