@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,51 @@
1
+ # nx-rust documentation
2
+
3
+ These pages are both the user guide and the engineering specification of
4
+ `@convesoft/nx-rust`, an Nx plugin that makes Cargo workspaces first-class Nx
5
+ projects while Cargo stays the build tool. Each topic page opens with guidance
6
+ for users, followed by the requirements and design that govern that topic.
7
+
8
+ > **Status:** milestones 0.1 to 0.5 of the [roadmap](product.mara.md#roadmap)
9
+ > are implemented on `main`, and 1.0 release candidates are published on npm
10
+ > under the `next` dist-tag (`nx add @convesoft/nx-rust@next`).
11
+
12
+ ## For users
13
+
14
+ | Page | What it covers |
15
+ | --------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
16
+ | [What nx-rust is](product.mara.md) | Purpose, audience, principles, roadmap, what the plugin deliberately does not do, goals and vocabulary |
17
+ | [Setup and compatibility](setup.mara.md) | Supported versions, tools you need, adding the plugin, generators and error messages |
18
+ | [Workspaces and projects](workspaces.mara.md) | How Cargo workspaces and crates become Nx projects, project names and the dependency graph |
19
+ | [Configuration](configuration.mara.md) | Overrides in `Cargo.toml`, plugin options and target names |
20
+ | [Targets](targets.mara.md) | The targets of crates and workspaces, and why crates have no `^build` |
21
+ | [Caching](caching.mara.md) | What goes into a cache key, what is stored, and Cargo's two directories |
22
+ | [Batching and features](execution.mara.md) | A few cargo commands per group of tasks instead of one per crate, and feature unification |
23
+ | [Testing](testing.mara.md) | Test runners, affected tests and how the cache stays honest |
24
+ | [napi and wasm artifacts](artifacts.mara.md) | Node addons and wasm packages for JS consumers |
25
+ | [Releasing](release.mara.md) | Versioning and publishing crates with Nx release |
26
+ | [Continuous integration](ci.mara.md) | What to cache where, the coverage baseline, and distributed runs later |
27
+
28
+ ## For contributors
29
+
30
+ | Page | What it covers |
31
+ | ---------------------------------------- | --------------------------------------------------------------------------------------- |
32
+ | [Decisions and risks](decisions.mara.md) | Why nx-rust is shaped the way it is, the risks it carries, the evidence and the sources |
33
+ | [Verification](verification.mara.md) | How the plugin is tested and how each requirement and goal is checked |
34
+
35
+ ## How to read the specification
36
+
37
+ The `:::mara` blocks are [Mara](https://github.com/convesoft/mara) items: goals
38
+ (`GOAL-`), needs (`NEED-`), terms (`TERM-`), scenarios (`SCN-`), requirements
39
+ (`REQ-`), designs (`DES-`), decisions (`ADR-`), risks (`RISK-`), evidence
40
+ (`EVD-`), verifications (`VER-`) and validations (`VAL-`). Lines such as
41
+ `:satisfies: NEED-…` connect items to each other. `[[ID]]` mentions another
42
+ item.
43
+
44
+ `status: accepted` means the knowledge is agreed. It does not mean the feature
45
+ is implemented or tested. `draft` marks open proposals: areas that are named
46
+ but not designed yet, each with its open questions. `retired` marks history
47
+ that no longer applies.
48
+
49
+ The work to build nx-rust is tracked in [`.zban/`](../../.zban/) with
50
+ [zban](https://github.com/convesoft/zban). Issues refer to these items by ID
51
+ instead of repeating them.
@@ -0,0 +1,366 @@
1
+ # What nx-rust is
2
+
3
+ `@convesoft/nx-rust` is an Nx plugin that makes Cargo workspaces first-class Nx
4
+ projects while Cargo stays the build tool.
5
+
6
+ > **Status:** milestones 0.1 to 0.5 are implemented on `main`, and 1.0 release
7
+ > candidates are published on npm under the `next` dist-tag
8
+ > (`nx add @convesoft/nx-rust@next`). What is left of v1 is real-repository
9
+ > validation, as the [roadmap](#roadmap) shows.
10
+
11
+ It is written for Nx monorepos where Rust crates sit beside JS and TS apps and
12
+ libraries. In such a repository Nx knows every JS project, but Rust is usually
13
+ a set of opaque scripts: no edges in the graph, no `nx affected`, and either no
14
+ caching or caching that cuts corners. nx-rust reads the Cargo workspaces as
15
+ they are:
16
+
17
+ - **Nothing to describe twice.** Projects, targets and dependencies come from
18
+ `cargo metadata`. No crate needs a `project.json`.
19
+ - **Cargo keeps working.** Plain `cargo` and rust-analyzer use the same
20
+ directories and flags as before, and the plugin puts no generated files into
21
+ crates.
22
+ - **A cache you can trust.** A cache key covers the crate's files, the sources
23
+ of its dependencies, the toolchain and a fixed list of environment variables.
24
+ Nx stores task results and final artifacts, never Cargo's intermediate files.
25
+ - **Few cargo invocations.** Nx schedules one task per crate, and the plugin
26
+ runs each group of tasks with one cargo command per step of their target: one
27
+ for most targets, a few for a test run with nextest, never one per crate.
28
+ - **Rust and JS in one graph.** `nx affected -t lint test build` covers both
29
+ languages, and napi and wasm crates produce artifacts that JS projects depend
30
+ on.
31
+
32
+ Rust-only repositories work too, but they do not drive priorities.
33
+
34
+ ## Principles
35
+
36
+ | Principle | What it means |
37
+ | -------------------------------------------- | --------------------------------------------------------------------------------------------------- |
38
+ | Cargo is the source of truth | Projects, targets and dependencies come from `cargo metadata`. |
39
+ | Nx decides what runs and what is cached | Cargo builds, in as few invocations as possible. |
40
+ | Cargo owns its build directory | Nx caches task results and final artifacts only. |
41
+ | Cargo behaves as it would without the plugin | Same directories, same default flags, no generated files inside crates apart from artifact outputs. |
42
+ | Overrides live in `Cargo.toml` | `[package.metadata.nx]` per crate, `[workspace.metadata.nx]` for workspace defaults. |
43
+ | Cache correctness over cache ambition | Running more than a cache key promises is fine. Running less is not. |
44
+ | v1 targets a single machine | Rust tasks are not spread across CI agents. |
45
+
46
+ ## What v1 includes
47
+
48
+ - Any number of Cargo workspaces and standalone crates, anywhere in the
49
+ repository, as Nx projects with a full dependency graph:
50
+ [Workspaces and projects](workspaces.mara.md).
51
+ - Overrides in `Cargo.toml` and a few plugin options:
52
+ [Configuration](configuration.mara.md).
53
+ - Inferred `build`, `check`, `lint`, `test`, `fmt-check`, `fmt`, `bench` and
54
+ `run` targets for each crate, and `doc`, `audit`, `deny` and `update` for each
55
+ Cargo workspace: [Targets](targets.mara.md).
56
+ - Cache keys and outputs that keep Cargo's build directory out of the Nx cache:
57
+ [Caching](caching.mara.md).
58
+ - A few cargo commands per group of tasks instead of one per crate, with
59
+ features resolved the same way on every run:
60
+ [Batching and features](execution.mara.md).
61
+ - `cargo test` or nextest, and optional selection of affected tests:
62
+ [Testing](testing.mara.md).
63
+ - Node addons and wasm packages as targets that JS projects depend on:
64
+ [napi and wasm artifacts](artifacts.mara.md).
65
+ - Versioning and publishing crates with Nx release: [Releasing](release.mara.md).
66
+ - An `init` generator, crate generators and clear error messages:
67
+ [Setup and compatibility](setup.mara.md).
68
+
69
+ ## Roadmap
70
+
71
+ v1 is delivered in stages, completed on `main` one after another, and the work
72
+ is tracked as one epic per milestone in [`.zban/`](../../.zban/). No 0.x
73
+ milestone is published to npm on its own: whether and when the package is
74
+ published is decided at 1.0 ([[ADR-PUBLISHING-AT-1-0]]).
75
+
76
+ | Milestone | Status | Contents |
77
+ | --------- | ------ | ------------------------------------------------------------------------------------------------------- |
78
+ | 0.1 | Done | Project graph, inferred targets and caching, with one cargo call per task. `init` and crate generators. |
79
+ | 0.2 | Done | Batching and feature unification. |
80
+ | 0.3 | Done | nextest, affected tests and the coverage baseline. |
81
+ | 0.4 | Done | napi and wasm artifacts. |
82
+ | 0.5 | Done | Releasing with Nx release. |
83
+ | 1.0 | Open | The open assumptions listed under [risks](decisions.mara.md#risks) are checked and closed. |
84
+
85
+ ## What nx-rust deliberately does not do
86
+
87
+ - It does not install toolchains or tools. rustup, nextest, cargo-affected,
88
+ cargo-hakari and the `wasm-bindgen` CLI stay your job; the plugin says clearly
89
+ what is missing. Every machine that runs `nx` in the repository needs cargo.
90
+ - It does not build hermetically. There is no sandbox and no remote execution;
91
+ the plugin trusts Cargo and a declared set of inputs.
92
+ - It does not store or restore Cargo's intermediate files.
93
+ - It does not need or generate a `project.json` per crate.
94
+ - It does not edit `Cargo.toml`, `Cargo.lock` or `.cargo/config.toml`, except
95
+ in generators, in release, and in tasks you run to change them.
96
+ - v1 does not run on Windows hosts.
97
+ - v1 does not cross-compile Node addons, run wasm tests, publish npm packages,
98
+ run tests for other target triples, migrate a repository from
99
+ `@monodon/rust`, format Rust through `nx format`, or spread Rust tasks across
100
+ CI agents.
101
+
102
+ The reasons are recorded in [[ADR-V1-SCOPE]] and [[ADR-SINGLE-MACHINE]]. Adding
103
+ one of these needs a recorded need and decision before it is built.
104
+
105
+ ## Goals
106
+
107
+ :::mara goal GOAL-CARGO-NATIVE
108
+ :mid: 01M78FHG7FRG7B5PSZD2NZ1ZAZ
109
+ :title: Keep Cargo the build tool and the source of truth
110
+ :status: accepted
111
+
112
+ Rust developers in an Nx monorepo keep working exactly as they would without the plugin. Cargo builds, the Cargo manifests describe the crates, and plain `cargo` and rust-analyzer behave the same with the plugin installed. Nothing about a crate has to be stated a second time for Nx, so the two descriptions cannot drift apart.
113
+ :::
114
+
115
+ :::mara goal GOAL-ONE-MONOREPO
116
+ :mid: 01M78FHG7F29A0KR2HCWPTFFZ1
117
+ :title: Treat Rust and JS as one monorepo
118
+ :status: accepted
119
+
120
+ In a repository that mixes JS/TS and Rust, one Nx graph, one cache, one `nx affected` and one set of commands cover both languages. A change in a Rust crate reaches the JS projects that consume it, and the other way round, without glue scripts.
121
+ :::
122
+
123
+ :::mara goal GOAL-TRUSTED-CACHE
124
+ :mid: 01M78FHG7F44E8BAFK3ZZJRQT7
125
+ :title: Never restore a wrong result
126
+ :status: accepted
127
+
128
+ A result restored from the Nx cache is the result the task would produce if it ran now. Teams can leave caching on in CI and on developer machines without re-running tasks to be safe. Where the plugin cannot be sure, it runs more work instead of restoring.
129
+ :::
130
+
131
+ :::mara goal GOAL-FAST-FEEDBACK
132
+ :mid: 01M78FHG7FME1CA6KC45BJAH4E
133
+ :title: Do as little Rust work as correctness allows
134
+ :status: accepted
135
+
136
+ A change triggers only the compilation and tests that it can affect, and that work costs about what a well-tuned plain cargo setup would cost. Developers and CI get Rust feedback in time proportional to the change, not to the size of the repository.
137
+ :::
138
+
139
+ ## Needs
140
+
141
+ :::mara need NEED-ZERO-CONFIG
142
+ :mid: 01M78FHG7F6ZMMNWYB6PVC4PPT
143
+ :title: Use a Cargo workspace without describing it again
144
+ :status: accepted
145
+ :contributes_to: GOAL-CARGO-NATIVE
146
+ :contributes_to: GOAL-ONE-MONOREPO
147
+
148
+ A team can add the plugin to a repository and get Nx projects, targets and dependencies for its crates from the Cargo manifests it already has, without writing or generating per-crate Nx configuration.
149
+ :::
150
+
151
+ :::mara need NEED-ANY-LAYOUT
152
+ :mid: 01M78FHG7F1CQQA7RNG78E8109
153
+ :title: Keep the repository layout the team already has
154
+ :status: accepted
155
+ :contributes_to: GOAL-ONE-MONOREPO
156
+
157
+ The plugin works with the Cargo layout a repository already has: one workspace or several, at the Nx root or in subfolders, standalone crates, crates excluded from a workspace, path dependencies between workspaces, and vendored or generated crates that should be left alone.
158
+ :::
159
+
160
+ :::mara need NEED-CARGO-UNCHANGED
161
+ :mid: 01M78FHG7FQRS21JJJXM330EJE
162
+ :title: Keep plain cargo and editor tooling working unchanged
163
+ :status: accepted
164
+ :contributes_to: GOAL-CARGO-NATIVE
165
+
166
+ A developer can run `cargo` directly and use rust-analyzer in a repository that has the plugin, and get the behaviour, directories and build reuse they would have without it. Work done through Nx and work done through plain cargo do not invalidate each other.
167
+ :::
168
+
169
+ :::mara need NEED-CONFIG-IN-CARGO
170
+ :mid: 01M78FHG7FKY2H96D624M0CEMJ
171
+ :title: Adjust the plugin where the crate is described
172
+ :status: accepted
173
+ :contributes_to: GOAL-CARGO-NATIVE
174
+
175
+ When a crate or workspace needs something other than the default, such as tags, another project name or different options for a target, a developer states it in the Cargo manifest that already describes that crate or workspace.
176
+ :::
177
+
178
+ :::mara need NEED-UNIFORM-COMMANDS
179
+ :mid: 01M78FHG7F03FJS926C86QPTPP
180
+ :title: Run Rust and JS tasks with the same commands
181
+ :status: accepted
182
+ :contributes_to: GOAL-ONE-MONOREPO
183
+
184
+ The commands a mixed repository already uses for JS projects, such as `nx affected -t lint test build`, also cover its Rust crates, so developers and CI pipelines do not need a second set of commands for Rust.
185
+ :::
186
+
187
+ :::mara need NEED-CORRECT-CACHE
188
+ :mid: 01M78FHG7FMWW59PS4KPRKVCEJ
189
+ :title: Trust cached results
190
+ :status: accepted
191
+ :contributes_to: GOAL-TRUSTED-CACHE
192
+
193
+ Developers and CI can rely on a cache hit for a Rust task: everything that can change the task's result is part of what decides whether the cached result is reused, and a result of one kind is never reused as a result of another kind.
194
+ :::
195
+
196
+ :::mara need NEED-AFFECTED
197
+ :mid: 01M78FHG7F4CKFXTSBXJ7131EY
198
+ :title: Run only what a change affects
199
+ :status: accepted
200
+ :contributes_to: GOAL-FAST-FEEDBACK
201
+ :contributes_to: GOAL-ONE-MONOREPO
202
+
203
+ Given a change, developers and CI can run the tasks of the crates and JS projects it can affect, and skip the rest, across language boundaries. A change in a dependency, including one used only by tests or build scripts, counts as affecting its dependents.
204
+ :::
205
+
206
+ :::mara need NEED-EFFICIENT-BUILDS
207
+ :mid: 01M78FHG7F597HWJZPETAMWPQ4
208
+ :title: Avoid repeated and contended compilation
209
+ :status: accepted
210
+ :contributes_to: GOAL-FAST-FEEDBACK
211
+
212
+ Running many Rust tasks through Nx does not compile the same code several times with the same features, does not queue cargo processes behind one build lock, and does not rebuild because a different set of crates happened to run together.
213
+ :::
214
+
215
+ :::mara need NEED-FAST-TESTS
216
+ :mid: 01M78FHG7FX5BYGF6N2SGWAV2D
217
+ :title: Get test feedback proportional to the change
218
+ :status: accepted
219
+ :contributes_to: GOAL-FAST-FEEDBACK
220
+
221
+ A developer who changes a few lines in a large crate can get the results of the tests that the change can affect without waiting for the crate's whole suite, while the full suite still runs for every state of the main branch.
222
+ :::
223
+
224
+ :::mara need NEED-JS-BRIDGE
225
+ :mid: 01M78FHG7F1RBZVPETF1K490S9
226
+ :title: Consume Rust from JS projects
227
+ :status: accepted
228
+ :contributes_to: GOAL-ONE-MONOREPO
229
+
230
+ A JS project can depend on a Rust crate that is built into a Node addon or a wasm package. Building the JS project builds the artifact first when needed, and a change in the crate affects the JS project.
231
+ :::
232
+
233
+ :::mara need NEED-RELEASE
234
+ :mid: 01M78FHG7F4QQYZSG4XA0NKA2W
235
+ :title: Version and publish crates with the rest of the repository
236
+ :status: accepted
237
+ :contributes_to: GOAL-ONE-MONOREPO
238
+
239
+ A team that releases its JS packages with Nx release can version and publish its crates through the same process, with versions of dependent crates and the lockfile kept consistent.
240
+ :::
241
+
242
+ :::mara need NEED-EASY-SETUP
243
+ :mid: 01M78FHG7F7N61AHPME24567FE
244
+ :title: Start using the plugin without trial and error
245
+ :status: accepted
246
+ :contributes_to: GOAL-ONE-MONOREPO
247
+
248
+ A team can add the plugin to an existing repository, and add new crates later, with one command each, and can tell from the documentation whether its Nx, Cargo and operating system are supported.
249
+ :::
250
+
251
+ :::mara need NEED-CLEAR-FAILURES
252
+ :mid: 01M78FHG7FV4WYX1Q7P92VTFTT
253
+ :title: Understand what is missing or misconfigured
254
+ :status: accepted
255
+ :contributes_to: GOAL-ONE-MONOREPO
256
+ :contributes_to: GOAL-TRUSTED-CACHE
257
+
258
+ When a tool is missing, a version is unsupported or a setting cannot work, the developer learns what is wrong, where, and what to do about it, before or instead of a confusing failure deep inside a build.
259
+ :::
260
+
261
+ ## Vocabulary
262
+
263
+ :::mara term TERM-WORKSPACE-CONTEXT
264
+ :mid: 01M78FHG7FMWPZ9BFDB3SSSXM3
265
+ :title: Workspace context
266
+ :status: accepted
267
+
268
+ Everything that Cargo scopes to one Cargo workspace and that the plugin therefore handles per workspace: the lockfile, the build directory, the toolchain file, the batches and the coverage baseline. A repository has one workspace context per Cargo workspace, including each [[TERM-STANDALONE-CRATE]].
269
+ :::
270
+
271
+ :::mara term TERM-STANDALONE-CRATE
272
+ :mid: 01M78FHG7F37Z611RA86TV4DP2
273
+ :title: Standalone crate
274
+ :status: accepted
275
+ :aliases: workspace of one
276
+
277
+ A crate that is not a member of any Cargo workspace, either because no enclosing manifest declares a workspace or because the enclosing workspace excludes it. The plugin treats it as a workspace with one member, with its own lockfile and build directory.
278
+ :::
279
+
280
+ :::mara term TERM-WORKSPACE-PROJECT
281
+ :mid: 01M78FHG7F8DTF27C4K7XPZK6X
282
+ :title: Workspace project
283
+ :status: accepted
284
+ :aliases: synthetic project
285
+
286
+ The Nx project that hosts the tasks of a whole Cargo workspace, such as documentation, auditing and coverage collection. It is rooted at the workspace folder and depends on every member. When the root manifest also defines a crate, that crate's project takes this role. See [[REQ-WORKSPACE-PROJECT]].
287
+ :::
288
+
289
+ :::mara term TERM-BUILD-DIR
290
+ :mid: 01M78FHG7FC78D37XE5W6AAEDD
291
+ :title: Build directory
292
+ :status: accepted
293
+
294
+ The directory where Cargo keeps intermediate build files, set by `build.build-dir`. Cargo owns it: its layout is internal to Cargo, and the plugin never names a path inside it. Each build directory has one build lock.
295
+ :::
296
+
297
+ :::mara term TERM-ARTIFACT-DIR
298
+ :mid: 01M78FHG7FX7GW7Y4KYF94XF2B
299
+ :title: Artifact directory
300
+ :status: accepted
301
+ :aliases: target directory
302
+
303
+ The directory where Cargo puts final artifacts such as binaries, set by `build.target-dir`. It is the only Cargo directory that Nx outputs point into.
304
+ :::
305
+
306
+ :::mara term TERM-GROUP
307
+ :mid: 01M78FHG7FKNVJ758TVW9DMDAD
308
+ :title: Batch group
309
+ :status: accepted
310
+ :aliases: group
311
+ :aliases: build flavour
312
+
313
+ The set of tasks that the plugin serves together, with one cargo command for each step of their target: tasks of the same kind in the same Cargo workspace whose commands would differ only in the crates they select. They have the same feature set, profile and target triple, the same options that shape the command, such as the switch for `--all-targets`, and the same environment, of which cargo never gets the two variables by which Nx names a task's project ([[ADR-TASK-NAME-VARIABLES]]), so that tasks of one target and configuration share it. Where their command would pass a flag whose effect on a crate depends on which other crates it selects, would select crates whose features cargo then resolves for that selection alone, or would set a runner where the user may have configured one, each task forms a group of one crate ([[DES-BATCH]]). Only those cases do: a group that holds one task because the command names one crate, or because Nx restored the others from the cache, selects its crates as any group does.
314
+ :::
315
+
316
+ :::mara term TERM-FEATURE-UNIFICATION
317
+ :mid: 01M78FHG7FH1JD1FSYB97BFN9P
318
+ :title: Feature unification
319
+ :status: accepted
320
+
321
+ Cargo's merging of the features requested for a shared dependency across all the crates that are built together. The same crate can therefore be compiled with different features of its dependencies depending on which other crates are in the same cargo invocation.
322
+ :::
323
+
324
+ :::mara term TERM-HACK-CRATE
325
+ :mid: 01M78FHG7FTG4JJ6EH5BFWDMBF
326
+ :title: Hack crate
327
+ :status: accepted
328
+ :aliases: workspace-hack crate
329
+
330
+ The crate that cargo-hakari generates and every workspace member depends on. It depends on the workspace's third-party dependencies with the union of the features that the members ask for, so those dependencies are compiled with the same features whichever members are built. It leaves out the members themselves, third-party crates that depend on a member through normal or build dependencies, and platform-specific dependencies on platforms that its configuration does not list ([[EVD-HAKARI-UNIFICATION]]). The workspace's cargo-hakari configuration names it. The plugin never publishes it, and [[DES-RELEASE]] says what happens to the crates that depend on it when they are published.
331
+ :::
332
+
333
+ :::mara term TERM-EXTERNAL-NODE
334
+ :mid: 01M78FHG7FTX12MCSFNZK69KW7
335
+ :title: External node
336
+ :status: retired
337
+
338
+ A node in the Nx graph for a dependency that is not a project in the repository. The plugin was to create one per direct external crate dependency, with the prefix `cargo:`.
339
+
340
+ Retired on 13 November 2026: v1 creates no external nodes. A crate's locked dependencies reach its cache key through the lockfile task of its workspace ([[ADR-LOCKFILE-TASK]], [[DES-LOCKFILE-HASHING]]).
341
+ :::
342
+
343
+ :::mara term TERM-TEST-MODE
344
+ :mid: 01M78FHG7FZA0TQ1TJABZBVGAP
345
+ :title: Test mode
346
+ :status: accepted
347
+
348
+ The kind of result a `test` task produces in the current run: `full` for the whole suite, or `affected:<baseline commit>` for the tests selected against a coverage baseline. The test mode is part of the task's cache key.
349
+ :::
350
+
351
+ :::mara term TERM-BASELINE
352
+ :mid: 01M78FHG7FY74HS6V7R78Z5FYH
353
+ :title: Coverage baseline
354
+ :status: accepted
355
+ :aliases: coverage database
356
+
357
+ The per-test coverage data that cargo-affected collected for one commit of the main branch. Selecting affected tests means comparing a change against this data.
358
+ :::
359
+
360
+ :::mara term TERM-ARTIFACT-TARGET
361
+ :mid: 01M78FHG7F5DC68V07AK3ENTZN
362
+ :title: Artifact target
363
+ :status: accepted
364
+
365
+ A target that produces a kind of artifact other than native binaries and libraries, and therefore has its own name: `napi-build` for a Node addon and `wasm-build` for a wasm package.
366
+ :::