@convesoft/nx-rust 0.0.0-stage → 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 +48 -2
- package/executors.json +35 -0
- package/generators.json +19 -0
- package/package.json +26 -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,479 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphSettings = void 0;
|
|
4
|
+
exports.readPluginOptions = readPluginOptions;
|
|
5
|
+
exports.readSettings = readSettings;
|
|
6
|
+
exports.affectedTestsRunnerProblem = affectedTestsRunnerProblem;
|
|
7
|
+
exports.readCrateFileInputs = readCrateFileInputs;
|
|
8
|
+
exports.readCrateAddedInputs = readCrateAddedInputs;
|
|
9
|
+
exports.targetHeader = targetHeader;
|
|
10
|
+
const node_path_1 = require("node:path");
|
|
11
|
+
const options_1 = require("./options");
|
|
12
|
+
const target_fields_1 = require("./target-fields");
|
|
13
|
+
/** The settings of every workspace and project of one graph computation. */
|
|
14
|
+
class GraphSettings {
|
|
15
|
+
constructor(options, workspaces, crates, workspaceProjects) {
|
|
16
|
+
this.options = options;
|
|
17
|
+
this.workspaces = workspaces;
|
|
18
|
+
this.crates = crates;
|
|
19
|
+
this.workspaceProjects = workspaceProjects;
|
|
20
|
+
}
|
|
21
|
+
/** The settings of a workspace that discovery found. */
|
|
22
|
+
workspace(workspace) {
|
|
23
|
+
return found(this.workspaces.get(workspace), workspace.rootManifest);
|
|
24
|
+
}
|
|
25
|
+
/** The settings of a member that discovery handed over. */
|
|
26
|
+
crate(pkg) {
|
|
27
|
+
return found(this.crates.get(pkg.manifest_path), pkg.manifest_path);
|
|
28
|
+
}
|
|
29
|
+
/** The settings of the workspace project of a root manifest without a crate. */
|
|
30
|
+
workspaceProject(workspace) {
|
|
31
|
+
return found(this.workspaceProjects.get(workspace), workspace.rootManifest);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.GraphSettings = GraphSettings;
|
|
35
|
+
function found(value, manifest) {
|
|
36
|
+
if (value === undefined) {
|
|
37
|
+
throw new Error(`nx-rust read no settings for ${manifest}. Please report this at https://github.com/convesoft/nx-rust/issues.`);
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
const pluginOptionsLabel = "the options of the @convesoft/nx-rust entry";
|
|
42
|
+
/** Each key that a place accepts, in the order of `DES-PLUGIN-OPTIONS`. */
|
|
43
|
+
const keysOf = {
|
|
44
|
+
plugin: [
|
|
45
|
+
"targetNames",
|
|
46
|
+
"locked",
|
|
47
|
+
"testRunner",
|
|
48
|
+
"affectedTests",
|
|
49
|
+
"featureUnification",
|
|
50
|
+
"envInputs",
|
|
51
|
+
"runtimeInputs",
|
|
52
|
+
],
|
|
53
|
+
workspace: [
|
|
54
|
+
"testRunner",
|
|
55
|
+
"affectedTests",
|
|
56
|
+
"featureUnification",
|
|
57
|
+
"namePrefix",
|
|
58
|
+
"tags",
|
|
59
|
+
"targets",
|
|
60
|
+
"implicitDependencies",
|
|
61
|
+
"envInputs",
|
|
62
|
+
"runtimeInputs",
|
|
63
|
+
"fileInputs",
|
|
64
|
+
"project",
|
|
65
|
+
],
|
|
66
|
+
project: ["name", "tags", "targets"],
|
|
67
|
+
package: [
|
|
68
|
+
"name",
|
|
69
|
+
"artifacts",
|
|
70
|
+
"tags",
|
|
71
|
+
"targets",
|
|
72
|
+
"implicitDependencies",
|
|
73
|
+
"envInputs",
|
|
74
|
+
"runtimeInputs",
|
|
75
|
+
"fileInputs",
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
/** Where a key that a place does not accept can be set instead, for the message. */
|
|
79
|
+
const placesOf = {
|
|
80
|
+
targetNames: "the options of the plugin's entry in nx.json",
|
|
81
|
+
locked: "the options of the plugin's entry in nx.json",
|
|
82
|
+
testRunner: "[workspace.metadata.nx] or the options of the plugin's entry in nx.json",
|
|
83
|
+
affectedTests: "[workspace.metadata.nx] or the options of the plugin's entry in nx.json",
|
|
84
|
+
featureUnification: "[workspace.metadata.nx] or the options of the plugin's entry in nx.json",
|
|
85
|
+
namePrefix: "[workspace.metadata.nx] of a workspace's root manifest",
|
|
86
|
+
name: "[package.metadata.nx] of a crate, or [workspace.metadata.nx.project] for a workspace project",
|
|
87
|
+
artifacts: "[package.metadata.nx] of a crate",
|
|
88
|
+
tags: "[package.metadata.nx], [workspace.metadata.nx] or [workspace.metadata.nx.project]",
|
|
89
|
+
targets: "[package.metadata.nx], [workspace.metadata.nx] or [workspace.metadata.nx.project]",
|
|
90
|
+
implicitDependencies: "[package.metadata.nx] or [workspace.metadata.nx]",
|
|
91
|
+
envInputs: "[package.metadata.nx], [workspace.metadata.nx] or the options of the plugin's entry in nx.json",
|
|
92
|
+
runtimeInputs: "[package.metadata.nx], [workspace.metadata.nx] or the options of the plugin's entry in nx.json",
|
|
93
|
+
fileInputs: "[package.metadata.nx] or [workspace.metadata.nx]",
|
|
94
|
+
project: "[workspace.metadata.nx]",
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Reads the options of the plugin's entry in `nx.json`, as Nx passes them to
|
|
98
|
+
* `createNodes`: each setting that `DES-PLUGIN-OPTIONS` gives the plugin
|
|
99
|
+
* options, validated.
|
|
100
|
+
*
|
|
101
|
+
* @throws {Error} When a key is unknown there or a value is invalid, naming
|
|
102
|
+
* `nx.json` and each such key.
|
|
103
|
+
*/
|
|
104
|
+
// @mara implements DES-PLUGIN-OPTIONS
|
|
105
|
+
function readPluginOptions(options) {
|
|
106
|
+
const problems = [];
|
|
107
|
+
if (options !== undefined && options !== null && !isTable(options)) {
|
|
108
|
+
throw new Error(`nx.json: ${pluginOptionsLabel} have to be an object, not ${JSON.stringify(options)}.`);
|
|
109
|
+
}
|
|
110
|
+
const reader = new TableReader("nx.json", pluginOptionsLabel, isTable(options) ? options : {}, problems);
|
|
111
|
+
reader.unknownKeys("plugin");
|
|
112
|
+
const read = {
|
|
113
|
+
targetNames: {},
|
|
114
|
+
locked: false,
|
|
115
|
+
testRunner: reader.oneOf("testRunner", testRunners),
|
|
116
|
+
affectedTests: reader.boolean("affectedTests"),
|
|
117
|
+
featureUnification: reader.oneOf("featureUnification", featureUnifications),
|
|
118
|
+
envInputs: reader.strings("envInputs", "the names of environment variables"),
|
|
119
|
+
runtimeInputs: reader.strings("runtimeInputs", "commands"),
|
|
120
|
+
};
|
|
121
|
+
if (problems.length > 0) {
|
|
122
|
+
throw new Error(problems.join("\n"));
|
|
123
|
+
}
|
|
124
|
+
// They name their own problems in the words their checks have used since 0.1.
|
|
125
|
+
read.targetNames = (0, options_1.readTargetNames)(options);
|
|
126
|
+
read.locked = (0, options_1.readLocked)(options);
|
|
127
|
+
return read;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Reads `[workspace.metadata.nx]` of each workspace that discovery found,
|
|
131
|
+
* with its `project` table, and `[package.metadata.nx]` of each member that
|
|
132
|
+
* becomes a project, from the `cargo metadata` reports (`DES-METADATA-REPORT`),
|
|
133
|
+
* and combines them with the plugin options by the precedence of
|
|
134
|
+
* `DES-PLUGIN-OPTIONS`: a crate's value wins over the workspace's, which wins
|
|
135
|
+
* over the plugin options', and tags, `implicitDependencies`, `fileInputs`,
|
|
136
|
+
* `envInputs` and `runtimeInputs` add up.
|
|
137
|
+
*
|
|
138
|
+
* @throws {Error} Naming every manifest with an unknown key, an invalid
|
|
139
|
+
* value, an `implicitDependencies` entry starting with `!`, or a `project`
|
|
140
|
+
* table in a root manifest that defines a crate.
|
|
141
|
+
*/
|
|
142
|
+
// @mara implements DES-METADATA-TABLES
|
|
143
|
+
// @mara implements DES-PLUGIN-OPTIONS
|
|
144
|
+
// @mara implements REQ-METADATA-OVERRIDES
|
|
145
|
+
function readSettings(discovery, options) {
|
|
146
|
+
var _a, _b, _c, _d, _e;
|
|
147
|
+
const problems = [];
|
|
148
|
+
const workspaces = new Map();
|
|
149
|
+
const crates = new Map();
|
|
150
|
+
const workspaceProjects = new Map();
|
|
151
|
+
for (const workspace of discovery.workspaces) {
|
|
152
|
+
const rootManifestPath = (0, node_path_1.join)(workspace.report.workspace_root, "Cargo.toml");
|
|
153
|
+
const rootIsCrate = workspace.report.packages.some((pkg) => pkg.manifest_path === rootManifestPath);
|
|
154
|
+
const table = readWorkspaceTable(workspace, rootIsCrate, problems);
|
|
155
|
+
const settings = {
|
|
156
|
+
rootManifest: workspace.rootManifest,
|
|
157
|
+
locked: options.locked,
|
|
158
|
+
testRunner: (_b = (_a = table.testRunner) !== null && _a !== void 0 ? _a : options.testRunner) !== null && _b !== void 0 ? _b : "cargo",
|
|
159
|
+
affectedTests: (_d = (_c = table.affectedTests) !== null && _c !== void 0 ? _c : options.affectedTests) !== null && _d !== void 0 ? _d : false,
|
|
160
|
+
featureUnification: (_e = table.featureUnification) !== null && _e !== void 0 ? _e : options.featureUnification,
|
|
161
|
+
namePrefix: table.namePrefix,
|
|
162
|
+
tags: table.tags,
|
|
163
|
+
implicitDependencies: table.implicitDependencies,
|
|
164
|
+
envInputs: union(options.envInputs, table.envInputs),
|
|
165
|
+
runtimeInputs: union(options.runtimeInputs, table.runtimeInputs),
|
|
166
|
+
fileInputs: table.fileInputs,
|
|
167
|
+
};
|
|
168
|
+
const runnerProblem = affectedTestsRunnerProblem(workspace.rootManifest, table, options);
|
|
169
|
+
if (runnerProblem !== undefined) {
|
|
170
|
+
problems.push(runnerProblem);
|
|
171
|
+
}
|
|
172
|
+
workspaces.set(workspace, settings);
|
|
173
|
+
for (const pkg of workspace.members) {
|
|
174
|
+
const own = readPackageTable(pkg, discovery.workspaceRoot, problems);
|
|
175
|
+
crates.set(pkg.manifest_path, {
|
|
176
|
+
workspace: settings,
|
|
177
|
+
name: own.name,
|
|
178
|
+
tags: union(settings.tags, own.tags),
|
|
179
|
+
implicitDependencies: union(settings.implicitDependencies, own.implicitDependencies),
|
|
180
|
+
envInputs: union(settings.envInputs, own.envInputs),
|
|
181
|
+
runtimeInputs: union(settings.runtimeInputs, own.runtimeInputs),
|
|
182
|
+
fileInputs: [...settings.fileInputs, ...own.fileInputs],
|
|
183
|
+
artifacts: own.artifacts,
|
|
184
|
+
targets: [...table.targets, ...own.targets],
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
workspaceProjects.set(workspace, {
|
|
188
|
+
workspace: settings,
|
|
189
|
+
name: table.project.name,
|
|
190
|
+
tags: union(settings.tags, table.project.tags),
|
|
191
|
+
implicitDependencies: [],
|
|
192
|
+
envInputs: [],
|
|
193
|
+
runtimeInputs: [],
|
|
194
|
+
fileInputs: [],
|
|
195
|
+
targets: table.project.targets,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
if (problems.length > 0) {
|
|
199
|
+
throw new Error(problems.join("\n"));
|
|
200
|
+
}
|
|
201
|
+
return new GraphSettings(options, workspaces, crates, workspaceProjects);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* The error for a workspace that turns on the selection of affected tests
|
|
205
|
+
* without the nextest runner (`REQ-AFFECTED-TESTS`, `DES-DIAGNOSTICS`): it
|
|
206
|
+
* names both options, where each of their values comes from, and what to
|
|
207
|
+
* change. `undefined` where the workspace does not select or uses nextest.
|
|
208
|
+
*/
|
|
209
|
+
// @mara implements REQ-AFFECTED-TESTS
|
|
210
|
+
// @mara implements DES-DIAGNOSTICS
|
|
211
|
+
function affectedTestsRunnerProblem(rootManifest, table, options) {
|
|
212
|
+
var _a, _b, _c, _d;
|
|
213
|
+
const affectedTests = (_b = (_a = table.affectedTests) !== null && _a !== void 0 ? _a : options.affectedTests) !== null && _b !== void 0 ? _b : false;
|
|
214
|
+
const testRunner = (_d = (_c = table.testRunner) !== null && _c !== void 0 ? _c : options.testRunner) !== null && _d !== void 0 ? _d : "cargo";
|
|
215
|
+
if (!affectedTests || testRunner === "nextest") {
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
const from = (key) => table[key] !== undefined
|
|
219
|
+
? `[workspace.metadata.nx] in ${rootManifest}`
|
|
220
|
+
: options[key] !== undefined
|
|
221
|
+
? "the options of the plugin's entry in nx.json"
|
|
222
|
+
: "the default";
|
|
223
|
+
return `${rootManifest}: affectedTests is true (from ${from("affectedTests")}), but testRunner is "${testRunner}" (from ${from("testRunner")}): the selection of affected tests runs only with the nextest runner. Set testRunner = "nextest" under [workspace.metadata.nx] in ${rootManifest}, or in the options of the plugin's entry in nx.json, or remove affectedTests.`;
|
|
224
|
+
}
|
|
225
|
+
const testRunners = ["cargo", "nextest"];
|
|
226
|
+
const featureUnifications = ["hakari", "cargo", "workspace-build"];
|
|
227
|
+
const artifactKinds = ["napi", "wasm"];
|
|
228
|
+
function readWorkspaceTable(workspace, rootIsCrate, problems) {
|
|
229
|
+
const manifest = workspace.rootManifest;
|
|
230
|
+
const value = nxTable(workspace.report.metadata, manifest, "[workspace.metadata]", problems);
|
|
231
|
+
const reader = new TableReader(manifest, "[workspace.metadata.nx]", value, problems);
|
|
232
|
+
reader.unknownKeys("workspace");
|
|
233
|
+
const project = reader.table("project");
|
|
234
|
+
if (project !== undefined && rootIsCrate) {
|
|
235
|
+
problems.push(`${manifest}: [workspace.metadata.nx.project] configures the workspace project, but this root manifest defines a crate, which is the workspace project. Move its settings to [package.metadata.nx] in ${manifest}.`);
|
|
236
|
+
}
|
|
237
|
+
const projectReader = new TableReader(manifest, "[workspace.metadata.nx.project]", project !== null && project !== void 0 ? project : {}, problems);
|
|
238
|
+
projectReader.unknownKeys("project");
|
|
239
|
+
return Object.assign(Object.assign({ testRunner: reader.oneOf("testRunner", testRunners), affectedTests: reader.boolean("affectedTests"), featureUnification: reader.oneOf("featureUnification", featureUnifications), namePrefix: reader.string("namePrefix", { nonEmpty: false }) }, readShared(reader, manifest)), { project: {
|
|
240
|
+
name: projectReader.string("name", { nonEmpty: true }),
|
|
241
|
+
tags: projectReader.strings("tags", "tags"),
|
|
242
|
+
targets: projectReader.targets(),
|
|
243
|
+
} });
|
|
244
|
+
}
|
|
245
|
+
function readPackageTable(pkg, repositoryRoot, problems) {
|
|
246
|
+
const manifest = (0, node_path_1.relative)(repositoryRoot, pkg.manifest_path);
|
|
247
|
+
const value = nxTable(pkg.metadata, manifest, "[package.metadata]", problems);
|
|
248
|
+
const reader = new TableReader(manifest, "[package.metadata.nx]", value, problems);
|
|
249
|
+
reader.unknownKeys("package");
|
|
250
|
+
const artifacts = reader.strings("artifacts", `kinds of artifact, "napi" or "wasm"`);
|
|
251
|
+
const unknownKinds = artifacts.filter((kind) => !artifactKinds.includes(kind));
|
|
252
|
+
if (unknownKinds.length > 0) {
|
|
253
|
+
problems.push(`${manifest}: "artifacts" in [package.metadata.nx] names ${list(unknownKinds.map(quote))}, but the kinds of artifact are "napi" and "wasm"; an empty list means none.`);
|
|
254
|
+
}
|
|
255
|
+
return Object.assign({ name: reader.string("name", { nonEmpty: true }), artifacts: reader.has("artifacts") ? artifacts : undefined }, readShared(reader, manifest));
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* The `fileInputs` of a crate that another crate's inputs name by its
|
|
259
|
+
* folder, beside an edge, such as a path dependency without a project: those
|
|
260
|
+
* of its workspace's table and of its own, each with its manifest, as
|
|
261
|
+
* {@link readSettings} reads them for a project (`DES-INPUTS`). Only that key
|
|
262
|
+
* is read.
|
|
263
|
+
*
|
|
264
|
+
* @param report The `cargo metadata` report of the crate's workspace.
|
|
265
|
+
* @param problems Where a value of the wrong type is reported.
|
|
266
|
+
*/
|
|
267
|
+
// @mara implements DES-INPUTS
|
|
268
|
+
function readCrateFileInputs(pkg, report, repositoryRoot, problems) {
|
|
269
|
+
return readCrateTables(pkg, report, repositoryRoot, problems, (reader, manifest) => reader.strings("fileInputs", "glob patterns").map((pattern) => ({ pattern, manifest }))).flat();
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* The variables and commands that a crate adds to its key with `envInputs`
|
|
273
|
+
* and `runtimeInputs` in its workspace's table and in its own, each once, for
|
|
274
|
+
* a crate that another crate's inputs name by its folder in place of an
|
|
275
|
+
* edge, which would have brought them in the crate's named input
|
|
276
|
+
* (`DES-INPUTS`, "Added variables and commands"). Only those keys are read,
|
|
277
|
+
* as {@link readSettings} reads them for a project; the plugin options'
|
|
278
|
+
* additions reach every crate of the entry already.
|
|
279
|
+
*
|
|
280
|
+
* @param report The `cargo metadata` report of the crate's workspace.
|
|
281
|
+
* @param problems Where a value of the wrong type is reported.
|
|
282
|
+
*/
|
|
283
|
+
// @mara implements DES-INPUTS
|
|
284
|
+
function readCrateAddedInputs(pkg, report, repositoryRoot, problems) {
|
|
285
|
+
const tables = readCrateTables(pkg, report, repositoryRoot, problems, (reader) => ({
|
|
286
|
+
envInputs: reader.strings("envInputs", "the names of environment variables"),
|
|
287
|
+
runtimeInputs: reader.strings("runtimeInputs", "commands"),
|
|
288
|
+
}));
|
|
289
|
+
return {
|
|
290
|
+
envInputs: union(...tables.map((table) => table.envInputs)),
|
|
291
|
+
runtimeInputs: union(...tables.map((table) => table.runtimeInputs)),
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
// Reads the workspace table of the crate's workspace and then the crate's
|
|
295
|
+
// own table, each with a reader of `read`.
|
|
296
|
+
function readCrateTables(pkg, report, repositoryRoot, problems, read) {
|
|
297
|
+
const readTable = (metadata, manifestPath, table) => {
|
|
298
|
+
const manifest = (0, node_path_1.relative)(repositoryRoot, manifestPath);
|
|
299
|
+
const parent = table === "[package.metadata.nx]" ? "[package.metadata]" : "[workspace.metadata]";
|
|
300
|
+
const value = nxTable(metadata, manifest, parent, problems);
|
|
301
|
+
return read(new TableReader(manifest, table, value, problems), manifest);
|
|
302
|
+
};
|
|
303
|
+
return [
|
|
304
|
+
readTable(report.metadata, (0, node_path_1.join)(report.workspace_root, "Cargo.toml"), "[workspace.metadata.nx]"),
|
|
305
|
+
readTable(pkg.metadata, pkg.manifest_path, "[package.metadata.nx]"),
|
|
306
|
+
];
|
|
307
|
+
}
|
|
308
|
+
function readShared(reader, manifest) {
|
|
309
|
+
return {
|
|
310
|
+
tags: reader.strings("tags", "tags"),
|
|
311
|
+
targets: reader.targets(),
|
|
312
|
+
implicitDependencies: reader.implicitDependencies(),
|
|
313
|
+
envInputs: reader.strings("envInputs", "the names of environment variables"),
|
|
314
|
+
runtimeInputs: reader.strings("runtimeInputs", "commands"),
|
|
315
|
+
fileInputs: reader
|
|
316
|
+
.strings("fileInputs", "glob patterns")
|
|
317
|
+
.map((pattern) => ({ pattern, manifest })),
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
// The `nx` table inside a `metadata` value of the report, or an empty one.
|
|
321
|
+
function nxTable(metadata, manifest, parent, problems) {
|
|
322
|
+
const value = isTable(metadata) ? metadata.nx : undefined;
|
|
323
|
+
if (value === undefined || value === null) {
|
|
324
|
+
return {};
|
|
325
|
+
}
|
|
326
|
+
if (!isTable(value)) {
|
|
327
|
+
problems.push(`${manifest}: "nx" in ${parent} has to be a table, not ${JSON.stringify(value)}.`);
|
|
328
|
+
return {};
|
|
329
|
+
}
|
|
330
|
+
return value;
|
|
331
|
+
}
|
|
332
|
+
/** Reads the values of one table or of the plugin options, collecting what is wrong. */
|
|
333
|
+
class TableReader {
|
|
334
|
+
constructor(file, label, value, problems) {
|
|
335
|
+
this.file = file;
|
|
336
|
+
this.label = label;
|
|
337
|
+
this.value = value;
|
|
338
|
+
this.problems = problems;
|
|
339
|
+
}
|
|
340
|
+
has(key) {
|
|
341
|
+
return this.value[key] !== undefined;
|
|
342
|
+
}
|
|
343
|
+
/** Reports each key that `place` does not accept. */
|
|
344
|
+
unknownKeys(place) {
|
|
345
|
+
const known = keysOf[place];
|
|
346
|
+
for (const key of Object.keys(this.value)) {
|
|
347
|
+
if (known.includes(key)) {
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
const similar = known.find((candidate) => candidate.toLowerCase() === key.toLowerCase());
|
|
351
|
+
const elsewhere = placesOf[key];
|
|
352
|
+
this.problems.push([
|
|
353
|
+
`${this.file}: nx-rust does not know the key ${quote(key)} in ${this.label}.`,
|
|
354
|
+
similar === undefined ? undefined : `Did you mean ${quote(similar)}?`,
|
|
355
|
+
similar === undefined && key === "affectedTests" && place === "package"
|
|
356
|
+
? `A crate opts out of the selection of affected tests with affectedTests = false under [package.metadata.nx.targets.test.options].`
|
|
357
|
+
: similar === undefined && elsewhere !== undefined
|
|
358
|
+
? `${quote(key)} can be set in ${elsewhere}.`
|
|
359
|
+
: undefined,
|
|
360
|
+
`The keys it knows there are ${list(known.map(quote))}.`,
|
|
361
|
+
]
|
|
362
|
+
.filter((sentence) => sentence !== undefined)
|
|
363
|
+
.join(" "));
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
string(key, { nonEmpty }) {
|
|
367
|
+
const value = this.value[key];
|
|
368
|
+
if (value === undefined) {
|
|
369
|
+
return undefined;
|
|
370
|
+
}
|
|
371
|
+
if (typeof value !== "string" || (nonEmpty && value.trim() === "")) {
|
|
372
|
+
this.invalid(key, nonEmpty ? "a string that is not empty" : "a string");
|
|
373
|
+
return undefined;
|
|
374
|
+
}
|
|
375
|
+
return value;
|
|
376
|
+
}
|
|
377
|
+
boolean(key) {
|
|
378
|
+
const value = this.value[key];
|
|
379
|
+
if (value === undefined || typeof value === "boolean") {
|
|
380
|
+
return value;
|
|
381
|
+
}
|
|
382
|
+
this.invalid(key, "true or false");
|
|
383
|
+
return undefined;
|
|
384
|
+
}
|
|
385
|
+
oneOf(key, values) {
|
|
386
|
+
const value = this.value[key];
|
|
387
|
+
if (value === undefined || values.includes(value)) {
|
|
388
|
+
return value;
|
|
389
|
+
}
|
|
390
|
+
this.invalid(key, list(values.map(quote), "or"));
|
|
391
|
+
return undefined;
|
|
392
|
+
}
|
|
393
|
+
/** A list of strings that are not empty; an empty list where the key is not set. */
|
|
394
|
+
strings(key, what) {
|
|
395
|
+
const value = this.value[key];
|
|
396
|
+
if (value === undefined) {
|
|
397
|
+
return [];
|
|
398
|
+
}
|
|
399
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string" || item === "")) {
|
|
400
|
+
this.invalid(key, `a list of ${what}, each a string that is not empty`);
|
|
401
|
+
return [];
|
|
402
|
+
}
|
|
403
|
+
return value;
|
|
404
|
+
}
|
|
405
|
+
table(key) {
|
|
406
|
+
const value = this.value[key];
|
|
407
|
+
if (value === undefined || isTable(value)) {
|
|
408
|
+
return value;
|
|
409
|
+
}
|
|
410
|
+
this.invalid(key, "a table");
|
|
411
|
+
return undefined;
|
|
412
|
+
}
|
|
413
|
+
/** `implicitDependencies`, which only adds: an entry starting with `!` is an error. */
|
|
414
|
+
implicitDependencies() {
|
|
415
|
+
const entries = this.strings("implicitDependencies", "project names");
|
|
416
|
+
const negated = entries.filter((entry) => entry.startsWith("!"));
|
|
417
|
+
if (negated.length > 0) {
|
|
418
|
+
this.problems.push(`${this.file}: "implicitDependencies" in ${this.label} has ${negated.length === 1 ? "the entry" : "the entries"} ${list(negated.map(quote))}, but the key only adds dependencies, so an entry starting with "!" is an error, whatever it names. Remove ${negated.length === 1 ? "it" : "them"}; nx-rust keeps the edge of every Cargo dependency.`);
|
|
419
|
+
}
|
|
420
|
+
return entries.filter((entry) => !entry.startsWith("!"));
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* The `targets.<name>` tables, each a table shaped like an Nx target whose
|
|
424
|
+
* fields have the types that Nx gives them ({@link targetFieldProblems}).
|
|
425
|
+
* A table with a field of another type is reported and left out.
|
|
426
|
+
*/
|
|
427
|
+
targets() {
|
|
428
|
+
var _a;
|
|
429
|
+
const targets = (_a = this.table("targets")) !== null && _a !== void 0 ? _a : {};
|
|
430
|
+
const tables = [];
|
|
431
|
+
for (const [name, target] of Object.entries(targets)) {
|
|
432
|
+
if (!isTable(target)) {
|
|
433
|
+
this.problems.push(`${this.file}: ${targetHeader(this.label, name)} has to be a table shaped like an Nx target, not ${JSON.stringify(target)}.`);
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
const header = targetHeader(this.label, name);
|
|
437
|
+
const problems = (0, target_fields_1.targetFieldProblems)(target, (field) => `${this.file}: ${quote(field)} in ${header}`);
|
|
438
|
+
if (problems.length > 0) {
|
|
439
|
+
this.problems.push(...problems);
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
tables.push({
|
|
443
|
+
name,
|
|
444
|
+
target: target,
|
|
445
|
+
manifest: this.file,
|
|
446
|
+
table: this.label,
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
return tables;
|
|
450
|
+
}
|
|
451
|
+
invalid(key, expected) {
|
|
452
|
+
this.problems.push(`${this.file}: ${quote(key)} in ${this.label} has to be ${expected}, not ${JSON.stringify(this.value[key])}.`);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
/** The header of a target table in messages, such as `[package.metadata.nx.targets.test]`. */
|
|
456
|
+
function targetHeader(table, target, ...path) {
|
|
457
|
+
return `${table.slice(0, -1)}.targets.${[target, ...path].map(tomlKey).join(".")}]`;
|
|
458
|
+
}
|
|
459
|
+
// A key as TOML writes it in a dotted header: bare where it can be.
|
|
460
|
+
function tomlKey(key) {
|
|
461
|
+
return /^[A-Za-z0-9_-]+$/.test(key) ? key : JSON.stringify(key);
|
|
462
|
+
}
|
|
463
|
+
function isTable(value) {
|
|
464
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
465
|
+
}
|
|
466
|
+
// The values of every list, each once, in the order they first appear.
|
|
467
|
+
function union(...lists) {
|
|
468
|
+
return [...new Set(lists.flat())];
|
|
469
|
+
}
|
|
470
|
+
function quote(value) {
|
|
471
|
+
return JSON.stringify(value);
|
|
472
|
+
}
|
|
473
|
+
// `a`, `a and b`, `a, b and c`
|
|
474
|
+
function list(items, conjunction = "and") {
|
|
475
|
+
return items.length <= 1
|
|
476
|
+
? items.join("")
|
|
477
|
+
: `${items.slice(0, -1).join(", ")} ${conjunction} ${items[items.length - 1]}`;
|
|
478
|
+
}
|
|
479
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/settings.ts"],"names":[],"mappings":";;;AAyNA,8CA8BC;AAkBD,oCA0DC;AAUD,gEAiBC;AAoGD,kDASC;AAeD,oDAcC;AA8MD,oCAEC;AAvrBD,yCAA2C;AAG3C,uCAAqE;AACrE,mDAAsD;AA6GtD,4EAA4E;AAC5E,MAAa,aAAa;IACxB,YACW,OAAsB,EACd,UAA0D,EAC1D,MAA4C,EAC5C,iBAA+D;QAHvE,YAAO,GAAP,OAAO,CAAe;QACd,eAAU,GAAV,UAAU,CAAgD;QAC1D,WAAM,GAAN,MAAM,CAAsC;QAC5C,sBAAiB,GAAjB,iBAAiB,CAA8C;IAC/E,CAAC;IAEJ,wDAAwD;IACxD,SAAS,CAAC,SAAyB;QACjC,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACvE,CAAC;IAED,2DAA2D;IAC3D,KAAK,CAAC,GAAiB;QACrB,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IACtE,CAAC;IAED,gFAAgF;IAChF,gBAAgB,CAAC,SAAyB;QACxC,OAAO,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,G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,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,+BAA+B;AAC/B,SAAS,IAAI,CAAC,KAAwB,EAAE,WAAW,GAAG,KAAK;IACzD,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC;QACtB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAChB,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,WAAW,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;AACnF,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { NxJsonConfiguration } from "@nx/devkit";
|
|
2
|
+
import type { CargoProject } from "./projects";
|
|
3
|
+
import { type TargetDefaultsInternals } from "./target-defaults-layers";
|
|
4
|
+
/**
|
|
5
|
+
* What the `targetDefaults` of `nx.json` add to the `dependsOn` of each
|
|
6
|
+
* project's inferred targets, as far as `createNodes` can see it: the
|
|
7
|
+
* cause of the warning of `DES-TARGET-DEFAULT-GUARD` for an entry that adds
|
|
8
|
+
* dependencies on other projects' tasks, which the digest of the project's
|
|
9
|
+
* warnings covers (`DES-DIAGNOSTICS`, "Warnings where they are seen").
|
|
10
|
+
* `createDependencies` finds the warning itself, once Nx has merged the
|
|
11
|
+
* projects of every plugin, too late to change a key.
|
|
12
|
+
*
|
|
13
|
+
* The inferred targets are rebuilt as `findTargetDefaultChanges`
|
|
14
|
+
* rebuilds them, from the layers that `createNodes` sees: the projects of
|
|
15
|
+
* this entry, the elements of `targetDefaults` that Nx's synthesis lays over
|
|
16
|
+
* them, once for each plugin that may be the source of the targets, which
|
|
17
|
+
* `createNodes` cannot see either ({@link otherSourcePlugins}), and what
|
|
18
|
+
* Nx's default plugins make of the `package.json` and `project.json` on disk
|
|
19
|
+
* in each project's folder. A `dependsOn` entry counts where a rebuild with
|
|
20
|
+
* the `targetDefaults` layer has it and the rebuild without it does not,
|
|
21
|
+
* unless its form shows that it reaches only the project's own tasks
|
|
22
|
+
* ({@link reachesOnlyOwnTasks}). An element whose filter names a tag, which
|
|
23
|
+
* `createNodes` cannot decide, counts wherever its key can reach the target
|
|
24
|
+
* ({@link undecidedCauses}). A target whose executor the folder's files
|
|
25
|
+
* replace is left out, as the check leaves it, and so is an extra target.
|
|
26
|
+
* Nothing is loaded without an entry that sets `dependsOn`; where Nx lacks
|
|
27
|
+
* the internal parts, nothing counts, and `createDependencies` fails graph
|
|
28
|
+
* creation where such an entry changes a target of the plugin.
|
|
29
|
+
*
|
|
30
|
+
* @returns By project root, one line for each target that entries add such
|
|
31
|
+
* dependencies to, naming the target, the entry and what it adds.
|
|
32
|
+
*/
|
|
33
|
+
export declare function targetDefaultCauses(projects: readonly CargoProject[], nxJson: NxJsonConfiguration | undefined, workspaceRoot: string, loadInternals?: () => TargetDefaultsInternals): Promise<Map<string, string[]>>;
|