nx 18.2.0-canary.20240316-b69047e → 18.2.0-canary.20240320-64b2396

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "18.2.0-canary.20240316-b69047e",
3
+ "version": "18.2.0-canary.20240320-64b2396",
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": {
@@ -66,7 +66,7 @@
66
66
  "yargs-parser": "21.1.1",
67
67
  "node-machine-id": "1.1.12",
68
68
  "ora": "5.3.0",
69
- "@nrwl/tao": "18.2.0-canary.20240316-b69047e"
69
+ "@nrwl/tao": "18.2.0-canary.20240320-64b2396"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@swc-node/register": "^1.8.0",
@@ -81,16 +81,16 @@
81
81
  }
82
82
  },
83
83
  "optionalDependencies": {
84
- "@nx/nx-darwin-x64": "18.2.0-canary.20240316-b69047e",
85
- "@nx/nx-darwin-arm64": "18.2.0-canary.20240316-b69047e",
86
- "@nx/nx-linux-x64-gnu": "18.2.0-canary.20240316-b69047e",
87
- "@nx/nx-linux-x64-musl": "18.2.0-canary.20240316-b69047e",
88
- "@nx/nx-win32-x64-msvc": "18.2.0-canary.20240316-b69047e",
89
- "@nx/nx-linux-arm64-gnu": "18.2.0-canary.20240316-b69047e",
90
- "@nx/nx-linux-arm64-musl": "18.2.0-canary.20240316-b69047e",
91
- "@nx/nx-linux-arm-gnueabihf": "18.2.0-canary.20240316-b69047e",
92
- "@nx/nx-win32-arm64-msvc": "18.2.0-canary.20240316-b69047e",
93
- "@nx/nx-freebsd-x64": "18.2.0-canary.20240316-b69047e"
84
+ "@nx/nx-darwin-x64": "18.2.0-canary.20240320-64b2396",
85
+ "@nx/nx-darwin-arm64": "18.2.0-canary.20240320-64b2396",
86
+ "@nx/nx-linux-x64-gnu": "18.2.0-canary.20240320-64b2396",
87
+ "@nx/nx-linux-x64-musl": "18.2.0-canary.20240320-64b2396",
88
+ "@nx/nx-win32-x64-msvc": "18.2.0-canary.20240320-64b2396",
89
+ "@nx/nx-linux-arm64-gnu": "18.2.0-canary.20240320-64b2396",
90
+ "@nx/nx-linux-arm64-musl": "18.2.0-canary.20240320-64b2396",
91
+ "@nx/nx-linux-arm-gnueabihf": "18.2.0-canary.20240320-64b2396",
92
+ "@nx/nx-win32-arm64-msvc": "18.2.0-canary.20240320-64b2396",
93
+ "@nx/nx-freebsd-x64": "18.2.0-canary.20240320-64b2396"
94
94
  },
95
95
  "nx-migrations": {
96
96
  "migrations": "./migrations.json",
@@ -1,2 +1,2 @@
1
- export declare const allowedProjectExtensions: readonly ["tags", "implicitDependencies", "configFilePath", "$schema", "generators", "namedInputs", "name", "files", "root", "sourceRoot", "projectType", "release", "includedScripts"];
1
+ export declare const allowedProjectExtensions: readonly ["tags", "implicitDependencies", "configFilePath", "$schema", "generators", "namedInputs", "name", "files", "root", "sourceRoot", "projectType", "release", "includedScripts", "metadata"];
2
2
  export declare const allowedWorkspaceExtensions: readonly ["implicitDependencies", "affected", "defaultBase", "tasksRunnerOptions", "workspaceLayout", "plugins", "targetDefaults", "files", "generators", "namedInputs", "extends", "cli", "pluginsConfig", "defaultProject", "installation", "release", "nxCloudAccessToken", "nxCloudUrl", "nxCloudEncryptionKey", "parallel", "cacheDirectory", "useDaemonProcess", "useInferencePlugins"];
@@ -28,6 +28,7 @@ exports.allowedProjectExtensions = [
28
28
  'projectType',
29
29
  'release',
30
30
  'includedScripts',
31
+ 'metadata',
31
32
  ];
32
33
  // If we pass props on the workspace that angular doesn't know about,
33
34
  // it throws a warning that users see. We want to pass them still,
@@ -55,7 +55,7 @@ async function installPackage(pkgName, version) {
55
55
  nxJson.installation.plugins[pkgName] = version;
56
56
  (0, fileutils_1.writeJsonFile)('nx.json', nxJson);
57
57
  try {
58
- await (0, child_process_2.runNxAsync)('');
58
+ await (0, child_process_2.runNxAsync)('--help');
59
59
  }
60
60
  catch (e) {
61
61
  // revert adding the plugin to nx.json
@@ -32,6 +32,12 @@ async function initHandler(options) {
32
32
  console.log('Setting Nx up installation in `.nx`. You can run Nx commands like: `./nx.bat --help`');
33
33
  }
34
34
  (0, add_nx_scripts_1.generateDotNxSetup)(version);
35
+ const { plugins } = await detectPlugins();
36
+ plugins.forEach((plugin) => {
37
+ (0, child_process_2.execSync)(`./nx add ${plugin}`, {
38
+ stdio: 'inherit',
39
+ });
40
+ });
35
41
  // invokes the wrapper, thus invoking the initial installation process
36
42
  (0, child_process_1.runNxSync)('--version', { stdio: 'ignore' });
37
43
  return;
@@ -146,6 +152,9 @@ async function detectPlugins() {
146
152
  }
147
153
  }
148
154
  }
155
+ if ((0, fs_1.existsSync)('gradlew') || (0, fs_1.existsSync)('gradlew.bat')) {
156
+ detectedPlugins.add('@nx/gradle');
157
+ }
149
158
  const plugins = Array.from(detectedPlugins);
150
159
  if (plugins.length === 0)
151
160
  return undefined;
@@ -166,24 +175,22 @@ async function detectPlugins() {
166
175
  ]).then((r) => r.plugins);
167
176
  if (pluginsToInstall?.length === 0)
168
177
  return undefined;
169
- const updatePackageScripts = await (0, enquirer_1.prompt)([
170
- {
171
- name: 'updatePackageScripts',
172
- type: 'autocomplete',
173
- message: `Do you want to start using Nx in your package.json scripts?`,
174
- choices: [
175
- {
176
- name: 'Yes',
177
- },
178
- {
179
- name: 'No',
180
- },
181
- ],
182
- initial: 0,
183
- },
184
- ]).then((r) => r.updatePackageScripts === 'Yes');
185
- return {
186
- plugins: pluginsToInstall,
187
- updatePackageScripts,
188
- };
178
+ const updatePackageScripts = (0, fs_1.existsSync)('package.json') &&
179
+ (await (0, enquirer_1.prompt)([
180
+ {
181
+ name: 'updatePackageScripts',
182
+ type: 'autocomplete',
183
+ message: `Do you want to start using Nx in your package.json scripts?`,
184
+ choices: [
185
+ {
186
+ name: 'Yes',
187
+ },
188
+ {
189
+ name: 'No',
190
+ },
191
+ ],
192
+ initial: 0,
193
+ },
194
+ ]).then((r) => r.updatePackageScripts === 'Yes'));
195
+ return { plugins: pluginsToInstall, updatePackageScripts };
189
196
  }
@@ -10,6 +10,7 @@ const configuration_1 = require("../../config/configuration");
10
10
  const async_iterator_1 = require("../../utils/async-iterator");
11
11
  const executor_utils_1 = require("./executor-utils");
12
12
  const pseudo_terminal_1 = require("../../tasks-runner/pseudo-terminal");
13
+ const child_process_1 = require("child_process");
13
14
  function printRunHelp(opts, schema, plugin) {
14
15
  (0, print_help_1.printHelp)(`run ${opts.project}:${opts.target}`, schema, {
15
16
  mode: 'run',
@@ -66,13 +67,22 @@ async function printTargetRunHelpInternal({ project, target }, root, projectsCon
66
67
  executor === 'run-commands' &&
67
68
  targetConfig.options.command) {
68
69
  const command = targetConfig.options.command.split(' ')[0];
69
- const terminal = (0, pseudo_terminal_1.getPseudoTerminal)();
70
- await new Promise(() => {
71
- const cp = terminal.runCommand(`${command} --help`);
72
- cp.onExit((code) => {
70
+ const helpCommand = `${command} --help`;
71
+ if (pseudo_terminal_1.PseudoTerminal.isSupported()) {
72
+ const terminal = (0, pseudo_terminal_1.getPseudoTerminal)();
73
+ await new Promise(() => {
74
+ const cp = terminal.runCommand(helpCommand);
75
+ cp.onExit((code) => {
76
+ process.exit(code);
77
+ });
78
+ });
79
+ }
80
+ else {
81
+ const cp = (0, child_process_1.exec)(helpCommand);
82
+ cp.on('exit', (code) => {
73
83
  process.exit(code);
74
84
  });
75
- });
85
+ }
76
86
  }
77
87
  else {
78
88
  process.exit(0);
@@ -99,6 +99,10 @@ export interface ProjectConfiguration {
99
99
  release?: {
100
100
  version?: Pick<NxReleaseVersionConfiguration, 'generator' | 'generatorOptions'>;
101
101
  };
102
+ metadata?: {
103
+ technologies?: string[];
104
+ targetGroups?: Record<string, string[]>;
105
+ };
102
106
  }
103
107
  export interface TargetDependencyConfig {
104
108
  /**