Skip to content

Commit

Permalink
fix(nx-mesh): dont cache validate executor output (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
domjtalbot committed Jan 9, 2023
1 parent edcf6dd commit a76a8ad
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-dragons-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nx-mesh': patch
---

Don't cache validate executor
6 changes: 6 additions & 0 deletions libs/example/sdk/graphql/star-wars-api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
3 changes: 1 addition & 2 deletions libs/nx-mesh/executors.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
13 changes: 0 additions & 13 deletions libs/nx-mesh/src/generators/base/lib/set-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"default": {
"runner": "@nrwl/nx-cloud",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e", "validate"],
"cacheableOperations": ["build", "lint", "test", "e2e"],
"accessToken": "NzExMGIxYWUtZjdkYy00MjRjLWI5NjItMjlkYmU0OWRjNWY2fHJlYWQ="
}
}
Expand Down

0 comments on commit a76a8ad

Please sign in to comment.