@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,341 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filesToKeep = filesToKeep;
4
+ exports.keepFiles = keepFiles;
5
+ exports.putBack = putBack;
6
+ const node_fs_1 = require("node:fs");
7
+ const node_path_1 = require("node:path");
8
+ const directories_1 = require("../cargo/directories");
9
+ const host_triple_1 = require("../cargo/host-triple");
10
+ const nx_bridge_1 = require("../compatibility/nx-bridge");
11
+ const nx_glob_1 = require("../graph/nx-glob");
12
+ const outputs_1 = require("../graph/outputs");
13
+ const real_path_1 = require("../graph/real-path");
14
+ const targets_1 = require("../graph/targets");
15
+ const build_records_1 = require("./build-records");
16
+ const stage_1 = require("./stage");
17
+ function state({ dev, ino, size, mtimeMs, mode }) {
18
+ return { dev, ino, size, mtimeMs, mode };
19
+ }
20
+ function same(a, b) {
21
+ return (a.dev === b.dev &&
22
+ a.ino === b.ino &&
23
+ a.size === b.size &&
24
+ a.mtimeMs === b.mtimeMs &&
25
+ a.mode === b.mode);
26
+ }
27
+ /**
28
+ * The files that a `test` or `bench` group of a batch keeps while its
29
+ * commands run, so that they are as the command's builds left them
30
+ * afterwards (`DES-BATCH`, "Files that a test batch puts back").
31
+ *
32
+ * The candidates are the final files that the group's cargo commands can
33
+ * link again: for each crate that the group can build for its tests, every
34
+ * member of the workspace where the group selects the whole workspace and
35
+ * its own crates where it selects them, those with a binary and an
36
+ * integration test or bench for `test` ({@link testReplacesExecutables}) and
37
+ * those with a binary for `bench`, the names that the outputs of a crate's
38
+ * `build` give its final files ({@link finalFileNames}), in the folder of
39
+ * each triple that the group's command builds for ({@link callTriples}) and
40
+ * of its profile ({@link profileFolder}), below the physical path of the
41
+ * artifact directory that cargo reports for the group.
42
+ *
43
+ * A candidate is kept where a cached `build` task of the command's task
44
+ * graph that is not one of the group's tasks, and for a group that selects
45
+ * its crates belongs to one of their projects, stores it: one of the
46
+ * outputs that Nx resolved for the task names the file or a folder above
47
+ * it, or is a glob that Nx's own glob matching accepts for it, with `!`
48
+ * exclusions. No folder is listed and no file is searched for.
49
+ *
50
+ * @param members The group's tasks with their commands.
51
+ * @param ids The group's task ids.
52
+ * @param match Nx's glob matching, for outputs that are globs; loaded from
53
+ * the Nx of the repository where not given.
54
+ * @param directoriesOf Cargo's directories for the group, as cargo reports them.
55
+ * @returns The candidates that a build stores, with the group's
56
+ * directories, or the problem with which the group's tasks fail.
57
+ */
58
+ // @mara implements DES-BATCH
59
+ function filesToKeep(members, ids, selection, context, match, directoriesOf = directories_1.reportedDirectories) {
60
+ var _a, _b;
61
+ const [first] = members;
62
+ const target = first === null || first === void 0 ? void 0 : first.prepared.target;
63
+ if (first === undefined || (target !== "test" && target !== "bench")) {
64
+ return { files: [] };
65
+ }
66
+ const wholeWorkspace = selection.kind === "workspace";
67
+ const projects = new Set(ids.map((id) => { var _a, _b; return (_b = (_a = context.taskGraph) === null || _a === void 0 ? void 0 : _a.tasks[id]) === null || _b === void 0 ? void 0 : _b.target.project; }));
68
+ const builds = storingBuilds(new Set(ids), wholeWorkspace ? undefined : projects, context);
69
+ const crates = (wholeWorkspace
70
+ ? ((_a = first.invocation.workspaceMembers) !== null && _a !== void 0 ? _a : [])
71
+ : members.flatMap((member) => member.invocation.package === undefined ? [] : [member.invocation.package])).filter(target === "test" ? targets_1.testReplacesExecutables : hasBinary);
72
+ if (builds.length === 0 || crates.length === 0) {
73
+ return { files: [] };
74
+ }
75
+ let matcher = match;
76
+ if (matcher === undefined && builds.some((build) => !build.outputs.every(isLiteral))) {
77
+ try {
78
+ matcher = (0, nx_bridge_1.loadNxNative)(context.root).matchGlobPaths;
79
+ }
80
+ catch (error) {
81
+ const owners = builds.filter((build) => !build.outputs.every(isLiteral));
82
+ return {
83
+ problem: `could not read the outputs ${owners.map((build) => `${build.outputs.join(", ")} of ${build.owner}`).join(" and ")} as Nx reads them, to tell which files those builds store, because Nx's glob matching could not be loaded: ${messageOf(error)}`,
84
+ };
85
+ }
86
+ }
87
+ let directories;
88
+ try {
89
+ const reported = directoriesOf(first.invocation.cwd, first.prepared.env);
90
+ directories = {
91
+ artifact: (0, real_path_1.physicalPath)(reported.artifact),
92
+ build: (0, real_path_1.physicalPath)(reported.build),
93
+ };
94
+ }
95
+ catch (error) {
96
+ if (!(error instanceof directories_1.DirectoryReportError)) {
97
+ throw error;
98
+ }
99
+ return {
100
+ problem: `could not get Cargo's directories for the group, to tell which files of the command's builds its cargo commands link again: ${error.message}`,
101
+ };
102
+ }
103
+ const { options, env, cwd } = first.prepared;
104
+ let picked = (0, build_records_1.callTriples)(options, env, cwd);
105
+ // Cargo builds for the host's triple where the option or the configuration
106
+ // says `host-tuple`, into that triple's folder, which a cached build that
107
+ // names the triple stores.
108
+ if ((picked.kind === "triples" && picked.triples.includes("host-tuple")) ||
109
+ (picked.kind === "unnamed" && picked.value === "host-tuple")) {
110
+ const host = selection.kind === "workspace" && selection.host !== undefined && selection.host !== ""
111
+ ? selection.host
112
+ : (0, host_triple_1.hostTriple)(cwd, env);
113
+ if (host !== undefined) {
114
+ picked = (0, build_records_1.callTriples)(options, env, cwd, host);
115
+ }
116
+ }
117
+ // Any other triple whose folder the plugin cannot name, such as a target
118
+ // specification file, gives no candidate (`DES-OUTPUTS`).
119
+ const triples = picked.kind === "none" ? [""] : picked.kind === "triples" ? picked.triples : [];
120
+ const profile = (0, build_records_1.profileFolder)((_b = options.profile) !== null && _b !== void 0 ? _b : (target === "bench" ? "bench" : undefined));
121
+ const root = (0, real_path_1.physicalPath)(context.root);
122
+ const files = [];
123
+ const seen = new Set();
124
+ for (const crate of crates) {
125
+ for (const triple of triples) {
126
+ for (const name of (0, outputs_1.finalFileNames)(crate)) {
127
+ const path = (0, node_path_1.join)(directories.artifact, triple, profile, name);
128
+ const inside = (0, node_path_1.relative)(root, path);
129
+ if (seen.has(path) || inside.startsWith("..") || (0, node_path_1.isAbsolute)(inside)) {
130
+ continue;
131
+ }
132
+ seen.add(path);
133
+ const owner = builds.find((build) => stores(build.outputs, inside.split(node_path_1.sep).join("/"), matcher));
134
+ if (owner !== undefined) {
135
+ files.push({ path, owner: owner.owner });
136
+ }
137
+ }
138
+ }
139
+ }
140
+ return { files, directories };
141
+ }
142
+ /**
143
+ * Keeps each of `files` that is a regular file in a new stage of the
144
+ * artifact directory, a hard link at the same path relative to it, or a
145
+ * copy where the file system refuses a link, so that {@link putBack} can put
146
+ * it back once the group's commands have run. A missing file, or one that
147
+ * is no regular file, such as a symbolic link, is not kept. Cargo replaces
148
+ * a file that it links into the artifact directory by removing it first,
149
+ * and a linker writes a new file, so the kept one stays as it was;
150
+ * {@link putBack} checks that it did. No stage is made where nothing is kept.
151
+ *
152
+ * @returns What is kept, or the problem with the first file that could not
153
+ * be looked at or kept, in which case nothing is kept any more.
154
+ */
155
+ // @mara implements DES-BATCH
156
+ function keepFiles(files, directories) {
157
+ const found = [];
158
+ for (const file of files) {
159
+ let stats;
160
+ try {
161
+ stats = (0, node_fs_1.lstatSync)(file.path);
162
+ }
163
+ catch (error) {
164
+ if (error.code === "ENOENT") {
165
+ continue;
166
+ }
167
+ return {
168
+ problem: `could not look at ${file.path}, which ${file.owner} stores: ${messageOf(error)}`,
169
+ };
170
+ }
171
+ if (stats.isFile()) {
172
+ found.push({ file, stats });
173
+ }
174
+ }
175
+ if (found.length === 0 || directories === undefined) {
176
+ return { keeping: { files: [] } };
177
+ }
178
+ let stage;
179
+ try {
180
+ stage = (0, stage_1.createStage)(directories);
181
+ }
182
+ catch (error) {
183
+ if (!(error instanceof stage_1.StageError)) {
184
+ throw error;
185
+ }
186
+ return {
187
+ problem: `could not make a stage to keep the files of the command's builds in: ${error.message}`,
188
+ };
189
+ }
190
+ const kept = [];
191
+ for (const { file, stats } of found) {
192
+ const staged = (0, stage_1.pathInStage)(stage, file.path);
193
+ try {
194
+ if (staged === undefined) {
195
+ throw new Error("it lies outside the artifact directory");
196
+ }
197
+ (0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(staged), { recursive: true });
198
+ try {
199
+ (0, node_fs_1.linkSync)(file.path, staged);
200
+ }
201
+ catch (_a) {
202
+ (0, node_fs_1.copyFileSync)(file.path, staged, node_fs_1.constants.COPYFILE_FICLONE);
203
+ }
204
+ kept.push(Object.assign(Object.assign({}, file), { staged, before: state(stats), kept: state((0, node_fs_1.lstatSync)(staged)) }));
205
+ }
206
+ catch (error) {
207
+ (0, stage_1.removeStage)(stage);
208
+ return {
209
+ problem: `could not keep ${file.path}, which ${file.owner} stores, in the stage ${stage.path}: ${messageOf(error)}`,
210
+ };
211
+ }
212
+ }
213
+ return { keeping: { stage, files: kept } };
214
+ }
215
+ /**
216
+ * Puts back each file that {@link keepFiles} kept where the group's commands
217
+ * replaced or removed it, by the stage's move, and removes the stage.
218
+ *
219
+ * @returns A problem for each file that could not be put back, or whose
220
+ * kept copy changed while the commands ran, and a warning where the stage
221
+ * could not be removed.
222
+ */
223
+ // @mara implements DES-BATCH
224
+ function putBack(keeping) {
225
+ const { stage } = keeping;
226
+ if (stage === undefined) {
227
+ return { problems: [] };
228
+ }
229
+ const problems = [];
230
+ for (const file of keeping.files) {
231
+ try {
232
+ if (!same(state((0, node_fs_1.lstatSync)(file.staged)), file.kept)) {
233
+ problems.push(`found that ${file.path}, which ${file.owner} stores, was written in place or had its permissions changed while the group's cargo commands ran, so that it could not keep the file as ${file.owner} left it`);
234
+ continue;
235
+ }
236
+ let current;
237
+ try {
238
+ current = (0, node_fs_1.lstatSync)(file.path);
239
+ }
240
+ catch (error) {
241
+ if (error.code !== "ENOENT") {
242
+ throw error;
243
+ }
244
+ current = undefined;
245
+ }
246
+ if (current !== undefined && same(state(current), file.before)) {
247
+ continue;
248
+ }
249
+ const moved = (0, stage_1.moveStagedFiles)(stage, [
250
+ { from: file.staged, to: file.path, packageId: file.owner },
251
+ ]);
252
+ for (const failures of moved.values()) {
253
+ problems.push(...failures.map((failure) => `could not put back ${file.path}, which ${file.owner} stores: ${failure}`));
254
+ }
255
+ }
256
+ catch (error) {
257
+ problems.push(`could not put back ${file.path}, which ${file.owner} stores, from ${file.staged}: ${messageOf(error)}`);
258
+ }
259
+ }
260
+ const warning = (0, stage_1.removeStage)(stage);
261
+ return warning === undefined ? { problems } : { problems, warning };
262
+ }
263
+ // The cached `build` tasks of the command's task graph that are not tasks of
264
+ // the group, and, where `projects` is given, belong to one of them, each with
265
+ // its outputs as Nx resolved them, relative to the repository: an absolute
266
+ // output inside the repository made relative, one outside it left out, since
267
+ // Nx cannot store it.
268
+ function storingBuilds(own, projects, context) {
269
+ var _a, _b, _c, _d, _e, _f, _g, _h;
270
+ const roots = [...new Set([context.root, (0, real_path_1.physicalPath)(context.root)])];
271
+ const builds = [];
272
+ for (const [id, task] of Object.entries((_b = (_a = context.taskGraph) === null || _a === void 0 ? void 0 : _a.tasks) !== null && _b !== void 0 ? _b : {})) {
273
+ const { project, target } = task.target;
274
+ if (own.has(id) || task.cache !== true || (projects !== undefined && !projects.has(project))) {
275
+ continue;
276
+ }
277
+ const metadata = (_g = (_f = (_e = (_d = (_c = context.projectGraph) === null || _c === void 0 ? void 0 : _c.nodes[project]) === null || _d === void 0 ? void 0 : _d.data.targets) === null || _e === void 0 ? void 0 : _e[target]) === null || _f === void 0 ? void 0 : _f.metadata) === null || _g === void 0 ? void 0 : _g[targets_1.targetCargoMetadataKey];
278
+ if ((metadata === null || metadata === void 0 ? void 0 : metadata.target) !== "build") {
279
+ continue;
280
+ }
281
+ const outputs = ((_h = task.outputs) !== null && _h !== void 0 ? _h : []).flatMap((output) => {
282
+ const negated = output.startsWith("!");
283
+ const path = negated ? output.slice(1) : output;
284
+ const inside = repositoryPath(path, roots);
285
+ return inside === undefined ? [] : [`${negated ? "!" : ""}${inside}`];
286
+ });
287
+ if (outputs.some((output) => !output.startsWith("!"))) {
288
+ builds.push({ owner: `${project}:${target}`, outputs });
289
+ }
290
+ }
291
+ return builds;
292
+ }
293
+ // An output relative to the repository, with `/` between its segments and
294
+ // without a trailing one, `.` for the repository root itself; `undefined`
295
+ // for an absolute one outside it.
296
+ function repositoryPath(output, roots) {
297
+ if (!(0, node_path_1.isAbsolute)(output)) {
298
+ return (0, node_path_1.normalize)(output).split(node_path_1.sep).join("/").replace(/\/+$/, "") || ".";
299
+ }
300
+ for (const root of roots) {
301
+ const inside = (0, node_path_1.relative)(root, output);
302
+ if (!inside.startsWith("..") && !(0, node_path_1.isAbsolute)(inside)) {
303
+ return inside.split(node_path_1.sep).join("/") || ".";
304
+ }
305
+ }
306
+ return undefined;
307
+ }
308
+ // Whether a build whose outputs are `outputs` stores the file `path`, both
309
+ // relative to the repository: as Nx stores a task's outputs, a file that an
310
+ // output names, a file below a folder that one names, and for globs and
311
+ // exclusions what Nx's own glob matching accepts, each output also followed
312
+ // by `/**`, so that a folder that a glob matches stands for its files. An
313
+ // output that is the repository root, `.`, is a folder above every file.
314
+ function stores(outputs, path, match) {
315
+ if (outputs.every(isLiteral)) {
316
+ return outputs.some((output) => output === "." || output === path || path.startsWith(`${output}/`));
317
+ }
318
+ if (match === undefined) {
319
+ return false;
320
+ }
321
+ const globs = outputs.map((output) => (output === "." ? "**" : output === "!." ? "!**" : output));
322
+ return match([...globs, ...globs.map((glob) => `${glob}/**`)], [path])[0] === true;
323
+ }
324
+ // Whether an output names a path rather than a glob: no exclusion and no
325
+ // pattern segment, as Nx reads its segments; an escape counts as a pattern.
326
+ function isLiteral(output) {
327
+ return (!output.startsWith("!") &&
328
+ output
329
+ .split("/")
330
+ .every((segment) => segment === "" ||
331
+ segment === "." ||
332
+ segment === ".." ||
333
+ (0, nx_glob_1.literalSegment)(segment) === segment));
334
+ }
335
+ function hasBinary(pkg) {
336
+ return pkg.targets.some((target) => target.kind.includes("bin"));
337
+ }
338
+ function messageOf(error) {
339
+ return error instanceof Error ? error.message : String(error);
340
+ }
341
+ //# sourceMappingURL=kept-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kept-files.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/kept-files.ts"],"names":[],"mappings":";;AA0GA,kCA+FC;AAgBD,8BAyDC;AAWD,0BA4CC;AAzUD,qCAA8F;AAC9F,yCAAgF;AAEhF,sDAI8B;AAC9B,sDAAkD;AAElD,0DAA+E;AAC/E,8CAAkD;AAClD,8CAAkD;AAClD,kDAAkD;AAClD,8CAAmF;AACnF,mDAA6D;AAG7D,mCAOiB;AA6BjB,SAAS,KAAK,CAAC,EAAE,GAAG,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AC;QACvB,MAAM;aACH,KAAK,CAAC,GAAG,CAAC;aACV,KAAK,CACJ,CAAC,OAAO,EAAE,EAAE,CACV,OAAO,KAAK,EAAE;YACd,OAAO,KAAK,GAAG;YACf,OAAO,KAAK,IAAI;YAChB,IAAA,wBAAc,EAAC,OAAO,CAAC,KAAK,OAAO,CACtC,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,GAAiB;IAClC,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ExecutorContext } from "@nx/devkit";
2
+ import type { CargoTargetOptions } from "../command";
3
+ /**
4
+ * The executor of the lockfile task and of `hakari-check`,
5
+ * `@convesoft/nx-rust:lockfile`, which has no batch implementation, so that
6
+ * neither task ever joins a batch (`DES-LOCKFILE-HASHING`,
7
+ * `DES-UNIFICATION`). The lockfile task runs `cargo update --workspace` in
8
+ * the workspace root, with `--locked` in locked mode, and then writes the
9
+ * members' digests from the `Cargo.lock` that cargo leaves; `hakari-check`
10
+ * runs `cargo hakari generate --diff` and then `cargo hakari manage-deps
11
+ * --dry-run` there, and fails where either fails. It also runs the coverage
12
+ * baseline target (`DES-BASELINE`, `collectBaseline`).
13
+ */
14
+ export default function lockfile(options: CargoTargetOptions, context: ExecutorContext): Promise<{
15
+ success: boolean;
16
+ }>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = lockfile;
4
+ const targets_1 = require("../../graph/targets");
5
+ const declared_options_1 = require("../declared-options");
6
+ const coverage_baseline_1 = require("../coverage-baseline");
7
+ const task_1 = require("../task");
8
+ // The executor, with the options of its schema, read where graph creation
9
+ // reads them (`declaredExecutorOptions`).
10
+ const executor = {
11
+ name: targets_1.lockfileExecutor,
12
+ shortName: "lockfile",
13
+ declared: (0, declared_options_1.declaredOptionsOf)(targets_1.lockfileExecutor),
14
+ serves: (target) => target === "lockfile" || target === "hakari-check",
15
+ };
16
+ /**
17
+ * The executor of the lockfile task and of `hakari-check`,
18
+ * `@convesoft/nx-rust:lockfile`, which has no batch implementation, so that
19
+ * neither task ever joins a batch (`DES-LOCKFILE-HASHING`,
20
+ * `DES-UNIFICATION`). The lockfile task runs `cargo update --workspace` in
21
+ * the workspace root, with `--locked` in locked mode, and then writes the
22
+ * members' digests from the `Cargo.lock` that cargo leaves; `hakari-check`
23
+ * runs `cargo hakari generate --diff` and then `cargo hakari manage-deps
24
+ * --dry-run` there, and fails where either fails. It also runs the coverage
25
+ * baseline target (`DES-BASELINE`, `collectBaseline`).
26
+ */
27
+ // @mara implements DES-UNIFICATION
28
+ // @mara implements DES-TARGETS
29
+ // @mara implements DES-LOCKFILE-HASHING
30
+ function lockfile(options, context) {
31
+ var _a, _b;
32
+ const metadata = (_b = (_a = context.target) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b[targets_1.targetCargoMetadataKey];
33
+ return (metadata === null || metadata === void 0 ? void 0 : metadata.target) === "coverage-baseline"
34
+ ? (0, coverage_baseline_1.collectBaseline)(options, context)
35
+ : (0, task_1.runTask)(executor, options, context);
36
+ }
37
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../nx-rust/src/executors/lockfile/executor.ts"],"names":[],"mappings":";;AA+BA,2BAUC;AAxCD,iDAA+E;AAE/E,0DAAwD;AACxD,4DAAuD;AACvD,kCAAkC;AAGlC,0EAA0E;AAC1E,0CAA0C;AAC1C,MAAM,QAAQ,GAAmB;IAC/B,IAAI,EAAE,0BAAgB;IACtB,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE,IAAA,oCAAiB,EAAC,0BAAgB,CAAC;IAC7C,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,UAAU,IAAI,MAAM,KAAK,cAAc;CACvE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,mCAAmC;AACnC,+BAA+B;AAC/B,wCAAwC;AACxC,SAAwB,QAAQ,CAC9B,OAA2B,EAC3B,OAAwB;;IAExB,MAAM,QAAQ,GAAG,MAAA,MAAA,OAAO,CAAC,MAAM,0CAAE,QAAQ,0CAAG,gCAAsB,CAErD,CAAC;IACd,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,MAAK,mBAAmB;QAC7C,CAAC,CAAC,IAAA,mCAAe,EAAC,OAAO,EAAE,OAAO,CAAC;QACnC,CAAC,CAAC,IAAA,cAAO,EAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "outputCapture": "pipe",
5
+ "title": "lockfile",
6
+ "description": "Runs the workspace-level targets of a Cargo workspace that never join a batch, in the workspace's root folder: lockfile lets cargo update --workspace bring Cargo.lock up to date and writes a digest of each member's locked dependencies, which the cached targets of the members read; hakari-check checks the hack crate of cargo-hakari; coverage-baseline brings the coverage baseline of the affected tests up to date with cargo affected collect.",
7
+ "type": "object",
8
+ "properties": {
9
+ "features": {
10
+ "type": "array",
11
+ "items": {
12
+ "type": "string"
13
+ },
14
+ "description": "Features to activate, passed as --features. Set the same as the test runs of the workspace. Taken by coverage-baseline."
15
+ },
16
+ "allFeatures": {
17
+ "type": "boolean",
18
+ "description": "Activate all features, passed as --all-features. Set the same as the test runs of the workspace. Taken by coverage-baseline."
19
+ },
20
+ "noDefaultFeatures": {
21
+ "type": "boolean",
22
+ "description": "Do not activate the default features, passed as --no-default-features. Set the same as the test runs of the workspace. Taken by coverage-baseline."
23
+ },
24
+ "profile": {
25
+ "type": "string",
26
+ "description": "The Cargo profile to build with, passed as --cargo-profile. Set the same as the test runs of the workspace. Taken by coverage-baseline."
27
+ },
28
+ "fullCollect": {
29
+ "type": "boolean",
30
+ "description": "Always collect the coverage of every test into an empty database, never cargo affected collect --diff, as for a nightly run. Taken by coverage-baseline."
31
+ },
32
+ "diffOnly": {
33
+ "type": "boolean",
34
+ "description": "Collect only with cargo affected collect --diff, and collect nothing where it cannot run, leaving a full collection to a run with --fullCollect. Taken by coverage-baseline."
35
+ },
36
+ "fullCollectThreshold": {
37
+ "type": "integer",
38
+ "minimum": 0,
39
+ "description": "How many commits the oldest collection of the baseline may lie behind HEAD before a full collection replaces cargo affected collect --diff. The inferred target sets 100. Taken by coverage-baseline."
40
+ },
41
+ "separateBuildDir": {
42
+ "type": "boolean",
43
+ "description": "Build the instrumented tests in a build directory of their own, target/affected/build, also where Cargo's configuration sets build.build-dir. Taken by coverage-baseline."
44
+ },
45
+ "pluginVersion": {
46
+ "type": "string",
47
+ "description": "The plugin's version, which the plugin sets for the cache key. Not meant to be set by hand."
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,73 @@
1
+ import type { TargetCargoMetadata } from "../graph/targets";
2
+ import { type InstalledNapiCli } from "../tools/napi-cli";
3
+ import { type GroupMember, type LiveOutput, type MemberResult } from "./group-run";
4
+ /** What a `napi-build` task needs beyond a `build` task, from its checks before cargo. */
5
+ export interface NapiTask {
6
+ /** The absolute path of the crate's folder, where the outputs go. */
7
+ crateFolder: string;
8
+ /** The napi CLI that Node resolves from the crate's folder. */
9
+ cli: InstalledNapiCli;
10
+ /** The host triple, for which the compile builds. */
11
+ host: string;
12
+ /** The addon's file name, `<binaryName>.<platform>-<arch>[-<abi>].node`. */
13
+ addon: string;
14
+ }
15
+ /** Thrown by {@link prepareNapiTask} with the message with which the task fails before cargo. */
16
+ export declare class NapiTaskError extends Error {
17
+ constructor(message: string);
18
+ }
19
+ /**
20
+ * The checks of a `napi-build` task before cargo runs (`DES-NAPI`, "What
21
+ * the step needs", "Library names"; `DES-DIAGNOSTICS`), in this order:
22
+ *
23
+ * - the crate's library has the file name of another crate's file, which
24
+ * graph creation records ({@link TargetCargoMetadata.sharedLibrary});
25
+ * - the crate's folder has no `package.json`, from which the napi CLI reads
26
+ * the crate's `napi` settings;
27
+ * - for a cached task, the settings' `dtsHeaderFile` lies outside the
28
+ * repository, where Nx cannot hash it, or is not the one that the graph's
29
+ * inputs hold;
30
+ * - Node resolves no `@napi-rs/cli` from the crate's folder, or one of
31
+ * another major than 3 or older than 3.4.0 (`ADR-NAPI-RS-3`);
32
+ * - `rustc -vV` names no host triple in the workspace root, or Cargo's
33
+ * configuration or `CARGO_BUILD_TARGET` picks another triple there:
34
+ * `napi-build` builds for the host only (`ADR-V1-SCOPE`);
35
+ * - the installed CLI names the addon's file otherwise than the outputs that
36
+ * graph creation declared, where the target is cached.
37
+ *
38
+ * @param crateFolder The absolute path of the crate's folder.
39
+ * @param cwd The absolute path of the workspace root, where cargo runs.
40
+ * @param cached Whether Nx caches the task, so that its outputs must name the addon.
41
+ * @throws {NapiTaskError} With the message of the first check that fails.
42
+ */
43
+ export declare function prepareNapiTask(task: string, crate: string, metadata: TargetCargoMetadata, crateFolder: string, cwd: string, env: NodeJS.ProcessEnv, cached: boolean, repositoryRoot?: string): NapiTask;
44
+ /**
45
+ * Runs a group of `napi-build` tasks (`DES-NAPI`): asks `cargo tree` for the
46
+ * crates that the group's command compiles for each addon through normal
47
+ * dependencies, with the group's selection and feature flags; fails the
48
+ * tasks whose closure holds a crate that depends on `napi-derive` of
49
+ * another major than 3; empties the type-definition folder of the group's
50
+ * configuration in Cargo's build directory; runs the group's compile with
51
+ * `NAPI_TYPE_DEF_TMP_FOLDER` set to that folder and `NAPI_FORCE_BUILD_<CRATE>`
52
+ * set to a value of this compile's own for every crate of the closures that
53
+ * depends on `napi-derive` ({@link runGroup}, which runs the checks after
54
+ * cargo of `build`); then, for each task whose crate passed, checks that
55
+ * every crate of its closure that the compile forced wrote its file, and
56
+ * post-processes the library into the addon, its JS loader and its type
57
+ * definitions with the functions of the installed `@napi-rs/cli`.
58
+ *
59
+ * Only this step sets those variables; `build`, `test`, `check` and `lint`
60
+ * run without them, as plain cargo does (`REQ-CARGO-UNCHANGED`,
61
+ * `ADR-NAPI-SHARED-BUILD-DIR`).
62
+ *
63
+ * @returns One result per member, in order.
64
+ */
65
+ export declare function runNapiGroup(members: readonly GroupMember[], verbose?: boolean, live?: LiveOutput): Promise<MemberResult[]>;
66
+ /**
67
+ * The dynamic libraries that cargo's JSON messages report for each package's
68
+ * `cdylib` target, by the package's ID ({@link reportedCdylibFiles}): the
69
+ * files with the extension of a dynamic library, `.so`, `.dylib` or `.dll`.
70
+ * Cargo reports the file where it puts it, in the folder of a triple where
71
+ * one is selected, also the host's (`DES-NAPI`).
72
+ */
73
+ export declare function reportedLibraries(output: string): Map<string, string[]>;