From 377b643720ba8a6ca68c677a7819c5ed447b7e02 Mon Sep 17 00:00:00 2001 From: Christopher Allford Date: Fri, 15 Apr 2022 14:42:56 -0700 Subject: [PATCH] Removed `prepare` Scripts Thanks to our build orchestration tooling, there is no reason for us to build all of the packages on `install`. In cases where `prepare` was used to build before packaging, this changes it to `prepack` so it will run only under the correct circumstances. --- nx.json | 9 +- packages/js/admin-e2e-tests/package.json | 1 - packages/js/admin-e2e-tests/project.json | 6 -- packages/js/api/package.json | 120 +++++++++++------------ packages/js/api/project.json | 6 -- packages/js/e2e-core-tests/package.json | 2 +- packages/js/e2e-core-tests/project.json | 6 -- packages/js/e2e-environment/package.json | 4 +- packages/js/e2e-environment/project.json | 6 -- packages/js/e2e-utils/package.json | 2 +- packages/js/e2e-utils/project.json | 6 -- 11 files changed, 65 insertions(+), 103 deletions(-) diff --git a/nx.json b/nx.json index fa1ac820d8b..f4cf052df4c 100644 --- a/nx.json +++ b/nx.json @@ -9,8 +9,7 @@ "build", "test", "lint", - "package", - "prepare" + "package" ] } } @@ -22,12 +21,6 @@ "projects": "dependencies" } ], - "prepare": [ - { - "target": "prepare", - "projects": "dependencies" - } - ], "package": [ { "target": "package", diff --git a/packages/js/admin-e2e-tests/package.json b/packages/js/admin-e2e-tests/package.json index 7ddb4a89f3a..aea3c4be449 100644 --- a/packages/js/admin-e2e-tests/package.json +++ b/packages/js/admin-e2e-tests/package.json @@ -50,7 +50,6 @@ "access": "public" }, "scripts": { - "prepare": "pnpm run build", "build": "tsc --build", "start": "tsc --build --watch", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", diff --git a/packages/js/admin-e2e-tests/project.json b/packages/js/admin-e2e-tests/project.json index be3b68c506c..6146d8472d2 100644 --- a/packages/js/admin-e2e-tests/project.json +++ b/packages/js/admin-e2e-tests/project.json @@ -33,12 +33,6 @@ "options": { "script": "clean" } - }, - "prepare": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "prepare" - } } } } diff --git a/packages/js/api/package.json b/packages/js/api/package.json index 9594310ca2f..24283608cdc 100644 --- a/packages/js/api/package.json +++ b/packages/js/api/package.json @@ -1,62 +1,62 @@ { - "name": "@woocommerce/api", - "version": "0.2.0", - "author": "Automattic", - "description": "A simple interface for interacting with a WooCommerce installation.", - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/api/README.md", - "repository": { - "type": "git", - "url": "https://github.com/woocommerce/woocommerce.git" - }, - "keywords": [ - "woocommerce", - "e2e" - ], - "license": "GPL-3.0+", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "files": [ - "/dist/", - "!*.ts.map", - "!*.tsbuildinfo", - "!/dist/**/__tests__/", - "!/dist/**/__mocks__/", - "!/dist/**/__snapshops__/", - "!/dist/**/__test_data__/" - ], - "sideEffects": false, - "scripts": { - "clean": "rm -rf ./dist ./tsconfig.tsbuildinfo", - "compile": "tsc -b", - "build": "pnpm run clean && npm run compile", - "prepare": "pnpm run build", - "lint": "eslint src", - "lint:fix": "eslint src --fix", - "test": "jest" - }, - "dependencies": { - "axios": "^0.24.0", - "create-hmac": "1.1.7", - "oauth-1.0a": "2.2.6" - }, - "devDependencies": { - "@types/create-hmac": "1.1.0", - "@types/jest": "^27.0.2", - "@types/node": "13.13.5", - "@typescript-eslint/eslint-plugin": "^5.3.1", - "@typescript-eslint/parser": "^5.3.1", - "axios-mock-adapter": "^1.20.0", - "eslint": "^8.2.0", - "jest": "^25", - "ts-jest": "^25", - "typescript": "^4.4.4" - }, - "publishConfig": { - "access": "public" - }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] - } + "name": "@woocommerce/api", + "version": "0.2.0", + "author": "Automattic", + "description": "A simple interface for interacting with a WooCommerce installation.", + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/api/README.md", + "repository": { + "type": "git", + "url": "https://github.com/woocommerce/woocommerce.git" + }, + "keywords": [ + "woocommerce", + "e2e" + ], + "license": "GPL-3.0+", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "/dist/", + "!*.ts.map", + "!*.tsbuildinfo", + "!/dist/**/__tests__/", + "!/dist/**/__mocks__/", + "!/dist/**/__snapshops__/", + "!/dist/**/__test_data__/" + ], + "sideEffects": false, + "scripts": { + "clean": "rm -rf ./dist ./tsconfig.tsbuildinfo", + "compile": "tsc -b", + "build": "pnpm run clean && npm run compile", + "prepack": "pnpm run build", + "lint": "eslint src", + "lint:fix": "eslint src --fix", + "test": "jest" + }, + "dependencies": { + "axios": "^0.24.0", + "create-hmac": "1.1.7", + "oauth-1.0a": "2.2.6" + }, + "devDependencies": { + "@types/create-hmac": "1.1.0", + "@types/jest": "^27.0.2", + "@types/node": "13.13.5", + "@typescript-eslint/eslint-plugin": "^5.3.1", + "@typescript-eslint/parser": "^5.3.1", + "axios-mock-adapter": "^1.20.0", + "eslint": "^8.2.0", + "jest": "^25", + "ts-jest": "^25", + "typescript": "^4.4.4" + }, + "publishConfig": { + "access": "public" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "eslint --fix" + ] + } } diff --git a/packages/js/api/project.json b/packages/js/api/project.json index e4022469b78..5458accc4b3 100644 --- a/packages/js/api/project.json +++ b/packages/js/api/project.json @@ -28,12 +28,6 @@ "script": "compile" } }, - "prepare": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "prepare" - } - }, "lint": { "executor": "@nrwl/workspace:run-script", "options": { diff --git a/packages/js/e2e-core-tests/package.json b/packages/js/e2e-core-tests/package.json index ee3708d3cae..fb37110be11 100644 --- a/packages/js/e2e-core-tests/package.json +++ b/packages/js/e2e-core-tests/package.json @@ -45,7 +45,7 @@ "access": "public" }, "scripts": { - "prepare": "pnpm run build", + "prepack": "pnpm run build", "clean": "rm -rf ./build ./build-module", "compile": "e2e-builds", "build": "./bin/build.sh && pnpm run clean && pnpm run compile" diff --git a/packages/js/e2e-core-tests/project.json b/packages/js/e2e-core-tests/project.json index ccff2f7a31e..e9eaf02e426 100644 --- a/packages/js/e2e-core-tests/project.json +++ b/packages/js/e2e-core-tests/project.json @@ -28,12 +28,6 @@ "script": "compile" } }, - "prepare": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "prepare" - } - }, "lint": { "executor": "@nrwl/workspace:run-script", "options": { diff --git a/packages/js/e2e-environment/package.json b/packages/js/e2e-environment/package.json index 1ecb668744b..287f7bc6403 100644 --- a/packages/js/e2e-environment/package.json +++ b/packages/js/e2e-environment/package.json @@ -65,9 +65,9 @@ "clean": "rm -rf ./build ./build-module", "compile": "e2e-builds", "build": "pnpm run clean && pnpm run compile", - "prepare": "pnpm run build", + "prepack": "pnpm run build", "docker:up": "./bin/docker-compose.sh up", - "docker:wait": "bash ./bin/wait-for-build.sh", + "docker:wait": "bash ./bin/wait-for-build.sh", "docker:down": "./bin/docker-compose.sh down", "docker:clear-all": "docker rmi --force $(docker images -q)", "docker:ssh": "docker exec -it $(node utils/get-app-name.js)_wordpress-www /bin/bash", diff --git a/packages/js/e2e-environment/project.json b/packages/js/e2e-environment/project.json index f7c92c4ef90..0c0ea3961a9 100644 --- a/packages/js/e2e-environment/project.json +++ b/packages/js/e2e-environment/project.json @@ -34,12 +34,6 @@ "script": "compile" } }, - "prepare": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "prepare" - } - }, "docker-up": { "executor": "@nrwl/workspace:run-script", "options": { diff --git a/packages/js/e2e-utils/package.json b/packages/js/e2e-utils/package.json index 2e0d9763070..6cbb4b678c0 100644 --- a/packages/js/e2e-utils/package.json +++ b/packages/js/e2e-utils/package.json @@ -44,7 +44,7 @@ "clean": "rm -rf ./build ./build-module", "compile": "e2e-builds", "build": "pnpm run clean && pnpm run compile", - "prepare": "pnpm run build", + "prepack": "pnpm run build", "lint": "eslint src" } } diff --git a/packages/js/e2e-utils/project.json b/packages/js/e2e-utils/project.json index cd77a6997cb..0b6e0a2bbce 100644 --- a/packages/js/e2e-utils/project.json +++ b/packages/js/e2e-utils/project.json @@ -28,12 +28,6 @@ "script": "compile" } }, - "prepare": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "prepare" - } - }, "lint": { "executor": "@nrwl/workspace:run-script", "options": {