@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,258 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OptionError = void 0;
4
+ exports.taskOptions = taskOptions;
5
+ exports.ignoredOptionLine = ignoredOptionLine;
6
+ exports.passedOnCommandLine = passedOnCommandLine;
7
+ exports.forwardedArguments = forwardedArguments;
8
+ const node_util_1 = require("node:util");
9
+ const command_1 = require("./command");
10
+ const nx_command_1 = require("./nx-command");
11
+ const split_words_1 = require("./split-words");
12
+ /**
13
+ * An option's value that the task cannot use, such as an `args` that does
14
+ * not split into words; its message names the task and the option.
15
+ */
16
+ class OptionError extends Error {
17
+ constructor(message) {
18
+ super(message);
19
+ this.name = "OptionError";
20
+ }
21
+ }
22
+ exports.OptionError = OptionError;
23
+ /**
24
+ * Sorts a task's options into those its target takes and those it ignores,
25
+ * and gives `run` its binary's arguments (`DES-UNKNOWN-OPTIONS`).
26
+ *
27
+ * An option that the executor's schema does not declare, or that it declares
28
+ * but the target does not take ({@link targetTakes}), stays out of the
29
+ * command and gets one warning line ({@link ignoredOptionLine}). On `run`,
30
+ * the value of `args` and, when {@link forwardedArguments} finds them, the
31
+ * arguments after `--` on the command line go to the binary; none of the
32
+ * latter is taken as an option or gets a line.
33
+ *
34
+ * It looks at one task only, so that the batch implementation can call it
35
+ * for each task of a batch.
36
+ *
37
+ * @throws {OptionError} When `args` does not split into words.
38
+ */
39
+ // @mara implements DES-UNKNOWN-OPTIONS
40
+ // @mara implements REQ-UNKNOWN-OPTIONS
41
+ function taskOptions(subject) {
42
+ const { executor, target } = subject;
43
+ const options = Object.assign({}, subject.options);
44
+ let forwarded = [];
45
+ if (target === "run") {
46
+ const found = forwardedArguments(subject);
47
+ if (found !== undefined) {
48
+ forwarded = found.words;
49
+ // Taken from the arguments, not as options: `run`'s own options keep
50
+ // their configured value, and other options are left out unseen.
51
+ for (const name of found.optionNames) {
52
+ if (executor.declared.has(name) && name in subject.configured) {
53
+ options[name] = subject.configured[name];
54
+ }
55
+ else {
56
+ delete options[name];
57
+ }
58
+ }
59
+ }
60
+ }
61
+ const taken = {};
62
+ const warnings = [];
63
+ for (const [name, value] of Object.entries(options)) {
64
+ const declared = executor.declared.has(name);
65
+ if (declared && (0, command_1.targetTakes)(target, name)) {
66
+ taken[name] = value;
67
+ }
68
+ else {
69
+ warnings.push(ignoredOptionLine(subject, name, value, declared ? "not-taken" : "unknown"));
70
+ }
71
+ }
72
+ const binaryArguments = target === "run" ? [...argsWords(subject.task, taken.args), ...forwarded] : [];
73
+ return { options: taken, binaryArguments, warnings };
74
+ }
75
+ /**
76
+ * The warning line for an option that a task ignores. It names the task and
77
+ * the option and says either that the option was passed on the command line,
78
+ * when {@link passedOnCommandLine} is sure of it, with what to do about the
79
+ * flag or words ({@link commandLineRemedy}), or that it comes from the
80
+ * workspace's configuration, with the command that shows where and the two
81
+ * fixes for a `targetDefaults` entry.
82
+ *
83
+ * Positional words, which Nx hands a task as the option `_`, are named as
84
+ * such.
85
+ */
86
+ // @mara implements DES-UNKNOWN-OPTIONS
87
+ function ignoredOptionLine(subject, name, value, because) {
88
+ const { task, executor } = subject;
89
+ const words = name === "_" && Array.isArray(value);
90
+ const option = words
91
+ ? `the positional arguments ${JSON.stringify(value.map(String))} (option \`_\`)`
92
+ : `option \`${name}\``;
93
+ const reason = because === "unknown"
94
+ ? `which the ${executor.shortName} executor does not know`
95
+ : "which this target does not take";
96
+ if (passedOnCommandLine(subject, name, value)) {
97
+ const remedy = commandLineRemedy(subject.target, words ? "words" : because);
98
+ return because === "unknown"
99
+ ? `${task}: ignoring ${option}, passed on the command line. ${remedy}`
100
+ : `${task}: ignoring ${option}, ${reason}, passed on the command line. ${remedy}`;
101
+ }
102
+ return [
103
+ `${task}: ignoring ${option}, ${reason}.`,
104
+ `It comes from the workspace's configuration: run \`nx show target ${task} --json\` and look under \`sourceMap\` for the file and entry.`,
105
+ `If it is a \`targetDefaults\` entry in nx.json, add a \`filter\` to it or add an empty entry keyed by "${executor.name}".`,
106
+ ].join(" ");
107
+ }
108
+ /**
109
+ * What the line for a flag or words typed on the command line tells the user
110
+ * to do (`DES-UNKNOWN-OPTIONS`, paragraph "Source"): to remove an option that
111
+ * the executor does not know or check its spelling, to remove one that the
112
+ * target does not take, and to remove positional words. Only `run` passes
113
+ * arguments on, to its binary, so on `run` the line for an unknown option or
114
+ * for words also names the two ways to do that; `test` has no option for
115
+ * arguments of the test binary.
116
+ */
117
+ function commandLineRemedy(target, what) {
118
+ switch (what) {
119
+ case "words":
120
+ return target === "run"
121
+ ? "Remove them, or pass them to the binary after `--` or with `--args`."
122
+ : "Remove them.";
123
+ case "not-taken":
124
+ return "Remove it.";
125
+ case "unknown":
126
+ return target === "run"
127
+ ? "Remove it or check its spelling, or pass it to the binary after `--` or with `--args`."
128
+ : "Remove it, or check its spelling.";
129
+ }
130
+ }
131
+ /**
132
+ * Whether the option `name` with `value` was passed on the command line of
133
+ * the `nx` command, which holds only when three records agree
134
+ * (`DES-UNKNOWN-OPTIONS`, paragraph "Command line"):
135
+ *
136
+ * 1. The graph task holds the option among its overrides with the same value.
137
+ * 2. That task's own `__overrides_unparsed__` lists it as `--<name>`,
138
+ * `--<name>=<value>`, `--no-<name>` or, for a one-letter name,
139
+ * `-<name>`, before any `--` in that list.
140
+ * 3. The same flag is among the recorded arguments of the `nx` command.
141
+ *
142
+ * For `_`, the positional words, the list parsed as Nx parses it gives the
143
+ * same words, and each word of the list that can be positional is among the
144
+ * recorded arguments. Where Nx gave a declared option its camel-case name,
145
+ * the overrides and the flag may still have the spelling with dashes.
146
+ */
147
+ // @mara implements DES-UNKNOWN-OPTIONS
148
+ function passedOnCommandLine(subject, name, value) {
149
+ const { graphTask, record } = subject;
150
+ const overrides = graphTask === null || graphTask === void 0 ? void 0 : graphTask.overrides;
151
+ const unparsed = overrides === null || overrides === void 0 ? void 0 : overrides.__overrides_unparsed__;
152
+ if (overrides === undefined || !isWordList(unparsed) || record === undefined) {
153
+ return false;
154
+ }
155
+ if (name === "_") {
156
+ return ((0, node_util_1.isDeepStrictEqual)(overrides._, value) &&
157
+ (0, node_util_1.isDeepStrictEqual)((0, nx_command_1.parseAsNx)(unparsed, subject.workspaceRoot)._, value) &&
158
+ positionalWords(unparsed).every((word) => record.includes(word)));
159
+ }
160
+ const flags = beforeDoubleDash(unparsed);
161
+ return Object.keys(overrides)
162
+ .filter((key) => key === name || (subject.executor.declared.has(name) && nxCamelCase(key) === name))
163
+ .some((key) => {
164
+ if (!(0, node_util_1.isDeepStrictEqual)(overrides[key], value)) {
165
+ return false;
166
+ }
167
+ const flag = flags.find((word) => isFlagFor(word, key));
168
+ return flag !== undefined && record.includes(flag);
169
+ });
170
+ }
171
+ /**
172
+ * The arguments after `--` on the command line that a `run` task passes to
173
+ * its binary, and the names under which the invocation's options hold what
174
+ * Nx parsed from them, or `undefined` when the task passes none. They are
175
+ * passed only when three conditions hold (`DES-UNKNOWN-OPTIONS`, paragraph
176
+ * "run"): the record has `--`; the graph task's own
177
+ * `__overrides_unparsed__` equals the recorded arguments after it; and the
178
+ * invocation's options hold every option that Nx parses from those
179
+ * arguments, apart from the executor's own, with the same value. A missing
180
+ * record counts as a command without `--`.
181
+ */
182
+ // @mara implements DES-UNKNOWN-OPTIONS
183
+ // @mara implements DES-TARGET-COMMANDS
184
+ function forwardedArguments(subject) {
185
+ var _a, _b;
186
+ const { record, graphTask, executor } = subject;
187
+ const separator = (_a = record === null || record === void 0 ? void 0 : record.indexOf("--")) !== null && _a !== void 0 ? _a : -1;
188
+ if (record === undefined || separator === -1) {
189
+ return undefined;
190
+ }
191
+ const words = record.slice(separator + 1);
192
+ const unparsed = (_b = graphTask === null || graphTask === void 0 ? void 0 : graphTask.overrides) === null || _b === void 0 ? void 0 : _b.__overrides_unparsed__;
193
+ if (!isWordList(unparsed) || !(0, node_util_1.isDeepStrictEqual)(unparsed, words)) {
194
+ return undefined;
195
+ }
196
+ const optionNames = Object.entries((0, nx_command_1.parseAsNx)(words, subject.workspaceRoot)).map(([key, parsed]) => {
197
+ const name = executor.declared.has(nxCamelCase(key)) ? nxCamelCase(key) : key;
198
+ return { name, parsed };
199
+ });
200
+ const held = optionNames.every(({ name, parsed }) => executor.declared.has(name) || (0, node_util_1.isDeepStrictEqual)(subject.options[name], parsed));
201
+ return held ? { words, optionNames: optionNames.map(({ name }) => name) } : undefined;
202
+ }
203
+ // The words of `args`, for the binary.
204
+ function argsWords(task, args) {
205
+ if (typeof args !== "string") {
206
+ return [];
207
+ }
208
+ try {
209
+ return (0, split_words_1.splitWords)(args);
210
+ }
211
+ catch (error) {
212
+ if (!(error instanceof split_words_1.SplitError)) {
213
+ throw error;
214
+ }
215
+ const problem = error.problem === "unterminated-quote"
216
+ ? "has a quote that is not closed. Close it, or put a backslash before a quote that is part of an argument."
217
+ : "ends in a backslash, which escapes nothing. Remove it, or write two backslashes for one.";
218
+ throw new OptionError(`${task}: the value of the \`args\` option, ${JSON.stringify(args)}, ${problem} The binary did not start.`);
219
+ }
220
+ }
221
+ // Whether `word` names the option `key` as a flag.
222
+ function isFlagFor(word, key) {
223
+ return (word === `--${key}` ||
224
+ word.startsWith(`--${key}=`) ||
225
+ word === `--no-${key}` ||
226
+ (key.length === 1 && word === `-${key}`));
227
+ }
228
+ // The words of a list of arguments before its first `--`, which Nx parses as
229
+ // flags; after it every word is positional.
230
+ function beforeDoubleDash(words) {
231
+ const end = words.indexOf("--");
232
+ return end === -1 ? words : words.slice(0, end);
233
+ }
234
+ // The words of a list that Nx can take as positional: those that are no
235
+ // flag, and every word after the first `--`. Some of them may be values of
236
+ // flags, which is no matter here: they come from the same command line.
237
+ function positionalWords(words) {
238
+ const end = words.indexOf("--");
239
+ const before = end === -1 ? words : words.slice(0, end);
240
+ return [
241
+ ...before.filter((word) => !word.startsWith("-")),
242
+ ...(end === -1 ? [] : words.slice(end + 1)),
243
+ ];
244
+ }
245
+ function isWordList(value) {
246
+ return Array.isArray(value) && value.every((word) => typeof word === "string");
247
+ }
248
+ /**
249
+ * The name under which Nx hands a task an option given with dashes, where
250
+ * the executor's schema declares that name (`camelCase` in `utils/params.js`
251
+ * of `nx` 24).
252
+ */
253
+ function nxCamelCase(name) {
254
+ return name.indexOf("-") > 1
255
+ ? name.toLowerCase().replace(/-(.)/g, (_match, letter) => letter.toUpperCase())
256
+ : name;
257
+ }
258
+ //# sourceMappingURL=task-options.js.map
@@ -0,0 +1 @@
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;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;QAC1B,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACvF,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
@@ -0,0 +1,166 @@
1
+ import type { ExecutorContext } from "@nx/devkit";
2
+ import type { BuildRecordSource } from "../graph/build-records";
3
+ import type { TestRunner } from "../graph/settings";
4
+ import { type InferredTargetName, type TargetCargoMetadata } from "../graph/targets";
5
+ import { type CargoTargetOptions } from "./command";
6
+ import { type GroupInvocation, groupInvocations } from "./group-invocations";
7
+ import { type NapiTask } from "./napi-build";
8
+ import { checksAfterCargo } from "./task-execution";
9
+ import { type DigestStep, type PluginExecutor, projectWarnings, TaskError } from "./task-guards";
10
+ import { type TestMode } from "./test-mode";
11
+ import { type WasmTask } from "./wasm-build";
12
+ export { checksAfterCargo, type GroupInvocation, groupInvocations, type PluginExecutor, projectWarnings, TaskError, };
13
+ /**
14
+ * Runs one task of an inferred target that Nx runs on its own, as with
15
+ * `--batch=false`: as a group with one task (`TERM-GROUP`), in the root
16
+ * folder of the crate's workspace, with the environment that Nx gives the
17
+ * task and nothing added.
18
+ *
19
+ * A group that selects its crate, a group of one crate among them, runs one
20
+ * cargo command with cargo's standard streams as the task's own, so that Nx
21
+ * shows and stores what cargo prints, and the task succeeds when cargo exits
22
+ * with status 0. A group that selects the whole workspace, as `build`,
23
+ * `check`, `lint` and `test` do under `workspace-build` on the host, runs the
24
+ * steps that the same group runs in a batch, so that its crate compiles with
25
+ * the features of the whole workspace whatever else runs
26
+ * (`REQ-STABLE-FEATURES`), and prints its part of their output once they
27
+ * have ended, as its result in a batch holds it (`DES-BATCH`).
28
+ *
29
+ * A problem found before cargo starts fails the task with a message that
30
+ * names it and runs no cargo. An option that the task ignores gets a warning
31
+ * line at the top of its output, and so does the reason why a task runs its
32
+ * crate alone where the output names it. Before anything else, the task
33
+ * prints the warnings that graph creation found for its project, among them
34
+ * the one for an Nx major newer than the supported ones that
35
+ * `NX_RUST_ALLOW_UNSUPPORTED_NX` lets the plugin run with, which the Nx
36
+ * daemon keeps out of the terminal. The project's keys hold a digest of them,
37
+ * so that a cache hit replays the warnings of the graph that the command
38
+ * uses (`DES-DIAGNOSTICS`, "Warnings where they are seen"), apart from those
39
+ * about Cargo configuration that Nx does not hash, which no key holds. When
40
+ * the executor's context says that Nx runs verbosely, the task prints each
41
+ * cargo command right before cargo starts, after every warning
42
+ * (`DES-INVOCATION`, "Printing the command"); otherwise it prints nothing of
43
+ * it.
44
+ */
45
+ export declare function runTask(executor: PluginExecutor, options: CargoTargetOptions, context: ExecutorContext): Promise<{
46
+ success: boolean;
47
+ }>;
48
+ /**
49
+ * A task whose checks before cargo have passed, waiting for the cargo
50
+ * command of its group (`TERM-GROUP`): what its command depends on, and
51
+ * what the task does after the command.
52
+ */
53
+ export interface PreparedTask {
54
+ /** The task as messages name it, `<project>:<target>`. */
55
+ task: string;
56
+ /** The default name of the task's target, which decides the command. */
57
+ target: InferredTargetName;
58
+ /** The options that the target takes ({@link taskOptions}). */
59
+ options: CargoTargetOptions;
60
+ /** The binary's arguments, for `run`; empty for every other target. */
61
+ binaryArguments: string[];
62
+ /** One warning line per option that the task ignores (`DES-UNKNOWN-OPTIONS`). */
63
+ warnings: string[];
64
+ /** Whether the command runs in locked mode (`DES-INVOCATION`). */
65
+ locked: boolean;
66
+ /** The workspace's root folder, relative to the repository root. */
67
+ workspaceRoot: string;
68
+ /** The absolute path of the workspace root, where cargo starts. */
69
+ cwd: string;
70
+ /** The crate's package name; absent for a workspace project without a crate. */
71
+ crate?: string;
72
+ /** The crate's manifest, relative to the repository root. */
73
+ manifest?: string;
74
+ /** What the task does with the lockfile's digests after cargo (`TaskInvocation.digests`). */
75
+ digests?: DigestStep;
76
+ /**
77
+ * On a cached `build` or `doc` whose outputs name the artifact directory:
78
+ * the target's metadata, against which the group's directories are
79
+ * checked before cargo builds (`DES-OUTPUTS`).
80
+ */
81
+ artifactCheck?: TargetCargoMetadata;
82
+ /**
83
+ * On a crate's `build`, `napi-build` and `wasm-build`: what graph creation
84
+ * reported for the records (`DES-BUILD-INPUT-CHECK`).
85
+ */
86
+ records?: BuildRecordSource;
87
+ /** On `napi-build`: what its compile and post-processing need (`DES-NAPI`). */
88
+ napi?: NapiTask;
89
+ /** On `wasm-build`: what its post-processing needs (`DES-WASM`). */
90
+ wasm?: WasmTask;
91
+ /**
92
+ * Whether the target's own options, which the crate's table, a
93
+ * `project.json` or a `targetDefaults` entry give it, set a feature set:
94
+ * features, all features or no default features. Such a task forms a
95
+ * group of one crate whatever else runs ("Groups of one crate" in
96
+ * `DES-BATCH`); a feature set that a configuration or the command line
97
+ * gives every task of a run does not count.
98
+ */
99
+ ownFeatureSet?: boolean;
100
+ /**
101
+ * On `test`: the workspace's test runner, from the target's metadata
102
+ * (`REQ-TEST-RUNNER`); absent means `cargo`.
103
+ */
104
+ testRunner?: TestRunner;
105
+ /**
106
+ * The feature-unification strategy of the task's workspace, as graph
107
+ * creation recorded it in the project's metadata (`DES-UNIFICATION`);
108
+ * `workspace-build` where it recorded none, and where absent.
109
+ */
110
+ featureUnification?: "hakari" | "cargo" | "workspace-build";
111
+ /**
112
+ * Under `hakari`, the triples of `platforms` that graph creation recorded:
113
+ * a task that builds for another triple, or on another host, forms a
114
+ * group of one crate ("Triples that `platforms` does not list").
115
+ */
116
+ hakariPlatforms?: string[];
117
+ /**
118
+ * On `test` in a workspace that uses selection: the test mode, decided
119
+ * from the task's environment by the rule of the target's mode input
120
+ * (`DES-TEST-MODE`), and the line that says at the top of the task's
121
+ * output which suite it runs and why.
122
+ */
123
+ testMode?: {
124
+ mode: TestMode;
125
+ /**
126
+ * Whether the task selects: it is in affected mode with a baseline and
127
+ * does not opt out with `affectedTests = false`.
128
+ */
129
+ selects: boolean;
130
+ note?: string;
131
+ };
132
+ /** Under `hakari`, the hack crate's package name (`DES-NAPI`). */
133
+ hakariPackage?: string;
134
+ /** The task's environment, with which its checks ran and its cargo runs. */
135
+ env: NodeJS.ProcessEnv;
136
+ }
137
+ /**
138
+ * The checks of a task before cargo runs, and what its command depends on,
139
+ * apart from what a group asks cargo once for all its tasks: the crates'
140
+ * package ID specifications and Cargo's directories ({@link groupInvocations}).
141
+ *
142
+ * @param env The task's environment, with `NX_RUST_LOCKED`, `NX_RUST_RUN_ID`
143
+ * and the record of the `nx` command ({@link recordedNxCommand}).
144
+ * @throws {TaskError} When the target is no inferred target of this
145
+ * executor, when its configuration caches a target that the plugin leaves
146
+ * uncached in this project, when `build` or `doc` gets the profile `dev`,
147
+ * `test` or `bench`, or is cached while its options name no triple and
148
+ * the task's environment and Cargo's configuration pick a triple whose
149
+ * folder the plugin cannot name or other triples than its outputs name,
150
+ * or is cached while its `targetTriple` option is `host-tuple` or a
151
+ * target specification file (`DES-OUTPUTS`), when `NX_RUST_LOCKED` is
152
+ * neither `true` nor `false`, when `args` does not split into words, when
153
+ * the run gives `pluginVersion` another value than the target's
154
+ * (`DES-PLUGIN-OPTIONS`), when a task whose target hashes digests does not
155
+ * depend on its workspace's lockfile task in a run that does not exclude
156
+ * task dependencies (`DES-LOCKFILE-HASHING`), when the run holds the
157
+ * `build` of a crate whose `test` replaces its executables without an
158
+ * order between the two (`DES-TARGETS`), or when the tool that the target
159
+ * runs besides cargo is not installed where `env` and the workspace root
160
+ * say (`DES-DIAGNOSTICS`), or when `NX_RUST_TEST_MODE` has another value
161
+ * than `full` or `affected` for a `test` in a workspace that uses
162
+ * selection (`DES-TEST-MODE`). The checks of what reaches the task's key, the
163
+ * cache guard, `pluginVersion` and the lockfile dependency, and the check
164
+ * of the order of `test` and `build` all run before the check for the tool.
165
+ */
166
+ export declare function prepareTask(executor: PluginExecutor, options: CargoTargetOptions, context: ExecutorContext, env: NodeJS.ProcessEnv): PreparedTask;