@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,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.knownPackages = knownPackages;
4
+ exports.projectsReachedByPath = projectsReachedByPath;
5
+ exports.projectsBehindDependency = projectsBehindDependency;
6
+ const node_path_1 = require("node:path");
7
+ /**
8
+ * Every package that a report of the graph computation describes, by the
9
+ * real path of its folder: the members of each workspace and the crates
10
+ * without a project whose reports discovery requested.
11
+ *
12
+ * @param realPath Resolves symbolic links, as the caller compares folders.
13
+ */
14
+ function knownPackages(graph, realPath) {
15
+ const known = new Map();
16
+ const reports = [
17
+ ...graph.discovery.workspaces.map((workspace) => workspace.report),
18
+ ...graph.discovery.pathDependencyReports.map((entry) => entry.report),
19
+ ];
20
+ for (const report of reports) {
21
+ for (const pkg of report.packages) {
22
+ const folder = realPath((0, node_path_1.dirname)(pkg.manifest_path));
23
+ if (!known.has(folder)) {
24
+ known.set(folder, pkg);
25
+ }
26
+ }
27
+ }
28
+ return known;
29
+ }
30
+ /**
31
+ * The crates with a project that `crate` reaches by path, by the real paths
32
+ * of their folders (DES-PROJECT-GRAPH, "Edges"): its own path dependencies
33
+ * on crates with a project, of every kind, and the crates with a project
34
+ * that it reaches only through path dependencies on crates without a
35
+ * project, through any number of them.
36
+ *
37
+ * A path names the crate at the real path of its folder, symbolic links
38
+ * resolved, as cargo builds the crate it finds there. The walk takes the
39
+ * crate's own path dependencies of every kind, and from each crate without
40
+ * a project only its normal and build dependencies: cargo builds the
41
+ * dev-dependencies of the crate it tests, never those of a crate it builds
42
+ * for that one. It stops at a crate with a project, whose own edges carry
43
+ * on from there, and at a crate that no report describes, such as one whose
44
+ * folder holds `.cargo-checksum.json` or whose report failed: what that one
45
+ * depends on is unknown and gives nothing. The crate itself is never among
46
+ * them, also where a dev-dependency leads back to it.
47
+ *
48
+ * @param hasProject Whether the crate in a folder, a real path, is an Nx project.
49
+ * @param known The packages that a report describes ({@link knownPackages}).
50
+ * @param realPath Resolves symbolic links, as `known` and `hasProject` do.
51
+ */
52
+ // @mara implements DES-PROJECT-GRAPH
53
+ function projectsReachedByPath(crate, hasProject, known, realPath) {
54
+ return reachedProjects(crate, true, hasProject, known, realPath);
55
+ }
56
+ /**
57
+ * The crates with a project behind `crate`, a crate without a project that
58
+ * cargo builds as a dependency, such as one that a `[patch]`, `[replace]`
59
+ * or `paths` entry puts in place of a registry or git dependency
60
+ * (DES-PROJECT-GRAPH, "Redirected crates"): those that it reaches through
61
+ * its normal and build path dependencies, through any number of crates
62
+ * without a project, by the real paths of their folders.
63
+ *
64
+ * It walks as {@link projectsReachedByPath} does from a crate without a
65
+ * project behind the one it starts from, so it takes no dev-dependency of
66
+ * `crate` either: cargo builds those only where it tests `crate`.
67
+ */
68
+ // @mara implements DES-PROJECT-GRAPH
69
+ function projectsBehindDependency(crate, hasProject, known, realPath) {
70
+ return reachedProjects(crate, false, hasProject, known, realPath);
71
+ }
72
+ // The walk of both: from `crate`, whose dev-dependencies count where
73
+ // `ownDevDependencies` says so, through crates without a project.
74
+ function reachedProjects(crate, ownDevDependencies, hasProject, known, realPath) {
75
+ const reached = [];
76
+ const visited = new Set([realPath((0, node_path_1.dirname)(crate.manifest_path))]);
77
+ const queue = [crate];
78
+ while (queue.length > 0) {
79
+ const pkg = queue.shift();
80
+ const devDependencies = pkg === crate && ownDevDependencies;
81
+ for (const dependency of pkg.dependencies) {
82
+ if (typeof dependency.path !== "string" || (!devDependencies && dependency.kind === "dev")) {
83
+ continue;
84
+ }
85
+ const folder = realPath(dependency.path);
86
+ if (visited.has(folder)) {
87
+ continue;
88
+ }
89
+ visited.add(folder);
90
+ if (hasProject(folder)) {
91
+ reached.push(folder);
92
+ continue;
93
+ }
94
+ const next = known.get(folder);
95
+ if (next !== undefined) {
96
+ queue.push(next);
97
+ }
98
+ }
99
+ }
100
+ return reached;
101
+ }
102
+ //# sourceMappingURL=reached-projects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reached-projects.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/reached-projects.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The path with every symbolic link resolved, so that two spellings of one
3
+ * folder compare equal; the absolute path as given when it does not exist.
4
+ */
5
+ export declare function realPath(path: string): string;
6
+ /**
7
+ * The folder that the system reaches through `path`, also before it
8
+ * exists: every symbolic link is followed, a `..` segment leaves the folder
9
+ * that a link before it leads to, and the folders that do not exist yet are
10
+ * added, as written, to the real path of the deepest one that does. A link
11
+ * that leads to a missing folder is followed as well. Links beyond the 40
12
+ * that Linux follows in one path stay as written. No `..` is taken as text
13
+ * before the links in front of it are followed: Node's JavaScript
14
+ * `realpathSync` and `resolve` do that, so the system's `realpath` resolves
15
+ * the folders that exist.
16
+ */
17
+ export declare function physicalPath(path: string): string;
18
+ /**
19
+ * A Cargo directory as the outputs and the plugin's messages name it
20
+ * (`DES-OUTPUTS`): the folder that the system reaches through `directory`
21
+ * ({@link physicalPath}), relative to the real path of `repositoryRoot`
22
+ * where it lies inside the repository, and absolute where it lies outside.
23
+ * Graph creation and the executor both name a directory with it, so that
24
+ * they agree on the same folder.
25
+ */
26
+ export declare function repositoryFolder(directory: string, repositoryRoot: string): {
27
+ inside: boolean;
28
+ path: string;
29
+ };
30
+ /**
31
+ * One of Cargo's directories as the messages about a directory inside the
32
+ * repository name it (`DES-DIAGNOSTICS`, paragraph "Directories that Nx does
33
+ * not ignore"), or `undefined` where it lies outside the repository.
34
+ *
35
+ * `path` is the folder that the system reaches through `directory`
36
+ * ({@link physicalPath}), relative to the real path of `repositoryRoot`, and
37
+ * `.` for the root itself. Where symbolic links make that folder differ from
38
+ * the one that `directory` names as text, with `.` and `..` taken as text,
39
+ * `written` gives `directory` exactly as cargo reports it, so that a message
40
+ * can show the path through which the folder is reached. It is not
41
+ * normalised: a `..` after a link leaves the folder that the link leads to,
42
+ * so taking it as text could name a path that does not exist.
43
+ */
44
+ export declare function folderInside(directory: string, repositoryRoot: string): {
45
+ path: string;
46
+ written?: string;
47
+ } | undefined;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.realPath = realPath;
4
+ exports.physicalPath = physicalPath;
5
+ exports.repositoryFolder = repositoryFolder;
6
+ exports.folderInside = folderInside;
7
+ const node_fs_1 = require("node:fs");
8
+ const node_path_1 = require("node:path");
9
+ /**
10
+ * The path with every symbolic link resolved, so that two spellings of one
11
+ * folder compare equal; the absolute path as given when it does not exist.
12
+ */
13
+ function realPath(path) {
14
+ try {
15
+ return (0, node_fs_1.realpathSync)(path);
16
+ }
17
+ catch (_a) {
18
+ return (0, node_path_1.resolve)(path);
19
+ }
20
+ }
21
+ /**
22
+ * The folder that the system reaches through `path`, also before it
23
+ * exists: every symbolic link is followed, a `..` segment leaves the folder
24
+ * that a link before it leads to, and the folders that do not exist yet are
25
+ * added, as written, to the real path of the deepest one that does. A link
26
+ * that leads to a missing folder is followed as well. Links beyond the 40
27
+ * that Linux follows in one path stay as written. No `..` is taken as text
28
+ * before the links in front of it are followed: Node's JavaScript
29
+ * `realpathSync` and `resolve` do that, so the system's `realpath` resolves
30
+ * the folders that exist.
31
+ */
32
+ function physicalPath(path) {
33
+ return reachedPath((0, node_path_1.isAbsolute)(path) ? path : `${process.cwd()}${node_path_1.sep}${path}`, { links: 0 });
34
+ }
35
+ /**
36
+ * A Cargo directory as the outputs and the plugin's messages name it
37
+ * (`DES-OUTPUTS`): the folder that the system reaches through `directory`
38
+ * ({@link physicalPath}), relative to the real path of `repositoryRoot`
39
+ * where it lies inside the repository, and absolute where it lies outside.
40
+ * Graph creation and the executor both name a directory with it, so that
41
+ * they agree on the same folder.
42
+ */
43
+ function repositoryFolder(directory, repositoryRoot) {
44
+ const reached = physicalPath(directory);
45
+ const path = (0, node_path_1.relative)(realPath(repositoryRoot), reached);
46
+ return path === "" || path === ".." || path.startsWith(`..${node_path_1.sep}`) || (0, node_path_1.isAbsolute)(path)
47
+ ? { inside: false, path: reached }
48
+ : { inside: true, path };
49
+ }
50
+ /**
51
+ * One of Cargo's directories as the messages about a directory inside the
52
+ * repository name it (`DES-DIAGNOSTICS`, paragraph "Directories that Nx does
53
+ * not ignore"), or `undefined` where it lies outside the repository.
54
+ *
55
+ * `path` is the folder that the system reaches through `directory`
56
+ * ({@link physicalPath}), relative to the real path of `repositoryRoot`, and
57
+ * `.` for the root itself. Where symbolic links make that folder differ from
58
+ * the one that `directory` names as text, with `.` and `..` taken as text,
59
+ * `written` gives `directory` exactly as cargo reports it, so that a message
60
+ * can show the path through which the folder is reached. It is not
61
+ * normalised: a `..` after a link leaves the folder that the link leads to,
62
+ * so taking it as text could name a path that does not exist.
63
+ */
64
+ function folderInside(directory, repositoryRoot) {
65
+ const realRoot = realPath(repositoryRoot);
66
+ const path = (0, node_path_1.relative)(realRoot, physicalPath(directory)) || ".";
67
+ if (leaves(path)) {
68
+ return undefined;
69
+ }
70
+ // Only to compare: the folder that the path names as text.
71
+ const asText = (0, node_path_1.resolve)(directory);
72
+ const named = [repositoryRoot, realRoot]
73
+ .map((root) => (0, node_path_1.relative)(root, asText) || ".")
74
+ .find((inside) => !leaves(inside));
75
+ return named === path ? { path } : { path, written: directory };
76
+ }
77
+ // Whether a path relative to a folder leaves that folder.
78
+ function leaves(path) {
79
+ return path === ".." || path.startsWith(`..${node_path_1.sep}`) || (0, node_path_1.isAbsolute)(path);
80
+ }
81
+ // Linux's MAXSYMLINKS.
82
+ const maximumLinks = 40;
83
+ function reachedPath(path, followed) {
84
+ try {
85
+ return node_fs_1.realpathSync.native(path);
86
+ }
87
+ catch (_a) {
88
+ // Missing, or reached through a link that leads to a missing folder.
89
+ }
90
+ const parent = (0, node_path_1.dirname)(path);
91
+ if (parent === path) {
92
+ return path;
93
+ }
94
+ const folder = reachedPath(parent, followed);
95
+ // `folder` has its links followed, so its `..` is its parent and joining
96
+ // as text is right here.
97
+ const reached = (0, node_path_1.join)(folder, (0, node_path_1.basename)(path));
98
+ if (followed.links >= maximumLinks) {
99
+ return reached;
100
+ }
101
+ let target;
102
+ try {
103
+ target = (0, node_fs_1.readlinkSync)(reached);
104
+ }
105
+ catch (_b) {
106
+ return reached;
107
+ }
108
+ followed.links += 1;
109
+ // Not `resolve`, which would take a `..` in the link as text.
110
+ const relativeTo = folder.endsWith(node_path_1.sep) ? folder : `${folder}${node_path_1.sep}`;
111
+ return reachedPath((0, node_path_1.isAbsolute)(target) ? target : `${relativeTo}${target}`, followed);
112
+ }
113
+ //# sourceMappingURL=real-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"real-path.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/real-path.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,98 @@
1
+ import type { CargoPackage } from "../cargo/metadata";
2
+ import type { CargoWorkspace } from "./discovery";
3
+ import type { CargoGraph } from "./projects";
4
+ /**
5
+ * A crate that a member of a workspace uses, or may use, because a
6
+ * `[patch]`, `[replace]` or `paths` entry of the workspace puts it in place
7
+ * of a registry or git dependency, or because it is a crate with a project
8
+ * behind such a crate without a project, which cargo builds with it.
9
+ *
10
+ * This is the one place that says which members get an edge to such a
11
+ * crate and which get its files as an input instead.
12
+ */
13
+ export interface RedirectedUse {
14
+ /** The member, which has a project. */
15
+ member: CargoPackage;
16
+ /** The workspace whose entry redirects. */
17
+ workspace: CargoWorkspace;
18
+ /** The real path of the crate's folder, symbolic links resolved. */
19
+ folder: string;
20
+ /** The root of the crate's Nx project, as Nx lists it; absent without a project. */
21
+ projectRoot?: string;
22
+ /**
23
+ * Whether a `cargo metadata` report describes the crate. Without one, the
24
+ * path dependencies behind it are unknown.
25
+ */
26
+ reported: boolean;
27
+ /**
28
+ * `direct` where cargo resolves a dependency of the member to the crate:
29
+ * the member, or a crate it reaches without passing another member of
30
+ * the workspace, declares a dependency of the crate's name whose source
31
+ * the entry redirects and whose version requirement the crate's version
32
+ * satisfies. `possible` where the member only has a registry or git
33
+ * dependency that may lead there. `assumed` where the member has none that
34
+ * a report shows, but reaches a path crate that no report describes, whose
35
+ * dependencies may lead there. A crate with a project behind a redirected
36
+ * crate without one has the kind of the member's use of that crate, and
37
+ * the strongest of them where several lead there or the crate is
38
+ * redirected itself.
39
+ */
40
+ kind: "direct" | "possible" | "assumed";
41
+ /**
42
+ * Whether the member gets an edge to the crate's project. Otherwise its
43
+ * targets get the crate's folder as an input, and for a crate with a
44
+ * project those of the crates behind it ({@link RedirectedUse.brings}):
45
+ * where the crate has no project, where a possible or assumed use would close a cycle with real
46
+ * dependencies, where two crates may only possibly use each other, and
47
+ * where an assumed use meets another edge in the opposite direction.
48
+ */
49
+ edge: boolean;
50
+ /**
51
+ * For a crate with a project whose edge is left out: the real paths of the
52
+ * folders whose files the member's targets get in place of the edge
53
+ * ({@link broughtFolders}), the crate's own first.
54
+ */
55
+ brings?: string[];
56
+ }
57
+ /**
58
+ * The crates that the members of each workspace use, or may use, through the
59
+ * workspace's redirections (DES-PROJECT-GRAPH).
60
+ *
61
+ * - Behind a redirected crate without a project, the member uses each crate
62
+ * with a project that cargo builds with it, through its normal and build
63
+ * path dependencies and any number of crates without a project
64
+ * ({@link projectsBehindDependency}), with the kind of its use of the
65
+ * redirected crate. Each such use weighs as a use of that kind of a
66
+ * redirected crate with a project, below.
67
+ * - A direct use is always an edge, cycles included, as for a path
68
+ * dependency.
69
+ * - A member with a registry or git dependency, of its own or of a path
70
+ * crate it reaches through normal or build dependencies, may use every
71
+ * other redirected crate. Its edge is left out where that crate already
72
+ * reaches the member through real dependencies of kind normal or build:
73
+ * path dependencies and direct redirections. Cargo would reject such a
74
+ * use as a cycle.
75
+ * - Two redirected crates that may only possibly use each other get no edge
76
+ * either way: cargo can have at most one of them, and which one is not
77
+ * known.
78
+ * - A member that has no such dependency that a report shows, but reaches
79
+ * a path crate without a report, may use every other redirected crate as
80
+ * well: an assumed use, the weakest kind, which never removes or weakens
81
+ * another edge. Its own edge is left out where the redirected crate
82
+ * reaches the member through real dependencies of kind normal or build,
83
+ * and where any other edge between the two projects points the opposite
84
+ * way: a path dependency, also one through crates without a project
85
+ * ({@link projectsReachedByPath}), a direct, possible or other assumed
86
+ * use.
87
+ *
88
+ * A use of a crate with a project whose edge is left out brings, in
89
+ * {@link RedirectedUse.brings}, what the edge would have brought: the crate
90
+ * and every crate that cargo builds with it ({@link broughtFolders}).
91
+ *
92
+ * A requirement that the plugin cannot evaluate, or a source it cannot
93
+ * match to the entry, makes a declaration possible, not direct.
94
+ *
95
+ * @param projectRoots The roots of the projects that Nx knows, relative to
96
+ * the repository root.
97
+ */
98
+ export declare function redirectedUses(graph: CargoGraph, projectRoots: readonly string[]): RedirectedUse[];