nx 22.1.0-canary.20251114-b3e6b03 → 22.1.0-canary.20251117-e8576a8
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/executors.json +16 -16
- package/generators.json +13 -13
- package/migrations.json +143 -143
- package/package.json +11 -14
- package/presets/npm.json +4 -4
- package/schemas/nx-schema.json +1286 -1286
- package/schemas/project-schema.json +359 -359
- package/schemas/workspace-schema.json +165 -165
- package/src/ai/set-up-ai-agents/schema.json +31 -31
- package/src/core/graph/main.js +1 -1
- package/src/daemon/client/client.d.ts.map +1 -1
- package/src/daemon/client/client.js +4 -4
- package/src/daemon/client/daemon-socket-messenger.d.ts.map +1 -1
- package/src/daemon/client/daemon-socket-messenger.js +4 -0
- package/src/daemon/server/server.d.ts.map +1 -1
- package/src/daemon/server/server.js +4 -0
- package/src/executors/noop/schema.json +8 -8
- package/src/executors/run-commands/schema.json +187 -187
- package/src/executors/run-script/schema.json +25 -25
- package/src/native/nx.wasi-browser.js +45 -53
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +38 -38
- package/src/project-graph/plugins/resolve-plugin.js +1 -1
- package/src/tasks-runner/task-env-paths.d.ts +2 -0
- package/src/tasks-runner/task-env-paths.d.ts.map +1 -0
- package/src/tasks-runner/task-env-paths.js +45 -0
- package/src/tasks-runner/task-env.d.ts +3 -1
- package/src/tasks-runner/task-env.d.ts.map +1 -1
- package/src/tasks-runner/task-env.js +27 -51
- package/src/tasks-runner/task-orchestrator.js +1 -1
- package/src/utils/consume-messages-from-socket.d.ts.map +1 -1
- package/src/utils/consume-messages-from-socket.js +4 -2
|
@@ -59,55 +59,51 @@ function __napi_rs_initialize_modules(__napiInstance) {
|
|
|
59
59
|
__napiInstance.exports['__napi_register__get_transformable_outputs_5']?.()
|
|
60
60
|
__napiInstance.exports['__napi_register__hash_array_6']?.()
|
|
61
61
|
__napiInstance.exports['__napi_register__hash_file_7']?.()
|
|
62
|
-
__napiInstance.exports['
|
|
63
|
-
__napiInstance.exports['
|
|
64
|
-
__napiInstance.exports['
|
|
65
|
-
__napiInstance.exports['
|
|
66
|
-
__napiInstance.exports['
|
|
67
|
-
__napiInstance.exports['
|
|
68
|
-
__napiInstance.exports['
|
|
69
|
-
__napiInstance.exports['
|
|
70
|
-
__napiInstance.exports['
|
|
71
|
-
__napiInstance.exports['
|
|
72
|
-
__napiInstance.exports['
|
|
73
|
-
__napiInstance.exports['
|
|
74
|
-
__napiInstance.exports['
|
|
75
|
-
__napiInstance.exports['
|
|
76
|
-
__napiInstance.exports['
|
|
77
|
-
__napiInstance.exports['
|
|
78
|
-
__napiInstance.exports['
|
|
79
|
-
__napiInstance.exports['
|
|
80
|
-
__napiInstance.exports['
|
|
81
|
-
__napiInstance.exports['
|
|
82
|
-
__napiInstance.exports['
|
|
83
|
-
__napiInstance.exports['
|
|
84
|
-
__napiInstance.exports['
|
|
85
|
-
__napiInstance.exports['
|
|
86
|
-
__napiInstance.exports['
|
|
87
|
-
__napiInstance.exports['
|
|
88
|
-
__napiInstance.exports['
|
|
89
|
-
__napiInstance.exports['
|
|
90
|
-
__napiInstance.exports['
|
|
91
|
-
__napiInstance.exports['
|
|
92
|
-
__napiInstance.exports['
|
|
93
|
-
__napiInstance.exports['
|
|
94
|
-
__napiInstance.exports['
|
|
95
|
-
__napiInstance.exports['
|
|
96
|
-
__napiInstance.exports['
|
|
97
|
-
__napiInstance.exports['
|
|
98
|
-
__napiInstance.exports['
|
|
99
|
-
__napiInstance.exports['
|
|
100
|
-
__napiInstance.exports['
|
|
101
|
-
__napiInstance.exports['
|
|
102
|
-
__napiInstance.exports['
|
|
103
|
-
__napiInstance.exports['
|
|
104
|
-
__napiInstance.exports['
|
|
105
|
-
__napiInstance.exports['
|
|
106
|
-
__napiInstance.exports['
|
|
107
|
-
__napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_74']?.()
|
|
108
|
-
__napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_75']?.()
|
|
109
|
-
__napiInstance.exports['__napi_register__FileMap_struct_76']?.()
|
|
110
|
-
__napiInstance.exports['__napi_register____test_only_transfer_file_map_77']?.()
|
|
62
|
+
__napiInstance.exports['__napi_register__can_install_nx_console_8']?.()
|
|
63
|
+
__napiInstance.exports['__napi_register__install_nx_console_9']?.()
|
|
64
|
+
__napiInstance.exports['__napi_register__NxConsolePreferences_struct_10']?.()
|
|
65
|
+
__napiInstance.exports['__napi_register__NxConsolePreferences_impl_14']?.()
|
|
66
|
+
__napiInstance.exports['__napi_register__log_debug_15']?.()
|
|
67
|
+
__napiInstance.exports['__napi_register__IS_WASM_16']?.()
|
|
68
|
+
__napiInstance.exports['__napi_register__get_binary_target_17']?.()
|
|
69
|
+
__napiInstance.exports['__napi_register__ImportResult_struct_18']?.()
|
|
70
|
+
__napiInstance.exports['__napi_register__find_imports_19']?.()
|
|
71
|
+
__napiInstance.exports['__napi_register__transfer_project_graph_20']?.()
|
|
72
|
+
__napiInstance.exports['__napi_register__ExternalNode_struct_21']?.()
|
|
73
|
+
__napiInstance.exports['__napi_register__Target_struct_22']?.()
|
|
74
|
+
__napiInstance.exports['__napi_register__Project_struct_23']?.()
|
|
75
|
+
__napiInstance.exports['__napi_register__ProjectGraph_struct_24']?.()
|
|
76
|
+
__napiInstance.exports['__napi_register__HashPlanInspector_struct_25']?.()
|
|
77
|
+
__napiInstance.exports['__napi_register__HashPlanInspector_impl_28']?.()
|
|
78
|
+
__napiInstance.exports['__napi_register__HashPlanner_struct_29']?.()
|
|
79
|
+
__napiInstance.exports['__napi_register__HashPlanner_impl_33']?.()
|
|
80
|
+
__napiInstance.exports['__napi_register__HashDetails_struct_34']?.()
|
|
81
|
+
__napiInstance.exports['__napi_register__HasherOptions_struct_35']?.()
|
|
82
|
+
__napiInstance.exports['__napi_register__TaskHasher_struct_36']?.()
|
|
83
|
+
__napiInstance.exports['__napi_register__TaskHasher_impl_39']?.()
|
|
84
|
+
__napiInstance.exports['__napi_register__Task_struct_40']?.()
|
|
85
|
+
__napiInstance.exports['__napi_register__TaskTarget_struct_41']?.()
|
|
86
|
+
__napiInstance.exports['__napi_register__TaskResult_struct_42']?.()
|
|
87
|
+
__napiInstance.exports['__napi_register__TaskGraph_struct_43']?.()
|
|
88
|
+
__napiInstance.exports['__napi_register__FileData_struct_44']?.()
|
|
89
|
+
__napiInstance.exports['__napi_register__InputsInput_struct_45']?.()
|
|
90
|
+
__napiInstance.exports['__napi_register__FileSetInput_struct_46']?.()
|
|
91
|
+
__napiInstance.exports['__napi_register__RuntimeInput_struct_47']?.()
|
|
92
|
+
__napiInstance.exports['__napi_register__EnvironmentInput_struct_48']?.()
|
|
93
|
+
__napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_49']?.()
|
|
94
|
+
__napiInstance.exports['__napi_register__DepsOutputsInput_struct_50']?.()
|
|
95
|
+
__napiInstance.exports['__napi_register__NxJson_struct_51']?.()
|
|
96
|
+
__napiInstance.exports['__napi_register__is_ai_agent_52']?.()
|
|
97
|
+
__napiInstance.exports['__napi_register__FileLock_struct_53']?.()
|
|
98
|
+
__napiInstance.exports['__napi_register__FileLock_impl_55']?.()
|
|
99
|
+
__napiInstance.exports['__napi_register__WorkspaceContext_struct_56']?.()
|
|
100
|
+
__napiInstance.exports['__napi_register__WorkspaceContext_impl_67']?.()
|
|
101
|
+
__napiInstance.exports['__napi_register__WorkspaceErrors_68']?.()
|
|
102
|
+
__napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_69']?.()
|
|
103
|
+
__napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_70']?.()
|
|
104
|
+
__napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_71']?.()
|
|
105
|
+
__napiInstance.exports['__napi_register__FileMap_struct_72']?.()
|
|
106
|
+
__napiInstance.exports['__napi_register____test_only_transfer_file_map_73']?.()
|
|
111
107
|
}
|
|
112
108
|
export const FileLock = __napiModule.exports.FileLock
|
|
113
109
|
export const HashPlanInspector = __napiModule.exports.HashPlanInspector
|
|
@@ -117,7 +113,6 @@ export const NxConsolePreferences = __napiModule.exports.NxConsolePreferences
|
|
|
117
113
|
export const TaskHasher = __napiModule.exports.TaskHasher
|
|
118
114
|
export const WorkspaceContext = __napiModule.exports.WorkspaceContext
|
|
119
115
|
export const canInstallNxConsole = __napiModule.exports.canInstallNxConsole
|
|
120
|
-
export const canInstallNxConsoleForEditor = __napiModule.exports.canInstallNxConsoleForEditor
|
|
121
116
|
export const copy = __napiModule.exports.copy
|
|
122
117
|
export const expandOutputs = __napiModule.exports.expandOutputs
|
|
123
118
|
export const findImports = __napiModule.exports.findImports
|
|
@@ -127,13 +122,10 @@ export const getTransformableOutputs = __napiModule.exports.getTransformableOutp
|
|
|
127
122
|
export const hashArray = __napiModule.exports.hashArray
|
|
128
123
|
export const hashFile = __napiModule.exports.hashFile
|
|
129
124
|
export const installNxConsole = __napiModule.exports.installNxConsole
|
|
130
|
-
export const installNxConsoleForEditor = __napiModule.exports.installNxConsoleForEditor
|
|
131
125
|
export const IS_WASM = __napiModule.exports.IS_WASM
|
|
132
126
|
export const isAiAgent = __napiModule.exports.isAiAgent
|
|
133
|
-
export const isEditorInstalled = __napiModule.exports.isEditorInstalled
|
|
134
127
|
export const logDebug = __napiModule.exports.logDebug
|
|
135
128
|
export const remove = __napiModule.exports.remove
|
|
136
|
-
export const SupportedEditor = __napiModule.exports.SupportedEditor
|
|
137
129
|
export const testOnlyTransferFileMap = __napiModule.exports.testOnlyTransferFileMap
|
|
138
130
|
export const transferProjectGraph = __napiModule.exports.transferProjectGraph
|
|
139
131
|
export const validateOutputs = __napiModule.exports.validateOutputs
|
|
Binary file
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"id": "NxCloudInit",
|
|
4
|
+
"title": "Add Nx Cloud Configuration to the workspace",
|
|
5
|
+
"description": "Connect a workspace to Nx Cloud.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"cli": "nx",
|
|
8
|
+
"properties": {
|
|
9
|
+
"analytics": {
|
|
10
|
+
"type": "boolean",
|
|
11
|
+
"description": "Anonymously store hashed machine ID for task runs",
|
|
12
|
+
"default": false
|
|
13
|
+
},
|
|
14
|
+
"installationSource": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Name of Nx Cloud installation invoker (ex. user, add-nx-to-monorepo, create-nx-workspace, nx-upgrade",
|
|
17
|
+
"default": "user"
|
|
18
|
+
},
|
|
19
|
+
"hideFormatLogs": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"description": "Hide formatting logs",
|
|
22
|
+
"x-priority": "internal"
|
|
23
|
+
},
|
|
24
|
+
"generateToken": {
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"description": "Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud"
|
|
27
|
+
},
|
|
28
|
+
"github": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "If the user will be using GitHub as their git hosting provider",
|
|
31
|
+
"default": false
|
|
32
|
+
},
|
|
33
|
+
"directory": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "The directory where the workspace is located",
|
|
36
|
+
"x-priority": "internal"
|
|
37
|
+
}
|
|
13
38
|
},
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
"description": "Name of Nx Cloud installation invoker (ex. user, add-nx-to-monorepo, create-nx-workspace, nx-upgrade",
|
|
17
|
-
"default": "user"
|
|
18
|
-
},
|
|
19
|
-
"hideFormatLogs": {
|
|
20
|
-
"type": "boolean",
|
|
21
|
-
"description": "Hide formatting logs",
|
|
22
|
-
"x-priority": "internal"
|
|
23
|
-
},
|
|
24
|
-
"generateToken": {
|
|
25
|
-
"type": "boolean",
|
|
26
|
-
"description": "Explicitly asks for a token to be created, do not override existing tokens from Nx Cloud"
|
|
27
|
-
},
|
|
28
|
-
"github": {
|
|
29
|
-
"type": "boolean",
|
|
30
|
-
"description": "If the user will be using GitHub as their git hosting provider",
|
|
31
|
-
"default": false
|
|
32
|
-
},
|
|
33
|
-
"directory": {
|
|
34
|
-
"type": "string",
|
|
35
|
-
"description": "The directory where the workspace is located",
|
|
36
|
-
"x-priority": "internal"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"additionalProperties": false,
|
|
40
|
-
"required": []
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"required": []
|
|
41
41
|
}
|
|
@@ -16,7 +16,7 @@ let projectsWithoutInference;
|
|
|
16
16
|
let projectsWithoutInferencePromise = null;
|
|
17
17
|
async function resolveNxPlugin(moduleName, root, paths) {
|
|
18
18
|
try {
|
|
19
|
-
require.resolve(moduleName);
|
|
19
|
+
require.resolve(moduleName, { paths });
|
|
20
20
|
}
|
|
21
21
|
catch {
|
|
22
22
|
// If a plugin cannot be resolved, we will need projects to resolve it
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-env-paths.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/task-env-paths.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,MAAM,EACtB,iBAAiB,CAAC,EAAE,MAAM,GACzB,MAAM,EAAE,CA6BV"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnvPathsForTask = getEnvPathsForTask;
|
|
4
|
+
function getEnvPathsForTask(projectRoot, target, configuration, nonAtomizedTarget) {
|
|
5
|
+
const identifiers = [];
|
|
6
|
+
// Configuration-specific identifier (like build.development, build.production)
|
|
7
|
+
if (configuration) {
|
|
8
|
+
identifiers.push(`${target}.${configuration}`);
|
|
9
|
+
if (nonAtomizedTarget) {
|
|
10
|
+
identifiers.push(`${nonAtomizedTarget}.${configuration}`);
|
|
11
|
+
}
|
|
12
|
+
identifiers.push(configuration);
|
|
13
|
+
}
|
|
14
|
+
// Non-configuration-specific identifier (like build, test, serve)
|
|
15
|
+
identifiers.push(target);
|
|
16
|
+
if (nonAtomizedTarget) {
|
|
17
|
+
identifiers.push(nonAtomizedTarget);
|
|
18
|
+
}
|
|
19
|
+
// Non-deterministic identifier (for files like .env.local, .local.env, .env)
|
|
20
|
+
identifiers.push('');
|
|
21
|
+
const envPaths = [];
|
|
22
|
+
// Add DotEnv Files in the project root folder
|
|
23
|
+
for (const identifier of identifiers) {
|
|
24
|
+
envPaths.push(...getEnvFileVariants(identifier, projectRoot));
|
|
25
|
+
}
|
|
26
|
+
// Add DotEnv Files in the workspace root folder
|
|
27
|
+
for (const identifier of identifiers) {
|
|
28
|
+
envPaths.push(...getEnvFileVariants(identifier));
|
|
29
|
+
}
|
|
30
|
+
return envPaths;
|
|
31
|
+
}
|
|
32
|
+
function getEnvFileVariants(identifier, root) {
|
|
33
|
+
const path = root ? root + '/' : '';
|
|
34
|
+
if (identifier) {
|
|
35
|
+
return [
|
|
36
|
+
`${path}.env.${identifier}.local`,
|
|
37
|
+
`${path}.env.${identifier}`,
|
|
38
|
+
`${path}.${identifier}.local.env`,
|
|
39
|
+
`${path}.${identifier}.env`,
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return [`${path}.env.local`, `${path}.local.env`, `${path}.env`];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Task } from '../config/task-graph';
|
|
2
|
+
import { ProjectGraph } from '../config/project-graph';
|
|
2
3
|
export declare function getEnvVariablesForBatchProcess(skipNxCache: boolean, captureStderr: boolean): NodeJS.ProcessEnv;
|
|
3
|
-
export declare function getTaskSpecificEnv(task: Task): NodeJS.ProcessEnv;
|
|
4
|
+
export declare function getTaskSpecificEnv(task: Task, graph: ProjectGraph): NodeJS.ProcessEnv;
|
|
4
5
|
export declare function getEnvVariablesForTask(task: Task, taskSpecificEnv: NodeJS.ProcessEnv, forceColor: string, skipNxCache: boolean, captureStderr: boolean, outputPath: string, streamOutput: boolean): NodeJS.ProcessEnv;
|
|
5
6
|
/**
|
|
6
7
|
* This function loads a .env file and expands the variables in it.
|
|
@@ -15,4 +16,5 @@ export declare function loadAndExpandDotEnvFile(filename: string, environmentVar
|
|
|
15
16
|
* @param environmentVariables
|
|
16
17
|
*/
|
|
17
18
|
export declare function unloadDotEnvFile(filename: string, environmentVariables: NodeJS.ProcessEnv, override?: boolean): void;
|
|
19
|
+
export declare function getEnvFilesForTask(task: Task, graph: ProjectGraph): string[];
|
|
18
20
|
//# sourceMappingURL=task-env.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-env.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/task-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"task-env.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/tasks-runner/task-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAK5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,OAAO,EACpB,aAAa,EAAE,OAAO,GACrB,MAAM,CAAC,UAAU,CAWnB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,qBAOjE;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,MAAM,CAAC,UAAU,EAClC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,OAAO,EACpB,aAAa,EAAE,OAAO,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,OAAO,GACpB,MAAM,CAAC,UAAU,CAwBnB;AA+DD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,oBAAoB,EAAE,MAAM,CAAC,UAAU,EACvC,QAAQ,UAAQ,8CAWjB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,oBAAoB,EAAE,MAAM,CAAC,UAAU,EACvC,QAAQ,UAAQ,QASjB;AAwBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAS5E"}
|
|
@@ -5,10 +5,12 @@ exports.getTaskSpecificEnv = getTaskSpecificEnv;
|
|
|
5
5
|
exports.getEnvVariablesForTask = getEnvVariablesForTask;
|
|
6
6
|
exports.loadAndExpandDotEnvFile = loadAndExpandDotEnvFile;
|
|
7
7
|
exports.unloadDotEnvFile = unloadDotEnvFile;
|
|
8
|
+
exports.getEnvFilesForTask = getEnvFilesForTask;
|
|
8
9
|
const dotenv_1 = require("dotenv");
|
|
9
10
|
const dotenv_expand_1 = require("dotenv-expand");
|
|
10
11
|
const workspace_root_1 = require("../utils/workspace-root");
|
|
11
12
|
const node_path_1 = require("node:path");
|
|
13
|
+
const task_env_paths_1 = require("./task-env-paths");
|
|
12
14
|
function getEnvVariablesForBatchProcess(skipNxCache, captureStderr) {
|
|
13
15
|
return {
|
|
14
16
|
// User Process Env Variables override Dotenv Variables
|
|
@@ -17,11 +19,11 @@ function getEnvVariablesForBatchProcess(skipNxCache, captureStderr) {
|
|
|
17
19
|
...getNxEnvVariablesForForkedProcess(process.env.FORCE_COLOR === undefined ? 'true' : process.env.FORCE_COLOR, skipNxCache, captureStderr),
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
|
-
function getTaskSpecificEnv(task) {
|
|
22
|
+
function getTaskSpecificEnv(task, graph) {
|
|
21
23
|
// Unload any dot env files at the root of the workspace that were loaded on init of Nx.
|
|
22
24
|
const taskEnv = unloadDotEnvFiles({ ...process.env });
|
|
23
25
|
return process.env.NX_LOAD_DOT_ENV_FILES === 'true'
|
|
24
|
-
? loadDotEnvFilesForTask(task, taskEnv)
|
|
26
|
+
? loadDotEnvFilesForTask(task, graph, taskEnv)
|
|
25
27
|
: // If not loading dot env files, ensure env vars created by system are still loaded
|
|
26
28
|
taskEnv;
|
|
27
29
|
}
|
|
@@ -110,56 +112,30 @@ function unloadDotEnvFile(filename, environmentVariables, override = false) {
|
|
|
110
112
|
}
|
|
111
113
|
});
|
|
112
114
|
}
|
|
113
|
-
function
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
`${task.projectRoot}/.env.local`,
|
|
135
|
-
`${task.projectRoot}/.local.env`,
|
|
136
|
-
`${task.projectRoot}/.env`,
|
|
137
|
-
// Load DotEnv Files for a configuration in the workspace root
|
|
138
|
-
...(task.target.configuration
|
|
139
|
-
? [
|
|
140
|
-
`.env.${task.target.target}.${task.target.configuration}.local`,
|
|
141
|
-
`.env.${task.target.target}.${task.target.configuration}`,
|
|
142
|
-
`.env.${task.target.configuration}.local`,
|
|
143
|
-
`.env.${task.target.configuration}`,
|
|
144
|
-
`.${task.target.target}.${task.target.configuration}.local.env`,
|
|
145
|
-
`.${task.target.target}.${task.target.configuration}.env`,
|
|
146
|
-
`.${task.target.configuration}.local.env`,
|
|
147
|
-
`.${task.target.configuration}.env`,
|
|
148
|
-
]
|
|
149
|
-
: []),
|
|
150
|
-
// Load DotEnv Files for a target in the workspace root
|
|
151
|
-
`.env.${task.target.target}.local`,
|
|
152
|
-
`.env.${task.target.target}`,
|
|
153
|
-
`.${task.target.target}.local.env`,
|
|
154
|
-
`.${task.target.target}.env`,
|
|
155
|
-
// Load base DotEnv Files at workspace root
|
|
156
|
-
`.local.env`,
|
|
157
|
-
`.env.local`,
|
|
158
|
-
`.env`,
|
|
159
|
-
];
|
|
115
|
+
function getOwnerTargetForTask(task, graph) {
|
|
116
|
+
const project = graph.nodes[task.target.project];
|
|
117
|
+
if (project.data.metadata?.targetGroups) {
|
|
118
|
+
for (const targets of Object.values(project.data.metadata.targetGroups)) {
|
|
119
|
+
if (targets.includes(task.target.target)) {
|
|
120
|
+
for (const target of targets) {
|
|
121
|
+
if (project.data.targets[target].metadata?.nonAtomizedTarget) {
|
|
122
|
+
return [
|
|
123
|
+
target,
|
|
124
|
+
project.data.targets[target].metadata?.nonAtomizedTarget,
|
|
125
|
+
];
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return [task.target.target];
|
|
132
|
+
}
|
|
133
|
+
function getEnvFilesForTask(task, graph) {
|
|
134
|
+
const [target, nonAtomizedTarget] = getOwnerTargetForTask(task, graph);
|
|
135
|
+
return (0, task_env_paths_1.getEnvPathsForTask)(task.projectRoot, target, task.target.configuration, nonAtomizedTarget);
|
|
160
136
|
}
|
|
161
|
-
function loadDotEnvFilesForTask(task, environmentVariables) {
|
|
162
|
-
const dotEnvFiles = getEnvFilesForTask(task);
|
|
137
|
+
function loadDotEnvFilesForTask(task, graph, environmentVariables) {
|
|
138
|
+
const dotEnvFiles = getEnvFilesForTask(task, graph);
|
|
163
139
|
for (const file of dotEnvFiles) {
|
|
164
140
|
loadAndExpandDotEnvFile((0, node_path_1.join)(workspace_root_1.workspaceRoot, file), environmentVariables);
|
|
165
141
|
}
|
|
@@ -146,7 +146,7 @@ class TaskOrchestrator {
|
|
|
146
146
|
// region Processing Scheduled Tasks
|
|
147
147
|
async processTask(taskId) {
|
|
148
148
|
const task = this.taskGraph.tasks[taskId];
|
|
149
|
-
const taskSpecificEnv = (0, task_env_1.getTaskSpecificEnv)(task);
|
|
149
|
+
const taskSpecificEnv = (0, task_env_1.getTaskSpecificEnv)(task, this.projectGraph);
|
|
150
150
|
if (!task.hash) {
|
|
151
151
|
await (0, hash_task_1.hashTask)(this.hasher, this.projectGraph, this.taskGraphForHashing, task, taskSpecificEnv, this.taskDetails);
|
|
152
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consume-messages-from-socket.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/consume-messages-from-socket.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consume-messages-from-socket.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/consume-messages-from-socket.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,QACuB,CAAC;AAEpD,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,IAEnE,SAAI,UA4Bb;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAYtD"}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MESSAGE_END_SEQ = void 0;
|
|
4
4
|
exports.consumeMessagesFromSocket = consumeMessagesFromSocket;
|
|
5
5
|
exports.isJsonMessage = isJsonMessage;
|
|
6
|
-
|
|
6
|
+
const VERY_END_CODE = 4;
|
|
7
|
+
exports.MESSAGE_END_SEQ = 'NX_MSG_END' + String.fromCharCode(VERY_END_CODE);
|
|
7
8
|
function consumeMessagesFromSocket(callback) {
|
|
8
9
|
let message = '';
|
|
9
10
|
return (data) => {
|
|
@@ -11,7 +12,8 @@ function consumeMessagesFromSocket(callback) {
|
|
|
11
12
|
message += chunk;
|
|
12
13
|
// Check if accumulated message ends with MESSAGE_END_SEQ (not just the chunk)
|
|
13
14
|
// This handles TCP packet fragmentation where MESSAGE_END_SEQ may be split across packets
|
|
14
|
-
if (
|
|
15
|
+
if (chunk.codePointAt(chunk.length - 1) === VERY_END_CODE &&
|
|
16
|
+
message.endsWith(exports.MESSAGE_END_SEQ)) {
|
|
15
17
|
// Remove the trailing MESSAGE_END_SEQ
|
|
16
18
|
const fullMessage = message.substring(0, message.length - exports.MESSAGE_END_SEQ.length);
|
|
17
19
|
// Server may send multiple messages in one chunk, so splitting by MESSAGE_END_SEQ
|