@convesoft/nx-rust 0.0.0 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +47 -1
- package/executors.json +35 -0
- package/generators.json +19 -0
- package/package.json +17 -4
- package/src/cargo/build-settings.d.ts +54 -0
- package/src/cargo/build-settings.js +93 -0
- package/src/cargo/build-settings.js.map +1 -0
- package/src/cargo/configured-runner.d.ts +36 -0
- package/src/cargo/configured-runner.js +99 -0
- package/src/cargo/configured-runner.js.map +1 -0
- package/src/cargo/configured-tools.d.ts +35 -0
- package/src/cargo/configured-tools.js +46 -0
- package/src/cargo/configured-tools.js.map +1 -0
- package/src/cargo/dep-info-basedir.d.ts +18 -0
- package/src/cargo/dep-info-basedir.js +38 -0
- package/src/cargo/dep-info-basedir.js.map +1 -0
- package/src/cargo/directories.d.ts +40 -0
- package/src/cargo/directories.js +89 -0
- package/src/cargo/directories.js.map +1 -0
- package/src/cargo/host-triple.d.ts +7 -0
- package/src/cargo/host-triple.js +21 -0
- package/src/cargo/host-triple.js.map +1 -0
- package/src/cargo/lockfile.d.ts +63 -0
- package/src/cargo/lockfile.js +157 -0
- package/src/cargo/lockfile.js.map +1 -0
- package/src/cargo/metadata.d.ts +112 -0
- package/src/cargo/metadata.js +37 -0
- package/src/cargo/metadata.js.map +1 -0
- package/src/cargo/package-specs.d.ts +54 -0
- package/src/cargo/package-specs.js +109 -0
- package/src/cargo/package-specs.js.map +1 -0
- package/src/cargo/paths-crates.d.ts +27 -0
- package/src/cargo/paths-crates.js +69 -0
- package/src/cargo/paths-crates.js.map +1 -0
- package/src/cargo/print-artifact-folders.d.ts +1 -0
- package/src/cargo/print-artifact-folders.js +58 -0
- package/src/cargo/print-artifact-folders.js.map +1 -0
- package/src/cargo/redirections.d.ts +87 -0
- package/src/cargo/redirections.js +195 -0
- package/src/cargo/redirections.js.map +1 -0
- package/src/cargo/run-cargo.d.ts +31 -0
- package/src/cargo/run-cargo.js +75 -0
- package/src/cargo/run-cargo.js.map +1 -0
- package/src/cargo/target-triples.d.ts +98 -0
- package/src/cargo/target-triples.js +265 -0
- package/src/cargo/target-triples.js.map +1 -0
- package/src/cargo/version-req.d.ts +12 -0
- package/src/cargo/version-req.js +122 -0
- package/src/cargo/version-req.js.map +1 -0
- package/src/compatibility/cargo-version.d.ts +43 -0
- package/src/compatibility/cargo-version.js +83 -0
- package/src/compatibility/cargo-version.js.map +1 -0
- package/src/compatibility/nx-bridge.d.ts +312 -0
- package/src/compatibility/nx-bridge.js +407 -0
- package/src/compatibility/nx-bridge.js.map +1 -0
- package/src/compatibility/nx-version.d.ts +104 -0
- package/src/compatibility/nx-version.js +272 -0
- package/src/compatibility/nx-version.js.map +1 -0
- package/src/executors/affected-inputs.d.ts +29 -0
- package/src/executors/affected-inputs.js +259 -0
- package/src/executors/affected-inputs.js.map +1 -0
- package/src/executors/affected-run.d.ts +54 -0
- package/src/executors/affected-run.js +394 -0
- package/src/executors/affected-run.js.map +1 -0
- package/src/executors/affected.d.ts +239 -0
- package/src/executors/affected.js +589 -0
- package/src/executors/affected.js.map +1 -0
- package/src/executors/baseline-context.d.ts +85 -0
- package/src/executors/baseline-context.js +227 -0
- package/src/executors/baseline-context.js.map +1 -0
- package/src/executors/baseline.d.ts +123 -0
- package/src/executors/baseline.js +356 -0
- package/src/executors/baseline.js.map +1 -0
- package/src/executors/batch.d.ts +75 -0
- package/src/executors/batch.js +434 -0
- package/src/executors/batch.js.map +1 -0
- package/src/executors/build-records.d.ts +110 -0
- package/src/executors/build-records.js +267 -0
- package/src/executors/build-records.js.map +1 -0
- package/src/executors/cargo/executor.d.ts +28 -0
- package/src/executors/cargo/executor.js +58 -0
- package/src/executors/cargo/executor.js.map +1 -0
- package/src/executors/cargo/schema.json +54 -0
- package/src/executors/cargo-invocation.d.ts +81 -0
- package/src/executors/cargo-invocation.js +109 -0
- package/src/executors/cargo-invocation.js.map +1 -0
- package/src/executors/cargo-output.d.ts +212 -0
- package/src/executors/cargo-output.js +646 -0
- package/src/executors/cargo-output.js.map +1 -0
- package/src/executors/command.d.ts +318 -0
- package/src/executors/command.js +517 -0
- package/src/executors/command.js.map +1 -0
- package/src/executors/coverage-baseline.d.ts +23 -0
- package/src/executors/coverage-baseline.js +284 -0
- package/src/executors/coverage-baseline.js.map +1 -0
- package/src/executors/declared-options.d.ts +21 -0
- package/src/executors/declared-options.js +58 -0
- package/src/executors/declared-options.js.map +1 -0
- package/src/executors/digests.d.ts +94 -0
- package/src/executors/digests.js +190 -0
- package/src/executors/digests.js.map +1 -0
- package/src/executors/dotenv-check.d.ts +79 -0
- package/src/executors/dotenv-check.js +553 -0
- package/src/executors/dotenv-check.js.map +1 -0
- package/src/executors/group-invocations.d.ts +80 -0
- package/src/executors/group-invocations.js +253 -0
- package/src/executors/group-invocations.js.map +1 -0
- package/src/executors/group-run.d.ts +114 -0
- package/src/executors/group-run.js +591 -0
- package/src/executors/group-run.js.map +1 -0
- package/src/executors/groups.d.ts +113 -0
- package/src/executors/groups.js +285 -0
- package/src/executors/groups.js.map +1 -0
- package/src/executors/input-check.d.ts +52 -0
- package/src/executors/input-check.js +271 -0
- package/src/executors/input-check.js.map +1 -0
- package/src/executors/kept-files.d.ts +98 -0
- package/src/executors/kept-files.js +341 -0
- package/src/executors/kept-files.js.map +1 -0
- package/src/executors/lockfile/executor.d.ts +16 -0
- package/src/executors/lockfile/executor.js +37 -0
- package/src/executors/lockfile/executor.js.map +1 -0
- package/src/executors/lockfile/schema.json +50 -0
- package/src/executors/napi-build.d.ts +73 -0
- package/src/executors/napi-build.js +420 -0
- package/src/executors/napi-build.js.map +1 -0
- package/src/executors/nextest.d.ts +185 -0
- package/src/executors/nextest.js +498 -0
- package/src/executors/nextest.js.map +1 -0
- package/src/executors/nx-command.d.ts +95 -0
- package/src/executors/nx-command.js +205 -0
- package/src/executors/nx-command.js.map +1 -0
- package/src/executors/nx-task-files.d.ts +82 -0
- package/src/executors/nx-task-files.js +156 -0
- package/src/executors/nx-task-files.js.map +1 -0
- package/src/executors/print-test-mode.d.ts +1 -0
- package/src/executors/print-test-mode.js +25 -0
- package/src/executors/print-test-mode.js.map +1 -0
- package/src/executors/release-publish/executor.d.ts +24 -0
- package/src/executors/release-publish/executor.js +165 -0
- package/src/executors/release-publish/executor.js.map +1 -0
- package/src/executors/release-publish/schema.json +30 -0
- package/src/executors/run/executor.d.ts +12 -0
- package/src/executors/run/executor.js +27 -0
- package/src/executors/run/executor.js.map +1 -0
- package/src/executors/run/schema.json +45 -0
- package/src/executors/runner-script.d.ts +12 -0
- package/src/executors/runner-script.js +22 -0
- package/src/executors/runner-script.js.map +1 -0
- package/src/executors/runtime-input-check.d.ts +24 -0
- package/src/executors/runtime-input-check.js +87 -0
- package/src/executors/runtime-input-check.js.map +1 -0
- package/src/executors/shared-artifacts.d.ts +44 -0
- package/src/executors/shared-artifacts.js +132 -0
- package/src/executors/shared-artifacts.js.map +1 -0
- package/src/executors/split-words.d.ts +24 -0
- package/src/executors/split-words.js +111 -0
- package/src/executors/split-words.js.map +1 -0
- package/src/executors/stage.d.ts +163 -0
- package/src/executors/stage.js +526 -0
- package/src/executors/stage.js.map +1 -0
- package/src/executors/staged-run.d.ts +24 -0
- package/src/executors/staged-run.js +110 -0
- package/src/executors/staged-run.js.map +1 -0
- package/src/executors/task-env.d.ts +271 -0
- package/src/executors/task-env.js +494 -0
- package/src/executors/task-env.js.map +1 -0
- package/src/executors/task-execution.d.ts +61 -0
- package/src/executors/task-execution.js +122 -0
- package/src/executors/task-execution.js.map +1 -0
- package/src/executors/task-guards.d.ts +112 -0
- package/src/executors/task-guards.js +430 -0
- package/src/executors/task-guards.js.map +1 -0
- package/src/executors/task-options.d.ts +114 -0
- package/src/executors/task-options.js +258 -0
- package/src/executors/task-options.js.map +1 -0
- package/src/executors/task.d.ts +166 -0
- package/src/executors/task.js +520 -0
- package/src/executors/task.js.map +1 -0
- package/src/executors/test-mode.d.ts +182 -0
- package/src/executors/test-mode.js +391 -0
- package/src/executors/test-mode.js.map +1 -0
- package/src/executors/test-runner.d.ts +44 -0
- package/src/executors/test-runner.js +159 -0
- package/src/executors/test-runner.js.map +1 -0
- package/src/executors/test-steps.d.ts +109 -0
- package/src/executors/test-steps.js +535 -0
- package/src/executors/test-steps.js.map +1 -0
- package/src/executors/wasm-build.d.ts +56 -0
- package/src/executors/wasm-build.js +216 -0
- package/src/executors/wasm-build.js.map +1 -0
- package/src/generators/crate/binary.schema.json +28 -0
- package/src/generators/crate/crate.d.ts +24 -0
- package/src/generators/crate/crate.js +108 -0
- package/src/generators/crate/crate.js.map +1 -0
- package/src/generators/crate/enclosing-workspace.d.ts +25 -0
- package/src/generators/crate/enclosing-workspace.js +58 -0
- package/src/generators/crate/enclosing-workspace.js.map +1 -0
- package/src/generators/crate/library.schema.json +28 -0
- package/src/generators/init/graph-check.d.ts +81 -0
- package/src/generators/init/graph-check.js +299 -0
- package/src/generators/init/graph-check.js.map +1 -0
- package/src/generators/init/init.d.ts +23 -0
- package/src/generators/init/init.js +113 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/report.d.ts +19 -0
- package/src/generators/init/report.js +93 -0
- package/src/generators/init/report.js.map +1 -0
- package/src/generators/init/schema.json +9 -0
- package/src/graph/artifact-kinds.d.ts +29 -0
- package/src/graph/artifact-kinds.js +50 -0
- package/src/graph/artifact-kinds.js.map +1 -0
- package/src/graph/artifact-names.d.ts +97 -0
- package/src/graph/artifact-names.js +276 -0
- package/src/graph/artifact-names.js.map +1 -0
- package/src/graph/build-records.d.ts +74 -0
- package/src/graph/build-records.js +104 -0
- package/src/graph/build-records.js.map +1 -0
- package/src/graph/caching.d.ts +148 -0
- package/src/graph/caching.js +676 -0
- package/src/graph/caching.js.map +1 -0
- package/src/graph/collisions.d.ts +106 -0
- package/src/graph/collisions.js +156 -0
- package/src/graph/collisions.js.map +1 -0
- package/src/graph/computation-reports.d.ts +89 -0
- package/src/graph/computation-reports.js +216 -0
- package/src/graph/computation-reports.js.map +1 -0
- package/src/graph/declared-files.d.ts +190 -0
- package/src/graph/declared-files.js +600 -0
- package/src/graph/declared-files.js.map +1 -0
- package/src/graph/discovery.d.ts +175 -0
- package/src/graph/discovery.js +656 -0
- package/src/graph/discovery.js.map +1 -0
- package/src/graph/edges.d.ts +25 -0
- package/src/graph/edges.js +94 -0
- package/src/graph/edges.js.map +1 -0
- package/src/graph/entries.d.ts +83 -0
- package/src/graph/entries.js +259 -0
- package/src/graph/entries.js.map +1 -0
- package/src/graph/inputs.d.ts +420 -0
- package/src/graph/inputs.js +746 -0
- package/src/graph/inputs.js.map +1 -0
- package/src/graph/lockfile-task.d.ts +74 -0
- package/src/graph/lockfile-task.js +105 -0
- package/src/graph/lockfile-task.js.map +1 -0
- package/src/graph/names.d.ts +41 -0
- package/src/graph/names.js +34 -0
- package/src/graph/names.js.map +1 -0
- package/src/graph/napi.d.ts +107 -0
- package/src/graph/napi.js +206 -0
- package/src/graph/napi.js.map +1 -0
- package/src/graph/nx-glob.d.ts +36 -0
- package/src/graph/nx-glob.js +152 -0
- package/src/graph/nx-glob.js.map +1 -0
- package/src/graph/nx-internals.d.ts +57 -0
- package/src/graph/nx-internals.js +128 -0
- package/src/graph/nx-internals.js.map +1 -0
- package/src/graph/options.d.ts +32 -0
- package/src/graph/options.js +80 -0
- package/src/graph/options.js.map +1 -0
- package/src/graph/outputs.d.ts +75 -0
- package/src/graph/outputs.js +140 -0
- package/src/graph/outputs.js.map +1 -0
- package/src/graph/path-dependencies.d.ts +122 -0
- package/src/graph/path-dependencies.js +459 -0
- package/src/graph/path-dependencies.js.map +1 -0
- package/src/graph/plugin-package.d.ts +36 -0
- package/src/graph/plugin-package.js +132 -0
- package/src/graph/plugin-package.js.map +1 -0
- package/src/graph/plugin-version.d.ts +20 -0
- package/src/graph/plugin-version.js +153 -0
- package/src/graph/plugin-version.js.map +1 -0
- package/src/graph/projects.d.ts +141 -0
- package/src/graph/projects.js +182 -0
- package/src/graph/projects.js.map +1 -0
- package/src/graph/reached-projects.d.ts +46 -0
- package/src/graph/reached-projects.js +102 -0
- package/src/graph/reached-projects.js.map +1 -0
- package/src/graph/real-path.d.ts +47 -0
- package/src/graph/real-path.js +113 -0
- package/src/graph/real-path.js.map +1 -0
- package/src/graph/redirected-uses.d.ts +98 -0
- package/src/graph/redirected-uses.js +434 -0
- package/src/graph/redirected-uses.js.map +1 -0
- package/src/graph/registration.d.ts +121 -0
- package/src/graph/registration.js +233 -0
- package/src/graph/registration.js.map +1 -0
- package/src/graph/script-input.d.ts +46 -0
- package/src/graph/script-input.js +65 -0
- package/src/graph/script-input.js.map +1 -0
- package/src/graph/settings.d.ts +178 -0
- package/src/graph/settings.js +479 -0
- package/src/graph/settings.js.map +1 -0
- package/src/graph/target-defaults-causes.d.ts +33 -0
- package/src/graph/target-defaults-causes.js +202 -0
- package/src/graph/target-defaults-causes.js.map +1 -0
- package/src/graph/target-defaults-layers.d.ts +186 -0
- package/src/graph/target-defaults-layers.js +420 -0
- package/src/graph/target-defaults-layers.js.map +1 -0
- package/src/graph/target-defaults-meaning.d.ts +95 -0
- package/src/graph/target-defaults-meaning.js +292 -0
- package/src/graph/target-defaults-meaning.js.map +1 -0
- package/src/graph/target-defaults-report.d.ts +77 -0
- package/src/graph/target-defaults-report.js +242 -0
- package/src/graph/target-defaults-report.js.map +1 -0
- package/src/graph/target-defaults.d.ts +79 -0
- package/src/graph/target-defaults.js +425 -0
- package/src/graph/target-defaults.js.map +1 -0
- package/src/graph/target-fields.d.ts +16 -0
- package/src/graph/target-fields.js +134 -0
- package/src/graph/target-fields.js.map +1 -0
- package/src/graph/target-tables.d.ts +45 -0
- package/src/graph/target-tables.js +299 -0
- package/src/graph/target-tables.js.map +1 -0
- package/src/graph/targets.d.ts +367 -0
- package/src/graph/targets.js +404 -0
- package/src/graph/targets.js.map +1 -0
- package/src/graph/unification.d.ts +141 -0
- package/src/graph/unification.js +459 -0
- package/src/graph/unification.js.map +1 -0
- package/src/graph/unignored-directories.d.ts +25 -0
- package/src/graph/unignored-directories.js +89 -0
- package/src/graph/unignored-directories.js.map +1 -0
- package/src/graph/visibility.d.ts +17 -0
- package/src/graph/visibility.js +67 -0
- package/src/graph/visibility.js.map +1 -0
- package/src/graph/warnings.d.ts +38 -0
- package/src/graph/warnings.js +77 -0
- package/src/graph/warnings.js.map +1 -0
- package/src/graph/wasm.d.ts +56 -0
- package/src/graph/wasm.js +77 -0
- package/src/graph/wasm.js.map +1 -0
- package/src/index.d.ts +68 -0
- package/src/index.js +109 -0
- package/src/index.js.map +1 -0
- package/src/release/manifests.d.ts +95 -0
- package/src/release/manifests.js +164 -0
- package/src/release/manifests.js.map +1 -0
- package/src/release/places.d.ts +127 -0
- package/src/release/places.js +368 -0
- package/src/release/places.js.map +1 -0
- package/src/release/publish-cargo.d.ts +177 -0
- package/src/release/publish-cargo.js +351 -0
- package/src/release/publish-cargo.js.map +1 -0
- package/src/release/publish-crates.d.ts +124 -0
- package/src/release/publish-crates.js +242 -0
- package/src/release/publish-crates.js.map +1 -0
- package/src/release/publish-environments.d.ts +50 -0
- package/src/release/publish-environments.js +284 -0
- package/src/release/publish-environments.js.map +1 -0
- package/src/release/publish-messages.d.ts +66 -0
- package/src/release/publish-messages.js +273 -0
- package/src/release/publish-messages.js.map +1 -0
- package/src/release/publish-registry.d.ts +27 -0
- package/src/release/publish-registry.js +135 -0
- package/src/release/publish-registry.js.map +1 -0
- package/src/release/publish-settings.d.ts +26 -0
- package/src/release/publish-settings.js +56 -0
- package/src/release/publish-settings.js.map +1 -0
- package/src/release/publish.d.ts +59 -0
- package/src/release/publish.js +620 -0
- package/src/release/publish.js.map +1 -0
- package/src/release/repository.d.ts +73 -0
- package/src/release/repository.js +219 -0
- package/src/release/repository.js.map +1 -0
- package/src/release/requirements.d.ts +34 -0
- package/src/release/requirements.js +30 -0
- package/src/release/requirements.js.map +1 -0
- package/src/release/toml-edit.d.ts +67 -0
- package/src/release/toml-edit.js +453 -0
- package/src/release/toml-edit.js.map +1 -0
- package/src/release/version-actions.d.ts +133 -0
- package/src/release/version-actions.js +474 -0
- package/src/release/version-actions.js.map +1 -0
- package/src/release/version-checks.d.ts +21 -0
- package/src/release/version-checks.js +151 -0
- package/src/release/version-checks.js.map +1 -0
- package/src/release/version-lockfiles.d.ts +61 -0
- package/src/release/version-lockfiles.js +222 -0
- package/src/release/version-lockfiles.js.map +1 -0
- package/src/tools/napi-cli.d.ts +70 -0
- package/src/tools/napi-cli.js +63 -0
- package/src/tools/napi-cli.js.map +1 -0
- package/src/tools/optional-tools.d.ts +121 -0
- package/src/tools/optional-tools.js +303 -0
- package/src/tools/optional-tools.js.map +1 -0
- package/src/tools/print-napi-cli.d.ts +1 -0
- package/src/tools/print-napi-cli.js +24 -0
- package/src/tools/print-napi-cli.js.map +1 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { CargoPackage } from "../cargo/metadata";
|
|
2
|
+
import { wasmTriple } from "../graph/wasm";
|
|
3
|
+
/** A Cargo workspace as far as the table of tools needs it. */
|
|
4
|
+
export interface ToolWorkspace {
|
|
5
|
+
/** The folder of the root manifest, relative to the repository root: `.` for the root itself. */
|
|
6
|
+
root: string;
|
|
7
|
+
/** The workspace's members, where the table needs to know which crates produce an artifact. */
|
|
8
|
+
members?: readonly CargoPackage[];
|
|
9
|
+
/** The workspace's test runner (`testRunner`), where its settings choose nextest. */
|
|
10
|
+
testRunner?: "nextest";
|
|
11
|
+
/** Whether the workspace's settings turn on the selection of affected tests (`affectedTests`). */
|
|
12
|
+
affectedTests?: true;
|
|
13
|
+
/**
|
|
14
|
+
* The feature-unification strategy that graph creation chose for the
|
|
15
|
+
* workspace (`DES-UNIFICATION`); `workspace-build` where absent.
|
|
16
|
+
*/
|
|
17
|
+
featureUnification?: "hakari" | "cargo" | "workspace-build";
|
|
18
|
+
}
|
|
19
|
+
/** What the table of tools looks at. */
|
|
20
|
+
export interface ToolContext {
|
|
21
|
+
/** The absolute path of the repository root. */
|
|
22
|
+
workspaceRoot: string;
|
|
23
|
+
/** The Cargo workspaces of the repository. */
|
|
24
|
+
workspaces: ToolWorkspace[];
|
|
25
|
+
/** The environment whose `PATH` and `CARGO_HOME` say where tools are installed. */
|
|
26
|
+
env: NodeJS.ProcessEnv;
|
|
27
|
+
/**
|
|
28
|
+
* The absolute path of the folder where a task's cargo runs, against which
|
|
29
|
+
* relative entries of `PATH` and a relative `CARGO_HOME` count, and whose
|
|
30
|
+
* toolchain counts for the wasm target; the repository root when absent.
|
|
31
|
+
*/
|
|
32
|
+
folder?: string;
|
|
33
|
+
}
|
|
34
|
+
/** How code refers to each tool of {@link optionalTools}. */
|
|
35
|
+
export type OptionalToolId = "cargo-nextest" | "cargo-affected" | "llvm-tools" | "cargo-hakari" | "wasm-bindgen" | "wasm-target" | "napi" | "cargo-deny" | "cargo-audit";
|
|
36
|
+
/**
|
|
37
|
+
* A tool that a feature of the plugin runs and that the plugin never
|
|
38
|
+
* installs (`ADR-V1-SCOPE`).
|
|
39
|
+
*/
|
|
40
|
+
export interface OptionalTool {
|
|
41
|
+
id: OptionalToolId;
|
|
42
|
+
/** How messages name the tool. */
|
|
43
|
+
name: string;
|
|
44
|
+
/** How to get it. */
|
|
45
|
+
install: string;
|
|
46
|
+
/** Whether the tool is installed. */
|
|
47
|
+
installed(context: ToolContext): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* What in the repository's configuration needs the tool, one phrase each,
|
|
50
|
+
* such as "the deny target that rust/deny.toml gives the Cargo workspace in
|
|
51
|
+
* rust". Empty when nothing needs it.
|
|
52
|
+
*/
|
|
53
|
+
neededBy(context: ToolContext): string[];
|
|
54
|
+
}
|
|
55
|
+
/** The configuration files of cargo-deny that give a workspace project its `deny` target. */
|
|
56
|
+
export declare const cargoDenyConfigurationFiles: string[];
|
|
57
|
+
/** The triple that `wasm-build` compiles for. */
|
|
58
|
+
export { wasmTriple };
|
|
59
|
+
/**
|
|
60
|
+
* The tools of the table in `DES-GENERATORS`, in its order. `init` reports
|
|
61
|
+
* the missing ones, and a task that runs a missing one fails
|
|
62
|
+
* ({@link requireTool}); the rows of the wasm tools are one row there.
|
|
63
|
+
*
|
|
64
|
+
* Which tool the configuration needs follows the features that exist:
|
|
65
|
+
* cargo-nextest where a workspace's settings choose the nextest runner,
|
|
66
|
+
* cargo-affected where they turn on `affectedTests`, cargo-hakari for every
|
|
67
|
+
* workspace that uses the `hakari` strategy, the napi CLI where a crate has
|
|
68
|
+
* a `napi-build` target, and the `wasm-bindgen` CLI and the wasm target
|
|
69
|
+
* where a crate has a `wasm-build` target.
|
|
70
|
+
*/
|
|
71
|
+
export declare const optionalTools: readonly OptionalTool[];
|
|
72
|
+
/**
|
|
73
|
+
* The message for a tool that is not installed and that `neededBy` need,
|
|
74
|
+
* one phrase each, such as "the deny target that rust/deny.toml gives the
|
|
75
|
+
* Cargo workspace in rust": it names the tool, what needs it and how to get
|
|
76
|
+
* it. `init` reports it as a warning, a task that starts without the tool
|
|
77
|
+
* fails with it (`DES-DIAGNOSTICS`).
|
|
78
|
+
*/
|
|
79
|
+
export declare function missingToolMessage(tool: OptionalTool, neededBy: readonly string[]): string;
|
|
80
|
+
/** A tool that a task needs is not installed. */
|
|
81
|
+
export declare class MissingToolError extends Error {
|
|
82
|
+
readonly tool: OptionalTool;
|
|
83
|
+
/** What needs the tool. */
|
|
84
|
+
readonly neededBy: string;
|
|
85
|
+
constructor(tool: OptionalTool,
|
|
86
|
+
/** What needs the tool. */
|
|
87
|
+
neededBy: string);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Fails when the tool `id` is not installed. The executors call it when a
|
|
91
|
+
* task that runs the tool starts, before cargo runs, so that the task fails
|
|
92
|
+
* with a message that names the tool, what needs it and how to get it; the
|
|
93
|
+
* plugin installs nothing (`DES-DIAGNOSTICS`, `ADR-V1-SCOPE`).
|
|
94
|
+
*
|
|
95
|
+
* @param neededBy What needs the tool, such as "the audit target of the
|
|
96
|
+
* Cargo workspace in rust".
|
|
97
|
+
* @param context Where to look: the environment of the task and, for the
|
|
98
|
+
* wasm target, the folder its cargo runs in.
|
|
99
|
+
* @throws {MissingToolError} When the tool is not installed.
|
|
100
|
+
*/
|
|
101
|
+
export declare function requireTool(id: OptionalToolId, neededBy: string, context: ToolContext, tools?: readonly OptionalTool[]): void;
|
|
102
|
+
/** "the repository root" for `.`, the folder otherwise. */
|
|
103
|
+
export declare function describeFolder(folder: string): string;
|
|
104
|
+
/**
|
|
105
|
+
* Whether cargo, started in the folder `cwd`, would find the subcommand
|
|
106
|
+
* `cargo <name>`: an executable `cargo-<name>` in the `bin` folder of the
|
|
107
|
+
* Cargo home or on `PATH`, where cargo looks for it. Cargo resolves a
|
|
108
|
+
* relative `CARGO_HOME` and relative entries of `PATH` against the folder
|
|
109
|
+
* it runs in.
|
|
110
|
+
*/
|
|
111
|
+
export declare function cargoSubcommandInstalled(name: string, env: NodeJS.ProcessEnv, cwd: string): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* The first executable file called `name` in `folders`, or `undefined`.
|
|
114
|
+
*/
|
|
115
|
+
export declare function findExecutable(name: string, folders: readonly string[]): string | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* The folders of `PATH` for a command started in `cwd`, where the operating
|
|
118
|
+
* system and cargo look for an executable: a relative entry counts from
|
|
119
|
+
* `cwd`, and an empty one stands for `cwd` itself. Without `PATH`, none.
|
|
120
|
+
*/
|
|
121
|
+
export declare function searchPath(env: NodeJS.ProcessEnv, cwd: string): string[];
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MissingToolError = exports.optionalTools = exports.wasmTriple = exports.cargoDenyConfigurationFiles = void 0;
|
|
4
|
+
exports.missingToolMessage = missingToolMessage;
|
|
5
|
+
exports.requireTool = requireTool;
|
|
6
|
+
exports.describeFolder = describeFolder;
|
|
7
|
+
exports.cargoSubcommandInstalled = cargoSubcommandInstalled;
|
|
8
|
+
exports.findExecutable = findExecutable;
|
|
9
|
+
exports.searchPath = searchPath;
|
|
10
|
+
const node_child_process_1 = require("node:child_process");
|
|
11
|
+
const node_fs_1 = require("node:fs");
|
|
12
|
+
const node_os_1 = require("node:os");
|
|
13
|
+
const node_path_1 = require("node:path");
|
|
14
|
+
const artifact_kinds_1 = require("../graph/artifact-kinds");
|
|
15
|
+
const wasm_1 = require("../graph/wasm");
|
|
16
|
+
Object.defineProperty(exports, "wasmTriple", { enumerable: true, get: function () { return wasm_1.wasmTriple; } });
|
|
17
|
+
const napi_cli_1 = require("./napi-cli");
|
|
18
|
+
/** The configuration files of cargo-deny that give a workspace project its `deny` target. */
|
|
19
|
+
exports.cargoDenyConfigurationFiles = ["deny.toml", ".deny.toml", ".cargo/deny.toml"];
|
|
20
|
+
/**
|
|
21
|
+
* The tools of the table in `DES-GENERATORS`, in its order. `init` reports
|
|
22
|
+
* the missing ones, and a task that runs a missing one fails
|
|
23
|
+
* ({@link requireTool}); the rows of the wasm tools are one row there.
|
|
24
|
+
*
|
|
25
|
+
* Which tool the configuration needs follows the features that exist:
|
|
26
|
+
* cargo-nextest where a workspace's settings choose the nextest runner,
|
|
27
|
+
* cargo-affected where they turn on `affectedTests`, cargo-hakari for every
|
|
28
|
+
* workspace that uses the `hakari` strategy, the napi CLI where a crate has
|
|
29
|
+
* a `napi-build` target, and the `wasm-bindgen` CLI and the wasm target
|
|
30
|
+
* where a crate has a `wasm-build` target.
|
|
31
|
+
*/
|
|
32
|
+
// @mara implements DES-GENERATORS
|
|
33
|
+
exports.optionalTools = [
|
|
34
|
+
{
|
|
35
|
+
id: "cargo-nextest",
|
|
36
|
+
name: "cargo-nextest",
|
|
37
|
+
install: "Install it as https://nexte.st/docs/installation/ describes.",
|
|
38
|
+
installed: (context) => cargoSubcommandInstalled("nextest", context.env, toolFolder(context)),
|
|
39
|
+
neededBy: (context) => context.workspaces
|
|
40
|
+
.filter((workspace) => workspace.testRunner === "nextest")
|
|
41
|
+
.map((workspace) => `the nextest runner that the Cargo workspace in ${describeFolder(workspace.root)} chooses for its test targets (testRunner)`),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "cargo-affected",
|
|
45
|
+
name: "cargo-affected",
|
|
46
|
+
install: "Install it as https://github.com/max-sixty/cargo-affected describes.",
|
|
47
|
+
installed: (context) => cargoSubcommandInstalled("affected", context.env, toolFolder(context)),
|
|
48
|
+
neededBy: (context) => context.workspaces
|
|
49
|
+
.filter((workspace) => workspace.affectedTests === true)
|
|
50
|
+
.map((workspace) => `the selection of affected tests that the Cargo workspace in ${describeFolder(workspace.root)} turns on for its test targets (affectedTests)`),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
// cargo-affected runs llvm-profdata and llvm-cov to collect coverage; it
|
|
54
|
+
// looks for them in the toolchain's sysroot, then through xcrun on macOS,
|
|
55
|
+
// then on PATH (`DES-BASELINE`).
|
|
56
|
+
id: "llvm-tools",
|
|
57
|
+
name: "the llvm-tools component (llvm-cov and llvm-profdata)",
|
|
58
|
+
install: "Install it with `rustup component add llvm-tools` for the toolchain of the workspace, or put the llvm-cov and llvm-profdata of that toolchain's LLVM version on PATH.",
|
|
59
|
+
installed: (context) => llvmToolsInstalled(context),
|
|
60
|
+
neededBy: (context) => context.workspaces
|
|
61
|
+
.filter((workspace) => workspace.affectedTests === true)
|
|
62
|
+
.map((workspace) => `the coverage collection that the Cargo workspace in ${describeFolder(workspace.root)} gets with the selection of affected tests (affectedTests)`),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "cargo-hakari",
|
|
66
|
+
name: "cargo-hakari",
|
|
67
|
+
install: "Install it with `cargo install --locked cargo-hakari` (https://docs.rs/cargo-hakari).",
|
|
68
|
+
installed: (context) => cargoSubcommandInstalled("hakari", context.env, toolFolder(context)),
|
|
69
|
+
neededBy: (context) => context.workspaces
|
|
70
|
+
.filter((workspace) => workspace.featureUnification === "hakari")
|
|
71
|
+
.map((workspace) => `the hakari-check target of the Cargo workspace in ${describeFolder(workspace.root)}`),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "wasm-bindgen",
|
|
75
|
+
name: "the wasm-bindgen CLI",
|
|
76
|
+
install: "Install the version of the wasm-bindgen crate in your Cargo.lock with `cargo install --locked wasm-bindgen-cli --version <version>`.",
|
|
77
|
+
installed: (context) => findExecutable("wasm-bindgen", searchPath(context.env, toolFolder(context))) !== undefined,
|
|
78
|
+
neededBy: (context) => wasmBuildTargets(context),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "wasm-target",
|
|
82
|
+
name: `the ${wasm_1.wasmTriple} target`,
|
|
83
|
+
install: `Install it with \`rustup target add ${wasm_1.wasmTriple}\`.`,
|
|
84
|
+
installed: (context) => wasmTargetInstalled(context),
|
|
85
|
+
neededBy: (context) => wasmBuildTargets(context),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: "napi",
|
|
89
|
+
name: "the napi CLI",
|
|
90
|
+
install: "Add @napi-rs/cli 3.4.0 or a later 3.x release to the devDependencies of the crate's package.json or of the repository's (https://napi.rs).",
|
|
91
|
+
// `napi-build` uses the package that Node resolves from the crate's
|
|
92
|
+
// folder, so each crate with the target has to reach one.
|
|
93
|
+
installed: (context) => {
|
|
94
|
+
const folders = artifactCrates(context, "napi").map(({ folder }) => (0, node_path_1.join)(context.workspaceRoot, folder));
|
|
95
|
+
return folders.length > 0
|
|
96
|
+
? folders.every((folder) => (0, napi_cli_1.installedNapiCli)(folder) !== undefined)
|
|
97
|
+
: (0, napi_cli_1.installedNapiCli)(context.workspaceRoot) !== undefined ||
|
|
98
|
+
findExecutable("napi", [
|
|
99
|
+
(0, node_path_1.join)(context.workspaceRoot, "node_modules", ".bin"),
|
|
100
|
+
...searchPath(context.env, toolFolder(context)),
|
|
101
|
+
]) !== undefined;
|
|
102
|
+
},
|
|
103
|
+
neededBy: (context) => artifactCrates(context, "napi").map(({ name, folder }) => `the napi-build target of the crate ${name} in ${describeFolder(folder)}`),
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: "cargo-deny",
|
|
107
|
+
name: "cargo-deny",
|
|
108
|
+
install: "Install it with `cargo install --locked cargo-deny` (https://crates.io/crates/cargo-deny).",
|
|
109
|
+
installed: (context) => cargoSubcommandInstalled("deny", context.env, toolFolder(context)),
|
|
110
|
+
neededBy: (context) => context.workspaces.flatMap((workspace) => {
|
|
111
|
+
const file = exports.cargoDenyConfigurationFiles.find((name) => (0, node_fs_1.existsSync)((0, node_path_1.join)(context.workspaceRoot, workspace.root, name)));
|
|
112
|
+
return file === undefined
|
|
113
|
+
? []
|
|
114
|
+
: [
|
|
115
|
+
`the deny target that ${(0, node_path_1.join)(workspace.root, file)} gives the Cargo workspace in ${describeFolder(workspace.root)}`,
|
|
116
|
+
];
|
|
117
|
+
}),
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
// No setting asks for `audit`, which every workspace project has, so a
|
|
121
|
+
// missing cargo-audit is reported as not needed; an `audit` task still
|
|
122
|
+
// fails without it.
|
|
123
|
+
id: "cargo-audit",
|
|
124
|
+
name: "cargo-audit",
|
|
125
|
+
install: "Install it with `cargo install --locked cargo-audit` (https://crates.io/crates/cargo-audit).",
|
|
126
|
+
installed: (context) => cargoSubcommandInstalled("audit", context.env, toolFolder(context)),
|
|
127
|
+
neededBy: () => [],
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
/**
|
|
131
|
+
* The message for a tool that is not installed and that `neededBy` need,
|
|
132
|
+
* one phrase each, such as "the deny target that rust/deny.toml gives the
|
|
133
|
+
* Cargo workspace in rust": it names the tool, what needs it and how to get
|
|
134
|
+
* it. `init` reports it as a warning, a task that starts without the tool
|
|
135
|
+
* fails with it (`DES-DIAGNOSTICS`).
|
|
136
|
+
*/
|
|
137
|
+
function missingToolMessage(tool, neededBy) {
|
|
138
|
+
const needs = neededBy.length === 1 ? "needs" : "need";
|
|
139
|
+
return `${sentenceStart(tool.name)} is not installed, but ${list(neededBy)} ${needs} it. ${tool.install}`;
|
|
140
|
+
}
|
|
141
|
+
/** A tool that a task needs is not installed. */
|
|
142
|
+
class MissingToolError extends Error {
|
|
143
|
+
constructor(tool,
|
|
144
|
+
/** What needs the tool. */
|
|
145
|
+
neededBy) {
|
|
146
|
+
super(missingToolMessage(tool, [neededBy]));
|
|
147
|
+
this.tool = tool;
|
|
148
|
+
this.neededBy = neededBy;
|
|
149
|
+
this.name = "MissingToolError";
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.MissingToolError = MissingToolError;
|
|
153
|
+
/**
|
|
154
|
+
* Fails when the tool `id` is not installed. The executors call it when a
|
|
155
|
+
* task that runs the tool starts, before cargo runs, so that the task fails
|
|
156
|
+
* with a message that names the tool, what needs it and how to get it; the
|
|
157
|
+
* plugin installs nothing (`DES-DIAGNOSTICS`, `ADR-V1-SCOPE`).
|
|
158
|
+
*
|
|
159
|
+
* @param neededBy What needs the tool, such as "the audit target of the
|
|
160
|
+
* Cargo workspace in rust".
|
|
161
|
+
* @param context Where to look: the environment of the task and, for the
|
|
162
|
+
* wasm target, the folder its cargo runs in.
|
|
163
|
+
* @throws {MissingToolError} When the tool is not installed.
|
|
164
|
+
*/
|
|
165
|
+
// @mara implements DES-DIAGNOSTICS
|
|
166
|
+
function requireTool(id, neededBy, context, tools = exports.optionalTools) {
|
|
167
|
+
const tool = tools.find((candidate) => candidate.id === id);
|
|
168
|
+
if (tool === undefined) {
|
|
169
|
+
throw new Error(`nx-rust has no tool "${id}" in its table of tools.`);
|
|
170
|
+
}
|
|
171
|
+
if (!tool.installed(context)) {
|
|
172
|
+
throw new MissingToolError(tool, neededBy);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* The crates of the context's workspaces that have the artifact target of
|
|
177
|
+
* the kind, `napi-build` or `wasm-build` (`producesArtifact` in
|
|
178
|
+
* `artifact-kinds.ts`), by package name and folder relative to the
|
|
179
|
+
* repository root, the `artifacts` of their `[package.metadata.nx]`
|
|
180
|
+
* included, in the order of their folders.
|
|
181
|
+
*/
|
|
182
|
+
function artifactCrates(context, kind) {
|
|
183
|
+
return context.workspaces.flatMap((workspace) => {
|
|
184
|
+
var _a;
|
|
185
|
+
return ((_a = workspace.members) !== null && _a !== void 0 ? _a : [])
|
|
186
|
+
.filter((pkg) => {
|
|
187
|
+
const artifacts = (0, artifact_kinds_1.reportedArtifacts)(pkg);
|
|
188
|
+
return (0, artifact_kinds_1.producesArtifact)({ pkg, settings: artifacts === undefined ? {} : { artifacts } }, kind);
|
|
189
|
+
})
|
|
190
|
+
.map((pkg) => ({
|
|
191
|
+
name: pkg.name,
|
|
192
|
+
folder: (0, node_path_1.relative)(context.workspaceRoot, (0, node_path_1.dirname)(pkg.manifest_path)) || ".",
|
|
193
|
+
}))
|
|
194
|
+
.sort((a, b) => (a.folder < b.folder ? -1 : a.folder > b.folder ? 1 : 0));
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
// What needs the wasm tools: the `wasm-build` target of each crate that has one.
|
|
198
|
+
function wasmBuildTargets(context) {
|
|
199
|
+
return artifactCrates(context, "wasm").map(({ name, folder }) => `the wasm-build target of the crate ${name} in ${describeFolder(folder)}`);
|
|
200
|
+
}
|
|
201
|
+
/** "the repository root" for `.`, the folder otherwise. */
|
|
202
|
+
function describeFolder(folder) {
|
|
203
|
+
return folder === "." || folder === "" ? "the repository root" : folder;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Whether cargo, started in the folder `cwd`, would find the subcommand
|
|
207
|
+
* `cargo <name>`: an executable `cargo-<name>` in the `bin` folder of the
|
|
208
|
+
* Cargo home or on `PATH`, where cargo looks for it. Cargo resolves a
|
|
209
|
+
* relative `CARGO_HOME` and relative entries of `PATH` against the folder
|
|
210
|
+
* it runs in.
|
|
211
|
+
*/
|
|
212
|
+
function cargoSubcommandInstalled(name, env, cwd) {
|
|
213
|
+
const cargoHome = env.CARGO_HOME
|
|
214
|
+
? (0, node_path_1.resolve)(cwd, env.CARGO_HOME)
|
|
215
|
+
: (0, node_path_1.join)(env.HOME || (0, node_os_1.homedir)(), ".cargo");
|
|
216
|
+
return (findExecutable(`cargo-${name}`, [(0, node_path_1.join)(cargoHome, "bin"), ...searchPath(env, cwd)]) !== undefined);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The first executable file called `name` in `folders`, or `undefined`.
|
|
220
|
+
*/
|
|
221
|
+
function findExecutable(name, folders) {
|
|
222
|
+
for (const folder of folders) {
|
|
223
|
+
if (folder === "") {
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
const candidate = (0, node_path_1.join)(folder, name);
|
|
227
|
+
try {
|
|
228
|
+
(0, node_fs_1.accessSync)(candidate, node_fs_1.constants.X_OK);
|
|
229
|
+
if ((0, node_fs_1.statSync)(candidate).isFile()) {
|
|
230
|
+
return candidate;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
catch (_a) {
|
|
234
|
+
// Not in this folder.
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return undefined;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* The folders of `PATH` for a command started in `cwd`, where the operating
|
|
241
|
+
* system and cargo look for an executable: a relative entry counts from
|
|
242
|
+
* `cwd`, and an empty one stands for `cwd` itself. Without `PATH`, none.
|
|
243
|
+
*/
|
|
244
|
+
function searchPath(env, cwd) {
|
|
245
|
+
return env.PATH === undefined
|
|
246
|
+
? []
|
|
247
|
+
: env.PATH.split(node_path_1.delimiter).map((entry) => (0, node_path_1.resolve)(cwd, entry));
|
|
248
|
+
}
|
|
249
|
+
// The folder where the command that runs a tool starts.
|
|
250
|
+
function toolFolder(context) {
|
|
251
|
+
var _a;
|
|
252
|
+
return (_a = context.folder) !== null && _a !== void 0 ? _a : context.workspaceRoot;
|
|
253
|
+
}
|
|
254
|
+
// Whether the toolchain that rustc picks in the context's folder has the
|
|
255
|
+
// standard library for the wasm triple. rustup may not install a toolchain
|
|
256
|
+
// that the folder names and that is missing.
|
|
257
|
+
function wasmTargetInstalled(context) {
|
|
258
|
+
var _a;
|
|
259
|
+
const result = (0, node_child_process_1.spawnSync)("rustc", ["--print", "sysroot"], {
|
|
260
|
+
cwd: (_a = context.folder) !== null && _a !== void 0 ? _a : context.workspaceRoot,
|
|
261
|
+
env: Object.assign(Object.assign({}, context.env), { RUSTUP_AUTO_INSTALL: "0" }),
|
|
262
|
+
encoding: "utf8",
|
|
263
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
264
|
+
});
|
|
265
|
+
if (result.error || result.status !== 0) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
return (0, node_fs_1.existsSync)((0, node_path_1.join)(result.stdout.trim(), "lib", "rustlib", wasm_1.wasmTriple));
|
|
269
|
+
}
|
|
270
|
+
// Whether cargo-affected, started in the context's folder, finds both
|
|
271
|
+
// llvm-cov and llvm-profdata as it looks for them: in the `lib/rustlib/<host>/bin`
|
|
272
|
+
// of the sysroot that rustc names there, through `xcrun --find` on macOS, or
|
|
273
|
+
// on PATH.
|
|
274
|
+
function llvmToolsInstalled(context) {
|
|
275
|
+
var _a, _b;
|
|
276
|
+
const folder = toolFolder(context);
|
|
277
|
+
const env = Object.assign(Object.assign({}, context.env), { RUSTUP_AUTO_INSTALL: "0" });
|
|
278
|
+
const rustc = (args) => (0, node_child_process_1.spawnSync)("rustc", args, {
|
|
279
|
+
cwd: folder,
|
|
280
|
+
env,
|
|
281
|
+
encoding: "utf8",
|
|
282
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
283
|
+
});
|
|
284
|
+
const sysroot = rustc(["--print", "sysroot"]);
|
|
285
|
+
const host = (_b = /^host: (\S+)$/m.exec((_a = rustc(["-vV"]).stdout) !== null && _a !== void 0 ? _a : "")) === null || _b === void 0 ? void 0 : _b[1];
|
|
286
|
+
const sysrootBin = sysroot.status === 0 && host !== undefined
|
|
287
|
+
? (0, node_path_1.join)(sysroot.stdout.trim(), "lib", "rustlib", host, "bin")
|
|
288
|
+
: undefined;
|
|
289
|
+
return ["llvm-cov", "llvm-profdata"].every((tool) => (sysrootBin !== undefined && findExecutable(tool, [sysrootBin]) !== undefined) ||
|
|
290
|
+
(process.platform === "darwin" &&
|
|
291
|
+
(0, node_child_process_1.spawnSync)("xcrun", ["--find", tool], { env, stdio: "ignore" }).status === 0) ||
|
|
292
|
+
findExecutable(tool, searchPath(context.env, folder)) !== undefined);
|
|
293
|
+
}
|
|
294
|
+
// "The" at the start of a sentence; a tool's own name keeps its case.
|
|
295
|
+
function sentenceStart(name) {
|
|
296
|
+
return name.startsWith("the ") ? `The ${name.slice(4)}` : name;
|
|
297
|
+
}
|
|
298
|
+
function list(items) {
|
|
299
|
+
return items.length <= 1
|
|
300
|
+
? items.join("")
|
|
301
|
+
: `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=optional-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"optional-tools.js","sourceRoot":"","sources":["../../../../nx-rust/src/tools/optional-tools.ts"],"names":[],"mappings":";;;AAuOA,gDAGC;AA2BD,kCAaC;AAsCD,wCAEC;AASD,4DAWC;AAKD,wCAgBC;AAOD,gCAIC;AA9WD,2DAA+C;AAC/C,qCAAsE;AACtE,qCAAkC;AAClC,yCAAwE;AAExE,4DAA8E;AAE9E,wCAA2C;AAwElC,2FAxEA,iBAAU,OAwEA;AAvEnB,yCAA8C;AAmE9C,6FAA6F;AAChF,QAAA,2BAA2B,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,kBAAkB,CAAC,CAAC;AAK3F;;;;;;;;;;;GAWG;AACH,kCAAkC;AACrB,QAAA,aAAa,GAA4B;IACpD;QACE,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,8DAA8D;QACvE,SAAS,EAAE,CAAC,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,GAAG,CAAC,CAAC,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_path_1 = require("node:path");
|
|
4
|
+
const napi_cli_1 = require("./napi-cli");
|
|
5
|
+
/**
|
|
6
|
+
* Prints the napi CLI that `napi-build` of a crate post-processes with, as
|
|
7
|
+
* the executor finds it: the package `@napi-rs/cli` that Node resolves from
|
|
8
|
+
* the crate's folder, by its name and version, or a line that says that
|
|
9
|
+
* none is installed. It prints no path of the checkout, so that checkouts in
|
|
10
|
+
* other folders share the keys.
|
|
11
|
+
*
|
|
12
|
+
* The runtime input of `napi-build` runs it in the repository root with the
|
|
13
|
+
* crate's folder, relative to the repository root, as its argument, so that
|
|
14
|
+
* the target's key holds the CLI's version (`REQ-ARTIFACT-CACHE`,
|
|
15
|
+
* `DES-NAPI`).
|
|
16
|
+
*/
|
|
17
|
+
// @mara implements DES-NAPI
|
|
18
|
+
function printNapiCli() {
|
|
19
|
+
var _a;
|
|
20
|
+
const cli = (0, napi_cli_1.installedNapiCli)((0, node_path_1.resolve)(process.cwd(), (_a = process.argv[2]) !== null && _a !== void 0 ? _a : "."));
|
|
21
|
+
process.stdout.write(cli === undefined ? "@napi-rs/cli not installed\n" : `@napi-rs/cli ${cli.version}\n`);
|
|
22
|
+
}
|
|
23
|
+
printNapiCli();
|
|
24
|
+
//# sourceMappingURL=print-napi-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-napi-cli.js","sourceRoot":"","sources":["../../../../nx-rust/src/tools/print-napi-cli.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AACpC,yCAA8C;AAE9C;;;;;;;;;;;GAWG;AACH,4BAA4B;AAC5B,SAAS,YAAY;;IACnB,MAAM,GAAG,GAAG,IAAA,2BAAgB,EAAC,IAAA,mBAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,mCAAI,GAAG,CAAC,CAAC,CAAC;IAC7E,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,gBAAgB,GAAG,CAAC,OAAO,IAAI,CACrF,CAAC;AACJ,CAAC;AAED,YAAY,EAAE,CAAC"}
|