nx 19.4.3 → 19.5.0-beta.1
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/init-local.js +2 -3
- package/package.json +30 -26
- package/src/adapter/angular-json.js +6 -6
- package/src/adapter/decorate-cli.js +1 -2
- package/src/adapter/ngcli-adapter.js +8 -8
- package/src/adapter/rxjs-for-await.js +5 -5
- package/src/command-line/add/add.js +2 -2
- package/src/command-line/affected/affected.js +2 -3
- package/src/command-line/connect/connect-to-nx-cloud.js +5 -6
- package/src/command-line/connect/view-logs.js +1 -2
- package/src/command-line/daemon/daemon.js +1 -2
- package/src/command-line/exec/exec.js +1 -2
- package/src/command-line/format/format.js +1 -2
- package/src/command-line/generate/generate.js +4 -5
- package/src/command-line/generate/generator-utils.js +2 -3
- package/src/command-line/graph/command-object.js +2 -2
- package/src/command-line/graph/graph.js +9 -5
- package/src/command-line/init/implementation/add-nx-to-monorepo.js +1 -2
- package/src/command-line/init/implementation/add-nx-to-nest.js +1 -2
- package/src/command-line/init/implementation/add-nx-to-npm-repo.js +1 -2
- package/src/command-line/init/implementation/angular/index.js +1 -2
- package/src/command-line/init/implementation/angular/integrated-workspace.js +1 -2
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +1 -2
- package/src/command-line/init/implementation/angular/standalone-workspace.js +1 -2
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.d.ts +1 -1
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +7 -7
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.js +1 -2
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +1 -2
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.js +1 -2
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +1 -2
- package/src/command-line/init/implementation/react/clean-up-files.js +1 -2
- package/src/command-line/init/implementation/react/index.js +1 -2
- package/src/command-line/init/implementation/react/read-name-from-package-json.js +1 -2
- package/src/command-line/init/implementation/react/rename-js-to-jsx.js +1 -2
- package/src/command-line/init/implementation/react/tsconfig-setup.js +1 -2
- package/src/command-line/init/implementation/react/write-craco-config.js +1 -2
- package/src/command-line/init/implementation/react/write-vite-config.js +1 -2
- package/src/command-line/init/implementation/react/write-vite-index-html.js +1 -2
- package/src/command-line/init/implementation/utils.js +10 -11
- package/src/command-line/init/init-v1.js +1 -2
- package/src/command-line/init/init-v2.js +1 -2
- package/src/command-line/list/list.js +1 -2
- package/src/command-line/migrate/migrate.d.ts +1 -1
- package/src/command-line/migrate/migrate.js +5 -5
- package/src/command-line/new/new.js +1 -2
- package/src/command-line/release/changelog.js +3 -3
- package/src/command-line/release/config/config.js +3 -3
- package/src/command-line/release/config/filter-release-groups.js +1 -2
- package/src/command-line/release/config/version-plans.js +3 -4
- package/src/command-line/release/plan.js +2 -2
- package/src/command-line/release/publish.js +2 -2
- package/src/command-line/release/release.js +2 -2
- package/src/command-line/release/utils/batch-projects-by-generator-config.js +1 -2
- package/src/command-line/release/utils/exec-command.js +1 -2
- package/src/command-line/release/utils/git.js +11 -12
- package/src/command-line/release/utils/github.js +5 -6
- package/src/command-line/release/utils/launch-editor.js +1 -2
- package/src/command-line/release/utils/markdown.js +1 -2
- package/src/command-line/release/utils/print-changes.d.ts +0 -1
- package/src/command-line/release/utils/print-changes.js +2 -3
- package/src/command-line/release/utils/resolve-changelog-renderer.js +1 -2
- package/src/command-line/release/utils/resolve-nx-json-error-message.js +1 -2
- package/src/command-line/release/utils/resolve-semver-specifier.js +2 -3
- package/src/command-line/release/utils/semver.js +4 -5
- package/src/command-line/release/utils/shared.js +6 -6
- package/src/command-line/release/version.js +2 -2
- package/src/command-line/repair/repair.js +1 -2
- package/src/command-line/report/report.js +7 -7
- package/src/command-line/reset/reset.js +1 -2
- package/src/command-line/run/executor-utils.js +2 -3
- package/src/command-line/run/run-one.js +1 -2
- package/src/command-line/run/run.js +5 -6
- package/src/command-line/run-many/run-many.js +2 -3
- package/src/command-line/show/project.js +1 -2
- package/src/command-line/show/projects.js +1 -2
- package/src/command-line/watch/watch.js +8 -2
- package/src/command-line/yargs-utils/documentation.js +1 -2
- package/src/command-line/yargs-utils/shared-options.js +12 -13
- package/src/commands-runner/create-command-graph.js +1 -2
- package/src/commands-runner/get-command-projects.js +1 -2
- package/src/config/calculate-default-project-name.js +2 -3
- package/src/config/configuration.js +2 -2
- package/src/config/nx-json.js +2 -3
- package/src/config/project-graph.js +3 -3
- package/src/config/schema-utils.js +3 -4
- package/src/config/to-project-name.js +1 -2
- package/src/core/graph/main.js +1 -1
- package/src/daemon/cache.js +6 -6
- package/src/daemon/client/client.d.ts +1 -2
- package/src/daemon/client/client.js +13 -1
- package/src/daemon/client/daemon-socket-messenger.d.ts +0 -1
- package/src/daemon/client/generate-help-output.js +1 -2
- package/src/daemon/is-on-daemon.js +1 -2
- package/src/daemon/message-types/get-context-file-data.js +2 -2
- package/src/daemon/message-types/get-files-in-directory.js +2 -2
- package/src/daemon/message-types/get-nx-workspace-files.js +2 -2
- package/src/daemon/message-types/glob.js +2 -2
- package/src/daemon/message-types/hash-glob.js +2 -2
- package/src/daemon/message-types/task-history.js +3 -3
- package/src/daemon/message-types/update-context-files.js +2 -2
- package/src/daemon/server/file-watching/changed-projects.js +1 -2
- package/src/daemon/server/file-watching/file-watcher-sockets.d.ts +0 -1
- package/src/daemon/server/file-watching/file-watcher-sockets.js +4 -4
- package/src/daemon/server/handle-context-file-data.js +1 -2
- package/src/daemon/server/handle-get-files-in-directory.js +1 -2
- package/src/daemon/server/handle-get-task-history.js +1 -2
- package/src/daemon/server/handle-glob.js +1 -2
- package/src/daemon/server/handle-hash-glob.js +1 -2
- package/src/daemon/server/handle-hash-tasks.js +1 -2
- package/src/daemon/server/handle-nx-workspace-files.js +1 -2
- package/src/daemon/server/handle-outputs-tracking.js +2 -3
- package/src/daemon/server/handle-process-in-background.js +1 -2
- package/src/daemon/server/handle-request-project-graph.js +1 -2
- package/src/daemon/server/handle-request-shutdown.d.ts +0 -1
- package/src/daemon/server/handle-request-shutdown.js +1 -2
- package/src/daemon/server/handle-write-task-runs-to-history.js +1 -2
- package/src/daemon/server/outputs-tracking.js +7 -8
- package/src/daemon/server/plugins.js +2 -3
- package/src/daemon/server/project-graph-incremental-recomputation.js +3 -3
- package/src/daemon/server/server.d.ts +0 -1
- package/src/daemon/server/server.js +2 -3
- package/src/daemon/server/shutdown-utils.d.ts +0 -1
- package/src/daemon/server/shutdown-utils.js +9 -9
- package/src/daemon/server/watcher.d.ts +0 -1
- package/src/daemon/server/watcher.js +3 -4
- package/src/daemon/socket-utils.js +3 -3
- package/src/daemon/tmp-dir.js +6 -6
- package/src/devkit-exports.d.ts +1 -0
- package/src/devkit-exports.js +3 -1
- package/src/executors/noop/noop.impl.js +1 -1
- package/src/executors/run-commands/run-commands.impl.js +3 -3
- package/src/executors/run-script/run-script.impl.js +1 -1
- package/src/executors/utils/convert-nx-executor.js +1 -2
- package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +1 -2
- package/src/generators/testing-utils/create-tree-with-empty-workspace.d.ts +1 -1
- package/src/generators/testing-utils/create-tree-with-empty-workspace.js +2 -3
- package/src/generators/testing-utils/create-tree.js +1 -2
- package/src/generators/tree.d.ts +0 -2
- package/src/generators/tree.js +3 -3
- package/src/generators/utils/glob.js +2 -3
- package/src/generators/utils/json.js +3 -4
- package/src/generators/utils/nx-json.js +2 -3
- package/src/generators/utils/project-configuration.js +7 -7
- package/src/hasher/create-task-hasher.js +1 -2
- package/src/hasher/file-hasher.js +2 -3
- package/src/hasher/hash-task.d.ts +0 -1
- package/src/hasher/hash-task.js +2 -3
- package/src/hasher/native-task-hasher-impl.d.ts +0 -1
- package/src/hasher/node-task-hasher-impl.d.ts +0 -1
- package/src/hasher/task-hasher.d.ts +0 -1
- package/src/hasher/task-hasher.js +10 -10
- package/src/migrations/update-15-0-0/migrate-to-inputs.js +1 -1
- package/src/migrations/update-15-0-0/prefix-outputs.js +1 -1
- package/src/migrations/update-16-0-0/remove-nrwl-cli.js +1 -1
- package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +1 -1
- package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +1 -1
- package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +1 -1
- package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +1 -1
- package/src/migrations/update-16-9-0/remove-project-name-and-root-format.js +1 -1
- package/src/migrations/update-17-0-0/move-cache-directory.js +1 -1
- package/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +1 -1
- package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +1 -1
- package/src/migrations/update-17-2-0/move-default-base.js +1 -1
- package/src/migrations/update-17-3-0/nx-release-path.js +2 -3
- package/src/migrations/update-17-3-0/update-nxw.js +1 -1
- package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +1 -1
- package/src/migrations/update-19-2-0/move-workspace-data-directory.js +3 -4
- package/src/migrations/update-19-2-4/set-project-name.js +1 -1
- package/src/native/assert-supported-platform.js +1 -2
- package/src/native/browser.js +1 -0
- package/src/native/index.d.ts +178 -138
- package/src/native/index.js +16 -0
- package/src/native/native-bindings.js +352 -238
- package/src/native/native-file-cache-location.js +1 -2
- package/src/native/nx.wasi-browser.js +108 -0
- package/src/native/nx.wasi.cjs +139 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/native/transform-objects.js +1 -2
- package/src/native/wasi-worker-browser.mjs +32 -0
- package/src/native/wasi-worker.mjs +63 -0
- package/src/nx-cloud/debug-logger.js +1 -2
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +1 -2
- package/src/nx-cloud/resolution-helpers.js +1 -2
- package/src/nx-cloud/update-manager.js +2 -2
- package/src/nx-cloud/utilities/axios.js +1 -2
- package/src/nx-cloud/utilities/get-cloud-options.js +1 -2
- package/src/nx-cloud/utilities/url-shorten.js +8 -9
- package/src/plugins/js/hasher/hasher.js +1 -2
- package/src/plugins/js/lock-file/lock-file.js +6 -6
- package/src/plugins/js/lock-file/npm-parser.js +3 -4
- package/src/plugins/js/lock-file/pnpm-parser.js +3 -4
- package/src/plugins/js/lock-file/project-graph-pruning.js +1 -2
- package/src/plugins/js/lock-file/utils/package-json.js +2 -3
- package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +5 -6
- package/src/plugins/js/lock-file/yarn-parser.js +3 -4
- package/src/plugins/js/package-json/create-package-json.js +2 -3
- package/src/plugins/js/project-graph/build-dependencies/build-dependencies.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/explicit-package-json-dependencies.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +1 -2
- package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +2 -2
- package/src/plugins/js/project-graph/build-nodes/build-npm-package-nodes.js +1 -2
- package/src/plugins/js/utils/config.js +1 -2
- package/src/plugins/js/utils/register.d.ts +1 -0
- package/src/plugins/js/utils/register.js +7 -8
- package/src/plugins/js/utils/resolve-relative-to-dir.js +1 -2
- package/src/plugins/js/utils/typescript.js +5 -6
- package/src/plugins/js/versions.d.ts +1 -1
- package/src/plugins/js/versions.js +1 -1
- package/src/plugins/package-json-workspaces/create-nodes.js +5 -5
- package/src/plugins/project-json/build-nodes/project-json.js +3 -3
- package/src/project-graph/affected/affected-project-graph.js +1 -2
- package/src/project-graph/build-project-graph.js +3 -4
- package/src/project-graph/error-types.js +11 -11
- package/src/project-graph/file-map-utils.js +4 -5
- package/src/project-graph/file-utils.d.ts +1 -1
- package/src/project-graph/file-utils.js +7 -7
- package/src/project-graph/nx-deps-cache.js +8 -8
- package/src/project-graph/operators.js +5 -5
- package/src/project-graph/plugins/internal-api.js +4 -5
- package/src/project-graph/plugins/isolation/index.js +1 -2
- package/src/project-graph/plugins/isolation/messaging.d.ts +0 -2
- package/src/project-graph/plugins/isolation/messaging.js +4 -5
- package/src/project-graph/plugins/isolation/plugin-pool.js +1 -2
- package/src/project-graph/plugins/loader.js +7 -7
- package/src/project-graph/plugins/utils.js +4 -5
- package/src/project-graph/project-graph-builder.js +2 -2
- package/src/project-graph/project-graph.js +7 -8
- package/src/project-graph/utils/build-all-workspace-files.js +1 -2
- package/src/project-graph/utils/find-project-for-path.js +4 -5
- package/src/project-graph/utils/implicit-project-dependencies.js +1 -2
- package/src/project-graph/utils/normalize-project-nodes.js +2 -3
- package/src/project-graph/utils/project-configuration-utils.d.ts +8 -6
- package/src/project-graph/utils/project-configuration-utils.js +118 -54
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +3 -3
- package/src/project-graph/utils/retrieve-workspace-files.js +6 -7
- package/src/tasks-runner/create-task-graph.js +3 -3
- package/src/tasks-runner/forked-process-task-runner.d.ts +0 -1
- package/src/tasks-runner/init-tasks-runner.js +1 -2
- package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +1 -2
- package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +1 -2
- package/src/tasks-runner/life-cycles/formatting-utils.js +2 -3
- package/src/tasks-runner/life-cycles/pretty-time.js +1 -2
- package/src/tasks-runner/life-cycles/view-logs-utils.js +1 -2
- package/src/tasks-runner/pseudo-ipc.d.ts +0 -1
- package/src/tasks-runner/pseudo-terminal.d.ts +0 -1
- package/src/tasks-runner/pseudo-terminal.js +5 -2
- package/src/tasks-runner/run-command.js +4 -5
- package/src/tasks-runner/task-env.d.ts +0 -1
- package/src/tasks-runner/task-env.js +5 -6
- package/src/tasks-runner/task-graph-utils.js +2 -3
- package/src/tasks-runner/utils.js +25 -26
- package/src/utils/ab-testing.js +2 -2
- package/src/utils/all-file-data.js +1 -2
- package/src/utils/assert-workspace-validity.js +1 -2
- package/src/utils/async-iterator.js +2 -3
- package/src/utils/cache-directory.js +2 -2
- package/src/utils/child-process.d.ts +0 -1
- package/src/utils/child-process.js +3 -3
- package/src/utils/chunkify.js +1 -2
- package/src/utils/code-frames.js +1 -2
- package/src/utils/collapse-expanded-outputs.js +1 -2
- package/src/utils/command-line-utils.js +5 -6
- package/src/utils/consume-messages-from-socket.js +1 -2
- package/src/utils/default-base.js +1 -2
- package/src/utils/dotenv.js +1 -2
- package/src/utils/exit-codes.d.ts +0 -1
- package/src/utils/exit-codes.js +1 -2
- package/src/utils/fileutils.d.ts +0 -1
- package/src/utils/fileutils.js +9 -10
- package/src/utils/find-matching-projects.js +2 -2
- package/src/utils/find-workspace-root.js +1 -2
- package/src/utils/get-package-name-from-import-path.js +1 -2
- package/src/utils/git-utils.js +4 -5
- package/src/utils/globs.js +1 -2
- package/src/utils/ignore.js +4 -4
- package/src/utils/installation-directory.js +2 -3
- package/src/utils/is-ci.js +1 -2
- package/src/utils/json-diff.js +5 -5
- package/src/utils/json.js +3 -3
- package/src/utils/logger.js +2 -2
- package/src/utils/nx-cloud-utils.js +3 -4
- package/src/utils/nx-plugin.deprecated.js +1 -4
- package/src/utils/object-sort.js +1 -2
- package/src/utils/package-json.js +8 -9
- package/src/utils/package-manager.js +13 -14
- package/src/utils/params.js +14 -14
- package/src/utils/path.js +3 -4
- package/src/utils/plugins/community-plugins.js +1 -2
- package/src/utils/plugins/core-plugins.js +2 -3
- package/src/utils/plugins/installed-plugins.js +3 -4
- package/src/utils/plugins/local-plugins.js +2 -3
- package/src/utils/plugins/plugin-capabilities.js +2 -3
- package/src/utils/plugins/shared.js +1 -2
- package/src/utils/print-help.js +1 -2
- package/src/utils/project-graph-utils.js +4 -5
- package/src/utils/serializable-error.js +1 -2
- package/src/utils/serialize-overrides-into-command-line.js +1 -2
- package/src/utils/serialize-target.js +1 -2
- package/src/utils/split-target.js +2 -3
- package/src/utils/strip-indents.js +1 -2
- package/src/utils/task-history.js +3 -3
- package/src/utils/update-nxw.js +1 -2
- package/src/utils/workspace-configuration-check.js +1 -2
- package/src/utils/workspace-context.js +10 -11
- package/src/utils/workspace-root.js +3 -3
- package/src/plugins/target-defaults/symbols.d.ts +0 -17
- package/src/plugins/target-defaults/symbols.js +0 -20
- package/src/plugins/target-defaults/target-defaults-plugin.d.ts +0 -121
- package/src/plugins/target-defaults/target-defaults-plugin.js +0 -176
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.mergeProjectConfigurationIntoRootMap = mergeProjectConfigurationIntoRootMap;
|
|
4
|
+
exports.mergeMetadata = mergeMetadata;
|
|
5
|
+
exports.createProjectConfigurations = createProjectConfigurations;
|
|
6
|
+
exports.readProjectConfigurationsFromRootMap = readProjectConfigurationsFromRootMap;
|
|
7
|
+
exports.validateProject = validateProject;
|
|
8
|
+
exports.mergeTargetDefaultWithTargetDefinition = mergeTargetDefaultWithTargetDefinition;
|
|
9
|
+
exports.mergeTargetConfigurations = mergeTargetConfigurations;
|
|
10
|
+
exports.isCompatibleTarget = isCompatibleTarget;
|
|
11
|
+
exports.resolveNxTokensInOptions = resolveNxTokensInOptions;
|
|
12
|
+
exports.readTargetDefaultsForTarget = readTargetDefaultsForTarget;
|
|
13
|
+
exports.normalizeTarget = normalizeTarget;
|
|
4
14
|
const logger_1 = require("../../utils/logger");
|
|
5
15
|
const fileutils_1 = require("../../utils/fileutils");
|
|
6
16
|
const workspace_root_1 = require("../../utils/workspace-root");
|
|
7
|
-
const symbols_1 = require("../../plugins/target-defaults/symbols");
|
|
8
17
|
const minimatch_1 = require("minimatch");
|
|
9
18
|
const path_1 = require("path");
|
|
10
19
|
const perf_hooks_1 = require("perf_hooks");
|
|
@@ -120,29 +129,19 @@ skipTargetNormalization) {
|
|
|
120
129
|
// Always set source map info for the target, but don't overwrite info already there
|
|
121
130
|
// if augmenting an existing target.
|
|
122
131
|
const target = project.targets?.[targetName];
|
|
123
|
-
if (sourceMap
|
|
132
|
+
if (sourceMap) {
|
|
124
133
|
sourceMap[`targets.${targetName}`] = sourceInformation;
|
|
125
134
|
}
|
|
126
|
-
// If ONLY_MODIFIES_EXISTING_TARGET is true, and its not on the matching project
|
|
127
|
-
// we shouldn't merge its info into the graph
|
|
128
|
-
if (target?.[symbols_1.ONLY_MODIFIES_EXISTING_TARGET] &&
|
|
129
|
-
!matchingProject.targets?.[targetName]) {
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
135
|
const normalizedTarget = skipTargetNormalization
|
|
133
136
|
? target
|
|
134
137
|
: resolveCommandSyntacticSugar(target, project.root);
|
|
135
138
|
const mergedTarget = mergeTargetConfigurations(normalizedTarget, matchingProject.targets?.[targetName], sourceMap, sourceInformation, `targets.${targetName}`);
|
|
136
|
-
// We don't want the symbol to live on past the merge process
|
|
137
|
-
if (mergedTarget?.[symbols_1.ONLY_MODIFIES_EXISTING_TARGET])
|
|
138
|
-
delete mergedTarget?.[symbols_1.ONLY_MODIFIES_EXISTING_TARGET];
|
|
139
139
|
updatedProjectConfiguration.targets[targetName] = mergedTarget;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
projectRootMap[updatedProjectConfiguration.root] =
|
|
143
143
|
updatedProjectConfiguration;
|
|
144
144
|
}
|
|
145
|
-
exports.mergeProjectConfigurationIntoRootMap = mergeProjectConfigurationIntoRootMap;
|
|
146
145
|
function mergeMetadata(sourceMap, sourceInformation, baseSourceMapPath, metadata, matchingMetadata) {
|
|
147
146
|
const result = {
|
|
148
147
|
...(matchingMetadata ?? {}),
|
|
@@ -212,7 +211,6 @@ function mergeMetadata(sourceMap, sourceInformation, baseSourceMapPath, metadata
|
|
|
212
211
|
}
|
|
213
212
|
return result;
|
|
214
213
|
}
|
|
215
|
-
exports.mergeMetadata = mergeMetadata;
|
|
216
214
|
/**
|
|
217
215
|
* Transforms a list of project paths into a map of project configurations.
|
|
218
216
|
*
|
|
@@ -265,7 +263,7 @@ plugins) {
|
|
|
265
263
|
results.push(r);
|
|
266
264
|
}
|
|
267
265
|
return Promise.all(results).then((results) => {
|
|
268
|
-
const { projectRootMap, externalNodes, rootMap, configurationSourceMaps } = mergeCreateNodesResults(results, errors);
|
|
266
|
+
const { projectRootMap, externalNodes, rootMap, configurationSourceMaps } = mergeCreateNodesResults(results, nxJson, errors);
|
|
269
267
|
perf_hooks_1.performance.mark('build-project-configs:end');
|
|
270
268
|
perf_hooks_1.performance.measure('build-project-configs', 'build-project-configs:start', 'build-project-configs:end');
|
|
271
269
|
if (errors.length === 0) {
|
|
@@ -288,8 +286,7 @@ plugins) {
|
|
|
288
286
|
}
|
|
289
287
|
});
|
|
290
288
|
}
|
|
291
|
-
|
|
292
|
-
function mergeCreateNodesResults(results, errors) {
|
|
289
|
+
function mergeCreateNodesResults(results, nxJsonConfiguration, errors) {
|
|
293
290
|
perf_hooks_1.performance.mark('createNodes:merge - start');
|
|
294
291
|
const projectRootMap = {};
|
|
295
292
|
const externalNodes = {};
|
|
@@ -298,9 +295,6 @@ function mergeCreateNodesResults(results, errors) {
|
|
|
298
295
|
const [pluginName, file, nodes] = result;
|
|
299
296
|
const { projects: projectNodes, externalNodes: pluginExternalNodes } = nodes;
|
|
300
297
|
const sourceInfo = [file, pluginName];
|
|
301
|
-
if (result[symbols_1.OVERRIDE_SOURCE_FILE]) {
|
|
302
|
-
sourceInfo[0] = result[symbols_1.OVERRIDE_SOURCE_FILE];
|
|
303
|
-
}
|
|
304
298
|
for (const node in projectNodes) {
|
|
305
299
|
// Handles `{projects: {'libs/foo': undefined}}`.
|
|
306
300
|
if (!projectNodes[node]) {
|
|
@@ -324,7 +318,7 @@ function mergeCreateNodesResults(results, errors) {
|
|
|
324
318
|
Object.assign(externalNodes, pluginExternalNodes);
|
|
325
319
|
}
|
|
326
320
|
try {
|
|
327
|
-
validateAndNormalizeProjectRootMap(projectRootMap);
|
|
321
|
+
validateAndNormalizeProjectRootMap(projectRootMap, nxJsonConfiguration, configurationSourceMaps);
|
|
328
322
|
}
|
|
329
323
|
catch (e) {
|
|
330
324
|
if ((0, error_types_1.isProjectsWithNoNameError)(e) ||
|
|
@@ -402,8 +396,7 @@ function readProjectConfigurationsFromRootMap(projectRootMap) {
|
|
|
402
396
|
}
|
|
403
397
|
return projects;
|
|
404
398
|
}
|
|
405
|
-
|
|
406
|
-
function validateAndNormalizeProjectRootMap(projectRootMap) {
|
|
399
|
+
function validateAndNormalizeProjectRootMap(projectRootMap, nxJsonConfiguration, sourceMaps = {}) {
|
|
407
400
|
// Name -> Project, used to validate that all projects have unique names
|
|
408
401
|
const projects = {};
|
|
409
402
|
// If there are projects that have the same name, that is an error.
|
|
@@ -436,24 +429,7 @@ function validateAndNormalizeProjectRootMap(projectRootMap) {
|
|
|
436
429
|
throw e;
|
|
437
430
|
}
|
|
438
431
|
}
|
|
439
|
-
|
|
440
|
-
project.targets[targetName] = normalizeTarget(project.targets[targetName], project);
|
|
441
|
-
if (
|
|
442
|
-
// If the target has no executor or command, it doesn't do anything
|
|
443
|
-
!project.targets[targetName].executor &&
|
|
444
|
-
!project.targets[targetName].command) {
|
|
445
|
-
// But it may have dependencies that do something
|
|
446
|
-
if (project.targets[targetName].dependsOn &&
|
|
447
|
-
project.targets[targetName].dependsOn.length > 0) {
|
|
448
|
-
project.targets[targetName].executor = 'nx:noop';
|
|
449
|
-
}
|
|
450
|
-
else {
|
|
451
|
-
// If it does nothing, and has no depenencies,
|
|
452
|
-
// we can remove it.
|
|
453
|
-
delete project.targets[targetName];
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
}
|
|
432
|
+
normalizeTargets(project, sourceMaps, nxJsonConfiguration);
|
|
457
433
|
}
|
|
458
434
|
if (conflicts.size > 0) {
|
|
459
435
|
throw new error_types_1.MultipleProjectsWithSameNameError(conflicts, projects);
|
|
@@ -463,6 +439,33 @@ function validateAndNormalizeProjectRootMap(projectRootMap) {
|
|
|
463
439
|
}
|
|
464
440
|
return projectRootMap;
|
|
465
441
|
}
|
|
442
|
+
function normalizeTargets(project, sourceMaps, nxJsonConfiguration) {
|
|
443
|
+
for (const targetName in project.targets) {
|
|
444
|
+
project.targets[targetName] = normalizeTarget(project.targets[targetName], project);
|
|
445
|
+
const projectSourceMaps = sourceMaps[project.root];
|
|
446
|
+
const targetConfig = project.targets[targetName];
|
|
447
|
+
const targetDefaults = readTargetDefaultsForTarget(targetName, nxJsonConfiguration.targetDefaults, targetConfig.executor);
|
|
448
|
+
// We only apply defaults if they exist
|
|
449
|
+
if (targetDefaults && isCompatibleTarget(targetConfig, targetDefaults)) {
|
|
450
|
+
project.targets[targetName] = mergeTargetDefaultWithTargetDefinition(targetName, project, normalizeTarget(targetDefaults, project), projectSourceMaps);
|
|
451
|
+
}
|
|
452
|
+
if (
|
|
453
|
+
// If the target has no executor or command, it doesn't do anything
|
|
454
|
+
!project.targets[targetName].executor &&
|
|
455
|
+
!project.targets[targetName].command) {
|
|
456
|
+
// But it may have dependencies that do something
|
|
457
|
+
if (project.targets[targetName].dependsOn &&
|
|
458
|
+
project.targets[targetName].dependsOn.length > 0) {
|
|
459
|
+
project.targets[targetName].executor = 'nx:noop';
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
// If it does nothing, and has no depenencies,
|
|
463
|
+
// we can remove it.
|
|
464
|
+
delete project.targets[targetName];
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
466
469
|
function validateProject(project,
|
|
467
470
|
// name -> project
|
|
468
471
|
knownProjects) {
|
|
@@ -483,7 +486,74 @@ knownProjects) {
|
|
|
483
486
|
throw new error_types_1.ProjectWithExistingNameError(project.name, project.root);
|
|
484
487
|
}
|
|
485
488
|
}
|
|
486
|
-
|
|
489
|
+
function targetDefaultShouldBeApplied(key, sourceMap) {
|
|
490
|
+
const sourceInfo = sourceMap[key];
|
|
491
|
+
if (!sourceInfo) {
|
|
492
|
+
return true;
|
|
493
|
+
}
|
|
494
|
+
// The defined value of the target is from a plugin that
|
|
495
|
+
// isn't part of Nx's core plugins, so target defaults are
|
|
496
|
+
// applied on top of it.
|
|
497
|
+
const [, plugin] = sourceInfo;
|
|
498
|
+
return !plugin?.startsWith('nx/');
|
|
499
|
+
}
|
|
500
|
+
function mergeTargetDefaultWithTargetDefinition(targetName, project, targetDefault, sourceMap) {
|
|
501
|
+
const targetDefinition = project.targets[targetName] ?? {};
|
|
502
|
+
const result = JSON.parse(JSON.stringify(targetDefinition));
|
|
503
|
+
for (const key in targetDefault) {
|
|
504
|
+
switch (key) {
|
|
505
|
+
case 'options': {
|
|
506
|
+
const normalizedDefaults = resolveNxTokensInOptions(targetDefault.options, project, targetName);
|
|
507
|
+
for (const optionKey in normalizedDefaults) {
|
|
508
|
+
const sourceMapKey = `targets.${targetName}.options.${optionKey}`;
|
|
509
|
+
if (targetDefinition.options[optionKey] === undefined ||
|
|
510
|
+
targetDefaultShouldBeApplied(sourceMapKey, sourceMap)) {
|
|
511
|
+
result.options[optionKey] = targetDefault.options[optionKey];
|
|
512
|
+
sourceMap[sourceMapKey] = ['nx.json', 'nx/target-defaults'];
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
517
|
+
case 'configurations': {
|
|
518
|
+
if (!result.configurations) {
|
|
519
|
+
result.configurations = {};
|
|
520
|
+
sourceMap[`targets.${targetName}.configurations`] = [
|
|
521
|
+
'nx.json',
|
|
522
|
+
'nx/target-defaults',
|
|
523
|
+
];
|
|
524
|
+
}
|
|
525
|
+
for (const configuration in targetDefault.configurations) {
|
|
526
|
+
if (!result.configurations[configuration]) {
|
|
527
|
+
result.configurations[configuration] = {};
|
|
528
|
+
sourceMap[`targets.${targetName}.configurations.${configuration}`] =
|
|
529
|
+
['nx.json', 'nx/target-defaults'];
|
|
530
|
+
}
|
|
531
|
+
const normalizedConfigurationDefaults = resolveNxTokensInOptions(targetDefault.configurations[configuration], project, targetName);
|
|
532
|
+
for (const configurationKey in normalizedConfigurationDefaults) {
|
|
533
|
+
const sourceMapKey = `targets.${targetName}.configurations.${configuration}.${configurationKey}`;
|
|
534
|
+
if (targetDefinition.configurations?.[configuration]?.[configurationKey] === undefined ||
|
|
535
|
+
targetDefaultShouldBeApplied(sourceMapKey, sourceMap)) {
|
|
536
|
+
result.configurations[configuration][configurationKey] =
|
|
537
|
+
targetDefault.configurations[configuration][configurationKey];
|
|
538
|
+
sourceMap[sourceMapKey] = ['nx.json', 'nx/target-defaults'];
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
544
|
+
default: {
|
|
545
|
+
const sourceMapKey = `targets.${targetName}.${key}`;
|
|
546
|
+
if (targetDefinition[key] === undefined ||
|
|
547
|
+
targetDefaultShouldBeApplied(sourceMapKey, sourceMap)) {
|
|
548
|
+
result[key] = targetDefault[key];
|
|
549
|
+
sourceMap[sourceMapKey] = ['nx.json', 'nx/target-defaults'];
|
|
550
|
+
}
|
|
551
|
+
break;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return result;
|
|
556
|
+
}
|
|
487
557
|
/**
|
|
488
558
|
* Merges two targets.
|
|
489
559
|
*
|
|
@@ -502,13 +572,6 @@ function mergeTargetConfigurations(target, baseTarget, projectConfigSourceMap, s
|
|
|
502
572
|
// Target is "compatible", e.g. executor is defined only once or is the same
|
|
503
573
|
// in both places. This means that it is likely safe to merge
|
|
504
574
|
const isCompatible = isCompatibleTarget(baseTarget ?? {}, target);
|
|
505
|
-
// If the targets are not compatible, we would normally overwrite the old target
|
|
506
|
-
// with the new one. However, we have a special case for targets that have the
|
|
507
|
-
// ONLY_MODIFIES_EXISTING_TARGET symbol set. This prevents the merged target
|
|
508
|
-
// equaling info that should have only been used to modify the existing target.
|
|
509
|
-
if (!isCompatible && target[symbols_1.ONLY_MODIFIES_EXISTING_TARGET]) {
|
|
510
|
-
return baseTarget;
|
|
511
|
-
}
|
|
512
575
|
if (!isCompatible && projectConfigSourceMap) {
|
|
513
576
|
// if the target is not compatible, we will simply override the options
|
|
514
577
|
// we have to delete old entries from the source map
|
|
@@ -547,7 +610,6 @@ function mergeTargetConfigurations(target, baseTarget, projectConfigSourceMap, s
|
|
|
547
610
|
}
|
|
548
611
|
return result;
|
|
549
612
|
}
|
|
550
|
-
exports.mergeTargetConfigurations = mergeTargetConfigurations;
|
|
551
613
|
/**
|
|
552
614
|
* Checks if targets options are compatible - used when merging configurations
|
|
553
615
|
* to avoid merging options for @nx/js:tsc into something like @nx/webpack:webpack.
|
|
@@ -580,7 +642,6 @@ function isCompatibleTarget(a, b) {
|
|
|
580
642
|
}
|
|
581
643
|
return true;
|
|
582
644
|
}
|
|
583
|
-
exports.isCompatibleTarget = isCompatibleTarget;
|
|
584
645
|
function mergeConfigurations(newConfigurations, baseConfigurations, projectConfigSourceMap, sourceInformation, targetIdentifier) {
|
|
585
646
|
const mergedConfigurations = {};
|
|
586
647
|
const configurations = new Set([
|
|
@@ -638,7 +699,6 @@ function resolveNxTokensInOptions(object, project, key) {
|
|
|
638
699
|
}
|
|
639
700
|
return result;
|
|
640
701
|
}
|
|
641
|
-
exports.resolveNxTokensInOptions = resolveNxTokensInOptions;
|
|
642
702
|
function readTargetDefaultsForTarget(targetName, targetDefaults, executor) {
|
|
643
703
|
if (executor) {
|
|
644
704
|
// If an executor is defined in project.json, defaults should be read
|
|
@@ -654,7 +714,6 @@ function readTargetDefaultsForTarget(targetName, targetDefaults, executor) {
|
|
|
654
714
|
return targetDefaults?.[targetName];
|
|
655
715
|
}
|
|
656
716
|
}
|
|
657
|
-
exports.readTargetDefaultsForTarget = readTargetDefaultsForTarget;
|
|
658
717
|
function createRootMap(projectRootMap) {
|
|
659
718
|
const map = {};
|
|
660
719
|
for (const projectRoot in projectRootMap) {
|
|
@@ -682,6 +741,12 @@ function resolveCommandSyntacticSugar(target, key) {
|
|
|
682
741
|
};
|
|
683
742
|
}
|
|
684
743
|
}
|
|
744
|
+
/**
|
|
745
|
+
* Expand's `command` syntactic sugar and replaces tokens in options.
|
|
746
|
+
* @param target The target to normalize
|
|
747
|
+
* @param project The project that the target belongs to
|
|
748
|
+
* @returns The normalized target configuration
|
|
749
|
+
*/
|
|
685
750
|
function normalizeTarget(target, project) {
|
|
686
751
|
target = resolveCommandSyntacticSugar(target, project.root);
|
|
687
752
|
target.options = resolveNxTokensInOptions(target.options, project, `${project.root}:${target}`);
|
|
@@ -691,4 +756,3 @@ function normalizeTarget(target, project) {
|
|
|
691
756
|
}
|
|
692
757
|
return target;
|
|
693
758
|
}
|
|
694
|
-
exports.normalizeTarget = normalizeTarget;
|
|
@@ -9,12 +9,12 @@ import { LoadedNxPlugin } from '../plugins/internal-api';
|
|
|
9
9
|
* @param nxJson
|
|
10
10
|
*/
|
|
11
11
|
export declare function retrieveWorkspaceFiles(workspaceRoot: string, projectRootMap: Record<string, string>): Promise<{
|
|
12
|
-
allWorkspaceFiles: import("
|
|
12
|
+
allWorkspaceFiles: import("../file-utils").FileData[];
|
|
13
13
|
fileMap: {
|
|
14
14
|
projectFileMap: ProjectFiles;
|
|
15
|
-
nonProjectFiles: import("
|
|
15
|
+
nonProjectFiles: import("../../native").FileData[];
|
|
16
16
|
};
|
|
17
|
-
rustReferences: import("
|
|
17
|
+
rustReferences: import("../../native").NxWorkspaceFilesExternals;
|
|
18
18
|
}>;
|
|
19
19
|
/**
|
|
20
20
|
* Walk through the workspace and return `ProjectConfigurations`. Only use this if the projectFileMap is not needed.
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.retrieveWorkspaceFiles = retrieveWorkspaceFiles;
|
|
4
|
+
exports.retrieveProjectConfigurations = retrieveProjectConfigurations;
|
|
5
|
+
exports.retrieveProjectConfigurationsWithAngularProjects = retrieveProjectConfigurationsWithAngularProjects;
|
|
6
|
+
exports.retrieveProjectConfigurationPaths = retrieveProjectConfigurationPaths;
|
|
7
|
+
exports.retrieveProjectConfigurationsWithoutPluginInference = retrieveProjectConfigurationsWithoutPluginInference;
|
|
8
|
+
exports.configurationGlobs = configurationGlobs;
|
|
4
9
|
const perf_hooks_1 = require("perf_hooks");
|
|
5
10
|
const angular_json_1 = require("../../adapter/angular-json");
|
|
6
11
|
const nx_json_1 = require("../../config/nx-json");
|
|
@@ -32,7 +37,6 @@ async function retrieveWorkspaceFiles(workspaceRoot, projectRootMap) {
|
|
|
32
37
|
rustReferences: externalReferences,
|
|
33
38
|
};
|
|
34
39
|
}
|
|
35
|
-
exports.retrieveWorkspaceFiles = retrieveWorkspaceFiles;
|
|
36
40
|
/**
|
|
37
41
|
* Walk through the workspace and return `ProjectConfigurations`. Only use this if the projectFileMap is not needed.
|
|
38
42
|
*/
|
|
@@ -41,7 +45,6 @@ async function retrieveProjectConfigurations(plugins, workspaceRoot, nxJson) {
|
|
|
41
45
|
const workspaceFiles = await (0, workspace_context_1.globWithWorkspaceContext)(workspaceRoot, globPatterns);
|
|
42
46
|
return (0, project_configuration_utils_1.createProjectConfigurations)(workspaceRoot, nxJson, workspaceFiles, plugins);
|
|
43
47
|
}
|
|
44
|
-
exports.retrieveProjectConfigurations = retrieveProjectConfigurations;
|
|
45
48
|
async function retrieveProjectConfigurationsWithAngularProjects(workspaceRoot, nxJson) {
|
|
46
49
|
const pluginsToLoad = nxJson?.plugins ?? [];
|
|
47
50
|
if ((0, angular_json_1.shouldMergeAngularProjects)(workspaceRoot, true) &&
|
|
@@ -54,12 +57,10 @@ async function retrieveProjectConfigurationsWithAngularProjects(workspaceRoot, n
|
|
|
54
57
|
cleanup();
|
|
55
58
|
return res;
|
|
56
59
|
}
|
|
57
|
-
exports.retrieveProjectConfigurationsWithAngularProjects = retrieveProjectConfigurationsWithAngularProjects;
|
|
58
60
|
function retrieveProjectConfigurationPaths(root, plugins) {
|
|
59
61
|
const projectGlobPatterns = configurationGlobs(plugins);
|
|
60
62
|
return (0, workspace_context_1.globWithWorkspaceContext)(root, projectGlobPatterns);
|
|
61
63
|
}
|
|
62
|
-
exports.retrieveProjectConfigurationPaths = retrieveProjectConfigurationPaths;
|
|
63
64
|
const projectsWithoutPluginCache = new Map();
|
|
64
65
|
// TODO: This function is called way too often, it should be optimized without this cache
|
|
65
66
|
async function retrieveProjectConfigurationsWithoutPluginInference(root) {
|
|
@@ -76,7 +77,6 @@ async function retrieveProjectConfigurationsWithoutPluginInference(root) {
|
|
|
76
77
|
cleanup();
|
|
77
78
|
return projects;
|
|
78
79
|
}
|
|
79
|
-
exports.retrieveProjectConfigurationsWithoutPluginInference = retrieveProjectConfigurationsWithoutPluginInference;
|
|
80
80
|
function configurationGlobs(plugins) {
|
|
81
81
|
const globPatterns = [];
|
|
82
82
|
for (const plugin of plugins) {
|
|
@@ -86,4 +86,3 @@ function configurationGlobs(plugins) {
|
|
|
86
86
|
}
|
|
87
87
|
return globPatterns;
|
|
88
88
|
}
|
|
89
|
-
exports.configurationGlobs = configurationGlobs;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ProcessTasks = void 0;
|
|
4
|
+
exports.createTaskGraph = createTaskGraph;
|
|
5
|
+
exports.mapTargetDefaultsToDependencies = mapTargetDefaultsToDependencies;
|
|
4
6
|
const utils_1 = require("./utils");
|
|
5
7
|
const project_graph_utils_1 = require("../utils/project-graph-utils");
|
|
6
8
|
const output_1 = require("../utils/output");
|
|
@@ -181,7 +183,6 @@ function createTaskGraph(projectGraph, extraTargetDependencies, projectNames, ta
|
|
|
181
183
|
dependencies: p.dependencies,
|
|
182
184
|
};
|
|
183
185
|
}
|
|
184
|
-
exports.createTaskGraph = createTaskGraph;
|
|
185
186
|
function mapTargetDefaultsToDependencies(defaults) {
|
|
186
187
|
const res = {};
|
|
187
188
|
Object.keys(defaults ?? {}).forEach((k) => {
|
|
@@ -189,7 +190,6 @@ function mapTargetDefaultsToDependencies(defaults) {
|
|
|
189
190
|
});
|
|
190
191
|
return res;
|
|
191
192
|
}
|
|
192
|
-
exports.mapTargetDefaultsToDependencies = mapTargetDefaultsToDependencies;
|
|
193
193
|
function interpolateOverrides(args, projectName, project) {
|
|
194
194
|
const interpolatedArgs = { ...args };
|
|
195
195
|
Object.entries(interpolatedArgs).forEach(([name, value]) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initTasksRunner =
|
|
3
|
+
exports.initTasksRunner = initTasksRunner;
|
|
4
4
|
const workspace_configuration_check_1 = require("../utils/workspace-configuration-check");
|
|
5
5
|
const configuration_1 = require("../config/configuration");
|
|
6
6
|
const project_graph_1 = require("../project-graph/project-graph");
|
|
@@ -56,4 +56,3 @@ async function initTasksRunner(nxArgs) {
|
|
|
56
56
|
},
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
exports.initTasksRunner = initTasksRunner;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createRunManyDynamicOutputRenderer =
|
|
3
|
+
exports.createRunManyDynamicOutputRenderer = createRunManyDynamicOutputRenderer;
|
|
4
4
|
const cliCursor = require("cli-cursor");
|
|
5
5
|
const cli_spinners_1 = require("cli-spinners");
|
|
6
6
|
const os_1 = require("os");
|
|
@@ -318,7 +318,6 @@ async function createRunManyDynamicOutputRenderer({ projectNames, tasks, args, o
|
|
|
318
318
|
};
|
|
319
319
|
return { lifeCycle, renderIsDone };
|
|
320
320
|
}
|
|
321
|
-
exports.createRunManyDynamicOutputRenderer = createRunManyDynamicOutputRenderer;
|
|
322
321
|
function writeCompletedTaskResultLine(line) {
|
|
323
322
|
output_1.output.overwriteLine(LEFT_PAD + line);
|
|
324
323
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createRunOneDynamicOutputRenderer =
|
|
3
|
+
exports.createRunOneDynamicOutputRenderer = createRunOneDynamicOutputRenderer;
|
|
4
4
|
const cliCursor = require("cli-cursor");
|
|
5
5
|
const cli_spinners_1 = require("cli-spinners");
|
|
6
6
|
const os_1 = require("os");
|
|
@@ -226,4 +226,3 @@ async function createRunOneDynamicOutputRenderer({ initiatingProject, tasks, arg
|
|
|
226
226
|
};
|
|
227
227
|
return { lifeCycle, renderIsDone };
|
|
228
228
|
}
|
|
229
|
-
exports.createRunOneDynamicOutputRenderer = createRunOneDynamicOutputRenderer;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.formatFlags = formatFlags;
|
|
4
|
+
exports.formatTargetsAndProjects = formatTargetsAndProjects;
|
|
4
5
|
const output_1 = require("../../utils/output");
|
|
5
6
|
function formatFlags(leftPadding, flag, value) {
|
|
6
7
|
return flag == '_'
|
|
7
8
|
? `${leftPadding} ${value.join(' ')}`
|
|
8
9
|
: `${leftPadding} --${flag}=${formatValue(value)}`;
|
|
9
10
|
}
|
|
10
|
-
exports.formatFlags = formatFlags;
|
|
11
11
|
function formatValue(value) {
|
|
12
12
|
if (Array.isArray(value)) {
|
|
13
13
|
return `[${value.join(',')}]`;
|
|
@@ -41,4 +41,3 @@ function formatTargetsAndProjects(projectNames, targets, tasks) {
|
|
|
41
41
|
}
|
|
42
42
|
return text;
|
|
43
43
|
}
|
|
44
|
-
exports.formatTargetsAndProjects = formatTargetsAndProjects;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* All credit to https://github.com/jonschlinkert/pretty-time
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.prettyTime =
|
|
6
|
+
exports.prettyTime = prettyTime;
|
|
7
7
|
const nano = (time) => +time[0] * 1e9 + +time[1];
|
|
8
8
|
const scale = {
|
|
9
9
|
w: 6048e11,
|
|
@@ -71,4 +71,3 @@ function prettyTime(time, smallest, digits) {
|
|
|
71
71
|
}
|
|
72
72
|
return res.trim();
|
|
73
73
|
}
|
|
74
|
-
exports.prettyTime = prettyTime;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.viewLogsFooterRows =
|
|
3
|
+
exports.viewLogsFooterRows = viewLogsFooterRows;
|
|
4
4
|
const nx_json_1 = require("../../config/nx-json");
|
|
5
5
|
const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
|
|
6
6
|
const output_1 = require("../../utils/output");
|
|
@@ -13,4 +13,3 @@ function viewLogsFooterRows(failedTasks) {
|
|
|
13
13
|
return [];
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
exports.viewLogsFooterRows = viewLogsFooterRows;
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
* * channel = getPseudoIpcChannel(process.env.NX_IPC_CHANNEL_ID)
|
|
17
17
|
* * forkChildProcess.on('message', writeToPseudoIpcChannel)
|
|
18
18
|
*/
|
|
19
|
-
/// <reference types="node" />
|
|
20
19
|
import { Serializable } from 'child_process';
|
|
21
20
|
export interface PseudoIPCMessage {
|
|
22
21
|
type: 'TO_CHILDREN_FROM_PARENT' | 'TO_PARENT_FROM_CHILDREN' | 'CHILD_READY';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PseudoTtyProcessWithSend = exports.PseudoTtyProcess = exports.PseudoTerminal =
|
|
3
|
+
exports.PseudoTtyProcessWithSend = exports.PseudoTtyProcess = exports.PseudoTerminal = void 0;
|
|
4
|
+
exports.getPseudoTerminal = getPseudoTerminal;
|
|
4
5
|
const native_1 = require("../native");
|
|
5
6
|
const pseudo_ipc_1 = require("./pseudo-ipc");
|
|
6
7
|
const socket_utils_1 = require("../daemon/socket-utils");
|
|
@@ -13,7 +14,6 @@ function getPseudoTerminal(skipSupportCheck = false) {
|
|
|
13
14
|
pseudoTerminal ??= new PseudoTerminal(new native_1.RustPseudoTerminal());
|
|
14
15
|
return pseudoTerminal;
|
|
15
16
|
}
|
|
16
|
-
exports.getPseudoTerminal = getPseudoTerminal;
|
|
17
17
|
class PseudoTerminal {
|
|
18
18
|
static isSupported() {
|
|
19
19
|
return process.stdout.isTTY && supportedPtyPlatform();
|
|
@@ -139,6 +139,9 @@ function messageToCode(message) {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
function supportedPtyPlatform() {
|
|
142
|
+
if (native_1.IS_WASM) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
142
145
|
if (process.platform !== 'win32') {
|
|
143
146
|
return true;
|
|
144
147
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.runCommand = runCommand;
|
|
4
|
+
exports.invokeTasksRunner = invokeTasksRunner;
|
|
5
|
+
exports.getRunner = getRunner;
|
|
6
|
+
exports.getRunnerOptions = getRunnerOptions;
|
|
4
7
|
const path_1 = require("path");
|
|
5
8
|
const workspace_root_1 = require("../utils/workspace-root");
|
|
6
9
|
const fileutils_1 = require("../utils/fileutils");
|
|
@@ -103,7 +106,6 @@ async function runCommand(projectsToRun, projectGraph, { nxJson }, nxArgs, overr
|
|
|
103
106
|
});
|
|
104
107
|
return status;
|
|
105
108
|
}
|
|
106
|
-
exports.runCommand = runCommand;
|
|
107
109
|
function setEnvVarsBasedOnArgs(nxArgs, loadDotEnvFiles) {
|
|
108
110
|
if (nxArgs.outputStyle == 'stream' ||
|
|
109
111
|
process.env.NX_BATCH_MODE === 'true' ||
|
|
@@ -195,7 +197,6 @@ async function invokeTasksRunner({ tasks, projectGraph, taskGraph, lifeCycle, nx
|
|
|
195
197
|
}
|
|
196
198
|
return anyFailures ? 1 : 0;
|
|
197
199
|
}
|
|
198
|
-
exports.invokeTasksRunner = invokeTasksRunner;
|
|
199
200
|
function constructLifeCycles(lifeCycle) {
|
|
200
201
|
const lifeCycles = [];
|
|
201
202
|
lifeCycles.push(new store_run_information_life_cycle_1.StoreRunInformationLifeCycle());
|
|
@@ -298,7 +299,6 @@ function getRunner(nxArgs, nxJson) {
|
|
|
298
299
|
throw new Error(`Could not find runner configuration for ${runner}`);
|
|
299
300
|
}
|
|
300
301
|
}
|
|
301
|
-
exports.getRunner = getRunner;
|
|
302
302
|
function getTasksRunnerPath(runner, nxJson) {
|
|
303
303
|
let modulePath = nxJson.tasksRunnerOptions?.[runner]?.runner;
|
|
304
304
|
if (modulePath) {
|
|
@@ -355,4 +355,3 @@ function getRunnerOptions(runner, nxJson, nxArgs, isCloudDefault) {
|
|
|
355
355
|
}
|
|
356
356
|
return result;
|
|
357
357
|
}
|
|
358
|
-
exports.getRunnerOptions = getRunnerOptions;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Task } from '../config/task-graph';
|
|
3
2
|
export declare function getEnvVariablesForBatchProcess(skipNxCache: boolean, captureStderr: boolean): NodeJS.ProcessEnv;
|
|
4
3
|
export declare function getTaskSpecificEnv(task: Task): NodeJS.ProcessEnv;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getEnvVariablesForBatchProcess = getEnvVariablesForBatchProcess;
|
|
4
|
+
exports.getTaskSpecificEnv = getTaskSpecificEnv;
|
|
5
|
+
exports.getEnvVariablesForTask = getEnvVariablesForTask;
|
|
6
|
+
exports.loadAndExpandDotEnvFile = loadAndExpandDotEnvFile;
|
|
7
|
+
exports.unloadDotEnvFile = unloadDotEnvFile;
|
|
4
8
|
const dotenv_1 = require("dotenv");
|
|
5
9
|
const dotenv_expand_1 = require("dotenv-expand");
|
|
6
10
|
const workspace_root_1 = require("../utils/workspace-root");
|
|
@@ -12,7 +16,6 @@ function getEnvVariablesForBatchProcess(skipNxCache, captureStderr) {
|
|
|
12
16
|
...getNxEnvVariablesForForkedProcess(process.env.FORCE_COLOR === undefined ? 'true' : process.env.FORCE_COLOR, skipNxCache, captureStderr),
|
|
13
17
|
};
|
|
14
18
|
}
|
|
15
|
-
exports.getEnvVariablesForBatchProcess = getEnvVariablesForBatchProcess;
|
|
16
19
|
function getTaskSpecificEnv(task) {
|
|
17
20
|
// Unload any dot env files at the root of the workspace that were loaded on init of Nx.
|
|
18
21
|
const taskEnv = unloadDotEnvFiles({ ...process.env });
|
|
@@ -21,7 +24,6 @@ function getTaskSpecificEnv(task) {
|
|
|
21
24
|
: // If not loading dot env files, ensure env vars created by system are still loaded
|
|
22
25
|
taskEnv;
|
|
23
26
|
}
|
|
24
|
-
exports.getTaskSpecificEnv = getTaskSpecificEnv;
|
|
25
27
|
function getEnvVariablesForTask(task, taskSpecificEnv, forceColor, skipNxCache, captureStderr, outputPath, streamOutput) {
|
|
26
28
|
const res = {
|
|
27
29
|
// Start With Dotenv Variables
|
|
@@ -39,7 +41,6 @@ function getEnvVariablesForTask(task, taskSpecificEnv, forceColor, skipNxCache,
|
|
|
39
41
|
delete res.NX_SET_CLI;
|
|
40
42
|
return res;
|
|
41
43
|
}
|
|
42
|
-
exports.getEnvVariablesForTask = getEnvVariablesForTask;
|
|
43
44
|
function getNxEnvVariablesForForkedProcess(forceColor, skipNxCache, captureStderr, outputPath, streamOutput) {
|
|
44
45
|
const env = {
|
|
45
46
|
FORCE_COLOR: forceColor,
|
|
@@ -92,7 +93,6 @@ function loadAndExpandDotEnvFile(filename, environmentVariables, override = fals
|
|
|
92
93
|
processEnv: environmentVariables,
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
|
-
exports.loadAndExpandDotEnvFile = loadAndExpandDotEnvFile;
|
|
96
96
|
/**
|
|
97
97
|
* This function unloads a .env file and removes the variables in it from the environmentVariables.
|
|
98
98
|
* @param filename
|
|
@@ -107,7 +107,6 @@ function unloadDotEnvFile(filename, environmentVariables, override = false) {
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
exports.unloadDotEnvFile = unloadDotEnvFile;
|
|
111
110
|
function getEnvFilesForTask(task) {
|
|
112
111
|
// Collect dot env files that may pertain to a task
|
|
113
112
|
return [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.findCycle = findCycle;
|
|
4
|
+
exports.makeAcyclic = makeAcyclic;
|
|
4
5
|
function _findCycle(graph, id, visited, path) {
|
|
5
6
|
if (visited[id])
|
|
6
7
|
return null;
|
|
@@ -26,7 +27,6 @@ function findCycle(graph) {
|
|
|
26
27
|
}
|
|
27
28
|
return null;
|
|
28
29
|
}
|
|
29
|
-
exports.findCycle = findCycle;
|
|
30
30
|
function _makeAcyclic(graph, id, visited, path) {
|
|
31
31
|
if (visited[id])
|
|
32
32
|
return;
|
|
@@ -52,4 +52,3 @@ function makeAcyclic(graph) {
|
|
|
52
52
|
}
|
|
53
53
|
graph.roots = Object.keys(graph.dependencies).filter((t) => graph.dependencies[t].length === 0);
|
|
54
54
|
}
|
|
55
|
-
exports.makeAcyclic = makeAcyclic;
|