@supatype/cli 0.8.0 → 0.9.1

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 (501) hide show
  1. package/CHANGELOG.md +415 -0
  2. package/bin/supatype.js +16 -1
  3. package/dist/after-hooks-health.d.ts +19 -0
  4. package/dist/after-hooks-health.d.ts.map +1 -0
  5. package/dist/after-hooks-health.js +69 -0
  6. package/dist/after-hooks-health.js.map +1 -0
  7. package/dist/app/proxy-dev-app.d.ts +13 -3
  8. package/dist/app/proxy-dev-app.d.ts.map +1 -1
  9. package/dist/app/proxy-dev-app.js +58 -62
  10. package/dist/app/proxy-dev-app.js.map +1 -1
  11. package/dist/app-vite-env.d.ts +5 -1
  12. package/dist/app-vite-env.d.ts.map +1 -1
  13. package/dist/app-vite-env.js +9 -15
  14. package/dist/app-vite-env.js.map +1 -1
  15. package/dist/augmentation-generator.d.ts +5 -0
  16. package/dist/augmentation-generator.d.ts.map +1 -1
  17. package/dist/augmentation-generator.js +13 -4
  18. package/dist/augmentation-generator.js.map +1 -1
  19. package/dist/auth-providers.d.ts +5 -4
  20. package/dist/auth-providers.d.ts.map +1 -1
  21. package/dist/auth-providers.js +3 -12
  22. package/dist/auth-providers.js.map +1 -1
  23. package/dist/binary-cache.d.ts +2 -1
  24. package/dist/binary-cache.d.ts.map +1 -1
  25. package/dist/binary-cache.js +2 -4
  26. package/dist/binary-cache.js.map +1 -1
  27. package/dist/build-spawn.d.ts +35 -0
  28. package/dist/build-spawn.d.ts.map +1 -0
  29. package/dist/build-spawn.js +75 -0
  30. package/dist/build-spawn.js.map +1 -0
  31. package/dist/byte-size.d.ts +9 -0
  32. package/dist/byte-size.d.ts.map +1 -0
  33. package/dist/byte-size.js +36 -0
  34. package/dist/byte-size.js.map +1 -0
  35. package/dist/cache-clean.d.ts +0 -2
  36. package/dist/cache-clean.d.ts.map +1 -1
  37. package/dist/cache-clean.js +1 -27
  38. package/dist/cache-clean.js.map +1 -1
  39. package/dist/cache-pins.d.ts.map +1 -1
  40. package/dist/cache-pins.js +1 -18
  41. package/dist/cache-pins.js.map +1 -1
  42. package/dist/cache-root.d.ts +7 -0
  43. package/dist/cache-root.d.ts.map +1 -0
  44. package/dist/cache-root.js +11 -0
  45. package/dist/cache-root.js.map +1 -0
  46. package/dist/cli-artifacts.d.ts.map +1 -1
  47. package/dist/cli-artifacts.js +2 -1
  48. package/dist/cli-artifacts.js.map +1 -1
  49. package/dist/cli-install-method.d.ts.map +1 -1
  50. package/dist/cli-install-method.js +7 -1
  51. package/dist/cli-install-method.js.map +1 -1
  52. package/dist/cli-launcher.d.ts +21 -0
  53. package/dist/cli-launcher.d.ts.map +1 -0
  54. package/dist/cli-launcher.js +112 -0
  55. package/dist/cli-launcher.js.map +1 -0
  56. package/dist/cli-old-versions.d.ts +44 -0
  57. package/dist/cli-old-versions.d.ts.map +1 -0
  58. package/dist/cli-old-versions.js +83 -0
  59. package/dist/cli-old-versions.js.map +1 -0
  60. package/dist/cli-program-path.d.ts +20 -0
  61. package/dist/cli-program-path.d.ts.map +1 -0
  62. package/dist/cli-program-path.js +41 -0
  63. package/dist/cli-program-path.js.map +1 -0
  64. package/dist/cli-standalone.d.ts +2 -3
  65. package/dist/cli-standalone.d.ts.map +1 -1
  66. package/dist/cli-standalone.js +51 -24
  67. package/dist/cli-standalone.js.map +1 -1
  68. package/dist/cli-version-embedded.js +1 -1
  69. package/dist/cli.d.ts.map +1 -1
  70. package/dist/cli.js +4 -0
  71. package/dist/cli.js.map +1 -1
  72. package/dist/cloud-credentials.d.ts.map +1 -1
  73. package/dist/cloud-credentials.js +3 -1
  74. package/dist/cloud-credentials.js.map +1 -1
  75. package/dist/commands/admin.d.ts.map +1 -1
  76. package/dist/commands/admin.js +6 -4
  77. package/dist/commands/admin.js.map +1 -1
  78. package/dist/commands/adopt.js +1 -1
  79. package/dist/commands/adopt.js.map +1 -1
  80. package/dist/commands/build.d.ts +29 -0
  81. package/dist/commands/build.d.ts.map +1 -0
  82. package/dist/commands/build.js +69 -0
  83. package/dist/commands/build.js.map +1 -0
  84. package/dist/commands/cache.d.ts.map +1 -1
  85. package/dist/commands/cache.js +37 -7
  86. package/dist/commands/cache.js.map +1 -1
  87. package/dist/commands/db.d.ts.map +1 -1
  88. package/dist/commands/db.js +46 -23
  89. package/dist/commands/db.js.map +1 -1
  90. package/dist/commands/deploy.d.ts +14 -0
  91. package/dist/commands/deploy.d.ts.map +1 -1
  92. package/dist/commands/deploy.js +68 -53
  93. package/dist/commands/deploy.js.map +1 -1
  94. package/dist/commands/dev.d.ts.map +1 -1
  95. package/dist/commands/dev.js +36 -19
  96. package/dist/commands/dev.js.map +1 -1
  97. package/dist/commands/diff.d.ts +3 -0
  98. package/dist/commands/diff.d.ts.map +1 -1
  99. package/dist/commands/diff.js +28 -34
  100. package/dist/commands/diff.js.map +1 -1
  101. package/dist/commands/doctor.d.ts +32 -0
  102. package/dist/commands/doctor.d.ts.map +1 -1
  103. package/dist/commands/doctor.js +67 -2
  104. package/dist/commands/doctor.js.map +1 -1
  105. package/dist/commands/functions.d.ts.map +1 -1
  106. package/dist/commands/functions.js +21 -16
  107. package/dist/commands/functions.js.map +1 -1
  108. package/dist/commands/hooks.d.ts.map +1 -1
  109. package/dist/commands/hooks.js +23 -15
  110. package/dist/commands/hooks.js.map +1 -1
  111. package/dist/commands/init.d.ts +33 -7
  112. package/dist/commands/init.d.ts.map +1 -1
  113. package/dist/commands/init.js +432 -333
  114. package/dist/commands/init.js.map +1 -1
  115. package/dist/commands/internal.d.ts.map +1 -1
  116. package/dist/commands/internal.js +27 -7
  117. package/dist/commands/internal.js.map +1 -1
  118. package/dist/commands/introspect.d.ts.map +1 -1
  119. package/dist/commands/introspect.js +3 -0
  120. package/dist/commands/introspect.js.map +1 -1
  121. package/dist/commands/keys-print.d.ts +20 -0
  122. package/dist/commands/keys-print.d.ts.map +1 -0
  123. package/dist/commands/keys-print.js +47 -0
  124. package/dist/commands/keys-print.js.map +1 -0
  125. package/dist/commands/keys.d.ts +10 -10
  126. package/dist/commands/keys.d.ts.map +1 -1
  127. package/dist/commands/keys.js +47 -43
  128. package/dist/commands/keys.js.map +1 -1
  129. package/dist/commands/link-helpers.d.ts.map +1 -1
  130. package/dist/commands/link-helpers.js +27 -7
  131. package/dist/commands/link-helpers.js.map +1 -1
  132. package/dist/commands/migrate.d.ts +5 -2
  133. package/dist/commands/migrate.d.ts.map +1 -1
  134. package/dist/commands/migrate.js +34 -36
  135. package/dist/commands/migrate.js.map +1 -1
  136. package/dist/commands/pull.d.ts.map +1 -1
  137. package/dist/commands/pull.js +6 -5
  138. package/dist/commands/pull.js.map +1 -1
  139. package/dist/commands/push.d.ts +2 -0
  140. package/dist/commands/push.d.ts.map +1 -1
  141. package/dist/commands/push.js +64 -26
  142. package/dist/commands/push.js.map +1 -1
  143. package/dist/commands/rename.js +1 -1
  144. package/dist/commands/rename.js.map +1 -1
  145. package/dist/commands/seed.d.ts +2 -11
  146. package/dist/commands/seed.d.ts.map +1 -1
  147. package/dist/commands/seed.js +11 -38
  148. package/dist/commands/seed.js.map +1 -1
  149. package/dist/commands/self-host.d.ts.map +1 -1
  150. package/dist/commands/self-host.js +88 -29
  151. package/dist/commands/self-host.js.map +1 -1
  152. package/dist/commands/self-update.d.ts.map +1 -1
  153. package/dist/commands/self-update.js +9 -3
  154. package/dist/commands/self-update.js.map +1 -1
  155. package/dist/commands/sso.d.ts +26 -0
  156. package/dist/commands/sso.d.ts.map +1 -0
  157. package/dist/commands/sso.js +362 -0
  158. package/dist/commands/sso.js.map +1 -0
  159. package/dist/commands/status.d.ts.map +1 -1
  160. package/dist/commands/status.js +25 -8
  161. package/dist/commands/status.js.map +1 -1
  162. package/dist/component-launch.d.ts.map +1 -1
  163. package/dist/component-launch.js +2 -1
  164. package/dist/component-launch.js.map +1 -1
  165. package/dist/compose-db-roles.d.ts +4 -4
  166. package/dist/compose-db-roles.d.ts.map +1 -1
  167. package/dist/compose-db-roles.js +11 -10
  168. package/dist/compose-db-roles.js.map +1 -1
  169. package/dist/compose-engine-run.d.ts +9 -2
  170. package/dist/compose-engine-run.d.ts.map +1 -1
  171. package/dist/compose-engine-run.js +30 -13
  172. package/dist/compose-engine-run.js.map +1 -1
  173. package/dist/compose-kong.d.ts +4 -0
  174. package/dist/compose-kong.d.ts.map +1 -1
  175. package/dist/compose-kong.js +13 -3
  176. package/dist/compose-kong.js.map +1 -1
  177. package/dist/compose-services.d.ts +18 -0
  178. package/dist/compose-services.d.ts.map +1 -1
  179. package/dist/compose-services.js +47 -22
  180. package/dist/compose-services.js.map +1 -1
  181. package/dist/config-mailer-env.d.ts +27 -0
  182. package/dist/config-mailer-env.d.ts.map +1 -0
  183. package/dist/config-mailer-env.js +47 -0
  184. package/dist/config-mailer-env.js.map +1 -0
  185. package/dist/config.d.ts +9 -1
  186. package/dist/config.d.ts.map +1 -1
  187. package/dist/config.js +18 -3
  188. package/dist/config.js.map +1 -1
  189. package/dist/database-url-owner.d.ts +5 -3
  190. package/dist/database-url-owner.d.ts.map +1 -1
  191. package/dist/database-url-owner.js +7 -4
  192. package/dist/database-url-owner.js.map +1 -1
  193. package/dist/db-port.d.ts +2 -0
  194. package/dist/db-port.d.ts.map +1 -1
  195. package/dist/db-port.js +1 -1
  196. package/dist/db-port.js.map +1 -1
  197. package/dist/db-preflight.d.ts +32 -3
  198. package/dist/db-preflight.d.ts.map +1 -1
  199. package/dist/db-preflight.js +211 -86
  200. package/dist/db-preflight.js.map +1 -1
  201. package/dist/db-rows.d.ts +3 -2
  202. package/dist/db-rows.d.ts.map +1 -1
  203. package/dist/db-rows.js +19 -4
  204. package/dist/db-rows.js.map +1 -1
  205. package/dist/dev-compose.d.ts +65 -5
  206. package/dist/dev-compose.d.ts.map +1 -1
  207. package/dist/dev-compose.js +262 -155
  208. package/dist/dev-compose.js.map +1 -1
  209. package/dist/dev-log-bus.d.ts +8 -0
  210. package/dist/dev-log-bus.d.ts.map +1 -1
  211. package/dist/dev-log-bus.js +13 -0
  212. package/dist/dev-log-bus.js.map +1 -1
  213. package/dist/dev-ports.d.ts +11 -4
  214. package/dist/dev-ports.d.ts.map +1 -1
  215. package/dist/dev-ports.js +87 -49
  216. package/dist/dev-ports.js.map +1 -1
  217. package/dist/dev-schema-watch.d.ts +8 -2
  218. package/dist/dev-schema-watch.d.ts.map +1 -1
  219. package/dist/dev-schema-watch.js +24 -13
  220. package/dist/dev-schema-watch.js.map +1 -1
  221. package/dist/dev-session.d.ts +27 -1
  222. package/dist/dev-session.d.ts.map +1 -1
  223. package/dist/dev-session.js +44 -4
  224. package/dist/dev-session.js.map +1 -1
  225. package/dist/dev-shutdown.d.ts.map +1 -1
  226. package/dist/dev-shutdown.js +19 -3
  227. package/dist/dev-shutdown.js.map +1 -1
  228. package/dist/diff-access.d.ts +10 -0
  229. package/dist/diff-access.d.ts.map +1 -0
  230. package/dist/diff-access.js +69 -0
  231. package/dist/diff-access.js.map +1 -0
  232. package/dist/diff-output.d.ts +7 -1
  233. package/dist/diff-output.d.ts.map +1 -1
  234. package/dist/diff-output.js +93 -3
  235. package/dist/diff-output.js.map +1 -1
  236. package/dist/docker-exec.d.ts.map +1 -1
  237. package/dist/docker-exec.js +4 -4
  238. package/dist/docker-exec.js.map +1 -1
  239. package/dist/docker-runtime.d.ts +10 -2
  240. package/dist/docker-runtime.d.ts.map +1 -1
  241. package/dist/docker-runtime.js +70 -23
  242. package/dist/docker-runtime.js.map +1 -1
  243. package/dist/engine-answers.d.ts +2 -1
  244. package/dist/engine-answers.d.ts.map +1 -1
  245. package/dist/engine-answers.js +11 -0
  246. package/dist/engine-answers.js.map +1 -1
  247. package/dist/engine-client.d.ts +20 -0
  248. package/dist/engine-client.d.ts.map +1 -1
  249. package/dist/engine-client.js +12 -8
  250. package/dist/engine-client.js.map +1 -1
  251. package/dist/engine-floor.d.ts +3 -2
  252. package/dist/engine-floor.d.ts.map +1 -1
  253. package/dist/engine-floor.js +2 -2
  254. package/dist/engine-floor.js.map +1 -1
  255. package/dist/engine-ownership-gate.d.ts +3 -1
  256. package/dist/engine-ownership-gate.d.ts.map +1 -1
  257. package/dist/engine-ownership-gate.js +5 -0
  258. package/dist/engine-ownership-gate.js.map +1 -1
  259. package/dist/engine-push-output.d.ts +8 -1
  260. package/dist/engine-push-output.d.ts.map +1 -1
  261. package/dist/engine-push-output.js +8 -1
  262. package/dist/engine-push-output.js.map +1 -1
  263. package/dist/env-file.d.ts +9 -2
  264. package/dist/env-file.d.ts.map +1 -1
  265. package/dist/env-file.js +56 -38
  266. package/dist/env-file.js.map +1 -1
  267. package/dist/env-lines.d.ts +3 -2
  268. package/dist/env-lines.d.ts.map +1 -1
  269. package/dist/env-lines.js +5 -2
  270. package/dist/env-lines.js.map +1 -1
  271. package/dist/env-value.d.ts +15 -0
  272. package/dist/env-value.d.ts.map +1 -0
  273. package/dist/env-value.js +34 -0
  274. package/dist/env-value.js.map +1 -0
  275. package/dist/error-message.d.ts +20 -0
  276. package/dist/error-message.d.ts.map +1 -1
  277. package/dist/error-message.js +42 -0
  278. package/dist/error-message.js.map +1 -1
  279. package/dist/frontend-env.d.ts +51 -0
  280. package/dist/frontend-env.d.ts.map +1 -0
  281. package/dist/frontend-env.js +101 -0
  282. package/dist/frontend-env.js.map +1 -0
  283. package/dist/frontend-values-linked.d.ts +22 -0
  284. package/dist/frontend-values-linked.d.ts.map +1 -0
  285. package/dist/frontend-values-linked.js +143 -0
  286. package/dist/frontend-values-linked.js.map +1 -0
  287. package/dist/frontend-values.d.ts +90 -0
  288. package/dist/frontend-values.d.ts.map +1 -0
  289. package/dist/frontend-values.js +208 -0
  290. package/dist/frontend-values.js.map +1 -0
  291. package/dist/functions-env-local.d.ts +13 -0
  292. package/dist/functions-env-local.d.ts.map +1 -0
  293. package/dist/functions-env-local.js +20 -0
  294. package/dist/functions-env-local.js.map +1 -0
  295. package/dist/generated/release-images.d.ts +4 -4
  296. package/dist/generated/release-images.js +2 -2
  297. package/dist/generated/release-images.js.map +1 -1
  298. package/dist/generated/typescript-libs.d.ts +4 -0
  299. package/dist/generated/typescript-libs.d.ts.map +1 -0
  300. package/dist/generated/typescript-libs.js +64 -0
  301. package/dist/generated/typescript-libs.js.map +1 -0
  302. package/dist/hook-actor.d.ts +17 -0
  303. package/dist/hook-actor.d.ts.map +1 -0
  304. package/dist/hook-actor.js +37 -0
  305. package/dist/hook-actor.js.map +1 -0
  306. package/dist/hook-columns.d.ts +30 -0
  307. package/dist/hook-columns.d.ts.map +1 -0
  308. package/dist/hook-columns.js +77 -0
  309. package/dist/hook-columns.js.map +1 -0
  310. package/dist/hook-events.d.ts +11 -0
  311. package/dist/hook-events.d.ts.map +1 -0
  312. package/dist/hook-events.js +11 -0
  313. package/dist/hook-events.js.map +1 -0
  314. package/dist/hooks-generator.d.ts.map +1 -1
  315. package/dist/hooks-generator.js +87 -21
  316. package/dist/hooks-generator.js.map +1 -1
  317. package/dist/host-database.d.ts +10 -10
  318. package/dist/host-database.d.ts.map +1 -1
  319. package/dist/host-database.js +18 -15
  320. package/dist/host-database.js.map +1 -1
  321. package/dist/init-answers.d.ts +18 -0
  322. package/dist/init-answers.d.ts.map +1 -0
  323. package/dist/init-answers.js +46 -0
  324. package/dist/init-answers.js.map +1 -0
  325. package/dist/init-dependency-versions.d.ts.map +1 -1
  326. package/dist/init-dependency-versions.js +11 -1
  327. package/dist/init-dependency-versions.js.map +1 -1
  328. package/dist/init-next-runtime-env.d.ts +30 -0
  329. package/dist/init-next-runtime-env.d.ts.map +1 -0
  330. package/dist/init-next-runtime-env.js +180 -0
  331. package/dist/init-next-runtime-env.js.map +1 -0
  332. package/dist/init-package-json.d.ts +38 -1
  333. package/dist/init-package-json.d.ts.map +1 -1
  334. package/dist/init-package-json.js +150 -39
  335. package/dist/init-package-json.js.map +1 -1
  336. package/dist/jwt.d.ts +5 -0
  337. package/dist/jwt.d.ts.map +1 -1
  338. package/dist/jwt.js +16 -0
  339. package/dist/jwt.js.map +1 -1
  340. package/dist/local-secrets.d.ts +22 -0
  341. package/dist/local-secrets.d.ts.map +1 -1
  342. package/dist/local-secrets.js +36 -0
  343. package/dist/local-secrets.js.map +1 -1
  344. package/dist/local-stack-guard.d.ts +37 -0
  345. package/dist/local-stack-guard.d.ts.map +1 -0
  346. package/dist/local-stack-guard.js +84 -0
  347. package/dist/local-stack-guard.js.map +1 -0
  348. package/dist/mailer-env.d.ts +4 -0
  349. package/dist/mailer-env.d.ts.map +1 -1
  350. package/dist/mailer-env.js +12 -1
  351. package/dist/mailer-env.js.map +1 -1
  352. package/dist/model-hooks.d.ts +5 -1
  353. package/dist/model-hooks.d.ts.map +1 -1
  354. package/dist/model-hooks.js +12 -2
  355. package/dist/model-hooks.js.map +1 -1
  356. package/dist/node-executable.d.ts +6 -0
  357. package/dist/node-executable.d.ts.map +1 -0
  358. package/dist/node-executable.js +43 -0
  359. package/dist/node-executable.js.map +1 -0
  360. package/dist/parent-watch.d.ts +8 -3
  361. package/dist/parent-watch.d.ts.map +1 -1
  362. package/dist/parent-watch.js +8 -3
  363. package/dist/parent-watch.js.map +1 -1
  364. package/dist/postgres-ctl.d.ts +2 -0
  365. package/dist/postgres-ctl.d.ts.map +1 -1
  366. package/dist/postgres-ctl.js +11 -5
  367. package/dist/postgres-ctl.js.map +1 -1
  368. package/dist/process-manager.d.ts +37 -5
  369. package/dist/process-manager.d.ts.map +1 -1
  370. package/dist/process-manager.js +127 -65
  371. package/dist/process-manager.js.map +1 -1
  372. package/dist/project-config.d.ts +31 -0
  373. package/dist/project-config.d.ts.map +1 -1
  374. package/dist/project-config.js +24 -0
  375. package/dist/project-config.js.map +1 -1
  376. package/dist/push-audit.d.ts +4 -1
  377. package/dist/push-audit.d.ts.map +1 -1
  378. package/dist/push-audit.js +33 -4
  379. package/dist/push-audit.js.map +1 -1
  380. package/dist/recorded-field-masking-tier.d.ts +2 -2
  381. package/dist/recorded-field-masking-tier.d.ts.map +1 -1
  382. package/dist/recorded-field-masking-tier.js +6 -6
  383. package/dist/recorded-field-masking-tier.js.map +1 -1
  384. package/dist/rename-journal.d.ts +1 -1
  385. package/dist/rename-journal.d.ts.map +1 -1
  386. package/dist/resolve-api-url.d.ts +2 -0
  387. package/dist/resolve-api-url.d.ts.map +1 -1
  388. package/dist/resolve-api-url.js +5 -1
  389. package/dist/resolve-api-url.js.map +1 -1
  390. package/dist/resolve-target.d.ts +18 -1
  391. package/dist/resolve-target.d.ts.map +1 -1
  392. package/dist/resolve-target.js +28 -16
  393. package/dist/resolve-target.js.map +1 -1
  394. package/dist/run-captured.d.ts +31 -0
  395. package/dist/run-captured.d.ts.map +1 -0
  396. package/dist/run-captured.js +36 -0
  397. package/dist/run-captured.js.map +1 -0
  398. package/dist/saml-config.d.ts +53 -0
  399. package/dist/saml-config.d.ts.map +1 -0
  400. package/dist/saml-config.js +177 -0
  401. package/dist/saml-config.js.map +1 -0
  402. package/dist/saml-key-rotation.d.ts +5 -0
  403. package/dist/saml-key-rotation.d.ts.map +1 -0
  404. package/dist/saml-key-rotation.js +26 -0
  405. package/dist/saml-key-rotation.js.map +1 -0
  406. package/dist/saml-sp-certificate.d.ts +15 -0
  407. package/dist/saml-sp-certificate.d.ts.map +1 -0
  408. package/dist/saml-sp-certificate.js +34 -0
  409. package/dist/saml-sp-certificate.js.map +1 -0
  410. package/dist/schema-reset.d.ts +41 -0
  411. package/dist/schema-reset.d.ts.map +1 -0
  412. package/dist/schema-reset.js +98 -0
  413. package/dist/schema-reset.js.map +1 -0
  414. package/dist/seed-child.d.ts +25 -0
  415. package/dist/seed-child.d.ts.map +1 -0
  416. package/dist/seed-child.js +61 -0
  417. package/dist/seed-child.js.map +1 -0
  418. package/dist/seed-runner.d.ts +3 -5
  419. package/dist/seed-runner.d.ts.map +1 -1
  420. package/dist/seed-runner.js +20 -42
  421. package/dist/seed-runner.js.map +1 -1
  422. package/dist/self-host-compose.d.ts +25 -4
  423. package/dist/self-host-compose.d.ts.map +1 -1
  424. package/dist/self-host-compose.js +108 -23
  425. package/dist/self-host-compose.js.map +1 -1
  426. package/dist/serial-runs.d.ts +7 -0
  427. package/dist/serial-runs.d.ts.map +1 -0
  428. package/dist/serial-runs.js +29 -0
  429. package/dist/serial-runs.js.map +1 -0
  430. package/dist/shell-ports.d.ts.map +1 -1
  431. package/dist/shell-ports.js +2 -8
  432. package/dist/shell-ports.js.map +1 -1
  433. package/dist/sso-admin.d.ts +114 -0
  434. package/dist/sso-admin.d.ts.map +1 -0
  435. package/dist/sso-admin.js +256 -0
  436. package/dist/sso-admin.js.map +1 -0
  437. package/dist/stack-engine.d.ts +28 -0
  438. package/dist/stack-engine.d.ts.map +1 -0
  439. package/dist/stack-engine.js +59 -0
  440. package/dist/stack-engine.js.map +1 -0
  441. package/dist/stack-exit-watch.d.ts +37 -0
  442. package/dist/stack-exit-watch.d.ts.map +1 -0
  443. package/dist/stack-exit-watch.js +70 -0
  444. package/dist/stack-exit-watch.js.map +1 -0
  445. package/dist/stack-setting-warnings.d.ts +8 -0
  446. package/dist/stack-setting-warnings.d.ts.map +1 -0
  447. package/dist/stack-setting-warnings.js +14 -0
  448. package/dist/stack-setting-warnings.js.map +1 -0
  449. package/dist/studio-dev-server.d.ts.map +1 -1
  450. package/dist/studio-dev-server.js +2 -1
  451. package/dist/studio-dev-server.js.map +1 -1
  452. package/dist/target-client.d.ts +12 -2
  453. package/dist/target-client.d.ts.map +1 -1
  454. package/dist/target-client.js +14 -1
  455. package/dist/target-client.js.map +1 -1
  456. package/dist/tsx-runner.d.ts +5 -0
  457. package/dist/tsx-runner.d.ts.map +1 -1
  458. package/dist/tsx-runner.js +18 -17
  459. package/dist/tsx-runner.js.map +1 -1
  460. package/dist/type-extractor.d.ts.map +1 -1
  461. package/dist/type-extractor.js +20 -11
  462. package/dist/type-extractor.js.map +1 -1
  463. package/dist/type-generation.d.ts +1 -1
  464. package/dist/type-generation.d.ts.map +1 -1
  465. package/dist/type-generation.js +2 -4
  466. package/dist/type-generation.js.map +1 -1
  467. package/dist/type-resolver.d.ts.map +1 -1
  468. package/dist/type-resolver.js +31 -12
  469. package/dist/type-resolver.js.map +1 -1
  470. package/dist/ui/clack-api.d.ts.map +1 -1
  471. package/dist/ui/clack-api.js +45 -23
  472. package/dist/ui/clack-api.js.map +1 -1
  473. package/dist/ui/components/LineInput.d.ts +26 -0
  474. package/dist/ui/components/LineInput.d.ts.map +1 -0
  475. package/dist/ui/components/LineInput.js +60 -0
  476. package/dist/ui/components/LineInput.js.map +1 -0
  477. package/dist/ui/dev/DevDashboard.d.ts.map +1 -1
  478. package/dist/ui/dev/DevDashboard.js +9 -3
  479. package/dist/ui/dev/DevDashboard.js.map +1 -1
  480. package/dist/ui/flows/FlowApp.d.ts +3 -1
  481. package/dist/ui/flows/FlowApp.d.ts.map +1 -1
  482. package/dist/ui/flows/FlowApp.js +14 -5
  483. package/dist/ui/flows/FlowApp.js.map +1 -1
  484. package/dist/ui/flows/prompt-fields.d.ts +14 -7
  485. package/dist/ui/flows/prompt-fields.d.ts.map +1 -1
  486. package/dist/ui/flows/prompt-fields.js +20 -12
  487. package/dist/ui/flows/prompt-fields.js.map +1 -1
  488. package/dist/ui/flows/types.d.ts +5 -1
  489. package/dist/ui/flows/types.d.ts.map +1 -1
  490. package/dist/ui/runtime/command-chrome.d.ts.map +1 -1
  491. package/dist/ui/runtime/command-chrome.js +2 -0
  492. package/dist/ui/runtime/command-chrome.js.map +1 -1
  493. package/dist/ui/runtime/flow-transcript.d.ts +17 -0
  494. package/dist/ui/runtime/flow-transcript.d.ts.map +1 -0
  495. package/dist/ui/runtime/flow-transcript.js +38 -0
  496. package/dist/ui/runtime/flow-transcript.js.map +1 -0
  497. package/dist/ui/runtime/run-clack-flow.d.ts +7 -0
  498. package/dist/ui/runtime/run-clack-flow.d.ts.map +1 -1
  499. package/dist/ui/runtime/run-clack-flow.js +131 -17
  500. package/dist/ui/runtime/run-clack-flow.js.map +1 -1
  501. package/package.json +16 -14
package/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@
4
4
 
5
5
  ### Breaking Changes
6
6
 
7
+ * **push, diff, seed and every command that reaches the local stack:** these commands no longer
8
+ start the local stack. On a Docker project with the stack stopped, `push`, `diff`, `adopt`,
9
+ `doctor`, `seed`, `migrate`, `migrations list`, `rollback`, `reset`, `introspect`, `pull` and
10
+ `admin` refuse before doing anything: "The local stack isn't running. Start it with
11
+ `supatype dev`, or `supatype self-host compose up -d` on a server, then run `supatype push`
12
+ again." (naming the command run). `seed` exits 2, the others 1. `push` used to start Postgres,
13
+ apply, then start the rest of the stack, and `diff` started Postgres and stopped it again. A
14
+ linked project, `--connection`, `connection` in the config and an external database are reached
15
+ as before, and a running stack behaves as before.
16
+ * **cache, functions:** `cache rest list`, `get`, `delete` and `flush`, and a local `functions invoke`
17
+ that no `functions serve` answers, refuse on a Docker project whose local stack is not running,
18
+ with the same message as `push` and the other commands that need the stack, naming the command
19
+ run, and exit 1. They reached the stopped stack's API and failed with `Cannot reach` or a
20
+ missing `SERVICE_ROLE_KEY`. An API address named by `SUPATYPE_URL` or `SUPATYPE_API_URL` in
21
+ `.env`, a linked project's `functions invoke`, and a native project are unaffected.
7
22
  * **schema:** a `?` on a model field (`due?: string`) is refused, naming `Model.field` and saying to
8
23
  write `Optional<>`. It read as nullable but compiled to a `NOT NULL` column.
9
24
  * **generate:** `supatype generate --connection` is refused as an unknown option. Generate writes the
@@ -15,9 +30,91 @@
15
30
  * **realtime:** the service's process entry is `dist/main.js`; `dist/index.js` only exports and no
16
31
  longer starts a server, so an `overrides.realtime` naming `packages/realtime/dist/index.js` exits
17
32
  at once. Point it at `packages/realtime/dist/main.js`.
33
+ * **hooks:** `AfterDeleteContext` has no `filter`. After-hooks are fed from the database's change log,
34
+ which records the rows a write changed rather than the request that changed them, so there is no
35
+ filter to give. `ctx.old` replaces it: the deleted rows themselves, as they were. A handler reading
36
+ `ctx.filter` in an `afterDelete` no longer compiles; read `ctx.old` instead.
18
37
 
19
38
  ### Features
20
39
 
40
+ * **auth:** SAML single sign-on can be turned on from the config: `auth: { sso: { saml: { enabled: true } } }`,
41
+ with optional `allowEncryptedAssertions`, `relayStateValidity` (seconds), `rateLimitAssertion`
42
+ (assertions per 5 minutes) and `externalUrl`. `dev`, native `dev` and `self-host compose` pass the
43
+ `SUPATYPE_SAML_*` settings to the auth server, a `.env` value winning over each, and nothing while
44
+ SAML is off. The service provider's signing key is generated into `.env` as
45
+ `SUPATYPE_SAML_PRIVATE_KEY` (RSA 2048) the first time SAML is on and never replaced, since a new
46
+ key breaks every identity provider that trusts the old certificate. The compose file requires it
47
+ from `.env` and never holds it. A key written into the config is refused.
48
+ * **sso:** `supatype sso add <name>`, `list`, `show`, `update` and `remove` register SAML identity
49
+ providers (metadata URL or file, email domains, attribute mapping, NameID format) through the auth
50
+ server's admin API, on the local stack or a linked self-hosted deployment. A provider is addressed
51
+ by its name, stored as `resource_id`, and `update` changes it in place: deleting and adding a
52
+ provider again would leave every user who signed in through it without a way back in. `update`
53
+ keeps the NameID format unless told to change it. `add` warns when SAML is off.
54
+ * **sso:** `supatype sso info` prints the values an identity provider asks for: entity ID and
55
+ metadata URL, ACS URL, NameID formats, the `subject-id` attribute preferred to the NameID, and a
56
+ link to download the metadata XML.
57
+ * **sso:** `supatype sso rotate-key` writes `SUPATYPE_SAML_NEXT_PRIVATE_KEY` into `.env`, which the
58
+ server publishes beside the current key while identity providers take the new certificate;
59
+ `supatype sso rotate-key --promote` then makes it the current key, after saying what stops working
60
+ for an identity provider that has not updated. For a linked deployment it prints the steps to take
61
+ on the server.
62
+ * **sso:** `supatype sso verify-domain <name> <domain>` proves the project owns one of a provider's
63
+ domains: it prints the DNS TXT record to add (`_supatype-challenge.<domain>` and its token), asks
64
+ the auth server to check it, and says whether the domain is verified or what DNS answered instead,
65
+ exiting 1 until it is. Running it again checks again. `sso show` and `sso list` mark each domain
66
+ verified or not. On a dev stack a domain ending in `.supatype.test` counts as verified with no DNS
67
+ lookup.
68
+ * **self-host:** `supatype self-host compose up -d` creates the storage buckets the schema declares
69
+ and the first admin user once the stack answers, as `supatype dev` and a push to a running stack
70
+ do. A push no longer starts a stopped stack, so nothing else would have made them. A failure there
71
+ is a warning: the stack is up.
72
+ * **init:** a static app's `index.html` (and the page Vite builds it from) loads
73
+ `<script src="/supatype-env.js" vite-ignore></script>` in its head, so the built site takes the address and
74
+ anon key of whichever deployment serves it. Only where the committed config serves the app's
75
+ files; a proxied app's page is left as it was.
76
+ * **init:** in a Next.js App Router app, init writes `app/supatype-env.js/route.ts` (or under
77
+ `src/app`, and `route.js` without a `tsconfig.json`), which serves `/supatype-env.js` from
78
+ `@supatype/ssr/next` with the running server's `SUPATYPE_URL` and `SUPATYPE_ANON_KEY`, adds
79
+ `@supatype/ssr` to the app's dependencies, and loads the script first in the root layout's
80
+ `<body>` with `next/script`'s `beforeInteractive`. One `next build` then runs against any
81
+ deployment. A route or layout that already has it is left alone; a layout init cannot edit
82
+ safely (no single `<body>`, or a `Script` that is not `next/script`) is left as it is, and the two
83
+ lines to add are printed. A Pages Router app gets nothing written and the steps printed. A static
84
+ export (`output: "export"` in `next.config`, read as text) gets neither the route nor the script,
85
+ since `next build` cannot export a dynamic route; init says to build it with
86
+ `supatype build -- next build`, or to let Supatype hosting serve it.
87
+ * **dev, init, keys:** a local stack's values in `.env.development.local` now include
88
+ `SUPATYPE_URL` and `SUPATYPE_ANON_KEY` beside the frontend copies, so a Next.js app's
89
+ `/supatype-env.js` route and its server client find them in `next dev` instead of refusing with 503.
90
+ A deployment's values in `.env` still get only the frontend names. The CLI never loads
91
+ `.env.development.local` into its own environment, so `supatype build` does not take these as
92
+ values the host set.
93
+ * **client:** the generated client takes `url` and `anonKey` as `string | undefined` and, for one
94
+ missing, reads the page's `window.__SUPATYPE_ENV__` at its first request; with neither, that
95
+ request throws naming the variables to set, `supatype build` and the Next.js route, instead of
96
+ sending requests the gateway refuses. Creating the client never throws, so `next build` can
97
+ prerender a page that creates one at module scope.
98
+ * **diff:** every `supatype diff` ends with what `anon` (signed out) and `authenticated` (signed
99
+ in) may do on each model's table once the push applies, one line per table (`question read`,
100
+ `profile none`). A line the push changes shows what it is now as well
101
+ (`question none -> read`). The engine grants `anon` a privilege only where it can prove the rule
102
+ needs no login, so a rule meant to be public that leaves signed-out callers with `401 42501` is
103
+ seen before the push (issue 16). Printed also when there are no changes; an engine older than the
104
+ summary prints no block. Many-to-many junction tables are listed too, as `post_tags (link)`, and
105
+ a link whose end reads it through its own read rule says what it denies and why
106
+ (`none (read denied: an end's read rule reads this link table)`).
107
+
108
+ * **push:** prints the same access block before it applies or asks to confirm, in a terminal and
109
+ with `--yes` alike.
110
+
111
+ * **dev:** after a push applies, prints the access lines it changed (`question none -> read`),
112
+ and nothing when no line changed.
113
+
114
+ * **push:** `--run-hooks` fires after-hooks for the rows a push's own data migrations rewrite (column
115
+ conversions, block moves, kind changes). Without it they are skipped, as seeds are. Against an
116
+ engine whose capabilities do not list `run_hooks`, the push stops before anything is sent.
117
+
21
118
  * **init:** `supatype init <dir> --example <name>` starts from `examples/<name>` of the release
22
119
  matching the CLI (`v<version>` on GitHub), with every `workspace:` dependency pinned to
23
120
  `^<version>`. An unknown name is refused with the list of examples in that release, and so is an
@@ -58,9 +155,316 @@
58
155
  generates a secret when the shell's is unusable, and never exits mid-wizard over the keys.
59
156
  * **keys, dev:** `NEXT_PUBLIC_SUPATYPE_ANON_KEY` is written beside the `VITE_`, `PUBLIC_` and
60
157
  `EXPO_PUBLIC_` copies, and `NEXT_PUBLIC_SUPATYPE_URL` wherever the other URL copies are.
158
+ * **build:** `supatype build [--env <name>] [--allow-local] [-- <command...>]` runs the app's
159
+ production build (the package.json `build` script through the project's package manager, or the
160
+ command after `--`) with the deployment's API URL and anon key under every front-end name
161
+ (`VITE_`, `PUBLIC_`, `NEXT_PUBLIC_`, `EXPO_PUBLIC_`). Each value comes from the first of: the
162
+ environment (any of those names, or `SUPATYPE_URL` / `SUPATYPE_ANON_KEY`), so a host's own
163
+ settings win; for the anon key alone, the `/supatype-env.json` of the server the environment's
164
+ URL names, for CI that sets only the URL; the linked environment (Supatype Cloud's keys route, or
165
+ a self-hosted server's `/supatype-env.json`); a `.env` recording a deployment
166
+ (`PUBLIC_SUPATYPE_URL` or `API_EXTERNAL_URL`, and `ANON_KEY`). A server's address is fetched over
167
+ HTTPS only, unless it is local. A 404 there is reported as the address switched off
168
+ (`server.public_env: false`), and a 503 as a server not set up to publish its anon key, quoting
169
+ its reason on one line with anything shaped like a JWT withheld. An anon key from the link, a server or `.env` goes into the build
170
+ only when it is for the same deployment as the URL (compared by scheme, host and port, ignoring a
171
+ trailing slash and `/auth/v1`); otherwise the refusal says whose it is. The build does not start when either is missing, or when the address is local
172
+ unless `--allow-local` is passed, and the refusal lists every source it tried. Nothing is written
173
+ to a file, the service role key is never given to the build, and the exit code is the build's
174
+ own. A bare `supatype build` run from inside one (a package.json `"build": "supatype build"`) is
175
+ refused rather than running the build script again without end; a command after `--` still runs.
176
+ * **keys:** `supatype keys --print frontend [--env <name>] [--allow-local]` prints those same
177
+ front-end names and values as `NAME=value` lines, and nothing else on stdout, for a host's
178
+ settings or `$GITHUB_ENV`. Bare `--print` still prints the key pair. An unknown target is refused,
179
+ listing the valid ones, and `--env` or `--allow-local` without `--print frontend` is refused.
180
+ `keys --help` states the `--exp-years` default once.
181
+ * **config:** `server.public_env: false` renders `SUPATYPE_PUBLIC_ENV=false` into the server (self-host
182
+ and dev compose, and native dev), turning off its `/supatype-env.json` and `/supatype-env.js` for
183
+ an API-only project. Absent, the server's default (on) applies. A value that is not a boolean is
184
+ refused.
185
+ * **init:** the "When you're ready to deploy" steps build the app with `supatype build --env
186
+ production` once the deployment is linked, for Supatype Cloud and self-host.
61
187
 
62
188
  ### Bug Fixes
63
189
 
190
+ * **dev:** a save made by writing another file and renaming it over the schema is pushed. `sed -i`
191
+ saves were always missed on Linux, and an editor's safe write or a script's `mv` about one time in
192
+ three: the event named only the other file, which the watch ignored, so the database kept the old
193
+ schema and nothing said so. Any event in the schema folder now leads to a check of the schema
194
+ itself.
195
+ * **init, self-host compose, dev:** every project gets its own object-store login, generated into
196
+ `.env` as `SUPATYPE_OBJECT_STORE_ACCESS_KEY` and `SUPATYPE_OBJECT_STORE_SECRET_KEY`, and the compose
197
+ file reads it from there. Every stack shared the published pair `supatype` / `supatype-secret`,
198
+ which opens every file in every bucket past the bucket rules to anything that can reach port 8333.
199
+ A project still on that pair gets a new one on its next `dev` or `self-host compose up`; stored
200
+ files are kept.
201
+ * **self-host compose up and restart:** the mailer settings come from the committed config. `dev`
202
+ wrote them into `.env` from the config with `supatype.local.config.ts` over it, so production
203
+ started with dev's mail catcher as its SMTP host, and with dev's last autoconfirm after the config
204
+ turned email confirmations on. Values the CLI writes from the config are marked as its own and taken
205
+ out when the config stops giving them; a value written by hand is left.
206
+ * **init:** choosing SMTP asks for the host and port. `dev` and `self-host compose up` warn when the
207
+ provider is SMTP and no host is set, which made the server drop every email without a word.
208
+ * **functions new, functions env set:** `functions env set` in a project with no `functions/` folder
209
+ creates it, where it said "Setting FOO" and then failed with ENOENT. `init`, `functions new` and
210
+ `env set` create `functions/.env.local` the same way.
211
+ * **status:** on the local stack, the stack's services are listed after its functions, and `_shared`
212
+ is no longer listed as a function. The database line is the address a program on this machine
213
+ connects to, with the password shown as `***`, as `seed --status` shows it.
214
+ * **self-host compose up, every command in a terminal:** docker's output no longer goes straight to
215
+ the terminal while a command's screen is up. It landed in the screen being redrawn, and the notices
216
+ above it came out twice. It is kept and shown when docker fails, and what docker prints as its
217
+ answer, `ps`'s table say, goes into the command's log.
218
+ * **push, every command in a terminal:** a spinner's line stays above the lines its work logs.
219
+ `push` printed "Schema pushed." above "Applying schema via Docker Compose".
220
+ * **init:** the closing list of the secrets it generated names the object store's login.
221
+ * **login:** the saved Cloud session is created readable by its owner alone (600). It holds the
222
+ session's tokens. A project's `.env` is not: the stack's containers read it as another user, and an
223
+ owner-only `.env` stopped the server starting on a Linux host.
224
+ * **migrations list:** a push by an OS user with no git name says "(unverified)" once. The recorded
225
+ author now reads `nic (OS user)`, and the list adds whether it was verified.
226
+ * **every command in a terminal:** what a command logged stays on screen when it ends, once. The
227
+ command's chrome was cleared at the end and a short report went with it: `seed --status` showed
228
+ nothing in a terminal, only when piped. The last frame is now just the logged lines, and it is left
229
+ on screen.
230
+ * **every command in a terminal:** a command that fails and exits shows why. `types check` in a
231
+ project with no `tsconfig.json` printed its banner and exited 1 with no message, because the
232
+ process ended before the message was drawn.
233
+ * **every text prompt:** a pasted line that ends in a line break is submitted, where the break was
234
+ kept in the answer and drawn raw over the prompt's border. Backspaces sent in one burst erase.
235
+ * **reset:** drops the managed tables, applies the schema to the empty tables and runs the seeds
236
+ again, which `--no-seed` skips. It printed "Reset complete." and changed nothing: it pushed the
237
+ schema the database already had. Sign-ins, stored files, Studio members and SSO providers are kept;
238
+ `dev --reset-db` still wipes the whole database.
239
+ * **migrate, reset, rollback, migrations list, rename --prune, pull, deploy --local:** on the local
240
+ stack's own database these run the project's engine image, as `push`, `diff` and `seed` do. They
241
+ ran the engine binary cached on this machine, so with an engine image chosen, `migrate` wrote SQL
242
+ from the released engine that `push` no longer ran. A `--connection` to another database still
243
+ runs the binary here.
244
+ * **seed:** `supatype seed` and `npm run seed` work from the standalone binary on Windows. Every
245
+ seed file failed with "Cannot find module 'B:\~BUN\root\seed-ir.js'": the seed ran from a temp
246
+ file that could not import the CLI's own modules out of the binary. The binary now collects a
247
+ seed by running itself, as it already does to read the config. It also resolves packages from the
248
+ project's node_modules, which it could not do at all, so a seed builder's `@supatype/cli/seed`
249
+ import is found.
250
+ * **init:** a Kong port typed that another running Supatype stack holds gets one reason at every
251
+ prompt, "Port N is in use by another Supatype stack configured with it.". The first prompt said
252
+ it was configured for another stack and the next said it was in use on this machine.
253
+ * **envs:** `envs list` says when the default environment is not linked, and how to link it:
254
+ "Default: production (from supatype.config.ts environments, not linked: run supatype link --env
255
+ production)". No environment was starred and nothing said why.
256
+ * **sso:** `supatype sso info` prints the signing certificate from the server's own metadata. It
257
+ said "it lists no certificate" because it only read a `<X509Certificate>` with nothing after the
258
+ name, and the server writes `<X509Certificate xmlns="...">`.
259
+ * **init:** the reasons around the Kong port prompt can be read. A port typed that is in use is
260
+ asked for again with the reason above the question, and a port only a stopped Supatype stack is
261
+ configured with is taken only after a yes to "Use it anyway?". Both were logged between prompts,
262
+ and the next prompt's redraw wiped them before anyone could read them.
263
+ * **self-host:** `supatype self-host compose up` checks the ports the stack publishes before it
264
+ starts anything, and names the port, the service and how to see what holds it. Docker used to fail
265
+ on the port after starting some containers. A stack whose gateway never answers is now reported as
266
+ "started but is not serving", with exit 1; it said "The stack is up" and exited 0.
267
+ * **envs:** `supatype envs list` names the default commands actually use, and says when it comes
268
+ from `environments` in supatype.config.ts, which wins over `envs use`. `envs use` says so too when
269
+ the config names another environment, rather than "Default environment set". A command refused for
270
+ an environment that is not linked says when the config named it.
271
+ * **pull:** `supatype pull` no longer hangs at "Introspecting database...". The engine reads its
272
+ input from stdin when it is not given an input file, `introspect` is given none, and the CLI left
273
+ the engine's stdin open with nothing written to it. Every program the CLI runs for its output,
274
+ the host engine and each `docker` call (so the engine run by `compose run`), now gets a closed
275
+ stdin after any input it is sent.
276
+ * **adopt, doctor, pull and every command that reaches the local stack's database:** on a running
277
+ stack whose `db` container was stopped on its own, these refuse with the "local stack isn't
278
+ running" message, as `diff` and `push` do, and leave it stopped. `adopt` and `doctor` ran the
279
+ engine with `docker compose run`, which started `db` as its dependency, so `adopt` answered
280
+ "Nothing to adopt" with the database running again; `pull` went on to the stopped database and
281
+ printed nothing.
282
+ * **db check:** `supatype db check` in a project reads DATABASE_URL from the project's `.env`, as
283
+ every other command does; with only `.env` naming the database it said "No connection". It is for
284
+ a Postgres the project does not run, so a stopped local stack is no reason to refuse it. A refused
285
+ connection names the address it tried, never the password, and says to check that the database
286
+ is running and that the source of the URL names the right host and port; it printed only
287
+ `connect ECONNREFUSED 127.0.0.1:54329`. The `push` check of a database Supatype does not run,
288
+ and `doctor`'s after-hooks check, say it the same way.
289
+ * **dev:** on Windows, `supatype dev` no longer stops itself two seconds after starting in a shell
290
+ whose own parent had already exited (a window opened by `Start-Process`, by `start` from a script,
291
+ or by a terminal launcher that exits). It watches the shell's parent too, and counted one that was
292
+ gone from the start as the process that started dev exiting. Only an ancestor alive when dev
293
+ started counts now, so dev still stops when the script or agent that started it is killed.
294
+ * **dev:** the dashboard's `supatype` pane shows what a save did, as `dev --stream` prints it: the
295
+ change detected, applied or failed (with its hints), the access lines the save changed, and the
296
+ generated files written. It stayed at "Services running." through every save: the renderer took
297
+ the console over once the dashboard was drawn, and the pane's filter dropped the access lines
298
+ besides.
299
+
300
+ * **dev, push:** a stack service that exits while the CLI waits for the API gateway stops the wait.
301
+ With the server container exited on a fatal config error, `supatype dev` sat at `Waiting for API
302
+ gateway...` for 120 s, failed naming the gateway's health, and then removed the containers, so
303
+ the server's log was gone. The wait now watches `db`, `kong`, `server`, `realtime` and `storage`:
304
+ once one has exited it says which, with its exit code, and prints its last 30 log lines with the
305
+ project's secrets from `.env` and any connection string's password replaced by `***`, before the
306
+ stack is taken down. Either failure now ends dev's dashboard before printing, so what it prints
307
+ reaches the terminal.
308
+ * **init:** the admin email must be one address (an `@`, no spaces), and no answer init asks for,
309
+ typed or given as `--admin-email` or `--admin-password`, may hold a line break or other control
310
+ character. A pasted email with carriage returns in it went into `.env` as it was, so the server
311
+ read each piece as a line of its own, refused to start, and printed the lines that followed in its
312
+ log, the admin password among them. Init now refuses it before writing any file.
313
+ * **env files:** no command writes a value with a line break or other control character into `.env`,
314
+ `.env.development.local` or the functions' `.env.local`. It is refused, naming the key and the file
315
+ and never the value, and the file is left as it was.
316
+ * **init:** the runtime env script init puts in `index.html` carries `vite-ignore`, so `vite build`
317
+ no longer warns, on every build, `<script src="/supatype-env.js"> in "/index.html" can't be
318
+ bundled without type="module" attribute`. Vite leaves the tag in the built page, without the
319
+ attribute, and it still runs before the app's own script. A page init wrote before keeps its tag
320
+ and its warning until `vite-ignore` is added by hand.
321
+ * **build:** a server that answers 404 at `/supatype-env.json` is reported as having
322
+ `server.public_env` set to false or running a release too old to serve it, in place of "or is
323
+ older than the address".
324
+ * **dev, push, self-host:** a project that does not pin its own versions now runs schema-engine
325
+ v0.9.0 and server v2.3.0. The 0.9.0 CLI shipped still pinned to engine v0.8.0 and server v2.2.2,
326
+ so it missed four fixes those releases carry. An access rule built on
327
+ `In<"col", Rows<"table", "id", Where>>` with a login-free `Where` now grants `anon` the privilege
328
+ its policy needs, where an anonymous read or insert answered `401 42501 permission denied`.
329
+ `Default<JSON<string[]>, "[]">` now gives the column its default, where it created `jsonb NOT
330
+ NULL` with none and an insert that left it out failed with `23502`. A missing file with an
331
+ extension, such as `/assets/missing-abc.js`, answers `404`, not the app's `index.html` with
332
+ `200 text/html`. A signup with a password but no email or phone answers `400 validation_failed`,
333
+ not `anonymous_provider_disabled`, and never creates an anonymous user that drops the password.
334
+ The next push on an existing project adds the missing grants and defaults.
335
+ * **dev, init, keys:** the front end's copies of the API address and the anon key
336
+ (`VITE_SUPATYPE_URL`, `VITE_SUPATYPE_ANON_KEY` and their `PUBLIC_`, `NEXT_PUBLIC_` and
337
+ `EXPO_PUBLIC_` twins) for a local stack are written to `.env.development.local`, not `.env` or
338
+ `.env.local`, and removed from those two files. A production build read the local stack's
339
+ `http://localhost:<port>` address and key from `.env` and shipped them. A production build now
340
+ reads no anon key unless one is set for it: `supatype keys` writes the copies to `.env` only when
341
+ `.env` records a non-local `PUBLIC_SUPATYPE_URL` or `API_EXTERNAL_URL`, and `self-host compose
342
+ up` writes only `ANON_KEY` and `SERVICE_ROLE_KEY`. Shipped in 0.9.0 without an entry here.
343
+ * **init:** the `.gitignore` init writes no longer ignores `src/lib/supatype.ts` or
344
+ `src/types/supatype.d.ts`. Nothing has generated either path for some time, and apps write their
345
+ own client to `src/lib/supatype.ts`, so a commit left the client out without a word and a fresh
346
+ clone did not build. A project made by an earlier init still has the two lines under
347
+ `# Generated by supatype push (legacy paths...)`; delete them and `git add` the client.
348
+ * **diff:** `supatype diff` and `supatype push` against a local stack that is not running say
349
+ `Could not connect to http://localhost:<port>/platform/v1/...: connection refused. The local stack
350
+ is not running: start it with supatype dev, then run this again.` The compiled CLI said only
351
+ `Unable to connect. Is the computer able to access the url?` and the npm one `fetch failed`,
352
+ naming neither the address nor the fix. A linked server that refuses the connection is named the
353
+ same way, without the `supatype dev` advice. `supatype functions invoke` says `Cannot reach <url>`
354
+ under the compiled CLI too; it printed Bun's words instead.
355
+ * **dev:** stopping `supatype dev` no longer says `Docker is installed but the daemon is not
356
+ running` while Docker is up. The shutdown's `docker compose down` first asked the daemon whether
357
+ it was running, giving `docker info` 15 s; a Docker busy enough to be slower than that was
358
+ reported as stopped, and dev exited before `down` ran, leaving the exit hook's fallback to stop
359
+ the stack. Stopping a stack that was just running no longer asks: `down` runs at once, and says
360
+ so itself if Docker really is gone.
361
+ * **diff, push, dev, self-host:** a Docker that is slow to answer is no longer reported as not
362
+ running. `supatype diff`, straight after one that failed on a port clash, said `Docker is
363
+ installed but the daemon is not running` with `Docker did not answer within 15s`, while `docker
364
+ info` answered in under a second. A check that times out is now asked once more, and if Docker is
365
+ still silent the CLI says `Docker did not answer in time` and that it may be busy. "Not running"
366
+ is said only when the docker CLI reports it cannot connect; a paused Docker Desktop is called
367
+ paused, and any other `docker info` failure is shown as Docker printed it.
368
+ * **dev:** a proxy app whose start script is `vite` starts again. The compiled program ran
369
+ `vite.js` with itself rather than Node, so the app task exited with `error: unknown command
370
+ '<app>/node_modules/vite/bin/vite.js'`, was restarted for the rest of the session, and every app
371
+ route answered 502. `vite.js` for the app and for `overrides.studio`, and a `.js` entry named by
372
+ `overrides.realtime` or `overrides.storage`, now run with the `node` on PATH; with none there,
373
+ dev stops and says Node.js is needed. The dev log names the program it runs, where it used to
374
+ say `node vite.js` whatever ran (#28).
375
+ * **generate:** a `JSON<T>` column is typed as its `T` again in the generated types, augmentation
376
+ and client, as it was in 0.8.0. Since 0.9.0, npm runs the compiled CLI, which carried none of
377
+ TypeScript's lib files, so the schema reader knew no `Array` or `Record`: `JSON<string[]>` was
378
+ written as `{}` and `JSON<Record<string, number>>` as `Json`. The CLI now carries those files
379
+ (#27).
380
+ * **dev:** the dashboard's `app` pane shows the proxy app's output whole. A line that reached the
381
+ CLI in two reads was shown as two lines, a CRLF line kept its carriage return, and a line printed
382
+ twice in a row was dropped the second time, so repeated request errors showed once. An app that
383
+ crashed on every start showed its error after the first crash only, followed by nothing but
384
+ `process exited ... restarting` lines: each restart's identical error was taken for a repeat of
385
+ the run before. The same applies to Studio, realtime and the other processes dev runs, and to
386
+ `--stream`, where each line is written once.
387
+
388
+ Freeing the proxy app's port no longer freezes the dashboard. The port scan ran synchronously
389
+ before the app's first start and before every restart, and on Windows it took over ten seconds,
390
+ during which no process's output appeared. It now runs in the background, and the app is still
391
+ spawned only once the stale listener is killed. The scan also matches only a listener on exactly
392
+ the app's port: on Windows it also killed listeners on longer ports that started with the same
393
+ digits (5285 matched 52851), and on macOS and Linux it killed every process connected to the
394
+ port, a browser on the dev server included.
395
+ * **deploy:** the app's build is given the deployment's anon key, through the resolver `supatype
396
+ build` uses. It got the URL copies only, and those from the control plane's address rather than
397
+ the project's, so a deployed app rendered a blank page. A deploy whose build would get no URL or
398
+ anon key now stops before building, listing what it tried (`--allow-local` takes a local
399
+ address). The install and build steps run through cmd.exe on Windows, where `npm` and `pnpm` could
400
+ not be started without it.
401
+
402
+ * **init, dev:** Windows no longer asks to let `supatype` through its firewall. Checking whether a
403
+ port was free bound it on every address (`0.0.0.0`), which Windows treats as a program wanting
404
+ network access, and it remembers the answer per program file, so it asked again after every CLI
405
+ upgrade. The check now binds loopback only and connects to the port, which still finds a
406
+ listener on every address, the kind Docker Compose publishes.
407
+ * **npm, install:** the compiled `supatype` program no longer reads `.env`, `.env.local`,
408
+ `.env.development.local` or `bunfig.toml` from the directory it runs in. It loaded the project's
409
+ files into its own environment, which the CLI under Node never did, so the project's
410
+ `SERVICE_ROLE_KEY` sent `diff` and `push` to a local stack's API instead of its database, and a
411
+ `bunfig.toml` `preload` ran its code inside the CLI. The CLI reads the files it needs itself.
412
+ * **dev:** saving the schema no longer freezes the dev dashboard while the push runs. The engine's
413
+ push, its `parse` and `admin` runs, the compose engine run on a docker project, and the two `psql`
414
+ calls a docker push makes after it (the `auth.users` grant and reading the field-masking tier)
415
+ were all synchronous, so for as long as a push took no process's output appeared and the
416
+ dashboard did not redraw. They now run in the background, and so does asking git who is
417
+ pushing. Native dev also pushes one save at a time, as docker dev already did: a save made during
418
+ a push is pushed once that push is done. Every command that runs the engine runs it the same
419
+ way, with the same results and errors.
420
+
421
+ * **npm:** the CLI works in an app that installs React 19. npm hoisted the CLI's `ink` into the
422
+ app's `node_modules`, where it loaded the app's React rather than the CLI's own React 18, and
423
+ every command failed with `Cannot read properties of undefined (reading 'ReactCurrentOwner')`.
424
+ So did `npm install`, through the scaffold's `prepare: supatype generate`. Installed from npm,
425
+ `supatype` now runs the same signed program the curl and Homebrew installs run, which carries its
426
+ own copy of everything it uses. The first run of each version downloads it from
427
+ releases.supatype.com into `~/.supatype/cache/cli/<version>/`, checked against the release's
428
+ signed checksums; set `SUPATYPE_CDN_BASE` to use a mirror. The package no longer installs `ink`,
429
+ `react`, `commander`, `ts-morph`, `tsx` or `bcryptjs` into the app. Linux, macOS (x64, arm64)
430
+ and Windows x64 are supported; anything else is refused with the list.
431
+ * **self-update:** run by the npm package, `self-update` says to update with npm instead of
432
+ replacing the program the package starts.
433
+ * **cache:** upgrading an npm install leaves the previous version's program in the cache, since
434
+ another project may still use it. Once those take more than 250 MB the CLI says so when it
435
+ starts, at most once a day, and `supatype cache clean` (or `cache clean cli`) removes them,
436
+ never the running version.
437
+ * **init:** new projects no longer install `tsx`. The CLI runs the project's TypeScript itself.
438
+ * **init:** a project installs for production. Its `prepare` ran `supatype generate`, which npm
439
+ runs on `npm ci --omit=dev` too, where the CLI (a development dependency) is not installed, so
440
+ every production install failed with `supatype: not found`. `prepare` is now
441
+ `supatype-prepare`, a command `@supatype/client` installs, which runs `generate` only where the
442
+ CLI is installed, as Prisma's client does with the Prisma CLI. A failing `generate` still fails
443
+ the install. Existing projects `init` is merged into get the same script, and their
444
+ `@supatype/client` is moved into `dependencies` and raised to a release that has the command.
445
+ `init` never picks a client older than itself, and replaces the `prepare` earlier releases
446
+ wrote. A project made before this release keeps that `prepare` until then: set it to
447
+ `supatype-prepare`, and upgrade `@supatype/client` to this release, the first with that command,
448
+ listed in `dependencies`.
449
+ * **dev:** a Ctrl+C sent to the npm package's process alone, as an IDE's stop button sends it, stops
450
+ dev on Linux and macOS, where the starter passes every stop signal on. dev counts the same signal
451
+ twice within half a second as one press, since a Ctrl+C typed in the terminal reaches it both
452
+ from the terminal and from the starter; pressing again to force quit still does.
453
+ * **dev:** one Ctrl+C stops `supatype dev`. Ink took the first one itself and closed the dashboard
454
+ and nothing else, so dev went on running with no screen until a second Ctrl+C.
455
+ * **dev:** the dashboard names what it is waiting on, with a spinner: starting Postgres, applying
456
+ the schema, starting the services (the first start downloads their images), waiting for the
457
+ gateway. It showed the logo over an idle log, sometimes for minutes. Starting the Compose stack
458
+ no longer blocks the screen, so the spinner keeps turning while images download.
459
+ * **init:** a Vite app gets `vite: ^8`, which current `@vitejs/plugin-react` requires (`^6` failed
460
+ the install with ERESOLVE), and a `build: vite build` script, without which nothing produced the
461
+ `./dist` that `app.static_dir` serves. A new project's package.json has `"version": "0.1.0"`.
462
+ * **init:** `.env`'s `SITE_URL`, where auth emails send people back to, is the address a static or
463
+ proxied app is served on (the gateway's port on Docker). It was `http://localhost:3000` for every
464
+ project, where nothing listened.
465
+ * **init:** in an existing package.json, `@supatype/cli` and `@supatype/types` go in
466
+ `devDependencies` as they do for a new project, and the `seed` script runs `supatype seed`. It ran
467
+ `tsx seed.ts`, which loads the seed module without calling it.
64
468
  * **functions serve:** a project with `functions/.env.local` serves again. The file was handed to
65
469
  Deno as `--env-file <path>`, two arguments, and Deno takes the value only after `=`, so it ran
66
470
  `.env.local` as the script and served nothing. `functions new` creates that file, so every project
@@ -257,6 +661,17 @@
257
661
  * **init:** `supatype init` uses an exported `SUPATYPE_KONG_PORT` as the project's gateway port, in
258
662
  `.env` and in what it prints, and the wizard does not ask for one. It chose its own port, so `.env`
259
663
  and the "API on" line named a port the stack, which binds the shell's, never listened on.
664
+ * **push:** a Docker push that applied the schema exits 0 when a step after it fails on the running
665
+ stack (its `up -d`, the gateway wait, the buckets or the first admin), warning `The schema was
666
+ applied, but a step after it failed` with the reason. A start that failed on a port another
667
+ program held made push exit 1 with the schema in.
668
+ * **push, diff, adopt, pull:** on a running stack these no longer run `docker compose up -d db`
669
+ before they reach its database. Every layout already publishes Postgres on the port the host
670
+ engine connects to, so the call had nothing to start, and could recreate the database container
671
+ when its definition had changed; with `overrides.engine` on a dev stack it could also move the dev
672
+ database port under a running database first. A running stack whose `db`
673
+ container has stopped is now refused with the "local stack isn't running" message rather than
674
+ having its database started.
260
675
 
261
676
 
262
677
  ## 0.7.0
package/bin/supatype.js CHANGED
@@ -2,7 +2,22 @@
2
2
  import { existsSync } from "node:fs"
3
3
  import { fileURLToPath } from "node:url"
4
4
 
5
- const cli = new URL("../dist/cli.js", import.meta.url)
5
+ // Installed from npm, this file sits under a `node_modules` directory and starts the compiled
6
+ // program for this machine (dist/cli-launcher.js says why). In the monorepo it runs the CLI's
7
+ // JavaScript, which is what the CLI's own tests and a workspace link exercise. Node reports this
8
+ // file's real path, so a workspace package linked into an app's node_modules still counts as the
9
+ // monorepo. A copy kept outside node_modules (Deno's npm cache, a vendored copy) counts as installed
10
+ // too: the JavaScript's own dependencies are development-only, so it could not run there.
11
+ function hasJavaScriptDependencies() {
12
+ try {
13
+ import.meta.resolve("commander")
14
+ return true
15
+ } catch {
16
+ return false
17
+ }
18
+ }
19
+ const installed = fileURLToPath(import.meta.url).split(/[\\/]/).includes("node_modules") || !hasJavaScriptDependencies()
20
+ const cli = new URL(installed ? "../dist/cli-launcher.js" : "../dist/cli.js", import.meta.url)
6
21
 
7
22
  // A fresh clone of the monorepo has no dist until its first build. Only that case gets the hint:
8
23
  // a module missing from inside a built dist is reported as it is.
@@ -0,0 +1,19 @@
1
+ /** Where doctor sends someone whose after-hooks are on the request path. */
2
+ export declare const DB_CHECK_HINT = " See what to change with: supatype db check";
3
+ /** `components.after_hooks`, as the server's `changelog.Status` writes it. */
4
+ export interface AfterHooksHealth {
5
+ path: "changelog" | "request" | "unknown";
6
+ slot: string;
7
+ reason?: string;
8
+ role?: string;
9
+ retained_wal_bytes?: number;
10
+ last_error?: string;
11
+ }
12
+ /**
13
+ * The server's after-hook status from the stack at `stackUrl`, or undefined when nothing answers,
14
+ * the answer is not JSON, or the server predates the listener and reports no `after_hooks`.
15
+ */
16
+ export declare function readAfterHooksHealth(stackUrl: string): Promise<AfterHooksHealth | undefined>;
17
+ /** Doctor's lines for the server's answer: the path, why, and anything worth acting on. */
18
+ export declare function afterHooksHealthLines(health: AfterHooksHealth): string[];
19
+ //# sourceMappingURL=after-hooks-health.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"after-hooks-health.d.ts","sourceRoot":"","sources":["../src/after-hooks-health.ts"],"names":[],"mappings":"AAYA,4EAA4E;AAC5E,eAAO,MAAM,aAAa,iDAAiD,CAAA;AAE3E,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,CAAA;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAaD;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAWlG;AAED,2FAA2F;AAC3F,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAExE"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * What the running server says about after-hooks, from `components.after_hooks` on its `/health`.
3
+ *
4
+ * The server's change-log listener knows which path after-hooks take, which replica reads the slot,
5
+ * how much WAL the slot holds and what last went wrong. Reading that beats probing the database
6
+ * from here: it is the answer of the process that actually delivers the hooks, as the role it
7
+ * connects with, which `doctor`'s own connection may not share.
8
+ */
9
+ import { isNumber, isOneOf, isRecordOf, isShape, isString, isUnknown, optional } from "@supatype/shared";
10
+ import { gibibytes, REQUEST_PATH_IMPACT, RETAINED_WAL_WARN_BYTES } from "./db-preflight.js";
11
+ import { fetchWithin } from "./fetch-within.js";
12
+ /** Where doctor sends someone whose after-hooks are on the request path. */
13
+ export const DB_CHECK_HINT = " See what to change with: supatype db check";
14
+ const isAfterHooksHealth = isShape({
15
+ path: isOneOf(["changelog", "request", "unknown"]),
16
+ slot: isString,
17
+ reason: optional(isString),
18
+ role: optional(isString),
19
+ retained_wal_bytes: optional(isNumber),
20
+ last_error: optional(isString),
21
+ });
22
+ const isHealthBody = isShape({ components: optional(isRecordOf(isUnknown)) });
23
+ /**
24
+ * The server's after-hook status from the stack at `stackUrl`, or undefined when nothing answers,
25
+ * the answer is not JSON, or the server predates the listener and reports no `after_hooks`.
26
+ */
27
+ export async function readAfterHooksHealth(stackUrl) {
28
+ try {
29
+ const res = await fetchWithin(`${stackUrl.replace(/\/$/, "")}/health`, 2_000);
30
+ if (!res.ok)
31
+ return undefined;
32
+ const body = await res.json();
33
+ const component = isHealthBody(body) ? body.components?.["after_hooks"] : undefined;
34
+ return isAfterHooksHealth(component) ? component : undefined;
35
+ }
36
+ catch {
37
+ // Unreachable or unreadable: the caller asks the database instead.
38
+ return undefined;
39
+ }
40
+ }
41
+ /** Doctor's lines for the server's answer: the path, why, and anything worth acting on. */
42
+ export function afterHooksHealthLines(health) {
43
+ return [...pathLines(health), ...troubleLines(health)];
44
+ }
45
+ function pathLines(health) {
46
+ if (health.path === "changelog") {
47
+ const role = health.role === undefined ? "" : `, this replica the ${health.role}`;
48
+ return [` • change log (slot ${health.slot}${role}): afterChange and afterDelete see every writer.`];
49
+ }
50
+ if (health.path === "unknown") {
51
+ return [` The server has not decided yet${health.reason === undefined ? "" : `: ${health.reason}`}.`];
52
+ }
53
+ return [
54
+ ` ✗ request path${health.reason === undefined ? "" : `, because ${health.reason}`}.`,
55
+ ` ${REQUEST_PATH_IMPACT}`,
56
+ DB_CHECK_HINT,
57
+ ];
58
+ }
59
+ function troubleLines(health) {
60
+ const lines = [];
61
+ const retained = health.retained_wal_bytes ?? 0;
62
+ if (retained > RETAINED_WAL_WARN_BYTES) {
63
+ lines.push(` ✗ slot ${health.slot} holds ${gibibytes(retained)} of WAL: hook delivery is behind. Postgres drops a`, " slot at max_slot_wal_keep_size, and changes it had not delivered are then never delivered.");
64
+ }
65
+ if (health.last_error !== undefined)
66
+ lines.push(` Last error: ${health.last_error}`);
67
+ return lines;
68
+ }
69
+ //# sourceMappingURL=after-hooks-health.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"after-hooks-health.js","sourceRoot":"","sources":["../src/after-hooks-health.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAc,MAAM,kBAAkB,CAAA;AACpH,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,aAAa,GAAG,8CAA8C,CAAA;AAY3E,MAAM,kBAAkB,GAA4B,OAAO,CAAC;IAC1D,IAAI,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAClD,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACxB,kBAAkB,EAAE,QAAQ,CAAC,QAAQ,CAAC;IACtC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC;CAC/B,CAAC,CAAA;AAEF,MAAM,YAAY,GAAG,OAAO,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAA;AAE7E;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,QAAgB;IACzD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QAC7E,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,SAAS,CAAA;QAC7B,MAAM,IAAI,GAAY,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;QACtC,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACnF,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;IAC9D,CAAC;IAAC,MAAM,CAAC;QACP,mEAAmE;QACnE,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,qBAAqB,CAAC,MAAwB;IAC5D,OAAO,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAA;AACxD,CAAC;AAED,SAAS,SAAS,CAAC,MAAwB;IACzC,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,sBAAsB,MAAM,CAAC,IAAI,EAAE,CAAA;QACjF,OAAO,CAAC,wBAAwB,MAAM,CAAC,IAAI,GAAG,IAAI,kDAAkD,CAAC,CAAA;IACvG,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,CAAC,mCAAmC,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxG,CAAC;IACD,OAAO;QACL,mBAAmB,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,MAAM,CAAC,MAAM,EAAE,GAAG;QACrF,KAAK,mBAAmB,EAAE;QAC1B,aAAa;KACd,CAAA;AACH,CAAC;AAED,SAAS,YAAY,CAAC,MAAwB;IAC5C,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,MAAM,QAAQ,GAAG,MAAM,CAAC,kBAAkB,IAAI,CAAC,CAAA;IAC/C,IAAI,QAAQ,GAAG,uBAAuB,EAAE,CAAC;QACvC,KAAK,CAAC,IAAI,CACR,YAAY,MAAM,CAAC,IAAI,UAAU,SAAS,CAAC,QAAQ,CAAC,oDAAoD,EACxG,gGAAgG,CACjG,CAAA;IACH,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA;IACrF,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -7,12 +7,22 @@ import { type SupatypeProjectConfig } from "../project-config.js";
7
7
  export declare function resolveProxyDevScript(config: SupatypeProjectConfig): string | null;
8
8
  /** Port from app.upstream (e.g. http://localhost:5285 → 5285). */
9
9
  export declare function portFromUpstream(config: SupatypeProjectConfig): number | null;
10
- /** Free the upstream port and any stale app PID before spawning Vite. */
11
- export declare function freeProxyDevPort(pidDir: string, port: number): void;
10
+ /**
11
+ * The PIDs listening on `port` in `netstat -ano` output. Only the local address is matched, and
12
+ * all of it: `findstr :5285` also matched port 52851, and a connection to the port from elsewhere.
13
+ */
14
+ export declare function netstatListeners(out: string, port: number): number[];
15
+ /**
16
+ * Free the upstream port and any stale app PID before spawning the app. Asynchronous: run
17
+ * synchronously, the port scan took ten seconds on Windows and froze the dashboard while it did.
18
+ * Rejects when the port could not be scanned.
19
+ */
20
+ export declare function freeProxyDevPort(pidDir: string, port: number): Promise<void>;
12
21
  /**
13
22
  * When a package.json script only runs Vite, spawn node + vite.js directly.
14
23
  * Avoids Windows shell shims (pnpm → bash → vite) that orphan the real server
15
- * and break PID-based cleanup / auto-restart.
24
+ * and break PID-based cleanup / auto-restart. Throws when the compiled binary
25
+ * finds no Node to run vite.js with (see node-executable.ts).
16
26
  */
17
27
  export declare function resolveViteDirectSpawn(appDir: string, script: string, scripts: Record<string, string> | undefined): {
18
28
  bin: string;
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-dev-app.d.ts","sourceRoot":"","sources":["../../src/app/proxy-dev-app.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,EAAE,cAAc,EAAW,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAIxF,qEAAqE;AACrE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,GAAG,IAAI,CAIlF;AAED,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,GAAG,IAAI,CAW7E;AAmDD,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAInE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAC1C;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAexD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,MAAM,GACb,cAAc,GAAG,IAAI,CA+CvB"}
1
+ {"version":3,"file":"proxy-dev-app.d.ts","sourceRoot":"","sources":["../../src/app/proxy-dev-app.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,EAAE,cAAc,EAAW,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAIxF,qEAAqE;AACrE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,GAAG,IAAI,CAIlF;AAED,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,GAAG,IAAI,CAW7E;AAqBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CASpE;AAYD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAC1C;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAexD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,qBAAqB,EAC7B,MAAM,EAAE,MAAM,GACb,cAAc,GAAG,IAAI,CAyCvB"}