nx 23.1.1 → 23.1.2

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.
Files changed (128) hide show
  1. package/dist/release/changelog-renderer/index.js +4 -5
  2. package/dist/release/index.d.ts +1 -1
  3. package/dist/src/command-line/add/add.js +5 -0
  4. package/dist/src/command-line/affected/affected.js +1 -0
  5. package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +2 -2
  6. package/dist/src/command-line/import/import.js +1 -2
  7. package/dist/src/command-line/init/init-v2.js +4 -5
  8. package/dist/src/command-line/migrate/migrate.d.ts +4 -0
  9. package/dist/src/command-line/migrate/migrate.js +89 -26
  10. package/dist/src/command-line/release/changelog.js +5 -0
  11. package/dist/src/command-line/release/index.d.ts +1 -1
  12. package/dist/src/command-line/release/utils/git.js +1 -1
  13. package/dist/src/command-line/release/utils/release-graph.d.ts +17 -0
  14. package/dist/src/command-line/release/utils/release-graph.js +71 -19
  15. package/dist/src/command-line/release/utils/remote-release-clients/github.js +6 -0
  16. package/dist/src/command-line/release/version/release-group-processor.d.ts +24 -0
  17. package/dist/src/command-line/release/version/release-group-processor.js +80 -6
  18. package/dist/src/command-line/release/version/version-actions.d.ts +27 -2
  19. package/dist/src/command-line/release/version/version-actions.js +9 -1
  20. package/dist/src/command-line/release/version.js +9 -5
  21. package/dist/src/command-line/reset/reset.js +6 -1
  22. package/dist/src/command-line/run/run-one.js +1 -0
  23. package/dist/src/command-line/run-many/run-many.js +1 -0
  24. package/dist/src/command-line/watch/watch.js +13 -0
  25. package/dist/src/core/graph/main.js +1 -1
  26. package/dist/src/core/graph/styles.js +1 -1
  27. package/dist/src/daemon/client/client.d.ts +52 -1
  28. package/dist/src/daemon/client/client.js +160 -36
  29. package/dist/src/daemon/client/daemon-environment.d.ts +17 -0
  30. package/dist/src/daemon/client/daemon-environment.js +110 -2
  31. package/dist/src/daemon/client/daemon-socket-messenger.js +4 -0
  32. package/dist/src/daemon/message-types/daemon-message.d.ts +32 -0
  33. package/dist/src/daemon/message-types/daemon-message.js +25 -0
  34. package/dist/src/daemon/server/file-watching/file-watcher-sockets.d.ts +5 -0
  35. package/dist/src/daemon/server/file-watching/file-watcher-sockets.js +16 -0
  36. package/dist/src/daemon/server/latest-nx.js +5 -2
  37. package/dist/src/daemon/server/server.js +24 -0
  38. package/dist/src/daemon/server/shutdown-utils.d.ts +5 -0
  39. package/dist/src/daemon/server/shutdown-utils.js +11 -4
  40. package/dist/src/daemon/socket-utils.d.ts +1 -0
  41. package/dist/src/daemon/socket-utils.js +24 -3
  42. package/dist/src/daemon/tmp-dir.d.ts +43 -3
  43. package/dist/src/daemon/tmp-dir.js +437 -15
  44. package/dist/src/devkit-internals.d.ts +93 -3
  45. package/dist/src/devkit-internals.js +192 -5
  46. package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +5 -0
  47. package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +9 -2
  48. package/dist/src/generators/tree.d.ts +4 -2
  49. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.d.ts +12 -0
  50. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.js +250 -0
  51. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.md +50 -0
  52. package/dist/src/native/index.d.ts +10 -0
  53. package/dist/src/native/index.js +71 -28
  54. package/dist/src/native/native-bindings.js +1 -0
  55. package/dist/src/native/native-file-cache-location.d.ts +17 -1
  56. package/dist/src/native/native-file-cache-location.js +86 -12
  57. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  58. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  59. package/dist/src/nx-cloud/utilities/get-cloud-options.js +5 -2
  60. package/dist/src/nx-cloud/utilities/onboarding.js +5 -2
  61. package/dist/src/plugins/js/lock-file/bun-parser.js +43 -10
  62. package/dist/src/plugins/js/lock-file/pnpm-parser.js +60 -0
  63. package/dist/src/plugins/js/lock-file/project-graph-pruning.js +14 -8
  64. package/dist/src/plugins/js/project-graph/affected/npm-packages.js +51 -20
  65. package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +2 -0
  66. package/dist/src/project-graph/affected/affected-project-graph-models.d.ts +1 -1
  67. package/dist/src/project-graph/affected/affected-project-graph.d.ts +1 -1
  68. package/dist/src/project-graph/affected/affected-project-graph.js +2 -2
  69. package/dist/src/project-graph/affected/locators/project-glob-changes.js +5 -2
  70. package/dist/src/project-graph/error-types.d.ts +12 -1
  71. package/dist/src/project-graph/error-types.js +27 -2
  72. package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +1 -0
  73. package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +18 -1
  74. package/dist/src/project-graph/plugins/isolation/messaging.d.ts +16 -3
  75. package/dist/src/project-graph/plugins/isolation/messaging.js +3 -0
  76. package/dist/src/project-graph/plugins/isolation/plugin-worker.js +58 -8
  77. package/dist/src/project-graph/project-graph.js +20 -0
  78. package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.js +5 -1
  79. package/dist/src/project-graph/utils/project-configuration/target-normalization.js +133 -3
  80. package/dist/src/tasks-runner/task-env.js +5 -2
  81. package/dist/src/tasks-runner/utils.js +2 -6
  82. package/dist/src/utils/assert-workspace-validity.js +7 -2
  83. package/dist/src/utils/fileutils.d.ts +5 -0
  84. package/dist/src/utils/fileutils.js +7 -2
  85. package/dist/src/utils/git-worktrees.d.ts +30 -0
  86. package/dist/src/utils/git-worktrees.js +212 -0
  87. package/dist/src/utils/ignore.d.ts +128 -1
  88. package/dist/src/utils/ignore.js +182 -12
  89. package/dist/src/utils/long-running-target.d.ts +10 -0
  90. package/dist/src/utils/long-running-target.js +19 -0
  91. package/dist/src/utils/min-release-age/behavior/bun.js +7 -11
  92. package/dist/src/utils/min-release-age/behavior/npm.js +5 -2
  93. package/dist/src/utils/min-release-age/packument.js +1 -1
  94. package/dist/src/utils/nx-tmp-dir.d.ts +18 -0
  95. package/dist/src/utils/nx-tmp-dir.js +40 -0
  96. package/dist/src/utils/owned-private-dir.d.ts +132 -0
  97. package/dist/src/utils/owned-private-dir.js +323 -0
  98. package/dist/src/utils/package-manager-config/bunfig.d.ts +14 -0
  99. package/dist/src/utils/package-manager-config/bunfig.js +49 -0
  100. package/dist/src/utils/package-manager-config/npmrc.d.ts +23 -0
  101. package/dist/src/utils/package-manager-config/npmrc.js +124 -0
  102. package/dist/src/utils/package-manager-config/pnpm-config.d.ts +17 -0
  103. package/dist/src/utils/package-manager-config/pnpm-config.js +60 -0
  104. package/dist/src/utils/package-manager.d.ts +21 -2
  105. package/dist/src/utils/package-manager.js +244 -47
  106. package/dist/src/utils/provenance.js +6 -14
  107. package/dist/src/utils/registry-config/bun.d.ts +2 -0
  108. package/dist/src/utils/registry-config/bun.js +257 -0
  109. package/dist/src/utils/registry-config/index.d.ts +13 -0
  110. package/dist/src/utils/registry-config/index.js +102 -0
  111. package/dist/src/utils/registry-config/pnpm.d.ts +2 -0
  112. package/dist/src/utils/registry-config/pnpm.js +1551 -0
  113. package/dist/src/utils/registry-config/utils.d.ts +195 -0
  114. package/dist/src/utils/registry-config/utils.js +496 -0
  115. package/dist/src/utils/registry-config/yarn-berry.d.ts +2 -0
  116. package/dist/src/utils/registry-config/yarn-berry.js +612 -0
  117. package/dist/src/utils/registry-config/yarn-classic.d.ts +2 -0
  118. package/dist/src/utils/registry-config/yarn-classic.js +1001 -0
  119. package/dist/src/utils/safe-spawn.d.ts +24 -0
  120. package/dist/src/utils/safe-spawn.js +104 -0
  121. package/dist/src/utils/shell-quoting.d.ts +15 -0
  122. package/dist/src/utils/shell-quoting.js +35 -0
  123. package/dist/src/utils/wait-for-socket-connection.d.ts +11 -0
  124. package/dist/src/utils/wait-for-socket-connection.js +14 -8
  125. package/migrations.json +6 -0
  126. package/package.json +12 -12
  127. package/dist/src/utils/min-release-age/npmrc.d.ts +0 -15
  128. package/dist/src/utils/min-release-age/npmrc.js +0 -45
@@ -0,0 +1,24 @@
1
+ import { ChildProcess, ExecFileSyncOptions, SpawnOptions } from 'child_process';
2
+ /**
3
+ * Spawn a binary that may be a Windows `.cmd`/`.bat` shim, without letting its
4
+ * arguments become shell syntax.
5
+ *
6
+ * Off Windows, and for a `.exe`, no shell is involved at all. Where one is —
7
+ * a shim or a bare name — the binary and every argument are quoted for cmd.exe.
8
+ *
9
+ * Not a complete guarantee: cmd.exe expands `%VAR%` in the binary or any
10
+ * argument whether or not it is quoted, so a caller with untrusted arguments
11
+ * inherits that gap (NXC-4798). See the note on `LINE_BREAK` above.
12
+ *
13
+ * @throws on Windows when the binary or an argument contains a line break, or a
14
+ * literal `"` (via `quoteShellArg`). Those are the only refusals — the `%`
15
+ * expansion above is not one of them.
16
+ */
17
+ export declare function safeSpawn(binary: string, args: readonly string[], options?: Omit<SpawnOptions, 'shell'>): ChildProcess;
18
+ /**
19
+ * Synchronous {@link safeSpawn}, returning the child's stdout.
20
+ *
21
+ * Carries the same Windows caveats: `%VAR%` is expanded quoted or not
22
+ * (NXC-4798), and a line break or literal `"` throws.
23
+ */
24
+ export declare function safeExecFileSync(binary: string, args: readonly string[], options?: Omit<ExecFileSyncOptions, 'encoding' | 'shell'>): string;
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.safeSpawn = safeSpawn;
4
+ exports.safeExecFileSync = safeExecFileSync;
5
+ const child_process_1 = require("child_process");
6
+ const path_1 = require("path");
7
+ const shell_quoting_1 = require("./shell-quoting");
8
+ // Node refuses to launch a Windows `.cmd`/`.bat` shim without a shell
9
+ // (CVE-2024-27980). A bare name takes the shell for the same reason, one step
10
+ // removed: libuv walks PATH and PATHEXT itself, so no shell is needed to *find*
11
+ // the binary — but the walk may land on a `.cmd`/`.bat`, and this cannot know
12
+ // which in advance, so it is deliberately conservative. Everything else,
13
+ // including a `.exe`, spawns directly, so the shell and the quoting below reach
14
+ // only the invocations that cannot do without them.
15
+ //
16
+ // Deliberately a function: a module-level const is fixed at import time, which
17
+ // would make the Windows branch untestable.
18
+ function needsShell(binary) {
19
+ if (process.platform !== 'win32') {
20
+ return false;
21
+ }
22
+ // win32.extname, not the platform default: this branch only runs on Windows,
23
+ // where `path` is win32 anyway, and pinning it lets a test model the real
24
+ // parse rather than posix's (which reads `C:\ws\my.app\gradlew` as `.app\gradlew`).
25
+ const ext = path_1.win32.extname(binary).toLowerCase();
26
+ return ext === '' || ext === '.cmd' || ext === '.bat';
27
+ }
28
+ // A line break ends the command line whatever the quoting, so nothing can carry
29
+ // one.
30
+ //
31
+ // `%` is deliberately NOT refused, and this is a known gap rather than a safe
32
+ // case. cmd.exe expands `%VAR%` whether or not the value is quoted — see
33
+ // `quoteShellArg`'s own docstring in ./shell-quoting, which says so and pins it
34
+ // with a test — so quoting contains nothing here. It applies to the binary path
35
+ // as much as to the arguments, and an expansion yielding a `"` defeats the
36
+ // literal-quote refusal below, because that inspects the pre-expansion bytes.
37
+ // `bin/nx.ts` loads the workspace's own `.env` before the graph is built, so a
38
+ // repo can set the variable too.
39
+ //
40
+ // Refusing `%` is what an earlier revision did, and it made any workspace under
41
+ // a `%` path — a legal Windows directory name — fail graph construction. The gap
42
+ // is bounded by the argument that bounds this whole class: a repo that can reach
43
+ // here already has `mvnw` / `pom.xml` executing on its behalf. Closing it
44
+ // properly is tracked as NXC-4798.
45
+ const LINE_BREAK = /[\r\n]/;
46
+ /**
47
+ * Spawn a binary that may be a Windows `.cmd`/`.bat` shim, without letting its
48
+ * arguments become shell syntax.
49
+ *
50
+ * Off Windows, and for a `.exe`, no shell is involved at all. Where one is —
51
+ * a shim or a bare name — the binary and every argument are quoted for cmd.exe.
52
+ *
53
+ * Not a complete guarantee: cmd.exe expands `%VAR%` in the binary or any
54
+ * argument whether or not it is quoted, so a caller with untrusted arguments
55
+ * inherits that gap (NXC-4798). See the note on `LINE_BREAK` above.
56
+ *
57
+ * @throws on Windows when the binary or an argument contains a line break, or a
58
+ * literal `"` (via `quoteShellArg`). Those are the only refusals — the `%`
59
+ * expansion above is not one of them.
60
+ */
61
+ function safeSpawn(binary, args, options = {}) {
62
+ const shell = needsShell(binary);
63
+ return (0, child_process_1.spawn)(quoteBinary(binary, shell), quoteArgs(args, shell), {
64
+ ...options,
65
+ windowsHide: true,
66
+ shell,
67
+ });
68
+ }
69
+ /**
70
+ * Synchronous {@link safeSpawn}, returning the child's stdout.
71
+ *
72
+ * Carries the same Windows caveats: `%VAR%` is expanded quoted or not
73
+ * (NXC-4798), and a line break or literal `"` throws.
74
+ */
75
+ function safeExecFileSync(binary, args, options = {}) {
76
+ const shell = needsShell(binary);
77
+ return (0, child_process_1.execFileSync)(quoteBinary(binary, shell), quoteArgs(args, shell), {
78
+ stdio: 'pipe',
79
+ ...options,
80
+ windowsHide: true,
81
+ shell,
82
+ encoding: 'utf-8',
83
+ });
84
+ }
85
+ // The binary needs quoting too: Node joins it into the same command line, so a
86
+ // path holding a space or an `&` would split there.
87
+ function quoteBinary(binary, shell) {
88
+ if (!shell) {
89
+ return binary;
90
+ }
91
+ return quoteForCmd(binary, `the path ${JSON.stringify(binary)}`);
92
+ }
93
+ function quoteForCmd(value, described, remedy = '') {
94
+ if (LINE_BREAK.test(value)) {
95
+ throw new Error(`Cannot pass ${described} to cmd.exe: a line break inside it would end the command line before cmd.exe reached the rest of it.${remedy}`);
96
+ }
97
+ return (0, shell_quoting_1.quoteShellArg)(value);
98
+ }
99
+ function quoteArgs(args, shell) {
100
+ if (!shell) {
101
+ return [...args];
102
+ }
103
+ return args.map((arg) => quoteForCmd(arg, `the argument ${JSON.stringify(arg)}`, ' Remove it from your Nx configuration and try again.'));
104
+ }
@@ -8,3 +8,18 @@ export declare function needsShellQuoting(str: string): boolean;
8
8
  * Check if a string is already wrapped in matching quotes (single or double).
9
9
  */
10
10
  export declare function isAlreadyQuoted(str: string): boolean;
11
+ /**
12
+ * Quote a string so it survives being interpolated into a shell command line
13
+ * as a single argument.
14
+ *
15
+ * On Windows the safety boundary is one unbroken double-quoted run: it keeps
16
+ * `^`, `&`, `|`, `<` and `>` literal through cmd.exe's parse and a `.cmd`
17
+ * shim's re-parse of `%*`, but not `%`, which cmd.exe expands inside double
18
+ * quotes too.
19
+ *
20
+ * @throws on Windows when the argument contains a double quote, which ends that
21
+ * run, since cmd.exe recognizes no backslash escape. Carrying one means
22
+ * caret-escaping every metacharacter instead, doubled for a `.cmd` shim, which
23
+ * this path does not implement.
24
+ */
25
+ export declare function quoteShellArg(arg: string): string;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.needsShellQuoting = needsShellQuoting;
4
4
  exports.isAlreadyQuoted = isAlreadyQuoted;
5
+ exports.quoteShellArg = quoteShellArg;
5
6
  /**
6
7
  * Shell metacharacters that have special meaning and require quoting.
7
8
  *
@@ -39,3 +40,37 @@ function isAlreadyQuoted(str) {
39
40
  ((str[0] === "'" && str[str.length - 1] === "'") ||
40
41
  (str[0] === '"' && str[str.length - 1] === '"')));
41
42
  }
43
+ /**
44
+ * Quote a string so it survives being interpolated into a shell command line
45
+ * as a single argument.
46
+ *
47
+ * On Windows the safety boundary is one unbroken double-quoted run: it keeps
48
+ * `^`, `&`, `|`, `<` and `>` literal through cmd.exe's parse and a `.cmd`
49
+ * shim's re-parse of `%*`, but not `%`, which cmd.exe expands inside double
50
+ * quotes too.
51
+ *
52
+ * @throws on Windows when the argument contains a double quote, which ends that
53
+ * run, since cmd.exe recognizes no backslash escape. Carrying one means
54
+ * caret-escaping every metacharacter instead, doubled for a `.cmd` shim, which
55
+ * this path does not implement.
56
+ */
57
+ function quoteShellArg(arg) {
58
+ const isWindows = process.platform === 'win32';
59
+ if (isWindows && arg.includes('"')) {
60
+ throw new Error(`Cannot safely pass ${arg} to cmd.exe as a single argument: a double quote inside it would end the quoting and leave the rest of the argument to be read as commands. Remove the double quote and run the command again.`);
61
+ }
62
+ if (arg === '') {
63
+ // an unquoted empty string would vanish when joined into a command line
64
+ return isWindows ? '""' : "''";
65
+ }
66
+ // `^` is cmd.exe syntax rather than shell syntax, so it earns quoting only
67
+ // where cmd.exe parses the command line.
68
+ if (!needsShellQuoting(arg) && !(isWindows && arg.includes('^'))) {
69
+ return arg;
70
+ }
71
+ return isWindows
72
+ ? // MSVCRT reads the backslashes that precede the closing quote as escapes,
73
+ // so they have to be doubled to survive as themselves.
74
+ `"${arg.replace(/(\\+)$/, '$1$1')}"`
75
+ : `'${arg.replace(/'/g, `'\\''`)}'`;
76
+ }
@@ -12,4 +12,15 @@ export declare function waitForSocketConnection(socketPath: string | (() => stri
12
12
  signal?: AbortSignal;
13
13
  maxAttempts?: number;
14
14
  delayMs?: number;
15
+ /**
16
+ * Called with the errno of each failed connect and the path it was made
17
+ * against. Return `true` to stop polling: a permission refusal does not
18
+ * heal by retrying, and without a way out the caller waits the full budget
19
+ * and then cannot say why.
20
+ *
21
+ * The path is passed rather than left to the caller to recompute — with a
22
+ * resolver it can differ per attempt, and the caller that reports the
23
+ * refusal may no longer be able to resolve one at all.
24
+ */
25
+ onConnectError?: (error: NodeJS.ErrnoException, socketPath: string) => boolean | void;
15
26
  }): Promise<Socket | null>;
@@ -26,9 +26,15 @@ async function waitForSocketConnection(socketPath, options) {
26
26
  return null;
27
27
  const path = typeof socketPath === 'function' ? socketPath() : socketPath;
28
28
  if (path) {
29
- const socket = await tryConnect(path);
30
- if (socket) {
31
- return socket;
29
+ const result = await tryConnect(path);
30
+ if (result.socket) {
31
+ return result.socket;
32
+ }
33
+ // The caller may need the errno this attempt produced — a refused
34
+ // connection is reported very differently from a socket that is not
35
+ // there yet, and polling past it only delays the same answer.
36
+ if (result.error && options?.onConnectError?.(result.error, path)) {
37
+ return null;
32
38
  }
33
39
  }
34
40
  attempts++;
@@ -39,15 +45,15 @@ function tryConnect(socketPath) {
39
45
  return new Promise((resolve) => {
40
46
  try {
41
47
  const socket = (0, net_1.connect)(socketPath, () => {
42
- resolve(socket);
48
+ resolve({ socket });
43
49
  });
44
- socket.once('error', () => {
50
+ socket.once('error', (error) => {
45
51
  socket.destroy();
46
- resolve(null);
52
+ resolve({ error });
47
53
  });
48
54
  }
49
- catch {
50
- resolve(null);
55
+ catch (error) {
56
+ resolve({ error: error });
51
57
  }
52
58
  });
53
59
  }
package/migrations.json CHANGED
@@ -184,6 +184,12 @@
184
184
  "version": "23.0.0-beta.18",
185
185
  "description": "Adds .nx/migrate-runs to .gitignore",
186
186
  "implementation": "./dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore"
187
+ },
188
+ "23-2-0-set-cache-on-executor-target-defaults": {
189
+ "version": "23.2.0-beta.8",
190
+ "description": "Sets \"cache\" on some executor-based target defaults whose caching was previously enabled by a target name default, maintaining compatibility with how cacheability resolved before Nx 23. Keys the migration cannot decide are left alone and keep working through a deprecated runtime fallback.",
191
+ "implementation": "./dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults",
192
+ "documentation": "./dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.md"
187
193
  }
188
194
  }
189
195
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "23.1.1",
3
+ "version": "23.1.2",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
@@ -65,7 +65,7 @@
65
65
  "balanced-match": "4.0.3",
66
66
  "base64-js": "1.5.1",
67
67
  "bl": "4.1.0",
68
- "brace-expansion": "5.0.8",
68
+ "brace-expansion": "5.0.9",
69
69
  "buffer": "5.7.1",
70
70
  "bundle-name": "4.1.0",
71
71
  "call-bind-apply-helpers": "1.0.2",
@@ -181,16 +181,16 @@
181
181
  }
182
182
  },
183
183
  "optionalDependencies": {
184
- "@nx/nx-darwin-arm64": "23.1.1",
185
- "@nx/nx-darwin-x64": "23.1.1",
186
- "@nx/nx-freebsd-x64": "23.1.1",
187
- "@nx/nx-linux-arm-gnueabihf": "23.1.1",
188
- "@nx/nx-linux-arm64-gnu": "23.1.1",
189
- "@nx/nx-linux-arm64-musl": "23.1.1",
190
- "@nx/nx-linux-x64-gnu": "23.1.1",
191
- "@nx/nx-linux-x64-musl": "23.1.1",
192
- "@nx/nx-win32-arm64-msvc": "23.1.1",
193
- "@nx/nx-win32-x64-msvc": "23.1.1"
184
+ "@nx/nx-darwin-arm64": "23.1.2",
185
+ "@nx/nx-darwin-x64": "23.1.2",
186
+ "@nx/nx-freebsd-x64": "23.1.2",
187
+ "@nx/nx-linux-arm-gnueabihf": "23.1.2",
188
+ "@nx/nx-linux-arm64-gnu": "23.1.2",
189
+ "@nx/nx-linux-arm64-musl": "23.1.2",
190
+ "@nx/nx-linux-x64-gnu": "23.1.2",
191
+ "@nx/nx-linux-x64-musl": "23.1.2",
192
+ "@nx/nx-win32-arm64-msvc": "23.1.2",
193
+ "@nx/nx-win32-x64-msvc": "23.1.2"
194
194
  },
195
195
  "nx-migrations": {
196
196
  "migrations": "./migrations.json",
@@ -1,15 +0,0 @@
1
- export interface NpmrcEntry {
2
- key: string;
3
- value: string;
4
- }
5
- /**
6
- * Parses an .npmrc file into its `key = value` entries the way npm/npm-conf do:
7
- * skip blank lines and `#`/`;` comments, split on the first `=`, and trim both
8
- * sides. The value is returned raw (quote stripping is the caller's concern).
9
- * Returns null when the file is missing or unreadable so callers can distinguish
10
- * "no file" from "file with no relevant keys". Shared by the npm and pnpm
11
- * cooldown readers.
12
- */
13
- export declare function readNpmrcEntries(path: string): NpmrcEntry[] | null;
14
- /** The parsing half of {@link readNpmrcEntries}, usable without a filesystem. */
15
- export declare function parseNpmrcContent(raw: string): NpmrcEntry[];
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readNpmrcEntries = readNpmrcEntries;
4
- exports.parseNpmrcContent = parseNpmrcContent;
5
- const fs_1 = require("fs");
6
- /**
7
- * Parses an .npmrc file into its `key = value` entries the way npm/npm-conf do:
8
- * skip blank lines and `#`/`;` comments, split on the first `=`, and trim both
9
- * sides. The value is returned raw (quote stripping is the caller's concern).
10
- * Returns null when the file is missing or unreadable so callers can distinguish
11
- * "no file" from "file with no relevant keys". Shared by the npm and pnpm
12
- * cooldown readers.
13
- */
14
- function readNpmrcEntries(path) {
15
- if (!(0, fs_1.existsSync)(path)) {
16
- return null;
17
- }
18
- let raw;
19
- try {
20
- raw = (0, fs_1.readFileSync)(path, 'utf-8');
21
- }
22
- catch {
23
- return null;
24
- }
25
- return parseNpmrcContent(raw);
26
- }
27
- /** The parsing half of {@link readNpmrcEntries}, usable without a filesystem. */
28
- function parseNpmrcContent(raw) {
29
- const entries = [];
30
- for (const line of raw.split(/\r?\n/)) {
31
- const trimmed = line.trim();
32
- if (!trimmed || trimmed.startsWith('#') || trimmed.startsWith(';')) {
33
- continue;
34
- }
35
- const eq = trimmed.indexOf('=');
36
- if (eq === -1) {
37
- continue;
38
- }
39
- entries.push({
40
- key: trimmed.slice(0, eq).trim(),
41
- value: trimmed.slice(eq + 1).trim(),
42
- });
43
- }
44
- return entries;
45
- }