@convesoft/nx-rust 0.0.0 → 1.0.0-rc.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/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +47 -1
- package/executors.json +35 -0
- package/generators.json +19 -0
- package/package.json +17 -4
- package/src/cargo/build-settings.d.ts +54 -0
- package/src/cargo/build-settings.js +93 -0
- package/src/cargo/build-settings.js.map +1 -0
- package/src/cargo/configured-runner.d.ts +36 -0
- package/src/cargo/configured-runner.js +99 -0
- package/src/cargo/configured-runner.js.map +1 -0
- package/src/cargo/configured-tools.d.ts +35 -0
- package/src/cargo/configured-tools.js +46 -0
- package/src/cargo/configured-tools.js.map +1 -0
- package/src/cargo/dep-info-basedir.d.ts +18 -0
- package/src/cargo/dep-info-basedir.js +38 -0
- package/src/cargo/dep-info-basedir.js.map +1 -0
- package/src/cargo/directories.d.ts +40 -0
- package/src/cargo/directories.js +89 -0
- package/src/cargo/directories.js.map +1 -0
- package/src/cargo/host-triple.d.ts +7 -0
- package/src/cargo/host-triple.js +21 -0
- package/src/cargo/host-triple.js.map +1 -0
- package/src/cargo/lockfile.d.ts +63 -0
- package/src/cargo/lockfile.js +157 -0
- package/src/cargo/lockfile.js.map +1 -0
- package/src/cargo/metadata.d.ts +112 -0
- package/src/cargo/metadata.js +37 -0
- package/src/cargo/metadata.js.map +1 -0
- package/src/cargo/package-specs.d.ts +54 -0
- package/src/cargo/package-specs.js +109 -0
- package/src/cargo/package-specs.js.map +1 -0
- package/src/cargo/paths-crates.d.ts +27 -0
- package/src/cargo/paths-crates.js +69 -0
- package/src/cargo/paths-crates.js.map +1 -0
- package/src/cargo/print-artifact-folders.d.ts +1 -0
- package/src/cargo/print-artifact-folders.js +58 -0
- package/src/cargo/print-artifact-folders.js.map +1 -0
- package/src/cargo/redirections.d.ts +87 -0
- package/src/cargo/redirections.js +195 -0
- package/src/cargo/redirections.js.map +1 -0
- package/src/cargo/run-cargo.d.ts +31 -0
- package/src/cargo/run-cargo.js +75 -0
- package/src/cargo/run-cargo.js.map +1 -0
- package/src/cargo/target-triples.d.ts +98 -0
- package/src/cargo/target-triples.js +265 -0
- package/src/cargo/target-triples.js.map +1 -0
- package/src/cargo/version-req.d.ts +12 -0
- package/src/cargo/version-req.js +122 -0
- package/src/cargo/version-req.js.map +1 -0
- package/src/compatibility/cargo-version.d.ts +43 -0
- package/src/compatibility/cargo-version.js +83 -0
- package/src/compatibility/cargo-version.js.map +1 -0
- package/src/compatibility/nx-bridge.d.ts +312 -0
- package/src/compatibility/nx-bridge.js +407 -0
- package/src/compatibility/nx-bridge.js.map +1 -0
- package/src/compatibility/nx-version.d.ts +104 -0
- package/src/compatibility/nx-version.js +272 -0
- package/src/compatibility/nx-version.js.map +1 -0
- package/src/executors/affected-inputs.d.ts +29 -0
- package/src/executors/affected-inputs.js +259 -0
- package/src/executors/affected-inputs.js.map +1 -0
- package/src/executors/affected-run.d.ts +54 -0
- package/src/executors/affected-run.js +394 -0
- package/src/executors/affected-run.js.map +1 -0
- package/src/executors/affected.d.ts +239 -0
- package/src/executors/affected.js +589 -0
- package/src/executors/affected.js.map +1 -0
- package/src/executors/baseline-context.d.ts +85 -0
- package/src/executors/baseline-context.js +227 -0
- package/src/executors/baseline-context.js.map +1 -0
- package/src/executors/baseline.d.ts +123 -0
- package/src/executors/baseline.js +356 -0
- package/src/executors/baseline.js.map +1 -0
- package/src/executors/batch.d.ts +75 -0
- package/src/executors/batch.js +434 -0
- package/src/executors/batch.js.map +1 -0
- package/src/executors/build-records.d.ts +110 -0
- package/src/executors/build-records.js +267 -0
- package/src/executors/build-records.js.map +1 -0
- package/src/executors/cargo/executor.d.ts +28 -0
- package/src/executors/cargo/executor.js +58 -0
- package/src/executors/cargo/executor.js.map +1 -0
- package/src/executors/cargo/schema.json +54 -0
- package/src/executors/cargo-invocation.d.ts +81 -0
- package/src/executors/cargo-invocation.js +109 -0
- package/src/executors/cargo-invocation.js.map +1 -0
- package/src/executors/cargo-output.d.ts +212 -0
- package/src/executors/cargo-output.js +646 -0
- package/src/executors/cargo-output.js.map +1 -0
- package/src/executors/command.d.ts +318 -0
- package/src/executors/command.js +517 -0
- package/src/executors/command.js.map +1 -0
- package/src/executors/coverage-baseline.d.ts +23 -0
- package/src/executors/coverage-baseline.js +284 -0
- package/src/executors/coverage-baseline.js.map +1 -0
- package/src/executors/declared-options.d.ts +21 -0
- package/src/executors/declared-options.js +58 -0
- package/src/executors/declared-options.js.map +1 -0
- package/src/executors/digests.d.ts +94 -0
- package/src/executors/digests.js +190 -0
- package/src/executors/digests.js.map +1 -0
- package/src/executors/dotenv-check.d.ts +79 -0
- package/src/executors/dotenv-check.js +553 -0
- package/src/executors/dotenv-check.js.map +1 -0
- package/src/executors/group-invocations.d.ts +80 -0
- package/src/executors/group-invocations.js +253 -0
- package/src/executors/group-invocations.js.map +1 -0
- package/src/executors/group-run.d.ts +114 -0
- package/src/executors/group-run.js +591 -0
- package/src/executors/group-run.js.map +1 -0
- package/src/executors/groups.d.ts +113 -0
- package/src/executors/groups.js +285 -0
- package/src/executors/groups.js.map +1 -0
- package/src/executors/input-check.d.ts +52 -0
- package/src/executors/input-check.js +271 -0
- package/src/executors/input-check.js.map +1 -0
- package/src/executors/kept-files.d.ts +98 -0
- package/src/executors/kept-files.js +341 -0
- package/src/executors/kept-files.js.map +1 -0
- package/src/executors/lockfile/executor.d.ts +16 -0
- package/src/executors/lockfile/executor.js +37 -0
- package/src/executors/lockfile/executor.js.map +1 -0
- package/src/executors/lockfile/schema.json +50 -0
- package/src/executors/napi-build.d.ts +73 -0
- package/src/executors/napi-build.js +420 -0
- package/src/executors/napi-build.js.map +1 -0
- package/src/executors/nextest.d.ts +185 -0
- package/src/executors/nextest.js +498 -0
- package/src/executors/nextest.js.map +1 -0
- package/src/executors/nx-command.d.ts +95 -0
- package/src/executors/nx-command.js +205 -0
- package/src/executors/nx-command.js.map +1 -0
- package/src/executors/nx-task-files.d.ts +82 -0
- package/src/executors/nx-task-files.js +156 -0
- package/src/executors/nx-task-files.js.map +1 -0
- package/src/executors/print-test-mode.d.ts +1 -0
- package/src/executors/print-test-mode.js +25 -0
- package/src/executors/print-test-mode.js.map +1 -0
- package/src/executors/release-publish/executor.d.ts +24 -0
- package/src/executors/release-publish/executor.js +165 -0
- package/src/executors/release-publish/executor.js.map +1 -0
- package/src/executors/release-publish/schema.json +30 -0
- package/src/executors/run/executor.d.ts +12 -0
- package/src/executors/run/executor.js +27 -0
- package/src/executors/run/executor.js.map +1 -0
- package/src/executors/run/schema.json +45 -0
- package/src/executors/runner-script.d.ts +12 -0
- package/src/executors/runner-script.js +22 -0
- package/src/executors/runner-script.js.map +1 -0
- package/src/executors/runtime-input-check.d.ts +24 -0
- package/src/executors/runtime-input-check.js +87 -0
- package/src/executors/runtime-input-check.js.map +1 -0
- package/src/executors/shared-artifacts.d.ts +44 -0
- package/src/executors/shared-artifacts.js +132 -0
- package/src/executors/shared-artifacts.js.map +1 -0
- package/src/executors/split-words.d.ts +24 -0
- package/src/executors/split-words.js +111 -0
- package/src/executors/split-words.js.map +1 -0
- package/src/executors/stage.d.ts +163 -0
- package/src/executors/stage.js +526 -0
- package/src/executors/stage.js.map +1 -0
- package/src/executors/staged-run.d.ts +24 -0
- package/src/executors/staged-run.js +110 -0
- package/src/executors/staged-run.js.map +1 -0
- package/src/executors/task-env.d.ts +271 -0
- package/src/executors/task-env.js +494 -0
- package/src/executors/task-env.js.map +1 -0
- package/src/executors/task-execution.d.ts +61 -0
- package/src/executors/task-execution.js +122 -0
- package/src/executors/task-execution.js.map +1 -0
- package/src/executors/task-guards.d.ts +112 -0
- package/src/executors/task-guards.js +430 -0
- package/src/executors/task-guards.js.map +1 -0
- package/src/executors/task-options.d.ts +114 -0
- package/src/executors/task-options.js +258 -0
- package/src/executors/task-options.js.map +1 -0
- package/src/executors/task.d.ts +166 -0
- package/src/executors/task.js +520 -0
- package/src/executors/task.js.map +1 -0
- package/src/executors/test-mode.d.ts +182 -0
- package/src/executors/test-mode.js +391 -0
- package/src/executors/test-mode.js.map +1 -0
- package/src/executors/test-runner.d.ts +44 -0
- package/src/executors/test-runner.js +159 -0
- package/src/executors/test-runner.js.map +1 -0
- package/src/executors/test-steps.d.ts +109 -0
- package/src/executors/test-steps.js +535 -0
- package/src/executors/test-steps.js.map +1 -0
- package/src/executors/wasm-build.d.ts +56 -0
- package/src/executors/wasm-build.js +216 -0
- package/src/executors/wasm-build.js.map +1 -0
- package/src/generators/crate/binary.schema.json +28 -0
- package/src/generators/crate/crate.d.ts +24 -0
- package/src/generators/crate/crate.js +108 -0
- package/src/generators/crate/crate.js.map +1 -0
- package/src/generators/crate/enclosing-workspace.d.ts +25 -0
- package/src/generators/crate/enclosing-workspace.js +58 -0
- package/src/generators/crate/enclosing-workspace.js.map +1 -0
- package/src/generators/crate/library.schema.json +28 -0
- package/src/generators/init/graph-check.d.ts +81 -0
- package/src/generators/init/graph-check.js +299 -0
- package/src/generators/init/graph-check.js.map +1 -0
- package/src/generators/init/init.d.ts +23 -0
- package/src/generators/init/init.js +113 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/report.d.ts +19 -0
- package/src/generators/init/report.js +93 -0
- package/src/generators/init/report.js.map +1 -0
- package/src/generators/init/schema.json +9 -0
- package/src/graph/artifact-kinds.d.ts +29 -0
- package/src/graph/artifact-kinds.js +50 -0
- package/src/graph/artifact-kinds.js.map +1 -0
- package/src/graph/artifact-names.d.ts +97 -0
- package/src/graph/artifact-names.js +276 -0
- package/src/graph/artifact-names.js.map +1 -0
- package/src/graph/build-records.d.ts +74 -0
- package/src/graph/build-records.js +104 -0
- package/src/graph/build-records.js.map +1 -0
- package/src/graph/caching.d.ts +148 -0
- package/src/graph/caching.js +676 -0
- package/src/graph/caching.js.map +1 -0
- package/src/graph/collisions.d.ts +106 -0
- package/src/graph/collisions.js +156 -0
- package/src/graph/collisions.js.map +1 -0
- package/src/graph/computation-reports.d.ts +89 -0
- package/src/graph/computation-reports.js +216 -0
- package/src/graph/computation-reports.js.map +1 -0
- package/src/graph/declared-files.d.ts +190 -0
- package/src/graph/declared-files.js +600 -0
- package/src/graph/declared-files.js.map +1 -0
- package/src/graph/discovery.d.ts +175 -0
- package/src/graph/discovery.js +656 -0
- package/src/graph/discovery.js.map +1 -0
- package/src/graph/edges.d.ts +25 -0
- package/src/graph/edges.js +94 -0
- package/src/graph/edges.js.map +1 -0
- package/src/graph/entries.d.ts +83 -0
- package/src/graph/entries.js +259 -0
- package/src/graph/entries.js.map +1 -0
- package/src/graph/inputs.d.ts +420 -0
- package/src/graph/inputs.js +746 -0
- package/src/graph/inputs.js.map +1 -0
- package/src/graph/lockfile-task.d.ts +74 -0
- package/src/graph/lockfile-task.js +105 -0
- package/src/graph/lockfile-task.js.map +1 -0
- package/src/graph/names.d.ts +41 -0
- package/src/graph/names.js +34 -0
- package/src/graph/names.js.map +1 -0
- package/src/graph/napi.d.ts +107 -0
- package/src/graph/napi.js +206 -0
- package/src/graph/napi.js.map +1 -0
- package/src/graph/nx-glob.d.ts +36 -0
- package/src/graph/nx-glob.js +152 -0
- package/src/graph/nx-glob.js.map +1 -0
- package/src/graph/nx-internals.d.ts +57 -0
- package/src/graph/nx-internals.js +128 -0
- package/src/graph/nx-internals.js.map +1 -0
- package/src/graph/options.d.ts +32 -0
- package/src/graph/options.js +80 -0
- package/src/graph/options.js.map +1 -0
- package/src/graph/outputs.d.ts +75 -0
- package/src/graph/outputs.js +140 -0
- package/src/graph/outputs.js.map +1 -0
- package/src/graph/path-dependencies.d.ts +122 -0
- package/src/graph/path-dependencies.js +459 -0
- package/src/graph/path-dependencies.js.map +1 -0
- package/src/graph/plugin-package.d.ts +36 -0
- package/src/graph/plugin-package.js +132 -0
- package/src/graph/plugin-package.js.map +1 -0
- package/src/graph/plugin-version.d.ts +20 -0
- package/src/graph/plugin-version.js +153 -0
- package/src/graph/plugin-version.js.map +1 -0
- package/src/graph/projects.d.ts +141 -0
- package/src/graph/projects.js +182 -0
- package/src/graph/projects.js.map +1 -0
- package/src/graph/reached-projects.d.ts +46 -0
- package/src/graph/reached-projects.js +102 -0
- package/src/graph/reached-projects.js.map +1 -0
- package/src/graph/real-path.d.ts +47 -0
- package/src/graph/real-path.js +113 -0
- package/src/graph/real-path.js.map +1 -0
- package/src/graph/redirected-uses.d.ts +98 -0
- package/src/graph/redirected-uses.js +434 -0
- package/src/graph/redirected-uses.js.map +1 -0
- package/src/graph/registration.d.ts +121 -0
- package/src/graph/registration.js +233 -0
- package/src/graph/registration.js.map +1 -0
- package/src/graph/script-input.d.ts +46 -0
- package/src/graph/script-input.js +65 -0
- package/src/graph/script-input.js.map +1 -0
- package/src/graph/settings.d.ts +178 -0
- package/src/graph/settings.js +479 -0
- package/src/graph/settings.js.map +1 -0
- package/src/graph/target-defaults-causes.d.ts +33 -0
- package/src/graph/target-defaults-causes.js +202 -0
- package/src/graph/target-defaults-causes.js.map +1 -0
- package/src/graph/target-defaults-layers.d.ts +186 -0
- package/src/graph/target-defaults-layers.js +420 -0
- package/src/graph/target-defaults-layers.js.map +1 -0
- package/src/graph/target-defaults-meaning.d.ts +95 -0
- package/src/graph/target-defaults-meaning.js +292 -0
- package/src/graph/target-defaults-meaning.js.map +1 -0
- package/src/graph/target-defaults-report.d.ts +77 -0
- package/src/graph/target-defaults-report.js +242 -0
- package/src/graph/target-defaults-report.js.map +1 -0
- package/src/graph/target-defaults.d.ts +79 -0
- package/src/graph/target-defaults.js +425 -0
- package/src/graph/target-defaults.js.map +1 -0
- package/src/graph/target-fields.d.ts +16 -0
- package/src/graph/target-fields.js +134 -0
- package/src/graph/target-fields.js.map +1 -0
- package/src/graph/target-tables.d.ts +45 -0
- package/src/graph/target-tables.js +299 -0
- package/src/graph/target-tables.js.map +1 -0
- package/src/graph/targets.d.ts +367 -0
- package/src/graph/targets.js +404 -0
- package/src/graph/targets.js.map +1 -0
- package/src/graph/unification.d.ts +141 -0
- package/src/graph/unification.js +459 -0
- package/src/graph/unification.js.map +1 -0
- package/src/graph/unignored-directories.d.ts +25 -0
- package/src/graph/unignored-directories.js +89 -0
- package/src/graph/unignored-directories.js.map +1 -0
- package/src/graph/visibility.d.ts +17 -0
- package/src/graph/visibility.js +67 -0
- package/src/graph/visibility.js.map +1 -0
- package/src/graph/warnings.d.ts +38 -0
- package/src/graph/warnings.js +77 -0
- package/src/graph/warnings.js.map +1 -0
- package/src/graph/wasm.d.ts +56 -0
- package/src/graph/wasm.js +77 -0
- package/src/graph/wasm.js.map +1 -0
- package/src/index.d.ts +68 -0
- package/src/index.js +109 -0
- package/src/index.js.map +1 -0
- package/src/release/manifests.d.ts +95 -0
- package/src/release/manifests.js +164 -0
- package/src/release/manifests.js.map +1 -0
- package/src/release/places.d.ts +127 -0
- package/src/release/places.js +368 -0
- package/src/release/places.js.map +1 -0
- package/src/release/publish-cargo.d.ts +177 -0
- package/src/release/publish-cargo.js +351 -0
- package/src/release/publish-cargo.js.map +1 -0
- package/src/release/publish-crates.d.ts +124 -0
- package/src/release/publish-crates.js +242 -0
- package/src/release/publish-crates.js.map +1 -0
- package/src/release/publish-environments.d.ts +50 -0
- package/src/release/publish-environments.js +284 -0
- package/src/release/publish-environments.js.map +1 -0
- package/src/release/publish-messages.d.ts +66 -0
- package/src/release/publish-messages.js +273 -0
- package/src/release/publish-messages.js.map +1 -0
- package/src/release/publish-registry.d.ts +27 -0
- package/src/release/publish-registry.js +135 -0
- package/src/release/publish-registry.js.map +1 -0
- package/src/release/publish-settings.d.ts +26 -0
- package/src/release/publish-settings.js +56 -0
- package/src/release/publish-settings.js.map +1 -0
- package/src/release/publish.d.ts +59 -0
- package/src/release/publish.js +620 -0
- package/src/release/publish.js.map +1 -0
- package/src/release/repository.d.ts +73 -0
- package/src/release/repository.js +219 -0
- package/src/release/repository.js.map +1 -0
- package/src/release/requirements.d.ts +34 -0
- package/src/release/requirements.js +30 -0
- package/src/release/requirements.js.map +1 -0
- package/src/release/toml-edit.d.ts +67 -0
- package/src/release/toml-edit.js +453 -0
- package/src/release/toml-edit.js.map +1 -0
- package/src/release/version-actions.d.ts +133 -0
- package/src/release/version-actions.js +474 -0
- package/src/release/version-actions.js.map +1 -0
- package/src/release/version-checks.d.ts +21 -0
- package/src/release/version-checks.js +151 -0
- package/src/release/version-checks.js.map +1 -0
- package/src/release/version-lockfiles.d.ts +61 -0
- package/src/release/version-lockfiles.js +222 -0
- package/src/release/version-lockfiles.js.map +1 -0
- package/src/tools/napi-cli.d.ts +70 -0
- package/src/tools/napi-cli.js +63 -0
- package/src/tools/napi-cli.js.map +1 -0
- package/src/tools/optional-tools.d.ts +121 -0
- package/src/tools/optional-tools.js +303 -0
- package/src/tools/optional-tools.js.map +1 -0
- package/src/tools/print-napi-cli.d.ts +1 -0
- package/src/tools/print-napi-cli.js +24 -0
- package/src/tools/print-napi-cli.js.map +1 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.targetDefaultCauses = targetDefaultCauses;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const target_defaults_layers_1 = require("./target-defaults-layers");
|
|
8
|
+
/**
|
|
9
|
+
* What the `targetDefaults` of `nx.json` add to the `dependsOn` of each
|
|
10
|
+
* project's inferred targets, as far as `createNodes` can see it: the
|
|
11
|
+
* cause of the warning of `DES-TARGET-DEFAULT-GUARD` for an entry that adds
|
|
12
|
+
* dependencies on other projects' tasks, which the digest of the project's
|
|
13
|
+
* warnings covers (`DES-DIAGNOSTICS`, "Warnings where they are seen").
|
|
14
|
+
* `createDependencies` finds the warning itself, once Nx has merged the
|
|
15
|
+
* projects of every plugin, too late to change a key.
|
|
16
|
+
*
|
|
17
|
+
* The inferred targets are rebuilt as `findTargetDefaultChanges`
|
|
18
|
+
* rebuilds them, from the layers that `createNodes` sees: the projects of
|
|
19
|
+
* this entry, the elements of `targetDefaults` that Nx's synthesis lays over
|
|
20
|
+
* them, once for each plugin that may be the source of the targets, which
|
|
21
|
+
* `createNodes` cannot see either ({@link otherSourcePlugins}), and what
|
|
22
|
+
* Nx's default plugins make of the `package.json` and `project.json` on disk
|
|
23
|
+
* in each project's folder. A `dependsOn` entry counts where a rebuild with
|
|
24
|
+
* the `targetDefaults` layer has it and the rebuild without it does not,
|
|
25
|
+
* unless its form shows that it reaches only the project's own tasks
|
|
26
|
+
* ({@link reachesOnlyOwnTasks}). An element whose filter names a tag, which
|
|
27
|
+
* `createNodes` cannot decide, counts wherever its key can reach the target
|
|
28
|
+
* ({@link undecidedCauses}). A target whose executor the folder's files
|
|
29
|
+
* replace is left out, as the check leaves it, and so is an extra target.
|
|
30
|
+
* Nothing is loaded without an entry that sets `dependsOn`; where Nx lacks
|
|
31
|
+
* the internal parts, nothing counts, and `createDependencies` fails graph
|
|
32
|
+
* creation where such an entry changes a target of the plugin.
|
|
33
|
+
*
|
|
34
|
+
* @returns By project root, one line for each target that entries add such
|
|
35
|
+
* dependencies to, naming the target, the entry and what it adds.
|
|
36
|
+
*/
|
|
37
|
+
// @mara implements DES-TARGET-DEFAULT-GUARD
|
|
38
|
+
function targetDefaultCauses(projects_1, nxJson_1, workspaceRoot_1) {
|
|
39
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (projects, nxJson, workspaceRoot, loadInternals = () => (0, target_defaults_layers_1.loadTargetDefaultsInternals)(workspaceRoot)) {
|
|
40
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
41
|
+
const causes = new Map();
|
|
42
|
+
const targetDefaults = nxJson === null || nxJson === void 0 ? void 0 : nxJson.targetDefaults;
|
|
43
|
+
if (projects.length === 0 ||
|
|
44
|
+
!(0, target_defaults_layers_1.isRecord)(targetDefaults) ||
|
|
45
|
+
!Object.values(targetDefaults).some(setsDependsOn)) {
|
|
46
|
+
return causes;
|
|
47
|
+
}
|
|
48
|
+
let nx;
|
|
49
|
+
try {
|
|
50
|
+
nx = loadInternals();
|
|
51
|
+
}
|
|
52
|
+
catch (_h) {
|
|
53
|
+
return causes;
|
|
54
|
+
}
|
|
55
|
+
const roots = projects.map(({ root }) => root);
|
|
56
|
+
const files = [
|
|
57
|
+
...new Set([
|
|
58
|
+
...roots.flatMap((root) => ["package.json", "project.json"].map((name) => (root === "." ? name : `${root}/${name}`))),
|
|
59
|
+
"package.json",
|
|
60
|
+
]),
|
|
61
|
+
].filter((file) => (0, node_fs_1.existsSync)((0, node_path_1.join)(workspaceRoot, file)));
|
|
62
|
+
const context = {
|
|
63
|
+
projects: {},
|
|
64
|
+
nxJsonConfiguration: nxJson !== null && nxJson !== void 0 ? nxJson : {},
|
|
65
|
+
workspaceRoot,
|
|
66
|
+
fileMap: { projectFileMap: {}, nonProjectFiles: files.map((file) => ({ file, hash: "" })) },
|
|
67
|
+
};
|
|
68
|
+
const plugin = (0, target_defaults_layers_1.pluginEntryNameIn)(nxJson, workspaceRoot);
|
|
69
|
+
const layers = yield (0, target_defaults_layers_1.rebuildLayers)(nx, projects, plugin, context, roots, {
|
|
70
|
+
otherSources: (0, target_defaults_layers_1.otherSourcePlugins)(targetDefaults, plugin, nxJson !== null && nxJson !== void 0 ? nxJson : {}, workspaceRoot),
|
|
71
|
+
});
|
|
72
|
+
const applied = layers.mayApply.map((results) => (0, target_defaults_layers_1.appliedElements)(results, targetDefaults));
|
|
73
|
+
for (const project of projects) {
|
|
74
|
+
const withoutDefaults = (0, target_defaults_layers_1.rebuild)(nx, layers, project.root, undefined);
|
|
75
|
+
// For each plugin that may be the source of the project's targets.
|
|
76
|
+
const sources = layers.mayApply.map((results, index) => ({
|
|
77
|
+
rebuilt: (0, target_defaults_layers_1.rebuild)(nx, layers, project.root, results),
|
|
78
|
+
byTarget: applied[index].get(project.root),
|
|
79
|
+
}));
|
|
80
|
+
const [primary] = sources;
|
|
81
|
+
const names = [
|
|
82
|
+
project.name,
|
|
83
|
+
...(primary.rebuilt.name === undefined ? [] : [primary.rebuilt.name]),
|
|
84
|
+
];
|
|
85
|
+
const lines = new Set();
|
|
86
|
+
for (const [name, inferred] of Object.entries(project.targets).sort(([a], [b]) => (0, target_defaults_layers_1.compare)(a, b))) {
|
|
87
|
+
if (!(0, target_defaults_layers_1.isInferred)(inferred)) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
for (const { rebuilt, byTarget } of sources) {
|
|
91
|
+
const target = (_a = rebuilt.targets) === null || _a === void 0 ? void 0 : _a[name];
|
|
92
|
+
if (target === undefined || target.executor !== inferred.executor) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const entry = byTarget === null || byTarget === void 0 ? void 0 : byTarget.get(name);
|
|
96
|
+
if (entry !== undefined) {
|
|
97
|
+
const without = (_c = (_b = withoutDefaults.targets) === null || _b === void 0 ? void 0 : _b[name]) !== null && _c !== void 0 ? _c : {};
|
|
98
|
+
const added = ((_d = target.dependsOn) !== null && _d !== void 0 ? _d : []).filter((dependency) => dependency !== target_defaults_layers_1.spread &&
|
|
99
|
+
!(0, target_defaults_layers_1.includes)(without.dependsOn, dependency) &&
|
|
100
|
+
!reachesOnlyOwnTasks(dependency, names));
|
|
101
|
+
if (added.length > 0) {
|
|
102
|
+
lines.add((0, target_defaults_layers_1.canonical)({ target: name, key: entry.key, elements: (_e = entry.indices) !== null && _e !== void 0 ? _e : null, added }));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const target = (_f = primary.rebuilt.targets) === null || _f === void 0 ? void 0 : _f[name];
|
|
107
|
+
if (target === undefined || target.executor !== inferred.executor) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
for (const cause of undecidedCauses(targetDefaults, name, inferred.executor, (_g = primary.byTarget) === null || _g === void 0 ? void 0 : _g.get(name), names, nx)) {
|
|
111
|
+
lines.add((0, target_defaults_layers_1.canonical)(Object.assign({ target: name }, cause)));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (lines.size > 0) {
|
|
115
|
+
causes.set(project.root, [...lines]);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return causes;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The elements of `targetDefaults` whose `filter` `createNodes` cannot
|
|
123
|
+
* decide for a target, because its `projects` names a tag, which another
|
|
124
|
+
* plugin may give the project, and that add dependencies which may reach
|
|
125
|
+
* other projects' tasks: each counts as a cause for every target that its
|
|
126
|
+
* key can reach, by the target's executor, its name or a glob, unless Nx's
|
|
127
|
+
* synthesis applied it already. That errs towards a run without a warning,
|
|
128
|
+
* never towards a cache hit that shows an earlier state of the warning
|
|
129
|
+
* (`DES-TARGET-DEFAULT-GUARD`).
|
|
130
|
+
*
|
|
131
|
+
* @param applied The elements that Nx's synthesis laid over the target.
|
|
132
|
+
*/
|
|
133
|
+
function undecidedCauses(targetDefaults, target, executor, applied, names, nx) {
|
|
134
|
+
var _a;
|
|
135
|
+
const causes = [];
|
|
136
|
+
for (const [key, value] of Object.entries(targetDefaults)) {
|
|
137
|
+
if (!nx.keyMayApply(key, target, executor)) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const elements = Array.isArray(value)
|
|
141
|
+
? value.map((element, index) => [element, index])
|
|
142
|
+
: [[value, undefined]];
|
|
143
|
+
for (const [element, index] of elements) {
|
|
144
|
+
if (!(0, target_defaults_layers_1.isRecord)(element) || !namesTag(element.filter)) {
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
const appliedAlready = (applied === null || applied === void 0 ? void 0 : applied.key) === key &&
|
|
148
|
+
(index === undefined ? applied.indices === undefined : (_a = applied.indices) === null || _a === void 0 ? void 0 : _a.includes(index));
|
|
149
|
+
const dependsOn = Array.isArray(element.dependsOn) ? element.dependsOn : [];
|
|
150
|
+
const added = dependsOn.filter((dependency) => dependency !== target_defaults_layers_1.spread && !reachesOnlyOwnTasks(dependency, names));
|
|
151
|
+
if (!appliedAlready && added.length > 0) {
|
|
152
|
+
causes.push({ key, elements: index === undefined ? null : [index], added });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return causes;
|
|
157
|
+
}
|
|
158
|
+
// Whether an entry's filter selects projects by a tag, also through `!`,
|
|
159
|
+
// which `createNodes` cannot decide: another plugin may add the tag.
|
|
160
|
+
function namesTag(filter) {
|
|
161
|
+
if (!(0, target_defaults_layers_1.isRecord)(filter) || filter.projects === undefined) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
const patterns = Array.isArray(filter.projects) ? filter.projects : [filter.projects];
|
|
165
|
+
return patterns.some((pattern) => typeof pattern === "string" && /^!?tag:/.test(pattern));
|
|
166
|
+
}
|
|
167
|
+
// Whether a value of targetDefaults, an entry or a list of entries, sets dependsOn.
|
|
168
|
+
function setsDependsOn(value) {
|
|
169
|
+
return Array.isArray(value)
|
|
170
|
+
? value.some((element) => (0, target_defaults_layers_1.isRecord)(element) && "dependsOn" in element)
|
|
171
|
+
: (0, target_defaults_layers_1.isRecord)(value) && "dependsOn" in value;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Whether a `dependsOn` entry reaches only tasks of the project itself, as
|
|
175
|
+
* far as its form shows without the names of other plugins' projects: a
|
|
176
|
+
* target name without `^` and without another project before a colon, or
|
|
177
|
+
* an object without `dependencies: true` whose `projects` is absent,
|
|
178
|
+
* `"self"`, or only the project's own names.
|
|
179
|
+
*
|
|
180
|
+
* @param names The project's names: the one the plugin gives it, and the
|
|
181
|
+
* one that a file in its folder gives it.
|
|
182
|
+
*/
|
|
183
|
+
function reachesOnlyOwnTasks(dependency, names) {
|
|
184
|
+
if (typeof dependency === "string") {
|
|
185
|
+
if (dependency.startsWith("^")) {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
const colon = dependency.indexOf(":");
|
|
189
|
+
return colon === -1 || names.includes(dependency.slice(0, colon));
|
|
190
|
+
}
|
|
191
|
+
if (!(0, target_defaults_layers_1.isRecord)(dependency) || dependency.dependencies === true) {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
const projects = dependency.projects;
|
|
195
|
+
if (projects === undefined) {
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
const listed = typeof projects === "string" ? [projects] : projects;
|
|
199
|
+
return (Array.isArray(listed) &&
|
|
200
|
+
listed.every((name) => name === "self" || (typeof name === "string" && names.includes(name))));
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=target-defaults-causes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target-defaults-causes.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/target-defaults-causes.ts"],"names":[],"mappings":";;AAoDA,kDAqGC;;AAxJD,qCAAqC;AACrC,yCAAiC;AAEjC,qEAgBkC;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,4CAA4C;AAC5C,SAAsB,mBAAmB;iEACvC,QAAiC,EACjC,MAAuC,EACvC,aAAqB,EACrB,gBAA+C,GAAG,EAAE,CAAC,IAAA,oDAA2B,EAAC,aAAa,CAAC;;QAE/F,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;QAC3C,MAAM,cAAc,GAAY,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,CAAC;QACvD,IACE,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,CAAC,IAAA,iCAAQ,EAAC,cAAc,CAAC;YACzB,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAClD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,IAAI,EAA2B,CAAC;QAChC,IAAI,CAAC;YACH,EAAE,GAAG,aAAa,EAAE,CAAC;QACvB,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,KAAK,GAA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,GAAG,UAAU,CAAC,QAAQ,CAAC;IACrC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACpE,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QACrB,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAC9F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { CreateDependenciesContext, NxJsonConfiguration, ProjectConfiguration, TargetConfiguration } from "@nx/devkit";
|
|
2
|
+
import { type CargoProject } from "./projects";
|
|
3
|
+
/** A project as Nx's root maps hold it while it merges the layers of a project. */
|
|
4
|
+
export interface RootMapProject {
|
|
5
|
+
root: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
tags?: string[];
|
|
8
|
+
namedInputs?: Record<string, unknown[]>;
|
|
9
|
+
targets?: Record<string, TargetConfiguration>;
|
|
10
|
+
}
|
|
11
|
+
/** A project node that one of Nx's default plugins made of a file in the project's folder. */
|
|
12
|
+
export interface DefaultNode {
|
|
13
|
+
/** The `package.json` or `project.json`, relative to the repository root. */
|
|
14
|
+
file: string;
|
|
15
|
+
project: RootMapProject;
|
|
16
|
+
}
|
|
17
|
+
/** Nx's source maps: by project root, the file and plugin behind each key. */
|
|
18
|
+
export type SourceMaps = Record<string, Record<string, [string | null, string]>>;
|
|
19
|
+
/** A dependency as Nx's task graph normalises a `dependsOn` entry. */
|
|
20
|
+
export interface NormalisedDependency {
|
|
21
|
+
target?: string;
|
|
22
|
+
projects?: string[];
|
|
23
|
+
dependencies?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** The project graph, as far as Nx's normalisation of `dependsOn` reads it. */
|
|
26
|
+
export interface DependencyGraph {
|
|
27
|
+
nodes: Record<string, {
|
|
28
|
+
name: string;
|
|
29
|
+
type: string;
|
|
30
|
+
data: ProjectConfiguration;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The parts of the installed Nx that the check runs, so that it rebuilds a
|
|
35
|
+
* target as Nx does (`DES-TARGET-DEFAULT-GUARD`). None is public API.
|
|
36
|
+
*/
|
|
37
|
+
export interface TargetDefaultsInternals {
|
|
38
|
+
/**
|
|
39
|
+
* Nx's synthesis of target defaults: for each project root and target,
|
|
40
|
+
* the elements of `targetDefaults` that Nx lays over the target, each as
|
|
41
|
+
* one result whose file names the key and element, such as
|
|
42
|
+
* `nx.json#targetDefaults.build[1]`.
|
|
43
|
+
*/
|
|
44
|
+
createTargetDefaultsResults(specifiedPluginRootMap: Record<string, RootMapProject>, defaultPluginRootMap: Record<string, RootMapProject>, nxJson: {
|
|
45
|
+
targetDefaults?: unknown;
|
|
46
|
+
}, specifiedSourceMaps: SourceMaps): [string, string, {
|
|
47
|
+
projects?: Record<string, RootMapProject>;
|
|
48
|
+
}][];
|
|
49
|
+
/** Nx's merge of one project node into a root map, as graph creation merges every layer. */
|
|
50
|
+
mergeProject(rootMap: Record<string, RootMapProject>, project: RootMapProject, sourceMaps: SourceMaps | undefined, sourceInformation: [string | null, string] | undefined, deferSpreadsWithoutBase: boolean): void;
|
|
51
|
+
/**
|
|
52
|
+
* The project nodes that Nx's default plugins make of the `package.json`
|
|
53
|
+
* and `project.json` files given, each with its file, in the order in
|
|
54
|
+
* which Nx merges them.
|
|
55
|
+
*/
|
|
56
|
+
defaultNodes(files: string[], nxJson: object, workspaceRoot: string): Promise<DefaultNode[]>;
|
|
57
|
+
/** Whether a `targetDefaults` key can reach a target of this name and executor at all. */
|
|
58
|
+
keyMayApply(key: string, targetName: string, executor: string | undefined): boolean;
|
|
59
|
+
/** A `dependsOn` entry as the task graph normalises it. */
|
|
60
|
+
normaliseDependency(entry: unknown, project: string, graph: DependencyGraph): NormalisedDependency;
|
|
61
|
+
}
|
|
62
|
+
/** What `createDependencies` receives, as far as the check reads it. */
|
|
63
|
+
export type TargetDefaultsContext = Pick<CreateDependenciesContext, "projects" | "nxJsonConfiguration" | "workspaceRoot" | "fileMap">;
|
|
64
|
+
/** The layers of the projects concerned, as Nx merges them, by root. */
|
|
65
|
+
export interface Layers {
|
|
66
|
+
/** The plugin's own projects, as its `createNodes` returned them, merged. */
|
|
67
|
+
specified: Record<string, RootMapProject>;
|
|
68
|
+
/** What Nx's synthesis of target defaults lays over them, result by result. */
|
|
69
|
+
targetDefaults: ReturnType<TargetDefaultsInternals["createTargetDefaultsResults"]>;
|
|
70
|
+
/**
|
|
71
|
+
* What the synthesis lays over them with this plugin as the source of its
|
|
72
|
+
* targets, as `targetDefaults` holds it, and with each other plugin that
|
|
73
|
+
* may be the source ({@link MergedView.otherSources}).
|
|
74
|
+
*/
|
|
75
|
+
mayApply: ReturnType<TargetDefaultsInternals["createTargetDefaultsResults"]>[];
|
|
76
|
+
/** What Nx's default plugins make of the folders' files, node by node. */
|
|
77
|
+
defaults: DefaultNode[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* What {@link rebuildLayers} takes from the graph that Nx merged, where it
|
|
81
|
+
* has one, and the other plugins that may be the source of the plugin's
|
|
82
|
+
* targets, which `createNodes` knows as well.
|
|
83
|
+
*/
|
|
84
|
+
export interface MergedView {
|
|
85
|
+
/** The plugin's targets with the names that Nx gives their references (`nxNames`). */
|
|
86
|
+
declared?: (project: CargoProject, target: TargetConfiguration) => TargetConfiguration;
|
|
87
|
+
/**
|
|
88
|
+
* The projects as Nx merged them, by root, whose name and tags Nx's
|
|
89
|
+
* synthesis reads for the filters of `targetDefaults`, also where another
|
|
90
|
+
* plugin gave them.
|
|
91
|
+
*/
|
|
92
|
+
asMerged?: ReadonlyMap<string, ProjectConfiguration>;
|
|
93
|
+
/** The other plugins that may be the source of the plugin's targets ({@link otherSourcePlugins}). */
|
|
94
|
+
otherSources: readonly string[];
|
|
95
|
+
}
|
|
96
|
+
/** The elements of one `targetDefaults` key that Nx laid over one target. */
|
|
97
|
+
export interface AppliedEntry {
|
|
98
|
+
key: string;
|
|
99
|
+
/** Their positions in the key's list, where its value is a list. */
|
|
100
|
+
indices?: number[];
|
|
101
|
+
}
|
|
102
|
+
/** A value in the options or a configuration of one of the plugin's targets. */
|
|
103
|
+
export interface OptionPlace {
|
|
104
|
+
project: CargoProject;
|
|
105
|
+
/** The target's name, as `targetNames` gives it. */
|
|
106
|
+
target: string;
|
|
107
|
+
/** The configuration that holds the value; absent for the target's `options`. */
|
|
108
|
+
configuration?: string;
|
|
109
|
+
option: string;
|
|
110
|
+
}
|
|
111
|
+
/** Where Nx took a value of a target from: a file in the project's folder or a `targetDefaults` entry. */
|
|
112
|
+
export type OptionOrigin = {
|
|
113
|
+
file: string;
|
|
114
|
+
} | AppliedEntry;
|
|
115
|
+
export declare const spread = "...";
|
|
116
|
+
/**
|
|
117
|
+
* The names of the plugins other than this one that may be the source of a
|
|
118
|
+
* target of this plugin, as Nx's synthesis of target defaults reads it for
|
|
119
|
+
* `filter.plugin`: the plugin whose node first gave the target the executor
|
|
120
|
+
* that it has, which keeps that source when this plugin gives the same
|
|
121
|
+
* executor (`getMergeValueResult` in Nx's
|
|
122
|
+
* `project-graph/utils/project-configuration/utils.js`). Graph creation
|
|
123
|
+
* cannot see which plugin that was. So where `nx.json` lists a plugin other
|
|
124
|
+
* than this one, each other plugin that an element's `filter.plugin` names
|
|
125
|
+
* may be it, and so may one that none names, which `unnamedSource` stands
|
|
126
|
+
* for; where `nx.json` lists none, this plugin is the source.
|
|
127
|
+
*/
|
|
128
|
+
export declare function otherSourcePlugins(targetDefaults: Record<string, unknown>, plugin: string | undefined, nxJson: NxJsonConfiguration, workspaceRoot: string): string[];
|
|
129
|
+
/**
|
|
130
|
+
* The plugins that `nx.json` lists after the first entry of this plugin, as
|
|
131
|
+
* it writes them, once each: the ones whose targets Nx merges over this
|
|
132
|
+
* plugin's, where they can replace its lists. A plugin listed before it
|
|
133
|
+
* cannot, since this plugin's lists replace its own.
|
|
134
|
+
*/
|
|
135
|
+
export declare function laterPlugins(nxJson: NxJsonConfiguration, workspaceRoot: string): string[];
|
|
136
|
+
export declare function byKey(entries: readonly AppliedEntry[]): AppliedEntry[];
|
|
137
|
+
export declare function isInferred(target: TargetConfiguration): boolean;
|
|
138
|
+
export declare function isGlobPattern(name: string): boolean;
|
|
139
|
+
export declare function rebuildLayers(nx: TargetDefaultsInternals, projects: readonly CargoProject[], plugin: string | undefined, context: TargetDefaultsContext, roots: readonly string[], view?: MergedView): Promise<Layers>;
|
|
140
|
+
export declare function rebuild(nx: TargetDefaultsInternals, layers: Layers, root: string, targetDefaults: Layers["targetDefaults"] | undefined): RootMapProject;
|
|
141
|
+
/**
|
|
142
|
+
* The name under which Nx knows the plugin's entry in `nx.json`, which
|
|
143
|
+
* `filter.plugin` of a `targetDefaults` entry compares with, as Nx 24
|
|
144
|
+
* derives it (`getPluginPathAndName` in `project-graph/plugins/resolve-plugin.js`):
|
|
145
|
+
* the entry's `plugin` itself where it names a `.js` or `.ts` file, and
|
|
146
|
+
* otherwise the name of the package it resolves to. The first entry that
|
|
147
|
+
* resolves to this plugin decides; the package's name where none does.
|
|
148
|
+
*/
|
|
149
|
+
export declare function pluginEntryNameIn(nxJson: NxJsonConfiguration | undefined, workspaceRoot: string): string;
|
|
150
|
+
/**
|
|
151
|
+
* The name under which Nx knows a plugin entry, from Nx's copy of the plugin
|
|
152
|
+
* for the entry, which `createDependencies` receives as `this`.
|
|
153
|
+
*/
|
|
154
|
+
export declare function pluginEntryName(plugin: unknown): string | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Where Nx took each value from, as far as the layers that
|
|
157
|
+
* `findTargetDefaultChanges` rebuilds with Nx's own code show it: the
|
|
158
|
+
* `project.json` or `package.json` in the project's folder whose node sets
|
|
159
|
+
* the option at that place, which Nx merges after `targetDefaults`, the
|
|
160
|
+
* later file winning; otherwise the element of `targetDefaults` that Nx
|
|
161
|
+
* lays over the target and that sets it, the later element winning; and
|
|
162
|
+
* `undefined` where none does, as where another plugin sets it.
|
|
163
|
+
*
|
|
164
|
+
* @param plugin The name under which Nx knows this plugin entry.
|
|
165
|
+
* @param internals Nx's internal parts ({@link loadTargetDefaultsInternals}).
|
|
166
|
+
*/
|
|
167
|
+
export declare function optionOrigins(places: readonly OptionPlace[], context: TargetDefaultsContext, plugin: string | undefined, internals: TargetDefaultsInternals): Promise<(OptionOrigin | undefined)[]>;
|
|
168
|
+
/**
|
|
169
|
+
* The parts of the Nx installed in the repository, which is the Nx that
|
|
170
|
+
* creates the graph, that the check runs: from `nx/src/devkit-internals`,
|
|
171
|
+
* `createTargetDefaultsResults`, `findMatchingTargetNames`,
|
|
172
|
+
* `expandDependencyConfigSyntaxSugar` and `normalizeDependencyConfigProjects`;
|
|
173
|
+
* `mergeProjectConfigurationIntoRootMap`, Nx's merge of project nodes; and
|
|
174
|
+
* the `createNodes` of Nx's default plugins for `package.json` and
|
|
175
|
+
* `project.json`.
|
|
176
|
+
*
|
|
177
|
+
* @param load Loads a module by its resolved path; replaced in tests.
|
|
178
|
+
* @throws {Error} When that Nx lacks one of them, naming the Nx version.
|
|
179
|
+
*/
|
|
180
|
+
export declare function loadTargetDefaultsInternals(workspaceRoot: string, load?: (path: string) => unknown): TargetDefaultsInternals;
|
|
181
|
+
export declare function appliedElements(results: ReturnType<TargetDefaultsInternals["createTargetDefaultsResults"]>, targetDefaults: Record<string, unknown>): Map<string, Map<string, AppliedEntry>>;
|
|
182
|
+
export declare function appliedEntry(file: string, targetDefaults: Record<string, unknown>): AppliedEntry | undefined;
|
|
183
|
+
export declare function includes(list: readonly unknown[] | undefined, value: unknown): boolean;
|
|
184
|
+
export declare function canonical(value: unknown): string;
|
|
185
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
186
|
+
export declare function compare(a: string, b: string): number;
|