@convesoft/nx-rust 0.0.0 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/PLUGIN.md +106 -0
- package/README.md +51 -1
- package/docs/artifacts.mara.md +374 -0
- package/docs/caching.mara.md +999 -0
- package/docs/ci.mara.md +308 -0
- package/docs/configuration.mara.md +508 -0
- package/docs/decisions.mara.md +3267 -0
- package/docs/execution.mara.md +533 -0
- package/docs/index.mara.md +51 -0
- package/docs/product.mara.md +366 -0
- package/docs/release.mara.md +493 -0
- package/docs/setup.mara.md +486 -0
- package/docs/targets.mara.md +704 -0
- package/docs/testing.mara.md +431 -0
- package/docs/verification.mara.md +465 -0
- package/docs/workspaces.mara.md +445 -0
- package/executors.json +35 -0
- package/generators.json +19 -0
- package/package.json +17 -4
- package/src/cargo/build-settings.d.ts +61 -0
- package/src/cargo/build-settings.js +103 -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 +114 -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 +90 -0
- package/src/cargo/redirections.js +200 -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/cargo/warnings-setting.d.ts +24 -0
- package/src/cargo/warnings-setting.js +81 -0
- package/src/cargo/warnings-setting.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 +58 -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 +218 -0
- package/src/executors/cargo-output.js +660 -0
- package/src/executors/cargo-output.js.map +1 -0
- package/src/executors/command.d.ts +331 -0
- package/src/executors/command.js +547 -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/denied-warnings.d.ts +99 -0
- package/src/executors/denied-warnings.js +188 -0
- package/src/executors/denied-warnings.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 +601 -0
- package/src/executors/group-run.js.map +1 -0
- package/src/executors/groups.d.ts +118 -0
- package/src/executors/groups.js +304 -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 +189 -0
- package/src/executors/nextest.js +504 -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 +435 -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 +527 -0
- package/src/executors/task.js.map +1 -0
- package/src/executors/test-mode.d.ts +185 -0
- package/src/executors/test-mode.js +397 -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 +121 -0
- package/src/executors/test-steps.js +566 -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 +681 -0
- package/src/graph/caching.js.map +1 -0
- package/src/graph/clippy-input.d.ts +53 -0
- package/src/graph/clippy-input.js +107 -0
- package/src/graph/clippy-input.js.map +1 -0
- package/src/graph/collisions.d.ts +113 -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 +190 -0
- package/src/graph/discovery.js +661 -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 +422 -0
- package/src/graph/inputs.js +756 -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 +193 -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/rustfmt-config.d.ts +42 -0
- package/src/graph/rustfmt-config.js +173 -0
- package/src/graph/rustfmt-config.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 +371 -0
- package/src/graph/targets.js +408 -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,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runTargetGroup = runTargetGroup;
|
|
4
|
+
exports.stageMessage = stageMessage;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const directories_1 = require("../cargo/directories");
|
|
7
|
+
const real_path_1 = require("../graph/real-path");
|
|
8
|
+
const group_run_1 = require("./group-run");
|
|
9
|
+
const napi_build_1 = require("./napi-build");
|
|
10
|
+
const stage_1 = require("./stage");
|
|
11
|
+
const wasm_build_1 = require("./wasm-build");
|
|
12
|
+
/**
|
|
13
|
+
* Runs a group of tasks with the runner of its target, in a batch or as a
|
|
14
|
+
* task run on its own: `runNapiGroup` for `napi-build`, `runWasmGroup` for
|
|
15
|
+
* `wasm-build` and `runGroup` for every other target (`DES-NAPI`,
|
|
16
|
+
* `DES-WASM`). A whole-workspace `build` and every compile of `napi-build`
|
|
17
|
+
* and `wasm-build` build in a stage of their own (`DES-BATCH`, "Staged
|
|
18
|
+
* builds"): a `build` moves its own crates' final artifacts and records out
|
|
19
|
+
* of it right after cargo, before the checks that read them, and a
|
|
20
|
+
* `napi-build` or `wasm-build` post-processes and checks from the stage. The
|
|
21
|
+
* stage is removed once the group is done, whatever happened. Where the
|
|
22
|
+
* stage cannot be made, every task fails before cargo; where a file of a
|
|
23
|
+
* task's crate cannot be moved, the task fails.
|
|
24
|
+
*
|
|
25
|
+
* @returns One result per member, in order.
|
|
26
|
+
*/
|
|
27
|
+
// @mara implements DES-BATCH
|
|
28
|
+
function runTargetGroup(members_1, selection_1, verbose_1) {
|
|
29
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (members, selection, verbose, live = "none") {
|
|
30
|
+
var _a, _b, _c;
|
|
31
|
+
const [first] = members;
|
|
32
|
+
const target = first === null || first === void 0 ? void 0 : first.prepared.target;
|
|
33
|
+
if (first === undefined || !(0, stage_1.stagesCommand)(target, selection)) {
|
|
34
|
+
return runner(target)(members, verbose, live);
|
|
35
|
+
}
|
|
36
|
+
let stage;
|
|
37
|
+
try {
|
|
38
|
+
stage = (0, stage_1.createStage)((_c = (_b = (_a = first.invocation.inputCheck) === null || _a === void 0 ? void 0 : _a.directories) !== null && _b !== void 0 ? _b : first.invocation.directories) !== null && _c !== void 0 ? _c : physicalDirectories(first.invocation.cwd, first.prepared.env));
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (!(error instanceof stage_1.StageError) && !(error instanceof directories_1.DirectoryReportError)) {
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
return members.map((member) => ({
|
|
45
|
+
success: false,
|
|
46
|
+
output: stageMessage(member.prepared.task, [error.message]),
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
const staged = members.map((member) => (Object.assign(Object.assign({}, member), { invocation: (0, stage_1.withStage)(member.invocation, stage, target !== "build") })));
|
|
50
|
+
// A `build` moves its own crates' files right after cargo, inside the
|
|
51
|
+
// step, so that the checks after cargo read them where they belong.
|
|
52
|
+
const moveProblems = new Map();
|
|
53
|
+
const packageIds = new Set(staged.flatMap((member) => member.invocation.package === undefined ? [] : [member.invocation.package.id]));
|
|
54
|
+
const observe = target !== "build"
|
|
55
|
+
? undefined
|
|
56
|
+
: (_step, output) => {
|
|
57
|
+
var _a;
|
|
58
|
+
for (const [id, problems] of (0, stage_1.moveStagedFiles)(stage, (0, stage_1.stagedFinalFiles)(output, stage, packageIds))) {
|
|
59
|
+
moveProblems.set(id, [...((_a = moveProblems.get(id)) !== null && _a !== void 0 ? _a : []), ...problems]);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
let results;
|
|
63
|
+
let removal;
|
|
64
|
+
try {
|
|
65
|
+
results =
|
|
66
|
+
target === "build"
|
|
67
|
+
? yield (0, group_run_1.runGroup)(staged, verbose, live, observe)
|
|
68
|
+
: yield runner(target)(staged, verbose, live);
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
removal = (0, stage_1.removeStage)(stage);
|
|
72
|
+
}
|
|
73
|
+
return staged.map((member, index) => {
|
|
74
|
+
var _a, _b, _c;
|
|
75
|
+
const { success, output } = results[index];
|
|
76
|
+
const problems = (_c = moveProblems.get((_b = (_a = member.invocation.package) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : "")) !== null && _c !== void 0 ? _c : [];
|
|
77
|
+
return {
|
|
78
|
+
success: success && problems.length === 0,
|
|
79
|
+
output: [
|
|
80
|
+
...(output === "" ? [] : [output]),
|
|
81
|
+
...(problems.length > 0 ? [stageMessage(member.prepared.task, problems)] : []),
|
|
82
|
+
...(removal === undefined ? [] : [`${member.prepared.task}: warning: ${removal}.`]),
|
|
83
|
+
].join("\n"),
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function runner(target) {
|
|
89
|
+
return target === "napi-build"
|
|
90
|
+
? napi_build_1.runNapiGroup
|
|
91
|
+
: target === "wasm-build"
|
|
92
|
+
? wasm_build_1.runWasmGroup
|
|
93
|
+
: (members, verbose, live) => (0, group_run_1.runGroup)(members, verbose, live);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The message of a task whose staged group could not make its stage, get
|
|
97
|
+
* Cargo's directories for it, or move a file of the task's crate out of it
|
|
98
|
+
* (`DES-BATCH`, "Staged builds"; `DES-DIAGNOSTICS`).
|
|
99
|
+
*/
|
|
100
|
+
// @mara implements DES-DIAGNOSTICS
|
|
101
|
+
function stageMessage(task, problems) {
|
|
102
|
+
return `${task}: @convesoft/nx-rust builds this task's cargo command in a stage of its own, in the artifact directory, and moves only the task's own files out of it, so that it replaces no file of another crate's build; ${problems.join("; ")}. The task fails, so that Nx stores no result for it. Check that the artifact directory can be written to and has space, and run the command again.`;
|
|
103
|
+
}
|
|
104
|
+
// Cargo's directories in the workspace root with the group's environment,
|
|
105
|
+
// as physical paths, for a staged group whose command had no report of them.
|
|
106
|
+
function physicalDirectories(cwd, env) {
|
|
107
|
+
const reported = (0, directories_1.reportedDirectories)(cwd, env);
|
|
108
|
+
return { artifact: (0, real_path_1.physicalPath)(reported.artifact), build: (0, real_path_1.physicalPath)(reported.build) };
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=staged-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staged-run.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/staged-run.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import type { ProjectGraph, Task } from "@nx/devkit";
|
|
2
|
+
import { NxBridgeError, type NxTaskEnv } from "../compatibility/nx-bridge";
|
|
3
|
+
/**
|
|
4
|
+
* Why the batch cannot rebuild a task's environment: the installed Nx lacks,
|
|
5
|
+
* or has changed, a part through which it does. Its message is the reason
|
|
6
|
+
* alone.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TaskEnvironmentError extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
/** Converts a bridge failure into a {@link TaskEnvironmentError} with its diagnostic wording. */
|
|
12
|
+
export declare function toTaskEnvironmentError(error: NxBridgeError): TaskEnvironmentError;
|
|
13
|
+
/**
|
|
14
|
+
* The variables by which Nx 24 tells a task how it runs and records the
|
|
15
|
+
* task, not what the task is, and whose value in the task's process depends
|
|
16
|
+
* on the way the task runs: alone or in a batch, with which output style, in
|
|
17
|
+
* a pseudo-terminal or the terminal UI, with `--verbose` or with analytics on
|
|
18
|
+
* (`EVD-NX-24-BATCHES`, "Task environment"). The task's key, `NX_TASK_HASH`,
|
|
19
|
+
* which Nx does not hand a batch; where Nx writes the task's terminal output,
|
|
20
|
+
* whether it captures standard error into it, streams it or prefixes it,
|
|
21
|
+
* which follow the output style and the task's key; `FORCE_COLOR`, which Nx
|
|
22
|
+
* removes from a task whose output it writes to a file and sets for one whose
|
|
23
|
+
* output it pipes; the variables of Nx's pseudo-terminal, which a task run
|
|
24
|
+
* on its own in a terminal has and a task of a batch has not, one of them
|
|
25
|
+
* empty where Nx's own process has no `execArgv`; and those that the `nx`
|
|
26
|
+
* process sets from the command's options, the terminal UI's
|
|
27
|
+
* `NX_TUI_AUTO_EXIT`, `--verbose`'s `NX_VERBOSE_LOGGING`, and the session of
|
|
28
|
+
* Nx's analytics. Also the variables that Nx removes from every task, and
|
|
29
|
+
* that Nx's pseudo-terminal, which lays the task's environment over the
|
|
30
|
+
* `nx` process's own, gives back to a task run on its own in a terminal:
|
|
31
|
+
* `NX_SET_CLI`, `NX_ORIGINAL_FORCE_COLOR` and the ready signal's socket and
|
|
32
|
+
* task. The plugin leaves them out of every environment it runs cargo with,
|
|
33
|
+
* for a task run on its own as in a batch, so that no cargo command, build
|
|
34
|
+
* script or test sees them and no result can depend on them (`DES-BATCH`).
|
|
35
|
+
*/
|
|
36
|
+
export declare const nxRunVariables: readonly ["NX_TASK_HASH", "NX_TERMINAL_OUTPUT_PATH", "NX_TERMINAL_CAPTURE_STDERR", "NX_STREAM_OUTPUT", "NX_PREFIX_OUTPUT", "FORCE_COLOR", "NX_PSEUDO_TERMINAL_EXEC_ARGV", "NX_PSEUDO_IPC_PATH", "NX_PSEUDO_IPC_FORK_ID", "NX_TUI_AUTO_EXIT", "NX_VERBOSE_LOGGING", "NX_ANALYTICS_SESSION_ID", "NX_SET_CLI", "NX_ORIGINAL_FORCE_COLOR", "NX_READY_SIGNAL_SOCKET", "NX_READY_SIGNAL_TASK"];
|
|
37
|
+
/**
|
|
38
|
+
* The variables by which Nx names a task's project, which differ between the
|
|
39
|
+
* tasks of any two crates of one target, so that tasks that share a cargo
|
|
40
|
+
* command could not share an environment with them (`DES-BATCH`): Nx's
|
|
41
|
+
* `NX_TASK_TARGET_PROJECT` and `LERNA_PACKAGE_NAME`. The maintainer decided
|
|
42
|
+
* on 15 November 2026 that cargo never gets them, whether a task runs alone
|
|
43
|
+
* or in a batch (`ADR-TASK-NAME-VARIABLES`); a build script or test that
|
|
44
|
+
* needs its crate reads `CARGO_PKG_NAME`. The task's target and
|
|
45
|
+
* configuration, which the tasks of a group share, stay.
|
|
46
|
+
*/
|
|
47
|
+
export declare const taskNameVariables: readonly ["NX_TASK_TARGET_PROJECT", "LERNA_PACKAGE_NAME"];
|
|
48
|
+
/**
|
|
49
|
+
* What Nx sets for the process of a task run on its own after the task's
|
|
50
|
+
* dotenv files and its own variables (`EVD-NX-24-BATCHES`, "Task
|
|
51
|
+
* environment"): the fork's `NX_FORKED_TASK_EXECUTOR`
|
|
52
|
+
* (`forked-process-task-runner.js`) and then `NX_CLI_SET`, which the task's
|
|
53
|
+
* process sets when it starts (`bin/run-executor.js`). A batch process has
|
|
54
|
+
* both from its start, before the batch lays each task's dotenv files over
|
|
55
|
+
* them, so the batch sets them again after its task's own variables, in the
|
|
56
|
+
* same order ({@link batchTaskEnvironment}), and a dotenv file that defines
|
|
57
|
+
* one changes the value for neither.
|
|
58
|
+
*/
|
|
59
|
+
export declare const afterTaskLayer: Readonly<Record<string, string>>;
|
|
60
|
+
/** What the plugin knows of a task for {@link cargoTaskEnvironment}. */
|
|
61
|
+
export interface TaskShape {
|
|
62
|
+
/** The task's configuration, as Nx gives it to the task's own variables. */
|
|
63
|
+
configuration: string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the task waits for a continuous task that reports ready by
|
|
66
|
+
* signal, for which Nx sets `NX_READY_URL` ({@link readyUrlProducers}).
|
|
67
|
+
*/
|
|
68
|
+
readyUrlDependency: boolean;
|
|
69
|
+
}
|
|
70
|
+
/** The parts of Nx's task graph that {@link readyUrlProducers} reads. */
|
|
71
|
+
interface ReadinessTaskGraph {
|
|
72
|
+
tasks: Record<string, {
|
|
73
|
+
continuous?: boolean;
|
|
74
|
+
target: {
|
|
75
|
+
project: string;
|
|
76
|
+
target: string;
|
|
77
|
+
};
|
|
78
|
+
}>;
|
|
79
|
+
continuousDependencies?: Record<string, unknown[]>;
|
|
80
|
+
}
|
|
81
|
+
/** The parts of Nx's project graph that {@link readyUrlProducers} reads. */
|
|
82
|
+
interface ReadinessProjectGraph {
|
|
83
|
+
nodes: Record<string, {
|
|
84
|
+
data?: {
|
|
85
|
+
targets?: Record<string, {
|
|
86
|
+
readyWhen?: unknown;
|
|
87
|
+
}>;
|
|
88
|
+
};
|
|
89
|
+
}>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The continuous tasks from which Nx 24 gives the task `taskId`, run on its
|
|
93
|
+
* own, `NX_READY_URL`: those that an edge with `waitFor: "ready"` leads to
|
|
94
|
+
* and whose `readyWhen` reports ready by `signal`, the only check of Nx 24
|
|
95
|
+
* that reports a URL (`getReadyUrlEnv` in `task-orchestrator.js` and
|
|
96
|
+
* `mayReportReadyUrl` in `readiness/ready-when.js`, `EVD-NX-24-BATCHES`,
|
|
97
|
+
* "Continuous tasks"). Every other continuous dependency, with another check
|
|
98
|
+
* or none, gives the task nothing that a batch lacks (`DES-BATCH`).
|
|
99
|
+
*/
|
|
100
|
+
export declare function readyUrlProducers(taskId: string, taskGraph: ReadinessTaskGraph, projectGraph: ReadinessProjectGraph): string[];
|
|
101
|
+
/**
|
|
102
|
+
* Why the value of each variable that Nx 24 sets, changes or removes on the
|
|
103
|
+
* way from the `nx` command to the process of a task or of a batch depends
|
|
104
|
+
* on how the task runs, in the process where Nx expands a task's dotenv
|
|
105
|
+
* files or where the plugin checks them (`EVD-NX-24-BATCHES`, "Task
|
|
106
|
+
* environment"). Nx expands the dotenv files of a task run on its own in the
|
|
107
|
+
* `nx` process, before it adds the task's own variables, and a batch expands
|
|
108
|
+
* them in its own process, which Nx gives variables of its own; the plugin
|
|
109
|
+
* checks them in the task's process or in the batch's. A task whose dotenv
|
|
110
|
+
* files make Nx look one of them up fails, alone as in a batch
|
|
111
|
+
* ({@link dotenvProblem}, `DES-BATCH`).
|
|
112
|
+
*
|
|
113
|
+
* Each of them is also left out of cargo's environment
|
|
114
|
+
* ({@link nxRunVariables}), set or removed by Nx after the dotenv files for
|
|
115
|
+
* every task, set by the batch after them as Nx sets it after them for a
|
|
116
|
+
* task run on its own ({@link afterTaskLayer}), or made the same for every
|
|
117
|
+
* way of running by {@link cargoTaskEnvironment}: so a dotenv file that only
|
|
118
|
+
* defines one changes nothing that cargo sees.
|
|
119
|
+
*/
|
|
120
|
+
export declare const runDependentVariables: Readonly<Record<string, string>>;
|
|
121
|
+
/**
|
|
122
|
+
* A task's environment as the plugin runs cargo with it, and asks cargo for
|
|
123
|
+
* reports with it, as a new object: `env` without {@link nxRunVariables}
|
|
124
|
+
* and {@link taskNameVariables}, and with the variables that Nx gives the task in its own layer as that
|
|
125
|
+
* layer gives them in every way of running the task. Nx's pseudo-terminal
|
|
126
|
+
* lays the environment that Nx built for a task run on its own over the
|
|
127
|
+
* `nx` process's own, so that a variable which that layer leaves without a
|
|
128
|
+
* value comes back with the `nx` process's value in a terminal
|
|
129
|
+
* (`EVD-NX-24-BATCHES`, "Task environment"): `NX_SKIP_NX_CACHE` is `true`
|
|
130
|
+
* for a run that skips the cache and absent otherwise, and
|
|
131
|
+
* `NX_TASK_TARGET_CONFIGURATION` names the task's configuration or is
|
|
132
|
+
* absent. `NX_READY_URL`, which Nx sets only for a task that waits for a
|
|
133
|
+
* continuous task that reports ready by signal ({@link readyUrlProducers}),
|
|
134
|
+
* can otherwise only be the value of a task that runs the `nx` command, and
|
|
135
|
+
* is left out.
|
|
136
|
+
*/
|
|
137
|
+
export declare function cargoTaskEnvironment(env: NodeJS.ProcessEnv, task: TaskShape): NodeJS.ProcessEnv;
|
|
138
|
+
/**
|
|
139
|
+
* The root dotenv files that the `nx` process loads when it starts and that
|
|
140
|
+
* Nx's `getTaskSpecificEnv` removes again from every task's environment,
|
|
141
|
+
* each on its own, in this order (`unloadDotEnvFiles` in
|
|
142
|
+
* `tasks-runner/task-env.js`; `EVD-NX-24-BATCHES`, "Dotenv expansion").
|
|
143
|
+
*/
|
|
144
|
+
export declare const rootDotenvFiles: readonly [".env", ".local.env", ".env.local"];
|
|
145
|
+
/**
|
|
146
|
+
* `env` as the plugin gives it to cargo where Nx loads no dotenv files for
|
|
147
|
+
* the task, its `NX_LOAD_DOT_ENV_FILES` not being `true` (`DES-BATCH`,
|
|
148
|
+
* "Dotenv files"). Nx's `getTaskSpecificEnv` then still removes each variable
|
|
149
|
+
* whose value the root `.env`, `.local.env` or `.env.local` gives, without
|
|
150
|
+
* loading any file back, while Nx's pseudo-terminal gives a task run on its
|
|
151
|
+
* own in a terminal the `nx` process's values back (`EVD-NX-24-BATCHES`,
|
|
152
|
+
* "Task environment"). So the plugin removes them again, with Nx's own
|
|
153
|
+
* `unloadDotEnvFile`, from every variable apart from those that Nx sets
|
|
154
|
+
* after the dotenv layer: a task run on its own without a terminal and a
|
|
155
|
+
* task of a batch lack them already, and a task in a terminal loses what the
|
|
156
|
+
* pseudo-terminal gave back. Where Nx loads the files, `env` comes back as
|
|
157
|
+
* it is.
|
|
158
|
+
*
|
|
159
|
+
* @throws {TaskEnvironmentError} When the installed Nx lacks `unloadDotEnvFile`.
|
|
160
|
+
*/
|
|
161
|
+
export declare function withoutUnloadedRootValues(env: NodeJS.ProcessEnv, root: string): NodeJS.ProcessEnv;
|
|
162
|
+
/**
|
|
163
|
+
* The environment that the plugin gives cargo for a task of a batch, from
|
|
164
|
+
* the task's dotenv layer as Nx's `getTaskSpecificEnv` builds it in the batch
|
|
165
|
+
* process (`DES-BATCH`): Nx's `getEnvVariablesForTask` over it, as Nx calls it
|
|
166
|
+
* for a task whose output it does not write to a file;
|
|
167
|
+
* `NX_INVOCATION_ANCESTOR_PIDS` with the value that Nx gave the batch process,
|
|
168
|
+
* which it gives a task run on its own too, where computed in the batch
|
|
169
|
+
* process it would name that process as well; then {@link afterTaskLayer}, as
|
|
170
|
+
* the fork and the task's process set them for a task run on its own; and
|
|
171
|
+
* {@link cargoTaskEnvironment}. A task of a batch waits for no continuous
|
|
172
|
+
* task that reports ready by signal ({@link refuseReadyUrl} in `batch.ts`).
|
|
173
|
+
*
|
|
174
|
+
* @param processEnv The batch process's environment.
|
|
175
|
+
*/
|
|
176
|
+
export declare function batchTaskEnvironment(base: NodeJS.ProcessEnv, task: Task, taskLayer: EnvVariablesForTask, processEnv: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
177
|
+
/** `getEnvVariablesForTask` of Nx 24, which lays the per-task layer over it. */
|
|
178
|
+
export type EnvVariablesForTask = NxTaskEnv["getEnvVariablesForTask"];
|
|
179
|
+
/**
|
|
180
|
+
* The environment of each task of a batch, as Nx builds it for the task run
|
|
181
|
+
* on its own (`DES-BATCH`; `EVD-NX-24-BATCHES`, "Task environment"), with
|
|
182
|
+
* the functions that Nx uses for that, from `nx/src/tasks-runner/task-env`,
|
|
183
|
+
* which are no public API (`RISK-UPSTREAM-CHANGES`):
|
|
184
|
+
*
|
|
185
|
+
* 1. {@link taskDotenvLayer}: the dotenv layer of Nx's `getTaskSpecificEnv`,
|
|
186
|
+
* the environment of the `nx` command without the values that the
|
|
187
|
+
* repository's root `.env`, `.local.env` and `.env.local` gave it, with
|
|
188
|
+
* the task's dotenv files loaded in the order Nx reads them, those in the
|
|
189
|
+
* project's folder and those at the repository root named for the target
|
|
190
|
+
* or a configuration, with the root files last. Nx hands a batch process
|
|
191
|
+
* the command's environment, so the batch builds this layer from its own,
|
|
192
|
+
* which Nx made for its child processes as it makes a task's: with
|
|
193
|
+
* `NX_WORKSPACE_ROOT`, `NX_SKIP_NX_CACHE`, `NX_INVOCATION_ANCESTOR_PIDS`
|
|
194
|
+
* and `NX_FORKED_TASK_EXECUTOR`, and with `NX_CLI_SET`, which the process
|
|
195
|
+
* of a task run on its own sets too.
|
|
196
|
+
* 2. {@link batchTaskEnvironment}: Nx's `getEnvVariablesForTask` with the
|
|
197
|
+
* task's own variables, `NX_TASK_TARGET_PROJECT`, `NX_TASK_TARGET_TARGET`,
|
|
198
|
+
* `NX_TASK_TARGET_CONFIGURATION`, `LERNA_PACKAGE_NAME` and `NX_TUI=false`,
|
|
199
|
+
* and the removal of the variables that Nx keeps from every task; then
|
|
200
|
+
* what Nx sets after that layer for a task run on its own
|
|
201
|
+
* ({@link afterTaskLayer}); then {@link cargoTaskEnvironment} and
|
|
202
|
+
* {@link withoutUnloadedRootValues}, as for a task run on its own. What a
|
|
203
|
+
* task run on its own and a task of a batch give cargo is the same.
|
|
204
|
+
*
|
|
205
|
+
* Neither step writes to the batch process's environment; dotenv itself
|
|
206
|
+
* does where a vault lies beside a task's files ({@link taskDotenvLayer}).
|
|
207
|
+
*
|
|
208
|
+
* @param root The repository root, from where the installed Nx is loaded.
|
|
209
|
+
* @param shielded The variables of {@link runDependentVariables} that the
|
|
210
|
+
* task's dotenv files define ({@link shieldValue}).
|
|
211
|
+
* @returns A function that gives a task's environment, as a new object.
|
|
212
|
+
* @throws {TaskEnvironmentError} When the installed Nx lacks a function.
|
|
213
|
+
*/
|
|
214
|
+
export declare function taskEnvironments(root: string, graph: ProjectGraph, shielded?: (task: Task) => readonly string[]): (task: Task) => NodeJS.ProcessEnv;
|
|
215
|
+
/** The functions of `nx/src/tasks-runner/task-env` with which {@link taskDotenvLayer} builds a layer. */
|
|
216
|
+
export type DotenvParts = Pick<NxTaskEnv, "getEnvFilesForTask" | "loadAndExpandDotEnvFile" | "unloadDotEnvFile">;
|
|
217
|
+
/**
|
|
218
|
+
* A task's dotenv layer, as Nx 24's `getTaskSpecificEnv` builds it from the
|
|
219
|
+
* process's environment, built instead on a copy of `processEnv`, so that
|
|
220
|
+
* the plugin writes nothing to the batch process's own environment
|
|
221
|
+
* (`DES-BATCH`, "Dotenv files"): Nx's `unloadDotEnvFile` removes from the copy each value that a
|
|
222
|
+
* root dotenv file ({@link rootDotenvFiles}) gives, and, where `processEnv`
|
|
223
|
+
* has `NX_LOAD_DOT_ENV_FILES=true`, Nx's `loadAndExpandDotEnvFile` loads and
|
|
224
|
+
* expands into it the files that Nx's `getEnvFilesForTask` names for the
|
|
225
|
+
* task, under `root`, which is Nx's workspace root in a batch. Which files,
|
|
226
|
+
* in which order, and how their expansion sees the copy's values is Nx's
|
|
227
|
+
* own code. The plugin repeats three facts of Nx's wrapper: the root files,
|
|
228
|
+
* the order of the calls, and the load switch. A test compares the result
|
|
229
|
+
* with `getTaskSpecificEnv` itself on the installed Nx, and another fails
|
|
230
|
+
* where the source of the wrapper changes (`VER-BATCHING`).
|
|
231
|
+
*
|
|
232
|
+
* With `DOTENV_KEY` set and a vault beside the files, dotenv 16.4.7 parses
|
|
233
|
+
* the vault into the live `process.env` before it decrypts it, so Nx's
|
|
234
|
+
* loader sets the vault's `DOTENV_VAULT_<ENVIRONMENT>` there, as it does in
|
|
235
|
+
* the `nx` process for a task run on its own; the dotenv check refuses such
|
|
236
|
+
* a task (`DES-BATCH`, nxr-gcknzm).
|
|
237
|
+
*
|
|
238
|
+
* Each name of `shielded` has {@link shieldValue} in the copy before Nx's
|
|
239
|
+
* functions see it.
|
|
240
|
+
*
|
|
241
|
+
* @param processEnv The batch process's environment; the plugin does not change it.
|
|
242
|
+
* @returns The layer, as a new object.
|
|
243
|
+
* @throws {TaskEnvironmentError} When `getEnvFilesForTask` fails or gives no
|
|
244
|
+
* list of files.
|
|
245
|
+
*/
|
|
246
|
+
export declare function taskDotenvLayer(parts: DotenvParts, root: string, task: Task, graph: ProjectGraph, processEnv: NodeJS.ProcessEnv, shielded: readonly string[]): NodeJS.ProcessEnv;
|
|
247
|
+
/**
|
|
248
|
+
* The value that the batch gives, in the copy on which it builds a task's
|
|
249
|
+
* dotenv layer ({@link taskDotenvLayer}), to each variable of
|
|
250
|
+
* {@link runDependentVariables} that the task's dotenv files define
|
|
251
|
+
* (`DES-BATCH`, "Dotenv files"). dotenv-expand then takes this value, which
|
|
252
|
+
* no file gives, instead of expanding the file's, as it takes the `nx`
|
|
253
|
+
* process's own value where that process has one: so a definition whose
|
|
254
|
+
* expansion would not end, as `NX_ORIGINAL_FORCE_COLOR=${CMD}z` with
|
|
255
|
+
* `CMD=x${CMD}` in the command, which the `nx` process does not expand where
|
|
256
|
+
* the command has `FORCE_COLOR=0`, cannot exhaust the batch process's memory
|
|
257
|
+
* either. The value never reaches cargo: each of those variables is left out
|
|
258
|
+
* of cargo's environment or set after the dotenv layer in both paths.
|
|
259
|
+
*/
|
|
260
|
+
export declare const shieldValue = "\u0001@convesoft/nx-rust";
|
|
261
|
+
/**
|
|
262
|
+
* The configuration with which Nx 24 would run `target` of `project` for a
|
|
263
|
+
* command that passes `configuration`, by the installed Nx's own rule
|
|
264
|
+
* (`ProcessTasks.resolveConfiguration` in `create-task-graph.js`): the
|
|
265
|
+
* configuration passed where the target declares it, otherwise the target's
|
|
266
|
+
* `defaultConfiguration`, and none where that is empty.
|
|
267
|
+
*
|
|
268
|
+
* @throws {TaskEnvironmentError} When the installed Nx lacks the rule.
|
|
269
|
+
*/
|
|
270
|
+
export declare function nxTaskConfiguration(root: string, graph: ProjectGraph, project: string, target: string, configuration: string | undefined): string | undefined;
|
|
271
|
+
export {};
|