@convesoft/nx-rust 0.0.0 → 1.0.0-rc.1

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 (391) hide show
  1. package/LICENSE-APACHE +201 -0
  2. package/LICENSE-MIT +21 -0
  3. package/README.md +47 -1
  4. package/executors.json +35 -0
  5. package/generators.json +19 -0
  6. package/package.json +17 -4
  7. package/src/cargo/build-settings.d.ts +54 -0
  8. package/src/cargo/build-settings.js +93 -0
  9. package/src/cargo/build-settings.js.map +1 -0
  10. package/src/cargo/configured-runner.d.ts +36 -0
  11. package/src/cargo/configured-runner.js +99 -0
  12. package/src/cargo/configured-runner.js.map +1 -0
  13. package/src/cargo/configured-tools.d.ts +35 -0
  14. package/src/cargo/configured-tools.js +46 -0
  15. package/src/cargo/configured-tools.js.map +1 -0
  16. package/src/cargo/dep-info-basedir.d.ts +18 -0
  17. package/src/cargo/dep-info-basedir.js +38 -0
  18. package/src/cargo/dep-info-basedir.js.map +1 -0
  19. package/src/cargo/directories.d.ts +40 -0
  20. package/src/cargo/directories.js +89 -0
  21. package/src/cargo/directories.js.map +1 -0
  22. package/src/cargo/host-triple.d.ts +7 -0
  23. package/src/cargo/host-triple.js +21 -0
  24. package/src/cargo/host-triple.js.map +1 -0
  25. package/src/cargo/lockfile.d.ts +63 -0
  26. package/src/cargo/lockfile.js +157 -0
  27. package/src/cargo/lockfile.js.map +1 -0
  28. package/src/cargo/metadata.d.ts +112 -0
  29. package/src/cargo/metadata.js +37 -0
  30. package/src/cargo/metadata.js.map +1 -0
  31. package/src/cargo/package-specs.d.ts +54 -0
  32. package/src/cargo/package-specs.js +109 -0
  33. package/src/cargo/package-specs.js.map +1 -0
  34. package/src/cargo/paths-crates.d.ts +27 -0
  35. package/src/cargo/paths-crates.js +69 -0
  36. package/src/cargo/paths-crates.js.map +1 -0
  37. package/src/cargo/print-artifact-folders.d.ts +1 -0
  38. package/src/cargo/print-artifact-folders.js +58 -0
  39. package/src/cargo/print-artifact-folders.js.map +1 -0
  40. package/src/cargo/redirections.d.ts +87 -0
  41. package/src/cargo/redirections.js +195 -0
  42. package/src/cargo/redirections.js.map +1 -0
  43. package/src/cargo/run-cargo.d.ts +31 -0
  44. package/src/cargo/run-cargo.js +75 -0
  45. package/src/cargo/run-cargo.js.map +1 -0
  46. package/src/cargo/target-triples.d.ts +98 -0
  47. package/src/cargo/target-triples.js +265 -0
  48. package/src/cargo/target-triples.js.map +1 -0
  49. package/src/cargo/version-req.d.ts +12 -0
  50. package/src/cargo/version-req.js +122 -0
  51. package/src/cargo/version-req.js.map +1 -0
  52. package/src/compatibility/cargo-version.d.ts +43 -0
  53. package/src/compatibility/cargo-version.js +83 -0
  54. package/src/compatibility/cargo-version.js.map +1 -0
  55. package/src/compatibility/nx-bridge.d.ts +312 -0
  56. package/src/compatibility/nx-bridge.js +407 -0
  57. package/src/compatibility/nx-bridge.js.map +1 -0
  58. package/src/compatibility/nx-version.d.ts +104 -0
  59. package/src/compatibility/nx-version.js +272 -0
  60. package/src/compatibility/nx-version.js.map +1 -0
  61. package/src/executors/affected-inputs.d.ts +29 -0
  62. package/src/executors/affected-inputs.js +259 -0
  63. package/src/executors/affected-inputs.js.map +1 -0
  64. package/src/executors/affected-run.d.ts +54 -0
  65. package/src/executors/affected-run.js +394 -0
  66. package/src/executors/affected-run.js.map +1 -0
  67. package/src/executors/affected.d.ts +239 -0
  68. package/src/executors/affected.js +589 -0
  69. package/src/executors/affected.js.map +1 -0
  70. package/src/executors/baseline-context.d.ts +85 -0
  71. package/src/executors/baseline-context.js +227 -0
  72. package/src/executors/baseline-context.js.map +1 -0
  73. package/src/executors/baseline.d.ts +123 -0
  74. package/src/executors/baseline.js +356 -0
  75. package/src/executors/baseline.js.map +1 -0
  76. package/src/executors/batch.d.ts +75 -0
  77. package/src/executors/batch.js +434 -0
  78. package/src/executors/batch.js.map +1 -0
  79. package/src/executors/build-records.d.ts +110 -0
  80. package/src/executors/build-records.js +267 -0
  81. package/src/executors/build-records.js.map +1 -0
  82. package/src/executors/cargo/executor.d.ts +28 -0
  83. package/src/executors/cargo/executor.js +58 -0
  84. package/src/executors/cargo/executor.js.map +1 -0
  85. package/src/executors/cargo/schema.json +54 -0
  86. package/src/executors/cargo-invocation.d.ts +81 -0
  87. package/src/executors/cargo-invocation.js +109 -0
  88. package/src/executors/cargo-invocation.js.map +1 -0
  89. package/src/executors/cargo-output.d.ts +212 -0
  90. package/src/executors/cargo-output.js +646 -0
  91. package/src/executors/cargo-output.js.map +1 -0
  92. package/src/executors/command.d.ts +318 -0
  93. package/src/executors/command.js +517 -0
  94. package/src/executors/command.js.map +1 -0
  95. package/src/executors/coverage-baseline.d.ts +23 -0
  96. package/src/executors/coverage-baseline.js +284 -0
  97. package/src/executors/coverage-baseline.js.map +1 -0
  98. package/src/executors/declared-options.d.ts +21 -0
  99. package/src/executors/declared-options.js +58 -0
  100. package/src/executors/declared-options.js.map +1 -0
  101. package/src/executors/digests.d.ts +94 -0
  102. package/src/executors/digests.js +190 -0
  103. package/src/executors/digests.js.map +1 -0
  104. package/src/executors/dotenv-check.d.ts +79 -0
  105. package/src/executors/dotenv-check.js +553 -0
  106. package/src/executors/dotenv-check.js.map +1 -0
  107. package/src/executors/group-invocations.d.ts +80 -0
  108. package/src/executors/group-invocations.js +253 -0
  109. package/src/executors/group-invocations.js.map +1 -0
  110. package/src/executors/group-run.d.ts +114 -0
  111. package/src/executors/group-run.js +591 -0
  112. package/src/executors/group-run.js.map +1 -0
  113. package/src/executors/groups.d.ts +113 -0
  114. package/src/executors/groups.js +285 -0
  115. package/src/executors/groups.js.map +1 -0
  116. package/src/executors/input-check.d.ts +52 -0
  117. package/src/executors/input-check.js +271 -0
  118. package/src/executors/input-check.js.map +1 -0
  119. package/src/executors/kept-files.d.ts +98 -0
  120. package/src/executors/kept-files.js +341 -0
  121. package/src/executors/kept-files.js.map +1 -0
  122. package/src/executors/lockfile/executor.d.ts +16 -0
  123. package/src/executors/lockfile/executor.js +37 -0
  124. package/src/executors/lockfile/executor.js.map +1 -0
  125. package/src/executors/lockfile/schema.json +50 -0
  126. package/src/executors/napi-build.d.ts +73 -0
  127. package/src/executors/napi-build.js +420 -0
  128. package/src/executors/napi-build.js.map +1 -0
  129. package/src/executors/nextest.d.ts +185 -0
  130. package/src/executors/nextest.js +498 -0
  131. package/src/executors/nextest.js.map +1 -0
  132. package/src/executors/nx-command.d.ts +95 -0
  133. package/src/executors/nx-command.js +205 -0
  134. package/src/executors/nx-command.js.map +1 -0
  135. package/src/executors/nx-task-files.d.ts +82 -0
  136. package/src/executors/nx-task-files.js +156 -0
  137. package/src/executors/nx-task-files.js.map +1 -0
  138. package/src/executors/print-test-mode.d.ts +1 -0
  139. package/src/executors/print-test-mode.js +25 -0
  140. package/src/executors/print-test-mode.js.map +1 -0
  141. package/src/executors/release-publish/executor.d.ts +24 -0
  142. package/src/executors/release-publish/executor.js +165 -0
  143. package/src/executors/release-publish/executor.js.map +1 -0
  144. package/src/executors/release-publish/schema.json +30 -0
  145. package/src/executors/run/executor.d.ts +12 -0
  146. package/src/executors/run/executor.js +27 -0
  147. package/src/executors/run/executor.js.map +1 -0
  148. package/src/executors/run/schema.json +45 -0
  149. package/src/executors/runner-script.d.ts +12 -0
  150. package/src/executors/runner-script.js +22 -0
  151. package/src/executors/runner-script.js.map +1 -0
  152. package/src/executors/runtime-input-check.d.ts +24 -0
  153. package/src/executors/runtime-input-check.js +87 -0
  154. package/src/executors/runtime-input-check.js.map +1 -0
  155. package/src/executors/shared-artifacts.d.ts +44 -0
  156. package/src/executors/shared-artifacts.js +132 -0
  157. package/src/executors/shared-artifacts.js.map +1 -0
  158. package/src/executors/split-words.d.ts +24 -0
  159. package/src/executors/split-words.js +111 -0
  160. package/src/executors/split-words.js.map +1 -0
  161. package/src/executors/stage.d.ts +163 -0
  162. package/src/executors/stage.js +526 -0
  163. package/src/executors/stage.js.map +1 -0
  164. package/src/executors/staged-run.d.ts +24 -0
  165. package/src/executors/staged-run.js +110 -0
  166. package/src/executors/staged-run.js.map +1 -0
  167. package/src/executors/task-env.d.ts +271 -0
  168. package/src/executors/task-env.js +494 -0
  169. package/src/executors/task-env.js.map +1 -0
  170. package/src/executors/task-execution.d.ts +61 -0
  171. package/src/executors/task-execution.js +122 -0
  172. package/src/executors/task-execution.js.map +1 -0
  173. package/src/executors/task-guards.d.ts +112 -0
  174. package/src/executors/task-guards.js +430 -0
  175. package/src/executors/task-guards.js.map +1 -0
  176. package/src/executors/task-options.d.ts +114 -0
  177. package/src/executors/task-options.js +258 -0
  178. package/src/executors/task-options.js.map +1 -0
  179. package/src/executors/task.d.ts +166 -0
  180. package/src/executors/task.js +520 -0
  181. package/src/executors/task.js.map +1 -0
  182. package/src/executors/test-mode.d.ts +182 -0
  183. package/src/executors/test-mode.js +391 -0
  184. package/src/executors/test-mode.js.map +1 -0
  185. package/src/executors/test-runner.d.ts +44 -0
  186. package/src/executors/test-runner.js +159 -0
  187. package/src/executors/test-runner.js.map +1 -0
  188. package/src/executors/test-steps.d.ts +109 -0
  189. package/src/executors/test-steps.js +535 -0
  190. package/src/executors/test-steps.js.map +1 -0
  191. package/src/executors/wasm-build.d.ts +56 -0
  192. package/src/executors/wasm-build.js +216 -0
  193. package/src/executors/wasm-build.js.map +1 -0
  194. package/src/generators/crate/binary.schema.json +28 -0
  195. package/src/generators/crate/crate.d.ts +24 -0
  196. package/src/generators/crate/crate.js +108 -0
  197. package/src/generators/crate/crate.js.map +1 -0
  198. package/src/generators/crate/enclosing-workspace.d.ts +25 -0
  199. package/src/generators/crate/enclosing-workspace.js +58 -0
  200. package/src/generators/crate/enclosing-workspace.js.map +1 -0
  201. package/src/generators/crate/library.schema.json +28 -0
  202. package/src/generators/init/graph-check.d.ts +81 -0
  203. package/src/generators/init/graph-check.js +299 -0
  204. package/src/generators/init/graph-check.js.map +1 -0
  205. package/src/generators/init/init.d.ts +23 -0
  206. package/src/generators/init/init.js +113 -0
  207. package/src/generators/init/init.js.map +1 -0
  208. package/src/generators/init/report.d.ts +19 -0
  209. package/src/generators/init/report.js +93 -0
  210. package/src/generators/init/report.js.map +1 -0
  211. package/src/generators/init/schema.json +9 -0
  212. package/src/graph/artifact-kinds.d.ts +29 -0
  213. package/src/graph/artifact-kinds.js +50 -0
  214. package/src/graph/artifact-kinds.js.map +1 -0
  215. package/src/graph/artifact-names.d.ts +97 -0
  216. package/src/graph/artifact-names.js +276 -0
  217. package/src/graph/artifact-names.js.map +1 -0
  218. package/src/graph/build-records.d.ts +74 -0
  219. package/src/graph/build-records.js +104 -0
  220. package/src/graph/build-records.js.map +1 -0
  221. package/src/graph/caching.d.ts +148 -0
  222. package/src/graph/caching.js +676 -0
  223. package/src/graph/caching.js.map +1 -0
  224. package/src/graph/collisions.d.ts +106 -0
  225. package/src/graph/collisions.js +156 -0
  226. package/src/graph/collisions.js.map +1 -0
  227. package/src/graph/computation-reports.d.ts +89 -0
  228. package/src/graph/computation-reports.js +216 -0
  229. package/src/graph/computation-reports.js.map +1 -0
  230. package/src/graph/declared-files.d.ts +190 -0
  231. package/src/graph/declared-files.js +600 -0
  232. package/src/graph/declared-files.js.map +1 -0
  233. package/src/graph/discovery.d.ts +175 -0
  234. package/src/graph/discovery.js +656 -0
  235. package/src/graph/discovery.js.map +1 -0
  236. package/src/graph/edges.d.ts +25 -0
  237. package/src/graph/edges.js +94 -0
  238. package/src/graph/edges.js.map +1 -0
  239. package/src/graph/entries.d.ts +83 -0
  240. package/src/graph/entries.js +259 -0
  241. package/src/graph/entries.js.map +1 -0
  242. package/src/graph/inputs.d.ts +420 -0
  243. package/src/graph/inputs.js +746 -0
  244. package/src/graph/inputs.js.map +1 -0
  245. package/src/graph/lockfile-task.d.ts +74 -0
  246. package/src/graph/lockfile-task.js +105 -0
  247. package/src/graph/lockfile-task.js.map +1 -0
  248. package/src/graph/names.d.ts +41 -0
  249. package/src/graph/names.js +34 -0
  250. package/src/graph/names.js.map +1 -0
  251. package/src/graph/napi.d.ts +107 -0
  252. package/src/graph/napi.js +206 -0
  253. package/src/graph/napi.js.map +1 -0
  254. package/src/graph/nx-glob.d.ts +36 -0
  255. package/src/graph/nx-glob.js +152 -0
  256. package/src/graph/nx-glob.js.map +1 -0
  257. package/src/graph/nx-internals.d.ts +57 -0
  258. package/src/graph/nx-internals.js +128 -0
  259. package/src/graph/nx-internals.js.map +1 -0
  260. package/src/graph/options.d.ts +32 -0
  261. package/src/graph/options.js +80 -0
  262. package/src/graph/options.js.map +1 -0
  263. package/src/graph/outputs.d.ts +75 -0
  264. package/src/graph/outputs.js +140 -0
  265. package/src/graph/outputs.js.map +1 -0
  266. package/src/graph/path-dependencies.d.ts +122 -0
  267. package/src/graph/path-dependencies.js +459 -0
  268. package/src/graph/path-dependencies.js.map +1 -0
  269. package/src/graph/plugin-package.d.ts +36 -0
  270. package/src/graph/plugin-package.js +132 -0
  271. package/src/graph/plugin-package.js.map +1 -0
  272. package/src/graph/plugin-version.d.ts +20 -0
  273. package/src/graph/plugin-version.js +153 -0
  274. package/src/graph/plugin-version.js.map +1 -0
  275. package/src/graph/projects.d.ts +141 -0
  276. package/src/graph/projects.js +182 -0
  277. package/src/graph/projects.js.map +1 -0
  278. package/src/graph/reached-projects.d.ts +46 -0
  279. package/src/graph/reached-projects.js +102 -0
  280. package/src/graph/reached-projects.js.map +1 -0
  281. package/src/graph/real-path.d.ts +47 -0
  282. package/src/graph/real-path.js +113 -0
  283. package/src/graph/real-path.js.map +1 -0
  284. package/src/graph/redirected-uses.d.ts +98 -0
  285. package/src/graph/redirected-uses.js +434 -0
  286. package/src/graph/redirected-uses.js.map +1 -0
  287. package/src/graph/registration.d.ts +121 -0
  288. package/src/graph/registration.js +233 -0
  289. package/src/graph/registration.js.map +1 -0
  290. package/src/graph/script-input.d.ts +46 -0
  291. package/src/graph/script-input.js +65 -0
  292. package/src/graph/script-input.js.map +1 -0
  293. package/src/graph/settings.d.ts +178 -0
  294. package/src/graph/settings.js +479 -0
  295. package/src/graph/settings.js.map +1 -0
  296. package/src/graph/target-defaults-causes.d.ts +33 -0
  297. package/src/graph/target-defaults-causes.js +202 -0
  298. package/src/graph/target-defaults-causes.js.map +1 -0
  299. package/src/graph/target-defaults-layers.d.ts +186 -0
  300. package/src/graph/target-defaults-layers.js +420 -0
  301. package/src/graph/target-defaults-layers.js.map +1 -0
  302. package/src/graph/target-defaults-meaning.d.ts +95 -0
  303. package/src/graph/target-defaults-meaning.js +292 -0
  304. package/src/graph/target-defaults-meaning.js.map +1 -0
  305. package/src/graph/target-defaults-report.d.ts +77 -0
  306. package/src/graph/target-defaults-report.js +242 -0
  307. package/src/graph/target-defaults-report.js.map +1 -0
  308. package/src/graph/target-defaults.d.ts +79 -0
  309. package/src/graph/target-defaults.js +425 -0
  310. package/src/graph/target-defaults.js.map +1 -0
  311. package/src/graph/target-fields.d.ts +16 -0
  312. package/src/graph/target-fields.js +134 -0
  313. package/src/graph/target-fields.js.map +1 -0
  314. package/src/graph/target-tables.d.ts +45 -0
  315. package/src/graph/target-tables.js +299 -0
  316. package/src/graph/target-tables.js.map +1 -0
  317. package/src/graph/targets.d.ts +367 -0
  318. package/src/graph/targets.js +404 -0
  319. package/src/graph/targets.js.map +1 -0
  320. package/src/graph/unification.d.ts +141 -0
  321. package/src/graph/unification.js +459 -0
  322. package/src/graph/unification.js.map +1 -0
  323. package/src/graph/unignored-directories.d.ts +25 -0
  324. package/src/graph/unignored-directories.js +89 -0
  325. package/src/graph/unignored-directories.js.map +1 -0
  326. package/src/graph/visibility.d.ts +17 -0
  327. package/src/graph/visibility.js +67 -0
  328. package/src/graph/visibility.js.map +1 -0
  329. package/src/graph/warnings.d.ts +38 -0
  330. package/src/graph/warnings.js +77 -0
  331. package/src/graph/warnings.js.map +1 -0
  332. package/src/graph/wasm.d.ts +56 -0
  333. package/src/graph/wasm.js +77 -0
  334. package/src/graph/wasm.js.map +1 -0
  335. package/src/index.d.ts +68 -0
  336. package/src/index.js +109 -0
  337. package/src/index.js.map +1 -0
  338. package/src/release/manifests.d.ts +95 -0
  339. package/src/release/manifests.js +164 -0
  340. package/src/release/manifests.js.map +1 -0
  341. package/src/release/places.d.ts +127 -0
  342. package/src/release/places.js +368 -0
  343. package/src/release/places.js.map +1 -0
  344. package/src/release/publish-cargo.d.ts +177 -0
  345. package/src/release/publish-cargo.js +351 -0
  346. package/src/release/publish-cargo.js.map +1 -0
  347. package/src/release/publish-crates.d.ts +124 -0
  348. package/src/release/publish-crates.js +242 -0
  349. package/src/release/publish-crates.js.map +1 -0
  350. package/src/release/publish-environments.d.ts +50 -0
  351. package/src/release/publish-environments.js +284 -0
  352. package/src/release/publish-environments.js.map +1 -0
  353. package/src/release/publish-messages.d.ts +66 -0
  354. package/src/release/publish-messages.js +273 -0
  355. package/src/release/publish-messages.js.map +1 -0
  356. package/src/release/publish-registry.d.ts +27 -0
  357. package/src/release/publish-registry.js +135 -0
  358. package/src/release/publish-registry.js.map +1 -0
  359. package/src/release/publish-settings.d.ts +26 -0
  360. package/src/release/publish-settings.js +56 -0
  361. package/src/release/publish-settings.js.map +1 -0
  362. package/src/release/publish.d.ts +59 -0
  363. package/src/release/publish.js +620 -0
  364. package/src/release/publish.js.map +1 -0
  365. package/src/release/repository.d.ts +73 -0
  366. package/src/release/repository.js +219 -0
  367. package/src/release/repository.js.map +1 -0
  368. package/src/release/requirements.d.ts +34 -0
  369. package/src/release/requirements.js +30 -0
  370. package/src/release/requirements.js.map +1 -0
  371. package/src/release/toml-edit.d.ts +67 -0
  372. package/src/release/toml-edit.js +453 -0
  373. package/src/release/toml-edit.js.map +1 -0
  374. package/src/release/version-actions.d.ts +133 -0
  375. package/src/release/version-actions.js +474 -0
  376. package/src/release/version-actions.js.map +1 -0
  377. package/src/release/version-checks.d.ts +21 -0
  378. package/src/release/version-checks.js +151 -0
  379. package/src/release/version-checks.js.map +1 -0
  380. package/src/release/version-lockfiles.d.ts +61 -0
  381. package/src/release/version-lockfiles.js +222 -0
  382. package/src/release/version-lockfiles.js.map +1 -0
  383. package/src/tools/napi-cli.d.ts +70 -0
  384. package/src/tools/napi-cli.js +63 -0
  385. package/src/tools/napi-cli.js.map +1 -0
  386. package/src/tools/optional-tools.d.ts +121 -0
  387. package/src/tools/optional-tools.js +303 -0
  388. package/src/tools/optional-tools.js.map +1 -0
  389. package/src/tools/print-napi-cli.d.ts +1 -0
  390. package/src/tools/print-napi-cli.js +24 -0
  391. package/src/tools/print-napi-cli.js.map +1 -0
@@ -0,0 +1,404 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cachedTargets = exports.targetCargoMetadataKey = exports.allFeaturesConfiguration = exports.compilingTargets = exports.inferredTargetNames = exports.releasePublishTarget = exports.defaultFullCollectThreshold = exports.releasePublishExecutor = exports.runExecutor = exports.lockfileExecutor = exports.outputsTargets = exports.cargoOutputsExecutor = exports.cargoExecutor = void 0;
4
+ exports.testReplacesExecutables = testReplacesExecutables;
5
+ exports.inferTargets = inferTargets;
6
+ exports.testBuilds = testBuilds;
7
+ exports.nameTargets = nameTargets;
8
+ const node_fs_1 = require("node:fs");
9
+ const node_path_1 = require("node:path");
10
+ const optional_tools_1 = require("../tools/optional-tools");
11
+ const caching_1 = require("./caching");
12
+ const inputs_1 = require("./inputs");
13
+ const lockfile_task_1 = require("./lockfile-task");
14
+ const napi_1 = require("./napi");
15
+ const unification_1 = require("./unification");
16
+ const wasm_1 = require("./wasm");
17
+ /**
18
+ * The plugin's cargo executor, which runs every inferred target but `build`
19
+ * and `doc`, `run` and `lockfile`. It has a batch implementation (`DES-BATCH`).
20
+ */
21
+ exports.cargoExecutor = "@convesoft/nx-rust:cargo";
22
+ /**
23
+ * The executor of `build` and `doc`, the targets whose files Nx stores: the
24
+ * cargo executor under a name of its own, with the same implementation,
25
+ * batch implementation and schema, so that Nx batches and stores these
26
+ * tasks apart from the tasks that wait for them (`DES-BATCH`, "Two batch
27
+ * executors"; `ADR-TEST-AFTER-BUILD`).
28
+ */
29
+ exports.cargoOutputsExecutor = "@convesoft/nx-rust:cargo-outputs";
30
+ /**
31
+ * The inferred targets, by their default names, that run
32
+ * {@link cargoOutputsExecutor} in place of {@link cargoExecutor}.
33
+ */
34
+ exports.outputsTargets = new Set([
35
+ "build",
36
+ "napi-build",
37
+ "wasm-build",
38
+ "doc",
39
+ ]);
40
+ /**
41
+ * The executor of the lockfile task, of `hakari-check` and of the coverage
42
+ * baseline target, which has no batch implementation, so that none of these
43
+ * tasks ever joins a batch (`DES-LOCKFILE-HASHING`, `DES-UNIFICATION`,
44
+ * "Drift", `DES-BASELINE`).
45
+ */
46
+ exports.lockfileExecutor = "@convesoft/nx-rust:lockfile";
47
+ /**
48
+ * The executor of `run`, which has no batch implementation: `cargo run`
49
+ * takes one package only (`DES-TARGET-COMMANDS`).
50
+ */
51
+ exports.runExecutor = "@convesoft/nx-rust:run";
52
+ /**
53
+ * The executor of `nx-release-publish`, with a batch implementation of its
54
+ * own that publishes the crates of each Cargo workspace and registry with
55
+ * one `cargo publish` (`DES-RELEASE`, `ADR-BATCHED-PUBLISH`).
56
+ */
57
+ exports.releasePublishExecutor = "@convesoft/nx-rust:release-publish";
58
+ /**
59
+ * The commits that the oldest collection of a baseline may lie behind `HEAD`
60
+ * before the coverage baseline target collects everything in place of
61
+ * `collect --diff`, where the option `fullCollectThreshold` sets none
62
+ * (`DES-BASELINE`).
63
+ */
64
+ exports.defaultFullCollectThreshold = 100;
65
+ /**
66
+ * The name of the publish target, which Nx release runs under this name
67
+ * only, so that `targetNames` cannot rename it (`DES-RELEASE`, "Publish
68
+ * target"; `DES-PLUGIN-OPTIONS`, "Target names").
69
+ */
70
+ exports.releasePublishTarget = "nx-release-publish";
71
+ /**
72
+ * The inferred targets by their default names, in the order of the table in
73
+ * `DES-TARGETS`: first those of a crate, then those of the workspace project.
74
+ * They are also the keys that `targetNames` accepts (`readTargetNames` in
75
+ * `options.ts`), apart from {@link releasePublishTarget}, which keeps its
76
+ * name.
77
+ */
78
+ exports.inferredTargetNames = [
79
+ "build",
80
+ "check",
81
+ "lint",
82
+ "test",
83
+ "fmt-check",
84
+ "fmt",
85
+ "bench",
86
+ "run",
87
+ "napi-build",
88
+ "wasm-build",
89
+ exports.releasePublishTarget,
90
+ "doc",
91
+ "lockfile",
92
+ "hakari-check",
93
+ "audit",
94
+ "deny",
95
+ "update",
96
+ "coverage-baseline",
97
+ ];
98
+ /**
99
+ * The inferred targets that compile, which take the feature and profile
100
+ * options (`DES-PLUGIN-OPTIONS`) and get the configuration for all features
101
+ * ({@link allFeaturesConfiguration}).
102
+ */
103
+ exports.compilingTargets = [
104
+ "build",
105
+ "check",
106
+ "lint",
107
+ "test",
108
+ "bench",
109
+ "run",
110
+ "napi-build",
111
+ "wasm-build",
112
+ "doc",
113
+ "coverage-baseline",
114
+ ];
115
+ /**
116
+ * The configuration that every compiling target of every crate and
117
+ * workspace gets, the feature set of all features, beside the default
118
+ * features of its options (`DES-FEATURE-SETS`): `nx run-many -t test -c
119
+ * all-features`. A target table can lay its own configuration of that name
120
+ * over it.
121
+ */
122
+ exports.allFeaturesConfiguration = "all-features";
123
+ /** The key of {@link TargetCargoMetadata} in the metadata of each inferred target. */
124
+ exports.targetCargoMetadataKey = "cargo";
125
+ /**
126
+ * Whether `cargo test` for the crate replaces the executables in the
127
+ * artifact directory that its `build` declares as outputs (`DES-OUTPUTS`),
128
+ * read from the crate's report: the crate has a target of kind `bin`, and a
129
+ * target of kind `test` or `bench` whose `test` flag is on. Cargo builds the
130
+ * crate's binaries for such a target, with what dev-dependencies turn on and
131
+ * with the `test` profile, and replaces the uplifted files even when their
132
+ * units are fresh (`EVD-CARGO-ARTIFACT-WRITERS`). The `required-features` of
133
+ * either target do not count: whether cargo builds them depends on the
134
+ * features of the run, and a crate counted without need only orders two
135
+ * tasks. A flag that the report lacks counts as on. Examples, unit tests,
136
+ * doctests and `cdylib` and `staticlib` files never make cargo replace them.
137
+ */
138
+ // @mara implements DES-TARGETS
139
+ // @mara implements DES-OUTPUTS
140
+ function testReplacesExecutables(pkg) {
141
+ return (pkg.targets.some((target) => target.kind.includes("bin")) &&
142
+ pkg.targets.some((target) => (target.kind.includes("test") || target.kind.includes("bench")) && target.test !== false));
143
+ }
144
+ /**
145
+ * The inferred targets that the plugin caches, as `DES-TARGETS` and
146
+ * `DES-OUTPUTS` give them, with the inputs of `DES-INPUTS` and the outputs
147
+ * of `DES-OUTPUTS` (`configureCaching` in `caching.ts`). `build` and `doc`
148
+ * are left uncached for a project where the plugin cannot name or store
149
+ * their artifacts, and `build` and `test` for a crate whose artifacts share
150
+ * a file name with another crate's in its artifact directory
151
+ * (`sharedArtifactNames` in `artifact-names.ts`), with the reason in
152
+ * `metadata.cargo.uncached`. Graph
153
+ * creation fails for a `targetDefaults` entry in `nx.json` that turns caching
154
+ * on for a target that the plugin leaves uncached in a project
155
+ * (`DES-TARGET-DEFAULT-GUARD`, which compares with the `cache` that
156
+ * {@link inferTargets} sets), and the executor fails a task of such a target
157
+ * that its configuration caches after all, so that Nx stores no result for it.
158
+ */
159
+ exports.cachedTargets = new Set([
160
+ "build",
161
+ "check",
162
+ "lint",
163
+ "test",
164
+ "fmt-check",
165
+ "napi-build",
166
+ "wasm-build",
167
+ "doc",
168
+ ]);
169
+ /**
170
+ * The targets that the plugin infers for a project, by their default names,
171
+ * in the order of {@link inferredTargetNames}.
172
+ *
173
+ * A crate gets `build`, `check`, `lint`, `test`, `fmt-check` and `fmt`, `run`
174
+ * when it has a binary target, `bench` when it has a bench target, and
175
+ * `nx-release-publish` unless its manifest sets `publish = false`, which the
176
+ * report gives as an empty `publish` list, or it is the hack crate that the
177
+ * workspace's cargo-hakari configuration names (`DES-RELEASE`, "Publish
178
+ * target", "Hack crate"), `napi-build` where it produces a Node addon and
179
+ * `wasm-build` where it produces a wasm package, with the wasm target of
180
+ * `wasm-bindgen`'s own default in its options (`DES-ARTIFACT-STEPS`,
181
+ * `DES-WASM`). The
182
+ * workspace project gets `doc`, `lockfile`, `audit` and `update`, `deny`
183
+ * where a cargo-deny configuration file is in the workspace root, and
184
+ * `hakari-check` where the workspace uses the `hakari` strategy
185
+ * (`DES-UNIFICATION`, "Drift"), and `coverage-baseline` where it uses the
186
+ * selection of affected tests (`affectedTests`, `DES-BASELINE`); a root
187
+ * manifest's crate gets both sets. Whether a tool is installed decides
188
+ * nothing.
189
+ *
190
+ * Only the targets in {@link cachedTargets} are cached; their inputs and
191
+ * outputs, the exceptions for the artifact directory, and the dependency of
192
+ * every cached target but `fmt-check` on the lockfile task of its workspace,
193
+ * the one task dependency of a crate's target on another project
194
+ * (`REQ-NO-RUST-TASK-DEPS`), come from `configureCaching` in `caching.ts`.
195
+ * Where `cargo test` replaces the executables of the crate's `build`
196
+ * ({@link testReplacesExecutables}), `test` also depends on that `build`,
197
+ * cached or not, so that the two never run at the same time (`DES-TARGETS`).
198
+ *
199
+ * @param context What the caching of the graph's projects shares.
200
+ * @param caching What the project's settings change in its caching.
201
+ * @param locked The `locked` option of the plugin entry, which each target
202
+ * carries in its metadata for the executor ({@link TargetCargoMetadata}).
203
+ * @param targetNames The names that the plugin options give the inferred
204
+ * targets, under which `test` names the `build` it depends on.
205
+ */
206
+ // @mara implements DES-TARGETS
207
+ // @mara implements DES-TARGET-COMMANDS
208
+ // @mara implements DES-WORKSPACE-TARGETS
209
+ // @mara implements DES-BASELINE
210
+ function inferTargets(subject, context, locked = false, caching, targetNames = {}) {
211
+ var _a, _b, _c, _d, _e;
212
+ const targets = new Map();
213
+ const { pkg, workspace } = subject;
214
+ const target = (inferred, description, options = {}) => inferredTarget(inferred, description, options, locked);
215
+ if (pkg !== undefined) {
216
+ const kinds = new Set(pkg.targets.flatMap((target) => target.kind));
217
+ targets.set("build", target("build", "Builds the crate with cargo build."));
218
+ targets.set("check", target("check", "Checks the crate with cargo check.", { allTargets: true }));
219
+ targets.set("lint", target("lint", "Lints the crate with cargo clippy.", { allTargets: true }));
220
+ targets.set("test", target("test", "Runs the tests of the crate."));
221
+ targets.set("fmt-check", target("fmt-check", "Checks the formatting of the crate with cargo fmt --check."));
222
+ targets.set("fmt", target("fmt", "Formats the crate with cargo fmt."));
223
+ if (kinds.has("bench")) {
224
+ targets.set("bench", Object.assign(Object.assign({}, target("bench", "Runs the benchmarks of the crate with cargo bench.")), { parallelism: false }));
225
+ }
226
+ if (kinds.has("bin")) {
227
+ targets.set("run", Object.assign(Object.assign({}, target("run", "Runs a binary of the crate with cargo run.")), { executor: exports.runExecutor, continuous: false }));
228
+ }
229
+ if ((0, napi_1.producesNodeAddon)(subject)) {
230
+ targets.set("napi-build", target("napi-build", "Builds the crate's Node addon for the host with cargo build, and writes the .node file, its JS loader and its type definitions into the crate's folder."));
231
+ }
232
+ if ((0, wasm_1.producesWasmPackage)(subject)) {
233
+ targets.set("wasm-build", target("wasm-build", `Builds the crate for ${wasm_1.wasmTriple} with cargo build, and writes the wasm package, the .wasm file with its JS glue and type definitions, into the crate's ${wasm_1.wasmPackageFolder} folder with the wasm-bindgen CLI.`, { wasmTarget: wasm_1.defaultWasmTarget }));
234
+ }
235
+ if (!(Array.isArray(pkg.publish) && pkg.publish.length === 0) &&
236
+ (0, unification_1.hackCrateName)(workspace.report.workspace_root, (0, unification_1.memberNames)(workspace)) !== pkg.name) {
237
+ targets.set(exports.releasePublishTarget, Object.assign(Object.assign({}, target(exports.releasePublishTarget, "Publishes the crate with cargo publish, with one call for the crates of its Cargo workspace and registry that nx release publish publishes together.")), { executor: exports.releasePublishExecutor }));
238
+ }
239
+ }
240
+ if (subject.isWorkspaceProject) {
241
+ const lockfile = "{projectRoot}/Cargo.lock";
242
+ const manifest = "{projectRoot}/Cargo.toml";
243
+ targets.set("doc", target("doc", "Documents the members of the Cargo workspace with cargo doc.", {
244
+ noDeps: true,
245
+ }));
246
+ targets.set("lockfile", Object.assign(Object.assign({}, target("lockfile", "Lets cargo update --workspace bring Cargo.lock up to date and writes a digest of each member's locked dependencies.")), { executor: exports.lockfileExecutor }));
247
+ if ((caching === null || caching === void 0 ? void 0 : caching.settings.featureUnification) === "hakari") {
248
+ targets.set("hakari-check", Object.assign(Object.assign({}, target("hakari-check", "Checks that the hack crate of cargo-hakari is current, with cargo hakari generate --diff and cargo hakari manage-deps --dry-run.")), { executor: exports.lockfileExecutor }));
249
+ }
250
+ targets.set("audit", Object.assign(Object.assign({}, target("audit", "Checks Cargo.lock for security advisories with cargo audit.")), { inputs: [lockfile, manifest, "{projectRoot}/.cargo/audit.toml"] }));
251
+ if (hasCargoDenyConfiguration(workspace)) {
252
+ targets.set("deny", Object.assign(Object.assign({}, target("deny", "Checks the dependencies of the Cargo workspace with cargo deny check.")), { inputs: [
253
+ lockfile,
254
+ manifest,
255
+ ...optional_tools_1.cargoDenyConfigurationFiles.map((file) => `{projectRoot}/${file}`),
256
+ ...(0, inputs_1.memberManifests)(workspace, context.repositoryRoot),
257
+ ] }));
258
+ }
259
+ targets.set("update", Object.assign(Object.assign({}, target("update", "Updates Cargo.lock with cargo update.")), { inputs: [lockfile, manifest] }));
260
+ if ((caching === null || caching === void 0 ? void 0 : caching.settings.affectedTests) === true) {
261
+ targets.set("coverage-baseline", Object.assign(Object.assign({}, target("coverage-baseline", "Brings the coverage baseline of the affected tests up to date with cargo affected collect, and writes the record of the context it collected in.", { fullCollectThreshold: exports.defaultFullCollectThreshold })), { executor: exports.lockfileExecutor }));
262
+ }
263
+ }
264
+ (0, caching_1.configureCaching)(targets, subject, context, caching);
265
+ const test = targets.get("test");
266
+ const testMetadata = (_a = test === null || test === void 0 ? void 0 : test.metadata) === null || _a === void 0 ? void 0 : _a[exports.targetCargoMetadataKey];
267
+ if (testMetadata !== undefined && (caching === null || caching === void 0 ? void 0 : caching.settings.testRunner) === "nextest") {
268
+ testMetadata.testRunner = "nextest";
269
+ }
270
+ if (testMetadata !== undefined && (caching === null || caching === void 0 ? void 0 : caching.settings.affectedTests) === true) {
271
+ testMetadata.affectedTests = true;
272
+ const declared = caching.settings.added.fileInputs.flatMap((input) => typeof input === "object" &&
273
+ input !== null &&
274
+ "fileset" in input &&
275
+ typeof input.fileset === "string"
276
+ ? [input.fileset]
277
+ : []);
278
+ if (declared.length > 0) {
279
+ testMetadata.declaredFiles = declared;
280
+ }
281
+ }
282
+ const builds = pkg === undefined
283
+ ? []
284
+ : testBuilds(subject, context.repositoryRoot, (_b = caching === null || caching === void 0 ? void 0 : caching.settings.featureUnification) !== null && _b !== void 0 ? _b : "workspace-build");
285
+ if (pkg !== undefined && test !== undefined && builds.length > 0) {
286
+ const build = (_c = targetNames.build) !== null && _c !== void 0 ? _c : "build";
287
+ const own = builds.includes(subject.root);
288
+ const others = builds.filter((root) => root !== subject.root);
289
+ test.dependsOn = [
290
+ ...((_d = test.dependsOn) !== null && _d !== void 0 ? _d : []),
291
+ ...(own ? [{ target: build }] : []),
292
+ ...(others.length > 0 ? [{ projects: others.map(lockfile_task_1.directoryPattern), target: build }] : []),
293
+ ];
294
+ const metadata = (_e = test.metadata) === null || _e === void 0 ? void 0 : _e[exports.targetCargoMetadataKey];
295
+ if (metadata !== undefined) {
296
+ if (own) {
297
+ metadata.waitsForBuild = true;
298
+ }
299
+ metadata.waitsForBuilds = builds;
300
+ }
301
+ }
302
+ return targets;
303
+ }
304
+ /**
305
+ * The roots, relative to the repository root and sorted, of the crates whose
306
+ * `build` a crate's `test` waits for (`DES-TARGETS`, `ADR-WORKSPACE-TEST-EXECUTABLES`):
307
+ * every member of its workspace that has a project and for which `cargo
308
+ * test` replaces the executables that its `build` declares
309
+ * ({@link testReplacesExecutables}), the crate itself among them where it is
310
+ * one. Under `workspace-build`, every step of a `test` group selects the
311
+ * whole workspace, and such a command replaces those executables of every
312
+ * such member, of no other crate, and no `cdylib` or `staticlib` file, on
313
+ * Cargo 1.91.0 and 1.100.0 (`EVD-CARGO-ARTIFACT-WRITERS`, "Commands that
314
+ * select the whole workspace"); the rule counts a crate whatever the
315
+ * `required-features` of its targets, so that the set is a superset of the
316
+ * crates whose files cargo replaces. Under `hakari` and `cargo`, whose
317
+ * commands select their crates with `-p`, a `cargo test` replaces the
318
+ * executables of the crates it selects only, and a group selects those of
319
+ * its own tasks, each of which waits for its own crate's `build`: the crate
320
+ * itself, where it is one.
321
+ */
322
+ // @mara implements DES-TARGETS
323
+ function testBuilds(subject, repositoryRoot, strategy = "workspace-build") {
324
+ const crates = strategy === "workspace-build"
325
+ ? subject.workspace.members
326
+ : subject.pkg === undefined
327
+ ? []
328
+ : [subject.pkg];
329
+ return crates
330
+ .filter(testReplacesExecutables)
331
+ .map((member) => (0, node_path_1.relative)(repositoryRoot, (0, node_path_1.dirname)(member.manifest_path)) || ".")
332
+ .map((root) => root.split(node_path_1.sep).join("/"))
333
+ .sort();
334
+ }
335
+ /**
336
+ * Gives each project's inferred targets the names that `targetNames` asks
337
+ * for, a target without an entry keeping its default name.
338
+ *
339
+ * @returns Each project's targets by name, in the order of `projects`.
340
+ * @throws {Error} When two inferred targets of one project would get one
341
+ * name, naming every such project, its targets and the name.
342
+ */
343
+ // @mara implements REQ-TARGET-NAMES
344
+ // @mara implements DES-PLUGIN-OPTIONS
345
+ function nameTargets(projects, targetNames) {
346
+ const collisions = [];
347
+ const named = projects.map(({ project, targets }) => {
348
+ var _a, _b;
349
+ const byName = new Map();
350
+ for (const inferred of targets.keys()) {
351
+ const name = (_a = targetNames[inferred]) !== null && _a !== void 0 ? _a : inferred;
352
+ byName.set(name, [...((_b = byName.get(name)) !== null && _b !== void 0 ? _b : []), inferred]);
353
+ }
354
+ for (const [name, inferred] of byName) {
355
+ if (inferred.length > 1) {
356
+ collisions.push(`- the project "${project.name}" (${project.manifest}): ${list(inferred.map((target) => `\`${target}\``))} would ${inferred.length === 2 ? "both" : "all"} be called "${name}"`);
357
+ }
358
+ }
359
+ return Object.fromEntries([...targets].map(([inferred, configuration]) => {
360
+ var _a;
361
+ return [
362
+ (_a = targetNames[inferred]) !== null && _a !== void 0 ? _a : inferred,
363
+ configuration,
364
+ ];
365
+ }));
366
+ });
367
+ if (collisions.length > 0) {
368
+ throw new Error([
369
+ `"targetNames" in the options of the @convesoft/nx-rust entry in nx.json gives two inferred targets of one project the same name, and a project can have only one target of each name:`,
370
+ ...collisions,
371
+ `Change "targetNames" so that every inferred target keeps a name of its own.`,
372
+ ].join("\n"));
373
+ }
374
+ return named;
375
+ }
376
+ // A target of the plugin, cached only if it is in cachedTargets.
377
+ function inferredTarget(inferred, description, options, locked) {
378
+ const metadata = { target: inferred, locked };
379
+ return Object.assign(Object.assign({ executor: exports.outputsTargets.has(inferred) ? exports.cargoOutputsExecutor : exports.cargoExecutor, options }, (exports.compilingTargets.includes(inferred)
380
+ ? { configurations: { [exports.allFeaturesConfiguration]: { allFeatures: true } } }
381
+ : {})), { cache: exports.cachedTargets.has(inferred), metadata: {
382
+ description,
383
+ technologies: ["cargo"],
384
+ [exports.targetCargoMetadataKey]: metadata,
385
+ } });
386
+ }
387
+ // Whether the workspace root holds one of cargo-deny's configuration files.
388
+ function hasCargoDenyConfiguration(workspace) {
389
+ return optional_tools_1.cargoDenyConfigurationFiles.some((file) => {
390
+ try {
391
+ return (0, node_fs_1.statSync)((0, node_path_1.join)(workspace.report.workspace_root, file)).isFile();
392
+ }
393
+ catch (_a) {
394
+ return false;
395
+ }
396
+ });
397
+ }
398
+ // "`a`, `b` and `c`"
399
+ function list(items) {
400
+ return items.length <= 1
401
+ ? items.join("")
402
+ : `${items.slice(0, -1).join(", ")} and ${items[items.length - 1]}`;
403
+ }
404
+ //# sourceMappingURL=targets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"targets.js","sourceRoot":"","sources":["../../../../nx-rust/src/graph/targets.ts"],"names":[],"mappings":";;;AAmUA,0DAQC;AAmFD,oCA8KC;AAqBD,gCAgBC;AAYD,kCAmCC;AA9pBD,qCAAmC;AACnC,yCAAyD;AAIzD,4DAAsE;AACtE,uCAAyE;AAEzE,qCAA2C;AAC3C,mDAAmD;AACnD,iCAA2C;AAG3C,+CAA2D;AAC3D,iCAA+F;AAE/F;;;GAGG;AACU,QAAA,aAAa,GAAG,0BAA0B,CAAC;AAExD;;;;;;GAMG;AACU,QAAA,oBA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AAC,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QACxE,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,qBAAqB;AACrB,SAAS,IAAI,CAAC,KAAwB;IACpC,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC;QACtB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAChB,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;AACxE,CAAC"}
@@ -0,0 +1,141 @@
1
+ import type { CargoPackage } from "../cargo/metadata";
2
+ import type { CargoDiscovery, CargoWorkspace } from "./discovery";
3
+ import type { FeatureUnification, GraphSettings } from "./settings";
4
+ /** What the `hakari` strategy of a workspace rests on (`DES-UNIFICATION`). */
5
+ export interface HakariSetup {
6
+ /**
7
+ * The configuration file of cargo-hakari, `.config/hakari.toml` or else
8
+ * `.guppy/hakari.toml` in the workspace root, relative to the repository root.
9
+ */
10
+ configFile: string;
11
+ /** The manifest of the hack crate, relative to the repository root. */
12
+ hackManifest: string;
13
+ /** The package name of the hack crate. */
14
+ hackPackage: string;
15
+ /** The triples of `platforms`, as the configuration lists them. */
16
+ platforms: string[];
17
+ }
18
+ /** The strategy that a workspace uses, and what graph creation says about it. */
19
+ export interface WorkspaceStrategy {
20
+ /** The strategy that applies: `hakari` only where every check passes. */
21
+ featureUnification: FeatureUnification;
22
+ /** Under `hakari`, the configuration and the hack crate. */
23
+ hakari?: HakariSetup;
24
+ /**
25
+ * The warnings of `DES-UNIFICATION` that concern every project of the
26
+ * workspace: the fallback to `workspace-build`, or under `hakari` a
27
+ * non-host triple that graph creation knows and `platforms` does not list.
28
+ */
29
+ warnings: string[];
30
+ }
31
+ /** The strategy of a workspace that uses `workspace-build` without being checked. */
32
+ export declare const workspaceBuildStrategy: WorkspaceStrategy;
33
+ /** The configuration files that cargo-hakari reads, in its order (`EVD-HAKARI-UNIFICATION`). */
34
+ export declare const hakariConfigurationFiles: string[];
35
+ /**
36
+ * The configuration file that cargo-hakari reads in the workspace root
37
+ * `root`, relative to it: `.config/hakari.toml`, or else
38
+ * `.guppy/hakari.toml`; `undefined` where neither exists.
39
+ */
40
+ export declare function hakariConfigurationFile(root: string): string | undefined;
41
+ /**
42
+ * The package name of the hack crate of the Cargo workspace in `root`,
43
+ * whatever its strategy (`DES-RELEASE`, "Hack crate"): the `hakari-package`
44
+ * of the configuration file that cargo-hakari reads there, where that file
45
+ * parses and the name is one of `members`, the package names of the
46
+ * workspace's members; `undefined` otherwise. A configuration that does not
47
+ * parse names no hack crate here; graph creation warns about it where the
48
+ * strategy is `hakari` by default or by setting ({@link workspaceStrategy}).
49
+ */
50
+ export declare function hackCrateName(root: string, members: readonly string[]): string | undefined;
51
+ /** The package names of the members of `workspace`. */
52
+ export declare function memberNames(workspace: CargoWorkspace): string[];
53
+ /** What the detection of a workspace's strategy reads beyond the workspace. */
54
+ export interface StrategyContext {
55
+ /** The discovery of the graph computation, for the crates outside the workspace. */
56
+ discovery: CargoDiscovery;
57
+ /** The environment of graph creation, in which `rustc -vV` names the host. */
58
+ env?: NodeJS.ProcessEnv;
59
+ /**
60
+ * The host's triple in a workspace root, as `rustc -vV` names it there;
61
+ * `undefined` where it names none. A seam for the tests.
62
+ */
63
+ host?: (workspaceRoot: string) => string | undefined;
64
+ /**
65
+ * The non-host triples that graph creation knows for the workspace beyond
66
+ * Cargo's configuration: the `targetTriple` that the metadata tables give
67
+ * a target of a member or one of its configurations.
68
+ */
69
+ tableTriples?: readonly string[];
70
+ }
71
+ /**
72
+ * The feature-unification strategy of a workspace (`DES-UNIFICATION`, "When
73
+ * the hack crate is enough", "Fallback"): `cargo` and `workspace-build` where
74
+ * the settings choose them, unchecked; otherwise `hakari` where the
75
+ * workspace has a configuration that cargo-hakari reads, which parses and
76
+ * whose `hakari-package` names a member, and passes the four checks, made
77
+ * in their order:
78
+ *
79
+ * 1. no member asks a feature of another member, in any form, and no
80
+ * member's dev-dependency on itself has features;
81
+ * 2. `platforms` lists the host's triple, as `rustc -vV` names it in the
82
+ * workspace root;
83
+ * 3. no crate outside the workspace reaches a member through normal or build
84
+ * dependencies, as far as the reports show, with a redirection to a
85
+ * member and a crate without a report counting as failing;
86
+ * 4. every key of the configuration is one that leaves nothing to the
87
+ * selection, with a value that experiments found safe.
88
+ *
89
+ * Where one fails, or where the settings ask for `hakari` and the workspace
90
+ * has no such configuration, the workspace uses `workspace-build` and gets
91
+ * the fallback warning, which names the workspace, the check and the first
92
+ * member, crate, entry or setting that fails it. A workspace without a
93
+ * configuration whose settings choose nothing uses `workspace-build`
94
+ * without a warning. Under `hakari`, a non-host triple that graph creation
95
+ * knows and `platforms` does not list gets a warning of its own; its tasks
96
+ * run one crate per command (`groupSelection` in `groups.ts`).
97
+ *
98
+ * @param setting The `featureUnification` that the workspace table or the
99
+ * plugin options set; `undefined` for the default.
100
+ */
101
+ export declare function workspaceStrategy(workspace: CargoWorkspace, setting: FeatureUnification | undefined, context: StrategyContext): WorkspaceStrategy;
102
+ /**
103
+ * The strategy of each workspace of a graph computation, by the workspace's
104
+ * root folder ({@link workspaceStrategy}), with the `featureUnification`
105
+ * that its settings give and the triples that the metadata tables of its
106
+ * members and workspace project give a target or a configuration.
107
+ */
108
+ export declare function workspaceStrategies(discovery: CargoDiscovery, settings: GraphSettings, context?: Omit<StrategyContext, "discovery" | "tableTriples">): Map<string, WorkspaceStrategy>;
109
+ /**
110
+ * The first check of `DES-UNIFICATION`: the first member, by the path of
111
+ * its manifest, that asks a feature of another member, with what it asks,
112
+ * or `undefined` where none does. A dependency on another member's folder,
113
+ * of every kind and under every platform table, fails where it has a
114
+ * `features` list, or turns off default features of a member whose
115
+ * `features` table declares `default`; a member's dev-dependency on itself
116
+ * fails where it has a `features` list; and an entry of a member's
117
+ * `features` table fails where it names a feature of another member as
118
+ * `<name>/<feature>` or `<name>?/<feature>`, by the dependency's name or
119
+ * its rename.
120
+ */
121
+ export declare function memberCheck(members: readonly CargoPackage[], repositoryRoot: string): string | undefined;
122
+ /**
123
+ * The third check of `DES-UNIFICATION`: the first crate outside the
124
+ * workspace, by the path of its manifest, that reaches a member through
125
+ * normal or build dependencies, directly or through other such crates, or
126
+ * whose dependencies the plugin cannot know, or the first redirection whose
127
+ * crate is a member; `undefined` where none does. The crates outside the
128
+ * workspace are those whose reports graph creation requests anyway: the
129
+ * path crates that the members reach through dependencies of every kind,
130
+ * and behind those through normal and build dependencies, and the crates
131
+ * that the workspace's `[patch]`, `[replace]` and `paths` entries name, with
132
+ * those behind them.
133
+ */
134
+ export declare function outsideCheck(workspace: CargoWorkspace, discovery: CargoDiscovery): string | undefined;
135
+ /**
136
+ * The fourth check of `DES-UNIFICATION`: the first key of the configuration,
137
+ * in the file's order, that is not one of those that the plugin accepts or
138
+ * has a value that it does not accept, with what to change; `undefined`
139
+ * where every key passes.
140
+ */
141
+ export declare function configurationCheck(config: Record<string, unknown>, configFile: string): string | undefined;