nx 21.4.0-beta.0 → 21.4.0-beta.2
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 +2 -0
- package/bin/nx.js +6 -6
- package/bin/post-install.js +8 -22
- package/package.json +12 -11
- package/schemas/nx-schema.json +77 -0
- package/src/command-line/index.d.ts +23 -0
- package/src/command-line/index.d.ts.map +1 -0
- package/src/command-line/index.js +26 -0
- package/src/command-line/init/implementation/add-nx-to-monorepo.d.ts +1 -1
- package/src/command-line/init/implementation/add-nx-to-monorepo.d.ts.map +1 -1
- package/src/command-line/init/implementation/add-nx-to-monorepo.js +2 -2
- package/src/command-line/init/implementation/add-nx-to-npm-repo.d.ts +1 -1
- package/src/command-line/init/implementation/add-nx-to-npm-repo.d.ts.map +1 -1
- package/src/command-line/init/implementation/add-nx-to-npm-repo.js +2 -2
- package/src/command-line/init/implementation/utils.d.ts.map +1 -1
- package/src/command-line/init/implementation/utils.js +1 -5
- package/src/command-line/init/init-v2.d.ts.map +1 -1
- package/src/command-line/init/init-v2.js +41 -23
- package/src/command-line/nx-cloud/connect/command-object.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/command-object.js +2 -1
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.d.ts +1 -0
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.d.ts.map +1 -1
- package/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +12 -0
- package/src/command-line/release/changelog.d.ts.map +1 -1
- package/src/command-line/release/changelog.js +6 -2
- package/src/command-line/release/command-object.d.ts +1 -0
- package/src/command-line/release/command-object.d.ts.map +1 -1
- package/src/command-line/release/command-object.js +4 -0
- package/src/command-line/release/config/config.d.ts +10 -3
- package/src/command-line/release/config/config.d.ts.map +1 -1
- package/src/command-line/release/config/config.js +103 -0
- package/src/command-line/release/config/filter-release-groups.d.ts +5 -1
- package/src/command-line/release/config/filter-release-groups.d.ts.map +1 -1
- package/src/command-line/release/release.d.ts.map +1 -1
- package/src/command-line/release/release.js +6 -1
- package/src/command-line/release/utils/shared.d.ts +9 -0
- package/src/command-line/release/utils/shared.d.ts.map +1 -1
- package/src/command-line/release/utils/shared.js +25 -4
- package/src/command-line/release/version/project-logger.d.ts.map +1 -1
- package/src/command-line/release/version/project-logger.js +1 -0
- package/src/command-line/release/version/release-group-processor.d.ts +6 -1
- package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
- package/src/command-line/release/version/release-group-processor.js +73 -3
- package/src/command-line/release/version/version-actions.d.ts +21 -0
- package/src/command-line/release/version/version-actions.d.ts.map +1 -1
- package/src/command-line/release/version/version-actions.js +32 -1
- package/src/command-line/release/version.d.ts.map +1 -1
- package/src/command-line/release/version.js +42 -11
- package/src/command-line/sync/sync.d.ts.map +1 -1
- package/src/command-line/sync/sync.js +8 -2
- package/src/config/nx-json.d.ts +58 -0
- package/src/config/nx-json.d.ts.map +1 -1
- package/src/config/workspace-json-project-json.d.ts +2 -1
- package/src/config/workspace-json-project-json.d.ts.map +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/daemon/server/handle-get-sync-generator-changes.d.ts.map +1 -1
- package/src/daemon/server/handle-get-sync-generator-changes.js +1 -0
- package/src/native/index.d.ts +4 -0
- package/src/native/native-bindings.js +1 -0
- package/src/native/nx.wasi.cjs +12 -10
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts.map +1 -1
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +3 -7
- package/src/plugins/js/lock-file/npm-parser.js +2 -2
- package/src/plugins/js/lock-file/pnpm-parser.js +2 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts.map +1 -1
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +5 -1
- package/src/project-graph/utils/normalize-project-nodes.d.ts +5 -5
- package/src/project-graph/utils/normalize-project-nodes.d.ts.map +1 -1
- package/src/project-graph/utils/normalize-project-nodes.js +35 -6
- package/src/tasks-runner/is-tui-enabled.d.ts.map +1 -1
- package/src/tasks-runner/is-tui-enabled.js +2 -0
- package/src/tasks-runner/life-cycle.d.ts +2 -0
- package/src/tasks-runner/life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycle.js +7 -0
- package/src/tasks-runner/task-orchestrator.d.ts.map +1 -1
- package/src/tasks-runner/task-orchestrator.js +5 -0
- package/src/tasks-runner/tasks-schedule.d.ts +1 -0
- package/src/tasks-runner/tasks-schedule.d.ts.map +1 -1
- package/src/tasks-runner/tasks-schedule.js +3 -0
- package/src/utils/ab-testing.d.ts +3 -3
- package/src/utils/ab-testing.d.ts.map +1 -1
- package/src/utils/ab-testing.js +3 -3
- package/src/utils/git-utils.d.ts +1 -0
- package/src/utils/git-utils.d.ts.map +1 -1
- package/src/utils/git-utils.js +11 -4
- package/src/utils/sync-generators.d.ts +3 -1
- package/src/utils/sync-generators.d.ts.map +1 -1
- package/src/utils/sync-generators.js +7 -1
package/.eslintrc.json
CHANGED
@@ -138,6 +138,8 @@
|
|
138
138
|
// Powerpack plugin conditionally available dynamically at runtime
|
139
139
|
"@nx/powerpack-conformance",
|
140
140
|
"@nx/conformance",
|
141
|
+
// Nx Docker plugin conditionally available dynamically at runtime
|
142
|
+
"@nx/docker",
|
141
143
|
// Only used in test-utils at the time of writing
|
142
144
|
"@ltd/j-toml"
|
143
145
|
]
|
package/bin/nx.js
CHANGED
@@ -68,7 +68,12 @@ async function main() {
|
|
68
68
|
handleMissingLocalInstallation(workspace ? workspace.dir : null);
|
69
69
|
}
|
70
70
|
// this file is already in the local workspace
|
71
|
-
if (
|
71
|
+
if (isNxCloudCommand(process.argv[2])) {
|
72
|
+
// nx-cloud commands can run without local Nx installation
|
73
|
+
process.env.NX_DAEMON = 'false';
|
74
|
+
require('nx/src/command-line/nx-commands').commandsObject.argv;
|
75
|
+
}
|
76
|
+
else if (isLocalInstall) {
|
72
77
|
await (0, init_local_1.initLocal)(workspace);
|
73
78
|
}
|
74
79
|
else if (localNx) {
|
@@ -82,11 +87,6 @@ async function main() {
|
|
82
87
|
require(localNx);
|
83
88
|
}
|
84
89
|
}
|
85
|
-
else if (isNxCloudCommand(process.argv[2])) {
|
86
|
-
// nx-cloud commands can run without local Nx installation
|
87
|
-
process.env.NX_DAEMON = 'false';
|
88
|
-
require('nx/src/command-line/nx-commands').commandsObject.argv;
|
89
|
-
}
|
90
90
|
}
|
91
91
|
}
|
92
92
|
function handleNoWorkspace(globalNxVersion) {
|
package/bin/post-install.js
CHANGED
@@ -1,43 +1,28 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const project_graph_1 = require("../src/project-graph/project-graph");
|
4
3
|
const workspace_root_1 = require("../src/utils/workspace-root");
|
5
4
|
const fileutils_1 = require("../src/utils/fileutils");
|
6
5
|
const path_1 = require("path");
|
7
|
-
const client_1 = require("../src/daemon/client/client");
|
8
6
|
const assert_supported_platform_1 = require("../src/native/assert-supported-platform");
|
9
7
|
const update_manager_1 = require("../src/nx-cloud/update-manager");
|
10
8
|
const get_cloud_options_1 = require("../src/nx-cloud/utilities/get-cloud-options");
|
11
9
|
const nx_cloud_utils_1 = require("../src/utils/nx-cloud-utils");
|
12
10
|
const nx_json_1 = require("../src/config/nx-json");
|
13
11
|
const logger_1 = require("../src/utils/logger");
|
14
|
-
|
12
|
+
// The post install is not critical, to avoid any chance that it may hang
|
13
|
+
// we will kill this process after 30 seconds.
|
14
|
+
const postinstallTimeout = setTimeout(() => {
|
15
|
+
logger_1.logger.verbose('Nx post-install timed out.');
|
16
|
+
process.exit(0);
|
17
|
+
}, 30_000);
|
15
18
|
(async () => {
|
16
19
|
const start = new Date();
|
17
20
|
try {
|
18
21
|
if (isMainNxPackage() && (0, fileutils_1.fileExists)((0, path_1.join)(workspace_root_1.workspaceRoot, 'nx.json'))) {
|
19
22
|
(0, assert_supported_platform_1.assertSupportedPlatform)();
|
20
|
-
(0, workspace_context_1.setupWorkspaceContext)(workspace_root_1.workspaceRoot);
|
21
|
-
if (client_1.daemonClient.enabled()) {
|
22
|
-
try {
|
23
|
-
await client_1.daemonClient.stop();
|
24
|
-
}
|
25
|
-
catch (e) { }
|
26
|
-
}
|
27
|
-
const tasks = [
|
28
|
-
(0, project_graph_1.buildProjectGraphAndSourceMapsWithoutDaemon)(),
|
29
|
-
];
|
30
23
|
if ((0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)())) {
|
31
|
-
|
24
|
+
await (0, update_manager_1.verifyOrUpdateNxCloudClient)((0, get_cloud_options_1.getCloudOptions)());
|
32
25
|
}
|
33
|
-
process.env.NX_DAEMON = 'false';
|
34
|
-
await Promise.all(tasks.map((promise) => {
|
35
|
-
return promise.catch((e) => {
|
36
|
-
if (process.env.NX_VERBOSE_LOGGING === 'true') {
|
37
|
-
console.warn(e);
|
38
|
-
}
|
39
|
-
});
|
40
|
-
}));
|
41
26
|
}
|
42
27
|
}
|
43
28
|
catch (e) {
|
@@ -46,6 +31,7 @@ const workspace_context_1 = require("../src/utils/workspace-context");
|
|
46
31
|
finally {
|
47
32
|
const end = new Date();
|
48
33
|
logger_1.logger.verbose(`Nx postinstall steps took ${end.getTime() - start.getTime()}ms`);
|
34
|
+
clearTimeout(postinstallTimeout);
|
49
35
|
process.exit(0);
|
50
36
|
}
|
51
37
|
})();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "21.4.0-beta.
|
3
|
+
"version": "21.4.0-beta.2",
|
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": {
|
@@ -83,16 +83,16 @@
|
|
83
83
|
}
|
84
84
|
},
|
85
85
|
"optionalDependencies": {
|
86
|
-
"@nx/nx-darwin-arm64": "21.4.0-beta.
|
87
|
-
"@nx/nx-darwin-x64": "21.4.0-beta.
|
88
|
-
"@nx/nx-freebsd-x64": "21.4.0-beta.
|
89
|
-
"@nx/nx-linux-arm-gnueabihf": "21.4.0-beta.
|
90
|
-
"@nx/nx-linux-arm64-gnu": "21.4.0-beta.
|
91
|
-
"@nx/nx-linux-arm64-musl": "21.4.0-beta.
|
92
|
-
"@nx/nx-linux-x64-gnu": "21.4.0-beta.
|
93
|
-
"@nx/nx-linux-x64-musl": "21.4.0-beta.
|
94
|
-
"@nx/nx-win32-arm64-msvc": "21.4.0-beta.
|
95
|
-
"@nx/nx-win32-x64-msvc": "21.4.0-beta.
|
86
|
+
"@nx/nx-darwin-arm64": "21.4.0-beta.2",
|
87
|
+
"@nx/nx-darwin-x64": "21.4.0-beta.2",
|
88
|
+
"@nx/nx-freebsd-x64": "21.4.0-beta.2",
|
89
|
+
"@nx/nx-linux-arm-gnueabihf": "21.4.0-beta.2",
|
90
|
+
"@nx/nx-linux-arm64-gnu": "21.4.0-beta.2",
|
91
|
+
"@nx/nx-linux-arm64-musl": "21.4.0-beta.2",
|
92
|
+
"@nx/nx-linux-x64-gnu": "21.4.0-beta.2",
|
93
|
+
"@nx/nx-linux-x64-musl": "21.4.0-beta.2",
|
94
|
+
"@nx/nx-win32-arm64-msvc": "21.4.0-beta.2",
|
95
|
+
"@nx/nx-win32-x64-msvc": "21.4.0-beta.2"
|
96
96
|
},
|
97
97
|
"nx-migrations": {
|
98
98
|
"migrations": "./migrations.json",
|
@@ -129,6 +129,7 @@
|
|
129
129
|
"@nx/vue",
|
130
130
|
"@nx/web",
|
131
131
|
"@nx/webpack",
|
132
|
+
"@nx/docker",
|
132
133
|
{
|
133
134
|
"package": "nx-cloud",
|
134
135
|
"version": "latest"
|
package/schemas/nx-schema.json
CHANGED
@@ -224,6 +224,18 @@
|
|
224
224
|
"description": "Enables using version plans as a specifier source for versioning and to determine changes for changelog generation."
|
225
225
|
}
|
226
226
|
]
|
227
|
+
},
|
228
|
+
"docker": {
|
229
|
+
"oneOf": [
|
230
|
+
{
|
231
|
+
"type": "boolean",
|
232
|
+
"enum": [true],
|
233
|
+
"description": "Enable docker configuration with default settings. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning. "
|
234
|
+
},
|
235
|
+
{
|
236
|
+
"$ref": "#/definitions/NxReleaseGroupDockerConfiguration"
|
237
|
+
}
|
238
|
+
]
|
227
239
|
}
|
228
240
|
},
|
229
241
|
"required": ["projects"]
|
@@ -309,6 +321,18 @@
|
|
309
321
|
},
|
310
322
|
"releaseTagPatternStrictPreid": {
|
311
323
|
"$ref": "#/definitions/NxReleaseReleaseTagPatternStrictPreidConfiguration"
|
324
|
+
},
|
325
|
+
"docker": {
|
326
|
+
"oneOf": [
|
327
|
+
{
|
328
|
+
"type": "boolean",
|
329
|
+
"enum": [true],
|
330
|
+
"description": "Enable docker configuration with default settings. Warning: Docker support is experimental. Breaking changes may occur and not adhere to semver versioning."
|
331
|
+
},
|
332
|
+
{
|
333
|
+
"$ref": "#/definitions/NxReleaseDockerConfiguration"
|
334
|
+
}
|
335
|
+
]
|
312
336
|
}
|
313
337
|
}
|
314
338
|
},
|
@@ -995,6 +1019,59 @@
|
|
995
1019
|
}
|
996
1020
|
}
|
997
1021
|
}
|
1022
|
+
},
|
1023
|
+
"NxReleaseDockerConfiguration": {
|
1024
|
+
"type": "object",
|
1025
|
+
"description": "Configuration for handling Docker projects during nx release.",
|
1026
|
+
"properties": {
|
1027
|
+
"preVersionCommand": {
|
1028
|
+
"type": "string",
|
1029
|
+
"description": "A command to run after validation of nx release configuration, but before docker versioning begins. Useful for preparing docker build artifacts. If --dry-run is passed, the command is still executed, but with the NX_DRY_RUN environment variable set to 'true'."
|
1030
|
+
},
|
1031
|
+
"skipVersionActions": {
|
1032
|
+
"oneOf": [
|
1033
|
+
{
|
1034
|
+
"type": "array",
|
1035
|
+
"items": {
|
1036
|
+
"type": "string"
|
1037
|
+
},
|
1038
|
+
"description": "Array of projects which should use a no-op VersionActions implementation rather than any potentially inferred by default or via Inference Plugins."
|
1039
|
+
},
|
1040
|
+
{
|
1041
|
+
"type": "boolean",
|
1042
|
+
"description": "When set to true, all projects in the release setup/release group will use a no-op VersionActions implementation."
|
1043
|
+
}
|
1044
|
+
],
|
1045
|
+
"description": "Projects which should use a no-op VersionActions implementation rather than any potentially inferred by default or via Inference Plugins. Can be an array of project names (subset of projects in the release setup/release group) or a boolean (true means all projects)."
|
1046
|
+
},
|
1047
|
+
"versionSchemes": {
|
1048
|
+
"type": "object",
|
1049
|
+
"additionalProperties": {
|
1050
|
+
"type": "string"
|
1051
|
+
},
|
1052
|
+
"description": "Record of named version patterns to choose between when versioning docker projects. e.g. \"production\": \"{currentDate|YYMM.DD}.{shortCommitSha}\", \"hotfix\": \"{currentDate|YYMM.DD}-hotfix\""
|
1053
|
+
},
|
1054
|
+
"repositoryName": {
|
1055
|
+
"type": "string",
|
1056
|
+
"description": "Repository name for the image on the configured registry"
|
1057
|
+
},
|
1058
|
+
"registryUrl": {
|
1059
|
+
"type": "string",
|
1060
|
+
"description": "Url of the Docker Image/Container Registry to push images to. Defaults to Docker Hub."
|
1061
|
+
}
|
1062
|
+
},
|
1063
|
+
"additionalProperties": false
|
1064
|
+
},
|
1065
|
+
"NxReleaseGroupDockerConfiguration": {
|
1066
|
+
"type": "object",
|
1067
|
+
"$comment": "We need to improve this configuration definition to be more precise once legacy versioning is removed. Right now it needs to be left open and runtime validation will ensure correct behavior.",
|
1068
|
+
"properties": {
|
1069
|
+
"groupPreVersionCommand": {
|
1070
|
+
"type": "string",
|
1071
|
+
"description": "A command to run after validation of nx release configuration, but before docker versioning begins. Used for preparing docker build artifacts. If --dry-run is passed, the command is still executed, but with the NX_DRY_RUN environment variable set to 'true'. It will run in addition to the global `preVersionCommand`"
|
1072
|
+
}
|
1073
|
+
},
|
1074
|
+
"additionalProperties": true
|
998
1075
|
}
|
999
1076
|
}
|
1000
1077
|
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
export * from './add/command-object';
|
2
|
+
export * from './affected/command-object';
|
3
|
+
export * from './daemon/command-object';
|
4
|
+
export * from './exec/command-object';
|
5
|
+
export * from './format/command-object';
|
6
|
+
export * from './generate/command-object';
|
7
|
+
export * from './graph/command-object';
|
8
|
+
export * from './import/command-object';
|
9
|
+
export * from './init/command-object';
|
10
|
+
export * from './list/command-object';
|
11
|
+
export * from './migrate/command-object';
|
12
|
+
export * from './new/command-object';
|
13
|
+
export * from './register/command-object';
|
14
|
+
export * from './release/command-object';
|
15
|
+
export * from './repair/command-object';
|
16
|
+
export * from './report/command-object';
|
17
|
+
export * from './reset/command-object';
|
18
|
+
export * from './run-many/command-object';
|
19
|
+
export * from './run/command-object';
|
20
|
+
export * from './show/command-object';
|
21
|
+
export * from './sync/command-object';
|
22
|
+
export * from './watch/command-object';
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/command-line/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
// CLI Commands Export File for Documentation
|
5
|
+
tslib_1.__exportStar(require("./add/command-object"), exports);
|
6
|
+
tslib_1.__exportStar(require("./affected/command-object"), exports);
|
7
|
+
tslib_1.__exportStar(require("./daemon/command-object"), exports);
|
8
|
+
tslib_1.__exportStar(require("./exec/command-object"), exports);
|
9
|
+
tslib_1.__exportStar(require("./format/command-object"), exports);
|
10
|
+
tslib_1.__exportStar(require("./generate/command-object"), exports);
|
11
|
+
tslib_1.__exportStar(require("./graph/command-object"), exports);
|
12
|
+
tslib_1.__exportStar(require("./import/command-object"), exports);
|
13
|
+
tslib_1.__exportStar(require("./init/command-object"), exports);
|
14
|
+
tslib_1.__exportStar(require("./list/command-object"), exports);
|
15
|
+
tslib_1.__exportStar(require("./migrate/command-object"), exports);
|
16
|
+
tslib_1.__exportStar(require("./new/command-object"), exports);
|
17
|
+
tslib_1.__exportStar(require("./register/command-object"), exports);
|
18
|
+
tslib_1.__exportStar(require("./release/command-object"), exports);
|
19
|
+
tslib_1.__exportStar(require("./repair/command-object"), exports);
|
20
|
+
tslib_1.__exportStar(require("./report/command-object"), exports);
|
21
|
+
tslib_1.__exportStar(require("./reset/command-object"), exports);
|
22
|
+
tslib_1.__exportStar(require("./run-many/command-object"), exports);
|
23
|
+
tslib_1.__exportStar(require("./run/command-object"), exports);
|
24
|
+
tslib_1.__exportStar(require("./show/command-object"), exports);
|
25
|
+
tslib_1.__exportStar(require("./sync/command-object"), exports);
|
26
|
+
tslib_1.__exportStar(require("./watch/command-object"), exports);
|
@@ -2,6 +2,6 @@ import { InitArgs } from '../init-v1';
|
|
2
2
|
type Options = Pick<InitArgs, 'nxCloud' | 'interactive' | 'cacheable'> & {
|
3
3
|
legacy?: boolean;
|
4
4
|
};
|
5
|
-
export declare function addNxToMonorepo(options: Options): Promise<void>;
|
5
|
+
export declare function addNxToMonorepo(options: Options, guided?: boolean): Promise<void>;
|
6
6
|
export {};
|
7
7
|
//# sourceMappingURL=add-nx-to-monorepo.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"add-nx-to-monorepo.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/init/implementation/add-nx-to-monorepo.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAYtC,KAAK,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC,GAAG;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAsB,eAAe,
|
1
|
+
{"version":3,"file":"add-nx-to-monorepo.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/init/implementation/add-nx-to-monorepo.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAYtC,KAAK,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC,GAAG;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAsB,eAAe,CACnC,OAAO,EAAE,OAAO,EAChB,MAAM,GAAE,OAAc,iBA6FvB"}
|
@@ -9,7 +9,7 @@ const fileutils_1 = require("../../../utils/fileutils");
|
|
9
9
|
const output_1 = require("../../../utils/output");
|
10
10
|
const utils_1 = require("./utils");
|
11
11
|
const connect_to_nx_cloud_1 = require("../../nx-cloud/connect/connect-to-nx-cloud");
|
12
|
-
async function addNxToMonorepo(options) {
|
12
|
+
async function addNxToMonorepo(options, guided = true) {
|
13
13
|
const repoRoot = process.cwd();
|
14
14
|
output_1.output.log({ title: '🐳 Nx initialization' });
|
15
15
|
const packageJsonFiles = allProjectPackageJsonFiles(repoRoot);
|
@@ -18,7 +18,7 @@ async function addNxToMonorepo(options) {
|
|
18
18
|
let cacheableOperations;
|
19
19
|
let scriptOutputs = {};
|
20
20
|
let useNxCloud;
|
21
|
-
if (options.interactive && scripts.length > 0) {
|
21
|
+
if (options.interactive && scripts.length > 0 && guided) {
|
22
22
|
output_1.output.log({
|
23
23
|
title: '🧑🔧 Please answer the following questions about the scripts found in your workspace in order to generate task runner configuration',
|
24
24
|
});
|
@@ -2,6 +2,6 @@ import { InitArgs } from '../init-v1';
|
|
2
2
|
type Options = Pick<InitArgs, 'nxCloud' | 'interactive' | 'cacheable'> & {
|
3
3
|
legacy?: boolean;
|
4
4
|
};
|
5
|
-
export declare function addNxToNpmRepo(options: Options): Promise<void>;
|
5
|
+
export declare function addNxToNpmRepo(options: Options, guided?: boolean): Promise<void>;
|
6
6
|
export {};
|
7
7
|
//# sourceMappingURL=add-nx-to-npm-repo.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"add-nx-to-npm-repo.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/init/implementation/add-nx-to-npm-repo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAetC,KAAK,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC,GAAG;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,
|
1
|
+
{"version":3,"file":"add-nx-to-npm-repo.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/init/implementation/add-nx-to-npm-repo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAetC,KAAK,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC,GAAG;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,OAAc,iBAgF5E"}
|
@@ -8,7 +8,7 @@ const output_1 = require("../../../utils/output");
|
|
8
8
|
const package_manager_1 = require("../../../utils/package-manager");
|
9
9
|
const utils_1 = require("./utils");
|
10
10
|
const connect_to_nx_cloud_1 = require("../../nx-cloud/connect/connect-to-nx-cloud");
|
11
|
-
async function addNxToNpmRepo(options) {
|
11
|
+
async function addNxToNpmRepo(options, guided = true) {
|
12
12
|
const repoRoot = process.cwd();
|
13
13
|
output_1.output.log({ title: '🐳 Nx initialization' });
|
14
14
|
let cacheableOperations;
|
@@ -16,7 +16,7 @@ async function addNxToNpmRepo(options) {
|
|
16
16
|
let useNxCloud;
|
17
17
|
const packageJson = (0, fileutils_1.readJsonFile)('package.json');
|
18
18
|
const scripts = Object.keys(packageJson.scripts ?? {}).filter((s) => !s.startsWith('pre') && !s.startsWith('post'));
|
19
|
-
if (options.interactive && scripts.length > 0) {
|
19
|
+
if (options.interactive && scripts.length > 0 && guided) {
|
20
20
|
output_1.output.log({
|
21
21
|
title: '🧑🔧 Please answer the following questions about the scripts found in your package.json in order to generate task runner configuration',
|
22
22
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/init/implementation/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAQ9D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAEL,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;AAUxC,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,MAAM,EAAE,EAC5B,mBAAmB,EAAE,MAAM,EAAE,EAC7B,aAAa,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,QA0C1C;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC7B,mBAAmB,CA+GrB;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,kBAAkB,CAAC,EAAE,MAAM,EAAE,QAY9B;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,QAqC3C;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,sBAAmD,QAOzD;AAED,wBAAsB,SAAS,CAC7B,kBAAkB,EACd,SAAS,GACT,iBAAiB,GACjB,aAAa,GACb,kBAAkB,GAClB,cAAc,GACd,kBAAkB,GAClB,mBAAmB,iBAMxB;AAED,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAAE,GACnB,IAAI,CAiBN;AAED,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EAAE,EAC1B,GAAG,EAAE,sBAAsB,QAqB5B;AAED,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,QAQjE;AAED,wBAAgB,iBAAiB,CAAC,EAChC,aAAa,EACb,WAAW,GACZ,EAAE;IACD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,GAAG,IAAI,
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/init/implementation/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAQ9D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAEL,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;AAUxC,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,MAAM,EAAE,EAC5B,mBAAmB,EAAE,MAAM,EAAE,EAC7B,aAAa,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,QA0C1C;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC7B,mBAAmB,CA+GrB;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,kBAAkB,CAAC,EAAE,MAAM,EAAE,QAY9B;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,QAqC3C;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,sBAAmD,QAOzD;AAED,wBAAsB,SAAS,CAC7B,kBAAkB,EACd,SAAS,GACT,iBAAiB,GACjB,aAAa,GACb,kBAAkB,GAClB,cAAc,GACd,kBAAkB,GAClB,mBAAmB,iBAMxB;AAED,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAAE,GACnB,IAAI,CAiBN;AAED,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EAAE,EAC1B,GAAG,EAAE,sBAAsB,QAqB5B;AAED,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,QAQjE;AAED,wBAAgB,iBAAiB,CAAC,EAChC,aAAa,EACb,WAAW,GACZ,EAAE;IACD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,GAAG,IAAI,CAUP;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,WASlD;AAED,wBAAgB,KAAK,CAAC,WAAW,EAAE,WAAW,WAa7C"}
|
@@ -24,7 +24,6 @@ const connect_to_nx_cloud_1 = require("../../../nx-cloud/generators/connect-to-n
|
|
24
24
|
const url_shorten_1 = require("../../../nx-cloud/utilities/url-shorten");
|
25
25
|
const connect_to_nx_cloud_2 = require("../../nx-cloud/connect/connect-to-nx-cloud");
|
26
26
|
const deduce_default_base_1 = require("./deduce-default-base");
|
27
|
-
const child_process_2 = require("../../../utils/child-process");
|
28
27
|
function createNxJsonFile(repoRoot, topologicalTargets, cacheableOperations, scriptOutputs) {
|
29
28
|
const nxJsonPath = (0, path_2.joinPathFragments)(repoRoot, 'nx.json');
|
30
29
|
let nxJson = {};
|
@@ -263,13 +262,10 @@ function markPackageJsonAsNxProject(packageJsonPath) {
|
|
263
262
|
(0, fileutils_1.writeJsonFile)(packageJsonPath, json);
|
264
263
|
}
|
265
264
|
function printFinalMessage({ learnMoreLink, appendLines, }) {
|
266
|
-
const pmc = (0, package_manager_1.getPackageManagerCommand)();
|
267
265
|
output_1.output.success({
|
268
266
|
title: '🎉 Done!',
|
269
267
|
bodyLines: [
|
270
|
-
`-
|
271
|
-
`- Run "${(0, child_process_2.getRunNxBaseCommand)(pmc)} graph" to see the graph of projects and tasks in your workspace. https://nx.dev/core-features/explore-graph`,
|
272
|
-
learnMoreLink ? `- Learn more at ${learnMoreLink}.` : undefined,
|
268
|
+
`- Learn more about what to do next at ${learnMoreLink ?? 'https://nx.dev/getting-started/adding-to-existing'}`,
|
273
269
|
...(appendLines ?? []),
|
274
270
|
].filter(Boolean),
|
275
271
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init-v2.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/init/init-v2.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,sBAAsB,CAAC;
|
1
|
+
{"version":3,"file":"init-v2.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/init/init-v2.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,sBAAsB,CAAC;AA4BvE,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAiJlE;AA2BD,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,OAAO,EACpB,iBAAiB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC;IACT,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC,CAgID"}
|
@@ -34,7 +34,7 @@ async function initHandler(options) {
|
|
34
34
|
integrated: !!options.integrated,
|
35
35
|
});
|
36
36
|
(0, utils_1.printFinalMessage)({
|
37
|
-
learnMoreLink: 'https://nx.dev/
|
37
|
+
learnMoreLink: 'https://nx.dev/technologies/angular/migration/angular',
|
38
38
|
});
|
39
39
|
return;
|
40
40
|
}
|
@@ -45,6 +45,18 @@ async function initHandler(options) {
|
|
45
45
|
const _isTurborepo = (0, fs_1.existsSync)('turbo.json');
|
46
46
|
const _isMonorepo = _isNonJs ? false : (0, utils_1.isMonorepo)(packageJson);
|
47
47
|
const _isCRA = _isNonJs ? false : (0, utils_1.isCRA)(packageJson);
|
48
|
+
let guided = true;
|
49
|
+
if (options.interactive && !(_isTurborepo || _isCRA || _isNonJs)) {
|
50
|
+
const setupType = await (0, enquirer_1.prompt)([
|
51
|
+
{
|
52
|
+
type: 'select',
|
53
|
+
name: 'setupPreference',
|
54
|
+
message: 'Would you like a minimum or guided setup?',
|
55
|
+
choices: [{ name: 'Minimum' }, { name: 'Guided' }],
|
56
|
+
},
|
57
|
+
]).then((r) => r.setupPreference);
|
58
|
+
guided = setupType === 'Guided';
|
59
|
+
}
|
48
60
|
/**
|
49
61
|
* Turborepo users must have set up individual scripts already, and we keep the transition as minimal as possible.
|
50
62
|
* We log a message during the conversion process in addNxToTurborepo about how they can learn more about the power
|
@@ -75,7 +87,7 @@ async function initHandler(options) {
|
|
75
87
|
await (0, add_nx_to_monorepo_1.addNxToMonorepo)({
|
76
88
|
interactive: options.interactive,
|
77
89
|
nxCloud: false,
|
78
|
-
});
|
90
|
+
}, guided);
|
79
91
|
}
|
80
92
|
else if (_isNonJs) {
|
81
93
|
(0, add_nx_scripts_1.generateDotNxSetup)(version);
|
@@ -85,41 +97,47 @@ async function initHandler(options) {
|
|
85
97
|
await (0, add_nx_to_npm_repo_1.addNxToNpmRepo)({
|
86
98
|
interactive: options.interactive,
|
87
99
|
nxCloud: false,
|
88
|
-
});
|
100
|
+
}, guided);
|
89
101
|
}
|
90
|
-
const useNxCloud = options.nxCloud ??
|
91
|
-
(options.interactive ? await (0, connect_to_nx_cloud_1.connectExistingRepoToNxCloudPrompt)() : false);
|
92
102
|
const repoRoot = process.cwd();
|
93
103
|
(0, utils_1.createNxJsonFile)(repoRoot, [], [], {});
|
94
104
|
(0, utils_1.updateGitIgnore)(repoRoot);
|
95
105
|
const nxJson = (0, nx_json_1.readNxJson)(repoRoot);
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
106
|
+
if (guided) {
|
107
|
+
output_1.output.log({ title: '🧐 Checking dependencies' });
|
108
|
+
let plugins;
|
109
|
+
let updatePackageScripts;
|
110
|
+
if (_isCRA) {
|
111
|
+
plugins = ['@nx/vite'];
|
112
|
+
updatePackageScripts = true;
|
113
|
+
}
|
114
|
+
else {
|
115
|
+
const { plugins: _plugins, updatePackageScripts: _updatePackageScripts } = await detectPlugins(nxJson, options.interactive);
|
116
|
+
plugins = _plugins;
|
117
|
+
updatePackageScripts = _updatePackageScripts;
|
118
|
+
}
|
119
|
+
output_1.output.log({ title: '📦 Installing Nx' });
|
120
|
+
(0, configure_plugins_1.installPluginPackages)(repoRoot, pmc, plugins);
|
121
|
+
await (0, configure_plugins_1.configurePlugins)(plugins, updatePackageScripts, pmc, repoRoot, options.verbose);
|
102
122
|
}
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
123
|
+
let useNxCloud = options.nxCloud;
|
124
|
+
if (useNxCloud === undefined) {
|
125
|
+
output_1.output.log({ title: '🛠️ Setting up Self-Healing CI and Remote Caching' });
|
126
|
+
useNxCloud = options.interactive
|
127
|
+
? await (0, connect_to_nx_cloud_1.connectExistingRepoToNxCloudPrompt)()
|
128
|
+
: false;
|
107
129
|
}
|
108
|
-
output_1.output.log({ title: '📦 Installing Nx' });
|
109
|
-
(0, configure_plugins_1.installPluginPackages)(repoRoot, pmc, plugins);
|
110
|
-
await (0, configure_plugins_1.configurePlugins)(plugins, updatePackageScripts, pmc, repoRoot, options.verbose);
|
111
130
|
if (useNxCloud) {
|
112
|
-
output_1.output.log({ title: '🛠️ Setting up Nx Cloud' });
|
113
131
|
await (0, utils_1.initCloud)('nx-init');
|
114
132
|
}
|
115
133
|
(0, utils_1.printFinalMessage)({
|
134
|
+
learnMoreLink: 'https://nx.dev/getting-started/adding-to-existing',
|
116
135
|
appendLines: _isMonorepo
|
117
136
|
? [
|
118
|
-
`-
|
137
|
+
`- Read a detailed guide about adding Nx to NPM/YARN/PNPM workspaces: https://nx.dev/recipes/adopting-nx/adding-to-monorepos`,
|
138
|
+
`- Learn how Nx helps manage your TypeScript monorepo: https://nx.dev/features/maintain-ts-monorepos`,
|
119
139
|
]
|
120
|
-
: [
|
121
|
-
`- Learn how Nx works with any type of project at https://nx.dev/recipes/adopting-nx/adding-to-existing-project.`,
|
122
|
-
],
|
140
|
+
: [],
|
123
141
|
});
|
124
142
|
}
|
125
143
|
const npmPackageToPluginMap = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/nx-cloud/connect/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAE,MAAM,OAAO,CAAC;AAK5C,eAAO,MAAM,mBAAmB,EAAE,
|
1
|
+
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/nx-cloud/connect/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAE,MAAM,OAAO,CAAC;AAK5C,eAAO,MAAM,mBAAmB,EAAE,aAoBjC,CAAC;AAUF,eAAO,MAAM,oBAAoB,EAAE,aAMlC,CAAC"}
|
@@ -10,7 +10,8 @@ exports.yargsConnectCommand = {
|
|
10
10
|
describe: `Connect workspace to Nx Cloud.`,
|
11
11
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withConnectOptions(yargs), 'connect-to-nx-cloud'),
|
12
12
|
handler: async (args) => {
|
13
|
-
|
13
|
+
const checkRemote = process.env.NX_SKIP_CHECK_REMOTE !== 'true';
|
14
|
+
await (await Promise.resolve().then(() => require('./connect-to-nx-cloud'))).connectToNxCloudCommand({ ...args, checkRemote });
|
14
15
|
await (await Promise.resolve().then(() => require('../../../utils/ab-testing'))).recordStat({
|
15
16
|
command: 'connect',
|
16
17
|
nxVersion: versions_1.nxVersion,
|
@@ -7,6 +7,7 @@ export declare function connectToNxCloudIfExplicitlyAsked(opts: NxArgs): Promise
|
|
7
7
|
export declare function connectWorkspaceToCloud(options: ConnectToNxCloudOptions, directory?: string): Promise<string>;
|
8
8
|
export declare function connectToNxCloudCommand(options: {
|
9
9
|
generateToken?: boolean;
|
10
|
+
checkRemote?: boolean;
|
10
11
|
}, command?: string): Promise<boolean>;
|
11
12
|
export declare function connectExistingRepoToNxCloudPrompt(command?: string, key?: MessageKey): Promise<boolean>;
|
12
13
|
export declare function connectToNxCloudWithPrompt(command: string): Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"connect-to-nx-cloud.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/nx-cloud/connect/connect-to-nx-cloud.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,uBAAuB,EACxB,MAAM,sEAAsE,CAAC;AAI9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,UAAU,EAIX,MAAM,2BAA2B,CAAC;
|
1
|
+
{"version":3,"file":"connect-to-nx-cloud.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/nx-cloud/connect/connect-to-nx-cloud.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,uBAAuB,EACxB,MAAM,sEAAsE,CAAC;AAI9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,UAAU,EAIX,MAAM,2BAA2B,CAAC;AAQnC,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,mBAAmB,WAclE;AAED,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,uBAAuB,EAChC,SAAS,SAAgB,mBAO1B;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,EAC3D,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CA2ElB;AAMD,wBAAsB,kCAAkC,CACtD,OAAO,SAAS,EAChB,GAAG,GAAE,UAA2B,GAC/B,OAAO,CAAC,OAAO,CAAC,CAWlB;AAED,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,MAAM,iBAY/D"}
|
@@ -17,6 +17,7 @@ const ab_testing_1 = require("../../../utils/ab-testing");
|
|
17
17
|
const versions_1 = require("../../../utils/versions");
|
18
18
|
const workspace_root_1 = require("../../../utils/workspace-root");
|
19
19
|
const chalk = require("chalk");
|
20
|
+
const git_utils_1 = require("../../../utils/git-utils");
|
20
21
|
const ora = require('ora');
|
21
22
|
const open = require('open');
|
22
23
|
function onlyDefaultRunnerIsUsed(nxJson) {
|
@@ -59,6 +60,17 @@ async function connectToNxCloudCommand(options, command) {
|
|
59
60
|
const installationSource = process.env.NX_CONSOLE
|
60
61
|
? 'nx-console'
|
61
62
|
: 'nx-connect';
|
63
|
+
const hasRemote = !!(0, git_utils_1.getGitRemote)();
|
64
|
+
if (!hasRemote && options.checkRemote) {
|
65
|
+
output_1.output.error({
|
66
|
+
title: 'Missing VCS provider',
|
67
|
+
bodyLines: [
|
68
|
+
'Push this repository to a VCS provider (e.g., GitHub) and try again.',
|
69
|
+
'Go to https://github.com/new to create a repository on GitHub.',
|
70
|
+
],
|
71
|
+
});
|
72
|
+
return false;
|
73
|
+
}
|
62
74
|
if ((0, nx_cloud_utils_1.isNxCloudUsed)(nxJson)) {
|
63
75
|
const token = process.env.NX_CLOUD_ACCESS_TOKEN ||
|
64
76
|
nxJson.nxCloudAccessToken ||
|
@@ -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,EAUV,MAAM,aAAa,CAAC;AAQrB,OAAO,EACL,cAAc,
|
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,EAUV,MAAM,aAAa,CAAC;AAQrB,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,CAqrBrC"}
|
@@ -827,11 +827,15 @@ async function generateChangelogForProjects({ tree, args, changes, projectsVersi
|
|
827
827
|
* no changelog entry is relevant in that case.
|
828
828
|
*/
|
829
829
|
if (!projectsVersionData[project.name] ||
|
830
|
-
projectsVersionData[project.name].newVersion === null
|
830
|
+
(projectsVersionData[project.name].newVersion === null &&
|
831
|
+
!projectsVersionData[project.name].dockerVersion)) {
|
831
832
|
continue;
|
832
833
|
}
|
834
|
+
const preferDockerVersion = (0, shared_1.shouldPreferDockerVersionForReleaseGroup)(releaseGroup);
|
833
835
|
const releaseVersion = new shared_1.ReleaseVersion({
|
834
|
-
version: projectsVersionData[project.name].
|
836
|
+
version: preferDockerVersion && projectsVersionData[project.name].dockerVersion
|
837
|
+
? projectsVersionData[project.name].dockerVersion
|
838
|
+
: projectsVersionData[project.name].newVersion,
|
835
839
|
releaseTagPattern: releaseGroup.releaseTagPattern,
|
836
840
|
projectName: project.name,
|
837
841
|
});
|
@@ -33,6 +33,7 @@ export type VersionOptions = NxReleaseArgs & GitOptions & VersionPlanArgs & Firs
|
|
33
33
|
*/
|
34
34
|
generatorOptionsOverrides?: Record<string, unknown>;
|
35
35
|
versionActionsOptionsOverrides?: Record<string, unknown>;
|
36
|
+
dockerVersionScheme?: string;
|
36
37
|
};
|
37
38
|
export type ChangelogOptions = NxReleaseArgs & GitOptions & VersionPlanArgs & FirstReleaseArgs & {
|
38
39
|
version?: string | null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAY,MAAM,OAAO,CAAC;AAEtD,OAAO,EACL,WAAW,EACX,cAAc,EAQf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,UAAU;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,cAAc,GAAG,aAAa,GACxC,UAAU,GACV,eAAe,GACf,gBAAgB,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpD,8BAA8B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/release/command-object.ts"],"names":[],"mappings":"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"}
|