nx 21.7.0-canary.20250930-e144408 → 22.0.0-beta.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 +2 -2
- package/src/command-line/format/command-object.js +2 -6
- package/src/command-line/init/implementation/add-nx-to-monorepo.js +2 -2
- package/src/command-line/release/changelog.d.ts.map +1 -1
- package/src/command-line/release/changelog.js +18 -32
- package/src/command-line/release/utils/git.d.ts +5 -1
- package/src/command-line/release/utils/git.d.ts.map +1 -1
- package/src/command-line/release/utils/git.js +8 -19
- package/src/devkit-internals.d.ts +1 -0
- package/src/devkit-internals.d.ts.map +1 -1
- package/src/devkit-internals.js +3 -1
- package/src/migrations/update-17-0-0/move-cache-directory.js +2 -2
- package/src/migrations/update-21-1-0/add-gitignore-entry.js +2 -2
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/utils/ignore.d.ts +3 -1
- package/src/utils/ignore.d.ts.map +1 -1
- package/src/utils/ignore.js +16 -2
- package/src/utils/provenance.d.ts.map +1 -1
- package/src/utils/provenance.js +28 -7
- package/src/adapter/decorate-cli.d.ts +0 -2
- package/src/adapter/decorate-cli.d.ts.map +0 -1
- package/src/adapter/decorate-cli.js +0 -25
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "
|
3
|
+
"version": "22.0.0-beta.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": {
|
@@ -49,7 +49,7 @@
|
|
49
49
|
"figures": "3.2.0",
|
50
50
|
"flat": "^5.0.2",
|
51
51
|
"front-matter": "^4.0.2",
|
52
|
-
"ignore": "^
|
52
|
+
"ignore": "^7.0.5",
|
53
53
|
"jest-diff": "^30.0.2",
|
54
54
|
"jsonc-parser": "3.2.0",
|
55
55
|
"lines-and-columns": "2.0.3",
|
@@ -37,7 +37,7 @@ function withFormatOptions(yargs) {
|
|
37
37
|
coerce: shared_options_1.parseCSV,
|
38
38
|
})
|
39
39
|
.option('sort-root-tsconfig-paths', {
|
40
|
-
describe: `Ensure the workspace's tsconfig compilerOptions.paths are sorted. Warning: This will cause comments in the tsconfig to be lost. The default value is "
|
40
|
+
describe: `Ensure the workspace's tsconfig compilerOptions.paths are sorted. Warning: This will cause comments in the tsconfig to be lost. The default value is "false" unless NX_FORMAT_SORT_TSCONFIG_PATHS is set to "true".`,
|
41
41
|
type: 'boolean',
|
42
42
|
})
|
43
43
|
.option('all', {
|
@@ -48,12 +48,8 @@ function withFormatOptions(yargs) {
|
|
48
48
|
all: 'projects',
|
49
49
|
})
|
50
50
|
.middleware((args) => {
|
51
|
-
/**
|
52
|
-
* TODO(v22): Stop sorting tsconfig paths by default, paths are now less common/important
|
53
|
-
* in Nx workspace setups, and the sorting causes comments to be lost.
|
54
|
-
*/
|
55
51
|
args.sortRootTsconfigPaths ??=
|
56
|
-
process.env.NX_FORMAT_SORT_TSCONFIG_PATHS
|
52
|
+
process.env.NX_FORMAT_SORT_TSCONFIG_PATHS === 'true';
|
57
53
|
// If NX_FORMAT_SORT_TSCONFIG_PATHS=false and --sort-root-tsconfig-paths is passed, we want to set it to true favoring the arg
|
58
54
|
process.env.NX_FORMAT_SORT_TSCONFIG_PATHS =
|
59
55
|
args.sortRootTsconfigPaths.toString();
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addNxToMonorepo = addNxToMonorepo;
|
4
4
|
const enquirer_1 = require("enquirer");
|
5
5
|
const fs_1 = require("fs");
|
6
|
-
const
|
6
|
+
const ignore = require("ignore");
|
7
7
|
const path_1 = require("path");
|
8
8
|
const fileutils_1 = require("../../../utils/fileutils");
|
9
9
|
const output_1 = require("../../../utils/output");
|
@@ -113,7 +113,7 @@ function allPackageJsonFiles(repoRoot, dirName) {
|
|
113
113
|
return res;
|
114
114
|
}
|
115
115
|
function getIgnoredGlobs(repoRoot) {
|
116
|
-
const ig = (
|
116
|
+
const ig = ignore();
|
117
117
|
try {
|
118
118
|
ig.add((0, fs_1.readFileSync)(`${repoRoot}/.gitignore`, 'utf-8'));
|
119
119
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/changelog.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAkB1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAmBpD,OAAO,EAEL,SAAS,
|
1
|
+
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/changelog.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,sBAAsB,EAAc,MAAM,sBAAsB,CAAC;AAkB1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAmBpD,OAAO,EAEL,SAAS,EAWV,MAAM,aAAa,CAAC;AAYrB,OAAO,EACL,cAAc,EASf,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,wBAAwB;IACvC,kBAAkB,CAAC,EAAE;QACnB,cAAc,EAAE,cAAc,CAAC;QAC/B,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;KACjC,CAAC;IACF,iBAAiB,CAAC,EAAE;QAClB,CAAC,WAAW,EAAE,MAAM,GAAG;YACrB,cAAc,EAAE,cAAc,CAAC;YAC/B,QAAQ,EAAE,MAAM,CAAC;YACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;SACjC,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAElE,eAAO,MAAM,0BAA0B,GAAI,MAAM,gBAAgB,oBACV,CAAC;AAExD,wBAAgB,SAAS,CAAC,qBAAqB,EAAE,sBAAsB,IAOnE,MAAM,gBAAgB,KACrB,OAAO,CAAC,wBAAwB,CAAC,CA+qBrC"}
|
@@ -155,8 +155,6 @@ function createAPI(overrideReleaseConfig) {
|
|
155
155
|
(0, shared_1.handleDuplicateGitTags)(gitTagValues);
|
156
156
|
const postGitTasks = [];
|
157
157
|
let workspaceChangelogChanges = [];
|
158
|
-
// TODO(v22): remove this after the changelog renderer is refactored to remove coupling with git commits
|
159
|
-
let workspaceChangelogCommits = [];
|
160
158
|
// If there are multiple release groups, we'll just skip the workspace changelog anyway.
|
161
159
|
const versionPlansEnabledForWorkspaceChangelog = releaseGroups[0].resolvedVersionPlans;
|
162
160
|
if (versionPlansEnabledForWorkspaceChangelog) {
|
@@ -168,13 +166,13 @@ function createAPI(overrideReleaseConfig) {
|
|
168
166
|
.flatMap((vp) => {
|
169
167
|
const releaseType = versionPlanSemverReleaseTypeToChangelogType(vp.groupVersionBump);
|
170
168
|
let githubReferences = [];
|
171
|
-
let
|
169
|
+
let authors = undefined;
|
172
170
|
const parsedCommit = vp.commit
|
173
|
-
? (0, git_1.
|
171
|
+
? (0, git_1.parseVersionPlanCommit)(vp.commit)
|
174
172
|
: null;
|
175
173
|
if (parsedCommit) {
|
176
174
|
githubReferences = parsedCommit.references;
|
177
|
-
|
175
|
+
authors = parsedCommit.authors;
|
178
176
|
}
|
179
177
|
const changes = !vp.triggeredByProjects
|
180
178
|
? {
|
@@ -184,8 +182,7 @@ function createAPI(overrideReleaseConfig) {
|
|
184
182
|
body: '',
|
185
183
|
isBreaking: releaseType.isBreaking,
|
186
184
|
githubReferences,
|
187
|
-
|
188
|
-
authors: [author],
|
185
|
+
authors,
|
189
186
|
affectedProjects: '*',
|
190
187
|
}
|
191
188
|
: vp.triggeredByProjects.map((project) => {
|
@@ -196,8 +193,7 @@ function createAPI(overrideReleaseConfig) {
|
|
196
193
|
body: '',
|
197
194
|
isBreaking: releaseType.isBreaking,
|
198
195
|
githubReferences,
|
199
|
-
|
200
|
-
authors: [author],
|
196
|
+
authors,
|
201
197
|
affectedProjects: [project],
|
202
198
|
};
|
203
199
|
});
|
@@ -229,8 +225,7 @@ function createAPI(overrideReleaseConfig) {
|
|
229
225
|
}
|
230
226
|
// Make sure that the fromRef is actually resolvable
|
231
227
|
const workspaceChangelogFromSHA = await (0, git_1.getCommitHash)(workspaceChangelogFromRef);
|
232
|
-
|
233
|
-
workspaceChangelogChanges = filterHiddenChanges(workspaceChangelogCommits.map((c) => {
|
228
|
+
workspaceChangelogChanges = filterHiddenChanges((await getCommits(workspaceChangelogFromSHA, toSHA)).map((c) => {
|
234
229
|
return {
|
235
230
|
type: c.type,
|
236
231
|
scope: c.scope,
|
@@ -238,7 +233,7 @@ function createAPI(overrideReleaseConfig) {
|
|
238
233
|
body: c.body,
|
239
234
|
isBreaking: c.isBreaking,
|
240
235
|
githubReferences: c.references,
|
241
|
-
authors:
|
236
|
+
authors: c.authors,
|
242
237
|
shortHash: c.shortHash,
|
243
238
|
revertedHashes: c.revertedHashes,
|
244
239
|
affectedProjects: '*',
|
@@ -312,8 +307,6 @@ function createAPI(overrideReleaseConfig) {
|
|
312
307
|
if (releaseGroup.projectsRelationship === 'independent') {
|
313
308
|
for (const project of projectNodes) {
|
314
309
|
let changes = null;
|
315
|
-
// TODO(v22): remove this after the changelog renderer is refactored to remove coupling with git commits
|
316
|
-
let commits;
|
317
310
|
if (releaseGroup.resolvedVersionPlans) {
|
318
311
|
changes = releaseGroup.resolvedVersionPlans
|
319
312
|
.map((vp) => {
|
@@ -325,12 +318,11 @@ function createAPI(overrideReleaseConfig) {
|
|
325
318
|
let githubReferences = [];
|
326
319
|
let authors = [];
|
327
320
|
const parsedCommit = vp.commit
|
328
|
-
? (0, git_1.
|
321
|
+
? (0, git_1.parseVersionPlanCommit)(vp.commit)
|
329
322
|
: null;
|
330
323
|
if (parsedCommit) {
|
331
324
|
githubReferences = parsedCommit.references;
|
332
|
-
|
333
|
-
authors = [parsedCommit.author];
|
325
|
+
authors = parsedCommit.authors;
|
334
326
|
}
|
335
327
|
return {
|
336
328
|
type: releaseType.type,
|
@@ -356,6 +348,7 @@ function createAPI(overrideReleaseConfig) {
|
|
356
348
|
releaseTagPatternRequireSemver: releaseGroup.releaseTagPatternRequireSemver,
|
357
349
|
releaseTagPatternStrictPreid: releaseGroup.releaseTagPatternStrictPreid,
|
358
350
|
}))?.tag;
|
351
|
+
let commits;
|
359
352
|
if (!fromRef && useAutomaticFromRef) {
|
360
353
|
const firstCommit = await (0, git_1.getFirstGitCommit)();
|
361
354
|
commits = await filterProjectCommits({
|
@@ -387,8 +380,7 @@ function createAPI(overrideReleaseConfig) {
|
|
387
380
|
body: c.body,
|
388
381
|
isBreaking: c.isBreaking,
|
389
382
|
githubReferences: c.references,
|
390
|
-
|
391
|
-
authors: [c.author],
|
383
|
+
authors: c.authors,
|
392
384
|
shortHash: c.shortHash,
|
393
385
|
revertedHashes: c.revertedHashes,
|
394
386
|
affectedProjects: commitChangesNonProjectFiles(c, fileMap.nonProjectFiles)
|
@@ -419,20 +411,18 @@ function createAPI(overrideReleaseConfig) {
|
|
419
411
|
}
|
420
412
|
else {
|
421
413
|
let changes = [];
|
422
|
-
// TODO(v22): remove this after the changelog renderer is refactored to remove coupling with git commits
|
423
|
-
let commits = [];
|
424
414
|
if (releaseGroup.resolvedVersionPlans) {
|
425
415
|
changes = releaseGroup.resolvedVersionPlans
|
426
416
|
.flatMap((vp) => {
|
427
417
|
const releaseType = versionPlanSemverReleaseTypeToChangelogType(vp.groupVersionBump);
|
428
418
|
let githubReferences = [];
|
429
|
-
let
|
419
|
+
let authors = undefined;
|
430
420
|
const parsedCommit = vp.commit
|
431
|
-
? (0, git_1.
|
421
|
+
? (0, git_1.parseVersionPlanCommit)(vp.commit)
|
432
422
|
: null;
|
433
423
|
if (parsedCommit) {
|
434
424
|
githubReferences = parsedCommit.references;
|
435
|
-
|
425
|
+
authors = parsedCommit.authors;
|
436
426
|
}
|
437
427
|
const changes = !vp.triggeredByProjects
|
438
428
|
? {
|
@@ -442,8 +432,7 @@ function createAPI(overrideReleaseConfig) {
|
|
442
432
|
body: '',
|
443
433
|
isBreaking: releaseType.isBreaking,
|
444
434
|
githubReferences,
|
445
|
-
|
446
|
-
authors: [author],
|
435
|
+
authors,
|
447
436
|
affectedProjects: '*',
|
448
437
|
}
|
449
438
|
: vp.triggeredByProjects.map((project) => {
|
@@ -454,8 +443,7 @@ function createAPI(overrideReleaseConfig) {
|
|
454
443
|
body: '',
|
455
444
|
isBreaking: releaseType.isBreaking,
|
456
445
|
githubReferences,
|
457
|
-
|
458
|
-
authors: [author],
|
446
|
+
authors,
|
459
447
|
affectedProjects: [project],
|
460
448
|
};
|
461
449
|
});
|
@@ -487,16 +475,14 @@ function createAPI(overrideReleaseConfig) {
|
|
487
475
|
const fromSHA = await (0, git_1.getCommitHash)(fromRef);
|
488
476
|
const { fileMap } = await (0, file_map_utils_1.createFileMapUsingProjectGraph)(projectGraph);
|
489
477
|
const fileToProjectMap = createFileToProjectMap(fileMap.projectFileMap);
|
490
|
-
|
491
|
-
changes = filterHiddenChanges(commits.map((c) => ({
|
478
|
+
changes = filterHiddenChanges((await getCommits(fromSHA, toSHA)).map((c) => ({
|
492
479
|
type: c.type,
|
493
480
|
scope: c.scope,
|
494
481
|
description: c.description,
|
495
482
|
body: c.body,
|
496
483
|
isBreaking: c.isBreaking,
|
497
484
|
githubReferences: c.references,
|
498
|
-
|
499
|
-
authors: [c.author],
|
485
|
+
authors: c.authors,
|
500
486
|
shortHash: c.shortHash,
|
501
487
|
revertedHashes: c.revertedHashes,
|
502
488
|
affectedProjects: commitChangesNonProjectFiles(c, fileMap.nonProjectFiles)
|
@@ -95,7 +95,11 @@ export declare function parseConventionalCommitsMessage(message: string): {
|
|
95
95
|
breaking: boolean;
|
96
96
|
} | null;
|
97
97
|
export declare function extractReferencesFromCommit(commit: RawGitCommit): Reference[];
|
98
|
-
export declare function
|
98
|
+
export declare function parseVersionPlanCommit(commit: RawGitCommit): {
|
99
|
+
references: Reference[];
|
100
|
+
authors: GitCommitAuthor[];
|
101
|
+
};
|
102
|
+
export declare function parseGitCommit(commit: RawGitCommit): GitCommit | null;
|
99
103
|
export declare function getCommitHash(ref: string): Promise<string>;
|
100
104
|
export declare function getFirstGitCommit(): Promise<string>;
|
101
105
|
//# sourceMappingURL=git.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/git.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MA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AEjE;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAiBP;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,EAAE,CAiC7E;AA2BD,wBAAgB,
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/release/utils/git.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,gCAAgC;IAC/C,oBAAoB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAC1C,K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AED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI,CAqDrE;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,mBAM9C;AAED,wBAAsB,iBAAiB,oBAatC"}
|
@@ -10,6 +10,7 @@ exports.gitPush = gitPush;
|
|
10
10
|
exports.parseCommits = parseCommits;
|
11
11
|
exports.parseConventionalCommitsMessage = parseConventionalCommitsMessage;
|
12
12
|
exports.extractReferencesFromCommit = extractReferencesFromCommit;
|
13
|
+
exports.parseVersionPlanCommit = parseVersionPlanCommit;
|
13
14
|
exports.parseGitCommit = parseGitCommit;
|
14
15
|
exports.getCommitHash = getCommitHash;
|
15
16
|
exports.getFirstGitCommit = getFirstGitCommit;
|
@@ -481,25 +482,13 @@ const GitLabMergeRequestRE = /See merge request (?:[a-z0-9/-]+)?(![\d]+)/gim;
|
|
481
482
|
const IssueRE = /(#\d+)/gm;
|
482
483
|
const ChangedFileRegex = /(A|M|D|R\d*|C\d*)\t([^\t\n]*)\t?(.*)?/gm;
|
483
484
|
const RevertHashRE = /This reverts commit (?<hash>[\da-f]{40})./gm;
|
484
|
-
function
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
scope: '',
|
492
|
-
references: extractReferencesFromCommit(commit),
|
493
|
-
// The commit message is not the source of truth for a breaking (major) change in version plans, so the value is not relevant
|
494
|
-
// TODO(v22): Make the current GitCommit interface more clearly tied to conventional commits
|
495
|
-
isBreaking: false,
|
496
|
-
authors: getAllAuthorsForCommit(commit),
|
497
|
-
// Not applicable to version plans
|
498
|
-
affectedFiles: [],
|
499
|
-
// Not applicable, a version plan cannot have been added in a commit that also reverts another commit
|
500
|
-
revertedHashes: [],
|
501
|
-
};
|
502
|
-
}
|
485
|
+
function parseVersionPlanCommit(commit) {
|
486
|
+
return {
|
487
|
+
references: extractReferencesFromCommit(commit),
|
488
|
+
authors: getAllAuthorsForCommit(commit),
|
489
|
+
};
|
490
|
+
}
|
491
|
+
function parseGitCommit(commit) {
|
503
492
|
const parsedMessage = parseConventionalCommitsMessage(commit.message);
|
504
493
|
if (!parsedMessage) {
|
505
494
|
return null;
|
@@ -10,6 +10,7 @@ export { calculateDefaultProjectName } from './config/calculate-default-project-
|
|
10
10
|
export { retrieveProjectConfigurationsWithAngularProjects } from './project-graph/utils/retrieve-workspace-files';
|
11
11
|
export { mergeTargetConfigurations } from './project-graph/utils/project-configuration-utils';
|
12
12
|
export { readProjectConfigurationsFromRootMap, findMatchingConfigFiles, } from './project-graph/utils/project-configuration-utils';
|
13
|
+
export { getIgnoreObjectForTree } from './utils/ignore';
|
13
14
|
export { splitTarget } from './utils/split-target';
|
14
15
|
export { combineOptionsForExecutor } from './utils/params';
|
15
16
|
export { sortObjectByKeys } from './utils/object-sort';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"devkit-internals.d.ts","sourceRoot":"","sources":["../../../../packages/nx/src/devkit-internals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,gDAAgD,EAAE,MAAM,gDAAgD,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EACL,oCAAoC,EACpC,uBAAuB,GACxB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,wBAAwB,EACxB,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kDAAkD,EAClD,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC"}
|
1
|
+
{"version":3,"file":"devkit-internals.d.ts","sourceRoot":"","sources":["../../../../packages/nx/src/devkit-internals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,gDAAgD,EAAE,MAAM,gDAAgD,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EACL,oCAAoC,EACpC,uBAAuB,GACxB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,wBAAwB,EACxB,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kDAAkD,EAClD,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/src/devkit-internals.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.isUsingPrettierInTree = exports.isCI = exports.interpolate = exports.registerTsProject = exports.LoadedNxPlugin = exports.retrieveProjectConfigurations = exports.findProjectForPath = exports.createProjectRootMappingsFromProjectConfigurations = exports.hashMultiGlobWithWorkspaceContext = exports.hashWithWorkspaceContext = exports.hashObject = exports.splitByColons = exports.installPackageToTmp = exports.readModulePackageJson = exports.stripIndent = exports.sortObjectByKeys = exports.combineOptionsForExecutor = exports.splitTarget = exports.findMatchingConfigFiles = exports.readProjectConfigurationsFromRootMap = exports.mergeTargetConfigurations = exports.retrieveProjectConfigurationsWithAngularProjects = exports.calculateDefaultProjectName = exports.readNxJsonFromDisk = exports.parseExecutor = exports.getExecutorInformation = exports.createTempNpmDirectory = void 0;
|
3
|
+
exports.isUsingPrettierInTree = exports.isCI = exports.interpolate = exports.registerTsProject = exports.LoadedNxPlugin = exports.retrieveProjectConfigurations = exports.findProjectForPath = exports.createProjectRootMappingsFromProjectConfigurations = exports.hashMultiGlobWithWorkspaceContext = exports.hashWithWorkspaceContext = exports.hashObject = exports.splitByColons = exports.installPackageToTmp = exports.readModulePackageJson = exports.stripIndent = exports.sortObjectByKeys = exports.combineOptionsForExecutor = exports.splitTarget = exports.getIgnoreObjectForTree = exports.findMatchingConfigFiles = exports.readProjectConfigurationsFromRootMap = exports.mergeTargetConfigurations = exports.retrieveProjectConfigurationsWithAngularProjects = exports.calculateDefaultProjectName = exports.readNxJsonFromDisk = exports.parseExecutor = exports.getExecutorInformation = exports.createTempNpmDirectory = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
/**
|
6
6
|
* Note to developers: STOP! These exports are available via requireNx in @nx/devkit.
|
@@ -23,6 +23,8 @@ Object.defineProperty(exports, "mergeTargetConfigurations", { enumerable: true,
|
|
23
23
|
var project_configuration_utils_2 = require("./project-graph/utils/project-configuration-utils");
|
24
24
|
Object.defineProperty(exports, "readProjectConfigurationsFromRootMap", { enumerable: true, get: function () { return project_configuration_utils_2.readProjectConfigurationsFromRootMap; } });
|
25
25
|
Object.defineProperty(exports, "findMatchingConfigFiles", { enumerable: true, get: function () { return project_configuration_utils_2.findMatchingConfigFiles; } });
|
26
|
+
var ignore_1 = require("./utils/ignore");
|
27
|
+
Object.defineProperty(exports, "getIgnoreObjectForTree", { enumerable: true, get: function () { return ignore_1.getIgnoreObjectForTree; } });
|
26
28
|
var split_target_1 = require("./utils/split-target");
|
27
29
|
Object.defineProperty(exports, "splitTarget", { enumerable: true, get: function () { return split_target_1.splitTarget; } });
|
28
30
|
var params_1 = require("./utils/params");
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.default = moveCacheDirectory;
|
4
|
-
const
|
4
|
+
const ignore = require("ignore");
|
5
5
|
function moveCacheDirectory(tree) {
|
6
6
|
// If nx.json doesn't exist the repo can't utilize
|
7
7
|
// caching, so .nx/cache is less relevant. Lerna users
|
@@ -24,7 +24,7 @@ function updateGitIgnore(tree) {
|
|
24
24
|
const gitignore = tree.exists('.gitignore')
|
25
25
|
? tree.read('.gitignore', 'utf-8')
|
26
26
|
: '';
|
27
|
-
const ig = (
|
27
|
+
const ig = ignore();
|
28
28
|
ig.add(gitignore);
|
29
29
|
if (!ig.ignores('.nx/cache')) {
|
30
30
|
const updatedLines = gitignore.length
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.default = addGitignoreEntry;
|
4
|
-
const
|
4
|
+
const ignore = require("ignore");
|
5
5
|
async function addGitignoreEntry(tree) {
|
6
6
|
if (!tree.exists('nx.json')) {
|
7
7
|
return;
|
@@ -14,7 +14,7 @@ async function addGitignoreEntry(tree) {
|
|
14
14
|
return;
|
15
15
|
}
|
16
16
|
let content = tree.read('.gitignore', 'utf-8') || '';
|
17
|
-
const ig = (
|
17
|
+
const ig = ignore().add(content);
|
18
18
|
for (const entry of GITIGNORE_ENTRIES) {
|
19
19
|
if (!ig.ignores(entry)) {
|
20
20
|
content = content.trimEnd() + '\n' + entry + '\n';
|
Binary file
|
package/src/utils/ignore.d.ts
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
-
import ignore
|
1
|
+
import ignore = require('ignore');
|
2
|
+
import { Tree } from '../generators/tree';
|
2
3
|
export declare function getIgnoreObject(root?: string): ReturnType<typeof ignore>;
|
4
|
+
export declare function getIgnoreObjectForTree(tree: Tree): ignore.Ignore;
|
3
5
|
//# sourceMappingURL=ignore.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/ignore.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,
|
1
|
+
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/ignore.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,GAAG,QAAQ,QAAQ,CAAC,CAAC;AAGlC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,wBAAgB,eAAe,CAC7B,IAAI,GAAE,MAAsB,GAC3B,UAAU,CAAC,OAAO,MAAM,CAAC,CAK3B;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,iBAahD"}
|
package/src/utils/ignore.js
CHANGED
@@ -1,12 +1,26 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getIgnoreObject = getIgnoreObject;
|
4
|
-
|
4
|
+
exports.getIgnoreObjectForTree = getIgnoreObjectForTree;
|
5
|
+
const ignore = require("ignore");
|
5
6
|
const fileutils_1 = require("./fileutils");
|
6
7
|
const workspace_root_1 = require("./workspace-root");
|
7
8
|
function getIgnoreObject(root = workspace_root_1.workspaceRoot) {
|
8
|
-
const ig = (
|
9
|
+
const ig = ignore();
|
9
10
|
ig.add((0, fileutils_1.readFileIfExisting)(`${root}/.gitignore`));
|
10
11
|
ig.add((0, fileutils_1.readFileIfExisting)(`${root}/.nxignore`));
|
11
12
|
return ig;
|
12
13
|
}
|
14
|
+
function getIgnoreObjectForTree(tree) {
|
15
|
+
let ig;
|
16
|
+
if (tree.exists('.gitignore')) {
|
17
|
+
ig = ignore();
|
18
|
+
ig.add('.git');
|
19
|
+
ig.add(tree.read('.gitignore', 'utf-8'));
|
20
|
+
}
|
21
|
+
if (tree.exists('.nxignore')) {
|
22
|
+
ig ??= ignore();
|
23
|
+
ig.add(tree.read('.nxignore', 'utf-8'));
|
24
|
+
}
|
25
|
+
return ig;
|
26
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/provenance.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/utils/provenance.ts"],"names":[],"mappings":"AAiBA,wBAAsB,0BAA0B,CAC9C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CA4Gf;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;CAoCxE;AAED,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAa5C;AAoBD,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,iCAAiC,CAAC;IACzC,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,aAAa,EAAE,gCAAgC,CAAC;IAChD,SAAS,EAAE;QACT,eAAe,EAAE;YACf,SAAS,EAAE,MAAM,CAAC;YAClB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACzC,oBAAoB,CAAC,EAAE,kBAAkB,EAAE,CAAC;SAC7C,CAAC;QACF,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,EAAE,EAAE,MAAM,CAAC;gBACX,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;gBAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;aAClC,CAAC;YACF,QAAQ,CAAC,EAAE;gBACT,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,SAAS,CAAC,EAAE,MAAM,CAAC;gBACnB,UAAU,CAAC,EAAE,MAAM,CAAC;aACrB,CAAC;YACF,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;SACnC,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;KACnC,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE;QACZ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH"}
|
package/src/utils/provenance.js
CHANGED
@@ -5,8 +5,8 @@ exports.ensurePackageHasProvenance = ensurePackageHasProvenance;
|
|
5
5
|
exports.getNxPackageGroup = getNxPackageGroup;
|
6
6
|
const child_process_1 = require("child_process");
|
7
7
|
const path_1 = require("path");
|
8
|
-
const util_1 = require("util");
|
9
8
|
const fileutils_1 = require("./fileutils");
|
9
|
+
const package_manager_1 = require("./package-manager");
|
10
10
|
/*
|
11
11
|
* Verifies that the given npm package has provenance attestations
|
12
12
|
* generated by the GitHub Actions workflow at .github/workflows/publish.yml
|
@@ -20,12 +20,9 @@ async function ensurePackageHasProvenance(packageName, packageVersion) {
|
|
20
20
|
if (process.env.NX_SKIP_PROVENANCE_CHECK) {
|
21
21
|
return;
|
22
22
|
}
|
23
|
-
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
24
23
|
try {
|
25
|
-
const result = await
|
26
|
-
|
27
|
-
});
|
28
|
-
const npmViewResult = JSON.parse(result.stdout.trim());
|
24
|
+
const result = await (0, package_manager_1.packageRegistryView)(packageName, packageVersion, '--json --silent');
|
25
|
+
const npmViewResult = JSON.parse(result);
|
29
26
|
const attURL = npmViewResult.dist?.attestations?.url;
|
30
27
|
if (!attURL)
|
31
28
|
throw new ProvenanceError(packageName, packageVersion, 'No attestation URL found');
|
@@ -68,7 +65,31 @@ async function ensurePackageHasProvenance(packageName, packageVersion) {
|
|
68
65
|
}
|
69
66
|
class ProvenanceError extends Error {
|
70
67
|
constructor(packageName, packageVersion, error) {
|
71
|
-
|
68
|
+
let customRegistry = undefined;
|
69
|
+
try {
|
70
|
+
const packageManager = (0, package_manager_1.detectPackageManager)();
|
71
|
+
const commands = (0, package_manager_1.getPackageManagerCommand)(packageManager);
|
72
|
+
// Try to get registry from current package manager, fall back to npm
|
73
|
+
const registryCommand = commands.getRegistryUrl ?? 'npm config get registry';
|
74
|
+
const registry = (0, child_process_1.execSync)(registryCommand, {
|
75
|
+
timeout: 5000,
|
76
|
+
windowsHide: true,
|
77
|
+
encoding: 'utf-8',
|
78
|
+
}).trim();
|
79
|
+
// Only consider it custom if it's not the default npm registry
|
80
|
+
if (registry &&
|
81
|
+
registry !== 'undefined' &&
|
82
|
+
!registry.includes('registry.npmjs.org')) {
|
83
|
+
customRegistry = registry;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
catch {
|
87
|
+
// If we can't determine the registry, proceed with default error message
|
88
|
+
}
|
89
|
+
const registryNote = customRegistry
|
90
|
+
? `This might be due to a custom registry configuration (${customRegistry}). Please check whether provenance is correctly configured for your registry.`
|
91
|
+
: `This could indicate a security risk. Please double check https://www.npmjs.com/package/${packageName} to see if the package is published correctly or file an issue at https://github.com/nrwl/nx/issues.`;
|
92
|
+
super(`An error occurred while checking the provenance of ${packageName}@${packageVersion}. ${registryNote} To disable this check at your own risk, you can set the NX_SKIP_PROVENANCE_CHECK environment variable to true. \n Error: ${error ?? ''}`);
|
72
93
|
}
|
73
94
|
}
|
74
95
|
exports.ProvenanceError = ProvenanceError;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"decorate-cli.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/adapter/decorate-cli.ts"],"names":[],"mappings":"AAKA,wBAAgB,WAAW,SAmB1B"}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
// TODO(v22): remove this file
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.decorateCli = decorateCli;
|
5
|
-
const fs_1 = require("fs");
|
6
|
-
const output_1 = require("../utils/output");
|
7
|
-
function decorateCli() {
|
8
|
-
output_1.output.warn({
|
9
|
-
title: `Decoration of the Angular CLI is deprecated and will be removed in Nx v22`,
|
10
|
-
bodyLines: [
|
11
|
-
`Please replace usage of "ng <command>" in any scripts, particularly for CI, with "nx <command>"`,
|
12
|
-
],
|
13
|
-
});
|
14
|
-
const path = 'node_modules/@angular/cli/lib/cli/index.js';
|
15
|
-
const angularCLIInit = (0, fs_1.readFileSync)(path, 'utf-8');
|
16
|
-
const start = angularCLIInit.indexOf(`(options) {`) + 11;
|
17
|
-
const newContent = `${angularCLIInit.slice(0, start)}
|
18
|
-
if (!process.env['NX_CLI_SET']) {
|
19
|
-
require('nx/bin/nx');
|
20
|
-
return new Promise(function(res, rej) {});
|
21
|
-
}
|
22
|
-
${angularCLIInit.substring(start)}
|
23
|
-
`;
|
24
|
-
(0, fs_1.writeFileSync)(path, newContent);
|
25
|
-
}
|