nx 19.2.0-alpha.3 → 19.2.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/package.json +27 -27
  2. package/src/command-line/init/implementation/add-nx-to-monorepo.js +8 -0
  3. package/src/command-line/init/implementation/add-nx-to-nest.js +4 -0
  4. package/src/command-line/init/implementation/add-nx-to-npm-repo.js +4 -0
  5. package/src/command-line/init/implementation/angular/index.js +4 -0
  6. package/src/command-line/init/init-v2.js +4 -0
  7. package/src/command-line/show/project.js +7 -1
  8. package/src/command-line/yargs-utils/shared-options.js +9 -1
  9. package/src/core/graph/main.js +1 -1
  10. package/src/core/graph/styles.css +1 -1
  11. package/src/daemon/client/client.js +1 -3
  12. package/src/daemon/server/server.js +1 -0
  13. package/src/native/index.d.ts +135 -175
  14. package/src/native/native-bindings.js +238 -352
  15. package/src/plugins/js/index.js +6 -2
  16. package/src/plugins/js/lock-file/pnpm-parser.js +219 -88
  17. package/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +7 -25
  18. package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +567 -287
  19. package/src/plugins/js/project-graph/affected/lock-file-changes.js +1 -0
  20. package/src/plugins/package-json-workspaces/create-nodes.js +1 -0
  21. package/src/plugins/project-json/build-nodes/package-json-next-to-project-json.js +1 -0
  22. package/src/project-graph/utils/retrieve-workspace-files.d.ts +3 -3
  23. package/src/tasks-runner/create-task-graph.d.ts +3 -3
  24. package/src/tasks-runner/create-task-graph.js +5 -5
  25. package/src/tasks-runner/pseudo-terminal.js +0 -3
  26. package/src/tasks-runner/run-command.js +3 -4
  27. package/src/tasks-runner/utils.d.ts +1 -2
  28. package/src/tasks-runner/utils.js +4 -8
  29. package/src/utils/package-json.d.ts +2 -1
  30. package/src/utils/package-json.js +11 -1
  31. package/src/utils/params.d.ts +1 -1
  32. package/src/utils/params.js +5 -4
  33. package/src/utils/print-help.js +1 -1
  34. package/src/native/browser.js +0 -1
  35. package/src/native/nx.debug.wasm32-wasi.wasm +0 -0
  36. package/src/native/nx.wasi-browser.js +0 -108
  37. package/src/native/nx.wasi.cjs +0 -139
  38. package/src/native/nx.wasm32-wasi.wasm +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "19.2.0-alpha.3",
3
+ "version": "19.2.0-beta.1",
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": {
@@ -37,7 +37,6 @@
37
37
  },
38
38
  "homepage": "https://nx.dev",
39
39
  "dependencies": {
40
- "@napi-rs/wasm-runtime": "0.2.4",
41
40
  "@yarnpkg/lockfile": "^1.1.0",
42
41
  "@yarnpkg/parsers": "3.0.0-rc.46",
43
42
  "@zkochan/js-yaml": "0.0.7",
@@ -70,7 +69,7 @@
70
69
  "yargs-parser": "21.1.1",
71
70
  "node-machine-id": "1.1.12",
72
71
  "ora": "5.3.0",
73
- "@nrwl/tao": "19.2.0-alpha.3"
72
+ "@nrwl/tao": "19.2.0-beta.1"
74
73
  },
75
74
  "peerDependencies": {
76
75
  "@swc-node/register": "^1.8.0",
@@ -85,16 +84,16 @@
85
84
  }
86
85
  },
87
86
  "optionalDependencies": {
88
- "@nx/nx-darwin-x64": "19.2.0-alpha.3",
89
- "@nx/nx-darwin-arm64": "19.2.0-alpha.3",
90
- "@nx/nx-linux-x64-gnu": "19.2.0-alpha.3",
91
- "@nx/nx-linux-x64-musl": "19.2.0-alpha.3",
92
- "@nx/nx-win32-x64-msvc": "19.2.0-alpha.3",
93
- "@nx/nx-linux-arm64-gnu": "19.2.0-alpha.3",
94
- "@nx/nx-linux-arm64-musl": "19.2.0-alpha.3",
95
- "@nx/nx-linux-arm-gnueabihf": "19.2.0-alpha.3",
96
- "@nx/nx-win32-arm64-msvc": "19.2.0-alpha.3",
97
- "@nx/nx-freebsd-x64": "19.2.0-alpha.3"
87
+ "@nx/nx-darwin-x64": "19.2.0-beta.1",
88
+ "@nx/nx-darwin-arm64": "19.2.0-beta.1",
89
+ "@nx/nx-linux-x64-gnu": "19.2.0-beta.1",
90
+ "@nx/nx-linux-x64-musl": "19.2.0-beta.1",
91
+ "@nx/nx-win32-x64-msvc": "19.2.0-beta.1",
92
+ "@nx/nx-linux-arm64-gnu": "19.2.0-beta.1",
93
+ "@nx/nx-linux-arm64-musl": "19.2.0-beta.1",
94
+ "@nx/nx-linux-arm-gnueabihf": "19.2.0-beta.1",
95
+ "@nx/nx-win32-arm64-msvc": "19.2.0-beta.1",
96
+ "@nx/nx-freebsd-x64": "19.2.0-beta.1"
98
97
  },
99
98
  "nx-migrations": {
100
99
  "migrations": "./migrations.json",
@@ -170,20 +169,21 @@
170
169
  "access": "public"
171
170
  },
172
171
  "napi": {
173
- "binaryName": "nx",
174
- "packageName": "@nx/nx",
175
- "targets": [
176
- "x86_64-unknown-linux-gnu",
177
- "x86_64-pc-windows-msvc",
178
- "x86_64-apple-darwin",
179
- "aarch64-apple-darwin",
180
- "aarch64-unknown-linux-gnu",
181
- "aarch64-unknown-linux-musl",
182
- "aarch64-pc-windows-msvc",
183
- "armv7-unknown-linux-gnueabihf",
184
- "x86_64-unknown-linux-musl",
185
- "x86_64-unknown-freebsd"
186
- ]
172
+ "name": "nx",
173
+ "package": {
174
+ "name": "@nx/nx"
175
+ },
176
+ "triples": {
177
+ "additional": [
178
+ "aarch64-apple-darwin",
179
+ "aarch64-unknown-linux-gnu",
180
+ "aarch64-unknown-linux-musl",
181
+ "aarch64-pc-windows-msvc",
182
+ "armv7-unknown-linux-gnueabihf",
183
+ "x86_64-unknown-linux-musl",
184
+ "x86_64-unknown-freebsd"
185
+ ]
186
+ }
187
187
  },
188
188
  "main": "./bin/nx.js",
189
189
  "type": "commonjs"
@@ -28,6 +28,10 @@ async function addNxToMonorepo(options) {
28
28
  name: 'targetDefaults',
29
29
  message: 'Which scripts need to be run in order? (e.g. before building a project, dependent projects must be built)',
30
30
  choices: scripts,
31
+ /**
32
+ * limit is missing from the interface but it limits the amount of options shown
33
+ */
34
+ limit: process.stdout.rows - 4, // 4 leaves room for the header above, the prompt and some whitespace
31
35
  },
32
36
  ])).targetDefaults;
33
37
  cacheableOperations = (await (0, enquirer_1.prompt)([
@@ -36,6 +40,10 @@ async function addNxToMonorepo(options) {
36
40
  name: 'cacheableOperations',
37
41
  message: 'Which scripts are cacheable? (Produce the same output given the same input, e.g. build, test and lint usually are, serve and start are not)',
38
42
  choices: scripts,
43
+ /**
44
+ * limit is missing from the interface but it limits the amount of options shown
45
+ */
46
+ limit: process.stdout.rows - 4, // 4 leaves room for the header above, the prompt and some whitespace
39
47
  },
40
48
  ])).cacheableOperations;
41
49
  for (const scriptName of cacheableOperations) {
@@ -51,6 +51,10 @@ async function addNxToNest(options, packageJson) {
51
51
  name: 'cacheableOperations',
52
52
  message: 'Which of the following scripts are cacheable? (Produce the same output given the same input, e.g. build, test and lint usually are, serve and start are not)',
53
53
  choices: scripts,
54
+ /**
55
+ * limit is missing from the interface but it limits the amount of options shown
56
+ */
57
+ limit: process.stdout.rows - 4, // 4 leaves room for the header above, the prompt and some whitespace
54
58
  },
55
59
  ])).cacheableOperations;
56
60
  for (const scriptName of cacheableOperations) {
@@ -26,6 +26,10 @@ async function addNxToNpmRepo(options) {
26
26
  name: 'cacheableOperations',
27
27
  message: 'Which of the following scripts are cacheable? (Produce the same output given the same input, e.g. build, test and lint usually are, serve and start are not). You can use spacebar to select one or more scripts.',
28
28
  choices: scripts,
29
+ /**
30
+ * limit is missing from the interface but it limits the amount of options shown
31
+ */
32
+ limit: process.stdout.rows - 4, // 4 leaves room for the header above, the prompt and some whitespace
29
33
  },
30
34
  ])).cacheableOperations;
31
35
  for (const scriptName of cacheableOperations) {
@@ -64,6 +64,10 @@ async function collectCacheableOperations(options) {
64
64
  message: 'Which of the following targets are cacheable? (Produce the same output given the same input, e.g. build, test and lint usually are, serve and start are not)',
65
65
  // enquirer mutates the array below, create a new one to avoid it
66
66
  choices: [...workspaceTargets],
67
+ /**
68
+ * limit is missing from the interface but it limits the amount of options shown
69
+ */
70
+ limit: process.stdout.rows - 4, // 4 leaves room for the header above, the prompt and some whitespace
67
71
  },
68
72
  ])).cacheableOperations;
69
73
  }
@@ -167,6 +167,10 @@ async function detectPlugins() {
167
167
  type: 'multiselect',
168
168
  message: `Which plugins would you like to add? Press <Space> to select and <Enter> to submit.`,
169
169
  choices: plugins.map((p) => ({ name: p, value: p })),
170
+ /**
171
+ * limit is missing from the interface but it limits the amount of options shown
172
+ */
173
+ limit: process.stdout.rows - 4, // 4 leaves room for the header above, the prompt and some whitespace
170
174
  },
171
175
  ]).then((r) => r.plugins);
172
176
  if (pluginsToInstall?.length === 0)
@@ -40,7 +40,13 @@ async function showProjectHandler(args) {
40
40
  if (targets.length > 0) {
41
41
  console.log(`${chalk.bold('Targets')}: `);
42
42
  for (const [target, targetConfig] of targets) {
43
- console.log(`- ${chalk.bold((target + ':').padEnd(maxTargetNameLength + 2))} ${(targetConfig?.executor ?? '').padEnd(maxExecutorNameLength + 2)} ${(() => {
43
+ const executorCommandText = targetConfig.metadata?.scriptContent ??
44
+ targetConfig?.options?.command ??
45
+ (targetConfig?.options?.commands?.length === 1
46
+ ? targetConfig.options.commands[0]
47
+ : targetConfig?.executor) ??
48
+ '';
49
+ console.log(`- ${chalk.bold((target + ':').padEnd(maxTargetNameLength + 2))} ${executorCommandText.padEnd(maxExecutorNameLength + 2)} ${(() => {
44
50
  const configurations = Object.keys(targetConfig.configurations ?? {});
45
51
  if (configurations.length) {
46
52
  return chalk.dim(configurations.join(', '));
@@ -202,7 +202,15 @@ function withOutputStyleOption(yargs, choices = [
202
202
  'stream-without-prefixes',
203
203
  ]) {
204
204
  return yargs.option('output-style', {
205
- describe: 'Defines how Nx emits outputs tasks logs',
205
+ describe: `Defines how Nx emits outputs tasks logs
206
+
207
+ | option | description |
208
+ | --- | --- |
209
+ | dynamic | use dynamic output life cycle, previous content is overwritten or modified as new outputs are added, display minimal logs by default, always show errors. This output format is recommended on your local development environments. |
210
+ | static | uses static output life cycle, no previous content is rewritten or modified as new outputs are added. This output format is recommened for CI environments. |
211
+ | stream | nx by default logs output to an internal output stream, enable this option to stream logs to stdout / stderr |
212
+ | stream-without-prefixes | nx prefixes the project name the target is running on, use this option remove the project name prefix from output |
213
+ `,
206
214
  type: 'string',
207
215
  choices,
208
216
  });