@convesoft/nx-rust 0.0.0 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +47 -1
- package/executors.json +35 -0
- package/generators.json +19 -0
- package/package.json +17 -4
- package/src/cargo/build-settings.d.ts +54 -0
- package/src/cargo/build-settings.js +93 -0
- package/src/cargo/build-settings.js.map +1 -0
- package/src/cargo/configured-runner.d.ts +36 -0
- package/src/cargo/configured-runner.js +99 -0
- package/src/cargo/configured-runner.js.map +1 -0
- package/src/cargo/configured-tools.d.ts +35 -0
- package/src/cargo/configured-tools.js +46 -0
- package/src/cargo/configured-tools.js.map +1 -0
- package/src/cargo/dep-info-basedir.d.ts +18 -0
- package/src/cargo/dep-info-basedir.js +38 -0
- package/src/cargo/dep-info-basedir.js.map +1 -0
- package/src/cargo/directories.d.ts +40 -0
- package/src/cargo/directories.js +89 -0
- package/src/cargo/directories.js.map +1 -0
- package/src/cargo/host-triple.d.ts +7 -0
- package/src/cargo/host-triple.js +21 -0
- package/src/cargo/host-triple.js.map +1 -0
- package/src/cargo/lockfile.d.ts +63 -0
- package/src/cargo/lockfile.js +157 -0
- package/src/cargo/lockfile.js.map +1 -0
- package/src/cargo/metadata.d.ts +112 -0
- package/src/cargo/metadata.js +37 -0
- package/src/cargo/metadata.js.map +1 -0
- package/src/cargo/package-specs.d.ts +54 -0
- package/src/cargo/package-specs.js +109 -0
- package/src/cargo/package-specs.js.map +1 -0
- package/src/cargo/paths-crates.d.ts +27 -0
- package/src/cargo/paths-crates.js +69 -0
- package/src/cargo/paths-crates.js.map +1 -0
- package/src/cargo/print-artifact-folders.d.ts +1 -0
- package/src/cargo/print-artifact-folders.js +58 -0
- package/src/cargo/print-artifact-folders.js.map +1 -0
- package/src/cargo/redirections.d.ts +87 -0
- package/src/cargo/redirections.js +195 -0
- package/src/cargo/redirections.js.map +1 -0
- package/src/cargo/run-cargo.d.ts +31 -0
- package/src/cargo/run-cargo.js +75 -0
- package/src/cargo/run-cargo.js.map +1 -0
- package/src/cargo/target-triples.d.ts +98 -0
- package/src/cargo/target-triples.js +265 -0
- package/src/cargo/target-triples.js.map +1 -0
- package/src/cargo/version-req.d.ts +12 -0
- package/src/cargo/version-req.js +122 -0
- package/src/cargo/version-req.js.map +1 -0
- package/src/compatibility/cargo-version.d.ts +43 -0
- package/src/compatibility/cargo-version.js +83 -0
- package/src/compatibility/cargo-version.js.map +1 -0
- package/src/compatibility/nx-bridge.d.ts +312 -0
- package/src/compatibility/nx-bridge.js +407 -0
- package/src/compatibility/nx-bridge.js.map +1 -0
- package/src/compatibility/nx-version.d.ts +104 -0
- package/src/compatibility/nx-version.js +272 -0
- package/src/compatibility/nx-version.js.map +1 -0
- package/src/executors/affected-inputs.d.ts +29 -0
- package/src/executors/affected-inputs.js +259 -0
- package/src/executors/affected-inputs.js.map +1 -0
- package/src/executors/affected-run.d.ts +54 -0
- package/src/executors/affected-run.js +394 -0
- package/src/executors/affected-run.js.map +1 -0
- package/src/executors/affected.d.ts +239 -0
- package/src/executors/affected.js +589 -0
- package/src/executors/affected.js.map +1 -0
- package/src/executors/baseline-context.d.ts +85 -0
- package/src/executors/baseline-context.js +227 -0
- package/src/executors/baseline-context.js.map +1 -0
- package/src/executors/baseline.d.ts +123 -0
- package/src/executors/baseline.js +356 -0
- package/src/executors/baseline.js.map +1 -0
- package/src/executors/batch.d.ts +75 -0
- package/src/executors/batch.js +434 -0
- package/src/executors/batch.js.map +1 -0
- package/src/executors/build-records.d.ts +110 -0
- package/src/executors/build-records.js +267 -0
- package/src/executors/build-records.js.map +1 -0
- package/src/executors/cargo/executor.d.ts +28 -0
- package/src/executors/cargo/executor.js +58 -0
- package/src/executors/cargo/executor.js.map +1 -0
- package/src/executors/cargo/schema.json +54 -0
- package/src/executors/cargo-invocation.d.ts +81 -0
- package/src/executors/cargo-invocation.js +109 -0
- package/src/executors/cargo-invocation.js.map +1 -0
- package/src/executors/cargo-output.d.ts +212 -0
- package/src/executors/cargo-output.js +646 -0
- package/src/executors/cargo-output.js.map +1 -0
- package/src/executors/command.d.ts +318 -0
- package/src/executors/command.js +517 -0
- package/src/executors/command.js.map +1 -0
- package/src/executors/coverage-baseline.d.ts +23 -0
- package/src/executors/coverage-baseline.js +284 -0
- package/src/executors/coverage-baseline.js.map +1 -0
- package/src/executors/declared-options.d.ts +21 -0
- package/src/executors/declared-options.js +58 -0
- package/src/executors/declared-options.js.map +1 -0
- package/src/executors/digests.d.ts +94 -0
- package/src/executors/digests.js +190 -0
- package/src/executors/digests.js.map +1 -0
- package/src/executors/dotenv-check.d.ts +79 -0
- package/src/executors/dotenv-check.js +553 -0
- package/src/executors/dotenv-check.js.map +1 -0
- package/src/executors/group-invocations.d.ts +80 -0
- package/src/executors/group-invocations.js +253 -0
- package/src/executors/group-invocations.js.map +1 -0
- package/src/executors/group-run.d.ts +114 -0
- package/src/executors/group-run.js +591 -0
- package/src/executors/group-run.js.map +1 -0
- package/src/executors/groups.d.ts +113 -0
- package/src/executors/groups.js +285 -0
- package/src/executors/groups.js.map +1 -0
- package/src/executors/input-check.d.ts +52 -0
- package/src/executors/input-check.js +271 -0
- package/src/executors/input-check.js.map +1 -0
- package/src/executors/kept-files.d.ts +98 -0
- package/src/executors/kept-files.js +341 -0
- package/src/executors/kept-files.js.map +1 -0
- package/src/executors/lockfile/executor.d.ts +16 -0
- package/src/executors/lockfile/executor.js +37 -0
- package/src/executors/lockfile/executor.js.map +1 -0
- package/src/executors/lockfile/schema.json +50 -0
- package/src/executors/napi-build.d.ts +73 -0
- package/src/executors/napi-build.js +420 -0
- package/src/executors/napi-build.js.map +1 -0
- package/src/executors/nextest.d.ts +185 -0
- package/src/executors/nextest.js +498 -0
- package/src/executors/nextest.js.map +1 -0
- package/src/executors/nx-command.d.ts +95 -0
- package/src/executors/nx-command.js +205 -0
- package/src/executors/nx-command.js.map +1 -0
- package/src/executors/nx-task-files.d.ts +82 -0
- package/src/executors/nx-task-files.js +156 -0
- package/src/executors/nx-task-files.js.map +1 -0
- package/src/executors/print-test-mode.d.ts +1 -0
- package/src/executors/print-test-mode.js +25 -0
- package/src/executors/print-test-mode.js.map +1 -0
- package/src/executors/release-publish/executor.d.ts +24 -0
- package/src/executors/release-publish/executor.js +165 -0
- package/src/executors/release-publish/executor.js.map +1 -0
- package/src/executors/release-publish/schema.json +30 -0
- package/src/executors/run/executor.d.ts +12 -0
- package/src/executors/run/executor.js +27 -0
- package/src/executors/run/executor.js.map +1 -0
- package/src/executors/run/schema.json +45 -0
- package/src/executors/runner-script.d.ts +12 -0
- package/src/executors/runner-script.js +22 -0
- package/src/executors/runner-script.js.map +1 -0
- package/src/executors/runtime-input-check.d.ts +24 -0
- package/src/executors/runtime-input-check.js +87 -0
- package/src/executors/runtime-input-check.js.map +1 -0
- package/src/executors/shared-artifacts.d.ts +44 -0
- package/src/executors/shared-artifacts.js +132 -0
- package/src/executors/shared-artifacts.js.map +1 -0
- package/src/executors/split-words.d.ts +24 -0
- package/src/executors/split-words.js +111 -0
- package/src/executors/split-words.js.map +1 -0
- package/src/executors/stage.d.ts +163 -0
- package/src/executors/stage.js +526 -0
- package/src/executors/stage.js.map +1 -0
- package/src/executors/staged-run.d.ts +24 -0
- package/src/executors/staged-run.js +110 -0
- package/src/executors/staged-run.js.map +1 -0
- package/src/executors/task-env.d.ts +271 -0
- package/src/executors/task-env.js +494 -0
- package/src/executors/task-env.js.map +1 -0
- package/src/executors/task-execution.d.ts +61 -0
- package/src/executors/task-execution.js +122 -0
- package/src/executors/task-execution.js.map +1 -0
- package/src/executors/task-guards.d.ts +112 -0
- package/src/executors/task-guards.js +430 -0
- package/src/executors/task-guards.js.map +1 -0
- package/src/executors/task-options.d.ts +114 -0
- package/src/executors/task-options.js +258 -0
- package/src/executors/task-options.js.map +1 -0
- package/src/executors/task.d.ts +166 -0
- package/src/executors/task.js +520 -0
- package/src/executors/task.js.map +1 -0
- package/src/executors/test-mode.d.ts +182 -0
- package/src/executors/test-mode.js +391 -0
- package/src/executors/test-mode.js.map +1 -0
- package/src/executors/test-runner.d.ts +44 -0
- package/src/executors/test-runner.js +159 -0
- package/src/executors/test-runner.js.map +1 -0
- package/src/executors/test-steps.d.ts +109 -0
- package/src/executors/test-steps.js +535 -0
- package/src/executors/test-steps.js.map +1 -0
- package/src/executors/wasm-build.d.ts +56 -0
- package/src/executors/wasm-build.js +216 -0
- package/src/executors/wasm-build.js.map +1 -0
- package/src/generators/crate/binary.schema.json +28 -0
- package/src/generators/crate/crate.d.ts +24 -0
- package/src/generators/crate/crate.js +108 -0
- package/src/generators/crate/crate.js.map +1 -0
- package/src/generators/crate/enclosing-workspace.d.ts +25 -0
- package/src/generators/crate/enclosing-workspace.js +58 -0
- package/src/generators/crate/enclosing-workspace.js.map +1 -0
- package/src/generators/crate/library.schema.json +28 -0
- package/src/generators/init/graph-check.d.ts +81 -0
- package/src/generators/init/graph-check.js +299 -0
- package/src/generators/init/graph-check.js.map +1 -0
- package/src/generators/init/init.d.ts +23 -0
- package/src/generators/init/init.js +113 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/report.d.ts +19 -0
- package/src/generators/init/report.js +93 -0
- package/src/generators/init/report.js.map +1 -0
- package/src/generators/init/schema.json +9 -0
- package/src/graph/artifact-kinds.d.ts +29 -0
- package/src/graph/artifact-kinds.js +50 -0
- package/src/graph/artifact-kinds.js.map +1 -0
- package/src/graph/artifact-names.d.ts +97 -0
- package/src/graph/artifact-names.js +276 -0
- package/src/graph/artifact-names.js.map +1 -0
- package/src/graph/build-records.d.ts +74 -0
- package/src/graph/build-records.js +104 -0
- package/src/graph/build-records.js.map +1 -0
- package/src/graph/caching.d.ts +148 -0
- package/src/graph/caching.js +676 -0
- package/src/graph/caching.js.map +1 -0
- package/src/graph/collisions.d.ts +106 -0
- package/src/graph/collisions.js +156 -0
- package/src/graph/collisions.js.map +1 -0
- package/src/graph/computation-reports.d.ts +89 -0
- package/src/graph/computation-reports.js +216 -0
- package/src/graph/computation-reports.js.map +1 -0
- package/src/graph/declared-files.d.ts +190 -0
- package/src/graph/declared-files.js +600 -0
- package/src/graph/declared-files.js.map +1 -0
- package/src/graph/discovery.d.ts +175 -0
- package/src/graph/discovery.js +656 -0
- package/src/graph/discovery.js.map +1 -0
- package/src/graph/edges.d.ts +25 -0
- package/src/graph/edges.js +94 -0
- package/src/graph/edges.js.map +1 -0
- package/src/graph/entries.d.ts +83 -0
- package/src/graph/entries.js +259 -0
- package/src/graph/entries.js.map +1 -0
- package/src/graph/inputs.d.ts +420 -0
- package/src/graph/inputs.js +746 -0
- package/src/graph/inputs.js.map +1 -0
- package/src/graph/lockfile-task.d.ts +74 -0
- package/src/graph/lockfile-task.js +105 -0
- package/src/graph/lockfile-task.js.map +1 -0
- package/src/graph/names.d.ts +41 -0
- package/src/graph/names.js +34 -0
- package/src/graph/names.js.map +1 -0
- package/src/graph/napi.d.ts +107 -0
- package/src/graph/napi.js +206 -0
- package/src/graph/napi.js.map +1 -0
- package/src/graph/nx-glob.d.ts +36 -0
- package/src/graph/nx-glob.js +152 -0
- package/src/graph/nx-glob.js.map +1 -0
- package/src/graph/nx-internals.d.ts +57 -0
- package/src/graph/nx-internals.js +128 -0
- package/src/graph/nx-internals.js.map +1 -0
- package/src/graph/options.d.ts +32 -0
- package/src/graph/options.js +80 -0
- package/src/graph/options.js.map +1 -0
- package/src/graph/outputs.d.ts +75 -0
- package/src/graph/outputs.js +140 -0
- package/src/graph/outputs.js.map +1 -0
- package/src/graph/path-dependencies.d.ts +122 -0
- package/src/graph/path-dependencies.js +459 -0
- package/src/graph/path-dependencies.js.map +1 -0
- package/src/graph/plugin-package.d.ts +36 -0
- package/src/graph/plugin-package.js +132 -0
- package/src/graph/plugin-package.js.map +1 -0
- package/src/graph/plugin-version.d.ts +20 -0
- package/src/graph/plugin-version.js +153 -0
- package/src/graph/plugin-version.js.map +1 -0
- package/src/graph/projects.d.ts +141 -0
- package/src/graph/projects.js +182 -0
- package/src/graph/projects.js.map +1 -0
- package/src/graph/reached-projects.d.ts +46 -0
- package/src/graph/reached-projects.js +102 -0
- package/src/graph/reached-projects.js.map +1 -0
- package/src/graph/real-path.d.ts +47 -0
- package/src/graph/real-path.js +113 -0
- package/src/graph/real-path.js.map +1 -0
- package/src/graph/redirected-uses.d.ts +98 -0
- package/src/graph/redirected-uses.js +434 -0
- package/src/graph/redirected-uses.js.map +1 -0
- package/src/graph/registration.d.ts +121 -0
- package/src/graph/registration.js +233 -0
- package/src/graph/registration.js.map +1 -0
- package/src/graph/script-input.d.ts +46 -0
- package/src/graph/script-input.js +65 -0
- package/src/graph/script-input.js.map +1 -0
- package/src/graph/settings.d.ts +178 -0
- package/src/graph/settings.js +479 -0
- package/src/graph/settings.js.map +1 -0
- package/src/graph/target-defaults-causes.d.ts +33 -0
- package/src/graph/target-defaults-causes.js +202 -0
- package/src/graph/target-defaults-causes.js.map +1 -0
- package/src/graph/target-defaults-layers.d.ts +186 -0
- package/src/graph/target-defaults-layers.js +420 -0
- package/src/graph/target-defaults-layers.js.map +1 -0
- package/src/graph/target-defaults-meaning.d.ts +95 -0
- package/src/graph/target-defaults-meaning.js +292 -0
- package/src/graph/target-defaults-meaning.js.map +1 -0
- package/src/graph/target-defaults-report.d.ts +77 -0
- package/src/graph/target-defaults-report.js +242 -0
- package/src/graph/target-defaults-report.js.map +1 -0
- package/src/graph/target-defaults.d.ts +79 -0
- package/src/graph/target-defaults.js +425 -0
- package/src/graph/target-defaults.js.map +1 -0
- package/src/graph/target-fields.d.ts +16 -0
- package/src/graph/target-fields.js +134 -0
- package/src/graph/target-fields.js.map +1 -0
- package/src/graph/target-tables.d.ts +45 -0
- package/src/graph/target-tables.js +299 -0
- package/src/graph/target-tables.js.map +1 -0
- package/src/graph/targets.d.ts +367 -0
- package/src/graph/targets.js +404 -0
- package/src/graph/targets.js.map +1 -0
- package/src/graph/unification.d.ts +141 -0
- package/src/graph/unification.js +459 -0
- package/src/graph/unification.js.map +1 -0
- package/src/graph/unignored-directories.d.ts +25 -0
- package/src/graph/unignored-directories.js +89 -0
- package/src/graph/unignored-directories.js.map +1 -0
- package/src/graph/visibility.d.ts +17 -0
- package/src/graph/visibility.js +67 -0
- package/src/graph/visibility.js.map +1 -0
- package/src/graph/warnings.d.ts +38 -0
- package/src/graph/warnings.js +77 -0
- package/src/graph/warnings.js.map +1 -0
- package/src/graph/wasm.d.ts +56 -0
- package/src/graph/wasm.js +77 -0
- package/src/graph/wasm.js.map +1 -0
- package/src/index.d.ts +68 -0
- package/src/index.js +109 -0
- package/src/index.js.map +1 -0
- package/src/release/manifests.d.ts +95 -0
- package/src/release/manifests.js +164 -0
- package/src/release/manifests.js.map +1 -0
- package/src/release/places.d.ts +127 -0
- package/src/release/places.js +368 -0
- package/src/release/places.js.map +1 -0
- package/src/release/publish-cargo.d.ts +177 -0
- package/src/release/publish-cargo.js +351 -0
- package/src/release/publish-cargo.js.map +1 -0
- package/src/release/publish-crates.d.ts +124 -0
- package/src/release/publish-crates.js +242 -0
- package/src/release/publish-crates.js.map +1 -0
- package/src/release/publish-environments.d.ts +50 -0
- package/src/release/publish-environments.js +284 -0
- package/src/release/publish-environments.js.map +1 -0
- package/src/release/publish-messages.d.ts +66 -0
- package/src/release/publish-messages.js +273 -0
- package/src/release/publish-messages.js.map +1 -0
- package/src/release/publish-registry.d.ts +27 -0
- package/src/release/publish-registry.js +135 -0
- package/src/release/publish-registry.js.map +1 -0
- package/src/release/publish-settings.d.ts +26 -0
- package/src/release/publish-settings.js +56 -0
- package/src/release/publish-settings.js.map +1 -0
- package/src/release/publish.d.ts +59 -0
- package/src/release/publish.js +620 -0
- package/src/release/publish.js.map +1 -0
- package/src/release/repository.d.ts +73 -0
- package/src/release/repository.js +219 -0
- package/src/release/repository.js.map +1 -0
- package/src/release/requirements.d.ts +34 -0
- package/src/release/requirements.js +30 -0
- package/src/release/requirements.js.map +1 -0
- package/src/release/toml-edit.d.ts +67 -0
- package/src/release/toml-edit.js +453 -0
- package/src/release/toml-edit.js.map +1 -0
- package/src/release/version-actions.d.ts +133 -0
- package/src/release/version-actions.js +474 -0
- package/src/release/version-actions.js.map +1 -0
- package/src/release/version-checks.d.ts +21 -0
- package/src/release/version-checks.js +151 -0
- package/src/release/version-checks.js.map +1 -0
- package/src/release/version-lockfiles.d.ts +61 -0
- package/src/release/version-lockfiles.js +222 -0
- package/src/release/version-lockfiles.js.map +1 -0
- package/src/tools/napi-cli.d.ts +70 -0
- package/src/tools/napi-cli.js +63 -0
- package/src/tools/napi-cli.js.map +1 -0
- package/src/tools/optional-tools.d.ts +121 -0
- package/src/tools/optional-tools.js +303 -0
- package/src/tools/optional-tools.js.map +1 -0
- package/src/tools/print-napi-cli.d.ts +1 -0
- package/src/tools/print-napi-cli.js +24 -0
- package/src/tools/print-napi-cli.js.map +1 -0
package/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Aliaksei Raketski
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/LICENSE-MIT
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aliaksei Raketski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
1
1
|
# @convesoft/nx-rust
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An Nx plugin that makes Cargo workspaces first-class Nx projects while Cargo
|
|
4
|
+
stays the build tool. It is written for monorepos where Rust crates sit beside
|
|
5
|
+
JS and TS projects.
|
|
6
|
+
|
|
7
|
+
> **Status:** milestones 0.1 to 0.5 of the
|
|
8
|
+
> [roadmap](https://github.com/convesoft/nx-rust/blob/main/nx-rust/docs/product.mara.md#roadmap)
|
|
9
|
+
> are implemented on the [`main` branch](https://github.com/convesoft/nx-rust).
|
|
10
|
+
> What is left of v1 is 1.0. It is not published to npm yet; publishing is
|
|
11
|
+
> decided at 1.0.
|
|
12
|
+
|
|
13
|
+
- **Nothing to describe twice.** Projects, targets and dependencies come from
|
|
14
|
+
`cargo metadata`. No crate needs a `project.json`.
|
|
15
|
+
- **Cargo keeps working.** Plain `cargo` and rust-analyzer behave as they would
|
|
16
|
+
without the plugin.
|
|
17
|
+
- **A cache you can trust.** Nx stores task results and final artifacts, never
|
|
18
|
+
Cargo's intermediate files.
|
|
19
|
+
- **Few cargo invocations**: a few cargo commands per group
|
|
20
|
+
of tasks, one for most targets, instead of one per crate.
|
|
21
|
+
- **Rust and JS in one graph.** `nx affected -t lint test build` covers both.
|
|
22
|
+
|
|
23
|
+
## Requirements
|
|
24
|
+
|
|
25
|
+
Nx 24, Cargo 1.91 or later, Linux or macOS. macOS is not covered by
|
|
26
|
+
CI yet.
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
nx add @convesoft/nx-rust # once the package is on npm
|
|
32
|
+
nx affected -t lint test build
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Overrides live in `Cargo.toml`:
|
|
36
|
+
|
|
37
|
+
```toml
|
|
38
|
+
[package.metadata.nx]
|
|
39
|
+
tags = ["scope:backend"]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Documentation
|
|
43
|
+
|
|
44
|
+
The user guide and specification are in the repository:
|
|
45
|
+
<https://github.com/convesoft/nx-rust/blob/main/nx-rust/docs/index.mara.md>
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
MIT OR Apache-2.0
|
package/executors.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"executors": {
|
|
3
|
+
"cargo": {
|
|
4
|
+
"implementation": "./src/executors/cargo/executor",
|
|
5
|
+
"batchImplementation": "./src/executors/cargo/executor#batch",
|
|
6
|
+
"preferBatch": true,
|
|
7
|
+
"schema": "./src/executors/cargo/schema.json",
|
|
8
|
+
"description": "Runs the cargo command of an inferred target of a crate or a Cargo workspace, other than build, the artifact targets and doc."
|
|
9
|
+
},
|
|
10
|
+
"cargo-outputs": {
|
|
11
|
+
"implementation": "./src/executors/cargo/executor#outputsTask",
|
|
12
|
+
"batchImplementation": "./src/executors/cargo/executor#outputsBatch",
|
|
13
|
+
"preferBatch": true,
|
|
14
|
+
"schema": "./src/executors/cargo/schema.json",
|
|
15
|
+
"description": "Runs the cargo command of the build, napi-build and wasm-build targets of a crate or the doc target of a Cargo workspace, whose files Nx stores."
|
|
16
|
+
},
|
|
17
|
+
"run": {
|
|
18
|
+
"implementation": "./src/executors/run/executor",
|
|
19
|
+
"schema": "./src/executors/run/schema.json",
|
|
20
|
+
"description": "Runs a binary of a crate with cargo run."
|
|
21
|
+
},
|
|
22
|
+
"lockfile": {
|
|
23
|
+
"implementation": "./src/executors/lockfile/executor",
|
|
24
|
+
"schema": "./src/executors/lockfile/schema.json",
|
|
25
|
+
"description": "Lets cargo update --workspace bring a Cargo workspace's Cargo.lock up to date and writes a digest of each member's locked dependencies; also runs hakari-check and the coverage baseline target of the workspace."
|
|
26
|
+
},
|
|
27
|
+
"release-publish": {
|
|
28
|
+
"implementation": "./src/executors/release-publish/executor",
|
|
29
|
+
"batchImplementation": "./src/executors/release-publish/executor#batch",
|
|
30
|
+
"preferBatch": true,
|
|
31
|
+
"schema": "./src/executors/release-publish/schema.json",
|
|
32
|
+
"description": "Publishes the crates of each Cargo workspace and registry with one cargo publish for nx release publish."
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
package/generators.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generators": {
|
|
3
|
+
"init": {
|
|
4
|
+
"factory": "./src/generators/init/init",
|
|
5
|
+
"schema": "./src/generators/init/schema.json",
|
|
6
|
+
"description": "Register the plugin in nx.json, add empty targetDefaults entries for its executors and report missing tools. `nx add @convesoft/nx-rust` runs it."
|
|
7
|
+
},
|
|
8
|
+
"library": {
|
|
9
|
+
"factory": "./src/generators/crate/crate#libraryGenerator",
|
|
10
|
+
"schema": "./src/generators/crate/library.schema.json",
|
|
11
|
+
"description": "Create a library crate with cargo new."
|
|
12
|
+
},
|
|
13
|
+
"binary": {
|
|
14
|
+
"factory": "./src/generators/crate/crate#binaryGenerator",
|
|
15
|
+
"schema": "./src/generators/crate/binary.schema.json",
|
|
16
|
+
"description": "Create a binary crate with cargo new."
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@convesoft/nx-rust",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
|
+
"description": "Nx plugin for Rust projects",
|
|
5
5
|
"license": "MIT OR Apache-2.0",
|
|
6
6
|
"author": "Aliaksei Raketski",
|
|
7
7
|
"repository": {
|
|
@@ -9,7 +9,20 @@
|
|
|
9
9
|
"url": "git+https://github.com/convesoft/nx-rust.git",
|
|
10
10
|
"directory": "nx-rust"
|
|
11
11
|
},
|
|
12
|
+
"type": "commonjs",
|
|
13
|
+
"main": "./src/index.js",
|
|
14
|
+
"types": "./src/index.d.ts",
|
|
12
15
|
"publishConfig": {
|
|
13
16
|
"access": "public"
|
|
14
|
-
}
|
|
15
|
-
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@nx/devkit": "^24.0.6",
|
|
20
|
+
"smol-toml": "^1.9.0",
|
|
21
|
+
"tslib": "^2.3.0"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"nx": "^24"
|
|
25
|
+
},
|
|
26
|
+
"executors": "./executors.json",
|
|
27
|
+
"generators": "./generators.json"
|
|
28
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** One value of a key of the `[build]` table in a configuration file that cargo reads. */
|
|
2
|
+
export interface BuildSetting {
|
|
3
|
+
/** The absolute path of the file. */
|
|
4
|
+
file: string;
|
|
5
|
+
/** The value as the file gives it. */
|
|
6
|
+
value: unknown;
|
|
7
|
+
/** Whether cargo reads the file only because another one includes it. */
|
|
8
|
+
included: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A configuration file that cargo reads but that exists and cannot be read
|
|
12
|
+
* or parsed, so that whether it sets a key is unknown.
|
|
13
|
+
*/
|
|
14
|
+
export interface UnreadableFile {
|
|
15
|
+
/** The absolute path of the file. */
|
|
16
|
+
file: string;
|
|
17
|
+
unreadable: true;
|
|
18
|
+
/** Whether cargo reads the file only because another one includes it. */
|
|
19
|
+
included: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The values of `build.<key>` in the configuration files that cargo reads
|
|
23
|
+
* for a command started in `folder`, in descending precedence:
|
|
24
|
+
*
|
|
25
|
+
* - The files are those of `folder`, of each folder above it and of the
|
|
26
|
+
* Cargo home ({@link configFiles}), with the files they include.
|
|
27
|
+
* - A deeper folder comes before the folders above it, a file's own value
|
|
28
|
+
* before the files it includes, and a later include before an earlier
|
|
29
|
+
* one, each with its own includes after it.
|
|
30
|
+
* - Each file of the walk counts in its own place, also where a deeper
|
|
31
|
+
* file includes it too: cargo loads each file of the walk with its own
|
|
32
|
+
* includes, so later versions read such a file in both places, and Cargo
|
|
33
|
+
* 1.91, which ignores `include`, in its own place only
|
|
34
|
+
* (`EVD-CARGO-COMPILER-SELECTION`). Within one file of the walk, a file
|
|
35
|
+
* that several includes name counts once, and the Cargo home counts once
|
|
36
|
+
* where it is also one of the folders.
|
|
37
|
+
* - Files that do not exist, or that exist and cannot be read or parsed,
|
|
38
|
+
* are skipped: graph creation reports the latter, and cargo fails on
|
|
39
|
+
* them. {@link buildSettingsAndUnreadable} names those in their place.
|
|
40
|
+
*
|
|
41
|
+
* Cargo 1.91 ignores `include` and later versions apply it, so each value
|
|
42
|
+
* says whether cargo reads it only through an include: the values that
|
|
43
|
+
* are not are those that Cargo 1.91 reads.
|
|
44
|
+
*
|
|
45
|
+
* @param env Where `CARGO_HOME` is read from.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildSettings(folder: string, env: Readonly<Record<string, string | undefined>>, key: string): BuildSetting[];
|
|
48
|
+
/**
|
|
49
|
+
* {@link buildSettings}, with each file that exists but cannot be read or
|
|
50
|
+
* parsed in its place in the order, for a reader that must not guess past
|
|
51
|
+
* it. Only a file that does not exist counts as absent; a file whose folder
|
|
52
|
+
* is no folder, such as a `.cargo` that is a file, counts as unreadable.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildSettingsAndUnreadable(folder: string, env: Readonly<Record<string, string | undefined>>, key: string): (BuildSetting | UnreadableFile)[];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildSettings = buildSettings;
|
|
4
|
+
exports.buildSettingsAndUnreadable = buildSettingsAndUnreadable;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const smol_toml_1 = require("smol-toml");
|
|
8
|
+
const redirections_1 = require("./redirections");
|
|
9
|
+
/**
|
|
10
|
+
* The values of `build.<key>` in the configuration files that cargo reads
|
|
11
|
+
* for a command started in `folder`, in descending precedence:
|
|
12
|
+
*
|
|
13
|
+
* - The files are those of `folder`, of each folder above it and of the
|
|
14
|
+
* Cargo home ({@link configFiles}), with the files they include.
|
|
15
|
+
* - A deeper folder comes before the folders above it, a file's own value
|
|
16
|
+
* before the files it includes, and a later include before an earlier
|
|
17
|
+
* one, each with its own includes after it.
|
|
18
|
+
* - Each file of the walk counts in its own place, also where a deeper
|
|
19
|
+
* file includes it too: cargo loads each file of the walk with its own
|
|
20
|
+
* includes, so later versions read such a file in both places, and Cargo
|
|
21
|
+
* 1.91, which ignores `include`, in its own place only
|
|
22
|
+
* (`EVD-CARGO-COMPILER-SELECTION`). Within one file of the walk, a file
|
|
23
|
+
* that several includes name counts once, and the Cargo home counts once
|
|
24
|
+
* where it is also one of the folders.
|
|
25
|
+
* - Files that do not exist, or that exist and cannot be read or parsed,
|
|
26
|
+
* are skipped: graph creation reports the latter, and cargo fails on
|
|
27
|
+
* them. {@link buildSettingsAndUnreadable} names those in their place.
|
|
28
|
+
*
|
|
29
|
+
* Cargo 1.91 ignores `include` and later versions apply it, so each value
|
|
30
|
+
* says whether cargo reads it only through an include: the values that
|
|
31
|
+
* are not are those that Cargo 1.91 reads.
|
|
32
|
+
*
|
|
33
|
+
* @param env Where `CARGO_HOME` is read from.
|
|
34
|
+
*/
|
|
35
|
+
function buildSettings(folder, env, key) {
|
|
36
|
+
return buildSettingsAndUnreadable(folder, env, key).filter((entry) => !("unreadable" in entry));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* {@link buildSettings}, with each file that exists but cannot be read or
|
|
40
|
+
* parsed in its place in the order, for a reader that must not guess past
|
|
41
|
+
* it. Only a file that does not exist counts as absent; a file whose folder
|
|
42
|
+
* is no folder, such as a `.cargo` that is a file, counts as unreadable.
|
|
43
|
+
*/
|
|
44
|
+
function buildSettingsAndUnreadable(folder, env, key) {
|
|
45
|
+
const entries = [];
|
|
46
|
+
const walked = new Set();
|
|
47
|
+
for (const [legacy, current] of (0, redirections_1.configFiles)(folder, env)) {
|
|
48
|
+
const file = (0, node_fs_1.existsSync)(legacy) ? legacy : current;
|
|
49
|
+
if (!walked.has(file)) {
|
|
50
|
+
walked.add(file);
|
|
51
|
+
// A record of its own, so that a file that a deeper file includes
|
|
52
|
+
// still counts here, where Cargo 1.91 reads it.
|
|
53
|
+
collect(file, key, false, new Set(), entries);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return entries;
|
|
57
|
+
}
|
|
58
|
+
// Adds the value of `file` and of the files it includes, in descending
|
|
59
|
+
// precedence: the file's own value, then its includes from the last to the
|
|
60
|
+
// first, each with its own includes after it.
|
|
61
|
+
function collect(file, key, included, read, entries) {
|
|
62
|
+
if (read.has(file)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
read.add(file);
|
|
66
|
+
let table;
|
|
67
|
+
try {
|
|
68
|
+
table = (0, smol_toml_1.parse)((0, node_fs_1.readFileSync)(file, "utf8"));
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
if (error.code !== "ENOENT") {
|
|
72
|
+
entries.push({ file, unreadable: true, included });
|
|
73
|
+
}
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const build = asTable(table.build);
|
|
77
|
+
if (build[key] !== undefined) {
|
|
78
|
+
entries.push({ file, value: build[key], included });
|
|
79
|
+
}
|
|
80
|
+
const includes = Array.isArray(table.include) ? table.include : [table.include];
|
|
81
|
+
for (const include of [...includes].reverse()) {
|
|
82
|
+
const path = typeof include === "string" ? include : asTable(include).path;
|
|
83
|
+
if (typeof path === "string") {
|
|
84
|
+
collect((0, node_path_1.resolve)((0, node_path_1.dirname)(file), path), key, true, read, entries);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function asTable(value) {
|
|
89
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
90
|
+
? value
|
|
91
|
+
: {};
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=build-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-settings.js","sourceRoot":"","sources":["../../../../nx-rust/src/cargo/build-settings.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Where a runner for the host is or may be configured, as a task's output names it. */
|
|
2
|
+
export interface ConfiguredRunner {
|
|
3
|
+
/** The variable or the absolute path of the file. */
|
|
4
|
+
source: string;
|
|
5
|
+
/** What it sets, or why it counts. */
|
|
6
|
+
detail: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The name of the variable through which cargo takes a runner for `triple`:
|
|
10
|
+
* `CARGO_TARGET_<TRIPLE>_RUNNER`, with the triple in capitals and `-` and `.`
|
|
11
|
+
* replaced by `_`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runnerVariable(triple: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Where a runner for the host is or may be configured for a cargo command
|
|
16
|
+
* started in `workspaceRoot` with `env` (`DES-TEST-RUN`, "A runner the user
|
|
17
|
+
* configured"), the first that the plugin finds, or `undefined`:
|
|
18
|
+
*
|
|
19
|
+
* - `CARGO_TARGET_<HOST>_RUNNER` in `env`, whatever its value;
|
|
20
|
+
* - a configuration file that cargo may read there that sets `runner` in the
|
|
21
|
+
* table `target.<host>`, or in any table under `target` whose key starts
|
|
22
|
+
* with `cfg(`, whether or not its expression matches the host. The files
|
|
23
|
+
* are `.cargo/config` and `.cargo/config.toml` in `workspaceRoot` and in
|
|
24
|
+
* each folder above it, both where both exist; `config` and `config.toml`
|
|
25
|
+
* in the Cargo home that `CARGO_HOME` in `env` names, or else in `.cargo`
|
|
26
|
+
* in the home folder; and every file that one of them adds with
|
|
27
|
+
* `include`, in any form and whatever the cargo version reads, with paths
|
|
28
|
+
* taken from the folder of the file that includes it;
|
|
29
|
+
* - such a file that exists and cannot be read or parsed, so that whether it
|
|
30
|
+
* sets a runner is unknown.
|
|
31
|
+
*
|
|
32
|
+
* Reading the user's runner as cargo applies it is not attempted: no reading
|
|
33
|
+
* gives what cargo uses in every case on Cargo 1.91 and 1.100
|
|
34
|
+
* (`EVD-WORKSPACE-TEST-SELECTION`), so every place where one may be counts.
|
|
35
|
+
*/
|
|
36
|
+
export declare function configuredRunner(workspaceRoot: string, env: Readonly<Record<string, string | undefined>>, host: string): ConfiguredRunner | undefined;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runnerVariable = runnerVariable;
|
|
4
|
+
exports.configuredRunner = configuredRunner;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const smol_toml_1 = require("smol-toml");
|
|
8
|
+
const redirections_1 = require("./redirections");
|
|
9
|
+
/**
|
|
10
|
+
* The name of the variable through which cargo takes a runner for `triple`:
|
|
11
|
+
* `CARGO_TARGET_<TRIPLE>_RUNNER`, with the triple in capitals and `-` and `.`
|
|
12
|
+
* replaced by `_`.
|
|
13
|
+
*/
|
|
14
|
+
function runnerVariable(triple) {
|
|
15
|
+
return `CARGO_TARGET_${triple.toUpperCase().replace(/[-.]/g, "_")}_RUNNER`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Where a runner for the host is or may be configured for a cargo command
|
|
19
|
+
* started in `workspaceRoot` with `env` (`DES-TEST-RUN`, "A runner the user
|
|
20
|
+
* configured"), the first that the plugin finds, or `undefined`:
|
|
21
|
+
*
|
|
22
|
+
* - `CARGO_TARGET_<HOST>_RUNNER` in `env`, whatever its value;
|
|
23
|
+
* - a configuration file that cargo may read there that sets `runner` in the
|
|
24
|
+
* table `target.<host>`, or in any table under `target` whose key starts
|
|
25
|
+
* with `cfg(`, whether or not its expression matches the host. The files
|
|
26
|
+
* are `.cargo/config` and `.cargo/config.toml` in `workspaceRoot` and in
|
|
27
|
+
* each folder above it, both where both exist; `config` and `config.toml`
|
|
28
|
+
* in the Cargo home that `CARGO_HOME` in `env` names, or else in `.cargo`
|
|
29
|
+
* in the home folder; and every file that one of them adds with
|
|
30
|
+
* `include`, in any form and whatever the cargo version reads, with paths
|
|
31
|
+
* taken from the folder of the file that includes it;
|
|
32
|
+
* - such a file that exists and cannot be read or parsed, so that whether it
|
|
33
|
+
* sets a runner is unknown.
|
|
34
|
+
*
|
|
35
|
+
* Reading the user's runner as cargo applies it is not attempted: no reading
|
|
36
|
+
* gives what cargo uses in every case on Cargo 1.91 and 1.100
|
|
37
|
+
* (`EVD-WORKSPACE-TEST-SELECTION`), so every place where one may be counts.
|
|
38
|
+
*/
|
|
39
|
+
// @mara implements DES-TEST-RUN
|
|
40
|
+
function configuredRunner(workspaceRoot, env, host) {
|
|
41
|
+
const variable = runnerVariable(host);
|
|
42
|
+
if (env[variable] !== undefined) {
|
|
43
|
+
return { source: variable, detail: "is set" };
|
|
44
|
+
}
|
|
45
|
+
const read = new Set();
|
|
46
|
+
for (const pair of (0, redirections_1.configFiles)(workspaceRoot, env)) {
|
|
47
|
+
for (const file of pair) {
|
|
48
|
+
const found = fileRunner(file, host, read);
|
|
49
|
+
if (found !== undefined) {
|
|
50
|
+
return found;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
// The runner that `file`, or a file that it includes, sets or may set.
|
|
57
|
+
function fileRunner(file, host, read) {
|
|
58
|
+
if (read.has(file) || !(0, node_fs_1.existsSync)(file)) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
read.add(file);
|
|
62
|
+
let table;
|
|
63
|
+
try {
|
|
64
|
+
table = (0, smol_toml_1.parse)((0, node_fs_1.readFileSync)(file, "utf8"));
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
return {
|
|
68
|
+
source: file,
|
|
69
|
+
detail: `cannot be read or parsed (${error instanceof Error ? error.message.split("\n")[0] : String(error)}), so it may set one`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const targets = asTable(table.target);
|
|
73
|
+
for (const [key, value] of Object.entries(targets)) {
|
|
74
|
+
if ((key === host || key.startsWith("cfg(")) && asTable(value).runner !== undefined) {
|
|
75
|
+
return { source: file, detail: `sets runner under [target.${quotedKey(key)}]` };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const includes = Array.isArray(table.include) ? table.include : [table.include];
|
|
79
|
+
for (const include of includes) {
|
|
80
|
+
const path = typeof include === "string" ? include : asTable(include).path;
|
|
81
|
+
if (typeof path === "string") {
|
|
82
|
+
const found = fileRunner((0, node_path_1.resolve)((0, node_path_1.dirname)(file), path), host, read);
|
|
83
|
+
if (found !== undefined) {
|
|
84
|
+
return found;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
// A key of the `target` table as a TOML table header writes it.
|
|
91
|
+
function quotedKey(key) {
|
|
92
|
+
return /^[A-Za-z0-9_-]+$/.test(key) ? key : `'${key}'`;
|
|
93
|
+
}
|
|
94
|
+
function asTable(value) {
|
|
95
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
96
|
+
? value
|
|
97
|
+
: {};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=configured-runner.js.map
|