@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,459 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findCrateFolders = findCrateFolders;
4
+ exports.crateInputs = crateInputs;
5
+ exports.unseenPathDependencyWarning = unseenPathDependencyWarning;
6
+ const tslib_1 = require("tslib");
7
+ const node_path_1 = require("node:path");
8
+ const declared_files_1 = require("./declared-files");
9
+ const reached_projects_1 = require("./reached-projects");
10
+ const real_path_1 = require("./real-path");
11
+ const settings_1 = require("./settings");
12
+ const visibility_1 = require("./visibility");
13
+ /**
14
+ * The crates whose files reach a crate's key through its inputs rather than
15
+ * through an edge (`DES-INPUTS`, "Path dependencies" and "Redirected
16
+ * crates"), for each crate with a project.
17
+ *
18
+ * A crate without a project is excluded by `exclude` on the plugin's entry,
19
+ * ignored by Nx, outside the repository, or a package of a directory source
20
+ * whose folder holds `.cargo-checksum.json`. One that a path dependency or a
21
+ * redirection reaches counts with the crates without a project behind it
22
+ * where a report describes it; without a report, as for such a package or
23
+ * one whose report failed, its folder counts alone. A crate with a project
24
+ * behind such crates is no folder here: the crate has an edge to it
25
+ * (`projectsReachedByPath` in `reached-projects.ts`, and `redirectedUses`
26
+ * behind a redirected crate), and its input, with what lies behind it,
27
+ * reaches the crate through `^` inputs; where `redirectedUses` leaves that
28
+ * edge out, its folder is among the left-out edges.
29
+ * A path names the crate at the real path of its folder, symbolic links
30
+ * resolved, so a path through a link to a crate with a project is that
31
+ * project's.
32
+ *
33
+ * Whether Nx sees a crate's files is whether it sees its manifest, or any
34
+ * file of a folder without one. The files that a crate seen there declares
35
+ * with `fileInputs`, in its own table or its workspace's, travel with its
36
+ * folder, and so do the variables and commands that any of these crates
37
+ * adds there with `envInputs` and `runtimeInputs`, also where Nx does not
38
+ * see its files; they are read from its report, so a crate without one
39
+ * declares and adds none.
40
+ *
41
+ * @param uses The redirected uses of the members (`redirectedUses`), for the
42
+ * projects that this plugin entry creates.
43
+ */
44
+ // @mara implements DES-INPUTS
45
+ function findCrateFolders(discovery, uses) {
46
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
48
+ const { workspaceRoot } = discovery;
49
+ const repositoryRoot = (0, real_path_1.realPath)(workspaceRoot);
50
+ // The real folders of the crates with a project.
51
+ const withProject = new Set(discovery.workspaces.flatMap((workspace) => workspace.members.map((pkg) => (0, real_path_1.realPath)((0, node_path_1.dirname)(pkg.manifest_path)))));
52
+ const byRealFolder = new Map();
53
+ // The report of each known crate's workspace, by the crate's real folder.
54
+ const reportOf = new Map();
55
+ // The root manifest of each known crate's workspace, by the crate's real folder.
56
+ const workspaceManifests = new Map();
57
+ for (const report of [
58
+ ...discovery.workspaces.map((workspace) => workspace.report),
59
+ ...discovery.pathDependencyReports.map((entry) => entry.report),
60
+ ]) {
61
+ for (const pkg of report.packages) {
62
+ const real = (0, real_path_1.realPath)((0, node_path_1.dirname)(pkg.manifest_path));
63
+ if (!workspaceManifests.has(real)) {
64
+ workspaceManifests.set(real, (0, node_path_1.join)(report.workspace_root, "Cargo.toml"));
65
+ }
66
+ const folder = (0, real_path_1.realPath)((0, node_path_1.dirname)(pkg.manifest_path));
67
+ if (!byRealFolder.has(folder)) {
68
+ byRealFolder.set(folder, pkg);
69
+ reportOf.set(folder, report);
70
+ }
71
+ }
72
+ }
73
+ const declared = new Map();
74
+ const added = new Map();
75
+ const problems = new Set();
76
+ const patterns = [];
77
+ const projectRoots = (0, declared_files_1.pluginProjectRoots)(discovery);
78
+ const cargoDirectories = (0, declared_files_1.knownCargoDirectories)(discovery);
79
+ const reached = new Map();
80
+ const leftOutEdges = new Map();
81
+ // The crates behind those of the left-out edges, by the member's manifest path.
82
+ const behindLeftOut = new Map();
83
+ for (const workspace of discovery.workspaces) {
84
+ for (const crate of workspace.members) {
85
+ reached.set(crate.manifest_path, reachedWithoutProject(crate, withProject, byRealFolder).map((behind) => ({
86
+ name: behind.name,
87
+ folder: behind.folder,
88
+ via: "path",
89
+ })));
90
+ }
91
+ }
92
+ for (const use of uses.filter((use) => !use.edge)) {
93
+ const member = use.member.manifest_path;
94
+ if (use.projectRoot !== undefined) {
95
+ const crate = byRealFolder.get(use.folder);
96
+ leftOutEdges.set(member, [
97
+ ...((_a = leftOutEdges.get(member)) !== null && _a !== void 0 ? _a : []),
98
+ {
99
+ name: (_b = crate === null || crate === void 0 ? void 0 : crate.name) !== null && _b !== void 0 ? _b : (0, node_path_1.basename)(use.folder),
100
+ folder: use.projectRoot,
101
+ seen: true,
102
+ via: "redirection",
103
+ workspaceManifest: ownWorkspaceManifest(use.folder),
104
+ declared: declaredOf(use.folder),
105
+ added: addedOf(use.folder),
106
+ },
107
+ ]);
108
+ behindLeftOut.set(member, [
109
+ ...((_c = behindLeftOut.get(member)) !== null && _c !== void 0 ? _c : []),
110
+ ...((_d = use.brings) !== null && _d !== void 0 ? _d : []).slice(1).map((folder) => {
111
+ var _a, _b;
112
+ return ({
113
+ name: (_b = (_a = byRealFolder.get(folder)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : (0, node_path_1.basename)(folder),
114
+ folder,
115
+ via: "redirection",
116
+ });
117
+ }),
118
+ ]);
119
+ continue;
120
+ }
121
+ const pkg = use.reported ? byRealFolder.get(use.folder) : undefined;
122
+ const crates = [
123
+ { name: (_e = pkg === null || pkg === void 0 ? void 0 : pkg.name) !== null && _e !== void 0 ? _e : (0, node_path_1.basename)(use.folder), folder: use.folder, via: "redirection" },
124
+ ...(pkg === undefined ? [] : reachedWithoutProject(pkg, withProject, byRealFolder)).map((behind) => ({ name: behind.name, folder: behind.folder, via: "redirection" })),
125
+ ];
126
+ reached.set(member, [...((_f = reached.get(member)) !== null && _f !== void 0 ? _f : []), ...crates]);
127
+ }
128
+ // The crates outside each workspace that its members reach, by the
129
+ // workspace's root manifest.
130
+ const outsideReached = new Map();
131
+ for (const workspace of discovery.workspaces) {
132
+ outsideReached.set((0, node_path_1.join)(workspace.report.workspace_root, "Cargo.toml"), outsideCrates(workspace, uses, byRealFolder));
133
+ }
134
+ const located = locate(reached);
135
+ const locatedBehind = locate(behindLeftOut);
136
+ const locatedOutside = locate(outsideReached);
137
+ const seen = yield (0, visibility_1.foldersNxSees)(workspaceRoot, [
138
+ ...new Set([...located.values(), ...locatedBehind.values(), ...locatedOutside.values()]
139
+ .flat()
140
+ .map((crate) => crate.inside)
141
+ .filter((path) => path !== undefined)),
142
+ ]);
143
+ const withoutProject = new Map();
144
+ for (const [manifest, crates] of located) {
145
+ withoutProject.set(manifest, crates.map(pathDependency));
146
+ }
147
+ for (const [manifest, crates] of locatedBehind) {
148
+ leftOutEdges.set(manifest, [
149
+ ...((_g = leftOutEdges.get(manifest)) !== null && _g !== void 0 ? _g : []),
150
+ ...crates.map(pathDependency),
151
+ ]);
152
+ }
153
+ for (const [manifest, crates] of leftOutEdges) {
154
+ const folders = new Set();
155
+ leftOutEdges.set(manifest, crates.filter((crate) => !folders.has(crate.folder) && folders.add(crate.folder)));
156
+ }
157
+ // The crates with a project that each crate has an edge to, by its
158
+ // manifest path, worked out once.
159
+ const useEdges = new Map();
160
+ for (const use of uses) {
161
+ if (use.edge && use.projectRoot !== undefined) {
162
+ const member = use.member.manifest_path;
163
+ useEdges.set(member, [...((_h = useEdges.get(member)) !== null && _h !== void 0 ? _h : []), use.folder]);
164
+ }
165
+ }
166
+ const edgesOf = new Map();
167
+ const outsideWorkspace = new Map();
168
+ for (const workspace of discovery.workspaces) {
169
+ const rootManifest = (0, node_path_1.join)(workspace.report.workspace_root, "Cargo.toml");
170
+ const crates = ((_j = locatedOutside.get(rootManifest)) !== null && _j !== void 0 ? _j : []).map((crate) => pathDependency(crate));
171
+ for (const key of new Set([
172
+ ...workspace.members.map((pkg) => pkg.manifest_path),
173
+ rootManifest,
174
+ ])) {
175
+ if (crates.length === 0) {
176
+ outsideWorkspace.set(key, []);
177
+ continue;
178
+ }
179
+ const held = heldFolders(key, workspace, rootManifest);
180
+ outsideWorkspace.set(key, crates.filter((crate) => !held.has(crate.folder)));
181
+ }
182
+ }
183
+ return { withoutProject, leftOutEdges, outsideWorkspace, problems: [...problems], patterns };
184
+ // The folders, as `PathDependency.folder` names them, that the inputs of
185
+ // the project whose crate's manifest, or whose workspace's root manifest,
186
+ // is `key` hold already (`DES-INPUTS`, "Crates outside the workspace"):
187
+ // those of the crates without a project and the left-out edges on its
188
+ // own targets, and through its `^` inputs those of every project that it
189
+ // reaches through edges, to any depth, with the crates without a project
190
+ // in their named inputs. The edges are those of `projectEdges` in
191
+ // `edges.ts` that this entry knows: path dependencies, the redirected
192
+ // uses with an edge, and from a workspace project to each member.
193
+ function heldFolders(key, workspace, rootManifest) {
194
+ var _a, _b, _c;
195
+ const held = new Set();
196
+ const name = (folder) => { var _a; return (_a = inside(repositoryRoot, folder)) !== null && _a !== void 0 ? _a : folder; };
197
+ const start = workspace.members.filter((pkg) => pkg.manifest_path === key || key === rootManifest);
198
+ for (const crate of (_a = leftOutEdges.get(key)) !== null && _a !== void 0 ? _a : []) {
199
+ held.add(crate.folder);
200
+ }
201
+ const visited = new Set(start.map((pkg) => (0, real_path_1.realPath)((0, node_path_1.dirname)(pkg.manifest_path))));
202
+ for (const folder of visited) {
203
+ held.add(name(folder));
204
+ }
205
+ const queue = [...start];
206
+ while (queue.length > 0) {
207
+ const pkg = queue.shift();
208
+ for (const crate of (_b = withoutProject.get(pkg.manifest_path)) !== null && _b !== void 0 ? _b : []) {
209
+ held.add(crate.folder);
210
+ }
211
+ let edges = edgesOf.get(pkg.manifest_path);
212
+ if (edges === undefined) {
213
+ edges = [
214
+ ...(0, reached_projects_1.projectsReachedByPath)(pkg, (folder) => withProject.has(folder), byRealFolder, real_path_1.realPath),
215
+ ...((_c = useEdges.get(pkg.manifest_path)) !== null && _c !== void 0 ? _c : []),
216
+ ];
217
+ edgesOf.set(pkg.manifest_path, edges);
218
+ }
219
+ for (const folder of edges) {
220
+ if (visited.has(folder)) {
221
+ continue;
222
+ }
223
+ visited.add(folder);
224
+ held.add(name(folder));
225
+ const next = byRealFolder.get(folder);
226
+ if (next !== undefined) {
227
+ queue.push(next);
228
+ }
229
+ }
230
+ }
231
+ return held;
232
+ }
233
+ // Each folder once per crate, relative to the repository root where it
234
+ // lies inside.
235
+ function locate(crates) {
236
+ const found = new Map();
237
+ for (const [manifest, list] of crates) {
238
+ const seenFolders = new Set();
239
+ found.set(manifest, list.flatMap((crate) => {
240
+ const folder = (0, real_path_1.realPath)(crate.folder);
241
+ if (seenFolders.has(folder)) {
242
+ return [];
243
+ }
244
+ seenFolders.add(folder);
245
+ return [Object.assign(Object.assign({}, crate), { folder, inside: inside(repositoryRoot, folder) })];
246
+ }));
247
+ }
248
+ return found;
249
+ }
250
+ // The entry for a located crate, with its declared files where Nx sees it.
251
+ function pathDependency(crate) {
252
+ var _a;
253
+ const isSeen = crate.inside !== undefined && seen.has(crate.inside);
254
+ return {
255
+ name: crate.name,
256
+ folder: (_a = crate.inside) !== null && _a !== void 0 ? _a : crate.folder,
257
+ seen: isSeen,
258
+ via: crate.via,
259
+ workspaceManifest: ownWorkspaceManifest(crate.folder),
260
+ declared: isSeen ? declaredOf(crate.folder) : [],
261
+ added: addedOf(crate.folder),
262
+ };
263
+ }
264
+ // The `env` and `runtime` inputs for what the crate in `folder`, a real
265
+ // path, adds with `envInputs` and `runtimeInputs`, read once per crate
266
+ // from its report; none without one.
267
+ function addedOf(folder) {
268
+ const pkg = byRealFolder.get(folder);
269
+ const report = reportOf.get(folder);
270
+ if (pkg === undefined || report === undefined) {
271
+ return [];
272
+ }
273
+ let inputs = added.get(folder);
274
+ if (inputs === undefined) {
275
+ const found = [];
276
+ const { envInputs, runtimeInputs } = (0, settings_1.readCrateAddedInputs)(pkg, report, workspaceRoot, found);
277
+ for (const problem of found) {
278
+ problems.add(problem);
279
+ }
280
+ inputs = [
281
+ ...envInputs.map((env) => ({ env })),
282
+ ...runtimeInputs.map((runtime) => ({ runtime })),
283
+ ];
284
+ added.set(folder, inputs);
285
+ }
286
+ return inputs;
287
+ }
288
+ // The filesets for the files that the crate in `folder`, a real path,
289
+ // declares, read once per crate from its report; none without one.
290
+ function declaredOf(folder) {
291
+ const pkg = byRealFolder.get(folder);
292
+ const report = reportOf.get(folder);
293
+ if (pkg === undefined || report === undefined) {
294
+ return [];
295
+ }
296
+ let filesets = declared.get(folder);
297
+ if (filesets === undefined) {
298
+ const found = [];
299
+ const fileInputs = (0, settings_1.readCrateFileInputs)(pkg, report, workspaceRoot, found);
300
+ const workspace = { root: (0, node_path_1.relative)(workspaceRoot, report.workspace_root) || ".", report };
301
+ const result = (0, declared_files_1.declaredFiles)(fileInputs, workspace, workspaceRoot, {
302
+ crate: pkg.name,
303
+ projectRoots,
304
+ cargoDirectories,
305
+ });
306
+ for (const problem of [...found, ...result.problems]) {
307
+ problems.add(problem);
308
+ }
309
+ patterns.push(...result.patterns);
310
+ filesets = result.filesets;
311
+ declared.set(folder, filesets);
312
+ }
313
+ return filesets;
314
+ }
315
+ // The root manifest of the workspace of the crate in `folder`, a real
316
+ // path, where it is not the crate's own and lies inside the repository.
317
+ function ownWorkspaceManifest(folder) {
318
+ const manifest = workspaceManifests.get(folder);
319
+ if (manifest === undefined || (0, real_path_1.realPath)((0, node_path_1.dirname)(manifest)) === folder) {
320
+ return undefined;
321
+ }
322
+ const path = inside(repositoryRoot, (0, real_path_1.realPath)(manifest));
323
+ return path === "." ? undefined : path;
324
+ }
325
+ });
326
+ }
327
+ /**
328
+ * The inputs for a crate without an edge: its folder, the root manifest of
329
+ * its workspace and the files it declares, where Nx can see them, and the
330
+ * variables and commands it adds, also where Nx cannot.
331
+ */
332
+ function crateInputs(crate) {
333
+ if (!crate.seen) {
334
+ return crate.added;
335
+ }
336
+ const folder = crate.folder === "." ? "{workspaceRoot}" : `{workspaceRoot}/${crate.folder}`;
337
+ return [
338
+ `${folder}/**/*`,
339
+ ...(crate.workspaceManifest === undefined
340
+ ? []
341
+ : [`{workspaceRoot}/${crate.workspaceManifest}`]),
342
+ ...crate.declared,
343
+ ...crate.added,
344
+ ];
345
+ }
346
+ /**
347
+ * The warning for a crate without a project whose files Nx does not see
348
+ * (`DES-DIAGNOSTICS`), naming the crate and the dependency.
349
+ *
350
+ * @param crate The crate with a project that reaches it.
351
+ * @param manifest The crate's manifest, relative to the repository root.
352
+ */
353
+ // @mara implements DES-DIAGNOSTICS
354
+ function unseenPathDependencyWarning(crate, manifest, dependency) {
355
+ const outside = (0, node_path_1.isAbsolute)(dependency.folder);
356
+ const how = dependency.via === "path"
357
+ ? "depends by path on"
358
+ : "may use, through a [patch], [replace] or paths entry of its workspace,";
359
+ return [
360
+ `nx-rust: the crate "${crate}" (${manifest}) ${how} "${dependency.name}" in ${dependency.folder}, which has no Nx project and whose files Nx cannot see, because ${outside ? "it lies outside the repository" : ".gitignore or .nxignore leaves it out"}.`,
361
+ `A change there changes no cache key of "${crate}" or of the crates that depend on it, so Nx can restore results built from the old files.`,
362
+ outside
363
+ ? `Move the crate into the repository, or add a command whose output changes with its files to runtimeInputs in the [package.metadata.nx] table of ${manifest}.`
364
+ : `Stop ignoring ${dependency.folder}, or add a command whose output changes with its files to runtimeInputs in the [package.metadata.nx] table of ${manifest}.`,
365
+ ].join(" ");
366
+ }
367
+ // The crates without a project that `crate` reaches through path
368
+ // dependencies, directly or through other crates without a project, in the
369
+ // order the walk meets them, each by its package name and the real path of
370
+ // its folder. A path names the crate at the real path of its folder, so one
371
+ // through a symbolic link to a crate with a project stops the walk as that
372
+ // crate does. A crate without a report, such as one whose folder holds
373
+ // `.cargo-checksum.json` or one whose report failed, counts too; only the
374
+ // path dependencies behind it stay unknown.
375
+ function reachedWithoutProject(crate, withProject, known) {
376
+ var _a;
377
+ const reached = [];
378
+ const visited = new Set([(0, real_path_1.realPath)((0, node_path_1.dirname)(crate.manifest_path))]);
379
+ const queue = [crate];
380
+ while (queue.length > 0) {
381
+ const current = queue.shift();
382
+ for (const dependency of current.dependencies) {
383
+ if (typeof dependency.path !== "string") {
384
+ continue;
385
+ }
386
+ const folder = (0, real_path_1.realPath)(dependency.path);
387
+ if (visited.has(folder) || withProject.has(folder)) {
388
+ continue;
389
+ }
390
+ visited.add(folder);
391
+ const pkg = known.get(folder);
392
+ reached.push({ name: (_a = pkg === null || pkg === void 0 ? void 0 : pkg.name) !== null && _a !== void 0 ? _a : dependency.name, folder });
393
+ if (pkg !== undefined) {
394
+ queue.push(pkg);
395
+ }
396
+ }
397
+ }
398
+ return reached;
399
+ }
400
+ // The path crates outside `workspace` that its members reach, each once, in
401
+ // the order the walk meets them, by package name and the real path of its
402
+ // folder (`DES-INPUTS`, "Crates outside the workspace"): through the path
403
+ // dependencies of every kind of each member, the members without a project
404
+ // included, and the redirected crates that any member may use (`uses`), and
405
+ // behind those through normal and build path dependencies, through any
406
+ // number of crates with a project or without. A member is never among them;
407
+ // the walk goes on from each member as from the first. A crate that no
408
+ // report describes counts, and what it depends on stays unknown.
409
+ function outsideCrates(workspace, uses, known) {
410
+ const ids = new Set(workspace.report.workspace_members);
411
+ const members = workspace.report.packages.filter((pkg) => ids.has(pkg.id));
412
+ const reached = [];
413
+ const visited = new Set(members.map((pkg) => (0, real_path_1.realPath)((0, node_path_1.dirname)(pkg.manifest_path))));
414
+ const queue = [];
415
+ const reach = (folder, name, via) => {
416
+ var _a;
417
+ if (visited.has(folder)) {
418
+ return;
419
+ }
420
+ visited.add(folder);
421
+ const pkg = known.get(folder);
422
+ reached.push({ name: (_a = pkg === null || pkg === void 0 ? void 0 : pkg.name) !== null && _a !== void 0 ? _a : name, folder, via });
423
+ if (pkg !== undefined) {
424
+ queue.push({ pkg, via });
425
+ }
426
+ };
427
+ for (const member of members) {
428
+ for (const dependency of member.dependencies) {
429
+ if (typeof dependency.path === "string") {
430
+ reach((0, real_path_1.realPath)(dependency.path), dependency.name, "path");
431
+ }
432
+ }
433
+ }
434
+ for (const use of uses) {
435
+ if (use.workspace === workspace) {
436
+ reach(use.folder, (0, node_path_1.basename)(use.folder), "redirection");
437
+ }
438
+ }
439
+ while (queue.length > 0) {
440
+ const { pkg, via } = queue.shift();
441
+ for (const dependency of pkg.dependencies) {
442
+ if (typeof dependency.path === "string" && dependency.kind !== "dev") {
443
+ reach((0, real_path_1.realPath)(dependency.path), dependency.name, via);
444
+ }
445
+ }
446
+ }
447
+ return reached;
448
+ }
449
+ // The path relative to the repository root, or `undefined` outside it.
450
+ function inside(repositoryRoot, path) {
451
+ const relativePath = (0, node_path_1.relative)(repositoryRoot, path);
452
+ if (relativePath === "") {
453
+ return ".";
454
+ }
455
+ return relativePath === ".." || relativePath.startsWith("../") || (0, node_path_1.isAbsolute)(relativePath)
456
+ ? undefined
457
+ : relativePath;
458
+ }
459
+ //# sourceMappingURL=path-dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-dependencies.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/path-dependencies.ts"],"names":[],"mappings":";;AA0HA,4CA4TC;AAOD,kCAaC;AAUD,kEAiBC;;AAreD,yCAA0E;AAE1E,qDAK0B;AAG1B,yDAA2D;AAC3D,2CAAuC;AAEvC,yCAAuE;AACvE,6CAA6C;AA4E7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,8BAA8B;AAC9B,SAAsB,gBAAgB,CACpC,SAAyB,EACzB,IAA8B;;;QAE9B,MAAM,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;QACpC,MAAM,cAAc,GAAG,IAAA,oBAAQ,EAAC,aAAa,CAAC,CAAC;QAC/C,iDAAiD;QACjD,MAAM,WAAW,GAAG,IAAI,GAAG,CACzB,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CACzC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,oBAAQ,EAAC,IAAA,mBAAO,EAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CACrE,CACF,CAAC;QACF,MAAM,YAAY,GAAG,IAAI,GAAG,EAAwB,CAAC;QACrD,0EAA0E;QAC1E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;QAClD,iFAAiF;QACjF,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAkB,CAAC;QACrD,KAAK,MAAM,MAAM,IAAI;YACnB,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,E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AAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,uEAAuE;AACvE,SAAS,MAAM,CAAC,cAAsB,EAAE,IAAY;IAClD,MAAM,YAAY,GAAG,IAAA,oBAAQ,EAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IACpD,IAAI,YAAY,KAAK,EAAE,EAAE,CAAC;QACxB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,YAAY,KAAK,IAAI,IAAI,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,IAAA,sBAAU,EAAC,YAAY,CAAC;QACxF,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,YAAY,CAAC;AACnB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { NxJsonConfiguration } from "@nx/devkit";
2
+ import type { PluginInput } from "./inputs";
3
+ /** The plugin's npm package name. */
4
+ export declare const pluginPackageName = "@convesoft/nx-rust";
5
+ /** The version in the plugin's own `package.json`. */
6
+ export declare function pluginVersion(): string;
7
+ /**
8
+ * How the plugin's version reaches each task's key (`DES-INPUTS`, "Plugin").
9
+ *
10
+ * Through `externalDependencies` naming the plugin's package wherever the
11
+ * plugin can establish that Nx has an npm node for it: Nx analyses the JS
12
+ * lockfile, and that lockfile lists the package with a version from a
13
+ * registry. Naming a package without a node would fail the hash of every
14
+ * Rust task (`EVD-NX-24-PLUGIN-VERSION`), so in any other case, and also
15
+ * when the plugin runs from another folder than the installed package, as
16
+ * when `nx.json` names it by path, the plugin's version goes into the target
17
+ * option `pluginVersion` instead.
18
+ *
19
+ * The lockfile counts as analysed as Nx's JS plugin decides it in Nx 24: the
20
+ * `analyzeLockfile` of `pluginsConfig["@nx/js"]` in `nx.json`, which by
21
+ * default is on wherever the repository root has a `package.json`; the
22
+ * lockfile of the package manager that `nx.json` names or whose lockfile is
23
+ * in the repository root, looked for in the order bun, yarn, pnpm, npm; and
24
+ * only where Nx sees that file. The plugin establishes a listing in
25
+ * `pnpm-lock.yaml`, `package-lock.json` and `yarn.lock`, not in bun's
26
+ * lockfiles.
27
+ */
28
+ export declare function pluginInput(workspaceRoot: string, nxJson: NxJsonConfiguration | undefined): Promise<PluginInput>;
29
+ /**
30
+ * Whether a JS lockfile lists `name` as an npm package with a version from a
31
+ * registry, for which Nx creates a node of that name: not as a workspace
32
+ * package, a link or a local file.
33
+ *
34
+ * @param lockfile The lockfile's name: `pnpm-lock.yaml`, `package-lock.json` or `yarn.lock`.
35
+ */
36
+ export declare function listsPackage(lockfile: string, contents: string, name: string): boolean;
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pluginPackageName = void 0;
4
+ exports.pluginVersion = pluginVersion;
5
+ exports.pluginInput = pluginInput;
6
+ exports.listsPackage = listsPackage;
7
+ const tslib_1 = require("tslib");
8
+ const node_fs_1 = require("node:fs");
9
+ const node_path_1 = require("node:path");
10
+ const visibility_1 = require("./visibility");
11
+ /** The plugin's npm package name. */
12
+ exports.pluginPackageName = "@convesoft/nx-rust";
13
+ // The folder of this package: `src/graph` is two levels below it, in the
14
+ // source and in the published package alike.
15
+ const packageFolder = (0, node_path_1.join)(__dirname, "..", "..");
16
+ /** The version in the plugin's own `package.json`. */
17
+ function pluginVersion() {
18
+ return JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(packageFolder, "package.json"), "utf8")).version;
19
+ }
20
+ /**
21
+ * How the plugin's version reaches each task's key (`DES-INPUTS`, "Plugin").
22
+ *
23
+ * Through `externalDependencies` naming the plugin's package wherever the
24
+ * plugin can establish that Nx has an npm node for it: Nx analyses the JS
25
+ * lockfile, and that lockfile lists the package with a version from a
26
+ * registry. Naming a package without a node would fail the hash of every
27
+ * Rust task (`EVD-NX-24-PLUGIN-VERSION`), so in any other case, and also
28
+ * when the plugin runs from another folder than the installed package, as
29
+ * when `nx.json` names it by path, the plugin's version goes into the target
30
+ * option `pluginVersion` instead.
31
+ *
32
+ * The lockfile counts as analysed as Nx's JS plugin decides it in Nx 24: the
33
+ * `analyzeLockfile` of `pluginsConfig["@nx/js"]` in `nx.json`, which by
34
+ * default is on wherever the repository root has a `package.json`; the
35
+ * lockfile of the package manager that `nx.json` names or whose lockfile is
36
+ * in the repository root, looked for in the order bun, yarn, pnpm, npm; and
37
+ * only where Nx sees that file. The plugin establishes a listing in
38
+ * `pnpm-lock.yaml`, `package-lock.json` and `yarn.lock`, not in bun's
39
+ * lockfiles.
40
+ */
41
+ // @mara implements DES-INPUTS
42
+ function pluginInput(workspaceRoot, nxJson) {
43
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
44
+ const option = { kind: "option", version: pluginVersion() };
45
+ if (!runsFromInstalledPackage(workspaceRoot) || !analysesLockfile(workspaceRoot, nxJson)) {
46
+ return option;
47
+ }
48
+ const lockfile = lockfileName(workspaceRoot, nxJson);
49
+ if (lockfile === undefined || !(0, node_fs_1.existsSync)((0, node_path_1.join)(workspaceRoot, lockfile))) {
50
+ return option;
51
+ }
52
+ if (!(yield (0, visibility_1.filesNxSees)(workspaceRoot, [lockfile])).has(lockfile)) {
53
+ return option;
54
+ }
55
+ const contents = (0, node_fs_1.readFileSync)((0, node_path_1.join)(workspaceRoot, lockfile), "utf8");
56
+ return listsPackage(lockfile, contents, exports.pluginPackageName)
57
+ ? { kind: "node", packageName: exports.pluginPackageName }
58
+ : option;
59
+ });
60
+ }
61
+ /**
62
+ * Whether a JS lockfile lists `name` as an npm package with a version from a
63
+ * registry, for which Nx creates a node of that name: not as a workspace
64
+ * package, a link or a local file.
65
+ *
66
+ * @param lockfile The lockfile's name: `pnpm-lock.yaml`, `package-lock.json` or `yarn.lock`.
67
+ */
68
+ function listsPackage(lockfile, contents, name) {
69
+ var _a, _b;
70
+ const escaped = name.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&");
71
+ switch (lockfile) {
72
+ case "pnpm-lock.yaml":
73
+ // `'@scope/name@1.0.0':` (v9), `/@scope/name@1.0.0:` (v6), `/@scope/name/1.0.0:` (v5).
74
+ return new RegExp(`^\\s+['"]?/?${escaped}[@/]\\d`, "m").test(contents);
75
+ case "package-lock.json": {
76
+ try {
77
+ const entry = (_b = (_a = JSON.parse(contents)) === null || _a === void 0 ? void 0 : _a.packages) === null || _b === void 0 ? void 0 : _b[`node_modules/${name}`];
78
+ return typeof (entry === null || entry === void 0 ? void 0 : entry.version) === "string" && entry.link !== true;
79
+ }
80
+ catch (_c) {
81
+ return false;
82
+ }
83
+ }
84
+ case "yarn.lock":
85
+ // `"@scope/name@^1.0.0":` (classic), `"@scope/name@npm:1.0.0":` (berry).
86
+ return new RegExp(`^"?${escaped}@(npm:)?[\\^~>=<]*\\d`, "m").test(contents);
87
+ default:
88
+ return false;
89
+ }
90
+ }
91
+ // Whether this module belongs to the package that the repository installs
92
+ // under the plugin's name. The installed package's `src` is the folder that
93
+ // this module's `src` resolves to; a plugin that `nx.json` names by path has
94
+ // another.
95
+ function runsFromInstalledPackage(workspaceRoot) {
96
+ try {
97
+ const installed = (0, node_path_1.dirname)(require.resolve(`${exports.pluginPackageName}/package.json`, { paths: [workspaceRoot] }));
98
+ return (0, node_fs_1.realpathSync)((0, node_path_1.join)(installed, "src")) === (0, node_fs_1.realpathSync)((0, node_path_1.join)(packageFolder, "src"));
99
+ }
100
+ catch (_a) {
101
+ return false;
102
+ }
103
+ }
104
+ // Nx's `analyzeLockfile`, as `jsPluginConfig` in Nx 24 derives it, for a
105
+ // repository with an `nx.json`.
106
+ function analysesLockfile(workspaceRoot, nxJson) {
107
+ var _a, _b;
108
+ const config = (_a = nxJson === null || nxJson === void 0 ? void 0 : nxJson.pluginsConfig) === null || _a === void 0 ? void 0 : _a["@nx/js"];
109
+ if (config !== undefined) {
110
+ return (_b = config.analyzeLockfile) !== null && _b !== void 0 ? _b : true;
111
+ }
112
+ return (0, node_fs_1.existsSync)((0, node_path_1.join)(workspaceRoot, "package.json"));
113
+ }
114
+ // The lockfile that Nx's JS plugin reads, as `detectPackageManager` and
115
+ // `getLockFileName` in Nx 24 choose it.
116
+ function lockfileName(workspaceRoot, nxJson) {
117
+ var _a;
118
+ const byManager = {
119
+ yarn: "yarn.lock",
120
+ pnpm: "pnpm-lock.yaml",
121
+ npm: "package-lock.json",
122
+ };
123
+ const named = (_a = nxJson === null || nxJson === void 0 ? void 0 : nxJson.cli) === null || _a === void 0 ? void 0 : _a.packageManager;
124
+ if (named !== undefined) {
125
+ return byManager[named];
126
+ }
127
+ if (["bun.lockb", "bun.lock"].some((file) => (0, node_fs_1.existsSync)((0, node_path_1.join)(workspaceRoot, file)))) {
128
+ return undefined;
129
+ }
130
+ return ["yarn.lock", "pnpm-lock.yaml", "package-lock.json"].find((file) => (0, node_fs_1.existsSync)((0, node_path_1.join)(workspaceRoot, file)));
131
+ }
132
+ //# sourceMappingURL=plugin-package.js.map