From 001df4f2110e8760bcffb0b024f3e104f1308cd8 Mon Sep 17 00:00:00 2001 From: jaybell Date: Fri, 25 Sep 2020 13:41:10 -0700 Subject: [PATCH 1/4] feat(core): feat(core): allow excluding projects based on tags from affected:* --- package.json | 4 ++-- packages/workspace/src/command-line/affected.ts | 9 ++++++++- packages/workspace/src/command-line/nx-commands.ts | 8 ++++++++ packages/workspace/src/command-line/utils.ts | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7ed117b8279bb..11c7f4c57d4ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nrwl/nx-source", - "version": "10.2.1", + "version": "999.9.8", "description": "Extensible Dev Tools for Monorepos", "homepage": "https://nx.dev", "main": "index.js", @@ -254,4 +254,4 @@ "pre-push": "yarn checkcommit && yarn documentation && pretty-quick --check" } } -} +} \ No newline at end of file diff --git a/packages/workspace/src/command-line/affected.ts b/packages/workspace/src/command-line/affected.ts index 0963117787354..bb38da6564da0 100644 --- a/packages/workspace/src/command-line/affected.ts +++ b/packages/workspace/src/command-line/affected.ts @@ -47,7 +47,14 @@ export async function affected( const projects = parsedArgs.all ? projectGraph.nodes : affectedGraph.nodes; const env = readEnvironment(nxArgs.target, projects); const affectedProjects = Object.values(projects) - .filter((n) => !parsedArgs.exclude.includes(n.name)) + .filter( + (n) => + !parsedArgs.exclude.includes(n.name) && + env.nxJson.projects[n.name] && + env.nxJson.projects[n.name].tags.filter((tag) => + parsedArgs.excludeTags.includes(tag) + ).length === 0 + ) .filter( (n) => !parsedArgs.onlyFailed || !env.workspaceResults.getResult(n.name) ); diff --git a/packages/workspace/src/command-line/nx-commands.ts b/packages/workspace/src/command-line/nx-commands.ts index abbd287a2193f..2e29d1fa50210 100644 --- a/packages/workspace/src/command-line/nx-commands.ts +++ b/packages/workspace/src/command-line/nx-commands.ts @@ -279,6 +279,14 @@ function withAffectedOptions(yargs: yargs.Argv): yargs.Argv { .option('verbose', { describe: 'Print additional error stack trace on failure', }) + .option('excludeTags', { + describe: + 'Exclude projects with tags matching one or more of the provided tags', + type: 'array', + requiresArg: false, + coerce: parseCSV, + default: [], + }) .conflicts({ files: ['uncommitted', 'untracked', 'base', 'head', 'all'], untracked: ['uncommitted', 'files', 'base', 'head', 'all'], diff --git a/packages/workspace/src/command-line/utils.ts b/packages/workspace/src/command-line/utils.ts index 7a3336f69b3e3..e3f79ab2e4727 100644 --- a/packages/workspace/src/command-line/utils.ts +++ b/packages/workspace/src/command-line/utils.ts @@ -72,6 +72,7 @@ export interface NxArgs { skipNxCache?: boolean; 'skip-nx-cache'?: boolean; scan?: boolean; + excludeTags?: string[]; } const ignoreArgs = ['$0', '_']; From d0c09370d1fdd4346f2f19ac8cd0daf6a4208706 Mon Sep 17 00:00:00 2001 From: jaybell Date: Fri, 25 Sep 2020 13:42:29 -0700 Subject: [PATCH 2/4] docs(core): update documentation for excludeTags --- docs/angular/cli/affected-apps.md | 6 ++++++ docs/angular/cli/affected-build.md | 6 ++++++ docs/angular/cli/affected-dep-graph.md | 6 ++++++ docs/angular/cli/affected-e2e.md | 6 ++++++ docs/angular/cli/affected-libs.md | 6 ++++++ docs/angular/cli/affected-lint.md | 6 ++++++ docs/angular/cli/affected-test.md | 6 ++++++ docs/angular/cli/affected.md | 6 ++++++ docs/angular/cli/format-check.md | 6 ++++++ docs/angular/cli/format-write.md | 6 ++++++ docs/angular/cli/print-affected.md | 6 ++++++ docs/node/cli/affected-apps.md | 6 ++++++ docs/node/cli/affected-build.md | 6 ++++++ docs/node/cli/affected-dep-graph.md | 6 ++++++ docs/node/cli/affected-e2e.md | 6 ++++++ docs/node/cli/affected-libs.md | 6 ++++++ docs/node/cli/affected-lint.md | 6 ++++++ docs/node/cli/affected-test.md | 6 ++++++ docs/node/cli/affected.md | 6 ++++++ docs/node/cli/format-check.md | 6 ++++++ docs/node/cli/format-write.md | 6 ++++++ docs/node/cli/print-affected.md | 6 ++++++ docs/react/cli/affected-apps.md | 6 ++++++ docs/react/cli/affected-build.md | 6 ++++++ docs/react/cli/affected-dep-graph.md | 6 ++++++ docs/react/cli/affected-e2e.md | 6 ++++++ docs/react/cli/affected-libs.md | 6 ++++++ docs/react/cli/affected-lint.md | 6 ++++++ docs/react/cli/affected-test.md | 6 ++++++ docs/react/cli/affected.md | 6 ++++++ docs/react/cli/format-check.md | 6 ++++++ docs/react/cli/format-write.md | 6 ++++++ docs/react/cli/print-affected.md | 6 ++++++ 33 files changed, 198 insertions(+) diff --git a/docs/angular/cli/affected-apps.md b/docs/angular/cli/affected-apps.md index a3a0b085a39c5..1e6920935a158 100644 --- a/docs/angular/cli/affected-apps.md +++ b/docs/angular/cli/affected-apps.md @@ -50,6 +50,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/angular/cli/affected-build.md b/docs/angular/cli/affected-build.md index 76dc8d0795571..c23f53a657cc4 100644 --- a/docs/angular/cli/affected-build.md +++ b/docs/angular/cli/affected-build.md @@ -80,6 +80,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/angular/cli/affected-dep-graph.md b/docs/angular/cli/affected-dep-graph.md index 1f5404f2a5494..15aaa3566e18d 100644 --- a/docs/angular/cli/affected-dep-graph.md +++ b/docs/angular/cli/affected-dep-graph.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### file output file (e.g. --file=output.json or --file=dep-graph.html) diff --git a/docs/angular/cli/affected-e2e.md b/docs/angular/cli/affected-e2e.md index f6a9518562914..8c8271c9f7535 100644 --- a/docs/angular/cli/affected-e2e.md +++ b/docs/angular/cli/affected-e2e.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/angular/cli/affected-libs.md b/docs/angular/cli/affected-libs.md index f9648615be937..b5deabc019671 100644 --- a/docs/angular/cli/affected-libs.md +++ b/docs/angular/cli/affected-libs.md @@ -50,6 +50,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/angular/cli/affected-lint.md b/docs/angular/cli/affected-lint.md index ebf0491368d70..d1fbb3163ad93 100644 --- a/docs/angular/cli/affected-lint.md +++ b/docs/angular/cli/affected-lint.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/angular/cli/affected-test.md b/docs/angular/cli/affected-test.md index 663ec95368de8..12c55e2ab099d 100644 --- a/docs/angular/cli/affected-test.md +++ b/docs/angular/cli/affected-test.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/angular/cli/affected.md b/docs/angular/cli/affected.md index 874b43a5c60fd..64f345ccb6e13 100644 --- a/docs/angular/cli/affected.md +++ b/docs/angular/cli/affected.md @@ -86,6 +86,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/angular/cli/format-check.md b/docs/angular/cli/format-check.md index 8582f2a9a592b..394ff69de721a 100644 --- a/docs/angular/cli/format-check.md +++ b/docs/angular/cli/format-check.md @@ -30,6 +30,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/angular/cli/format-write.md b/docs/angular/cli/format-write.md index 356fdf198afcc..03b59c1d4247a 100644 --- a/docs/angular/cli/format-write.md +++ b/docs/angular/cli/format-write.md @@ -30,6 +30,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/angular/cli/print-affected.md b/docs/angular/cli/print-affected.md index 1ac11d2fd80e5..56552602f6d27 100644 --- a/docs/angular/cli/print-affected.md +++ b/docs/angular/cli/print-affected.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/node/cli/affected-apps.md b/docs/node/cli/affected-apps.md index a3a0b085a39c5..1e6920935a158 100644 --- a/docs/node/cli/affected-apps.md +++ b/docs/node/cli/affected-apps.md @@ -50,6 +50,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/node/cli/affected-build.md b/docs/node/cli/affected-build.md index 76dc8d0795571..c23f53a657cc4 100644 --- a/docs/node/cli/affected-build.md +++ b/docs/node/cli/affected-build.md @@ -80,6 +80,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/node/cli/affected-dep-graph.md b/docs/node/cli/affected-dep-graph.md index 1f5404f2a5494..15aaa3566e18d 100644 --- a/docs/node/cli/affected-dep-graph.md +++ b/docs/node/cli/affected-dep-graph.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### file output file (e.g. --file=output.json or --file=dep-graph.html) diff --git a/docs/node/cli/affected-e2e.md b/docs/node/cli/affected-e2e.md index f6a9518562914..8c8271c9f7535 100644 --- a/docs/node/cli/affected-e2e.md +++ b/docs/node/cli/affected-e2e.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/node/cli/affected-libs.md b/docs/node/cli/affected-libs.md index f9648615be937..b5deabc019671 100644 --- a/docs/node/cli/affected-libs.md +++ b/docs/node/cli/affected-libs.md @@ -50,6 +50,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/node/cli/affected-lint.md b/docs/node/cli/affected-lint.md index ebf0491368d70..d1fbb3163ad93 100644 --- a/docs/node/cli/affected-lint.md +++ b/docs/node/cli/affected-lint.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/node/cli/affected-test.md b/docs/node/cli/affected-test.md index 663ec95368de8..12c55e2ab099d 100644 --- a/docs/node/cli/affected-test.md +++ b/docs/node/cli/affected-test.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/node/cli/affected.md b/docs/node/cli/affected.md index 874b43a5c60fd..64f345ccb6e13 100644 --- a/docs/node/cli/affected.md +++ b/docs/node/cli/affected.md @@ -86,6 +86,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/node/cli/format-check.md b/docs/node/cli/format-check.md index 8582f2a9a592b..394ff69de721a 100644 --- a/docs/node/cli/format-check.md +++ b/docs/node/cli/format-check.md @@ -30,6 +30,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/node/cli/format-write.md b/docs/node/cli/format-write.md index 356fdf198afcc..03b59c1d4247a 100644 --- a/docs/node/cli/format-write.md +++ b/docs/node/cli/format-write.md @@ -30,6 +30,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/node/cli/print-affected.md b/docs/node/cli/print-affected.md index 1ac11d2fd80e5..56552602f6d27 100644 --- a/docs/node/cli/print-affected.md +++ b/docs/node/cli/print-affected.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/react/cli/affected-apps.md b/docs/react/cli/affected-apps.md index a3a0b085a39c5..1e6920935a158 100644 --- a/docs/react/cli/affected-apps.md +++ b/docs/react/cli/affected-apps.md @@ -50,6 +50,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/react/cli/affected-build.md b/docs/react/cli/affected-build.md index 76dc8d0795571..c23f53a657cc4 100644 --- a/docs/react/cli/affected-build.md +++ b/docs/react/cli/affected-build.md @@ -80,6 +80,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/react/cli/affected-dep-graph.md b/docs/react/cli/affected-dep-graph.md index 1f5404f2a5494..15aaa3566e18d 100644 --- a/docs/react/cli/affected-dep-graph.md +++ b/docs/react/cli/affected-dep-graph.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### file output file (e.g. --file=output.json or --file=dep-graph.html) diff --git a/docs/react/cli/affected-e2e.md b/docs/react/cli/affected-e2e.md index f6a9518562914..8c8271c9f7535 100644 --- a/docs/react/cli/affected-e2e.md +++ b/docs/react/cli/affected-e2e.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/react/cli/affected-libs.md b/docs/react/cli/affected-libs.md index f9648615be937..b5deabc019671 100644 --- a/docs/react/cli/affected-libs.md +++ b/docs/react/cli/affected-libs.md @@ -50,6 +50,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/react/cli/affected-lint.md b/docs/react/cli/affected-lint.md index ebf0491368d70..d1fbb3163ad93 100644 --- a/docs/react/cli/affected-lint.md +++ b/docs/react/cli/affected-lint.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/react/cli/affected-test.md b/docs/react/cli/affected-test.md index 663ec95368de8..12c55e2ab099d 100644 --- a/docs/react/cli/affected-test.md +++ b/docs/react/cli/affected-test.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/react/cli/affected.md b/docs/react/cli/affected.md index 874b43a5c60fd..64f345ccb6e13 100644 --- a/docs/react/cli/affected.md +++ b/docs/react/cli/affected.md @@ -86,6 +86,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/react/cli/format-check.md b/docs/react/cli/format-check.md index 8582f2a9a592b..394ff69de721a 100644 --- a/docs/react/cli/format-check.md +++ b/docs/react/cli/format-check.md @@ -30,6 +30,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/react/cli/format-write.md b/docs/react/cli/format-write.md index 356fdf198afcc..03b59c1d4247a 100644 --- a/docs/react/cli/format-write.md +++ b/docs/react/cli/format-write.md @@ -30,6 +30,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas diff --git a/docs/react/cli/print-affected.md b/docs/react/cli/print-affected.md index 1ac11d2fd80e5..56552602f6d27 100644 --- a/docs/react/cli/print-affected.md +++ b/docs/react/cli/print-affected.md @@ -68,6 +68,12 @@ Default: `` Exclude certain projects from being processed +### excludeTags + +Default: `` + +Exclude projects with tags matching one or more of the provided tags + ### files Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas From 28e78847e8fb72b1671e2eb89b0f81c34e5d6d50 Mon Sep 17 00:00:00 2001 From: jaybell Date: Fri, 25 Sep 2020 17:03:07 -0700 Subject: [PATCH 3/4] cleanup(core): do not include default value to yargs-parser for exclude-tags --- docs/angular/cli/affected-apps.md | 2 -- docs/angular/cli/affected-build.md | 2 -- docs/angular/cli/affected-dep-graph.md | 2 -- docs/angular/cli/affected-e2e.md | 2 -- docs/angular/cli/affected-libs.md | 2 -- docs/angular/cli/affected-lint.md | 2 -- docs/angular/cli/affected-test.md | 2 -- docs/angular/cli/affected.md | 2 -- docs/angular/cli/format-check.md | 2 -- docs/angular/cli/format-write.md | 2 -- docs/angular/cli/print-affected.md | 2 -- docs/node/cli/affected-apps.md | 2 -- docs/node/cli/affected-build.md | 2 -- docs/node/cli/affected-dep-graph.md | 2 -- docs/node/cli/affected-e2e.md | 2 -- docs/node/cli/affected-libs.md | 2 -- docs/node/cli/affected-lint.md | 2 -- docs/node/cli/affected-test.md | 2 -- docs/node/cli/affected.md | 2 -- docs/node/cli/format-check.md | 2 -- docs/node/cli/format-write.md | 2 -- docs/node/cli/print-affected.md | 2 -- docs/react/cli/affected-apps.md | 2 -- docs/react/cli/affected-build.md | 2 -- docs/react/cli/affected-dep-graph.md | 2 -- docs/react/cli/affected-e2e.md | 2 -- docs/react/cli/affected-libs.md | 2 -- docs/react/cli/affected-lint.md | 2 -- docs/react/cli/affected-test.md | 2 -- docs/react/cli/affected.md | 2 -- docs/react/cli/format-check.md | 2 -- docs/react/cli/format-write.md | 2 -- docs/react/cli/print-affected.md | 2 -- packages/workspace/src/command-line/nx-commands.ts | 1 - packages/workspace/src/command-line/utils.ts | 4 ++++ 35 files changed, 4 insertions(+), 67 deletions(-) diff --git a/docs/angular/cli/affected-apps.md b/docs/angular/cli/affected-apps.md index 1e6920935a158..f00ec7066868a 100644 --- a/docs/angular/cli/affected-apps.md +++ b/docs/angular/cli/affected-apps.md @@ -52,8 +52,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/angular/cli/affected-build.md b/docs/angular/cli/affected-build.md index c23f53a657cc4..f290e679a28ed 100644 --- a/docs/angular/cli/affected-build.md +++ b/docs/angular/cli/affected-build.md @@ -82,8 +82,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/angular/cli/affected-dep-graph.md b/docs/angular/cli/affected-dep-graph.md index 15aaa3566e18d..61acac08f81f4 100644 --- a/docs/angular/cli/affected-dep-graph.md +++ b/docs/angular/cli/affected-dep-graph.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### file diff --git a/docs/angular/cli/affected-e2e.md b/docs/angular/cli/affected-e2e.md index 8c8271c9f7535..5f305c937fab9 100644 --- a/docs/angular/cli/affected-e2e.md +++ b/docs/angular/cli/affected-e2e.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/angular/cli/affected-libs.md b/docs/angular/cli/affected-libs.md index b5deabc019671..0cdcd63c32a9b 100644 --- a/docs/angular/cli/affected-libs.md +++ b/docs/angular/cli/affected-libs.md @@ -52,8 +52,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/angular/cli/affected-lint.md b/docs/angular/cli/affected-lint.md index d1fbb3163ad93..a198dc6a9593a 100644 --- a/docs/angular/cli/affected-lint.md +++ b/docs/angular/cli/affected-lint.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/angular/cli/affected-test.md b/docs/angular/cli/affected-test.md index 12c55e2ab099d..e45e3e97288d5 100644 --- a/docs/angular/cli/affected-test.md +++ b/docs/angular/cli/affected-test.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/angular/cli/affected.md b/docs/angular/cli/affected.md index 64f345ccb6e13..51be6d0ce24ca 100644 --- a/docs/angular/cli/affected.md +++ b/docs/angular/cli/affected.md @@ -88,8 +88,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/angular/cli/format-check.md b/docs/angular/cli/format-check.md index 394ff69de721a..d6f8a31432e8a 100644 --- a/docs/angular/cli/format-check.md +++ b/docs/angular/cli/format-check.md @@ -32,8 +32,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/angular/cli/format-write.md b/docs/angular/cli/format-write.md index 03b59c1d4247a..674ffd0f1f230 100644 --- a/docs/angular/cli/format-write.md +++ b/docs/angular/cli/format-write.md @@ -32,8 +32,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/angular/cli/print-affected.md b/docs/angular/cli/print-affected.md index 56552602f6d27..5316340ccc96b 100644 --- a/docs/angular/cli/print-affected.md +++ b/docs/angular/cli/print-affected.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/node/cli/affected-apps.md b/docs/node/cli/affected-apps.md index 1e6920935a158..f00ec7066868a 100644 --- a/docs/node/cli/affected-apps.md +++ b/docs/node/cli/affected-apps.md @@ -52,8 +52,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/node/cli/affected-build.md b/docs/node/cli/affected-build.md index c23f53a657cc4..f290e679a28ed 100644 --- a/docs/node/cli/affected-build.md +++ b/docs/node/cli/affected-build.md @@ -82,8 +82,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/node/cli/affected-dep-graph.md b/docs/node/cli/affected-dep-graph.md index 15aaa3566e18d..61acac08f81f4 100644 --- a/docs/node/cli/affected-dep-graph.md +++ b/docs/node/cli/affected-dep-graph.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### file diff --git a/docs/node/cli/affected-e2e.md b/docs/node/cli/affected-e2e.md index 8c8271c9f7535..5f305c937fab9 100644 --- a/docs/node/cli/affected-e2e.md +++ b/docs/node/cli/affected-e2e.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/node/cli/affected-libs.md b/docs/node/cli/affected-libs.md index b5deabc019671..0cdcd63c32a9b 100644 --- a/docs/node/cli/affected-libs.md +++ b/docs/node/cli/affected-libs.md @@ -52,8 +52,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/node/cli/affected-lint.md b/docs/node/cli/affected-lint.md index d1fbb3163ad93..a198dc6a9593a 100644 --- a/docs/node/cli/affected-lint.md +++ b/docs/node/cli/affected-lint.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/node/cli/affected-test.md b/docs/node/cli/affected-test.md index 12c55e2ab099d..e45e3e97288d5 100644 --- a/docs/node/cli/affected-test.md +++ b/docs/node/cli/affected-test.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/node/cli/affected.md b/docs/node/cli/affected.md index 64f345ccb6e13..51be6d0ce24ca 100644 --- a/docs/node/cli/affected.md +++ b/docs/node/cli/affected.md @@ -88,8 +88,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/node/cli/format-check.md b/docs/node/cli/format-check.md index 394ff69de721a..d6f8a31432e8a 100644 --- a/docs/node/cli/format-check.md +++ b/docs/node/cli/format-check.md @@ -32,8 +32,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/node/cli/format-write.md b/docs/node/cli/format-write.md index 03b59c1d4247a..674ffd0f1f230 100644 --- a/docs/node/cli/format-write.md +++ b/docs/node/cli/format-write.md @@ -32,8 +32,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/node/cli/print-affected.md b/docs/node/cli/print-affected.md index 56552602f6d27..5316340ccc96b 100644 --- a/docs/node/cli/print-affected.md +++ b/docs/node/cli/print-affected.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/react/cli/affected-apps.md b/docs/react/cli/affected-apps.md index 1e6920935a158..f00ec7066868a 100644 --- a/docs/react/cli/affected-apps.md +++ b/docs/react/cli/affected-apps.md @@ -52,8 +52,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/react/cli/affected-build.md b/docs/react/cli/affected-build.md index c23f53a657cc4..f290e679a28ed 100644 --- a/docs/react/cli/affected-build.md +++ b/docs/react/cli/affected-build.md @@ -82,8 +82,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/react/cli/affected-dep-graph.md b/docs/react/cli/affected-dep-graph.md index 15aaa3566e18d..61acac08f81f4 100644 --- a/docs/react/cli/affected-dep-graph.md +++ b/docs/react/cli/affected-dep-graph.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### file diff --git a/docs/react/cli/affected-e2e.md b/docs/react/cli/affected-e2e.md index 8c8271c9f7535..5f305c937fab9 100644 --- a/docs/react/cli/affected-e2e.md +++ b/docs/react/cli/affected-e2e.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/react/cli/affected-libs.md b/docs/react/cli/affected-libs.md index b5deabc019671..0cdcd63c32a9b 100644 --- a/docs/react/cli/affected-libs.md +++ b/docs/react/cli/affected-libs.md @@ -52,8 +52,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/react/cli/affected-lint.md b/docs/react/cli/affected-lint.md index d1fbb3163ad93..a198dc6a9593a 100644 --- a/docs/react/cli/affected-lint.md +++ b/docs/react/cli/affected-lint.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/react/cli/affected-test.md b/docs/react/cli/affected-test.md index 12c55e2ab099d..e45e3e97288d5 100644 --- a/docs/react/cli/affected-test.md +++ b/docs/react/cli/affected-test.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/react/cli/affected.md b/docs/react/cli/affected.md index 64f345ccb6e13..51be6d0ce24ca 100644 --- a/docs/react/cli/affected.md +++ b/docs/react/cli/affected.md @@ -88,8 +88,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/react/cli/format-check.md b/docs/react/cli/format-check.md index 394ff69de721a..d6f8a31432e8a 100644 --- a/docs/react/cli/format-check.md +++ b/docs/react/cli/format-check.md @@ -32,8 +32,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/react/cli/format-write.md b/docs/react/cli/format-write.md index 03b59c1d4247a..674ffd0f1f230 100644 --- a/docs/react/cli/format-write.md +++ b/docs/react/cli/format-write.md @@ -32,8 +32,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/docs/react/cli/print-affected.md b/docs/react/cli/print-affected.md index 56552602f6d27..5316340ccc96b 100644 --- a/docs/react/cli/print-affected.md +++ b/docs/react/cli/print-affected.md @@ -70,8 +70,6 @@ Exclude certain projects from being processed ### excludeTags -Default: `` - Exclude projects with tags matching one or more of the provided tags ### files diff --git a/packages/workspace/src/command-line/nx-commands.ts b/packages/workspace/src/command-line/nx-commands.ts index 2e29d1fa50210..2fac962b283a5 100644 --- a/packages/workspace/src/command-line/nx-commands.ts +++ b/packages/workspace/src/command-line/nx-commands.ts @@ -285,7 +285,6 @@ function withAffectedOptions(yargs: yargs.Argv): yargs.Argv { type: 'array', requiresArg: false, coerce: parseCSV, - default: [], }) .conflicts({ files: ['uncommitted', 'untracked', 'base', 'head', 'all'], diff --git a/packages/workspace/src/command-line/utils.ts b/packages/workspace/src/command-line/utils.ts index e3f79ab2e4727..aea5778f0f4de 100644 --- a/packages/workspace/src/command-line/utils.ts +++ b/packages/workspace/src/command-line/utils.ts @@ -138,6 +138,10 @@ export function splitArgsIntoNxArgsAndOverrides( nxArgs.skipNxCache = false; } + if (!nxArgs.excludeTags) { + nxArgs.excludeTags = []; + } + return { nxArgs, overrides }; } From 9e18a6c6a9812be3b72333ac53a72293ffe7a769 Mon Sep 17 00:00:00 2001 From: jaybell Date: Sun, 27 Sep 2020 17:47:41 -0700 Subject: [PATCH 4/4] cleanup(core): cleanup(core): check for valid exclude tags instead of setting --- packages/workspace/src/command-line/affected.ts | 1 + packages/workspace/src/command-line/utils.ts | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/workspace/src/command-line/affected.ts b/packages/workspace/src/command-line/affected.ts index bb38da6564da0..d54a6a8f3c273 100644 --- a/packages/workspace/src/command-line/affected.ts +++ b/packages/workspace/src/command-line/affected.ts @@ -51,6 +51,7 @@ export async function affected( (n) => !parsedArgs.exclude.includes(n.name) && env.nxJson.projects[n.name] && + Array.isArray(parsedArgs.excludeTags) && env.nxJson.projects[n.name].tags.filter((tag) => parsedArgs.excludeTags.includes(tag) ).length === 0 diff --git a/packages/workspace/src/command-line/utils.ts b/packages/workspace/src/command-line/utils.ts index aea5778f0f4de..e3f79ab2e4727 100644 --- a/packages/workspace/src/command-line/utils.ts +++ b/packages/workspace/src/command-line/utils.ts @@ -138,10 +138,6 @@ export function splitArgsIntoNxArgsAndOverrides( nxArgs.skipNxCache = false; } - if (!nxArgs.excludeTags) { - nxArgs.excludeTags = []; - } - return { nxArgs, overrides }; }