nx 19.6.2 → 19.6.3
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.json +12 -1
- package/package.json +12 -12
- package/src/command-line/graph/graph.d.ts +18 -1
- package/src/command-line/migrate/migrate.js +5 -36
- package/src/command-line/yargs-utils/shared-options.d.ts +2 -1
- package/src/command-line/yargs-utils/shared-options.js +11 -15
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.js +4 -2
- package/src/devkit-exports.d.ts +1 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
package/.eslintrc.json
CHANGED
@@ -100,7 +100,18 @@
|
|
100
100
|
"events", // This is coming from @storybook/builder-manager since it uses the browser polyfill
|
101
101
|
"process", // This is coming from @storybook/builder-manager since it uses the browser polyfill
|
102
102
|
"prettier", // This is coming from @storybook/builder-manager since it uses the browser polyfill
|
103
|
-
"util" // This is coming from @storybook/builder-manager since it uses the browser polyfill
|
103
|
+
"util", // This is coming from @storybook/builder-manager since it uses the browser polyfill
|
104
|
+
// The native modules are optional and only one of them will ever be installed on a given machine
|
105
|
+
"@nx/nx-darwin-x64",
|
106
|
+
"@nx/nx-darwin-arm64",
|
107
|
+
"@nx/nx-linux-x64-gnu",
|
108
|
+
"@nx/nx-linux-x64-musl",
|
109
|
+
"@nx/nx-win32-x64-msvc",
|
110
|
+
"@nx/nx-linux-arm64-gnu",
|
111
|
+
"@nx/nx-linux-arm64-musl",
|
112
|
+
"@nx/nx-linux-arm-gnueabihf",
|
113
|
+
"@nx/nx-win32-arm64-msvc",
|
114
|
+
"@nx/nx-freebsd-x64"
|
104
115
|
]
|
105
116
|
}
|
106
117
|
]
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.6.
|
3
|
+
"version": "19.6.3",
|
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": {
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"yargs-parser": "21.1.1",
|
72
72
|
"node-machine-id": "1.1.12",
|
73
73
|
"ora": "5.3.0",
|
74
|
-
"@nrwl/tao": "19.6.
|
74
|
+
"@nrwl/tao": "19.6.3"
|
75
75
|
},
|
76
76
|
"peerDependencies": {
|
77
77
|
"@swc-node/register": "^1.8.0",
|
@@ -86,16 +86,16 @@
|
|
86
86
|
}
|
87
87
|
},
|
88
88
|
"optionalDependencies": {
|
89
|
-
"@nx/nx-darwin-x64": "19.6.
|
90
|
-
"@nx/nx-darwin-arm64": "19.6.
|
91
|
-
"@nx/nx-linux-x64-gnu": "19.6.
|
92
|
-
"@nx/nx-linux-x64-musl": "19.6.
|
93
|
-
"@nx/nx-win32-x64-msvc": "19.6.
|
94
|
-
"@nx/nx-linux-arm64-gnu": "19.6.
|
95
|
-
"@nx/nx-linux-arm64-musl": "19.6.
|
96
|
-
"@nx/nx-linux-arm-gnueabihf": "19.6.
|
97
|
-
"@nx/nx-win32-arm64-msvc": "19.6.
|
98
|
-
"@nx/nx-freebsd-x64": "19.6.
|
89
|
+
"@nx/nx-darwin-x64": "19.6.3",
|
90
|
+
"@nx/nx-darwin-arm64": "19.6.3",
|
91
|
+
"@nx/nx-linux-x64-gnu": "19.6.3",
|
92
|
+
"@nx/nx-linux-x64-musl": "19.6.3",
|
93
|
+
"@nx/nx-win32-x64-msvc": "19.6.3",
|
94
|
+
"@nx/nx-linux-arm64-gnu": "19.6.3",
|
95
|
+
"@nx/nx-linux-arm64-musl": "19.6.3",
|
96
|
+
"@nx/nx-linux-arm-gnueabihf": "19.6.3",
|
97
|
+
"@nx/nx-win32-arm64-msvc": "19.6.3",
|
98
|
+
"@nx/nx-freebsd-x64": "19.6.3"
|
99
99
|
},
|
100
100
|
"nx-migrations": {
|
101
101
|
"migrations": "./migrations.json",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ProjectFileMap, ProjectGraphDependency, ProjectGraphProjectNode } from '../../config/project-graph';
|
1
|
+
import { ProjectFileMap, ProjectGraph, ProjectGraphDependency, ProjectGraphProjectNode } from '../../config/project-graph';
|
2
2
|
import { TaskGraph } from '../../config/task-graph';
|
3
3
|
export interface GraphError {
|
4
4
|
message: string;
|
@@ -48,3 +48,20 @@ export declare function generateGraph(args: {
|
|
48
48
|
exclude?: string[];
|
49
49
|
affected?: boolean;
|
50
50
|
}, affectedProjects: string[]): Promise<void>;
|
51
|
+
/**
|
52
|
+
* The data type that `nx graph --file graph.json` or `nx build --graph graph.json` contains
|
53
|
+
*/
|
54
|
+
export interface GraphJson {
|
55
|
+
/**
|
56
|
+
* A graph of tasks populated with `nx build --graph`
|
57
|
+
*/
|
58
|
+
tasks?: TaskGraph;
|
59
|
+
/**
|
60
|
+
* The plans for hashing a task in the task graph
|
61
|
+
*/
|
62
|
+
taskPlans?: Record<string, string[]>;
|
63
|
+
/**
|
64
|
+
* The project graph
|
65
|
+
*/
|
66
|
+
graph: ProjectGraph;
|
67
|
+
}
|
@@ -1079,55 +1079,24 @@ function getImplementationPath(collection, collectionPath, name) {
|
|
1079
1079
|
}
|
1080
1080
|
return { path: implPath, fnSymbol };
|
1081
1081
|
}
|
1082
|
-
// TODO (
|
1083
|
-
// ```
|
1084
|
-
// return !collection.generators[name] && collection.schematics[name]
|
1085
|
-
// ```
|
1082
|
+
// TODO (v21): Remove CLI determination of Angular Migration
|
1086
1083
|
function isAngularMigration(collection, collectionPath, name) {
|
1087
1084
|
const entry = collection.generators?.[name] || collection.schematics?.[name];
|
1088
|
-
// In the future we will determine this based on the location of the entry in the collection.
|
1089
|
-
// If the entry is under `schematics`, it will be assumed to be an angular cli migration.
|
1090
|
-
// If the entry is under `generators`, it will be assumed to be an nx migration.
|
1091
|
-
// For now, we will continue to obey the cli property, if it exists.
|
1092
|
-
// If it doesn't exist, we will check if the implementation references @angular/devkit.
|
1093
1085
|
const shouldBeNx = !!collection.generators?.[name];
|
1094
1086
|
const shouldBeNg = !!collection.schematics?.[name];
|
1095
|
-
|
1096
|
-
const { path: implementationPath } = getImplementationPath(collection, collectionPath, name);
|
1097
|
-
const implStringContents = (0, fs_1.readFileSync)(implementationPath, 'utf-8');
|
1098
|
-
// TODO (v17): Remove this check and the cli property access - it is only here for backwards compatibility.
|
1099
|
-
if (['@angular/material', '@angular/cdk'].includes(collection.name) ||
|
1100
|
-
[
|
1101
|
-
"import('@angular-devkit",
|
1102
|
-
'import("@angular-devkit',
|
1103
|
-
"require('@angular-devkit",
|
1104
|
-
'require("@angular-devkit',
|
1105
|
-
"from '@angular-devkit",
|
1106
|
-
'from "@angular-devkit',
|
1107
|
-
].some((s) => implStringContents.includes(s))) {
|
1108
|
-
useAngularDevkitToRunMigration = true;
|
1109
|
-
}
|
1110
|
-
if (useAngularDevkitToRunMigration && shouldBeNx) {
|
1087
|
+
if (entry.cli && entry.cli !== 'nx' && collection.generators?.[name]) {
|
1111
1088
|
output_1.output.warn({
|
1112
1089
|
title: `The migration '${collection.name}:${name}' appears to be an Angular CLI migration, but is located in the 'generators' section of migrations.json.`,
|
1113
1090
|
bodyLines: [
|
1114
|
-
'In Nx
|
1115
|
-
|
1116
|
-
],
|
1117
|
-
});
|
1118
|
-
}
|
1119
|
-
if (!useAngularDevkitToRunMigration && entry.cli === 'nx' && shouldBeNg) {
|
1120
|
-
output_1.output.warn({
|
1121
|
-
title: `The migration '${collection.name}:${name}' appears to be an Nx migration, but is located in the 'schematics' section of migrations.json.`,
|
1122
|
-
bodyLines: [
|
1123
|
-
'In Nx 17, migrations inside `generators` will be treated as nx devkit migrations.',
|
1091
|
+
'In Nx 21, migrations inside `generators` will be treated as Nx Devkit migrations and therefore may not run correctly if they are using Angular Devkit.',
|
1092
|
+
'If the migration should be run with Angular Devkit, please place the migration inside `schematics` instead.',
|
1124
1093
|
"Please open an issue on the plugin's repository if you believe this is an error.",
|
1125
1094
|
],
|
1126
1095
|
});
|
1127
1096
|
}
|
1128
1097
|
// Currently, if the cli property exists we listen to it. If its nx, its not an ng cli migration.
|
1129
1098
|
// If the property is not set, we will fall back to our intuition.
|
1130
|
-
return entry.cli ? entry.cli !== 'nx' :
|
1099
|
+
return entry.cli ? entry.cli !== 'nx' : !shouldBeNx && shouldBeNg;
|
1131
1100
|
}
|
1132
1101
|
const getNgCompatLayer = (() => {
|
1133
1102
|
let _ngCliAdapter;
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import { Argv } from 'yargs';
|
1
|
+
import { Argv, ParserConfigurationOptions } from 'yargs';
|
2
2
|
interface ExcludeOptions {
|
3
3
|
exclude: string[];
|
4
4
|
}
|
5
|
+
export declare const defaultYargsParserConfiguration: Partial<ParserConfigurationOptions>;
|
5
6
|
export declare function withExcludeOption(yargs: Argv): Argv<ExcludeOptions>;
|
6
7
|
export interface RunOptions {
|
7
8
|
exclude: string;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.defaultYargsParserConfiguration = void 0;
|
3
4
|
exports.withExcludeOption = withExcludeOption;
|
4
5
|
exports.withRunOptions = withRunOptions;
|
5
6
|
exports.withTargetAndConfigurationOption = withTargetAndConfigurationOption;
|
@@ -12,6 +13,13 @@ exports.withOverrides = withOverrides;
|
|
12
13
|
exports.withOutputStyleOption = withOutputStyleOption;
|
13
14
|
exports.withRunOneOptions = withRunOneOptions;
|
14
15
|
exports.parseCSV = parseCSV;
|
16
|
+
exports.defaultYargsParserConfiguration = {
|
17
|
+
'strip-dashed': true,
|
18
|
+
'unknown-options-as-args': true,
|
19
|
+
'populate--': true,
|
20
|
+
'parse-numbers': false,
|
21
|
+
'parse-positional-numbers': false,
|
22
|
+
};
|
15
23
|
function withExcludeOption(yargs) {
|
16
24
|
return yargs.option('exclude', {
|
17
25
|
describe: 'Exclude certain projects from being processed',
|
@@ -128,11 +136,7 @@ function withBatch(yargs) {
|
|
128
136
|
}
|
129
137
|
function withAffectedOptions(yargs) {
|
130
138
|
return withExcludeOption(yargs)
|
131
|
-
.parserConfiguration(
|
132
|
-
'strip-dashed': true,
|
133
|
-
'unknown-options-as-args': true,
|
134
|
-
'populate--': true,
|
135
|
-
})
|
139
|
+
.parserConfiguration(exports.defaultYargsParserConfiguration)
|
136
140
|
.option('files', {
|
137
141
|
describe: 'Change the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas or spaces',
|
138
142
|
type: 'string',
|
@@ -169,11 +173,7 @@ function withAffectedOptions(yargs) {
|
|
169
173
|
}
|
170
174
|
function withRunManyOptions(yargs) {
|
171
175
|
return withRunOptions(yargs)
|
172
|
-
.parserConfiguration(
|
173
|
-
'strip-dashed': true,
|
174
|
-
'unknown-options-as-args': true,
|
175
|
-
'populate--': true,
|
176
|
-
})
|
176
|
+
.parserConfiguration(exports.defaultYargsParserConfiguration)
|
177
177
|
.option('projects', {
|
178
178
|
type: 'string',
|
179
179
|
alias: 'p',
|
@@ -225,11 +225,7 @@ function withOutputStyleOption(yargs, choices = [
|
|
225
225
|
function withRunOneOptions(yargs) {
|
226
226
|
const executorShouldShowHelp = !(process.argv[2] === 'run' && process.argv[3] === '--help');
|
227
227
|
const res = withRunOptions(withOutputStyleOption(withConfiguration(yargs), allOutputStyles))
|
228
|
-
.parserConfiguration(
|
229
|
-
'strip-dashed': true,
|
230
|
-
'unknown-options-as-args': true,
|
231
|
-
'populate--': true,
|
232
|
-
})
|
228
|
+
.parserConfiguration(exports.defaultYargsParserConfiguration)
|
233
229
|
.option('project', {
|
234
230
|
describe: 'Target project',
|
235
231
|
type: 'string',
|