@supatype/cli 0.2.0 → 0.3.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.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +190 -153
- package/.turbo/turbo-typecheck.log +1 -1
- package/dist/api-config-cache.d.ts +34 -0
- package/dist/api-config-cache.d.ts.map +1 -0
- package/dist/api-config-cache.js +123 -0
- package/dist/api-config-cache.js.map +1 -0
- package/dist/cache-identity-scope.d.ts +38 -0
- package/dist/cache-identity-scope.d.ts.map +1 -0
- package/dist/cache-identity-scope.js +70 -0
- package/dist/cache-identity-scope.js.map +1 -0
- package/dist/cache-provider.d.ts +30 -0
- package/dist/cache-provider.d.ts.map +1 -0
- package/dist/cache-provider.js +60 -0
- package/dist/cache-provider.js.map +1 -0
- package/dist/cli-version-embedded.js +1 -1
- package/dist/commands/add.js +1 -1
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/cache.d.ts +1 -1
- package/dist/commands/cache.js +3 -3
- package/dist/commands/cache.js.map +1 -1
- package/dist/commands/cloud.d.ts.map +1 -1
- package/dist/commands/cloud.js +2 -1
- package/dist/commands/cloud.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +2 -1
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +61 -8
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +2 -1
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/functions.d.ts.map +1 -1
- package/dist/commands/functions.js +6 -2
- package/dist/commands/functions.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +13 -9
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/keys.d.ts +14 -0
- package/dist/commands/keys.d.ts.map +1 -1
- package/dist/commands/keys.js +37 -0
- package/dist/commands/keys.js.map +1 -1
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +2 -1
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +52 -1
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/self-host.d.ts.map +1 -1
- package/dist/commands/self-host.js +9 -0
- package/dist/commands/self-host.js.map +1 -1
- package/dist/compose-services.d.ts.map +1 -1
- package/dist/compose-services.js +2 -1
- package/dist/compose-services.js.map +1 -1
- package/dist/dev-compose.d.ts.map +1 -1
- package/dist/dev-compose.js +18 -7
- package/dist/dev-compose.js.map +1 -1
- package/dist/engine-floor.d.ts +11 -1
- package/dist/engine-floor.d.ts.map +1 -1
- package/dist/engine-floor.js +49 -16
- package/dist/engine-floor.js.map +1 -1
- package/dist/functions-deno-types.d.ts +9 -0
- package/dist/functions-deno-types.d.ts.map +1 -1
- package/dist/functions-deno-types.js +45 -1
- package/dist/functions-deno-types.js.map +1 -1
- package/dist/functions-router-gen.d.ts.map +1 -1
- package/dist/functions-router-gen.js +113 -81
- package/dist/functions-router-gen.js.map +1 -1
- package/dist/kong-config.d.ts +1 -1
- package/dist/model-cache.d.ts +17 -0
- package/dist/model-cache.d.ts.map +1 -0
- package/dist/model-cache.js +45 -0
- package/dist/model-cache.js.map +1 -0
- package/dist/model-hooks.d.ts +5 -0
- package/dist/model-hooks.d.ts.map +1 -1
- package/dist/model-hooks.js +29 -1
- package/dist/model-hooks.js.map +1 -1
- package/dist/model-versioning.d.ts +80 -0
- package/dist/model-versioning.d.ts.map +1 -0
- package/dist/model-versioning.js +140 -0
- package/dist/model-versioning.js.map +1 -0
- package/dist/postgres-ctl.d.ts +55 -0
- package/dist/postgres-ctl.d.ts.map +1 -1
- package/dist/postgres-ctl.js +84 -8
- package/dist/postgres-ctl.js.map +1 -1
- package/dist/preview-config-check.d.ts +21 -0
- package/dist/preview-config-check.d.ts.map +1 -0
- package/dist/preview-config-check.js +47 -0
- package/dist/preview-config-check.js.map +1 -0
- package/dist/project-config.d.ts +182 -5
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +125 -8
- package/dist/project-config.js.map +1 -1
- package/dist/resolve-target.d.ts +9 -0
- package/dist/resolve-target.d.ts.map +1 -1
- package/dist/resolve-target.js.map +1 -1
- package/dist/rest-cache-admin.d.ts.map +1 -1
- package/dist/rest-cache-admin.js +6 -2
- package/dist/rest-cache-admin.js.map +1 -1
- package/dist/schema-ast-v2.d.ts +32 -1
- package/dist/schema-ast-v2.d.ts.map +1 -1
- package/dist/schema-ast-v2.js +14 -1
- package/dist/schema-ast-v2.js.map +1 -1
- package/dist/self-host-compose.d.ts +20 -1
- package/dist/self-host-compose.d.ts.map +1 -1
- package/dist/self-host-compose.js +181 -27
- package/dist/self-host-compose.js.map +1 -1
- package/dist/studio-admin-roles.d.ts +8 -1
- package/dist/studio-admin-roles.d.ts.map +1 -1
- package/dist/studio-admin-roles.js +16 -2
- package/dist/studio-admin-roles.js.map +1 -1
- package/dist/type-extractor.d.ts +7 -0
- package/dist/type-extractor.d.ts.map +1 -1
- package/dist/type-extractor.js +234 -3
- package/dist/type-extractor.js.map +1 -1
- package/package.json +2 -2
- package/src/api-config-cache.ts +142 -0
- package/src/cache-identity-scope.ts +92 -0
- package/src/cache-provider.ts +61 -0
- package/src/cli-version-embedded.ts +1 -1
- package/src/commands/add.ts +1 -1
- package/src/commands/cache.ts +3 -3
- package/src/commands/cloud.ts +2 -1
- package/src/commands/deploy.ts +2 -1
- package/src/commands/dev.ts +68 -7
- package/src/commands/diff.ts +2 -1
- package/src/commands/functions.ts +6 -2
- package/src/commands/init.ts +13 -9
- package/src/commands/keys.ts +40 -0
- package/src/commands/migrate.ts +2 -1
- package/src/commands/push.ts +57 -1
- package/src/commands/self-host.ts +9 -0
- package/src/compose-services.ts +2 -1
- package/src/dev-compose.ts +18 -7
- package/src/engine-floor.ts +73 -16
- package/src/functions-deno-types.ts +48 -1
- package/src/functions-router-gen.ts +113 -81
- package/src/kong-config.ts +1 -1
- package/src/model-cache.ts +74 -0
- package/src/model-hooks.ts +26 -2
- package/src/model-versioning.ts +167 -0
- package/src/postgres-ctl.ts +103 -9
- package/src/preview-config-check.ts +52 -0
- package/src/project-config.ts +273 -11
- package/src/resolve-target.ts +11 -1
- package/src/rest-cache-admin.ts +8 -2
- package/src/schema-ast-v2.ts +47 -0
- package/src/self-host-compose.ts +204 -27
- package/src/studio-admin-roles.ts +16 -2
- package/src/type-extractor.ts +281 -2
- package/tests/api-config-cache-seed.test.ts +180 -0
- package/tests/cache-identity-scope.test.ts +61 -0
- package/tests/cache-provider-config.test.ts +132 -0
- package/tests/engine-floor.test.ts +43 -0
- package/tests/external-database-compose.test.ts +74 -3
- package/tests/field-masking-tier.test.ts +3 -3
- package/tests/fixtures/identity-scope-corpus.json +42 -0
- package/tests/functions-concurrency.test.ts +71 -0
- package/tests/init.test.ts +36 -2
- package/tests/model-cache-declaration.test.ts +229 -0
- package/tests/model-cache-manifest.test.ts +99 -0
- package/tests/model-hooks.test.ts +55 -0
- package/tests/model-versions.test.ts +229 -0
- package/tests/native-keyspace.test.ts +130 -0
- package/tests/preview-config-check.test.ts +104 -0
- package/tests/rest-cache-admin.test.ts +36 -0
- package/tests/runtime-contract.test.ts +176 -22
- package/tests/self-host-keys.test.ts +92 -0
- package/tests/studio-admin-roles.test.ts +32 -0
- package/tests/type-extractor.test.ts +113 -0
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @supatype/cli@0.
|
|
2
|
+
> @supatype/cli@0.3.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
|
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @supatype/cli@0.
|
|
2
|
+
> @supatype/cli@0.3.0 test /home/runner/work/supatype/supatype/packages/cli
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/home/runner/work/supatype/supatype/packages/cli[39m
|
|
7
7
|
|
|
8
|
-
[32m✓[39m tests/
|
|
9
|
-
[32m✓[39m tests/
|
|
10
|
-
[32m✓[39m tests/model-hooks.test.ts [2m([22m[
|
|
11
|
-
[32m✓[39m tests/runtime-contract.test.ts [2m([22m[
|
|
8
|
+
[32m✓[39m tests/type-extractor.test.ts [2m([22m[2m48 tests[22m[2m)[22m[33m 507[2mms[22m[39m
|
|
9
|
+
[32m✓[39m tests/access-composition.test.ts [2m([22m[2m26 tests[22m[2m)[22m[33m 397[2mms[22m[39m
|
|
10
|
+
[32m✓[39m tests/model-hooks.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 241[2mms[22m[39m
|
|
11
|
+
[32m✓[39m tests/runtime-contract.test.ts [2m([22m[2m57 tests[22m[2m)[22m[33m 323[2mms[22m[39m
|
|
12
12
|
[90mstdout[2m | tests/init.test.ts[2m > [22m[2mscaffold()[2m > [22m[2mcreates all expected files
|
|
13
13
|
[22m[39m created package.json
|
|
14
14
|
created supatype.config.ts
|
|
@@ -295,14 +295,49 @@
|
|
|
295
295
|
created public/.gitkeep
|
|
296
296
|
created .gitignore
|
|
297
297
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
298
|
+
[90mstdout[2m | tests/init.test.ts[2m > [22m[2mscaffold()[2m > [22m[2ma scaffolded .env never names MinIO or its port
|
|
299
|
+
[22m[39m created package.json
|
|
300
|
+
created supatype.config.ts
|
|
301
|
+
created schema/index.ts
|
|
302
|
+
created .env
|
|
303
|
+
created seed.ts
|
|
304
|
+
created seeds/.gitkeep
|
|
305
|
+
created public/.gitkeep
|
|
306
|
+
created .gitignore
|
|
307
|
+
created package.json
|
|
308
|
+
created supatype.config.ts
|
|
309
|
+
created schema/index.ts
|
|
310
|
+
created .env
|
|
311
|
+
created seed.ts
|
|
312
|
+
created seeds/.gitkeep
|
|
313
|
+
created public/.gitkeep
|
|
314
|
+
created .gitignore
|
|
302
315
|
|
|
303
|
-
|
|
316
|
+
[90mstdout[2m | tests/init.test.ts[2m > [22m[2mscaffold()[2m > [22m[2mlocal storage points at the port the object store actually publishes
|
|
317
|
+
[22m[39m created package.json
|
|
318
|
+
created supatype.config.ts
|
|
319
|
+
created schema/index.ts
|
|
320
|
+
created .env
|
|
321
|
+
created seed.ts
|
|
322
|
+
created seeds/.gitkeep
|
|
323
|
+
created public/.gitkeep
|
|
324
|
+
created .gitignore
|
|
325
|
+
|
|
326
|
+
[32m✓[39m tests/init.test.ts [2m([22m[2m28 tests[22m[2m)[22m[32m 254[2mms[22m[39m
|
|
327
|
+
[32m✓[39m tests/external-database-compose.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
328
|
+
[32m✓[39m tests/model-constraints.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 174[2mms[22m[39m
|
|
329
|
+
[32m✓[39m tests/model-versions.test.ts [2m([22m[2m19 tests[22m[2m)[22m[32m 62[2mms[22m[39m
|
|
330
|
+
[32m✓[39m tests/api-config-cache-seed.test.ts [2m([22m[2m15 tests[22m[2m)[22m[32m 39[2mms[22m[39m
|
|
331
|
+
[32m✓[39m tests/model-cache-declaration.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 102[2mms[22m[39m
|
|
332
|
+
[32m✓[39m tests/field-masking-tier.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
333
|
+
|
|
334
|
+
[32m✓[39m tests/dev-ui.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m 112[2mms[22m[39m
|
|
304
335
|
|
|
305
336
|
[supatype] Shutting down…
|
|
337
|
+
[32m✓[39m tests/hooks-generator.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 8217[2mms[22m[39m
|
|
338
|
+
[33m[2m✓[22m[39m typechecks under strict mode, together with a handler that uses it [33m 2986[2mms[22m[39m
|
|
339
|
+
[33m[2m✓[22m[39m rejects a handler for a table that declares no hook [33m 2753[2mms[22m[39m
|
|
340
|
+
[33m[2m✓[22m[39m typechecks with a validator written the way the docs will show it [33m 2352[2mms[22m[39m
|
|
306
341
|
[90mstdout[2m | tests/docker-runtime.test.ts[2m > [22m[2mrequireDockerDaemon[2m > [22m[2mexits when the daemon is unavailable
|
|
307
342
|
[22m[39m
|
|
308
343
|
Start the Docker daemon (e.g. sudo systemctl start docker), then try again.
|
|
@@ -311,54 +346,52 @@
|
|
|
311
346
|
|
|
312
347
|
docker: daemon down
|
|
313
348
|
|
|
314
|
-
[32m✓[39m tests/docker-runtime.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
315
|
-
[32m✓[39m tests/
|
|
316
|
-
[33m[2m✓[22m[39m
|
|
317
|
-
[33m[2m✓[22m[39m
|
|
318
|
-
[33m[2m✓[22m[39m
|
|
319
|
-
|
|
320
|
-
[33m[2m✓[22m[39m
|
|
321
|
-
[33m[2m✓[22m[39m
|
|
322
|
-
[33m[2m✓[22m[39m
|
|
323
|
-
[33m[2m✓[22m[39m loads
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
[33m[2m✓[22m[39m
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
[32m✓[39m tests/cache-
|
|
331
|
-
|
|
332
|
-
[33m[2m✓[22m[39m
|
|
333
|
-
[33m[2m✓[22m[39m
|
|
334
|
-
[32m✓[39m tests/
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
[32m✓[39m tests/field-
|
|
339
|
-
[32m✓[39m tests/
|
|
340
|
-
[32m✓[39m tests/
|
|
341
|
-
[32m✓[39m tests/
|
|
342
|
-
[32m✓[39m tests/
|
|
343
|
-
[32m✓[39m tests/hook-upload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
344
|
-
[32m✓[39m tests/env-file.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
349
|
+
[32m✓[39m tests/docker-runtime.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 18[2mms[22m[39m
|
|
350
|
+
[32m✓[39m tests/config.test.ts [2m([22m[2m19 tests[22m[2m)[22m[33m 8166[2mms[22m[39m
|
|
351
|
+
[33m[2m✓[22m[39m loads a valid supatype.config.ts (plain export default, no package imports) [33m 865[2mms[22m[39m
|
|
352
|
+
[33m[2m✓[22m[39m normalizes shorthand schema string to { path, pg_schema } [33m 869[2mms[22m[39m
|
|
353
|
+
[33m[2m✓[22m[39m loads a supatype.config.js (plain ESM) [33m 966[2mms[22m[39m
|
|
354
|
+
[33m[2m✓[22m[39m loads config without a versions section (latest by default) [33m 840[2mms[22m[39m
|
|
355
|
+
[33m[2m✓[22m[39m prefers supatype.config.ts over supatype.config.js when both exist [33m 860[2mms[22m[39m
|
|
356
|
+
[33m[2m✓[22m[39m supports optional output field in config [33m 886[2mms[22m[39m
|
|
357
|
+
[33m[2m✓[22m[39m merges supatype.local.config.ts over base [33m 1488[2mms[22m[39m
|
|
358
|
+
[33m[2m✓[22m[39m loads defineConfig import before @supatype/cli is installed (init scaffold) [33m 1378[2mms[22m[39m
|
|
359
|
+
[32m✓[39m tests/db-preflight.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
360
|
+
[32m✓[39m tests/field-bounds.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
361
|
+
[32m✓[39m tests/cache-clean.test.ts [2m([22m[2m8 tests[22m[2m)[22m[33m 2182[2mms[22m[39m
|
|
362
|
+
[33m[2m✓[22m[39m keeps pinned versions and removes the rest [33m 633[2mms[22m[39m
|
|
363
|
+
[33m[2m✓[22m[39m --force removes pinned versions [33m 817[2mms[22m[39m
|
|
364
|
+
[33m[2m✓[22m[39m explicit version removes even when pinned (with warning) [33m 715[2mms[22m[39m
|
|
365
|
+
[32m✓[39m tests/cache-provider-config.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
366
|
+
[32m✓[39m tests/functions-deno-types.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 2958[2mms[22m[39m
|
|
367
|
+
[33m[2m✓[22m[39m tsc fails with Cannot find name Deno without ambient types [33m 2009[2mms[22m[39m
|
|
368
|
+
[33m[2m✓[22m[39m tsc passes for Deno.env after ensureFunctionsDenoTypes [33m 929[2mms[22m[39m
|
|
369
|
+
[32m✓[39m tests/field-bounds-matrix.test.ts [2m([22m[2m124 tests[22m[2m)[22m[32m 36[2mms[22m[39m
|
|
370
|
+
[32m✓[39m tests/engine-floor.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
371
|
+
[32m✓[39m tests/external-database-config.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
372
|
+
[32m✓[39m tests/compose-services.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
373
|
+
[32m✓[39m tests/field-validators.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 71[2mms[22m[39m
|
|
374
|
+
[32m✓[39m tests/native-keyspace.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 39[2mms[22m[39m
|
|
375
|
+
[32m✓[39m tests/command-chrome-coverage.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
376
|
+
[32m✓[39m tests/hook-upload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
377
|
+
[32m✓[39m tests/env-file.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
345
378
|
[90mstdout[2m | tests/link.test.ts[2m > [22m[2mlink model[2m > [22m[2mmigrates cloud.json into link.json
|
|
346
379
|
[22m[39m created package.json
|
|
347
380
|
created supatype.config.ts
|
|
381
|
+
[90mstderr[2m | tests/link.test.ts[2m > [22m[2mlink model[2m > [22m[2mmigrates cloud.json into link.json
|
|
382
|
+
[22m[39m[supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
|
|
348
383
|
created schema/index.ts
|
|
384
|
+
|
|
349
385
|
created .env
|
|
350
386
|
created seed.ts
|
|
351
387
|
created seeds/.gitkeep
|
|
352
388
|
created public/.gitkeep
|
|
353
389
|
created .gitignore
|
|
354
390
|
|
|
355
|
-
[
|
|
356
|
-
[22m[39m
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
[33m[2m✓[22m[39m resolveTarget returns cloud mode with /api/v1 prefix [33m 899[2mms[22m[39m
|
|
360
|
-
[33m[2m✓[22m[39m resolveTarget returns self-host mode with /platform/v1 prefix [33m 789[2mms[22m[39m
|
|
361
|
-
[33m[2m✓[22m[39m targetSchemaRollback posts to /platform/v1 when linked [33m 867[2mms[22m[39m
|
|
391
|
+
[32m✓[39m tests/link.test.ts [2m([22m[2m4 tests[22m[2m)[22m[33m 3162[2mms[22m[39m
|
|
392
|
+
[33m[2m✓[22m[39m resolveTarget returns cloud mode with /api/v1 prefix [33m 1108[2mms[22m[39m
|
|
393
|
+
[33m[2m✓[22m[39m resolveTarget returns self-host mode with /platform/v1 prefix [33m 992[2mms[22m[39m
|
|
394
|
+
[33m[2m✓[22m[39m targetSchemaRollback posts to /platform/v1 when linked [33m 1051[2mms[22m[39m
|
|
362
395
|
[90mstdout[2m | tests/admin-ensure.test.ts[2m > [22m[2minit admin seed in .env[2m > [22m[2mwrites SUPATYPE_ADMIN_* when scaffold options include credentials
|
|
363
396
|
[22m[39m created package.json
|
|
364
397
|
created supatype.config.ts
|
|
@@ -369,8 +402,8 @@
|
|
|
369
402
|
created public/.gitkeep
|
|
370
403
|
created .gitignore
|
|
371
404
|
|
|
372
|
-
[32m✓[39m tests/admin-ensure.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
373
|
-
[32m✓[39m tests/service-role-check.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
405
|
+
[32m✓[39m tests/admin-ensure.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 149[2mms[22m[39m
|
|
406
|
+
[32m✓[39m tests/service-role-check.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
374
407
|
[90mstdout[2m | tests/admin-studio-membership.test.ts[2m > [22m[2mfirst admin user creation[2m > [22m[2mdoes not write a role into app_metadata
|
|
375
408
|
[22m[39m[supatype] Admin user "admin@example.com" created (role: admin).
|
|
376
409
|
[supatype] Log in at /admin after starting the dev server.
|
|
@@ -387,45 +420,50 @@
|
|
|
387
420
|
[22m[39m[supatype] Admin user "admin@example.com" created (role: admin).
|
|
388
421
|
[supatype] Log in at /admin after starting the dev server.
|
|
389
422
|
|
|
390
|
-
[32m✓[39m tests/admin-studio-membership.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m
|
|
391
|
-
[32m✓[39m tests/augmentation-generator.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
392
|
-
[32m✓[39m tests/pull-utils.test.ts [2m([22m[2m49 tests[22m[2m)[22m[32m
|
|
393
|
-
[32m✓[39m tests/keys.test.ts [2m([22m[2m11 tests[22m[2m)[22m[33m
|
|
394
|
-
[33m[2m✓[22m[39m exits 0 with --secret [33m
|
|
395
|
-
[33m[2m✓[22m[39m outputs ANON_KEY= line [33m
|
|
396
|
-
[33m[2m✓[22m[39m outputs SERVICE_ROLE_KEY= line [33m
|
|
397
|
-
[33m[2m✓[22m[39m ANON_KEY is a valid three-part JWT [33m
|
|
398
|
-
[33m[2m✓[22m[39m SERVICE_ROLE_KEY payload has role: service_role [33m
|
|
399
|
-
[33m[2m✓[22m[39m JWT has exp in the future [33m
|
|
400
|
-
[33m[2m✓[22m[39m --exp-years changes the expiry window [33m
|
|
401
|
-
[33m[2m✓[22m[39m reads JWT_SECRET from environment variable [33m
|
|
402
|
-
[33m[2m✓[22m[39m reads JWT_SECRET from .env file [33m
|
|
403
|
-
[33m[2m✓[22m[39m exits non-zero when no secret is available [33m
|
|
404
|
-
[33m[2m✓[22m[39m keys --help shows --secret and --exp-years options [33m
|
|
405
|
-
[32m✓[39m tests/schema-sources.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m
|
|
406
|
-
[33m[2m✓[22m[39m buildSchemaSourcesPayload includes manifest metadata [33m
|
|
407
|
-
[33m[2m✓[22m[39m restore overwrites modified local files [33m
|
|
423
|
+
[32m✓[39m tests/admin-studio-membership.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m 499[2mms[22m[39m
|
|
424
|
+
[32m✓[39m tests/augmentation-generator.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
425
|
+
[32m✓[39m tests/pull-utils.test.ts [2m([22m[2m49 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
426
|
+
[32m✓[39m tests/keys.test.ts [2m([22m[2m11 tests[22m[2m)[22m[33m 17971[2mms[22m[39m
|
|
427
|
+
[33m[2m✓[22m[39m exits 0 with --secret [33m 1795[2mms[22m[39m
|
|
428
|
+
[33m[2m✓[22m[39m outputs ANON_KEY= line [33m 1603[2mms[22m[39m
|
|
429
|
+
[33m[2m✓[22m[39m outputs SERVICE_ROLE_KEY= line [33m 1405[2mms[22m[39m
|
|
430
|
+
[33m[2m✓[22m[39m ANON_KEY is a valid three-part JWT [33m 1507[2mms[22m[39m
|
|
431
|
+
[33m[2m✓[22m[39m SERVICE_ROLE_KEY payload has role: service_role [33m 1445[2mms[22m[39m
|
|
432
|
+
[33m[2m✓[22m[39m JWT has exp in the future [33m 1351[2mms[22m[39m
|
|
433
|
+
[33m[2m✓[22m[39m --exp-years changes the expiry window [33m 2906[2mms[22m[39m
|
|
434
|
+
[33m[2m✓[22m[39m reads JWT_SECRET from environment variable [33m 1577[2mms[22m[39m
|
|
435
|
+
[33m[2m✓[22m[39m reads JWT_SECRET from .env file [33m 1520[2mms[22m[39m
|
|
436
|
+
[33m[2m✓[22m[39m exits non-zero when no secret is available [33m 1364[2mms[22m[39m
|
|
437
|
+
[33m[2m✓[22m[39m keys --help shows --secret and --exp-years options [33m 1491[2mms[22m[39m
|
|
438
|
+
[32m✓[39m tests/schema-sources.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m 1311[2mms[22m[39m
|
|
439
|
+
[33m[2m✓[22m[39m buildSchemaSourcesPayload includes manifest metadata [33m 664[2mms[22m[39m
|
|
440
|
+
[33m[2m✓[22m[39m restore overwrites modified local files [33m 597[2mms[22m[39m
|
|
441
|
+
[32m✓[39m tests/preview-config-check.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
408
442
|
[90mstderr[2m | tests/binary-cache-cloud-overrides.test.ts[2m > [22m[2misLinkedToCloudProject[2m > [22m[2mis true when .supatype/cloud.json has projectSlug
|
|
409
443
|
[22m[39m[supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
|
|
410
444
|
|
|
411
|
-
[32m✓[39m tests/binary-cache-cloud-overrides.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m
|
|
412
|
-
[32m✓[39m tests/homebrew-formula.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
413
|
-
[32m✓[39m tests/
|
|
414
|
-
[32m✓[39m tests/
|
|
415
|
-
[32m✓[39m tests/
|
|
416
|
-
[32m✓[39m tests/local-secrets.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
417
|
-
[32m✓[39m tests/
|
|
445
|
+
[32m✓[39m tests/binary-cache-cloud-overrides.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 21[2mms[22m[39m
|
|
446
|
+
[32m✓[39m tests/homebrew-formula.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 223[2mms[22m[39m
|
|
447
|
+
[32m✓[39m tests/model-cache-manifest.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
448
|
+
[32m✓[39m tests/local-server-image-env.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
449
|
+
[32m✓[39m tests/minisign.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
450
|
+
[32m✓[39m tests/local-secrets.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
451
|
+
[32m✓[39m tests/functions-concurrency.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
452
|
+
[32m✓[39m tests/readiness-poll.test.ts [2m([22m[2m3 tests[22m[2m)[22m[33m 330[2mms[22m[39m
|
|
453
|
+
[33m[2m✓[22m[39m ends promptly when it carries a deadline [33m 326[2mms[22m[39m
|
|
454
|
+
[32m✓[39m tests/self-host-keys.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
455
|
+
[32m✓[39m tests/api-schemas.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
418
456
|
[90mstdout[2m | tests/storage-provision.test.ts[2m > [22m[2mprovisionBuckets[2m > [22m[2mPOSTs each bucket to the storage API
|
|
419
457
|
[22m[39m[supatype] Storage bucket "photos" ready.
|
|
420
458
|
|
|
421
459
|
[90mstdout[2m | tests/storage-provision.test.ts[2m > [22m[2mprovisionBuckets[2m > [22m[2mPOSTs each bucket to the storage API
|
|
422
460
|
[22m[39m[supatype] Storage bucket "avatars" ready.
|
|
423
461
|
|
|
424
|
-
[32m✓[39m tests/storage-provision.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
425
|
-
[32m✓[39m tests/cached-artifact-format.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
426
|
-
[32m✓[39m tests/
|
|
427
|
-
|
|
428
|
-
[32m✓[39m tests/
|
|
462
|
+
[32m✓[39m tests/storage-provision.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
463
|
+
[32m✓[39m tests/cached-artifact-format.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
464
|
+
[32m✓[39m tests/cache-identity-scope.test.ts [2m([22m[2m33 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
465
|
+
[32m✓[39m tests/target-client-refresh.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
466
|
+
[32m✓[39m tests/studio-admin-roles.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
429
467
|
[32m✓[39m tests/proxy-dev-app.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
430
468
|
[90mstdout[2m | tests/app-command.test.ts[2m > [22m[2msupatype app add --static[2m > [22m[2msets app.mode=static and static_dir in supatype.config.ts
|
|
431
469
|
[22m[39m created package.json
|
|
@@ -447,80 +485,79 @@
|
|
|
447
485
|
created public/.gitkeep
|
|
448
486
|
created .gitignore
|
|
449
487
|
|
|
450
|
-
[32m✓[39m tests/service-role-routes.test.ts [2m([22m[2m4 tests[22m[2m)[22m[33m
|
|
451
|
-
[33m[2m✓[22m[39m reads the declared list [33m
|
|
452
|
-
[33m[2m✓[22m[39m is an empty list when a project declares none [33m
|
|
453
|
-
[33m[2m✓[22m[39m sends what the project declared, hook entries included [33m
|
|
454
|
-
[32m✓[39m tests/app-command.test.ts [2m([22m[2m2 tests[22m[2m)[22m[33m
|
|
455
|
-
[33m[2m✓[22m[39m sets app.mode=static and static_dir in supatype.config.ts [33m
|
|
456
|
-
[33m[2m✓[22m[39m creates the static directory when missing [33m
|
|
457
|
-
[32m✓[39m tests/
|
|
458
|
-
[32m✓[39m tests/
|
|
459
|
-
[32m✓[39m tests/
|
|
460
|
-
[32m✓[39m tests/
|
|
461
|
-
[32m✓[39m tests/
|
|
462
|
-
|
|
463
|
-
[33m[2m✓[22m[39m --
|
|
464
|
-
[33m[2m✓[22m[39m
|
|
465
|
-
[33m[2m✓[22m[39m
|
|
466
|
-
[33m[2m✓[22m[39m
|
|
467
|
-
[33m[2m✓[22m[39m
|
|
468
|
-
[33m[2m✓[22m[39m
|
|
469
|
-
[33m[2m✓[22m[39m
|
|
470
|
-
[33m[2m✓[22m[39m
|
|
471
|
-
[33m[2m✓[22m[39m
|
|
472
|
-
[33m[2m✓[22m[39m
|
|
473
|
-
[33m[2m✓[22m[39m
|
|
474
|
-
[33m[2m✓[22m[39m app
|
|
475
|
-
[33m[2m✓[22m[39m
|
|
476
|
-
[33m[2m✓[22m[39m self-host
|
|
477
|
-
[33m[2m✓[22m[39m
|
|
488
|
+
[32m✓[39m tests/service-role-routes.test.ts [2m([22m[2m4 tests[22m[2m)[22m[33m 1804[2mms[22m[39m
|
|
489
|
+
[33m[2m✓[22m[39m reads the declared list [33m 608[2mms[22m[39m
|
|
490
|
+
[33m[2m✓[22m[39m is an empty list when a project declares none [33m 599[2mms[22m[39m
|
|
491
|
+
[33m[2m✓[22m[39m sends what the project declared, hook entries included [33m 592[2mms[22m[39m
|
|
492
|
+
[32m✓[39m tests/app-command.test.ts [2m([22m[2m2 tests[22m[2m)[22m[33m 3147[2mms[22m[39m
|
|
493
|
+
[33m[2m✓[22m[39m sets app.mode=static and static_dir in supatype.config.ts [33m 1581[2mms[22m[39m
|
|
494
|
+
[33m[2m✓[22m[39m creates the static directory when missing [33m 1564[2mms[22m[39m
|
|
495
|
+
[32m✓[39m tests/compose-parsable-defaults.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
496
|
+
[32m✓[39m tests/rest-cache-admin.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 45[2mms[22m[39m
|
|
497
|
+
[32m✓[39m tests/init-dependency-versions.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 60[2mms[22m[39m
|
|
498
|
+
[32m✓[39m tests/type-resolver.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 24[2mms[22m[39m
|
|
499
|
+
[32m✓[39m tests/engine-push-output.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
500
|
+
[32m✓[39m tests/cli-help.test.ts [2m([22m[2m16 tests[22m[2m)[22m[33m 23650[2mms[22m[39m
|
|
501
|
+
[33m[2m✓[22m[39m --help lists all top-level commands [33m 1432[2mms[22m[39m
|
|
502
|
+
[33m[2m✓[22m[39m --version prints package.json version [33m 1508[2mms[22m[39m
|
|
503
|
+
[33m[2m✓[22m[39m self-update --help describes the command [33m 1414[2mms[22m[39m
|
|
504
|
+
[33m[2m✓[22m[39m init --help describes the init command [33m 1625[2mms[22m[39m
|
|
505
|
+
[33m[2m✓[22m[39m push --help describes the push command and --yes flag [33m 1503[2mms[22m[39m
|
|
506
|
+
[33m[2m✓[22m[39m diff --help describes the diff command [33m 1457[2mms[22m[39m
|
|
507
|
+
[33m[2m✓[22m[39m pull --help describes scaffold pull command [33m 1344[2mms[22m[39m
|
|
508
|
+
[33m[2m✓[22m[39m doctor --help describes drift report command [33m 1512[2mms[22m[39m
|
|
509
|
+
[33m[2m✓[22m[39m introspect --help describes database introspection command [33m 1351[2mms[22m[39m
|
|
510
|
+
[33m[2m✓[22m[39m adopt --help describes adoption ceremony command [33m 1533[2mms[22m[39m
|
|
511
|
+
[33m[2m✓[22m[39m reset --help shows --yes flag [33m 1421[2mms[22m[39m
|
|
512
|
+
[33m[2m✓[22m[39m app --help describes the app command with add/remove subcommands [33m 1491[2mms[22m[39m
|
|
513
|
+
[33m[2m✓[22m[39m app add --help shows --static and --port options [33m 1418[2mms[22m[39m
|
|
514
|
+
[33m[2m✓[22m[39m self-host --help shows compose only (legacy commands hidden) [33m 1477[2mms[22m[39m
|
|
515
|
+
[33m[2m✓[22m[39m self-host compose --help shows compose subcommands [33m 1538[2mms[22m[39m
|
|
516
|
+
[33m[2m✓[22m[39m unknown command exits non-zero [33m 1613[2mms[22m[39m
|
|
478
517
|
[32m✓[39m tests/command-chrome-wrap.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
479
|
-
[32m✓[39m tests/cli-install-method.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
480
|
-
[32m✓[39m tests/
|
|
481
|
-
[32m✓[39m tests/
|
|
482
|
-
[32m✓[39m tests/
|
|
483
|
-
[32m✓[39m tests/ensure-binary.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
484
|
-
[32m✓[39m tests/
|
|
485
|
-
|
|
486
|
-
[33m[2m✓[22m[39m evaluates
|
|
487
|
-
[33m[2m✓[22m[39m
|
|
488
|
-
[33m[2m✓[22m[39m
|
|
489
|
-
[33m[2m✓[22m[39m returns non-zero exit code on
|
|
490
|
-
[33m[2m✓[22m[39m
|
|
491
|
-
[33m[2m✓[22m[39m
|
|
492
|
-
|
|
493
|
-
[32m✓[39m tests/doctor-service-role.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
494
|
-
[32m✓[39m tests/
|
|
495
|
-
[32m✓[39m tests/
|
|
518
|
+
[32m✓[39m tests/cli-install-method.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
519
|
+
[32m✓[39m tests/port-in-use.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
520
|
+
[32m✓[39m tests/archive-name-alias.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
521
|
+
[32m✓[39m tests/doctor-render.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
522
|
+
[32m✓[39m tests/ensure-binary.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
523
|
+
[32m✓[39m tests/tsx-runner.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 3052[2mms[22m[39m
|
|
524
|
+
[33m[2m✓[22m[39m evaluates a simple expression and returns stdout [33m 383[2mms[22m[39m
|
|
525
|
+
[33m[2m✓[22m[39m evaluates TypeScript syntax (type annotations) [33m 367[2mms[22m[39m
|
|
526
|
+
[33m[2m✓[22m[39m can serialize a JSON object to stdout [33m 398[2mms[22m[39m
|
|
527
|
+
[33m[2m✓[22m[39m returns non-zero exit code on syntax error [33m 381[2mms[22m[39m
|
|
528
|
+
[33m[2m✓[22m[39m returns non-zero exit code on runtime error [33m 452[2mms[22m[39m
|
|
529
|
+
[33m[2m✓[22m[39m captures stderr separately from stdout [33m 469[2mms[22m[39m
|
|
530
|
+
[33m[2m✓[22m[39m runs a .ts file and returns its stdout [33m 597[2mms[22m[39m
|
|
531
|
+
[32m✓[39m tests/init-project-detect.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
532
|
+
[32m✓[39m tests/doctor-service-role.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
533
|
+
[32m✓[39m tests/dev-ports-owner.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
534
|
+
[32m✓[39m tests/required-host-components.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
496
535
|
[32m✓[39m tests/ui-messages.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
497
|
-
[32m✓[39m tests/normalize-admin-config.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
498
|
-
[32m✓[39m tests/ui-confirm.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
499
|
-
[32m✓[39m tests/docker-postgres.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
500
|
-
[32m✓[39m tests/binary-download-lock.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
501
|
-
[32m✓[39m tests/dev-session-lock.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
502
|
-
[32m✓[39m tests/dev-ports.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
503
|
-
[32m✓[39m tests/
|
|
504
|
-
|
|
505
|
-
[33m[2m✓[22m[39m
|
|
506
|
-
|
|
507
|
-
[32m✓[39m tests/dev-ready-panel.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
508
|
-
[32m✓[39m tests/
|
|
509
|
-
[32m✓[39m tests/release-pins.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
510
|
-
[32m✓[39m tests/
|
|
511
|
-
[32m✓[39m tests/
|
|
512
|
-
[32m✓[39m tests/
|
|
513
|
-
[32m✓[39m tests/
|
|
514
|
-
[32m✓[39m tests/init-package-json.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
515
|
-
[32m✓[39m tests/resolve-api-url.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
516
|
-
[32m✓[39m tests/pg-spawn-env.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
536
|
+
[32m✓[39m tests/normalize-admin-config.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
537
|
+
[32m✓[39m tests/ui-confirm.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
538
|
+
[32m✓[39m tests/docker-postgres.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
539
|
+
[32m✓[39m tests/binary-download-lock.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
540
|
+
[32m✓[39m tests/dev-session-lock.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
541
|
+
[32m✓[39m tests/dev-ports.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
542
|
+
[32m✓[39m tests/route-manifest.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
543
|
+
[32m✓[39m tests/config-load-failure.test.ts [2m([22m[2m2 tests[22m[2m)[22m[33m 3799[2mms[22m[39m
|
|
544
|
+
[33m[2m✓[22m[39m is reported, rather than treated as absent [33m 2235[2mms[22m[39m
|
|
545
|
+
[33m[2m✓[22m[39m does not stop the CLI working with no config at all [33m 1561[2mms[22m[39m
|
|
546
|
+
[32m✓[39m tests/dev-ready-panel.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
547
|
+
[32m✓[39m tests/realtime-launch.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
548
|
+
[32m✓[39m tests/release-pins.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
549
|
+
[32m✓[39m tests/ensure-dev-api-config.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
550
|
+
[32m✓[39m tests/seed-discover.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
551
|
+
[32m✓[39m tests/init-package-json.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
552
|
+
[32m✓[39m tests/resolve-api-url.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
517
553
|
[32m✓[39m tests/migrate-from-v1.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
518
|
-
[32m✓[39m tests/
|
|
519
|
-
[32m✓[39m tests/
|
|
520
|
-
[32m✓[39m tests/stdin-after-ink.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
[2m
|
|
524
|
-
[2m
|
|
525
|
-
[2m
|
|
554
|
+
[32m✓[39m tests/pg-spawn-env.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
555
|
+
[32m✓[39m tests/cli-package-version.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
556
|
+
[32m✓[39m tests/stdin-after-ink.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
557
|
+
[32m✓[39m tests/postgres-archive-tag.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
558
|
+
|
|
559
|
+
[2m Test Files [22m [1m[32m94 passed[39m[22m[90m (94)[39m
|
|
560
|
+
[2m Tests [22m [1m[32m986 passed[39m[22m[90m (986)[39m
|
|
561
|
+
[2m Start at [22m 09:24:20
|
|
562
|
+
[2m Duration [22m 54.40s[2m (transform 9.67s, setup 0ms, import 58.44s, tests 83.74s, environment 19ms)[22m
|
|
526
563
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface CacheSeedResult {
|
|
2
|
+
/** Tables switched on by this push because the schema had just started declaring them. */
|
|
3
|
+
seeded: string[];
|
|
4
|
+
/** True when every declared table is switched off project-wide by `cache_max_ttl: 0`. */
|
|
5
|
+
ttlIsOff: boolean;
|
|
6
|
+
/** Tables the schema declares, whether or not this push changed anything. */
|
|
7
|
+
declared: string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Bring the local allowlist in line with new declarations, and report what is still in the way.
|
|
11
|
+
*
|
|
12
|
+
* Returns null when there is no file to seed — a cloud-only project, or a stack that has never
|
|
13
|
+
* been started. A missing file is not an error here: the file is the local server's, and `dev`
|
|
14
|
+
* creates it.
|
|
15
|
+
*/
|
|
16
|
+
export declare function seedApiConfigCache(cwd: string, ast: unknown): CacheSeedResult | null;
|
|
17
|
+
/**
|
|
18
|
+
* §13.4's note, in the words of the project that will read it — or null when there is nothing to
|
|
19
|
+
* say.
|
|
20
|
+
*
|
|
21
|
+
* A free project with `cache` in its schema has asked for the paid feature **in code**. That is
|
|
22
|
+
* better qualified than any banner, and it is why this names the tables: "your cache is off" is a
|
|
23
|
+
* fact about the plan, while "posts and profiles are served from PostgREST on every request" is a
|
|
24
|
+
* fact about their project.
|
|
25
|
+
*
|
|
26
|
+
* Said once per push and never as an error. Declaring a cache on a tier that does not honour it is
|
|
27
|
+
* a correct declaration, not a mistake — the tier decides what runs, not what a schema may say —
|
|
28
|
+
* and a push that failed over it would be punishing someone for writing down their intent.
|
|
29
|
+
*/
|
|
30
|
+
export declare function freeTierCacheNote(report: {
|
|
31
|
+
tables?: string[];
|
|
32
|
+
honoured?: boolean;
|
|
33
|
+
} | undefined): string | null;
|
|
34
|
+
//# sourceMappingURL=api-config-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-config-cache.d.ts","sourceRoot":"","sources":["../src/api-config-cache.ts"],"names":[],"mappings":"AAgCA,MAAM,WAAW,eAAe;IAC9B,0FAA0F;IAC1F,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,yFAAyF;IACzF,QAAQ,EAAE,OAAO,CAAA;IACjB,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CA4CpF;AAmBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAW9G"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seed `.supatype/api-config.json`'s cache allowlist from what the schema declares.
|
|
3
|
+
*
|
|
4
|
+
* The declaration is a **ceiling**, not a switch: the server reads `cache` on the manifest as what
|
|
5
|
+
* *may* be cached and `cache_tables` as what *is*. Both are needed, and only one of them is written
|
|
6
|
+
* by a push — which on a local stack means a developer who wrote `cache: { enabled: true }`, pushed,
|
|
7
|
+
* and called `.cache({ server: true })` gets a BYPASS and no explanation short of opening Studio.
|
|
8
|
+
*
|
|
9
|
+
* So a push turns on what the schema newly declares, and **never touches an entry that already
|
|
10
|
+
* exists**. That asymmetry is the whole design:
|
|
11
|
+
*
|
|
12
|
+
* - Seeding a new table is not a decision anyone made differently. The schema is the only thing
|
|
13
|
+
* that has ever said anything about it.
|
|
14
|
+
* - Rewriting an existing entry is `push resets to declared`, which §13.2 rejects by name: an
|
|
15
|
+
* operator narrows a table during an incident, someone pushes an unrelated model, and the
|
|
16
|
+
* mitigation is reverted at the worst possible moment with nothing in the output to say so.
|
|
17
|
+
*
|
|
18
|
+
* It follows that a table dropped from the schema keeps its entry here. That is not a leak: the
|
|
19
|
+
* server intersects the allowlist with the declaration on every request, so an entry with no
|
|
20
|
+
* declaration behind it caches nothing. Removing it would be tidier and would also mean a push
|
|
21
|
+
* silently editing entries it did not create.
|
|
22
|
+
*/
|
|
23
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
24
|
+
import { dirname, join } from "node:path";
|
|
25
|
+
import { manifestCache } from "./model-cache.js";
|
|
26
|
+
/**
|
|
27
|
+
* Bring the local allowlist in line with new declarations, and report what is still in the way.
|
|
28
|
+
*
|
|
29
|
+
* Returns null when there is no file to seed — a cloud-only project, or a stack that has never
|
|
30
|
+
* been started. A missing file is not an error here: the file is the local server's, and `dev`
|
|
31
|
+
* creates it.
|
|
32
|
+
*/
|
|
33
|
+
export function seedApiConfigCache(cwd, ast) {
|
|
34
|
+
const declared = manifestCache(ast);
|
|
35
|
+
const declaredTables = Object.keys(declared).filter((t) => declared[t]?.enabled !== false).sort();
|
|
36
|
+
const path = join(cwd, ".supatype", "api-config.json");
|
|
37
|
+
if (!existsSync(path))
|
|
38
|
+
return null;
|
|
39
|
+
let parsed;
|
|
40
|
+
try {
|
|
41
|
+
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Malformed: the server reports this far more clearly than a push can, and rewriting it here
|
|
45
|
+
// would destroy whatever the author was in the middle of.
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
if (typeof parsed !== "object" || parsed === null)
|
|
49
|
+
return null;
|
|
50
|
+
const rest = asRecord(parsed["rest"]);
|
|
51
|
+
if (!rest)
|
|
52
|
+
return null;
|
|
53
|
+
const tables = asRecord(rest["cache_tables"]) ?? {};
|
|
54
|
+
const seeded = [];
|
|
55
|
+
for (const table of declaredTables) {
|
|
56
|
+
if (table in tables)
|
|
57
|
+
continue;
|
|
58
|
+
tables[table] = seedEntry(declared[table]);
|
|
59
|
+
seeded.push(table);
|
|
60
|
+
}
|
|
61
|
+
if (seeded.length > 0) {
|
|
62
|
+
rest["cache_tables"] = tables;
|
|
63
|
+
parsed["rest"] = rest;
|
|
64
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
65
|
+
writeFileSync(path, `${JSON.stringify(parsed, null, 2)}\n`, "utf8");
|
|
66
|
+
}
|
|
67
|
+
const ttl = rest["cache_max_ttl"];
|
|
68
|
+
return {
|
|
69
|
+
seeded,
|
|
70
|
+
// The project-wide TTL is deliberately not written. Zero is an operator's off switch, and a
|
|
71
|
+
// push that turned it on would be overriding a decision rather than filling in a blank — so it
|
|
72
|
+
// is reported instead, where the person who can decide is reading.
|
|
73
|
+
ttlIsOff: declaredTables.length > 0 && (typeof ttl !== "number" || ttl <= 0),
|
|
74
|
+
declared: declaredTables,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* What a newly declared table is switched on as.
|
|
79
|
+
*
|
|
80
|
+
* `allow_public` follows the declaration rather than defaulting off: the schema saying `public` is
|
|
81
|
+
* a considered statement that this table's reads are the same for everyone, and `push` has already
|
|
82
|
+
* refused it where the read rule varies by caller. Defaulting it off would make the declaration
|
|
83
|
+
* mean nothing until someone ticked a box that the schema had already justified.
|
|
84
|
+
*/
|
|
85
|
+
function seedEntry(entry) {
|
|
86
|
+
return { enabled: true, allow_public: entry.public === true };
|
|
87
|
+
}
|
|
88
|
+
function asRecord(value) {
|
|
89
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
90
|
+
return null;
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* §13.4's note, in the words of the project that will read it — or null when there is nothing to
|
|
95
|
+
* say.
|
|
96
|
+
*
|
|
97
|
+
* A free project with `cache` in its schema has asked for the paid feature **in code**. That is
|
|
98
|
+
* better qualified than any banner, and it is why this names the tables: "your cache is off" is a
|
|
99
|
+
* fact about the plan, while "posts and profiles are served from PostgREST on every request" is a
|
|
100
|
+
* fact about their project.
|
|
101
|
+
*
|
|
102
|
+
* Said once per push and never as an error. Declaring a cache on a tier that does not honour it is
|
|
103
|
+
* a correct declaration, not a mistake — the tier decides what runs, not what a schema may say —
|
|
104
|
+
* and a push that failed over it would be punishing someone for writing down their intent.
|
|
105
|
+
*/
|
|
106
|
+
export function freeTierCacheNote(report) {
|
|
107
|
+
// Absent, rather than `honoured: false`, is a control plane too old to answer. Silence is the
|
|
108
|
+
// only honest response to a question that was never asked.
|
|
109
|
+
if (!report || report.honoured !== false)
|
|
110
|
+
return null;
|
|
111
|
+
const tables = (report.tables ?? []).filter((t) => typeof t === "string" && t.length > 0);
|
|
112
|
+
if (tables.length === 0)
|
|
113
|
+
return null;
|
|
114
|
+
return (`${listed(tables)} declare a cache in your schema. On the free tier these are served from ` +
|
|
115
|
+
`PostgREST on every request — the declaration is stored and takes effect on a paid plan.`);
|
|
116
|
+
}
|
|
117
|
+
/** "posts", "posts and profiles", "posts, profiles and tags". */
|
|
118
|
+
function listed(tables) {
|
|
119
|
+
if (tables.length === 1)
|
|
120
|
+
return tables[0];
|
|
121
|
+
return `${tables.slice(0, -1).join(", ")} and ${tables[tables.length - 1]}`;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=api-config-cache.js.map
|