nx 22.5.0 → 22.5.1
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 +11 -11
- package/src/ai/constants.d.ts +7 -1
- package/src/ai/constants.d.ts.map +1 -1
- package/src/ai/constants.js +4 -3
- package/src/ai/set-up-ai-agents/get-agent-rules.d.ts +5 -1
- package/src/ai/set-up-ai-agents/get-agent-rules.d.ts.map +1 -1
- package/src/ai/set-up-ai-agents/get-agent-rules.js +4 -3
- package/src/ai/set-up-ai-agents/set-up-ai-agents.d.ts.map +1 -1
- package/src/ai/set-up-ai-agents/set-up-ai-agents.js +59 -1
- package/src/daemon/client/client.d.ts.map +1 -1
- package/src/daemon/client/client.js +2 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/project-graph/plugins/isolation/enabled.d.ts.map +1 -1
- package/src/project-graph/plugins/isolation/enabled.js +4 -1
- package/src/project-graph/utils/project-configuration-utils.d.ts.map +1 -1
- package/src/project-graph/utils/project-configuration-utils.js +47 -10
- package/src/tasks-runner/forked-process-task-runner.d.ts +1 -1
- package/src/tasks-runner/forked-process-task-runner.d.ts.map +1 -1
- package/src/tasks-runner/forked-process-task-runner.js +3 -4
- package/src/tasks-runner/pseudo-ipc.d.ts.map +1 -1
- package/src/tasks-runner/pseudo-ipc.js +16 -0
- package/src/tasks-runner/task-graph-utils.d.ts.map +1 -1
- package/src/tasks-runner/task-graph-utils.js +8 -2
- package/src/utils/is-sandbox.d.ts +2 -0
- package/src/utils/is-sandbox.d.ts.map +1 -0
- package/src/utils/is-sandbox.js +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "22.5.
|
|
3
|
+
"version": "22.5.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": {
|
|
@@ -84,16 +84,16 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"optionalDependencies": {
|
|
87
|
-
"@nx/nx-darwin-arm64": "22.5.
|
|
88
|
-
"@nx/nx-darwin-x64": "22.5.
|
|
89
|
-
"@nx/nx-freebsd-x64": "22.5.
|
|
90
|
-
"@nx/nx-linux-arm-gnueabihf": "22.5.
|
|
91
|
-
"@nx/nx-linux-arm64-gnu": "22.5.
|
|
92
|
-
"@nx/nx-linux-arm64-musl": "22.5.
|
|
93
|
-
"@nx/nx-linux-x64-gnu": "22.5.
|
|
94
|
-
"@nx/nx-linux-x64-musl": "22.5.
|
|
95
|
-
"@nx/nx-win32-arm64-msvc": "22.5.
|
|
96
|
-
"@nx/nx-win32-x64-msvc": "22.5.
|
|
87
|
+
"@nx/nx-darwin-arm64": "22.5.1",
|
|
88
|
+
"@nx/nx-darwin-x64": "22.5.1",
|
|
89
|
+
"@nx/nx-freebsd-x64": "22.5.1",
|
|
90
|
+
"@nx/nx-linux-arm-gnueabihf": "22.5.1",
|
|
91
|
+
"@nx/nx-linux-arm64-gnu": "22.5.1",
|
|
92
|
+
"@nx/nx-linux-arm64-musl": "22.5.1",
|
|
93
|
+
"@nx/nx-linux-x64-gnu": "22.5.1",
|
|
94
|
+
"@nx/nx-linux-x64-musl": "22.5.1",
|
|
95
|
+
"@nx/nx-win32-arm64-msvc": "22.5.1",
|
|
96
|
+
"@nx/nx-win32-x64-msvc": "22.5.1"
|
|
97
97
|
},
|
|
98
98
|
"nx-migrations": {
|
|
99
99
|
"migrations": "./migrations.json",
|
package/src/ai/constants.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AgentRulesOptions } from './set-up-ai-agents/get-agent-rules';
|
|
2
|
+
export type { AgentRulesOptions };
|
|
1
3
|
export declare function agentsMdPath(root: string): string;
|
|
2
4
|
export declare function geminiMdPath(root: string): string;
|
|
3
5
|
export declare function parseGeminiSettings(root: string): any | undefined;
|
|
@@ -10,7 +12,11 @@ export declare const nxRulesMarkerCommentStart = "<!-- nx configuration start-->
|
|
|
10
12
|
export declare const nxRulesMarkerCommentDescription = "<!-- Leave the start & end comments to automatically receive updates. -->";
|
|
11
13
|
export declare const nxRulesMarkerCommentEnd = "<!-- nx configuration end-->";
|
|
12
14
|
export declare const rulesRegex: RegExp;
|
|
13
|
-
export
|
|
15
|
+
export interface AgentRulesWrappedOptions {
|
|
16
|
+
writeNxCloudRules: boolean;
|
|
17
|
+
useH1?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const getAgentRulesWrapped: (options: AgentRulesWrappedOptions) => string;
|
|
14
20
|
export declare const nxMcpTomlHeader = "[mcp_servers.\"nx-mcp\"]";
|
|
15
21
|
/**
|
|
16
22
|
* Get the MCP TOML configuration based on the Nx version.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/ai/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/ai/constants.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,iBAAiB,EAClB,MAAM,oCAAoC,CAAC;AAE5C,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAOjE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,eAAO,MAAM,mBAAmB,QAA2C,CAAC;AAE5E,eAAO,MAAM,yBAAyB,mCAAmC,CAAC;AAC1E,eAAO,MAAM,+BAA+B,8EAA8E,CAAC;AAC3H,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AACtE,eAAO,MAAM,UAAU,QAGtB,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,oBAAoB,GAAI,SAAS,wBAAwB,WAIrE,CAAC;AAEF,eAAO,MAAM,eAAe,6BAA2B,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAQ5D"}
|
package/src/ai/constants.js
CHANGED
|
@@ -46,9 +46,10 @@ exports.nxRulesMarkerCommentStart = `<!-- nx configuration start-->`;
|
|
|
46
46
|
exports.nxRulesMarkerCommentDescription = `<!-- Leave the start & end comments to automatically receive updates. -->`;
|
|
47
47
|
exports.nxRulesMarkerCommentEnd = `<!-- nx configuration end-->`;
|
|
48
48
|
exports.rulesRegex = new RegExp(`${exports.nxRulesMarkerCommentStart}[\\s\\S]*?${exports.nxRulesMarkerCommentEnd}`, 'm');
|
|
49
|
-
const getAgentRulesWrapped = (
|
|
50
|
-
const
|
|
51
|
-
|
|
49
|
+
const getAgentRulesWrapped = (options) => {
|
|
50
|
+
const { writeNxCloudRules, useH1 = true } = options;
|
|
51
|
+
const agentRulesString = (0, get_agent_rules_1.getAgentRules)({ nxCloud: writeNxCloudRules, useH1 });
|
|
52
|
+
return `${exports.nxRulesMarkerCommentStart}\n${exports.nxRulesMarkerCommentDescription}\n\n${agentRulesString}\n\n${exports.nxRulesMarkerCommentEnd}`;
|
|
52
53
|
};
|
|
53
54
|
exports.getAgentRulesWrapped = getAgentRulesWrapped;
|
|
54
55
|
exports.nxMcpTomlHeader = `[mcp_servers."nx-mcp"]`;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface AgentRulesOptions {
|
|
2
|
+
nxCloud: boolean;
|
|
3
|
+
useH1?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function getAgentRules(options: AgentRulesOptions): string;
|
|
2
6
|
//# sourceMappingURL=get-agent-rules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-agent-rules.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/ai/set-up-ai-agents/get-agent-rules.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"get-agent-rules.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/ai/set-up-ai-agents/get-agent-rules.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,iBAAiB,UAsBvD"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAgentRules = getAgentRules;
|
|
4
|
-
function getAgentRules(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
function getAgentRules(options) {
|
|
5
|
+
const { nxCloud, useH1 = true } = options;
|
|
6
|
+
const header = useH1 ? '#' : '##';
|
|
7
|
+
return `${header} General Guidelines for working with Nx
|
|
7
8
|
|
|
8
9
|
- For navigating/exploring the workspace, invoke the \`nx-workspace\` skill first - it has patterns for querying projects, targets, and dependencies
|
|
9
10
|
- When running tasks (for example build, lint, test, e2e, etc.), always prefer running the task through \`nx\` (i.e. \`nx run\`, \`nx run-many\`, \`nx affected\`) instead of using the underlying tooling directly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-up-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/ai/set-up-ai-agents/set-up-ai-agents.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAS7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAyB5B,OAAO,EACL,sCAAsC,EACtC,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC,CAAC;AAmCF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,EACrC,KAAK,UAAQ,GACZ,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAmC5D;AAaD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sCAAsC,GAC9C,OAAO,CAAC,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC,CA4O7C;
|
|
1
|
+
{"version":3,"file":"set-up-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/ai/set-up-ai-agents/set-up-ai-agents.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAS7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAyB5B,OAAO,EACL,sCAAsC,EACtC,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC,CAAC;AAmCF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,EACrC,KAAK,UAAQ,GACZ,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAmC5D;AAaD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sCAAsC,GAC9C,OAAO,CAAC,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC,CA4O7C;AAqJD,eAAe,sBAAsB,CAAC"}
|
|
@@ -270,8 +270,12 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
272
|
function writeAgentRules(tree, path, writeNxCloudRules) {
|
|
273
|
-
const expectedRules = (0, constants_2.getAgentRulesWrapped)(writeNxCloudRules);
|
|
274
273
|
if (!tree.exists(path)) {
|
|
274
|
+
// File doesn't exist - create with h1 header (standalone content)
|
|
275
|
+
const expectedRules = (0, constants_2.getAgentRulesWrapped)({
|
|
276
|
+
writeNxCloudRules,
|
|
277
|
+
useH1: true,
|
|
278
|
+
});
|
|
275
279
|
tree.write(path, expectedRules);
|
|
276
280
|
return;
|
|
277
281
|
}
|
|
@@ -279,6 +283,14 @@ function writeAgentRules(tree, path, writeNxCloudRules) {
|
|
|
279
283
|
const regex = constants_2.rulesRegex;
|
|
280
284
|
const existingNxConfiguration = existing.match(regex);
|
|
281
285
|
if (existingNxConfiguration) {
|
|
286
|
+
// Check the rest of the file (outside nx block) for an h1 header
|
|
287
|
+
// to ensure only one h1 exists in the document
|
|
288
|
+
const contentWithoutNxBlock = existing.replace(regex, '');
|
|
289
|
+
const hasExternalH1 = /^# /m.test(contentWithoutNxBlock);
|
|
290
|
+
const expectedRules = (0, constants_2.getAgentRulesWrapped)({
|
|
291
|
+
writeNxCloudRules,
|
|
292
|
+
useH1: !hasExternalH1,
|
|
293
|
+
});
|
|
282
294
|
const contentOnly = (str) => str
|
|
283
295
|
.replace(constants_2.nxRulesMarkerCommentStart, '')
|
|
284
296
|
.replace(constants_2.nxRulesMarkerCommentEnd, '')
|
|
@@ -293,12 +305,52 @@ function writeAgentRules(tree, path, writeNxCloudRules) {
|
|
|
293
305
|
tree.write(path, updatedContent);
|
|
294
306
|
}
|
|
295
307
|
else {
|
|
308
|
+
// Appending to existing content - use h2 only if the file already has an h1 header
|
|
309
|
+
// This prevents unnecessary changes when users add content without their own h1
|
|
310
|
+
const hasExistingH1 = /^# /m.test(existing);
|
|
311
|
+
const expectedRules = (0, constants_2.getAgentRulesWrapped)({
|
|
312
|
+
writeNxCloudRules,
|
|
313
|
+
useH1: !hasExistingH1,
|
|
314
|
+
});
|
|
296
315
|
tree.write(path, existing + '\n\n' + expectedRules);
|
|
297
316
|
}
|
|
298
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Extract user-added extra args/flags from an existing MCP config args array
|
|
320
|
+
* by stripping the known base command prefix.
|
|
321
|
+
*
|
|
322
|
+
* Known base patterns (matched in order, first wins):
|
|
323
|
+
* ['nx', 'mcp'] or ['nx-mcp'] (possibly with @version suffix like nx-mcp@latest)
|
|
324
|
+
* For opencode the caller prepends 'npx' to these patterns.
|
|
325
|
+
*/
|
|
326
|
+
function getExtraMcpArgs(existingArgs, knownBasePatterns) {
|
|
327
|
+
if (!Array.isArray(existingArgs) || existingArgs.length === 0)
|
|
328
|
+
return [];
|
|
329
|
+
for (const pattern of knownBasePatterns) {
|
|
330
|
+
if (existingArgs.length < pattern.length)
|
|
331
|
+
continue;
|
|
332
|
+
const matches = pattern.every((baseArg, i) => {
|
|
333
|
+
if (baseArg === 'nx-mcp') {
|
|
334
|
+
// Also match versioned variants like nx-mcp@latest
|
|
335
|
+
return (existingArgs[i] === 'nx-mcp' || existingArgs[i].startsWith('nx-mcp@'));
|
|
336
|
+
}
|
|
337
|
+
return existingArgs[i] === baseArg;
|
|
338
|
+
});
|
|
339
|
+
if (matches) {
|
|
340
|
+
return existingArgs.slice(pattern.length);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return [];
|
|
344
|
+
}
|
|
299
345
|
function mcpConfigUpdater(existing, nxVersion) {
|
|
300
346
|
const majorVersion = (0, semver_1.major)(nxVersion);
|
|
301
347
|
const mcpArgs = majorVersion >= 22 ? ['nx', 'mcp'] : ['nx-mcp'];
|
|
348
|
+
// Preserve any extra args (e.g. --experimental-polygraph, --transport http) from existing config
|
|
349
|
+
const extraArgs = getExtraMcpArgs(existing.mcpServers?.['nx-mcp']?.args, [
|
|
350
|
+
['nx', 'mcp'],
|
|
351
|
+
['nx-mcp'],
|
|
352
|
+
]);
|
|
353
|
+
mcpArgs.push(...extraArgs);
|
|
302
354
|
if (existing.mcpServers) {
|
|
303
355
|
existing.mcpServers['nx-mcp'] = {
|
|
304
356
|
type: 'stdio',
|
|
@@ -320,6 +372,12 @@ function mcpConfigUpdater(existing, nxVersion) {
|
|
|
320
372
|
function opencodeMcpConfigUpdater(existing, nxVersion) {
|
|
321
373
|
const majorVersion = (0, semver_1.major)(nxVersion);
|
|
322
374
|
const mcpCommand = majorVersion >= 22 ? ['npx', 'nx', 'mcp'] : ['npx', 'nx-mcp'];
|
|
375
|
+
// Preserve any extra args (e.g. --experimental-polygraph, --transport http) from existing config
|
|
376
|
+
const extraArgs = getExtraMcpArgs(existing.mcp?.['nx-mcp']?.command, [
|
|
377
|
+
['npx', 'nx', 'mcp'],
|
|
378
|
+
['npx', 'nx-mcp'],
|
|
379
|
+
]);
|
|
380
|
+
mcpCommand.push(...extraArgs);
|
|
323
381
|
if (existing.mcp) {
|
|
324
382
|
existing.mcp['nx-mcp'] = {
|
|
325
383
|
type: 'local',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/daemon/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAC;AAepD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,SAAS,E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AAwC,CAAC;IAQ9C,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;YAwB7B,sBAAsB;YAsCtB,oBAAoB;IASlC,OAAO,CAAC,eAAe;YA8CT,qBAAqB;IAoDnC,OAAO,CAAC,mBAAmB;IAO3B;;;OAGG;YACW,0BAA0B;YAwC1B,mBAAmB;YAsBnB,uCAAuC;IAiBrD,OAAO,CAAC,aAAa;IA2Cf,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAqDjD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB5B;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC;AAE/C,wBAAgB,eAAe,YAE9B"}
|
|
@@ -17,6 +17,7 @@ const project_graph_1 = require("../../project-graph/project-graph");
|
|
|
17
17
|
const consume_messages_from_socket_1 = require("../../utils/consume-messages-from-socket");
|
|
18
18
|
const delayed_spinner_1 = require("../../utils/delayed-spinner");
|
|
19
19
|
const is_ci_1 = require("../../utils/is-ci");
|
|
20
|
+
const is_sandbox_1 = require("../../utils/is-sandbox");
|
|
20
21
|
const output_1 = require("../../utils/output");
|
|
21
22
|
const promised_based_queue_1 = require("../../utils/promised-based-queue");
|
|
22
23
|
const workspace_root_1 = require("../../utils/workspace-root");
|
|
@@ -96,7 +97,7 @@ class DaemonClient {
|
|
|
96
97
|
// WASM => no daemon because file watching does not work
|
|
97
98
|
// version mismatch => no daemon because the installed nx version differs from the running one
|
|
98
99
|
if ((0, is_nx_version_mismatch_1.isNxVersionMismatch)() ||
|
|
99
|
-
(((0, is_ci_1.isCI)() || isDocker()) && env !== 'true') ||
|
|
100
|
+
(((0, is_ci_1.isCI)() || isDocker() || (0, is_sandbox_1.isSandbox)()) && env !== 'true') ||
|
|
100
101
|
(0, tmp_dir_1.isDaemonDisabled)() ||
|
|
101
102
|
nxJsonIsNotPresent() ||
|
|
102
103
|
(useDaemonProcessOption === undefined && env === 'false') ||
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enabled.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/project-graph/plugins/isolation/enabled.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enabled.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/project-graph/plugins/isolation/enabled.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,YAiBjC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isIsolationEnabled = isIsolationEnabled;
|
|
4
4
|
const native_1 = require("../../../native");
|
|
5
|
+
const is_sandbox_1 = require("../../../utils/is-sandbox");
|
|
5
6
|
function isIsolationEnabled() {
|
|
6
7
|
// Explicitly enabled, regardless of further conditions
|
|
7
8
|
if (process.env.NX_ISOLATE_PLUGINS === 'true') {
|
|
@@ -11,7 +12,9 @@ function isIsolationEnabled() {
|
|
|
11
12
|
// Explicitly disabled
|
|
12
13
|
process.env.NX_ISOLATE_PLUGINS === 'false' ||
|
|
13
14
|
// Isolation is disabled on WASM builds currently.
|
|
14
|
-
native_1.IS_WASM
|
|
15
|
+
native_1.IS_WASM ||
|
|
16
|
+
// Isolation is disabled in sandbox environments (AI agents, etc.)
|
|
17
|
+
(0, is_sandbox_1.isSandbox)()) {
|
|
15
18
|
return false;
|
|
16
19
|
}
|
|
17
20
|
// Default value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-configuration-utils.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/project-graph/utils/project-configuration-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACf,MAAM,0CAA0C,CAAC;AAUlD,OAAO,KAAK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1D,IAAI,EAAE,MAAsB,EAC5B,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,wEAAwE;AAClG,OAAO,EAAE,cAAc,EAAE,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAuI9B;
|
|
1
|
+
{"version":3,"file":"project-configuration-utils.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/project-graph/utils/project-configuration-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACf,MAAM,0CAA0C,CAAC;AAUlD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AA2BlE,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACtE,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAClC,CAAC;AAEF,wBAAgB,oCAAoC,CAClD,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,EACpD,OAAO,EAAE,oBAAoB,EAC7B,uBAAuB,CAAC,EAAE,uBAAuB,EACjD,iBAAiB,CAAC,EAAE,iBAAiB,EAGrC,uBAAuB,CAAC,EAAE,OAAO,GAChC,IAAI,CAgLN;AAED,wBAAgB,aAAa,CAAC,CAAC,GAAG,eAAe,GAAG,cAAc,EAChE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EACzD,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACjD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3C,mBAAmB,CAyErB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,mBAAmB,EAC3B,UAAU,CAAC,EAAE,mBAAmB,EAChC,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC1D,iBAAiB,CAAC,EAAE,iBAAiB,EACrC,gBAAgB,CAAC,EAAE,MAAM,GACxB,mBAAmB,CAyErB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,mBAAmB,EACtB,CAAC,EAAE,mBAAmB,WA+BvB;AA8DD,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,EACxE,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,oBAAoB,EAC7B,GAAG,EAAE,MAAM,GACV,CAAC,CAwBH;AAED,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,cAAc,EAC9B,QAAQ,CAAC,EAAE,MAAM,GAChB,cAAc,CAAC,MAAM,CAAC,CA6BxB;AAqCD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,oBAAoB,EAC7B,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,EACjD,WAAW,EAAE,MAAM,4BAiDpB"}
|
|
@@ -373,21 +373,58 @@ function mergeCreateNodesResults(results, nxJsonConfiguration, workspaceRoot, er
|
|
|
373
373
|
perf_hooks_1.performance.measure('createNodes:merge', 'createNodes:merge - start', 'createNodes:merge - end');
|
|
374
374
|
return { projectRootMap, externalNodes, rootMap, configurationSourceMaps };
|
|
375
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* Fast matcher for patterns without negations - uses short-circuit evaluation.
|
|
378
|
+
*/
|
|
379
|
+
function matchesSimplePatterns(file, patterns) {
|
|
380
|
+
return patterns.some((pattern) => (0, minimatch_1.minimatch)(file, pattern, { dot: true }));
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Full matcher for patterns with negations - processes all patterns sequentially.
|
|
384
|
+
* Patterns starting with '!' are negation patterns that remove files from the match set.
|
|
385
|
+
* Patterns are processed in order, with later patterns overriding earlier ones.
|
|
386
|
+
*/
|
|
387
|
+
function matchesNegationPatterns(file, patterns) {
|
|
388
|
+
// If first pattern is negation, start by matching everything
|
|
389
|
+
let isMatch = patterns[0].startsWith('!');
|
|
390
|
+
for (const pattern of patterns) {
|
|
391
|
+
const isNegation = pattern.startsWith('!');
|
|
392
|
+
const actualPattern = isNegation ? pattern.substring(1) : pattern;
|
|
393
|
+
if ((0, minimatch_1.minimatch)(file, actualPattern, { dot: true })) {
|
|
394
|
+
// Last matching pattern wins
|
|
395
|
+
isMatch = !isNegation;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return isMatch;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Creates a matcher function for the given patterns.
|
|
402
|
+
* @param patterns Array of glob patterns (can include negation patterns starting with '!')
|
|
403
|
+
* @param emptyValue Value to return when patterns array is empty
|
|
404
|
+
* @returns A function that checks if a file matches the patterns
|
|
405
|
+
*/
|
|
406
|
+
function createMatcher(patterns, emptyValue) {
|
|
407
|
+
if (!patterns || patterns.length === 0) {
|
|
408
|
+
return () => emptyValue;
|
|
409
|
+
}
|
|
410
|
+
const hasNegationPattern = patterns.some((p) => p.startsWith('!'));
|
|
411
|
+
return hasNegationPattern
|
|
412
|
+
? (file) => matchesNegationPatterns(file, patterns)
|
|
413
|
+
: (file) => matchesSimplePatterns(file, patterns);
|
|
414
|
+
}
|
|
376
415
|
function findMatchingConfigFiles(projectFiles, pattern, include, exclude) {
|
|
377
416
|
const matchingConfigFiles = [];
|
|
417
|
+
// Create matchers once, outside the loop
|
|
418
|
+
// Empty include means include everything, empty exclude means exclude nothing
|
|
419
|
+
const includes = createMatcher(include, true);
|
|
420
|
+
const excludes = createMatcher(exclude, false);
|
|
378
421
|
for (const file of projectFiles) {
|
|
379
422
|
if ((0, minimatch_1.minimatch)(file, pattern, { dot: true })) {
|
|
380
|
-
if (
|
|
381
|
-
|
|
382
|
-
if (!included) {
|
|
383
|
-
continue;
|
|
384
|
-
}
|
|
423
|
+
if (!includes(file)) {
|
|
424
|
+
continue;
|
|
385
425
|
}
|
|
386
|
-
if (
|
|
387
|
-
|
|
388
|
-
if (excluded) {
|
|
389
|
-
continue;
|
|
390
|
-
}
|
|
426
|
+
if (excludes(file)) {
|
|
427
|
+
continue;
|
|
391
428
|
}
|
|
392
429
|
matchingConfigFiles.push(file);
|
|
393
430
|
}
|
|
@@ -15,7 +15,7 @@ export declare class ForkedProcessTaskRunner {
|
|
|
15
15
|
private pseudoTerminals;
|
|
16
16
|
constructor(options: DefaultTasksRunnerOptions, tuiEnabled: boolean);
|
|
17
17
|
init(): Promise<void>;
|
|
18
|
-
forkProcessForBatch({ executorName, taskGraph: batchTaskGraph }: Batch, projectGraph: ProjectGraph, fullTaskGraph: TaskGraph, env: NodeJS.ProcessEnv): Promise<BatchProcess>;
|
|
18
|
+
forkProcessForBatch({ id: batchId, executorName, taskGraph: batchTaskGraph }: Batch, projectGraph: ProjectGraph, fullTaskGraph: TaskGraph, env: NodeJS.ProcessEnv): Promise<BatchProcess>;
|
|
19
19
|
cleanUpBatchProcesses(): void;
|
|
20
20
|
forkProcessLegacy(task: Task, { temporaryOutputPath, streamOutput, pipeOutput, taskGraph, env, }: {
|
|
21
21
|
temporaryOutputPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forked-process-task-runner.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/forked-process-task-runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAMvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,
|
|
1
|
+
{"version":3,"file":"forked-process-task-runner.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/forked-process-task-runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAMvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAGL,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAK7D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAOzC,qBAAa,uBAAuB;IAShC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAT7B,OAAO,SAAgB;IAEvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6C;IACrE,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,iBAAiB,CAA2B;IACpD,OAAO,CAAC,eAAe,CAA6B;gBAGjC,OAAO,EAAE,yBAAyB,EAClC,UAAU,EAAE,OAAO;IAGhC,IAAI;IAKG,mBAAmB,CAC9B,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,KAAK,EAC/D,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,SAAS,EACxB,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,OAAO,CAAC,YAAY,CAAC;IAgDjB,qBAAqB;IASf,iBAAiB,CAC5B,IAAI,EAAE,IAAI,EACV,EACE,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,SAAS,EACT,GAAG,GACJ,EAAE;QACD,mBAAmB,EAAE,MAAM,CAAC;QAC5B,YAAY,EAAE,OAAO,CAAC;QACtB,UAAU,EAAE,OAAO,CAAC;QACpB,SAAS,EAAE,SAAS,CAAC;QACrB,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;KACxB,GACA,OAAO,CAAC,WAAW,CAAC;IAgBV,WAAW,CACtB,IAAI,EAAE,IAAI,EACV,EACE,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,GAAG,EACH,qBAAqB,GACtB,EAAE;QACD,mBAAmB,EAAE,MAAM,CAAC;QAC5B,YAAY,EAAE,OAAO,CAAC;QACtB,UAAU,EAAE,OAAO,CAAC;QACpB,SAAS,EAAE,SAAS,CAAC;QACrB,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;QACvB,qBAAqB,EAAE,OAAO,CAAC;KAChC,GACA,OAAO,CAAC,WAAW,GAAG,gBAAgB,CAAC;YAiC5B,oBAAoB;YAapB,6BAA6B;IAkE3C,OAAO,CAAC,8BAA8B;IAmEtC,OAAO,CAAC,8BAA8B;IA2EtC,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO;IAO/B,OAAO,CAAC,0BAA0B;CAwCnC"}
|
|
@@ -4,7 +4,6 @@ exports.ForkedProcessTaskRunner = void 0;
|
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const path_1 = require("path");
|
|
7
|
-
const native_1 = require("../native");
|
|
8
7
|
const exit_codes_1 = require("../utils/exit-codes");
|
|
9
8
|
const output_1 = require("../utils/output");
|
|
10
9
|
const strip_indents_1 = require("../utils/strip-indents");
|
|
@@ -31,7 +30,7 @@ class ForkedProcessTaskRunner {
|
|
|
31
30
|
this.setupProcessEventListeners();
|
|
32
31
|
}
|
|
33
32
|
// TODO: vsavkin delegate terminal output printing
|
|
34
|
-
async forkProcessForBatch({ executorName, taskGraph: batchTaskGraph }, projectGraph, fullTaskGraph, env) {
|
|
33
|
+
async forkProcessForBatch({ id: batchId, executorName, taskGraph: batchTaskGraph }, projectGraph, fullTaskGraph, env) {
|
|
35
34
|
const count = Object.keys(batchTaskGraph.tasks).length;
|
|
36
35
|
if (count > 1) {
|
|
37
36
|
output_1.output.logSingleLine(`Running ${output_1.output.bold(count)} ${output_1.output.bold('tasks')} with ${output_1.output.bold(executorName)}`);
|
|
@@ -49,7 +48,6 @@ class ForkedProcessTaskRunner {
|
|
|
49
48
|
});
|
|
50
49
|
// Register batch worker process with all tasks
|
|
51
50
|
if (p.pid) {
|
|
52
|
-
const batchId = `${executorName}-${p.pid}`;
|
|
53
51
|
const taskIds = Object.keys(batchTaskGraph.tasks);
|
|
54
52
|
(0, process_metrics_service_1.getProcessMetricsService)().registerBatch(batchId, taskIds, p.pid);
|
|
55
53
|
}
|
|
@@ -121,7 +119,8 @@ class ForkedProcessTaskRunner {
|
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
async createPseudoTerminal() {
|
|
124
|
-
|
|
122
|
+
// Use the helper to ensure shutdown callbacks are registered
|
|
123
|
+
const terminal = (0, pseudo_terminal_1.createPseudoTerminal)(true);
|
|
125
124
|
await terminal.init();
|
|
126
125
|
terminal.onMessageFromChildren((message) => {
|
|
127
126
|
process.send(message);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pseudo-ipc.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/pseudo-ipc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"pseudo-ipc.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/pseudo-ipc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAQH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAgB7C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,yBAAyB,GAAG,yBAAyB,GAAG,aAAa,CAAC;IAC5E,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,qBAAa,eAAe;IAUd,OAAO,CAAC,IAAI;IATxB,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,CAAC,aAAa,CAIZ;gBAEW,IAAI,EAAE,MAAM;IAEhC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBrB,OAAO,CAAC,aAAa,CAAiC;IAEhD,iBAAiB,CAAC,OAAO,EAAE,MAAM;IAMvC,OAAO,CAAC,qBAAqB;IA8B7B,qBAAqB,CAAC,OAAO,EAAE,YAAY;IAU3C,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IASpD,qBAAqB,CACnB,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,EAC1C,OAAO,GAAE,MAAM,IAAe,EAC9B,OAAO,GAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAkB;IAS7C,KAAK;CAIN;AAED,qBAAa,eAAe;IAGd,OAAO,CAAC,IAAI;IAFxB,OAAO,CAAC,MAAM,CAA0C;gBAEpC,IAAI,EAAE,MAAM;IAEhC,mBAAmB,CAAC,OAAO,EAAE,YAAY;IAQzC,kBAAkB,CAAC,EAAE,EAAE,MAAM;IAW7B,mBAAmB,CACjB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,EAC1C,OAAO,GAAE,MAAM,IAAe,EAC9B,OAAO,GAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAkB;IAsB7C,KAAK;CAGN"}
|
|
@@ -20,7 +20,22 @@
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.PseudoIPCClient = exports.PseudoIPCServer = void 0;
|
|
22
22
|
const net_1 = require("net");
|
|
23
|
+
const fs_1 = require("fs");
|
|
23
24
|
const consume_messages_from_socket_1 = require("../utils/consume-messages-from-socket");
|
|
25
|
+
const socket_utils_1 = require("../daemon/socket-utils");
|
|
26
|
+
/**
|
|
27
|
+
* Remove a stale socket file if it exists.
|
|
28
|
+
* This handles cases where a previous process with the same PID
|
|
29
|
+
* left behind a socket file (e.g., due to PID recycling in containers).
|
|
30
|
+
*/
|
|
31
|
+
function cleanupSocketFile(path) {
|
|
32
|
+
if (!socket_utils_1.isWindows) {
|
|
33
|
+
try {
|
|
34
|
+
(0, fs_1.unlinkSync)(path);
|
|
35
|
+
}
|
|
36
|
+
catch { }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
24
39
|
class PseudoIPCServer {
|
|
25
40
|
constructor(path) {
|
|
26
41
|
this.path = path;
|
|
@@ -30,6 +45,7 @@ class PseudoIPCServer {
|
|
|
30
45
|
}
|
|
31
46
|
init() {
|
|
32
47
|
return new Promise((res) => {
|
|
48
|
+
cleanupSocketFile(this.path);
|
|
33
49
|
this.server = new net_1.Server((socket) => {
|
|
34
50
|
this.sockets.add(socket);
|
|
35
51
|
this.registerChildMessages(socket);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-graph-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/task-graph-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAQ,SAAS,EAAE,MAAM,sBAAsB,CAAC;AA0BvD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAC/B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACvC,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACnD,GAAG,MAAM,EAAE,GAAG,IAAI,CAYlB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,YAAY,EAAE,M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,MAAM,CAAC,CAU9D"}
|
|
@@ -65,8 +65,14 @@ function _makeAcyclic(graph, id, visited, path) {
|
|
|
65
65
|
const continuousDeps = graph.continuousDependencies?.[id] ?? [];
|
|
66
66
|
for (const d of [...deps, ...continuousDeps]) {
|
|
67
67
|
if (path.includes(d)) {
|
|
68
|
-
deps.
|
|
69
|
-
|
|
68
|
+
const depsIdx = deps.indexOf(d);
|
|
69
|
+
if (depsIdx >= 0) {
|
|
70
|
+
deps.splice(depsIdx, 1);
|
|
71
|
+
}
|
|
72
|
+
const continuousIdx = continuousDeps.indexOf(d);
|
|
73
|
+
if (continuousIdx >= 0) {
|
|
74
|
+
continuousDeps.splice(continuousIdx, 1);
|
|
75
|
+
}
|
|
70
76
|
}
|
|
71
77
|
else {
|
|
72
78
|
_makeAcyclic(graph, d, visited, [...path, d]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-sandbox.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/is-sandbox.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,IAAI,OAAO,CAOnC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSandbox = isSandbox;
|
|
4
|
+
function isSandbox() {
|
|
5
|
+
return (!!process.env.SANDBOX_RUNTIME ||
|
|
6
|
+
!!process.env.GEMINI_SANDBOX ||
|
|
7
|
+
!!process.env.CODEX_SANDBOX ||
|
|
8
|
+
!!process.env.CURSOR_SANDBOX);
|
|
9
|
+
}
|