@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,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether one segment of a glob matches the name of a folder, as a folder
|
|
3
|
+
* that more of the glob follows. `true` where it cannot tell, which can only
|
|
4
|
+
* add files to a key or keep an error.
|
|
5
|
+
*/
|
|
6
|
+
export type SegmentMatcher = (segment: string, name: string) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Nx's own glob matching for one segment of a fileset, as the hasher and
|
|
9
|
+
* `nx affected` apply it (`EVD-NX-24-FILESET-SCOPE`): `matchGlobPaths` of
|
|
10
|
+
* Nx's native module runs the engine that builds the globs of filesets
|
|
11
|
+
* (`build_glob_set` in Nx's `native/glob.rs`), with its conversion of
|
|
12
|
+
* extended groups such as `@(a|b)`, `!(a)` and `*(a)`, of classes and of
|
|
13
|
+
* escapes. The segment is matched followed by one more segment, so that a
|
|
14
|
+
* group gets the reading that Nx gives a segment that is not the last.
|
|
15
|
+
*
|
|
16
|
+
* Where the installed Nx lacks the function, the plugin's own reading
|
|
17
|
+
* applies ({@link globSegmentMatches}).
|
|
18
|
+
*
|
|
19
|
+
* @param workspaceRoot The repository root, from which Nx is resolved as Nx resolves itself.
|
|
20
|
+
*/
|
|
21
|
+
export declare function nxSegmentMatcher(workspaceRoot: string): SegmentMatcher;
|
|
22
|
+
/**
|
|
23
|
+
* The plugin's own reading of a segment, where Nx's is not at hand: `*` and
|
|
24
|
+
* `?` stand for any characters but `/`, a `[...]` class for one of its
|
|
25
|
+
* characters, and a backslash makes the next character literal. A segment
|
|
26
|
+
* with a group or a brace is taken to match.
|
|
27
|
+
*/
|
|
28
|
+
export declare function globSegmentMatches(segment: string, name: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The name that a segment of a fileset stands for where Nx reads it as a
|
|
31
|
+
* name and not as a pattern, its escapes resolved; `undefined` for a
|
|
32
|
+
* pattern. As Nx's `literal_segment`: `*`, `?`, a class, a brace or a group
|
|
33
|
+
* make a pattern, while `!`, `+` and `@` count as characters unless a `(`
|
|
34
|
+
* follows (`EVD-NX-24-FILESET-SCOPE`).
|
|
35
|
+
*/
|
|
36
|
+
export declare function literalSegment(segment: string): string | undefined;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nxSegmentMatcher = nxSegmentMatcher;
|
|
4
|
+
exports.globSegmentMatches = globSegmentMatches;
|
|
5
|
+
exports.literalSegment = literalSegment;
|
|
6
|
+
const nx_bridge_1 = require("../compatibility/nx-bridge");
|
|
7
|
+
const matchers = new Map();
|
|
8
|
+
/**
|
|
9
|
+
* Nx's own glob matching for one segment of a fileset, as the hasher and
|
|
10
|
+
* `nx affected` apply it (`EVD-NX-24-FILESET-SCOPE`): `matchGlobPaths` of
|
|
11
|
+
* Nx's native module runs the engine that builds the globs of filesets
|
|
12
|
+
* (`build_glob_set` in Nx's `native/glob.rs`), with its conversion of
|
|
13
|
+
* extended groups such as `@(a|b)`, `!(a)` and `*(a)`, of classes and of
|
|
14
|
+
* escapes. The segment is matched followed by one more segment, so that a
|
|
15
|
+
* group gets the reading that Nx gives a segment that is not the last.
|
|
16
|
+
*
|
|
17
|
+
* Where the installed Nx lacks the function, the plugin's own reading
|
|
18
|
+
* applies ({@link globSegmentMatches}).
|
|
19
|
+
*
|
|
20
|
+
* @param workspaceRoot The repository root, from which Nx is resolved as Nx resolves itself.
|
|
21
|
+
*/
|
|
22
|
+
// @mara implements DES-INPUTS
|
|
23
|
+
function nxSegmentMatcher(workspaceRoot) {
|
|
24
|
+
let matcher = matchers.get(workspaceRoot);
|
|
25
|
+
if (matcher === undefined) {
|
|
26
|
+
const match = nativeMatch(workspaceRoot);
|
|
27
|
+
matcher =
|
|
28
|
+
match === undefined
|
|
29
|
+
? globSegmentMatches
|
|
30
|
+
: (segment, name) => {
|
|
31
|
+
try {
|
|
32
|
+
return match([`${segment}/x`], [`${name}/x`])[0] !== false;
|
|
33
|
+
}
|
|
34
|
+
catch (_a) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
matchers.set(workspaceRoot, matcher);
|
|
39
|
+
}
|
|
40
|
+
return matcher;
|
|
41
|
+
}
|
|
42
|
+
// `matchGlobPaths` of the Nx that resolves from the repository, as the
|
|
43
|
+
// version check and the build input check resolve it; else of the plugin's.
|
|
44
|
+
function nativeMatch(workspaceRoot) {
|
|
45
|
+
try {
|
|
46
|
+
return (0, nx_bridge_1.loadNxNative)(workspaceRoot).matchGlobPaths;
|
|
47
|
+
}
|
|
48
|
+
catch (_a) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The plugin's own reading of a segment, where Nx's is not at hand: `*` and
|
|
54
|
+
* `?` stand for any characters but `/`, a `[...]` class for one of its
|
|
55
|
+
* characters, and a backslash makes the next character literal. A segment
|
|
56
|
+
* with a group or a brace is taken to match.
|
|
57
|
+
*/
|
|
58
|
+
function globSegmentMatches(segment, name) {
|
|
59
|
+
if (/[(){}]/.test(segment)) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
let source = "";
|
|
63
|
+
for (let index = 0; index < segment.length; index++) {
|
|
64
|
+
const character = segment[index];
|
|
65
|
+
if (character === "\\" && index + 1 < segment.length) {
|
|
66
|
+
source += escapeRegExp(segment[++index]);
|
|
67
|
+
}
|
|
68
|
+
else if (character === "*") {
|
|
69
|
+
source += "[^/]*";
|
|
70
|
+
}
|
|
71
|
+
else if (character === "?") {
|
|
72
|
+
source += "[^/]";
|
|
73
|
+
}
|
|
74
|
+
else if (character === "[") {
|
|
75
|
+
const end = classEnd(segment, index);
|
|
76
|
+
if (end === undefined) {
|
|
77
|
+
source += "\\[";
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const body = segment.slice(index + 1, end);
|
|
81
|
+
const negated = body.startsWith("!") || body.startsWith("^");
|
|
82
|
+
const members = (negated ? body.slice(1) : body).replace(/[\]\\^[]/g, (c) => `\\${c}`);
|
|
83
|
+
source += `[${negated ? "^" : ""}${members}]`;
|
|
84
|
+
index = end;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
source += escapeRegExp(character);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
return new RegExp(`^${source}$`).test(name);
|
|
93
|
+
}
|
|
94
|
+
catch (_a) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The name that a segment of a fileset stands for where Nx reads it as a
|
|
100
|
+
* name and not as a pattern, its escapes resolved; `undefined` for a
|
|
101
|
+
* pattern. As Nx's `literal_segment`: `*`, `?`, a class, a brace or a group
|
|
102
|
+
* make a pattern, while `!`, `+` and `@` count as characters unless a `(`
|
|
103
|
+
* follows (`EVD-NX-24-FILESET-SCOPE`).
|
|
104
|
+
*/
|
|
105
|
+
function literalSegment(segment) {
|
|
106
|
+
if (segment === "" || !/[*?[\]{}()!+@\\]/.test(segment)) {
|
|
107
|
+
return segment === "" ? undefined : segment;
|
|
108
|
+
}
|
|
109
|
+
let name = "";
|
|
110
|
+
for (let index = 0; index < segment.length; index++) {
|
|
111
|
+
const character = segment[index];
|
|
112
|
+
if (character === "\\") {
|
|
113
|
+
if (index + 1 >= segment.length) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
name += segment[++index];
|
|
117
|
+
}
|
|
118
|
+
else if ("!+@".includes(character) && segment[index + 1] !== "(") {
|
|
119
|
+
name += character;
|
|
120
|
+
}
|
|
121
|
+
else if ("*?[]{}()!+@".includes(character)) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
name += character;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return name === "." || name === ".." ? undefined : name;
|
|
129
|
+
}
|
|
130
|
+
/** The index of the `]` that closes the class opened at `open`, if any. */
|
|
131
|
+
function classEnd(segment, open) {
|
|
132
|
+
let index = open + 1;
|
|
133
|
+
if (segment[index] === "!" || segment[index] === "^") {
|
|
134
|
+
index++;
|
|
135
|
+
}
|
|
136
|
+
if (segment[index] === "]") {
|
|
137
|
+
index++;
|
|
138
|
+
}
|
|
139
|
+
for (; index < segment.length; index++) {
|
|
140
|
+
if (segment[index] === "\\") {
|
|
141
|
+
index++;
|
|
142
|
+
}
|
|
143
|
+
else if (segment[index] === "]") {
|
|
144
|
+
return index;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
function escapeRegExp(text) {
|
|
150
|
+
return text.replace(/[.*+?^${}()|[\]\\/]/g, (character) => `\\${character}`);
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=nx-glob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx-glob.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/nx-glob.ts"],"names":[],"mappings":";;AA0BA,4CAiBC;AAkBD,gDAiCC;AASD,wCAqBC;AA5HD,0DAA+E;AAS/E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,8BAA8B;AAC9B,SAAgB,gBAAgB,CAAC,aAAqB;IACpD,IAAI,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;QACzC,OAAO;YACL,KAAK,KAAK,SAAS;gBACjB,CAAC,CAAC,kBAAkB;gBACpB,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;oBAChB,IAAI,CAAC;wBACH,OAAO,KAAK,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK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IAAI,EAAE,CAAC;YAC5B,KAAK,EAAE,CAAC;QACV,CAAC;aAAM,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;YAClC,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,SAAS,EAAE,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { TargetConfiguration } from "@nx/devkit";
|
|
2
|
+
/** The parts of Nx's internal modules that graph creation uses. */
|
|
3
|
+
export interface NxGraphInternals {
|
|
4
|
+
/**
|
|
5
|
+
* Nx's rule for laying one configuration of a target over another, as it
|
|
6
|
+
* lays a `project.json` over a plugin's target (`EVD-NX-24-OPTION-SEMANTICS`).
|
|
7
|
+
* With `deferSpreadsWithoutBase` false, a `"..."` without a base value
|
|
8
|
+
* stands for nothing.
|
|
9
|
+
*/
|
|
10
|
+
mergeTargetConfigurations(target: TargetConfiguration, baseTarget: TargetConfiguration | undefined, projectConfigSourceMap: undefined, sourceInformation: undefined, targetIdentifier: undefined, deferSpreadsWithoutBase: boolean): TargetConfiguration;
|
|
11
|
+
/**
|
|
12
|
+
* The files of `files` that an entry with `include` and `exclude`
|
|
13
|
+
* receives: Nx's last step in choosing an entry's files.
|
|
14
|
+
*/
|
|
15
|
+
findMatchingConfigFiles(files: readonly string[], include: readonly string[] | undefined, exclude: readonly string[] | undefined): string[];
|
|
16
|
+
/**
|
|
17
|
+
* The files that Nx chooses for an entry before {@link findMatchingConfigFiles}:
|
|
18
|
+
* those of Nx's workspace context that the entry's `createNodes` pattern
|
|
19
|
+
* matches, where Nx globs a narrow `include` natively first
|
|
20
|
+
* (`EVD-NX-24-ENTRY-CONTEXT`). Nx's own `globPluginFiles`, called through
|
|
21
|
+
* `retrieveProjectConfigurationPaths` of
|
|
22
|
+
* `nx/src/project-graph/utils/retrieve-workspace-files` with the entry
|
|
23
|
+
* alone, relative to the repository root. That module is loaded on the
|
|
24
|
+
* first call.
|
|
25
|
+
*/
|
|
26
|
+
pluginFiles(workspaceRoot: string, pattern: string, include: readonly string[] | undefined, exclude: readonly string[] | undefined): Promise<string[]>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The internal parts of the Nx installed in the repository that graph
|
|
30
|
+
* creation uses, from the same module that Nx itself loaded. They are no
|
|
31
|
+
* public API and can change between majors (`RISK-UPSTREAM-CHANGES`), so
|
|
32
|
+
* each part is checked to be a function, and each result to have the shape
|
|
33
|
+
* that the plugin reads, as `init`'s graph check does: a changed part fails
|
|
34
|
+
* graph creation with a message that names it, instead of giving a wrong
|
|
35
|
+
* graph.
|
|
36
|
+
*
|
|
37
|
+
* @throws {Error} When the module cannot be loaded or lacks a part, naming
|
|
38
|
+
* it; the returned functions throw such an error for a result of another shape.
|
|
39
|
+
*/
|
|
40
|
+
export declare function nxGraphInternals(workspaceRoot: string): NxGraphInternals;
|
|
41
|
+
/**
|
|
42
|
+
* Whether Nx leaves a directory out of the files it reads, by the rules that
|
|
43
|
+
* Nx itself gives for its file walker (`createGitIgnoreChecker` of
|
|
44
|
+
* `nx/src/devkit-internals`, the same in every Nx 24 release): its fixed
|
|
45
|
+
* folders, such as `node_modules` and `.nx/cache`, and the `.gitignore` and
|
|
46
|
+
* `.nxignore` files from the repository root down to the directory, read
|
|
47
|
+
* from disk now. Ask a new function after an ignore file changes.
|
|
48
|
+
*
|
|
49
|
+
* Unlike {@link nxGraphInternals}, it fails nothing: where the installed Nx
|
|
50
|
+
* lacks that part, it returns `undefined`, and a caller that only warns can
|
|
51
|
+
* say nothing instead.
|
|
52
|
+
*
|
|
53
|
+
* @returns A function of a directory's path relative to the repository
|
|
54
|
+
* root, with `/` separators, that is `false` only where Nx answers that it
|
|
55
|
+
* reads the directory; `undefined` where the installed Nx cannot tell.
|
|
56
|
+
*/
|
|
57
|
+
export declare function nxIgnoreRules(workspaceRoot: string): ((directory: string) => boolean) | undefined;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nxGraphInternals = nxGraphInternals;
|
|
4
|
+
exports.nxIgnoreRules = nxIgnoreRules;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const nx_bridge_1 = require("../compatibility/nx-bridge");
|
|
9
|
+
const pluginFilesPath = "nx/src/project-graph/utils/retrieve-workspace-files";
|
|
10
|
+
const pluginFilesPart = "retrieveProjectConfigurationPaths";
|
|
11
|
+
const loaded = new Map();
|
|
12
|
+
/**
|
|
13
|
+
* The internal parts of the Nx installed in the repository that graph
|
|
14
|
+
* creation uses, from the same module that Nx itself loaded. They are no
|
|
15
|
+
* public API and can change between majors (`RISK-UPSTREAM-CHANGES`), so
|
|
16
|
+
* each part is checked to be a function, and each result to have the shape
|
|
17
|
+
* that the plugin reads, as `init`'s graph check does: a changed part fails
|
|
18
|
+
* graph creation with a message that names it, instead of giving a wrong
|
|
19
|
+
* graph.
|
|
20
|
+
*
|
|
21
|
+
* @throws {Error} When the module cannot be loaded or lacks a part, naming
|
|
22
|
+
* it; the returned functions throw such an error for a result of another shape.
|
|
23
|
+
*/
|
|
24
|
+
function nxGraphInternals(workspaceRoot) {
|
|
25
|
+
const cached = loaded.get(workspaceRoot);
|
|
26
|
+
if (cached !== undefined) {
|
|
27
|
+
return cached;
|
|
28
|
+
}
|
|
29
|
+
let nx;
|
|
30
|
+
try {
|
|
31
|
+
nx = (0, nx_bridge_1.loadDevkitInternals)(workspaceRoot, [
|
|
32
|
+
"mergeTargetConfigurations",
|
|
33
|
+
"findMatchingConfigFiles",
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
if (error instanceof nx_bridge_1.NxBridgeError) {
|
|
38
|
+
throw unsupported(error.message);
|
|
39
|
+
}
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
const internals = {
|
|
43
|
+
mergeTargetConfigurations: (...args) => checked(nx.mergeTargetConfigurations(...args), "mergeTargetConfigurations", "no target configuration", isTable),
|
|
44
|
+
findMatchingConfigFiles: (...args) => checked(nx.findMatchingConfigFiles(...args), "findMatchingConfigFiles", "no list of file paths", isPathList),
|
|
45
|
+
pluginFiles: (root, pattern, include, exclude) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
let retrieve;
|
|
47
|
+
try {
|
|
48
|
+
retrieve = (0, nx_bridge_1.loadRetrieveWorkspaceFiles)(workspaceRoot, [
|
|
49
|
+
pluginFilesPart,
|
|
50
|
+
]).retrieveProjectConfigurationPaths;
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (error instanceof nx_bridge_1.NxBridgeError) {
|
|
54
|
+
throw unsupported(error.message);
|
|
55
|
+
}
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
// The parts of a loaded plugin entry that Nx's globPluginFiles reads.
|
|
59
|
+
const entry = { createNodes: [pattern], include, exclude };
|
|
60
|
+
return checked((yield retrieve(root, [entry])), pluginFilesPart, "no list of file paths", isPathList, pluginFilesPath);
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
loaded.set(workspaceRoot, internals);
|
|
64
|
+
return internals;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Whether Nx leaves a directory out of the files it reads, by the rules that
|
|
68
|
+
* Nx itself gives for its file walker (`createGitIgnoreChecker` of
|
|
69
|
+
* `nx/src/devkit-internals`, the same in every Nx 24 release): its fixed
|
|
70
|
+
* folders, such as `node_modules` and `.nx/cache`, and the `.gitignore` and
|
|
71
|
+
* `.nxignore` files from the repository root down to the directory, read
|
|
72
|
+
* from disk now. Ask a new function after an ignore file changes.
|
|
73
|
+
*
|
|
74
|
+
* Unlike {@link nxGraphInternals}, it fails nothing: where the installed Nx
|
|
75
|
+
* lacks that part, it returns `undefined`, and a caller that only warns can
|
|
76
|
+
* say nothing instead.
|
|
77
|
+
*
|
|
78
|
+
* @returns A function of a directory's path relative to the repository
|
|
79
|
+
* root, with `/` separators, that is `false` only where Nx answers that it
|
|
80
|
+
* reads the directory; `undefined` where the installed Nx cannot tell.
|
|
81
|
+
*/
|
|
82
|
+
function nxIgnoreRules(workspaceRoot) {
|
|
83
|
+
let create;
|
|
84
|
+
try {
|
|
85
|
+
create = (0, nx_bridge_1.loadDevkitInternals)(workspaceRoot, ["createGitIgnoreChecker"]).createGitIgnoreChecker;
|
|
86
|
+
}
|
|
87
|
+
catch (_a) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
// The only part of a generator's file tree that the checker reads.
|
|
91
|
+
const tree = {
|
|
92
|
+
read(path) {
|
|
93
|
+
try {
|
|
94
|
+
return (0, node_fs_1.readFileSync)((0, node_path_1.join)(workspaceRoot, path), "utf8");
|
|
95
|
+
}
|
|
96
|
+
catch (_a) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
const checker = create(tree);
|
|
102
|
+
const isIgnoredDirectory = checker === null || checker === void 0 ? void 0 : checker.isIgnoredDirectory;
|
|
103
|
+
if (typeof isIgnoredDirectory !== "function") {
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
return (directory) => isIgnoredDirectory.call(checker, directory) !== false;
|
|
107
|
+
}
|
|
108
|
+
// The result, or an error that names the part and what its result lacks.
|
|
109
|
+
function checked(result, part, lacking, isExpected, path = "nx/src/devkit-internals") {
|
|
110
|
+
if (!isExpected(result)) {
|
|
111
|
+
throw unsupported(`the result of ${part} from ${path} is ${lacking}`);
|
|
112
|
+
}
|
|
113
|
+
return result;
|
|
114
|
+
}
|
|
115
|
+
function isTable(value) {
|
|
116
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
117
|
+
}
|
|
118
|
+
function isPathList(value) {
|
|
119
|
+
return Array.isArray(value) && value.every((path) => typeof path === "string");
|
|
120
|
+
}
|
|
121
|
+
function unsupported(detail) {
|
|
122
|
+
return new Error([
|
|
123
|
+
`nx-rust cannot create the project graph with the installed Nx: ${detail}.`,
|
|
124
|
+
"It reads the settings of the nx metadata tables in Cargo.toml and of its entries in nx.json through parts of Nx that are not public API, and the installed Nx does not have them in the form it expects.",
|
|
125
|
+
"Use an Nx version that @convesoft/nx-rust supports, or a version of @convesoft/nx-rust that supports the installed Nx.",
|
|
126
|
+
].join("\n"));
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=nx-internals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx-internals.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/nx-internals.ts"],"names":[],"mappings":";;AAqEA,4CA6DC;AAkBD,sCAyBC;;AA5KD,qCAAuC;AACvC,yCAAiC;AACjC,0DAIoC;AA6CpC,MAAM,eAAe,GAAG,qDAAqD,CAAC;AAC9E,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAE5D,MAAM,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,SAAgB,gBAAgB,CAAC,aAAqB;IACpD,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACzC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,EAEH,CAAC;IACF,IAAI,CAAC;QACH,EAAE,GAAG,IAAA,+BAAmB,EAAC,aAAa,EAAE;YACtC,2BAA2B;YAC3B,yBAAyB;SAC1B,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,yBAAa,EAAE,CAA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I,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;AACjF,CAAC;AAED,SAAS,WAAW,CAAC,MAAc;IACjC,OAAO,IAAI,KAAK,CACd;QACE,kEAAkE,MAAM,GAAG;QAC3E,0MAA0M;QAC1M,wHAAwH;KACzH,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names that the plugin options' `targetNames` gives inferred targets:
|
|
3
|
+
* from the default name of a target to the name to use, such as
|
|
4
|
+
* `{ lint: "clippy" }`. A target without an entry keeps its default name.
|
|
5
|
+
*/
|
|
6
|
+
export type TargetNames = Readonly<Record<string, string>>;
|
|
7
|
+
/**
|
|
8
|
+
* Reads `targetNames` from the options of the plugin's entry in `nx.json`.
|
|
9
|
+
*
|
|
10
|
+
* Each key has to be the default name of an inferred target that this
|
|
11
|
+
* version of the plugin knows ({@link inferredTargetNames}), whether or not
|
|
12
|
+
* a project has that target, other than `nx-release-publish`, which Nx
|
|
13
|
+
* release runs only under that name, and each value a target name. The other
|
|
14
|
+
* plugin options are read with it (`readPluginOptions` in `settings.ts`).
|
|
15
|
+
*
|
|
16
|
+
* @param options The `options` of the entry, as Nx passes them to `createNodes`.
|
|
17
|
+
* @throws {Error} When `targetNames` is no object, has a key that names no
|
|
18
|
+
* inferred target, or `nx-release-publish`, or a value that is no name,
|
|
19
|
+
* naming the keys.
|
|
20
|
+
*/
|
|
21
|
+
export declare function readTargetNames(options: unknown): TargetNames;
|
|
22
|
+
/**
|
|
23
|
+
* Reads `locked` from the options of the plugin's entry in `nx.json`: locked
|
|
24
|
+
* mode for the commands of the tasks of the projects that this entry creates
|
|
25
|
+
* (`DES-INVOCATION`). The environment variable `NX_RUST_LOCKED` replaces it
|
|
26
|
+
* for one run, which the executor decides when a task starts.
|
|
27
|
+
*
|
|
28
|
+
* @param options The `options` of the entry, as Nx passes them to `createNodes`.
|
|
29
|
+
* @returns `false` when the entry does not set it.
|
|
30
|
+
* @throws {Error} When `locked` is set to anything but `true` or `false`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function readLocked(options: unknown): boolean;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readTargetNames = readTargetNames;
|
|
4
|
+
exports.readLocked = readLocked;
|
|
5
|
+
const targets_1 = require("./targets");
|
|
6
|
+
/**
|
|
7
|
+
* Reads `targetNames` from the options of the plugin's entry in `nx.json`.
|
|
8
|
+
*
|
|
9
|
+
* Each key has to be the default name of an inferred target that this
|
|
10
|
+
* version of the plugin knows ({@link inferredTargetNames}), whether or not
|
|
11
|
+
* a project has that target, other than `nx-release-publish`, which Nx
|
|
12
|
+
* release runs only under that name, and each value a target name. The other
|
|
13
|
+
* plugin options are read with it (`readPluginOptions` in `settings.ts`).
|
|
14
|
+
*
|
|
15
|
+
* @param options The `options` of the entry, as Nx passes them to `createNodes`.
|
|
16
|
+
* @throws {Error} When `targetNames` is no object, has a key that names no
|
|
17
|
+
* inferred target, or `nx-release-publish`, or a value that is no name,
|
|
18
|
+
* naming the keys.
|
|
19
|
+
*/
|
|
20
|
+
// @mara implements DES-PLUGIN-OPTIONS
|
|
21
|
+
function readTargetNames(options) {
|
|
22
|
+
const value = isObject(options) ? options.targetNames : undefined;
|
|
23
|
+
if (value === undefined) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
const where = `"targetNames" in the options of the @convesoft/nx-rust entry in nx.json`;
|
|
27
|
+
if (!isObject(value)) {
|
|
28
|
+
throw new Error(`${where} has to be an object that maps the default name of an inferred target to the name to use, such as { "lint": "clippy" }.`);
|
|
29
|
+
}
|
|
30
|
+
const renamable = targets_1.inferredTargetNames.filter((target) => target !== targets_1.releasePublishTarget);
|
|
31
|
+
if (Object.prototype.hasOwnProperty.call(value, targets_1.releasePublishTarget)) {
|
|
32
|
+
throw new Error(`${where} names "${targets_1.releasePublishTarget}", but Nx release runs the publish target only under that name, so it cannot be renamed. Remove the key "${targets_1.releasePublishTarget}" from "targetNames"; the targets that can be renamed are ${list(renamable.map((target) => `"${target}"`))}.`);
|
|
33
|
+
}
|
|
34
|
+
const known = new Set(renamable);
|
|
35
|
+
const unknown = Object.keys(value).filter((target) => !known.has(target));
|
|
36
|
+
if (unknown.length > 0) {
|
|
37
|
+
throw new Error([
|
|
38
|
+
`${where} names ${list(unknown.map((target) => `"${target}"`))}, which ${unknown.length === 1 ? "is not the default name of an inferred target" : "are not default names of inferred targets"}.`,
|
|
39
|
+
`The targets that can be renamed are ${list(renamable.map((target) => `"${target}"`))}.`,
|
|
40
|
+
].join(" "));
|
|
41
|
+
}
|
|
42
|
+
for (const [target, name] of Object.entries(value)) {
|
|
43
|
+
if (typeof name !== "string" || name.trim() === "") {
|
|
44
|
+
throw new Error(`${where} gives the target "${target}" ${JSON.stringify(name)}, but a target name has to be a string that is not empty.`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Reads `locked` from the options of the plugin's entry in `nx.json`: locked
|
|
51
|
+
* mode for the commands of the tasks of the projects that this entry creates
|
|
52
|
+
* (`DES-INVOCATION`). The environment variable `NX_RUST_LOCKED` replaces it
|
|
53
|
+
* for one run, which the executor decides when a task starts.
|
|
54
|
+
*
|
|
55
|
+
* @param options The `options` of the entry, as Nx passes them to `createNodes`.
|
|
56
|
+
* @returns `false` when the entry does not set it.
|
|
57
|
+
* @throws {Error} When `locked` is set to anything but `true` or `false`.
|
|
58
|
+
*/
|
|
59
|
+
// @mara implements DES-INVOCATION
|
|
60
|
+
// @mara implements DES-PLUGIN-OPTIONS
|
|
61
|
+
function readLocked(options) {
|
|
62
|
+
const value = isObject(options) ? options.locked : undefined;
|
|
63
|
+
if (value === undefined) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
if (typeof value !== "boolean") {
|
|
67
|
+
throw new Error(`"locked" in the options of the @convesoft/nx-rust entry in nx.json is ${JSON.stringify(value)}, but it has to be true or false.`);
|
|
68
|
+
}
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
function isObject(value) {
|
|
72
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
73
|
+
}
|
|
74
|
+
// `"a"`, `"a" and "b"`, `"a", "b" and "c"`
|
|
75
|
+
function list(items) {
|
|
76
|
+
return items.length <= 1
|
|
77
|
+
? items.join("")
|
|
78
|
+
: `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/options.ts"],"names":[],"mappings":";;AAwBA,0CAmCC;AAcD,gCAWC;AApFD,uCAAsE;AAStE;;;;;;;;;;;;;GAaG;AACH,sCAAsC;AACtC,SAAgB,eAAe,CAAC,OAAgB;IAC9C,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,KAAK,GAAG,yEAAyE,CAAC;IACxF,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,yHAAyH,CAClI,CAAC;IACJ,CAAC;I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|
|
1
|
+
import type { CargoPackage } from "../cargo/metadata";
|
|
2
|
+
import type { PickedTriples } from "../cargo/target-triples";
|
|
3
|
+
import type { InferredTargetName } from "./targets";
|
|
4
|
+
/**
|
|
5
|
+
* Where a workspace's artifact directory lies, as far as caching cares: the
|
|
6
|
+
* folder that the system reaches through the path that cargo reports, with
|
|
7
|
+
* every symbolic link followed (`DES-OUTPUTS`).
|
|
8
|
+
*/
|
|
9
|
+
export type ArtifactDirectory =
|
|
10
|
+
/** Inside the repository, at `path` relative to its real path; `shared` when it is another workspace's too, or lies inside another's or holds it. */
|
|
11
|
+
{
|
|
12
|
+
inside: true;
|
|
13
|
+
path: string;
|
|
14
|
+
shared: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Outside the repository, where Nx cannot store files. */
|
|
17
|
+
| {
|
|
18
|
+
inside: false;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Why `DES-TARGETS` and `DES-WORKSPACE-TARGETS` leave a target uncached in
|
|
22
|
+
* every project, for the message of a task whose configuration caches it
|
|
23
|
+
* anyway.
|
|
24
|
+
*/
|
|
25
|
+
export declare const uncachedByDesign: Partial<Record<InferredTargetName, string>>;
|
|
26
|
+
/** What decides, beyond the target, whether the plugin can cache it in a workspace. */
|
|
27
|
+
export interface CachePlace {
|
|
28
|
+
/** Where the workspace's artifact directory lies. */
|
|
29
|
+
artifacts: ArtifactDirectory;
|
|
30
|
+
/**
|
|
31
|
+
* Where Cargo's configuration or the graph's environment picks a triple
|
|
32
|
+
* whose folder the plugin cannot name, what picks it and why, as in "build.target
|
|
33
|
+
* in rust/.cargo/config.toml picks the target triple "host-tuple", whose
|
|
34
|
+
* folder the plugin cannot name: …".
|
|
35
|
+
*/
|
|
36
|
+
tripleProblem?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Why the plugin leaves a target that `DES-TARGETS` caches uncached in one
|
|
40
|
+
* project, or `undefined` where it caches it (`DES-OUTPUTS`): `build` and
|
|
41
|
+
* `doc` where the artifact directory lies outside the repository, or where
|
|
42
|
+
* Cargo's configuration or the graph's environment picks a triple whose
|
|
43
|
+
* folder the plugin cannot name and the target's options name none, and
|
|
44
|
+
* `doc` where another workspace shares the artifact directory, as the same
|
|
45
|
+
* folder or one inside the other. The plugin
|
|
46
|
+
* cannot name or store the artifacts of such a task.
|
|
47
|
+
*
|
|
48
|
+
* @param namesTriple Whether the target's options or configurations name a triple.
|
|
49
|
+
*/
|
|
50
|
+
export declare function uncachedReason(target: InferredTargetName, place: CachePlace, namesTriple: boolean): string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The outputs of a cached target, which name final artifacts only and never
|
|
53
|
+
* a path inside Cargo's build directory (`DES-OUTPUTS`, `DES-BUILD-DIRS`):
|
|
54
|
+
*
|
|
55
|
+
* - `build`: the executable of each binary target, and the `cdylib` and
|
|
56
|
+
* `staticlib` files of the library, in the artifact directory's folder
|
|
57
|
+
* for each triple that the task builds for and its profile
|
|
58
|
+
* ({@link tripleFolders}). A library's file is named for both Linux and
|
|
59
|
+
* macOS, and Nx stores what exists.
|
|
60
|
+
* - `doc`: the whole `doc` folder of the artifact directory, or of each
|
|
61
|
+
* triple's folder where the task builds for a triple.
|
|
62
|
+
*
|
|
63
|
+
* Other targets store their result only and have no outputs, and neither
|
|
64
|
+
* do targets that are not cached. The list is empty rather than absent,
|
|
65
|
+
* because Nx gives a `build` target without `outputs` folders such as
|
|
66
|
+
* `{projectRoot}/build` of its own accord.
|
|
67
|
+
*/
|
|
68
|
+
export declare function targetOutputs(target: InferredTargetName, pkg: CargoPackage | undefined, artifacts: ArtifactDirectory, cached: boolean, triples?: PickedTriples): string[];
|
|
69
|
+
/**
|
|
70
|
+
* The names of a crate's final artifacts in a profile folder, which the
|
|
71
|
+
* outputs of its `build` name ({@link targetOutputs}, `DES-OUTPUTS`): the
|
|
72
|
+
* executable of each binary target, and the `cdylib` and `staticlib` files
|
|
73
|
+
* of the library, a `cdylib` named for both Linux and macOS.
|
|
74
|
+
*/
|
|
75
|
+
export declare function finalFileNames(pkg: CargoPackage): string[];
|