@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,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComputationReports = void 0;
|
|
4
|
+
exports.computationReports = computationReports;
|
|
5
|
+
exports.possibleRoots = possibleRoots;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const smol_toml_1 = require("smol-toml");
|
|
10
|
+
const metadata_1 = require("../cargo/metadata");
|
|
11
|
+
const real_path_1 = require("./real-path");
|
|
12
|
+
/**
|
|
13
|
+
* The `cargo metadata` reports of one graph computation, shared by the
|
|
14
|
+
* entries of the plugin in `nx.json` that Nx runs in this process.
|
|
15
|
+
*
|
|
16
|
+
* A report requested for one manifest is reused for another manifest only
|
|
17
|
+
* when it lists that manifest as its root manifest or as one of its
|
|
18
|
+
* packages: `cargo metadata` would then report the same workspace for it.
|
|
19
|
+
* A workspace's own report, from which graph creation takes what Cargo's
|
|
20
|
+
* configuration decides, must come from the workspace's root folder
|
|
21
|
+
* ({@link requestFromRoot}), so a report requested in another folder is not
|
|
22
|
+
* reused for that. What each entry discovers therefore does not depend on
|
|
23
|
+
* whether Nx runs the entries in one process or in several.
|
|
24
|
+
*
|
|
25
|
+
* Before it looks, a request waits for the requests in flight whose
|
|
26
|
+
* workspace may be its own ({@link possibleRoots}), so that a workspace
|
|
27
|
+
* whose manifests two entries receive is reported once, whichever entry
|
|
28
|
+
* gets there first. Requests that cannot report one workspace run at the
|
|
29
|
+
* same time.
|
|
30
|
+
*/
|
|
31
|
+
// @mara implements DES-METADATA-REPORT
|
|
32
|
+
class ComputationReports {
|
|
33
|
+
/**
|
|
34
|
+
* @param run Requests a report; tests pass one that counts the calls.
|
|
35
|
+
*/
|
|
36
|
+
constructor(run = metadata_1.requestMetadata) {
|
|
37
|
+
this.run = run;
|
|
38
|
+
this.settled = [];
|
|
39
|
+
this.inFlight = new Map();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The report for `manifest`: one requested earlier in this computation
|
|
43
|
+
* that covers it, or a new one requested in `cwd`.
|
|
44
|
+
*
|
|
45
|
+
* @param manifest The absolute path of a `Cargo.toml`.
|
|
46
|
+
* @throws Whatever {@link requestMetadata} throws.
|
|
47
|
+
*/
|
|
48
|
+
request(manifest, cwd) {
|
|
49
|
+
return this.find(manifest, cwd, () => true);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The report of the workspace whose root manifest is `rootManifest`, as
|
|
53
|
+
* cargo gives it in the workspace's root folder, where the workspace's
|
|
54
|
+
* tasks run cargo: one requested there earlier in this computation, or a
|
|
55
|
+
* new one requested there.
|
|
56
|
+
*
|
|
57
|
+
* @param rootManifest The absolute path of a workspace's root manifest.
|
|
58
|
+
* @throws Whatever {@link requestMetadata} throws.
|
|
59
|
+
*/
|
|
60
|
+
requestFromRoot(rootManifest) {
|
|
61
|
+
return this.find(rootManifest, (0, node_path_1.dirname)(rootManifest), (entry) => startedInRoot(entry));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Whether cargo started in the root folder of the reported workspace for
|
|
65
|
+
* this report of the computation.
|
|
66
|
+
*/
|
|
67
|
+
fromRoot(report) {
|
|
68
|
+
const entry = this.settled.find((settled) => settled.report === report);
|
|
69
|
+
return entry !== undefined && startedInRoot(entry);
|
|
70
|
+
}
|
|
71
|
+
find(manifest, cwd, reusable) {
|
|
72
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const roots = possibleRoots(manifest);
|
|
74
|
+
for (;;) {
|
|
75
|
+
const related = [...this.inFlight]
|
|
76
|
+
.filter(([, others]) => mayShare(roots, others))
|
|
77
|
+
.map(([requesting]) => requesting);
|
|
78
|
+
if (related.length === 0) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
yield Promise.allSettled(related);
|
|
82
|
+
}
|
|
83
|
+
// From here to the request's start nothing awaits, so a request that
|
|
84
|
+
// checks next sees this one in flight.
|
|
85
|
+
const known = this.settled.find((entry) => covers(entry.report, manifest) && reusable(entry));
|
|
86
|
+
if (known !== undefined) {
|
|
87
|
+
return known.report;
|
|
88
|
+
}
|
|
89
|
+
const requesting = this.run(manifest, cwd);
|
|
90
|
+
this.inFlight.set(requesting, roots);
|
|
91
|
+
try {
|
|
92
|
+
const report = yield requesting;
|
|
93
|
+
this.settled.push({ report, cwd });
|
|
94
|
+
return report;
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
this.inFlight.delete(requesting);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.ComputationReports = ComputationReports;
|
|
103
|
+
let current;
|
|
104
|
+
/**
|
|
105
|
+
* The reports of the graph computation that the calling `createNodes`
|
|
106
|
+
* belongs to. Call it before the first `await` of `createNodes`.
|
|
107
|
+
*
|
|
108
|
+
* Nx starts the `createNodes` calls of all plugin entries of one computation
|
|
109
|
+
* in one synchronous loop. The calls made before the next microtask therefore
|
|
110
|
+
* belong together, and a later call starts a new computation: reports are
|
|
111
|
+
* never reused from an earlier computation. Should Nx start the entries'
|
|
112
|
+
* calls apart, each gets reports of its own, which costs cargo calls but
|
|
113
|
+
* changes no result.
|
|
114
|
+
*/
|
|
115
|
+
function computationReports() {
|
|
116
|
+
if (current === undefined) {
|
|
117
|
+
const reports = new ComputationReports();
|
|
118
|
+
current = reports;
|
|
119
|
+
queueMicrotask(() => {
|
|
120
|
+
if (current === reports) {
|
|
121
|
+
current = undefined;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
return current;
|
|
126
|
+
}
|
|
127
|
+
// Whether cargo started in the reported workspace's root folder. rustup and
|
|
128
|
+
// Cargo find the toolchain and configuration files from the physical folder
|
|
129
|
+
// that a command starts in, so two spellings of one folder count as one.
|
|
130
|
+
function startedInRoot({ report, cwd }) {
|
|
131
|
+
return (0, real_path_1.realPath)(cwd) === (0, real_path_1.realPath)(report.workspace_root);
|
|
132
|
+
}
|
|
133
|
+
function covers(report, manifest) {
|
|
134
|
+
return ((0, node_path_1.join)(report.workspace_root, "Cargo.toml") === manifest ||
|
|
135
|
+
report.packages.some((pkg) => pkg.manifest_path === manifest));
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The root manifests, as real paths, that cargo may take for a manifest's
|
|
139
|
+
* workspace, or `"any"` where nothing short of cargo can tell. Two requests
|
|
140
|
+
* whose sets share no manifest report different workspaces, so neither can
|
|
141
|
+
* reuse the other's report and neither waits for the other.
|
|
142
|
+
*
|
|
143
|
+
* Cargo takes a manifest with a `[workspace]` table as its own root, follows
|
|
144
|
+
* `package.workspace` wherever it points, and otherwise looks for the root in
|
|
145
|
+
* the folders above the manifest, where it follows the `package.workspace`
|
|
146
|
+
* of a manifest above as well; a member outside its root's folder must name
|
|
147
|
+
* the root in `package.workspace` or lie below a manifest that does. The set
|
|
148
|
+
* is therefore the manifest itself where it has a `[workspace]` table, and
|
|
149
|
+
* otherwise the manifest and every `Cargo.toml` in a folder above it,
|
|
150
|
+
* whether or not that one is a workspace that lists it, along the path as
|
|
151
|
+
* cargo normalises it and along its real path. Where the manifest or one
|
|
152
|
+
* above it has `package.workspace`, or the `[project]` table's, or cannot be
|
|
153
|
+
* read as TOML, the workspace may be any: `"any"`. Taking more than cargo
|
|
154
|
+
* would only make a request wait longer than needed.
|
|
155
|
+
*
|
|
156
|
+
* @param given The absolute path of a `Cargo.toml`.
|
|
157
|
+
*/
|
|
158
|
+
// @mara implements DES-METADATA-REPORT
|
|
159
|
+
function possibleRoots(given) {
|
|
160
|
+
// Cargo normalises the path it is given as text, before following links.
|
|
161
|
+
const manifest = (0, node_path_1.resolve)(given);
|
|
162
|
+
const own = readManifest(manifest);
|
|
163
|
+
if (own === undefined || pointsToRoot(own)) {
|
|
164
|
+
return "any";
|
|
165
|
+
}
|
|
166
|
+
const roots = new Set([(0, real_path_1.realPath)(manifest)]);
|
|
167
|
+
if (own.workspace !== undefined) {
|
|
168
|
+
return roots;
|
|
169
|
+
}
|
|
170
|
+
for (const start of [(0, node_path_1.dirname)(manifest), (0, node_path_1.dirname)((0, real_path_1.realPath)(manifest))]) {
|
|
171
|
+
for (let above = (0, node_path_1.dirname)(start);; above = (0, node_path_1.dirname)(above)) {
|
|
172
|
+
const candidate = (0, node_path_1.join)(above, "Cargo.toml");
|
|
173
|
+
if ((0, node_fs_1.existsSync)(candidate)) {
|
|
174
|
+
const read = readManifest(candidate);
|
|
175
|
+
if (read === undefined || pointsToRoot(read)) {
|
|
176
|
+
return "any";
|
|
177
|
+
}
|
|
178
|
+
roots.add((0, real_path_1.realPath)(candidate));
|
|
179
|
+
}
|
|
180
|
+
if ((0, node_path_1.dirname)(above) === above) {
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return roots;
|
|
186
|
+
}
|
|
187
|
+
// A manifest's tables, or `undefined` where it cannot be read as TOML.
|
|
188
|
+
function readManifest(path) {
|
|
189
|
+
try {
|
|
190
|
+
return (0, smol_toml_1.parse)((0, node_fs_1.readFileSync)(path, "utf8"));
|
|
191
|
+
}
|
|
192
|
+
catch (_a) {
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Whether a manifest names its workspace root with `package.workspace`, or
|
|
197
|
+
// with the key of the legacy `[project]` table.
|
|
198
|
+
function pointsToRoot(manifest) {
|
|
199
|
+
return namesWorkspace(manifest.package) || namesWorkspace(manifest.project);
|
|
200
|
+
}
|
|
201
|
+
function namesWorkspace(table) {
|
|
202
|
+
return typeof table === "object" && table !== null && "workspace" in table;
|
|
203
|
+
}
|
|
204
|
+
// Whether two requests may report one workspace.
|
|
205
|
+
function mayShare(roots, others) {
|
|
206
|
+
if (roots === "any" || others === "any") {
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
for (const root of roots) {
|
|
210
|
+
if (others.has(root)) {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=computation-reports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computation-reports.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/computation-reports.ts"],"names":[],"mappings":";;;AAuHA,gDAWC;AAsCD,sCA2BC;;AAnMD,qCAAmD;AACnD,yCAAmD;AACnD,yCAAkC;AAClC,gDAAmE;AACnE,2CAAuC;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,uCAAuC;AACvC,MAAa,kBAAkB;IAI7B;;OAEG;IACH,YACmB,MAGa,0BAAe;QAH5B,QAAG,GAAH,GAAG,CAGyB;QAV9B,YAAO,GAA6C,EAAE,CAAC;QACvD,aAAQ,GAAG,IAAI,GAAG,EAAyC,CAAC;IAU1E,CAAC;IAEJ;;;;;;OAMG;IACH,OAAO,CAAC,QAAgB,EAAE,GAAW;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;;OAQG;IACH,eAAe,CAAC,YAAoB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAA,mBAAO,EAAC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IACzF,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,MAAqB;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;QACxE,OAAO,KAAK,KAAK,SAAS,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC;IAEa,IAAI,CAChB,QAAgB,EAChB,GAAW,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AC,QAAiC;IACrD,OAAO,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC9E,CAAC;AAKD,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,WAAW,IAAI,KAAK,CAAC;AAC7E,CAAC;AAED,iDAAiD;AACjD,SAAS,QAAQ,CAAC,KAAoB,EAAE,MAAqB;IAC3D,IAAI,KAAK,KAAK,KAAK,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type { CreateDependenciesContext } from "@nx/devkit";
|
|
2
|
+
import { CargoDiscovery, CargoWorkspace } from "./discovery";
|
|
3
|
+
import type { InputDefinition } from "./inputs";
|
|
4
|
+
import { SegmentMatcher } from "./nx-glob";
|
|
5
|
+
import type { FileInput } from "./settings";
|
|
6
|
+
/** What a project's `fileInputs` give: the filesets for its key, or why graph creation stops. */
|
|
7
|
+
export interface DeclaredFiles {
|
|
8
|
+
/**
|
|
9
|
+
* The filesets for the patterns, with `includeIgnored`, in the order of
|
|
10
|
+
* the patterns and of the alternatives of their braces: for each, those of
|
|
11
|
+
* the links it passes, the one for its real path, with the one for
|
|
12
|
+
* everything below it where it names a folder, and those for the folders
|
|
13
|
+
* of the plugin's projects below where it starts.
|
|
14
|
+
*/
|
|
15
|
+
filesets: InputDefinition[];
|
|
16
|
+
/** The problems of `DES-DIAGNOSTICS` that the patterns have; graph creation stops on any. */
|
|
17
|
+
problems: string[];
|
|
18
|
+
/** The patterns that gave filesets, as resolved, for {@link failOnUncoveredProjectFolders}. */
|
|
19
|
+
patterns: DeclaredPattern[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* One alternative of a `fileInputs` pattern as graph creation resolved it,
|
|
23
|
+
* kept for the check that `createDependencies` makes with the projects of
|
|
24
|
+
* every plugin ({@link failOnUncoveredProjectFolders}).
|
|
25
|
+
*/
|
|
26
|
+
export interface DeclaredPattern {
|
|
27
|
+
/** The pattern as written, with its manifest. */
|
|
28
|
+
input: FileInput;
|
|
29
|
+
/** The alternative of the pattern's braces, the pattern itself where it has none. */
|
|
30
|
+
alternative: string;
|
|
31
|
+
/** The real name of the crate whose key the pattern goes into. */
|
|
32
|
+
crate: string;
|
|
33
|
+
/** The real path of the folder of the manifest, relative to the repository root. */
|
|
34
|
+
manifestFolder: string;
|
|
35
|
+
/**
|
|
36
|
+
* The folder that Nx reads the alternative from, relative to the
|
|
37
|
+
* repository root, `""` for the root itself: the real path of its fixed
|
|
38
|
+
* part, with the segments after it that Nx reads as names.
|
|
39
|
+
*/
|
|
40
|
+
folder: string;
|
|
41
|
+
/** The rest of the alternative after {@link folder}, `""` where it has none. */
|
|
42
|
+
glob: string;
|
|
43
|
+
/** Whether it names folders, and thereby everything below them ({@link namesFolders}). */
|
|
44
|
+
namesFolders: boolean;
|
|
45
|
+
/** Whether the plugin cannot read it, so that it takes it to name everything below its folder. */
|
|
46
|
+
unread: boolean;
|
|
47
|
+
/** Every fileset that the crate's patterns give, this one's among them. */
|
|
48
|
+
crateFilesets: readonly string[];
|
|
49
|
+
}
|
|
50
|
+
/** Who a crate's patterns are for, and which projects the plugin creates. */
|
|
51
|
+
export interface DeclaredScope {
|
|
52
|
+
/** The real name of the crate whose key the patterns go into. */
|
|
53
|
+
crate: string;
|
|
54
|
+
/**
|
|
55
|
+
* The folders of the projects that this entry of the plugin creates,
|
|
56
|
+
* relative to the repository root ({@link pluginProjectRoots}).
|
|
57
|
+
*/
|
|
58
|
+
projectRoots: readonly string[];
|
|
59
|
+
/**
|
|
60
|
+
* The build and artifact directories of the workspaces that the plugin
|
|
61
|
+
* knows, inside the repository ({@link knownCargoDirectories}); by default
|
|
62
|
+
* those of the crate's workspace.
|
|
63
|
+
*/
|
|
64
|
+
cargoDirectories?: readonly string[];
|
|
65
|
+
/**
|
|
66
|
+
* How a segment of a pattern is matched against a folder's name; by
|
|
67
|
+
* default as Nx matches it ({@link nxSegmentMatcher}).
|
|
68
|
+
*/
|
|
69
|
+
matches?: SegmentMatcher;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Turns the `fileInputs` patterns of a crate's tables into the filesets of
|
|
73
|
+
* `DES-INPUTS` ("Declared files"): each pattern resolved against the folder
|
|
74
|
+
* of the manifest that holds it, as `{workspaceRoot}/<path>` with
|
|
75
|
+
* `includeIgnored`, so that Nx hashes a declared file that Git ignores.
|
|
76
|
+
*
|
|
77
|
+
* Nx fails the hash of every task whose `includeIgnored` fileset has a `.`
|
|
78
|
+
* or `..` segment, so the pattern's fixed part, its segments before the
|
|
79
|
+
* first one with a glob character, is resolved here as the system resolves
|
|
80
|
+
* it, the symbolic links in it included. Nx keeps the hash of a link to a
|
|
81
|
+
* file until the link itself changes, and matches changed files by their
|
|
82
|
+
* own paths (`EVD-NX-24-FILE-INPUTS`). The pattern therefore gives a
|
|
83
|
+
* fileset for each link that its fixed part passes, at the path where the
|
|
84
|
+
* link itself lies, so that a change to the link is seen, and one for the
|
|
85
|
+
* real path with the rest of the pattern, so that a change to what the
|
|
86
|
+
* links lead to is seen. A link that only the glob part reaches stays as it
|
|
87
|
+
* is.
|
|
88
|
+
*
|
|
89
|
+
* Each alternative of the pattern's braces counts as a pattern of its own
|
|
90
|
+
* from here on, as Nx reads a fileset whose braces hold names, also for the
|
|
91
|
+
* braces that Nx leaves to its glob: each gets its own fixed part, links and
|
|
92
|
+
* filesets (`DES-INPUTS`, "Patterns over project folders"). A pattern that
|
|
93
|
+
* names folders counts everything below them ({@link namesFolders}): Nx does
|
|
94
|
+
* so for a path without a glob, and for a glob the pattern also gives the
|
|
95
|
+
* fileset with `/**` after it.
|
|
96
|
+
*
|
|
97
|
+
* Nx matches an `includeIgnored` fileset only against the files of the
|
|
98
|
+
* deepest project whose folder holds the folder it is read from, and not
|
|
99
|
+
* against those of a project in a folder below it; one that no project's
|
|
100
|
+
* folder holds, other than the repository root's, against every file
|
|
101
|
+
* (`EVD-NX-24-FILESET-SCOPE`). For each folder of a project of `scope` below
|
|
102
|
+
* that folder, the pattern therefore also gives a fileset that starts in
|
|
103
|
+
* that folder and names the files below it that the pattern names, matched
|
|
104
|
+
* as Nx matches them ({@link patternsBelow}), so that Nx counts them for the
|
|
105
|
+
* project that holds them. Projects of other plugins and entries are checked
|
|
106
|
+
* in `createDependencies` ({@link failOnUncoveredProjectFolders}). None of
|
|
107
|
+
* this depends on which files exist.
|
|
108
|
+
*
|
|
109
|
+
* Each of these is a problem that names the manifest and the pattern
|
|
110
|
+
* (`REQ-FILE-INPUTS-HASHABLE`): a `..` after a glob character, which could
|
|
111
|
+
* lead anywhere and fails Nx's hash; a real path outside the repository, or
|
|
112
|
+
* a link outside it that the fixed part passes; and a real path in the
|
|
113
|
+
* build or artifact directory of the crate's workspace. Nx hashes no file
|
|
114
|
+
* that a fileset names by a path that leaves the repository, and
|
|
115
|
+
* `nx affected` sees no change to a file outside it, so the message for
|
|
116
|
+
* such a pattern points to `runtimeInputs`.
|
|
117
|
+
*
|
|
118
|
+
* @param fileInputs The patterns of both tables, each with its manifest relative to the repository root.
|
|
119
|
+
* @param workspace The crate's workspace, whose Cargo directories no pattern may point into.
|
|
120
|
+
* @param repositoryRoot The absolute path of the repository root.
|
|
121
|
+
* @param scope The crate and the folders of the projects of the plugin's entry.
|
|
122
|
+
*/
|
|
123
|
+
export declare function declaredFiles(fileInputs: readonly FileInput[], workspace: Pick<CargoWorkspace, "root" | "report">, repositoryRoot: string, scope: DeclaredScope): DeclaredFiles;
|
|
124
|
+
/**
|
|
125
|
+
* The build and artifact directories of every workspace that `discovery`
|
|
126
|
+
* reports, those of the crates without a project included, that lie inside
|
|
127
|
+
* the repository, as real paths relative to its root.
|
|
128
|
+
*/
|
|
129
|
+
export declare function knownCargoDirectories(discovery: Pick<CargoDiscovery, "workspaceRoot" | "workspaces" | "pathDependencyReports">): string[];
|
|
130
|
+
/**
|
|
131
|
+
* Whether a pattern names folders, so that it counts everything below them:
|
|
132
|
+
* where it ends in `/`, or its last segment is a name, which may be a
|
|
133
|
+
* folder's as well as a file's. A pattern whose last segment is a glob, such
|
|
134
|
+
* as `*` or `*.proto`, names files only, as Nx reads it.
|
|
135
|
+
*/
|
|
136
|
+
export declare function namesFolders(pattern: string): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* The folders of the projects that the plugin's entry creates for the
|
|
139
|
+
* workspaces of `discovery`, relative to the repository root, without the
|
|
140
|
+
* root itself: each member's folder, and the folder of each root manifest
|
|
141
|
+
* that Nx hands to the plugin (`inferProjects` in `projects.ts`).
|
|
142
|
+
*/
|
|
143
|
+
export declare function pluginProjectRoots(discovery: Pick<CargoDiscovery, "workspaceRoot" | "workspaces">): string[];
|
|
144
|
+
/**
|
|
145
|
+
* Fails when a `fileInputs` pattern names files in the folder of a project
|
|
146
|
+
* that none of its crate's filesets covers, once Nx has merged the projects
|
|
147
|
+
* of every plugin and entry.
|
|
148
|
+
*
|
|
149
|
+
* Nx matches an `includeIgnored` fileset only against the files of the
|
|
150
|
+
* deepest project whose folder holds the folder that the fileset is read
|
|
151
|
+
* from, and leaves out the projects in folders below it
|
|
152
|
+
* (`EVD-NX-24-FILESET-SCOPE`). `declaredFiles` adds a fileset for each folder
|
|
153
|
+
* of the entry's own projects there, but projects that other plugins or
|
|
154
|
+
* entries create are known only here. For each project in a folder below
|
|
155
|
+
* the fixed part of a pattern that a project's folder holds, the files that
|
|
156
|
+
* the pattern names there count only where the crate's filesets hold the
|
|
157
|
+
* fileset that `declaredFiles` would give that folder, or one for the whole
|
|
158
|
+
* folder, as a pattern that the repository adds does. Otherwise the message
|
|
159
|
+
* gives that fileset as a pattern relative to the manifest. Each alternative
|
|
160
|
+
* of a pattern's braces is checked on its own, and its segments are matched
|
|
161
|
+
* against the folders' names as Nx matches them, so that a folder that the
|
|
162
|
+
* pattern does not reach fails nothing.
|
|
163
|
+
*
|
|
164
|
+
* @param patterns The patterns of the entry's projects and of the crates
|
|
165
|
+
* whose folders their inputs name ({@link DeclaredFiles.patterns}).
|
|
166
|
+
* @param projects The merged projects that `createDependencies` receives.
|
|
167
|
+
* @param matches How a segment is matched against a folder's name ({@link nxSegmentMatcher}).
|
|
168
|
+
* @throws {Error} Naming the manifest, the pattern, its crates and the
|
|
169
|
+
* project for each folder, with the patterns that would cover it.
|
|
170
|
+
*/
|
|
171
|
+
export declare function failOnUncoveredProjectFolders(patterns: readonly DeclaredPattern[], projects: CreateDependenciesContext["projects"], matches: SegmentMatcher): void;
|
|
172
|
+
/**
|
|
173
|
+
* The patterns, relative to a folder below the one that a pattern starts in,
|
|
174
|
+
* for the files below that folder that the rest of the pattern names: `**`
|
|
175
|
+
* where the pattern names everything below it, as a pattern without a glob,
|
|
176
|
+
* or one that names folders and names that folder or one above it, does;
|
|
177
|
+
* none where it names nothing there.
|
|
178
|
+
*
|
|
179
|
+
* The rest has no braces left ({@link braceAlternatives}). Its segments are
|
|
180
|
+
* matched against the names of the folders in between with `matches`, a
|
|
181
|
+
* `**` standing for any number of them.
|
|
182
|
+
*
|
|
183
|
+
* @param glob The rest of the pattern after the folder it starts in, `""` for none.
|
|
184
|
+
* @param names The names of the folders from that folder down to the folder below it.
|
|
185
|
+
* @param options Whether the pattern names folders ({@link namesFolders}), and how a segment is matched.
|
|
186
|
+
*/
|
|
187
|
+
export declare function patternsBelow(glob: string, names: readonly string[], options: {
|
|
188
|
+
folders: boolean;
|
|
189
|
+
matches: SegmentMatcher;
|
|
190
|
+
}): string[];
|