Build: copyBlockAssets: Use cpSync for proper recursive copy#10805
Build: copyBlockAssets: Use cpSync for proper recursive copy#10805mcsf wants to merge 1 commit intoWordPress:trunkfrom
Conversation
Issue first described in WordPress/gutenberg#74805 (comment) Replace manual file iteration via `fs.cpSync` — which didn't support unexpected nested directories in block types' source dirs — with `fs.cpSync`.
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Do we want to support these random folders or only keep block types folders? AFAIK, this is the first time we do this right? |
youknowriad
left a comment
There was a problem hiding this comment.
I like the simplification of the code, regardless of whether we want to support additional random folders or not.
This is the choice I gave in WordPress/gutenberg#74805 (comment). My opinion is that it's not
Yes and no. It's definitely not the first time we've added a directory under a block type: $ find packages/block-library/src \
-mindepth 2 -maxdepth 2 \
-type d \
-not -path '*/test' \
-not -path '*/test/*'
packages/block-library/src/comments/edit
packages/block-library/src/navigation-link/link-ui
packages/block-library/src/navigation-link/shared
packages/block-library/src/file/utils
packages/block-library/src/navigation/utils
packages/block-library/src/navigation/edit
packages/block-library/src/template-part/edit
packages/block-library/src/social-link/icons
packages/block-library/src/list-item/hooks
packages/block-library/src/query/edit
packages/block-library/src/terms-query/edit
packages/block-library/src/cover/editBut it is the only one ending up in the build artefacts: $ find build/scripts/block-library \
-mindepth 2 -maxdepth 2 \
-type d
build/scripts/block-library/navigation-link/shared |
See https://core.trac.wordpress.org/ticket/64559
Issue first described in WordPress/gutenberg#74805 (comment)
Replace manual file iteration via
fs.cpSync— which didn't support unexpected nested directories in block types' source dirs — withfs.cpSync.