@supatype/cli 0.1.13 → 0.2.0

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 (96) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +151 -143
  3. package/.turbo/turbo-typecheck.log +1 -1
  4. package/dist/cli-version-embedded.d.ts.map +1 -1
  5. package/dist/cli-version-embedded.js +1 -1
  6. package/dist/cli-version-embedded.js.map +1 -1
  7. package/dist/commands/admin.d.ts +5 -5
  8. package/dist/commands/admin.d.ts.map +1 -1
  9. package/dist/commands/admin.js +10 -10
  10. package/dist/commands/admin.js.map +1 -1
  11. package/dist/commands/dev.js +51 -51
  12. package/dist/commands/dev.js.map +1 -1
  13. package/dist/commands/init.js +1 -1
  14. package/dist/commands/logs.d.ts +14 -1
  15. package/dist/commands/logs.d.ts.map +1 -1
  16. package/dist/commands/logs.js +33 -37
  17. package/dist/commands/logs.js.map +1 -1
  18. package/dist/commands/push.d.ts.map +1 -1
  19. package/dist/commands/push.js +3 -0
  20. package/dist/commands/push.js.map +1 -1
  21. package/dist/commands/status.d.ts +1 -1
  22. package/dist/commands/status.d.ts.map +1 -1
  23. package/dist/commands/status.js +33 -64
  24. package/dist/commands/status.js.map +1 -1
  25. package/dist/compose-services.d.ts +59 -0
  26. package/dist/compose-services.d.ts.map +1 -0
  27. package/dist/compose-services.js +160 -0
  28. package/dist/compose-services.js.map +1 -0
  29. package/dist/config.d.ts +1 -1
  30. package/dist/config.d.ts.map +1 -1
  31. package/dist/dev-compose.d.ts.map +1 -1
  32. package/dist/dev-compose.js +123 -20
  33. package/dist/dev-compose.js.map +1 -1
  34. package/dist/dev-ports.d.ts +24 -0
  35. package/dist/dev-ports.d.ts.map +1 -1
  36. package/dist/dev-ports.js +37 -0
  37. package/dist/dev-ports.js.map +1 -1
  38. package/dist/docker-postgres.d.ts +1 -1
  39. package/dist/docker-postgres.d.ts.map +1 -1
  40. package/dist/docker-postgres.js +2 -2
  41. package/dist/docker-postgres.js.map +1 -1
  42. package/dist/engine-floor.d.ts +50 -0
  43. package/dist/engine-floor.d.ts.map +1 -0
  44. package/dist/engine-floor.js +80 -0
  45. package/dist/engine-floor.js.map +1 -0
  46. package/dist/link.d.ts +1 -1
  47. package/dist/link.d.ts.map +1 -1
  48. package/dist/pgbouncer-userlist.d.ts +1 -1
  49. package/dist/pgbouncer-userlist.d.ts.map +1 -1
  50. package/dist/pgbouncer-userlist.js +1 -1
  51. package/dist/pgbouncer-userlist.js.map +1 -1
  52. package/dist/postgres-ctl.d.ts +5 -1
  53. package/dist/postgres-ctl.d.ts.map +1 -1
  54. package/dist/postgres-ctl.js +43 -4
  55. package/dist/postgres-ctl.js.map +1 -1
  56. package/dist/project-config.d.ts +4 -4
  57. package/dist/resolve-target.d.ts +1 -1
  58. package/dist/resolve-target.d.ts.map +1 -1
  59. package/dist/self-host-compose.d.ts.map +1 -1
  60. package/dist/self-host-compose.js +41 -18
  61. package/dist/self-host-compose.js.map +1 -1
  62. package/dist/studio-dev-server.d.ts +8 -1
  63. package/dist/studio-dev-server.d.ts.map +1 -1
  64. package/dist/studio-dev-server.js +1 -2
  65. package/dist/studio-dev-server.js.map +1 -1
  66. package/package.json +2 -2
  67. package/src/cli-version-embedded.ts +1 -1
  68. package/src/commands/admin.ts +10 -10
  69. package/src/commands/dev.ts +51 -51
  70. package/src/commands/init.ts +1 -1
  71. package/src/commands/logs.ts +34 -37
  72. package/src/commands/push.ts +3 -0
  73. package/src/commands/status.ts +34 -70
  74. package/src/compose-services.ts +174 -0
  75. package/src/config.ts +1 -1
  76. package/src/dev-compose.ts +130 -20
  77. package/src/dev-ports.ts +48 -0
  78. package/src/docker-postgres.ts +2 -2
  79. package/src/engine-floor.ts +113 -0
  80. package/src/link.ts +1 -1
  81. package/src/pgbouncer-userlist.ts +1 -1
  82. package/src/postgres-ctl.ts +44 -4
  83. package/src/project-config.ts +4 -4
  84. package/src/resolve-target.ts +1 -1
  85. package/src/self-host-compose.ts +41 -18
  86. package/src/studio-dev-server.ts +9 -3
  87. package/tests/admin-ensure.test.ts +10 -10
  88. package/tests/compose-parsable-defaults.test.ts +60 -0
  89. package/tests/compose-services.test.ts +144 -0
  90. package/tests/dev-ports-owner.test.ts +40 -0
  91. package/tests/engine-floor.test.ts +102 -0
  92. package/tests/external-database-compose.test.ts +3 -3
  93. package/tests/port-in-use.test.ts +58 -0
  94. package/tests/readiness-poll.test.ts +84 -0
  95. package/tests/runtime-contract.test.ts +1 -1
  96. package/tsconfig.tsbuildinfo +1 -1
@@ -1,4 +1,4 @@
1
1
 
2
- > @supatype/cli@0.1.13 build /home/runner/work/supatype/supatype/packages/cli
2
+ > @supatype/cli@0.2.0 build /home/runner/work/supatype/supatype/packages/cli
3
3
  > tsc --project tsconfig.json && node --input-type=module -e "import{cpSync,mkdirSync}from'node:fs';const a='dist/assets';mkdirSync(a,{recursive:true});cpSync('assets/supatype-logo-wordmark.ascii.txt',a+'/supatype-logo-wordmark.ascii.txt')"
4
4
 
@@ -1,13 +1,14 @@
1
1
 
2
- > @supatype/cli@0.1.13 test /home/runner/work/supatype/supatype/packages/cli
2
+ > @supatype/cli@0.2.0 test /home/runner/work/supatype/supatype/packages/cli
3
3
  > vitest run
4
4
 
5
5
 
6
6
   RUN  v4.0.18 /home/runner/work/supatype/supatype/packages/cli
7
7
 
8
- ✓ tests/access-composition.test.ts (26 tests) 236ms
9
- ✓ tests/type-extractor.test.ts (44 tests) 234ms
10
- ✓ tests/model-hooks.test.ts (21 tests) 117ms
8
+ ✓ tests/access-composition.test.ts (26 tests) 90ms
9
+ ✓ tests/type-extractor.test.ts (44 tests) 117ms
10
+ ✓ tests/model-hooks.test.ts (21 tests) 66ms
11
+ ✓ tests/runtime-contract.test.ts (49 tests) 142ms
11
12
  stdout | tests/init.test.ts > scaffold() > creates all expected files
12
13
   created package.json
13
14
  created supatype.config.ts
@@ -294,13 +295,12 @@
294
295
  created public/.gitkeep
295
296
  created .gitignore
296
297
 
297
- ✓ tests/init.test.ts (26 tests) 126ms
298
- ✓ tests/runtime-contract.test.ts (49 tests) 141ms
299
- ✓ tests/model-constraints.test.ts (18 tests) 155ms
300
- ✓ tests/external-database-compose.test.ts (17 tests) 34ms
301
- ✓ tests/field-masking-tier.test.ts (16 tests) 34ms
298
+ ✓ tests/init.test.ts (26 tests) 44ms
299
+ ✓ tests/model-constraints.test.ts (18 tests) 76ms
300
+ ✓ tests/external-database-compose.test.ts (17 tests) 8ms
301
+ ✓ tests/field-masking-tier.test.ts (16 tests) 14ms
302
302
 
303
- ✓ tests/dev-ui.test.ts (21 tests) 145ms
303
+ ✓ tests/dev-ui.test.ts (21 tests) 117ms
304
304
 
305
305
  [supatype] Shutting down…
306
306
  stdout | tests/docker-runtime.test.ts > requireDockerDaemon > exits when the daemon is unavailable
@@ -311,40 +311,39 @@
311
311
 
312
312
  docker: daemon down
313
313
 
314
- ✓ tests/docker-runtime.test.ts (10 tests) 18ms
315
- ✓ tests/hooks-generator.test.ts (7 tests) 8597ms
316
- ✓ typechecks under strict mode, together with a handler that uses it  2915ms
317
- ✓ rejects a handler for a table that declares no hook  2901ms
318
- ✓ typechecks with a validator written the way the docs will show it  2718ms
319
- ✓ tests/config.test.ts (19 tests) 8783ms
320
- ✓ loads a valid supatype.config.ts (plain export default, no package imports)  800ms
321
- ✓ normalizes shorthand schema string to { path, pg_schema }  1028ms
322
- ✓ loads a supatype.config.js (plain ESM)  703ms
323
- ✓ loads config without a versions section (latest by default)  853ms
324
- ✓ prefers supatype.config.ts over supatype.config.js when both exist  984ms
325
- ✓ supports optional output field in config  998ms
326
- ✓ merges supatype.local.config.ts over base  1981ms
327
- ✓ loads defineConfig import before @supatype/cli is installed (init scaffold)  1414ms
328
- ✓ tests/db-preflight.test.ts (14 tests) 32ms
329
- ✓ tests/field-bounds.test.ts (23 tests) 38ms
330
- ✓ tests/cache-clean.test.ts (8 tests) 2523ms
331
- ✓ keeps pinned versions and removes the rest  724ms
332
- ✓ --force removes pinned versions  870ms
333
- ✓ explicit version removes even when pinned (with warning)  903ms
334
- ✓ tests/field-bounds-matrix.test.ts (124 tests) 38ms
335
- ✓ tests/functions-deno-types.test.ts (7 tests) 3606ms
336
- ✓ tsc fails with Cannot find name Deno without ambient types  2505ms
337
- ✓ tsc passes for Deno.env after ensureFunctionsDenoTypes  1082ms
338
- ✓ tests/external-database-config.test.ts (14 tests) 11ms
339
- ✓ tests/field-validators.test.ts (10 tests) 73ms
340
- ✓ tests/command-chrome-coverage.test.ts (1 test) 19ms
341
- ✓ tests/hook-upload.test.ts (8 tests) 12ms
342
- ✓ tests/env-file.test.ts (9 tests) 21ms
314
+ ✓ tests/docker-runtime.test.ts (10 tests) 12ms
315
+ ✓ tests/hooks-generator.test.ts (7 tests) 5380ms
316
+ ✓ typechecks under strict mode, together with a handler that uses it  1784ms
317
+ ✓ rejects a handler for a table that declares no hook  1801ms
318
+ ✓ typechecks with a validator written the way the docs will show it  1768ms
319
+ ✓ tests/config.test.ts (19 tests) 5148ms
320
+ ✓ loads a valid supatype.config.ts (plain export default, no package imports)  529ms
321
+ ✓ normalizes shorthand schema string to { path, pg_schema }  520ms
322
+ ✓ loads a supatype.config.js (plain ESM)  485ms
323
+ ✓ loads config without a versions section (latest by default)  533ms
324
+ ✓ prefers supatype.config.ts over supatype.config.js when both exist  588ms
325
+ ✓ supports optional output field in config  581ms
326
+ ✓ merges supatype.local.config.ts over base  1021ms
327
+ ✓ loads defineConfig import before @supatype/cli is installed (init scaffold)  880ms
328
+ ✓ tests/db-preflight.test.ts (14 tests) 5ms
329
+ ✓ tests/field-bounds.test.ts (23 tests) 9ms
330
+ ✓ tests/cache-clean.test.ts (8 tests) 1667ms
331
+ ✓ keeps pinned versions and removes the rest  551ms
332
+ ✓ --force removes pinned versions  514ms
333
+ ✓ explicit version removes even when pinned (with warning)  590ms
334
+ ✓ tests/functions-deno-types.test.ts (7 tests) 2732ms
335
+ ✓ adds functions to root tsconfig exclude when possible  510ms
336
+ ✓ tsc fails with Cannot find name Deno without ambient types  1604ms
337
+ ✓ tsc passes for Deno.env after ensureFunctionsDenoTypes  612ms
338
+ ✓ tests/field-bounds-matrix.test.ts (124 tests) 24ms
339
+ ✓ tests/external-database-config.test.ts (14 tests) 5ms
340
+ ✓ tests/compose-services.test.ts (12 tests) 19ms
341
+ ✓ tests/field-validators.test.ts (10 tests) 38ms
342
+ ✓ tests/command-chrome-coverage.test.ts (1 test) 16ms
343
+ ✓ tests/hook-upload.test.ts (8 tests) 14ms
344
+ ✓ tests/env-file.test.ts (9 tests) 14ms
343
345
  stdout | tests/link.test.ts > link model > migrates cloud.json into link.json
344
346
   created package.json
345
- stderr | tests/link.test.ts > link model > migrates cloud.json into link.json
346
- [supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
347
-
348
347
  created supatype.config.ts
349
348
  created schema/index.ts
350
349
  created .env
@@ -353,10 +352,13 @@
353
352
  created public/.gitkeep
354
353
  created .gitignore
355
354
 
356
- ✓ tests/link.test.ts (4 tests) 3020ms
357
- ✓ resolveTarget returns cloud mode with /api/v1 prefix  1000ms
358
- ✓ resolveTarget returns self-host mode with /platform/v1 prefix  972ms
359
- ✓ targetSchemaRollback posts to /platform/v1 when linked  1037ms
355
+ stderr | tests/link.test.ts > link model > migrates cloud.json into link.json
356
+ [supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
357
+
358
+ ✓ tests/link.test.ts (4 tests) 2564ms
359
+ ✓ resolveTarget returns cloud mode with /api/v1 prefix  899ms
360
+ ✓ resolveTarget returns self-host mode with /platform/v1 prefix  789ms
361
+ ✓ targetSchemaRollback posts to /platform/v1 when linked  867ms
360
362
  stdout | tests/admin-ensure.test.ts > init admin seed in .env > writes SUPATYPE_ADMIN_* when scaffold options include credentials
361
363
   created package.json
362
364
  created supatype.config.ts
@@ -367,8 +369,8 @@
367
369
  created public/.gitkeep
368
370
  created .gitignore
369
371
 
370
- ✓ tests/admin-ensure.test.ts (10 tests) 164ms
371
- ✓ tests/service-role-check.test.ts (10 tests) 12ms
372
+ ✓ tests/admin-ensure.test.ts (10 tests) 144ms
373
+ ✓ tests/service-role-check.test.ts (10 tests) 8ms
372
374
  stdout | tests/admin-studio-membership.test.ts > first admin user creation > does not write a role into app_metadata
373
375
  [supatype] Admin user "admin@example.com" created (role: admin).
374
376
  [supatype] Log in at /admin after starting the dev server.
@@ -385,43 +387,46 @@
385
387
  [supatype] Admin user "admin@example.com" created (role: admin).
386
388
  [supatype] Log in at /admin after starting the dev server.
387
389
 
388
- ✓ tests/admin-studio-membership.test.ts (5 tests) 539ms
389
- ✓ tests/augmentation-generator.test.ts (6 tests) 17ms
390
- ✓ tests/pull-utils.test.ts (49 tests) 15ms
391
- ✓ tests/schema-sources.test.ts (5 tests) 1255ms
392
- ✓ buildSchemaSourcesPayload includes manifest metadata  659ms
393
- ✓ restore overwrites modified local files  553ms
394
- ✓ tests/keys.test.ts (11 tests) 18407ms
395
- ✓ exits 0 with --secret  2004ms
396
- ✓ outputs ANON_KEY= line  2047ms
397
- ✓ outputs SERVICE_ROLE_KEY= line  1727ms
398
- ✓ ANON_KEY is a valid three-part JWT  1358ms
399
- ✓ SERVICE_ROLE_KEY payload has role: service_role  1463ms
400
- ✓ JWT has exp in the future  1438ms
401
- ✓ --exp-years changes the expiry window  2856ms
402
- ✓ reads JWT_SECRET from environment variable  1440ms
403
- ✓ reads JWT_SECRET from .env file  1300ms
404
- ✓ exits non-zero when no secret is available  1357ms
405
- ✓ keys --help shows --secret and --exp-years options  1407ms
406
- ✓ tests/local-server-image-env.test.ts (5 tests) 11ms
390
+ ✓ tests/admin-studio-membership.test.ts (5 tests) 385ms
391
+ ✓ tests/augmentation-generator.test.ts (6 tests) 16ms
392
+ ✓ tests/pull-utils.test.ts (49 tests) 10ms
393
+ ✓ tests/keys.test.ts (11 tests) 13237ms
394
+ ✓ exits 0 with --secret  1193ms
395
+ ✓ outputs ANON_KEY= line  1194ms
396
+ ✓ outputs SERVICE_ROLE_KEY= line  1074ms
397
+ ✓ ANON_KEY is a valid three-part JWT  1092ms
398
+ ✓ SERVICE_ROLE_KEY payload has role: service_role  1053ms
399
+ ✓ JWT has exp in the future  1047ms
400
+ ✓ --exp-years changes the expiry window  2168ms
401
+ ✓ reads JWT_SECRET from environment variable  1063ms
402
+ ✓ reads JWT_SECRET from .env file  1105ms
403
+ ✓ exits non-zero when no secret is available  1134ms
404
+ ✓ keys --help shows --secret and --exp-years options  1108ms
405
+ ✓ tests/schema-sources.test.ts (5 tests) 1099ms
406
+ ✓ buildSchemaSourcesPayload includes manifest metadata  459ms
407
+ ✓ restore overwrites modified local files  604ms
407
408
  stderr | tests/binary-cache-cloud-overrides.test.ts > isLinkedToCloudProject > is true when .supatype/cloud.json has projectSlug
408
409
  [supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
409
410
 
410
- ✓ tests/binary-cache-cloud-overrides.test.ts (11 tests) 15ms
411
- ✓ tests/homebrew-formula.test.ts (4 tests) 151ms
412
- ✓ tests/minisign.test.ts (5 tests) 13ms
413
- ✓ tests/local-secrets.test.ts (5 tests) 13ms
414
- ✓ tests/api-schemas.test.ts (10 tests) 9ms
411
+ ✓ tests/binary-cache-cloud-overrides.test.ts (11 tests) 17ms
412
+ ✓ tests/homebrew-formula.test.ts (4 tests) 110ms
413
+ ✓ tests/local-server-image-env.test.ts (5 tests) 218ms
414
+ ✓ tests/minisign.test.ts (5 tests) 8ms
415
+ ✓ tests/engine-floor.test.ts (11 tests) 7ms
416
+ ✓ tests/local-secrets.test.ts (5 tests) 7ms
417
+ ✓ tests/api-schemas.test.ts (10 tests) 7ms
415
418
  stdout | tests/storage-provision.test.ts > provisionBuckets > POSTs each bucket to the storage API
416
419
  [supatype] Storage bucket "photos" ready.
417
420
 
418
421
  stdout | tests/storage-provision.test.ts > provisionBuckets > POSTs each bucket to the storage API
419
422
  [supatype] Storage bucket "avatars" ready.
420
423
 
421
- ✓ tests/storage-provision.test.ts (6 tests) 11ms
422
- ✓ tests/cached-artifact-format.test.ts (7 tests) 12ms
423
- ✓ tests/target-client-refresh.test.ts (3 tests) 10ms
424
- ✓ tests/proxy-dev-app.test.ts (7 tests) 6ms
424
+ ✓ tests/storage-provision.test.ts (6 tests) 10ms
425
+ ✓ tests/cached-artifact-format.test.ts (7 tests) 7ms
426
+ ✓ tests/readiness-poll.test.ts (3 tests) 320ms
427
+ ✓ ends promptly when it carries a deadline  317ms
428
+ ✓ tests/target-client-refresh.test.ts (3 tests) 9ms
429
+ ✓ tests/proxy-dev-app.test.ts (7 tests) 5ms
425
430
  stdout | tests/app-command.test.ts > supatype app add --static > sets app.mode=static and static_dir in supatype.config.ts
426
431
   created package.json
427
432
  created supatype.config.ts
@@ -442,77 +447,80 @@
442
447
  created public/.gitkeep
443
448
  created .gitignore
444
449
 
445
- ✓ tests/service-role-routes.test.ts (4 tests) 1737ms
446
- ✓ reads the declared list  576ms
447
- ✓ is an empty list when a project declares none  589ms
448
- ✓ sends what the project declared, hook entries included  569ms
449
- ✓ tests/init-dependency-versions.test.ts (4 tests) 37ms
450
- ✓ tests/app-command.test.ts (2 tests) 2802ms
451
- ✓ sets app.mode=static and static_dir in supatype.config.ts  1418ms
452
- ✓ creates the static directory when missing  1380ms
453
- ✓ tests/type-resolver.test.ts (2 tests) 14ms
450
+ ✓ tests/service-role-routes.test.ts (4 tests) 1404ms
451
+ ✓ reads the declared list  465ms
452
+ ✓ is an empty list when a project declares none  458ms
453
+ ✓ sends what the project declared, hook entries included  479ms
454
+ ✓ tests/app-command.test.ts (2 tests) 2281ms
455
+ ✓ sets app.mode=static and static_dir in supatype.config.ts  1088ms
456
+ ✓ creates the static directory when missing  1191ms
457
+ ✓ tests/init-dependency-versions.test.ts (4 tests) 28ms
458
+ ✓ tests/compose-parsable-defaults.test.ts (2 tests) 6ms
459
+ ✓ tests/type-resolver.test.ts (2 tests) 13ms
454
460
  ✓ tests/engine-push-output.test.ts (7 tests) 6ms
455
- ✓ tests/command-chrome-wrap.test.ts (3 tests) 12ms
456
- ✓ tests/cli-help.test.ts (16 tests) 22909ms
457
- ✓ --help lists all top-level commands  2166ms
458
- ✓ --version prints package.json version  1355ms
459
- ✓ self-update --help describes the command  1300ms
460
- ✓ init --help describes the init command  1390ms
461
- ✓ push --help describes the push command and --yes flag  1388ms
462
- ✓ diff --help describes the diff command  1372ms
463
- ✓ pull --help describes scaffold pull command  1470ms
464
- ✓ doctor --help describes drift report command  1414ms
465
- ✓ introspect --help describes database introspection command  1267ms
466
- ✓ adopt --help describes adoption ceremony command  1390ms
467
- ✓ reset --help shows --yes flag  1419ms
468
- ✓ app --help describes the app command with add/remove subcommands  1384ms
469
- ✓ app add --help shows --static and --port options  1362ms
470
- ✓ self-host --help shows compose only (legacy commands hidden)  1418ms
471
- ✓ self-host compose --help shows compose subcommands  1383ms
472
- ✓ unknown command exits non-zero  1416ms
473
- ✓ tests/cli-install-method.test.ts (8 tests) 6ms
474
- ✓ tests/archive-name-alias.test.ts (4 tests) 6ms
475
- ✓ tests/ensure-binary.test.ts (2 tests) 9ms
476
- ✓ tests/tsx-runner.test.ts (7 tests) 2922ms
477
- ✓ evaluates a simple expression and returns stdout  388ms
478
- ✓ evaluates TypeScript syntax (type annotations)  400ms
479
- ✓ can serialize a JSON object to stdout  335ms
480
- ✓ returns non-zero exit code on syntax error  424ms
481
- ✓ returns non-zero exit code on runtime error  422ms
482
- ✓ captures stderr separately from stdout  400ms
483
- ✓ runs a .ts file and returns its stdout  547ms
484
- ✓ tests/init-project-detect.test.ts (4 tests) 14ms
485
- ✓ tests/doctor-render.test.ts (3 tests) 6ms
486
- ✓ tests/required-host-components.test.ts (4 tests) 6ms
487
- ✓ tests/ui-messages.test.ts (5 tests) 7ms
488
- ✓ tests/normalize-admin-config.test.ts (1 test) 7ms
489
- ✓ tests/doctor-service-role.test.ts (4 tests) 6ms
490
- ✓ tests/ui-confirm.test.ts (3 tests) 7ms
461
+ ✓ tests/cli-help.test.ts (16 tests) 17072ms
462
+ ✓ --help lists all top-level commands  1059ms
463
+ ✓ --version prints package.json version  1058ms
464
+ ✓ self-update --help describes the command  975ms
465
+ ✓ init --help describes the init command  1062ms
466
+ ✓ push --help describes the push command and --yes flag  1091ms
467
+ ✓ diff --help describes the diff command  1054ms
468
+ ✓ pull --help describes scaffold pull command  1091ms
469
+ ✓ doctor --help describes drift report command  1142ms
470
+ ✓ introspect --help describes database introspection command  1060ms
471
+ ✓ adopt --help describes adoption ceremony command  1025ms
472
+ ✓ reset --help shows --yes flag  987ms
473
+ ✓ app --help describes the app command with add/remove subcommands  1006ms
474
+ ✓ app add --help shows --static and --port options  1046ms
475
+ ✓ self-host --help shows compose only (legacy commands hidden)  1161ms
476
+ ✓ self-host compose --help shows compose subcommands  1139ms
477
+ ✓ unknown command exits non-zero  1108ms
478
+ ✓ tests/command-chrome-wrap.test.ts (3 tests) 6ms
479
+ ✓ tests/cli-install-method.test.ts (8 tests) 5ms
480
+ ✓ tests/doctor-render.test.ts (3 tests) 5ms
481
+ ✓ tests/port-in-use.test.ts (4 tests) 26ms
482
+ ✓ tests/archive-name-alias.test.ts (4 tests) 5ms
483
+ ✓ tests/ensure-binary.test.ts (2 tests) 8ms
484
+ ✓ tests/init-project-detect.test.ts (4 tests) 9ms
485
+ ✓ tests/tsx-runner.test.ts (7 tests) 2520ms
486
+ ✓ evaluates a simple expression and returns stdout  329ms
487
+ ✓ evaluates TypeScript syntax (type annotations)  343ms
488
+ ✓ can serialize a JSON object to stdout  339ms
489
+ ✓ returns non-zero exit code on syntax error  350ms
490
+ ✓ returns non-zero exit code on runtime error  360ms
491
+ ✓ captures stderr separately from stdout  344ms
492
+ ✓ runs a .ts file and returns its stdout  448ms
493
+ ✓ tests/doctor-service-role.test.ts (4 tests) 5ms
494
+ ✓ tests/required-host-components.test.ts (4 tests) 4ms
495
+ ✓ tests/dev-ports-owner.test.ts (6 tests) 4ms
496
+ ✓ tests/ui-messages.test.ts (5 tests) 5ms
497
+ ✓ tests/normalize-admin-config.test.ts (1 test) 5ms
498
+ ✓ tests/ui-confirm.test.ts (3 tests) 6ms
491
499
  ✓ tests/docker-postgres.test.ts (5 tests) 4ms
492
- ✓ tests/binary-download-lock.test.ts (2 tests) 6ms
493
- ✓ tests/dev-session-lock.test.ts (2 tests) 5ms
494
- ✓ tests/dev-ports.test.ts (3 tests) 6ms
495
- ✓ tests/route-manifest.test.ts (1 test) 6ms
496
- ✓ tests/dev-ready-panel.test.ts (2 tests) 5ms
500
+ ✓ tests/binary-download-lock.test.ts (2 tests) 5ms
501
+ ✓ tests/dev-session-lock.test.ts (2 tests) 3ms
502
+ ✓ tests/dev-ports.test.ts (3 tests) 5ms
503
+ ✓ tests/config-load-failure.test.ts (2 tests) 2836ms
504
+ ✓ is reported, rather than treated as absent  1611ms
505
+ ✓ does not stop the CLI working with no config at all  1223ms
506
+ ✓ tests/route-manifest.test.ts (1 test) 4ms
507
+ ✓ tests/dev-ready-panel.test.ts (2 tests) 3ms
497
508
  ✓ tests/studio-admin-roles.test.ts (3 tests) 3ms
498
- ✓ tests/config-load-failure.test.ts (2 tests) 3474ms
499
- ✓ is reported, rather than treated as absent  1964ms
500
- ✓ does not stop the CLI working with no config at all  1507ms
501
- ✓ tests/realtime-launch.test.ts (1 test) 5ms
502
- ✓ tests/release-pins.test.ts (2 tests) 6ms
503
- ✓ tests/ensure-dev-api-config.test.ts (1 test) 5ms
504
- ✓ tests/seed-discover.test.ts (2 tests) 17ms
505
- ✓ tests/rest-cache-admin.test.ts (1 test) 30ms
506
- ✓ tests/init-package-json.test.ts (1 test) 3ms
509
+ ✓ tests/release-pins.test.ts (2 tests) 3ms
510
+ ✓ tests/realtime-launch.test.ts (1 test) 4ms
511
+ ✓ tests/ensure-dev-api-config.test.ts (1 test) 3ms
512
+ ✓ tests/seed-discover.test.ts (2 tests) 10ms
513
+ ✓ tests/rest-cache-admin.test.ts (1 test) 40ms
514
+ ✓ tests/init-package-json.test.ts (1 test) 2ms
515
+ ✓ tests/resolve-api-url.test.ts (2 tests) 5ms
507
516
  ✓ tests/pg-spawn-env.test.ts (2 tests) 4ms
508
- ✓ tests/resolve-api-url.test.ts (2 tests) 4ms
509
- ✓ tests/migrate-from-v1.test.ts (1 test) 10ms
510
- ✓ tests/cli-package-version.test.ts (1 test) 4ms
517
+ ✓ tests/migrate-from-v1.test.ts (1 test) 12ms
518
+ ✓ tests/cli-package-version.test.ts (1 test) 3ms
511
519
  ✓ tests/postgres-archive-tag.test.ts (1 test) 2ms
512
- ✓ tests/stdin-after-ink.test.ts (1 test) 3ms
520
+ ✓ tests/stdin-after-ink.test.ts (1 test) 2ms
513
521
 
514
-  Test Files  78 passed (78)
515
-  Tests  774 passed (774)
516
-  Start at  22:11:33
517
-  Duration  48.31s (transform 7.40s, setup 0ms, import 44.84s, tests 82.79s, environment 17ms)
522
+  Test Files  84 passed (84)
523
+  Tests  812 passed (812)
524
+  Start at  07:11:48
525
+  Duration  35.25s (transform 4.64s, setup 0ms, import 33.01s, tests 60.32s, environment 10ms)
518
526
 
@@ -1,4 +1,4 @@
1
1
 
2
- > @supatype/cli@0.1.13 typecheck /home/runner/work/supatype/supatype/packages/cli
2
+ > @supatype/cli@0.2.0 typecheck /home/runner/work/supatype/supatype/packages/cli
3
3
  > tsc --project tsconfig.json --noEmit && tsc --project tests/tsconfig.json --noEmit
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"cli-version-embedded.d.ts","sourceRoot":"","sources":["../src/cli-version-embedded.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,oBAAoB,EAAE,MAAiB,CAAA"}
1
+ {"version":3,"file":"cli-version-embedded.d.ts","sourceRoot":"","sources":["../src/cli-version-embedded.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,oBAAoB,EAAE,MAAgB,CAAA"}
@@ -9,5 +9,5 @@
9
9
  // Annotated `string`, not left to inference: once a release stamps a value here, the
10
10
  // inferred literal type makes the `!== ""` test in cliPackageVersion() a compile error
11
11
  // (TS2367, no overlap), so the build would only fail during a release.
12
- export const EMBEDDED_CLI_VERSION = "0.1.13";
12
+ export const EMBEDDED_CLI_VERSION = "0.2.0";
13
13
  //# sourceMappingURL=cli-version-embedded.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-version-embedded.js","sourceRoot":"","sources":["../src/cli-version-embedded.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qFAAqF;AACrF,uFAAuF;AACvF,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAW,QAAQ,CAAA"}
1
+ {"version":3,"file":"cli-version-embedded.js","sourceRoot":"","sources":["../src/cli-version-embedded.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qFAAqF;AACrF,uFAAuF;AACvF,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAW,OAAO,CAAA"}
@@ -12,13 +12,13 @@ export declare const ADMIN_PASSWORD_ENV = "SUPATYPE_ADMIN_PASSWORD";
12
12
  * is locked out of the very panel they were made for.
13
13
  */
14
14
  export declare const STUDIO_ROLES: readonly ["admin", "developer", "editor"];
15
- /** GoTrue scopes users to the nil instance id in single-tenant/self-host mode. */
16
- export declare const GOTRUE_NIL_INSTANCE_ID = "00000000-0000-0000-0000-000000000000";
17
- /** Audience claim used by GoTrue when looking up users (matches GOTRUE_JWT_AUD in compose). */
18
- export declare function gotrueJwtAud(cwd: string): string;
15
+ /** The auth service scopes users to the nil instance id in single-tenant/self-host mode. */
16
+ export declare const SUPATYPE_NIL_INSTANCE_ID = "00000000-0000-0000-0000-000000000000";
17
+ /** Audience claim used when looking up users (matches SUPATYPE_JWT_AUD in compose). */
18
+ export declare function authJwtAud(cwd: string): string;
19
19
  type DbQuery = (sql: string, params?: unknown[]) => Promise<QueryResult>;
20
20
  type AuthConfirmedColumn = "email_confirmed_at" | "confirmed_at";
21
- /** Prefer GoTrue's column when migrated; fall back to postgres init `confirmed_at`. */
21
+ /** Prefer the migrated column when present; fall back to postgres init `confirmed_at`. */
22
22
  export declare function resolveAuthConfirmedAtColumn(query: DbQuery): Promise<AuthConfirmedColumn>;
23
23
  export interface EnsureFirstAdminOptions {
24
24
  email?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/commands/admin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC,OAAO,KAAK,EAAQ,WAAW,EAAE,MAAM,IAAI,CAAA;AAE3C,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAA;AAa7B,eAAO,MAAM,eAAe,yBAAyB,CAAA;AACrD,eAAO,MAAM,kBAAkB,4BAA4B,CAAA;AAI3D;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,2CAA4C,CAAA;AAYrE,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,yCAAyC,CAAA;AAE5E,+FAA+F;AAC/F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,KAAK,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;AACxE,KAAK,mBAAmB,GAAG,oBAAoB,GAAG,cAAc,CAAA;AAEhE,uFAAuF;AACvF,wBAAsB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAc/F;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,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CAIxD;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3E;AAqMD,mFAAmF;AACnF,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3D"}
@@ -37,13 +37,13 @@ function assertStudioRole(role) {
37
37
  "and belong in your access rules.");
38
38
  process.exit(1);
39
39
  }
40
- /** GoTrue scopes users to the nil instance id in single-tenant/self-host mode. */
41
- export const GOTRUE_NIL_INSTANCE_ID = "00000000-0000-0000-0000-000000000000";
42
- /** Audience claim used by GoTrue when looking up users (matches GOTRUE_JWT_AUD in compose). */
43
- export function gotrueJwtAud(cwd) {
44
- return readEnvValue(cwd, "GOTRUE_JWT_AUD", "authenticated");
40
+ /** The auth service scopes users to the nil instance id in single-tenant/self-host mode. */
41
+ export const SUPATYPE_NIL_INSTANCE_ID = "00000000-0000-0000-0000-000000000000";
42
+ /** Audience claim used when looking up users (matches SUPATYPE_JWT_AUD in compose). */
43
+ export function authJwtAud(cwd) {
44
+ return readEnvValue(cwd, "SUPATYPE_JWT_AUD", "authenticated");
45
45
  }
46
- /** Prefer GoTrue's column when migrated; fall back to postgres init `confirmed_at`. */
46
+ /** Prefer the migrated column when present; fall back to postgres init `confirmed_at`. */
47
47
  export async function resolveAuthConfirmedAtColumn(query) {
48
48
  const result = await query(`SELECT column_name
49
49
  FROM information_schema.columns
@@ -339,12 +339,12 @@ async function createAdminUser(db, email, password, role, opts = {}) {
339
339
  ? (sql, params) => db.query(sql, params)
340
340
  : db;
341
341
  const normalized = email.toLowerCase();
342
- const aud = opts.aud ?? (opts.cwd ? gotrueJwtAud(opts.cwd) : "authenticated");
342
+ const aud = opts.aud ?? (opts.cwd ? authJwtAud(opts.cwd) : "authenticated");
343
343
  const existing = await query(`SELECT id FROM auth.users
344
344
  WHERE instance_id = $1::uuid
345
345
  AND LOWER(email) = $2
346
346
  AND aud = $3
347
- AND is_sso_user = false`, [GOTRUE_NIL_INSTANCE_ID, normalized, aud]);
347
+ AND is_sso_user = false`, [SUPATYPE_NIL_INSTANCE_ID, normalized, aud]);
348
348
  if (existing.rows.length > 0) {
349
349
  throw new Error(`User with email "${email}" already exists.`);
350
350
  }
@@ -375,7 +375,7 @@ async function createAdminUser(db, email, password, role, opts = {}) {
375
375
  '', '', '', '', '', '', '', '',
376
376
  false, false,
377
377
  now(), now()
378
- ) RETURNING id, email`, [GOTRUE_NIL_INSTANCE_ID, aud, normalized, passwordHash, appMetadata, userMetadata]);
378
+ ) RETURNING id, email`, [SUPATYPE_NIL_INSTANCE_ID, aud, normalized, passwordHash, appMetadata, userMetadata]);
379
379
  const user = result.rows[0];
380
380
  await recordStudioMembership(query, user.id, role);
381
381
  if (!opts.quiet) {
@@ -454,7 +454,7 @@ async function hasAdminUsers(query) {
454
454
  if (!(await studioMembersTableExists(query)))
455
455
  return false;
456
456
  // Inner JOIN on purpose, unlike `list-users`: a membership held by a cloud
457
- // account cannot log in to a self-hosted GoTrue, so a project exported from
457
+ // account cannot log in to a self-hosted auth service, so a project exported from
458
458
  // cloud with only those grants genuinely still needs a first admin.
459
459
  const adminCount = await query(`SELECT COUNT(*)::int as count
460
460
  FROM _supatype.studio_members m