@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,474 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.afterAllProjectsVersioned = afterAllProjectsVersioned;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const release_1 = require("nx/release");
|
|
8
|
+
const manifests_1 = require("./manifests");
|
|
9
|
+
const places_1 = require("./places");
|
|
10
|
+
const repository_1 = require("./repository");
|
|
11
|
+
const requirements_1 = require("./requirements");
|
|
12
|
+
const version_checks_1 = require("./version-checks");
|
|
13
|
+
const version_lockfiles_1 = require("./version-lockfiles");
|
|
14
|
+
/**
|
|
15
|
+
* The version actions of every project configured for release, by project
|
|
16
|
+
* name: Nx constructs them for each such project before it versions any.
|
|
17
|
+
*/
|
|
18
|
+
const configured = new Map();
|
|
19
|
+
/** The runs, by the tree that Nx hands to each method that writes. */
|
|
20
|
+
const runs = new WeakMap();
|
|
21
|
+
/**
|
|
22
|
+
* The latest run, for `calculateNewVersion`, which gets no tree. Nx calls
|
|
23
|
+
* `validate` with the run's tree before it works out any version.
|
|
24
|
+
*/
|
|
25
|
+
let latestRun;
|
|
26
|
+
/**
|
|
27
|
+
* The project graph of the run, which Nx hands to `readDependencies` before
|
|
28
|
+
* it versions anything; the methods that get none use it.
|
|
29
|
+
*/
|
|
30
|
+
let runGraph;
|
|
31
|
+
/** The repository of the run, once a method has read it. */
|
|
32
|
+
let runRepository;
|
|
33
|
+
/**
|
|
34
|
+
* The version actions that `nx release version` runs for each crate's
|
|
35
|
+
* project (`DES-RELEASE`): Nx works out the bumps, walks the dependents,
|
|
36
|
+
* writes the changelogs and makes the commit and tag, and these actions
|
|
37
|
+
* read and write the crates' `Cargo.toml`.
|
|
38
|
+
*
|
|
39
|
+
* - The current version comes from the crate's manifest, following
|
|
40
|
+
* `[workspace.package].version` where the crate inherits it; `registry`
|
|
41
|
+
* is not supported, and a crate without a version fails when Nx loads
|
|
42
|
+
* the actions, because Nx would replace a later error with its own.
|
|
43
|
+
* - The dependencies, which decide the dependents and the order of the
|
|
44
|
+
* release groups, come from the workspaces' `cargo metadata --no-deps`
|
|
45
|
+
* reports: normal and build dependencies that name a crate with a project
|
|
46
|
+
* by path and carry a version requirement (`ADR-RELEASE-DEPENDENTS`).
|
|
47
|
+
* - A new version is written once per crate, an inherited one once to
|
|
48
|
+
* `[workspace.package]`, and every requirement on the crate that names it
|
|
49
|
+
* by path is updated at the same time, as {@link requirementChange} says,
|
|
50
|
+
* wherever cargo reads one ({@link requirementsOn}). Only the version
|
|
51
|
+
* strings change (`replaceStrings`).
|
|
52
|
+
* - Every check runs before Nx writes any file: Nx keeps the changes in its
|
|
53
|
+
* tree until every release group is processed, and writes nothing when an
|
|
54
|
+
* action throws (`EVD-NX-24-VERSION-ACTIONS`).
|
|
55
|
+
* - Where Nx bumps a fixed group through an edge of the project graph, the
|
|
56
|
+
* output names the edge; where a crate of the release would get a new
|
|
57
|
+
* requirement on a bumped crate without a bump of its own, the run stops
|
|
58
|
+
* (nxr-5a9w1y).
|
|
59
|
+
*/
|
|
60
|
+
// @mara implements DES-RELEASE
|
|
61
|
+
class CargoVersionActions extends release_1.VersionActions {
|
|
62
|
+
constructor(...args) {
|
|
63
|
+
super(...args);
|
|
64
|
+
this.validManifestFilenames = ["Cargo.toml"];
|
|
65
|
+
/**
|
|
66
|
+
* Nx's formatter leaves alone the manifests in {@link manifestsToUpdate},
|
|
67
|
+
* which lists every file that the actions change.
|
|
68
|
+
*/
|
|
69
|
+
this.excludeManifestsFromFormatting = true;
|
|
70
|
+
/** Lines that `calculateNewVersion` found for the next `updateProjectVersion` to print. */
|
|
71
|
+
this.pendingLines = [];
|
|
72
|
+
configured.set(this.projectGraphNode.name, this);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Checks what Nx would otherwise report in its own words or not at all,
|
|
76
|
+
* for every project configured for release: that the project is a crate,
|
|
77
|
+
* that its manifest gives it a version, and that its current version is
|
|
78
|
+
* not to come from a registry.
|
|
79
|
+
*/
|
|
80
|
+
init(tree) {
|
|
81
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const crate = this.crate();
|
|
83
|
+
if (this.finalConfigForProject.currentVersionResolver === "registry") {
|
|
84
|
+
throw new manifests_1.ReleaseError(`The project "${this.projectGraphNode.name}" reads its current version from a registry ("currentVersionResolver": "registry"), which nx-rust does not support. Set "currentVersionResolver" to "disk", the default, which reads the version from ${crate.manifest}, or to "git-tag" in the release configuration of nx.json.`);
|
|
85
|
+
}
|
|
86
|
+
this.currentVersion(tree);
|
|
87
|
+
this.manifestsToUpdate = [
|
|
88
|
+
{
|
|
89
|
+
manifestPath: crate.manifest,
|
|
90
|
+
preserveLocalDependencyProtocols: this.finalConfigForProject.preserveLocalDependencyProtocols,
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Records the project as one of the run's and checks that the crates that
|
|
97
|
+
* share its inherited version are in its release group, which is fixed.
|
|
98
|
+
*/
|
|
99
|
+
validate(tree) {
|
|
100
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
var _a;
|
|
102
|
+
runOf(tree).projects.add(this.projectGraphNode.name);
|
|
103
|
+
const repository = this.repository(tree);
|
|
104
|
+
const crate = this.releaseCrate(repository);
|
|
105
|
+
if ((0, manifests_1.crateVersion)((0, places_1.readDocument)(tree, repository, crate.manifest)).kind !== "inherited") {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const sharing = (0, version_checks_1.inheritingCrates)(tree, repository, crate);
|
|
109
|
+
const group = this.releaseGroup;
|
|
110
|
+
const reasons = [];
|
|
111
|
+
if (group.projectsRelationship !== "fixed") {
|
|
112
|
+
reasons.push(`the release group "${group.name}" is ${group.projectsRelationship}`);
|
|
113
|
+
}
|
|
114
|
+
const byGroup = new Map();
|
|
115
|
+
for (const other of sharing) {
|
|
116
|
+
const otherGroup = groupOf(other.project);
|
|
117
|
+
if (other.project === undefined) {
|
|
118
|
+
reasons.push(`${other.name} has no Nx project`);
|
|
119
|
+
}
|
|
120
|
+
else if (otherGroup === undefined) {
|
|
121
|
+
reasons.push(`${other.name} is in no release group`);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
byGroup.set(otherGroup, [...((_a = byGroup.get(otherGroup)) !== null && _a !== void 0 ? _a : []), other.name]);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (byGroup.size > 1) {
|
|
128
|
+
reasons.push((0, version_checks_1.sentenceList)([...byGroup].map(([name, crates]) => `${(0, version_checks_1.sentenceList)(crates)} ${crates.length === 1 ? "is" : "are"} in the release group "${name}"`)));
|
|
129
|
+
}
|
|
130
|
+
if (reasons.length > 0) {
|
|
131
|
+
throw new manifests_1.ReleaseError(`The crates ${(0, version_checks_1.sentenceList)(sharing.map((other) => other.name))} of the Cargo workspace ${crate.workspace.rootManifest} inherit version.workspace = true, so they share the one version in [workspace.package], and nx release version has to version them together, but ${(0, version_checks_1.sentenceList)(reasons)}. Put all of them into one release group with "projectsRelationship": "fixed" in nx.json.`);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
readCurrentVersionFromSourceManifest(tree) {
|
|
136
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
return this.currentVersion(tree);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/** nx-rust reads no version from a registry; `init` has failed already where one is asked for. */
|
|
141
|
+
readCurrentVersionFromRegistry() {
|
|
142
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
return null;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The crates with a project that the crate depends on through a normal or
|
|
148
|
+
* build dependency with a version requirement, matched by the real path
|
|
149
|
+
* of their folders, in any of the repository's workspaces. A requirement
|
|
150
|
+
* of `*` in the report is looked up in the manifest, because cargo gives
|
|
151
|
+
* it also where the entry has no version (`EVD-CARGO-PUBLISH`).
|
|
152
|
+
*/
|
|
153
|
+
readDependencies(tree, projectGraph) {
|
|
154
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
runGraph = projectGraph;
|
|
156
|
+
const repository = this.repository(tree);
|
|
157
|
+
const crate = this.releaseCrate(repository);
|
|
158
|
+
const targets = new Set();
|
|
159
|
+
for (const dependency of crate.dependencies) {
|
|
160
|
+
if (dependency.kind === "dev" || dependency.path === undefined) {
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
const target = repository.crateAt(dependency.path);
|
|
164
|
+
if ((target === null || target === void 0 ? void 0 : target.project) === undefined || target === crate || targets.has(target.project)) {
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
if (dependency.req !== "*" || (0, version_checks_1.writesRequirement)(tree, repository, crate, dependency)) {
|
|
168
|
+
targets.add(target.project);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return [...targets].map((target) => ({
|
|
172
|
+
source: this.projectGraphNode.name,
|
|
173
|
+
target,
|
|
174
|
+
type: "static",
|
|
175
|
+
}));
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The crate's requirement on the crate of `dependencyProjectName`, as its
|
|
180
|
+
* manifest or the `[workspace.dependencies]` entry it inherits writes it,
|
|
181
|
+
* for Nx's record of the run; `null` where it has none of kind normal or
|
|
182
|
+
* build.
|
|
183
|
+
*/
|
|
184
|
+
readCurrentVersionOfDependency(tree, projectGraph, dependencyProjectName) {
|
|
185
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
runGraph !== null && runGraph !== void 0 ? runGraph : (runGraph = projectGraph);
|
|
187
|
+
const repository = this.repository(tree);
|
|
188
|
+
const crate = this.releaseCrate(repository);
|
|
189
|
+
const target = repository.crateOfProject(dependencyProjectName);
|
|
190
|
+
if (target !== undefined) {
|
|
191
|
+
for (const entry of (0, places_1.memberEntries)(tree, repository, crate)) {
|
|
192
|
+
if ((entry.kind === "normal" || entry.kind === "build") &&
|
|
193
|
+
entry.folder === target.folder &&
|
|
194
|
+
entry.requirement !== undefined) {
|
|
195
|
+
return { currentVersion: entry.requirement, dependencyCollection: (0, manifests_1.tableName)(entry) };
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return { currentVersion: null, dependencyCollection: null };
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Names the edges through which Nx bumps a fixed group that has no bump of
|
|
204
|
+
* its own (nxr-5a9w1y, part 1), which Nx reports with the reason
|
|
205
|
+
* `DEPENDENCY_ACROSS_GROUPS_WAS_BUMPED` for each project of the group with
|
|
206
|
+
* such an edge; the lines come out with the project's version.
|
|
207
|
+
*/
|
|
208
|
+
calculateNewVersion(currentVersion, newVersionInput, newVersionInputReason, newVersionInputReasonData, preid) {
|
|
209
|
+
const _super = Object.create(null, {
|
|
210
|
+
calculateNewVersion: { get: () => super.calculateNewVersion }
|
|
211
|
+
});
|
|
212
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
const result = yield _super.calculateNewVersion.call(this, currentVersion, newVersionInput, newVersionInputReason, newVersionInputReasonData, preid);
|
|
214
|
+
const run = latestRun;
|
|
215
|
+
if (newVersionInputReason === "DEPENDENCY_ACROSS_GROUPS_WAS_BUMPED" &&
|
|
216
|
+
run !== undefined &&
|
|
217
|
+
runGraph !== undefined &&
|
|
218
|
+
!run.named.has(this.projectGraphNode.name)) {
|
|
219
|
+
run.named.add(this.projectGraphNode.name);
|
|
220
|
+
this.pendingLines = (0, version_checks_1.graphBumpLines)(this.projectGraphNode.name, this.releaseGroup.name, run.versioned, runGraph, runRepository, groupOf);
|
|
221
|
+
}
|
|
222
|
+
return result;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Writes the new version, and updates every requirement on the crate
|
|
227
|
+
* wherever cargo reads one. Nothing is written when a check fails.
|
|
228
|
+
*
|
|
229
|
+
* @returns The lines that Nx prints for the crate.
|
|
230
|
+
*/
|
|
231
|
+
updateProjectVersion(tree, newVersion) {
|
|
232
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
233
|
+
const run = runOf(tree);
|
|
234
|
+
const repository = this.repository(tree);
|
|
235
|
+
const crate = this.releaseCrate(repository);
|
|
236
|
+
const edits = new Map();
|
|
237
|
+
const addEdit = (file, edit) => { var _a; return edits.set(file, [...((_a = edits.get(file)) !== null && _a !== void 0 ? _a : []), edit]); };
|
|
238
|
+
const lines = this.pendingLines;
|
|
239
|
+
this.pendingLines = [];
|
|
240
|
+
if ((0, manifests_1.crateVersion)((0, places_1.readDocument)(tree, repository, crate.manifest)).kind === "inherited") {
|
|
241
|
+
const rootManifest = crate.workspace.rootManifest;
|
|
242
|
+
const sharing = (0, version_checks_1.inheritingCrates)(tree, repository, crate);
|
|
243
|
+
(0, version_checks_1.checkVersionedTogether)(run.projects, crate, sharing);
|
|
244
|
+
// Nx may bump a crate twice in a run (EVD-NX-24-VERSION-ACTIONS); the
|
|
245
|
+
// last version stays, as for a version of the crate's own.
|
|
246
|
+
if ((0, manifests_1.workspaceVersion)((0, places_1.readDocument)(tree, repository, rootManifest)) === newVersion) {
|
|
247
|
+
lines.push(`✍️ New version ${newVersion} is in [workspace.package] in ${rootManifest}`);
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
addEdit(rootManifest, { path: manifests_1.workspaceVersionPath, value: newVersion });
|
|
251
|
+
lines.push(`✍️ New version ${newVersion} written to [workspace.package] in ${rootManifest}`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
addEdit(crate.manifest, { path: manifests_1.packageVersionPath, value: newVersion });
|
|
256
|
+
lines.push(`✍️ New version ${newVersion} written to manifest: ${crate.manifest}`);
|
|
257
|
+
}
|
|
258
|
+
const failures = [];
|
|
259
|
+
const rewrites = [];
|
|
260
|
+
for (const requirement of (0, places_1.requirementsOn)(tree, repository, crate)) {
|
|
261
|
+
const place = `${requirement.file} [${requirement.table}]`;
|
|
262
|
+
const change = (0, requirements_1.requirementChange)(requirement.requirement, newVersion, this.preservesMatchingRequirements(requirement));
|
|
263
|
+
if (change.kind === "rewrite" && !requirement.inRepository) {
|
|
264
|
+
failures.push(`- "${requirement.requirement}" in ${place}, which lies outside the repository, where nx release version writes nothing; it has to become "${change.requirement}"`);
|
|
265
|
+
}
|
|
266
|
+
else if (change.kind === "rewrite") {
|
|
267
|
+
addEdit(requirement.file, { path: requirement.versionPath, value: change.requirement });
|
|
268
|
+
rewrites.push({ requirement, crate, to: change.requirement });
|
|
269
|
+
lines.push(`✍️ Updated the requirement on ${crate.name} in ${place} from "${requirement.requirement}" to "${change.requirement}"`);
|
|
270
|
+
}
|
|
271
|
+
else if (change.kind === "keep-other") {
|
|
272
|
+
lines.push(`Kept the requirement "${requirement.requirement}" on ${crate.name} in ${place}: ${newVersion} matches it, and nx-rust rewrites bare, ^, ~ and = requirements only`);
|
|
273
|
+
}
|
|
274
|
+
else if (change.kind === "fail") {
|
|
275
|
+
failures.push(`- "${requirement.requirement}" in ${place}${change.leaves ? "" : `, of which nx-rust cannot tell whether it accepts ${newVersion}`}`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
const blocking = (0, places_1.blockers)(tree, repository, crate, newVersion);
|
|
279
|
+
// The lockfiles that cargo will rewrite after Nx has written the files
|
|
280
|
+
// (`afterAllProjectsVersioned`), checked now with them.
|
|
281
|
+
const { lockfiles, unreadable } = (0, version_lockfiles_1.staleLockfiles)(tree, repository, run, crate, [
|
|
282
|
+
...edits.keys(),
|
|
283
|
+
]);
|
|
284
|
+
const files = [...new Set([...edits.keys(), ...lockfiles.keys()])];
|
|
285
|
+
// A file inside the repository by its path can lead outside it through
|
|
286
|
+
// a symbolic link, of its own or of a folder on the way.
|
|
287
|
+
const outside = files.flatMap((file) => {
|
|
288
|
+
const destination = (0, places_1.outsideDestination)(tree.root, file);
|
|
289
|
+
return destination === undefined ? [] : [`- ${file} leads to ${destination}`];
|
|
290
|
+
});
|
|
291
|
+
const unwritable = files.filter((file) => (0, places_1.outsideDestination)(tree.root, file) === undefined && !(0, version_checks_1.writable)((0, node_path_1.join)(tree.root, file)));
|
|
292
|
+
const sections = [];
|
|
293
|
+
if (failures.length > 0) {
|
|
294
|
+
sections.push([
|
|
295
|
+
`The new version ${newVersion} of ${crate.name} leaves ${failures.length === 1 ? "a requirement" : "requirements"} on it that nx release version cannot rewrite, because only a bare, ^, ~ or = requirement inside the repository can be rewritten without inventing bounds:`,
|
|
296
|
+
...failures,
|
|
297
|
+
`Change ${failures.length === 1 ? "it" : "each of them"} so that it accepts ${newVersion}, or into a bare, ^, ~ or = requirement, and run nx release version again.`,
|
|
298
|
+
].join("\n"));
|
|
299
|
+
}
|
|
300
|
+
if (blocking.length > 0) {
|
|
301
|
+
sections.push([
|
|
302
|
+
`nx release version cannot give ${crate.name} the new version ${newVersion} while:`,
|
|
303
|
+
...blocking,
|
|
304
|
+
].join("\n"));
|
|
305
|
+
}
|
|
306
|
+
if (outside.length > 0) {
|
|
307
|
+
sections.push([
|
|
308
|
+
`The new version ${newVersion} of ${crate.name} changes files that symbolic links lead outside the repository, where nx release version writes nothing:`,
|
|
309
|
+
...outside,
|
|
310
|
+
"Change the versions there by hand, or put the files themselves into the repository, and run nx release version again.",
|
|
311
|
+
].join("\n"));
|
|
312
|
+
}
|
|
313
|
+
if (unreadable.length > 0) {
|
|
314
|
+
const one = unreadable.length === 1;
|
|
315
|
+
sections.push([
|
|
316
|
+
`nx release version cannot read the Cargo.lock of ${one ? "a Cargo workspace" : "Cargo workspaces"}, which it needs to tell whether the new version ${newVersion} of ${crate.name} makes ${one ? "it" : "them"} stale and to bring ${one ? "it" : "them"} up to date:`,
|
|
317
|
+
...unreadable,
|
|
318
|
+
`Make ${one ? "it" : "them"} readable and valid, and run the command again.`,
|
|
319
|
+
].join("\n"));
|
|
320
|
+
}
|
|
321
|
+
if (unwritable.length > 0) {
|
|
322
|
+
sections.push(`nx release version cannot write ${(0, version_checks_1.sentenceList)(unwritable)}, which the new version ${newVersion} of ${crate.name} changes: make ${unwritable.length === 1 ? "it" : "them"} writable and run the command again.`);
|
|
323
|
+
}
|
|
324
|
+
if (sections.length > 0) {
|
|
325
|
+
throw new manifests_1.ReleaseError([...sections, "No file has been changed."].join("\n\n"));
|
|
326
|
+
}
|
|
327
|
+
// Written at the path of what a symbolic link leads to, which Nx then
|
|
328
|
+
// stages and its formatter leaves alone.
|
|
329
|
+
for (const [file, fileEdits] of edits) {
|
|
330
|
+
const path = (0, places_1.treePath)(tree.root, file);
|
|
331
|
+
tree.write(path, (0, version_checks_1.editedFile)(tree, file, fileEdits));
|
|
332
|
+
if (!this.manifestsToUpdate.some((update) => update.manifestPath === path)) {
|
|
333
|
+
this.manifestsToUpdate.push({
|
|
334
|
+
manifestPath: path,
|
|
335
|
+
preserveLocalDependencyProtocols: this.finalConfigForProject.preserveLocalDependencyProtocols,
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
run.written.add(path);
|
|
339
|
+
}
|
|
340
|
+
run.versioned.add(this.projectGraphNode.name);
|
|
341
|
+
run.rewrites.push(...rewrites);
|
|
342
|
+
for (const [lockfile, workspace] of lockfiles) {
|
|
343
|
+
run.lockfiles.set(lockfile, workspace);
|
|
344
|
+
}
|
|
345
|
+
return lines;
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Nx calls it, for each crate whose version a run writes, only once it has
|
|
350
|
+
* decided every version of the run, before it writes any file. The first
|
|
351
|
+
* call checks that no crate of the release gets a rewritten requirement on
|
|
352
|
+
* a bumped crate without a new version of its own (nxr-5a9w1y, part 2).
|
|
353
|
+
* The requirements themselves were updated with the versions.
|
|
354
|
+
*/
|
|
355
|
+
updateProjectDependencies(tree) {
|
|
356
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
357
|
+
const run = runOf(tree);
|
|
358
|
+
if (!run.dependentsChecked) {
|
|
359
|
+
run.dependentsChecked = true;
|
|
360
|
+
(0, version_checks_1.checkDependentsVersioned)(tree, this.repository(tree), run.rewrites, run.versioned, groupOf);
|
|
361
|
+
}
|
|
362
|
+
return [];
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
// What the plugin recorded in the project's metadata about its crate.
|
|
366
|
+
crate() {
|
|
367
|
+
const cargo = (0, repository_1.cargoMetadataOf)(this.projectGraphNode.data.metadata);
|
|
368
|
+
if ((cargo === null || cargo === void 0 ? void 0 : cargo.packageName) === undefined) {
|
|
369
|
+
throw new manifests_1.ReleaseError(`The project "${this.projectGraphNode.name}" uses nx-rust's version actions, but it is no crate: ${cargo === undefined
|
|
370
|
+
? `nx-rust created no crate project in ${this.projectGraphNode.data.root}`
|
|
371
|
+
: `it is the workspace project of ${cargo.manifest}, which has no [package] table and so no version`}. Leave it out of the release groups in nx.json.`);
|
|
372
|
+
}
|
|
373
|
+
return {
|
|
374
|
+
manifest: cargo.manifest,
|
|
375
|
+
workspaceManifest: cargo.workspaceManifest,
|
|
376
|
+
packageName: cargo.packageName,
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
// The current version and the manifest that holds it.
|
|
380
|
+
currentVersion(tree) {
|
|
381
|
+
const crate = this.crate();
|
|
382
|
+
const read = (path) => (0, places_1.readTreeText)(tree, path);
|
|
383
|
+
const version = (0, manifests_1.crateVersion)((0, manifests_1.parseManifest)(read(crate.manifest), crate.manifest));
|
|
384
|
+
if (version.kind === "own") {
|
|
385
|
+
return { currentVersion: version.version, manifestPath: crate.manifest };
|
|
386
|
+
}
|
|
387
|
+
if (version.kind === "missing") {
|
|
388
|
+
throw new manifests_1.ReleaseError(`The crate ${crate.packageName} has no version in ${crate.manifest}, so nx release version cannot version it; cargo takes it as 0.0.0. Give its [package] table a version, such as version = "0.1.0", or leave the project "${this.projectGraphNode.name}" out of the release groups in nx.json.`);
|
|
389
|
+
}
|
|
390
|
+
const inherited = (0, manifests_1.workspaceVersion)((0, manifests_1.parseManifest)(read(crate.workspaceManifest), crate.workspaceManifest));
|
|
391
|
+
if (inherited === undefined) {
|
|
392
|
+
throw new manifests_1.ReleaseError(`The crate ${crate.packageName} inherits its version from [workspace.package] in ${crate.workspaceManifest}, which sets none, so nx release version cannot version it. Set version in [workspace.package] of ${crate.workspaceManifest}, or leave the project "${this.projectGraphNode.name}" out of the release groups in nx.json.`);
|
|
393
|
+
}
|
|
394
|
+
return { currentVersion: inherited, manifestPath: crate.workspaceManifest };
|
|
395
|
+
}
|
|
396
|
+
repository(tree) {
|
|
397
|
+
runGraph !== null && runGraph !== void 0 ? runGraph : (runGraph = (0, devkit_1.readCachedProjectGraph)());
|
|
398
|
+
runRepository = (0, repository_1.releaseRepository)(tree.root, runGraph);
|
|
399
|
+
return runRepository;
|
|
400
|
+
}
|
|
401
|
+
releaseCrate(repository) {
|
|
402
|
+
const crate = repository.crateOfProject(this.projectGraphNode.name);
|
|
403
|
+
if (crate === undefined) {
|
|
404
|
+
throw new manifests_1.ReleaseError(`cargo metadata reports no crate for the project "${this.projectGraphNode.name}" (${this.crate().manifest}), so the project graph is out of date: run nx reset and the command again.`);
|
|
405
|
+
}
|
|
406
|
+
return crate;
|
|
407
|
+
}
|
|
408
|
+
// Whether Nx's `preserveMatchingDependencyRanges` is on for a
|
|
409
|
+
// requirement: that of the crate whose manifest holds it where that crate
|
|
410
|
+
// is configured for release, and otherwise, as in
|
|
411
|
+
// `[workspace.dependencies]` and `[patch]`, that of the crate whose
|
|
412
|
+
// version changes.
|
|
413
|
+
preservesMatchingRequirements(requirement) {
|
|
414
|
+
var _a, _b, _c;
|
|
415
|
+
const holder = (_a = requirement.holder) === null || _a === void 0 ? void 0 : _a.project;
|
|
416
|
+
const setting = holder === undefined
|
|
417
|
+
? undefined
|
|
418
|
+
: (_b = configured.get(holder)) === null || _b === void 0 ? void 0 : _b.finalConfigForProject.preserveMatchingDependencyRanges;
|
|
419
|
+
return (0, version_checks_1.isOn)((_c = setting !== null && setting !== void 0 ? setting : this.finalConfigForProject.preserveMatchingDependencyRanges) !== null && _c !== void 0 ? _c : true);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
exports.default = CargoVersionActions;
|
|
423
|
+
/** The run of `tree`, which becomes the latest. */
|
|
424
|
+
function runOf(tree) {
|
|
425
|
+
let run = runs.get(tree);
|
|
426
|
+
if (run === undefined) {
|
|
427
|
+
run = {
|
|
428
|
+
projects: new Set(),
|
|
429
|
+
versioned: new Set(),
|
|
430
|
+
rewrites: [],
|
|
431
|
+
named: new Set(),
|
|
432
|
+
dependentsChecked: false,
|
|
433
|
+
lockfiles: new Map(),
|
|
434
|
+
written: new Set(),
|
|
435
|
+
lockfileStates: new Map(),
|
|
436
|
+
};
|
|
437
|
+
runs.set(tree, run);
|
|
438
|
+
}
|
|
439
|
+
latestRun = run;
|
|
440
|
+
return run;
|
|
441
|
+
}
|
|
442
|
+
/** The release group of a project configured for release. */
|
|
443
|
+
function groupOf(project) {
|
|
444
|
+
var _a;
|
|
445
|
+
return project === undefined ? undefined : (_a = configured.get(project)) === null || _a === void 0 ? void 0 : _a.releaseGroup.name;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Brings the `Cargo.lock` of each Cargo workspace that the run changed up to
|
|
449
|
+
* date (`DES-RELEASE`, "Lockfile"). Nx calls it once, after it has written
|
|
450
|
+
* the files of the run and before it stages and commits them
|
|
451
|
+
* (`EVD-NX-24-VERSION-ACTIONS`); in a dry run it does nothing, because Nx has
|
|
452
|
+
* written nothing.
|
|
453
|
+
*
|
|
454
|
+
* For each lockfile that `updateProjectVersion` recorded, in the order of
|
|
455
|
+
* their paths, it runs `cargo update --workspace` in the workspace's root
|
|
456
|
+
* folder, with the environment of the run and never with `--locked` or
|
|
457
|
+
* `--offline`, whatever the plugin's `locked` option says, because the
|
|
458
|
+
* lockfile has to change. It goes on after a workspace whose cargo fails,
|
|
459
|
+
* so that the message names every failure, and then throws.
|
|
460
|
+
*
|
|
461
|
+
* @returns The lockfiles that cargo changed and that git does not ignore,
|
|
462
|
+
* for Nx to stage and commit, each by its {@link treePath}: where it lies
|
|
463
|
+
* once symbolic links are followed, relative to the repository root.
|
|
464
|
+
* @throws {ReleaseError} When cargo fails in a workspace, or a lockfile
|
|
465
|
+
* cannot be read, naming the workspace, with cargo's message and the
|
|
466
|
+
* commands that go back or on.
|
|
467
|
+
*/
|
|
468
|
+
// @mara implements DES-RELEASE
|
|
469
|
+
function afterAllProjectsVersioned(cwd, options) {
|
|
470
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
471
|
+
return (0, version_lockfiles_1.updateVersionedLockfiles)(latestRun, cwd, options);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
//# sourceMappingURL=version-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-actions.js","sourceRoot":"","sources":["../../../../nx-rust/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AG,EAAE;YAChB,iBAAiB,EAAE,KAAK;YACxB,SAAS,EAAE,IAAI,GAAG,EAAE;YACpB,OAAO,EAAE,IAAI,GAAG,EAAE;YAClB,cAAc,EAAE,IAAI,GAAG,EAAE;SAC1B,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACtB,CAAC;IACD,SAAS,GAAG,GAAG,CAAC;IAChB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,6DAA6D;AAC7D,SAAS,OAAO,CAAC,OAA2B;;IAC1C,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAA,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,0CAAE,YAAY,CAAC,IAAI,CAAC;AACxF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,+BAA+B;AAC/B,SAAsB,yBAAyB,CAC7C,GAAW,EACX,OAA6B;;QAE7B,OAAO,IAAA,4CAAwB,EAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ProjectGraph, Tree } from "@nx/devkit";
|
|
2
|
+
import type { CargoDependency } from "../cargo/metadata";
|
|
3
|
+
import { type Requirement } from "./places";
|
|
4
|
+
import type { ReleaseCrate, ReleaseRepository } from "./repository";
|
|
5
|
+
import { type StringEdit } from "./toml-edit";
|
|
6
|
+
/** A requirement on a dependent's entry that a run rewrites. */
|
|
7
|
+
export interface Rewrite {
|
|
8
|
+
requirement: Requirement;
|
|
9
|
+
/** The crate whose version changes. */
|
|
10
|
+
crate: ReleaseCrate;
|
|
11
|
+
to: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function checkVersionedTogether(projects: ReadonlySet<string>, crate: ReleaseCrate, sharing: readonly ReleaseCrate[]): void;
|
|
14
|
+
export declare function graphBumpLines(project: string, group: string, versioned: ReadonlySet<string>, graph: ProjectGraph, repository: ReleaseRepository | undefined, groupOf: (project: string | undefined) => string | undefined): string[];
|
|
15
|
+
export declare function checkDependentsVersioned(tree: Tree, repository: ReleaseRepository, rewrites: readonly Rewrite[], versioned: ReadonlySet<string>, groupOf: (project: string | undefined) => string | undefined): void;
|
|
16
|
+
export declare function isOn(setting: boolean | readonly string[]): boolean;
|
|
17
|
+
export declare function writesRequirement(tree: Tree, repository: ReleaseRepository, crate: ReleaseCrate, dependency: CargoDependency): boolean;
|
|
18
|
+
export declare function inheritingCrates(tree: Tree, repository: ReleaseRepository, crate: ReleaseCrate): ReleaseCrate[];
|
|
19
|
+
export declare function writable(path: string): boolean;
|
|
20
|
+
export declare function editedFile(tree: Tree, file: string, edits: readonly StringEdit[]): string;
|
|
21
|
+
export declare function sentenceList(items: readonly string[]): string;
|