nx 19.7.0-canary.20240905-ccda7f9 → 19.7.0-canary.20240906-a3c2db8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. package/package.json +12 -12
  2. package/src/command-line/add/command-object.js +2 -2
  3. package/src/command-line/affected/command-object.js +1 -1
  4. package/src/command-line/connect/command-object.js +2 -2
  5. package/src/command-line/daemon/command-object.js +1 -1
  6. package/src/command-line/deprecated/command-objects.js +2 -2
  7. package/src/command-line/exec/command-object.js +1 -1
  8. package/src/command-line/format/command-object.js +4 -4
  9. package/src/command-line/generate/command-object.js +4 -4
  10. package/src/command-line/graph/command-object.js +6 -6
  11. package/src/command-line/import/command-object.js +6 -6
  12. package/src/command-line/list/command-object.js +1 -1
  13. package/src/command-line/login/command-object.js +1 -1
  14. package/src/command-line/logout/command-object.js +1 -1
  15. package/src/command-line/migrate/command-object.js +9 -9
  16. package/src/command-line/new/command-object.js +2 -2
  17. package/src/command-line/release/command-object.js +27 -27
  18. package/src/command-line/report/command-object.js +1 -1
  19. package/src/command-line/reset/command-object.js +1 -1
  20. package/src/command-line/run/command-object.js +1 -1
  21. package/src/command-line/run-many/command-object.js +1 -1
  22. package/src/command-line/show/command-object.js +10 -10
  23. package/src/command-line/watch/command-object.js +1 -1
  24. package/src/command-line/yargs-utils/shared-options.js +20 -20
  25. package/src/native/nx.wasm32-wasi.wasm +0 -0
  26. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +6 -41
  27. package/src/tasks-runner/cache.d.ts +2 -0
  28. package/src/tasks-runner/cache.js +15 -1
  29. package/src/tasks-runner/task-orchestrator.js +1 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.7.0-canary.20240905-ccda7f9",
3
+ "version": "19.7.0-canary.20240906-a3c2db8",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -71,7 +71,7 @@
71
71
  "yargs-parser": "21.1.1",
72
72
  "node-machine-id": "1.1.12",
73
73
  "ora": "5.3.0",
74
- "@nrwl/tao": "19.7.0-canary.20240905-ccda7f9"
74
+ "@nrwl/tao": "19.7.0-canary.20240906-a3c2db8"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@swc-node/register": "^1.8.0",
@@ -86,16 +86,16 @@
86
86
  }
87
87
  },
88
88
  "optionalDependencies": {
89
- "@nx/nx-darwin-x64": "19.7.0-canary.20240905-ccda7f9",
90
- "@nx/nx-darwin-arm64": "19.7.0-canary.20240905-ccda7f9",
91
- "@nx/nx-linux-x64-gnu": "19.7.0-canary.20240905-ccda7f9",
92
- "@nx/nx-linux-x64-musl": "19.7.0-canary.20240905-ccda7f9",
93
- "@nx/nx-win32-x64-msvc": "19.7.0-canary.20240905-ccda7f9",
94
- "@nx/nx-linux-arm64-gnu": "19.7.0-canary.20240905-ccda7f9",
95
- "@nx/nx-linux-arm64-musl": "19.7.0-canary.20240905-ccda7f9",
96
- "@nx/nx-linux-arm-gnueabihf": "19.7.0-canary.20240905-ccda7f9",
97
- "@nx/nx-win32-arm64-msvc": "19.7.0-canary.20240905-ccda7f9",
98
- "@nx/nx-freebsd-x64": "19.7.0-canary.20240905-ccda7f9"
89
+ "@nx/nx-darwin-x64": "19.7.0-canary.20240906-a3c2db8",
90
+ "@nx/nx-darwin-arm64": "19.7.0-canary.20240906-a3c2db8",
91
+ "@nx/nx-linux-x64-gnu": "19.7.0-canary.20240906-a3c2db8",
92
+ "@nx/nx-linux-x64-musl": "19.7.0-canary.20240906-a3c2db8",
93
+ "@nx/nx-win32-x64-msvc": "19.7.0-canary.20240906-a3c2db8",
94
+ "@nx/nx-linux-arm64-gnu": "19.7.0-canary.20240906-a3c2db8",
95
+ "@nx/nx-linux-arm64-musl": "19.7.0-canary.20240906-a3c2db8",
96
+ "@nx/nx-linux-arm-gnueabihf": "19.7.0-canary.20240906-a3c2db8",
97
+ "@nx/nx-win32-arm64-msvc": "19.7.0-canary.20240906-a3c2db8",
98
+ "@nx/nx-freebsd-x64": "19.7.0-canary.20240906-a3c2db8"
99
99
  },
100
100
  "nx-migrations": {
101
101
  "migrations": "./migrations.json",
@@ -12,11 +12,11 @@ exports.yargsAddCommand = {
12
12
  })
13
13
  .positional('packageSpecifier', {
14
14
  type: 'string',
15
- description: 'The package name and optional version (e.g. `@nx/react` or `@nx/react@latest`) to install and initialize. If the version is not specified it will install the same version as the `nx` package for Nx core plugins or the latest version for other packages',
15
+ description: 'The package name and optional version (e.g. `@nx/react` or `@nx/react@latest`) to install and initialize. If the version is not specified it will install the same version as the `nx` package for Nx core plugins or the latest version for other packages.',
16
16
  })
17
17
  .option('updatePackageScripts', {
18
18
  type: 'boolean',
19
- description: 'Update `package.json` scripts with inferred targets. Defaults to `true` when the package is a core Nx plugin',
19
+ description: 'Update `package.json` scripts with inferred targets. Defaults to `true` when the package is a core Nx plugin.',
20
20
  })
21
21
  .example('$0 add @nx/react', 'Install the latest version of the `@nx/react` package and run its `@nx/react:init` generator')
22
22
  .example('$0 add non-core-nx-plugin', 'Install the latest version of the `non-core-nx-plugin` package and run its `non-core-nx-plugin:init` generator if available')
@@ -6,7 +6,7 @@ const shared_options_1 = require("../yargs-utils/shared-options");
6
6
  const params_1 = require("../../utils/params");
7
7
  exports.yargsAffectedCommand = {
8
8
  command: 'affected',
9
- describe: 'Run target for affected projects',
9
+ describe: 'Run target for affected projects.',
10
10
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withAffectedOptions)((0, shared_options_1.withRunOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withTargetAndConfigurationOption)((0, shared_options_1.withBatch)(yargs)))))
11
11
  .option('all', {
12
12
  type: 'boolean',
@@ -7,7 +7,7 @@ const shared_options_1 = require("../yargs-utils/shared-options");
7
7
  exports.yargsConnectCommand = {
8
8
  command: 'connect',
9
9
  aliases: ['connect-to-nx-cloud'],
10
- describe: `Connect workspace to Nx Cloud`,
10
+ describe: `Connect workspace to Nx Cloud.`,
11
11
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withConnectOptions(yargs), 'connect-to-nx-cloud'),
12
12
  handler: async (args) => {
13
13
  await (await Promise.resolve().then(() => require('./connect-to-nx-cloud'))).connectToNxCloudCommand(args);
@@ -22,7 +22,7 @@ exports.yargsConnectCommand = {
22
22
  function withConnectOptions(yargs) {
23
23
  return (0, shared_options_1.withVerbose)(yargs).option('generateToken', {
24
24
  type: 'boolean',
25
- description: 'Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud',
25
+ description: 'Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud.',
26
26
  });
27
27
  }
28
28
  exports.yargsViewLogsCommand = {
@@ -4,7 +4,7 @@ exports.yargsDaemonCommand = void 0;
4
4
  const documentation_1 = require("../yargs-utils/documentation");
5
5
  exports.yargsDaemonCommand = {
6
6
  command: 'daemon',
7
- describe: 'Prints information about the Nx Daemon process or starts a daemon process',
7
+ describe: 'Prints information about the Nx Daemon process or starts a daemon process.',
8
8
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withDaemonOptions(yargs), 'daemon'),
9
9
  handler: async (args) => (await Promise.resolve().then(() => require('./daemon'))).daemonHandler(args),
10
10
  };
@@ -31,12 +31,12 @@ exports.yargsPrintAffectedCommand = {
31
31
  builder: (yargs) => (0, shared_options_1.withAffectedOptions)((0, shared_options_1.withTargetAndConfigurationOption)(yargs, false))
32
32
  .option('select', {
33
33
  type: 'string',
34
- describe: 'Select the subset of the returned json document (e.g., --select=projects)',
34
+ describe: 'Select the subset of the returned json document (e.g., --select=projects).',
35
35
  })
36
36
  .option('type', {
37
37
  type: 'string',
38
38
  choices: ['app', 'lib'],
39
- describe: 'Select the type of projects to be returned (e.g., --type=app)',
39
+ describe: 'Select the type of projects to be returned (e.g., --type=app).',
40
40
  }),
41
41
  handler: async (args) => {
42
42
  const exitCode = await (0, params_1.handleErrors)(false, () => {
@@ -4,7 +4,7 @@ exports.yargsExecCommand = void 0;
4
4
  const shared_options_1 = require("../yargs-utils/shared-options");
5
5
  exports.yargsExecCommand = {
6
6
  command: 'exec',
7
- describe: 'Executes any command as if it was a target on the project',
7
+ describe: 'Executes any command as if it was a target on the project.',
8
8
  builder: (yargs) => (0, shared_options_1.withRunManyOptions)(yargs),
9
9
  handler: async (args) => {
10
10
  try {
@@ -5,7 +5,7 @@ const documentation_1 = require("../yargs-utils/documentation");
5
5
  const shared_options_1 = require("../yargs-utils/shared-options");
6
6
  exports.yargsFormatCheckCommand = {
7
7
  command: 'format:check',
8
- describe: 'Check for un-formatted files',
8
+ describe: 'Check for un-formatted files.',
9
9
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withFormatOptions(yargs), 'format:check'),
10
10
  handler: async (args) => {
11
11
  await (await Promise.resolve().then(() => require('./format'))).format('check', args);
@@ -14,7 +14,7 @@ exports.yargsFormatCheckCommand = {
14
14
  };
15
15
  exports.yargsFormatWriteCommand = {
16
16
  command: 'format:write',
17
- describe: 'Overwrite un-formatted files',
17
+ describe: 'Overwrite un-formatted files.',
18
18
  aliases: ['format'],
19
19
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withFormatOptions(yargs), 'format:write'),
20
20
  handler: async (args) => {
@@ -32,12 +32,12 @@ function withFormatOptions(yargs) {
32
32
  type: 'boolean',
33
33
  })
34
34
  .option('projects', {
35
- describe: 'Projects to format (comma/space delimited)',
35
+ describe: 'Projects to format (comma/space delimited).',
36
36
  type: 'string',
37
37
  coerce: shared_options_1.parseCSV,
38
38
  })
39
39
  .option('all', {
40
- describe: 'Format all projects',
40
+ describe: 'Format all projects.',
41
41
  type: 'boolean',
42
42
  })
43
43
  .conflicts({
@@ -18,23 +18,23 @@ function withGenerateOptions(yargs) {
18
18
  const generatorWillShowHelp = process.argv[3] && !process.argv[3].startsWith('-');
19
19
  const res = (0, shared_options_1.withVerbose)(yargs)
20
20
  .positional('generator', {
21
- describe: 'Name of the generator (e.g., @nx/js:library, library)',
21
+ describe: 'Name of the generator (e.g., @nx/js:library, library).',
22
22
  type: 'string',
23
23
  required: true,
24
24
  })
25
25
  .option('dryRun', {
26
- describe: 'Preview the changes without updating files',
26
+ describe: 'Preview the changes without updating files.',
27
27
  alias: 'd',
28
28
  type: 'boolean',
29
29
  default: false,
30
30
  })
31
31
  .option('interactive', {
32
- describe: 'When false disables interactive input prompts for options',
32
+ describe: 'When false disables interactive input prompts for options.',
33
33
  type: 'boolean',
34
34
  default: true,
35
35
  })
36
36
  .option('quiet', {
37
- describe: 'Hides logs from tree operations (e.g. `CREATE package.json`)',
37
+ describe: 'Hides logs from tree operations (e.g. `CREATE package.json`).',
38
38
  type: 'boolean',
39
39
  conflicts: ['verbose'],
40
40
  })
@@ -6,12 +6,12 @@ const documentation_1 = require("../yargs-utils/documentation");
6
6
  const shared_options_1 = require("../yargs-utils/shared-options");
7
7
  exports.yargsGraphCommand = {
8
8
  command: 'graph',
9
- describe: 'Graph dependencies within workspace',
9
+ describe: 'Graph dependencies within workspace.',
10
10
  aliases: ['dep-graph'],
11
11
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withVerbose)((0, shared_options_1.withAffectedOptions)(withGraphOptions(yargs))), 'dep-graph')
12
12
  .option('affected', {
13
13
  type: 'boolean',
14
- description: 'Highlight affected projects',
14
+ description: 'Highlight affected projects.',
15
15
  })
16
16
  .implies('untracked', 'affected')
17
17
  .implies('uncommitted', 'affected')
@@ -31,13 +31,13 @@ function withGraphOptions(yargs) {
31
31
  type: 'boolean',
32
32
  })
33
33
  .option('view', {
34
- describe: 'Choose whether to view the projects or task graph',
34
+ describe: 'Choose whether to view the projects or task graph.',
35
35
  type: 'string',
36
36
  default: 'projects',
37
37
  choices: ['projects', 'tasks'],
38
38
  })
39
39
  .option('targets', {
40
- describe: 'The target to show tasks for in the task graph',
40
+ describe: 'The target to show tasks for in the task graph.',
41
41
  type: 'string',
42
42
  coerce: shared_options_1.parseCSV,
43
43
  })
@@ -51,7 +51,7 @@ function withGraphOptions(yargs) {
51
51
  coerce: shared_options_1.parseCSV,
52
52
  })
53
53
  .option('groupByFolder', {
54
- describe: 'Group projects by folder in the project graph',
54
+ describe: 'Group projects by folder in the project graph.',
55
55
  type: 'boolean',
56
56
  })
57
57
  .option('host', {
@@ -63,7 +63,7 @@ function withGraphOptions(yargs) {
63
63
  type: 'number',
64
64
  })
65
65
  .option('watch', {
66
- describe: 'Watch for changes to project graph and update in-browser',
66
+ describe: 'Watch for changes to project graph and update in-browser.',
67
67
  type: 'boolean',
68
68
  default: true,
69
69
  })
@@ -10,27 +10,27 @@ exports.yargsImportCommand = {
10
10
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withVerbose)(yargs
11
11
  .positional('sourceRemoteUrl', {
12
12
  type: 'string',
13
- description: 'The remote URL of the source to import',
13
+ description: 'The remote URL of the source to import.',
14
14
  })
15
15
  .positional('destination', {
16
16
  type: 'string',
17
- description: 'The directory in the current workspace to import into',
17
+ description: 'The directory in the current workspace to import into.',
18
18
  })
19
19
  .option('source', {
20
20
  type: 'string',
21
- description: 'The directory in the source repository to import from',
21
+ description: 'The directory in the source repository to import from.',
22
22
  })
23
23
  .option('ref', {
24
24
  type: 'string',
25
- description: 'The branch from the source repository to import',
25
+ description: 'The branch from the source repository to import.',
26
26
  })
27
27
  .option('depth', {
28
28
  type: 'number',
29
- description: 'The depth to clone the source repository (limit this for faster git clone)',
29
+ description: 'The depth to clone the source repository (limit this for faster git clone).',
30
30
  })
31
31
  .option('interactive', {
32
32
  type: 'boolean',
33
- description: 'Interactive mode',
33
+ description: 'Interactive mode.',
34
34
  default: true,
35
35
  })), 'import'),
36
36
  handler: async (args) => {
@@ -6,7 +6,7 @@ exports.yargsListCommand = {
6
6
  describe: 'Lists installed plugins, capabilities of installed plugins and other available plugins.',
7
7
  builder: (yargs) => yargs.positional('plugin', {
8
8
  type: 'string',
9
- description: 'The name of an installed plugin to query',
9
+ description: 'The name of an installed plugin to query.',
10
10
  }),
11
11
  handler: async (args) => {
12
12
  await (await Promise.resolve().then(() => require('./list'))).listHandler(args);
@@ -4,7 +4,7 @@ exports.yargsLoginCommand = void 0;
4
4
  const shared_options_1 = require("../../command-line/yargs-utils/shared-options");
5
5
  exports.yargsLoginCommand = {
6
6
  command: 'login [nxCloudUrl]',
7
- describe: false,
7
+ describe: 'Login to Nx Cloud. This command is an alias for [`nx-cloud login`](/ci/reference/nx-cloud-cli#npx-nxcloud-login).',
8
8
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs.positional('nxCloudUrl', {
9
9
  describe: 'The Nx Cloud URL of the instance you are trying to connect to. If no positional argument is provided, this command will connect to https://cloud.nx.app.',
10
10
  type: 'string',
@@ -4,7 +4,7 @@ exports.yargsLogoutCommand = void 0;
4
4
  const shared_options_1 = require("../../command-line/yargs-utils/shared-options");
5
5
  exports.yargsLogoutCommand = {
6
6
  command: 'logout',
7
- describe: false,
7
+ describe: 'Logout from Nx Cloud. This command is an alias for [`nx-cloud logout`](/ci/reference/nx-cloud-cli#npx-nxcloud-logout).',
8
8
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs),
9
9
  handler: async (args) => {
10
10
  process.exit(await (await Promise.resolve().then(() => require('./logout'))).logoutHandler(args));
@@ -30,44 +30,44 @@ function withMigrationOptions(yargs) {
30
30
  const defaultCommitPrefix = 'chore: [nx migration] ';
31
31
  return (0, shared_options_1.withVerbose)(yargs)
32
32
  .positional('packageAndVersion', {
33
- describe: `The target package and version (e.g, @nx/workspace@16.0.0)`,
33
+ describe: `The target package and version (e.g, @nx/workspace@16.0.0).`,
34
34
  type: 'string',
35
35
  })
36
36
  .option('runMigrations', {
37
- describe: `Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json)`,
37
+ describe: `Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json).`,
38
38
  type: 'string',
39
39
  })
40
40
  .option('ifExists', {
41
- describe: `Run migrations only if the migrations file exists, if not continues successfully`,
41
+ describe: `Run migrations only if the migrations file exists, if not continues successfully.`,
42
42
  type: 'boolean',
43
43
  default: false,
44
44
  })
45
45
  .option('from', {
46
- describe: 'Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@16.0.0,@nx/js@16.0.0")',
46
+ describe: 'Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/react@16.0.0,@nx/js@16.0.0").',
47
47
  type: 'string',
48
48
  })
49
49
  .option('to', {
50
- describe: 'Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@16.0.0,@nx/js@16.0.0")',
50
+ describe: 'Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/react@16.0.0,@nx/js@16.0.0").',
51
51
  type: 'string',
52
52
  })
53
53
  .option('createCommits', {
54
- describe: 'Automatically create a git commit after each migration runs',
54
+ describe: 'Automatically create a git commit after each migration runs.',
55
55
  type: 'boolean',
56
56
  alias: ['C'],
57
57
  default: false,
58
58
  })
59
59
  .option('commitPrefix', {
60
- describe: 'Commit prefix to apply to the commit for each migration, when --create-commits is enabled',
60
+ describe: 'Commit prefix to apply to the commit for each migration, when --create-commits is enabled.',
61
61
  type: 'string',
62
62
  default: defaultCommitPrefix,
63
63
  })
64
64
  .option('interactive', {
65
- describe: 'Enable prompts to confirm whether to collect optional package updates and migrations',
65
+ describe: 'Enable prompts to confirm whether to collect optional package updates and migrations.',
66
66
  type: 'boolean',
67
67
  default: false,
68
68
  })
69
69
  .option('excludeAppliedMigrations', {
70
- describe: 'Exclude migrations that should have been applied on previous updates. To be used with --from',
70
+ describe: 'Exclude migrations that should have been applied on previous updates. To be used with --from.',
71
71
  type: 'boolean',
72
72
  default: false,
73
73
  })
@@ -13,12 +13,12 @@ exports.yargsNewCommand = {
13
13
  function withNewOptions(yargs) {
14
14
  return yargs
15
15
  .option('nxWorkspaceRoot', {
16
- describe: 'The folder where the new workspace is going to be created',
16
+ describe: 'The folder where the new workspace is going to be created.',
17
17
  type: 'string',
18
18
  required: true,
19
19
  })
20
20
  .option('interactive', {
21
- describe: 'When false disables interactive input prompts for options',
21
+ describe: 'When false disables interactive input prompts for options.',
22
22
  type: 'boolean',
23
23
  default: true,
24
24
  });
@@ -8,7 +8,7 @@ const logger_1 = require("../../utils/logger");
8
8
  const shared_options_1 = require("../yargs-utils/shared-options");
9
9
  exports.yargsReleaseCommand = {
10
10
  command: 'release',
11
- describe: 'Orchestrate versioning and publishing of applications and libraries',
11
+ describe: 'Orchestrate versioning and publishing of applications and libraries.',
12
12
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
13
13
  .command(releaseCommand)
14
14
  .command(versionCommand)
@@ -29,10 +29,10 @@ exports.yargsReleaseCommand = {
29
29
  type: 'string',
30
30
  alias: 'p',
31
31
  coerce: shared_options_1.parseCSV,
32
- describe: 'Projects to run. (comma/space delimited project names and/or patterns)',
32
+ describe: 'Projects to run. (comma/space delimited project names and/or patterns).',
33
33
  })
34
34
  .option('dry-run', {
35
- describe: 'Preview the changes without updating files/creating releases',
35
+ describe: 'Preview the changes without updating files/creating releases.',
36
36
  alias: 'd',
37
37
  type: 'boolean',
38
38
  default: false,
@@ -40,7 +40,7 @@ exports.yargsReleaseCommand = {
40
40
  // NOTE: The camel case format is required for the coerce() function to be called correctly. It still supports --print-config casing.
41
41
  .option('printConfig', {
42
42
  type: 'string',
43
- describe: 'Print the resolved nx release configuration that would be used for the current command and then exit',
43
+ describe: 'Print the resolved nx release configuration that would be used for the current command and then exit.',
44
44
  coerce: (val) => {
45
45
  if (val === '') {
46
46
  return true;
@@ -72,7 +72,7 @@ exports.yargsReleaseCommand = {
72
72
  };
73
73
  const releaseCommand = {
74
74
  command: '$0 [specifier]',
75
- describe: 'Create a version and release for the workspace, generate a changelog, and optionally publish the packages',
75
+ describe: 'Create a version and release for the workspace, generate a changelog, and optionally publish the packages.',
76
76
  builder: (yargs) => withFirstReleaseOptions(yargs)
77
77
  .positional('specifier', {
78
78
  type: 'string',
@@ -81,11 +81,11 @@ const releaseCommand = {
81
81
  .option('yes', {
82
82
  type: 'boolean',
83
83
  alias: 'y',
84
- description: 'Automatically answer yes to the confirmation prompt for publishing',
84
+ description: 'Automatically answer yes to the confirmation prompt for publishing.',
85
85
  })
86
86
  .option('skip-publish', {
87
87
  type: 'boolean',
88
- description: 'Skip publishing by automatically answering no to the confirmation prompt for publishing',
88
+ description: 'Skip publishing by automatically answering no to the confirmation prompt for publishing.',
89
89
  })
90
90
  .check((argv) => {
91
91
  if (argv.yes !== undefined && argv.skipPublish !== undefined) {
@@ -105,7 +105,7 @@ const releaseCommand = {
105
105
  const versionCommand = {
106
106
  command: 'version [specifier]',
107
107
  aliases: ['v'],
108
- describe: 'Create a version and release for one or more applications and libraries',
108
+ describe: 'Create a version and release for one or more applications and libraries.',
109
109
  builder: (yargs) => withFirstReleaseOptions(withGitCommitAndGitTagOptions(yargs
110
110
  .positional('specifier', {
111
111
  type: 'string',
@@ -113,7 +113,7 @@ const versionCommand = {
113
113
  })
114
114
  .option('preid', {
115
115
  type: 'string',
116
- describe: 'The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor',
116
+ describe: 'The optional prerelease identifier to apply to the version. This will only be applied in the case that the specifier argument has been set to `prerelease` OR when conventional commits are enabled, in which case it will modify the resolved specifier from conventional commits to be its prerelease equivalent. E.g. minor -> preminor.',
117
117
  default: '',
118
118
  })
119
119
  .option('stage-changes', {
@@ -132,32 +132,32 @@ const versionCommand = {
132
132
  const changelogCommand = {
133
133
  command: 'changelog [version]',
134
134
  aliases: ['c'],
135
- describe: 'Generate a changelog for one or more projects, and optionally push to Github',
135
+ describe: 'Generate a changelog for one or more projects, and optionally push to Github.',
136
136
  builder: (yargs) => withFirstReleaseOptions(withGitCommitAndGitTagOptions(yargs
137
137
  // Disable default meaning of yargs version for this command
138
138
  .version(false)
139
139
  .positional('version', {
140
140
  type: 'string',
141
- description: 'The version to create a Github release and changelog for',
141
+ description: 'The version to create a Github release and changelog for.',
142
142
  })
143
143
  .option('from', {
144
144
  type: 'string',
145
- description: 'The git reference to use as the start of the changelog. If not set it will attempt to resolve the latest tag and use that',
145
+ description: 'The git reference to use as the start of the changelog. If not set it will attempt to resolve the latest tag and use that.',
146
146
  })
147
147
  .option('to', {
148
148
  type: 'string',
149
- description: 'The git reference to use as the end of the changelog',
149
+ description: 'The git reference to use as the end of the changelog.',
150
150
  default: 'HEAD',
151
151
  })
152
152
  .option('interactive', {
153
153
  alias: 'i',
154
154
  type: 'string',
155
- description: 'Interactively modify changelog markdown contents in your code editor before applying the changes. You can set it to be interactive for all changelogs, or only the workspace level, or only the project level',
155
+ description: 'Interactively modify changelog markdown contents in your code editor before applying the changes. You can set it to be interactive for all changelogs, or only the workspace level, or only the project level.',
156
156
  choices: ['all', 'workspace', 'projects'],
157
157
  })
158
158
  .option('git-remote', {
159
159
  type: 'string',
160
- description: 'Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing)',
160
+ description: 'Alternate git remote in the form {user}/{repo} on which to create the Github release (useful for testing).',
161
161
  default: 'origin',
162
162
  })
163
163
  .check((argv) => {
@@ -178,15 +178,15 @@ const changelogCommand = {
178
178
  const publishCommand = {
179
179
  command: 'publish',
180
180
  aliases: ['p'],
181
- describe: 'Publish a versioned project to a registry',
181
+ describe: 'Publish a versioned project to a registry.',
182
182
  builder: (yargs) => withFirstReleaseOptions((0, shared_options_1.withRunManyOptions)((0, shared_options_1.withOutputStyleOption)(yargs))
183
183
  .option('registry', {
184
184
  type: 'string',
185
- description: 'The registry to publish to',
185
+ description: 'The registry to publish to.',
186
186
  })
187
187
  .option('tag', {
188
188
  type: 'string',
189
- description: 'The distribution tag to apply to the published package',
189
+ description: 'The distribution tag to apply to the published package.',
190
190
  })
191
191
  .option('access', {
192
192
  type: 'string',
@@ -195,7 +195,7 @@ const publishCommand = {
195
195
  })
196
196
  .option('otp', {
197
197
  type: 'number',
198
- description: 'A one-time password for publishing to a registry that requires 2FA',
198
+ description: 'A one-time password for publishing to a registry that requires 2FA.',
199
199
  })),
200
200
  handler: async (args) => {
201
201
  const status = await (await Promise.resolve().then(() => require('./publish'))).releasePublishCLIHandler(coerceParallelOption((0, shared_options_1.withOverrides)(args, 2)));
@@ -208,7 +208,7 @@ const publishCommand = {
208
208
  const planCommand = {
209
209
  command: 'plan [bump]',
210
210
  aliases: ['pl'],
211
- describe: 'Create a version plan file to specify the desired semver bump for one or more projects or groups, as well as the relevant changelog entry',
211
+ describe: 'Create a version plan file to specify the desired semver bump for one or more projects or groups, as well as the relevant changelog entry.',
212
212
  builder: (yargs) => (0, shared_options_1.withAffectedOptions)(yargs)
213
213
  .positional('bump', {
214
214
  type: 'string',
@@ -226,11 +226,11 @@ const planCommand = {
226
226
  .option('message', {
227
227
  type: 'string',
228
228
  alias: 'm',
229
- describe: 'Custom message to use for the changelog entry',
229
+ describe: 'Custom message to use for the changelog entry.',
230
230
  })
231
231
  .option('onlyTouched', {
232
232
  type: 'boolean',
233
- describe: 'Only include projects that have been affected by the current changes',
233
+ describe: 'Only include projects that have been affected by the current changes.',
234
234
  default: true,
235
235
  }),
236
236
  handler: async (args) => {
@@ -244,7 +244,7 @@ const planCommand = {
244
244
  };
245
245
  const planCheckCommand = {
246
246
  command: 'plan:check',
247
- describe: 'Ensure that all touched projects have an applicable version plan created for them',
247
+ describe: 'Ensure that all touched projects have an applicable version plan created for them.',
248
248
  builder: (yargs) => (0, shared_options_1.withAffectedOptions)(yargs),
249
249
  handler: async (args) => {
250
250
  const release = await Promise.resolve().then(() => require('./plan-check'));
@@ -261,7 +261,7 @@ function coerceParallelOption(args) {
261
261
  function withGitCommitAndGitTagOptions(yargs) {
262
262
  return yargs
263
263
  .option('git-commit', {
264
- describe: 'Whether or not to automatically commit the changes made by this command',
264
+ describe: 'Whether or not to automatically commit the changes made by this command.',
265
265
  type: 'boolean',
266
266
  })
267
267
  .option('git-commit-message', {
@@ -269,11 +269,11 @@ function withGitCommitAndGitTagOptions(yargs) {
269
269
  type: 'string',
270
270
  })
271
271
  .option('git-commit-args', {
272
- describe: 'Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes',
272
+ describe: 'Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes.',
273
273
  type: 'string',
274
274
  })
275
275
  .option('git-tag', {
276
- describe: 'Whether or not to automatically tag the changes made by this command',
276
+ describe: 'Whether or not to automatically tag the changes made by this command.',
277
277
  type: 'boolean',
278
278
  })
279
279
  .option('git-tag-message', {
@@ -281,7 +281,7 @@ function withGitCommitAndGitTagOptions(yargs) {
281
281
  type: 'string',
282
282
  })
283
283
  .option('git-tag-args', {
284
- describe: 'Additional arguments to pass to the `git tag` command invoked behind the scenes',
284
+ describe: 'Additional arguments to pass to the `git tag` command invoked behind the scenes.',
285
285
  type: 'string',
286
286
  })
287
287
  .option('stage-changes', {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.yargsReportCommand = void 0;
4
4
  exports.yargsReportCommand = {
5
5
  command: 'report',
6
- describe: 'Reports useful version numbers to copy into the Nx issue template',
6
+ describe: 'Reports useful version numbers to copy into the Nx issue template.',
7
7
  handler: async () => {
8
8
  await (await Promise.resolve().then(() => require('./report'))).reportHandler();
9
9
  process.exit(0);
@@ -19,7 +19,7 @@ exports.yargsResetCommand = {
19
19
  type: 'boolean',
20
20
  })
21
21
  .option('onlyWorkspaceData', {
22
- description: 'Clears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc)',
22
+ description: 'Clears the workspace data directory. Used by Nx to store cached data about the current workspace (e.g. partial results, incremental data, etc).',
23
23
  type: 'boolean',
24
24
  }),
25
25
  handler: async (argv) => (await Promise.resolve().then(() => require('./reset'))).resetHandler(argv),
@@ -27,7 +27,7 @@ exports.yargsRunCommand = {
27
27
  exports.yargsNxInfixCommand = {
28
28
  ...exports.yargsRunCommand,
29
29
  command: '$0 <target> [project] [_..]',
30
- describe: 'Run a target for a project',
30
+ describe: 'Run a target for a project.',
31
31
  handler: async (args) => {
32
32
  const exitCode = await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
33
33
  // Yargs parses <target> as 'undefined' if running just 'nx'
@@ -6,7 +6,7 @@ const shared_options_1 = require("../yargs-utils/shared-options");
6
6
  const params_1 = require("../../utils/params");
7
7
  exports.yargsRunManyCommand = {
8
8
  command: 'run-many',
9
- describe: 'Run target for multiple listed projects',
9
+ describe: 'Run target for multiple listed projects.',
10
10
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withRunManyOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withTargetAndConfigurationOption)((0, shared_options_1.withBatch)(yargs)))), 'run-many'),
11
11
  handler: async (args) => {
12
12
  const exitCode = await (0, params_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
@@ -6,14 +6,14 @@ const shared_options_1 = require("../yargs-utils/shared-options");
6
6
  const params_1 = require("../../utils/params");
7
7
  exports.yargsShowCommand = {
8
8
  command: 'show',
9
- describe: 'Show information about the workspace (e.g., list of projects)',
9
+ describe: 'Show information about the workspace (e.g., list of projects).',
10
10
  builder: (yargs) => yargs
11
11
  .command(showProjectsCommand)
12
12
  .command(showProjectCommand)
13
13
  .demandCommand()
14
14
  .option('json', {
15
15
  type: 'boolean',
16
- description: 'Output JSON',
16
+ description: 'Output JSON.',
17
17
  })
18
18
  .example('$0 show projects', 'Show a list of all projects in the workspace')
19
19
  .example('$0 show projects --with-target serve', 'Show a list of all projects in the workspace that have a "serve" target')
@@ -25,11 +25,11 @@ exports.yargsShowCommand = {
25
25
  };
26
26
  const showProjectsCommand = {
27
27
  command: 'projects',
28
- describe: 'Show a list of projects in the workspace',
28
+ describe: 'Show a list of projects in the workspace.',
29
29
  builder: (yargs) => (0, shared_options_1.withVerbose)((0, shared_options_1.withAffectedOptions)(yargs))
30
30
  .option('affected', {
31
31
  type: 'boolean',
32
- description: 'Show only affected projects',
32
+ description: 'Show only affected projects.',
33
33
  })
34
34
  .option('projects', {
35
35
  type: 'string',
@@ -40,17 +40,17 @@ const showProjectsCommand = {
40
40
  .option('withTarget', {
41
41
  type: 'string',
42
42
  alias: ['t'],
43
- description: 'Show only projects that have a specific target',
43
+ description: 'Show only projects that have a specific target.',
44
44
  coerce: shared_options_1.parseCSV,
45
45
  })
46
46
  .option('type', {
47
47
  type: 'string',
48
- description: 'Select only projects of the given type',
48
+ description: 'Select only projects of the given type.',
49
49
  choices: ['app', 'lib', 'e2e'],
50
50
  })
51
51
  .option('sep', {
52
52
  type: 'string',
53
- description: 'Outputs projects with the specified seperator',
53
+ description: 'Outputs projects with the specified seperator.',
54
54
  })
55
55
  .implies('untracked', 'affected')
56
56
  .implies('uncommitted', 'affected')
@@ -79,15 +79,15 @@ const showProjectCommand = {
79
79
  .positional('projectName', {
80
80
  type: 'string',
81
81
  alias: 'p',
82
- description: 'Which project should be viewed?',
82
+ description: 'Which project should be viewed?.',
83
83
  })
84
84
  .option('web', {
85
85
  type: 'boolean',
86
- description: 'Show project details in the browser. (default when interactive)',
86
+ description: 'Show project details in the browser. (default when interactive).',
87
87
  })
88
88
  .option('open', {
89
89
  type: 'boolean',
90
- description: 'Set to false to prevent the browser from opening when using --web',
90
+ description: 'Set to false to prevent the browser from opening when using --web.',
91
91
  implies: 'web',
92
92
  })
93
93
  .check((argv) => {
@@ -5,7 +5,7 @@ const documentation_1 = require("../yargs-utils/documentation");
5
5
  const shared_options_1 = require("../yargs-utils/shared-options");
6
6
  exports.yargsWatchCommand = {
7
7
  command: 'watch',
8
- describe: 'Watch for changes within projects, and execute commands',
8
+ describe: 'Watch for changes within projects, and execute commands.',
9
9
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withWatchOptions(yargs), 'watch'),
10
10
  handler: async (args) => {
11
11
  await Promise.resolve().then(() => require('./watch')).then((m) => m.watch(args));
@@ -22,7 +22,7 @@ exports.defaultYargsParserConfiguration = {
22
22
  };
23
23
  function withExcludeOption(yargs) {
24
24
  return yargs.option('exclude', {
25
- describe: 'Exclude certain projects from being processed',
25
+ describe: 'Exclude certain projects from being processed.',
26
26
  type: 'string',
27
27
  coerce: parseCSV,
28
28
  });
@@ -30,7 +30,7 @@ function withExcludeOption(yargs) {
30
30
  function withRunOptions(yargs) {
31
31
  return withVerbose(withExcludeOption(yargs))
32
32
  .option('parallel', {
33
- describe: 'Max number of parallel processes [default is 3]',
33
+ describe: 'Max number of parallel processes [default is 3].',
34
34
  type: 'string',
35
35
  })
36
36
  .option('maxParallel', {
@@ -38,11 +38,11 @@ function withRunOptions(yargs) {
38
38
  hidden: true,
39
39
  })
40
40
  .options('runner', {
41
- describe: 'This is the name of the tasks runner configured in nx.json',
41
+ describe: 'This is the name of the tasks runner configured in nx.json.',
42
42
  type: 'string',
43
43
  })
44
44
  .option('prod', {
45
- describe: 'Use the production configuration',
45
+ describe: 'Use the production configuration.',
46
46
  type: 'boolean',
47
47
  default: false,
48
48
  hidden: true,
@@ -61,22 +61,22 @@ function withRunOptions(yargs) {
61
61
  : value,
62
62
  })
63
63
  .option('nxBail', {
64
- describe: 'Stop command execution after the first failed task',
64
+ describe: 'Stop command execution after the first failed task.',
65
65
  type: 'boolean',
66
66
  default: false,
67
67
  })
68
68
  .option('nxIgnoreCycles', {
69
- describe: 'Ignore cycles in the task graph',
69
+ describe: 'Ignore cycles in the task graph.',
70
70
  type: 'boolean',
71
71
  default: false,
72
72
  })
73
73
  .options('skipNxCache', {
74
- describe: 'Rerun the tasks even when the results are available in the cache',
74
+ describe: 'Rerun the tasks even when the results are available in the cache.',
75
75
  type: 'boolean',
76
76
  default: false,
77
77
  })
78
78
  .options('excludeTaskDependencies', {
79
- describe: 'Skips running dependent tasks first',
79
+ describe: 'Skips running dependent tasks first.',
80
80
  type: 'boolean',
81
81
  default: false,
82
82
  })
@@ -101,7 +101,7 @@ function withRunOptions(yargs) {
101
101
  }
102
102
  function withTargetAndConfigurationOption(yargs, demandOption = true) {
103
103
  return withConfiguration(yargs).option('targets', {
104
- describe: 'Tasks to run for affected projects',
104
+ describe: 'Tasks to run for affected projects.',
105
105
  type: 'string',
106
106
  alias: ['target', 't'],
107
107
  requiresArg: true,
@@ -112,7 +112,7 @@ function withTargetAndConfigurationOption(yargs, demandOption = true) {
112
112
  }
113
113
  function withConfiguration(yargs) {
114
114
  return yargs.options('configuration', {
115
- describe: 'This is the configuration to use when performing tasks on projects',
115
+ describe: 'This is the configuration to use when performing tasks on projects.',
116
116
  type: 'string',
117
117
  alias: 'c',
118
118
  });
@@ -120,7 +120,7 @@ function withConfiguration(yargs) {
120
120
  function withVerbose(yargs) {
121
121
  return yargs
122
122
  .option('verbose', {
123
- describe: 'Prints additional information about the commands (e.g., stack traces)',
123
+ describe: 'Prints additional information about the commands (e.g., stack traces).',
124
124
  type: 'boolean',
125
125
  })
126
126
  .middleware((args) => {
@@ -132,7 +132,7 @@ function withVerbose(yargs) {
132
132
  function withBatch(yargs) {
133
133
  return yargs.options('batch', {
134
134
  type: 'boolean',
135
- describe: 'Run task(s) in batches for executors which support batches',
135
+ describe: 'Run task(s) in batches for executors which support batches.',
136
136
  coerce: (v) => {
137
137
  return v || process.env.NX_BATCH_MODE === 'true';
138
138
  },
@@ -143,26 +143,26 @@ function withAffectedOptions(yargs) {
143
143
  return withExcludeOption(yargs)
144
144
  .parserConfiguration(exports.defaultYargsParserConfiguration)
145
145
  .option('files', {
146
- describe: 'Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces',
146
+ describe: 'Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces.',
147
147
  type: 'string',
148
148
  requiresArg: true,
149
149
  coerce: parseCSV,
150
150
  })
151
151
  .option('uncommitted', {
152
- describe: 'Uncommitted changes',
152
+ describe: 'Uncommitted changes.',
153
153
  type: 'boolean',
154
154
  })
155
155
  .option('untracked', {
156
- describe: 'Untracked changes',
156
+ describe: 'Untracked changes.',
157
157
  type: 'boolean',
158
158
  })
159
159
  .option('base', {
160
- describe: 'Base of the current branch (usually main)',
160
+ describe: 'Base of the current branch (usually main).',
161
161
  type: 'string',
162
162
  requiresArg: true,
163
163
  })
164
164
  .option('head', {
165
- describe: 'Latest commit of the current branch (usually HEAD)',
165
+ describe: 'Latest commit of the current branch (usually HEAD).',
166
166
  type: 'string',
167
167
  requiresArg: true,
168
168
  })
@@ -183,7 +183,7 @@ function withRunManyOptions(yargs) {
183
183
  type: 'string',
184
184
  alias: 'p',
185
185
  coerce: parseCSV,
186
- describe: 'Projects to run. (comma/space delimited project names and/or patterns)',
186
+ describe: 'Projects to run. (comma/space delimited project names and/or patterns).',
187
187
  })
188
188
  .option('all', {
189
189
  describe: '[deprecated] `run-many` runs all targets on all projects in the workspace if no projects are provided. This option is no longer required.',
@@ -224,11 +224,11 @@ function withRunOneOptions(yargs) {
224
224
  const res = withRunOptions(withOutputStyleOption(withConfiguration(yargs), allOutputStyles))
225
225
  .parserConfiguration(exports.defaultYargsParserConfiguration)
226
226
  .option('project', {
227
- describe: 'Target project',
227
+ describe: 'Target project.',
228
228
  type: 'string',
229
229
  })
230
230
  .option('help', {
231
- describe: 'Show Help',
231
+ describe: 'Show Help.',
232
232
  type: 'boolean',
233
233
  });
234
234
  if (executorShouldShowHelp) {
Binary file
@@ -42,18 +42,6 @@ function getNxInitDate() {
42
42
  return null;
43
43
  }
44
44
  }
45
- async function createNxCloudWorkspaceV1(workspaceName, installationSource, nxInitDate) {
46
- const apiUrl = (0, get_cloud_options_1.getCloudUrl)();
47
- const response = await require('axios').post(`${apiUrl}/nx-cloud/create-org-and-workspace`, {
48
- workspaceName,
49
- installationSource,
50
- nxInitDate,
51
- });
52
- if (response.data.message) {
53
- throw new Error(response.data.message);
54
- }
55
- return response.data;
56
- }
57
45
  async function createNxCloudWorkspaceV2(workspaceName, installationSource, nxInitDate) {
58
46
  const apiUrl = (0, get_cloud_options_1.getCloudUrl)();
59
47
  const response = await require('axios').post(`${apiUrl}/nx-cloud/v2/create-org-and-workspace`, {
@@ -81,19 +69,6 @@ async function printSuccessMessage(token, installationSource, usesGithub) {
81
69
  });
82
70
  return connectCloudUrl;
83
71
  }
84
- function addNxCloudOptionsToNxJson(tree, token, directory = '') {
85
- const nxJsonPath = (0, path_1.join)(directory, 'nx.json');
86
- if (tree.exists(nxJsonPath)) {
87
- (0, json_1.updateJson)(tree, (0, path_1.join)(directory, 'nx.json'), (nxJson) => {
88
- const overrideUrl = process.env.NX_CLOUD_API || process.env.NRWL_API;
89
- if (overrideUrl) {
90
- nxJson.nxCloudUrl = overrideUrl;
91
- }
92
- nxJson.nxCloudAccessToken = token;
93
- return nxJson;
94
- });
95
- }
96
- }
97
72
  function addNxCloudIdToNxJson(tree, nxCloudId, directory = '') {
98
73
  const nxJsonPath = (0, path_1.join)(directory, 'nx.json');
99
74
  if (tree.exists(nxJsonPath)) {
@@ -124,22 +99,12 @@ async function connectToNxCloud(tree, schema, nxJson = (0, nx_json_1.readNxJson)
124
99
  isGitHubDetected &&
125
100
  schema.installationSource === 'nx-connect')
126
101
  return null;
127
- if (process.env.NX_ENABLE_LOGIN === 'true') {
128
- responseFromCreateNxCloudWorkspaceV2 = await createNxCloudWorkspaceV2(getRootPackageName(tree), schema.installationSource, getNxInitDate());
129
- addNxCloudIdToNxJson(tree, responseFromCreateNxCloudWorkspaceV2?.nxCloudId, schema.directory);
130
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree, {
131
- silent: schema.hideFormatLogs,
132
- });
133
- return responseFromCreateNxCloudWorkspaceV2.nxCloudId;
134
- }
135
- else {
136
- responseFromCreateNxCloudWorkspaceV1 = await createNxCloudWorkspaceV1(getRootPackageName(tree), schema.installationSource, getNxInitDate());
137
- addNxCloudOptionsToNxJson(tree, responseFromCreateNxCloudWorkspaceV1?.token, schema.directory);
138
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree, {
139
- silent: schema.hideFormatLogs,
140
- });
141
- return responseFromCreateNxCloudWorkspaceV1.token;
142
- }
102
+ responseFromCreateNxCloudWorkspaceV2 = await createNxCloudWorkspaceV2(getRootPackageName(tree), schema.installationSource, getNxInitDate());
103
+ addNxCloudIdToNxJson(tree, responseFromCreateNxCloudWorkspaceV2?.nxCloudId, schema.directory);
104
+ await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree, {
105
+ silent: schema.hideFormatLogs,
106
+ });
107
+ return responseFromCreateNxCloudWorkspaceV2.nxCloudId;
143
108
  }
144
109
  async function connectToNxCloudGenerator(tree, options) {
145
110
  await connectToNxCloud(tree, options);
@@ -10,6 +10,7 @@ export type TaskWithCachedResult = {
10
10
  task: Task;
11
11
  cachedResult: CachedResult;
12
12
  };
13
+ export declare function getCache(options: DefaultTasksRunnerOptions): DbCache | Cache;
13
14
  export declare class DbCache {
14
15
  private readonly options;
15
16
  private cache;
@@ -20,6 +21,7 @@ export declare class DbCache {
20
21
  nxCloudRemoteCache: RemoteCache;
21
22
  });
22
23
  get(task: Task): Promise<CachedResult | null>;
24
+ private applyRemoteCacheResults;
23
25
  put(task: Task, terminalOutput: string | null, outputs: string[], code: number): Promise<void>;
24
26
  copyFilesFromCache(_: string, cachedResult: CachedResult, outputs: string[]): Promise<void>;
25
27
  removeOldCacheRecords(): void;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Cache = exports.DbCache = void 0;
4
+ exports.getCache = getCache;
4
5
  const workspace_root_1 = require("../utils/workspace-root");
5
6
  const fs_extra_1 = require("fs-extra");
6
7
  const path_1 = require("path");
@@ -15,6 +16,16 @@ const nx_cloud_utils_1 = require("../utils/nx-cloud-utils");
15
16
  const nx_json_1 = require("../config/nx-json");
16
17
  const update_manager_1 = require("../nx-cloud/update-manager");
17
18
  const get_cloud_options_1 = require("../nx-cloud/utilities/get-cloud-options");
19
+ function getCache(options) {
20
+ return process.env.NX_DB_CACHE === 'true'
21
+ ? new DbCache({
22
+ // Remove this in Nx 21
23
+ nxCloudRemoteCache: (0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)())
24
+ ? options.remoteCache
25
+ : null,
26
+ })
27
+ : new Cache(options);
28
+ }
18
29
  class DbCache {
19
30
  async setup() {
20
31
  this.remoteCache = await this.getRemoteCache();
@@ -37,7 +48,7 @@ class DbCache {
37
48
  // attempt remote cache
38
49
  const res = await this.remoteCache.retrieve(task.hash, this.cache.cacheDirectory);
39
50
  if (res) {
40
- this.cache.applyRemoteCacheResults(task.hash, res);
51
+ this.applyRemoteCacheResults(task.hash, res);
41
52
  return {
42
53
  ...res,
43
54
  remote: true,
@@ -51,6 +62,9 @@ class DbCache {
51
62
  return null;
52
63
  }
53
64
  }
65
+ applyRemoteCacheResults(hash, res) {
66
+ return this.cache.applyRemoteCacheResults(hash, res);
67
+ }
54
68
  async put(task, terminalOutput, outputs, code) {
55
69
  return tryAndRetry(async () => {
56
70
  this.cache.put(task.hash, terminalOutput, outputs, code);
@@ -15,8 +15,6 @@ const task_env_1 = require("./task-env");
15
15
  const workspace_root_1 = require("../utils/workspace-root");
16
16
  const output_1 = require("../utils/output");
17
17
  const params_1 = require("../utils/params");
18
- const nx_cloud_utils_1 = require("../utils/nx-cloud-utils");
19
- const nx_json_1 = require("../config/nx-json");
20
18
  class TaskOrchestrator {
21
19
  // endregion internal state
22
20
  constructor(hasher, initiatingProject, projectGraph, taskGraph, options, bail, daemon, outputStyle) {
@@ -28,14 +26,7 @@ class TaskOrchestrator {
28
26
  this.bail = bail;
29
27
  this.daemon = daemon;
30
28
  this.outputStyle = outputStyle;
31
- this.cache = process.env.NX_DB_CACHE === 'true'
32
- ? new cache_1.DbCache({
33
- // Remove this in Nx 21
34
- nxCloudRemoteCache: (0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)())
35
- ? this.options.remoteCache
36
- : null,
37
- })
38
- : new cache_1.Cache(this.options);
29
+ this.cache = (0, cache_1.getCache)(this.options);
39
30
  this.forkedProcessTaskRunner = new forked_process_task_runner_1.ForkedProcessTaskRunner(this.options);
40
31
  this.tasksSchedule = new tasks_schedule_1.TasksSchedule(this.projectGraph, this.taskGraph, this.options);
41
32
  // region internal state