@supatype/cli 0.1.7 → 0.1.10

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 (414) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +125 -122
  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 +17 -1
  23. package/dist/cli-install-method.d.ts.map +1 -1
  24. package/dist/cli-install-method.js +32 -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 +4 -3
  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.d.ts.map +1 -1
  53. package/dist/commands/db.js +12 -11
  54. package/dist/commands/db.js.map +1 -1
  55. package/dist/commands/deploy.d.ts +9 -9
  56. package/dist/commands/deploy.js +12 -12
  57. package/dist/commands/deploy.js.map +1 -1
  58. package/dist/commands/dev.d.ts +3 -3
  59. package/dist/commands/dev.js +17 -17
  60. package/dist/commands/dev.js.map +1 -1
  61. package/dist/commands/doctor.d.ts +1 -1
  62. package/dist/commands/doctor.js +3 -3
  63. package/dist/commands/doctor.js.map +1 -1
  64. package/dist/commands/engine.d.ts +1 -1
  65. package/dist/commands/engine.js +1 -1
  66. package/dist/commands/functions.d.ts.map +1 -1
  67. package/dist/commands/functions.js +8 -7
  68. package/dist/commands/functions.js.map +1 -1
  69. package/dist/commands/hooks.d.ts +2 -2
  70. package/dist/commands/hooks.js +4 -4
  71. package/dist/commands/hooks.js.map +1 -1
  72. package/dist/commands/init.js +28 -28
  73. package/dist/commands/init.js.map +1 -1
  74. package/dist/commands/internal.d.ts.map +1 -1
  75. package/dist/commands/internal.js +37 -0
  76. package/dist/commands/internal.js.map +1 -1
  77. package/dist/commands/login.d.ts +1 -1
  78. package/dist/commands/login.js +1 -1
  79. package/dist/commands/login.js.map +1 -1
  80. package/dist/commands/logs.d.ts +1 -1
  81. package/dist/commands/migrate.js +5 -5
  82. package/dist/commands/migrate.js.map +1 -1
  83. package/dist/commands/pg.d.ts +1 -1
  84. package/dist/commands/pg.js +1 -1
  85. package/dist/commands/plugins.js +1 -1
  86. package/dist/commands/plugins.js.map +1 -1
  87. package/dist/commands/pull.js +2 -2
  88. package/dist/commands/pull.js.map +1 -1
  89. package/dist/commands/push.js +3 -3
  90. package/dist/commands/push.js.map +1 -1
  91. package/dist/commands/self-host.d.ts +1 -1
  92. package/dist/commands/self-host.js +1 -1
  93. package/dist/commands/self-update.d.ts +2 -8
  94. package/dist/commands/self-update.d.ts.map +1 -1
  95. package/dist/commands/self-update.js +20 -12
  96. package/dist/commands/self-update.js.map +1 -1
  97. package/dist/commands/status.d.ts +1 -1
  98. package/dist/commands/update.d.ts +1 -1
  99. package/dist/commands/update.js +1 -1
  100. package/dist/config.d.ts +23 -1
  101. package/dist/config.d.ts.map +1 -1
  102. package/dist/config.js +37 -18
  103. package/dist/config.js.map +1 -1
  104. package/dist/db-preflight.d.ts +4 -4
  105. package/dist/db-preflight.js +14 -14
  106. package/dist/db-preflight.js.map +1 -1
  107. package/dist/dev-compose.d.ts +3 -3
  108. package/dist/dev-compose.js +27 -27
  109. package/dist/dev-compose.js.map +1 -1
  110. package/dist/dev-log-filter.d.ts +1 -1
  111. package/dist/dev-log-filter.d.ts.map +1 -1
  112. package/dist/dev-log-filter.js +1 -1
  113. package/dist/dev-log-filter.js.map +1 -1
  114. package/dist/dev-ports.d.ts +2 -2
  115. package/dist/dev-ports.d.ts.map +1 -1
  116. package/dist/dev-ports.js +2 -2
  117. package/dist/dev-ports.js.map +1 -1
  118. package/dist/dev-session.d.ts +5 -5
  119. package/dist/dev-session.d.ts.map +1 -1
  120. package/dist/dev-session.js +6 -6
  121. package/dist/dev-session.js.map +1 -1
  122. package/dist/dev-shutdown.d.ts +5 -5
  123. package/dist/dev-shutdown.d.ts.map +1 -1
  124. package/dist/dev-shutdown.js +7 -7
  125. package/dist/dev-shutdown.js.map +1 -1
  126. package/dist/dev-task-colors.d.ts +1 -1
  127. package/dist/dev-task-colors.d.ts.map +1 -1
  128. package/dist/dev-task-colors.js +1 -1
  129. package/dist/dev-task-colors.js.map +1 -1
  130. package/dist/docker-postgres.d.ts +5 -5
  131. package/dist/docker-postgres.d.ts.map +1 -1
  132. package/dist/docker-postgres.js +5 -5
  133. package/dist/docker-postgres.js.map +1 -1
  134. package/dist/docker-runtime.d.ts +2 -2
  135. package/dist/docker-runtime.d.ts.map +1 -1
  136. package/dist/docker-runtime.js +5 -5
  137. package/dist/docker-runtime.js.map +1 -1
  138. package/dist/engine-client.d.ts +1 -1
  139. package/dist/engine-client.js +3 -3
  140. package/dist/engine-client.js.map +1 -1
  141. package/dist/engine-push-output.js +1 -1
  142. package/dist/engine-push-output.js.map +1 -1
  143. package/dist/ensure-binary.d.ts.map +1 -1
  144. package/dist/ensure-binary.js +17 -0
  145. package/dist/ensure-binary.js.map +1 -1
  146. package/dist/ensure-component-binaries.js +1 -1
  147. package/dist/ensure-component-binaries.js.map +1 -1
  148. package/dist/env-file.d.ts +2 -2
  149. package/dist/env-file.d.ts.map +1 -1
  150. package/dist/env-file.js +1 -1
  151. package/dist/env-file.js.map +1 -1
  152. package/dist/field-masking-tier.d.ts +5 -5
  153. package/dist/field-masking-tier.d.ts.map +1 -1
  154. package/dist/field-masking-tier.js +6 -6
  155. package/dist/field-masking-tier.js.map +1 -1
  156. package/dist/functions-deno-types.d.ts +1 -1
  157. package/dist/functions-deno-types.d.ts.map +1 -1
  158. package/dist/functions-deno-types.js +3 -3
  159. package/dist/functions-deno-types.js.map +1 -1
  160. package/dist/functions-router-gen.js +1 -1
  161. package/dist/gitignore.d.ts +2 -2
  162. package/dist/gitignore.d.ts.map +1 -1
  163. package/dist/gitignore.js +3 -3
  164. package/dist/gitignore.js.map +1 -1
  165. package/dist/hook-upload.d.ts +1 -1
  166. package/dist/hook-upload.js +3 -3
  167. package/dist/hooks-generator.d.ts +1 -1
  168. package/dist/hooks-generator.js +9 -9
  169. package/dist/index.d.ts +1 -1
  170. package/dist/index.js +1 -1
  171. package/dist/init-project-detect.d.ts +1 -1
  172. package/dist/init-project-detect.d.ts.map +1 -1
  173. package/dist/init-project-detect.js +1 -1
  174. package/dist/init-project-detect.js.map +1 -1
  175. package/dist/link.d.ts +1 -1
  176. package/dist/link.d.ts.map +1 -1
  177. package/dist/local-secrets.d.ts +5 -5
  178. package/dist/local-secrets.js +5 -5
  179. package/dist/main.d.ts +2 -0
  180. package/dist/main.d.ts.map +1 -0
  181. package/dist/main.js +20 -0
  182. package/dist/main.js.map +1 -0
  183. package/dist/model-hooks.d.ts +3 -3
  184. package/dist/model-hooks.js +4 -4
  185. package/dist/pgbouncer-userlist.d.ts +1 -1
  186. package/dist/pgbouncer-userlist.d.ts.map +1 -1
  187. package/dist/pgbouncer-userlist.js +2 -2
  188. package/dist/pgbouncer-userlist.js.map +1 -1
  189. package/dist/postgres-ctl.d.ts +1 -1
  190. package/dist/postgres-ctl.js +4 -4
  191. package/dist/postgres-ctl.js.map +1 -1
  192. package/dist/process-manager.d.ts +2 -2
  193. package/dist/process-manager.d.ts.map +1 -1
  194. package/dist/process-manager.js +4 -4
  195. package/dist/process-manager.js.map +1 -1
  196. package/dist/project-config.d.ts +12 -12
  197. package/dist/project-config.d.ts.map +1 -1
  198. package/dist/project-config.js +9 -9
  199. package/dist/project-config.js.map +1 -1
  200. package/dist/pull-utils.d.ts +2 -2
  201. package/dist/pull-utils.d.ts.map +1 -1
  202. package/dist/pull-utils.js +4 -4
  203. package/dist/pull-utils.js.map +1 -1
  204. package/dist/realtime-launch.js +1 -1
  205. package/dist/realtime-launch.js.map +1 -1
  206. package/dist/release-pins.d.ts +1 -1
  207. package/dist/release-pins.js +2 -2
  208. package/dist/release-pins.js.map +1 -1
  209. package/dist/resolve-api-url.d.ts.map +1 -1
  210. package/dist/resolve-api-url.js +4 -3
  211. package/dist/resolve-api-url.js.map +1 -1
  212. package/dist/resolve-target.d.ts +1 -1
  213. package/dist/resolve-target.d.ts.map +1 -1
  214. package/dist/rest-cache-admin.js +2 -2
  215. package/dist/rest-cache-admin.js.map +1 -1
  216. package/dist/runtime-routes.d.ts +1 -1
  217. package/dist/runtime-routes.js +1 -1
  218. package/dist/schema-ast-v2.d.ts +3 -3
  219. package/dist/schema-ast-v2.d.ts.map +1 -1
  220. package/dist/schema-ast-v2.js +2 -2
  221. package/dist/schema-ast-v2.js.map +1 -1
  222. package/dist/schema-push-lock.js +3 -3
  223. package/dist/schema-push-lock.js.map +1 -1
  224. package/dist/scripts/postinstall.d.ts +1 -1
  225. package/dist/scripts/postinstall.js +1 -1
  226. package/dist/self-host-compose.d.ts +5 -5
  227. package/dist/self-host-compose.d.ts.map +1 -1
  228. package/dist/self-host-compose.js +24 -24
  229. package/dist/self-host-compose.js.map +1 -1
  230. package/dist/service-role-check.js +3 -3
  231. package/dist/service-role-check.js.map +1 -1
  232. package/dist/storage-provision.d.ts +1 -1
  233. package/dist/storage-provision.js +3 -3
  234. package/dist/storage-provision.js.map +1 -1
  235. package/dist/studio-dev-server.d.ts +1 -1
  236. package/dist/studio-dev-server.d.ts.map +1 -1
  237. package/dist/systemd.d.ts +1 -1
  238. package/dist/systemd.js +1 -1
  239. package/dist/target-client.js +1 -1
  240. package/dist/target-client.js.map +1 -1
  241. package/dist/tsx-runner.d.ts +12 -0
  242. package/dist/tsx-runner.d.ts.map +1 -1
  243. package/dist/tsx-runner.js +36 -2
  244. package/dist/tsx-runner.js.map +1 -1
  245. package/dist/type-extractor.js +27 -27
  246. package/dist/type-extractor.js.map +1 -1
  247. package/dist/type-resolver.js +1 -1
  248. package/dist/type-resolver.js.map +1 -1
  249. package/dist/ui/brand.d.ts +1 -1
  250. package/dist/ui/brand.js +1 -1
  251. package/dist/ui/components/LogoWordmark.d.ts +1 -1
  252. package/dist/ui/components/LogoWordmark.d.ts.map +1 -1
  253. package/dist/ui/components/LogoWordmark.js +1 -1
  254. package/dist/ui/components/LogoWordmark.js.map +1 -1
  255. package/dist/ui/components/SelectField.js +1 -1
  256. package/dist/ui/components/SelectField.js.map +1 -1
  257. package/dist/ui/confirm.d.ts +1 -1
  258. package/dist/ui/confirm.js +1 -1
  259. package/dist/ui/fatal.d.ts +1 -1
  260. package/dist/ui/fatal.d.ts.map +1 -1
  261. package/dist/ui/fatal.js +1 -1
  262. package/dist/ui/fatal.js.map +1 -1
  263. package/dist/ui/flows/prompt-fields.js +1 -1
  264. package/dist/ui/flows/prompt-fields.js.map +1 -1
  265. package/dist/ui/interactive.d.ts +1 -1
  266. package/dist/ui/interactive.d.ts.map +1 -1
  267. package/dist/ui/interactive.js +1 -1
  268. package/dist/ui/interactive.js.map +1 -1
  269. package/dist/ui/progress.d.ts +1 -1
  270. package/dist/ui/progress.js +1 -1
  271. package/dist/ui/runtime/command-chrome.js +1 -1
  272. package/dist/ui/runtime/command-chrome.js.map +1 -1
  273. package/dist/ui/runtime/run-clack-flow.js +1 -1
  274. package/dist/ui/runtime/run-clack-flow.js.map +1 -1
  275. package/dist/ui/runtime/stdin-after-ink.js +1 -1
  276. package/dist/ui/runtime/stdin-after-ink.js.map +1 -1
  277. package/dist/ui/theme.d.ts +1 -1
  278. package/dist/ui/theme.js +1 -1
  279. package/dist/valkey-sidecar.d.ts +1 -1
  280. package/dist/valkey-sidecar.d.ts.map +1 -1
  281. package/dist/valkey-sidecar.js +2 -2
  282. package/dist/valkey-sidecar.js.map +1 -1
  283. package/package.json +3 -2
  284. package/scripts/build-release-artifacts.sh +112 -0
  285. package/scripts/generate-homebrew-formula.mjs +47 -45
  286. package/scripts/mirror-deno-release.sh +1 -1
  287. package/src/TYPE-RESOLUTION.md +31 -31
  288. package/src/app/framework.ts +1 -1
  289. package/src/augmentation-generator.ts +3 -3
  290. package/src/binary-cache.ts +51 -36
  291. package/src/cache-pins.ts +2 -2
  292. package/src/cli-artifacts.ts +65 -0
  293. package/src/cli-install-method.ts +35 -4
  294. package/src/cli-package-version.ts +5 -1
  295. package/src/cli-standalone.ts +116 -34
  296. package/src/cli-version-embedded.ts +12 -0
  297. package/src/cli.ts +1 -1
  298. package/src/commands/add.ts +4 -3
  299. package/src/commands/admin.ts +6 -6
  300. package/src/commands/adopt.ts +1 -1
  301. package/src/commands/app.ts +2 -2
  302. package/src/commands/cache.ts +3 -3
  303. package/src/commands/db.ts +12 -11
  304. package/src/commands/deploy.ts +12 -12
  305. package/src/commands/dev.ts +19 -19
  306. package/src/commands/doctor.ts +3 -3
  307. package/src/commands/engine.ts +1 -1
  308. package/src/commands/functions.ts +8 -7
  309. package/src/commands/hooks.ts +6 -6
  310. package/src/commands/init.ts +28 -28
  311. package/src/commands/internal.ts +37 -0
  312. package/src/commands/login.ts +2 -2
  313. package/src/commands/logs.ts +1 -1
  314. package/src/commands/migrate.ts +5 -5
  315. package/src/commands/pg.ts +1 -1
  316. package/src/commands/plugins.ts +1 -1
  317. package/src/commands/pull.ts +2 -2
  318. package/src/commands/push.ts +3 -3
  319. package/src/commands/self-host.ts +1 -1
  320. package/src/commands/self-update.ts +23 -73
  321. package/src/commands/status.ts +1 -1
  322. package/src/commands/update.ts +1 -1
  323. package/src/config.ts +39 -18
  324. package/src/db-preflight.ts +15 -15
  325. package/src/dev-compose.ts +27 -27
  326. package/src/dev-log-filter.ts +1 -1
  327. package/src/dev-ports.ts +3 -3
  328. package/src/dev-session.ts +6 -6
  329. package/src/dev-shutdown.ts +8 -8
  330. package/src/dev-task-colors.ts +1 -1
  331. package/src/docker-postgres.ts +6 -6
  332. package/src/docker-runtime.ts +5 -5
  333. package/src/engine-client.ts +3 -3
  334. package/src/engine-push-output.ts +1 -1
  335. package/src/ensure-binary.ts +20 -0
  336. package/src/ensure-component-binaries.ts +1 -1
  337. package/src/env-file.ts +2 -2
  338. package/src/field-masking-tier.ts +6 -6
  339. package/src/functions-deno-types.ts +3 -3
  340. package/src/functions-router-gen.ts +1 -1
  341. package/src/gitignore.ts +3 -3
  342. package/src/hook-upload.ts +3 -3
  343. package/src/hooks-generator.ts +9 -9
  344. package/src/index.ts +1 -1
  345. package/src/init-project-detect.ts +1 -1
  346. package/src/link.ts +1 -1
  347. package/src/local-secrets.ts +5 -5
  348. package/src/main.ts +20 -0
  349. package/src/model-hooks.ts +4 -4
  350. package/src/pgbouncer-userlist.ts +2 -2
  351. package/src/postgres-ctl.ts +4 -4
  352. package/src/process-manager.ts +4 -4
  353. package/src/project-config.ts +16 -16
  354. package/src/pull-utils.ts +4 -4
  355. package/src/realtime-launch.ts +1 -1
  356. package/src/release-pins.ts +2 -2
  357. package/src/resolve-api-url.ts +4 -3
  358. package/src/resolve-target.ts +1 -1
  359. package/src/rest-cache-admin.ts +2 -2
  360. package/src/runtime-routes.ts +2 -2
  361. package/src/schema-ast-v2.ts +4 -4
  362. package/src/schema-push-lock.ts +3 -3
  363. package/src/scripts/postinstall.ts +1 -1
  364. package/src/self-host-compose.ts +25 -25
  365. package/src/service-role-check.ts +3 -3
  366. package/src/storage-provision.ts +3 -3
  367. package/src/studio-dev-server.ts +1 -1
  368. package/src/systemd.ts +1 -1
  369. package/src/target-client.ts +1 -1
  370. package/src/tsx-runner.ts +41 -2
  371. package/src/type-extractor.ts +27 -27
  372. package/src/type-resolver.ts +1 -1
  373. package/src/ui/README.md +1 -1
  374. package/src/ui/brand.ts +1 -1
  375. package/src/ui/components/LogoWordmark.tsx +1 -1
  376. package/src/ui/components/SelectField.tsx +1 -1
  377. package/src/ui/confirm.ts +1 -1
  378. package/src/ui/fatal.ts +1 -1
  379. package/src/ui/flows/prompt-fields.tsx +1 -1
  380. package/src/ui/interactive.ts +1 -1
  381. package/src/ui/progress.ts +1 -1
  382. package/src/ui/runtime/command-chrome.ts +1 -1
  383. package/src/ui/runtime/run-clack-flow.tsx +1 -1
  384. package/src/ui/runtime/stdin-after-ink.ts +1 -1
  385. package/src/ui/theme.ts +1 -1
  386. package/src/valkey-sidecar.ts +2 -2
  387. package/tests/access-composition.test.ts +6 -6
  388. package/tests/admin-studio-membership.test.ts +1 -1
  389. package/tests/api-schemas.test.ts +1 -1
  390. package/tests/archive-name-alias.test.ts +1 -1
  391. package/tests/cli-help.test.ts +8 -2
  392. package/tests/config-load-failure.test.ts +44 -0
  393. package/tests/db-preflight.test.ts +1 -1
  394. package/tests/doctor-render.test.ts +3 -3
  395. package/tests/doctor-service-role.test.ts +2 -2
  396. package/tests/engine-push-output.test.ts +1 -1
  397. package/tests/env-file.test.ts +3 -3
  398. package/tests/external-database-compose.test.ts +5 -5
  399. package/tests/external-database-config.test.ts +2 -2
  400. package/tests/field-masking-tier.test.ts +1 -1
  401. package/tests/homebrew-formula.test.ts +68 -26
  402. package/tests/hook-upload.test.ts +1 -1
  403. package/tests/hooks-generator.test.ts +1 -1
  404. package/tests/init.test.ts +2 -2
  405. package/tests/keys.test.ts +8 -2
  406. package/tests/local-secrets.test.ts +3 -3
  407. package/tests/model-hooks.test.ts +6 -6
  408. package/tests/runtime-contract.test.ts +2 -2
  409. package/tests/service-role-check.test.ts +3 -3
  410. package/tests/storage-provision.test.ts +1 -1
  411. package/tests/type-extractor.test.ts +2 -2
  412. package/tsconfig.tsbuildinfo +1 -1
  413. package/vitest.config.ts +7 -1
  414. package/scripts/build-release-bundle.mjs +0 -27
@@ -48,7 +48,7 @@ export function filterStackLogLine(line: string): boolean {
48
48
  return false
49
49
  }
50
50
 
51
- /** Drop docker noise only keep diff tables, push status, and command output. */
51
+ /** Drop docker noise only, keep diff tables, push status, and command output. */
52
52
  export function filterCommandLogLine(line: string): boolean {
53
53
  const t = stripAnsi(line).trim()
54
54
  if (!t) return false
package/src/dev-ports.ts CHANGED
@@ -60,7 +60,7 @@ async function promptPortConflict(
60
60
  export interface EnsureKongPortOptions {
61
61
  /** When false, fail fast instead of prompting (CI / scripts). */
62
62
  interactive?: boolean
63
- /** init wizard slightly different copy */
63
+ /** init wizard: slightly different copy */
64
64
  context?: "dev" | "init"
65
65
  }
66
66
 
@@ -102,7 +102,7 @@ export async function ensureKongPort(
102
102
  return port
103
103
  }
104
104
 
105
- /** Wizard / init pick a Kong port without writing `.env` (scaffold writes it). */
105
+ /** Wizard / init: pick a Kong port without writing `.env` (scaffold writes it). */
106
106
  export async function promptKongPortChoice(): Promise<number> {
107
107
  const freeDefault = (await isPortInUse(COMPOSE_DEV_KONG_PORT))
108
108
  ? await findNextFreePort(COMPOSE_DEV_KONG_PORT)
@@ -139,7 +139,7 @@ async function promptPortConflictWithoutPersist(
139
139
  const headline =
140
140
  reason === "init"
141
141
  ? `Port ${blockedPort} is already in use on this machine.`
142
- : `Port ${blockedPort} is in use another Supatype project or service may already be bound to it.`
142
+ : `Port ${blockedPort} is in use, another Supatype project or service may already be bound to it.`
143
143
 
144
144
  const choice = await p.select<"suggested" | "custom" | "cancel">({
145
145
  message: headline,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `supatype dev` output session Ink dashboard (default) or interleaved stream mode.
2
+ * `supatype dev` output session, Ink dashboard (default) or interleaved stream mode.
3
3
  */
4
4
 
5
5
  import { render, type Instance } from "ink"
@@ -32,7 +32,7 @@ export function beginDevSession(mode: DevUiMode): DevSession {
32
32
  return activeSession
33
33
  }
34
34
 
35
- /** @deprecated Ink starts in beginDevSession kept for callers that invoke late. */
35
+ /** @deprecated Ink starts in beginDevSession, kept for callers that invoke late. */
36
36
  export function startDevSession(): void {
37
37
  activeSession?.startInk()
38
38
  }
@@ -47,7 +47,7 @@ export function endDevSession(): void {
47
47
  activeSession = null
48
48
  }
49
49
 
50
- /** @deprecated Dev prompts render inside the Ink dashboard no suspend needed. */
50
+ /** @deprecated Dev prompts render inside the Ink dashboard, no suspend needed. */
51
51
  export function suspendDevSessionForPrompt(): void {
52
52
  prepareStdinForInteractivePrompt()
53
53
  }
@@ -58,12 +58,12 @@ export function prepareStdinForInteractivePrompt(): void {
58
58
  process.stdin.resume()
59
59
  }
60
60
 
61
- /** @deprecated Dev prompts render inside the Ink dashboard no resume needed. */
61
+ /** @deprecated Dev prompts render inside the Ink dashboard, no resume needed. */
62
62
  export function resumeDevSessionAfterPrompt(): void {
63
- // no-op prompts are Ink overlays
63
+ // no-op: prompts are Ink overlays
64
64
  }
65
65
 
66
- /** @deprecated Use Ink overlay prompts runs fn without tearing down the dashboard. */
66
+ /** @deprecated Use Ink overlay prompts, runs fn without tearing down the dashboard. */
67
67
  export async function withDevSessionSuspended<T>(fn: () => Promise<T>): Promise<T> {
68
68
  return fn()
69
69
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Graceful shutdown for `supatype dev` SIGINT, TUI Ctrl+C, terminal close,
2
+ * Graceful shutdown for `supatype dev`, SIGINT, TUI Ctrl+C, terminal close,
3
3
  * and a synchronous compose-down fallback on process exit.
4
4
  */
5
5
 
@@ -23,7 +23,7 @@ let forceQuitRequested = false
23
23
  let hooksRegistered = false
24
24
  let ignoreSigintUntil = 0
25
25
 
26
- /** SIGINT/SIGTERM hooks call as soon as `supatype dev` starts (before compose is up). */
26
+ /** SIGINT/SIGTERM hooks: call as soon as `supatype dev` starts (before compose is up). */
27
27
  export function ensureDevShutdownHooks(): void {
28
28
  if (hooksRegistered) return
29
29
  hooksRegistered = true
@@ -62,7 +62,7 @@ function syncComposeDownFallback(): void {
62
62
  { quiet: true },
63
63
  )
64
64
  } catch {
65
- // best-effort process is exiting
65
+ // best-effort: process is exiting
66
66
  }
67
67
  if (shutdownCwd) clearDevSessionLock(shutdownCwd)
68
68
  }
@@ -74,7 +74,7 @@ function onProcessExit(): void {
74
74
  export interface RegisterDevShutdownOptions {
75
75
  /** Sync `docker compose down` when async teardown cannot finish (terminal close, kill). */
76
76
  compose?: DevComposeShutdownFallback
77
- /** Project root clears `.supatype/dev-session.json` after shutdown. */
77
+ /** Project root: clears `.supatype/dev-session.json` after shutdown. */
78
78
  cwd?: string
79
79
  }
80
80
 
@@ -89,7 +89,7 @@ export function registerDevShutdown(
89
89
  ensureDevShutdownHooks()
90
90
  }
91
91
 
92
- /** TUI Ctrl+C do not re-emit SIGINT (avoids double-fire on Windows raw mode). */
92
+ /** TUI Ctrl+C: do not re-emit SIGINT (avoids double-fire on Windows raw mode). */
93
93
  export function requestDevShutdown(): void {
94
94
  ignoreSigintUntil = Date.now() + 400
95
95
  void runDevShutdown()
@@ -99,7 +99,7 @@ export function isDevShuttingDown(): boolean {
99
99
  return shuttingDown
100
100
  }
101
101
 
102
- /** @internal Tests reset module state between cases. */
102
+ /** @internal Tests: reset module state between cases. */
103
103
  export function resetDevShutdownForTests(): void {
104
104
  shutdownWork = null
105
105
  composeFallback = null
@@ -125,7 +125,7 @@ async function runDevShutdown(): Promise<void> {
125
125
  } catch {
126
126
  // best-effort terminal restore
127
127
  }
128
- process.stderr.write("\n[supatype] Forced quit Docker containers may still be running.\n")
128
+ process.stderr.write("\n[supatype] Forced quit: Docker containers may still be running.\n")
129
129
  process.stdout.write("\n")
130
130
  process.exit(130)
131
131
  }
@@ -145,7 +145,7 @@ async function runDevShutdown(): Promise<void> {
145
145
  } catch (err) {
146
146
  process.stderr.write(`[supatype] Shutdown failed: ${(err as Error).message}\n`)
147
147
  process.stderr.write(
148
- "[supatype] Docker containers may still be running try: supatype self-host compose down\n",
148
+ "[supatype] Docker containers may still be running, try: supatype self-host compose down\n",
149
149
  )
150
150
  syncComposeDownFallback()
151
151
  shutdownCompleted = true
@@ -30,7 +30,7 @@ export function levelColor(line: string): string | null {
30
30
  return null
31
31
  }
32
32
 
33
- /** Drop redundant prefix task pane is already labelled supatype. */
33
+ /** Drop redundant prefix: task pane is already labelled supatype. */
34
34
  export function normalizeStackLogLine(line: string): string {
35
35
  return line.replace(/^\[supatype\]\s*/, "")
36
36
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * docker-postgres manage a supatype/postgres Docker container for local dev.
2
+ * docker-postgres: manage a supatype/postgres Docker container for local dev.
3
3
  *
4
4
  * Used by `supatype dev` when database.provider = "docker".
5
5
  * The container is named supatype-{projectName} and persists data in a
@@ -11,7 +11,7 @@ import { spawnSync } from "node:child_process"
11
11
  export interface DockerPgOptions {
12
12
  /** Docker image to run. Defaults to supatype/postgres:latest. */
13
13
  image: string
14
- /** Project name used to derive the container and volume names. */
14
+ /** Project name: used to derive the container and volume names. */
15
15
  projectName: string
16
16
  /** Host port to bind to container's 5432. */
17
17
  port: number
@@ -85,7 +85,7 @@ export function dockerPgStart(opts: DockerPgOptions): void {
85
85
  }
86
86
 
87
87
  /**
88
- * Stop the container (fast does not remove it or the data volume).
88
+ * Stop the container (fast, does not remove it or the data volume).
89
89
  * Safe to call even if the container is not running.
90
90
  */
91
91
  export function dockerPgStop(projectName: string): void {
@@ -120,7 +120,7 @@ export function dockerPgPostInitServing(logs: string): boolean {
120
120
 
121
121
  const initDone = logs.lastIndexOf("PostgreSQL init process complete")
122
122
  if (initDone === -1) {
123
- // Reused data volume this run did not re-run entrypoint init.
123
+ // Reused data volume: this run did not re-run entrypoint init.
124
124
  return true
125
125
  }
126
126
  return initDone < lastReady
@@ -240,7 +240,7 @@ export function dockerDbUrl(projectName: string, port: number, password = DEFAUL
240
240
  /**
241
241
  * DB URL for processes sharing the Postgres container network namespace
242
242
  * (supatype-server migrate in a one-shot container). Uses loopback inside the
243
- * container where pg_hba grants trust avoids host-published-port SCRAM/SSL issues.
243
+ * container where pg_hba grants trust, avoids host-published-port SCRAM/SSL issues.
244
244
  */
245
245
  export function dockerPgLoopbackDbUrl(projectName: string, password = DEFAULT_DEV_PASSWORD): string {
246
246
  return `postgres://${PG_USER}:${password}@127.0.0.1:5432/${projectName}?sslmode=disable`
@@ -254,7 +254,7 @@ export const DEFAULT_SERVER_DOCKER_IMAGE = "supatype/server:latest"
254
254
 
255
255
  /**
256
256
  * Run `supatype-server migrate` on the Postgres container network (loopback trust).
257
- * Used on Windows + database.provider docker host-published :5432 breaks libpq TLS there.
257
+ * Used on Windows + database.provider docker, host-published :5432 breaks libpq TLS there.
258
258
  */
259
259
  export function runGotrueMigrationsViaDocker(
260
260
  pgContainerName: string,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Docker daemon availability used before `docker compose` and other docker CLI calls.
2
+ * Docker daemon availability: used before `docker compose` and other docker CLI calls.
3
3
  */
4
4
 
5
5
  import { spawnSync } from "node:child_process"
@@ -41,7 +41,7 @@ export function probeDockerDaemon(): DockerDaemonProbe {
41
41
  const versionStderr = (version.stderr ?? "").trim()
42
42
  const versionDetail = `${versionStderr}${version.stdout ?? ""}`.trim()
43
43
 
44
- // No client version CLI missing or broken.
44
+ // No client version: CLI missing or broken.
45
45
  if (!clientVersion) {
46
46
  return {
47
47
  ok: false,
@@ -51,7 +51,7 @@ export function probeDockerDaemon(): DockerDaemonProbe {
51
51
  }
52
52
 
53
53
  // Client is present but daemon refused (paused/stopped). `docker info` can hang
54
- // while paused on Docker Desktop use the version stderr and skip info.
54
+ // while paused on Docker Desktop, use the version stderr and skip info.
55
55
  if (version.status !== 0 && versionStderr) {
56
56
  return { ok: false, reason: "daemon_unavailable", detail: versionStderr }
57
57
  }
@@ -104,7 +104,7 @@ function dockerUnavailableHints(probe: Extract<DockerDaemonProbe, { ok: false }>
104
104
  return hints
105
105
  }
106
106
 
107
- /** @deprecated Tests only use `reportDockerUnavailable`. */
107
+ /** @deprecated Tests only: use `reportDockerUnavailable`. */
108
108
  export function formatDockerUnavailableMessage(
109
109
  probe: Extract<DockerDaemonProbe, { ok: false }>,
110
110
  ): string {
@@ -142,7 +142,7 @@ export function reportDockerUnavailable(
142
142
  export function requireDockerDaemon(opts?: DockerReportOptions): void {
143
143
  const probe = probeDockerDaemon()
144
144
  if (probe.ok) return
145
- // Dev TUI patches console restore stderr before printing a fatal message.
145
+ // Dev TUI patches console, restore stderr before printing a fatal message.
146
146
  if (getActiveDevSession()) {
147
147
  endDevSession()
148
148
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * engine-client.ts subprocess-based engine invocation.
2
+ * engine-client.ts: subprocess-based engine invocation.
3
3
  *
4
4
  * Replaces the former HTTP-based engine client (Docker container API).
5
5
  * All callers use the same interface; only the transport changed.
@@ -99,7 +99,7 @@ async function getEngineBin(): Promise<string> {
99
99
  // Otherwise (no valid project config) fall through to default cache scan.
100
100
  }
101
101
 
102
- // No config found scan the cache for any available engine binary.
102
+ // No config found: scan the cache for any available engine binary.
103
103
  const platform = currentPlatform()
104
104
  const engineCacheDir = join(homedir(), ".supatype", "cache", "engine")
105
105
  try {
@@ -208,7 +208,7 @@ export async function engineRequest<T = unknown>(
208
208
  try {
209
209
  return JSON.parse(result.stdout) as T
210
210
  } catch {
211
- // Non-JSON stdout return as message.
211
+ // Non-JSON stdout: return as message.
212
212
  return { message: result.stdout.trim() } as T
213
213
  }
214
214
  }
@@ -43,7 +43,7 @@ export function parseEnginePushOutput(output: string): EnginePushResult | null {
43
43
  export function formatEnginePushMessage(result: EnginePushResult): string {
44
44
  if (result.status === "up_to_date") {
45
45
  if (result.admin_refreshed) {
46
- return "Schema up to date Studio metadata synced."
46
+ return "Schema up to date, Studio metadata synced."
47
47
  }
48
48
  return "Schema up to date."
49
49
  }
@@ -11,8 +11,26 @@ import {
11
11
  type Component,
12
12
  } from "./binary-cache.js"
13
13
  import { isDownloadInProgress, waitForComponentDownload } from "./binary-download-lock.js"
14
+ import { currentLibc } from "./cli-artifacts.js"
14
15
  import type { SupatypeProjectConfig } from "./project-config.js"
15
16
 
17
+ /**
18
+ * Components are published for glibc only, so on Alpine the CLI itself runs (it has a musl
19
+ * build) while everything it downloads cannot start. Said once, before the first download,
20
+ * because the alternative is a dynamic loader error naming a file the user never asked for.
21
+ */
22
+ let warnedAboutMusl = false
23
+ function warnIfMusl(component: Component): void {
24
+ if (warnedAboutMusl || currentLibc() !== "musl") return
25
+ warnedAboutMusl = true
26
+ console.warn(
27
+ `[supatype] This is a musl system (Alpine). Component binaries such as ${component} are ` +
28
+ "published for glibc only, so they may fail to start here.\n" +
29
+ "[supatype] Use a glibc image (for example node:22-bookworm) for local stacks, or run " +
30
+ "against a remote target with `supatype link`.",
31
+ )
32
+ }
33
+
16
34
  export async function ensureBinary(
17
35
  component: Component,
18
36
  config: SupatypeProjectConfig,
@@ -26,6 +44,8 @@ export async function ensureBinary(
26
44
  }
27
45
  }
28
46
 
47
+ warnIfMusl(component)
48
+
29
49
  const version = await resolveVersionFor(component, config)
30
50
  const platform = currentPlatform()
31
51
 
@@ -37,7 +37,7 @@ export async function ensureComponentBinaries(
37
37
  const list = describeRequiredHostComponents(components)
38
38
  if (provider === "docker") {
39
39
  info(
40
- `Preparing host CLI tools (${list}) Compose still runs Postgres and the API stack.`,
40
+ `Preparing host CLI tools (${list}), Compose still runs Postgres and the API stack.`,
41
41
  )
42
42
  } else {
43
43
  info(`Preparing local runtime components (${list})…`)
package/src/env-file.ts CHANGED
@@ -10,7 +10,7 @@ import { join } from "node:path"
10
10
  * `SUPATYPE_REALTIME_IMAGE` from `.env` and could not override `SUPATYPE_SERVER_IMAGE`, because the
11
11
  * latter is derivable from a pin and the former is not. Same file, same shape, different rules.
12
12
  */
13
- export const MANAGED_MARKER = "# supatype:managed value from versions in supatype.config.ts"
13
+ export const MANAGED_MARKER = "# supatype:managed, value from versions in supatype.config.ts"
14
14
 
15
15
  interface EnvLine {
16
16
  /** `KEY` for an assignment, undefined for comments and blanks. */
@@ -47,7 +47,7 @@ function parseLines(text: string): EnvLine[] {
47
47
 
48
48
  export interface UpsertOptions {
49
49
  /**
50
- * Keys to delete but only where the CLI wrote them (see [`MANAGED_MARKER`]). A hand-written value
50
+ * Keys to delete: but only where the CLI wrote them (see [`MANAGED_MARKER`]). A hand-written value
51
51
  * is left alone, because the operator putting an image tag in `.env` is the documented way to run a
52
52
  * local build and deleting it silently sent them back to `:latest`.
53
53
  */
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Which mechanism will enforce this project's per-column rules decided offline.
2
+ * Which mechanism will enforce this project's per-column rules, decided offline.
3
3
  *
4
4
  * The engine makes the same decision at push time by asking the database whether `supatype_mask` is
5
5
  * installed. The CLI has to answer earlier: it writes `PGRST_DB_SCHEMA` when it generates compose,
6
6
  * before any database necessarily exists. It can, because the extension needs
7
- * `shared_preload_libraries` and a compiled library on the host, so exactly one path ships it
7
+ * `shared_preload_libraries` and a compiled library on the host, so exactly one path ships it,
8
8
  * `supatype/postgres`. Everything else gets the view tier:
9
9
  *
10
10
  * | Config | Ships the extension | Tier |
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * Deliberately **not** "is the database external": a native `supatype dev` has no extension either,
18
18
  * and treating it as tier 1 would point PostgREST at a schema whose tables the API roles no longer
19
- * hold privileges on every request denied.
19
+ * hold privileges on: every request denied.
20
20
  *
21
21
  * The one case this cannot call is a self-managed Postgres where the operator compiled and installed
22
22
  * the extension themselves and points at it with `database.external`. They set `schema.api_schemas`
@@ -25,7 +25,7 @@
25
25
 
26
26
  import { existsSync } from "node:fs"
27
27
  // Statically imported: these packages are ESM, where `require` does not exist. The first attempt used
28
- // it for a lazy import and every command that generates compose would have thrown at runtime caught
28
+ // it for a lazy import and every command that generates compose would have thrown at runtime, caught
29
29
  // by the tests that run the built binary rather than the source.
30
30
  import { loadSchemaAst } from "./config.js"
31
31
  export { nativeMaskLibraryPresent } from "./postgres-ctl.js"
@@ -77,7 +77,7 @@ export function schemaHasFieldRules(ast: unknown): boolean {
77
77
  export function fieldMaskingTier(
78
78
  config: SupatypeProjectConfig,
79
79
  ast: unknown,
80
- /** Set on the native path once the Postgres install is known see [`nativeMaskLibraryPresent`]. */
80
+ /** Set on the native path once the Postgres install is known, see [`nativeMaskLibraryPresent`]. */
81
81
  maskLibraryPresent?: boolean,
82
82
  ): FieldMaskingTier {
83
83
  if (!schemaHasFieldRules(ast)) return "none"
@@ -88,7 +88,7 @@ export function fieldMaskingTier(
88
88
  /**
89
89
  * The tier for a project on disk, loading its schema to see whether any column is masked.
90
90
  *
91
- * A schema that fails to load falls back to `"none"` the default exposed-schema list. Deciding the
91
+ * A schema that fails to load falls back to `"none"`, the default exposed-schema list. Deciding the
92
92
  * tier is the wrong moment to report a syntax error, and `push`/`dev` do it properly moments later
93
93
  * with the file and line.
94
94
  */
@@ -23,7 +23,7 @@ export function functionsDenoAmbientSource(): string {
23
23
  return `/**
24
24
  * ${MARKER}.
25
25
  * Runtime is Deno; this file covers APIs edge functions commonly use.
26
- * Do not add \`@types/deno\` to the app package.json it leaks into the
26
+ * Do not add \`@types/deno\` to the app package.json, it leaks into the
27
27
  * whole project when root tsconfig has no \`"types"\` field.
28
28
  *
29
29
  * Optional: for the full Deno API, install the Deno VS Code/Cursor extension
@@ -75,7 +75,7 @@ declare namespace Deno {
75
75
  `
76
76
  }
77
77
 
78
- /** `functions/tsconfig.json` owns function files so the app config can exclude them. */
78
+ /** `functions/tsconfig.json`: owns function files so the app config can exclude them. */
79
79
  export function functionsTsConfigSource(): string {
80
80
  return `{
81
81
  "compilerOptions": {
@@ -166,7 +166,7 @@ function ensureRootTsconfigExcludesFunctions(
166
166
  writeFileSync(path, `${JSON.stringify(asJson, null, 2)}\n`, "utf8")
167
167
  return "updated"
168
168
  } catch {
169
- // JSONC / trailing commas try a conservative string splice into an existing exclude array.
169
+ // JSONC / trailing commas, try a conservative string splice into an existing exclude array.
170
170
  if (/"exclude"\s*:\s*\[/.test(raw)) {
171
171
  const next = raw.replace(/("exclude"\s*:\s*\[)/, `$1\n "functions",`)
172
172
  if (next !== raw) {
@@ -58,7 +58,7 @@ export function generateFunctionsRouterSource(
58
58
  )
59
59
  const routes = fns.map((fn, i) => ` "${fn.name}": handler_${i},`)
60
60
 
61
- return `// Auto-generated do not edit (regenerated by supatype dev / functions serve)
61
+ return `// Auto-generated: do not edit (regenerated by supatype dev / functions serve)
62
62
  ${imports.join("\n")}
63
63
 
64
64
  const handlers: Record<string, (req: Request) => Response | Promise<Response>> = {
package/src/gitignore.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readFileSync, writeFileSync } from "node:fs"
2
2
  import { resolve } from "node:path"
3
3
 
4
- export const SUPATYPE_GITIGNORE_MARKER = "# Supatype local runtime (contains secrets in link.json)"
4
+ export const SUPATYPE_GITIGNORE_MARKER = "# Supatype, local runtime (contains secrets in link.json)"
5
5
  export const SUPATYPE_GITIGNORE_BLOCK = `${SUPATYPE_GITIGNORE_MARKER}
6
6
  .env
7
7
  .supatype/
@@ -34,7 +34,7 @@ export function ensureSupatypeGitignore(cwd: string, opts?: { silent?: boolean }
34
34
  }
35
35
 
36
36
  if (!opts?.silent) {
37
- console.warn("Added .supatype/ to .gitignore (link.json contains secrets never commit).")
37
+ console.warn("Added .supatype/ to .gitignore (link.json contains secrets, never commit).")
38
38
  }
39
39
  return true
40
40
  }
@@ -42,7 +42,7 @@ export function ensureSupatypeGitignore(cwd: string, opts?: { silent?: boolean }
42
42
  export function warnIfLinkNotGitignored(cwd: string): void {
43
43
  if (isSupatypeGitignored(cwd)) return
44
44
  console.warn(
45
- "\n⚠ Warning: .supatype/ is not in .gitignore link.json contains tokens and must not be committed.",
45
+ "\n⚠ Warning: .supatype/ is not in .gitignore, link.json contains tokens and must not be committed.",
46
46
  )
47
47
  console.warn(" Run with link --fix-gitignore to append the Supatype block.\n")
48
48
  }
@@ -2,7 +2,7 @@
2
2
  * Package a project's hooks for a managed stack.
3
3
  *
4
4
  * Self-hosted stacks need none of this: the worker mounts the project directory, so `hooks/` is already
5
- * where it looks. A managed project has no directory its worker reads a ConfigMap, whose keys may only
5
+ * where it looks. A managed project has no directory, its worker reads a ConfigMap, whose keys may only
6
6
  * contain alphanumerics, `-`, `_` and `.`. So the tree is flattened here, where it can be checked and
7
7
  * explained, rather than in the deploy route where a dropped file would be silent.
8
8
  */
@@ -28,7 +28,7 @@ export interface HookUpload {
28
28
  * Rewrite the one import a hook handler is generated to make.
29
29
  *
30
30
  * `../_supatype/hooks.ts` is a path that cannot survive flattening, and it is the specifier our own
31
- * scaffold writes so it is rewritten rather than refused. Any *other* relative import is refused
31
+ * scaffold writes: so it is rewritten rather than refused. Any *other* relative import is refused
32
32
  * below: it would resolve to nothing on the worker, and a hook that fails to import is a hooked table
33
33
  * whose writes all start failing.
34
34
  */
@@ -55,7 +55,7 @@ function unsupportedImports(source: string): string[] {
55
55
  * holding the service-role key with nothing able to call it. Uploading it buys nothing and widens what
56
56
  * runs with that credential.
57
57
  *
58
- * Throws with a message meant for a terminal when a handler cannot be flattened faithfully the
58
+ * Throws with a message meant for a terminal when a handler cannot be flattened faithfully, the
59
59
  * alternative is a deploy that succeeds and a hook that fails to import, which reads to the caller as
60
60
  * the table's writes being broken for no visible reason.
61
61
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generate `functions/_supatype/hooks.ts` the typed handler surface for model hooks.
2
+ * Generate `functions/_supatype/hooks.ts`: the typed handler surface for model hooks.
3
3
  *
4
4
  * Generated into the project rather than shipped as a package, for two reasons: a Deno function
5
5
  * resolves a relative `.ts` import with no npm involved, and the types then move in lockstep with the
@@ -40,7 +40,7 @@ function hookedModels(ast: unknown): HookedModel[] {
40
40
  * The module source, or `null` when no model declares a hook.
41
41
  *
42
42
  * Returning null rather than an empty module keeps a `_supatype/hooks.ts` from appearing in projects
43
- * that have no hooks a generated file nobody imports is a file somebody eventually edits.
43
+ * that have no hooks, a generated file nobody imports is a file somebody eventually edits.
44
44
  */
45
45
  export function generateHooksModule(ast: unknown): string | null {
46
46
  const models = hookedModels(ast)
@@ -56,7 +56,7 @@ export function generateHooksModule(ast: unknown): string | null {
56
56
  )
57
57
  .join("\n")
58
58
 
59
- return `// Generated by supatype CLI do not edit manually.
59
+ return `// Generated by supatype CLI, do not edit manually.
60
60
  //
61
61
  // Typed handlers for the models that declare \`hooks\`. Import from a function beside it:
62
62
  //
@@ -103,7 +103,7 @@ interface HookBase {
103
103
  /**
104
104
  * The rows this request is about to overwrite, fetched only if you ask.
105
105
  *
106
- * Resolved by the server from the in-flight request's own filter, as the caller's own role so it
106
+ * Resolved by the server from the in-flight request's own filter, as the caller's own role, so it
107
107
  * cannot show you rows the caller could not read, and you cannot widen the filter. Capped:
108
108
  * \`truncated\` is true when there were more, in which case acting on what you got means acting on a
109
109
  * prefix you did not choose.
@@ -131,7 +131,7 @@ export type BeforeDeleteContext<T extends HookedTable> = HookBase & {
131
131
 
132
132
  export type AfterChangeContext<T extends HookedTable> = HookBase & {
133
133
  readonly operation: "insert" | "update"
134
- /** Written rows present only when the caller sent \`Prefer: return=representation\`. */
134
+ /** Written rows: present only when the caller sent \`Prefer: return=representation\`. */
135
135
  readonly rows?: HookTables[T]["Row"][]
136
136
  }
137
137
 
@@ -201,7 +201,7 @@ interface WireContext {
201
201
  *
202
202
  * The outcome travels as the **HTTP status**: 200 for proceed, 4xx for a rejection. That keeps the
203
203
  * contract in the transport rather than in a second envelope inside the body, so a hook written by
204
- * hand or in another language needs to know nothing about this file.
204
+ * hand: or in another language, needs to know nothing about this file.
205
205
  */
206
206
  export function hook(handler: AnyHandler): (req: Request) => Promise<Response> {
207
207
  return async (req: Request): Promise<Response> => {
@@ -263,7 +263,7 @@ export function hook(handler: AnyHandler): (req: Request) => Promise<Response> {
263
263
  *
264
264
  * The worker takes **one default export per function directory**, so \`hook(single)\` is one hook per
265
265
  * directory. That is fine for a single moderation rule and tedious for a model whose whole lifecycle
266
- * you want in one place hence this. Point every event at the same function name in the schema:
266
+ * you want in one place, hence this. Point every event at the same function name in the schema:
267
267
  *
268
268
  * hooks: { beforeChange: "post-hooks", afterChange: "post-hooks" }
269
269
  *
@@ -284,7 +284,7 @@ export function hooks(handlers: Record<string, AnyHandler | undefined>): (req: R
284
284
  * The stack's address from this worker's point of view.
285
285
  *
286
286
  * \`SUPATYPE_INTERNAL_URL\` in Compose is the in-network gateway; \`SUPATYPE_URL\` is the same value
287
- * there. Never a public or host URL \`localhost\` inside this container is this container.
287
+ * there. Never a public or host URL, \`localhost\` inside this container is this container.
288
288
  */
289
289
  function stackBaseUrl(): string {
290
290
  const base =
@@ -330,7 +330,7 @@ function json(body: unknown, status: number): Response {
330
330
  * Replace cross-package type imports the client types use but a hook cannot resolve.
331
331
  *
332
332
  * `RichText` normally generates `import("@supatype/types/lexical").SerializedEditorState`. That works
333
- * in an app, where the package is installed but this file lives in `functions/`, is imported by a
333
+ * in an app, where the package is installed, but this file lives in `functions/`, is imported by a
334
334
  * Deno handler, and has no node_modules to reach into. Left alone, any hooked model with a rich-text
335
335
  * column emitted a module that failed to compile in the user's editor. Caught by compiling the
336
336
  * generated file in a test rather than by a reader reporting it.
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @supatype/cli programmatic API for invoking the engine.
2
+ * @supatype/cli: programmatic API for invoking the engine.
3
3
  *
4
4
  * For CLI usage: use the `supatype` binary.
5
5
  */
@@ -62,7 +62,7 @@ function detectStaticDir(cwd: string): string {
62
62
  return "./public"
63
63
  }
64
64
 
65
- /** Inspect `cwd` before init prompts Vite, static dir, existing Supatype config. */
65
+ /** Inspect `cwd` before init prompts, Vite, static dir, existing Supatype config. */
66
66
  export function detectProjectSetup(cwd: string): DetectedProjectSetup {
67
67
  let entries: string[] = []
68
68
  try {
package/src/link.ts CHANGED
@@ -23,7 +23,7 @@ export interface ProjectLink {
23
23
  defaultEnvironment: string
24
24
  /** Access token (cloud user JWT) or self-host SERVICE_ROLE_KEY. */
25
25
  token?: string
26
- /** Cloud GoTrue refresh token used to renew short-lived access JWTs. */
26
+ /** Cloud GoTrue refresh token, used to renew short-lived access JWTs. */
27
27
  refreshToken?: string
28
28
  orgId?: string | undefined
29
29
  cloudApiUrl?: string
@@ -2,7 +2,7 @@
2
2
  * The secrets the local stack runs with.
3
3
  *
4
4
  * **Read from `.env`, never pinned back into it.** These used to be hardcoded constants that
5
- * `supatype dev` wrote to `.env` on every run which meant a project could not hold its own
5
+ * `supatype dev` wrote to `.env` on every run, which meant a project could not hold its own
6
6
  * secrets: whatever `supatype init` or the developer put there was replaced by the published
7
7
  * defaults on the next `dev`, and the same `.env` then went to a server. Resolving instead of
8
8
  * pinning is what lets a generated secret survive to production.
@@ -16,7 +16,7 @@ import { hasEnvValue, readEnvValue } from "./env-file.js"
16
16
  /**
17
17
  * Fallback JWT signing secret for a project that has none.
18
18
  *
19
- * Published, therefore worthless as a secret anyone can mint a token for a stack still using
19
+ * Published, therefore worthless as a secret, anyone can mint a token for a stack still using
20
20
  * it. That is precisely why `init` generates one instead of relying on this.
21
21
  */
22
22
  export const FALLBACK_JWT_SECRET = "super-secret-jwt-token-with-at-least-32-characters-long"
@@ -52,7 +52,7 @@ export function devAuthenticatorPassword(cwd: string): string {
52
52
  *
53
53
  * The compose template requires these with `${VAR:?}` rather than defaulting them, because a
54
54
  * default is how a published constant ends up signing a real deployment's tokens. That only
55
- * works if something guarantees presence this does, for any project that predates
55
+ * works if something guarantees presence, this does, for any project that predates
56
56
  * `supatype init` writing them.
57
57
  *
58
58
  * **Fills with the fallback, does not generate.** Preserving the value such a project has been
@@ -72,11 +72,11 @@ export function seedMissingLocalSecrets(cwd: string): Record<string, string> {
72
72
  }
73
73
 
74
74
  /**
75
- * The database identity the local stack connects with seeded, never overwritten.
75
+ * The database identity the local stack connects with, seeded, never overwritten.
76
76
  *
77
77
  * `POSTGRES_DB` in particular is *project configuration*: `supatype init` sets it to the
78
78
  * project name, and the running container's database was created from it. Rewriting it to a
79
- * default afterwards points every tool at a database that does not exist observed as
79
+ * default afterwards points every tool at a database that does not exist, observed as
80
80
  * `supatype push` failing with `FATAL: database "supatype" does not exist` on a project called
81
81
  * something else, because the push path rewrote `.env` after `self-host compose up` had already
82
82
  * created the database under its real name.