Storybook: Declare workspace dependencies for theme example story#78979
Conversation
Explicitly list @WordPress packages imported by the theme example application story and with-router decorator so the storybook workspace does not rely on hoisted phantom dependencies. Co-authored-by: Cursor <[email protected]>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 8.21 MB |
|
Flaky tests detected in 5069e3b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27012586795
|
What
Declare explicit
@wordpress/*workspace dependencies instorybook/package.jsonfor packages imported by the Theme Provider example application story and thewith-routerdecorator.Added to
devDependencies:@wordpress/admin-ui@wordpress/element@wordpress/icons@wordpress/private-apis@wordpress/route@wordpress/ui(
@wordpress/themewas already declared.)Why
Follow-up to #78814 which introduced imports from
@wordpress/admin-ui,@wordpress/route, and related packages in the storybook workspace, but only@wordpress/themewas listed instorybook/package.json.@manzoorwanijk noted in review that newly used dependencies should be declared explicitly. This aligns with workspace development guidance.
How
Add
file:../packages/<name>references tostorybook/package.json(same pattern as other root-level workspaces such asroutes/*andtest/*, adjusted for storybook’s directory depth) and updatepackage-lock.jsonvianpm install --workspace=@wordpress/storybook.Test plan
npm installcompletes without errorsnpm run --workspace @wordpress/storybook storybook:build