nx 21.6.1-beta.4 → 21.6.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/bin/nx.js +1 -0
- package/package.json +11 -11
- package/src/ai/constants.d.ts +15 -0
- package/src/ai/constants.d.ts.map +1 -0
- package/src/ai/constants.js +53 -0
- package/src/ai/set-up-ai-agents/schema.d.ts +1 -0
- package/src/ai/set-up-ai-agents/schema.json +9 -0
- package/src/ai/set-up-ai-agents/set-up-ai-agents.d.ts +7 -2
- 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 +151 -22
- package/src/ai/utils.d.ts +20 -0
- package/src/ai/utils.d.ts.map +1 -0
- package/src/ai/utils.js +187 -0
- package/src/command-line/configure-ai-agents/command-object.d.ts +9 -0
- package/src/command-line/configure-ai-agents/command-object.d.ts.map +1 -0
- package/src/command-line/configure-ai-agents/command-object.js +32 -0
- package/src/command-line/configure-ai-agents/configure-ai-agents.d.ts +4 -0
- package/src/command-line/configure-ai-agents/configure-ai-agents.d.ts.map +1 -0
- package/src/command-line/configure-ai-agents/configure-ai-agents.js +231 -0
- package/src/command-line/format/format.js +5 -1
- package/src/command-line/migrate/migrate.d.ts.map +1 -1
- package/src/command-line/migrate/migrate.js +5 -0
- package/src/command-line/nx-commands.d.ts.map +1 -1
- package/src/command-line/nx-commands.js +17 -15
- package/src/command-line/release/publish.d.ts.map +1 -1
- package/src/command-line/release/publish.js +8 -0
- package/src/command-line/run/run-one.d.ts.map +1 -1
- package/src/command-line/run/run-one.js +9 -9
- package/src/config/workspace-json-project-json.d.ts +1 -0
- package/src/config/workspace-json-project-json.d.ts.map +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/native/index.d.ts +15 -0
- package/src/native/native-bindings.js +4 -0
- package/src/native/nx.wasi.cjs +53 -45
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/plugins/js/lock-file/npm-parser.d.ts.map +1 -1
- package/src/plugins/js/lock-file/npm-parser.js +4 -1
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.js +7 -7
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +1 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts.map +1 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +33 -2
- package/src/project-graph/build-project-graph.d.ts.map +1 -1
- package/src/project-graph/build-project-graph.js +18 -19
- package/src/project-graph/plugins/loaded-nx-plugin.d.ts.map +1 -1
- package/src/project-graph/plugins/public-api.d.ts +4 -0
- package/src/project-graph/plugins/public-api.d.ts.map +1 -1
- package/src/project-graph/utils/project-configuration-utils.d.ts.map +1 -1
- package/src/project-graph/utils/project-configuration-utils.js +4 -6
- package/src/tasks-runner/life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/run-command.d.ts.map +1 -1
- package/src/tasks-runner/run-command.js +7 -2
- package/src/tasks-runner/utils.d.ts.map +1 -1
- package/src/tasks-runner/utils.js +3 -1
- package/src/utils/package-json.d.ts.map +1 -1
- package/src/utils/package-json.js +2 -1
- package/src/utils/split-target.d.ts.map +1 -1
- package/src/utils/split-target.js +46 -6
@@ -61,7 +61,7 @@ function buildTargetFromScript(script, scripts = {}, packageManagerCommand) {
|
|
61
61
|
}
|
62
62
|
let packageManagerCommand;
|
63
63
|
function getMetadataFromPackageJson(packageJson, isInPackageManagerWorkspaces) {
|
64
|
-
const { scripts, nx, description, name, exports, main } = packageJson;
|
64
|
+
const { scripts, nx, description, name, exports, main, version } = packageJson;
|
65
65
|
const includedScripts = nx?.includedScripts || Object.keys(scripts ?? {});
|
66
66
|
return {
|
67
67
|
targetGroups: {
|
@@ -70,6 +70,7 @@ function getMetadataFromPackageJson(packageJson, isInPackageManagerWorkspaces) {
|
|
70
70
|
description,
|
71
71
|
js: {
|
72
72
|
packageName: name,
|
73
|
+
packageVersion: version,
|
73
74
|
packageExports: exports,
|
74
75
|
packageMain: main,
|
75
76
|
isInPackageManagerWorkspaces,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"split-target.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/split-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
1
|
+
{"version":3,"file":"split-target.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/split-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAkCvD,wBAAgB,WAAW,CACzB,CAAC,EAAE,MAAM,EACT,YAAY,EAAE,YAAY,GACzB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,CA4B5D;AAuBD,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAiBrB,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CACtC"}
|
@@ -2,13 +2,53 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.splitTarget = splitTarget;
|
4
4
|
exports.splitByColons = splitByColons;
|
5
|
+
function findMatchingSegments(s, projectGraph) {
|
6
|
+
const projectNames = Object.keys(projectGraph.nodes);
|
7
|
+
// return project if matching
|
8
|
+
if (projectNames.includes(s)) {
|
9
|
+
return [s];
|
10
|
+
}
|
11
|
+
if (!s.includes(':')) {
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
for (const projectName of projectNames) {
|
15
|
+
for (const [targetName, targetConfig] of Object.entries(projectGraph.nodes[projectName].data.targets || {})) {
|
16
|
+
if (s === `${projectName}:${targetName}`) {
|
17
|
+
return [projectName, targetName];
|
18
|
+
}
|
19
|
+
if (targetConfig.configurations) {
|
20
|
+
for (const configurationName of Object.keys(targetConfig.configurations)) {
|
21
|
+
if (s === `${projectName}:${targetName}:${configurationName}`) {
|
22
|
+
return [projectName, targetName, configurationName];
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
5
29
|
function splitTarget(s, projectGraph) {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
30
|
+
const matchingSegments = findMatchingSegments(s, projectGraph);
|
31
|
+
if (matchingSegments) {
|
32
|
+
return matchingSegments;
|
33
|
+
}
|
34
|
+
if (s.indexOf(':') > 0) {
|
35
|
+
let [project, ...segments] = splitByColons(s);
|
36
|
+
// if only configuration cannot be matched, try to match project and target
|
37
|
+
const configuration = segments[segments.length - 1];
|
38
|
+
const rest = s.slice(0, -(configuration.length + 1));
|
39
|
+
const matchingSegments = findMatchingSegments(rest, projectGraph);
|
40
|
+
if (matchingSegments && matchingSegments.length === 2) {
|
41
|
+
return [...matchingSegments, configuration];
|
42
|
+
}
|
43
|
+
// no project-target pair found, do the naive matching
|
44
|
+
const validTargets = projectGraph.nodes[project]
|
45
|
+
? projectGraph.nodes[project].data.targets
|
46
|
+
: {};
|
47
|
+
const validTargetNames = new Set(Object.keys(validTargets ?? {}));
|
48
|
+
return [project, ...groupJointSegments(segments, validTargetNames)];
|
49
|
+
}
|
50
|
+
// we don't know what to do with the string, return as is
|
51
|
+
return [s];
|
12
52
|
}
|
13
53
|
function groupJointSegments(segments, validTargetNames) {
|
14
54
|
for (let endingSegmentIdx = segments.length; endingSegmentIdx > 0; endingSegmentIdx--) {
|