@supatype/cli 0.1.12 → 0.1.13

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 (62) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +138 -132
  3. package/.turbo/turbo-typecheck.log +1 -1
  4. package/dist/cli-version-embedded.js +1 -1
  5. package/dist/commands/db.d.ts.map +1 -1
  6. package/dist/commands/db.js +23 -1
  7. package/dist/commands/db.js.map +1 -1
  8. package/dist/commands/doctor.d.ts +0 -7
  9. package/dist/commands/doctor.d.ts.map +1 -1
  10. package/dist/commands/doctor.js +26 -0
  11. package/dist/commands/doctor.js.map +1 -1
  12. package/dist/commands/push.d.ts.map +1 -1
  13. package/dist/commands/push.js +15 -7
  14. package/dist/commands/push.js.map +1 -1
  15. package/dist/compose-local-server-image.d.ts +11 -0
  16. package/dist/compose-local-server-image.d.ts.map +1 -1
  17. package/dist/compose-local-server-image.js +18 -0
  18. package/dist/compose-local-server-image.js.map +1 -1
  19. package/dist/dev-compose.d.ts +1 -0
  20. package/dist/dev-compose.d.ts.map +1 -1
  21. package/dist/dev-compose.js +79 -10
  22. package/dist/dev-compose.js.map +1 -1
  23. package/dist/field-bounds.d.ts +68 -0
  24. package/dist/field-bounds.d.ts.map +1 -0
  25. package/dist/field-bounds.js +277 -0
  26. package/dist/field-bounds.js.map +1 -0
  27. package/dist/hooks-generator.d.ts +1 -1
  28. package/dist/hooks-generator.d.ts.map +1 -1
  29. package/dist/hooks-generator.js +78 -4
  30. package/dist/hooks-generator.js.map +1 -1
  31. package/dist/model-hooks.d.ts +44 -2
  32. package/dist/model-hooks.d.ts.map +1 -1
  33. package/dist/model-hooks.js +116 -12
  34. package/dist/model-hooks.js.map +1 -1
  35. package/dist/schema-ast-v2.d.ts +38 -4
  36. package/dist/schema-ast-v2.d.ts.map +1 -1
  37. package/dist/schema-ast-v2.js +87 -4
  38. package/dist/schema-ast-v2.js.map +1 -1
  39. package/dist/type-extractor.d.ts.map +1 -1
  40. package/dist/type-extractor.js +309 -27
  41. package/dist/type-extractor.js.map +1 -1
  42. package/package.json +4 -3
  43. package/src/cli-version-embedded.ts +1 -1
  44. package/src/commands/db.ts +27 -1
  45. package/src/commands/doctor.ts +30 -0
  46. package/src/commands/push.ts +26 -6
  47. package/src/compose-local-server-image.ts +17 -0
  48. package/src/dev-compose.ts +96 -9
  49. package/src/field-bounds.ts +359 -0
  50. package/src/hooks-generator.ts +81 -4
  51. package/src/model-hooks.ts +158 -12
  52. package/src/schema-ast-v2.ts +114 -10
  53. package/src/type-extractor.ts +374 -39
  54. package/tests/field-bounds-matrix.test.ts +163 -0
  55. package/tests/field-bounds.test.ts +139 -0
  56. package/tests/field-validators.test.ts +139 -0
  57. package/tests/hooks-generator.test.ts +86 -0
  58. package/tests/local-server-image-env.test.ts +93 -0
  59. package/tests/model-constraints.test.ts +293 -0
  60. package/tests/model-hooks.test.ts +56 -0
  61. package/tests/type-extractor.test.ts +49 -0
  62. package/tsconfig.tsbuildinfo +1 -1
@@ -1,4 +1,4 @@
1
1
 
2
- > @supatype/cli@0.1.12 build /home/runner/work/supatype/supatype/packages/cli
2
+ > @supatype/cli@0.1.13 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,14 +1,13 @@
1
1
 
2
- > @supatype/cli@0.1.12 test /home/runner/work/supatype/supatype/packages/cli
2
+ > @supatype/cli@0.1.13 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) 157ms
9
- ✓ tests/type-extractor.test.ts (43 tests) 304ms
10
- ✓ tests/runtime-contract.test.ts (49 tests) 178ms
11
- ✓ tests/model-hooks.test.ts (19 tests) 165ms
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
12
11
  stdout | tests/init.test.ts > scaffold() > creates all expected files
13
12
   created package.json
14
13
  created supatype.config.ts
@@ -295,11 +294,13 @@
295
294
  created public/.gitkeep
296
295
  created .gitignore
297
296
 
298
- ✓ tests/init.test.ts (26 tests) 155ms
299
- ✓ tests/external-database-compose.test.ts (17 tests) 14ms
300
- ✓ tests/field-masking-tier.test.ts (16 tests) 16ms
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
301
302
 
302
- ✓ tests/dev-ui.test.ts (21 tests) 131ms
303
+ ✓ tests/dev-ui.test.ts (21 tests) 145ms
303
304
 
304
305
  [supatype] Shutting down…
305
306
  stdout | tests/docker-runtime.test.ts > requireDockerDaemon > exits when the daemon is unavailable
@@ -310,33 +311,40 @@
310
311
 
311
312
  docker: daemon down
312
313
 
313
- ✓ tests/docker-runtime.test.ts (10 tests) 31ms
314
- ✓ tests/hooks-generator.test.ts (5 tests) 6103ms
315
- ✓ typechecks under strict mode, together with a handler that uses it  3057ms
316
- ✓ rejects a handler for a table that declares no hook  3005ms
317
- ✓ tests/config.test.ts (19 tests) 8949ms
318
- ✓ loads a valid supatype.config.ts (plain export default, no package imports)  762ms
319
- ✓ normalizes shorthand schema string to { path, pg_schema }  876ms
320
- ✓ loads a supatype.config.js (plain ESM)  841ms
321
- ✓ loads config without a versions section (latest by default)  938ms
322
- ✓ prefers supatype.config.ts over supatype.config.js when both exist  935ms
323
- ✓ supports optional output field in config  932ms
324
- ✓ merges supatype.local.config.ts over base  1930ms
325
- ✓ loads defineConfig import before @supatype/cli is installed (init scaffold)  1719ms
326
- ✓ tests/db-preflight.test.ts (14 tests) 15ms
327
- ✓ tests/functions-deno-types.test.ts (7 tests) 4144ms
328
- ✓ tsc fails with Cannot find name Deno without ambient types  2908ms
329
- ✓ tsc passes for Deno.env after ensureFunctionsDenoTypes  1215ms
330
- ✓ tests/external-database-config.test.ts (14 tests) 13ms
331
- ✓ tests/cache-clean.test.ts (8 tests) 2514ms
332
- ✓ keeps pinned versions and removes the rest  832ms
333
- ✓ --force removes pinned versions  820ms
334
- ✓ explicit version removes even when pinned (with warning)  829ms
335
- ✓ tests/command-chrome-coverage.test.ts (1 test) 20ms
336
- ✓ tests/hook-upload.test.ts (8 tests) 14ms
337
- ✓ tests/env-file.test.ts (9 tests) 16ms
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
338
343
  stdout | tests/link.test.ts > link model > migrates cloud.json into link.json
339
344
   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
+
340
348
  created supatype.config.ts
341
349
  created schema/index.ts
342
350
  created .env
@@ -344,14 +352,11 @@
344
352
  created seeds/.gitkeep
345
353
  created public/.gitkeep
346
354
  created .gitignore
347
- stderr | tests/link.test.ts > link model > migrates cloud.json into link.json
348
-
349
- [supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
350
355
 
351
- ✓ tests/link.test.ts (4 tests) 3151ms
352
- ✓ resolveTarget returns cloud mode with /api/v1 prefix  1039ms
353
- ✓ resolveTarget returns self-host mode with /platform/v1 prefix  1059ms
354
- ✓ targetSchemaRollback posts to /platform/v1 when linked  1043ms
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
360
  stdout | tests/admin-ensure.test.ts > init admin seed in .env > writes SUPATYPE_ADMIN_* when scaffold options include credentials
356
361
   created package.json
357
362
  created supatype.config.ts
@@ -362,7 +367,7 @@
362
367
  created public/.gitkeep
363
368
  created .gitignore
364
369
 
365
- ✓ tests/admin-ensure.test.ts (10 tests) 187ms
370
+ ✓ tests/admin-ensure.test.ts (10 tests) 164ms
366
371
  ✓ tests/service-role-check.test.ts (10 tests) 12ms
367
372
  stdout | tests/admin-studio-membership.test.ts > first admin user creation > does not write a role into app_metadata
368
373
  [supatype] Admin user "admin@example.com" created (role: admin).
@@ -380,42 +385,43 @@
380
385
  [supatype] Admin user "admin@example.com" created (role: admin).
381
386
  [supatype] Log in at /admin after starting the dev server.
382
387
 
383
- ✓ tests/admin-studio-membership.test.ts (5 tests) 488ms
384
- ✓ tests/augmentation-generator.test.ts (6 tests) 20ms
385
- ✓ tests/pull-utils.test.ts (49 tests) 14ms
386
- ✓ tests/schema-sources.test.ts (5 tests) 1281ms
387
- ✓ buildSchemaSourcesPayload includes manifest metadata  609ms
388
- ✓ restore overwrites modified local files  625ms
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
389
407
  stderr | tests/binary-cache-cloud-overrides.test.ts > isLinkedToCloudProject > is true when .supatype/cloud.json has projectSlug
390
408
  [supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
391
409
 
392
- ✓ tests/binary-cache-cloud-overrides.test.ts (11 tests) 18ms
393
- ✓ tests/homebrew-formula.test.ts (4 tests) 208ms
394
- ✓ tests/minisign.test.ts (5 tests) 17ms
395
- ✓ tests/local-secrets.test.ts (5 tests) 9ms
396
- ✓ tests/api-schemas.test.ts (10 tests) 10ms
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
397
415
  stdout | tests/storage-provision.test.ts > provisionBuckets > POSTs each bucket to the storage API
398
416
  [supatype] Storage bucket "photos" ready.
399
417
 
400
418
  stdout | tests/storage-provision.test.ts > provisionBuckets > POSTs each bucket to the storage API
401
419
  [supatype] Storage bucket "avatars" ready.
402
420
 
403
- ✓ tests/storage-provision.test.ts (6 tests) 12ms
404
- ✓ tests/cached-artifact-format.test.ts (7 tests) 11ms
405
- ✓ tests/keys.test.ts (11 tests) 18356ms
406
- ✓ exits 0 with --secret  1919ms
407
- ✓ outputs ANON_KEY= line  1898ms
408
- ✓ outputs SERVICE_ROLE_KEY= line  1634ms
409
- ✓ ANON_KEY is a valid three-part JWT  1372ms
410
- ✓ SERVICE_ROLE_KEY payload has role: service_role  1517ms
411
- ✓ JWT has exp in the future  1479ms
412
- ✓ --exp-years changes the expiry window  2842ms
413
- ✓ reads JWT_SECRET from environment variable  1572ms
414
- ✓ reads JWT_SECRET from .env file  1412ms
415
- ✓ exits non-zero when no secret is available  1301ms
416
- ✓ keys --help shows --secret and --exp-years options  1405ms
421
+ ✓ tests/storage-provision.test.ts (6 tests) 11ms
422
+ ✓ tests/cached-artifact-format.test.ts (7 tests) 12ms
417
423
  ✓ tests/target-client-refresh.test.ts (3 tests) 10ms
418
- ✓ tests/proxy-dev-app.test.ts (7 tests) 7ms
424
+ ✓ tests/proxy-dev-app.test.ts (7 tests) 6ms
419
425
  stdout | tests/app-command.test.ts > supatype app add --static > sets app.mode=static and static_dir in supatype.config.ts
420
426
   created package.json
421
427
  created supatype.config.ts
@@ -436,77 +442,77 @@
436
442
  created public/.gitkeep
437
443
  created .gitignore
438
444
 
439
- ✓ tests/service-role-routes.test.ts (4 tests) 1708ms
440
- ✓ reads the declared list  627ms
441
- ✓ is an empty list when a project declares none  549ms
442
- ✓ sends what the project declared, hook entries included  527ms
443
- ✓ tests/init-dependency-versions.test.ts (4 tests) 38ms
444
- ✓ tests/app-command.test.ts (2 tests) 3092ms
445
- ✓ sets app.mode=static and static_dir in supatype.config.ts  1528ms
446
- ✓ creates the static directory when missing  1558ms
447
- ✓ tests/type-resolver.test.ts (2 tests) 16ms
448
- ✓ tests/engine-push-output.test.ts (7 tests) 8ms
449
- ✓ tests/tsx-runner.test.ts (7 tests) 3030ms
450
- ✓ evaluates a simple expression and returns stdout  451ms
451
- ✓ evaluates TypeScript syntax (type annotations)  361ms
452
- ✓ can serialize a JSON object to stdout  422ms
453
- ✓ returns non-zero exit code on syntax error  402ms
454
- ✓ returns non-zero exit code on runtime error  359ms
455
- ✓ captures stderr separately from stdout  379ms
456
- ✓ runs a .ts file and returns its stdout  650ms
457
- ✓ tests/command-chrome-wrap.test.ts (3 tests) 7ms
458
- ✓ tests/cli-help.test.ts (16 tests) 24015ms
459
- ✓ --help lists all top-level commands  2056ms
460
- ✓ --version prints package.json version  1897ms
461
- ✓ self-update --help describes the command  1356ms
462
- ✓ init --help describes the init command  1430ms
463
- ✓ push --help describes the push command and --yes flag  1473ms
464
- ✓ diff --help describes the diff command  1439ms
465
- ✓ pull --help describes scaffold pull command  1415ms
466
- ✓ doctor --help describes drift report command  1476ms
467
- ✓ introspect --help describes database introspection command  1397ms
468
- ✓ adopt --help describes adoption ceremony command  1408ms
469
- ✓ reset --help shows --yes flag  1413ms
470
- ✓ app --help describes the app command with add/remove subcommands  1417ms
471
- ✓ app add --help shows --static and --port options  1474ms
472
- ✓ self-host --help shows compose only (legacy commands hidden)  1452ms
473
- ✓ self-host compose --help shows compose subcommands  1435ms
474
- ✓ unknown command exits non-zero  1469ms
475
- ✓ tests/cli-install-method.test.ts (8 tests) 8ms
476
- ✓ tests/archive-name-alias.test.ts (4 tests) 7ms
477
- ✓ tests/ensure-binary.test.ts (2 tests) 7ms
478
- ✓ tests/init-project-detect.test.ts (4 tests) 12ms
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
454
+ ✓ 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
479
485
  ✓ tests/doctor-render.test.ts (3 tests) 6ms
480
- ✓ tests/required-host-components.test.ts (4 tests) 7ms
481
- ✓ tests/ui-messages.test.ts (5 tests) 6ms
482
- ✓ tests/normalize-admin-config.test.ts (1 test) 8ms
483
- ✓ tests/doctor-service-role.test.ts (4 tests) 7ms
484
- ✓ tests/ui-confirm.test.ts (3 tests) 6ms
485
- ✓ tests/docker-postgres.test.ts (5 tests) 8ms
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
491
+ ✓ tests/docker-postgres.test.ts (5 tests) 4ms
486
492
  ✓ tests/binary-download-lock.test.ts (2 tests) 6ms
487
- ✓ tests/dev-session-lock.test.ts (2 tests) 6ms
488
- ✓ tests/dev-ports.test.ts (3 tests) 8ms
489
- ✓ tests/route-manifest.test.ts (1 test) 4ms
490
- ✓ tests/config-load-failure.test.ts (2 tests) 3570ms
491
- ✓ is reported, rather than treated as absent  2076ms
492
- ✓ does not stop the CLI working with no config at all  1491ms
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
493
496
  ✓ tests/dev-ready-panel.test.ts (2 tests) 5ms
494
- ✓ tests/studio-admin-roles.test.ts (3 tests) 5ms
497
+ ✓ 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
495
501
  ✓ tests/realtime-launch.test.ts (1 test) 5ms
496
- ✓ tests/release-pins.test.ts (2 tests) 3ms
502
+ ✓ tests/release-pins.test.ts (2 tests) 6ms
497
503
  ✓ tests/ensure-dev-api-config.test.ts (1 test) 5ms
498
- ✓ tests/seed-discover.test.ts (2 tests) 12ms
499
- ✓ tests/rest-cache-admin.test.ts (1 test) 39ms
500
- ✓ tests/init-package-json.test.ts (1 test) 4ms
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
501
507
  ✓ tests/pg-spawn-env.test.ts (2 tests) 4ms
502
- ✓ tests/resolve-api-url.test.ts (2 tests) 6ms
503
- ✓ tests/migrate-from-v1.test.ts (1 test) 15ms
508
+ ✓ tests/resolve-api-url.test.ts (2 tests) 4ms
509
+ ✓ tests/migrate-from-v1.test.ts (1 test) 10ms
504
510
  ✓ tests/cli-package-version.test.ts (1 test) 4ms
505
- ✓ tests/postgres-archive-tag.test.ts (1 test) 3ms
511
+ ✓ tests/postgres-archive-tag.test.ts (1 test) 2ms
506
512
  ✓ tests/stdin-after-ink.test.ts (1 test) 3ms
507
513
 
508
-  Test Files  73 passed (73)
509
-  Tests  589 passed (589)
510
-  Start at  22:59:36
511
-  Duration  47.15s (transform 6.84s, setup 0ms, import 43.14s, tests 82.45s, environment 17ms)
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)
512
518
 
@@ -1,4 +1,4 @@
1
1
 
2
- > @supatype/cli@0.1.12 typecheck /home/runner/work/supatype/supatype/packages/cli
2
+ > @supatype/cli@0.1.13 typecheck /home/runner/work/supatype/supatype/packages/cli
3
3
  > tsc --project tsconfig.json --noEmit && tsc --project tests/tsconfig.json --noEmit
4
4
 
@@ -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.12";
12
+ export const EMBEDDED_CLI_VERSION = "0.1.13";
13
13
  //# sourceMappingURL=cli-version-embedded.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/commands/db.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAiBxC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyOjD"}
1
+ {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/commands/db.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAiBxC,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmQjD"}
@@ -184,13 +184,35 @@ export function registerDb(program) {
184
184
  info(`\nApplying ${fixable.length} remediation(s) in one transaction...`);
185
185
  try {
186
186
  await applyRemedies(client, fixable);
187
- info("Applied. Re-run `supatype db check` to confirm.");
188
187
  }
189
188
  catch (err) {
190
189
  error(`Rolled back: the database is unchanged: ${err.message}`);
191
190
  process.exitCode = 1;
192
191
  return;
193
192
  }
193
+ // Re-read rather than report the commit. A committed statement is not a fixed finding:
194
+ // `GRANT` on an object the caller does not own raises `WARNING: no privileges were
195
+ // granted` and commits happily, so "Applied" was a claim about the transaction rather
196
+ // than about the database. Checking is the whole job of this command.
197
+ const after = await runPreflight(client, {
198
+ schema: schema,
199
+ ...(opts.authenticatorPassword !== undefined && {
200
+ authenticatorPassword: opts.authenticatorPassword,
201
+ }),
202
+ });
203
+ const stillFailing = transactionalRemedies(after);
204
+ if (stillFailing.length === 0) {
205
+ info(`Applied. ${fixable.length} finding(s) fixed and confirmed.`);
206
+ }
207
+ else {
208
+ error(`\nApplied, but ${stillFailing.length} of ${fixable.length} finding(s) are still failing:`);
209
+ for (const r of stillFailing)
210
+ error(` ${r.title}: ${r.detail}`);
211
+ error("\n The statements committed without error and changed nothing that the check can see.\n" +
212
+ " The usual cause is a privilege the connected role does not hold: Postgres reports\n" +
213
+ " that as a warning, not an error. Re-run with --emit and apply the SQL as an owner.");
214
+ process.exitCode = 1;
215
+ }
194
216
  }
195
217
  if (manual.length > 0) {
196
218
  warn(`\n${manual.length} finding(s) cannot be fixed in a transaction:`);
@@ -1 +1 @@
1
- {"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/commands/db.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MA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,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,MAAM,EAAE,CAAA;QACtE,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM;YAAE,KAAK,CAAC,IAAI,CAAC,CAAA;aACjC,IAAI,CAAC,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM;YAAE,IAAI,CAAC,IAAI,CAAC,CAAA;;YACjE,KAAK,CAAC,IAAI,CAAC,CAAA;QAChB,IAAI,CAAC,CAAC,MAAM;YAAE,KAAK,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,CAAA;IAC7C,CAAC;AACH,CAAC"}
@@ -11,13 +11,6 @@ interface DoctorItem {
11
11
  /** Exported for tests: the label form is easy to get subtly wrong per item kind. */
12
12
  export declare function printSection(title: string, items: DoctorItem[]): void;
13
13
  export declare function registerDoctor(program: Command): void;
14
- /**
15
- * Whether declared hooks can actually run.
16
- *
17
- * Worth its own section because every failure here is silent: a hook whose function is missing, or a
18
- * stack with functions switched off, produces no error anywhere, the write just succeeds
19
- * unvalidated. Drift you cannot see is the thing doctor exists for.
20
- */
21
14
  export declare function printHooks(report: HooksReport): void;
22
15
  /**
23
16
  * Report which functions may see the service-role key, and which grants do nothing.
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOxC,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE3F,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAQD,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,IAAI,CAUrE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyErD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAuBpD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,IAAI,CAcN"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOxC,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE3F,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAQD,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,IAAI,CAUrE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyErD;AAsCD,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAwBpD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,IAAI,CAcN"}
@@ -89,7 +89,33 @@ export function registerDoctor(program) {
89
89
  * stack with functions switched off, produces no error anywhere, the write just succeeds
90
90
  * unvalidated. Drift you cannot see is the thing doctor exists for.
91
91
  */
92
+ /**
93
+ * Field validators, reported separately from hooks because the consequence differs.
94
+ *
95
+ * A hook that never fires is a step that did not happen. A validator that never fires would be a
96
+ * field written unchecked, so the server refuses the write instead: these fields cannot be saved at
97
+ * all until the function exists, and the line has to say that rather than imply a silent gap.
98
+ */
99
+ function printFieldValidators(report) {
100
+ if (report.validators.length === 0)
101
+ return;
102
+ plain(`\nField validators (${report.validators.length}):\n`);
103
+ for (const entry of report.validators) {
104
+ const broken = report.validatorsMissing.some((m) => m.model === entry.model && m.field === entry.field);
105
+ plain(` ${broken ? "✗" : "•"} ${entry.model}.${entry.field} → ${entry.function}`);
106
+ }
107
+ if (report.validatorsMissing.length > 0) {
108
+ plain("\n Those marked ✗ name a function that does not exist. An unreachable validator refuses");
109
+ plain(" the write, so these fields cannot be saved until the function is created.");
110
+ plain(" Create it with: supatype hooks new <name>");
111
+ }
112
+ if (report.validatorMapMissing) {
113
+ plain("\n .supatype/manifest.json carries no validator map, so no field is being checked.");
114
+ plain(" Run: supatype push");
115
+ }
116
+ }
92
117
  export function printHooks(report) {
118
+ printFieldValidators(report);
93
119
  if (report.declared.length === 0)
94
120
  return;
95
121
  plain(`\nHooks (${report.declared.length}):\n`);
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACrG,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,4BAA4B,E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MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IACxC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,KAAK,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC,CAAA;IACpD,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QACpB,KAAK,CAAC,yFAAyF,CAAC,CAAA;IAClG,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,QAAQ;QAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IACvD,KAAK,CAAC,yFAAyF,CAAC,CAAA;AAClG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA6CxC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoDnD"}
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAkDxC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoDnD"}
@@ -1,7 +1,7 @@
1
1
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { loadConfig, loadSchemaAst } from "../config.js";
4
- import { syncManifestHooks, validateModelHooks, writeHooksModule } from "../model-hooks.js";
4
+ import { syncManifestHooks, validateModelHooks, validateModelValidators, writeHooksModule, } from "../model-hooks.js";
5
5
  import { adapterEntry, readHookUpload } from "../hook-upload.js";
6
6
  import { checkServiceRoleRoutes, serviceRoleProblemLines } from "../service-role-check.js";
7
7
  import { fatalError } from "../ui/fatal.js";
@@ -248,11 +248,19 @@ function assertServiceRoleGrantsResolve(cwd, config) {
248
248
  });
249
249
  }
250
250
  function assertModelHooksResolve(cwd, config, ast) {
251
- const problems = validateModelHooks(ast, hooksPathFromProject(config, cwd), cwd);
252
- if (problems.length === 0)
253
- return;
254
- fatalError("A model declares a hook whose function does not exist.", problems, {
255
- brand: { intro: "Push" },
256
- });
251
+ const dir = hooksPathFromProject(config, cwd);
252
+ const problems = validateModelHooks(ast, dir, cwd);
253
+ if (problems.length > 0) {
254
+ fatalError("A model declares a hook whose function does not exist.", problems, {
255
+ brand: { intro: "Push" },
256
+ });
257
+ }
258
+ // Reported separately from hooks, because the fix is different: a missing validator means a field
259
+ // nobody is checking, and the message should say so rather than talk about lifecycle events.
260
+ const validatorProblems = validateModelValidators(ast, dir, cwd);
261
+ if (validatorProblems.length > 0) {
262
+ fatalError("A model declares a field validator whose function does not exist, so that field would be " +
263
+ "written unchecked.", validatorProblems, { brand: { intro: "Push" } });
264
+ }
257
265
  }
258
266
  //# sourceMappingURL=push.js.map