From a5ae8a0e890c7a204f7d0e03b924dee0c5784474 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Wed, 11 Dec 2024 13:51:11 +0100 Subject: [PATCH 1/2] Add --glob argument to rimraf on CLI rimraf now requires the --glob option https://github.com/isaacs/rimraf?tab=readme-ov-file#v3-to-v4 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index dbf69043c5829..ee79350a437e1 100644 --- a/package.json +++ b/package.json @@ -180,8 +180,8 @@ "build:packages": "npm run --silent build:package-types && node ./bin/packages/build.js", "postbuild:packages": " npm run --if-present --workspaces build:wp", "build:plugin-zip": "bash ./bin/build-plugin-zip.sh", - "clean:package-types": "tsc --build --clean && rimraf \"./packages/*/build-types\"", - "clean:packages": "rimraf \"./packages/*/@(build|build-module|build-wp|build-style)\"", + "clean:package-types": "tsc --build --clean && rimraf --glob \"./packages/*/build-types\"", + "clean:packages": "rimraf --glob \"./packages/*/@(build|build-module|build-wp|build-style)\"", "component-usage-stats": "node ./node_modules/react-scanner/bin/react-scanner -c ./react-scanner.config.js", "dev": "cross-env NODE_ENV=development npm run build:packages && concurrently \"wp-scripts start\" \"npm run dev:packages\"", "dev:packages": "cross-env NODE_ENV=development concurrently \"node ./bin/packages/watch.js\" \"tsc --build --watch\"", @@ -193,7 +193,7 @@ "docs:gen": "node ./docs/tool/index.js", "docs:theme-ref": "node ./bin/api-docs/gen-theme-reference.mjs", "env": "wp-env", - "fixtures:clean": "rimraf \"test/integration/fixtures/blocks/*.+(json|serialized.html)\"", + "fixtures:clean": "rimraf --glob \"test/integration/fixtures/blocks/*.+(json|serialized.html)\"", "fixtures:generate": "cross-env GENERATE_MISSING_FIXTURES=y npm run test:unit test/integration/full-content/ && npm run format test/integration/fixtures/blocks/*.json", "fixtures:regenerate": "npm-run-all fixtures:clean fixtures:generate", "format": "wp-scripts format", From fc6cfef823b372d300f2308cd613b4a1ab97395b Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Wed, 11 Dec 2024 13:54:28 +0100 Subject: [PATCH 2/2] Single-quote globs so shell does not expand It seems likely that shell expansion was handling these globs on some systems but not on windows. Use single quotes to avoid shell glob behavior and rely on rimraf --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ee79350a437e1..b4fd877c82690 100644 --- a/package.json +++ b/package.json @@ -180,8 +180,8 @@ "build:packages": "npm run --silent build:package-types && node ./bin/packages/build.js", "postbuild:packages": " npm run --if-present --workspaces build:wp", "build:plugin-zip": "bash ./bin/build-plugin-zip.sh", - "clean:package-types": "tsc --build --clean && rimraf --glob \"./packages/*/build-types\"", - "clean:packages": "rimraf --glob \"./packages/*/@(build|build-module|build-wp|build-style)\"", + "clean:package-types": "tsc --build --clean && rimraf --glob './packages/*/build-types'", + "clean:packages": "rimraf --glob './packages/*/@(build|build-module|build-wp|build-style)'", "component-usage-stats": "node ./node_modules/react-scanner/bin/react-scanner -c ./react-scanner.config.js", "dev": "cross-env NODE_ENV=development npm run build:packages && concurrently \"wp-scripts start\" \"npm run dev:packages\"", "dev:packages": "cross-env NODE_ENV=development concurrently \"node ./bin/packages/watch.js\" \"tsc --build --watch\"", @@ -193,7 +193,7 @@ "docs:gen": "node ./docs/tool/index.js", "docs:theme-ref": "node ./bin/api-docs/gen-theme-reference.mjs", "env": "wp-env", - "fixtures:clean": "rimraf --glob \"test/integration/fixtures/blocks/*.+(json|serialized.html)\"", + "fixtures:clean": "rimraf --glob 'test/integration/fixtures/blocks/*.+(json|serialized.html)'", "fixtures:generate": "cross-env GENERATE_MISSING_FIXTURES=y npm run test:unit test/integration/full-content/ && npm run format test/integration/fixtures/blocks/*.json", "fixtures:regenerate": "npm-run-all fixtures:clean fixtures:generate", "format": "wp-scripts format",