From 032a7be46956003b28d36c9ed1d66066c3608c20 Mon Sep 17 00:00:00 2001 From: Vladimir Reznichenko Date: Fri, 28 Jun 2024 11:54:05 +0200 Subject: [PATCH] Monorepo: minor tooling tweaks (zip compression level, composer invocations) (#48857) * Tooling: composer related tweaks * Tooling: composer related tweaks * Tooling: composer related tweaks * Tooling: composer related tweaks * Tooling: composer related tweaks * Tooling: better zip compression and faster build times * Tooling: composer related tweaks * Tooling: composer related tweaks * Tooling: composer related tweaks * Tooling: pnpm related tweaks * Tooling: pnpm related tweaks * Tooling: composer related tweaks * Tooling: revert unnecessary change. * Tooling: revert unnecessary change. * Tooling: cleanup. * Tooling: cleanup. * Tooling: cleanup. * Tooling: added a changelog entries. * Tooling: cleanup. --- plugins/woo-ai/bin/build-zip.sh | 2 +- plugins/woo-ai/changelog/dev-tune-up-zip-generation | 4 ++++ plugins/woo-ai/package.json | 4 ++-- plugins/woocommerce-beta-tester/bin/build-zip.sh | 2 +- .../changelog/dev-tune-up-zip-generation | 4 ++++ plugins/woocommerce-beta-tester/package.json | 4 ++-- plugins/woocommerce/bin/build-zip.sh | 5 +++-- plugins/woocommerce/changelog/dev-tune-up-zip-generation | 4 ++++ plugins/woocommerce/package.json | 4 ++-- 9 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 plugins/woo-ai/changelog/dev-tune-up-zip-generation create mode 100644 plugins/woocommerce-beta-tester/changelog/dev-tune-up-zip-generation create mode 100644 plugins/woocommerce/changelog/dev-tune-up-zip-generation diff --git a/plugins/woo-ai/bin/build-zip.sh b/plugins/woo-ai/bin/build-zip.sh index b3c3a8334c9..58f3b85d114 100755 --- a/plugins/woo-ai/bin/build-zip.sh +++ b/plugins/woo-ai/bin/build-zip.sh @@ -19,7 +19,7 @@ rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PAT echo "Generating zip file..." cd "$BUILD_PATH" || exit -zip -q -r "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/" +zip -q -r -9 "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/" cd "$PROJECT_PATH" || exit mv "$BUILD_PATH/${PLUGIN_SLUG}.zip" "$PROJECT_PATH" diff --git a/plugins/woo-ai/changelog/dev-tune-up-zip-generation b/plugins/woo-ai/changelog/dev-tune-up-zip-generation new file mode 100644 index 00000000000..76c199f300f --- /dev/null +++ b/plugins/woo-ai/changelog/dev-tune-up-zip-generation @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Minor tooling tweaks (zip compression level, composer invocation) diff --git a/plugins/woo-ai/package.json b/plugins/woo-ai/package.json index 303bc2c0aac..c7f29f8585a 100644 --- a/plugins/woo-ai/package.json +++ b/plugins/woo-ai/package.json @@ -44,11 +44,11 @@ "build:project": "pnpm --if-present '/^build:project:.*$/'", "build:project:wp-scripts": "wireit", "build:zip": "./bin/build-zip.sh", - "changelog": "composer install && composer exec -- changelogger", + "changelog": "XDEBUG_MODE=off composer install --quiet && composer exec -- changelogger", "check-engines": "wp-scripts check-engines", "check-licenses": "wp-scripts check-licenses", "format:js": "wp-scripts format-js", - "postinstall": "composer install", + "postinstall": "XDEBUG_MODE=off composer install --quiet", "lint": "pnpm --if-present '/^lint:lang:.*$/'", "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", "lint:fix:lang:css": "wp-scripts lint-style --fix", diff --git a/plugins/woocommerce-beta-tester/bin/build-zip.sh b/plugins/woocommerce-beta-tester/bin/build-zip.sh index bfc53ef34bb..76656aced28 100755 --- a/plugins/woocommerce-beta-tester/bin/build-zip.sh +++ b/plugins/woocommerce-beta-tester/bin/build-zip.sh @@ -19,7 +19,7 @@ rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PAT echo "Generating zip file..." cd "$BUILD_PATH" || exit -zip -q -r "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/" +zip -q -r -9 "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/" cd "$PROJECT_PATH" || exit mv "$BUILD_PATH/${PLUGIN_SLUG}.zip" "$PROJECT_PATH" diff --git a/plugins/woocommerce-beta-tester/changelog/dev-tune-up-zip-generation b/plugins/woocommerce-beta-tester/changelog/dev-tune-up-zip-generation new file mode 100644 index 00000000000..76c199f300f --- /dev/null +++ b/plugins/woocommerce-beta-tester/changelog/dev-tune-up-zip-generation @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Minor tooling tweaks (zip compression level, composer invocation) diff --git a/plugins/woocommerce-beta-tester/package.json b/plugins/woocommerce-beta-tester/package.json index 7edebad7f4b..a33af188e41 100644 --- a/plugins/woocommerce-beta-tester/package.json +++ b/plugins/woocommerce-beta-tester/package.json @@ -67,11 +67,11 @@ "build:admin": "wp-scripts build", "build:dev": "pnpm lint:js && pnpm build", "build:zip": "./bin/build-zip.sh", - "changelog": "composer install && composer exec -- changelogger", + "changelog": "XDEBUG_MODE=off composer install --quiet && composer exec -- changelogger", "check-engines": "wp-scripts check-engines", "check-licenses": "wp-scripts check-licenses", "format:js": "wp-scripts format-js", - "postinstall": "composer install", + "postinstall": "XDEBUG_MODE=off composer install --quiet", "lint:css": "wp-scripts lint-style", "lint:css:fix": "wp-scripts lint-style --fix", "lint:js": "wp-scripts lint-js", diff --git a/plugins/woocommerce/bin/build-zip.sh b/plugins/woocommerce/bin/build-zip.sh index aff500a017e..1e3f2050f21 100755 --- a/plugins/woocommerce/bin/build-zip.sh +++ b/plugins/woocommerce/bin/build-zip.sh @@ -4,6 +4,7 @@ PLUGIN_SLUG="woocommerce" PROJECT_PATH=$(pwd) BUILD_PATH="${PROJECT_PATH}/build" DEST_PATH="$BUILD_PATH/$PLUGIN_SLUG" +XDEBUG_MODE=off echo "Generating build directory..." rm -rf "$BUILD_PATH" @@ -21,7 +22,7 @@ if [ -z "${NODE_ENV}" ]; then fi pnpm --filter='@woocommerce/plugin-woocommerce' build || exit "$?" echo "Cleaning up PHP dependencies..." -composer install --no-dev || exit "$?" +composer install --no-dev --quiet --optimize-autoloader || exit "$?" echo "Run makepot..." pnpm --filter=@woocommerce/plugin-woocommerce makepot || exit "$?" echo "Syncing files..." @@ -29,7 +30,7 @@ rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PAT echo "Generating zip file..." cd "$BUILD_PATH" || exit -zip -q -r "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/" +zip -q -r -9 "${PLUGIN_SLUG}.zip" "$PLUGIN_SLUG/" cd "$PROJECT_PATH" || exit mv "$BUILD_PATH/${PLUGIN_SLUG}.zip" "$PROJECT_PATH" diff --git a/plugins/woocommerce/changelog/dev-tune-up-zip-generation b/plugins/woocommerce/changelog/dev-tune-up-zip-generation new file mode 100644 index 00000000000..76c199f300f --- /dev/null +++ b/plugins/woocommerce/changelog/dev-tune-up-zip-generation @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Minor tooling tweaks (zip compression level, composer invocation) diff --git a/plugins/woocommerce/package.json b/plugins/woocommerce/package.json index 217107407e2..002ed8fdac4 100644 --- a/plugins/woocommerce/package.json +++ b/plugins/woocommerce/package.json @@ -14,7 +14,7 @@ "build:project": "pnpm --if-present '/^build:project:.*$/'", "build:project:copy-assets": "wireit", "build:zip": "./bin/build-zip.sh", - "changelog": "composer install && composer exec -- changelogger", + "changelog": "XDEBUG_MODE=off composer install --quiet && composer exec -- changelogger", "docker:down": "pnpm exec wc-e2e docker:down", "docker:ssh": "pnpm exec wc-e2e docker:ssh", "docker:up": "pnpm exec wc-e2e docker:up", @@ -33,7 +33,7 @@ "env:perf:install-k6": "curl https://github.com/grafana/k6/releases/download/v0.33.0/k6-v0.33.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1", "env:perf": "pnpm env:dev && pnpm env:performance-init && pnpm env:perf:install-k6", "preinstall": "npx only-allow pnpm", - "postinstall": "composer install", + "postinstall": "XDEBUG_MODE=off composer install --quiet", "lint": "pnpm --if-present '/^lint:lang:.*$/'", "lint:changes:branch": "pnpm '/^lint:changes:branch:.*$/'", "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",