nx 19.8.0-canary.20240917-5b34ea5 → 19.8.0-canary.20240919-7f4a877

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/bin/nx-cloud.js +0 -0
  2. package/package.json +17 -17
  3. package/schemas/nx-schema.json +2 -2
  4. package/src/command-line/activate-powerpack/activate-powerpack.d.ts +2 -0
  5. package/src/command-line/activate-powerpack/activate-powerpack.js +32 -0
  6. package/src/command-line/activate-powerpack/command-object.d.ts +6 -0
  7. package/src/command-line/activate-powerpack/command-object.js +26 -0
  8. package/src/command-line/add/command-object.d.ts +1 -1
  9. package/src/command-line/format/format.js +24 -7
  10. package/src/command-line/import/import.js +9 -4
  11. package/src/command-line/import/utils/prepare-source-repo.js +7 -35
  12. package/src/command-line/init/init-v2.d.ts +1 -1
  13. package/src/command-line/init/init-v2.js +10 -4
  14. package/src/command-line/list/list.js +2 -0
  15. package/src/command-line/nx-commands.d.ts +1 -1
  16. package/src/command-line/nx-commands.js +77 -57
  17. package/src/command-line/release/command-object.d.ts +2 -2
  18. package/src/command-line/release/config/config.js +8 -2
  19. package/src/command-line/release/utils/git.d.ts +2 -2
  20. package/src/command-line/release/utils/git.js +12 -2
  21. package/src/command-line/release/utils/shared.d.ts +1 -1
  22. package/src/command-line/release/version.js +4 -0
  23. package/src/command-line/report/report.d.ts +3 -0
  24. package/src/command-line/report/report.js +27 -1
  25. package/src/config/nx-json.d.ts +13 -5
  26. package/src/core/graph/main.js +1 -1
  27. package/src/native/index.d.ts +2 -1
  28. package/src/native/nx.wasm32-wasi.wasm +0 -0
  29. package/src/tasks-runner/cache.d.ts +5 -1
  30. package/src/tasks-runner/cache.js +51 -5
  31. package/src/tasks-runner/init-tasks-runner.d.ts +1 -1
  32. package/src/tasks-runner/init-tasks-runner.js +5 -3
  33. package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.d.ts +0 -2
  34. package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +0 -5
  35. package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +2 -6
  36. package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +2 -6
  37. package/src/tasks-runner/life-cycles/store-run-information-life-cycle.d.ts +2 -7
  38. package/src/tasks-runner/life-cycles/task-profiling-life-cycle.d.ts +2 -7
  39. package/src/tasks-runner/life-cycles/task-results-life-cycle.d.ts +6 -0
  40. package/src/tasks-runner/life-cycles/task-results-life-cycle.js +17 -0
  41. package/src/tasks-runner/life-cycles/task-timings-life-cycle.d.ts +2 -7
  42. package/src/tasks-runner/run-command.d.ts +12 -2
  43. package/src/tasks-runner/run-command.js +52 -59
  44. package/src/tasks-runner/task-orchestrator.d.ts +0 -1
  45. package/src/tasks-runner/task-orchestrator.js +5 -7
  46. package/src/utils/db-connection.d.ts +4 -1
  47. package/src/utils/db-connection.js +15 -4
  48. package/src/utils/git-utils.d.ts +4 -2
  49. package/src/utils/git-utils.index-filter.d.ts +0 -0
  50. package/src/utils/git-utils.index-filter.js +20 -0
  51. package/src/utils/git-utils.js +48 -13
  52. package/src/utils/git-utils.tree-filter.d.ts +11 -0
  53. package/src/utils/git-utils.tree-filter.js +43 -0
  54. package/src/utils/plugins/output.d.ts +1 -0
  55. package/src/utils/plugins/output.js +7 -0
  56. package/src/utils/powerpack.d.ts +5 -0
  57. package/src/utils/powerpack.js +38 -0
package/bin/nx-cloud.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.8.0-canary.20240917-5b34ea5",
3
+ "version": "19.8.0-canary.20240919-7f4a877",
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": {
@@ -8,9 +8,6 @@
8
8
  "url": "https://github.com/nrwl/nx.git",
9
9
  "directory": "packages/nx"
10
10
  },
11
- "scripts": {
12
- "postinstall": "node ./bin/post-install"
13
- },
14
11
  "keywords": [
15
12
  "Monorepo",
16
13
  "Angular",
@@ -71,7 +68,7 @@
71
68
  "yargs-parser": "21.1.1",
72
69
  "node-machine-id": "1.1.12",
73
70
  "ora": "5.3.0",
74
- "@nrwl/tao": "19.8.0-canary.20240917-5b34ea5"
71
+ "@nrwl/tao": "19.8.0-canary.20240919-7f4a877"
75
72
  },
76
73
  "peerDependencies": {
77
74
  "@swc-node/register": "^1.8.0",
@@ -86,16 +83,16 @@
86
83
  }
87
84
  },
88
85
  "optionalDependencies": {
89
- "@nx/nx-darwin-x64": "19.8.0-canary.20240917-5b34ea5",
90
- "@nx/nx-darwin-arm64": "19.8.0-canary.20240917-5b34ea5",
91
- "@nx/nx-linux-x64-gnu": "19.8.0-canary.20240917-5b34ea5",
92
- "@nx/nx-linux-x64-musl": "19.8.0-canary.20240917-5b34ea5",
93
- "@nx/nx-win32-x64-msvc": "19.8.0-canary.20240917-5b34ea5",
94
- "@nx/nx-linux-arm64-gnu": "19.8.0-canary.20240917-5b34ea5",
95
- "@nx/nx-linux-arm64-musl": "19.8.0-canary.20240917-5b34ea5",
96
- "@nx/nx-linux-arm-gnueabihf": "19.8.0-canary.20240917-5b34ea5",
97
- "@nx/nx-win32-arm64-msvc": "19.8.0-canary.20240917-5b34ea5",
98
- "@nx/nx-freebsd-x64": "19.8.0-canary.20240917-5b34ea5"
86
+ "@nx/nx-darwin-x64": "19.8.0-canary.20240919-7f4a877",
87
+ "@nx/nx-darwin-arm64": "19.8.0-canary.20240919-7f4a877",
88
+ "@nx/nx-linux-x64-gnu": "19.8.0-canary.20240919-7f4a877",
89
+ "@nx/nx-linux-x64-musl": "19.8.0-canary.20240919-7f4a877",
90
+ "@nx/nx-win32-x64-msvc": "19.8.0-canary.20240919-7f4a877",
91
+ "@nx/nx-linux-arm64-gnu": "19.8.0-canary.20240919-7f4a877",
92
+ "@nx/nx-linux-arm64-musl": "19.8.0-canary.20240919-7f4a877",
93
+ "@nx/nx-linux-arm-gnueabihf": "19.8.0-canary.20240919-7f4a877",
94
+ "@nx/nx-win32-arm64-msvc": "19.8.0-canary.20240919-7f4a877",
95
+ "@nx/nx-freebsd-x64": "19.8.0-canary.20240919-7f4a877"
99
96
  },
100
97
  "nx-migrations": {
101
98
  "migrations": "./migrations.json",
@@ -192,5 +189,8 @@
192
189
  },
193
190
  "main": "./bin/nx.js",
194
191
  "type": "commonjs",
195
- "types": "./bin/nx.d.ts"
196
- }
192
+ "types": "./bin/nx.d.ts",
193
+ "scripts": {
194
+ "postinstall": "node ./bin/post-install"
195
+ }
196
+ }
@@ -634,7 +634,7 @@
634
634
  "description": "Custom git commit message to use when committing the changes made by this command"
635
635
  },
636
636
  "commitArgs": {
637
- "type": "string",
637
+ "type": ["string", "array"],
638
638
  "description": "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"
639
639
  },
640
640
  "stageChanges": {
@@ -650,7 +650,7 @@
650
650
  "description": "Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself."
651
651
  },
652
652
  "tagArgs": {
653
- "type": "string",
653
+ "type": ["string", "array"],
654
654
  "description": "Additional arguments to pass to the `git tag` command invoked behind the scenes"
655
655
  }
656
656
  }
@@ -0,0 +1,2 @@
1
+ import { ActivatePowerpackOptions } from './command-object';
2
+ export declare function handleActivatePowerpack(options: ActivatePowerpackOptions): Promise<void>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleActivatePowerpack = handleActivatePowerpack;
4
+ const workspace_root_1 = require("../../utils/workspace-root");
5
+ const enquirer_1 = require("enquirer");
6
+ const child_process_1 = require("child_process");
7
+ const package_manager_1 = require("../../utils/package-manager");
8
+ async function handleActivatePowerpack(options) {
9
+ const license = options.license ??
10
+ (await (0, enquirer_1.prompt)({
11
+ type: 'input',
12
+ name: 'license',
13
+ message: 'Enter your License Key',
14
+ }));
15
+ const { activatePowerpack } = await requirePowerpack();
16
+ activatePowerpack(workspace_root_1.workspaceRoot, license);
17
+ }
18
+ async function requirePowerpack() {
19
+ // @ts-ignore
20
+ return Promise.resolve().then(() => require('@nx/powerpack-license')).catch(async (e) => {
21
+ if ('code' in e && e.code === 'MODULE_NOT_FOUND') {
22
+ try {
23
+ (0, child_process_1.execSync)(`${(0, package_manager_1.getPackageManagerCommand)().addDev} @nx/powerpack-license@latest`);
24
+ // @ts-ignore
25
+ return await Promise.resolve().then(() => require('@nx/powerpack-license'));
26
+ }
27
+ catch (e) {
28
+ throw new Error('Failed to install @nx/powerpack-license. Please install @nx/powerpack-license and try again.');
29
+ }
30
+ }
31
+ });
32
+ }
@@ -0,0 +1,6 @@
1
+ import { CommandModule } from 'yargs';
2
+ export interface ActivatePowerpackOptions {
3
+ license: string;
4
+ verbose: boolean;
5
+ }
6
+ export declare const yargsActivatePowerpackCommand: CommandModule<{}, ActivatePowerpackOptions>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.yargsActivatePowerpackCommand = void 0;
4
+ const shared_options_1 = require("../yargs-utils/shared-options");
5
+ const handle_errors_1 = require("../../utils/handle-errors");
6
+ exports.yargsActivatePowerpackCommand = {
7
+ command: 'activate-powerpack <license>',
8
+ describe: false,
9
+ // describe: 'Activate a Nx Powerpack license.',
10
+ builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
11
+ .parserConfiguration({
12
+ 'strip-dashed': true,
13
+ 'unknown-options-as-args': true,
14
+ })
15
+ .positional('license', {
16
+ type: 'string',
17
+ description: 'This is a License Key for Nx Powerpack.',
18
+ })
19
+ .example('$0 activate-powerpack <license key>', 'Activate a Nx Powerpack license'),
20
+ handler: async (args) => {
21
+ const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose, async () => {
22
+ return (await Promise.resolve().then(() => require('./activate-powerpack'))).handleActivatePowerpack(args);
23
+ });
24
+ process.exit(exitCode);
25
+ },
26
+ };
@@ -5,4 +5,4 @@ export interface AddOptions {
5
5
  verbose?: boolean;
6
6
  __overrides_unparsed__: string[];
7
7
  }
8
- export declare const yargsAddCommand: CommandModule<Record<string, unknown>, AddOptions>;
8
+ export declare const yargsAddCommand: CommandModule<{}, AddOptions>;
@@ -7,7 +7,6 @@ const file_utils_1 = require("../../project-graph/file-utils");
7
7
  const command_line_utils_1 = require("../../utils/command-line-utils");
8
8
  const fileutils_1 = require("../../utils/fileutils");
9
9
  const ignore_1 = require("../../utils/ignore");
10
- const prettier = require("prettier");
11
10
  const configuration_1 = require("../../config/configuration");
12
11
  const typescript_1 = require("../../plugins/js/utils/typescript");
13
12
  const affected_project_graph_1 = require("../../project-graph/affected/affected-project-graph");
@@ -18,8 +17,19 @@ const object_sort_1 = require("../../utils/object-sort");
18
17
  const output_1 = require("../../utils/output");
19
18
  const package_json_1 = require("../../utils/package-json");
20
19
  const workspace_root_1 = require("../../utils/workspace-root");
21
- const PRETTIER_PATH = getPrettierPath();
22
20
  async function format(command, args) {
21
+ try {
22
+ require('prettier');
23
+ }
24
+ catch {
25
+ output_1.output.error({
26
+ title: 'Prettier is not installed.',
27
+ bodyLines: [
28
+ `Please install "prettier" and try again, or don't run the "nx format:${command}" command.`,
29
+ ],
30
+ });
31
+ process.exit(1);
32
+ }
23
33
  const { nxArgs } = (0, command_line_utils_1.splitArgsIntoNxArgsAndOverrides)(args, 'affected', { printWarnings: false }, (0, configuration_1.readNxJson)());
24
34
  const patterns = (await getPatterns({ ...args, ...nxArgs })).map(
25
35
  // prettier removes one of the \
@@ -72,7 +82,7 @@ async function getPatterns(args) {
72
82
  }
73
83
  const p = (0, command_line_utils_1.parseFiles)(args);
74
84
  // In prettier v3 the getSupportInfo result is a promise
75
- const supportedExtensions = new Set((await prettier.getSupportInfo()).languages
85
+ const supportedExtensions = new Set((await require('prettier').getSupportInfo()).languages
76
86
  .flatMap((language) => language.extensions)
77
87
  .filter((extension) => !!extension)
78
88
  // Prettier supports ".swcrc" as a file instead of an extension
@@ -131,11 +141,12 @@ function write(patterns) {
131
141
  result[pattern.includes('.swcrc') ? 0 : 1].push(pattern);
132
142
  return result;
133
143
  }, [[], []]);
134
- (0, node_child_process_1.execSync)(`node "${PRETTIER_PATH}" --write --list-different ${regularPatterns.join(' ')}`, {
144
+ const prettierPath = getPrettierPath();
145
+ (0, node_child_process_1.execSync)(`node "${prettierPath}" --write --list-different ${regularPatterns.join(' ')}`, {
135
146
  stdio: [0, 1, 2],
136
147
  });
137
148
  if (swcrcPatterns.length > 0) {
138
- (0, node_child_process_1.execSync)(`node "${PRETTIER_PATH}" --write --list-different ${swcrcPatterns.join(' ')} --parser json`, {
149
+ (0, node_child_process_1.execSync)(`node "${prettierPath}" --write --list-different ${swcrcPatterns.join(' ')} --parser json`, {
139
150
  stdio: [0, 1, 2],
140
151
  });
141
152
  }
@@ -145,8 +156,9 @@ async function check(patterns) {
145
156
  if (patterns.length === 0) {
146
157
  return [];
147
158
  }
159
+ const prettierPath = getPrettierPath();
148
160
  return new Promise((resolve) => {
149
- (0, node_child_process_1.exec)(`node "${PRETTIER_PATH}" --list-different ${patterns.join(' ')}`, { encoding: 'utf-8' }, (error, stdout) => {
161
+ (0, node_child_process_1.exec)(`node "${prettierPath}" --list-different ${patterns.join(' ')}`, { encoding: 'utf-8' }, (error, stdout) => {
150
162
  if (error) {
151
163
  // The command failed so there are files with different formatting. Prettier writes them to stdout, newline separated.
152
164
  resolve(stdout.trim().split('\n'));
@@ -170,7 +182,12 @@ function sortTsConfig() {
170
182
  // catch noop
171
183
  }
172
184
  }
185
+ let prettierPath;
173
186
  function getPrettierPath() {
187
+ if (prettierPath) {
188
+ return prettierPath;
189
+ }
174
190
  const { bin } = (0, package_json_1.readModulePackageJson)('prettier').packageJson;
175
- return require.resolve(path.join('prettier', bin));
191
+ prettierPath = require.resolve(path.join('prettier', bin));
192
+ return prettierPath;
176
193
  }
@@ -25,7 +25,12 @@ const needs_install_1 = require("./utils/needs-install");
25
25
  const file_utils_1 = require("../../project-graph/file-utils");
26
26
  const importRemoteName = '__tmp_nx_import__';
27
27
  async function importHandler(options) {
28
+ process.env.NX_RUNNING_NX_IMPORT = 'true';
28
29
  let { sourceRepository, ref, source, destination } = options;
30
+ const destinationGitClient = new git_utils_1.GitRepository(process.cwd());
31
+ if (await destinationGitClient.hasUncommittedChanges()) {
32
+ throw new Error(`You have uncommitted changes in the destination repository. Commit or revert the changes and try again.`);
33
+ }
29
34
  output_1.output.log({
30
35
  title: 'Nx will walk you through the process of importing code from the source repository into this repository:',
31
36
  bodyLines: [
@@ -120,7 +125,6 @@ async function importHandler(options) {
120
125
  throw new Error(`The destination directory must be a relative path in this repository.`);
121
126
  }
122
127
  const absDestination = (0, path_1.join)(process.cwd(), destination);
123
- const destinationGitClient = new git_utils_1.GitRepository(process.cwd());
124
128
  await assertDestinationEmpty(destinationGitClient, absDestination);
125
129
  const tempImportBranch = getTempImportBranch(ref);
126
130
  await sourceGitClient.addFetchRemote(importRemoteName, ref);
@@ -152,7 +156,7 @@ async function importHandler(options) {
152
156
  const pmc = (0, package_manager_1.getPackageManagerCommand)();
153
157
  const nxJson = (0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot);
154
158
  (0, workspace_context_1.resetWorkspaceContext)();
155
- const { plugins, updatePackageScripts } = await (0, init_v2_1.detectPlugins)(nxJson, options.interactive);
159
+ const { plugins, updatePackageScripts } = await (0, init_v2_1.detectPlugins)(nxJson, options.interactive, true);
156
160
  if (packageManager !== sourcePackageManager) {
157
161
  output_1.output.warn({
158
162
  title: `Mismatched package managers`,
@@ -232,8 +236,9 @@ async function importHandler(options) {
232
236
  title: `Merging these changes into ${(0, command_line_utils_1.getBaseRef)(nxJson)}`,
233
237
  bodyLines: [
234
238
  `MERGE these changes when merging these changes.`,
235
- `Do NOT squash and do NOT rebase these changes when merging these changes.`,
236
- `If you would like to UNDO these changes, run "git reset HEAD~1 --hard"`,
239
+ `Do NOT squash these commits when merging these changes.`,
240
+ `If you rebase, make sure to use "--rebase-merges" to preserve merge commits.`,
241
+ `To UNDO these changes, run "git reset HEAD~1 --hard"`,
237
242
  ],
238
243
  });
239
244
  }
@@ -3,46 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prepareSourceRepo = prepareSourceRepo;
4
4
  const createSpinner = require("ora");
5
5
  const path_1 = require("path");
6
- const promises_1 = require("node:fs/promises");
7
6
  async function prepareSourceRepo(gitClient, ref, source, relativeDestination, tempImportBranch, sourceRemoteUrl) {
8
7
  const spinner = createSpinner().start(`Fetching ${ref} from ${sourceRemoteUrl}`);
9
8
  const relativeSourceDir = (0, path_1.relative)(gitClient.root, (0, path_1.join)(gitClient.root, source));
10
- if (relativeSourceDir !== '') {
11
- if (await gitClient.hasFilterRepoInstalled()) {
12
- spinner.start(`Filtering git history to only include files in ${relativeSourceDir}`);
13
- await gitClient.filterRepo(relativeSourceDir);
14
- }
15
- else {
16
- spinner.start(`Filtering git history to only include files in ${relativeSourceDir} (this might take a few minutes -- install git-filter-repo for faster performance)`);
17
- await gitClient.filterBranch(relativeSourceDir, tempImportBranch);
18
- }
19
- spinner.succeed(`Filtered git history to only include files in ${relativeSourceDir}`);
9
+ if (await gitClient.hasFilterRepoInstalled()) {
10
+ spinner.start(`Filtering git history to only include files in ${relativeSourceDir}`);
11
+ await gitClient.filterRepo(relativeSourceDir, relativeDestination);
20
12
  }
21
- const destinationInSource = (0, path_1.join)(gitClient.root, relativeDestination);
22
- spinner.start(`Moving files and git history to ${destinationInSource}`);
23
- // The result of filter-branch will contain only the files in the subdirectory at its root.
24
- const files = await gitClient.getGitFiles('.');
25
- try {
26
- await (0, promises_1.rm)(destinationInSource, {
27
- recursive: true,
28
- });
13
+ else {
14
+ spinner.start(`Filtering git history to only include files in ${relativeSourceDir} (this might take a few minutes -- install git-filter-repo for faster performance)`);
15
+ await gitClient.filterBranch(relativeSourceDir, relativeDestination, tempImportBranch);
29
16
  }
30
- catch { }
31
- await (0, promises_1.mkdir)(destinationInSource, { recursive: true });
32
- for (const file of files) {
33
- spinner.start(`Moving files and git history to ${destinationInSource}: ${file}`);
34
- const newPath = (0, path_1.join)(destinationInSource, file);
35
- await (0, promises_1.mkdir)((0, path_1.dirname)(newPath), { recursive: true });
36
- try {
37
- await gitClient.move(file, newPath);
38
- }
39
- catch {
40
- await wait(100);
41
- await gitClient.move(file, newPath);
42
- }
43
- }
44
- await gitClient.commit(`chore(repo): move ${source} to ${relativeDestination} to prepare to be imported`);
45
- await gitClient.amendCommit();
17
+ spinner.succeed(`Filtered git history to only include files in ${relativeSourceDir}`);
46
18
  spinner.succeed(`${sourceRemoteUrl} has been prepared to be imported into this workspace on a temporary branch: ${tempImportBranch} in ${gitClient.root}`);
47
19
  }
48
20
  function wait(ms) {
@@ -8,7 +8,7 @@ export interface InitArgs {
8
8
  }
9
9
  export declare function installPlugins(repoRoot: string, plugins: string[], pmc: PackageManagerCommands, updatePackageScripts: boolean): void;
10
10
  export declare function initHandler(options: InitArgs): Promise<void>;
11
- export declare function detectPlugins(nxJson: NxJsonConfiguration, interactive: boolean): Promise<{
11
+ export declare function detectPlugins(nxJson: NxJsonConfiguration, interactive: boolean, includeAngularCli?: boolean): Promise<{
12
12
  plugins: string[];
13
13
  updatePackageScripts: boolean;
14
14
  }>;
@@ -127,8 +127,8 @@ const npmPackageToPluginMap = {
127
127
  'react-native': '@nx/react-native',
128
128
  '@remix-run/dev': '@nx/remix',
129
129
  };
130
- async function detectPlugins(nxJson, interactive) {
131
- let files = ['package.json'].concat(await (0, workspace_context_1.globWithWorkspaceContext)(process.cwd(), ['**/*/package.json']));
130
+ async function detectPlugins(nxJson, interactive, includeAngularCli) {
131
+ let files = ['package.json'].concat((0, workspace_context_1.globWithWorkspaceContextSync)(process.cwd(), ['**/*/package.json']));
132
132
  const currentPlugins = new Set((nxJson.plugins ?? []).map((p) => {
133
133
  const plugin = typeof p === 'string' ? p : p.plugin;
134
134
  return (0, get_package_name_from_import_path_1.getPackageNameFromImportPath)(plugin);
@@ -149,13 +149,19 @@ async function detectPlugins(nxJson, interactive) {
149
149
  ...packageJson.dependencies,
150
150
  ...packageJson.devDependencies,
151
151
  };
152
- for (const [dep, plugin] of Object.entries(npmPackageToPluginMap)) {
152
+ const _npmPackageToPluginMap = {
153
+ ...npmPackageToPluginMap,
154
+ };
155
+ if (includeAngularCli) {
156
+ _npmPackageToPluginMap['@angular/cli'] = '@nx/angular';
157
+ }
158
+ for (const [dep, plugin] of Object.entries(_npmPackageToPluginMap)) {
153
159
  if (deps[dep]) {
154
160
  detectedPlugins.add(plugin);
155
161
  }
156
162
  }
157
163
  }
158
- let gradlewFiles = ['gradlew', 'gradlew.bat'].concat(await (0, workspace_context_1.globWithWorkspaceContext)(process.cwd(), [
164
+ let gradlewFiles = ['gradlew', 'gradlew.bat'].concat((0, workspace_context_1.globWithWorkspaceContextSync)(process.cwd(), [
159
165
  '**/gradlew',
160
166
  '**/gradlew.bat',
161
167
  ]));
@@ -6,6 +6,7 @@ const project_graph_1 = require("../../project-graph/project-graph");
6
6
  const output_1 = require("../../utils/output");
7
7
  const plugins_1 = require("../../utils/plugins");
8
8
  const workspace_root_1 = require("../../utils/workspace-root");
9
+ const output_2 = require("../../utils/plugins/output");
9
10
  /**
10
11
  * List available plugins or capabilities within a specific plugin
11
12
  *
@@ -29,6 +30,7 @@ async function listHandler(args) {
29
30
  }
30
31
  (0, plugins_1.listPlugins)(installedPlugins, 'Installed plugins:');
31
32
  (0, plugins_1.listAlsoAvailableCorePlugins)(installedPlugins);
33
+ (0, output_2.listPowerpackPlugins)();
32
34
  output_1.output.note({
33
35
  title: 'Community Plugins',
34
36
  bodyLines: [
@@ -7,4 +7,4 @@ export declare const parserConfiguration: Partial<yargs.ParserConfigurationOptio
7
7
  * from the `.argv` call, so the object and it's relative scripts can
8
8
  * le executed correctly.
9
9
  */
10
- export declare const commandsObject: yargs.Argv<{}>;
10
+ export declare const commandsObject: yargs.Argv<unknown>;
@@ -3,31 +3,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.commandsObject = exports.parserConfiguration = void 0;
4
4
  const chalk = require("chalk");
5
5
  const yargs = require("yargs");
6
- const command_object_1 = require("./affected/command-object");
7
- const command_object_2 = require("./connect/command-object");
8
- const command_object_3 = require("./daemon/command-object");
9
- const command_object_4 = require("./graph/command-object");
10
- const command_object_5 = require("./exec/command-object");
11
- const command_object_6 = require("./format/command-object");
12
- const command_object_7 = require("./generate/command-object");
13
- const command_object_8 = require("./import/command-object");
14
- const command_object_9 = require("./init/command-object");
15
- const command_object_10 = require("./list/command-object");
16
- const command_object_11 = require("./migrate/command-object");
17
- const command_object_12 = require("./new/command-object");
18
- const command_object_13 = require("./repair/command-object");
19
- const command_object_14 = require("./report/command-object");
20
- const command_object_15 = require("./run/command-object");
21
- const command_object_16 = require("./run-many/command-object");
22
- const command_object_17 = require("./show/command-object");
23
- const command_object_18 = require("./watch/command-object");
24
- const command_object_19 = require("./reset/command-object");
25
- const command_object_20 = require("./release/command-object");
26
- const command_object_21 = require("./add/command-object");
27
- const command_object_22 = require("./login/command-object");
28
- const command_object_23 = require("./logout/command-object");
6
+ const command_object_1 = require("./activate-powerpack/command-object");
7
+ const command_object_2 = require("./affected/command-object");
8
+ const command_object_3 = require("./connect/command-object");
9
+ const command_object_4 = require("./daemon/command-object");
10
+ const command_object_5 = require("./graph/command-object");
11
+ const command_object_6 = require("./exec/command-object");
12
+ const command_object_7 = require("./format/command-object");
13
+ const command_object_8 = require("./generate/command-object");
14
+ const command_object_9 = require("./import/command-object");
15
+ const command_object_10 = require("./init/command-object");
16
+ const command_object_11 = require("./list/command-object");
17
+ const command_object_12 = require("./migrate/command-object");
18
+ const command_object_13 = require("./new/command-object");
19
+ const command_object_14 = require("./repair/command-object");
20
+ const command_object_15 = require("./report/command-object");
21
+ const command_object_16 = require("./run/command-object");
22
+ const command_object_17 = require("./run-many/command-object");
23
+ const command_object_18 = require("./show/command-object");
24
+ const command_object_19 = require("./watch/command-object");
25
+ const command_object_20 = require("./reset/command-object");
26
+ const command_object_21 = require("./release/command-object");
27
+ const command_object_22 = require("./add/command-object");
28
+ const command_object_23 = require("./login/command-object");
29
+ const command_object_24 = require("./logout/command-object");
29
30
  const command_objects_1 = require("./deprecated/command-objects");
30
- const command_object_24 = require("./sync/command-object");
31
+ const command_object_25 = require("./sync/command-object");
31
32
  // Ensure that the output takes up the available width of the terminal.
32
33
  yargs.wrap(yargs.terminalWidth());
33
34
  exports.parserConfiguration = {
@@ -44,44 +45,63 @@ exports.commandsObject = yargs
44
45
  .parserConfiguration(exports.parserConfiguration)
45
46
  .usage(chalk.bold('Smart Monorepos · Fast CI'))
46
47
  .demandCommand(1, '')
47
- .command(command_object_21.yargsAddCommand)
48
- .command(command_object_1.yargsAffectedBuildCommand)
49
- .command(command_object_1.yargsAffectedCommand)
50
- .command(command_object_1.yargsAffectedE2ECommand)
51
- .command(command_object_1.yargsAffectedLintCommand)
52
- .command(command_object_1.yargsAffectedTestCommand)
48
+ .command(command_object_1.yargsActivatePowerpackCommand)
49
+ .command(command_object_22.yargsAddCommand)
50
+ .command(command_object_2.yargsAffectedBuildCommand)
51
+ .command(command_object_2.yargsAffectedCommand)
52
+ .command(command_object_2.yargsAffectedE2ECommand)
53
+ .command(command_object_2.yargsAffectedLintCommand)
54
+ .command(command_object_2.yargsAffectedTestCommand)
53
55
  .command(command_objects_1.yargsAffectedGraphCommand)
54
- .command(command_object_2.yargsConnectCommand)
55
- .command(command_object_3.yargsDaemonCommand)
56
- .command(command_object_4.yargsGraphCommand)
57
- .command(command_object_5.yargsExecCommand)
58
- .command(command_object_6.yargsFormatCheckCommand)
59
- .command(command_object_6.yargsFormatWriteCommand)
60
- .command(command_object_7.yargsGenerateCommand)
61
- .command(command_object_8.yargsImportCommand)
62
- .command(command_object_9.yargsInitCommand)
63
- .command(command_object_11.yargsInternalMigrateCommand)
64
- .command(command_object_10.yargsListCommand)
65
- .command(command_object_11.yargsMigrateCommand)
66
- .command(command_object_12.yargsNewCommand)
56
+ .command(command_object_3.yargsConnectCommand)
57
+ .command(command_object_4.yargsDaemonCommand)
58
+ .command(command_object_5.yargsGraphCommand)
59
+ .command(command_object_6.yargsExecCommand)
60
+ .command(command_object_7.yargsFormatCheckCommand)
61
+ .command(command_object_7.yargsFormatWriteCommand)
62
+ .command(command_object_8.yargsGenerateCommand)
63
+ .command(command_object_9.yargsImportCommand)
64
+ .command(command_object_10.yargsInitCommand)
65
+ .command(command_object_12.yargsInternalMigrateCommand)
66
+ .command(command_object_11.yargsListCommand)
67
+ .command(command_object_12.yargsMigrateCommand)
68
+ .command(command_object_13.yargsNewCommand)
67
69
  .command(command_objects_1.yargsPrintAffectedCommand)
68
- .command(command_object_20.yargsReleaseCommand)
69
- .command(command_object_13.yargsRepairCommand)
70
- .command(command_object_14.yargsReportCommand)
71
- .command(command_object_19.yargsResetCommand)
72
- .command(command_object_15.yargsRunCommand)
73
- .command(command_object_16.yargsRunManyCommand)
74
- .command(command_object_17.yargsShowCommand)
75
- .command(command_object_24.yargsSyncCommand)
76
- .command(command_object_24.yargsSyncCheckCommand)
77
- .command(command_object_2.yargsViewLogsCommand)
78
- .command(command_object_18.yargsWatchCommand)
79
- .command(command_object_15.yargsNxInfixCommand)
80
- .command(command_object_22.yargsLoginCommand)
81
- .command(command_object_23.yargsLogoutCommand)
70
+ .command(command_object_21.yargsReleaseCommand)
71
+ .command(command_object_14.yargsRepairCommand)
72
+ .command(command_object_15.yargsReportCommand)
73
+ .command(command_object_20.yargsResetCommand)
74
+ .command(command_object_16.yargsRunCommand)
75
+ .command(command_object_17.yargsRunManyCommand)
76
+ .command(command_object_18.yargsShowCommand)
77
+ .command(command_object_25.yargsSyncCommand)
78
+ .command(command_object_25.yargsSyncCheckCommand)
79
+ .command(command_object_3.yargsViewLogsCommand)
80
+ .command(command_object_19.yargsWatchCommand)
81
+ .command(command_object_16.yargsNxInfixCommand)
82
+ .command(command_object_23.yargsLoginCommand)
83
+ .command(command_object_24.yargsLogoutCommand)
84
+ .command(resolveConformanceCommandObject())
82
85
  .scriptName('nx')
83
86
  .help()
84
87
  // NOTE: we handle --version in nx.ts, this just tells yargs that the option exists
85
88
  // so that it shows up in help. The default yargs implementation of --version is not
86
89
  // hit, as the implementation in nx.ts is hit first and calls process.exit(0).
87
90
  .version();
91
+ function resolveConformanceCommandObject() {
92
+ try {
93
+ const { yargsConformanceCommand } = require('@nx/powerpack-conformance');
94
+ return yargsConformanceCommand;
95
+ }
96
+ catch (e) {
97
+ return {
98
+ command: 'conformance',
99
+ // Hide from --help output in the common case of not having the plugin installed
100
+ describe: false,
101
+ handler: () => {
102
+ // TODO: Add messaging to help with learning more about powerpack and conformance
103
+ process.exit(1);
104
+ },
105
+ };
106
+ }
107
+ }
@@ -14,10 +14,10 @@ interface GitCommitAndTagOptions {
14
14
  stageChanges?: boolean;
15
15
  gitCommit?: boolean;
16
16
  gitCommitMessage?: string;
17
- gitCommitArgs?: string;
17
+ gitCommitArgs?: string | string[];
18
18
  gitTag?: boolean;
19
19
  gitTagMessage?: string;
20
- gitTagArgs?: string;
20
+ gitTagArgs?: string | string[];
21
21
  }
22
22
  export type VersionOptions = NxReleaseArgs & GitCommitAndTagOptions & VersionPlanArgs & FirstReleaseArgs & {
23
23
  specifier?: string;
@@ -155,6 +155,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
155
155
  conventionalCommits: false,
156
156
  generator: '@nx/js:release-version',
157
157
  generatorOptions: {},
158
+ groupPreVersionCommand: '',
158
159
  },
159
160
  changelog: {
160
161
  createRelease: false,
@@ -206,7 +207,9 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
206
207
  WORKSPACE_DEFAULTS.versionPlans);
207
208
  const rootConventionalCommitsConfig = deepMergeDefaults([WORKSPACE_DEFAULTS.conventionalCommits], fillUnspecifiedConventionalCommitsProperties(normalizeConventionalCommitsConfig(userConfig.conventionalCommits)));
208
209
  // these options are not supported at the group level, only the root/command level
209
- const rootVersionWithoutGlobalOptions = { ...rootVersionConfig };
210
+ const rootVersionWithoutGlobalOptions = {
211
+ ...rootVersionConfig,
212
+ };
210
213
  delete rootVersionWithoutGlobalOptions.git;
211
214
  delete rootVersionWithoutGlobalOptions.preVersionCommand;
212
215
  // Apply conventionalCommits shorthand to the final group defaults if explicitly configured in the original user config
@@ -316,7 +319,10 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
316
319
  projects: matchingProjects,
317
320
  version: deepMergeDefaults(
318
321
  // First apply any group level defaults, then apply actual root level config, then group level config
319
- [GROUP_DEFAULTS.version, rootVersionWithoutGlobalOptions], releaseGroup.version),
322
+ [
323
+ GROUP_DEFAULTS.version,
324
+ { ...rootVersionWithoutGlobalOptions, groupPreVersionCommand: '' },
325
+ ], releaseGroup.version),
320
326
  // If the user has set any changelog config at all, including at the root level, then use one set of defaults, otherwise default to false for the whole feature
321
327
  changelog: releaseGroup.changelog || rootChangelogConfig.projectChangelogs
322
328
  ? deepMergeDefaults(groupChangelogDefaults, releaseGroup.changelog || {})
@@ -37,7 +37,7 @@ export declare function gitAdd({ changedFiles, deletedFiles, dryRun, verbose, lo
37
37
  }): Promise<string>;
38
38
  export declare function gitCommit({ messages, additionalArgs, dryRun, verbose, logFn, }: {
39
39
  messages: string[];
40
- additionalArgs?: string;
40
+ additionalArgs?: string | string[];
41
41
  dryRun?: boolean;
42
42
  verbose?: boolean;
43
43
  logFn?: (message: string) => void;
@@ -45,7 +45,7 @@ export declare function gitCommit({ messages, additionalArgs, dryRun, verbose, l
45
45
  export declare function gitTag({ tag, message, additionalArgs, dryRun, verbose, logFn, }: {
46
46
  tag: string;
47
47
  message?: string;
48
- additionalArgs?: string;
48
+ additionalArgs?: string | string[];
49
49
  dryRun?: boolean;
50
50
  verbose?: boolean;
51
51
  logFn?: (message: string) => void;