nx 21.3.5 → 21.3.6
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/native/index.d.ts +3 -0
- package/src/native/native-bindings.js +1 -0
- package/src/native/nx.wasi.cjs +12 -10
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +5 -1
- package/src/project-graph/utils/normalize-project-nodes.d.ts +5 -5
- package/src/project-graph/utils/normalize-project-nodes.js +35 -6
- package/src/tasks-runner/is-tui-enabled.js +2 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "21.3.
|
3
|
+
"version": "21.3.6",
|
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": {
|
@@ -83,16 +83,16 @@
|
|
83
83
|
}
|
84
84
|
},
|
85
85
|
"optionalDependencies": {
|
86
|
-
"@nx/nx-darwin-arm64": "21.3.
|
87
|
-
"@nx/nx-darwin-x64": "21.3.
|
88
|
-
"@nx/nx-freebsd-x64": "21.3.
|
89
|
-
"@nx/nx-linux-arm-gnueabihf": "21.3.
|
90
|
-
"@nx/nx-linux-arm64-gnu": "21.3.
|
91
|
-
"@nx/nx-linux-arm64-musl": "21.3.
|
92
|
-
"@nx/nx-linux-x64-gnu": "21.3.
|
93
|
-
"@nx/nx-linux-x64-musl": "21.3.
|
94
|
-
"@nx/nx-win32-arm64-msvc": "21.3.
|
95
|
-
"@nx/nx-win32-x64-msvc": "21.3.
|
86
|
+
"@nx/nx-darwin-arm64": "21.3.6",
|
87
|
+
"@nx/nx-darwin-x64": "21.3.6",
|
88
|
+
"@nx/nx-freebsd-x64": "21.3.6",
|
89
|
+
"@nx/nx-linux-arm-gnueabihf": "21.3.6",
|
90
|
+
"@nx/nx-linux-arm64-gnu": "21.3.6",
|
91
|
+
"@nx/nx-linux-arm64-musl": "21.3.6",
|
92
|
+
"@nx/nx-linux-x64-gnu": "21.3.6",
|
93
|
+
"@nx/nx-linux-x64-musl": "21.3.6",
|
94
|
+
"@nx/nx-win32-arm64-msvc": "21.3.6",
|
95
|
+
"@nx/nx-win32-x64-msvc": "21.3.6"
|
96
96
|
},
|
97
97
|
"nx-migrations": {
|
98
98
|
"migrations": "./migrations.json",
|
package/src/native/index.d.ts
CHANGED
@@ -252,6 +252,9 @@ export declare export declare function installNxConsole(): void
|
|
252
252
|
|
253
253
|
export const IS_WASM: boolean
|
254
254
|
|
255
|
+
/** Detects if the current process is being run by an AI agent */
|
256
|
+
export declare export declare function isAiAgent(): boolean
|
257
|
+
|
255
258
|
export declare export declare function logDebug(message: string): void
|
256
259
|
|
257
260
|
/** Stripped version of the NxJson interface for use in rust */
|
@@ -392,6 +392,7 @@ module.exports.hashArray = nativeBinding.hashArray
|
|
392
392
|
module.exports.hashFile = nativeBinding.hashFile
|
393
393
|
module.exports.installNxConsole = nativeBinding.installNxConsole
|
394
394
|
module.exports.IS_WASM = nativeBinding.IS_WASM
|
395
|
+
module.exports.isAiAgent = nativeBinding.isAiAgent
|
395
396
|
module.exports.logDebug = nativeBinding.logDebug
|
396
397
|
module.exports.parseTaskStatus = nativeBinding.parseTaskStatus
|
397
398
|
module.exports.remove = nativeBinding.remove
|
package/src/native/nx.wasi.cjs
CHANGED
@@ -124,16 +124,17 @@ function __napi_rs_initialize_modules(__napiInstance) {
|
|
124
124
|
__napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_49']?.()
|
125
125
|
__napiInstance.exports['__napi_register__DepsOutputsInput_struct_50']?.()
|
126
126
|
__napiInstance.exports['__napi_register__NxJson_struct_51']?.()
|
127
|
-
__napiInstance.exports['
|
128
|
-
__napiInstance.exports['
|
129
|
-
__napiInstance.exports['
|
130
|
-
__napiInstance.exports['
|
131
|
-
__napiInstance.exports['
|
132
|
-
__napiInstance.exports['
|
133
|
-
__napiInstance.exports['
|
134
|
-
__napiInstance.exports['
|
135
|
-
__napiInstance.exports['
|
136
|
-
__napiInstance.exports['
|
127
|
+
__napiInstance.exports['__napi_register__is_ai_agent_52']?.()
|
128
|
+
__napiInstance.exports['__napi_register__FileLock_struct_53']?.()
|
129
|
+
__napiInstance.exports['__napi_register__FileLock_impl_55']?.()
|
130
|
+
__napiInstance.exports['__napi_register__WorkspaceContext_struct_56']?.()
|
131
|
+
__napiInstance.exports['__napi_register__WorkspaceContext_impl_67']?.()
|
132
|
+
__napiInstance.exports['__napi_register__WorkspaceErrors_68']?.()
|
133
|
+
__napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_69']?.()
|
134
|
+
__napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_70']?.()
|
135
|
+
__napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_71']?.()
|
136
|
+
__napiInstance.exports['__napi_register__FileMap_struct_72']?.()
|
137
|
+
__napiInstance.exports['__napi_register____test_only_transfer_file_map_73']?.()
|
137
138
|
}
|
138
139
|
module.exports.FileLock = __napiModule.exports.FileLock
|
139
140
|
module.exports.HashPlanInspector = __napiModule.exports.HashPlanInspector
|
@@ -153,6 +154,7 @@ module.exports.hashArray = __napiModule.exports.hashArray
|
|
153
154
|
module.exports.hashFile = __napiModule.exports.hashFile
|
154
155
|
module.exports.installNxConsole = __napiModule.exports.installNxConsole
|
155
156
|
module.exports.IS_WASM = __napiModule.exports.IS_WASM
|
157
|
+
module.exports.isAiAgent = __napiModule.exports.isAiAgent
|
156
158
|
module.exports.logDebug = __napiModule.exports.logDebug
|
157
159
|
module.exports.remove = __napiModule.exports.remove
|
158
160
|
module.exports.testOnlyTransferFileMap = __napiModule.exports.testOnlyTransferFileMap
|
Binary file
|
@@ -292,9 +292,13 @@ class TargetProjectLocator {
|
|
292
292
|
resolvedModule.includes('/node_modules/')) {
|
293
293
|
return undefined;
|
294
294
|
}
|
295
|
-
|
295
|
+
let normalizedResolvedModule = resolvedModule.startsWith('./')
|
296
296
|
? resolvedModule.substring(2)
|
297
297
|
: resolvedModule;
|
298
|
+
// Remove trailing slash to ensure proper project matching
|
299
|
+
if (normalizedResolvedModule.endsWith('/')) {
|
300
|
+
normalizedResolvedModule = normalizedResolvedModule.slice(0, -1);
|
301
|
+
}
|
298
302
|
const importedProject = this.findMatchingProjectFiles(normalizedResolvedModule);
|
299
303
|
return importedProject ? importedProject.name : void 0;
|
300
304
|
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { ProjectGraphProjectNode } from '../../config/project-graph';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
export declare function normalizeProjectNodes({ projects }: CreateDependenciesContext, builder: ProjectGraphBuilder): Promise<void>;
|
1
|
+
import type { ProjectGraphProjectNode } from '../../config/project-graph';
|
2
|
+
import type { ProjectConfiguration } from '../../config/workspace-json-project-json';
|
3
|
+
import type { CreateDependenciesContext } from '../plugins';
|
4
|
+
import type { ProjectGraphBuilder } from '../project-graph-builder';
|
5
|
+
export declare function normalizeProjectNodes({ projects, workspaceRoot }: CreateDependenciesContext, builder: ProjectGraphBuilder): Promise<void>;
|
6
6
|
export declare function normalizeImplicitDependencies(source: string, implicitDependencies: ProjectConfiguration['implicitDependencies'], projects: Record<string, ProjectGraphProjectNode>): string[];
|
@@ -2,8 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.normalizeProjectNodes = normalizeProjectNodes;
|
4
4
|
exports.normalizeImplicitDependencies = normalizeImplicitDependencies;
|
5
|
+
const node_fs_1 = require("node:fs");
|
6
|
+
const node_path_1 = require("node:path");
|
7
|
+
const fileutils_1 = require("../../utils/fileutils");
|
5
8
|
const find_matching_projects_1 = require("../../utils/find-matching-projects");
|
6
|
-
async function normalizeProjectNodes({ projects }, builder) {
|
9
|
+
async function normalizeProjectNodes({ projects, workspaceRoot }, builder) {
|
7
10
|
// Sorting projects by name to make sure that the order of projects in the graph is deterministic.
|
8
11
|
// This is important to ensure that expanded properties referencing projects (e.g. implicit dependencies)
|
9
12
|
// are also deterministic, and thus don't cause the calculated project configuration hash to shift.
|
@@ -26,11 +29,7 @@ async function normalizeProjectNodes({ projects }, builder) {
|
|
26
29
|
p.implicitDependencies = normalizeImplicitDependencies(key, p.implicitDependencies, partialProjectGraphNodes);
|
27
30
|
p.targets ??= {};
|
28
31
|
// TODO: remove in v16
|
29
|
-
const projectType = p.projectType
|
30
|
-
? key.endsWith('-e2e') || key === 'e2e'
|
31
|
-
? 'e2e'
|
32
|
-
: 'app'
|
33
|
-
: 'lib';
|
32
|
+
const projectType = getProjectType(key, p.projectType, workspaceRoot, p.root);
|
34
33
|
const tags = p.tags || [];
|
35
34
|
toAdd.push({
|
36
35
|
name: key,
|
@@ -86,3 +85,33 @@ function normalizeImplicitDependencies(source, implicitDependencies, projects) {
|
|
86
85
|
// detected by createDependencies.
|
87
86
|
return deps.concat(alwaysIgnoredDeps.map((x) => '!' + x));
|
88
87
|
}
|
88
|
+
function getProjectType(projectName, projectType, workspaceRoot, projectRoot) {
|
89
|
+
if (projectType) {
|
90
|
+
if (projectType === 'library') {
|
91
|
+
return 'lib';
|
92
|
+
}
|
93
|
+
if (projectName.endsWith('-e2e') || projectName === 'e2e') {
|
94
|
+
return 'e2e';
|
95
|
+
}
|
96
|
+
return 'app';
|
97
|
+
}
|
98
|
+
if ((0, node_fs_1.existsSync)((0, node_path_1.join)(workspaceRoot, projectRoot, 'tsconfig.lib.json'))) {
|
99
|
+
return 'lib';
|
100
|
+
}
|
101
|
+
if ((0, node_fs_1.existsSync)((0, node_path_1.join)(workspaceRoot, projectRoot, 'tsconfig.app.json'))) {
|
102
|
+
return 'app';
|
103
|
+
}
|
104
|
+
// If it doesn't have any common library entry points, assume it is an application
|
105
|
+
const packageJsonPath = (0, node_path_1.join)(workspaceRoot, projectRoot, 'package.json');
|
106
|
+
try {
|
107
|
+
const packageJson = (0, fileutils_1.readJsonFile)(packageJsonPath);
|
108
|
+
if (!packageJson.exports &&
|
109
|
+
!packageJson.main &&
|
110
|
+
!packageJson.module &&
|
111
|
+
!packageJson.bin) {
|
112
|
+
return 'app';
|
113
|
+
}
|
114
|
+
}
|
115
|
+
catch { }
|
116
|
+
return 'lib';
|
117
|
+
}
|
@@ -56,6 +56,8 @@ function shouldUseTui(nxJson, nxArgs, skipCapabilityCheck = process.env.NX_TUI_S
|
|
56
56
|
if (
|
57
57
|
// Interactive TUI doesn't make sense on CI
|
58
58
|
(0, is_ci_1.isCI)() ||
|
59
|
+
// Interactive TUI doesn't make sense in an AI agent context
|
60
|
+
(0, native_1.isAiAgent)() ||
|
59
61
|
// TODO(@JamesHenry): Remove this check once Windows issues are fixed.
|
60
62
|
// Windows is not working well right now, temporarily disable it on Windows even if it has been specified as enabled
|
61
63
|
isWindows ||
|