nx 19.8.0-canary.20240920-999abe9 โ 19.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.json +2 -1
- package/bin/nx.js +10 -2
- package/package.json +12 -12
- package/release/changelog-renderer/index.d.ts +3 -1
- package/release/changelog-renderer/index.js +8 -8
- package/schemas/nx-schema.json +47 -21
- package/src/adapter/compat.d.ts +1 -1
- package/src/adapter/compat.js +1 -0
- package/src/command-line/activate-powerpack/activate-powerpack.js +3 -1
- package/src/command-line/add/add.js +4 -2
- package/src/command-line/connect/view-logs.js +1 -0
- package/src/command-line/exec/exec.js +6 -1
- package/src/command-line/format/format.js +3 -1
- package/src/command-line/graph/graph.js +1 -0
- package/src/command-line/init/implementation/angular/integrated-workspace.js +4 -1
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +5 -2
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +3 -1
- package/src/command-line/init/implementation/dot-nx/nxw.js +1 -0
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +3 -1
- package/src/command-line/init/implementation/react/index.js +17 -5
- package/src/command-line/init/implementation/utils.js +5 -1
- package/src/command-line/init/init-v1.js +1 -0
- package/src/command-line/init/init-v2.js +2 -1
- package/src/command-line/migrate/command-object.js +4 -0
- package/src/command-line/migrate/migrate.js +1 -1
- package/src/command-line/release/changelog.js +16 -10
- package/src/command-line/release/config/config.d.ts +2 -1
- package/src/command-line/release/config/config.js +165 -20
- package/src/command-line/release/config/version-plans.js +3 -1
- package/src/command-line/release/release.js +6 -2
- package/src/command-line/release/utils/exec-command.js +1 -0
- package/src/command-line/release/utils/github.d.ts +14 -6
- package/src/command-line/release/utils/github.js +50 -24
- package/src/command-line/release/utils/launch-editor.js +6 -1
- package/src/command-line/release/version.js +6 -3
- package/src/command-line/report/report.d.ts +3 -1
- package/src/command-line/report/report.js +17 -2
- package/src/command-line/run/run.js +1 -0
- package/src/command-line/sync/sync.js +5 -4
- package/src/command-line/watch/watch.js +1 -0
- package/src/config/nx-json.d.ts +12 -1
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.js +1 -1
- package/src/daemon/client/client.d.ts +4 -1
- package/src/daemon/client/generate-help-output.js +1 -0
- package/src/daemon/server/sync-generators.d.ts +4 -1
- package/src/daemon/server/sync-generators.js +33 -15
- package/src/executors/run-commands/run-commands.impl.js +1 -0
- package/src/executors/run-script/run-script.impl.js +1 -0
- package/src/native/index.d.ts +1 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +1 -1
- package/src/project-graph/file-utils.js +1 -0
- package/src/tasks-runner/cache.d.ts +3 -1
- package/src/tasks-runner/cache.js +12 -13
- package/src/tasks-runner/default-tasks-runner.js +1 -1
- package/src/tasks-runner/life-cycles/formatting-utils.d.ts +1 -1
- package/src/tasks-runner/life-cycles/formatting-utils.js +27 -15
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +3 -0
- package/src/tasks-runner/task-orchestrator.d.ts +3 -1
- package/src/tasks-runner/task-orchestrator.js +3 -2
- package/src/tasks-runner/tasks-schedule.js +1 -1
- package/src/utils/ab-testing.js +4 -1
- package/src/utils/child-process.js +5 -3
- package/src/utils/command-line-utils.js +7 -1
- package/src/utils/default-base.js +5 -2
- package/src/utils/git-utils.index-filter.js +2 -1
- package/src/utils/git-utils.js +4 -0
- package/src/utils/git-utils.tree-filter.js +3 -1
- package/src/utils/powerpack.d.ts +1 -1
- package/src/utils/powerpack.js +3 -8
- package/src/utils/sync-generators.d.ts +13 -3
- package/src/utils/sync-generators.js +99 -25
- package/src/utils/task-history.d.ts +2 -2
- package/src/utils/task-history.js +4 -1
package/.eslintrc.json
CHANGED
package/bin/nx.js
CHANGED
@@ -200,11 +200,19 @@ function getLocalNxVersion(workspace) {
|
|
200
200
|
}
|
201
201
|
function _getLatestVersionOfNx() {
|
202
202
|
try {
|
203
|
-
return (0, child_process_1.execSync)('npm view nx@latest version'
|
203
|
+
return (0, child_process_1.execSync)('npm view nx@latest version', {
|
204
|
+
windowsHide: true,
|
205
|
+
})
|
206
|
+
.toString()
|
207
|
+
.trim();
|
204
208
|
}
|
205
209
|
catch {
|
206
210
|
try {
|
207
|
-
return (0, child_process_1.execSync)('pnpm view nx@latest version'
|
211
|
+
return (0, child_process_1.execSync)('pnpm view nx@latest version', {
|
212
|
+
windowsHide: true,
|
213
|
+
})
|
214
|
+
.toString()
|
215
|
+
.trim();
|
208
216
|
}
|
209
217
|
catch {
|
210
218
|
return null;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.8.
|
3
|
+
"version": "19.8.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": {
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"yargs-parser": "21.1.1",
|
69
69
|
"node-machine-id": "1.1.12",
|
70
70
|
"ora": "5.3.0",
|
71
|
-
"@nrwl/tao": "19.8.
|
71
|
+
"@nrwl/tao": "19.8.1"
|
72
72
|
},
|
73
73
|
"peerDependencies": {
|
74
74
|
"@swc-node/register": "^1.8.0",
|
@@ -83,16 +83,16 @@
|
|
83
83
|
}
|
84
84
|
},
|
85
85
|
"optionalDependencies": {
|
86
|
-
"@nx/nx-darwin-x64": "19.8.
|
87
|
-
"@nx/nx-darwin-arm64": "19.8.
|
88
|
-
"@nx/nx-linux-x64-gnu": "19.8.
|
89
|
-
"@nx/nx-linux-x64-musl": "19.8.
|
90
|
-
"@nx/nx-win32-x64-msvc": "19.8.
|
91
|
-
"@nx/nx-linux-arm64-gnu": "19.8.
|
92
|
-
"@nx/nx-linux-arm64-musl": "19.8.
|
93
|
-
"@nx/nx-linux-arm-gnueabihf": "19.8.
|
94
|
-
"@nx/nx-win32-arm64-msvc": "19.8.
|
95
|
-
"@nx/nx-freebsd-x64": "19.8.
|
86
|
+
"@nx/nx-darwin-x64": "19.8.1",
|
87
|
+
"@nx/nx-darwin-arm64": "19.8.1",
|
88
|
+
"@nx/nx-linux-x64-gnu": "19.8.1",
|
89
|
+
"@nx/nx-linux-x64-musl": "19.8.1",
|
90
|
+
"@nx/nx-win32-x64-msvc": "19.8.1",
|
91
|
+
"@nx/nx-linux-arm64-gnu": "19.8.1",
|
92
|
+
"@nx/nx-linux-arm64-musl": "19.8.1",
|
93
|
+
"@nx/nx-linux-arm-gnueabihf": "19.8.1",
|
94
|
+
"@nx/nx-win32-arm64-msvc": "19.8.1",
|
95
|
+
"@nx/nx-freebsd-x64": "19.8.1"
|
96
96
|
},
|
97
97
|
"nx-migrations": {
|
98
98
|
"migrations": "./migrations.json",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ChangelogChange } from '../../src/command-line/release/changelog';
|
2
2
|
import { NxReleaseConfig } from '../../src/command-line/release/config/config';
|
3
3
|
import { GitCommit } from '../../src/command-line/release/utils/git';
|
4
|
-
import { RepoSlug } from '../../src/command-line/release/utils/github';
|
4
|
+
import { GithubRepoData, RepoSlug } from '../../src/command-line/release/utils/github';
|
5
5
|
import type { ProjectGraph } from '../../src/config/project-graph';
|
6
6
|
/**
|
7
7
|
* The ChangelogRenderOptions are specific to each ChangelogRenderer implementation, and are taken
|
@@ -30,6 +30,7 @@ export type DependencyBump = {
|
|
30
30
|
* @param {string | false} config.entryWhenNoChanges The (already interpolated) string to use as the changelog entry when there are no changes, or `false` if no entry should be generated
|
31
31
|
* @param {ChangelogRenderOptions} config.changelogRenderOptions The options specific to the ChangelogRenderer implementation
|
32
32
|
* @param {DependencyBump[]} config.dependencyBumps Optional list of additional dependency bumps that occurred as part of the release, outside of the commit data
|
33
|
+
* @param {GithubRepoData} config.repoData Resolved data for the current GitHub repository
|
33
34
|
*/
|
34
35
|
export type ChangelogRenderer = (config: {
|
35
36
|
projectGraph: ProjectGraph;
|
@@ -41,6 +42,7 @@ export type ChangelogRenderer = (config: {
|
|
41
42
|
changelogRenderOptions: DefaultChangelogRenderOptions;
|
42
43
|
dependencyBumps?: DependencyBump[];
|
43
44
|
repoSlug?: RepoSlug;
|
45
|
+
repoData?: GithubRepoData;
|
44
46
|
conventionalCommitsConfig: NxReleaseConfig['conventionalCommits'] | null;
|
45
47
|
}) => Promise<string> | string;
|
46
48
|
/**
|
@@ -10,7 +10,7 @@ const axios = _axios;
|
|
10
10
|
* The default ChangelogRenderer implementation that nx exports for the common case of generating markdown
|
11
11
|
* from the given commits and other metadata.
|
12
12
|
*/
|
13
|
-
const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion, project, entryWhenNoChanges, changelogRenderOptions, dependencyBumps, repoSlug, conventionalCommitsConfig, }) => {
|
13
|
+
const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion, project, entryWhenNoChanges, changelogRenderOptions, dependencyBumps, repoSlug, conventionalCommitsConfig, repoData, }) => {
|
14
14
|
const markdownLines = [];
|
15
15
|
// If the current range of changes contains both a commit and its revert, we strip them both from the final list. Changes from version plans are unaffected, as they have no hashes.
|
16
16
|
for (const change of changes) {
|
@@ -46,7 +46,7 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
|
|
46
46
|
if (relevantChanges[i].isBreaking) {
|
47
47
|
const change = relevantChanges[i];
|
48
48
|
additionalChangesForAuthorsSection.push(change);
|
49
|
-
const line = formatChange(change, changelogRenderOptions, isVersionPlans,
|
49
|
+
const line = formatChange(change, changelogRenderOptions, isVersionPlans, repoData);
|
50
50
|
breakingChanges.push(line);
|
51
51
|
relevantChanges.splice(i, 1);
|
52
52
|
}
|
@@ -89,7 +89,7 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
|
|
89
89
|
for (const scope of scopesSortedAlphabetically) {
|
90
90
|
const changes = changesGroupedByScope[scope];
|
91
91
|
for (const change of changes) {
|
92
|
-
const line = formatChange(change, changelogRenderOptions, isVersionPlans,
|
92
|
+
const line = formatChange(change, changelogRenderOptions, isVersionPlans, repoData);
|
93
93
|
markdownLines.push(line);
|
94
94
|
if (change.isBreaking) {
|
95
95
|
const breakingChangeExplanation = extractBreakingChangeExplanation(change.body);
|
@@ -132,7 +132,7 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
|
|
132
132
|
markdownLines.push('', `### ${changeTypes[type].changelog.title}`, '');
|
133
133
|
const changesInChronologicalOrder = group.reverse();
|
134
134
|
for (const change of changesInChronologicalOrder) {
|
135
|
-
const line = formatChange(change, changelogRenderOptions, isVersionPlans,
|
135
|
+
const line = formatChange(change, changelogRenderOptions, isVersionPlans, repoData);
|
136
136
|
markdownLines.push(line + '\n');
|
137
137
|
if (change.isBreaking) {
|
138
138
|
const breakingChangeExplanation = extractBreakingChangeExplanation(change.body);
|
@@ -176,7 +176,7 @@ const defaultChangelogRenderer = async ({ projectGraph, changes, releaseVersion,
|
|
176
176
|
}
|
177
177
|
}
|
178
178
|
// Try to map authors to github usernames
|
179
|
-
if (
|
179
|
+
if (repoData && changelogRenderOptions.mapAuthorsToGitHubUsernames) {
|
180
180
|
await Promise.all([..._authors.keys()].map(async (authorName) => {
|
181
181
|
const meta = _authors.get(authorName);
|
182
182
|
for (const email of meta.email) {
|
@@ -245,7 +245,7 @@ function groupBy(items, key) {
|
|
245
245
|
}
|
246
246
|
return groups;
|
247
247
|
}
|
248
|
-
function formatChange(change, changelogRenderOptions, isVersionPlans,
|
248
|
+
function formatChange(change, changelogRenderOptions, isVersionPlans, repoData) {
|
249
249
|
let description = change.description;
|
250
250
|
let extraLines = [];
|
251
251
|
let extraLinesStr = '';
|
@@ -267,8 +267,8 @@ function formatChange(change, changelogRenderOptions, isVersionPlans, repoSlug)
|
|
267
267
|
(!isVersionPlans && change.isBreaking ? 'โ ๏ธ ' : '') +
|
268
268
|
(!isVersionPlans && change.scope ? `**${change.scope.trim()}:** ` : '') +
|
269
269
|
description;
|
270
|
-
if (
|
271
|
-
changeLine += (0, github_1.formatReferences)(change.githubReferences,
|
270
|
+
if (repoData && changelogRenderOptions.commitReferences) {
|
271
|
+
changeLine += (0, github_1.formatReferences)(change.githubReferences, repoData);
|
272
272
|
}
|
273
273
|
if (extraLinesStr) {
|
274
274
|
changeLine += '\n\n' + extraLinesStr;
|
package/schemas/nx-schema.json
CHANGED
@@ -152,25 +152,7 @@
|
|
152
152
|
]
|
153
153
|
},
|
154
154
|
"version": {
|
155
|
-
"
|
156
|
-
{
|
157
|
-
"$ref": "#/definitions/NxReleaseVersionConfiguration"
|
158
|
-
},
|
159
|
-
{
|
160
|
-
"allOf": [
|
161
|
-
{
|
162
|
-
"not": {
|
163
|
-
"required": ["git"]
|
164
|
-
}
|
165
|
-
},
|
166
|
-
{
|
167
|
-
"not": {
|
168
|
-
"required": ["preVersionCommand"]
|
169
|
-
}
|
170
|
-
}
|
171
|
-
]
|
172
|
-
}
|
173
|
-
]
|
155
|
+
"$ref": "#/definitions/NxReleaseGroupVersionConfiguration"
|
174
156
|
},
|
175
157
|
"changelog": {
|
176
158
|
"oneOf": [
|
@@ -675,9 +657,32 @@
|
|
675
657
|
},
|
676
658
|
"preVersionCommand": {
|
677
659
|
"type": "string",
|
678
|
-
"description": "A command to run after validation of nx release configuration, but before versioning begins.
|
660
|
+
"description": "A command to run after validation of nx release configuration, but before versioning begins. Useful for preparing build artifacts. If --dry-run is passed, the command is still executed, but with the NX_DRY_RUN environment variable set to 'true'."
|
679
661
|
}
|
680
|
-
}
|
662
|
+
},
|
663
|
+
"additionalProperties": false
|
664
|
+
},
|
665
|
+
"NxReleaseGroupVersionConfiguration": {
|
666
|
+
"type": "object",
|
667
|
+
"properties": {
|
668
|
+
"conventionalCommits": {
|
669
|
+
"type": "boolean",
|
670
|
+
"description": "Shorthand for enabling the current version of projects to be resolved from git tags, and the next version to be determined by analyzing commit messages according to the Conventional Commits specification.",
|
671
|
+
"default": false
|
672
|
+
},
|
673
|
+
"generator": {
|
674
|
+
"type": "string"
|
675
|
+
},
|
676
|
+
"generatorOptions": {
|
677
|
+
"type": "object",
|
678
|
+
"additionalProperties": true
|
679
|
+
},
|
680
|
+
"groupPreVersionCommand": {
|
681
|
+
"type": "string",
|
682
|
+
"description": "A command to run after validation of nx release configuration AND after the release.version.preVersionCommand (if any), but before versioning begins for this specific group. Useful for preparing build artifacts for the group. If --dry-run is passed, the command is still executed, but with the NX_DRY_RUN environment variable set to 'true'."
|
683
|
+
}
|
684
|
+
},
|
685
|
+
"additionalProperties": false
|
681
686
|
},
|
682
687
|
"NxReleaseChangelogConfiguration": {
|
683
688
|
"type": "object",
|
@@ -691,6 +696,9 @@
|
|
691
696
|
{
|
692
697
|
"type": "boolean",
|
693
698
|
"enum": [false]
|
699
|
+
},
|
700
|
+
{
|
701
|
+
"$ref": "#/definitions/CreateReleaseProviderConfiguration"
|
694
702
|
}
|
695
703
|
]
|
696
704
|
},
|
@@ -724,6 +732,24 @@
|
|
724
732
|
}
|
725
733
|
}
|
726
734
|
},
|
735
|
+
"CreateReleaseProviderConfiguration": {
|
736
|
+
"type": "object",
|
737
|
+
"properties": {
|
738
|
+
"provider": {
|
739
|
+
"type": "string",
|
740
|
+
"enum": ["github-enterprise-server"]
|
741
|
+
},
|
742
|
+
"hostname": {
|
743
|
+
"type": "string",
|
744
|
+
"description": "The hostname of the VCS provider instance, e.g. github.example.com"
|
745
|
+
},
|
746
|
+
"apiBaseUrl": {
|
747
|
+
"type": "string",
|
748
|
+
"description": "The base URL for the relevant VCS provider API. If not set, this will default to `https://${hostname}/api/v3`"
|
749
|
+
}
|
750
|
+
},
|
751
|
+
"required": ["provider", "hostname"]
|
752
|
+
},
|
727
753
|
"NxReleaseVersionPlansConfiguration": {
|
728
754
|
"type": "object",
|
729
755
|
"properties": {
|
package/src/adapter/compat.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
export declare const allowedProjectExtensions: readonly ["tags", "implicitDependencies", "configFilePath", "$schema", "generators", "namedInputs", "name", "files", "root", "sourceRoot", "projectType", "release", "includedScripts", "metadata"];
|
2
|
-
export declare const allowedWorkspaceExtensions: readonly ["implicitDependencies", "affected", "defaultBase", "tasksRunnerOptions", "workspaceLayout", "plugins", "targetDefaults", "files", "generators", "namedInputs", "extends", "cli", "pluginsConfig", "defaultProject", "installation", "release", "nxCloudAccessToken", "nxCloudId", "nxCloudUrl", "nxCloudEncryptionKey", "parallel", "cacheDirectory", "useDaemonProcess", "useInferencePlugins", "neverConnectToCloud", "sync"];
|
2
|
+
export declare const allowedWorkspaceExtensions: readonly ["implicitDependencies", "affected", "defaultBase", "tasksRunnerOptions", "workspaceLayout", "plugins", "targetDefaults", "files", "generators", "namedInputs", "extends", "cli", "pluginsConfig", "defaultProject", "installation", "release", "nxCloudAccessToken", "nxCloudId", "nxCloudUrl", "nxCloudEncryptionKey", "parallel", "cacheDirectory", "useDaemonProcess", "useInferencePlugins", "neverConnectToCloud", "sync", "enableDbCache"];
|
package/src/adapter/compat.js
CHANGED
@@ -20,7 +20,9 @@ async function requirePowerpack() {
|
|
20
20
|
return Promise.resolve().then(() => require('@nx/powerpack-license')).catch(async (e) => {
|
21
21
|
if ('code' in e && e.code === 'MODULE_NOT_FOUND') {
|
22
22
|
try {
|
23
|
-
(0, child_process_1.execSync)(`${(0, package_manager_1.getPackageManagerCommand)().addDev} @nx/powerpack-license@latest
|
23
|
+
(0, child_process_1.execSync)(`${(0, package_manager_1.getPackageManagerCommand)().addDev} @nx/powerpack-license@latest`, {
|
24
|
+
windowsHide: true,
|
25
|
+
});
|
24
26
|
// @ts-ignore
|
25
27
|
return await Promise.resolve().then(() => require('@nx/powerpack-license'));
|
26
28
|
}
|
@@ -34,7 +34,9 @@ async function installPackage(pkgName, version, nxJson) {
|
|
34
34
|
spinner.start();
|
35
35
|
if ((0, fs_1.existsSync)('package.json')) {
|
36
36
|
const pmc = (0, package_manager_1.getPackageManagerCommand)();
|
37
|
-
await new Promise((resolve) => (0, child_process_1.exec)(`${pmc.addDev} ${pkgName}@${version}`,
|
37
|
+
await new Promise((resolve) => (0, child_process_1.exec)(`${pmc.addDev} ${pkgName}@${version}`, {
|
38
|
+
windowsHide: true,
|
39
|
+
}, (error, stdout) => {
|
38
40
|
if (error) {
|
39
41
|
spinner.fail();
|
40
42
|
output_1.output.addNewline();
|
@@ -108,7 +110,7 @@ async function initializePlugin(pkgName, options, nxJson) {
|
|
108
110
|
catch (e) {
|
109
111
|
spinner.fail();
|
110
112
|
output_1.output.addNewline();
|
111
|
-
logger_1.logger.error(e
|
113
|
+
logger_1.logger.error(e);
|
112
114
|
output_1.output.error({
|
113
115
|
title: `Failed to initialize ${pkgName}. Please check the error above for more details.`,
|
114
116
|
});
|
@@ -43,6 +43,7 @@ async function viewLogs() {
|
|
43
43
|
const pmc = (0, package_manager_1.getPackageManagerCommand)();
|
44
44
|
(0, child_process_1.execSync)(`${pmc.exec} nx-cloud upload-and-show-run-details`, {
|
45
45
|
stdio: [0, 1, 2],
|
46
|
+
windowsHide: true,
|
46
47
|
});
|
47
48
|
if (!cloudUsed) {
|
48
49
|
output_1.output.note({
|
@@ -34,6 +34,7 @@ async function nxExecCommand(args) {
|
|
34
34
|
NX_PROJECT_NAME: process.env.NX_TASK_TARGET_PROJECT,
|
35
35
|
NX_PROJECT_ROOT_PATH: projectGraph.nodes?.[process.env.NX_TASK_TARGET_PROJECT]?.data?.root,
|
36
36
|
},
|
37
|
+
windowsHide: true,
|
37
38
|
});
|
38
39
|
}
|
39
40
|
else {
|
@@ -66,6 +67,7 @@ async function runScriptAsNxTarget(projectGraph, argv, nxArgs) {
|
|
66
67
|
cwd: projectGraph.nodes?.[projectName]?.data?.root
|
67
68
|
? (0, path_2.joinPathFragments)(workspace_root_1.workspaceRoot, projectGraph.nodes?.[projectName]?.data?.root)
|
68
69
|
: workspace_root_1.workspaceRoot,
|
70
|
+
windowsHide: true,
|
69
71
|
});
|
70
72
|
});
|
71
73
|
}
|
@@ -77,7 +79,10 @@ function runTargetOnProject(scriptDefinition, targetName, project, projectName,
|
|
77
79
|
const pm = (0, package_manager_1.getPackageManagerCommand)();
|
78
80
|
// `targetName` might be an npm script with `:` like: `start:dev`, `start:debug`.
|
79
81
|
const command = `${pm.exec} nx run ${projectName}:\\\"${targetName}\\\" ${extraArgs.join(' ')}`;
|
80
|
-
(0, child_process_1.execSync)(command, {
|
82
|
+
(0, child_process_1.execSync)(command, {
|
83
|
+
stdio: 'inherit',
|
84
|
+
windowsHide: true,
|
85
|
+
});
|
81
86
|
}
|
82
87
|
function readScriptArgV(overrides) {
|
83
88
|
const scriptSeparatorIdx = process.argv.findIndex((el) => el === '--');
|
@@ -144,10 +144,12 @@ function write(patterns) {
|
|
144
144
|
const prettierPath = getPrettierPath();
|
145
145
|
(0, node_child_process_1.execSync)(`node "${prettierPath}" --write --list-different ${regularPatterns.join(' ')}`, {
|
146
146
|
stdio: [0, 1, 2],
|
147
|
+
windowsHide: true,
|
147
148
|
});
|
148
149
|
if (swcrcPatterns.length > 0) {
|
149
150
|
(0, node_child_process_1.execSync)(`node "${prettierPath}" --write --list-different ${swcrcPatterns.join(' ')} --parser json`, {
|
150
151
|
stdio: [0, 1, 2],
|
152
|
+
windowsHide: true,
|
151
153
|
});
|
152
154
|
}
|
153
155
|
}
|
@@ -158,7 +160,7 @@ async function check(patterns) {
|
|
158
160
|
}
|
159
161
|
const prettierPath = getPrettierPath();
|
160
162
|
return new Promise((resolve) => {
|
161
|
-
(0, node_child_process_1.exec)(`node "${prettierPath}" --list-different ${patterns.join(' ')}`, { encoding: 'utf-8' }, (error, stdout) => {
|
163
|
+
(0, node_child_process_1.exec)(`node "${prettierPath}" --list-different ${patterns.join(' ')}`, { encoding: 'utf-8', windowsHide: true }, (error, stdout) => {
|
162
164
|
if (error) {
|
163
165
|
// The command failed so there are files with different formatting. Prettier writes them to stdout, newline separated.
|
164
166
|
resolve(stdout.trim().split('\n'));
|
@@ -801,5 +801,6 @@ function getHelpTextFromTarget(projectName, targetName) {
|
|
801
801
|
throw new Error(`No help command found for ${projectName}:${targetName}`);
|
802
802
|
return (0, node_child_process_1.execSync)(command, {
|
803
803
|
cwd: target.options?.cwd ?? workspace_root_1.workspaceRoot,
|
804
|
+
windowsHide: true,
|
804
805
|
}).toString();
|
805
806
|
}
|
@@ -5,5 +5,8 @@ const child_process_1 = require("child_process");
|
|
5
5
|
const package_manager_1 = require("../../../../utils/package-manager");
|
6
6
|
function setupIntegratedWorkspace() {
|
7
7
|
const pmc = (0, package_manager_1.getPackageManagerCommand)();
|
8
|
-
(0, child_process_1.execSync)(`${pmc.exec} nx g @nx/angular:ng-add`, {
|
8
|
+
(0, child_process_1.execSync)(`${pmc.exec} nx g @nx/angular:ng-add`, {
|
9
|
+
stdio: [0, 1, 2],
|
10
|
+
windowsHide: true,
|
11
|
+
});
|
9
12
|
}
|
@@ -82,7 +82,10 @@ async function getLegacyMigrationFunctionIfApplicable(repoRoot, options) {
|
|
82
82
|
unscopedPkgName,
|
83
83
|
}, pmc);
|
84
84
|
output_1.output.log({ title: '๐ Setting up workspace' });
|
85
|
-
(0, child_process_1.execSync)(`${pmc.exec} ${legacyMigrationCommand}`, {
|
85
|
+
(0, child_process_1.execSync)(`${pmc.exec} ${legacyMigrationCommand}`, {
|
86
|
+
stdio: [0, 1, 2],
|
87
|
+
windowsHide: true,
|
88
|
+
});
|
86
89
|
if (useNxCloud) {
|
87
90
|
output_1.output.log({ title: '๐ ๏ธ Setting up Nx Cloud' });
|
88
91
|
await (0, utils_1.initCloud)('nx-init-angular');
|
@@ -107,7 +110,7 @@ async function installDependencies(repoRoot, pkgInfo, pmc) {
|
|
107
110
|
json.dependencies = (0, object_sort_1.sortObjectByKeys)(json.dependencies);
|
108
111
|
}
|
109
112
|
(0, fileutils_1.writeJsonFile)(`package.json`, json);
|
110
|
-
(0, child_process_1.execSync)(pmc.install, { stdio: [0, 1, 2] });
|
113
|
+
(0, child_process_1.execSync)(pmc.install, { stdio: [0, 1, 2], windowsHide: true });
|
111
114
|
}
|
112
115
|
async function resolvePackageVersion(packageName, version) {
|
113
116
|
try {
|
@@ -62,7 +62,9 @@ function generateDotNxSetup(version) {
|
|
62
62
|
}
|
63
63
|
function normalizeVersionForNxJson(pkg, version) {
|
64
64
|
if (!(0, semver_1.valid)(version)) {
|
65
|
-
version = (0, child_process_1.execSync)(`npm view ${pkg}@${version} version
|
65
|
+
version = (0, child_process_1.execSync)(`npm view ${pkg}@${version} version`, {
|
66
|
+
windowsHide: true,
|
67
|
+
}).toString();
|
66
68
|
}
|
67
69
|
return version.trimEnd();
|
68
70
|
}
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkForUncommittedChanges = checkForUncommittedChanges;
|
4
4
|
const child_process_1 = require("child_process");
|
5
5
|
function checkForUncommittedChanges() {
|
6
|
-
const gitResult = (0, child_process_1.execSync)('git status --porcelain'
|
6
|
+
const gitResult = (0, child_process_1.execSync)('git status --porcelain', {
|
7
|
+
windowsHide: true,
|
8
|
+
}).toString();
|
7
9
|
const filteredResults = gitResult
|
8
10
|
.split('\n')
|
9
11
|
.filter((line) => !line.includes('.nx') && line.trim().length > 0);
|
@@ -41,6 +41,7 @@ function installDependencies(options) {
|
|
41
41
|
}
|
42
42
|
(0, child_process_1.execSync)(`${options.pmc.addDev} ${dependencies.join(' ')}`, {
|
43
43
|
stdio: [0, 1, 2],
|
44
|
+
windowsHide: true,
|
44
45
|
});
|
45
46
|
}
|
46
47
|
async function normalizeOptions(options) {
|
@@ -54,7 +55,9 @@ async function normalizeOptions(options) {
|
|
54
55
|
...packageJson.devDependencies,
|
55
56
|
};
|
56
57
|
const isCRA5 = /^[^~]?5/.test(deps['react-scripts']);
|
57
|
-
const npmVersion = (0, child_process_1.execSync)('npm -v'
|
58
|
+
const npmVersion = (0, child_process_1.execSync)('npm -v', {
|
59
|
+
windowsHide: true,
|
60
|
+
}).toString();
|
58
61
|
// Should remove this check 04/2023 once Node 14 & npm 6 reach EOL
|
59
62
|
const npxYesFlagNeeded = !npmVersion.startsWith('6'); // npm 7 added -y flag to npx
|
60
63
|
const isVite = options.vite;
|
@@ -86,8 +89,14 @@ async function reorgnizeWorkspaceStructure(options) {
|
|
86
89
|
moveFilesToTempWorkspace(options);
|
87
90
|
await addBundler(options);
|
88
91
|
output_1.output.log({ title: '๐งถ Updating .gitignore file' });
|
89
|
-
(0, child_process_1.execSync)(`echo "node_modules" >> .gitignore`, {
|
90
|
-
|
92
|
+
(0, child_process_1.execSync)(`echo "node_modules" >> .gitignore`, {
|
93
|
+
stdio: [0, 1, 2],
|
94
|
+
windowsHide: true,
|
95
|
+
});
|
96
|
+
(0, child_process_1.execSync)(`echo "dist" >> .gitignore`, {
|
97
|
+
stdio: [0, 1, 2],
|
98
|
+
windowsHide: true,
|
99
|
+
});
|
91
100
|
process.chdir('..');
|
92
101
|
copyFromTempWorkspaceToRoot();
|
93
102
|
cleanUpUnusedFilesAndAddConfigFiles(options);
|
@@ -108,7 +117,7 @@ async function reorgnizeWorkspaceStructure(options) {
|
|
108
117
|
}
|
109
118
|
function createTempWorkspace(options) {
|
110
119
|
(0, fs_extra_1.removeSync)('temp-workspace');
|
111
|
-
(0, child_process_1.execSync)(`npx ${options.npxYesFlagNeeded ? '-y' : ''} create-nx-workspace@latest temp-workspace --appName=${options.reactAppName} --preset=react-monorepo --style=css --bundler=${options.isVite ? 'vite' : 'webpack'} --packageManager=${options.packageManager} ${options.nxCloud ? '--nxCloud=yes' : '--nxCloud=skip'} ${options.addE2e ? '--e2eTestRunner=playwright' : '--e2eTestRunner=none'}`, { stdio: [0, 1, 2] });
|
120
|
+
(0, child_process_1.execSync)(`npx ${options.npxYesFlagNeeded ? '-y' : ''} create-nx-workspace@latest temp-workspace --appName=${options.reactAppName} --preset=react-monorepo --style=css --bundler=${options.isVite ? 'vite' : 'webpack'} --packageManager=${options.packageManager} ${options.nxCloud ? '--nxCloud=yes' : '--nxCloud=skip'} ${options.addE2e ? '--e2eTestRunner=playwright' : '--e2eTestRunner=none'}`, { stdio: [0, 1, 2], windowsHide: true });
|
112
121
|
output_1.output.log({ title: '๐ Welcome to Nx!' });
|
113
122
|
output_1.output.log({ title: '๐งน Clearing unused files' });
|
114
123
|
(0, fs_extra_1.copySync)((0, path_1.join)('temp-workspace', 'apps', options.reactAppName, 'project.json'), 'project.json');
|
@@ -191,7 +200,10 @@ async function addBundler(options) {
|
|
191
200
|
output_1.output.log({
|
192
201
|
title: '๐ฌ Skip CRA preflight check since Nx manages the monorepo',
|
193
202
|
});
|
194
|
-
(0, child_process_1.execSync)(`echo "SKIP_PREFLIGHT_CHECK=true" > .env`, {
|
203
|
+
(0, child_process_1.execSync)(`echo "SKIP_PREFLIGHT_CHECK=true" > .env`, {
|
204
|
+
stdio: [0, 1, 2],
|
205
|
+
windowsHide: true,
|
206
|
+
});
|
195
207
|
}
|
196
208
|
}
|
197
209
|
function copyFromTempWorkspaceToRoot() {
|
@@ -59,6 +59,7 @@ function deduceDefaultBase() {
|
|
59
59
|
try {
|
60
60
|
(0, child_process_1.execSync)(`git rev-parse --verify main`, {
|
61
61
|
stdio: ['ignore', 'ignore', 'ignore'],
|
62
|
+
windowsHide: true,
|
62
63
|
});
|
63
64
|
return 'main';
|
64
65
|
}
|
@@ -66,6 +67,7 @@ function deduceDefaultBase() {
|
|
66
67
|
try {
|
67
68
|
(0, child_process_1.execSync)(`git rev-parse --verify dev`, {
|
68
69
|
stdio: ['ignore', 'ignore', 'ignore'],
|
70
|
+
windowsHide: true,
|
69
71
|
});
|
70
72
|
return 'dev';
|
71
73
|
}
|
@@ -73,6 +75,7 @@ function deduceDefaultBase() {
|
|
73
75
|
try {
|
74
76
|
(0, child_process_1.execSync)(`git rev-parse --verify develop`, {
|
75
77
|
stdio: ['ignore', 'ignore', 'ignore'],
|
78
|
+
windowsHide: true,
|
76
79
|
});
|
77
80
|
return 'develop';
|
78
81
|
}
|
@@ -80,6 +83,7 @@ function deduceDefaultBase() {
|
|
80
83
|
try {
|
81
84
|
(0, child_process_1.execSync)(`git rev-parse --verify next`, {
|
82
85
|
stdio: ['ignore', 'ignore', 'ignore'],
|
86
|
+
windowsHide: true,
|
83
87
|
});
|
84
88
|
return 'next';
|
85
89
|
}
|
@@ -128,7 +132,7 @@ function updateGitIgnore(root) {
|
|
128
132
|
catch { }
|
129
133
|
}
|
130
134
|
function runInstall(repoRoot, pmc = (0, package_manager_1.getPackageManagerCommand)()) {
|
131
|
-
(0, child_process_1.execSync)(pmc.install, { stdio: [0, 1, 2], cwd: repoRoot });
|
135
|
+
(0, child_process_1.execSync)(pmc.install, { stdio: [0, 1, 2], cwd: repoRoot, windowsHide: true });
|
132
136
|
}
|
133
137
|
async function initCloud(installationSource) {
|
134
138
|
const token = await (0, connect_to_nx_cloud_2.connectWorkspaceToCloud)({
|
@@ -29,9 +29,10 @@ function installPlugins(repoRoot, plugins, pmc, updatePackageScripts) {
|
|
29
29
|
(0, utils_1.runInstall)(repoRoot, pmc);
|
30
30
|
output_1.output.log({ title: '๐จ Configuring plugins' });
|
31
31
|
for (const plugin of plugins) {
|
32
|
-
(0, child_process_2.execSync)(`${pmc.exec} nx g ${plugin}:init --keepExistingVersions ${updatePackageScripts ? '--updatePackageScripts' : ''}
|
32
|
+
(0, child_process_2.execSync)(`${pmc.exec} nx g ${plugin}:init --keepExistingVersions ${updatePackageScripts ? '--updatePackageScripts' : ''}`, {
|
33
33
|
stdio: [0, 1, 2],
|
34
34
|
cwd: repoRoot,
|
35
|
+
windowsHide: true,
|
35
36
|
});
|
36
37
|
}
|
37
38
|
}
|
@@ -101,6 +101,7 @@ function runMigration() {
|
|
101
101
|
}
|
102
102
|
(0, child_process_2.execSync)(`${p} _migrate ${process.argv.slice(3).join(' ')}`, {
|
103
103
|
stdio: ['inherit', 'inherit', 'inherit'],
|
104
|
+
windowsHide: true,
|
104
105
|
});
|
105
106
|
}
|
106
107
|
}
|
@@ -127,18 +128,21 @@ function nxCliPath() {
|
|
127
128
|
(0, child_process_2.execSync)(pmc.preInstall, {
|
128
129
|
cwd: tmpDir,
|
129
130
|
stdio: ['ignore', 'ignore', 'ignore'],
|
131
|
+
windowsHide: true,
|
130
132
|
});
|
131
133
|
// if it's berry ensure we set the node_linker to node-modules
|
132
134
|
if (packageManager === 'yarn' && pmc.ciInstall.includes('immutable')) {
|
133
135
|
(0, child_process_2.execSync)('yarn config set nodeLinker node-modules', {
|
134
136
|
cwd: tmpDir,
|
135
137
|
stdio: ['ignore', 'ignore', 'ignore'],
|
138
|
+
windowsHide: true,
|
136
139
|
});
|
137
140
|
}
|
138
141
|
}
|
139
142
|
(0, child_process_2.execSync)(pmc.install, {
|
140
143
|
cwd: tmpDir,
|
141
144
|
stdio: ['ignore', 'ignore', 'ignore'],
|
145
|
+
windowsHide: true,
|
142
146
|
});
|
143
147
|
// Set NODE_PATH so that these modules can be used for module resolution
|
144
148
|
addToNodePath(path.join(tmpDir, 'node_modules'));
|
@@ -886,7 +886,7 @@ function runInstall() {
|
|
886
886
|
output_1.output.log({
|
887
887
|
title: `Running '${pmCommands.install}' to make sure necessary packages are installed`,
|
888
888
|
});
|
889
|
-
(0, child_process_1.execSync)(pmCommands.install, { stdio: [0, 1, 2] });
|
889
|
+
(0, child_process_1.execSync)(pmCommands.install, { stdio: [0, 1, 2], windowsHide: true });
|
890
890
|
}
|
891
891
|
async function executeMigrations(root, migrations, isVerbose, shouldCreateCommits, commitPrefix) {
|
892
892
|
let initialDeps = getStringifiedPackageJsonDeps(root);
|