@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,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filesNxSees = filesNxSees;
|
|
4
|
+
exports.foldersNxSees = foldersNxSees;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const nx_bridge_1 = require("../compatibility/nx-bridge");
|
|
9
|
+
/**
|
|
10
|
+
* Which of `files`, relative to the repository root, are in the files that
|
|
11
|
+
* Nx sees: those that `.gitignore` and `.nxignore` files and Nx's fixed
|
|
12
|
+
* exclusions leave in its workspace context. Nx hashes no other file, and a
|
|
13
|
+
* fileset that names one has no effect (`EVD-NX-24-FILE-INPUTS`).
|
|
14
|
+
*
|
|
15
|
+
* It asks Nx's workspace context, through the daemon where one serves the
|
|
16
|
+
* command, as Nx's own plugins do. Where the installed Nx lacks that part,
|
|
17
|
+
* every file counts as seen.
|
|
18
|
+
*/
|
|
19
|
+
function filesNxSees(workspaceRoot, files) {
|
|
20
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
if (files.length === 0) {
|
|
22
|
+
return new Set();
|
|
23
|
+
}
|
|
24
|
+
const glob = workspaceContextGlob(workspaceRoot);
|
|
25
|
+
if (glob === undefined) {
|
|
26
|
+
return new Set(files);
|
|
27
|
+
}
|
|
28
|
+
return new Set(yield glob(workspaceRoot, files.map(escapeGlob)));
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Which of `folders`, relative to the repository root, Nx sees: a folder
|
|
33
|
+
* with a `Cargo.toml` where Nx sees that file, and another folder where Nx
|
|
34
|
+
* sees any file below it ({@link filesNxSees}).
|
|
35
|
+
*/
|
|
36
|
+
function foldersNxSees(workspaceRoot, folders) {
|
|
37
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (folders.length === 0) {
|
|
39
|
+
return new Set();
|
|
40
|
+
}
|
|
41
|
+
const glob = workspaceContextGlob(workspaceRoot);
|
|
42
|
+
if (glob === undefined) {
|
|
43
|
+
return new Set(folders);
|
|
44
|
+
}
|
|
45
|
+
const prefix = (folder) => (folder === "." ? "" : `${escapeGlob(folder)}/`);
|
|
46
|
+
const patterns = folders.map((folder) => (0, node_fs_1.existsSync)((0, node_path_1.join)(workspaceRoot, folder, "Cargo.toml"))
|
|
47
|
+
? `${prefix(folder)}Cargo.toml`
|
|
48
|
+
: `${prefix(folder)}**/*`);
|
|
49
|
+
const files = yield glob(workspaceRoot, patterns);
|
|
50
|
+
return new Set(folders.filter((folder) => files.some((file) => folder === "." || file.startsWith(`${folder}/`))));
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
// `globWithWorkspaceContext` of the Nx installed in the repository.
|
|
54
|
+
function workspaceContextGlob(workspaceRoot) {
|
|
55
|
+
try {
|
|
56
|
+
return (0, nx_bridge_1.loadWorkspaceContext)(workspaceRoot, ["globWithWorkspaceContext"])
|
|
57
|
+
.globWithWorkspaceContext;
|
|
58
|
+
}
|
|
59
|
+
catch (_a) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// A path as a glob that matches only itself.
|
|
64
|
+
function escapeGlob(path) {
|
|
65
|
+
return path.replace(/[*?[\]{}()!@+\\]/g, "\\$&");
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=visibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visibility.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/visibility.ts"],"names":[],"mappings":";;AAcA,kCAYC;AAOD,sCAuBC;;AAxDD,qCAAqC;AACrC,yCAAiC;AACjC,0DAAkE;AAElE;;;;;;;;;GASG;AACH,SAAsB,WAAW,CAC/B,aAAqB,EACrB,KAAwB;;QAExB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,IAAI,GAAG,EAAE,CAAC;QACnB,CAAC;QACD,MAAM,IAAI,GAAG,oBAAoB,CAAC,aAAa,CAAC,CAAC;QACjD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;CAAA;AAED;;;;GAIG;AACH,SAAsB,aAAa,CACjC,aAAqB,EACrB,OAA0B;;QAE1B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,GAAG,EAAE,CAAC;QACnB,CAAC;QACD,MAAM,IAAI,GAAG,oBAAoB,CAAC,aAAa,CAAC,CAAC;QACjD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QACD,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACpF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACtC,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;YACnD,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY;YAC/B,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAC5B,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAClD,OAAO,IAAI,GAAG,CACZ,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CACxB,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CACtE,CACF,CAAC;IACJ,CAAC;CAAA;AAID,oEAAoE;AACpE,SAAS,oBAAoB,CAAC,aAAqB;IACjD,IAAI,CAAC;QACH,OAAO,IAAA,gCAAoB,EAAC,aAAa,EAAE,CAAC,0BAA0B,CAAC,CAAC;aACrE,wBAAwB,CAAC;IAC9B,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,6CAA6C;AAC7C,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Input } from "./inputs";
|
|
2
|
+
/**
|
|
3
|
+
* The name of the named input that holds a digest of a project's warnings
|
|
4
|
+
* (`DES-DIAGNOSTICS`, "Warnings where they are seen"). No target names it:
|
|
5
|
+
* Nx hashes a project's named inputs into the key of each of its tasks and
|
|
6
|
+
* of the tasks that depend on it all the same (`EVD-NX-24-WARNING-CHANNELS`).
|
|
7
|
+
*/
|
|
8
|
+
export declare const warningsInputName = "nx-rust-warnings";
|
|
9
|
+
/**
|
|
10
|
+
* The named input that holds the digest of a project's warnings, which the
|
|
11
|
+
* executor prints at the start of each of the project's tasks, so that the
|
|
12
|
+
* tasks' keys change with them and a cache hit replays the warnings of the
|
|
13
|
+
* graph that the command uses (`DES-DIAGNOSTICS`, "Warnings where they are
|
|
14
|
+
* seen"). A project without warnings and without such causes gets none, so
|
|
15
|
+
* that its keys are the keys it has without the plugin's warnings.
|
|
16
|
+
*
|
|
17
|
+
* The digest is the value of the input's only entry, a command that prints
|
|
18
|
+
* it: Nx hashes the entries of named inputs, not their names. Since no
|
|
19
|
+
* target names the input, Nx never runs the command.
|
|
20
|
+
*
|
|
21
|
+
* @param repositoryRoot The absolute path of the repository root.
|
|
22
|
+
* @param causes What decides warnings that only `createDependencies` finds,
|
|
23
|
+
* the `dependsOn` entries that `targetDefaults` adds to the project's
|
|
24
|
+
* targets (`targetDefaultCauses` in `target-defaults.ts`).
|
|
25
|
+
*/
|
|
26
|
+
export declare function warningsInput(warnings: readonly string[], repositoryRoot: string, causes?: readonly string[]): Record<string, Input[]>;
|
|
27
|
+
/**
|
|
28
|
+
* The digest of a project's warnings: SHA-256 over the warnings, each once
|
|
29
|
+
* and sorted, with the paths inside the repository written relative to its
|
|
30
|
+
* root, so that checkouts of one repository in different folders get one
|
|
31
|
+
* digest, and over the causes of the warnings that only `createDependencies`
|
|
32
|
+
* finds, sorted, where there are any. A path outside the repository, such
|
|
33
|
+
* as the Cargo home's, stays as it is: it names the cause.
|
|
34
|
+
*
|
|
35
|
+
* @param repositoryRoot The absolute path of the repository root; its real
|
|
36
|
+
* path counts too, as cargo reports paths through symbolic links resolved.
|
|
37
|
+
*/
|
|
38
|
+
export declare function warningsDigest(warnings: readonly string[], repositoryRoot: string, causes?: readonly string[]): string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.warningsInputName = void 0;
|
|
4
|
+
exports.warningsInput = warningsInput;
|
|
5
|
+
exports.warningsDigest = warningsDigest;
|
|
6
|
+
const node_crypto_1 = require("node:crypto");
|
|
7
|
+
const real_path_1 = require("./real-path");
|
|
8
|
+
/**
|
|
9
|
+
* The name of the named input that holds a digest of a project's warnings
|
|
10
|
+
* (`DES-DIAGNOSTICS`, "Warnings where they are seen"). No target names it:
|
|
11
|
+
* Nx hashes a project's named inputs into the key of each of its tasks and
|
|
12
|
+
* of the tasks that depend on it all the same (`EVD-NX-24-WARNING-CHANNELS`).
|
|
13
|
+
*/
|
|
14
|
+
exports.warningsInputName = "nx-rust-warnings";
|
|
15
|
+
/**
|
|
16
|
+
* The named input that holds the digest of a project's warnings, which the
|
|
17
|
+
* executor prints at the start of each of the project's tasks, so that the
|
|
18
|
+
* tasks' keys change with them and a cache hit replays the warnings of the
|
|
19
|
+
* graph that the command uses (`DES-DIAGNOSTICS`, "Warnings where they are
|
|
20
|
+
* seen"). A project without warnings and without such causes gets none, so
|
|
21
|
+
* that its keys are the keys it has without the plugin's warnings.
|
|
22
|
+
*
|
|
23
|
+
* The digest is the value of the input's only entry, a command that prints
|
|
24
|
+
* it: Nx hashes the entries of named inputs, not their names. Since no
|
|
25
|
+
* target names the input, Nx never runs the command.
|
|
26
|
+
*
|
|
27
|
+
* @param repositoryRoot The absolute path of the repository root.
|
|
28
|
+
* @param causes What decides warnings that only `createDependencies` finds,
|
|
29
|
+
* the `dependsOn` entries that `targetDefaults` adds to the project's
|
|
30
|
+
* targets (`targetDefaultCauses` in `target-defaults.ts`).
|
|
31
|
+
*/
|
|
32
|
+
// @mara implements DES-DIAGNOSTICS
|
|
33
|
+
function warningsInput(warnings, repositoryRoot, causes = []) {
|
|
34
|
+
return warnings.length === 0 && causes.length === 0
|
|
35
|
+
? {}
|
|
36
|
+
: {
|
|
37
|
+
[exports.warningsInputName]: [
|
|
38
|
+
{ runtime: `echo ${warningsDigest(warnings, repositoryRoot, causes)}` },
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The digest of a project's warnings: SHA-256 over the warnings, each once
|
|
44
|
+
* and sorted, with the paths inside the repository written relative to its
|
|
45
|
+
* root, so that checkouts of one repository in different folders get one
|
|
46
|
+
* digest, and over the causes of the warnings that only `createDependencies`
|
|
47
|
+
* finds, sorted, where there are any. A path outside the repository, such
|
|
48
|
+
* as the Cargo home's, stays as it is: it names the cause.
|
|
49
|
+
*
|
|
50
|
+
* @param repositoryRoot The absolute path of the repository root; its real
|
|
51
|
+
* path counts too, as cargo reports paths through symbolic links resolved.
|
|
52
|
+
*/
|
|
53
|
+
function warningsDigest(warnings, repositoryRoot, causes = []) {
|
|
54
|
+
const roots = [...new Set([repositoryRoot, (0, real_path_1.realPath)(repositoryRoot)])].sort((a, b) => b.length - a.length);
|
|
55
|
+
const relative = (warning) => roots.reduce((text, root) => withRelativePaths(text, root), warning);
|
|
56
|
+
const normalised = [...new Set(warnings.map(relative))].sort(compare);
|
|
57
|
+
const hashed = causes.length === 0
|
|
58
|
+
? normalised
|
|
59
|
+
: { warnings: normalised, targetDefaults: [...new Set(causes)].sort(compare) };
|
|
60
|
+
return (0, node_crypto_1.createHash)("sha256").update(JSON.stringify(hashed)).digest("hex");
|
|
61
|
+
}
|
|
62
|
+
// The text with every path below `root` written relative to it, and `root`
|
|
63
|
+
// itself as `.`. A path that only starts or ends with the same characters,
|
|
64
|
+
// such as `/repo-old` or `/old/repo` beside `/repo`, is no path below it.
|
|
65
|
+
function withRelativePaths(text, root) {
|
|
66
|
+
if (root === "/" || root === "") {
|
|
67
|
+
return text;
|
|
68
|
+
}
|
|
69
|
+
const escaped = root.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
70
|
+
return text
|
|
71
|
+
.replace(new RegExp(`(?<![\\w.-])${escaped}/`, "g"), "")
|
|
72
|
+
.replace(new RegExp(`(?<![\\w.-])${escaped}(?![\\w.-])`, "g"), ".");
|
|
73
|
+
}
|
|
74
|
+
function compare(a, b) {
|
|
75
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=warnings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/warnings.ts"],"names":[],"mappings":";;;AA8BA,sCAYC;AAaD,wCAgBC;AAvED,6CAAyC;AAEzC,2CAAuC;AAEvC;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,kBAAkB,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,mCAAmC;AACnC,SAAgB,aAAa,CAC3B,QAA2B,EAC3B,cAAsB,EACtB,SAA4B,EAAE;IAE9B,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QACjD,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;YACE,CAAC,yBAAiB,CAAC,EAAE;gBACnB,EAAE,OAAO,EAAE,QAAQ,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,EAAE;aACxE;SACF,CAAC;AACR,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,cAAc,CAC5B,QAA2B,EAC3B,cAAsB,EACtB,SAA4B,EAAE;IAE9B,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,IAAA,oBAAQ,EAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CACzE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAC9B,CAAC;IACF,MAAM,QAAQ,GAAG,CAAC,OAAe,EAAE,EAAE,CACnC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IACvE,MAAM,UAAU,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtE,MAAM,MAAM,GACV,MAAM,CAAC,MAAM,KAAK,CAAC;QACjB,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IACnF,OAAO,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3E,CAAC;AAED,2EAA2E;AAC3E,2EAA2E;AAC3E,0EAA0E;AAC1E,SAAS,iBAAiB,CAAC,IAAY,EAAE,IAAY;IACnD,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,IAAI;SACR,OAAO,CAAC,IAAI,MAAM,CAAC,eAAe,OAAO,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;SACvD,OAAO,CAAC,IAAI,MAAM,CAAC,eAAe,OAAO,aAAa,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AACxE,CAAC;AAED,SAAS,OAAO,CAAC,CAAS,EAAE,CAAS;IACnC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type ArtifactSubject } from "./artifact-kinds";
|
|
2
|
+
/** The triple that `wasm-build` compiles for (`DES-WASM`). */
|
|
3
|
+
export declare const wasmTriple = "wasm32-unknown-unknown";
|
|
4
|
+
/**
|
|
5
|
+
* The folder in the crate's folder that `wasm-build` writes the package to,
|
|
6
|
+
* as wasm-pack names it, outside Cargo's directories (`DES-WASM`). It is the
|
|
7
|
+
* target's output and no input of the crate's targets.
|
|
8
|
+
*/
|
|
9
|
+
export declare const wasmPackageFolder = "pkg";
|
|
10
|
+
/** The wasm targets of the `wasm-bindgen` CLI that `wasm-build` takes, its `--target` values (`DES-WASM`). */
|
|
11
|
+
export declare const wasmTargets: readonly ["bundler", "web", "nodejs"];
|
|
12
|
+
/** A wasm target of {@link wasmTargets}. */
|
|
13
|
+
export type WasmTarget = (typeof wasmTargets)[number];
|
|
14
|
+
/** The wasm target that the inferred `wasm-build` sets in its options: the CLI's own default. */
|
|
15
|
+
export declare const defaultWasmTarget: WasmTarget;
|
|
16
|
+
/**
|
|
17
|
+
* The variables that the `wasm-bindgen` CLI reads and that change what it
|
|
18
|
+
* writes: in 0.2.130, `WASM_BINDGEN_ANYREF` and `WASM_BINDGEN_EXTERNREF`
|
|
19
|
+
* turn on reference types and `WASM_BINDGEN_MULTI_VALUE` multi-value
|
|
20
|
+
* returns, whatever their value (`EVD-WASM-POSTPROCESS`).
|
|
21
|
+
*/
|
|
22
|
+
export declare const wasmBindgenVariables: readonly ["WASM_BINDGEN_ANYREF", "WASM_BINDGEN_EXTERNREF", "WASM_BINDGEN_MULTI_VALUE"];
|
|
23
|
+
/**
|
|
24
|
+
* Whether a crate produces a wasm package (`DES-ARTIFACT-STEPS`): its
|
|
25
|
+
* library target has the crate type `cdylib` and it depends directly,
|
|
26
|
+
* through a normal dependency, on `wasm-bindgen`, also one declared for one
|
|
27
|
+
* platform only. An `artifacts` list in the crate's `[package.metadata.nx]`
|
|
28
|
+
* replaces the inference.
|
|
29
|
+
*/
|
|
30
|
+
export declare function producesWasmPackage(subject: ArtifactSubject): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The inputs that `wasm-build` has beside those of `build` (`DES-INPUTS`,
|
|
33
|
+
* `REQ-ARTIFACT-CACHE`):
|
|
34
|
+
*
|
|
35
|
+
* - an `env` input for each of {@link wasmBindgenVariables}, for its value;
|
|
36
|
+
* - a `runtime` input that prints what `wasm-bindgen --version` writes in
|
|
37
|
+
* the workspace root, where the task finds the CLI on `PATH` as the
|
|
38
|
+
* executor does, or a random value, new at each evaluation, where it
|
|
39
|
+
* fails, so that no stored result is restored; and then one line per
|
|
40
|
+
* variable of {@link wasmBindgenVariables} that says whether it is set.
|
|
41
|
+
* The CLI turns each on by its presence, also with an empty value, while
|
|
42
|
+
* Nx 24 hashes an unset and an empty `env` input alike
|
|
43
|
+
* (`EVD-WASM-POSTPROCESS`), so only these lines tell the two apart. Nx
|
|
44
|
+
* runs the command with the task's environment, its dotenv files
|
|
45
|
+
* included, as the batch gives it to the CLI (`EVD-NX-24-INPUT-SEMANTICS`).
|
|
46
|
+
*
|
|
47
|
+
* The triple is a constant of the target, whose name and options Nx
|
|
48
|
+
* hashes, and the toolchain input names the compiler.
|
|
49
|
+
*
|
|
50
|
+
* @param workspaceRoot The workspace's root folder, relative to the repository root.
|
|
51
|
+
*/
|
|
52
|
+
export declare function wasmInputs(workspaceRoot: string): ({
|
|
53
|
+
runtime: string;
|
|
54
|
+
} | {
|
|
55
|
+
env: string;
|
|
56
|
+
})[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wasmBindgenVariables = exports.defaultWasmTarget = exports.wasmTargets = exports.wasmPackageFolder = exports.wasmTriple = void 0;
|
|
4
|
+
exports.producesWasmPackage = producesWasmPackage;
|
|
5
|
+
exports.wasmInputs = wasmInputs;
|
|
6
|
+
const artifact_kinds_1 = require("./artifact-kinds");
|
|
7
|
+
const script_input_1 = require("./script-input");
|
|
8
|
+
/** The triple that `wasm-build` compiles for (`DES-WASM`). */
|
|
9
|
+
exports.wasmTriple = "wasm32-unknown-unknown";
|
|
10
|
+
/**
|
|
11
|
+
* The folder in the crate's folder that `wasm-build` writes the package to,
|
|
12
|
+
* as wasm-pack names it, outside Cargo's directories (`DES-WASM`). It is the
|
|
13
|
+
* target's output and no input of the crate's targets.
|
|
14
|
+
*/
|
|
15
|
+
exports.wasmPackageFolder = "pkg";
|
|
16
|
+
/** The wasm targets of the `wasm-bindgen` CLI that `wasm-build` takes, its `--target` values (`DES-WASM`). */
|
|
17
|
+
exports.wasmTargets = ["bundler", "web", "nodejs"];
|
|
18
|
+
/** The wasm target that the inferred `wasm-build` sets in its options: the CLI's own default. */
|
|
19
|
+
exports.defaultWasmTarget = "bundler";
|
|
20
|
+
/**
|
|
21
|
+
* The variables that the `wasm-bindgen` CLI reads and that change what it
|
|
22
|
+
* writes: in 0.2.130, `WASM_BINDGEN_ANYREF` and `WASM_BINDGEN_EXTERNREF`
|
|
23
|
+
* turn on reference types and `WASM_BINDGEN_MULTI_VALUE` multi-value
|
|
24
|
+
* returns, whatever their value (`EVD-WASM-POSTPROCESS`).
|
|
25
|
+
*/
|
|
26
|
+
exports.wasmBindgenVariables = [
|
|
27
|
+
"WASM_BINDGEN_ANYREF",
|
|
28
|
+
"WASM_BINDGEN_EXTERNREF",
|
|
29
|
+
"WASM_BINDGEN_MULTI_VALUE",
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Whether a crate produces a wasm package (`DES-ARTIFACT-STEPS`): its
|
|
33
|
+
* library target has the crate type `cdylib` and it depends directly,
|
|
34
|
+
* through a normal dependency, on `wasm-bindgen`, also one declared for one
|
|
35
|
+
* platform only. An `artifacts` list in the crate's `[package.metadata.nx]`
|
|
36
|
+
* replaces the inference.
|
|
37
|
+
*/
|
|
38
|
+
function producesWasmPackage(subject) {
|
|
39
|
+
return (0, artifact_kinds_1.producesArtifact)(subject, "wasm");
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The inputs that `wasm-build` has beside those of `build` (`DES-INPUTS`,
|
|
43
|
+
* `REQ-ARTIFACT-CACHE`):
|
|
44
|
+
*
|
|
45
|
+
* - an `env` input for each of {@link wasmBindgenVariables}, for its value;
|
|
46
|
+
* - a `runtime` input that prints what `wasm-bindgen --version` writes in
|
|
47
|
+
* the workspace root, where the task finds the CLI on `PATH` as the
|
|
48
|
+
* executor does, or a random value, new at each evaluation, where it
|
|
49
|
+
* fails, so that no stored result is restored; and then one line per
|
|
50
|
+
* variable of {@link wasmBindgenVariables} that says whether it is set.
|
|
51
|
+
* The CLI turns each on by its presence, also with an empty value, while
|
|
52
|
+
* Nx 24 hashes an unset and an empty `env` input alike
|
|
53
|
+
* (`EVD-WASM-POSTPROCESS`), so only these lines tell the two apart. Nx
|
|
54
|
+
* runs the command with the task's environment, its dotenv files
|
|
55
|
+
* included, as the batch gives it to the CLI (`EVD-NX-24-INPUT-SEMANTICS`).
|
|
56
|
+
*
|
|
57
|
+
* The triple is a constant of the target, whose name and options Nx
|
|
58
|
+
* hashes, and the toolchain input names the compiler.
|
|
59
|
+
*
|
|
60
|
+
* @param workspaceRoot The workspace's root folder, relative to the repository root.
|
|
61
|
+
*/
|
|
62
|
+
// @mara implements DES-INPUTS
|
|
63
|
+
// @mara implements REQ-ARTIFACT-CACHE
|
|
64
|
+
function wasmInputs(workspaceRoot) {
|
|
65
|
+
const presence = exports.wasmBindgenVariables.map((name) => `if [ -n "\${${name}+x}" ]; then echo '${name} set'; else echo '${name} unset'; fi`);
|
|
66
|
+
return [
|
|
67
|
+
...exports.wasmBindgenVariables.map((env) => ({ env })),
|
|
68
|
+
{
|
|
69
|
+
runtime: [
|
|
70
|
+
`{ cd ${(0, artifact_kinds_1.shellQuote)(workspaceRoot)} && wasm-bindgen --version; } 2>/dev/null || ${script_input_1.unrepeatableValue}`,
|
|
71
|
+
...presence,
|
|
72
|
+
"true",
|
|
73
|
+
].join("; "),
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=wasm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/wasm.ts"],"names":[],"mappings":";;;AAyCA,kDAEC;AAyBD,gCAcC;AAlFD,qDAAsF;AACtF,iDAAmD;AAEnD,8DAA8D;AACjD,QAAA,UAAU,GAAG,wBAAwB,CAAC;AAEnD;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAEvC,8GAA8G;AACjG,QAAA,WAAW,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAU,CAAC;AAKjE,iGAAiG;AACpF,QAAA,iBAAiB,GAAe,SAAS,CAAC;AAEvD;;;;;GAKG;AACU,QAAA,oBAAoB,GAAG;IAClC,qBAAqB;IACrB,wBAAwB;IACxB,0BAA0B;CAClB,CAAC;AAEX;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,OAAwB;IAC1D,OAAO,IAAA,iCAAgB,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8BAA8B;AAC9B,sCAAsC;AACtC,SAAgB,UAAU,CAAC,aAAqB;IAC9C,MAAM,QAAQ,GAAG,4BAAoB,CAAC,GAAG,CACvC,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,IAAI,sBAAsB,IAAI,qBAAqB,IAAI,aAAa,CAC9F,CAAC;IACF,OAAO;QACL,GAAG,4BAAoB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QAC/C;YACE,OAAO,EAAE;gBACP,QAAQ,IAAA,2BAAU,EAAC,aAAa,CAAC,gDAAgD,gCAAiB,EAAE;gBACpG,GAAG,QAAQ;gBACX,MAAM;aACP,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC"}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { CreateDependenciesContext, CreateMetadataContext, CreateNodes, ProjectGraph, ProjectsMetadata, RawProjectGraphDependency } from "@nx/devkit";
|
|
2
|
+
import { postTasksExecution, preTasksExecution } from "./executors/nx-command";
|
|
3
|
+
/**
|
|
4
|
+
* The edges between the projects that this entry's `createNodes` created in
|
|
5
|
+
* the same graph computation, from the reports it requested there; none when
|
|
6
|
+
* that call failed, whose error already fails graph creation.
|
|
7
|
+
*
|
|
8
|
+
* It fails first when projects of the plugin still share a name once Nx has
|
|
9
|
+
* merged the projects of all plugins and entries, which only the projects
|
|
10
|
+
* and files that Nx passes here can show, when a `fileInputs` pattern names
|
|
11
|
+
* files in the folder of a project of another plugin or entry that its
|
|
12
|
+
* filesets do not cover (`DES-INPUTS`), and when what Nx merged over a
|
|
13
|
+
* crate's `test` target turns on `affectedTests` where the workspace does
|
|
14
|
+
* not use selection, and when it gives an inferred target a `pluginVersion`
|
|
15
|
+
* that the plugin did not set (`DES-PLUGIN-OPTIONS`). It then reports the
|
|
16
|
+
* `targetDefaults` entries of `nx.json` that change the inferred targets,
|
|
17
|
+
* which only the merged projects show (`DES-TARGET-DEFAULT-GUARD`), and keeps
|
|
18
|
+
* their warnings for {@link createMetadata}.
|
|
19
|
+
*
|
|
20
|
+
* Nx calls it as a method of its copy of the plugin for the entry, which is
|
|
21
|
+
* `this`, with the options it passed to the entry's `createNodes`; where it
|
|
22
|
+
* does not, the plugin cannot tell the entry and fails
|
|
23
|
+
* ({@link entryRegistration}).
|
|
24
|
+
*/
|
|
25
|
+
declare function createDependencies(this: unknown, options: unknown, context: CreateDependenciesContext): RawProjectGraphDependency[] | Promise<RawProjectGraphDependency[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Gives each project whose targets `createDependencies` found warnings for
|
|
28
|
+
* those warnings in its metadata, under `cargo.targetWarnings`, each with
|
|
29
|
+
* its target, so that the executor prints each at the start of a task of
|
|
30
|
+
* its target, where the Nx daemon keeps graph creation's output from the
|
|
31
|
+
* terminal (`DES-DIAGNOSTICS`, "Warnings where they are seen"). Nx merges
|
|
32
|
+
* the metadata into the project's own and keeps it out of task keys.
|
|
33
|
+
*
|
|
34
|
+
* Nx calls it after `createDependencies`, in the same process, as a method
|
|
35
|
+
* of its copy of the plugin for the entry, which is `this`, with the entry's
|
|
36
|
+
* options, as {@link createDependencies}.
|
|
37
|
+
*/
|
|
38
|
+
declare function createMetadata(this: unknown, _graph: ProjectGraph, options: unknown, context: CreateMetadataContext): ProjectsMetadata;
|
|
39
|
+
/**
|
|
40
|
+
* The plugin as Nx loads it.
|
|
41
|
+
*
|
|
42
|
+
* Nx hands each entry's `createNodes` every `Cargo.toml` that `.gitignore`
|
|
43
|
+
* and `.nxignore` do not ignore and that the entry's `include` and `exclude`
|
|
44
|
+
* in `nx.json` let through. The plugin finds the Cargo workspaces among them
|
|
45
|
+
* with one `cargo metadata` report each, and creates a project for each crate
|
|
46
|
+
* and for each workspace whose root manifest defines no crate, with the
|
|
47
|
+
* targets of its shape.
|
|
48
|
+
*
|
|
49
|
+
* `createNodes` is a getter: Nx copies the module's properties once for each
|
|
50
|
+
* entry in `nx.json`, so that each entry gets a registration of its own
|
|
51
|
+
* ({@link Registration}). Nx passes the hooks nothing else that tells the
|
|
52
|
+
* entries apart (EVD-NX-24-PLUGIN-ENTRIES). Nx reads it when it loads the plugin for an entry,
|
|
53
|
+
* and an unsupported Nx stops the plugin there, which fails graph creation
|
|
54
|
+
* also where Nx calls none of its hooks ({@link checkNxOnLoad}).
|
|
55
|
+
*
|
|
56
|
+
* Before a command runs its tasks, `preTasksExecution` records the command's
|
|
57
|
+
* arguments for them and gives the command an id ({@link preTasksExecution});
|
|
58
|
+
* afterwards `postTasksExecution` removes what the command's lockfile tasks
|
|
59
|
+
* kept under that id ({@link postTasksExecution}).
|
|
60
|
+
*/
|
|
61
|
+
declare const plugin: {
|
|
62
|
+
readonly createNodes: CreateNodes;
|
|
63
|
+
createDependencies: typeof createDependencies;
|
|
64
|
+
createMetadata: typeof createMetadata;
|
|
65
|
+
preTasksExecution: typeof preTasksExecution;
|
|
66
|
+
postTasksExecution: typeof postTasksExecution;
|
|
67
|
+
};
|
|
68
|
+
export = plugin;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const nx_version_1 = require("./compatibility/nx-version");
|
|
3
|
+
const nx_command_1 = require("./executors/nx-command");
|
|
4
|
+
const collisions_1 = require("./graph/collisions");
|
|
5
|
+
const declared_files_1 = require("./graph/declared-files");
|
|
6
|
+
const nx_glob_1 = require("./graph/nx-glob");
|
|
7
|
+
const edges_1 = require("./graph/edges");
|
|
8
|
+
const plugin_version_1 = require("./graph/plugin-version");
|
|
9
|
+
const registration_1 = require("./graph/registration");
|
|
10
|
+
const target_defaults_1 = require("./graph/target-defaults");
|
|
11
|
+
const target_tables_1 = require("./graph/target-tables");
|
|
12
|
+
/**
|
|
13
|
+
* The edges between the projects that this entry's `createNodes` created in
|
|
14
|
+
* the same graph computation, from the reports it requested there; none when
|
|
15
|
+
* that call failed, whose error already fails graph creation.
|
|
16
|
+
*
|
|
17
|
+
* It fails first when projects of the plugin still share a name once Nx has
|
|
18
|
+
* merged the projects of all plugins and entries, which only the projects
|
|
19
|
+
* and files that Nx passes here can show, when a `fileInputs` pattern names
|
|
20
|
+
* files in the folder of a project of another plugin or entry that its
|
|
21
|
+
* filesets do not cover (`DES-INPUTS`), and when what Nx merged over a
|
|
22
|
+
* crate's `test` target turns on `affectedTests` where the workspace does
|
|
23
|
+
* not use selection, and when it gives an inferred target a `pluginVersion`
|
|
24
|
+
* that the plugin did not set (`DES-PLUGIN-OPTIONS`). It then reports the
|
|
25
|
+
* `targetDefaults` entries of `nx.json` that change the inferred targets,
|
|
26
|
+
* which only the merged projects show (`DES-TARGET-DEFAULT-GUARD`), and keeps
|
|
27
|
+
* their warnings for {@link createMetadata}.
|
|
28
|
+
*
|
|
29
|
+
* Nx calls it as a method of its copy of the plugin for the entry, which is
|
|
30
|
+
* `this`, with the options it passed to the entry's `createNodes`; where it
|
|
31
|
+
* does not, the plugin cannot tell the entry and fails
|
|
32
|
+
* ({@link entryRegistration}).
|
|
33
|
+
*/
|
|
34
|
+
function createDependencies(options, context) {
|
|
35
|
+
var _a;
|
|
36
|
+
const registration = (0, registration_1.entryRegistration)(this, "createDependencies", options);
|
|
37
|
+
const graph = registration.graphForDependencies(context.workspaceRoot);
|
|
38
|
+
if (graph === undefined) {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
(0, collisions_1.failOnNameCollisions)(graph, context);
|
|
42
|
+
(0, declared_files_1.failOnUncoveredProjectFolders)((_a = graph.declaredPatterns) !== null && _a !== void 0 ? _a : [], context.projects, (0, nx_glob_1.nxSegmentMatcher)(context.workspaceRoot));
|
|
43
|
+
(0, target_tables_1.failOnAffectedTestsOption)(graph, context.projects);
|
|
44
|
+
const edges = (0, edges_1.projectEdges)(graph, context.projects);
|
|
45
|
+
return (0, plugin_version_1.failOnPluginVersionOption)(graph, context, this)
|
|
46
|
+
.then(() => (0, target_defaults_1.failOnTargetDefaults)(graph, context, this))
|
|
47
|
+
.then((warnings) => {
|
|
48
|
+
registration.recordTargetWarnings(context.workspaceRoot, warnings);
|
|
49
|
+
return edges;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Gives each project whose targets `createDependencies` found warnings for
|
|
54
|
+
* those warnings in its metadata, under `cargo.targetWarnings`, each with
|
|
55
|
+
* its target, so that the executor prints each at the start of a task of
|
|
56
|
+
* its target, where the Nx daemon keeps graph creation's output from the
|
|
57
|
+
* terminal (`DES-DIAGNOSTICS`, "Warnings where they are seen"). Nx merges
|
|
58
|
+
* the metadata into the project's own and keeps it out of task keys.
|
|
59
|
+
*
|
|
60
|
+
* Nx calls it after `createDependencies`, in the same process, as a method
|
|
61
|
+
* of its copy of the plugin for the entry, which is `this`, with the entry's
|
|
62
|
+
* options, as {@link createDependencies}.
|
|
63
|
+
*/
|
|
64
|
+
// @mara implements DES-DIAGNOSTICS
|
|
65
|
+
// @mara implements DES-TARGET-DEFAULT-GUARD
|
|
66
|
+
function createMetadata(_graph, options, context) {
|
|
67
|
+
const metadata = {};
|
|
68
|
+
const registration = (0, registration_1.entryRegistration)(this, "createMetadata", options);
|
|
69
|
+
for (const [project, targetWarnings] of registration.targetWarnings(context.workspaceRoot)) {
|
|
70
|
+
metadata[project] = {
|
|
71
|
+
metadata: { [collisions_1.cargoMetadataKey]: { targetWarnings } },
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return metadata;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The plugin as Nx loads it.
|
|
78
|
+
*
|
|
79
|
+
* Nx hands each entry's `createNodes` every `Cargo.toml` that `.gitignore`
|
|
80
|
+
* and `.nxignore` do not ignore and that the entry's `include` and `exclude`
|
|
81
|
+
* in `nx.json` let through. The plugin finds the Cargo workspaces among them
|
|
82
|
+
* with one `cargo metadata` report each, and creates a project for each crate
|
|
83
|
+
* and for each workspace whose root manifest defines no crate, with the
|
|
84
|
+
* targets of its shape.
|
|
85
|
+
*
|
|
86
|
+
* `createNodes` is a getter: Nx copies the module's properties once for each
|
|
87
|
+
* entry in `nx.json`, so that each entry gets a registration of its own
|
|
88
|
+
* ({@link Registration}). Nx passes the hooks nothing else that tells the
|
|
89
|
+
* entries apart (EVD-NX-24-PLUGIN-ENTRIES). Nx reads it when it loads the plugin for an entry,
|
|
90
|
+
* and an unsupported Nx stops the plugin there, which fails graph creation
|
|
91
|
+
* also where Nx calls none of its hooks ({@link checkNxOnLoad}).
|
|
92
|
+
*
|
|
93
|
+
* Before a command runs its tasks, `preTasksExecution` records the command's
|
|
94
|
+
* arguments for them and gives the command an id ({@link preTasksExecution});
|
|
95
|
+
* afterwards `postTasksExecution` removes what the command's lockfile tasks
|
|
96
|
+
* kept under that id ({@link postTasksExecution}).
|
|
97
|
+
*/
|
|
98
|
+
const plugin = {
|
|
99
|
+
get createNodes() {
|
|
100
|
+
(0, nx_version_1.checkNxOnLoad)();
|
|
101
|
+
return new registration_1.Registration().createNodes;
|
|
102
|
+
},
|
|
103
|
+
createDependencies,
|
|
104
|
+
createMetadata,
|
|
105
|
+
preTasksExecution: nx_command_1.preTasksExecution,
|
|
106
|
+
postTasksExecution: nx_command_1.postTasksExecution,
|
|
107
|
+
};
|
|
108
|
+
module.exports = plugin;
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../nx-rust/src/index.ts"],"names":[],"mappings":";AAQA,2DAA2D;AAC3D,uDAA+E;AAC/E,mDAA4E;AAC5E,2DAAuE;AACvE,6CAAmD;AACnD,yCAA6C;AAC7C,2DAAmE;AACnE,uDAAuE;AACvE,6DAA+D;AAC/D,yDAAkE;AAElE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAS,kBAAkB,CAEzB,OAAgB,EAChB,OAAkC;;IAElC,MAAM,YAAY,GAAG,IAAA,gCAAiB,EAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAC5E,MAAM,KAAK,GAAG,YAAY,CAAC,oBAAoB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACvE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAA,iCAAoB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACrC,IAAA,8CAA6B,EAC3B,MAAA,KAAK,CAAC,gBAAgB,mCAAI,EAAE,EAC5B,OAAO,CAAC,QAAQ,EAChB,IAAA,0BAAgB,EAAC,OAAO,CAAC,aAAa,CAAC,CACxC,CAAC;IACF,IAAA,yCAAyB,EAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,IAAA,oBAAY,EAAC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpD,OAAO,IAAA,0CAAyB,EAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC;SACnD,IAAI,CAAC,GAAG,EAAE,CAAC,IAAA,sCAAoB,EAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;SACtD,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;QACjB,YAAY,CAAC,oBAAoB,CAAC,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QACnE,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;;;;;GAWG;AACH,mCAAmC;AACnC,4CAA4C;AAC5C,SAAS,cAAc,CAErB,MAAoB,EACpB,OAAgB,EAChB,OAA8B;IAE9B,MAAM,QAAQ,GAAqB,EAAE,CAAC;IACtC,MAAM,YAAY,GAAG,IAAA,gCAAiB,EAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACxE,KAAK,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,IAAI,YAAY,CAAC,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QAC3F,QAAQ,CAAC,OAAO,CAAC,GAAG;YAClB,QAAQ,EAAE,EAAE,CAAC,6BAAgB,CAAC,EAAE,EAAE,cAAc,EAAE,EAA0C;SAC7F,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,GAAG;IACb,IAAI,WAAW;QACb,IAAA,0BAAa,GAAE,CAAC;QAChB,OAAO,IAAI,2BAAY,EAAE,CAAC,WAAW,CAAC;IACxC,CAAC;IACD,kBAAkB;IAClB,cAAc;IACd,iBAAiB,EAAjB,8BAAiB;IACjB,kBAAkB,EAAlB,+BAAkB;CACnB,CAAC;AAEF,iBAAS,MAAM,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** A parsed TOML table. */
|
|
2
|
+
export type TomlTable = Record<string, unknown>;
|
|
3
|
+
/** Versioning cannot go on; the message says why and what to do. */
|
|
4
|
+
export declare class ReleaseError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
/** Whether `value` is a TOML table. */
|
|
8
|
+
export declare function isTable(value: unknown): value is TomlTable;
|
|
9
|
+
/**
|
|
10
|
+
* The manifest's text parsed.
|
|
11
|
+
*
|
|
12
|
+
* @param manifest The manifest's path, for the message.
|
|
13
|
+
* @throws {ReleaseError} When the text is no valid TOML.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseManifest(text: string, manifest: string): TomlTable;
|
|
16
|
+
/**
|
|
17
|
+
* Where a crate's manifest gives its version: in its own `[package]` table,
|
|
18
|
+
* through `version.workspace = true` from `[workspace.package]`, or not at
|
|
19
|
+
* all, which cargo reports as 0.0.0.
|
|
20
|
+
*/
|
|
21
|
+
export type CrateVersion = {
|
|
22
|
+
kind: "own";
|
|
23
|
+
version: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: "inherited";
|
|
26
|
+
} | {
|
|
27
|
+
kind: "missing";
|
|
28
|
+
};
|
|
29
|
+
/** Where the crate whose parsed manifest is `manifest` takes its version from. */
|
|
30
|
+
export declare function crateVersion(manifest: TomlTable): CrateVersion;
|
|
31
|
+
/** The `[workspace.package].version` of a parsed root manifest, where it has one. */
|
|
32
|
+
export declare function workspaceVersion(root: TomlTable): string | undefined;
|
|
33
|
+
/** The keys from the document root to `[package].version` and to `[workspace.package].version`. */
|
|
34
|
+
export declare const packageVersionPath: readonly ["package", "version"];
|
|
35
|
+
export declare const workspaceVersionPath: readonly ["workspace", "package", "version"];
|
|
36
|
+
/** An entry of a dependency table of a manifest. */
|
|
37
|
+
export interface DependencyEntry {
|
|
38
|
+
/** The keys from the document root to the entry, such as `["target", "cfg(unix)", "dependencies", "a"]`. */
|
|
39
|
+
path: string[];
|
|
40
|
+
/** `workspace` for an entry of `[workspace.dependencies]`. */
|
|
41
|
+
kind: "normal" | "dev" | "build" | "workspace";
|
|
42
|
+
/** The platform of a `[target.<platform>]` table; `null` elsewhere. */
|
|
43
|
+
target: string | null;
|
|
44
|
+
/** The entry's key, which is the package name unless the entry renames it. */
|
|
45
|
+
key: string;
|
|
46
|
+
/** The entry's table; a plain string, a registry requirement, gives `{ version }`. */
|
|
47
|
+
entry: TomlTable;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Every entry of the dependency tables of a parsed manifest: those of each
|
|
51
|
+
* kind, under their old spellings with `_` too, their `[target.*]` forms,
|
|
52
|
+
* and `[workspace.dependencies]` where the manifest has it.
|
|
53
|
+
*/
|
|
54
|
+
export declare function dependencyEntries(manifest: TomlTable): DependencyEntry[];
|
|
55
|
+
/** The table, as a header would name it, that holds the entry at `entry.path`. */
|
|
56
|
+
export declare function tableName(entry: {
|
|
57
|
+
path: readonly string[];
|
|
58
|
+
}): string;
|
|
59
|
+
/** An entry of a `[patch.<source>]` table, in a root manifest or a Cargo configuration file. */
|
|
60
|
+
export interface PatchEntry {
|
|
61
|
+
/** The keys from the document root to the entry, `["patch", source, key]`. */
|
|
62
|
+
path: string[];
|
|
63
|
+
/** The table's source: `crates-io`, a registry's name or a URL. */
|
|
64
|
+
source: string;
|
|
65
|
+
/** The entry's key, which is the package name unless the entry renames it. */
|
|
66
|
+
key: string;
|
|
67
|
+
entry: TomlTable;
|
|
68
|
+
}
|
|
69
|
+
/** Every entry of the `[patch.<source>]` tables of a parsed manifest or configuration file. */
|
|
70
|
+
export declare function patchEntries(document: TomlTable): PatchEntry[];
|
|
71
|
+
/** An entry of `[replace]`, whose key is the package ID specification of what it replaces. */
|
|
72
|
+
export interface ReplaceEntry {
|
|
73
|
+
spec: string;
|
|
74
|
+
entry: TomlTable;
|
|
75
|
+
}
|
|
76
|
+
/** Every entry of the `[replace]` table of a parsed manifest. */
|
|
77
|
+
export declare function replaceEntries(manifest: TomlTable): ReplaceEntry[];
|
|
78
|
+
/** The package ID specification of a `[profile.<name>.package.<spec>]` table. */
|
|
79
|
+
export interface ProfileSpec {
|
|
80
|
+
profile: string;
|
|
81
|
+
spec: string;
|
|
82
|
+
}
|
|
83
|
+
/** Every package ID specification of the profiles' package tables of a parsed manifest or configuration file. */
|
|
84
|
+
export declare function profileSpecs(document: TomlTable): ProfileSpec[];
|
|
85
|
+
/**
|
|
86
|
+
* The parts of a package ID specification, such as `base`, `base:0.1.0`,
|
|
87
|
+
* `base@0.1`, `https://github.com/rust-lang/crates.io-index#base@0.1.0` or
|
|
88
|
+
* `path+file:///repo/crates/base#0.1.0`, where the name is the URL's last
|
|
89
|
+
* segment. `undefined` for `*` and other forms that name no package.
|
|
90
|
+
*/
|
|
91
|
+
export declare function parsePackageSpec(spec: string): {
|
|
92
|
+
url?: string;
|
|
93
|
+
name: string;
|
|
94
|
+
version?: string;
|
|
95
|
+
} | undefined;
|