@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,253 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.groupInvocations = groupInvocations;
4
+ const directories_1 = require("../cargo/directories");
5
+ const package_specs_1 = require("../cargo/package-specs");
6
+ const real_path_1 = require("../graph/real-path");
7
+ const wasm_1 = require("../graph/wasm");
8
+ const optional_tools_1 = require("../tools/optional-tools");
9
+ const command_1 = require("./command");
10
+ const runner_script_1 = require("./runner-script");
11
+ const task_guards_1 = require("./task-guards");
12
+ /**
13
+ * Completes the cargo command of a group of prepared tasks, all of one
14
+ * workspace, kind, environment and command options (`TERM-GROUP`): asks
15
+ * cargo once for the package ID specifications of the group's crates,
16
+ * where its command selects them so (`DES-INVOCATION`), and once for
17
+ * Cargo's directories, where a task of the group is a cached `build` or
18
+ * `doc` or checks a build's inputs (`DES-OUTPUTS`, `DES-BUILD-INPUT-CHECK`),
19
+ * both in the workspace root with the group's environment, and checks each
20
+ * cached `build` and `doc` against the artifact directory its outputs name.
21
+ *
22
+ * The commands select the crates as `selection` says (`planGroups`):
23
+ * each with `-p`, or the whole workspace with `--workspace`, for which the
24
+ * group keeps every member that the report gives, and for `test` with the
25
+ * three steps and the selecting runner of `DES-TEST-RUN` ({@link cargoSteps}).
26
+ *
27
+ * @returns For each task, in order, the commands of the whole group with
28
+ * what the task does after it, or the message with which the task fails
29
+ * before cargo runs: cargo cannot report the specifications or the
30
+ * directories, the workspace has no member of the crate's name any more,
31
+ * or cargo reports another artifact directory than the outputs name.
32
+ * Every task of a group gets the same `args` where none fails.
33
+ */
34
+ // @mara implements DES-INVOCATION
35
+ // @mara implements DES-OUTPUTS
36
+ // @mara implements DES-BATCH
37
+ // @mara implements DES-UNIFICATION
38
+ function groupInvocations(tasks, root, selection = { kind: "crates" }) {
39
+ var _a;
40
+ const [first] = tasks;
41
+ if (first === undefined) {
42
+ return [];
43
+ }
44
+ const { cwd, env, workspaceRoot, target } = first;
45
+ // One report of Cargo's directories for the group, and then one of the
46
+ // members, where its command selects crates by their specifications: the
47
+ // order in which a task run on its own has always asked.
48
+ const directories = tasks.some((task) => task.artifactCheck !== undefined || task.records !== undefined || task.napi !== undefined)
49
+ ? directoryReport(cwd, env)
50
+ : undefined;
51
+ const specs = (0, command_1.selectsBySpecification)(target) && tasks.some((task) => task.crate !== undefined)
52
+ ? specReport(cwd, env)
53
+ : undefined;
54
+ const finished = tasks.map((task) => {
55
+ try {
56
+ const reached = directories instanceof directories_1.DirectoryReportError
57
+ ? directoryFailure(task.task, directories)
58
+ : directories;
59
+ if (task.napi !== undefined && reached === undefined) {
60
+ throw new task_guards_1.TaskError(`${task.task}: cargo reported no directories for this napi-build.`);
61
+ }
62
+ if (task.artifactCheck !== undefined && reached !== undefined) {
63
+ checkArtifactDirectory(task.task, task.artifactCheck, cwd, root, env, reached);
64
+ }
65
+ const pkg = task.crate === undefined || !(0, command_1.selectsBySpecification)(task.target)
66
+ ? undefined
67
+ : packageSpec(task.task, task.crate, workspaceRoot, specs);
68
+ const crate = task.crate === undefined
69
+ ? undefined
70
+ : Object.assign({ name: task.crate }, (pkg === undefined ? {} : { spec: pkg.id }));
71
+ return Object.assign(Object.assign(Object.assign({}, (crate === undefined ? {} : { crate })), (pkg === undefined ? {} : { package: pkg })), (reached === undefined ? {} : { directories: reached }));
72
+ }
73
+ catch (error) {
74
+ if (error instanceof task_guards_1.TaskError) {
75
+ return error.message;
76
+ }
77
+ throw error;
78
+ }
79
+ });
80
+ // The command selects the crates of the tasks that passed their checks;
81
+ // a task that failed before cargo takes no part in it.
82
+ const crates = finished.flatMap((entry) => typeof entry === "string" || entry.crate === undefined ? [] : [entry.crate]);
83
+ const workspace = selection.kind === "workspace";
84
+ // nextest runs no runner of the plugin's (`DES-TEST-RUN`).
85
+ const runner = workspace && target === "test" && first.testRunner !== "nextest"
86
+ ? { host: (_a = selection.host) !== null && _a !== void 0 ? _a : "", command: (0, runner_script_1.runnerCommand)() }
87
+ : undefined;
88
+ if (runner !== undefined && runner.host === "") {
89
+ throw new Error("A test group that selects the whole workspace needs the host's triple.");
90
+ }
91
+ const workspaceMembers = workspace && specs instanceof Map ? [...specs.values()] : undefined;
92
+ // A group that selects affected tests places changed files among every
93
+ // member (`DES-TEST-RUN`, step 2).
94
+ const affectedMembers = tasks.some((task) => { var _a; return ((_a = task.testMode) === null || _a === void 0 ? void 0 : _a.selects) === true; }) && specs instanceof Map
95
+ ? [...specs.values()]
96
+ : undefined;
97
+ return tasks.map((task, index) => {
98
+ const entry = finished[index];
99
+ if (typeof entry === "string") {
100
+ return entry;
101
+ }
102
+ const steps = (0, command_1.cargoSteps)(Object.assign(Object.assign(Object.assign(Object.assign({ target: task.target }, (crates.length === 0 ? {} : { crates })), { locked: task.locked, binaryArguments: task.binaryArguments, workspace }), (task.testRunner === undefined ? {} : { testRunner: task.testRunner })), { workspaceUnification: task.featureUnification === "cargo" }), task.options, runner);
103
+ const args = steps[0].args;
104
+ const inputCheck = task.records !== undefined &&
105
+ task.crate !== undefined &&
106
+ task.manifest !== undefined &&
107
+ entry.directories !== undefined
108
+ ? {
109
+ task: task.task,
110
+ crate: task.crate,
111
+ manifest: task.manifest,
112
+ // The compile of `wasm-build` builds the library alone, with
113
+ // `--lib`, and exports no record of a binary (`DES-WASM`).
114
+ records: task.target === "wasm-build" ? Object.assign(Object.assign({}, task.records), { binaries: [] }) : task.records,
115
+ directories: entry.directories,
116
+ // `wasm-build` passes the wasm triple with `--target` (`DES-WASM`).
117
+ selection: task.target === "wasm-build"
118
+ ? Object.assign(Object.assign({}, task.options), { targetTriple: wasm_1.wasmTriple }) : task.options,
119
+ env,
120
+ cwd,
121
+ }
122
+ : undefined;
123
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ args,
124
+ steps,
125
+ cwd }, (workspaceMembers === undefined ? {} : { workspaceMembers })), (affectedMembers === undefined ? {} : { affectedMembers })), (runner === undefined ? {} : { runner: [...runner.command] })), (entry.crate === undefined ? {} : { crate: entry.crate })), (entry.package === undefined ? {} : { package: entry.package })), (task.digests === undefined ? {} : { digests: task.digests })), (inputCheck === undefined ? {} : { inputCheck })), (task.napi !== undefined && entry.directories !== undefined
126
+ ? { directories: entry.directories }
127
+ : {}));
128
+ });
129
+ }
130
+ // The members in the workspace root with the group's environment, as the
131
+ // group's command starts (`DES-INVOCATION`), from one report for the group.
132
+ function specReport(cwd, env) {
133
+ try {
134
+ return (0, package_specs_1.memberPackages)(cwd, env);
135
+ }
136
+ catch (error) {
137
+ if (error instanceof package_specs_1.PackageSpecReportError) {
138
+ return error;
139
+ }
140
+ throw error;
141
+ }
142
+ }
143
+ // Cargo's directories in the workspace root with the group's environment,
144
+ // as physical paths, or why cargo could not report them.
145
+ function directoryReport(cwd, env) {
146
+ try {
147
+ const reported = (0, directories_1.reportedDirectories)(cwd, env);
148
+ return { artifact: (0, real_path_1.physicalPath)(reported.artifact), build: (0, real_path_1.physicalPath)(reported.build) };
149
+ }
150
+ catch (error) {
151
+ if (error instanceof directories_1.DirectoryReportError) {
152
+ return error;
153
+ }
154
+ throw error;
155
+ }
156
+ }
157
+ // The package ID specification with which the task's command selects its
158
+ // crate: the one that cargo reports for the member of that name when it
159
+ // starts in the workspace root with the task's environment, as the command
160
+ // does (`DES-INVOCATION`). It holds the absolute path of the crate's folder
161
+ // and goes into the command only, into no input, output or option. A group
162
+ // asks cargo once for all its crates ({@link specReport}).
163
+ // @mara implements DES-INVOCATION
164
+ // @mara implements DES-DIAGNOSTICS
165
+ function packageSpec(task, packageName, workspaceRoot, specs) {
166
+ if (!(specs instanceof Map)) {
167
+ const failure = specs !== null && specs !== void 0 ? specs : new package_specs_1.PackageSpecReportError("no report was asked for", "");
168
+ const stderr = failure.stderr.trim();
169
+ throw new task_guards_1.TaskError([
170
+ `${task}: \`cargo metadata\` could not list the members of the Cargo workspace for this task, so @convesoft/nx-rust cannot name the crate ${packageName} to cargo: ${failure.message}.`,
171
+ ...(stderr === "" ? [] : [stderr]),
172
+ "The task does not run, so that Nx stores no result for it. Correct what cargo reports, such as a manifest or a configuration file that it cannot read, and run the task again.",
173
+ ].join("\n"));
174
+ }
175
+ const spec = specs.get(packageName);
176
+ if (spec === undefined) {
177
+ throw new task_guards_1.TaskError([
178
+ `${task}: the Cargo workspace in ${(0, optional_tools_1.describeFolder)(workspaceRoot)} has no member named ${packageName} any more, while the project graph still has the crate, so the graph is out of date. The task does not run, so that Nx stores no result for it.`,
179
+ "Run `nx reset`, or stop the daemon with `nx daemon --stop`, and run the task again.",
180
+ ].join("\n"));
181
+ }
182
+ return spec;
183
+ }
184
+ // Cargo's directories for a task, which cargo reports with the task's
185
+ // environment in the folder where it will run, as physical paths: the
186
+ // artifact directory that it writes to, and the build directory, whose
187
+ // files the check of `DES-BUILD-INPUT-CHECK` leaves out.
188
+ // @mara implements DES-BUILD-INPUT-CHECK
189
+ function taskDirectories(task, cwd, env) {
190
+ const report = directoryReport(cwd, env);
191
+ return report instanceof directories_1.DirectoryReportError ? directoryFailure(task, report) : report;
192
+ }
193
+ // Fails a task whose cargo could not report Cargo's directories.
194
+ function directoryFailure(task, error) {
195
+ const stderr = error.stderr.trim();
196
+ throw new task_guards_1.TaskError([
197
+ `${task}: \`cargo metadata\` could not report Cargo's directories for this task, so @convesoft/nx-rust cannot tell where cargo puts its files: ${error.message}.`,
198
+ ...(stderr === "" ? [] : [stderr]),
199
+ "The task does not run, so that Nx stores no result for it. Correct what cargo reports, such as a manifest or a configuration file that it cannot read, and run the task again.",
200
+ ].join("\n"));
201
+ }
202
+ // Fails a cached `build` or `doc` for which cargo reports, with the task's
203
+ // environment, another artifact directory than the one whose folders its
204
+ // outputs name, which graph creation recorded: cargo would write elsewhere,
205
+ // and Nx would store what lies at the declared paths, an older artifact or
206
+ // nothing, under the task's key (`DES-OUTPUTS`). Where the variables that
207
+ // move the directory, `CARGO_TARGET_DIR`, `CARGO_BUILD_TARGET_DIR` and
208
+ // `CARGO_HOME`, have the values that graph creation saw, or those values
209
+ // give another directory as well, Cargo's configuration has changed since
210
+ // graph creation, as a file that Nx does not watch can under the Nx daemon;
211
+ // otherwise the task's environment moves it, as a dotenv file of the task
212
+ // does. A group asks cargo once for its directories ({@link directoryReport}).
213
+ // @mara implements DES-OUTPUTS
214
+ // @mara implements DES-DIAGNOSTICS
215
+ function checkArtifactDirectory(task, metadata, cwd, root, env, directories) {
216
+ var _a;
217
+ const named = metadata.artifactDirectory;
218
+ const now = (0, real_path_1.repositoryFolder)(directories.artifact, root);
219
+ if (now.inside && now.path === named) {
220
+ return;
221
+ }
222
+ const end = "The task does not run, so that Nx stores no result for it.";
223
+ const graphVariables = (_a = metadata.directoryVariables) !== null && _a !== void 0 ? _a : {};
224
+ const taskVariables = (0, directories_1.directoryVariables)(env);
225
+ const moved = directories_1.directoryVariableNames.filter((name) => taskVariables[name] !== graphVariables[name]);
226
+ const graphEnv = Object.assign({}, env);
227
+ for (const name of directories_1.directoryVariableNames) {
228
+ if (graphVariables[name] === undefined) {
229
+ delete graphEnv[name];
230
+ }
231
+ else {
232
+ graphEnv[name] = graphVariables[name];
233
+ }
234
+ }
235
+ const byVariables = moved.length === 0
236
+ ? undefined
237
+ : (0, real_path_1.repositoryFolder)(taskDirectories(task, cwd, graphEnv).artifact, root);
238
+ if (byVariables === undefined || !byVariables.inside || byVariables.path !== named) {
239
+ throw new task_guards_1.TaskError([
240
+ `${task}: Cargo's configuration has changed since Nx created the project graph: cargo now puts the artifacts of this run in ${now.path}${now.inside ? "" : ", outside the repository"}, while the outputs of the cached ${metadata.target} name the artifact directory ${named}.`,
241
+ `Nx does not watch a configuration file outside the repository, such as the Cargo home's, so the graph that the Nx daemon keeps is out of date. ${end} Run \`nx reset\`, or stop the daemon with \`nx daemon --stop\`, and run the task again.`,
242
+ ].join("\n"));
243
+ }
244
+ const shown = (value) => value === undefined ? "unset" : JSON.stringify(value);
245
+ const variables = moved
246
+ .map((name) => `${name} is ${shown(taskVariables[name])} in the task's environment and was ${shown(graphVariables[name])} when Nx created the graph`)
247
+ .join(", and ");
248
+ throw new task_guards_1.TaskError([
249
+ `${task}: cargo puts the artifacts of this run of the cached ${metadata.target} in ${now.path}${now.inside ? "" : ", outside the repository"}, but its outputs name the artifact directory ${named}: ${variables}.`,
250
+ `A variable that only a dotenv file of the task sets, such as a .env file in the crate's or the workspace's folder or a root .env.build, .env.doc or .env.<configuration>, is unknown when Nx creates the graph. ${end} Set the variable in the environment of the nx command or in the repository's root .env file, or set the folder as build.target-dir in a .cargo/config.toml of the workspace instead.`,
251
+ ].join("\n"));
252
+ }
253
+ //# sourceMappingURL=group-invocations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-invocations.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/group-invocations.ts"],"names":[],"mappings":";;AAuGA,4CA4IC;AAnPD,sDAM8B;AAE9B,0DAAgF;AAChF,kDAAoE;AAEpE,wCAA2C;AAC3C,4DAAyD;AAEzD,uCAMmB;AAGnB,mDAAgD;AAEhD,+CAA2D;AAoD3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,kCAAkC;AAClC,+BAA+B;AAC/B,6BAA6B;AAC7B,mCAAmC;AACnC,SAAgB,gBAAgB,CAC9B,KAA8B,EAC9B,IAAY,EACZ,YAA4B,EAAE,IAAI,EAAE,QAAQ,EAAE;;IAE9C,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IACtB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAClD,uEAAuE;IACvE,yEAAyE;IACzE,yDAAyD;IACzD,MAAM,WAAW,GAAwD,KAAK,CAAC,IAAI,CACjF,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAC5F;QACC,CAAC,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC;QAC3B,CAAC,CAAC,SAAS,CAAC;IACd,MAAM,KAAK,GACT,IAAA,gCAAsB,EAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,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,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,KAAK;SACpB,GAAG,CACF,CAAC,IAAI,EAAE,EAAE,CACP,GAAG,IAAI,OAAO,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,sCAAsC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,4BAA4B,CACxI;SACA,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClB,MAAM,IAAI,uBAAS,CACjB;QACE,GAAG,IAAI,wDAAwD,QAAQ,CAAC,MAAM,OAAO,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,0BAA0B,iDAAiD,KAAK,KAAK,SAAS,GAAG;QACnN,mNAAmN,GAAG,uLAAuL;KAC9Y,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACJ,CAAC"}
@@ -0,0 +1,114 @@
1
+ import type { ExecutorContext } from "@nx/devkit";
2
+ import type { CargoPackage } from "../cargo/metadata";
3
+ import type { CrateSelection } from "./affected";
4
+ import { type CargoStep } from "./command";
5
+ import { type GroupInvocation, type PreparedTask } from "./task";
6
+ import { type RunnerRecords } from "./test-steps";
7
+ /** A task of a group whose checks before cargo passed, with the group's command. */
8
+ export interface GroupMember {
9
+ /** The task as its checks before cargo left it. */
10
+ prepared: PreparedTask;
11
+ /** The group's command, and what the task does after it ({@link groupInvocations}). */
12
+ invocation: GroupInvocation;
13
+ /** The task's own executor context, for the checks after cargo. */
14
+ context: ExecutorContext;
15
+ }
16
+ /** The result of one task of a group. */
17
+ export interface MemberResult {
18
+ /** Whether the task passed every step of its group and the checks after them. */
19
+ success: boolean;
20
+ /** The task's part of each step's output, in order, with the plugin's lines after it. */
21
+ output: string;
22
+ }
23
+ /**
24
+ * What a batch shows of cargo's output while a group's command runs, besides
25
+ * each task's result (`DES-BATCH`, "Cargo's output while a batch runs"):
26
+ *
27
+ * - `lines`: cargo's lines as they arrive, on the batch process's standard
28
+ * error, where Nx's terminal UI shows them in the batch's pane;
29
+ * - `status`: one line each time a cargo command starts, naming the command,
30
+ * its crates and the step;
31
+ * - `none`: nothing, as for a task run on its own, whose output is its own.
32
+ *
33
+ * Neither line belongs to a task: no task's stored output changes.
34
+ */
35
+ export type LiveOutput = "lines" | "status" | "none";
36
+ /**
37
+ * What a batch process shows of cargo's output while it runs
38
+ * ({@link LiveOutput}): its lines under Nx's terminal UI, which Nx tells the
39
+ * batch process with `NX_TUI=true`, and a status line in every other output
40
+ * style, which the batch process cannot tell apart (`EVD-NX-24-BATCHES`,
41
+ * "Terminal output"). The maintainer chose this on 15 November 2026.
42
+ *
43
+ * @param batchEnv The batch process's own environment.
44
+ */
45
+ export declare function batchLiveOutput(batchEnv: NodeJS.ProcessEnv): LiveOutput;
46
+ /**
47
+ * Runs a group of tasks (`TERM-GROUP`): one cargo command for each step of
48
+ * their target, in the workspace root with the group's environment, and the
49
+ * checks that follow cargo for each task whose crate passed every step
50
+ * (`DES-BATCH`).
51
+ *
52
+ * Cargo's standard output and error go to one file, so that the output
53
+ * keeps the order in which cargo and the test executables wrote it, and only
54
+ * what {@link LiveOutput} asks for reaches the batch process's own output,
55
+ * which belongs to no task (`EVD-NX-24-BATCHES`).
56
+ *
57
+ * Each step runs even where a step before it failed for some crates, and a
58
+ * step is left out where no crate of the group can take part any more:
59
+ * where every task has failed, and for the doctests where no crate of the
60
+ * group has a library. A group of one crate, and a group of one task that
61
+ * selects its crate, runs the command that its task runs on its own and
62
+ * passes where cargo exits with status 0, with the whole output as its own.
63
+ * A group that selects the whole workspace, and a group of several crates,
64
+ * reads which crates passed from cargo's output ({@link readJsonStep},
65
+ * {@link readTestStepWithWarnings} and the steps of `test-steps.ts`); a step whose
66
+ * output shows no result per crate, such as that of `cargo fmt`, fails
67
+ * every task of the group when cargo fails. A task passes only where cargo's
68
+ * output shows that its crate passed.
69
+ *
70
+ * Then each task whose crate passed runs the checks that a task run on its
71
+ * own runs after cargo (`DES-LOCKFILE-HASHING`, "Post-check";
72
+ * `DES-BUILD-INPUT-CHECK`), so that no task of a batch skips one.
73
+ *
74
+ * In a verbose run, each command's lines are printed once, before cargo
75
+ * starts, with a first line that names the tasks of the command, so that
76
+ * they belong to no task's output in a batch (`DES-INVOCATION`, "Printing
77
+ * the command"): from the invocation that cargo is started with, through
78
+ * {@link printCommand}.
79
+ *
80
+ * @param members The tasks of one group, all with the same command.
81
+ * @param verbose Whether the run is verbose: as `batchRunsVerbosely`
82
+ * decides once for the batch, or `taskRunsVerbosely` for a task on its own.
83
+ * @param live What the batch shows of cargo's output while it runs.
84
+ * @param observe Receives each step's whole output once cargo has ended, as
85
+ * `napi-build` and `wasm-build` need it for the library that cargo
86
+ * reports (`DES-NAPI`, `DES-WASM`).
87
+ * @returns One result per member, in order.
88
+ */
89
+ export declare function runGroup(members: readonly GroupMember[], verbose?: boolean, live?: LiveOutput, observe?: (step: CargoStep, output: string) => void): Promise<MemberResult[]>;
90
+ /**
91
+ * The line that says what a task of an affected group runs and why
92
+ * (`REQ-AFFECTED-TESTS`): all its tests, the tests that cargo-affected
93
+ * selected, with every integration test where its binary may have changed,
94
+ * or none, and why that is enough.
95
+ */
96
+ export declare function selectionLine(task: string, crate: string, selection: CrateSelection | undefined, baseline: string): string;
97
+ /**
98
+ * The checks after cargo of a task that shared its group's command with
99
+ * other tasks: under `hakari`, the post-check compares the digests of every
100
+ * member, although the task's key holds its own, because its result rests
101
+ * on the drift check, which judged the whole lockfile (`DES-LOCKFILE-HASHING`,
102
+ * "Post-check"). Under the other strategies the key holds them already.
103
+ */
104
+ export declare function sharedCommandChecks(invocation: GroupInvocation): GroupInvocation;
105
+ /**
106
+ * Whether a crate has a library, whose doctests the doctest step runs; cargo
107
+ * fails `cargo test --doc` for a crate without one.
108
+ */
109
+ export declare function hasLibrary(pkg: CargoPackage | undefined): boolean;
110
+ /**
111
+ * What the selecting runner recorded in `folder` ({@link RunnerRecords}):
112
+ * one record per file, each a start followed by what came after it.
113
+ */
114
+ export declare function readRecords(folder: string): RunnerRecords;