@sdxc/kit 2026.10.17 → 2026.10.21

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 (295) hide show
  1. package/README.md +397 -22
  2. package/changelog.jsonl +1171 -1092
  3. package/config.schema.json +53 -1
  4. package/dist/cli.js +12 -0
  5. package/dist/commands/deploy.d.ts +23 -0
  6. package/dist/commands/deploy.js +167 -0
  7. package/dist/commands/destroy.d.ts +22 -0
  8. package/dist/commands/destroy.js +92 -0
  9. package/dist/commands/doctor.d.ts +26 -0
  10. package/dist/commands/doctor.js +65 -0
  11. package/dist/commands/initializers.d.ts +16 -0
  12. package/dist/commands/initializers.js +23 -0
  13. package/dist/commands/make.d.ts +78 -6
  14. package/dist/commands/make.js +134 -20
  15. package/dist/commands/middleware.d.ts +16 -0
  16. package/dist/commands/middleware.js +21 -0
  17. package/dist/commands/models.d.ts +18 -0
  18. package/dist/commands/models.js +29 -0
  19. package/dist/commands/notes.d.ts +17 -0
  20. package/dist/commands/notes.js +27 -0
  21. package/dist/commands/routes.d.ts +25 -0
  22. package/dist/commands/routes.js +50 -0
  23. package/dist/commands/run.d.ts +16 -0
  24. package/dist/commands/run.js +32 -11
  25. package/dist/commands/scaffold.d.ts +30 -0
  26. package/dist/commands/scaffold.js +34 -0
  27. package/dist/commands/schedule.d.ts +16 -0
  28. package/dist/commands/schedule.js +21 -0
  29. package/dist/commands/stats.d.ts +16 -0
  30. package/dist/commands/stats.js +21 -0
  31. package/dist/commands/ui/update.d.ts +6 -3
  32. package/dist/commands/ui/update.js +24 -7
  33. package/dist/commands/upgrade.d.ts +3 -1
  34. package/dist/commands/upgrade.js +88 -23
  35. package/dist/config.d.ts +20 -0
  36. package/dist/config.js +32 -1
  37. package/dist/contract.d.ts +101 -3
  38. package/dist/contract.js +371 -26
  39. package/dist/create/templates.js +3 -2
  40. package/dist/dependencies.d.ts +5 -1
  41. package/dist/dependencies.js +16 -1
  42. package/dist/deploy/plan.d.ts +49 -0
  43. package/dist/deploy/plan.js +68 -0
  44. package/dist/destroy.d.ts +40 -0
  45. package/dist/destroy.js +317 -0
  46. package/dist/doctor/check.d.ts +71 -0
  47. package/dist/doctor/check.js +53 -0
  48. package/dist/doctor/checks.d.ts +23 -0
  49. package/dist/doctor/checks.js +70 -0
  50. package/dist/doctor/define.d.ts +59 -0
  51. package/dist/doctor/define.js +16 -0
  52. package/dist/doctor/emails.d.ts +18 -0
  53. package/dist/doctor/emails.js +243 -0
  54. package/dist/doctor/env.d.ts +26 -0
  55. package/dist/doctor/env.js +88 -0
  56. package/dist/doctor/files.d.ts +14 -0
  57. package/dist/doctor/files.js +34 -0
  58. package/dist/doctor/fixture.d.ts +23 -0
  59. package/dist/doctor/fixture.js +46 -0
  60. package/dist/doctor/install.d.ts +17 -0
  61. package/dist/doctor/install.js +37 -0
  62. package/dist/doctor/installed.d.ts +11 -0
  63. package/dist/doctor/installed.js +79 -0
  64. package/dist/doctor/jsdoc.d.ts +44 -0
  65. package/dist/doctor/jsdoc.js +201 -0
  66. package/dist/doctor/layout.d.ts +23 -0
  67. package/dist/doctor/layout.js +83 -0
  68. package/dist/doctor/migrations.d.ts +16 -0
  69. package/dist/doctor/migrations.js +96 -0
  70. package/dist/doctor/models.d.ts +13 -0
  71. package/dist/doctor/models.js +69 -0
  72. package/dist/doctor/pins.d.ts +15 -0
  73. package/dist/doctor/pins.js +79 -0
  74. package/dist/doctor/project.d.ts +58 -0
  75. package/dist/doctor/project.js +261 -0
  76. package/dist/doctor/remix.d.ts +14 -0
  77. package/dist/doctor/remix.js +44 -0
  78. package/dist/doctor/routes.d.ts +11 -0
  79. package/dist/doctor/routes.js +49 -0
  80. package/dist/doctor/typegen.d.ts +13 -0
  81. package/dist/doctor/typegen.js +57 -0
  82. package/dist/doctor/ui.d.ts +14 -0
  83. package/dist/doctor/ui.js +51 -0
  84. package/dist/initializers.d.ts +25 -0
  85. package/dist/initializers.js +89 -0
  86. package/dist/lock.d.ts +2 -2
  87. package/dist/make/actions.d.ts +23 -0
  88. package/dist/make/actions.js +82 -0
  89. package/dist/make/declare.d.ts +31 -3
  90. package/dist/make/declare.js +284 -9
  91. package/dist/make/email.d.ts +23 -0
  92. package/dist/make/email.js +111 -0
  93. package/dist/make/from-fields.d.ts +30 -0
  94. package/dist/make/from-fields.js +162 -0
  95. package/dist/make/from-model.d.ts +39 -0
  96. package/dist/make/from-model.js +161 -0
  97. package/dist/make/generate.d.ts +25 -5
  98. package/dist/make/generate.js +76 -22
  99. package/dist/make/guard.d.ts +35 -0
  100. package/dist/make/guard.js +73 -0
  101. package/dist/make/imports.d.ts +6 -0
  102. package/dist/make/imports.js +19 -0
  103. package/dist/make/index.d.ts +49 -4
  104. package/dist/make/index.js +290 -29
  105. package/dist/make/kinds.d.ts +34 -2
  106. package/dist/make/kinds.js +92 -8
  107. package/dist/make/mount.d.ts +25 -0
  108. package/dist/make/mount.js +135 -0
  109. package/dist/make/schema-diff.d.ts +58 -0
  110. package/dist/make/schema-diff.js +609 -0
  111. package/dist/make/schema.d.ts +76 -0
  112. package/dist/make/schema.js +206 -0
  113. package/dist/make/stubs.d.ts +14 -7
  114. package/dist/make/stubs.js +24 -8
  115. package/dist/make/test.d.ts +43 -0
  116. package/dist/make/test.js +150 -0
  117. package/dist/make/trigger.d.ts +31 -0
  118. package/dist/make/trigger.js +163 -0
  119. package/dist/models.d.ts +42 -0
  120. package/dist/models.js +149 -0
  121. package/dist/notes.d.ts +28 -0
  122. package/dist/notes.js +66 -0
  123. package/dist/reference.d.ts +27 -0
  124. package/dist/reference.js +103 -0
  125. package/dist/releases.d.ts +9 -0
  126. package/dist/releases.js +29 -8
  127. package/dist/routes/chains.d.ts +34 -0
  128. package/dist/routes/chains.js +95 -0
  129. package/dist/routes/filter.d.ts +53 -0
  130. package/dist/routes/filter.js +147 -0
  131. package/dist/routes/format.d.ts +23 -0
  132. package/dist/routes/format.js +123 -0
  133. package/dist/routes/helpers.d.ts +21 -0
  134. package/dist/routes/helpers.js +165 -0
  135. package/dist/routes/index.d.ts +56 -0
  136. package/dist/routes/index.js +167 -0
  137. package/dist/routes/modules.d.ts +116 -0
  138. package/dist/routes/modules.js +235 -0
  139. package/dist/routes/parse.d.ts +161 -0
  140. package/dist/routes/parse.js +621 -0
  141. package/dist/routes/routers.d.ts +69 -0
  142. package/dist/routes/routers.js +327 -0
  143. package/dist/scaffold/fields.d.ts +129 -0
  144. package/dist/scaffold/fields.js +421 -0
  145. package/dist/scaffold/index.d.ts +39 -0
  146. package/dist/scaffold/index.js +622 -0
  147. package/dist/scaffold/render.d.ts +61 -0
  148. package/dist/scaffold/render.js +417 -0
  149. package/dist/schedule.d.ts +45 -0
  150. package/dist/schedule.js +124 -0
  151. package/dist/stats.d.ts +37 -0
  152. package/dist/stats.js +126 -0
  153. package/dist/ui/commands.d.ts +10 -3
  154. package/dist/ui/commands.js +85 -15
  155. package/dist/ui/registry.d.ts +8 -8
  156. package/dist/upgrade/agents.d.ts +49 -0
  157. package/dist/upgrade/agents.js +110 -0
  158. package/dist/upgrade/changelog.d.ts +2 -2
  159. package/dist/upgrade/project.d.ts +4 -0
  160. package/dist/upgrade/project.js +11 -1
  161. package/dist/upgrade/prompt.d.ts +11 -0
  162. package/dist/upgrade/prompt.js +50 -7
  163. package/package.json +6 -4
  164. package/registry/ui/alert-dialog.json +2 -2
  165. package/registry/ui/attachment.json +2 -2
  166. package/registry/ui/calendar.json +2 -2
  167. package/registry/ui/color-picker.json +2 -2
  168. package/registry/ui/command.json +2 -2
  169. package/registry/ui/date-picker.json +2 -2
  170. package/registry/ui/date-range-picker.json +2 -2
  171. package/registry/ui/dialog.json +2 -2
  172. package/registry/ui/file-trigger.json +2 -2
  173. package/registry/ui/heading-scope.json +2 -2
  174. package/registry/ui/message-scroller.json +2 -2
  175. package/registry/ui/number-field.json +2 -2
  176. package/registry/ui/range-calendar.json +2 -2
  177. package/registry/ui/resizable.json +2 -2
  178. package/registry/ui/select.json +2 -2
  179. package/registry/ui/shared-element.json +2 -2
  180. package/registry/ui/sidebar.json +3 -3
  181. package/registry/ui/typeset.json +3 -3
  182. package/stubs/command.spec.stub +15 -0
  183. package/stubs/controller.api.resource.stub +23 -0
  184. package/stubs/controller.api.spec.stub +15 -0
  185. package/stubs/controller.form.stub +2 -2
  186. package/stubs/controller.form.test.stub +2 -2
  187. package/stubs/controller.resource.form.stub +67 -0
  188. package/stubs/controller.resource.stub +28 -0
  189. package/stubs/controller.spec.stub +15 -0
  190. package/stubs/email.stub +9 -14
  191. package/stubs/email.test.stub +9 -9
  192. package/stubs/factory.stub +1 -1
  193. package/stubs/mcp.spec.stub +16 -0
  194. package/stubs/model.stub +3 -3
  195. package/stubs/policy.test.stub +34 -8
  196. package/stubs/scaffold.api.create.stub +34 -0
  197. package/stubs/scaffold.api.create.test.stub +37 -0
  198. package/stubs/scaffold.api.destroy.stub +34 -0
  199. package/stubs/scaffold.api.destroy.test.stub +44 -0
  200. package/stubs/scaffold.api.index.stub +23 -0
  201. package/stubs/scaffold.api.index.test.stub +31 -0
  202. package/stubs/scaffold.api.show.stub +27 -0
  203. package/stubs/scaffold.api.show.test.stub +41 -0
  204. package/stubs/scaffold.api.update.stub +44 -0
  205. package/stubs/scaffold.api.update.test.stub +46 -0
  206. package/stubs/scaffold.command.create.stub +22 -0
  207. package/stubs/scaffold.command.create.test.stub +30 -0
  208. package/stubs/scaffold.command.delete.stub +20 -0
  209. package/stubs/scaffold.command.delete.test.stub +39 -0
  210. package/stubs/scaffold.command.list.stub +18 -0
  211. package/stubs/scaffold.command.list.test.stub +31 -0
  212. package/stubs/scaffold.command.show.stub +19 -0
  213. package/stubs/scaffold.command.show.test.stub +37 -0
  214. package/stubs/scaffold.controller.destroy.stub +35 -0
  215. package/stubs/scaffold.controller.destroy.test.stub +65 -0
  216. package/stubs/scaffold.controller.edit.stub +97 -0
  217. package/stubs/scaffold.controller.edit.test.stub +91 -0
  218. package/stubs/scaffold.controller.index.stub +55 -0
  219. package/stubs/scaffold.controller.index.test.stub +32 -0
  220. package/stubs/scaffold.controller.new.stub +70 -0
  221. package/stubs/scaffold.controller.new.test.stub +81 -0
  222. package/stubs/scaffold.controller.show.stub +59 -0
  223. package/stubs/scaffold.controller.show.test.stub +43 -0
  224. package/stubs/scaffold.factory.stub +16 -0
  225. package/stubs/scaffold.form.stub +75 -0
  226. package/stubs/scaffold.mcp.create.stub +24 -0
  227. package/stubs/scaffold.mcp.create.test.stub +36 -0
  228. package/stubs/scaffold.mcp.delete.stub +31 -0
  229. package/stubs/scaffold.mcp.delete.test.stub +43 -0
  230. package/stubs/scaffold.mcp.get.stub +21 -0
  231. package/stubs/scaffold.mcp.get.test.stub +31 -0
  232. package/stubs/scaffold.mcp.list.stub +23 -0
  233. package/stubs/scaffold.mcp.list.test.stub +25 -0
  234. package/stubs/scaffold.mcp.update.stub +37 -0
  235. package/stubs/scaffold.mcp.update.test.stub +40 -0
  236. package/stubs/scaffold.migration.stub +3 -0
  237. package/stubs/scaffold.model.stub +35 -0
  238. package/stubs/scaffold.model.test.stub +25 -0
  239. package/stubs/scaffold.spec.stub +7 -0
  240. package/stubs/scaffold.test-database.stub +33 -0
  241. package/stubs/scaffold.test-mcp.stub +92 -0
  242. package/stubs/scaffold.validator.stub +18 -0
  243. package/stubs/scaffold.validator.test.stub +26 -0
  244. package/templates/app/AGENTS.md +167 -0
  245. package/templates/app/CLAUDE.md +1 -0
  246. package/templates/app/README.md +33 -15
  247. package/templates/app/app/commands/console.test.ts +26 -0
  248. package/templates/app/app/commands/console.ts +19 -0
  249. package/templates/app/app/commands/db/fresh.test.ts +57 -0
  250. package/templates/app/app/commands/db/fresh.ts +37 -0
  251. package/templates/app/app/commands/db/migrate.test.ts +17 -1
  252. package/templates/app/app/commands/db/migrate.ts +51 -18
  253. package/templates/app/app/commands/db/prepare.test.ts +39 -0
  254. package/templates/app/app/commands/db/prepare.ts +35 -0
  255. package/templates/app/app/commands/db/seed.test.ts +38 -0
  256. package/templates/app/app/commands/db/seed.ts +26 -0
  257. package/templates/app/app/commands/deploy.test.ts +34 -0
  258. package/templates/app/app/commands/deploy.ts +18 -0
  259. package/templates/app/app/commands/emails/preview.test.tsx +63 -0
  260. package/templates/app/app/commands/emails/preview.ts +24 -0
  261. package/templates/app/app/commands/index.ts +57 -2
  262. package/templates/app/app/commands/typegen.test.ts +20 -1
  263. package/templates/app/app/commands/typegen.ts +16 -2
  264. package/templates/app/app/emails/index.ts +10 -0
  265. package/templates/app/app/http/middleware/access.test.ts +43 -0
  266. package/templates/app/app/http/middleware/access.ts +41 -0
  267. package/templates/app/app/http/middleware/api.ts +12 -3
  268. package/templates/app/app/http/middleware/page.test.ts +4 -1
  269. package/templates/app/app/http/middleware/page.ts +7 -5
  270. package/templates/app/app/initializers/cli.ts +35 -2
  271. package/templates/app/app/initializers/dispatcher.ts +9 -1
  272. package/templates/app/app/initializers/mail-transport.test.ts +33 -0
  273. package/templates/app/app/initializers/mail-transport.ts +26 -0
  274. package/templates/app/app/initializers/mail.test.ts +17 -17
  275. package/templates/app/app/initializers/mail.ts +15 -7
  276. package/templates/app/app/initializers/router.test.ts +7 -0
  277. package/templates/app/app/initializers/router.tsx +13 -3
  278. package/templates/app/app/jobs/email.test.tsx +70 -0
  279. package/templates/app/app/jobs/email.ts +16 -0
  280. package/templates/app/app/jobs/index.ts +6 -2
  281. package/templates/app/app/policies/abilities.ts +13 -0
  282. package/templates/app/app/policies/policy.test.ts +15 -0
  283. package/templates/app/app/policies/policy.ts +30 -0
  284. package/templates/app/app/services/commands.ts +30 -0
  285. package/templates/app/app/services/migrations.test.ts +48 -1
  286. package/templates/app/app/services/migrations.ts +66 -9
  287. package/templates/app/app/test/cloudflare-workers.ts +2 -0
  288. package/templates/app/app/test/local-database.ts +67 -0
  289. package/templates/app/app/test/session.ts +28 -0
  290. package/templates/app/bootstrap/console.ts +13 -0
  291. package/templates/app/cloudflare.config.ts +3 -3
  292. package/templates/app/database/seed.ts +12 -0
  293. package/templates/app/package.json +3 -1
  294. package/templates/app/spec/config.jsonc +16 -0
  295. package/stubs/policy.stub +0 -16
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The checks `sdxc doctor` runs, in report order, and the two forms the report takes: one line
3
+ * per check for a person and one JSON document for an agent. Adding a check means adding it to
4
+ * `CHECKS`; both forms print it without further changes.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import { emailsCheck } from "./emails.js";
10
+ import { envCheck } from "./env.js";
11
+ import { installedCheck } from "./installed.js";
12
+ import { jsdocCheck } from "./jsdoc.js";
13
+ import { layoutCheck } from "./layout.js";
14
+ import { migrationsCheck } from "./migrations.js";
15
+ import { modelsCheck } from "./models.js";
16
+ import { pinsCheck } from "./pins.js";
17
+ import { remixCheck } from "./remix.js";
18
+ import { routesCheck } from "./routes.js";
19
+ import { typegenCheck } from "./typegen.js";
20
+ import { uiCheck } from "./ui.js";
21
+ /**
22
+ * Every built-in check: release drift, the install and the `remix` peer first, then the
23
+ * Worker's secrets and types, then the app's own code, layout to copied components.
24
+ */
25
+ export const CHECKS = [
26
+ pinsCheck,
27
+ installedCheck,
28
+ remixCheck,
29
+ envCheck,
30
+ typegenCheck,
31
+ migrationsCheck,
32
+ layoutCheck,
33
+ routesCheck,
34
+ modelsCheck,
35
+ emailsCheck,
36
+ jsdocCheck,
37
+ uiCheck,
38
+ ];
39
+ /** Whether any check failed, which makes `sdxc doctor` exit 1. */
40
+ export function hasFailure(reports) {
41
+ return reports.some((report) => report.status === "fail");
42
+ }
43
+ /**
44
+ * One line per check: its status and name in aligned columns, what it found with each finding
45
+ * after a colon, and the fix after it, so a line reads whole when copied on its own.
46
+ */
47
+ export function formatText(reports) {
48
+ let width = Math.max(0, ...reports.map((report) => report.name.length));
49
+ return reports
50
+ .map((report) => {
51
+ let line = `${report.status.padEnd(4)} ${report.name.padEnd(width)} ${report.message}`;
52
+ if (report.findings.length > 0)
53
+ line += `: ${report.findings.join("; ")}`;
54
+ if (report.fix !== null)
55
+ line += `. Fix: ${report.fix}`;
56
+ return `${line}\n`;
57
+ })
58
+ .join("");
59
+ }
60
+ /** The report as one JSON document, `ok` false exactly when the run exits 1. */
61
+ export function formatJSON(reports) {
62
+ let checks = reports.map(({ name, status, message, findings, fix }) => ({
63
+ name,
64
+ status,
65
+ message,
66
+ findings,
67
+ fix,
68
+ }));
69
+ return `${JSON.stringify({ ok: !hasFailure(reports), checks }, null, 2)}\n`;
70
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The API a project writes its own `sdxc doctor` checks against. A check module in the
3
+ * `doctor.checks` folder default-exports one check, or a list of them, and `sdxc doctor` runs
4
+ * each beside the built-in ones with a read-only view of the project.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Config } from "../config.js";
10
+ import type { RouteEntry } from "../routes/index.js";
11
+ import type { CheckStatus } from "./check.js";
12
+ export type { CheckStatus } from "./check.js";
13
+ /** What a project check answers; only `fail` makes `sdxc doctor` exit 1. */
14
+ export interface ProjectCheckResult {
15
+ status: CheckStatus;
16
+ /** One sentence summing up what the check found, or why it was skipped. */
17
+ message: string;
18
+ /** Each file, route or value the check flagged, printed after the message. */
19
+ findings?: string[];
20
+ /** The command or edit that clears a warning or failure. */
21
+ fix?: string | null;
22
+ }
23
+ /**
24
+ * The project as a check sees it. Every path is relative to the project root, and a path that
25
+ * leads outside it throws, which reports the check as failed.
26
+ */
27
+ export interface ProjectCheckContext {
28
+ /** The project root, absolute. */
29
+ root: string;
30
+ /** `package.json`, parsed as written. */
31
+ manifest: Record<string, unknown>;
32
+ /** `.config/sdxc.jsonc`, with every default filled in. */
33
+ config: Config;
34
+ /** Every route and what maps it, as `sdxc routes --json` prints them. */
35
+ routes: RouteEntry[];
36
+ /** A file's text, or `null` when it does not exist. */
37
+ readFile(path: string): Promise<string | null>;
38
+ exists(path: string): Promise<boolean>;
39
+ /**
40
+ * Every file under `folder`, recursively and sorted, relative to the project root;
41
+ * `node_modules` and dot-files are left out, and a missing folder lists nothing.
42
+ */
43
+ files(folder: string): Promise<string[]>;
44
+ }
45
+ /** A check a project adds to `sdxc doctor`. */
46
+ export interface ProjectCheck {
47
+ /**
48
+ * The check's name in the report and for `--only` and `--skip`: lowercase words joined by
49
+ * dashes, distinct from every built-in check and every other project check.
50
+ */
51
+ name: string;
52
+ run(context: ProjectCheckContext): ProjectCheckResult | Promise<ProjectCheckResult>;
53
+ }
54
+ /**
55
+ * Types a project check, so `run` gets its context and result checked by the editor.
56
+ *
57
+ * @example export default defineCheck({ name: "readme", async run(ctx) { return (await ctx.exists("README.md")) ? { status: "pass", message: "README.md exists" } : { status: "warn", message: "No README.md", fix: "touch README.md" }; } });
58
+ */
59
+ export declare function defineCheck(check: ProjectCheck): ProjectCheck;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The API a project writes its own `sdxc doctor` checks against. A check module in the
3
+ * `doctor.checks` folder default-exports one check, or a list of them, and `sdxc doctor` runs
4
+ * each beside the built-in ones with a read-only view of the project.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ /**
10
+ * Types a project check, so `run` gets its context and result checked by the editor.
11
+ *
12
+ * @example export default defineCheck({ name: "readme", async run(ctx) { return (await ctx.exists("README.md")) ? { status: "pass", message: "README.md exists" } : { status: "warn", message: "No README.md", fix: "touch README.md" }; } });
13
+ */
14
+ export function defineCheck(check) {
15
+ return check;
16
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The `emails` check: every email `app/emails/index.ts` declares is mapped onto a template in
3
+ * `app/initializers/mail.ts`, each mapped template has a test beside it, and each has a
4
+ * `preview()`. An unmapped email fails every send, so that finding fails the run.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Check } from "./check.js";
10
+ /** The module that declares every email, which `sdxc make email` adds each one to. */
11
+ export declare const EMAILS_INDEX = "app/emails/index.ts";
12
+ /** The initializer that maps each declared email onto its template. */
13
+ export declare const MAIL_INITIALIZER = "app/initializers/mail.ts";
14
+ /**
15
+ * Fails on a declared email no template is mapped for, and warns on a mapped template without
16
+ * a test beside it or without `preview()`.
17
+ */
18
+ export declare const emailsCheck: Check;
@@ -0,0 +1,243 @@
1
+ /**
2
+ * The `emails` check: every email `app/emails/index.ts` declares is mapped onto a template in
3
+ * `app/initializers/mail.ts`, each mapped template has a test beside it, and each has a
4
+ * `preview()`. An unmapped email fails every send, so that finding fails the run.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import { readFile, stat } from "node:fs/promises";
10
+ import { join, posix } from "node:path";
11
+ import { findModuleReferences, tokenize } from "@sdxc/codemod";
12
+ import { isFailure, isSuccess, wrap } from "@sdxc/result";
13
+ import { Reader } from "../routes/parse.js";
14
+ import { passed, skipped } from "./check.js";
15
+ /** The module that declares every email, which `sdxc make email` adds each one to. */
16
+ export const EMAILS_INDEX = "app/emails/index.ts";
17
+ /** The initializer that maps each declared email onto its template. */
18
+ export const MAIL_INITIALIZER = "app/initializers/mail.ts";
19
+ /** The extensions a template specifier without one may resolve to. */
20
+ const EXTENSIONS = [".tsx", ".ts", "/index.tsx", "/index.ts"];
21
+ /**
22
+ * A `preview` property or method opening a line of the options' source, for the members the
23
+ * reader leaves out of an object: methods, and entries after a body it could not read.
24
+ */
25
+ const PREVIEW_MEMBER = /^\s*(?:async\s+)?preview\s*[:(]/m;
26
+ /**
27
+ * Fails on a declared email no template is mapped for, and warns on a mapped template without
28
+ * a test beside it or without `preview()`.
29
+ */
30
+ export const emailsCheck = {
31
+ name: "emails",
32
+ async run(context) {
33
+ let index = await readModule(context.root, EMAILS_INDEX);
34
+ if (index === null)
35
+ return skipped(`No ${EMAILS_INDEX} in the project`);
36
+ let declared = declaredEmails(index);
37
+ if (declared === null)
38
+ return skipped(`${EMAILS_INDEX} declares no emails({ … })`);
39
+ let initializer = await readModule(context.root, MAIL_INITIALIZER);
40
+ let mapped = initializer === null ? new Map() : mappings(initializer);
41
+ let unmapped = [];
42
+ let untested = [];
43
+ let unpreviewed = [];
44
+ for (let name of declared) {
45
+ if (!mapped.has(name)) {
46
+ unmapped.push(`${name} is declared in ${EMAILS_INDEX} and mapped by no template`);
47
+ continue;
48
+ }
49
+ let template = await resolveTemplate(context.root, mapped.get(name) ?? null);
50
+ if (template === null)
51
+ continue;
52
+ if (!(await hasTest(context.root, template))) {
53
+ untested.push(`${template} has no test beside it`);
54
+ }
55
+ let module = await readModule(context.root, template);
56
+ if (module !== null && !hasPreview(module)) {
57
+ unpreviewed.push(`${template} has no preview()`);
58
+ }
59
+ }
60
+ if (unmapped.length > 0) {
61
+ return {
62
+ status: "fail",
63
+ message: `${MAIL_INITIALIZER} maps no template for ${count(unmapped.length, "declared email")}`,
64
+ findings: [...unmapped, ...untested, ...unpreviewed],
65
+ fix: `Map each in ${MAIL_INITIALIZER} as mail.map(emails.<name>, lazy(() => import("~/app/emails/<file>"))); sdxc make email writes and maps one`,
66
+ };
67
+ }
68
+ if (untested.length > 0 || unpreviewed.length > 0) {
69
+ let problems = [
70
+ untested.length === 0 ? null : `${count(untested.length, "template")} without a test`,
71
+ unpreviewed.length === 0
72
+ ? null
73
+ : `${count(unpreviewed.length, "template")} without preview()`,
74
+ ].filter((problem) => problem !== null);
75
+ return {
76
+ status: "warn",
77
+ message: `Found ${problems.join(" and ")}`,
78
+ findings: [...untested, ...unpreviewed],
79
+ fix: "Write <template>.test.tsx rendering it through mail.render(), and give createEmail() a preview: () => ({ … }) of sample props",
80
+ };
81
+ }
82
+ return passed(`${count(declared.length, "declared email")} mapped, tested and previewable`);
83
+ },
84
+ };
85
+ /** `count` with `noun`, pluralized by an `s` past one. */
86
+ function count(amount, noun) {
87
+ return `${amount} ${noun}${amount === 1 ? "" : "s"}`;
88
+ }
89
+ /** The module at `path` tokenized with its imports, or `null` when it is missing or unreadable. */
90
+ async function readModule(root, path) {
91
+ let source = await wrap(() => readFile(join(root, path), "utf8"));
92
+ if (isFailure(source))
93
+ return null;
94
+ let tokens = tokenize(path, source.data);
95
+ let references = findModuleReferences(path, source.data);
96
+ if (isFailure(tokens) || isFailure(references))
97
+ return null;
98
+ let imports = new Map();
99
+ for (let reference of references.data) {
100
+ if (reference.kind !== "import")
101
+ continue;
102
+ for (let bound of reference.names) {
103
+ imports.set(bound.local, { specifier: reference.specifier, imported: bound.imported });
104
+ }
105
+ }
106
+ return { reader: new Reader(tokens.data, source.data), imports };
107
+ }
108
+ /**
109
+ * Every email name the default-exported `emails({ … })` declares, by its path through the
110
+ * groups (`teams.invite`), or `null` when the module exports no such call.
111
+ */
112
+ function declaredEmails(module) {
113
+ let declarations = module.reader.declarations();
114
+ let exported = declarations.defaultExport;
115
+ if (exported?.kind === "identifier")
116
+ exported = declarations.locals.get(exported.name) ?? null;
117
+ if (exported?.kind !== "call" || !isImportOf(module, exported.callee, "emails"))
118
+ return null;
119
+ let tree = exported.args[0]?.node;
120
+ if (tree?.kind !== "object")
121
+ return null;
122
+ return leaves(module, tree, []);
123
+ }
124
+ /** The names of the `email(…)` leaves under a group, nested groups as objects or `emails()` calls. */
125
+ function leaves(module, node, path) {
126
+ if (node.kind === "call" && isImportOf(module, node.callee, "email"))
127
+ return [path.join(".")];
128
+ let group = node;
129
+ if (node.kind === "call" && isImportOf(module, node.callee, "emails")) {
130
+ group = node.args[0]?.node ?? node;
131
+ }
132
+ if (group.kind !== "object")
133
+ return [];
134
+ return group.entries.flatMap((entry) => "key" in entry ? leaves(module, entry.value, [...path, entry.key]) : []);
135
+ }
136
+ /** Whether `callee` is a local bound to the `imported` export of some module. */
137
+ function isImportOf(module, callee, imported) {
138
+ return callee.kind === "identifier" && module.imports.get(callee.name)?.imported === imported;
139
+ }
140
+ /**
141
+ * Every `<registry>.map(emails.<name>, template)` in the initializer, by email name, with the
142
+ * specifier its template is imported from, through `lazy(() => import(…))` or a static import;
143
+ * `null` when the template is written some other way.
144
+ */
145
+ function mappings(module) {
146
+ let reader = module.reader;
147
+ let found = new Map();
148
+ for (let index = 0; index < reader.tokens.length; index += 1) {
149
+ if (!reader.is(index, ".") || !reader.isWord(index + 1, "map") || !reader.is(index + 2, "(")) {
150
+ continue;
151
+ }
152
+ let start = index - 1;
153
+ let call = reader.expression(start, reader.tokens.length).node;
154
+ if (call.kind !== "call")
155
+ continue;
156
+ let [target, template] = call.args;
157
+ let name = target === undefined ? null : emailName(target.node);
158
+ if (name === null)
159
+ continue;
160
+ found.set(name, template === undefined ? null : templateSpecifier(module, template.node));
161
+ }
162
+ return found;
163
+ }
164
+ /** The dotted name a member chain such as `emails.teams.invite` names, its root left out. */
165
+ function emailName(node) {
166
+ let path = [];
167
+ let current = node;
168
+ while (current.kind === "member") {
169
+ path.unshift(current.property);
170
+ current = current.object;
171
+ }
172
+ return current.kind === "identifier" && path.length > 0 ? path.join(".") : null;
173
+ }
174
+ /** The specifier a mapped template is loaded from. */
175
+ function templateSpecifier(module, node) {
176
+ if (node.kind === "identifier")
177
+ return module.imports.get(node.name)?.specifier ?? null;
178
+ if (node.kind !== "call")
179
+ return null;
180
+ let loader = node.args[0]?.node;
181
+ if (loader?.kind !== "function")
182
+ return null;
183
+ return loader.body?.kind === "import" ? loader.body.specifier : null;
184
+ }
185
+ /**
186
+ * Whether the options of the template's `createEmail(email, { … })` call carry a `preview`, as
187
+ * a property or a method; a template written any other way counts as having one.
188
+ */
189
+ function hasPreview(module) {
190
+ let reader = module.reader;
191
+ for (let index = 0; index < reader.tokens.length; index += 1) {
192
+ let token = reader.tokens[index];
193
+ if (token?.type !== "identifier" ||
194
+ module.imports.get(token.value)?.imported !== "createEmail") {
195
+ continue;
196
+ }
197
+ if (!reader.is(index + 1, "("))
198
+ continue;
199
+ let call = reader.expression(index, reader.tokens.length).node;
200
+ let options = call.kind === "call" ? call.args[1]?.node : undefined;
201
+ if (options?.kind !== "object")
202
+ return true;
203
+ if (options.entries.some((entry) => "key" in entry && entry.key === "preview"))
204
+ return true;
205
+ return PREVIEW_MEMBER.test(reader.source.slice(options.start, options.end));
206
+ }
207
+ return true;
208
+ }
209
+ /** The project file a template specifier names, from the initializer; `null` for a package. */
210
+ async function resolveTemplate(root, specifier) {
211
+ if (specifier === null)
212
+ return null;
213
+ let base;
214
+ if (specifier.startsWith("~/"))
215
+ base = specifier.slice(2);
216
+ else if (specifier.startsWith(".")) {
217
+ base = posix.normalize(posix.join(posix.dirname(MAIL_INITIALIZER), specifier));
218
+ }
219
+ else
220
+ return null;
221
+ let candidates = /\.[cm]?[jt]sx?$/.test(base)
222
+ ? [base.replace(/\.js$/, ".tsx"), base.replace(/\.js$/, ".ts"), base]
223
+ : EXTENSIONS.map((extension) => `${base}${extension}`);
224
+ for (let candidate of candidates) {
225
+ if (await isFile(root, candidate))
226
+ return candidate;
227
+ }
228
+ return null;
229
+ }
230
+ /** Whether a test sits beside `template`, as `<name>.test.tsx` or `<name>.test.ts`. */
231
+ async function hasTest(root, template) {
232
+ let bare = template.replace(/\.[cm]?[jt]sx?$/, "");
233
+ for (let extension of [".tsx", ".ts"]) {
234
+ if (await isFile(root, `${bare}.test${extension}`))
235
+ return true;
236
+ }
237
+ return false;
238
+ }
239
+ /** Whether `path` is a file under `root`. */
240
+ async function isFile(root, path) {
241
+ let found = await wrap(() => stat(join(root, path)));
242
+ return isSuccess(found) && found.data.isFile();
243
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The `env` check: every secret `cloudflare.config.ts` declares has a line in `.env.example`.
3
+ * CI copies `.env.example` to `.dev.vars` before it generates the Worker's `Env` types, so a
4
+ * secret only a local `.dev.vars` holds type checks on a laptop and fails in CI.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { Check } from "./check.js";
10
+ /** The Worker configuration file the check reads. */
11
+ export declare const CONFIG_FILE = "cloudflare.config.ts";
12
+ /** The file CI builds `.dev.vars` from. */
13
+ export declare const ENV_EXAMPLE_FILE = ".env.example";
14
+ /**
15
+ * Fails on a secret `.env.example` leaves out, with the command that appends it, and warns on a
16
+ * key `.env.example` lists that no binding declares, since CI types it into `Env` and the
17
+ * deployed Worker never receives it.
18
+ */
19
+ export declare const envCheck: Check;
20
+ /**
21
+ * Every binding the config source declares, as key and `bindings` helper name, comments
22
+ * stripped first so a documented example in one stays out of the result.
23
+ */
24
+ export declare function declaredBindings(source: string): Map<string, string>;
25
+ /** Every key a `.env` file assigns, comments and blank lines skipped. */
26
+ export declare function exampleKeys(source: string): Set<string>;
@@ -0,0 +1,88 @@
1
+ /**
2
+ * The `env` check: every secret `cloudflare.config.ts` declares has a line in `.env.example`.
3
+ * CI copies `.env.example` to `.dev.vars` before it generates the Worker's `Env` types, so a
4
+ * secret only a local `.dev.vars` holds type checks on a laptop and fails in CI.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import { readFile } from "node:fs/promises";
10
+ import { join } from "node:path";
11
+ import { isFailure, wrap } from "@sdxc/result";
12
+ import { passed, skipped } from "./check.js";
13
+ /** The Worker configuration file the check reads. */
14
+ export const CONFIG_FILE = "cloudflare.config.ts";
15
+ /** The file CI builds `.dev.vars` from. */
16
+ export const ENV_EXAMPLE_FILE = ".env.example";
17
+ /**
18
+ * A binding as the config writes it, `KEY: bindings.secret(`, with the key optionally quoted.
19
+ * The key must start a property, so a mention inside prose does not count.
20
+ */
21
+ const BINDING = /(?:^|[\s{,(])["']?([A-Za-z_$][\w$]*)["']?\s*:\s*bindings\.(\w+)\s*\(/g;
22
+ /** A `.env` assignment, `KEY=value` or `export KEY=value`. */
23
+ const ASSIGNMENT = /^(?:export\s+)?([A-Za-z_][\w.-]*)\s*=/;
24
+ /**
25
+ * Fails on a secret `.env.example` leaves out, with the command that appends it, and warns on a
26
+ * key `.env.example` lists that no binding declares, since CI types it into `Env` and the
27
+ * deployed Worker never receives it.
28
+ */
29
+ export const envCheck = {
30
+ name: "env",
31
+ async run(context) {
32
+ let config = await wrap(() => readFile(join(context.root, CONFIG_FILE), "utf8"));
33
+ if (isFailure(config))
34
+ return skipped(`No ${CONFIG_FILE} in the project`);
35
+ let declared = declaredBindings(config.data);
36
+ let example = await wrap(() => readFile(join(context.root, ENV_EXAMPLE_FILE), "utf8"));
37
+ let listed = isFailure(example) ? new Set() : exampleKeys(example.data);
38
+ let missing = [...declared]
39
+ .filter(([key, kind]) => kind === "secret" && !listed.has(key))
40
+ .map(([key]) => key);
41
+ if (missing.length > 0) {
42
+ let lines = missing.map((key) => `${key}=`).join("\\n");
43
+ return {
44
+ status: "fail",
45
+ message: `${ENV_EXAMPLE_FILE} leaves out ${missing.length === 1 ? "a secret" : `${missing.length} secrets`} ${CONFIG_FILE} declares`,
46
+ findings: missing.map((key) => `${key} is declared with bindings.secret()`),
47
+ fix: `printf '\\n${lines}\\n' >> ${ENV_EXAMPLE_FILE}`,
48
+ };
49
+ }
50
+ let undeclared = [...listed].filter((key) => !declared.has(key));
51
+ if (undeclared.length > 0) {
52
+ return {
53
+ status: "warn",
54
+ message: `${ENV_EXAMPLE_FILE} lists ${undeclared.length === 1 ? "a key" : `${undeclared.length} keys`} no binding declares`,
55
+ findings: undeclared.map((key) => `${key} is in ${ENV_EXAMPLE_FILE} only`),
56
+ fix: `Declare each with bindings.secret() in ${CONFIG_FILE}, or delete its line from ${ENV_EXAMPLE_FILE}`,
57
+ };
58
+ }
59
+ let secrets = [...declared.values()].filter((kind) => kind === "secret").length;
60
+ if (secrets === 0)
61
+ return passed(`${CONFIG_FILE} declares no secret`);
62
+ return passed(`${ENV_EXAMPLE_FILE} lists every secret ${CONFIG_FILE} declares`);
63
+ },
64
+ };
65
+ /**
66
+ * Every binding the config source declares, as key and `bindings` helper name, comments
67
+ * stripped first so a documented example in one stays out of the result.
68
+ */
69
+ export function declaredBindings(source) {
70
+ let code = source.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|[^:"'])\/\/.*$/gm, "$1");
71
+ let bindings = new Map();
72
+ for (let match of code.matchAll(BINDING)) {
73
+ let [, key, kind] = match;
74
+ if (key !== undefined && kind !== undefined)
75
+ bindings.set(key, kind);
76
+ }
77
+ return bindings;
78
+ }
79
+ /** Every key a `.env` file assigns, comments and blank lines skipped. */
80
+ export function exampleKeys(source) {
81
+ let keys = new Set();
82
+ for (let line of source.split(/\r?\n/)) {
83
+ let key = ASSIGNMENT.exec(line.trim())?.[1];
84
+ if (key !== undefined)
85
+ keys.add(key);
86
+ }
87
+ return keys;
88
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The project files the source-reading checks walk: every file under a folder, relative to the
3
+ * project root with `/` separators, so a finding names a path the same way on every platform.
4
+ *
5
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
6
+ * @copyright Sergio Xalambrí 2026
7
+ */
8
+ /**
9
+ * Every file under `folder`, sorted, `node_modules` and dot-folders left out; a missing folder
10
+ * lists nothing.
11
+ */
12
+ export declare function listFiles(root: string, folder: string): Promise<string[]>;
13
+ /** Whether `path` is a module the app runs, its tests and declaration files left out. */
14
+ export declare function isAppSource(path: string): boolean;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The project files the source-reading checks walk: every file under a folder, relative to the
3
+ * project root with `/` separators, so a finding names a path the same way on every platform.
4
+ *
5
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
6
+ * @copyright Sergio Xalambrí 2026
7
+ */
8
+ import { readdir } from "node:fs/promises";
9
+ import { join, relative, sep } from "node:path";
10
+ import { isFailure, wrap } from "@sdxc/result";
11
+ /** A TypeScript or JavaScript module. */
12
+ const SOURCE = /\.[cm]?[jt]sx?$/;
13
+ /** A test or a declaration file, which no layout rule applies to. */
14
+ const NOT_APP_CODE = /(?:\.test\.[cm]?[jt]sx?|\.d\.[cm]?ts)$/;
15
+ /**
16
+ * Every file under `folder`, sorted, `node_modules` and dot-folders left out; a missing folder
17
+ * lists nothing.
18
+ */
19
+ export async function listFiles(root, folder) {
20
+ let base = join(root, folder);
21
+ let entries = await wrap(() => readdir(base, { recursive: true, withFileTypes: true }));
22
+ if (isFailure(entries))
23
+ return [];
24
+ return entries.data
25
+ .filter((entry) => entry.isFile())
26
+ .map((entry) => relative(base, join(entry.parentPath, entry.name)).split(sep).join("/"))
27
+ .filter((path) => !path.split("/").some((part) => part === "node_modules" || part.startsWith(".")))
28
+ .map((path) => `${folder}/${path}`)
29
+ .sort();
30
+ }
31
+ /** Whether `path` is a module the app runs, its tests and declaration files left out. */
32
+ export function isAppSource(path) {
33
+ return SOURCE.test(path) && !NOT_APP_CODE.test(path);
34
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Fixture projects for the `sdxc doctor` check tests: a temporary directory holding the given
3
+ * files and the context a check runs with, so each test states only the files its check reads.
4
+ *
5
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
6
+ * @copyright Sergio Xalambrí 2026
7
+ */
8
+ import type { DoctorContext } from "./check.js";
9
+ /** What a fixture project is built from. */
10
+ export interface FixtureOptions {
11
+ /** Further `.config/sdxc.jsonc` keys. */
12
+ config?: Record<string, unknown>;
13
+ /** The `@sdxc/kit` package the context compares copied components with. */
14
+ packageRoot?: string;
15
+ /** Seconds since the epoch to stamp on a file as its modification time, by path. */
16
+ modified?: Record<string, number>;
17
+ }
18
+ /** A bun project holding `files`, keyed by path relative to its root, and its check context. */
19
+ export declare function fixture(files: Record<string, string>, options?: FixtureOptions): Promise<DoctorContext>;
20
+ /** A temporary directory holding `files`, removed by {@link removeFixtures}. */
21
+ export declare function writeTree(files: Record<string, string>): Promise<string>;
22
+ /** Removes every fixture directory, for an `afterEach`. */
23
+ export declare function removeFixtures(): Promise<void>;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Fixture projects for the `sdxc doctor` check tests: a temporary directory holding the given
3
+ * files and the context a check runs with, so each test states only the files its check reads.
4
+ *
5
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
6
+ * @copyright Sergio Xalambrí 2026
7
+ */
8
+ import { mkdir, mkdtemp, rm, utimes, writeFile } from "node:fs/promises";
9
+ import { tmpdir } from "node:os";
10
+ import { dirname, join } from "node:path";
11
+ import { unwrap } from "@sdxc/result";
12
+ import { parseConfig } from "../config.js";
13
+ import { packageManager } from "../package-manager.js";
14
+ import { createDoctorContext } from "./check.js";
15
+ /** Every fixture directory created since the last {@link removeFixtures}. */
16
+ const CREATED = [];
17
+ /** A bun project holding `files`, keyed by path relative to its root, and its check context. */
18
+ export async function fixture(files, options = {}) {
19
+ let root = await writeTree(files);
20
+ for (let [path, seconds] of Object.entries(options.modified ?? {})) {
21
+ await utimes(join(root, path), seconds, seconds);
22
+ }
23
+ let manifest = { packageManager: "bun@1.4.2" };
24
+ return createDoctorContext({
25
+ root,
26
+ manifest,
27
+ config: unwrap(parseConfig(options.config ?? {}, root, null)).config,
28
+ manager: await packageManager({ declared: manifest.packageManager, findLockFile: () => null }),
29
+ packageRoot: options.packageRoot ?? join(root, "node_modules/@sdxc/kit"),
30
+ });
31
+ }
32
+ /** A temporary directory holding `files`, removed by {@link removeFixtures}. */
33
+ export async function writeTree(files) {
34
+ let root = await mkdtemp(join(tmpdir(), "sdxc-doctor-check-"));
35
+ CREATED.push(root);
36
+ for (let [path, content] of Object.entries({ "package.json": "{}", ...files })) {
37
+ await mkdir(dirname(join(root, path)), { recursive: true });
38
+ await writeFile(join(root, path), content);
39
+ }
40
+ return root;
41
+ }
42
+ /** Removes every fixture directory, for an `afterEach`. */
43
+ export async function removeFixtures() {
44
+ let created = CREATED.splice(0);
45
+ await Promise.all(created.map((dir) => rm(dir, { recursive: true, force: true })));
46
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The install commands `sdxc doctor` prints as fixes, spelled for the project's package manager:
3
+ * each pins an exact version and keeps a package in the dependency section that lists it, so
4
+ * running the fix changes only the versions the check flagged.
5
+ *
6
+ * @author [Sergio Xalambrí](https://sergiodxa.com)
7
+ * @copyright Sergio Xalambrí 2026
8
+ */
9
+ import type { PackageManager } from "../package-manager.js";
10
+ import type { Manifest } from "../upgrade/project.js";
11
+ /**
12
+ * The command that pins each package to its version: one for the packages in `dependencies`
13
+ * and one for those in `devDependencies`, joined with `&&` when both are needed.
14
+ *
15
+ * @param versions - The exact version to pin, by package name
16
+ */
17
+ export declare function exactInstallCommand(manager: PackageManager, manifest: Manifest, versions: ReadonlyMap<string, string>): string;