Add Playground docs importer - #569
Merged
Merged
Conversation
akirk
marked this pull request as ready for review
July 15, 2026 10:34
The theme imports @wordpress/i18n directly but previously relied on it being absent from the installed dependency tree, while import/no-unresolved ignores @WordPress packages. Since PR #568, @wordpress/stylelint-config 23.42.0 changed its @wordpress/theme dependency from ^0.15.1 to ^0.17.0. That newer theme package installs @wordpress/i18n through @wordpress/compose and @wordpress/keycodes, causing import/no-extraneous-dependencies to detect the undeclared direct import. Declare the runtime dependency explicitly so lint does not depend on the transitive install layout.
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.
Summary
Adds a Playground handbook importer to the Developer theme and a focused Playground command for importing documentation.
playground:import-docsusesjqto derive a temporary ignored Blueprint from the normal Playground Blueprint. It appends a compact step that invokes the manifest and Markdown import actions for the documentation post type supplied throughIMPORT_POST_TYPE. The base Blueprint remains unchanged, and no temporary importer PHP files are written into the theme.The Playground importer reads its manifest from the
trunkbranch ofWordPress/wordpress-playgroundand handles inline Markdown inside Docusaurus callout markup.Usage
Import the Playground documentation with:
The command fails with a usage message when
IMPORT_POST_TYPEis missing.JavaScript lint dependency
The theme already imported
@wordpress/i18ndirectly but did not declare it. PR #568 still passed because its unlocked CI install resolved@wordpress/stylelint-config@23.40.1, whose dependency tree did not install@wordpress/i18n; the ignored unresolved WordPress import therefore did not reach the extraneous-dependency check.@wordpress/stylelint-config@23.42.0, published July 1, updated its@wordpress/themerange from^0.15.1to^0.17.0. The newer theme package installs i18n through@wordpress/composeand@wordpress/keycodes. Once i18n became resolvable,import/no-extraneous-dependenciescorrectly reported the undeclared direct import. This PR therefore declares@wordpress/i18nexplicitly in the theme workspace.Testing
Validated locally:
package.jsonand both the base and generated Blueprint JSON.jqappendsIMPORT_POST_TYPE=playgroundand the two-step documentation import.runPHPcode withphp -l.inc/import-playground.phpwithphp -l.IMPORT_POST_TYPEexits with the documented usage message.yarn workspace wporg-developer-2023 lint:jssuccessfully after declaring i18n.git diff --check.The earlier PHP commit hook was bypassed because the local PHPCompatibility sniff fails internally with
trim(): Passing null to parameter #1under the current PHP version. The hook also reports the existing file-header ordering issue infunctions.php.