nx 22.6.0 → 22.6.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/bin/nx.js +19 -11
- package/package.json +11 -12
- package/release/changelog-renderer/index.d.ts +2 -1
- package/release/changelog-renderer/index.d.ts.map +1 -1
- package/schemas/nx-schema.json +102 -0
- package/src/adapter/ngcli-adapter.d.ts +8 -5
- package/src/adapter/ngcli-adapter.d.ts.map +1 -1
- package/src/adapter/ngcli-adapter.js +33 -19
- package/src/ai/clone-ai-config-repo.d.ts.map +1 -1
- package/src/ai/clone-ai-config-repo.js +2 -0
- package/src/command-line/add/add.js +1 -1
- package/src/command-line/examples.d.ts +7 -0
- package/src/command-line/examples.d.ts.map +1 -1
- package/src/command-line/examples.js +29 -1
- package/src/command-line/exec/exec.js +3 -3
- package/src/command-line/format/format.js +3 -3
- package/src/command-line/generate/generate.d.ts.map +1 -1
- package/src/command-line/generate/generate.js +1 -1
- package/src/command-line/graph/graph.js +1 -1
- package/src/command-line/init/command-object.js +1 -21
- package/src/command-line/init/configure-plugins.js +1 -1
- package/src/command-line/init/implementation/angular/integrated-workspace.js +1 -1
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +2 -2
- package/src/command-line/init/implementation/deduce-default-base.js +5 -5
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +2 -2
- package/src/command-line/init/implementation/dot-nx/nxw.js +1 -1
- package/src/command-line/init/implementation/utils.d.ts +1 -2
- package/src/command-line/init/implementation/utils.d.ts.map +1 -1
- package/src/command-line/init/implementation/utils.js +1 -15
- package/src/command-line/init/init-v1.d.ts +0 -3
- package/src/command-line/init/init-v1.d.ts.map +1 -1
- package/src/command-line/init/init-v1.js +1 -27
- package/src/command-line/init/init-v2.d.ts +0 -1
- package/src/command-line/init/init-v2.d.ts.map +1 -1
- package/src/command-line/init/init-v2.js +7 -35
- package/src/command-line/mcp/mcp.d.ts.map +1 -1
- package/src/command-line/mcp/mcp.js +2 -0
- package/src/command-line/migrate/migrate-ui-api.d.ts.map +1 -1
- package/src/command-line/migrate/migrate-ui-api.js +13 -0
- package/src/command-line/migrate/migrate.d.ts.map +1 -1
- package/src/command-line/migrate/migrate.js +41 -23
- package/src/command-line/migrate/run-migration-process.js +2 -0
- package/src/command-line/nx-cloud/connect/view-logs.js +1 -1
- package/src/command-line/nx-commands.js +65 -65
- package/src/command-line/release/config/version-plans.js +1 -1
- package/src/command-line/release/utils/exec-command.js +1 -1
- package/src/command-line/release/utils/launch-editor.js +2 -2
- package/src/command-line/release/utils/remote-release-clients/github.d.ts +1 -0
- package/src/command-line/release/utils/remote-release-clients/github.d.ts.map +1 -1
- package/src/command-line/release/utils/remote-release-clients/github.js +39 -2
- package/src/command-line/release/utils/remote-release-clients/gitlab.d.ts.map +1 -1
- package/src/command-line/release/utils/remote-release-clients/gitlab.js +1 -0
- package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
- package/src/command-line/release/version/release-group-processor.js +2 -4
- package/src/command-line/release/version.js +1 -1
- package/src/command-line/run/run-one.d.ts.map +1 -1
- package/src/command-line/run/run-one.js +1 -1
- package/src/command-line/run/run.d.ts.map +1 -1
- package/src/command-line/run/run.js +2 -2
- package/src/command-line/show/target.js +5 -2
- package/src/command-line/watch/watch.js +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/daemon/client/client.d.ts +2 -2
- package/src/daemon/client/client.d.ts.map +1 -1
- package/src/daemon/client/client.js +3 -2
- package/src/daemon/client/generate-help-output.js +1 -1
- package/src/daemon/server/handle-configure-ai-agents.js +11 -4
- package/src/daemon/server/handle-hash-tasks.d.ts +1 -0
- package/src/daemon/server/handle-hash-tasks.d.ts.map +1 -1
- package/src/daemon/server/handle-hash-tasks.js +1 -1
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts +1 -1
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts.map +1 -1
- package/src/daemon/server/project-graph-listener-sockets.d.ts +1 -1
- package/src/daemon/server/project-graph-listener-sockets.d.ts.map +1 -1
- package/src/daemon/server/shutdown-utils.js +1 -1
- package/src/devkit-internals.d.ts +3 -2
- package/src/devkit-internals.d.ts.map +1 -1
- package/src/devkit-internals.js +5 -4
- package/src/executors/run-commands/run-commands.impl.d.ts.map +1 -1
- package/src/executors/run-commands/run-commands.impl.js +60 -7
- package/src/executors/run-commands/running-tasks.d.ts.map +1 -1
- package/src/executors/run-commands/running-tasks.js +1 -5
- package/src/executors/run-script/run-script.impl.js +1 -1
- package/src/executors/utils/convert-nx-executor.js +2 -2
- package/src/generators/utils/project-configuration.js +4 -4
- package/src/hasher/hash-plan-inspector.d.ts.map +1 -1
- package/src/hasher/hash-plan-inspector.js +1 -1
- package/src/hasher/native-task-hasher-impl.d.ts +2 -2
- package/src/hasher/native-task-hasher-impl.d.ts.map +1 -1
- package/src/hasher/native-task-hasher-impl.js +6 -6
- package/src/hasher/task-hasher.d.ts +4 -4
- package/src/hasher/task-hasher.d.ts.map +1 -1
- package/src/hasher/task-hasher.js +9 -6
- package/src/native/index.d.ts +1 -1
- package/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- 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/plugins/js/lock-file/bun-parser.js +1 -1
- package/src/plugins/js/lock-file/lock-file.d.ts.map +1 -1
- package/src/plugins/js/lock-file/lock-file.js +3 -1
- package/src/project-graph/build-project-graph.d.ts +1 -1
- package/src/project-graph/build-project-graph.d.ts.map +1 -1
- package/src/project-graph/build-project-graph.js +2 -2
- package/src/project-graph/error-types.d.ts +2 -1
- package/src/project-graph/error-types.d.ts.map +1 -1
- package/src/project-graph/file-utils.d.ts.map +1 -1
- package/src/project-graph/file-utils.js +4 -2
- package/src/project-graph/nx-deps-cache.d.ts +1 -1
- package/src/project-graph/nx-deps-cache.d.ts.map +1 -1
- package/src/project-graph/plugins/isolation/isolated-plugin.js +5 -5
- package/src/project-graph/project-graph.d.ts +2 -2
- package/src/project-graph/utils/project-configuration/name-substitution-manager.d.ts +23 -18
- package/src/project-graph/utils/project-configuration/name-substitution-manager.d.ts.map +1 -1
- package/src/project-graph/utils/project-configuration/name-substitution-manager.js +129 -87
- package/src/project-graph/utils/project-configuration/project-nodes-manager.d.ts +40 -0
- package/src/project-graph/utils/project-configuration/project-nodes-manager.d.ts.map +1 -0
- package/src/project-graph/utils/project-configuration/project-nodes-manager.js +264 -0
- package/src/project-graph/utils/project-configuration/target-merging.d.ts +32 -0
- package/src/project-graph/utils/project-configuration/target-merging.d.ts.map +1 -0
- package/src/project-graph/utils/project-configuration/target-merging.js +332 -0
- package/src/project-graph/utils/project-configuration/target-normalization.d.ts +13 -0
- package/src/project-graph/utils/project-configuration/target-normalization.d.ts.map +1 -0
- package/src/project-graph/utils/project-configuration/target-normalization.js +177 -0
- package/src/project-graph/utils/project-configuration-utils.d.ts +16 -41
- package/src/project-graph/utils/project-configuration-utils.d.ts.map +1 -1
- package/src/project-graph/utils/project-configuration-utils.js +56 -734
- package/src/tasks-runner/cache.js +1 -1
- package/src/tasks-runner/default-tasks-runner.js +1 -1
- package/src/tasks-runner/life-cycle.d.ts +4 -0
- package/src/tasks-runner/life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +4 -0
- package/src/tasks-runner/task-orchestrator.d.ts +12 -4
- package/src/tasks-runner/task-orchestrator.d.ts.map +1 -1
- package/src/tasks-runner/task-orchestrator.js +123 -68
- package/src/tasks-runner/tasks-schedule.d.ts +1 -1
- package/src/tasks-runner/tasks-schedule.d.ts.map +1 -1
- package/src/tasks-runner/tasks-schedule.js +14 -3
- package/src/tasks-runner/utils.d.ts +2 -2
- package/src/tasks-runner/utils.d.ts.map +1 -1
- package/src/tasks-runner/utils.js +5 -7
- package/src/utils/ab-testing.js +1 -1
- package/src/utils/analytics-prompt.d.ts.map +1 -1
- package/src/utils/analytics-prompt.js +2 -0
- package/src/utils/child-process.d.ts.map +1 -1
- package/src/utils/child-process.js +1 -2
- package/src/utils/command-line-utils.js +3 -3
- package/src/utils/default-base.js +1 -1
- package/src/utils/git-utils.d.ts.map +1 -1
- package/src/utils/git-utils.index-filter.js +2 -2
- package/src/utils/git-utils.js +6 -5
- package/src/utils/git-utils.tree-filter.js +1 -1
- package/src/utils/machine-id-cache.d.ts.map +1 -1
- package/src/utils/machine-id-cache.js +72 -2
- package/src/utils/package-json.js +2 -2
- package/src/utils/package-manager.d.ts.map +1 -1
- package/src/utils/package-manager.js +8 -13
- package/src/utils/provenance.d.ts.map +1 -1
- package/src/utils/provenance.js +2 -2
- package/src/utils/require-nx-key.js +1 -1
- package/src/utils/serialize-overrides-into-command-line.d.ts.map +1 -1
- package/src/utils/serialize-overrides-into-command-line.js +3 -4
- package/src/utils/shell-quoting.d.ts +11 -0
- package/src/utils/shell-quoting.d.ts.map +1 -0
- package/src/utils/shell-quoting.js +41 -0
- package/src/utils/split-target.d.ts +13 -2
- package/src/utils/split-target.d.ts.map +1 -1
- package/src/utils/split-target.js +180 -31
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.d.ts +0 -2
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.js +0 -21
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.d.ts +0 -2
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +0 -20
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.d.ts +0 -2
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.js +0 -17
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.d.ts +0 -2
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +0 -20
- package/src/command-line/init/implementation/react/clean-up-files.d.ts +0 -2
- package/src/command-line/init/implementation/react/clean-up-files.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/clean-up-files.js +0 -30
- package/src/command-line/init/implementation/react/index.d.ts +0 -5
- package/src/command-line/init/implementation/react/index.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/index.js +0 -77
- package/src/command-line/init/implementation/react/read-name-from-package-json.d.ts +0 -2
- package/src/command-line/init/implementation/react/read-name-from-package-json.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/read-name-from-package-json.js +0 -16
- package/src/command-line/init/implementation/react/rename-js-to-jsx.d.ts +0 -2
- package/src/command-line/init/implementation/react/rename-js-to-jsx.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/rename-js-to-jsx.js +0 -22
- package/src/command-line/init/implementation/react/tsconfig-setup.d.ts +0 -2
- package/src/command-line/init/implementation/react/tsconfig-setup.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/tsconfig-setup.js +0 -108
- package/src/command-line/init/implementation/react/write-vite-config.d.ts +0 -2
- package/src/command-line/init/implementation/react/write-vite-config.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/write-vite-config.js +0 -53
- package/src/command-line/init/implementation/react/write-vite-index-html.d.ts +0 -2
- package/src/command-line/init/implementation/react/write-vite-index-html.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/write-vite-index-html.js +0 -24
package/bin/nx.js
CHANGED
|
@@ -50,9 +50,6 @@ async function main() {
|
|
|
50
50
|
require('nx/src/command-line/nx-commands').commandsObject.argv;
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
if (!client_1.daemonClient.enabled() && workspace !== null) {
|
|
54
|
-
(0, workspace_context_1.setupWorkspaceContext)(workspace.dir);
|
|
55
|
-
}
|
|
56
53
|
// polyfill rxjs observable to avoid issues with multiple version of Observable installed in node_modules
|
|
57
54
|
// https://twitter.com/BenLesh/status/1192478226385428483?s=20
|
|
58
55
|
if (!Symbol.observable)
|
|
@@ -76,23 +73,27 @@ async function main() {
|
|
|
76
73
|
if (!localNx && !isNxCloudCommand(process.argv[2])) {
|
|
77
74
|
handleMissingLocalInstallation(workspace ? workspace.dir : null);
|
|
78
75
|
}
|
|
79
|
-
// Prompt for analytics preference if not set
|
|
80
|
-
try {
|
|
81
|
-
await (0, analytics_prompt_1.ensureAnalyticsPreferenceSet)();
|
|
82
|
-
}
|
|
83
|
-
catch { }
|
|
84
|
-
await (0, analytics_1.startAnalytics)();
|
|
85
76
|
// this file is already in the local workspace
|
|
86
77
|
if (isNxCloudCommand(process.argv[2])) {
|
|
78
|
+
if (!client_1.daemonClient.enabled() && workspace !== null) {
|
|
79
|
+
(0, workspace_context_1.setupWorkspaceContext)(workspace.dir);
|
|
80
|
+
}
|
|
81
|
+
await initAnalytics();
|
|
87
82
|
// nx-cloud commands can run without local Nx installation
|
|
88
83
|
process.env.NX_DAEMON = 'false';
|
|
89
84
|
require('nx/src/command-line/nx-commands').commandsObject.argv;
|
|
90
85
|
}
|
|
91
86
|
else if (isLocalInstall) {
|
|
87
|
+
if (!client_1.daemonClient.enabled() && workspace !== null) {
|
|
88
|
+
(0, workspace_context_1.setupWorkspaceContext)(workspace.dir);
|
|
89
|
+
}
|
|
90
|
+
await initAnalytics();
|
|
92
91
|
await (0, init_local_1.initLocal)(workspace);
|
|
93
92
|
}
|
|
94
93
|
else if (localNx) {
|
|
95
94
|
// Nx is being run from globally installed CLI - hand off to the local
|
|
95
|
+
// Don't start analytics, connect to the DB, or set up the workspace
|
|
96
|
+
// context here — the local Nx will handle it when it runs its own bin/nx.ts
|
|
96
97
|
warnIfUsingOutdatedGlobalInstall(GLOBAL_NX_VERSION, LOCAL_NX_VERSION);
|
|
97
98
|
if (localNx.includes('.nx')) {
|
|
98
99
|
const nxWrapperPath = localNx.replace(/\.nx.*/, '.nx/') + 'nxw.js';
|
|
@@ -169,6 +170,13 @@ function isNxCloudCommand(command) {
|
|
|
169
170
|
];
|
|
170
171
|
return nxCloudCommands.includes(command);
|
|
171
172
|
}
|
|
173
|
+
async function initAnalytics() {
|
|
174
|
+
try {
|
|
175
|
+
await (0, analytics_prompt_1.ensureAnalyticsPreferenceSet)();
|
|
176
|
+
}
|
|
177
|
+
catch { }
|
|
178
|
+
await (0, analytics_1.startAnalytics)();
|
|
179
|
+
}
|
|
172
180
|
function handleMissingLocalInstallation(detectedWorkspaceRoot) {
|
|
173
181
|
output_1.output.error({
|
|
174
182
|
title: detectedWorkspaceRoot
|
|
@@ -231,7 +239,7 @@ function getLocalNxVersion(workspace) {
|
|
|
231
239
|
function _getLatestVersionOfNx() {
|
|
232
240
|
try {
|
|
233
241
|
return (0, child_process_1.execSync)('npm view nx@latest version', {
|
|
234
|
-
windowsHide:
|
|
242
|
+
windowsHide: true,
|
|
235
243
|
})
|
|
236
244
|
.toString()
|
|
237
245
|
.trim();
|
|
@@ -239,7 +247,7 @@ function _getLatestVersionOfNx() {
|
|
|
239
247
|
catch {
|
|
240
248
|
try {
|
|
241
249
|
return (0, child_process_1.execSync)('pnpm view nx@latest version', {
|
|
242
|
-
windowsHide:
|
|
250
|
+
windowsHide: true,
|
|
243
251
|
})
|
|
244
252
|
.toString()
|
|
245
253
|
.trim();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "22.6.
|
|
3
|
+
"version": "22.6.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": {
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"jsonc-parser": "3.2.0",
|
|
57
57
|
"lines-and-columns": "2.0.3",
|
|
58
58
|
"minimatch": "10.2.4",
|
|
59
|
-
"node-machine-id": "1.1.12",
|
|
60
59
|
"npm-run-path": "^4.0.1",
|
|
61
60
|
"open": "^8.4.0",
|
|
62
61
|
"ora": "5.3.0",
|
|
@@ -85,16 +84,16 @@
|
|
|
85
84
|
}
|
|
86
85
|
},
|
|
87
86
|
"optionalDependencies": {
|
|
88
|
-
"@nx/nx-darwin-arm64": "22.6.
|
|
89
|
-
"@nx/nx-darwin-x64": "22.6.
|
|
90
|
-
"@nx/nx-freebsd-x64": "22.6.
|
|
91
|
-
"@nx/nx-linux-arm-gnueabihf": "22.6.
|
|
92
|
-
"@nx/nx-linux-arm64-gnu": "22.6.
|
|
93
|
-
"@nx/nx-linux-arm64-musl": "22.6.
|
|
94
|
-
"@nx/nx-linux-x64-gnu": "22.6.
|
|
95
|
-
"@nx/nx-linux-x64-musl": "22.6.
|
|
96
|
-
"@nx/nx-win32-arm64-msvc": "22.6.
|
|
97
|
-
"@nx/nx-win32-x64-msvc": "22.6.
|
|
87
|
+
"@nx/nx-darwin-arm64": "22.6.2",
|
|
88
|
+
"@nx/nx-darwin-x64": "22.6.2",
|
|
89
|
+
"@nx/nx-freebsd-x64": "22.6.2",
|
|
90
|
+
"@nx/nx-linux-arm-gnueabihf": "22.6.2",
|
|
91
|
+
"@nx/nx-linux-arm64-gnu": "22.6.2",
|
|
92
|
+
"@nx/nx-linux-arm64-musl": "22.6.2",
|
|
93
|
+
"@nx/nx-linux-x64-gnu": "22.6.2",
|
|
94
|
+
"@nx/nx-linux-x64-musl": "22.6.2",
|
|
95
|
+
"@nx/nx-win32-arm64-msvc": "22.6.2",
|
|
96
|
+
"@nx/nx-win32-x64-msvc": "22.6.2"
|
|
98
97
|
},
|
|
99
98
|
"nx-migrations": {
|
|
100
99
|
"migrations": "./migrations.json",
|
|
@@ -31,7 +31,8 @@ export interface DefaultChangelogRenderOptions extends ChangelogRenderOptions {
|
|
|
31
31
|
authors?: boolean;
|
|
32
32
|
/**
|
|
33
33
|
* If authors is enabled, controls whether or not to try to map the authors to their GitHub usernames
|
|
34
|
-
* using https://ungh.cc (from https://github.com/unjs/ungh) and
|
|
34
|
+
* using https://ungh.cc (from https://github.com/unjs/ungh) and, if needed, the GitHub search API via
|
|
35
|
+
* the gh CLI and the email addresses found in the commits.
|
|
35
36
|
* Defaults to true.
|
|
36
37
|
*/
|
|
37
38
|
applyUsernameToAuthors?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/release/changelog-renderer/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mFAAmF,CAAC;AAE7H;;GAEG;AACH,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,sBAAsB;IAC3E;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/release/changelog-renderer/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mFAAmF,CAAC;AAE7H;;GAEG;AACH,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;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Ae,EAAE,CAAC;IAUpC,SAAS,CAAC,gCAAgC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IA+B1E,SAAS,CAAC,UAAU,CAAC,IAAI,SAAK,GAAG,MAAM;CAMxC"}
|
package/schemas/nx-schema.json
CHANGED
|
@@ -548,9 +548,111 @@
|
|
|
548
548
|
},
|
|
549
549
|
"required": ["rules"],
|
|
550
550
|
"additionalProperties": false
|
|
551
|
+
},
|
|
552
|
+
"owners": {
|
|
553
|
+
"description": "Configuration for Nx Owners (CODEOWNERS generation). Set to true to enable with all defaults.",
|
|
554
|
+
"oneOf": [
|
|
555
|
+
{
|
|
556
|
+
"type": "boolean",
|
|
557
|
+
"enum": [true],
|
|
558
|
+
"description": "Enable owners with all default settings."
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"type": "object",
|
|
562
|
+
"properties": {
|
|
563
|
+
"format": {
|
|
564
|
+
"type": "string",
|
|
565
|
+
"description": "The format to use for the generated owners file. Defaults to 'github'.",
|
|
566
|
+
"enum": ["github", "gitlab", "bitbucket"],
|
|
567
|
+
"default": "github"
|
|
568
|
+
},
|
|
569
|
+
"outputPath": {
|
|
570
|
+
"type": "string",
|
|
571
|
+
"description": "The path to write the generated owners file to. Defaults based on format (e.g. '.github/CODEOWNERS')."
|
|
572
|
+
},
|
|
573
|
+
"patterns": {
|
|
574
|
+
"type": "array",
|
|
575
|
+
"description": "List of ownership patterns to apply.",
|
|
576
|
+
"items": {
|
|
577
|
+
"$ref": "#/definitions/ownersPattern"
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
"sections": {
|
|
581
|
+
"type": "array",
|
|
582
|
+
"description": "List of ownership sections (GitLab only). Sections allow grouping patterns with approval requirements.",
|
|
583
|
+
"items": {
|
|
584
|
+
"type": "object",
|
|
585
|
+
"properties": {
|
|
586
|
+
"name": {
|
|
587
|
+
"type": "string",
|
|
588
|
+
"description": "The section label."
|
|
589
|
+
},
|
|
590
|
+
"defaultOwners": {
|
|
591
|
+
"type": "array",
|
|
592
|
+
"description": "Default owners for all patterns in this section.",
|
|
593
|
+
"items": {
|
|
594
|
+
"type": "string"
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
"numberOfRequiredApprovals": {
|
|
598
|
+
"type": "number",
|
|
599
|
+
"description": "Number of required approvals for this section. Mutually exclusive with 'optional'."
|
|
600
|
+
},
|
|
601
|
+
"optional": {
|
|
602
|
+
"type": "boolean",
|
|
603
|
+
"description": "Whether this section is optional. Mutually exclusive with 'numberOfRequiredApprovals'."
|
|
604
|
+
},
|
|
605
|
+
"patterns": {
|
|
606
|
+
"type": "array",
|
|
607
|
+
"description": "List of ownership patterns within this section.",
|
|
608
|
+
"items": {
|
|
609
|
+
"$ref": "#/definitions/ownersPattern"
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
"required": ["name"],
|
|
614
|
+
"additionalProperties": false
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
"additionalProperties": false
|
|
619
|
+
}
|
|
620
|
+
]
|
|
551
621
|
}
|
|
552
622
|
},
|
|
553
623
|
"definitions": {
|
|
624
|
+
"ownersPattern": {
|
|
625
|
+
"type": "object",
|
|
626
|
+
"properties": {
|
|
627
|
+
"description": {
|
|
628
|
+
"type": "string",
|
|
629
|
+
"description": "A human-readable description of this ownership pattern."
|
|
630
|
+
},
|
|
631
|
+
"projects": {
|
|
632
|
+
"type": "array",
|
|
633
|
+
"description": "The projects this pattern applies to. Accepts project names, glob patterns, tag references, or any other valid project filter supported by the --projects flag.",
|
|
634
|
+
"items": {
|
|
635
|
+
"type": "string"
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
"files": {
|
|
639
|
+
"type": "array",
|
|
640
|
+
"description": "File glob patterns this ownership pattern applies to (for non-project-based ownership).",
|
|
641
|
+
"items": {
|
|
642
|
+
"type": "string"
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
"owners": {
|
|
646
|
+
"type": "array",
|
|
647
|
+
"description": "List of owners (e.g. GitHub usernames or team handles) for the matched projects or files.",
|
|
648
|
+
"items": {
|
|
649
|
+
"type": "string"
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
},
|
|
653
|
+
"required": ["owners"],
|
|
654
|
+
"additionalProperties": false
|
|
655
|
+
},
|
|
554
656
|
"inputs": {
|
|
555
657
|
"type": "array",
|
|
556
658
|
"items": {
|
|
@@ -4,6 +4,7 @@ import { Observable } from 'rxjs';
|
|
|
4
4
|
import type { GenerateOptions } from '../command-line/generate/generate';
|
|
5
5
|
import { ProjectConfiguration } from '../config/workspace-json-project-json';
|
|
6
6
|
import { Tree } from '../generators/tree';
|
|
7
|
+
import type { ProjectGraph } from '../config/project-graph';
|
|
7
8
|
import { ExecutorContext, GeneratorCallback } from '../config/misc-interfaces';
|
|
8
9
|
export declare function createBuilderContext(builderInfo: {
|
|
9
10
|
builderName: string;
|
|
@@ -16,13 +17,14 @@ export declare function scheduleTarget(root: string, opts: {
|
|
|
16
17
|
configuration: string;
|
|
17
18
|
runOptions: any;
|
|
18
19
|
projects: Record<string, ProjectConfiguration>;
|
|
19
|
-
}, verbose: boolean): Promise<Observable<import('@angular-devkit/architect').BuilderOutput>>;
|
|
20
|
+
}, verbose: boolean, projectGraph: ProjectGraph): Promise<Observable<import('@angular-devkit/architect').BuilderOutput>>;
|
|
20
21
|
type AngularProjectConfiguration = ProjectConfiguration & {
|
|
21
22
|
prefix?: string;
|
|
22
23
|
};
|
|
23
24
|
export declare class NxScopedHost extends virtualFs.ScopedHost<any> {
|
|
24
25
|
private root;
|
|
25
|
-
|
|
26
|
+
protected _projectGraph?: ProjectGraph;
|
|
27
|
+
constructor(root: string, _projectGraph?: ProjectGraph);
|
|
26
28
|
read(path: Path): Observable<FileBuffer>;
|
|
27
29
|
protected readMergedWorkspaceConfiguration(): Observable<any>;
|
|
28
30
|
write(path: Path, content: FileBuffer): Observable<void>;
|
|
@@ -37,6 +39,7 @@ export declare class NxScopedHost extends virtualFs.ScopedHost<any> {
|
|
|
37
39
|
* the project graph to access the expanded targets.
|
|
38
40
|
*/
|
|
39
41
|
export declare class NxScopedHostForBuilders extends NxScopedHost {
|
|
42
|
+
constructor(root: string, projectGraph: ProjectGraph);
|
|
40
43
|
protected readMergedWorkspaceConfiguration(): Observable<any>;
|
|
41
44
|
}
|
|
42
45
|
export declare function arrayBufferToString(buffer: any): string;
|
|
@@ -46,15 +49,15 @@ export declare function arrayBufferToString(buffer: any): string;
|
|
|
46
49
|
*/
|
|
47
50
|
export declare class NxScopeHostUsedForWrappedSchematics extends NxScopedHost {
|
|
48
51
|
private readonly host;
|
|
49
|
-
constructor(root: string, host: Tree);
|
|
52
|
+
constructor(root: string, host: Tree, projectGraph: ProjectGraph);
|
|
50
53
|
read(path: Path): Observable<FileBuffer>;
|
|
51
54
|
exists(path: Path): Observable<boolean>;
|
|
52
55
|
isDirectory(path: Path): Observable<boolean>;
|
|
53
56
|
isFile(path: Path): Observable<boolean>;
|
|
54
57
|
list(path: Path): Observable<PathFragment[]>;
|
|
55
58
|
}
|
|
56
|
-
export declare function generate(root: string, opts: GenerateOptions, projects: Record<string, ProjectConfiguration>, verbose: boolean): Promise<number>;
|
|
57
|
-
export declare function runMigration(root: string, packageName: string, migrationName: string, projects: Record<string, ProjectConfiguration>, isVerbose: boolean): Promise<{
|
|
59
|
+
export declare function generate(root: string, opts: GenerateOptions, projects: Record<string, ProjectConfiguration>, verbose: boolean, projectGraph: ProjectGraph): Promise<number>;
|
|
60
|
+
export declare function runMigration(root: string, packageName: string, migrationName: string, projects: Record<string, ProjectConfiguration>, isVerbose: boolean, projectGraph: ProjectGraph): Promise<{
|
|
58
61
|
loggingQueue: string[];
|
|
59
62
|
madeChanges: boolean;
|
|
60
63
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngcli-adapter.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/adapter/ngcli-adapter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,CACxC,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,IAcnB,MAAM,IAAI,EACV,kBAAkB;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,KACrC,OAAO,CAAC,iBAAiB,CAAC,CAwG9B;AAID,eAAO,MAAM,SAAS,GAAI,mBAAiB,KAAG,OAAO,CAAC,MAqBrD,CAAC;AA2MF;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,EACxE,UAAU,EAAE,CAAC,EACb,eAAe,EAAE,CAAC,EAClB,OAAO,EAAE,oBAAoB,GAC5B,CAAC,CAkDH"}
|
|
@@ -29,10 +29,18 @@ const angular_json_1 = require("./angular-json");
|
|
|
29
29
|
const executor_utils_1 = require("../command-line/run/executor-utils");
|
|
30
30
|
const plugins_1 = require("../project-graph/plugins");
|
|
31
31
|
const schema_utils_1 = require("../config/schema-utils");
|
|
32
|
-
const
|
|
32
|
+
const target_merging_1 = require("../project-graph/utils/project-configuration/target-merging");
|
|
33
|
+
function getProjectGraph() {
|
|
34
|
+
try {
|
|
35
|
+
return Promise.resolve((0, project_graph_1.readCachedProjectGraph)());
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return (0, project_graph_1.createProjectGraphAsync)();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
33
41
|
async function createBuilderContext(builderInfo, context) {
|
|
34
42
|
require('./compat');
|
|
35
|
-
const fsHost = new NxScopedHostForBuilders(context.root);
|
|
43
|
+
const fsHost = new NxScopedHostForBuilders(context.root, context.projectGraph);
|
|
36
44
|
// the top level import is not patched because it is imported before the
|
|
37
45
|
// patching happens so we require it here to use the patched version below
|
|
38
46
|
const { workspaces } = require('@angular-devkit/core');
|
|
@@ -120,10 +128,10 @@ async function createBuilderContext(builderInfo, context) {
|
|
|
120
128
|
};
|
|
121
129
|
return builderContext;
|
|
122
130
|
}
|
|
123
|
-
async function scheduleTarget(root, opts, verbose) {
|
|
131
|
+
async function scheduleTarget(root, opts, verbose, projectGraph) {
|
|
124
132
|
const { Architect } = require('@angular-devkit/architect');
|
|
125
133
|
const logger = (0, exports.getLogger)(verbose);
|
|
126
|
-
const fsHost = new NxScopedHostForBuilders(root);
|
|
134
|
+
const fsHost = new NxScopedHostForBuilders(root, projectGraph);
|
|
127
135
|
const { workspace } = await core_1.workspaces.readWorkspace('angular.json', core_1.workspaces.createWorkspaceHost(fsHost));
|
|
128
136
|
const architectHost = await getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, opts.projects);
|
|
129
137
|
const project = workspace.projects.get(opts.project);
|
|
@@ -269,21 +277,24 @@ async function runSchematic(host, root, workflow, logger, opts, schematic, print
|
|
|
269
277
|
return { status: 0, loggingQueue: record.loggingQueue };
|
|
270
278
|
}
|
|
271
279
|
class NxScopedHost extends core_1.virtualFs.ScopedHost {
|
|
272
|
-
constructor(root) {
|
|
280
|
+
constructor(root, _projectGraph) {
|
|
273
281
|
super(new node_1.NodeJsSyncHost(), (0, core_1.normalize)(root));
|
|
274
282
|
this.root = root;
|
|
283
|
+
this._projectGraph = _projectGraph;
|
|
275
284
|
}
|
|
276
285
|
read(path) {
|
|
277
286
|
if ((path === 'angular.json' || path === '/angular.json') &&
|
|
278
287
|
(0, angular_json_1.isAngularPluginInstalled)()) {
|
|
279
|
-
return this.readMergedWorkspaceConfiguration().pipe(
|
|
288
|
+
return this.readMergedWorkspaceConfiguration().pipe(
|
|
289
|
+
// structuredClone to avoid toOldFormat mutating shared graph objects
|
|
290
|
+
(0, operators_1.map)((r) => stringToArrayBuffer(JSON.stringify((0, angular_json_1.toOldFormat)(structuredClone(r))))));
|
|
280
291
|
}
|
|
281
292
|
else {
|
|
282
293
|
return super.read(path);
|
|
283
294
|
}
|
|
284
295
|
}
|
|
285
296
|
readMergedWorkspaceConfiguration() {
|
|
286
|
-
return (0, rxjs_1.zip)((0, rxjs_1.
|
|
297
|
+
return (0, rxjs_1.zip)(this._projectGraph ? (0, rxjs_1.of)(this._projectGraph) : (0, rxjs_1.from)(getProjectGraph()), this.readExistingAngularJson(), this.readJson('nx.json')).pipe((0, operators_1.concatMap)(([graph, angularJson, nxJson]) => {
|
|
287
298
|
const workspaceConfig = (angularJson || { projects: {} });
|
|
288
299
|
workspaceConfig.cli ??= nxJson.cli;
|
|
289
300
|
workspaceConfig.schematics ??= nxJson.generators;
|
|
@@ -437,8 +448,11 @@ exports.NxScopedHost = NxScopedHost;
|
|
|
437
448
|
* the project graph to access the expanded targets.
|
|
438
449
|
*/
|
|
439
450
|
class NxScopedHostForBuilders extends NxScopedHost {
|
|
451
|
+
constructor(root, projectGraph) {
|
|
452
|
+
super(root, projectGraph);
|
|
453
|
+
}
|
|
440
454
|
readMergedWorkspaceConfiguration() {
|
|
441
|
-
return (0, rxjs_1.zip)((0, rxjs_1.
|
|
455
|
+
return (0, rxjs_1.zip)((0, rxjs_1.of)(this._projectGraph), this.readExistingAngularJson(), this.readJson('nx.json')).pipe((0, operators_1.map)(([graph, angularJson, nxJson]) => {
|
|
442
456
|
const workspaceConfig = (angularJson || { projects: {} });
|
|
443
457
|
workspaceConfig.cli ??= nxJson.cli;
|
|
444
458
|
workspaceConfig.schematics ??= nxJson.generators;
|
|
@@ -472,8 +486,8 @@ function arrayBufferToString(buffer) {
|
|
|
472
486
|
* the project configuration files.
|
|
473
487
|
*/
|
|
474
488
|
class NxScopeHostUsedForWrappedSchematics extends NxScopedHost {
|
|
475
|
-
constructor(root, host) {
|
|
476
|
-
super(root);
|
|
489
|
+
constructor(root, host, projectGraph) {
|
|
490
|
+
super(root, projectGraph);
|
|
477
491
|
this.host = host;
|
|
478
492
|
}
|
|
479
493
|
read(path) {
|
|
@@ -485,11 +499,11 @@ class NxScopeHostUsedForWrappedSchematics extends NxScopedHost {
|
|
|
485
499
|
if (project.targets) {
|
|
486
500
|
for (const [targetName, target] of Object.entries(project.targets)) {
|
|
487
501
|
if (target.options) {
|
|
488
|
-
target.options = (0,
|
|
502
|
+
target.options = (0, target_merging_1.resolveNxTokensInOptions)(target.options, { ...project, name: projectName }, `${projectName}:${targetName}`);
|
|
489
503
|
}
|
|
490
504
|
if (target.configurations) {
|
|
491
505
|
for (const [configName, config] of Object.entries(target.configurations)) {
|
|
492
|
-
target.configurations[configName] = (0,
|
|
506
|
+
target.configurations[configName] = (0, target_merging_1.resolveNxTokensInOptions)(config, { ...project, name: projectName }, `${projectName}:${targetName}:${configName}`);
|
|
493
507
|
}
|
|
494
508
|
}
|
|
495
509
|
}
|
|
@@ -566,9 +580,9 @@ function findMatchingFileChange(host, path) {
|
|
|
566
580
|
.listChanges()
|
|
567
581
|
.find((f) => f.type !== 'DELETE' && (0, core_1.normalize)(f.path) === targetPath);
|
|
568
582
|
}
|
|
569
|
-
async function generate(root, opts, projects, verbose) {
|
|
583
|
+
async function generate(root, opts, projects, verbose, projectGraph) {
|
|
570
584
|
const logger = (0, exports.getLogger)(verbose);
|
|
571
|
-
const fsHost = new NxScopeHostUsedForWrappedSchematics(root, new tree_1.FsTree(root, verbose, `ng-cli generator: ${opts.collectionName}:${opts.generatorName}`));
|
|
585
|
+
const fsHost = new NxScopeHostUsedForWrappedSchematics(root, new tree_1.FsTree(root, verbose, `ng-cli generator: ${opts.collectionName}:${opts.generatorName}`), projectGraph);
|
|
572
586
|
const workflow = createWorkflow(fsHost, root, opts, projects);
|
|
573
587
|
const collection = getCollection(workflow, opts.collectionName);
|
|
574
588
|
const schematic = collection.createSchematic(opts.generatorName, true);
|
|
@@ -623,9 +637,9 @@ function createPromptProvider() {
|
|
|
623
637
|
return require('enquirer').prompt(questions);
|
|
624
638
|
};
|
|
625
639
|
}
|
|
626
|
-
async function runMigration(root, packageName, migrationName, projects, isVerbose) {
|
|
640
|
+
async function runMigration(root, packageName, migrationName, projects, isVerbose, projectGraph) {
|
|
627
641
|
const logger = (0, exports.getLogger)(isVerbose);
|
|
628
|
-
const fsHost = new NxScopeHostUsedForWrappedSchematics(root, new tree_1.FsTree(root, isVerbose, `ng-cli migration: ${packageName}:${migrationName}`));
|
|
642
|
+
const fsHost = new NxScopeHostUsedForWrappedSchematics(root, new tree_1.FsTree(root, isVerbose, `ng-cli migration: ${packageName}:${migrationName}`), projectGraph);
|
|
629
643
|
const workflow = createWorkflow(fsHost, root, {}, projects);
|
|
630
644
|
const collection = resolveMigrationsCollection(packageName);
|
|
631
645
|
const record = { loggingQueue: [], error: false };
|
|
@@ -713,7 +727,7 @@ function wrapAngularDevkitSchematic(collectionName, generatorName) {
|
|
|
713
727
|
// were written with Nx in mind, and may care about tags.
|
|
714
728
|
require('./compat');
|
|
715
729
|
return async (host, generatorOptions) => {
|
|
716
|
-
const graph = await (
|
|
730
|
+
const graph = await getProjectGraph();
|
|
717
731
|
const { projects } = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(graph);
|
|
718
732
|
if (mockedSchematics &&
|
|
719
733
|
mockedSchematics[`${collectionName}:${generatorName}`]) {
|
|
@@ -744,7 +758,7 @@ function wrapAngularDevkitSchematic(collectionName, generatorName) {
|
|
|
744
758
|
host.rename(eventPath, event.to);
|
|
745
759
|
}
|
|
746
760
|
};
|
|
747
|
-
const fsHost = new NxScopeHostUsedForWrappedSchematics(host.root, host);
|
|
761
|
+
const fsHost = new NxScopeHostUsedForWrappedSchematics(host.root, host, graph);
|
|
748
762
|
const logger = (0, exports.getLogger)(generatorOptions.verbose);
|
|
749
763
|
const options = {
|
|
750
764
|
generatorOptions,
|
|
@@ -932,7 +946,7 @@ function restoreNxTokensInOptions(newOptions, previousOptions, project) {
|
|
|
932
946
|
const result = Array.isArray(newOptions)
|
|
933
947
|
? [...newOptions]
|
|
934
948
|
: { ...newOptions };
|
|
935
|
-
const resolvedPreviousOptions = (0,
|
|
949
|
+
const resolvedPreviousOptions = (0, target_merging_1.resolveNxTokensInOptions)(previousOptions, project, '');
|
|
936
950
|
for (const key of Object.keys(newOptions)) {
|
|
937
951
|
const newValue = newOptions[key];
|
|
938
952
|
const previousValue = previousOptions[key];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clone-ai-config-repo.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/ai/clone-ai-config-repo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clone-ai-config-repo.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/ai/clone-ai-config-repo.ts"],"names":[],"mappings":"AAyHA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAiB5C"}
|
|
@@ -17,6 +17,7 @@ function getLatestCommitHash() {
|
|
|
17
17
|
encoding: 'utf-8',
|
|
18
18
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
19
19
|
timeout: 30000, // 30 second timeout
|
|
20
|
+
windowsHide: true,
|
|
20
21
|
});
|
|
21
22
|
const hash = output.split('\t')[0];
|
|
22
23
|
if (!hash || hash.length < 10) {
|
|
@@ -46,6 +47,7 @@ function cloneRepo(targetPath) {
|
|
|
46
47
|
encoding: 'utf-8',
|
|
47
48
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
48
49
|
timeout: 120000, // 2 minute timeout for clone
|
|
50
|
+
windowsHide: true,
|
|
49
51
|
});
|
|
50
52
|
// Remove .git directory after clone
|
|
51
53
|
const gitDir = (0, path_1.join)(tempPath, '.git');
|
|
@@ -42,7 +42,7 @@ async function installPackage(pkgName, version, nxJson) {
|
|
|
42
42
|
? `${pmc.addDev} ${pkgName}`
|
|
43
43
|
: `${pmc.addDev} ${pkgName}@${version}`;
|
|
44
44
|
await new Promise((resolve) => (0, child_process_1.exec)(command, {
|
|
45
|
-
windowsHide:
|
|
45
|
+
windowsHide: true,
|
|
46
46
|
}, (error, stdout, stderr) => {
|
|
47
47
|
if (error) {
|
|
48
48
|
spinner.fail();
|
|
@@ -2,5 +2,12 @@ export interface Example {
|
|
|
2
2
|
command: string;
|
|
3
3
|
description: string;
|
|
4
4
|
}
|
|
5
|
+
export interface CliDocsCommandMetadata {
|
|
6
|
+
supportedVersionRange?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Docs-only metadata keyed by the full command name as rendered in the CLI docs.
|
|
10
|
+
*/
|
|
11
|
+
export declare const cliDocsCommandMetadata: Record<string, CliDocsCommandMetadata>;
|
|
5
12
|
export declare const examples: Record<string, Example[]>;
|
|
6
13
|
//# sourceMappingURL=examples.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"examples.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/command-line/examples.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"examples.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/command-line/examples.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAIzE,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CA8d9C,CAAC"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.examples = void 0;
|
|
3
|
+
exports.examples = exports.cliDocsCommandMetadata = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Docs-only metadata keyed by the full command name as rendered in the CLI docs.
|
|
6
|
+
*/
|
|
7
|
+
exports.cliDocsCommandMetadata = {
|
|
8
|
+
'show target': {
|
|
9
|
+
supportedVersionRange: 'Nx 22.6+',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
4
12
|
exports.examples = {
|
|
5
13
|
affected: [
|
|
6
14
|
{
|
|
@@ -343,6 +351,26 @@ exports.examples = {
|
|
|
343
351
|
command: 'show project my-app --web',
|
|
344
352
|
description: 'Opens a web browser to explore the configuration of "my-app"',
|
|
345
353
|
},
|
|
354
|
+
{
|
|
355
|
+
command: 'show target my-app:build',
|
|
356
|
+
description: 'Prints the specified + inferred configuration for `my-app:build`',
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
command: 'show target my-app:build inputs',
|
|
360
|
+
description: 'Prints the resolved inputs for `my-app:build`',
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
command: 'show target my-app:build inputs --check packages/my-app/index.html',
|
|
364
|
+
description: 'Checks if `packages/my-app/index.html` is an input for `my-app:build`',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
command: 'show target my-app:build outputs',
|
|
368
|
+
description: 'Prints the outputs detected on disk for `my-app:build`',
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
command: 'show target my-app:build outputs --check packages/my-app/dist/index.html',
|
|
372
|
+
description: 'Checks if `packages/my-app/dist/index.html` is an output for `my-app:build`',
|
|
373
|
+
},
|
|
346
374
|
],
|
|
347
375
|
watch: [
|
|
348
376
|
{
|
|
@@ -34,7 +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:
|
|
37
|
+
windowsHide: true,
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
@@ -67,7 +67,7 @@ async function runScriptAsNxTarget(projectGraph, argv, nxArgs) {
|
|
|
67
67
|
cwd: projectGraph.nodes?.[projectName]?.data?.root
|
|
68
68
|
? (0, path_2.joinPathFragments)(workspace_root_1.workspaceRoot, projectGraph.nodes?.[projectName]?.data?.root)
|
|
69
69
|
: workspace_root_1.workspaceRoot,
|
|
70
|
-
windowsHide:
|
|
70
|
+
windowsHide: true,
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -81,7 +81,7 @@ function runTargetOnProject(scriptDefinition, targetName, project, projectName,
|
|
|
81
81
|
const command = `${pm.exec} nx run ${projectName}:\\\"${targetName}\\\" ${extraArgs.join(' ')}`;
|
|
82
82
|
(0, child_process_1.execSync)(command, {
|
|
83
83
|
stdio: 'inherit',
|
|
84
|
-
windowsHide:
|
|
84
|
+
windowsHide: true,
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
function readScriptArgV(overrides) {
|
|
@@ -152,12 +152,12 @@ function write(prettier, patterns) {
|
|
|
152
152
|
: '';
|
|
153
153
|
(0, node_child_process_1.execSync)(`node "${prettierPath}" --write ${listDifferentArg}${regularPatterns.join(' ')}`, {
|
|
154
154
|
stdio: [0, 1, 2],
|
|
155
|
-
windowsHide:
|
|
155
|
+
windowsHide: true,
|
|
156
156
|
});
|
|
157
157
|
if (swcrcPatterns.length > 0) {
|
|
158
158
|
(0, node_child_process_1.execSync)(`node "${prettierPath}" --write ${listDifferentArg}${swcrcPatterns.join(' ')} --parser json`, {
|
|
159
159
|
stdio: [0, 1, 2],
|
|
160
|
-
windowsHide:
|
|
160
|
+
windowsHide: true,
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -168,7 +168,7 @@ async function check(patterns) {
|
|
|
168
168
|
}
|
|
169
169
|
const prettierPath = getPrettierPath();
|
|
170
170
|
return new Promise((resolve, reject) => {
|
|
171
|
-
(0, node_child_process_1.exec)(`node "${prettierPath}" --list-different ${patterns.join(' ')}`, { encoding: 'utf-8', windowsHide:
|
|
171
|
+
(0, node_child_process_1.exec)(`node "${prettierPath}" --list-different ${patterns.join(' ')}`, { encoding: 'utf-8', windowsHide: true }, (error, stdout) => {
|
|
172
172
|
if (error) {
|
|
173
173
|
// The command failed because Prettier threw an error.
|
|
174
174
|
if (stdout.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/generate/generate.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAwB,MAAM,uBAAuB,CAAC;AAMzE,OAAO,EAEL,OAAO,EACP,MAAM,EACP,MAAM,oBAAoB,CAAC;AAW5B,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,QAUrD;AAwJD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAaA;AAmED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,MAAM,EACd,uBAAuB,EAAE,MAAM,EAC/B,OAAO,EAAE,MAAM,EAAE,QAelB;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/generate/generate.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAwB,MAAM,uBAAuB,CAAC;AAMzE,OAAO,EAEL,OAAO,EACP,MAAM,EACP,MAAM,oBAAoB,CAAC;AAW5B,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,QAUrD;AAwJD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAaA;AAmED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,MAAM,EACd,uBAAuB,EAAE,MAAM,EAC/B,OAAO,EAAE,MAAM,EAAE,QAelB;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,mBA2HxD"}
|
|
@@ -260,7 +260,7 @@ async function generate(args) {
|
|
|
260
260
|
return (await Promise.resolve().then(() => require('../../adapter/ngcli-adapter'))).generate(workspace_root_1.workspaceRoot, {
|
|
261
261
|
...opts,
|
|
262
262
|
generatorOptions: combinedOpts,
|
|
263
|
-
}, projectsConfigurations.projects, args.verbose);
|
|
263
|
+
}, projectsConfigurations.projects, args.verbose, projectGraph);
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
}
|