@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.
Files changed (418) hide show
  1. package/LICENSE-APACHE +201 -0
  2. package/LICENSE-MIT +21 -0
  3. package/PLUGIN.md +106 -0
  4. package/README.md +51 -1
  5. package/docs/artifacts.mara.md +374 -0
  6. package/docs/caching.mara.md +999 -0
  7. package/docs/ci.mara.md +308 -0
  8. package/docs/configuration.mara.md +508 -0
  9. package/docs/decisions.mara.md +3267 -0
  10. package/docs/execution.mara.md +533 -0
  11. package/docs/index.mara.md +51 -0
  12. package/docs/product.mara.md +366 -0
  13. package/docs/release.mara.md +493 -0
  14. package/docs/setup.mara.md +486 -0
  15. package/docs/targets.mara.md +704 -0
  16. package/docs/testing.mara.md +431 -0
  17. package/docs/verification.mara.md +465 -0
  18. package/docs/workspaces.mara.md +445 -0
  19. package/executors.json +35 -0
  20. package/generators.json +19 -0
  21. package/package.json +17 -4
  22. package/src/cargo/build-settings.d.ts +61 -0
  23. package/src/cargo/build-settings.js +103 -0
  24. package/src/cargo/build-settings.js.map +1 -0
  25. package/src/cargo/configured-runner.d.ts +36 -0
  26. package/src/cargo/configured-runner.js +99 -0
  27. package/src/cargo/configured-runner.js.map +1 -0
  28. package/src/cargo/configured-tools.d.ts +35 -0
  29. package/src/cargo/configured-tools.js +46 -0
  30. package/src/cargo/configured-tools.js.map +1 -0
  31. package/src/cargo/dep-info-basedir.d.ts +18 -0
  32. package/src/cargo/dep-info-basedir.js +38 -0
  33. package/src/cargo/dep-info-basedir.js.map +1 -0
  34. package/src/cargo/directories.d.ts +40 -0
  35. package/src/cargo/directories.js +89 -0
  36. package/src/cargo/directories.js.map +1 -0
  37. package/src/cargo/host-triple.d.ts +7 -0
  38. package/src/cargo/host-triple.js +21 -0
  39. package/src/cargo/host-triple.js.map +1 -0
  40. package/src/cargo/lockfile.d.ts +63 -0
  41. package/src/cargo/lockfile.js +157 -0
  42. package/src/cargo/lockfile.js.map +1 -0
  43. package/src/cargo/metadata.d.ts +114 -0
  44. package/src/cargo/metadata.js +37 -0
  45. package/src/cargo/metadata.js.map +1 -0
  46. package/src/cargo/package-specs.d.ts +54 -0
  47. package/src/cargo/package-specs.js +109 -0
  48. package/src/cargo/package-specs.js.map +1 -0
  49. package/src/cargo/paths-crates.d.ts +27 -0
  50. package/src/cargo/paths-crates.js +69 -0
  51. package/src/cargo/paths-crates.js.map +1 -0
  52. package/src/cargo/print-artifact-folders.d.ts +1 -0
  53. package/src/cargo/print-artifact-folders.js +58 -0
  54. package/src/cargo/print-artifact-folders.js.map +1 -0
  55. package/src/cargo/redirections.d.ts +90 -0
  56. package/src/cargo/redirections.js +200 -0
  57. package/src/cargo/redirections.js.map +1 -0
  58. package/src/cargo/run-cargo.d.ts +31 -0
  59. package/src/cargo/run-cargo.js +75 -0
  60. package/src/cargo/run-cargo.js.map +1 -0
  61. package/src/cargo/target-triples.d.ts +98 -0
  62. package/src/cargo/target-triples.js +265 -0
  63. package/src/cargo/target-triples.js.map +1 -0
  64. package/src/cargo/version-req.d.ts +12 -0
  65. package/src/cargo/version-req.js +122 -0
  66. package/src/cargo/version-req.js.map +1 -0
  67. package/src/cargo/warnings-setting.d.ts +24 -0
  68. package/src/cargo/warnings-setting.js +81 -0
  69. package/src/cargo/warnings-setting.js.map +1 -0
  70. package/src/compatibility/cargo-version.d.ts +43 -0
  71. package/src/compatibility/cargo-version.js +83 -0
  72. package/src/compatibility/cargo-version.js.map +1 -0
  73. package/src/compatibility/nx-bridge.d.ts +312 -0
  74. package/src/compatibility/nx-bridge.js +407 -0
  75. package/src/compatibility/nx-bridge.js.map +1 -0
  76. package/src/compatibility/nx-version.d.ts +104 -0
  77. package/src/compatibility/nx-version.js +272 -0
  78. package/src/compatibility/nx-version.js.map +1 -0
  79. package/src/executors/affected-inputs.d.ts +29 -0
  80. package/src/executors/affected-inputs.js +259 -0
  81. package/src/executors/affected-inputs.js.map +1 -0
  82. package/src/executors/affected-run.d.ts +54 -0
  83. package/src/executors/affected-run.js +394 -0
  84. package/src/executors/affected-run.js.map +1 -0
  85. package/src/executors/affected.d.ts +239 -0
  86. package/src/executors/affected.js +589 -0
  87. package/src/executors/affected.js.map +1 -0
  88. package/src/executors/baseline-context.d.ts +85 -0
  89. package/src/executors/baseline-context.js +227 -0
  90. package/src/executors/baseline-context.js.map +1 -0
  91. package/src/executors/baseline.d.ts +123 -0
  92. package/src/executors/baseline.js +356 -0
  93. package/src/executors/baseline.js.map +1 -0
  94. package/src/executors/batch.d.ts +75 -0
  95. package/src/executors/batch.js +434 -0
  96. package/src/executors/batch.js.map +1 -0
  97. package/src/executors/build-records.d.ts +110 -0
  98. package/src/executors/build-records.js +267 -0
  99. package/src/executors/build-records.js.map +1 -0
  100. package/src/executors/cargo/executor.d.ts +28 -0
  101. package/src/executors/cargo/executor.js +58 -0
  102. package/src/executors/cargo/executor.js.map +1 -0
  103. package/src/executors/cargo/schema.json +58 -0
  104. package/src/executors/cargo-invocation.d.ts +81 -0
  105. package/src/executors/cargo-invocation.js +109 -0
  106. package/src/executors/cargo-invocation.js.map +1 -0
  107. package/src/executors/cargo-output.d.ts +218 -0
  108. package/src/executors/cargo-output.js +660 -0
  109. package/src/executors/cargo-output.js.map +1 -0
  110. package/src/executors/command.d.ts +331 -0
  111. package/src/executors/command.js +547 -0
  112. package/src/executors/command.js.map +1 -0
  113. package/src/executors/coverage-baseline.d.ts +23 -0
  114. package/src/executors/coverage-baseline.js +284 -0
  115. package/src/executors/coverage-baseline.js.map +1 -0
  116. package/src/executors/declared-options.d.ts +21 -0
  117. package/src/executors/declared-options.js +58 -0
  118. package/src/executors/declared-options.js.map +1 -0
  119. package/src/executors/denied-warnings.d.ts +99 -0
  120. package/src/executors/denied-warnings.js +188 -0
  121. package/src/executors/denied-warnings.js.map +1 -0
  122. package/src/executors/digests.d.ts +94 -0
  123. package/src/executors/digests.js +190 -0
  124. package/src/executors/digests.js.map +1 -0
  125. package/src/executors/dotenv-check.d.ts +79 -0
  126. package/src/executors/dotenv-check.js +553 -0
  127. package/src/executors/dotenv-check.js.map +1 -0
  128. package/src/executors/group-invocations.d.ts +80 -0
  129. package/src/executors/group-invocations.js +253 -0
  130. package/src/executors/group-invocations.js.map +1 -0
  131. package/src/executors/group-run.d.ts +114 -0
  132. package/src/executors/group-run.js +601 -0
  133. package/src/executors/group-run.js.map +1 -0
  134. package/src/executors/groups.d.ts +118 -0
  135. package/src/executors/groups.js +304 -0
  136. package/src/executors/groups.js.map +1 -0
  137. package/src/executors/input-check.d.ts +52 -0
  138. package/src/executors/input-check.js +271 -0
  139. package/src/executors/input-check.js.map +1 -0
  140. package/src/executors/kept-files.d.ts +98 -0
  141. package/src/executors/kept-files.js +341 -0
  142. package/src/executors/kept-files.js.map +1 -0
  143. package/src/executors/lockfile/executor.d.ts +16 -0
  144. package/src/executors/lockfile/executor.js +37 -0
  145. package/src/executors/lockfile/executor.js.map +1 -0
  146. package/src/executors/lockfile/schema.json +50 -0
  147. package/src/executors/napi-build.d.ts +73 -0
  148. package/src/executors/napi-build.js +420 -0
  149. package/src/executors/napi-build.js.map +1 -0
  150. package/src/executors/nextest.d.ts +189 -0
  151. package/src/executors/nextest.js +504 -0
  152. package/src/executors/nextest.js.map +1 -0
  153. package/src/executors/nx-command.d.ts +95 -0
  154. package/src/executors/nx-command.js +205 -0
  155. package/src/executors/nx-command.js.map +1 -0
  156. package/src/executors/nx-task-files.d.ts +82 -0
  157. package/src/executors/nx-task-files.js +156 -0
  158. package/src/executors/nx-task-files.js.map +1 -0
  159. package/src/executors/print-test-mode.d.ts +1 -0
  160. package/src/executors/print-test-mode.js +25 -0
  161. package/src/executors/print-test-mode.js.map +1 -0
  162. package/src/executors/release-publish/executor.d.ts +24 -0
  163. package/src/executors/release-publish/executor.js +165 -0
  164. package/src/executors/release-publish/executor.js.map +1 -0
  165. package/src/executors/release-publish/schema.json +30 -0
  166. package/src/executors/run/executor.d.ts +12 -0
  167. package/src/executors/run/executor.js +27 -0
  168. package/src/executors/run/executor.js.map +1 -0
  169. package/src/executors/run/schema.json +45 -0
  170. package/src/executors/runner-script.d.ts +12 -0
  171. package/src/executors/runner-script.js +22 -0
  172. package/src/executors/runner-script.js.map +1 -0
  173. package/src/executors/runtime-input-check.d.ts +24 -0
  174. package/src/executors/runtime-input-check.js +87 -0
  175. package/src/executors/runtime-input-check.js.map +1 -0
  176. package/src/executors/shared-artifacts.d.ts +44 -0
  177. package/src/executors/shared-artifacts.js +132 -0
  178. package/src/executors/shared-artifacts.js.map +1 -0
  179. package/src/executors/split-words.d.ts +24 -0
  180. package/src/executors/split-words.js +111 -0
  181. package/src/executors/split-words.js.map +1 -0
  182. package/src/executors/stage.d.ts +163 -0
  183. package/src/executors/stage.js +526 -0
  184. package/src/executors/stage.js.map +1 -0
  185. package/src/executors/staged-run.d.ts +24 -0
  186. package/src/executors/staged-run.js +110 -0
  187. package/src/executors/staged-run.js.map +1 -0
  188. package/src/executors/task-env.d.ts +271 -0
  189. package/src/executors/task-env.js +494 -0
  190. package/src/executors/task-env.js.map +1 -0
  191. package/src/executors/task-execution.d.ts +61 -0
  192. package/src/executors/task-execution.js +122 -0
  193. package/src/executors/task-execution.js.map +1 -0
  194. package/src/executors/task-guards.d.ts +112 -0
  195. package/src/executors/task-guards.js +435 -0
  196. package/src/executors/task-guards.js.map +1 -0
  197. package/src/executors/task-options.d.ts +114 -0
  198. package/src/executors/task-options.js +258 -0
  199. package/src/executors/task-options.js.map +1 -0
  200. package/src/executors/task.d.ts +166 -0
  201. package/src/executors/task.js +527 -0
  202. package/src/executors/task.js.map +1 -0
  203. package/src/executors/test-mode.d.ts +185 -0
  204. package/src/executors/test-mode.js +397 -0
  205. package/src/executors/test-mode.js.map +1 -0
  206. package/src/executors/test-runner.d.ts +44 -0
  207. package/src/executors/test-runner.js +159 -0
  208. package/src/executors/test-runner.js.map +1 -0
  209. package/src/executors/test-steps.d.ts +121 -0
  210. package/src/executors/test-steps.js +566 -0
  211. package/src/executors/test-steps.js.map +1 -0
  212. package/src/executors/wasm-build.d.ts +56 -0
  213. package/src/executors/wasm-build.js +216 -0
  214. package/src/executors/wasm-build.js.map +1 -0
  215. package/src/generators/crate/binary.schema.json +28 -0
  216. package/src/generators/crate/crate.d.ts +24 -0
  217. package/src/generators/crate/crate.js +108 -0
  218. package/src/generators/crate/crate.js.map +1 -0
  219. package/src/generators/crate/enclosing-workspace.d.ts +25 -0
  220. package/src/generators/crate/enclosing-workspace.js +58 -0
  221. package/src/generators/crate/enclosing-workspace.js.map +1 -0
  222. package/src/generators/crate/library.schema.json +28 -0
  223. package/src/generators/init/graph-check.d.ts +81 -0
  224. package/src/generators/init/graph-check.js +299 -0
  225. package/src/generators/init/graph-check.js.map +1 -0
  226. package/src/generators/init/init.d.ts +23 -0
  227. package/src/generators/init/init.js +113 -0
  228. package/src/generators/init/init.js.map +1 -0
  229. package/src/generators/init/report.d.ts +19 -0
  230. package/src/generators/init/report.js +93 -0
  231. package/src/generators/init/report.js.map +1 -0
  232. package/src/generators/init/schema.json +9 -0
  233. package/src/graph/artifact-kinds.d.ts +29 -0
  234. package/src/graph/artifact-kinds.js +50 -0
  235. package/src/graph/artifact-kinds.js.map +1 -0
  236. package/src/graph/artifact-names.d.ts +97 -0
  237. package/src/graph/artifact-names.js +276 -0
  238. package/src/graph/artifact-names.js.map +1 -0
  239. package/src/graph/build-records.d.ts +74 -0
  240. package/src/graph/build-records.js +104 -0
  241. package/src/graph/build-records.js.map +1 -0
  242. package/src/graph/caching.d.ts +148 -0
  243. package/src/graph/caching.js +681 -0
  244. package/src/graph/caching.js.map +1 -0
  245. package/src/graph/clippy-input.d.ts +53 -0
  246. package/src/graph/clippy-input.js +107 -0
  247. package/src/graph/clippy-input.js.map +1 -0
  248. package/src/graph/collisions.d.ts +113 -0
  249. package/src/graph/collisions.js +156 -0
  250. package/src/graph/collisions.js.map +1 -0
  251. package/src/graph/computation-reports.d.ts +89 -0
  252. package/src/graph/computation-reports.js +216 -0
  253. package/src/graph/computation-reports.js.map +1 -0
  254. package/src/graph/declared-files.d.ts +190 -0
  255. package/src/graph/declared-files.js +600 -0
  256. package/src/graph/declared-files.js.map +1 -0
  257. package/src/graph/discovery.d.ts +190 -0
  258. package/src/graph/discovery.js +661 -0
  259. package/src/graph/discovery.js.map +1 -0
  260. package/src/graph/edges.d.ts +25 -0
  261. package/src/graph/edges.js +94 -0
  262. package/src/graph/edges.js.map +1 -0
  263. package/src/graph/entries.d.ts +83 -0
  264. package/src/graph/entries.js +259 -0
  265. package/src/graph/entries.js.map +1 -0
  266. package/src/graph/inputs.d.ts +422 -0
  267. package/src/graph/inputs.js +756 -0
  268. package/src/graph/inputs.js.map +1 -0
  269. package/src/graph/lockfile-task.d.ts +74 -0
  270. package/src/graph/lockfile-task.js +105 -0
  271. package/src/graph/lockfile-task.js.map +1 -0
  272. package/src/graph/names.d.ts +41 -0
  273. package/src/graph/names.js +34 -0
  274. package/src/graph/names.js.map +1 -0
  275. package/src/graph/napi.d.ts +107 -0
  276. package/src/graph/napi.js +206 -0
  277. package/src/graph/napi.js.map +1 -0
  278. package/src/graph/nx-glob.d.ts +36 -0
  279. package/src/graph/nx-glob.js +152 -0
  280. package/src/graph/nx-glob.js.map +1 -0
  281. package/src/graph/nx-internals.d.ts +57 -0
  282. package/src/graph/nx-internals.js +128 -0
  283. package/src/graph/nx-internals.js.map +1 -0
  284. package/src/graph/options.d.ts +32 -0
  285. package/src/graph/options.js +80 -0
  286. package/src/graph/options.js.map +1 -0
  287. package/src/graph/outputs.d.ts +75 -0
  288. package/src/graph/outputs.js +140 -0
  289. package/src/graph/outputs.js.map +1 -0
  290. package/src/graph/path-dependencies.d.ts +122 -0
  291. package/src/graph/path-dependencies.js +459 -0
  292. package/src/graph/path-dependencies.js.map +1 -0
  293. package/src/graph/plugin-package.d.ts +36 -0
  294. package/src/graph/plugin-package.js +132 -0
  295. package/src/graph/plugin-package.js.map +1 -0
  296. package/src/graph/plugin-version.d.ts +20 -0
  297. package/src/graph/plugin-version.js +153 -0
  298. package/src/graph/plugin-version.js.map +1 -0
  299. package/src/graph/projects.d.ts +141 -0
  300. package/src/graph/projects.js +193 -0
  301. package/src/graph/projects.js.map +1 -0
  302. package/src/graph/reached-projects.d.ts +46 -0
  303. package/src/graph/reached-projects.js +102 -0
  304. package/src/graph/reached-projects.js.map +1 -0
  305. package/src/graph/real-path.d.ts +47 -0
  306. package/src/graph/real-path.js +113 -0
  307. package/src/graph/real-path.js.map +1 -0
  308. package/src/graph/redirected-uses.d.ts +98 -0
  309. package/src/graph/redirected-uses.js +434 -0
  310. package/src/graph/redirected-uses.js.map +1 -0
  311. package/src/graph/registration.d.ts +121 -0
  312. package/src/graph/registration.js +233 -0
  313. package/src/graph/registration.js.map +1 -0
  314. package/src/graph/rustfmt-config.d.ts +42 -0
  315. package/src/graph/rustfmt-config.js +173 -0
  316. package/src/graph/rustfmt-config.js.map +1 -0
  317. package/src/graph/script-input.d.ts +46 -0
  318. package/src/graph/script-input.js +65 -0
  319. package/src/graph/script-input.js.map +1 -0
  320. package/src/graph/settings.d.ts +178 -0
  321. package/src/graph/settings.js +479 -0
  322. package/src/graph/settings.js.map +1 -0
  323. package/src/graph/target-defaults-causes.d.ts +33 -0
  324. package/src/graph/target-defaults-causes.js +202 -0
  325. package/src/graph/target-defaults-causes.js.map +1 -0
  326. package/src/graph/target-defaults-layers.d.ts +186 -0
  327. package/src/graph/target-defaults-layers.js +420 -0
  328. package/src/graph/target-defaults-layers.js.map +1 -0
  329. package/src/graph/target-defaults-meaning.d.ts +95 -0
  330. package/src/graph/target-defaults-meaning.js +292 -0
  331. package/src/graph/target-defaults-meaning.js.map +1 -0
  332. package/src/graph/target-defaults-report.d.ts +77 -0
  333. package/src/graph/target-defaults-report.js +242 -0
  334. package/src/graph/target-defaults-report.js.map +1 -0
  335. package/src/graph/target-defaults.d.ts +79 -0
  336. package/src/graph/target-defaults.js +425 -0
  337. package/src/graph/target-defaults.js.map +1 -0
  338. package/src/graph/target-fields.d.ts +16 -0
  339. package/src/graph/target-fields.js +134 -0
  340. package/src/graph/target-fields.js.map +1 -0
  341. package/src/graph/target-tables.d.ts +45 -0
  342. package/src/graph/target-tables.js +299 -0
  343. package/src/graph/target-tables.js.map +1 -0
  344. package/src/graph/targets.d.ts +371 -0
  345. package/src/graph/targets.js +408 -0
  346. package/src/graph/targets.js.map +1 -0
  347. package/src/graph/unification.d.ts +141 -0
  348. package/src/graph/unification.js +459 -0
  349. package/src/graph/unification.js.map +1 -0
  350. package/src/graph/unignored-directories.d.ts +25 -0
  351. package/src/graph/unignored-directories.js +89 -0
  352. package/src/graph/unignored-directories.js.map +1 -0
  353. package/src/graph/visibility.d.ts +17 -0
  354. package/src/graph/visibility.js +67 -0
  355. package/src/graph/visibility.js.map +1 -0
  356. package/src/graph/warnings.d.ts +38 -0
  357. package/src/graph/warnings.js +77 -0
  358. package/src/graph/warnings.js.map +1 -0
  359. package/src/graph/wasm.d.ts +56 -0
  360. package/src/graph/wasm.js +77 -0
  361. package/src/graph/wasm.js.map +1 -0
  362. package/src/index.d.ts +68 -0
  363. package/src/index.js +109 -0
  364. package/src/index.js.map +1 -0
  365. package/src/release/manifests.d.ts +95 -0
  366. package/src/release/manifests.js +164 -0
  367. package/src/release/manifests.js.map +1 -0
  368. package/src/release/places.d.ts +127 -0
  369. package/src/release/places.js +368 -0
  370. package/src/release/places.js.map +1 -0
  371. package/src/release/publish-cargo.d.ts +177 -0
  372. package/src/release/publish-cargo.js +351 -0
  373. package/src/release/publish-cargo.js.map +1 -0
  374. package/src/release/publish-crates.d.ts +124 -0
  375. package/src/release/publish-crates.js +242 -0
  376. package/src/release/publish-crates.js.map +1 -0
  377. package/src/release/publish-environments.d.ts +50 -0
  378. package/src/release/publish-environments.js +284 -0
  379. package/src/release/publish-environments.js.map +1 -0
  380. package/src/release/publish-messages.d.ts +66 -0
  381. package/src/release/publish-messages.js +273 -0
  382. package/src/release/publish-messages.js.map +1 -0
  383. package/src/release/publish-registry.d.ts +27 -0
  384. package/src/release/publish-registry.js +135 -0
  385. package/src/release/publish-registry.js.map +1 -0
  386. package/src/release/publish-settings.d.ts +26 -0
  387. package/src/release/publish-settings.js +56 -0
  388. package/src/release/publish-settings.js.map +1 -0
  389. package/src/release/publish.d.ts +59 -0
  390. package/src/release/publish.js +620 -0
  391. package/src/release/publish.js.map +1 -0
  392. package/src/release/repository.d.ts +73 -0
  393. package/src/release/repository.js +219 -0
  394. package/src/release/repository.js.map +1 -0
  395. package/src/release/requirements.d.ts +34 -0
  396. package/src/release/requirements.js +30 -0
  397. package/src/release/requirements.js.map +1 -0
  398. package/src/release/toml-edit.d.ts +67 -0
  399. package/src/release/toml-edit.js +453 -0
  400. package/src/release/toml-edit.js.map +1 -0
  401. package/src/release/version-actions.d.ts +133 -0
  402. package/src/release/version-actions.js +474 -0
  403. package/src/release/version-actions.js.map +1 -0
  404. package/src/release/version-checks.d.ts +21 -0
  405. package/src/release/version-checks.js +151 -0
  406. package/src/release/version-checks.js.map +1 -0
  407. package/src/release/version-lockfiles.d.ts +61 -0
  408. package/src/release/version-lockfiles.js +222 -0
  409. package/src/release/version-lockfiles.js.map +1 -0
  410. package/src/tools/napi-cli.d.ts +70 -0
  411. package/src/tools/napi-cli.js +63 -0
  412. package/src/tools/napi-cli.js.map +1 -0
  413. package/src/tools/optional-tools.d.ts +121 -0
  414. package/src/tools/optional-tools.js +303 -0
  415. package/src/tools/optional-tools.js.map +1 -0
  416. package/src/tools/print-napi-cli.d.ts +1 -0
  417. package/src/tools/print-napi-cli.js +24 -0
  418. package/src/tools/print-napi-cli.js.map +1 -0
@@ -0,0 +1,434 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.redirectedUses = redirectedUses;
4
+ const node_fs_1 = require("node:fs");
5
+ const node_path_1 = require("node:path");
6
+ const version_req_1 = require("../cargo/version-req");
7
+ const reached_projects_1 = require("./reached-projects");
8
+ const real_path_1 = require("./real-path");
9
+ /**
10
+ * The crates that the members of each workspace use, or may use, through the
11
+ * workspace's redirections (DES-PROJECT-GRAPH).
12
+ *
13
+ * - Behind a redirected crate without a project, the member uses each crate
14
+ * with a project that cargo builds with it, through its normal and build
15
+ * path dependencies and any number of crates without a project
16
+ * ({@link projectsBehindDependency}), with the kind of its use of the
17
+ * redirected crate. Each such use weighs as a use of that kind of a
18
+ * redirected crate with a project, below.
19
+ * - A direct use is always an edge, cycles included, as for a path
20
+ * dependency.
21
+ * - A member with a registry or git dependency, of its own or of a path
22
+ * crate it reaches through normal or build dependencies, may use every
23
+ * other redirected crate. Its edge is left out where that crate already
24
+ * reaches the member through real dependencies of kind normal or build:
25
+ * path dependencies and direct redirections. Cargo would reject such a
26
+ * use as a cycle.
27
+ * - Two redirected crates that may only possibly use each other get no edge
28
+ * either way: cargo can have at most one of them, and which one is not
29
+ * known.
30
+ * - A member that has no such dependency that a report shows, but reaches
31
+ * a path crate without a report, may use every other redirected crate as
32
+ * well: an assumed use, the weakest kind, which never removes or weakens
33
+ * another edge. Its own edge is left out where the redirected crate
34
+ * reaches the member through real dependencies of kind normal or build,
35
+ * and where any other edge between the two projects points the opposite
36
+ * way: a path dependency, also one through crates without a project
37
+ * ({@link projectsReachedByPath}), a direct, possible or other assumed
38
+ * use.
39
+ *
40
+ * A use of a crate with a project whose edge is left out brings, in
41
+ * {@link RedirectedUse.brings}, what the edge would have brought: the crate
42
+ * and every crate that cargo builds with it ({@link broughtFolders}).
43
+ *
44
+ * A requirement that the plugin cannot evaluate, or a source it cannot
45
+ * match to the entry, makes a declaration possible, not direct.
46
+ *
47
+ * @param projectRoots The roots of the projects that Nx knows, relative to
48
+ * the repository root.
49
+ */
50
+ // @mara implements DES-PROJECT-GRAPH
51
+ function redirectedUses(graph, projectRoots) {
52
+ realPaths = new Map();
53
+ const { workspaceRoot } = graph.discovery;
54
+ const known = (0, reached_projects_1.knownPackages)(graph, realPath);
55
+ // The root folders whose report shows a virtual manifest: no crate lies
56
+ // there, although a workspace project may.
57
+ const virtualRoots = new Set([
58
+ ...graph.discovery.workspaces.map((workspace) => workspace.report),
59
+ ...graph.discovery.pathDependencyReports.map((entry) => entry.report),
60
+ ]
61
+ .map((report) => realPath(report.workspace_root))
62
+ .filter((folder) => !known.has(folder)));
63
+ const rootByFolder = new Map();
64
+ for (const root of projectRoots) {
65
+ const folder = realPath((0, node_path_1.join)(workspaceRoot, root));
66
+ if (!rootByFolder.has(folder)) {
67
+ rootByFolder.set(folder, root);
68
+ }
69
+ }
70
+ const uses = [];
71
+ // How cargo resolves a dependency in each workspace that redirects.
72
+ const resolvers = new Map();
73
+ for (const workspace of graph.discovery.workspaces) {
74
+ if (workspace.redirections.length > 0) {
75
+ const found = workspaceUses(workspace, known, rootByFolder, virtualRoots);
76
+ uses.push(...found.uses);
77
+ resolvers.set(workspace, found.resolved);
78
+ }
79
+ }
80
+ // An assumed use gives way to every other edge in the opposite direction.
81
+ const edges = new Set(uses.filter((use) => use.edge).map((use) => pair(folderOf(use.member), use.folder)));
82
+ const hasProject = (folder) => rootByFolder.has(folder);
83
+ for (const use of uses) {
84
+ if (use.kind === "assumed" &&
85
+ use.edge &&
86
+ (edges.has(pair(use.folder, folderOf(use.member))) ||
87
+ reachesByPath(known.get(use.folder), folderOf(use.member), hasProject, known))) {
88
+ use.edge = false;
89
+ }
90
+ }
91
+ for (const use of uses) {
92
+ if (!use.edge && use.projectRoot !== undefined) {
93
+ use.brings = broughtFolders(use.folder, folderOf(use.member), known, resolvers.get(use.workspace));
94
+ }
95
+ }
96
+ return uses;
97
+ }
98
+ /**
99
+ * The crates whose files a member's targets get in place of a left-out edge
100
+ * to the crate with a project in `folder` (DES-INPUTS, "Redirected crates"):
101
+ * what the edge would have brought through `^` inputs, by the real paths of
102
+ * their folders. That is the crate itself and every crate that it reaches
103
+ * through dependencies of kind normal or build, to any depth, with or
104
+ * without a project: path dependencies, matched by real folder, and the
105
+ * dependencies that a redirection of the member's workspace resolves
106
+ * directly, since cargo builds the crate for the member in that workspace.
107
+ * Cargo builds the dev-dependencies of none of them for the member.
108
+ *
109
+ * The walk ends at the member, which is never among them, so that it stops
110
+ * where a cycle would lead back to the member and on to the crates that
111
+ * depend on it; at a crate it has met before; and at a crate that no report
112
+ * describes, whose folder counts alone because what it depends on is not
113
+ * known. Registry and git crates that a crate on the way depends on are no
114
+ * folders: the member's lockfile digest covers them (DES-LOCKFILE-HASHING).
115
+ */
116
+ function broughtFolders(folder, member, known, resolved) {
117
+ const folders = [folder];
118
+ const visited = new Set([member, folder]);
119
+ const start = known.get(folder);
120
+ const queue = start === undefined ? [] : [start];
121
+ while (queue.length > 0) {
122
+ const pkg = queue.shift();
123
+ for (const dependency of pkg.dependencies) {
124
+ if (dependency.kind === "dev") {
125
+ continue;
126
+ }
127
+ const next = typeof dependency.path === "string"
128
+ ? [realPath(dependency.path)]
129
+ : resolved(dependency).map((target) => folderOf(target));
130
+ for (const reached of next) {
131
+ if (visited.has(reached)) {
132
+ continue;
133
+ }
134
+ visited.add(reached);
135
+ folders.push(reached);
136
+ const behind = known.get(reached);
137
+ if (behind !== undefined) {
138
+ queue.push(behind);
139
+ }
140
+ }
141
+ }
142
+ }
143
+ return folders;
144
+ }
145
+ // Whether `pkg` has an edge to the crate in `folder`, which has a project,
146
+ // through its path dependencies: directly, or through crates without a
147
+ // project.
148
+ function reachesByPath(pkg, folder, hasProject, known) {
149
+ return (pkg !== undefined && (0, reached_projects_1.projectsReachedByPath)(pkg, hasProject, known, realPath).includes(folder));
150
+ }
151
+ function pair(from, to) {
152
+ return JSON.stringify([from, to]);
153
+ }
154
+ // How strong each kind of use is: a member that uses a crate in two ways
155
+ // uses it in the stronger.
156
+ const strength = { assumed: 0, possible: 1, direct: 2 };
157
+ function workspaceUses(workspace, known, rootByFolder, virtualRoots) {
158
+ var _a, _b;
159
+ const targets = redirectedCrates(workspace, known, rootByFolder, virtualRoots);
160
+ const byName = new Map();
161
+ for (const target of targets.values()) {
162
+ if (target.pkg) {
163
+ byName.set(target.pkg.name, [...((_a = byName.get(target.pkg.name)) !== null && _a !== void 0 ? _a : []), target]);
164
+ }
165
+ }
166
+ // The crates that cargo resolves a dependency to, in this workspace.
167
+ const resolved = (dependency) => {
168
+ var _a;
169
+ if (typeof dependency.path === "string") {
170
+ const pkg = known.get(realPath(dependency.path));
171
+ return pkg ? [pkg] : [];
172
+ }
173
+ return ((_a = byName.get(dependency.name)) !== null && _a !== void 0 ? _a : [])
174
+ .filter((target) => redirects(target, dependency))
175
+ .map((target) => target.pkg);
176
+ };
177
+ // The crates with a project behind each redirected crate without one, by
178
+ // the redirected crate's folder.
179
+ const hasProject = (folder) => rootByFolder.has(folder);
180
+ const behind = new Map();
181
+ for (const target of targets.values()) {
182
+ if (target.projectRoot === undefined && target.pkg !== undefined) {
183
+ behind.set(target.folder, (0, reached_projects_1.projectsBehindDependency)(target.pkg, hasProject, known, realPath));
184
+ }
185
+ }
186
+ const members = new Set(workspace.members.map((pkg) => folderOf(pkg)));
187
+ const uses = [];
188
+ for (const member of workspace.members) {
189
+ const own = folderOf(member);
190
+ const direct = directTargets(member, own, members, targets, resolved);
191
+ const external = reachesExternal(member, known);
192
+ // The member's strongest use of each crate, by its folder.
193
+ const used = new Map();
194
+ const use = (folder, kind, projectRoot) => {
195
+ const earlier = used.get(folder);
196
+ if (folder !== own && (earlier === undefined || strength[kind] > strength[earlier.kind])) {
197
+ used.set(folder, {
198
+ member,
199
+ workspace,
200
+ folder,
201
+ projectRoot,
202
+ reported: known.has(folder),
203
+ kind,
204
+ });
205
+ }
206
+ };
207
+ for (const target of targets.values()) {
208
+ const kind = direct.has(target.folder) ? "direct" : external;
209
+ if (target.folder === own || kind === undefined) {
210
+ continue;
211
+ }
212
+ use(target.folder, kind, target.projectRoot);
213
+ for (const folder of (_b = behind.get(target.folder)) !== null && _b !== void 0 ? _b : []) {
214
+ use(folder, kind, rootByFolder.get(folder));
215
+ }
216
+ }
217
+ for (const found of used.values()) {
218
+ const pkg = known.get(found.folder);
219
+ const cycle = found.kind !== "direct" && pkg !== undefined && reaches(pkg, own, resolved);
220
+ uses.push(Object.assign(Object.assign({}, found), { edge: found.projectRoot !== undefined && !cycle }));
221
+ }
222
+ }
223
+ // Two crates that may only possibly use each other.
224
+ const possible = new Set(uses
225
+ .filter((use) => use.kind === "possible" && use.edge)
226
+ .map((use) => JSON.stringify([folderOf(use.member), use.folder])));
227
+ for (const use of uses) {
228
+ if (use.kind === "possible" &&
229
+ use.edge &&
230
+ possible.has(JSON.stringify([use.folder, folderOf(use.member)]))) {
231
+ use.edge = false;
232
+ }
233
+ }
234
+ return { uses, resolved };
235
+ }
236
+ // The crates that the workspace's entries name, by real folder: the crate
237
+ // of a `[patch]` or `[replace]` entry; for a `paths` entry, every crate at
238
+ // or below its folder that a report describes or that has a project, but
239
+ // no folder whose report shows a virtual manifest (`virtualRoots`), whose
240
+ // project is a workspace project, and every crate that discovery says the
241
+ // entry can redirect to (`CargoWorkspace.pathsCrates`): those that cargo
242
+ // finds below the folder and their path dependencies of every kind, inside
243
+ // or outside the folder, with or without a report; or that folder itself
244
+ // where it holds none.
245
+ function redirectedCrates(workspace, known, rootByFolder, virtualRoots) {
246
+ var _a, _b;
247
+ const targets = new Map();
248
+ const add = (folder, redirection) => {
249
+ var _a;
250
+ const target = (_a = targets.get(folder)) !== null && _a !== void 0 ? _a : {
251
+ folder,
252
+ projectRoot: rootByFolder.get(folder),
253
+ pkg: known.get(folder),
254
+ redirections: [],
255
+ };
256
+ target.redirections.push(redirection);
257
+ targets.set(folder, target);
258
+ };
259
+ for (const redirection of workspace.redirections) {
260
+ const folder = realPath(redirection.folder);
261
+ if (redirection.table !== "paths") {
262
+ if ((0, node_fs_1.existsSync)((0, node_path_1.join)(folder, "Cargo.toml"))) {
263
+ add(folder, redirection);
264
+ }
265
+ continue;
266
+ }
267
+ if (!(0, node_fs_1.existsSync)(folder)) {
268
+ continue;
269
+ }
270
+ const crates = [
271
+ ...new Set([
272
+ ...[...new Set([...known.keys(), ...rootByFolder.keys()])].filter((candidate) => (candidate === folder || candidate.startsWith(folder + node_path_1.sep)) &&
273
+ !virtualRoots.has(candidate) &&
274
+ (0, node_fs_1.existsSync)((0, node_path_1.join)(candidate, "Cargo.toml"))),
275
+ ...((_b = (_a = workspace.pathsCrates) === null || _a === void 0 ? void 0 : _a.get(redirection.folder)) !== null && _b !== void 0 ? _b : []),
276
+ ]),
277
+ ];
278
+ for (const crate of crates.length > 0 ? crates : [folder]) {
279
+ add(crate, redirection);
280
+ }
281
+ }
282
+ return targets;
283
+ }
284
+ // Whether the entries of `target` redirect `dependency` to it: the name is
285
+ // the crate's, the entry applies to the dependency's source, and the crate's
286
+ // version satisfies the requirement.
287
+ function redirects(target, dependency) {
288
+ if (target.pkg === undefined || dependency.name !== target.pkg.name) {
289
+ return false;
290
+ }
291
+ return (target.redirections.some((redirection) => appliesTo(redirection, dependency)) &&
292
+ (0, version_req_1.satisfies)(dependency.req, target.pkg.version) === true);
293
+ }
294
+ const cratesIo = "https://github.com/rust-lang/crates.io-index";
295
+ // Whether an entry applies to a dependency's source, as far as the plugin
296
+ // can tell without reading the configuration of registries.
297
+ function appliesTo(redirection, dependency) {
298
+ var _a, _b;
299
+ const source = dependency.source;
300
+ if (source === null) {
301
+ return false;
302
+ }
303
+ if (redirection.table === "paths") {
304
+ return true;
305
+ }
306
+ let url;
307
+ if (redirection.table === "patch") {
308
+ url =
309
+ redirection.key === "crates-io"
310
+ ? cratesIo
311
+ : ((_a = redirection.key) === null || _a === void 0 ? void 0 : _a.includes("://"))
312
+ ? redirection.key
313
+ : undefined;
314
+ }
315
+ else {
316
+ // A package id specification: `name:version`, `name@version` or
317
+ // `url#name@version`; without a URL, the package is from crates.io.
318
+ const spec = (_b = redirection.key) !== null && _b !== void 0 ? _b : "";
319
+ url = spec.includes("#") ? spec.slice(0, spec.indexOf("#")) : cratesIo;
320
+ }
321
+ return url !== undefined && sameSource(sourceUrl(source), url);
322
+ }
323
+ // The URL of a source as the report writes it, without its kind, query and fragment.
324
+ function sourceUrl(source) {
325
+ const url = source.replace(/^(git|registry|sparse)\+/, "");
326
+ const end = url.search(/[?#]/);
327
+ return end === -1 ? url : url.slice(0, end);
328
+ }
329
+ function sameSource(a, b) {
330
+ const normal = (url) => url === "https://index.crates.io/" || url === "https://index.crates.io"
331
+ ? cratesIo
332
+ : url.replace(/\/+$/, "").replace(/\.git$/, "");
333
+ return normal(a) === normal(b);
334
+ }
335
+ // The redirected crates that cargo resolves the member's dependencies to:
336
+ // its own, of every kind, and those of the crates it reaches through normal
337
+ // and build dependencies, without passing another member of the workspace,
338
+ // whose own edges carry on from there.
339
+ function directTargets(member, own, members, targets, resolved) {
340
+ const direct = new Set();
341
+ const visited = new Set([own]);
342
+ const queue = [member];
343
+ while (queue.length > 0) {
344
+ const pkg = queue.shift();
345
+ for (const dependency of pkg.dependencies) {
346
+ if (pkg !== member && dependency.kind === "dev") {
347
+ continue;
348
+ }
349
+ const redirected = typeof dependency.path !== "string";
350
+ for (const next of resolved(dependency)) {
351
+ const folder = folderOf(next);
352
+ if (redirected && targets.has(folder)) {
353
+ direct.add(folder);
354
+ }
355
+ if (!visited.has(folder) && !members.has(folder)) {
356
+ visited.add(folder);
357
+ queue.push(next);
358
+ }
359
+ }
360
+ }
361
+ }
362
+ return direct;
363
+ }
364
+ // Whether `from` reaches the crate in `to` through real dependencies of kind
365
+ // normal or build: path dependencies and direct redirections.
366
+ function reaches(from, to, resolved) {
367
+ const visited = new Set([folderOf(from)]);
368
+ const queue = [from];
369
+ while (queue.length > 0) {
370
+ const pkg = queue.shift();
371
+ for (const dependency of pkg.dependencies) {
372
+ if (dependency.kind === "dev") {
373
+ continue;
374
+ }
375
+ for (const next of resolved(dependency)) {
376
+ const folder = folderOf(next);
377
+ if (folder === to) {
378
+ return true;
379
+ }
380
+ if (!visited.has(folder)) {
381
+ visited.add(folder);
382
+ queue.push(next);
383
+ }
384
+ }
385
+ }
386
+ }
387
+ return false;
388
+ }
389
+ // `possible` where the member, or a path crate that it reaches through its
390
+ // own dependencies and then through normal and build dependencies, has a
391
+ // registry or git dependency. Cargo builds no dev-dependency of a crate
392
+ // other than the one it builds or tests. Otherwise `assumed` where such a
393
+ // path crate has no report, so that what it depends on is not known, and
394
+ // `undefined` where the member reaches no registry or git crate.
395
+ function reachesExternal(member, known) {
396
+ const visited = new Set([folderOf(member)]);
397
+ const queue = [member];
398
+ let unreported = false;
399
+ while (queue.length > 0) {
400
+ const pkg = queue.shift();
401
+ for (const dependency of pkg.dependencies) {
402
+ if (pkg !== member && dependency.kind === "dev") {
403
+ continue;
404
+ }
405
+ if (typeof dependency.path !== "string") {
406
+ return "possible";
407
+ }
408
+ const next = known.get(realPath(dependency.path));
409
+ if (next === undefined) {
410
+ unreported = true;
411
+ }
412
+ else if (!visited.has(folderOf(next))) {
413
+ visited.add(folderOf(next));
414
+ queue.push(next);
415
+ }
416
+ }
417
+ }
418
+ return unreported ? "assumed" : undefined;
419
+ }
420
+ // The real path of a package's folder.
421
+ function folderOf(pkg) {
422
+ return realPath((0, node_path_1.dirname)(pkg.manifest_path));
423
+ }
424
+ // The real paths that one call of redirectedUses has looked up.
425
+ let realPaths = new Map();
426
+ function realPath(path) {
427
+ let real = realPaths.get(path);
428
+ if (real === undefined) {
429
+ real = (0, real_path_1.realPath)(path);
430
+ realPaths.set(path, real);
431
+ }
432
+ return real;
433
+ }
434
+ //# sourceMappingURL=redirected-uses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redirected-uses.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/redirected-uses.ts"],"names":[],"mappings":";;AA0GA,wCA4DC;AAtKD,qCAAqC;AACrC,yCAA+C;AAG/C,sDAAiD;AAGjD,yDAAoG;AACpG,2CAA0D;AAwD1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qCAAqC;AACrC,SAAgB,cAAc,CAC5B,KAAiB,EACjB,YAA+B;IAE/B,SAAS,GAAG,IAAI,GAAG,EAAE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,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACxC,OAAO,UAAU,CAAC;YACpB,CAAC;YACD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAClD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,UAAU,GAAG,IAAI,CAAC;YACpB,CAAC;iBAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;gBACxC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC5B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5C,CAAC;AAED,uCAAuC;AACvC,SAAS,QAAQ,CAAC,GAAiB;IACjC,OAAO,QAAQ,CAAC,IAAA,mBAAO,EAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,gEAAgE;AAChE,IAAI,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE1C,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,IAAI,GAAG,IAAA,oBAAe,EAAC,IAAI,CAAC,CAAC;QAC7B,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,121 @@
1
+ import type { CreateNodes, NxJsonConfiguration } from "@nx/devkit";
2
+ import type { TargetWarning } from "./collisions";
3
+ import { CargoGraph } from "./projects";
4
+ import type { PlacedWarning } from "./target-defaults-report";
5
+ /**
6
+ * One entry of the plugin in `nx.json`, with what its `createNodes` hook
7
+ * found for its `createDependencies` and `createMetadata` hooks.
8
+ *
9
+ * Nx loads the plugin module once per process and copies its properties for
10
+ * each entry, reading `createNodes` anew for each copy. Each read creates a
11
+ * registration with a `createNodes` of its own ({@link Registration.createNodes}).
12
+ * Nx calls the function of the copy's `createNodes` tuple as an element of
13
+ * that tuple, so that its `this` is the tuple and not the copy, and
14
+ * `createDependencies` and `createMetadata` as methods of the entry's copy, so {@link registrationOf}
15
+ * finds the registration through the copy's `createNodes`. Nothing else that
16
+ * Nx passes to the hooks tells the entries apart: their context is the same
17
+ * for all, and the options of an entry without options are `undefined`
18
+ * (EVD-NX-24-PLUGIN-ENTRIES). An entry's later hooks therefore see only what
19
+ * its own `createNodes` discovered, whether Nx runs the entries in one
20
+ * process or each in a worker of its own.
21
+ *
22
+ * Where a call shows that this does not hold, the hook fails rather than
23
+ * answer with another entry's projects ({@link entryRegistration}).
24
+ */
25
+ export declare class Registration {
26
+ /** The `createNodes` hook of this entry. */
27
+ readonly createNodes: CreateNodes;
28
+ private started;
29
+ private latest;
30
+ /**
31
+ * The options of this entry's first `createNodes` call. Nx keeps one value
32
+ * with its copy of the plugin for the entry and passes it to every hook of
33
+ * the entry, also across graph computations, so another value comes from
34
+ * another entry.
35
+ */
36
+ private options;
37
+ constructor();
38
+ /**
39
+ * Discovers the Cargo workspaces for this entry's `createNodes`, infers
40
+ * their projects and targets and keeps both for its `createDependencies`.
41
+ * Every call requests the reports afresh, sharing them only with the other
42
+ * entries of the same graph computation.
43
+ *
44
+ * Nx calls `createDependencies` after `createNodes` in the same process. A
45
+ * daemon can start a computation while an earlier one is still running and
46
+ * then drops the earlier one, so the result of the call that started last
47
+ * is kept, even if an earlier call finishes after it. Nx 24 hands an entry
48
+ * all its manifests in one call, so each call is taken as a computation of
49
+ * its own.
50
+ *
51
+ * @param options The entry's plugin options.
52
+ * @param nxJson `nx.json`, whose `plugins` name the entries of the plugin,
53
+ * no two of which may receive manifests of one workspace (`checkEntries`
54
+ * in `entries.ts`), which says whether Nx analyses the JS lockfile
55
+ * (`pluginInput` in `plugin-package.ts`), and whose `namedInputs` give
56
+ * the repository's `default` (`cacheContext` in `caching.ts`).
57
+ * @throws {Error} When the call cannot be this entry's alone (see
58
+ * {@link Registration.claim}), when the installed Nx is not supported (see
59
+ * {@link checkNxForGraph}), when the options are invalid, when discovery
60
+ * fails (see {@link discoverWorkspaces}), when a metadata table is
61
+ * invalid (see {@link readSettings}), when two entries of the plugin
62
+ * receive manifests of one workspace, or the plugin cannot tell whether
63
+ * they do (see {@link checkEntries}), when a `fileInputs` pattern resolves where
64
+ * Nx cannot hash it, or when the targets cannot be given their names
65
+ * and tables (see {@link inferProjects}).
66
+ */
67
+ discover(manifests: readonly string[], workspaceRoot: string, options?: unknown, nxJson?: NxJsonConfiguration): Promise<CargoGraph>;
68
+ /**
69
+ * Takes a `createNodes` call for this entry, or fails where it comes with
70
+ * other options than the entry's first call, which shows that entries
71
+ * share this registration. Calls with the entry's options may overlap, as
72
+ * where the daemon starts a graph computation before an earlier one has
73
+ * finished; {@link Registration.discover} keeps the newest.
74
+ */
75
+ private claim;
76
+ /**
77
+ * This registration, for a later hook of the entry, which Nx calls with the
78
+ * options that it passed to the entry's `createNodes`.
79
+ *
80
+ * @throws {Error} When `options` are not those.
81
+ */
82
+ forHook(hook: string, options: unknown): this;
83
+ /**
84
+ * What this entry's `createNodes` found for the graph computation that
85
+ * `createDependencies` belongs to, or `undefined` when it failed: Nx still
86
+ * calls `createDependencies` then, and graph creation fails with the error
87
+ * of `createNodes`.
88
+ *
89
+ * @throws {Error} When `createNodes` has not run for `workspaceRoot`.
90
+ */
91
+ graphForDependencies(workspaceRoot: string): CargoGraph | undefined;
92
+ /**
93
+ * Keeps the warnings that `createDependencies` found for targets of this
94
+ * entry's projects with the graph computation they belong to, for
95
+ * `createMetadata`, which Nx calls after it in the same process.
96
+ */
97
+ recordTargetWarnings(workspaceRoot: string, warnings: readonly PlacedWarning[]): void;
98
+ /**
99
+ * The warnings that `createDependencies` found in the graph computation
100
+ * that `createMetadata` belongs to, by project name, each with its target;
101
+ * none where it found none or did not run.
102
+ */
103
+ targetWarnings(workspaceRoot: string): Map<string, TargetWarning[]>;
104
+ }
105
+ /**
106
+ * The registration of the plugin entry that `plugin`, Nx's copy of the
107
+ * plugin module for that entry, belongs to.
108
+ *
109
+ * @throws {Error} When `plugin` is no such copy, as where a later hook is
110
+ * called detached from the copy, after destructuring, rather than as a
111
+ * method of the copy.
112
+ */
113
+ export declare function registrationOf(plugin: unknown, hook?: string): Registration;
114
+ /**
115
+ * The registration of the entry whose `hook` Nx called as a method of
116
+ * `plugin` with `options`: {@link registrationOf}, checked against the
117
+ * options of the entry's `createNodes` ({@link Registration.forHook}).
118
+ *
119
+ * @throws {Error} When the plugin cannot tell that the call is the entry's.
120
+ */
121
+ export declare function entryRegistration(plugin: unknown, hook: string, options: unknown): Registration;