From ee58c4601651f3d6966b3e779484e01ff5b30857 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 28 Dec 2023 09:27:49 +0000 Subject: [PATCH 1/5] build(nx): Run build commands in parallel for workspace `build` script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e1d8309637c6..239ddb58ed84 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "scripts": { - "build": "node ./scripts/verify-packages-versions.js && run-s build:transpile build:types build:bundle", + "build": "node ./scripts/verify-packages-versions.js && lerna run build:transpile,build:types,build:bundle", "build:bundle": "lerna run build:bundle", "build:dev": "lerna run build:types,build:transpile", "build:dev:filter": "lerna run build:dev --include-filtered-dependencies --include-filtered-dependents --scope", From 253343c4874792b0cb665498cb73b7b66a8e628c Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 28 Dec 2023 12:36:42 +0000 Subject: [PATCH 2/5] Weird flakes? --- nx.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nx.json b/nx.json index da4ed2456a75..5060a4f1fa92 100644 --- a/nx.json +++ b/nx.json @@ -21,7 +21,7 @@ }, "build:tarball": { "inputs": ["production", "^production"], - "dependsOn": ["build:transpile", "build:types"], + "dependsOn": ["build:transpile", "^build:transpile", "build:types", "^build:types"], "outputs": [] }, "build:transpile": { @@ -33,10 +33,7 @@ "inputs": ["production", "^production"], "dependsOn": ["^build:types"], "outputs": [ - "{projectRoot}/build/types", - "{projectRoot}/build/types-ts3.8", - "{projectRoot}/build/npm/types", - "{projectRoot}/build/npm/types-ts3.8" + "{projectRoot}/build/**/*.d.ts" ] }, "lint:eslint": { From 963f40da008333362fe83bcc2b588ea829517db4 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 28 Dec 2023 13:26:30 +0000 Subject: [PATCH 3/5] Cache tarballs --- nx.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx.json b/nx.json index 5060a4f1fa92..0aaf82e6b588 100644 --- a/nx.json +++ b/nx.json @@ -3,7 +3,7 @@ "default": { "runner": "nx/tasks-runners/default", "options": { - "cacheableOperations": ["build:bundle", "build:transpile", "build:types", "lint:eslint", "test:unit"], + "cacheableOperations": ["build:bundle", "build:transpile", "build:types", "lint:eslint", "test:unit", "build:tarball"], "cacheDirectory": ".nxcache" } } @@ -11,7 +11,7 @@ "namedInputs": { "default": ["{projectRoot}/**/*", "sharedGlobals"], "sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json"], - "production": ["default", "!{projectRoot}/test/**/*", "!{projectRoot}/**/*.md"] + "production": ["default", "!{projectRoot}/test/**/*", "!{projectRoot}/**/*.md", "!{projectRoot}/*.tgz"] }, "targetDefaults": { "build:bundle": { @@ -22,7 +22,7 @@ "build:tarball": { "inputs": ["production", "^production"], "dependsOn": ["build:transpile", "^build:transpile", "build:types", "^build:types"], - "outputs": [] + "outputs": ["{projectRoot}/*.tgz"] }, "build:transpile": { "inputs": ["production", "^production"], From 7af92a4c81a55a4834d1ba3bdb2745157b0eb6f8 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 28 Dec 2023 13:42:02 +0000 Subject: [PATCH 4/5] lint --- nx.json | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/nx.json b/nx.json index 0aaf82e6b588..8a47c22e3c15 100644 --- a/nx.json +++ b/nx.json @@ -3,7 +3,14 @@ "default": { "runner": "nx/tasks-runners/default", "options": { - "cacheableOperations": ["build:bundle", "build:transpile", "build:types", "lint:eslint", "test:unit", "build:tarball"], + "cacheableOperations": [ + "build:bundle", + "build:transpile", + "build:types", + "lint:eslint", + "test:unit", + "build:tarball" + ], "cacheDirectory": ".nxcache" } } @@ -11,7 +18,12 @@ "namedInputs": { "default": ["{projectRoot}/**/*", "sharedGlobals"], "sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json"], - "production": ["default", "!{projectRoot}/test/**/*", "!{projectRoot}/**/*.md", "!{projectRoot}/*.tgz"] + "production": [ + "default", + "!{projectRoot}/test/**/*", + "!{projectRoot}/**/*.md", + "!{projectRoot}/*.tgz" + ] }, "targetDefaults": { "build:bundle": { @@ -21,27 +33,39 @@ }, "build:tarball": { "inputs": ["production", "^production"], - "dependsOn": ["build:transpile", "^build:transpile", "build:types", "^build:types"], + "dependsOn": [ + "build:transpile", + "^build:transpile", + "build:types", + "^build:types" + ], "outputs": ["{projectRoot}/*.tgz"] }, "build:transpile": { "inputs": ["production", "^production"], "dependsOn": ["^build:transpile"], - "outputs": ["{projectRoot}/build/npm", "{projectRoot}/build/esm", "{projectRoot}/build/cjs"] + "outputs": [ + "{projectRoot}/build/npm", + "{projectRoot}/build/esm", + "{projectRoot}/build/cjs" + ] }, "build:types": { "inputs": ["production", "^production"], "dependsOn": ["^build:types"], - "outputs": [ - "{projectRoot}/build/**/*.d.ts" - ] + "outputs": ["{projectRoot}/build/**/*.d.ts"] }, "lint:eslint": { "inputs": ["default"], "outputs": [] }, "test:unit": { - "dependsOn": ["build:types", "^build:types", "build:transpile", "^build:transpile"], + "dependsOn": [ + "build:types", + "^build:types", + "build:transpile", + "^build:transpile" + ], "inputs": ["default"], "outputs": ["{projectRoot}/coverage"] } From 487882ce71f9f1c887a87fe97a24526d36b7ba98 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 28 Dec 2023 14:01:37 +0000 Subject: [PATCH 5/5] lint --- nx.json | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/nx.json b/nx.json index 8a47c22e3c15..871546e98a4e 100644 --- a/nx.json +++ b/nx.json @@ -18,12 +18,7 @@ "namedInputs": { "default": ["{projectRoot}/**/*", "sharedGlobals"], "sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json"], - "production": [ - "default", - "!{projectRoot}/test/**/*", - "!{projectRoot}/**/*.md", - "!{projectRoot}/*.tgz" - ] + "production": ["default", "!{projectRoot}/test/**/*", "!{projectRoot}/**/*.md", "!{projectRoot}/*.tgz"] }, "targetDefaults": { "build:bundle": { @@ -33,22 +28,13 @@ }, "build:tarball": { "inputs": ["production", "^production"], - "dependsOn": [ - "build:transpile", - "^build:transpile", - "build:types", - "^build:types" - ], + "dependsOn": ["build:transpile", "^build:transpile", "build:types", "^build:types"], "outputs": ["{projectRoot}/*.tgz"] }, "build:transpile": { "inputs": ["production", "^production"], "dependsOn": ["^build:transpile"], - "outputs": [ - "{projectRoot}/build/npm", - "{projectRoot}/build/esm", - "{projectRoot}/build/cjs" - ] + "outputs": ["{projectRoot}/build/npm", "{projectRoot}/build/esm", "{projectRoot}/build/cjs"] }, "build:types": { "inputs": ["production", "^production"], @@ -60,12 +46,7 @@ "outputs": [] }, "test:unit": { - "dependsOn": [ - "build:types", - "^build:types", - "build:transpile", - "^build:transpile" - ], + "dependsOn": ["build:types", "^build:types", "build:transpile", "^build:transpile"], "inputs": ["default"], "outputs": ["{projectRoot}/coverage"] }