@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,371 @@
1
+ import type { NamedArtifact } from "./artifact-names";
2
+ import type { TargetConfiguration } from "@nx/devkit";
3
+ import type { PackageVersion } from "../cargo/lockfile";
4
+ import type { CargoPackage } from "../cargo/metadata";
5
+ import type { BuildRecordSource } from "./build-records";
6
+ import { CacheContext, CacheOptions } from "./caching";
7
+ import type { CargoWorkspace } from "./discovery";
8
+ import type { TargetNames } from "./options";
9
+ import type { ArtifactKind, FeatureUnification } from "./settings";
10
+ /**
11
+ * The plugin's cargo executor, which runs every inferred target but `build`
12
+ * and `doc`, `run` and `lockfile`. It has a batch implementation (`DES-BATCH`).
13
+ */
14
+ export declare const cargoExecutor = "@convesoft/nx-rust:cargo";
15
+ /**
16
+ * The executor of `build` and `doc`, the targets whose files Nx stores: the
17
+ * cargo executor under a name of its own, with the same implementation,
18
+ * batch implementation and schema, so that Nx batches and stores these
19
+ * tasks apart from the tasks that wait for them (`DES-BATCH`, "Two batch
20
+ * executors"; `ADR-TEST-AFTER-BUILD`).
21
+ */
22
+ export declare const cargoOutputsExecutor = "@convesoft/nx-rust:cargo-outputs";
23
+ /**
24
+ * The inferred targets, by their default names, that run
25
+ * {@link cargoOutputsExecutor} in place of {@link cargoExecutor}.
26
+ */
27
+ export declare const outputsTargets: ReadonlySet<InferredTargetName>;
28
+ /**
29
+ * The executor of the lockfile task, of `hakari-check` and of the coverage
30
+ * baseline target, which has no batch implementation, so that none of these
31
+ * tasks ever joins a batch (`DES-LOCKFILE-HASHING`, `DES-UNIFICATION`,
32
+ * "Drift", `DES-BASELINE`).
33
+ */
34
+ export declare const lockfileExecutor = "@convesoft/nx-rust:lockfile";
35
+ /**
36
+ * The executor of `run`, which has no batch implementation: `cargo run`
37
+ * takes one package only (`DES-TARGET-COMMANDS`).
38
+ */
39
+ export declare const runExecutor = "@convesoft/nx-rust:run";
40
+ /**
41
+ * The executor of `nx-release-publish`, with a batch implementation of its
42
+ * own that publishes the crates of each Cargo workspace and registry with
43
+ * one `cargo publish` (`DES-RELEASE`, `ADR-BATCHED-PUBLISH`).
44
+ */
45
+ export declare const releasePublishExecutor = "@convesoft/nx-rust:release-publish";
46
+ /**
47
+ * The commits that the oldest collection of a baseline may lie behind `HEAD`
48
+ * before the coverage baseline target collects everything in place of
49
+ * `collect --diff`, where the option `fullCollectThreshold` sets none
50
+ * (`DES-BASELINE`).
51
+ */
52
+ export declare const defaultFullCollectThreshold = 100;
53
+ /**
54
+ * The name of the publish target, which Nx release runs under this name
55
+ * only, so that `targetNames` cannot rename it (`DES-RELEASE`, "Publish
56
+ * target"; `DES-PLUGIN-OPTIONS`, "Target names").
57
+ */
58
+ export declare const releasePublishTarget = "nx-release-publish";
59
+ /**
60
+ * The inferred targets by their default names, in the order of the table in
61
+ * `DES-TARGETS`: first those of a crate, then those of the workspace project.
62
+ * They are also the keys that `targetNames` accepts (`readTargetNames` in
63
+ * `options.ts`), apart from {@link releasePublishTarget}, which keeps its
64
+ * name.
65
+ */
66
+ export declare const inferredTargetNames: readonly ["build", "check", "lint", "test", "fmt-check", "fmt", "bench", "run", "napi-build", "wasm-build", "nx-release-publish", "doc", "lockfile", "hakari-check", "audit", "deny", "update", "coverage-baseline"];
67
+ /** The default name of an inferred target, which identifies it whatever `targetNames` calls it. */
68
+ export type InferredTargetName = (typeof inferredTargetNames)[number];
69
+ /**
70
+ * The inferred targets that compile, which take the feature and profile
71
+ * options (`DES-PLUGIN-OPTIONS`) and get the configuration for all features
72
+ * ({@link allFeaturesConfiguration}).
73
+ */
74
+ export declare const compilingTargets: readonly InferredTargetName[];
75
+ /**
76
+ * The configuration that every compiling target of every crate and
77
+ * workspace gets, the feature set of all features, beside the default
78
+ * features of its options (`DES-FEATURE-SETS`): `nx run-many -t test -c
79
+ * all-features`. A target table can lay its own configuration of that name
80
+ * over it.
81
+ */
82
+ export declare const allFeaturesConfiguration = "all-features";
83
+ /** The key of {@link TargetCargoMetadata} in the metadata of each inferred target. */
84
+ export declare const targetCargoMetadataKey = "cargo";
85
+ /**
86
+ * What each inferred target carries in its Nx metadata, under
87
+ * {@link targetCargoMetadataKey}. The executor reads it to know which
88
+ * command a task runs, because `targetNames` can give the target another
89
+ * name. Nx keeps a target's metadata out of task hashes
90
+ * (`EVD-NX-OPTION-VALIDATION`), but the name of the task's target and
91
+ * `nx.json`, where `targetNames` is set, are part of each hash, so a change
92
+ * of what a target runs always changes the key.
93
+ */
94
+ export interface TargetCargoMetadata {
95
+ /** The target's default name in `DES-TARGETS`. */
96
+ target: InferredTargetName;
97
+ /**
98
+ * The `locked` option of the plugin entry that created the project, which
99
+ * `NX_RUST_LOCKED` replaces for one run (`DES-INVOCATION`). It is no input
100
+ * of a task's key; `nx.json`, where it is set, is part of every key anyway.
101
+ */
102
+ locked: boolean;
103
+ /**
104
+ * Why the plugin leaves the target uncached in this project
105
+ * (`configureCaching` in `caching.ts`, or a target table that sets
106
+ * `cache = false`, `applyTargetTables` in `target-tables.ts`); absent
107
+ * where it caches it. The executor fails a task whose configuration
108
+ * caches the target anyway.
109
+ */
110
+ uncached?: string;
111
+ /**
112
+ * On `build` and `doc`, the target triples that Cargo's configuration and
113
+ * the graph's environment pick, whose folders the outputs name where a run
114
+ * names no triple; absent where they pick none. The executor fails a
115
+ * cached task whose environment and configuration pick other triples when
116
+ * it starts (`DES-OUTPUTS`).
117
+ */
118
+ triples?: string[];
119
+ /**
120
+ * On `build` and `doc`, what picks a triple whose folder the plugin cannot
121
+ * name, and why. The executor fails a cached task of the target whose run
122
+ * names no triple (`DES-OUTPUTS`).
123
+ */
124
+ tripleProblem?: string;
125
+ /**
126
+ * On `build` and `doc`, the triples that Cargo's configuration alone
127
+ * picked when the graph was created, without `CARGO_BUILD_TARGET`, as
128
+ * `pickText` in `target-triples.ts` writes them; absent where it picked
129
+ * none. The executor tells by it
130
+ * whether a cached task's triples differ because the configuration
131
+ * changed after graph creation or because of the task's environment
132
+ * (`DES-OUTPUTS`).
133
+ */
134
+ configuredPick?: string;
135
+ /**
136
+ * On `build` and `doc`, the workspace's artifact directory whose folders
137
+ * the outputs name, relative to the repository's real path; absent where
138
+ * it lies outside the repository. The executor fails a cached task for
139
+ * which cargo reports another directory when it starts (`DES-OUTPUTS`).
140
+ */
141
+ artifactDirectory?: string;
142
+ /**
143
+ * On `build` and `doc`, the variables of graph creation's environment that
144
+ * move the artifact directory, `CARGO_TARGET_DIR`, `CARGO_BUILD_TARGET_DIR`
145
+ * and `CARGO_HOME`, with their values; absent where none is set. The
146
+ * executor tells by them whether a cached task's artifact directory
147
+ * differs because Cargo's configuration changed after graph creation or
148
+ * because of the task's environment (`DES-OUTPUTS`).
149
+ */
150
+ directoryVariables?: Record<string, string>;
151
+ /**
152
+ * On the lockfile task: the workspace's members, whose digests it writes
153
+ * (`DES-LOCKFILE-HASHING`).
154
+ */
155
+ members?: PackageVersion[];
156
+ /**
157
+ * On a cached target that depends on the lockfile task: the crate's own
158
+ * member, whose digest its key holds, or nothing for a workspace project
159
+ * without a crate. The executor computes the digests again after cargo's
160
+ * call, the crate's own first (`DES-LOCKFILE-HASHING`, "Post-check").
161
+ */
162
+ digests?: PackageVersion[];
163
+ /**
164
+ * On such a target whose key holds the digests of every member of its
165
+ * workspace (`holdsEveryDigest` in `inputs.ts`): the executor compares
166
+ * those of the other members as well, which it takes from the
167
+ * {@link TargetCargoMetadata.members} of the lockfile task that the task
168
+ * depends on. Naming them once per workspace, on the lockfile task, keeps
169
+ * the graph from carrying every member on every target.
170
+ */
171
+ everyDigest?: boolean;
172
+ /**
173
+ * On a crate's `build`: what the executor names the dependency files of
174
+ * the crate's library and binaries from, which it compares with the
175
+ * task's inputs after cargo's call (`DES-BUILD-INPUT-CHECK`).
176
+ */
177
+ records?: BuildRecordSource;
178
+ /**
179
+ * On a crate's `test`: `true` where `cargo test` replaces the executables
180
+ * that the crate's `build` declares ({@link testReplacesExecutables}), so
181
+ * that the target depends on that `build` (`DES-TARGETS`).
182
+ */
183
+ waitsForBuild?: boolean;
184
+ /**
185
+ * On a crate's `test`: the roots, relative to the repository root, of the
186
+ * crates whose `build` the target depends on because the test's cargo
187
+ * commands replace the executables that it declares ({@link testBuilds}),
188
+ * the crate's own among them where it has such executables. The executor
189
+ * fails a task whose run holds one of those `build` tasks without an order
190
+ * between the two (`DES-TARGETS`, "Guard").
191
+ */
192
+ waitsForBuilds?: string[];
193
+ /**
194
+ * On a crate's `build`, cached or not: the files that the crate's targets
195
+ * put into the folders of its artifact directory, with whether they are
196
+ * executables and whether `build` declares them (`namedArtifacts` in
197
+ * `artifact-names.ts`). The executor compares them with those of other
198
+ * projects when a cached task starts (`DES-OUTPUTS`, "Files of one name").
199
+ */
200
+ artifactFiles?: NamedArtifact[];
201
+ /**
202
+ * On `napi-build`: the addon's file in the crate's folder, which the
203
+ * outputs name, and the host triple whose name it holds; absent where
204
+ * graph creation could not name it. The executor fails a cached task
205
+ * whose installed napi CLI names the addon otherwise (`DES-NAPI`).
206
+ */
207
+ napiAddon?: string;
208
+ /** On `napi-build`: the host triple that {@link TargetCargoMetadata.napiAddon} comes from. */
209
+ napiHost?: string;
210
+ /**
211
+ * On `napi-build`: the `dtsHeaderFile` of the crate's napi settings,
212
+ * relative to the repository root, where the target's inputs hold it, or
213
+ * absolute outside the repository, where the executor fails the cached
214
+ * task before cargo (`DES-NAPI`).
215
+ */
216
+ napiHeaderFile?: string;
217
+ /**
218
+ * On `napi-build` and `wasm-build`: why the crate's library has the file
219
+ * name of another crate's file, so that cargo builds one file for both;
220
+ * the executor fails the task before cargo runs (`DES-NAPI`, "Library
221
+ * names"; `DES-WASM`).
222
+ */
223
+ sharedLibrary?: string;
224
+ /**
225
+ * On a crate's `test`: `nextest` where the workspace's settings choose the
226
+ * nextest runner (`REQ-TEST-RUNNER`); absent for the `cargo` runner. Like
227
+ * `locked`, it is no input of a key: the setting lies in `nx.json` or in
228
+ * the workspace's root `Cargo.toml`, both of which every key of the
229
+ * crate's `test` holds, and the nextest runner gives the target inputs of
230
+ * its own, the variables that start with `NEXTEST_` and the workspace's
231
+ * `.config/nextest.toml` (`DES-INPUTS`).
232
+ */
233
+ testRunner?: "nextest";
234
+ /**
235
+ * On a crate's `test`: `true` where the workspace uses the selection of
236
+ * affected tests (`affectedTests`), so that the executor decides the test
237
+ * mode as the target's mode input does (`DES-TEST-MODE`); absent
238
+ * otherwise. Like `testRunner`, it is no input of a key: the setting lies
239
+ * in a file that every key of the crate's `test` holds, and it gives the
240
+ * target the mode input.
241
+ */
242
+ affectedTests?: true;
243
+ /**
244
+ * On a crate's `test` where the workspace uses the selection of affected
245
+ * tests: the filesets of the crate's `fileInputs` patterns
246
+ * (`DES-PLUGIN-OPTIONS`), which coverage never narrows (`DES-TEST-RUN`,
247
+ * step 2); absent where it declares none.
248
+ */
249
+ declaredFiles?: string[];
250
+ }
251
+ /**
252
+ * Whether `cargo test` for the crate replaces the executables in the
253
+ * artifact directory that its `build` declares as outputs (`DES-OUTPUTS`),
254
+ * read from the crate's report: the crate has a target of kind `bin`, and a
255
+ * target of kind `test`, whatever its `test` flag, or of kind `bench` whose
256
+ * `test` flag is on. Cargo builds the crate's binaries for such a target,
257
+ * with what dev-dependencies turn on and with the `test` profile, and
258
+ * replaces the uplifted files even when their units are fresh
259
+ * (`EVD-CARGO-ARTIFACT-WRITERS`). A test target with `test = false` counts
260
+ * because the `test` option, which can come from the command line where the
261
+ * graph never sees it, makes cargo build and run it with `--test`
262
+ * (`DES-TEST-RUN`, "One test target"; `EVD-CARGO-TEST-TARGET-SELECTOR`).
263
+ * The `required-features` of either target do not count: whether cargo
264
+ * builds them depends on the features of the run, and a crate counted
265
+ * without need only orders two tasks. A flag that the report lacks counts as on. Examples, unit tests,
266
+ * doctests and `cdylib` and `staticlib` files never make cargo replace them.
267
+ */
268
+ export declare function testReplacesExecutables(pkg: CargoPackage): boolean;
269
+ /**
270
+ * The inferred targets that the plugin caches, as `DES-TARGETS` and
271
+ * `DES-OUTPUTS` give them, with the inputs of `DES-INPUTS` and the outputs
272
+ * of `DES-OUTPUTS` (`configureCaching` in `caching.ts`). `build` and `doc`
273
+ * are left uncached for a project where the plugin cannot name or store
274
+ * their artifacts, and `build` and `test` for a crate whose artifacts share
275
+ * a file name with another crate's in its artifact directory
276
+ * (`sharedArtifactNames` in `artifact-names.ts`), with the reason in
277
+ * `metadata.cargo.uncached`. Graph
278
+ * creation fails for a `targetDefaults` entry in `nx.json` that turns caching
279
+ * on for a target that the plugin leaves uncached in a project
280
+ * (`DES-TARGET-DEFAULT-GUARD`, which compares with the `cache` that
281
+ * {@link inferTargets} sets), and the executor fails a task of such a target
282
+ * that its configuration caches after all, so that Nx stores no result for it.
283
+ */
284
+ export declare const cachedTargets: ReadonlySet<InferredTargetName>;
285
+ /** What the inference of a project's targets needs to know about the project. */
286
+ export interface TargetSubject {
287
+ /** The project's folder, relative to the repository root: `.` for the root itself. */
288
+ root: string;
289
+ /** The workspace the project belongs to. */
290
+ workspace: CargoWorkspace;
291
+ /** The crate; absent for a workspace project without a crate. */
292
+ pkg?: CargoPackage;
293
+ /** Whether the project hosts the workspace's own targets. */
294
+ isWorkspaceProject: boolean;
295
+ /** The project's settings, of which the crate's `artifacts` replace the inference of artifact targets. */
296
+ settings?: {
297
+ artifacts?: readonly ArtifactKind[];
298
+ };
299
+ }
300
+ /**
301
+ * The targets that the plugin infers for a project, by their default names,
302
+ * in the order of {@link inferredTargetNames}.
303
+ *
304
+ * A crate gets `build`, `check`, `lint`, `test`, `fmt-check` and `fmt`, `run`
305
+ * when it has a binary target, `bench` when it has a bench target, and
306
+ * `nx-release-publish` unless its manifest sets `publish = false`, which the
307
+ * report gives as an empty `publish` list, or it is the hack crate that the
308
+ * workspace's cargo-hakari configuration names (`DES-RELEASE`, "Publish
309
+ * target", "Hack crate"), `napi-build` where it produces a Node addon and
310
+ * `wasm-build` where it produces a wasm package, with the wasm target of
311
+ * `wasm-bindgen`'s own default in its options (`DES-ARTIFACT-STEPS`,
312
+ * `DES-WASM`). The
313
+ * workspace project gets `doc`, `lockfile`, `audit` and `update`, `deny`
314
+ * where a cargo-deny configuration file is in the workspace root, and
315
+ * `hakari-check` where the workspace uses the `hakari` strategy
316
+ * (`DES-UNIFICATION`, "Drift"), and `coverage-baseline` where it uses the
317
+ * selection of affected tests (`affectedTests`, `DES-BASELINE`); a root
318
+ * manifest's crate gets both sets. Whether a tool is installed decides
319
+ * nothing.
320
+ *
321
+ * Only the targets in {@link cachedTargets} are cached; their inputs and
322
+ * outputs, the exceptions for the artifact directory, and the dependency of
323
+ * every cached target but `fmt-check` on the lockfile task of its workspace,
324
+ * the one task dependency of a crate's target on another project
325
+ * (`REQ-NO-RUST-TASK-DEPS`), come from `configureCaching` in `caching.ts`.
326
+ * Where `cargo test` replaces the executables of the crate's `build`
327
+ * ({@link testReplacesExecutables}), `test` also depends on that `build`,
328
+ * cached or not, so that the two never run at the same time (`DES-TARGETS`).
329
+ *
330
+ * @param context What the caching of the graph's projects shares.
331
+ * @param caching What the project's settings change in its caching.
332
+ * @param locked The `locked` option of the plugin entry, which each target
333
+ * carries in its metadata for the executor ({@link TargetCargoMetadata}).
334
+ * @param targetNames The names that the plugin options give the inferred
335
+ * targets, under which `test` names the `build` it depends on.
336
+ */
337
+ export declare function inferTargets(subject: TargetSubject, context: CacheContext, locked?: boolean, caching?: CacheOptions, targetNames?: TargetNames): Map<InferredTargetName, TargetConfiguration>;
338
+ /**
339
+ * The roots, relative to the repository root and sorted, of the crates whose
340
+ * `build` a crate's `test` waits for (`DES-TARGETS`, `ADR-WORKSPACE-TEST-EXECUTABLES`):
341
+ * every member of its workspace that has a project and for which `cargo
342
+ * test` replaces the executables that its `build` declares
343
+ * ({@link testReplacesExecutables}), the crate itself among them where it is
344
+ * one. Under `workspace-build`, every step of a `test` group selects the
345
+ * whole workspace, and such a command replaces those executables of every
346
+ * such member, of no other crate, and no `cdylib` or `staticlib` file, on
347
+ * Cargo 1.91.0 and 1.100.0 (`EVD-CARGO-ARTIFACT-WRITERS`, "Commands that
348
+ * select the whole workspace"); the rule counts a crate whatever the
349
+ * `required-features` of its targets, so that the set is a superset of the
350
+ * crates whose files cargo replaces. Under `hakari` and `cargo`, whose
351
+ * commands select their crates with `-p`, a `cargo test` replaces the
352
+ * executables of the crates it selects only, and a group selects those of
353
+ * its own tasks, each of which waits for its own crate's `build`: the crate
354
+ * itself, where it is one.
355
+ */
356
+ export declare function testBuilds(subject: TargetSubject, repositoryRoot: string, strategy?: FeatureUnification): string[];
357
+ /**
358
+ * Gives each project's inferred targets the names that `targetNames` asks
359
+ * for, a target without an entry keeping its default name.
360
+ *
361
+ * @returns Each project's targets by name, in the order of `projects`.
362
+ * @throws {Error} When two inferred targets of one project would get one
363
+ * name, naming every such project, its targets and the name.
364
+ */
365
+ export declare function nameTargets<P extends {
366
+ name: string;
367
+ manifest: string;
368
+ }>(projects: readonly {
369
+ project: P;
370
+ targets: Map<InferredTargetName, TargetConfiguration>;
371
+ }[], targetNames: TargetNames): Record<string, TargetConfiguration>[];