nx 20.0.0-beta.5 → 20.0.0-beta.7
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/.eslintrc.json +12 -2
- package/migrations.json +0 -37
- package/package.json +11 -11
- package/release/changelog-renderer/index.d.ts +60 -38
- package/release/changelog-renderer/index.js +260 -236
- package/src/command-line/add/add.js +2 -2
- package/src/command-line/nx-commands.js +31 -10
- package/src/command-line/release/changelog.d.ts +2 -2
- package/src/command-line/release/changelog.js +28 -29
- package/src/command-line/release/index.d.ts +5 -2
- package/src/command-line/release/publish.d.ts +6 -1
- package/src/command-line/release/publish.js +31 -25
- package/src/command-line/release/utils/print-changes.js +6 -4
- package/src/command-line/release/utils/resolve-changelog-renderer.d.ts +2 -2
- package/src/command-line/release/utils/resolve-changelog-renderer.js +3 -3
- package/src/command-line/release/utils/resolve-nx-json-error-message.js +4 -3
- package/src/command-line/release/version.d.ts +3 -3
- package/src/command-line/yargs-utils/shared-options.js +2 -2
- package/src/config/nx-json.d.ts +2 -1
- package/src/config/workspace-json-project-json.d.ts +14 -0
- package/src/core/graph/main.js +1 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/utilities/axios.js +1 -2
- package/src/nx-cloud/utilities/onboarding.js +2 -2
- package/src/nx-cloud/utilities/url-shorten.js +5 -5
- package/src/project-graph/file-utils.d.ts +2 -2
- package/src/project-graph/file-utils.js +2 -2
- package/src/tasks-runner/cache.d.ts +2 -1
- package/src/tasks-runner/cache.js +10 -6
- package/src/tasks-runner/create-task-graph.d.ts +2 -0
- package/src/tasks-runner/create-task-graph.js +39 -5
- package/src/tasks-runner/run-command.js +15 -2
- package/src/tasks-runner/task-orchestrator.js +1 -1
- package/src/utils/command-line-utils.d.ts +3 -0
- package/src/utils/git-utils.js +2 -2
- package/src/migrations/update-15-0-0/prefix-outputs.d.ts +0 -2
- package/src/migrations/update-15-0-0/prefix-outputs.js +0 -49
- package/src/migrations/update-16-0-0/remove-nrwl-cli.d.ts +0 -2
- package/src/migrations/update-16-0-0/remove-nrwl-cli.js +0 -16
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.d.ts +0 -2
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +0 -97
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.d.ts +0 -2
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +0 -29
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.d.ts +0 -2
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +0 -45
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.d.ts +0 -12
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +0 -67
@@ -22,10 +22,10 @@ export interface ChangelogChange {
|
|
22
22
|
body?: string;
|
23
23
|
isBreaking?: boolean;
|
24
24
|
githubReferences?: Reference[];
|
25
|
-
|
25
|
+
authors?: {
|
26
26
|
name: string;
|
27
27
|
email: string;
|
28
|
-
};
|
28
|
+
}[];
|
29
29
|
shortHash?: string;
|
30
30
|
revertedHashes?: string[];
|
31
31
|
}
|
@@ -162,7 +162,8 @@ function createAPI(overrideReleaseConfig) {
|
|
162
162
|
body: '',
|
163
163
|
isBreaking: releaseType.isBreaking,
|
164
164
|
githubReferences,
|
165
|
-
|
165
|
+
// TODO(JamesHenry): Implement support for Co-authored-by and adding multiple authors
|
166
|
+
authors: [author],
|
166
167
|
affectedProjects: '*',
|
167
168
|
}
|
168
169
|
: vp.triggeredByProjects.map((project) => {
|
@@ -173,7 +174,8 @@ function createAPI(overrideReleaseConfig) {
|
|
173
174
|
body: '',
|
174
175
|
isBreaking: releaseType.isBreaking,
|
175
176
|
githubReferences,
|
176
|
-
|
177
|
+
// TODO(JamesHenry): Implement support for Co-authored-by and adding multiple authors
|
178
|
+
authors: [author],
|
177
179
|
affectedProjects: [project],
|
178
180
|
};
|
179
181
|
});
|
@@ -209,7 +211,7 @@ function createAPI(overrideReleaseConfig) {
|
|
209
211
|
body: c.body,
|
210
212
|
isBreaking: c.isBreaking,
|
211
213
|
githubReferences: c.references,
|
212
|
-
|
214
|
+
authors: [c.author],
|
213
215
|
shortHash: c.shortHash,
|
214
216
|
revertedHashes: c.revertedHashes,
|
215
217
|
affectedProjects: '*',
|
@@ -313,13 +315,14 @@ function createAPI(overrideReleaseConfig) {
|
|
313
315
|
}
|
314
316
|
const releaseType = versionPlanSemverReleaseTypeToChangelogType(bumpForProject);
|
315
317
|
let githubReferences = [];
|
316
|
-
let
|
318
|
+
let authors = [];
|
317
319
|
const parsedCommit = vp.commit
|
318
320
|
? (0, git_1.parseGitCommit)(vp.commit, true)
|
319
321
|
: null;
|
320
322
|
if (parsedCommit) {
|
321
323
|
githubReferences = parsedCommit.references;
|
322
|
-
|
324
|
+
// TODO(JamesHenry): Implement support for Co-authored-by and adding multiple authors
|
325
|
+
authors = [parsedCommit.author];
|
323
326
|
}
|
324
327
|
return {
|
325
328
|
type: releaseType.type,
|
@@ -329,7 +332,7 @@ function createAPI(overrideReleaseConfig) {
|
|
329
332
|
isBreaking: releaseType.isBreaking,
|
330
333
|
affectedProjects: Object.keys(vp.projectVersionBumps),
|
331
334
|
githubReferences,
|
332
|
-
|
335
|
+
authors,
|
333
336
|
};
|
334
337
|
})
|
335
338
|
.filter(Boolean);
|
@@ -365,7 +368,8 @@ function createAPI(overrideReleaseConfig) {
|
|
365
368
|
body: c.body,
|
366
369
|
isBreaking: c.isBreaking,
|
367
370
|
githubReferences: c.references,
|
368
|
-
|
371
|
+
// TODO(JamesHenry): Implement support for Co-authored-by and adding multiple authors
|
372
|
+
authors: [c.author],
|
369
373
|
shortHash: c.shortHash,
|
370
374
|
revertedHashes: c.revertedHashes,
|
371
375
|
affectedProjects: commitChangesNonProjectFiles(c, fileMap.nonProjectFiles)
|
@@ -376,15 +380,12 @@ function createAPI(overrideReleaseConfig) {
|
|
376
380
|
const projectChangelogs = await generateChangelogForProjects({
|
377
381
|
tree,
|
378
382
|
args,
|
379
|
-
projectGraph,
|
380
383
|
changes,
|
381
384
|
projectsVersionData,
|
382
385
|
releaseGroup,
|
383
386
|
projects: [project],
|
384
387
|
nxReleaseConfig,
|
385
388
|
projectToAdditionalDependencyBumps,
|
386
|
-
// TODO: remove this after the changelog renderer is refactored to remove coupling with git commits
|
387
|
-
commits: filterHiddenCommits(commits, nxReleaseConfig.conventionalCommits),
|
388
389
|
});
|
389
390
|
let hasPushed = false;
|
390
391
|
for (const [projectName, projectChangelog] of Object.entries(projectChangelogs)) {
|
@@ -436,7 +437,8 @@ function createAPI(overrideReleaseConfig) {
|
|
436
437
|
body: '',
|
437
438
|
isBreaking: releaseType.isBreaking,
|
438
439
|
githubReferences,
|
439
|
-
|
440
|
+
// TODO(JamesHenry): Implement support for Co-authored-by and adding multiple authors
|
441
|
+
authors: [author],
|
440
442
|
affectedProjects: '*',
|
441
443
|
}
|
442
444
|
: vp.triggeredByProjects.map((project) => {
|
@@ -447,7 +449,8 @@ function createAPI(overrideReleaseConfig) {
|
|
447
449
|
body: '',
|
448
450
|
isBreaking: releaseType.isBreaking,
|
449
451
|
githubReferences,
|
450
|
-
|
452
|
+
// TODO(JamesHenry): Implement support for Co-authored-by and adding multiple authors
|
453
|
+
authors: [author],
|
451
454
|
affectedProjects: [project],
|
452
455
|
};
|
453
456
|
});
|
@@ -482,7 +485,8 @@ function createAPI(overrideReleaseConfig) {
|
|
482
485
|
body: c.body,
|
483
486
|
isBreaking: c.isBreaking,
|
484
487
|
githubReferences: c.references,
|
485
|
-
|
488
|
+
// TODO(JamesHenry): Implement support for Co-authored-by and adding multiple authors
|
489
|
+
authors: [c.author],
|
486
490
|
shortHash: c.shortHash,
|
487
491
|
revertedHashes: c.revertedHashes,
|
488
492
|
affectedProjects: commitChangesNonProjectFiles(c, fileMap.nonProjectFiles)
|
@@ -493,15 +497,12 @@ function createAPI(overrideReleaseConfig) {
|
|
493
497
|
const projectChangelogs = await generateChangelogForProjects({
|
494
498
|
tree,
|
495
499
|
args,
|
496
|
-
projectGraph,
|
497
500
|
changes,
|
498
501
|
projectsVersionData,
|
499
502
|
releaseGroup,
|
500
503
|
projects: projectNodes,
|
501
504
|
nxReleaseConfig,
|
502
505
|
projectToAdditionalDependencyBumps,
|
503
|
-
// TODO: remove this after the changelog renderer is refactored to remove coupling with git commits
|
504
|
-
commits: filterHiddenCommits(commits, nxReleaseConfig.conventionalCommits),
|
505
506
|
});
|
506
507
|
let hasPushed = false;
|
507
508
|
for (const [projectName, projectChangelog] of Object.entries(projectChangelogs)) {
|
@@ -716,7 +717,7 @@ async function generateChangelogForWorkspace({ tree, args, projectGraph, nxRelea
|
|
716
717
|
const interactive = args.interactive === 'all' || args.interactive === 'workspace';
|
717
718
|
const dryRun = !!args.dryRun;
|
718
719
|
const gitRemote = args.gitRemote;
|
719
|
-
const
|
720
|
+
const ChangelogRendererClass = (0, resolve_changelog_renderer_1.resolveChangelogRenderer)(config.renderer);
|
720
721
|
let interpolatedTreePath = config.file || '';
|
721
722
|
if (interpolatedTreePath) {
|
722
723
|
interpolatedTreePath = (0, utils_1.interpolate)(interpolatedTreePath, {
|
@@ -736,18 +737,17 @@ async function generateChangelogForWorkspace({ tree, args, projectGraph, nxRelea
|
|
736
737
|
});
|
737
738
|
}
|
738
739
|
const githubRepoData = (0, github_1.getGitHubRepoData)(gitRemote, config.createRelease);
|
739
|
-
|
740
|
-
projectGraph,
|
740
|
+
const changelogRenderer = new ChangelogRendererClass({
|
741
741
|
changes,
|
742
|
-
|
743
|
-
releaseVersion: releaseVersion.rawVersion,
|
742
|
+
changelogEntryVersion: releaseVersion.rawVersion,
|
744
743
|
project: null,
|
745
|
-
|
744
|
+
isVersionPlans: false,
|
746
745
|
repoData: githubRepoData,
|
747
746
|
entryWhenNoChanges: config.entryWhenNoChanges,
|
748
747
|
changelogRenderOptions: config.renderOptions,
|
749
748
|
conventionalCommitsConfig: nxReleaseConfig.conventionalCommits,
|
750
749
|
});
|
750
|
+
let contents = await changelogRenderer.render();
|
751
751
|
/**
|
752
752
|
* If interactive mode, make the changelog contents available for the user to modify in their editor of choice,
|
753
753
|
* in a similar style to git interactive rebases/merges.
|
@@ -789,7 +789,7 @@ async function generateChangelogForWorkspace({ tree, args, projectGraph, nxRelea
|
|
789
789
|
contents,
|
790
790
|
};
|
791
791
|
}
|
792
|
-
async function generateChangelogForProjects({ tree, args,
|
792
|
+
async function generateChangelogForProjects({ tree, args, changes, projectsVersionData, releaseGroup, projects, nxReleaseConfig, projectToAdditionalDependencyBumps, }) {
|
793
793
|
const config = releaseGroup.changelog;
|
794
794
|
// The entire feature is disabled at the release group level, exit early
|
795
795
|
if (config === false) {
|
@@ -799,7 +799,7 @@ async function generateChangelogForProjects({ tree, args, projectGraph, changes,
|
|
799
799
|
const interactive = args.interactive === 'all' || args.interactive === 'projects';
|
800
800
|
const dryRun = !!args.dryRun;
|
801
801
|
const gitRemote = args.gitRemote;
|
802
|
-
const
|
802
|
+
const ChangelogRendererClass = (0, resolve_changelog_renderer_1.resolveChangelogRenderer)(config.renderer);
|
803
803
|
const projectChangelogs = {};
|
804
804
|
for (const project of projects) {
|
805
805
|
let interpolatedTreePath = config.file || '';
|
@@ -829,13 +829,10 @@ async function generateChangelogForProjects({ tree, args, projectGraph, changes,
|
|
829
829
|
});
|
830
830
|
}
|
831
831
|
const githubRepoData = (0, github_1.getGitHubRepoData)(gitRemote, config.createRelease);
|
832
|
-
|
833
|
-
projectGraph,
|
832
|
+
const changelogRenderer = new ChangelogRendererClass({
|
834
833
|
changes,
|
835
|
-
|
836
|
-
releaseVersion: releaseVersion.rawVersion,
|
834
|
+
changelogEntryVersion: releaseVersion.rawVersion,
|
837
835
|
project: project.name,
|
838
|
-
repoSlug: githubRepoData?.slug,
|
839
836
|
repoData: githubRepoData,
|
840
837
|
entryWhenNoChanges: typeof config.entryWhenNoChanges === 'string'
|
841
838
|
? (0, utils_1.interpolate)(config.entryWhenNoChanges, {
|
@@ -845,11 +842,13 @@ async function generateChangelogForProjects({ tree, args, projectGraph, changes,
|
|
845
842
|
})
|
846
843
|
: false,
|
847
844
|
changelogRenderOptions: config.renderOptions,
|
845
|
+
isVersionPlans: !!releaseGroup.versionPlans,
|
848
846
|
conventionalCommitsConfig: releaseGroup.versionPlans
|
849
847
|
? null
|
850
848
|
: nxReleaseConfig.conventionalCommits,
|
851
849
|
dependencyBumps: projectToAdditionalDependencyBumps.get(project.name),
|
852
850
|
});
|
851
|
+
let contents = await changelogRenderer.render();
|
853
852
|
/**
|
854
853
|
* If interactive mode, make the changelog contents available for the user to modify in their editor of choice,
|
855
854
|
* in a similar style to git interactive rebases/merges.
|
@@ -5,7 +5,7 @@ import type { NxReleaseConfiguration } from '../../config/nx-json';
|
|
5
5
|
export declare class ReleaseClient {
|
6
6
|
private overrideReleaseConfig;
|
7
7
|
releaseChangelog: (args: import("./command-object").ChangelogOptions) => Promise<import("./changelog").NxReleaseChangelogResult>;
|
8
|
-
releasePublish: (args: import("./command-object").PublishOptions
|
8
|
+
releasePublish: (args: import("./command-object").PublishOptions) => Promise<import("./publish").PublishProjectsResult>;
|
9
9
|
releaseVersion: (args: import("./command-object").VersionOptions) => Promise<import("./version").NxReleaseVersionResult>;
|
10
10
|
release: (args: import("./command-object").ReleaseOptions) => Promise<import("./version").NxReleaseVersionResult | number>;
|
11
11
|
constructor(overrideReleaseConfig: NxReleaseConfiguration);
|
@@ -15,6 +15,10 @@ declare const defaultClient: ReleaseClient;
|
|
15
15
|
* @public
|
16
16
|
*/
|
17
17
|
export declare const releaseChangelog: typeof defaultClient.releaseChangelog;
|
18
|
+
/**
|
19
|
+
* @public
|
20
|
+
*/
|
21
|
+
export { PublishProjectsResult } from './publish';
|
18
22
|
/**
|
19
23
|
* @public
|
20
24
|
*/
|
@@ -27,4 +31,3 @@ export declare const releaseVersion: typeof defaultClient.releaseVersion;
|
|
27
31
|
* @public
|
28
32
|
*/
|
29
33
|
export declare const release: typeof defaultClient.release;
|
30
|
-
export {};
|
@@ -1,4 +1,9 @@
|
|
1
1
|
import { NxReleaseConfiguration } from '../../config/nx-json';
|
2
2
|
import { PublishOptions } from './command-object';
|
3
|
+
export interface PublishProjectsResult {
|
4
|
+
[projectName: string]: {
|
5
|
+
code: number;
|
6
|
+
};
|
7
|
+
}
|
3
8
|
export declare const releasePublishCLIHandler: (args: PublishOptions) => Promise<number>;
|
4
|
-
export declare function createAPI(overrideReleaseConfig: NxReleaseConfiguration): (args: PublishOptions
|
9
|
+
export declare function createAPI(overrideReleaseConfig: NxReleaseConfiguration): (args: PublishOptions) => Promise<PublishProjectsResult>;
|
@@ -7,15 +7,21 @@ const file_map_utils_1 = require("../../project-graph/file-map-utils");
|
|
7
7
|
const project_graph_1 = require("../../project-graph/project-graph");
|
8
8
|
const run_command_1 = require("../../tasks-runner/run-command");
|
9
9
|
const command_line_utils_1 = require("../../utils/command-line-utils");
|
10
|
-
const output_1 = require("../../utils/output");
|
11
10
|
const handle_errors_1 = require("../../utils/handle-errors");
|
11
|
+
const output_1 = require("../../utils/output");
|
12
12
|
const project_graph_utils_1 = require("../../utils/project-graph-utils");
|
13
13
|
const graph_1 = require("../graph/graph");
|
14
14
|
const config_1 = require("./config/config");
|
15
15
|
const deep_merge_json_1 = require("./config/deep-merge-json");
|
16
16
|
const filter_release_groups_1 = require("./config/filter-release-groups");
|
17
17
|
const print_config_1 = require("./utils/print-config");
|
18
|
-
const releasePublishCLIHandler = (args) => (0, handle_errors_1.handleErrors)(args.verbose, () =>
|
18
|
+
const releasePublishCLIHandler = (args) => (0, handle_errors_1.handleErrors)(args.verbose, async () => {
|
19
|
+
const publishProjectsResult = await createAPI({})(args);
|
20
|
+
// If all projects are published successfully, return 0, otherwise return 1
|
21
|
+
return Object.values(publishProjectsResult).every((result) => result.code === 0)
|
22
|
+
? 0
|
23
|
+
: 1;
|
24
|
+
});
|
19
25
|
exports.releasePublishCLIHandler = releasePublishCLIHandler;
|
20
26
|
function createAPI(overrideReleaseConfig) {
|
21
27
|
/**
|
@@ -23,7 +29,7 @@ function createAPI(overrideReleaseConfig) {
|
|
23
29
|
* of Nx. We intentionally do not wrap the implementation with handleErrors because users need
|
24
30
|
* to have control over their own error handling when using the API.
|
25
31
|
*/
|
26
|
-
return async function releasePublish(args
|
32
|
+
return async function releasePublish(args) {
|
27
33
|
/**
|
28
34
|
* When used via the CLI, the args object will contain a __overrides_unparsed__ property that is
|
29
35
|
* important for invoking the relevant executor behind the scenes.
|
@@ -60,38 +66,40 @@ function createAPI(overrideReleaseConfig) {
|
|
60
66
|
const shouldExcludeTaskDependencies = _args.projects?.length > 0 ||
|
61
67
|
_args.groups?.length > 0 ||
|
62
68
|
args.excludeTaskDependencies;
|
63
|
-
let
|
69
|
+
let overallPublishProjectsResult = {};
|
64
70
|
if (args.projects?.length) {
|
65
71
|
/**
|
66
72
|
* Run publishing for all remaining release groups and filtered projects within them
|
67
73
|
*/
|
68
74
|
for (const releaseGroup of releaseGroups) {
|
69
|
-
const
|
75
|
+
const publishProjectsResult = await runPublishOnProjects(_args, projectGraph, nxJson, Array.from(releaseGroupToFilteredProjects.get(releaseGroup)), {
|
70
76
|
excludeTaskDependencies: shouldExcludeTaskDependencies,
|
71
77
|
loadDotEnvFiles: process.env.NX_LOAD_DOT_ENV_FILES !== 'false',
|
72
78
|
});
|
73
|
-
|
74
|
-
|
75
|
-
|
79
|
+
overallPublishProjectsResult = {
|
80
|
+
...overallPublishProjectsResult,
|
81
|
+
...publishProjectsResult,
|
82
|
+
};
|
76
83
|
}
|
77
|
-
return
|
84
|
+
return overallPublishProjectsResult;
|
78
85
|
}
|
79
86
|
/**
|
80
87
|
* Run publishing for all remaining release groups
|
81
88
|
*/
|
82
89
|
for (const releaseGroup of releaseGroups) {
|
83
|
-
const
|
90
|
+
const publishProjectsResult = await runPublishOnProjects(_args, projectGraph, nxJson, releaseGroup.projects, {
|
84
91
|
excludeTaskDependencies: shouldExcludeTaskDependencies,
|
85
92
|
loadDotEnvFiles: process.env.NX_LOAD_DOT_ENV_FILES !== 'false',
|
86
93
|
});
|
87
|
-
|
88
|
-
|
89
|
-
|
94
|
+
overallPublishProjectsResult = {
|
95
|
+
...overallPublishProjectsResult,
|
96
|
+
...publishProjectsResult,
|
97
|
+
};
|
90
98
|
}
|
91
|
-
return
|
99
|
+
return overallPublishProjectsResult;
|
92
100
|
};
|
93
101
|
}
|
94
|
-
async function runPublishOnProjects(args, projectGraph, nxJson, projectNames,
|
102
|
+
async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, extraOptions) {
|
95
103
|
const projectsToRun = projectNames.map((projectName) => projectGraph.nodes[projectName]);
|
96
104
|
const overrides = (0, command_line_utils_1.createOverrides)(args.__overrides_unparsed__);
|
97
105
|
if (args.registry) {
|
@@ -132,7 +140,7 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, is
|
|
132
140
|
projects: projectNamesWithTarget,
|
133
141
|
file,
|
134
142
|
}, projectNamesWithTarget);
|
135
|
-
return
|
143
|
+
return {};
|
136
144
|
}
|
137
145
|
const projectsWithTarget = projectsToRun.filter((project) => (0, project_graph_utils_1.projectHasTarget)(project, requiredTargetName));
|
138
146
|
if (projectsWithTarget.length === 0) {
|
@@ -145,20 +153,18 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, is
|
|
145
153
|
/**
|
146
154
|
* Run the relevant nx-release-publish executor on each of the selected projects.
|
147
155
|
*/
|
148
|
-
const
|
156
|
+
const commandResults = await (0, run_command_1.runCommandForTasks)(projectsWithTarget, projectGraph, { nxJson }, {
|
149
157
|
targets: [requiredTargetName],
|
150
158
|
outputStyle: 'static',
|
151
159
|
...args,
|
152
160
|
// It is possible for workspaces to have circular dependencies between packages and still release them to a registry
|
153
161
|
nxIgnoreCycles: true,
|
154
162
|
}, overrides, null, {}, extraOptions);
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
}
|
160
|
-
// Throw an additional error for programmatic API usage
|
161
|
-
throw new Error('One or more of the selected projects could not be published');
|
163
|
+
const publishProjectsResult = {};
|
164
|
+
for (const taskData of Object.values(commandResults)) {
|
165
|
+
publishProjectsResult[taskData.task.target.project] = {
|
166
|
+
code: taskData.code,
|
167
|
+
};
|
162
168
|
}
|
163
|
-
return
|
169
|
+
return publishProjectsResult;
|
164
170
|
}
|
@@ -5,8 +5,10 @@ exports.printAndFlushChanges = printAndFlushChanges;
|
|
5
5
|
const chalk = require("chalk");
|
6
6
|
const jest_diff_1 = require("jest-diff");
|
7
7
|
const node_fs_1 = require("node:fs");
|
8
|
-
const devkit_exports_1 = require("../../../devkit-exports");
|
9
8
|
const tree_1 = require("../../../generators/tree");
|
9
|
+
const workspace_root_1 = require("../../../utils/workspace-root");
|
10
|
+
const path_1 = require("../../../utils/path");
|
11
|
+
const logger_1 = require("../../../utils/logger");
|
10
12
|
// jest-diff does not export this constant
|
11
13
|
const NO_DIFF_MESSAGE = 'Compared values have no visual difference.';
|
12
14
|
function printDiff(before, after, contextLines = 1, noDiffMessage = NO_DIFF_MESSAGE) {
|
@@ -43,7 +45,7 @@ function printAndFlushChanges(tree, isDryRun, diffContextLines = 1, shouldPrintD
|
|
43
45
|
}
|
44
46
|
else if (f.type === 'UPDATE') {
|
45
47
|
console.error(`${chalk.white('UPDATE')} ${f.path}${isDryRun ? chalk.keyword('orange')(' [dry-run]') : ''}`);
|
46
|
-
const currentContentsOnDisk = (0, node_fs_1.readFileSync)((0,
|
48
|
+
const currentContentsOnDisk = (0, node_fs_1.readFileSync)((0, path_1.joinPathFragments)(tree.root, f.path)).toString();
|
47
49
|
printDiff(currentContentsOnDisk, f.content?.toString() || '', diffContextLines, noDiffMessage);
|
48
50
|
}
|
49
51
|
else if (f.type === 'DELETE') {
|
@@ -51,9 +53,9 @@ function printAndFlushChanges(tree, isDryRun, diffContextLines = 1, shouldPrintD
|
|
51
53
|
}
|
52
54
|
});
|
53
55
|
if (!isDryRun) {
|
54
|
-
(0, tree_1.flushChanges)(
|
56
|
+
(0, tree_1.flushChanges)(workspace_root_1.workspaceRoot, changes);
|
55
57
|
}
|
56
58
|
if (isDryRun && shouldPrintDryRunMessage) {
|
57
|
-
|
59
|
+
logger_1.logger.warn(`\nNOTE: The "dryRun" flag means no changes were made.`);
|
58
60
|
}
|
59
61
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import type
|
2
|
-
export declare function resolveChangelogRenderer(changelogRendererPath: string): ChangelogRenderer;
|
1
|
+
import type ChangelogRenderer from '../../../../release/changelog-renderer';
|
2
|
+
export declare function resolveChangelogRenderer(changelogRendererPath: string): typeof ChangelogRenderer;
|
@@ -10,7 +10,7 @@ function resolveChangelogRenderer(changelogRendererPath) {
|
|
10
10
|
workspaceRoot: workspace_root_1.workspaceRoot,
|
11
11
|
});
|
12
12
|
// Try and load the provided (or default) changelog renderer
|
13
|
-
let
|
13
|
+
let ChangelogRendererClass;
|
14
14
|
let cleanupTranspiler = () => { };
|
15
15
|
try {
|
16
16
|
const rootTsconfigPath = (0, typescript_1.getRootTsConfigPath)();
|
@@ -18,7 +18,7 @@ function resolveChangelogRenderer(changelogRendererPath) {
|
|
18
18
|
cleanupTranspiler = (0, register_1.registerTsProject)(rootTsconfigPath);
|
19
19
|
}
|
20
20
|
const r = require(interpolatedChangelogRendererPath);
|
21
|
-
|
21
|
+
ChangelogRendererClass = r.default || r;
|
22
22
|
}
|
23
23
|
catch (err) {
|
24
24
|
throw err;
|
@@ -26,5 +26,5 @@ function resolveChangelogRenderer(changelogRendererPath) {
|
|
26
26
|
finally {
|
27
27
|
cleanupTranspiler();
|
28
28
|
}
|
29
|
-
return
|
29
|
+
return ChangelogRendererClass;
|
30
30
|
}
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveNxJsonConfigErrorMessage = resolveNxJsonConfigErrorMessage;
|
4
4
|
const node_fs_1 = require("node:fs");
|
5
5
|
const node_path_1 = require("node:path");
|
6
|
-
const
|
6
|
+
const path_1 = require("../../../utils/path");
|
7
|
+
const workspace_root_1 = require("../../../utils/workspace-root");
|
7
8
|
async function resolveNxJsonConfigErrorMessage(propPath) {
|
8
|
-
const errorLines = await getJsonConfigLinesForErrorMessage((0, node_fs_1.readFileSync)((0,
|
9
|
-
let nxJsonMessage = `The relevant config is defined here: ${(0, node_path_1.relative)(process.cwd(), (0,
|
9
|
+
const errorLines = await getJsonConfigLinesForErrorMessage((0, node_fs_1.readFileSync)((0, path_1.joinPathFragments)(workspace_root_1.workspaceRoot, 'nx.json'), 'utf-8'), propPath);
|
10
|
+
let nxJsonMessage = `The relevant config is defined here: ${(0, node_path_1.relative)(process.cwd(), (0, path_1.joinPathFragments)(workspace_root_1.workspaceRoot, 'nx.json'))}`;
|
10
11
|
if (errorLines) {
|
11
12
|
nxJsonMessage +=
|
12
13
|
errorLines.startLine === errorLines.endLine
|
@@ -26,10 +26,10 @@ export interface ReleaseVersionGeneratorSchema {
|
|
26
26
|
conventionalCommitsConfig?: NxReleaseConfig['conventionalCommits'];
|
27
27
|
deleteVersionPlans?: boolean;
|
28
28
|
/**
|
29
|
-
* 'auto'
|
30
|
-
* This is only applicable to independently released projects.
|
29
|
+
* 'auto' is the default and will cause dependents to be updated (a patch version bump) when a dependency is versioned.
|
30
|
+
* This is only applicable to independently released projects. 'never' will cause dependents to not be updated.
|
31
31
|
*/
|
32
|
-
updateDependents?: '
|
32
|
+
updateDependents?: 'auto' | 'never';
|
33
33
|
/**
|
34
34
|
* Whether or not to completely omit project logs when that project has no applicable changes. This can be useful for
|
35
35
|
* large monorepos which have a large number of projects, especially when only a subset are released together.
|
@@ -81,9 +81,9 @@ function withRunOptions(yargs) {
|
|
81
81
|
default: false,
|
82
82
|
})
|
83
83
|
.option('skipSync', {
|
84
|
+
describe: 'Skips running the sync generators associated with the tasks.',
|
84
85
|
type: 'boolean',
|
85
|
-
|
86
|
-
hidden: true,
|
86
|
+
default: false,
|
87
87
|
})
|
88
88
|
.options('cloud', {
|
89
89
|
type: 'boolean',
|
package/src/config/nx-json.d.ts
CHANGED
@@ -353,7 +353,8 @@ export interface NxJsonConfiguration<T = '*' | string[]> {
|
|
353
353
|
appsDir?: string;
|
354
354
|
};
|
355
355
|
/**
|
356
|
-
*
|
356
|
+
* @deprecated Custom task runners will no longer be supported in Nx 21. Use Nx Cloud or Nx Powerpack instead.
|
357
|
+
* Available Task Runners for Nx to use
|
357
358
|
*/
|
358
359
|
tasksRunnerOptions?: {
|
359
360
|
[tasksRunnerName: string]: {
|
@@ -108,6 +108,20 @@ export interface ProjectMetadata {
|
|
108
108
|
description?: string;
|
109
109
|
technologies?: string[];
|
110
110
|
targetGroups?: Record<string, string[]>;
|
111
|
+
owners?: {
|
112
|
+
[ownerId: string]: {
|
113
|
+
ownedFiles: {
|
114
|
+
files: ['*'] | string[];
|
115
|
+
fromConfig?: {
|
116
|
+
filePath: string;
|
117
|
+
location: {
|
118
|
+
startLine: number;
|
119
|
+
endLine: number;
|
120
|
+
};
|
121
|
+
};
|
122
|
+
}[];
|
123
|
+
};
|
124
|
+
};
|
111
125
|
}
|
112
126
|
export interface TargetMetadata {
|
113
127
|
[k: string]: any;
|