@supatype/cli 0.1.7 → 0.1.9

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 (404) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +128 -128
  3. package/.turbo/turbo-typecheck.log +1 -1
  4. package/LICENSE +202 -0
  5. package/deno.d.ts +1 -1
  6. package/dist/app/framework.js +1 -1
  7. package/dist/app/framework.js.map +1 -1
  8. package/dist/augmentation-generator.d.ts +1 -1
  9. package/dist/augmentation-generator.js +3 -3
  10. package/dist/augmentation-generator.js.map +1 -1
  11. package/dist/binary-cache.d.ts +30 -8
  12. package/dist/binary-cache.d.ts.map +1 -1
  13. package/dist/binary-cache.js +47 -35
  14. package/dist/binary-cache.js.map +1 -1
  15. package/dist/cache-pins.d.ts +1 -1
  16. package/dist/cache-pins.js +2 -2
  17. package/dist/cache-pins.js.map +1 -1
  18. package/dist/cli-artifacts.d.ts +32 -0
  19. package/dist/cli-artifacts.d.ts.map +1 -0
  20. package/dist/cli-artifacts.js +49 -0
  21. package/dist/cli-artifacts.js.map +1 -0
  22. package/dist/cli-install-method.d.ts +9 -1
  23. package/dist/cli-install-method.d.ts.map +1 -1
  24. package/dist/cli-install-method.js +22 -4
  25. package/dist/cli-install-method.js.map +1 -1
  26. package/dist/cli-package-version.d.ts +1 -1
  27. package/dist/cli-package-version.d.ts.map +1 -1
  28. package/dist/cli-package-version.js +6 -1
  29. package/dist/cli-package-version.js.map +1 -1
  30. package/dist/cli-standalone.d.ts +13 -4
  31. package/dist/cli-standalone.d.ts.map +1 -1
  32. package/dist/cli-standalone.js +86 -31
  33. package/dist/cli-standalone.js.map +1 -1
  34. package/dist/cli-version-embedded.d.ts +10 -0
  35. package/dist/cli-version-embedded.d.ts.map +1 -0
  36. package/dist/cli-version-embedded.js +13 -0
  37. package/dist/cli-version-embedded.js.map +1 -0
  38. package/dist/cli.js +1 -1
  39. package/dist/cli.js.map +1 -1
  40. package/dist/commands/add.js +1 -1
  41. package/dist/commands/add.js.map +1 -1
  42. package/dist/commands/admin.js +6 -6
  43. package/dist/commands/admin.js.map +1 -1
  44. package/dist/commands/adopt.js +1 -1
  45. package/dist/commands/adopt.js.map +1 -1
  46. package/dist/commands/app.js +2 -2
  47. package/dist/commands/app.js.map +1 -1
  48. package/dist/commands/cache.d.ts +1 -1
  49. package/dist/commands/cache.js +3 -3
  50. package/dist/commands/cache.js.map +1 -1
  51. package/dist/commands/db.d.ts +3 -3
  52. package/dist/commands/db.js +9 -9
  53. package/dist/commands/db.js.map +1 -1
  54. package/dist/commands/deploy.d.ts +9 -9
  55. package/dist/commands/deploy.js +12 -12
  56. package/dist/commands/deploy.js.map +1 -1
  57. package/dist/commands/dev.d.ts +3 -3
  58. package/dist/commands/dev.js +17 -17
  59. package/dist/commands/dev.js.map +1 -1
  60. package/dist/commands/doctor.d.ts +1 -1
  61. package/dist/commands/doctor.js +3 -3
  62. package/dist/commands/doctor.js.map +1 -1
  63. package/dist/commands/engine.d.ts +1 -1
  64. package/dist/commands/engine.js +1 -1
  65. package/dist/commands/functions.js +5 -5
  66. package/dist/commands/functions.js.map +1 -1
  67. package/dist/commands/hooks.d.ts +2 -2
  68. package/dist/commands/hooks.js +4 -4
  69. package/dist/commands/hooks.js.map +1 -1
  70. package/dist/commands/init.js +28 -28
  71. package/dist/commands/init.js.map +1 -1
  72. package/dist/commands/login.d.ts +1 -1
  73. package/dist/commands/login.js +1 -1
  74. package/dist/commands/login.js.map +1 -1
  75. package/dist/commands/logs.d.ts +1 -1
  76. package/dist/commands/migrate.js +5 -5
  77. package/dist/commands/migrate.js.map +1 -1
  78. package/dist/commands/pg.d.ts +1 -1
  79. package/dist/commands/pg.js +1 -1
  80. package/dist/commands/plugins.js +1 -1
  81. package/dist/commands/plugins.js.map +1 -1
  82. package/dist/commands/pull.js +2 -2
  83. package/dist/commands/pull.js.map +1 -1
  84. package/dist/commands/push.js +3 -3
  85. package/dist/commands/push.js.map +1 -1
  86. package/dist/commands/self-host.d.ts +1 -1
  87. package/dist/commands/self-host.js +1 -1
  88. package/dist/commands/self-update.d.ts +2 -8
  89. package/dist/commands/self-update.d.ts.map +1 -1
  90. package/dist/commands/self-update.js +20 -12
  91. package/dist/commands/self-update.js.map +1 -1
  92. package/dist/commands/status.d.ts +1 -1
  93. package/dist/commands/update.d.ts +1 -1
  94. package/dist/commands/update.js +1 -1
  95. package/dist/config.d.ts +1 -1
  96. package/dist/config.d.ts.map +1 -1
  97. package/dist/config.js +3 -3
  98. package/dist/config.js.map +1 -1
  99. package/dist/db-preflight.d.ts +4 -4
  100. package/dist/db-preflight.js +14 -14
  101. package/dist/db-preflight.js.map +1 -1
  102. package/dist/dev-compose.d.ts +3 -3
  103. package/dist/dev-compose.js +27 -27
  104. package/dist/dev-compose.js.map +1 -1
  105. package/dist/dev-log-filter.d.ts +1 -1
  106. package/dist/dev-log-filter.d.ts.map +1 -1
  107. package/dist/dev-log-filter.js +1 -1
  108. package/dist/dev-log-filter.js.map +1 -1
  109. package/dist/dev-ports.d.ts +2 -2
  110. package/dist/dev-ports.d.ts.map +1 -1
  111. package/dist/dev-ports.js +2 -2
  112. package/dist/dev-ports.js.map +1 -1
  113. package/dist/dev-session.d.ts +5 -5
  114. package/dist/dev-session.d.ts.map +1 -1
  115. package/dist/dev-session.js +6 -6
  116. package/dist/dev-session.js.map +1 -1
  117. package/dist/dev-shutdown.d.ts +5 -5
  118. package/dist/dev-shutdown.d.ts.map +1 -1
  119. package/dist/dev-shutdown.js +7 -7
  120. package/dist/dev-shutdown.js.map +1 -1
  121. package/dist/dev-task-colors.d.ts +1 -1
  122. package/dist/dev-task-colors.d.ts.map +1 -1
  123. package/dist/dev-task-colors.js +1 -1
  124. package/dist/dev-task-colors.js.map +1 -1
  125. package/dist/docker-postgres.d.ts +5 -5
  126. package/dist/docker-postgres.d.ts.map +1 -1
  127. package/dist/docker-postgres.js +5 -5
  128. package/dist/docker-postgres.js.map +1 -1
  129. package/dist/docker-runtime.d.ts +2 -2
  130. package/dist/docker-runtime.d.ts.map +1 -1
  131. package/dist/docker-runtime.js +5 -5
  132. package/dist/docker-runtime.js.map +1 -1
  133. package/dist/engine-client.d.ts +1 -1
  134. package/dist/engine-client.js +3 -3
  135. package/dist/engine-client.js.map +1 -1
  136. package/dist/engine-push-output.js +1 -1
  137. package/dist/engine-push-output.js.map +1 -1
  138. package/dist/ensure-binary.d.ts.map +1 -1
  139. package/dist/ensure-binary.js +17 -0
  140. package/dist/ensure-binary.js.map +1 -1
  141. package/dist/ensure-component-binaries.js +1 -1
  142. package/dist/ensure-component-binaries.js.map +1 -1
  143. package/dist/env-file.d.ts +2 -2
  144. package/dist/env-file.d.ts.map +1 -1
  145. package/dist/env-file.js +1 -1
  146. package/dist/env-file.js.map +1 -1
  147. package/dist/field-masking-tier.d.ts +5 -5
  148. package/dist/field-masking-tier.d.ts.map +1 -1
  149. package/dist/field-masking-tier.js +6 -6
  150. package/dist/field-masking-tier.js.map +1 -1
  151. package/dist/functions-deno-types.d.ts +1 -1
  152. package/dist/functions-deno-types.d.ts.map +1 -1
  153. package/dist/functions-deno-types.js +3 -3
  154. package/dist/functions-deno-types.js.map +1 -1
  155. package/dist/functions-router-gen.js +1 -1
  156. package/dist/gitignore.d.ts +2 -2
  157. package/dist/gitignore.d.ts.map +1 -1
  158. package/dist/gitignore.js +3 -3
  159. package/dist/gitignore.js.map +1 -1
  160. package/dist/hook-upload.d.ts +1 -1
  161. package/dist/hook-upload.js +3 -3
  162. package/dist/hooks-generator.d.ts +1 -1
  163. package/dist/hooks-generator.js +9 -9
  164. package/dist/index.d.ts +1 -1
  165. package/dist/index.js +1 -1
  166. package/dist/init-project-detect.d.ts +1 -1
  167. package/dist/init-project-detect.d.ts.map +1 -1
  168. package/dist/init-project-detect.js +1 -1
  169. package/dist/init-project-detect.js.map +1 -1
  170. package/dist/link.d.ts +1 -1
  171. package/dist/link.d.ts.map +1 -1
  172. package/dist/local-secrets.d.ts +5 -5
  173. package/dist/local-secrets.js +5 -5
  174. package/dist/main.d.ts +2 -0
  175. package/dist/main.d.ts.map +1 -0
  176. package/dist/main.js +20 -0
  177. package/dist/main.js.map +1 -0
  178. package/dist/model-hooks.d.ts +3 -3
  179. package/dist/model-hooks.js +4 -4
  180. package/dist/pgbouncer-userlist.d.ts +1 -1
  181. package/dist/pgbouncer-userlist.d.ts.map +1 -1
  182. package/dist/pgbouncer-userlist.js +2 -2
  183. package/dist/pgbouncer-userlist.js.map +1 -1
  184. package/dist/postgres-ctl.d.ts +1 -1
  185. package/dist/postgres-ctl.js +4 -4
  186. package/dist/postgres-ctl.js.map +1 -1
  187. package/dist/process-manager.d.ts +2 -2
  188. package/dist/process-manager.d.ts.map +1 -1
  189. package/dist/process-manager.js +4 -4
  190. package/dist/process-manager.js.map +1 -1
  191. package/dist/project-config.d.ts +12 -12
  192. package/dist/project-config.d.ts.map +1 -1
  193. package/dist/project-config.js +9 -9
  194. package/dist/project-config.js.map +1 -1
  195. package/dist/pull-utils.d.ts +2 -2
  196. package/dist/pull-utils.d.ts.map +1 -1
  197. package/dist/pull-utils.js +4 -4
  198. package/dist/pull-utils.js.map +1 -1
  199. package/dist/realtime-launch.js +1 -1
  200. package/dist/realtime-launch.js.map +1 -1
  201. package/dist/release-pins.d.ts +1 -1
  202. package/dist/release-pins.js +2 -2
  203. package/dist/release-pins.js.map +1 -1
  204. package/dist/resolve-api-url.js +1 -1
  205. package/dist/resolve-api-url.js.map +1 -1
  206. package/dist/resolve-target.d.ts +1 -1
  207. package/dist/resolve-target.d.ts.map +1 -1
  208. package/dist/rest-cache-admin.js +2 -2
  209. package/dist/rest-cache-admin.js.map +1 -1
  210. package/dist/runtime-routes.d.ts +1 -1
  211. package/dist/runtime-routes.js +1 -1
  212. package/dist/schema-ast-v2.d.ts +3 -3
  213. package/dist/schema-ast-v2.d.ts.map +1 -1
  214. package/dist/schema-ast-v2.js +2 -2
  215. package/dist/schema-ast-v2.js.map +1 -1
  216. package/dist/schema-push-lock.js +3 -3
  217. package/dist/schema-push-lock.js.map +1 -1
  218. package/dist/scripts/postinstall.d.ts +1 -1
  219. package/dist/scripts/postinstall.js +1 -1
  220. package/dist/self-host-compose.d.ts +5 -5
  221. package/dist/self-host-compose.d.ts.map +1 -1
  222. package/dist/self-host-compose.js +24 -24
  223. package/dist/self-host-compose.js.map +1 -1
  224. package/dist/service-role-check.js +3 -3
  225. package/dist/service-role-check.js.map +1 -1
  226. package/dist/storage-provision.d.ts +1 -1
  227. package/dist/storage-provision.js +3 -3
  228. package/dist/storage-provision.js.map +1 -1
  229. package/dist/studio-dev-server.d.ts +1 -1
  230. package/dist/studio-dev-server.d.ts.map +1 -1
  231. package/dist/systemd.d.ts +1 -1
  232. package/dist/systemd.js +1 -1
  233. package/dist/target-client.js +1 -1
  234. package/dist/target-client.js.map +1 -1
  235. package/dist/tsx-runner.js +1 -1
  236. package/dist/tsx-runner.js.map +1 -1
  237. package/dist/type-extractor.js +27 -27
  238. package/dist/type-extractor.js.map +1 -1
  239. package/dist/type-resolver.js +1 -1
  240. package/dist/type-resolver.js.map +1 -1
  241. package/dist/ui/brand.d.ts +1 -1
  242. package/dist/ui/brand.js +1 -1
  243. package/dist/ui/components/LogoWordmark.d.ts +1 -1
  244. package/dist/ui/components/LogoWordmark.d.ts.map +1 -1
  245. package/dist/ui/components/LogoWordmark.js +1 -1
  246. package/dist/ui/components/LogoWordmark.js.map +1 -1
  247. package/dist/ui/components/SelectField.js +1 -1
  248. package/dist/ui/components/SelectField.js.map +1 -1
  249. package/dist/ui/confirm.d.ts +1 -1
  250. package/dist/ui/confirm.js +1 -1
  251. package/dist/ui/fatal.d.ts +1 -1
  252. package/dist/ui/fatal.d.ts.map +1 -1
  253. package/dist/ui/fatal.js +1 -1
  254. package/dist/ui/fatal.js.map +1 -1
  255. package/dist/ui/flows/prompt-fields.js +1 -1
  256. package/dist/ui/flows/prompt-fields.js.map +1 -1
  257. package/dist/ui/interactive.d.ts +1 -1
  258. package/dist/ui/interactive.d.ts.map +1 -1
  259. package/dist/ui/interactive.js +1 -1
  260. package/dist/ui/interactive.js.map +1 -1
  261. package/dist/ui/progress.d.ts +1 -1
  262. package/dist/ui/progress.js +1 -1
  263. package/dist/ui/runtime/command-chrome.js +1 -1
  264. package/dist/ui/runtime/command-chrome.js.map +1 -1
  265. package/dist/ui/runtime/run-clack-flow.js +1 -1
  266. package/dist/ui/runtime/run-clack-flow.js.map +1 -1
  267. package/dist/ui/runtime/stdin-after-ink.js +1 -1
  268. package/dist/ui/runtime/stdin-after-ink.js.map +1 -1
  269. package/dist/ui/theme.d.ts +1 -1
  270. package/dist/ui/theme.js +1 -1
  271. package/dist/valkey-sidecar.d.ts +1 -1
  272. package/dist/valkey-sidecar.d.ts.map +1 -1
  273. package/dist/valkey-sidecar.js +2 -2
  274. package/dist/valkey-sidecar.js.map +1 -1
  275. package/package.json +3 -2
  276. package/scripts/build-release-artifacts.sh +112 -0
  277. package/scripts/generate-homebrew-formula.mjs +47 -45
  278. package/scripts/mirror-deno-release.sh +1 -1
  279. package/src/TYPE-RESOLUTION.md +31 -31
  280. package/src/app/framework.ts +1 -1
  281. package/src/augmentation-generator.ts +3 -3
  282. package/src/binary-cache.ts +51 -36
  283. package/src/cache-pins.ts +2 -2
  284. package/src/cli-artifacts.ts +65 -0
  285. package/src/cli-install-method.ts +24 -4
  286. package/src/cli-package-version.ts +5 -1
  287. package/src/cli-standalone.ts +116 -34
  288. package/src/cli-version-embedded.ts +12 -0
  289. package/src/cli.ts +1 -1
  290. package/src/commands/add.ts +1 -1
  291. package/src/commands/admin.ts +6 -6
  292. package/src/commands/adopt.ts +1 -1
  293. package/src/commands/app.ts +2 -2
  294. package/src/commands/cache.ts +3 -3
  295. package/src/commands/db.ts +9 -9
  296. package/src/commands/deploy.ts +12 -12
  297. package/src/commands/dev.ts +19 -19
  298. package/src/commands/doctor.ts +3 -3
  299. package/src/commands/engine.ts +1 -1
  300. package/src/commands/functions.ts +5 -5
  301. package/src/commands/hooks.ts +6 -6
  302. package/src/commands/init.ts +28 -28
  303. package/src/commands/login.ts +2 -2
  304. package/src/commands/logs.ts +1 -1
  305. package/src/commands/migrate.ts +5 -5
  306. package/src/commands/pg.ts +1 -1
  307. package/src/commands/plugins.ts +1 -1
  308. package/src/commands/pull.ts +2 -2
  309. package/src/commands/push.ts +3 -3
  310. package/src/commands/self-host.ts +1 -1
  311. package/src/commands/self-update.ts +23 -73
  312. package/src/commands/status.ts +1 -1
  313. package/src/commands/update.ts +1 -1
  314. package/src/config.ts +3 -3
  315. package/src/db-preflight.ts +15 -15
  316. package/src/dev-compose.ts +27 -27
  317. package/src/dev-log-filter.ts +1 -1
  318. package/src/dev-ports.ts +3 -3
  319. package/src/dev-session.ts +6 -6
  320. package/src/dev-shutdown.ts +8 -8
  321. package/src/dev-task-colors.ts +1 -1
  322. package/src/docker-postgres.ts +6 -6
  323. package/src/docker-runtime.ts +5 -5
  324. package/src/engine-client.ts +3 -3
  325. package/src/engine-push-output.ts +1 -1
  326. package/src/ensure-binary.ts +20 -0
  327. package/src/ensure-component-binaries.ts +1 -1
  328. package/src/env-file.ts +2 -2
  329. package/src/field-masking-tier.ts +6 -6
  330. package/src/functions-deno-types.ts +3 -3
  331. package/src/functions-router-gen.ts +1 -1
  332. package/src/gitignore.ts +3 -3
  333. package/src/hook-upload.ts +3 -3
  334. package/src/hooks-generator.ts +9 -9
  335. package/src/index.ts +1 -1
  336. package/src/init-project-detect.ts +1 -1
  337. package/src/link.ts +1 -1
  338. package/src/local-secrets.ts +5 -5
  339. package/src/main.ts +20 -0
  340. package/src/model-hooks.ts +4 -4
  341. package/src/pgbouncer-userlist.ts +2 -2
  342. package/src/postgres-ctl.ts +4 -4
  343. package/src/process-manager.ts +4 -4
  344. package/src/project-config.ts +16 -16
  345. package/src/pull-utils.ts +4 -4
  346. package/src/realtime-launch.ts +1 -1
  347. package/src/release-pins.ts +2 -2
  348. package/src/resolve-api-url.ts +1 -1
  349. package/src/resolve-target.ts +1 -1
  350. package/src/rest-cache-admin.ts +2 -2
  351. package/src/runtime-routes.ts +2 -2
  352. package/src/schema-ast-v2.ts +4 -4
  353. package/src/schema-push-lock.ts +3 -3
  354. package/src/scripts/postinstall.ts +1 -1
  355. package/src/self-host-compose.ts +25 -25
  356. package/src/service-role-check.ts +3 -3
  357. package/src/storage-provision.ts +3 -3
  358. package/src/studio-dev-server.ts +1 -1
  359. package/src/systemd.ts +1 -1
  360. package/src/target-client.ts +1 -1
  361. package/src/tsx-runner.ts +1 -1
  362. package/src/type-extractor.ts +27 -27
  363. package/src/type-resolver.ts +1 -1
  364. package/src/ui/README.md +1 -1
  365. package/src/ui/brand.ts +1 -1
  366. package/src/ui/components/LogoWordmark.tsx +1 -1
  367. package/src/ui/components/SelectField.tsx +1 -1
  368. package/src/ui/confirm.ts +1 -1
  369. package/src/ui/fatal.ts +1 -1
  370. package/src/ui/flows/prompt-fields.tsx +1 -1
  371. package/src/ui/interactive.ts +1 -1
  372. package/src/ui/progress.ts +1 -1
  373. package/src/ui/runtime/command-chrome.ts +1 -1
  374. package/src/ui/runtime/run-clack-flow.tsx +1 -1
  375. package/src/ui/runtime/stdin-after-ink.ts +1 -1
  376. package/src/ui/theme.ts +1 -1
  377. package/src/valkey-sidecar.ts +2 -2
  378. package/tests/access-composition.test.ts +6 -6
  379. package/tests/admin-studio-membership.test.ts +1 -1
  380. package/tests/api-schemas.test.ts +1 -1
  381. package/tests/archive-name-alias.test.ts +1 -1
  382. package/tests/cli-help.test.ts +8 -2
  383. package/tests/db-preflight.test.ts +1 -1
  384. package/tests/doctor-render.test.ts +3 -3
  385. package/tests/doctor-service-role.test.ts +2 -2
  386. package/tests/engine-push-output.test.ts +1 -1
  387. package/tests/env-file.test.ts +3 -3
  388. package/tests/external-database-compose.test.ts +5 -5
  389. package/tests/external-database-config.test.ts +2 -2
  390. package/tests/field-masking-tier.test.ts +1 -1
  391. package/tests/homebrew-formula.test.ts +68 -26
  392. package/tests/hook-upload.test.ts +1 -1
  393. package/tests/hooks-generator.test.ts +1 -1
  394. package/tests/init.test.ts +2 -2
  395. package/tests/keys.test.ts +8 -2
  396. package/tests/local-secrets.test.ts +3 -3
  397. package/tests/model-hooks.test.ts +6 -6
  398. package/tests/runtime-contract.test.ts +2 -2
  399. package/tests/service-role-check.test.ts +3 -3
  400. package/tests/storage-provision.test.ts +1 -1
  401. package/tests/type-extractor.test.ts +2 -2
  402. package/tsconfig.tsbuildinfo +1 -1
  403. package/vitest.config.ts +7 -1
  404. package/scripts/build-release-bundle.mjs +0 -27
@@ -1,11 +1,15 @@
1
1
  import { readFileSync } from "node:fs"
2
2
  import { dirname, join } from "node:path"
3
3
  import { fileURLToPath } from "node:url"
4
+ import { EMBEDDED_CLI_VERSION } from "./cli-version-embedded.js"
4
5
 
5
6
  const CLI_PACKAGE_JSON = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json")
6
7
 
7
- /** Installed @supatype/cli version from package.json (used by --version and init scaffolding). */
8
+ /** Installed @supatype/cli version (used by --version and init scaffolding). */
8
9
  export function cliPackageVersion(): string {
10
+ // Set in published builds; the package.json read below only works when one is on disk,
11
+ // which is true for the npm package and false inside the standalone binary.
12
+ if (EMBEDDED_CLI_VERSION !== "") return EMBEDDED_CLI_VERSION
9
13
  try {
10
14
  const pkg = JSON.parse(readFileSync(CLI_PACKAGE_JSON, "utf8")) as { version?: string }
11
15
  return pkg.version ?? "0.0.0"
@@ -1,23 +1,45 @@
1
1
  /**
2
- * Standalone CLI binary CDN download (self-update + curl|sh installers).
2
+ * Standalone CLI archive download, used by `supatype self-update`.
3
+ *
4
+ * The artefact is a per-platform archive holding one executable, not a bare executable, and it
5
+ * is verified against the release's checksums.sha256 before anything is replaced. Previously
6
+ * this path checked only that the download was over 64 bytes and did not begin like HTML or
7
+ * JSON, which made the CLI stricter about a postgres archive than about overwriting itself.
3
8
  */
4
9
 
5
- import { chmodSync, existsSync, mkdirSync, writeFileSync } from "node:fs"
6
- import { homedir } from "node:os"
10
+ import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"
11
+ import { createHash } from "node:crypto"
12
+ import { homedir, tmpdir } from "node:os"
7
13
  import { join } from "node:path"
8
- import { currentPlatform, type PlatformId } from "./binary-cache.js"
14
+ import { spawnSync } from "node:child_process"
15
+ import { currentPlatform, fetchChecksums, type PlatformId } from "./binary-cache.js"
16
+ import {
17
+ cliArchiveName,
18
+ cliArchivePath,
19
+ cliChecksumsPath,
20
+ cliExecutableName,
21
+ currentLibc,
22
+ type LibcId,
23
+ } from "./cli-artifacts.js"
9
24
 
10
- const CDN_BASE = "https://releases.supatype.com"
11
-
12
- export function cliCdnPath(version: string, platform: PlatformId): string {
13
- const win = platform.os === "windows"
14
- return `/cli/v${version}/supatype-cli-${platform.os}-${platform.arch}${win ? ".exe" : ""}`
15
- }
25
+ /**
26
+ * Overridable for the same reason scripts/install.sh takes SUPATYPE_CDN: with the host fixed,
27
+ * nothing can exercise this path except a real release, which is how it came to request bare
28
+ * executables the publisher had stopped writing. SUPATYPE_CDN_BASE is the CDN root, where
29
+ * install.sh's SUPATYPE_CDN is the root plus /cli.
30
+ *
31
+ * binary-cache.ts hardcodes the same host for component downloads and could use the same
32
+ * treatment, which is left alone here as it is not part of this change.
33
+ */
34
+ const CDN_BASE = process.env["SUPATYPE_CDN_BASE"]?.replace(/\/$/, "")
35
+ || "https://releases.supatype.com"
16
36
 
17
- export function cliCachePath(version: string, platform: PlatformId = currentPlatform()): string {
18
- const win = platform.os === "windows"
19
- const name = `supatype-cli-${platform.os}-${platform.arch}${win ? ".exe" : ""}`
20
- return join(homedir(), ".supatype", "cache", "cli", version, name)
37
+ /** Where a downloaded release is unpacked, so a repeated update does not refetch it. */
38
+ export function cliCachePath(
39
+ version: string,
40
+ platform: PlatformId = currentPlatform(),
41
+ ): string {
42
+ return join(homedir(), ".supatype", "cache", "cli", version, cliExecutableName(platform))
21
43
  }
22
44
 
23
45
  export async function fetchStandaloneCliLatestVersion(): Promise<string> {
@@ -32,31 +54,91 @@ export async function fetchStandaloneCliLatestVersion(): Promise<string> {
32
54
  return data.version.trim()
33
55
  }
34
56
 
35
- /** Download the standalone CLI binary for the current platform. */
36
- export async function downloadStandaloneCli(version?: string): Promise<string> {
37
- const platform = currentPlatform()
38
- const resolved = version ?? await fetchStandaloneCliLatestVersion()
39
- const dest = cliCachePath(resolved, platform)
40
- if (existsSync(dest)) return dest
41
-
42
- const url = `${CDN_BASE}${cliCdnPath(resolved, platform)}`
57
+ async function fetchBytes(url: string, what: string): Promise<Buffer> {
43
58
  const resp = await fetch(url)
44
59
  if (!resp.ok) {
45
- throw new Error(`Failed to download CLI from ${url}: HTTP ${resp.status}`)
60
+ throw new Error(`Failed to download ${what} from ${url}: HTTP ${resp.status}`)
46
61
  }
47
- const buf = Buffer.from(await resp.arrayBuffer())
48
- if (buf.length < 64) {
49
- throw new Error("Downloaded CLI artifact is too small")
62
+ return Buffer.from(await resp.arrayBuffer())
63
+ }
64
+
65
+ /**
66
+ * Unpack the single executable from an archive.
67
+ *
68
+ * PowerShell on Windows, because Git Bash's tar is usually first on PATH there and chokes on
69
+ * drive-letter paths. The same split exists in commands/dev.ts for component archives.
70
+ */
71
+ function unpackExecutable(archivePath: string, destDir: string, platform: PlatformId): string {
72
+ mkdirSync(destDir, { recursive: true })
73
+ const result = platform.os === "windows"
74
+ ? spawnSync(
75
+ "powershell.exe",
76
+ [
77
+ "-NoProfile",
78
+ "-Command",
79
+ `Expand-Archive -Path '${archivePath}' -DestinationPath '${destDir}' -Force`,
80
+ ],
81
+ { stdio: "pipe" },
82
+ )
83
+ : spawnSync("tar", ["-xzf", archivePath, "-C", destDir], { stdio: "pipe" })
84
+
85
+ if (result.status !== 0) {
86
+ throw new Error(
87
+ `Failed to unpack ${archivePath}: ${result.stderr?.toString().trim() || "unknown error"}`,
88
+ )
50
89
  }
51
- const head = buf.subarray(0, 5).toString("utf8").toLowerCase()
52
- if (head.startsWith("<!doc") || head.startsWith("{")) {
53
- throw new Error("Downloaded CLI artifact looks like an error page, not a binary")
90
+
91
+ const exe = join(destDir, cliExecutableName(platform))
92
+ if (!existsSync(exe)) {
93
+ throw new Error(
94
+ `${cliArchiveName(platform)} did not contain ${cliExecutableName(platform)}.`,
95
+ )
96
+ }
97
+ return exe
98
+ }
99
+
100
+ /**
101
+ * Download and verify the standalone CLI for this machine, returning the path to the
102
+ * executable. Nothing is written to the cache until the checksum matches.
103
+ */
104
+ export async function downloadStandaloneCli(
105
+ version?: string,
106
+ platform: PlatformId = currentPlatform(),
107
+ libc: LibcId = currentLibc(platform),
108
+ ): Promise<string> {
109
+ const resolved = version ?? await fetchStandaloneCliLatestVersion()
110
+ const dest = cliCachePath(resolved, platform)
111
+ if (existsSync(dest)) return dest
112
+
113
+ const name = cliArchiveName(platform, libc)
114
+ const archive = await fetchBytes(`${CDN_BASE}${cliArchivePath(resolved, platform, libc)}`, name)
115
+
116
+ // The manifest is verified before it is trusted, and only then is the archive compared
117
+ // against it. A checksum alone would prove the download was intact, not that it came from
118
+ // us, and the signature is what makes replacing our own executable no weaker than fetching
119
+ // a postgres archive. fetchChecksums treats the .minisig as mandatory and fails closed
120
+ // without a public key, which is the same rule component downloads follow.
121
+ const checksumsUrl = `${CDN_BASE}${cliChecksumsPath(resolved)}`
122
+ const expected = await fetchChecksums(checksumsUrl, `${checksumsUrl}.minisig`, name)
123
+ const actual = createHash("sha256").update(archive).digest("hex")
124
+ if (actual !== expected.checksum) {
125
+ throw new Error(
126
+ `Checksum mismatch for ${name}.\n expected: ${expected.checksum}\n actual: ${actual}`,
127
+ )
54
128
  }
55
129
 
56
- mkdirSync(join(dest, ".."), { recursive: true })
57
- writeFileSync(dest, buf)
58
- if (platform.os !== "windows") {
59
- chmodSync(dest, 0o755)
130
+ const staging = join(tmpdir(), `supatype-cli-${resolved}-${process.pid}`)
131
+ try {
132
+ mkdirSync(staging, { recursive: true })
133
+ const archivePath = join(staging, name)
134
+ writeFileSync(archivePath, archive)
135
+ const unpacked = unpackExecutable(archivePath, staging, platform)
136
+
137
+ mkdirSync(join(dest, ".."), { recursive: true })
138
+ writeFileSync(dest, readFileSync(unpacked))
139
+ if (platform.os !== "windows") chmodSync(dest, 0o755)
140
+ return dest
141
+ } finally {
142
+ rmSync(staging, { recursive: true, force: true })
60
143
  }
61
- return dest
62
144
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * CLI version, baked in at publish by scripts/set-version.mjs.
3
+ *
4
+ * The standalone binary cannot read its own package.json: pkg carries only files it can
5
+ * find by static analysis, and that path is assembled at runtime, so `--version` inside a
6
+ * published binary would answer 0.0.0 without this. Empty in a source checkout, where
7
+ * cliPackageVersion() falls back to reading package.json.
8
+ */
9
+ // Annotated `string`, not left to inference: once a release stamps a value here, the
10
+ // inferred literal type makes the `!== ""` test in cliPackageVersion() a compile error
11
+ // (TS2367, no overlap), so the build would only fail during a release.
12
+ export const EMBEDDED_CLI_VERSION: string = "0.1.9"
package/src/cli.ts CHANGED
@@ -39,7 +39,7 @@ import { wrapProgramActionsWithChrome } from "./ui/runtime/command-chrome.js"
39
39
  export async function run(): Promise<void> {
40
40
  const program = new Command()
41
41
  .name("supatype")
42
- .description("Supatype type-first platform for PostgreSQL")
42
+ .description("Supatype: type-first platform for PostgreSQL")
43
43
  .version(cliPackageVersion())
44
44
 
45
45
  registerInit(program)
@@ -99,6 +99,6 @@ function printDomainNextSteps(cwd: string, domain: string): void {
99
99
  "supatype self-host compose up -d # Kong provisions HTTPS automatically",
100
100
  `Platform URL: https://${domain}`,
101
101
  ])
102
- plain(" App, REST, Auth, Storage, Realtime, Functions, and Studio one HTTPS domain.")
102
+ plain(" App, REST, Auth, Storage, Realtime, Functions, and Studio, one HTTPS domain.")
103
103
  plain(" Certificates persist in the valkey-data volume.\n")
104
104
  }
@@ -1,6 +1,6 @@
1
1
  // ─── Admin panel CLI commands (Gap Appendices task 48) ──────────────────────
2
2
  //
3
- // `npx supatype admin create-user` create an admin user in the project's
3
+ // `npx supatype admin create-user`, create an admin user in the project's
4
4
  // auth.users table. First admin is ensured on `supatype dev` or `supatype push`.
5
5
 
6
6
  import type { Command } from "commander"
@@ -242,7 +242,7 @@ export function registerAdmin(program: Command): void {
242
242
  const pool = new pg.Pool({ connectionString: connection, max: 2 })
243
243
 
244
244
  try {
245
- // Studio access is membership, not a claim list the grant that
245
+ // Studio access is membership, not a claim, list the grant that
246
246
  // actually decides admission. LEFT JOIN, because a membership held by a
247
247
  // Supatype Cloud account has no row in this project's `auth.users`;
248
248
  // hiding those would make `list-users` disagree with who can log in.
@@ -308,7 +308,7 @@ export async function ensureFirstAdminUser(
308
308
  options,
309
309
  )
310
310
  } catch {
311
- // Non-fatal skip when DB is unreachable or auth schema is not ready
311
+ // Non-fatal: skip when DB is unreachable or auth schema is not ready
312
312
  } finally {
313
313
  await pool.end()
314
314
  }
@@ -528,7 +528,7 @@ async function createAdminUser(
528
528
  * the developer's own app roles, and letting it grant Studio access means a
529
529
  * developer assigning an app role could hand out admin UI access by accident.
530
530
  *
531
- * This is now the *only* grant, so a failure here is fatal to the command a
531
+ * This is now the *only* grant, so a failure here is fatal to the command, a
532
532
  * user created without a membership row cannot reach Studio at all, and
533
533
  * reporting success would leave no clue why.
534
534
  */
@@ -591,12 +591,12 @@ async function authUsersTableExists(query: DbQuery): Promise<boolean> {
591
591
  *
592
592
  * Counts membership rows, not `app_metadata` claims: the claim no longer grants
593
593
  * anything, so counting it would report an admin exists while nobody can log in.
594
- * A missing table means the project has never been pushed no admins.
594
+ * A missing table means the project has never been pushed, no admins.
595
595
  */
596
596
  async function hasAdminUsers(query: DbQuery): Promise<boolean> {
597
597
  // Postgres resolves relations at parse time, so the table has to be checked
598
598
  // separately rather than guarded inside the count query. Absent means the
599
- // project has never been pushed no admins, and `createAdminUser` will
599
+ // project has never been pushed, no admins, and `createAdminUser` will
600
600
  // create the table itself.
601
601
  if (!(await studioMembersTableExists(query))) return false
602
602
 
@@ -54,7 +54,7 @@ export function registerAdopt(program: Command): void {
54
54
 
55
55
  const statements = preview.stampStatements ?? []
56
56
  if (statements.length === 0) {
57
- info("Nothing to stamp matching objects are already managed or absent.")
57
+ info("Nothing to stamp: matching objects are already managed or absent.")
58
58
  return
59
59
  }
60
60
 
@@ -17,7 +17,7 @@ export function registerApp(program: Command): void {
17
17
  .option("--static", "Serve a static directory at / (default: ./public, or [dir] argument)")
18
18
  .option("--port <port>", "Port your app listens on (proxy mode)", "3000")
19
19
  .option("--upstream <url>", "URL of your running dev server (proxy mode; defaults to localhost:<port>)")
20
- .option("--dockerfile <path>", "(deprecated) ignored use supatype.config.ts")
20
+ .option("--dockerfile <path>", "(deprecated) ignored, use supatype.config.ts")
21
21
  .action(
22
22
  (
23
23
  dir: string | undefined,
@@ -80,7 +80,7 @@ function addProxyApp(cwd: string, port: string, upstream?: string): void {
80
80
  try {
81
81
  const configPath = updateAppConfigInProject(cwd, { mode: "proxy", upstream: upstreamUrl })
82
82
  file("updated", configPath)
83
- info(`Forwarding to ${upstreamUrl} app at ${localKongBaseUrl()}/`)
83
+ info(`Forwarding to ${upstreamUrl}: app at ${localKongBaseUrl()}/`)
84
84
  nextSteps("Next:", ["supatype self-host compose render"])
85
85
  } catch (err) {
86
86
  error((err as Error).message)
@@ -1,5 +1,5 @@
1
1
  /**
2
- * supatype cache list and clean cached component binaries + REST Valkey cache.
2
+ * supatype cache: list and clean cached component binaries + REST Valkey cache.
3
3
  */
4
4
 
5
5
  import type { Command } from "commander"
@@ -126,7 +126,7 @@ export function registerCache(program: Command): void {
126
126
  if (result.removed.length === 0 && result.skipped.length === 0) {
127
127
  info("Nothing to clean.")
128
128
  } else if (opts?.dryRun) {
129
- info(`Dry run ${result.removed.length} entr${result.removed.length === 1 ? "y" : "ies"} would be removed.`)
129
+ info(`Dry run: ${result.removed.length} entr${result.removed.length === 1 ? "y" : "ies"} would be removed.`)
130
130
  } else {
131
131
  info("Done.")
132
132
  }
@@ -160,7 +160,7 @@ export function registerCache(program: Command): void {
160
160
  )
161
161
  }
162
162
  if (result.cursor !== "0") {
163
- plain(`\n(more available cursor ${result.cursor})`)
163
+ plain(`\n(more available: cursor ${result.cursor})`)
164
164
  }
165
165
  } catch (e) {
166
166
  error(e instanceof Error ? e.message : String(e))
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Database connection commands:
3
- * supatype db connection-string show the connection string for the linked project
4
- * supatype db reset-password reset the database password
5
- * supatype db check does this database meet what Supatype needs of it?
3
+ * supatype db connection-string: show the connection string for the linked project
4
+ * supatype db reset-password: reset the database password
5
+ * supatype db check: does this database meet what Supatype needs of it?
6
6
  */
7
7
 
8
8
  import type { Command } from "commander"
@@ -154,7 +154,7 @@ export function registerDb(program: Command): void {
154
154
  url = url ?? connectionString(config)
155
155
  schema = schema ?? config.schema?.pg_schema ?? "public"
156
156
  } catch {
157
- // Runnable outside a project, which is the point an operator should be able to check a
157
+ // Runnable outside a project, which is the point, an operator should be able to check a
158
158
  // database before committing to any config at all.
159
159
  url = url ?? process.env["DATABASE_URL"]
160
160
  schema = schema ?? "public"
@@ -190,7 +190,7 @@ export function registerDb(program: Command): void {
190
190
  if (opts.emit) {
191
191
  // Machine-consumable: SQL on stdout, commentary on stderr, so it can be piped to psql.
192
192
  if (fixable.length === 0) {
193
- warn("Nothing to emit no SQL-fixable findings.")
193
+ warn("Nothing to emit: no SQL-fixable findings.")
194
194
  } else {
195
195
  plain("BEGIN;")
196
196
  for (const r of fixable) plain(`\n-- ${r.title}\n${r.remedy}`)
@@ -198,7 +198,7 @@ export function registerDb(program: Command): void {
198
198
  }
199
199
  if (manual.length > 0) {
200
200
  warn(`\n${manual.length} finding(s) need operator action and are not included above:`)
201
- for (const r of manual) warn(` ${r.title} ${r.detail}`)
201
+ for (const r of manual) warn(` ${r.title}, ${r.detail}`)
202
202
  }
203
203
  return
204
204
  }
@@ -224,7 +224,7 @@ export function registerDb(program: Command): void {
224
224
  await applyRemedies(client, fixable)
225
225
  info("Applied. Re-run `supatype db check` to confirm.")
226
226
  } catch (err) {
227
- error(`Rolled back the database is unchanged: ${(err as Error).message}`)
227
+ error(`Rolled back: the database is unchanged: ${(err as Error).message}`)
228
228
  process.exitCode = 1
229
229
  return
230
230
  }
@@ -232,7 +232,7 @@ export function registerDb(program: Command): void {
232
232
  if (manual.length > 0) {
233
233
  warn(`\n${manual.length} finding(s) cannot be fixed in a transaction:`)
234
234
  for (const r of manual) {
235
- warn(` ${r.title} needs a server setting change and likely a restart`)
235
+ warn(` ${r.title}: needs a server setting change and likely a restart`)
236
236
  }
237
237
  }
238
238
  return
@@ -265,7 +265,7 @@ const SEVERITY_LABEL: Record<Severity, string> = {
265
265
 
266
266
  function printReport(results: readonly CheckResult[]): void {
267
267
  for (const r of results) {
268
- const line = `[${SEVERITY_LABEL[r.severity]}] ${r.title} ${r.detail}`
268
+ const line = `[${SEVERITY_LABEL[r.severity]}] ${r.title}, ${r.detail}`
269
269
  if (r.severity === "fail") error(line)
270
270
  else if (r.severity === "degrade" || r.severity === "warn") warn(line)
271
271
  else plain(line)
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * Deploy commands:
3
- * supatype deploy Supatype Cloud by default (linked via supatype link), else platform projectRef; use --local for engine + DB
4
- * supatype deploy --local push schema via local engine + optional static app to .supatype/static
5
- * supatype deploy --app-only only build & deploy the static site
6
- * supatype deploy --schema-only only push schema changes
7
- * supatype deploy --skip-build deploy existing build output (no build step)
8
- * supatype deploy --preview deploy to a preview URL
9
- * supatype deploy rollback roll back to previous deployment
10
- * supatype deploy status show current deployment info
11
- * supatype deploy logs <version> show build logs
3
+ * supatype deploy: Supatype Cloud by default (linked via supatype link), else platform projectRef; use --local for engine + DB
4
+ * supatype deploy --local: push schema via local engine + optional static app to .supatype/static
5
+ * supatype deploy --app-only: only build & deploy the static site
6
+ * supatype deploy --schema-only: only push schema changes
7
+ * supatype deploy --skip-build: deploy existing build output (no build step)
8
+ * supatype deploy --preview: deploy to a preview URL
9
+ * supatype deploy rollback: roll back to previous deployment
10
+ * supatype deploy status: show current deployment info
11
+ * supatype deploy logs <version>, show build logs
12
12
  */
13
13
 
14
14
  import type { Command } from "commander"
@@ -31,7 +31,7 @@ export function registerDeploy(program: Command): void {
31
31
  const deploy = program
32
32
  .command("deploy")
33
33
  .description(
34
- "Deploy schema and app Supatype Cloud by default when linked (`supatype link`); pass --local for engine + your database",
34
+ "Deploy schema and app, Supatype Cloud by default when linked (`supatype link`); pass --local for engine + your database",
35
35
  )
36
36
  .option("--local", "Use local schema engine and database_url from config (skip cloud control plane)")
37
37
  .option("--environment <name>", "Target environment when linked", "production")
@@ -119,7 +119,7 @@ export function registerDeploy(program: Command): void {
119
119
  error("No build section found in supatype.config.ts")
120
120
  process.exit(1)
121
121
  }
122
- // No build config skip app deployment silently
122
+ // No build config: skip app deployment silently
123
123
  return
124
124
  }
125
125
 
@@ -151,7 +151,7 @@ export function registerDeploy(program: Command): void {
151
151
  buildEnv["NEXT_PUBLIC_SUPATYPE_URL"] = cloudCfg.apiUrl || `https://${cloudCfg.projectSlug}.supatype.dev`
152
152
  buildEnv["VITE_SUPATYPE_URL"] = buildEnv["NEXT_PUBLIC_SUPATYPE_URL"]!
153
153
  buildEnv["PUBLIC_SUPATYPE_URL"] = buildEnv["NEXT_PUBLIC_SUPATYPE_URL"]!
154
- // NEVER inject service_role key only anon key is safe for client-side
154
+ // NEVER inject service_role key, only anon key is safe for client-side
155
155
  }
156
156
 
157
157
  // Install dependencies
@@ -1,9 +1,9 @@
1
1
  /**
2
- * supatype dev start local Postgres, apply schema, run supatype-server.
2
+ * supatype dev: start local Postgres, apply schema, run supatype-server.
3
3
  *
4
4
  * Runtime provider (top-level `provider` or legacy `database.provider`):
5
- * native host Postgres + host server + host engine (default)
6
- * docker full self-host Compose stack (Kong :18473); see dev-compose.ts
5
+ * native: host Postgres + host server + host engine (default)
6
+ * docker: full self-host Compose stack (Kong :18473); see dev-compose.ts
7
7
  *
8
8
  * Edge functions (when a functions/ dir exists): Deno is resolved from the CDN cache
9
9
  * (auto-download on miss). Self-host/cloud Docker stacks use supatype-server in-container;
@@ -127,7 +127,7 @@ export function registerDev(program: Command): void {
127
127
  .action(async (opts: { watch: boolean; stream?: boolean; port?: string }) => {
128
128
  const cwd = process.cwd()
129
129
 
130
- // ── 1. Load project config (before TUI fatal errors must hit real stderr) ──
130
+ // ── 1. Load project config (before TUI, fatal errors must hit real stderr) ──
131
131
  const config = loadConfig(cwd)
132
132
  const provider = resolveRuntimeProvider(config)
133
133
 
@@ -181,7 +181,7 @@ export function registerDev(program: Command): void {
181
181
 
182
182
  // ── 5–7. Start Postgres ───────────────────────────────────────────────
183
183
  let dbURL: string
184
- /** What PostgREST connects as deliberately not `dbURL`, which is a superuser. */
184
+ /** What PostgREST connects as, deliberately not `dbURL`, which is a superuser. */
185
185
  let postgrestDbURL: string
186
186
  let stopPostgres: () => void | Promise<void>
187
187
  const pgPort = NATIVE_PG_PORT
@@ -195,7 +195,7 @@ export function registerDev(program: Command): void {
195
195
  let pgBinDir: string | null = null
196
196
 
197
197
  {
198
- // native resolve pg bin dir and manage with pg_ctl
198
+ // native: resolve pg bin dir and manage with pg_ctl
199
199
  pgBinDir = await resolvePgBinDir(config)
200
200
  const dataDir = config.database.data_dir ?? join(stateRoot, "data")
201
201
  mkdirSync(dataDir, { recursive: true })
@@ -239,7 +239,7 @@ export function registerDev(program: Command): void {
239
239
  //
240
240
  // `authenticator` is NOINHERIT and holds no privileges of its own: it can only
241
241
  // SET ROLE to the three above. That containment is the point. Connecting as
242
- // `postgres` a superuser meant a request whose JWT named *any* role in the
242
+ // `postgres`: a superuser: meant a request whose JWT named *any* role in the
243
243
  // cluster got it, because a superuser may SET ROLE to anything. Verified: as
244
244
  // postgres, `SET ROLE supatype_replication_admin` succeeds; as authenticator the
245
245
  // same statement is refused. Mirrors the image, which has had this role all along.
@@ -300,7 +300,7 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticate
300
300
  mkdirSync(supatypeDir, { recursive: true })
301
301
 
302
302
  const localStoragePath = config.storage?.provider !== "s3" ? join(stateRoot, "storage") : undefined
303
- // Native Postgres builds don't include PostGIS skip geo fields rather than failing.
303
+ // Native Postgres builds don't include PostGIS, skip geo fields rather than failing.
304
304
  const skipFieldKinds: ReadonlySet<string> = new Set(["geo", "vector"])
305
305
 
306
306
  await runSchemaPush(cwd, engineBin, schemaPath, dbURL, manifestPath, adminConfigPath, localStoragePath, skipFieldKinds, config).catch(
@@ -341,7 +341,7 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticate
341
341
  }
342
342
  } catch (err) {
343
343
  console.warn(
344
- `[supatype] ⚠ Found ${functionsDir} but could not provision Deno edge functions will not run.\n` +
344
+ `[supatype] ⚠ Found ${functionsDir} but could not provision Deno, edge functions will not run.\n` +
345
345
  ` ${(err as Error).message}\n` +
346
346
  " (Functions still appear in Studio; invocations need Deno.)",
347
347
  )
@@ -383,7 +383,7 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticate
383
383
  console.log(`[supatype] Realtime service: ${realtimeUrl}`)
384
384
  } catch (err) {
385
385
  console.warn(
386
- `[supatype] ⚠ Realtime unavailable WebSocket subscriptions will not work.\n` +
386
+ `[supatype] ⚠ Realtime unavailable, WebSocket subscriptions will not work.\n` +
387
387
  ` ${(err as Error).message}`,
388
388
  )
389
389
  }
@@ -509,10 +509,10 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticate
509
509
 
510
510
  const postgrestEnv: Record<string, string> = {
511
511
  PGRST_DB_URI: postgrestDbURL,
512
- // Derived from schema.pg_schema (or schema.api_schemas) a hardcoded "public" here meant
512
+ // Derived from schema.pg_schema (or schema.api_schemas), a hardcoded "public" here meant
513
513
  // a non-default pg_schema pushed correctly and then answered PGRST106 on every request.
514
514
  // Native dev has no masking extension either, so a schema with field rules is served from
515
- // `api` here too the case an "is the database external" rule would have got wrong.
515
+ // `api` here too: the case an "is the database external" rule would have got wrong.
516
516
  PGRST_DB_SCHEMA: apiSchemaList(
517
517
  config,
518
518
  // The installed archive decides: one downloaded before the masking library was bundled
@@ -644,9 +644,9 @@ ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO authenticate
644
644
  // Schema push (engine subprocess)
645
645
  // ---------------------------------------------------------------------------
646
646
 
647
- // Last successfully-pushed AST JSON used to skip no-op re-fires.
647
+ // Last successfully-pushed AST JSON, used to skip no-op re-fires.
648
648
  let _lastPushedAst: string | null = null
649
- // AST that failed on its last attempt always retried even if content is unchanged.
649
+ // AST that failed on its last attempt, always retried even if content is unchanged.
650
650
  let _lastFailedAst: string | null = null
651
651
 
652
652
  async function runSchemaPush(
@@ -670,7 +670,7 @@ async function runSchemaPush(
670
670
  ast = filtered
671
671
  if (adapted.length > 0) {
672
672
  console.warn(
673
- `[supatype] ⚠ ${adapted.length} field(s) replaced with JSONB required extensions not available:\n` +
673
+ `[supatype] ⚠ ${adapted.length} field(s) replaced with JSONB, required extensions not available:\n` +
674
674
  adapted.map((s: string) => ` ${s}`).join("\n"),
675
675
  )
676
676
  }
@@ -744,7 +744,7 @@ async function runSchemaPush(
744
744
  { cwd, stdio: "pipe", encoding: "utf8" },
745
745
  )
746
746
  if (genResult.status !== 0) {
747
- console.warn("[supatype] Manifest generation failed server routing may be stale.")
747
+ console.warn("[supatype] Manifest generation failed, server routing may be stale.")
748
748
  }
749
749
 
750
750
  // Generate admin config (for Studio). Engine writes to stdout.
@@ -889,7 +889,7 @@ async function extractPostgresArchive(
889
889
  }
890
890
 
891
891
  // ---------------------------------------------------------------------------
892
- // PostgREST resolver downloads from GitHub releases if not cached
892
+ // PostgREST resolver: downloads from GitHub releases if not cached
893
893
  // ---------------------------------------------------------------------------
894
894
 
895
895
  const POSTGREST_DEFAULT_VERSION = "12.2.3"
@@ -1030,12 +1030,12 @@ function repairWindowsPostgrestRuntime(cacheDir: string, archivePath: string, bi
1030
1030
  }
1031
1031
 
1032
1032
  // ---------------------------------------------------------------------------
1033
- // Local-dev JWT generator (no external dep pure crypto)
1033
+ // Local-dev JWT generator (no external dep, pure crypto)
1034
1034
  // ---------------------------------------------------------------------------
1035
1035
 
1036
1036
 
1037
1037
  // ---------------------------------------------------------------------------
1038
- // AST adaptation replace extension-dependent fields with JSONB fallbacks
1038
+ // AST adaptation: replace extension-dependent fields with JSONB fallbacks
1039
1039
  // ---------------------------------------------------------------------------
1040
1040
 
1041
1041
  interface AstField { kind: string; required?: boolean; [k: string]: unknown }
@@ -114,7 +114,7 @@ export function registerDoctor(program: Command): void {
114
114
  * Whether declared hooks can actually run.
115
115
  *
116
116
  * Worth its own section because every failure here is silent: a hook whose function is missing, or a
117
- * stack with functions switched off, produces no error anywhere the write just succeeds
117
+ * stack with functions switched off, produces no error anywhere, the write just succeeds
118
118
  * unvalidated. Drift you cannot see is the thing doctor exists for.
119
119
  */
120
120
  export function printHooks(report: HooksReport): void {
@@ -133,7 +133,7 @@ export function printHooks(report: HooksReport): void {
133
133
  plain(" Create it with: supatype hooks new <name>")
134
134
  }
135
135
  if (report.functionsDisabled) {
136
- plain("\n functions_enabled is false in .supatype/manifest.json every hook is inert.")
136
+ plain("\n functions_enabled is false in .supatype/manifest.json, every hook is inert.")
137
137
  plain(" Regenerate the stack config with: supatype self-host compose")
138
138
  }
139
139
  if (report.mapMissing) {
@@ -162,7 +162,7 @@ export function printServiceRoleGrants(
162
162
  }
163
163
 
164
164
  if (broken.size > 0) {
165
- plain("\n Those marked ✗ match no function, so they grant nothing the function reads no key.")
165
+ plain("\n Those marked ✗ match no function, so they grant nothing, the function reads no key.")
166
166
  }
167
167
  for (const warning of problems.warnings) plain(warning)
168
168
  plain("\n These functions bypass every access rule in the schema. Anything not listed cannot.")
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Engine management commands:
3
- * supatype engine status check if the engine container is reachable
3
+ * supatype engine status: check if the engine container is reachable
4
4
  */
5
5
 
6
6
  import type { Command } from "commander"