From a76a8ade64cdfa32330e3a9d7bf94808206657ef Mon Sep 17 00:00:00 2001 From: Dom Talbot <3301714+domjtalbot@users.noreply.github.com> Date: Mon, 9 Jan 2023 20:17:41 +0000 Subject: [PATCH] fix(nx-mesh): dont cache `validate` executor output (#116) --- .changeset/many-dragons-reflect.md | 5 +++++ libs/example/sdk/graphql/star-wars-api/project.json | 6 ++++++ libs/nx-mesh/executors.json | 3 +-- .../nx-mesh/src/generators/base/lib/set-defaults.ts | 13 ------------- nx.json | 2 +- 5 files changed, 13 insertions(+), 16 deletions(-) create mode 100644 .changeset/many-dragons-reflect.md diff --git a/.changeset/many-dragons-reflect.md b/.changeset/many-dragons-reflect.md new file mode 100644 index 00000000..6d701636 --- /dev/null +++ b/.changeset/many-dragons-reflect.md @@ -0,0 +1,5 @@ +--- +'nx-mesh': patch +--- + +Don't cache validate executor diff --git a/libs/example/sdk/graphql/star-wars-api/project.json b/libs/example/sdk/graphql/star-wars-api/project.json index 3930fe35..98d26c26 100644 --- a/libs/example/sdk/graphql/star-wars-api/project.json +++ b/libs/example/sdk/graphql/star-wars-api/project.json @@ -43,6 +43,12 @@ "dev": true, "dir": "libs/example/sdk/graphql/star-wars-api" } + }, + "validate": { + "executor": "nx-mesh:validate", + "options": { + "dir": "libs/example/sdk/graphql/star-wars-api" + } } }, "tags": ["type:example", "type:sdk"] diff --git a/libs/nx-mesh/executors.json b/libs/nx-mesh/executors.json index 3b84c6c2..70050e11 100644 --- a/libs/nx-mesh/executors.json +++ b/libs/nx-mesh/executors.json @@ -40,8 +40,7 @@ "validate": { "implementation": "./src/executors/validate/validate.impl", "schema": "./src/executors/validate/schema.json", - "description": "Validates artifacts", - "hasher": "./src/executors/validate/hasher" + "description": "Validates artifacts" } } } diff --git a/libs/nx-mesh/src/generators/base/lib/set-defaults.ts b/libs/nx-mesh/src/generators/base/lib/set-defaults.ts index 579356e4..03034b38 100644 --- a/libs/nx-mesh/src/generators/base/lib/set-defaults.ts +++ b/libs/nx-mesh/src/generators/base/lib/set-defaults.ts @@ -14,19 +14,6 @@ export function setDefaults(host: Tree, options: NormalizedOptions) { workspace.defaultProject = options.projectName; } - if (workspace.tasksRunnerOptions?.['default']?.runner === '@nrwl/nx-cloud') { - const cacheableOperations = - (workspace.tasksRunnerOptions['default'].options - ?.cacheableOperations as string[]) ?? []; - - if (!cacheableOperations.includes('validate')) { - workspace.tasksRunnerOptions['default'].options = { - ...workspace.tasksRunnerOptions['default'].options, - cacheableOperations: [...cacheableOperations, 'validate'], - }; - } - } - if (workspace.targetDefaults) { workspace.targetDefaults = { ...workspace.targetDefaults, diff --git a/nx.json b/nx.json index 48319263..988ee760 100644 --- a/nx.json +++ b/nx.json @@ -8,7 +8,7 @@ "default": { "runner": "@nrwl/nx-cloud", "options": { - "cacheableOperations": ["build", "lint", "test", "e2e", "validate"], + "cacheableOperations": ["build", "lint", "test", "e2e"], "accessToken": "NzExMGIxYWUtZjdkYy00MjRjLWI5NjItMjlkYmU0OWRjNWY2fHJlYWQ=" } }