Repository navigation
Storybook: Type-check manifest post-processing scripts - #85769
Conversation
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: -36 B (0%) Total Size: 8.56 MB 📦 View Changed
|
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in these annotation and configuration changes; build and type-check commands were not run.
No open issues 🎉
What changed in this PR
Extends Storybook type-checking to both manifest post-processing scripts without changing runtime behavior.
Changes:
- Removes script exclusions while preserving an explicit empty
excludelist so stories remain type-checked. - Adds JSDoc types for manifest data and recursive component processing.
| File | Description |
|---|---|
storybook/tsconfig.json |
Includes both manifest scripts in type-checking. |
storybook/scripts/sanitize-components-manifest.mjs |
Types manifest nodes and recursive sanitization. |
storybook/scripts/inject-legacy-docgen.mjs |
Types manifest nodes and recursive legacy adaptation. |
Review effort: Balanced
aduth
left a comment
There was a problem hiding this comment.
Thanks 👍 It's on my radar to remove inject-legacy-docgen.mjs altogether since it was only meant to be temporary for a single package release months ago, so not strictly needed, but also not worth backing out either at this point 😄
|
Since it's an internal package, we could probably also author Maybe something I can put in an agent context somewhere so that agents apply it more consistently if we want to see that as the default for internal packages. |
Actually, this is probably better served by the new |
PR at #85774 |
Removing in #85778 |
b8d6040 to
b412c4a
Compare
73e548a to
47a4bb4
Compare
Follow-up to aduth's feedback on #82023.
What?
Include both Storybook manifest post-processing scripts in type-checking.
Why?
The sanitizer added in #82023 and the older legacy adapter were excluded, leaving their code unchecked.
How?
Clear the script exclusions and add JSDoc types for the manifest data and recursive component functions. Keep an explicit empty
excludelist so the shared configuration does not exclude Storybook stories. Runtime behavior is unchanged.Testing Instructions
npm run storybook:buildto build Gutenberg and run both manifest scripts.npm run typecheck -- storybook. Both scripts should pass without exclusions.npm run storybook:manifest-snapshot. The manifest snapshot and description allowlist should remain unchanged.Use of AI Tools
Codex assessed the feedback, added the type annotations, and ran verification.