Repository navigation
CLI: Remove deprecated componentSubtitle - #36129
Conversation
Package BenchmarksCommit: No significant changes detected, all good. 👏 |
|
@copilot rebase and resolve conflicts |
Merged |
|
CSF mutation adoption pushed at
|
a286c58 to
720a813
Compare
efd7548 to
4ca5e60
Compare
|
@copilot resolve the merge conflicts in this pull request |
Resolved the merge conflicts with |
|
[AUTOMATED MESSAGE] Component-subtitle migration: PASS for exact head Both repositories upgraded through Storybook 9 and 10 to PR-built Storybook 11 packages with
In both repositories, the installed runtime reported |
a0dcf12 to
6d85646
Compare
dec80a1 to
1a9799e
Compare
6d85646 to
6f879d1
Compare
…btitle The Subtitle block no longer reads parameters.componentSubtitle. The new component-subtitle automigration moves preview, meta, and story values to parameters.docs.subtitle when it can preserve inheritance, and reports the files it cannot migrate safely. loadAnnotationFile gives preview and story files the same object editor, and nested paths follow a sole spread of a single-use local object literal.
1a9799e to
96b69e0
Compare
The fix now describes its edits as hooks: the preview hook migrates the preview and records what it passes down, and the story hook migrates each story with that inheritance. The runner reads and writes the files. A file that cannot be migrated safely is skipped and listed in automigrations-summary.md instead of blocking the whole migration. Stories that depend on a preview that cannot be migrated or inspected are skipped too, rather than migrated against unknown inheritance. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Subtitle block read `docs.subtitle || componentSubtitle` from the preview and meta parameters only. The migration now does exactly that move: in the preview and every meta, it moves componentSubtitle to docs.subtitle, or drops it where docs.subtitle is already set. Files the editor cannot change safely are skipped and reported by the runner. This removes the cross-file inheritance checks, the story-level migration, the upgrade version gate and its isUpgrade/beforeVersion threading, and the csf-tools AnnotationFile and spread-following additions, along with an unrelated Yarn1Proxy change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The runner now parses, checks diagnostics, prints, and formats, so the fix is the move rule plus one hook for preview configs and story metas. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…into local/sto-111-merge
… script files The runner now passes only script files to editConfig and editCsf hooks, so the fix no longer needs its own filter.id for MDX docs. Update the test mocks for the runner's formatExistingFile and FileFailure.kind.
85997ed
into
refactor/automigrate-fix-files
Closes #
What I did
parameters.componentSubtitlehas been deprecated for a while, and the Subtitle block still fell back to it.Storybook 11 removes that fallback.
A new
component-subtitleautomigration moves the value toparameters.docs.subtitle, in the preview and in story metas.This is a real run on twentyhq/twenty's
twenty-uiStorybook (1main.ts, 1preview.tsx, 105 story files), withcomponentSubtitleadded to four metas, one of them built from a spread:const meta: Meta<typeof ButtonGroup> = { - parameters: { componentSubtitle: 'Injected subtitle' }, + parameters: { + docs: { + subtitle: 'Injected subtitle', + }, + }, title: 'UI/Input/Button/ButtonGroup',What changes for users:
parameters.componentSubtitleno longer renders a subtitle, and its deprecation warning is gone.docs.subtitlein the preview used to win over acomponentSubtitlein a meta. After the migration the meta value wins, like any other parameter.MIGRATION.mdasks users with a preview-leveldocs.subtitleto check their Docs pages.componentSubtitleon a single story stays where it is, since the block never read it there.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Caution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
yarn task sandbox --template react-vite/default-ts --start-from auto.parameters: { componentSubtitle: 'Legacy' }to the default export of.storybook/preview.tsand to the meta of one story file.parameters: { ...shared, componentSubtitle: 'Unsafe' }, wheresharedis imported from another module.npx storybook automigrate component-subtitle.Confirm that the preview and the first story file now use
parameters.docs.subtitle, that the second story file is unchanged, and that the command reports 1 file that could not be migrated and points toautomigrations-summary.md.automigrations-summary.mdin the project root and confirm it lists the second story file undercomponent-subtitle.parameters: { componentSubtitle: 'Fixed' }and run the command again.Confirm the second story file now uses
parameters.docs.subtitle,automigrations-summary.mdis gone, and the subtitles render on the Docs pages.Documentation
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-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake 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 publish.yml --field pr=<PR_NUMBER>🤖 Generated with Claude Code