nx 19.7.3 → 19.8.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +12 -12
- package/schemas/nx-schema.json +2 -2
- package/src/command-line/generate/generator-utils.d.ts +2 -1
- package/src/command-line/import/command-object.js +1 -1
- package/src/command-line/import/import.js +9 -4
- package/src/command-line/import/utils/prepare-source-repo.js +7 -35
- package/src/command-line/init/init-v2.d.ts +1 -1
- package/src/command-line/init/init-v2.js +14 -4
- package/src/command-line/release/command-object.d.ts +2 -2
- package/src/command-line/release/config/config.js +10 -3
- package/src/command-line/release/utils/git.d.ts +2 -2
- package/src/command-line/release/utils/git.js +12 -2
- package/src/command-line/release/utils/shared.d.ts +1 -1
- package/src/command-line/release/version.js +4 -0
- package/src/command-line/sync/command-object.js +2 -2
- package/src/config/nx-json.d.ts +13 -5
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/daemon/client/client.d.ts +2 -1
- package/src/daemon/client/client.js +7 -0
- package/src/daemon/message-types/task-history.d.ts +9 -3
- package/src/daemon/message-types/task-history.js +10 -2
- package/src/daemon/server/handle-task-history.d.ts +5 -1
- package/src/daemon/server/handle-task-history.js +11 -9
- package/src/daemon/server/server.js +5 -2
- package/src/hasher/hash-task.js +2 -2
- package/src/native/index.d.ts +1 -0
- package/src/native/nx.wasi-browser.js +42 -54
- package/src/native/nx.wasi.cjs +42 -54
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/plugins/js/utils/register.js +7 -0
- package/src/tasks-runner/cache.js +2 -1
- package/src/tasks-runner/init-tasks-runner.d.ts +1 -1
- package/src/tasks-runner/init-tasks-runner.js +5 -3
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.d.ts +0 -2
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +0 -5
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +2 -6
- package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +2 -6
- package/src/tasks-runner/life-cycles/store-run-information-life-cycle.d.ts +2 -7
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +1 -1
- package/src/tasks-runner/life-cycles/task-profiling-life-cycle.d.ts +2 -7
- package/src/tasks-runner/life-cycles/task-results-life-cycle.d.ts +6 -0
- package/src/tasks-runner/life-cycles/task-results-life-cycle.js +17 -0
- package/src/tasks-runner/life-cycles/task-timings-life-cycle.d.ts +2 -7
- package/src/tasks-runner/run-command.d.ts +12 -2
- package/src/tasks-runner/run-command.js +53 -60
- package/src/tasks-runner/task-orchestrator.d.ts +0 -1
- package/src/tasks-runner/task-orchestrator.js +7 -7
- package/src/tasks-runner/tasks-schedule.d.ts +3 -0
- package/src/tasks-runner/tasks-schedule.js +26 -4
- package/src/utils/git-utils.d.ts +4 -2
- package/src/utils/git-utils.index-filter.d.ts +0 -0
- package/src/utils/git-utils.index-filter.js +20 -0
- package/src/utils/git-utils.js +48 -13
- package/src/utils/git-utils.tree-filter.d.ts +11 -0
- package/src/utils/git-utils.tree-filter.js +43 -0
- package/src/utils/task-history.d.ts +12 -1
- package/src/utils/task-history.js +23 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.8.0-beta.0",
|
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.
|
74
|
+
"@nrwl/tao": "19.8.0-beta.0"
|
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.
|
90
|
-
"@nx/nx-darwin-arm64": "19.
|
91
|
-
"@nx/nx-linux-x64-gnu": "19.
|
92
|
-
"@nx/nx-linux-x64-musl": "19.
|
93
|
-
"@nx/nx-win32-x64-msvc": "19.
|
94
|
-
"@nx/nx-linux-arm64-gnu": "19.
|
95
|
-
"@nx/nx-linux-arm64-musl": "19.
|
96
|
-
"@nx/nx-linux-arm-gnueabihf": "19.
|
97
|
-
"@nx/nx-win32-arm64-msvc": "19.
|
98
|
-
"@nx/nx-freebsd-x64": "19.
|
89
|
+
"@nx/nx-darwin-x64": "19.8.0-beta.0",
|
90
|
+
"@nx/nx-darwin-arm64": "19.8.0-beta.0",
|
91
|
+
"@nx/nx-linux-x64-gnu": "19.8.0-beta.0",
|
92
|
+
"@nx/nx-linux-x64-musl": "19.8.0-beta.0",
|
93
|
+
"@nx/nx-win32-x64-msvc": "19.8.0-beta.0",
|
94
|
+
"@nx/nx-linux-arm64-gnu": "19.8.0-beta.0",
|
95
|
+
"@nx/nx-linux-arm64-musl": "19.8.0-beta.0",
|
96
|
+
"@nx/nx-linux-arm-gnueabihf": "19.8.0-beta.0",
|
97
|
+
"@nx/nx-win32-arm64-msvc": "19.8.0-beta.0",
|
98
|
+
"@nx/nx-freebsd-x64": "19.8.0-beta.0"
|
99
99
|
},
|
100
100
|
"nx-migrations": {
|
101
101
|
"migrations": "./migrations.json",
|
package/schemas/nx-schema.json
CHANGED
@@ -634,7 +634,7 @@
|
|
634
634
|
"description": "Custom git commit message to use when committing the changes made by this command"
|
635
635
|
},
|
636
636
|
"commitArgs": {
|
637
|
-
"type": "string",
|
637
|
+
"type": ["string", "array"],
|
638
638
|
"description": "Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes"
|
639
639
|
},
|
640
640
|
"stageChanges": {
|
@@ -650,7 +650,7 @@
|
|
650
650
|
"description": "Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself."
|
651
651
|
},
|
652
652
|
"tagArgs": {
|
653
|
-
"type": "string",
|
653
|
+
"type": ["string", "array"],
|
654
654
|
"description": "Additional arguments to pass to the `git tag` command invoked behind the scenes"
|
655
655
|
}
|
656
656
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Generator, GeneratorsJson, GeneratorsJsonEntry } from '../../config/misc-interfaces';
|
2
2
|
import { ProjectConfiguration } from '../../config/workspace-json-project-json';
|
3
|
-
export
|
3
|
+
export type GeneratorInformation = {
|
4
4
|
resolvedCollectionName: string;
|
5
5
|
normalizedGeneratorName: string;
|
6
6
|
schema: any;
|
@@ -9,6 +9,7 @@ export declare function getGeneratorInformation(collectionName: string, generato
|
|
9
9
|
isNxGenerator: boolean;
|
10
10
|
generatorConfiguration: GeneratorsJsonEntry;
|
11
11
|
};
|
12
|
+
export declare function getGeneratorInformation(collectionName: string, generatorName: string, root: string | null, projects: Record<string, ProjectConfiguration>): GeneratorInformation;
|
12
13
|
export declare function readGeneratorsJson(collectionName: string, generator: string, root: string | null, projects: Record<string, ProjectConfiguration>): {
|
13
14
|
generatorsFilePath: string;
|
14
15
|
generatorsJson: GeneratorsJson;
|
@@ -6,7 +6,7 @@ const shared_options_1 = require("../yargs-utils/shared-options");
|
|
6
6
|
const handle_errors_1 = require("../../utils/handle-errors");
|
7
7
|
exports.yargsImportCommand = {
|
8
8
|
command: 'import [sourceRepository] [destinationDirectory]',
|
9
|
-
describe:
|
9
|
+
describe: 'Import code and git history from another repository into this repository.',
|
10
10
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withVerbose)(yargs
|
11
11
|
.positional('sourceRepository', {
|
12
12
|
type: 'string',
|
@@ -25,7 +25,12 @@ const needs_install_1 = require("./utils/needs-install");
|
|
25
25
|
const file_utils_1 = require("../../project-graph/file-utils");
|
26
26
|
const importRemoteName = '__tmp_nx_import__';
|
27
27
|
async function importHandler(options) {
|
28
|
+
process.env.NX_RUNNING_NX_IMPORT = 'true';
|
28
29
|
let { sourceRepository, ref, source, destination } = options;
|
30
|
+
const destinationGitClient = new git_utils_1.GitRepository(process.cwd());
|
31
|
+
if (await destinationGitClient.hasUncommittedChanges()) {
|
32
|
+
throw new Error(`You have uncommitted changes in the destination repository. Commit or revert the changes and try again.`);
|
33
|
+
}
|
29
34
|
output_1.output.log({
|
30
35
|
title: 'Nx will walk you through the process of importing code from the source repository into this repository:',
|
31
36
|
bodyLines: [
|
@@ -120,7 +125,6 @@ async function importHandler(options) {
|
|
120
125
|
throw new Error(`The destination directory must be a relative path in this repository.`);
|
121
126
|
}
|
122
127
|
const absDestination = (0, path_1.join)(process.cwd(), destination);
|
123
|
-
const destinationGitClient = new git_utils_1.GitRepository(process.cwd());
|
124
128
|
await assertDestinationEmpty(destinationGitClient, absDestination);
|
125
129
|
const tempImportBranch = getTempImportBranch(ref);
|
126
130
|
await sourceGitClient.addFetchRemote(importRemoteName, ref);
|
@@ -152,7 +156,7 @@ async function importHandler(options) {
|
|
152
156
|
const pmc = (0, package_manager_1.getPackageManagerCommand)();
|
153
157
|
const nxJson = (0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot);
|
154
158
|
(0, workspace_context_1.resetWorkspaceContext)();
|
155
|
-
const { plugins, updatePackageScripts } = await (0, init_v2_1.detectPlugins)(nxJson, options.interactive);
|
159
|
+
const { plugins, updatePackageScripts } = await (0, init_v2_1.detectPlugins)(nxJson, options.interactive, true);
|
156
160
|
if (packageManager !== sourcePackageManager) {
|
157
161
|
output_1.output.warn({
|
158
162
|
title: `Mismatched package managers`,
|
@@ -232,8 +236,9 @@ async function importHandler(options) {
|
|
232
236
|
title: `Merging these changes into ${(0, command_line_utils_1.getBaseRef)(nxJson)}`,
|
233
237
|
bodyLines: [
|
234
238
|
`MERGE these changes when merging these changes.`,
|
235
|
-
`Do NOT squash
|
236
|
-
`If you
|
239
|
+
`Do NOT squash these commits when merging these changes.`,
|
240
|
+
`If you rebase, make sure to use "--rebase-merges" to preserve merge commits.`,
|
241
|
+
`To UNDO these changes, run "git reset HEAD~1 --hard"`,
|
237
242
|
],
|
238
243
|
});
|
239
244
|
}
|
@@ -3,46 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prepareSourceRepo = prepareSourceRepo;
|
4
4
|
const createSpinner = require("ora");
|
5
5
|
const path_1 = require("path");
|
6
|
-
const promises_1 = require("node:fs/promises");
|
7
6
|
async function prepareSourceRepo(gitClient, ref, source, relativeDestination, tempImportBranch, sourceRemoteUrl) {
|
8
7
|
const spinner = createSpinner().start(`Fetching ${ref} from ${sourceRemoteUrl}`);
|
9
8
|
const relativeSourceDir = (0, path_1.relative)(gitClient.root, (0, path_1.join)(gitClient.root, source));
|
10
|
-
if (
|
11
|
-
|
12
|
-
|
13
|
-
await gitClient.filterRepo(relativeSourceDir);
|
14
|
-
}
|
15
|
-
else {
|
16
|
-
spinner.start(`Filtering git history to only include files in ${relativeSourceDir} (this might take a few minutes -- install git-filter-repo for faster performance)`);
|
17
|
-
await gitClient.filterBranch(relativeSourceDir, tempImportBranch);
|
18
|
-
}
|
19
|
-
spinner.succeed(`Filtered git history to only include files in ${relativeSourceDir}`);
|
9
|
+
if (await gitClient.hasFilterRepoInstalled()) {
|
10
|
+
spinner.start(`Filtering git history to only include files in ${relativeSourceDir}`);
|
11
|
+
await gitClient.filterRepo(relativeSourceDir, relativeDestination);
|
20
12
|
}
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
const files = await gitClient.getGitFiles('.');
|
25
|
-
try {
|
26
|
-
await (0, promises_1.rm)(destinationInSource, {
|
27
|
-
recursive: true,
|
28
|
-
});
|
13
|
+
else {
|
14
|
+
spinner.start(`Filtering git history to only include files in ${relativeSourceDir} (this might take a few minutes -- install git-filter-repo for faster performance)`);
|
15
|
+
await gitClient.filterBranch(relativeSourceDir, relativeDestination, tempImportBranch);
|
29
16
|
}
|
30
|
-
|
31
|
-
await (0, promises_1.mkdir)(destinationInSource, { recursive: true });
|
32
|
-
for (const file of files) {
|
33
|
-
spinner.start(`Moving files and git history to ${destinationInSource}: ${file}`);
|
34
|
-
const newPath = (0, path_1.join)(destinationInSource, file);
|
35
|
-
await (0, promises_1.mkdir)((0, path_1.dirname)(newPath), { recursive: true });
|
36
|
-
try {
|
37
|
-
await gitClient.move(file, newPath);
|
38
|
-
}
|
39
|
-
catch {
|
40
|
-
await wait(100);
|
41
|
-
await gitClient.move(file, newPath);
|
42
|
-
}
|
43
|
-
}
|
44
|
-
await gitClient.commit(`chore(repo): move ${source} to ${relativeDestination} to prepare to be imported`);
|
45
|
-
await gitClient.amendCommit();
|
17
|
+
spinner.succeed(`Filtered git history to only include files in ${relativeSourceDir}`);
|
46
18
|
spinner.succeed(`${sourceRemoteUrl} has been prepared to be imported into this workspace on a temporary branch: ${tempImportBranch} in ${gitClient.root}`);
|
47
19
|
}
|
48
20
|
function wait(ms) {
|
@@ -8,7 +8,7 @@ export interface InitArgs {
|
|
8
8
|
}
|
9
9
|
export declare function installPlugins(repoRoot: string, plugins: string[], pmc: PackageManagerCommands, updatePackageScripts: boolean): void;
|
10
10
|
export declare function initHandler(options: InitArgs): Promise<void>;
|
11
|
-
export declare function detectPlugins(nxJson: NxJsonConfiguration, interactive: boolean): Promise<{
|
11
|
+
export declare function detectPlugins(nxJson: NxJsonConfiguration, interactive: boolean, includeAngularCli?: boolean): Promise<{
|
12
12
|
plugins: string[];
|
13
13
|
updatePackageScripts: boolean;
|
14
14
|
}>;
|
@@ -127,8 +127,8 @@ const npmPackageToPluginMap = {
|
|
127
127
|
'react-native': '@nx/react-native',
|
128
128
|
'@remix-run/dev': '@nx/remix',
|
129
129
|
};
|
130
|
-
async function detectPlugins(nxJson, interactive) {
|
131
|
-
let files = ['package.json'].concat(
|
130
|
+
async function detectPlugins(nxJson, interactive, includeAngularCli) {
|
131
|
+
let files = ['package.json'].concat((0, workspace_context_1.globWithWorkspaceContextSync)(process.cwd(), ['**/*/package.json']));
|
132
132
|
const currentPlugins = new Set((nxJson.plugins ?? []).map((p) => {
|
133
133
|
const plugin = typeof p === 'string' ? p : p.plugin;
|
134
134
|
return (0, get_package_name_from_import_path_1.getPackageNameFromImportPath)(plugin);
|
@@ -149,13 +149,23 @@ async function detectPlugins(nxJson, interactive) {
|
|
149
149
|
...packageJson.dependencies,
|
150
150
|
...packageJson.devDependencies,
|
151
151
|
};
|
152
|
-
|
152
|
+
const _npmPackageToPluginMap = {
|
153
|
+
...npmPackageToPluginMap,
|
154
|
+
};
|
155
|
+
if (includeAngularCli) {
|
156
|
+
_npmPackageToPluginMap['@angular/cli'] = '@nx/angular';
|
157
|
+
}
|
158
|
+
for (const [dep, plugin] of Object.entries(_npmPackageToPluginMap)) {
|
153
159
|
if (deps[dep]) {
|
154
160
|
detectedPlugins.add(plugin);
|
155
161
|
}
|
156
162
|
}
|
157
163
|
}
|
158
|
-
|
164
|
+
let gradlewFiles = ['gradlew', 'gradlew.bat'].concat((0, workspace_context_1.globWithWorkspaceContextSync)(process.cwd(), [
|
165
|
+
'**/gradlew',
|
166
|
+
'**/gradlew.bat',
|
167
|
+
]));
|
168
|
+
if (gradlewFiles.some((f) => (0, fs_1.existsSync)(f))) {
|
159
169
|
detectedPlugins.add('@nx/gradle');
|
160
170
|
}
|
161
171
|
// Remove existing plugins
|
@@ -14,10 +14,10 @@ interface GitCommitAndTagOptions {
|
|
14
14
|
stageChanges?: boolean;
|
15
15
|
gitCommit?: boolean;
|
16
16
|
gitCommitMessage?: string;
|
17
|
-
gitCommitArgs?: string;
|
17
|
+
gitCommitArgs?: string | string[];
|
18
18
|
gitTag?: boolean;
|
19
19
|
gitTagMessage?: string;
|
20
|
-
gitTagArgs?: string;
|
20
|
+
gitTagArgs?: string | string[];
|
21
21
|
}
|
22
22
|
export type VersionOptions = NxReleaseArgs & GitCommitAndTagOptions & VersionPlanArgs & FirstReleaseArgs & {
|
23
23
|
specifier?: string;
|
@@ -21,6 +21,7 @@ const fileutils_1 = require("../../../utils/fileutils");
|
|
21
21
|
const find_matching_projects_1 = require("../../../utils/find-matching-projects");
|
22
22
|
const output_1 = require("../../../utils/output");
|
23
23
|
const workspace_root_1 = require("../../../utils/workspace-root");
|
24
|
+
const path_1 = require("../../../utils/path");
|
24
25
|
const resolve_changelog_renderer_1 = require("../utils/resolve-changelog-renderer");
|
25
26
|
const resolve_nx_json_error_message_1 = require("../utils/resolve-nx-json-error-message");
|
26
27
|
const conventional_commits_1 = require("./conventional-commits");
|
@@ -154,6 +155,7 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
154
155
|
conventionalCommits: false,
|
155
156
|
generator: '@nx/js:release-version',
|
156
157
|
generatorOptions: {},
|
158
|
+
groupPreVersionCommand: '',
|
157
159
|
},
|
158
160
|
changelog: {
|
159
161
|
createRelease: false,
|
@@ -205,7 +207,9 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
205
207
|
WORKSPACE_DEFAULTS.versionPlans);
|
206
208
|
const rootConventionalCommitsConfig = deepMergeDefaults([WORKSPACE_DEFAULTS.conventionalCommits], fillUnspecifiedConventionalCommitsProperties(normalizeConventionalCommitsConfig(userConfig.conventionalCommits)));
|
207
209
|
// these options are not supported at the group level, only the root/command level
|
208
|
-
const rootVersionWithoutGlobalOptions = {
|
210
|
+
const rootVersionWithoutGlobalOptions = {
|
211
|
+
...rootVersionConfig,
|
212
|
+
};
|
209
213
|
delete rootVersionWithoutGlobalOptions.git;
|
210
214
|
delete rootVersionWithoutGlobalOptions.preVersionCommand;
|
211
215
|
// Apply conventionalCommits shorthand to the final group defaults if explicitly configured in the original user config
|
@@ -315,7 +319,10 @@ async function createNxReleaseConfig(projectGraph, projectFileMap, userConfig =
|
|
315
319
|
projects: matchingProjects,
|
316
320
|
version: deepMergeDefaults(
|
317
321
|
// First apply any group level defaults, then apply actual root level config, then group level config
|
318
|
-
[
|
322
|
+
[
|
323
|
+
GROUP_DEFAULTS.version,
|
324
|
+
{ ...rootVersionWithoutGlobalOptions, groupPreVersionCommand: '' },
|
325
|
+
], releaseGroup.version),
|
319
326
|
// If the user has set any changelog config at all, including at the root level, then use one set of defaults, otherwise default to false for the whole feature
|
320
327
|
changelog: releaseGroup.changelog || rootChangelogConfig.projectChangelogs
|
321
328
|
? deepMergeDefaults(groupChangelogDefaults, releaseGroup.changelog || {})
|
@@ -657,7 +664,7 @@ async function getDefaultProjects(projectGraph, projectFileMap) {
|
|
657
664
|
function isProjectPublic(project, projectGraph, projectFileMap) {
|
658
665
|
const projectNode = projectGraph.nodes[project];
|
659
666
|
const packageJsonPath = (0, node_path_1.join)(projectNode.data.root, 'package.json');
|
660
|
-
if (!projectFileMap[project]?.find((f) => f.file === packageJsonPath)) {
|
667
|
+
if (!projectFileMap[project]?.find((f) => f.file === (0, path_1.normalizePath)(packageJsonPath))) {
|
661
668
|
return false;
|
662
669
|
}
|
663
670
|
try {
|
@@ -37,7 +37,7 @@ export declare function gitAdd({ changedFiles, deletedFiles, dryRun, verbose, lo
|
|
37
37
|
}): Promise<string>;
|
38
38
|
export declare function gitCommit({ messages, additionalArgs, dryRun, verbose, logFn, }: {
|
39
39
|
messages: string[];
|
40
|
-
additionalArgs?: string;
|
40
|
+
additionalArgs?: string | string[];
|
41
41
|
dryRun?: boolean;
|
42
42
|
verbose?: boolean;
|
43
43
|
logFn?: (message: string) => void;
|
@@ -45,7 +45,7 @@ export declare function gitCommit({ messages, additionalArgs, dryRun, verbose, l
|
|
45
45
|
export declare function gitTag({ tag, message, additionalArgs, dryRun, verbose, logFn, }: {
|
46
46
|
tag: string;
|
47
47
|
message?: string;
|
48
|
-
additionalArgs?: string;
|
48
|
+
additionalArgs?: string | string[];
|
49
49
|
dryRun?: boolean;
|
50
50
|
verbose?: boolean;
|
51
51
|
logFn?: (message: string) => void;
|
@@ -188,7 +188,12 @@ async function gitCommit({ messages, additionalArgs, dryRun, verbose, logFn, })
|
|
188
188
|
commandArgs.push('--message', message);
|
189
189
|
}
|
190
190
|
if (additionalArgs) {
|
191
|
-
|
191
|
+
if (Array.isArray(additionalArgs)) {
|
192
|
+
commandArgs.push(...additionalArgs);
|
193
|
+
}
|
194
|
+
else {
|
195
|
+
commandArgs.push(...additionalArgs.split(' '));
|
196
|
+
}
|
192
197
|
}
|
193
198
|
if (verbose) {
|
194
199
|
logFn(dryRun
|
@@ -224,7 +229,12 @@ async function gitTag({ tag, message, additionalArgs, dryRun, verbose, logFn, })
|
|
224
229
|
message || tag,
|
225
230
|
];
|
226
231
|
if (additionalArgs) {
|
227
|
-
|
232
|
+
if (Array.isArray(additionalArgs)) {
|
233
|
+
commandArgs.push(...additionalArgs);
|
234
|
+
}
|
235
|
+
else {
|
236
|
+
commandArgs.push(...additionalArgs.split(' '));
|
237
|
+
}
|
228
238
|
}
|
229
239
|
if (verbose) {
|
230
240
|
logFn(dryRun
|
@@ -45,7 +45,7 @@ export declare function commitChanges({ changedFiles, deletedFiles, isDryRun, is
|
|
45
45
|
isDryRun?: boolean;
|
46
46
|
isVerbose?: boolean;
|
47
47
|
gitCommitMessages?: string[];
|
48
|
-
gitCommitArgs?: string;
|
48
|
+
gitCommitArgs?: string | string[];
|
49
49
|
}): Promise<void>;
|
50
50
|
export declare function createCommitMessageValues(releaseGroups: ReleaseGroupWithName[], releaseGroupToFilteredProjects: Map<ReleaseGroupWithName, Set<string>>, versionData: VersionData, commitMessage: string): string[];
|
51
51
|
export declare function createGitTagValues(releaseGroups: ReleaseGroupWithName[], releaseGroupToFilteredProjects: Map<ReleaseGroupWithName, Set<string>>, versionData: VersionData): string[];
|
@@ -207,6 +207,10 @@ function createAPI(overrideReleaseConfig) {
|
|
207
207
|
*/
|
208
208
|
for (const releaseGroup of releaseGroups) {
|
209
209
|
const releaseGroupName = releaseGroup.name;
|
210
|
+
runPreVersionCommand(releaseGroup.version.groupPreVersionCommand, {
|
211
|
+
dryRun: args.dryRun,
|
212
|
+
verbose: args.verbose,
|
213
|
+
});
|
210
214
|
const projectBatches = (0, batch_projects_by_generator_config_1.batchProjectsByGeneratorConfig)(projectGraph, releaseGroup,
|
211
215
|
// Batch based on all projects within the release group
|
212
216
|
releaseGroup.projects);
|
@@ -4,7 +4,7 @@ exports.yargsSyncCheckCommand = exports.yargsSyncCommand = void 0;
|
|
4
4
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
5
5
|
exports.yargsSyncCommand = {
|
6
6
|
command: 'sync',
|
7
|
-
describe:
|
7
|
+
describe: 'Sync the workspace files by running all the sync generators.',
|
8
8
|
builder: (yargs) => (0, shared_options_1.withVerbose)(yargs),
|
9
9
|
handler: async (args) => {
|
10
10
|
process.exit(await Promise.resolve().then(() => require('./sync')).then((m) => m.syncHandler(args)));
|
@@ -12,7 +12,7 @@ exports.yargsSyncCommand = {
|
|
12
12
|
};
|
13
13
|
exports.yargsSyncCheckCommand = {
|
14
14
|
command: 'sync:check',
|
15
|
-
describe:
|
15
|
+
describe: 'Check that no changes are required after running all sync generators.',
|
16
16
|
builder: (yargs) => (0, shared_options_1.withVerbose)(yargs),
|
17
17
|
handler: async (args) => {
|
18
18
|
process.exit(await Promise.resolve().then(() => require('./sync')).then((m) => m.syncHandler({ ...args, check: true })));
|
package/src/config/nx-json.d.ts
CHANGED
@@ -101,9 +101,9 @@ export interface NxReleaseGitConfiguration {
|
|
101
101
|
*/
|
102
102
|
commitMessage?: string;
|
103
103
|
/**
|
104
|
-
* Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes
|
104
|
+
* Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes. May be a string or array of strings.
|
105
105
|
*/
|
106
|
-
commitArgs?: string;
|
106
|
+
commitArgs?: string | string[];
|
107
107
|
/**
|
108
108
|
* Whether or not to stage the changes made by this command. Always treated as true if commit is true.
|
109
109
|
*/
|
@@ -117,9 +117,9 @@ export interface NxReleaseGitConfiguration {
|
|
117
117
|
*/
|
118
118
|
tagMessage?: string;
|
119
119
|
/**
|
120
|
-
* Additional arguments to pass to the `git tag` command invoked behind the scenes
|
120
|
+
* Additional arguments to pass to the `git tag` command invoked behind the scenes. . May be a string or array of strings.
|
121
121
|
*/
|
122
|
-
tagArgs?: string;
|
122
|
+
tagArgs?: string | string[];
|
123
123
|
}
|
124
124
|
export interface NxReleaseConventionalCommitsConfiguration {
|
125
125
|
types?: Record<string,
|
@@ -179,7 +179,15 @@ export interface NxReleaseConfiguration {
|
|
179
179
|
*
|
180
180
|
* NOTE: git configuration is not supported at the group level, only the root/command level
|
181
181
|
*/
|
182
|
-
version?: NxReleaseVersionConfiguration
|
182
|
+
version?: NxReleaseVersionConfiguration & {
|
183
|
+
/**
|
184
|
+
* A command to run after validation of nx release configuration, but before versioning begins.
|
185
|
+
* Used for preparing build artifacts. If --dry-run is passed, the command is still executed, but
|
186
|
+
* with the NX_DRY_RUN environment variable set to 'true'.
|
187
|
+
* It will run in addition to the global `preVersionCommand`
|
188
|
+
*/
|
189
|
+
groupPreVersionCommand?: string;
|
190
|
+
};
|
183
191
|
/**
|
184
192
|
* Project changelogs are disabled by default.
|
185
193
|
*
|