@convesoft/nx-rust 0.0.0 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/PLUGIN.md +106 -0
- package/README.md +51 -1
- package/docs/artifacts.mara.md +374 -0
- package/docs/caching.mara.md +999 -0
- package/docs/ci.mara.md +308 -0
- package/docs/configuration.mara.md +508 -0
- package/docs/decisions.mara.md +3267 -0
- package/docs/execution.mara.md +533 -0
- package/docs/index.mara.md +51 -0
- package/docs/product.mara.md +366 -0
- package/docs/release.mara.md +493 -0
- package/docs/setup.mara.md +486 -0
- package/docs/targets.mara.md +704 -0
- package/docs/testing.mara.md +431 -0
- package/docs/verification.mara.md +465 -0
- package/docs/workspaces.mara.md +445 -0
- package/executors.json +35 -0
- package/generators.json +19 -0
- package/package.json +17 -4
- package/src/cargo/build-settings.d.ts +61 -0
- package/src/cargo/build-settings.js +103 -0
- package/src/cargo/build-settings.js.map +1 -0
- package/src/cargo/configured-runner.d.ts +36 -0
- package/src/cargo/configured-runner.js +99 -0
- package/src/cargo/configured-runner.js.map +1 -0
- package/src/cargo/configured-tools.d.ts +35 -0
- package/src/cargo/configured-tools.js +46 -0
- package/src/cargo/configured-tools.js.map +1 -0
- package/src/cargo/dep-info-basedir.d.ts +18 -0
- package/src/cargo/dep-info-basedir.js +38 -0
- package/src/cargo/dep-info-basedir.js.map +1 -0
- package/src/cargo/directories.d.ts +40 -0
- package/src/cargo/directories.js +89 -0
- package/src/cargo/directories.js.map +1 -0
- package/src/cargo/host-triple.d.ts +7 -0
- package/src/cargo/host-triple.js +21 -0
- package/src/cargo/host-triple.js.map +1 -0
- package/src/cargo/lockfile.d.ts +63 -0
- package/src/cargo/lockfile.js +157 -0
- package/src/cargo/lockfile.js.map +1 -0
- package/src/cargo/metadata.d.ts +114 -0
- package/src/cargo/metadata.js +37 -0
- package/src/cargo/metadata.js.map +1 -0
- package/src/cargo/package-specs.d.ts +54 -0
- package/src/cargo/package-specs.js +109 -0
- package/src/cargo/package-specs.js.map +1 -0
- package/src/cargo/paths-crates.d.ts +27 -0
- package/src/cargo/paths-crates.js +69 -0
- package/src/cargo/paths-crates.js.map +1 -0
- package/src/cargo/print-artifact-folders.d.ts +1 -0
- package/src/cargo/print-artifact-folders.js +58 -0
- package/src/cargo/print-artifact-folders.js.map +1 -0
- package/src/cargo/redirections.d.ts +90 -0
- package/src/cargo/redirections.js +200 -0
- package/src/cargo/redirections.js.map +1 -0
- package/src/cargo/run-cargo.d.ts +31 -0
- package/src/cargo/run-cargo.js +75 -0
- package/src/cargo/run-cargo.js.map +1 -0
- package/src/cargo/target-triples.d.ts +98 -0
- package/src/cargo/target-triples.js +265 -0
- package/src/cargo/target-triples.js.map +1 -0
- package/src/cargo/version-req.d.ts +12 -0
- package/src/cargo/version-req.js +122 -0
- package/src/cargo/version-req.js.map +1 -0
- package/src/cargo/warnings-setting.d.ts +24 -0
- package/src/cargo/warnings-setting.js +81 -0
- package/src/cargo/warnings-setting.js.map +1 -0
- package/src/compatibility/cargo-version.d.ts +43 -0
- package/src/compatibility/cargo-version.js +83 -0
- package/src/compatibility/cargo-version.js.map +1 -0
- package/src/compatibility/nx-bridge.d.ts +312 -0
- package/src/compatibility/nx-bridge.js +407 -0
- package/src/compatibility/nx-bridge.js.map +1 -0
- package/src/compatibility/nx-version.d.ts +104 -0
- package/src/compatibility/nx-version.js +272 -0
- package/src/compatibility/nx-version.js.map +1 -0
- package/src/executors/affected-inputs.d.ts +29 -0
- package/src/executors/affected-inputs.js +259 -0
- package/src/executors/affected-inputs.js.map +1 -0
- package/src/executors/affected-run.d.ts +54 -0
- package/src/executors/affected-run.js +394 -0
- package/src/executors/affected-run.js.map +1 -0
- package/src/executors/affected.d.ts +239 -0
- package/src/executors/affected.js +589 -0
- package/src/executors/affected.js.map +1 -0
- package/src/executors/baseline-context.d.ts +85 -0
- package/src/executors/baseline-context.js +227 -0
- package/src/executors/baseline-context.js.map +1 -0
- package/src/executors/baseline.d.ts +123 -0
- package/src/executors/baseline.js +356 -0
- package/src/executors/baseline.js.map +1 -0
- package/src/executors/batch.d.ts +75 -0
- package/src/executors/batch.js +434 -0
- package/src/executors/batch.js.map +1 -0
- package/src/executors/build-records.d.ts +110 -0
- package/src/executors/build-records.js +267 -0
- package/src/executors/build-records.js.map +1 -0
- package/src/executors/cargo/executor.d.ts +28 -0
- package/src/executors/cargo/executor.js +58 -0
- package/src/executors/cargo/executor.js.map +1 -0
- package/src/executors/cargo/schema.json +58 -0
- package/src/executors/cargo-invocation.d.ts +81 -0
- package/src/executors/cargo-invocation.js +109 -0
- package/src/executors/cargo-invocation.js.map +1 -0
- package/src/executors/cargo-output.d.ts +218 -0
- package/src/executors/cargo-output.js +660 -0
- package/src/executors/cargo-output.js.map +1 -0
- package/src/executors/command.d.ts +331 -0
- package/src/executors/command.js +547 -0
- package/src/executors/command.js.map +1 -0
- package/src/executors/coverage-baseline.d.ts +23 -0
- package/src/executors/coverage-baseline.js +284 -0
- package/src/executors/coverage-baseline.js.map +1 -0
- package/src/executors/declared-options.d.ts +21 -0
- package/src/executors/declared-options.js +58 -0
- package/src/executors/declared-options.js.map +1 -0
- package/src/executors/denied-warnings.d.ts +99 -0
- package/src/executors/denied-warnings.js +188 -0
- package/src/executors/denied-warnings.js.map +1 -0
- package/src/executors/digests.d.ts +94 -0
- package/src/executors/digests.js +190 -0
- package/src/executors/digests.js.map +1 -0
- package/src/executors/dotenv-check.d.ts +79 -0
- package/src/executors/dotenv-check.js +553 -0
- package/src/executors/dotenv-check.js.map +1 -0
- package/src/executors/group-invocations.d.ts +80 -0
- package/src/executors/group-invocations.js +253 -0
- package/src/executors/group-invocations.js.map +1 -0
- package/src/executors/group-run.d.ts +114 -0
- package/src/executors/group-run.js +601 -0
- package/src/executors/group-run.js.map +1 -0
- package/src/executors/groups.d.ts +118 -0
- package/src/executors/groups.js +304 -0
- package/src/executors/groups.js.map +1 -0
- package/src/executors/input-check.d.ts +52 -0
- package/src/executors/input-check.js +271 -0
- package/src/executors/input-check.js.map +1 -0
- package/src/executors/kept-files.d.ts +98 -0
- package/src/executors/kept-files.js +341 -0
- package/src/executors/kept-files.js.map +1 -0
- package/src/executors/lockfile/executor.d.ts +16 -0
- package/src/executors/lockfile/executor.js +37 -0
- package/src/executors/lockfile/executor.js.map +1 -0
- package/src/executors/lockfile/schema.json +50 -0
- package/src/executors/napi-build.d.ts +73 -0
- package/src/executors/napi-build.js +420 -0
- package/src/executors/napi-build.js.map +1 -0
- package/src/executors/nextest.d.ts +189 -0
- package/src/executors/nextest.js +504 -0
- package/src/executors/nextest.js.map +1 -0
- package/src/executors/nx-command.d.ts +95 -0
- package/src/executors/nx-command.js +205 -0
- package/src/executors/nx-command.js.map +1 -0
- package/src/executors/nx-task-files.d.ts +82 -0
- package/src/executors/nx-task-files.js +156 -0
- package/src/executors/nx-task-files.js.map +1 -0
- package/src/executors/print-test-mode.d.ts +1 -0
- package/src/executors/print-test-mode.js +25 -0
- package/src/executors/print-test-mode.js.map +1 -0
- package/src/executors/release-publish/executor.d.ts +24 -0
- package/src/executors/release-publish/executor.js +165 -0
- package/src/executors/release-publish/executor.js.map +1 -0
- package/src/executors/release-publish/schema.json +30 -0
- package/src/executors/run/executor.d.ts +12 -0
- package/src/executors/run/executor.js +27 -0
- package/src/executors/run/executor.js.map +1 -0
- package/src/executors/run/schema.json +45 -0
- package/src/executors/runner-script.d.ts +12 -0
- package/src/executors/runner-script.js +22 -0
- package/src/executors/runner-script.js.map +1 -0
- package/src/executors/runtime-input-check.d.ts +24 -0
- package/src/executors/runtime-input-check.js +87 -0
- package/src/executors/runtime-input-check.js.map +1 -0
- package/src/executors/shared-artifacts.d.ts +44 -0
- package/src/executors/shared-artifacts.js +132 -0
- package/src/executors/shared-artifacts.js.map +1 -0
- package/src/executors/split-words.d.ts +24 -0
- package/src/executors/split-words.js +111 -0
- package/src/executors/split-words.js.map +1 -0
- package/src/executors/stage.d.ts +163 -0
- package/src/executors/stage.js +526 -0
- package/src/executors/stage.js.map +1 -0
- package/src/executors/staged-run.d.ts +24 -0
- package/src/executors/staged-run.js +110 -0
- package/src/executors/staged-run.js.map +1 -0
- package/src/executors/task-env.d.ts +271 -0
- package/src/executors/task-env.js +494 -0
- package/src/executors/task-env.js.map +1 -0
- package/src/executors/task-execution.d.ts +61 -0
- package/src/executors/task-execution.js +122 -0
- package/src/executors/task-execution.js.map +1 -0
- package/src/executors/task-guards.d.ts +112 -0
- package/src/executors/task-guards.js +435 -0
- package/src/executors/task-guards.js.map +1 -0
- package/src/executors/task-options.d.ts +114 -0
- package/src/executors/task-options.js +258 -0
- package/src/executors/task-options.js.map +1 -0
- package/src/executors/task.d.ts +166 -0
- package/src/executors/task.js +527 -0
- package/src/executors/task.js.map +1 -0
- package/src/executors/test-mode.d.ts +185 -0
- package/src/executors/test-mode.js +397 -0
- package/src/executors/test-mode.js.map +1 -0
- package/src/executors/test-runner.d.ts +44 -0
- package/src/executors/test-runner.js +159 -0
- package/src/executors/test-runner.js.map +1 -0
- package/src/executors/test-steps.d.ts +121 -0
- package/src/executors/test-steps.js +566 -0
- package/src/executors/test-steps.js.map +1 -0
- package/src/executors/wasm-build.d.ts +56 -0
- package/src/executors/wasm-build.js +216 -0
- package/src/executors/wasm-build.js.map +1 -0
- package/src/generators/crate/binary.schema.json +28 -0
- package/src/generators/crate/crate.d.ts +24 -0
- package/src/generators/crate/crate.js +108 -0
- package/src/generators/crate/crate.js.map +1 -0
- package/src/generators/crate/enclosing-workspace.d.ts +25 -0
- package/src/generators/crate/enclosing-workspace.js +58 -0
- package/src/generators/crate/enclosing-workspace.js.map +1 -0
- package/src/generators/crate/library.schema.json +28 -0
- package/src/generators/init/graph-check.d.ts +81 -0
- package/src/generators/init/graph-check.js +299 -0
- package/src/generators/init/graph-check.js.map +1 -0
- package/src/generators/init/init.d.ts +23 -0
- package/src/generators/init/init.js +113 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/report.d.ts +19 -0
- package/src/generators/init/report.js +93 -0
- package/src/generators/init/report.js.map +1 -0
- package/src/generators/init/schema.json +9 -0
- package/src/graph/artifact-kinds.d.ts +29 -0
- package/src/graph/artifact-kinds.js +50 -0
- package/src/graph/artifact-kinds.js.map +1 -0
- package/src/graph/artifact-names.d.ts +97 -0
- package/src/graph/artifact-names.js +276 -0
- package/src/graph/artifact-names.js.map +1 -0
- package/src/graph/build-records.d.ts +74 -0
- package/src/graph/build-records.js +104 -0
- package/src/graph/build-records.js.map +1 -0
- package/src/graph/caching.d.ts +148 -0
- package/src/graph/caching.js +681 -0
- package/src/graph/caching.js.map +1 -0
- package/src/graph/clippy-input.d.ts +53 -0
- package/src/graph/clippy-input.js +107 -0
- package/src/graph/clippy-input.js.map +1 -0
- package/src/graph/collisions.d.ts +113 -0
- package/src/graph/collisions.js +156 -0
- package/src/graph/collisions.js.map +1 -0
- package/src/graph/computation-reports.d.ts +89 -0
- package/src/graph/computation-reports.js +216 -0
- package/src/graph/computation-reports.js.map +1 -0
- package/src/graph/declared-files.d.ts +190 -0
- package/src/graph/declared-files.js +600 -0
- package/src/graph/declared-files.js.map +1 -0
- package/src/graph/discovery.d.ts +190 -0
- package/src/graph/discovery.js +661 -0
- package/src/graph/discovery.js.map +1 -0
- package/src/graph/edges.d.ts +25 -0
- package/src/graph/edges.js +94 -0
- package/src/graph/edges.js.map +1 -0
- package/src/graph/entries.d.ts +83 -0
- package/src/graph/entries.js +259 -0
- package/src/graph/entries.js.map +1 -0
- package/src/graph/inputs.d.ts +422 -0
- package/src/graph/inputs.js +756 -0
- package/src/graph/inputs.js.map +1 -0
- package/src/graph/lockfile-task.d.ts +74 -0
- package/src/graph/lockfile-task.js +105 -0
- package/src/graph/lockfile-task.js.map +1 -0
- package/src/graph/names.d.ts +41 -0
- package/src/graph/names.js +34 -0
- package/src/graph/names.js.map +1 -0
- package/src/graph/napi.d.ts +107 -0
- package/src/graph/napi.js +206 -0
- package/src/graph/napi.js.map +1 -0
- package/src/graph/nx-glob.d.ts +36 -0
- package/src/graph/nx-glob.js +152 -0
- package/src/graph/nx-glob.js.map +1 -0
- package/src/graph/nx-internals.d.ts +57 -0
- package/src/graph/nx-internals.js +128 -0
- package/src/graph/nx-internals.js.map +1 -0
- package/src/graph/options.d.ts +32 -0
- package/src/graph/options.js +80 -0
- package/src/graph/options.js.map +1 -0
- package/src/graph/outputs.d.ts +75 -0
- package/src/graph/outputs.js +140 -0
- package/src/graph/outputs.js.map +1 -0
- package/src/graph/path-dependencies.d.ts +122 -0
- package/src/graph/path-dependencies.js +459 -0
- package/src/graph/path-dependencies.js.map +1 -0
- package/src/graph/plugin-package.d.ts +36 -0
- package/src/graph/plugin-package.js +132 -0
- package/src/graph/plugin-package.js.map +1 -0
- package/src/graph/plugin-version.d.ts +20 -0
- package/src/graph/plugin-version.js +153 -0
- package/src/graph/plugin-version.js.map +1 -0
- package/src/graph/projects.d.ts +141 -0
- package/src/graph/projects.js +193 -0
- package/src/graph/projects.js.map +1 -0
- package/src/graph/reached-projects.d.ts +46 -0
- package/src/graph/reached-projects.js +102 -0
- package/src/graph/reached-projects.js.map +1 -0
- package/src/graph/real-path.d.ts +47 -0
- package/src/graph/real-path.js +113 -0
- package/src/graph/real-path.js.map +1 -0
- package/src/graph/redirected-uses.d.ts +98 -0
- package/src/graph/redirected-uses.js +434 -0
- package/src/graph/redirected-uses.js.map +1 -0
- package/src/graph/registration.d.ts +121 -0
- package/src/graph/registration.js +233 -0
- package/src/graph/registration.js.map +1 -0
- package/src/graph/rustfmt-config.d.ts +42 -0
- package/src/graph/rustfmt-config.js +173 -0
- package/src/graph/rustfmt-config.js.map +1 -0
- package/src/graph/script-input.d.ts +46 -0
- package/src/graph/script-input.js +65 -0
- package/src/graph/script-input.js.map +1 -0
- package/src/graph/settings.d.ts +178 -0
- package/src/graph/settings.js +479 -0
- package/src/graph/settings.js.map +1 -0
- package/src/graph/target-defaults-causes.d.ts +33 -0
- package/src/graph/target-defaults-causes.js +202 -0
- package/src/graph/target-defaults-causes.js.map +1 -0
- package/src/graph/target-defaults-layers.d.ts +186 -0
- package/src/graph/target-defaults-layers.js +420 -0
- package/src/graph/target-defaults-layers.js.map +1 -0
- package/src/graph/target-defaults-meaning.d.ts +95 -0
- package/src/graph/target-defaults-meaning.js +292 -0
- package/src/graph/target-defaults-meaning.js.map +1 -0
- package/src/graph/target-defaults-report.d.ts +77 -0
- package/src/graph/target-defaults-report.js +242 -0
- package/src/graph/target-defaults-report.js.map +1 -0
- package/src/graph/target-defaults.d.ts +79 -0
- package/src/graph/target-defaults.js +425 -0
- package/src/graph/target-defaults.js.map +1 -0
- package/src/graph/target-fields.d.ts +16 -0
- package/src/graph/target-fields.js +134 -0
- package/src/graph/target-fields.js.map +1 -0
- package/src/graph/target-tables.d.ts +45 -0
- package/src/graph/target-tables.js +299 -0
- package/src/graph/target-tables.js.map +1 -0
- package/src/graph/targets.d.ts +371 -0
- package/src/graph/targets.js +408 -0
- package/src/graph/targets.js.map +1 -0
- package/src/graph/unification.d.ts +141 -0
- package/src/graph/unification.js +459 -0
- package/src/graph/unification.js.map +1 -0
- package/src/graph/unignored-directories.d.ts +25 -0
- package/src/graph/unignored-directories.js +89 -0
- package/src/graph/unignored-directories.js.map +1 -0
- package/src/graph/visibility.d.ts +17 -0
- package/src/graph/visibility.js +67 -0
- package/src/graph/visibility.js.map +1 -0
- package/src/graph/warnings.d.ts +38 -0
- package/src/graph/warnings.js +77 -0
- package/src/graph/warnings.js.map +1 -0
- package/src/graph/wasm.d.ts +56 -0
- package/src/graph/wasm.js +77 -0
- package/src/graph/wasm.js.map +1 -0
- package/src/index.d.ts +68 -0
- package/src/index.js +109 -0
- package/src/index.js.map +1 -0
- package/src/release/manifests.d.ts +95 -0
- package/src/release/manifests.js +164 -0
- package/src/release/manifests.js.map +1 -0
- package/src/release/places.d.ts +127 -0
- package/src/release/places.js +368 -0
- package/src/release/places.js.map +1 -0
- package/src/release/publish-cargo.d.ts +177 -0
- package/src/release/publish-cargo.js +351 -0
- package/src/release/publish-cargo.js.map +1 -0
- package/src/release/publish-crates.d.ts +124 -0
- package/src/release/publish-crates.js +242 -0
- package/src/release/publish-crates.js.map +1 -0
- package/src/release/publish-environments.d.ts +50 -0
- package/src/release/publish-environments.js +284 -0
- package/src/release/publish-environments.js.map +1 -0
- package/src/release/publish-messages.d.ts +66 -0
- package/src/release/publish-messages.js +273 -0
- package/src/release/publish-messages.js.map +1 -0
- package/src/release/publish-registry.d.ts +27 -0
- package/src/release/publish-registry.js +135 -0
- package/src/release/publish-registry.js.map +1 -0
- package/src/release/publish-settings.d.ts +26 -0
- package/src/release/publish-settings.js +56 -0
- package/src/release/publish-settings.js.map +1 -0
- package/src/release/publish.d.ts +59 -0
- package/src/release/publish.js +620 -0
- package/src/release/publish.js.map +1 -0
- package/src/release/repository.d.ts +73 -0
- package/src/release/repository.js +219 -0
- package/src/release/repository.js.map +1 -0
- package/src/release/requirements.d.ts +34 -0
- package/src/release/requirements.js +30 -0
- package/src/release/requirements.js.map +1 -0
- package/src/release/toml-edit.d.ts +67 -0
- package/src/release/toml-edit.js +453 -0
- package/src/release/toml-edit.js.map +1 -0
- package/src/release/version-actions.d.ts +133 -0
- package/src/release/version-actions.js +474 -0
- package/src/release/version-actions.js.map +1 -0
- package/src/release/version-checks.d.ts +21 -0
- package/src/release/version-checks.js +151 -0
- package/src/release/version-checks.js.map +1 -0
- package/src/release/version-lockfiles.d.ts +61 -0
- package/src/release/version-lockfiles.js +222 -0
- package/src/release/version-lockfiles.js.map +1 -0
- package/src/tools/napi-cli.d.ts +70 -0
- package/src/tools/napi-cli.js +63 -0
- package/src/tools/napi-cli.js.map +1 -0
- package/src/tools/optional-tools.d.ts +121 -0
- package/src/tools/optional-tools.js +303 -0
- package/src/tools/optional-tools.js.map +1 -0
- package/src/tools/print-napi-cli.d.ts +1 -0
- package/src/tools/print-napi-cli.js +24 -0
- package/src/tools/print-napi-cli.js.map +1 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkVersionedTogether = checkVersionedTogether;
|
|
4
|
+
exports.graphBumpLines = graphBumpLines;
|
|
5
|
+
exports.checkDependentsVersioned = checkDependentsVersioned;
|
|
6
|
+
exports.isOn = isOn;
|
|
7
|
+
exports.writesRequirement = writesRequirement;
|
|
8
|
+
exports.inheritingCrates = inheritingCrates;
|
|
9
|
+
exports.writable = writable;
|
|
10
|
+
exports.editedFile = editedFile;
|
|
11
|
+
exports.sentenceList = sentenceList;
|
|
12
|
+
const node_fs_1 = require("node:fs");
|
|
13
|
+
const real_path_1 = require("../graph/real-path");
|
|
14
|
+
const manifests_1 = require("./manifests");
|
|
15
|
+
const places_1 = require("./places");
|
|
16
|
+
const toml_edit_1 = require("./toml-edit");
|
|
17
|
+
// Fails where the run versions only some of the crates that share the inherited version.
|
|
18
|
+
function checkVersionedTogether(projects, crate, sharing) {
|
|
19
|
+
const left = sharing.filter((other) => other.project === undefined || !projects.has(other.project));
|
|
20
|
+
if (left.length > 0) {
|
|
21
|
+
const versioned = sharing.filter((other) => !left.includes(other));
|
|
22
|
+
throw new manifests_1.ReleaseError(`nx release version would version ${sentenceList(versioned.map((other) => other.name))} but not ${sentenceList(left.map((other) => other.name))}, although they inherit version.workspace = true from ${crate.workspace.rootManifest} and share one version. Nx adds a crate to a run as a dependent of a crate in another release group without the rest of its group: run the command for their whole release group as well, such as with --groups naming it, or without --projects and --groups.`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// The lines that name the edges of the project graph through which Nx
|
|
26
|
+
// bumps this project's fixed group: those into a project of another
|
|
27
|
+
// release group in which the run has written a new version.
|
|
28
|
+
function graphBumpLines(project, group, versioned, graph, repository, groupOf) {
|
|
29
|
+
var _a;
|
|
30
|
+
const bumpedGroups = new Set([...versioned].map(groupOf));
|
|
31
|
+
const edges = ((_a = graph.dependencies[project]) !== null && _a !== void 0 ? _a : []).filter((edge) => {
|
|
32
|
+
const target = groupOf(edge.target);
|
|
33
|
+
return target !== undefined && target !== group && bumpedGroups.has(target);
|
|
34
|
+
});
|
|
35
|
+
if (edges.length === 0) {
|
|
36
|
+
return [
|
|
37
|
+
`⚠️ Nx bumps the fixed release group "${group}" as a whole, because ${project} has an edge in the project graph to a project of a release group that it bumped before; nx-rust's guide lists this as a known limit of Nx release.`,
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
return [...new Set(edges.map((edge) => edge.target))].map((target) => `⚠️ Nx bumps the fixed release group "${group}" as a whole, because the project graph has an edge from ${project} to ${target}, whose release group "${groupOf(target)}" it bumped before. ${edgeInCargo(repository, project, target)} nx-rust's guide lists this as a known limit of Nx release.`);
|
|
41
|
+
}
|
|
42
|
+
// What the edge between two crates' projects is in Cargo, as a sentence.
|
|
43
|
+
function edgeInCargo(repository, source, target) {
|
|
44
|
+
const from = repository === null || repository === void 0 ? void 0 : repository.crateOfProject(source);
|
|
45
|
+
const to = repository === null || repository === void 0 ? void 0 : repository.crateOfProject(target);
|
|
46
|
+
if (from === undefined || to === undefined) {
|
|
47
|
+
return "";
|
|
48
|
+
}
|
|
49
|
+
const uses = from.dependencies.filter((dependency) => dependency.path !== undefined && (0, real_path_1.realPath)(dependency.path) === to.folder);
|
|
50
|
+
if (uses.length === 0) {
|
|
51
|
+
return `In Cargo, ${from.name} names ${to.name} in no dependency: nx-rust adds the edge for the cache key, as through a crate without a project or a [patch].`;
|
|
52
|
+
}
|
|
53
|
+
const kinds = [
|
|
54
|
+
...new Set(uses.map((dependency) => dependency.kind === "dev"
|
|
55
|
+
? "a dev-dependency"
|
|
56
|
+
: `a ${dependency.kind === "build" ? "build" : "normal"} dependency`)),
|
|
57
|
+
];
|
|
58
|
+
return `In Cargo, ${from.name} depends on ${to.name} through ${sentenceList(kinds)}.`;
|
|
59
|
+
}
|
|
60
|
+
// Stops the run where a crate of the release would get a rewritten
|
|
61
|
+
// requirement on a bumped crate without a new version (nxr-5a9w1y, part 2).
|
|
62
|
+
function checkDependentsVersioned(tree, repository, rewrites, versioned, groupOf) {
|
|
63
|
+
const lines = new Set();
|
|
64
|
+
for (const { requirement, crate, to } of rewrites) {
|
|
65
|
+
if (requirement.kind !== "normal" &&
|
|
66
|
+
requirement.kind !== "build" &&
|
|
67
|
+
requirement.kind !== "workspace") {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
// A [workspace.dependencies] entry is the requirement of each member
|
|
71
|
+
// that inherits it in a normal or build table.
|
|
72
|
+
const holders = requirement.kind === "workspace"
|
|
73
|
+
? requirement.workspace.crates.filter((member) => (0, places_1.memberEntries)(tree, repository, member).some((entry) => (entry.kind === "normal" || entry.kind === "build") &&
|
|
74
|
+
entry.entry.workspace === true &&
|
|
75
|
+
entry.key === requirement.key))
|
|
76
|
+
: requirement.holder === undefined
|
|
77
|
+
? []
|
|
78
|
+
: [requirement.holder];
|
|
79
|
+
for (const holder of holders) {
|
|
80
|
+
const group = groupOf(holder.project);
|
|
81
|
+
if (holder.project === undefined || group === undefined || versioned.has(holder.project)) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
lines.add(`- ${holder.name}, in the release group "${group}": its requirement on ${crate.name} in ${requirement.file} [${requirement.table}] becomes "${to}", but Nx gives ${holder.name} no new version`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (lines.size > 0) {
|
|
88
|
+
throw new manifests_1.ReleaseError([
|
|
89
|
+
"nx release version would rewrite requirements of crates in the release on crates that it bumps, without bumping those crates:",
|
|
90
|
+
...lines,
|
|
91
|
+
"Release each of them in the same run: give it a bump of its own, through a version plan or a conventional commit, or name a version on the command line, which applies to every crate of the run. Nx bumps no crate of an independent group for a dependency in a fixed group. No file has been changed.",
|
|
92
|
+
].join("\n"));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// The setting is on as `true`, and as a list, which names npm's dependency
|
|
96
|
+
// collections and so means nothing more specific for a crate, while it is
|
|
97
|
+
// not empty.
|
|
98
|
+
function isOn(setting) {
|
|
99
|
+
return Array.isArray(setting) ? setting.length > 0 : setting === true;
|
|
100
|
+
}
|
|
101
|
+
// Whether the manifest's entries for a dependency whose report gives the
|
|
102
|
+
// requirement `*` write a version: the entries of its kind and key that
|
|
103
|
+
// name its folder, in any target table, however the table's header spells
|
|
104
|
+
// the platform. Fails where the manifest has no such entry.
|
|
105
|
+
function writesRequirement(tree, repository, crate, dependency) {
|
|
106
|
+
var _a, _b;
|
|
107
|
+
const kind = dependency.kind === "build" ? "build" : "normal";
|
|
108
|
+
const key = (_a = dependency.rename) !== null && _a !== void 0 ? _a : dependency.name;
|
|
109
|
+
const folder = (0, real_path_1.realPath)((_b = dependency.path) !== null && _b !== void 0 ? _b : "");
|
|
110
|
+
const entries = (0, places_1.memberEntries)(tree, repository, crate).filter((entry) => entry.kind === kind && entry.key === key && entry.folder === folder);
|
|
111
|
+
if (entries.length === 0) {
|
|
112
|
+
throw new manifests_1.ReleaseError(`cargo reports that ${crate.name} depends on the crate in ${dependency.path} as ${key}, but nx release version finds no such entry in ${crate.manifest} to tell whether it writes a version requirement. Run nx reset and the command again; if this stays, report the manifest to nx-rust.`);
|
|
113
|
+
}
|
|
114
|
+
return entries.some((entry) => entry.requirement !== undefined);
|
|
115
|
+
}
|
|
116
|
+
// The members of the crate's workspace that inherit their version, the crate among them.
|
|
117
|
+
function inheritingCrates(tree, repository, crate) {
|
|
118
|
+
return crate.workspace.crates.filter((other) => other === crate ||
|
|
119
|
+
(0, manifests_1.crateVersion)((0, places_1.readDocument)(tree, repository, other.manifest)).kind === "inherited");
|
|
120
|
+
}
|
|
121
|
+
// Whether the file at `path` exists and the run may write it.
|
|
122
|
+
function writable(path) {
|
|
123
|
+
try {
|
|
124
|
+
(0, node_fs_1.accessSync)(path, node_fs_1.constants.W_OK);
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
catch (_a) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// The file with the edits made, read at its tree path (`treePath`).
|
|
132
|
+
function editedFile(tree, file, edits) {
|
|
133
|
+
const text = (0, places_1.readTreeText)(tree, file);
|
|
134
|
+
try {
|
|
135
|
+
return (0, toml_edit_1.replaceStrings)(text, edits);
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
if (!(error instanceof toml_edit_1.TomlEditError)) {
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
throw new manifests_1.ReleaseError(`nx release version could not change the version strings in ${file} without changing anything else of it: ${error.message}. No file has been changed; change the versions by hand, and report the file to nx-rust.`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// "a", "a and b", "a, b and c".
|
|
145
|
+
function sentenceList(items) {
|
|
146
|
+
var _a;
|
|
147
|
+
return items.length <= 1
|
|
148
|
+
? ((_a = items[0]) !== null && _a !== void 0 ? _a : "")
|
|
149
|
+
: `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=version-checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-checks.js","sourceRoot":"","sources":["../../../../nx-rust/src/release/version-checks.ts"],"names":[],"mappings":";;AAkBA,wDAcC;AAKD,wCAsBC;AAiCD,4DAkDC;AAKD,oBAEC;AAMD,8CAkBC;AAGD,4CAUC;AAGD,4BAOC;AAGD,gCAYC;AAGD,oCAIC;AAzND,qCAAgD;AAEhD,kDAA8C;AAC9C,2CAAyD;AACzD,qCAAuF;AAEvF,2CAA6E;AAU7E,yFAAyF;AACzF,SAAgB,sBAAsB,CACpC,QAA6B,EAC7B,KAAmB,EACnB,OAAgC;IAEhC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CACzB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAA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CAAC;AACH,CAAC;AAED,oEAAoE;AACpE,SAAgB,UAAU,CAAC,IAAU,EAAE,IAAY,EAAE,KAA4B;IAC/E,MAAM,IAAI,GAAG,IAAA,qBAAY,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC;QACH,OAAO,IAAA,0BAAc,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,CAAC,KAAK,YAAY,yBAAa,CAAC,EAAE,CAAC;YACtC,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,wBAAY,CACpB,8DAA8D,IAAI,0CAA0C,KAAK,CAAC,OAAO,0FAA0F,CACpN,CAAC;IACJ,CAAC;AACH,CAAC;AAED,gCAAgC;AAChC,SAAgB,YAAY,CAAC,KAAwB;;IACnD,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC;QACtB,CAAC,CAAC,CAAC,MAAA,KAAK,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC;QAClB,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Tree } from "@nx/devkit";
|
|
2
|
+
import { type ReleaseCrate, type ReleaseRepository, type ReleaseWorkspace } from "./repository";
|
|
3
|
+
/** A package that a lockfile locks. */
|
|
4
|
+
interface LockedPackage {
|
|
5
|
+
name?: unknown;
|
|
6
|
+
version?: unknown;
|
|
7
|
+
source?: unknown;
|
|
8
|
+
}
|
|
9
|
+
/** A lockfile as the run read it before it changed anything. */
|
|
10
|
+
export type LockfileState = {
|
|
11
|
+
kind: "absent";
|
|
12
|
+
} | {
|
|
13
|
+
kind: "unreadable";
|
|
14
|
+
reason: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "read";
|
|
17
|
+
packages: LockedPackage[];
|
|
18
|
+
};
|
|
19
|
+
/** The lockfile state that a version run records for `afterAllProjectsVersioned`. */
|
|
20
|
+
export interface LockfileRun {
|
|
21
|
+
/**
|
|
22
|
+
* The lockfiles that `afterAllProjectsVersioned` brings up to date, relative
|
|
23
|
+
* to the repository root, with their workspaces.
|
|
24
|
+
*/
|
|
25
|
+
lockfiles: Map<string, ReleaseWorkspace>;
|
|
26
|
+
/**
|
|
27
|
+
* The files that the run writes through Nx's tree, by their
|
|
28
|
+
* {@link treePath}: where they lie once symbolic links are followed.
|
|
29
|
+
*/
|
|
30
|
+
written: Set<string>;
|
|
31
|
+
/** The lockfiles that the run has read, by their absolute path, as they were before it. */
|
|
32
|
+
lockfileStates: Map<string, LockfileState>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Brings the `Cargo.lock` of each Cargo workspace that `run` changed up to
|
|
36
|
+
* date (`DES-RELEASE`, "Lockfile"), for `afterAllProjectsVersioned`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function updateVersionedLockfiles(run: LockfileRun | undefined, cwd: string, options: {
|
|
39
|
+
dryRun?: boolean;
|
|
40
|
+
}): {
|
|
41
|
+
changedFiles: string[];
|
|
42
|
+
deletedFiles: string[];
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The lockfiles, by their path relative to the repository root, that the new
|
|
46
|
+
* version of `crate` makes stale, with their workspaces: those of the
|
|
47
|
+
* workspaces whose root manifest, member manifests or Cargo configuration
|
|
48
|
+
* files are among `files`, and those that lock the crate as a path package
|
|
49
|
+
* at its old version, as the lockfile of a workspace does whose member
|
|
50
|
+
* depends on the crate by path without a version requirement, whose
|
|
51
|
+
* manifests stay as they are (`EVD-CARGO-LOCKFILE-UPDATE`). A workspace
|
|
52
|
+
* without a `Cargo.lock` has none. A lockfile that cannot be read or parsed
|
|
53
|
+
* is among `unreadable`, with the reason, because then nx-rust can tell
|
|
54
|
+
* neither whether it is stale nor bring it up to date; only a lockfile that
|
|
55
|
+
* does not exist is absent.
|
|
56
|
+
*/
|
|
57
|
+
export declare function staleLockfiles(tree: Tree, repository: ReleaseRepository, run: LockfileRun, crate: ReleaseCrate, files: readonly string[]): {
|
|
58
|
+
lockfiles: Map<string, ReleaseWorkspace>;
|
|
59
|
+
unreadable: string[];
|
|
60
|
+
};
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateVersionedLockfiles = updateVersionedLockfiles;
|
|
4
|
+
exports.staleLockfiles = staleLockfiles;
|
|
5
|
+
const node_child_process_1 = require("node:child_process");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const smol_toml_1 = require("smol-toml");
|
|
9
|
+
const cargo_invocation_1 = require("../executors/cargo-invocation");
|
|
10
|
+
const manifests_1 = require("./manifests");
|
|
11
|
+
const places_1 = require("./places");
|
|
12
|
+
const repository_1 = require("./repository");
|
|
13
|
+
const version_checks_1 = require("./version-checks");
|
|
14
|
+
/**
|
|
15
|
+
* Brings the `Cargo.lock` of each Cargo workspace that `run` changed up to
|
|
16
|
+
* date (`DES-RELEASE`, "Lockfile"), for `afterAllProjectsVersioned`.
|
|
17
|
+
*/
|
|
18
|
+
function updateVersionedLockfiles(run, cwd, options) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (options.dryRun || run === undefined || run.lockfiles.size === 0) {
|
|
21
|
+
return { changedFiles: [], deletedFiles: [] };
|
|
22
|
+
}
|
|
23
|
+
const changed = [];
|
|
24
|
+
const failures = [];
|
|
25
|
+
for (const [lockfile, workspace] of [...run.lockfiles].sort(([a], [b]) => a.localeCompare(b))) {
|
|
26
|
+
const file = (0, node_path_1.join)(cwd, lockfile);
|
|
27
|
+
const before = readLockfile(file);
|
|
28
|
+
if (before.kind === "absent") {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (before.kind === "unreadable") {
|
|
32
|
+
failures.push({
|
|
33
|
+
workspace,
|
|
34
|
+
reason: `nx release version cannot read ${lockfile}: ${before.reason}`,
|
|
35
|
+
output: "",
|
|
36
|
+
cargoFailed: false,
|
|
37
|
+
});
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
const update = (0, node_child_process_1.spawnSync)("cargo", ["update", "--workspace"], {
|
|
41
|
+
cwd: (0, node_path_1.dirname)(file),
|
|
42
|
+
env: process.env,
|
|
43
|
+
encoding: "utf8",
|
|
44
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
45
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
46
|
+
});
|
|
47
|
+
if (update.error !== undefined || update.status !== 0) {
|
|
48
|
+
const code = (_a = update.error) === null || _a === void 0 ? void 0 : _a.code;
|
|
49
|
+
failures.push({
|
|
50
|
+
workspace,
|
|
51
|
+
reason: code === "ENOENT"
|
|
52
|
+
? "cargo was not found on PATH"
|
|
53
|
+
: update.error !== undefined
|
|
54
|
+
? update.error.message
|
|
55
|
+
: update.signal
|
|
56
|
+
? `cargo was stopped by ${update.signal}`
|
|
57
|
+
: `cargo exited with status ${update.status}`,
|
|
58
|
+
output: ((_b = update.stderr) !== null && _b !== void 0 ? _b : "").trim(),
|
|
59
|
+
cargoFailed: true,
|
|
60
|
+
});
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const after = readLockfile(file);
|
|
64
|
+
if (after.kind !== "read") {
|
|
65
|
+
failures.push({
|
|
66
|
+
workspace,
|
|
67
|
+
reason: `nx release version cannot read ${lockfile} after cargo update --workspace: ${after.kind === "absent" ? "it does not exist" : after.reason}`,
|
|
68
|
+
output: "",
|
|
69
|
+
cargoFailed: false,
|
|
70
|
+
});
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (after.text !== before.text) {
|
|
74
|
+
const path = (0, places_1.treePath)(cwd, lockfile);
|
|
75
|
+
changed.push(path);
|
|
76
|
+
console.log(path === lockfile
|
|
77
|
+
? `Updated ${lockfile} with cargo update --workspace`
|
|
78
|
+
: `Updated ${path}, to which ${lockfile} leads, with cargo update --workspace`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const staged = changed.filter((path) => !gitIgnores(cwd, path));
|
|
82
|
+
if (failures.length > 0) {
|
|
83
|
+
throw new manifests_1.ReleaseError(recoveryMessage(cwd, run, failures, changed, staged));
|
|
84
|
+
}
|
|
85
|
+
return { changedFiles: staged, deletedFiles: [] };
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The message for a lockfile step that failed: each failure, and the
|
|
89
|
+
* commands, quoted for a POSIX shell, that take back what Nx and cargo
|
|
90
|
+
* wrote or bring the lockfiles up to date by hand.
|
|
91
|
+
*/
|
|
92
|
+
function recoveryMessage(cwd, run, failures, changed, staged) {
|
|
93
|
+
const one = failures.length === 1;
|
|
94
|
+
const workspaces = `${one ? "the Cargo workspace" : "the Cargo workspaces"} ${(0, version_checks_1.sentenceList)(failures.map(({ workspace }) => workspace.rootManifest))}`;
|
|
95
|
+
const written = [...new Set([...run.written, ...staged])].sort();
|
|
96
|
+
const untracked = untrackedFiles(cwd, written);
|
|
97
|
+
const restorable = written.filter((file) => !untracked.includes(file));
|
|
98
|
+
const folders = failures.map(({ workspace }) => node_path_1.posix.dirname(workspace.rootManifest));
|
|
99
|
+
const byHand = untracked.length === 0
|
|
100
|
+
? ""
|
|
101
|
+
: `take back ${(0, version_checks_1.sentenceList)(untracked)}, which git does not track, by hand`;
|
|
102
|
+
return [
|
|
103
|
+
failures.every(({ cargoFailed }) => cargoFailed)
|
|
104
|
+
? `cargo update --workspace failed in ${workspaces}, so nx release version cannot bring ${one ? "its" : "their"} Cargo.lock up to date:`
|
|
105
|
+
: `nx release version cannot bring the Cargo.lock of ${workspaces} up to date:`,
|
|
106
|
+
...failures.flatMap(({ workspace, reason, output }) => [
|
|
107
|
+
`- ${workspace.rootManifest}: ${reason}`,
|
|
108
|
+
...(output === "" ? [] : output.split("\n").map((line) => ` ${line}`)),
|
|
109
|
+
]),
|
|
110
|
+
`Nx has written the new versions${changed.length > 0 ? ` and cargo has updated ${(0, version_checks_1.sentenceList)(changed)}` : ""}, and made no commit or tag.`,
|
|
111
|
+
...(restorable.length === 0
|
|
112
|
+
? [`To go back, ${byHand}, and run nx release version again once cargo works.`]
|
|
113
|
+
: [
|
|
114
|
+
`To go back, run this in the root of the Nx workspace,${byHand === "" ? "" : ` ${byHand},`} and run nx release version again once cargo works:`,
|
|
115
|
+
// git reads a path in `*`, `?`, `[` or `\` as a pattern otherwise.
|
|
116
|
+
` git ${restorable.some((file) => /[*?[\\]/.test(file)) ? "--literal-pathspecs " : ""}checkout -- ${restorable.map(cargo_invocation_1.shellWord).join(" ")}`,
|
|
117
|
+
]),
|
|
118
|
+
`To go on instead, correct what cargo reports, run ${folders.length === 1 ? "this" : "these"} in the root of the Nx workspace, and commit and tag the release yourself:`,
|
|
119
|
+
// cd would read a folder that starts with `-` as an option.
|
|
120
|
+
...folders.map((folder) => ` (cd ${(0, cargo_invocation_1.shellWord)(folder.startsWith("-") ? `./${folder}` : folder)} && cargo update --workspace)`),
|
|
121
|
+
].join("\n");
|
|
122
|
+
}
|
|
123
|
+
/** The lockfile of a workspace, relative to the repository root with `/`. */
|
|
124
|
+
function lockfileOf(workspace) {
|
|
125
|
+
return node_path_1.posix.join(node_path_1.posix.dirname(workspace.rootManifest), "Cargo.lock");
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The lockfiles, by their path relative to the repository root, that the new
|
|
129
|
+
* version of `crate` makes stale, with their workspaces: those of the
|
|
130
|
+
* workspaces whose root manifest, member manifests or Cargo configuration
|
|
131
|
+
* files are among `files`, and those that lock the crate as a path package
|
|
132
|
+
* at its old version, as the lockfile of a workspace does whose member
|
|
133
|
+
* depends on the crate by path without a version requirement, whose
|
|
134
|
+
* manifests stay as they are (`EVD-CARGO-LOCKFILE-UPDATE`). A workspace
|
|
135
|
+
* without a `Cargo.lock` has none. A lockfile that cannot be read or parsed
|
|
136
|
+
* is among `unreadable`, with the reason, because then nx-rust can tell
|
|
137
|
+
* neither whether it is stale nor bring it up to date; only a lockfile that
|
|
138
|
+
* does not exist is absent.
|
|
139
|
+
*/
|
|
140
|
+
function staleLockfiles(tree, repository, run, crate, files) {
|
|
141
|
+
const lockfiles = new Map();
|
|
142
|
+
const unreadable = [];
|
|
143
|
+
for (const workspace of repository.workspaces) {
|
|
144
|
+
const lockfile = lockfileOf(workspace);
|
|
145
|
+
const file = (0, node_path_1.join)(tree.root, lockfile);
|
|
146
|
+
let state = run.lockfileStates.get(file);
|
|
147
|
+
if (state === undefined) {
|
|
148
|
+
state = lockfileState(file);
|
|
149
|
+
run.lockfileStates.set(file, state);
|
|
150
|
+
}
|
|
151
|
+
if (state.kind === "unreadable") {
|
|
152
|
+
unreadable.push(`- ${lockfile}: ${state.reason}`);
|
|
153
|
+
}
|
|
154
|
+
else if (state.kind === "read" &&
|
|
155
|
+
(changesWorkspace(repository, workspace, files) ||
|
|
156
|
+
// A lockfile names no path, and another path crate of that name and
|
|
157
|
+
// version only costs an update that changes nothing.
|
|
158
|
+
state.packages.some((pkg) => pkg.name === crate.name && pkg.version === crate.version && pkg.source === undefined))) {
|
|
159
|
+
lockfiles.set(lockfile, workspace);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return { lockfiles, unreadable };
|
|
163
|
+
}
|
|
164
|
+
// Whether `files` holds the workspace's root manifest, a member's manifest
|
|
165
|
+
// or one of its Cargo configuration files.
|
|
166
|
+
function changesWorkspace(repository, workspace, files) {
|
|
167
|
+
return files.some((file) => file === workspace.rootManifest ||
|
|
168
|
+
workspace.crates.some((member) => member.manifest === file) ||
|
|
169
|
+
workspace.configFiles.some((configFile) => (0, repository_1.repositoryPath)(repository.root, configFile) === file));
|
|
170
|
+
}
|
|
171
|
+
// The packages that the lockfile at `file` locks.
|
|
172
|
+
function lockfileState(file) {
|
|
173
|
+
const read = readLockfile(file);
|
|
174
|
+
if (read.kind !== "read") {
|
|
175
|
+
return read;
|
|
176
|
+
}
|
|
177
|
+
try {
|
|
178
|
+
const lock = (0, smol_toml_1.parse)(read.text);
|
|
179
|
+
return {
|
|
180
|
+
kind: "read",
|
|
181
|
+
packages: Array.isArray(lock.package) ? lock.package : [],
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
return { kind: "unreadable", reason: `no valid TOML: ${(0, places_1.errorMessage)(error).split("\n")[0]}` };
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// The text of the lockfile at `file`; absent only where it does not exist.
|
|
189
|
+
function readLockfile(file) {
|
|
190
|
+
try {
|
|
191
|
+
return { kind: "read", text: (0, node_fs_1.readFileSync)(file, "utf8") };
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
return (0, places_1.isAbsence)(error)
|
|
195
|
+
? { kind: "absent" }
|
|
196
|
+
: { kind: "unreadable", reason: (0, places_1.errorMessage)(error) };
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// Whether git ignores a path of the repository; outside a git repository nothing is.
|
|
200
|
+
function gitIgnores(cwd, path) {
|
|
201
|
+
return ((0, node_child_process_1.spawnSync)("git", ["check-ignore", "--quiet", "--", path], { cwd, stdio: "ignore" }).status === 0);
|
|
202
|
+
}
|
|
203
|
+
// The files among `files` that git does not track, which `git checkout`
|
|
204
|
+
// cannot take back and refuses to take back anything beside; none where git
|
|
205
|
+
// cannot tell, as outside a git repository.
|
|
206
|
+
function untrackedFiles(cwd, files) {
|
|
207
|
+
if (files.length === 0) {
|
|
208
|
+
return [];
|
|
209
|
+
}
|
|
210
|
+
const listed = (0, node_child_process_1.spawnSync)("git", ["--literal-pathspecs", "ls-files", "-z", "--", ...files], {
|
|
211
|
+
cwd,
|
|
212
|
+
encoding: "utf8",
|
|
213
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
214
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
215
|
+
});
|
|
216
|
+
if (listed.status !== 0) {
|
|
217
|
+
return [];
|
|
218
|
+
}
|
|
219
|
+
const tracked = new Set(listed.stdout.split("\0"));
|
|
220
|
+
return files.filter((file) => !tracked.has(file));
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=version-lockfiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-lockfiles.js","sourceRoot":"","sources":["../../../../nx-rust/src/release/version-lockfiles.ts"],"names":[],"mappings":";;AAiDA,4DA+EC;AAwED,wCAiCC;AAxOD,2DAA+C;AAC/C,qCAAuC;AACvC,yCAAiD;AACjD,yCAAkC;AAClC,oEAA0D;AAC1D,2CAA2C;AAC3C,qCAA6D;AAC7D,6CAKsB;AACtB,qDAAgD;AA+BhD;;;GAGG;AACH,SAAgB,wBAAwB,CACtC,GAA4B,EAC5B,GAAW,EACX,OAA6B;;IAE7B,IAAI,OAAO,CAAC,MAAM,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACpE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAChD,CAAC;IACD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAKR,EAAE,CAAC;IACT,KAAK,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9F,MAAM,IAAI,GAAG,IAAA,gBAAI,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACjC,MAAM,MAA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AAC;IACD,MAAM,MAAM,GAAG,IAAA,8BAAS,EAAC,KAAK,EAAE,CAAC,qBAAqB,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,EAAE;QACzF,GAAG;QACH,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;QAC3B,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;KACpC,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** The napi CLI that a crate's `napi-build` uses. */
|
|
2
|
+
export interface InstalledNapiCli {
|
|
3
|
+
/** The absolute path of the package's `package.json`. */
|
|
4
|
+
manifest: string;
|
|
5
|
+
/** The package's version, such as `3.10.12`. */
|
|
6
|
+
version: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The package `@napi-rs/cli` as Node resolves it from `folder`, the crate's
|
|
10
|
+
* folder, through the `node_modules` folders from there up to the file
|
|
11
|
+
* system's root, as the workspace's package manager installs it for the
|
|
12
|
+
* crate's own `package.json` or for the repository; `undefined` where
|
|
13
|
+
* none is installed or its `package.json` names no version.
|
|
14
|
+
*/
|
|
15
|
+
export declare function installedNapiCli(folder: string): InstalledNapiCli | undefined;
|
|
16
|
+
/** The CLI's exported functions that `napi-build` calls (`DES-NAPI`, `EVD-NAPI-POSTPROCESS`). */
|
|
17
|
+
export interface NapiCliFunctions {
|
|
18
|
+
readNapiConfig(path: string, configPath?: string): Promise<{
|
|
19
|
+
binaryName: string;
|
|
20
|
+
packageName: string;
|
|
21
|
+
dtsHeader?: string;
|
|
22
|
+
dtsHeaderFile?: string;
|
|
23
|
+
constEnum?: boolean;
|
|
24
|
+
runtimeStringEnum?: boolean;
|
|
25
|
+
targets: {
|
|
26
|
+
platform: string;
|
|
27
|
+
platformArchABI: string;
|
|
28
|
+
triple: string;
|
|
29
|
+
}[];
|
|
30
|
+
packageJson: {
|
|
31
|
+
version: string;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
parseTriple(triple: string): {
|
|
35
|
+
platformArchABI: string;
|
|
36
|
+
platform: string;
|
|
37
|
+
};
|
|
38
|
+
generateTypeDef(options: {
|
|
39
|
+
typeDefDir: string;
|
|
40
|
+
cwd: string;
|
|
41
|
+
configDtsHeader?: string;
|
|
42
|
+
configDtsHeaderFile?: string;
|
|
43
|
+
constEnum?: boolean;
|
|
44
|
+
runtimeStringEnum?: boolean;
|
|
45
|
+
declareBindingTarget?: (exports: readonly string[]) => boolean;
|
|
46
|
+
}): Promise<{
|
|
47
|
+
exports: string[];
|
|
48
|
+
dts: string;
|
|
49
|
+
}>;
|
|
50
|
+
writeJsBinding(options: {
|
|
51
|
+
platform: boolean;
|
|
52
|
+
idents: string[];
|
|
53
|
+
binaryName: string;
|
|
54
|
+
packageName: string;
|
|
55
|
+
version: string;
|
|
56
|
+
outputDir: string;
|
|
57
|
+
wasiFlavors?: string[];
|
|
58
|
+
}): Promise<unknown>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Loads the CLI's CommonJS entry point, which every release from 3.4.0 has,
|
|
62
|
+
* and returns its functions, or throws where one is missing.
|
|
63
|
+
*/
|
|
64
|
+
export declare function loadNapiCli(cli: InstalledNapiCli): NapiCliFunctions;
|
|
65
|
+
/**
|
|
66
|
+
* Whether `napi-build` supports a version of `@napi-rs/cli`: major 3, from
|
|
67
|
+
* 3.4.0, the first release that exports every function it calls
|
|
68
|
+
* (`ADR-NAPI-RS-3`).
|
|
69
|
+
*/
|
|
70
|
+
export declare function supportedNapiCli(version: string): boolean;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.installedNapiCli = installedNapiCli;
|
|
4
|
+
exports.loadNapiCli = loadNapiCli;
|
|
5
|
+
exports.supportedNapiCli = supportedNapiCli;
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_module_1 = require("node:module");
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
/**
|
|
10
|
+
* The package `@napi-rs/cli` as Node resolves it from `folder`, the crate's
|
|
11
|
+
* folder, through the `node_modules` folders from there up to the file
|
|
12
|
+
* system's root, as the workspace's package manager installs it for the
|
|
13
|
+
* crate's own `package.json` or for the repository; `undefined` where
|
|
14
|
+
* none is installed or its `package.json` names no version.
|
|
15
|
+
*/
|
|
16
|
+
function installedNapiCli(folder) {
|
|
17
|
+
let manifest;
|
|
18
|
+
try {
|
|
19
|
+
manifest = (0, node_module_1.createRequire)((0, node_path_1.join)(folder, "package.json")).resolve("@napi-rs/cli/package.json");
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
const version = JSON.parse((0, node_fs_1.readFileSync)(manifest, "utf8")).version;
|
|
26
|
+
return typeof version === "string" && version !== "" ? { manifest, version } : undefined;
|
|
27
|
+
}
|
|
28
|
+
catch (_b) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Loads the CLI's CommonJS entry point, which every release from 3.4.0 has,
|
|
34
|
+
* and returns its functions, or throws where one is missing.
|
|
35
|
+
*/
|
|
36
|
+
function loadNapiCli(cli) {
|
|
37
|
+
const loaded = (0, node_module_1.createRequire)(cli.manifest)((0, node_path_1.dirname)(cli.manifest));
|
|
38
|
+
for (const name of [
|
|
39
|
+
"readNapiConfig",
|
|
40
|
+
"parseTriple",
|
|
41
|
+
"generateTypeDef",
|
|
42
|
+
"writeJsBinding",
|
|
43
|
+
]) {
|
|
44
|
+
if (typeof loaded[name] !== "function") {
|
|
45
|
+
throw new Error(`@napi-rs/cli ${cli.version} exports no function ${name}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return loaded;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Whether `napi-build` supports a version of `@napi-rs/cli`: major 3, from
|
|
52
|
+
* 3.4.0, the first release that exports every function it calls
|
|
53
|
+
* (`ADR-NAPI-RS-3`).
|
|
54
|
+
*/
|
|
55
|
+
function supportedNapiCli(version) {
|
|
56
|
+
const match = /^(\d+)\.(\d+)\.(\d+)/.exec(version);
|
|
57
|
+
if (match === null) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
const [major, minor] = [Number(match[1]), Number(match[2])];
|
|
61
|
+
return major === 3 && minor >= 4;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=napi-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"napi-cli.js","sourceRoot":"","sources":["../../../../nx-rust/src/tools/napi-cli.ts"],"names":[],"mappings":";;AAmBA,4CAaC;AA0CD,kCAaC;AAOD,4CAOC;AArGD,qCAAuC;AACvC,6CAA4C;AAC5C,yCAA0C;AAU1C;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,MAAc;IAC7C,IAAI,QAAgB,CAAC;IACrB,IAAI,CAAC;QACH,QAAQ,GAAG,IAAA,2BAAa,EAAC,IAAA,gBAAI,EAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC9F,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC;QACH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