@supatype/cli 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +157 -157
- package/.turbo/turbo-typecheck.log +1 -1
- package/dist/cli-version-embedded.js +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/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/package.json +2 -2
- package/src/cli-version-embedded.ts +1 -1
- package/src/commands/keys.ts +40 -0
- package/src/commands/self-host.ts +9 -0
- package/tests/self-host-keys.test.ts +92 -0
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @supatype/cli@0.2.
|
|
2
|
+
> @supatype/cli@0.2.1 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.
|
|
2
|
+
> @supatype/cli@0.2.1 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/access-composition.test.ts [2m([22m[2m26 tests[22m[2m)[22m[
|
|
9
|
-
[32m✓[39m tests/type-extractor.test.ts [2m([22m[2m44 tests[22m[2m)[22m[
|
|
10
|
-
[32m✓[39m tests/model-hooks.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m
|
|
11
|
-
[32m✓[39m tests/runtime-contract.test.ts [2m([22m[2m49 tests[22m[2m)[22m[32m
|
|
8
|
+
[32m✓[39m tests/access-composition.test.ts [2m([22m[2m26 tests[22m[2m)[22m[33m 389[2mms[22m[39m
|
|
9
|
+
[32m✓[39m tests/type-extractor.test.ts [2m([22m[2m44 tests[22m[2m)[22m[33m 484[2mms[22m[39m
|
|
10
|
+
[32m✓[39m tests/model-hooks.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m 110[2mms[22m[39m
|
|
11
|
+
[32m✓[39m tests/runtime-contract.test.ts [2m([22m[2m49 tests[22m[2m)[22m[32m 212[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,12 +295,12 @@
|
|
|
295
295
|
created public/.gitkeep
|
|
296
296
|
created .gitignore
|
|
297
297
|
|
|
298
|
-
[32m✓[39m tests/init.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m
|
|
299
|
-
[32m✓[39m tests/model-constraints.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m
|
|
300
|
-
[32m✓[39m tests/external-database-compose.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m
|
|
301
|
-
[32m✓[39m tests/field-masking-tier.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m
|
|
298
|
+
[32m✓[39m tests/init.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m 108[2mms[22m[39m
|
|
299
|
+
[32m✓[39m tests/model-constraints.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 98[2mms[22m[39m
|
|
300
|
+
[32m✓[39m tests/external-database-compose.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
301
|
+
[32m✓[39m tests/field-masking-tier.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
302
302
|
|
|
303
|
-
[32m✓[39m tests/dev-ui.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m
|
|
303
|
+
[32m✓[39m tests/dev-ui.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m 129[2mms[22m[39m
|
|
304
304
|
|
|
305
305
|
[supatype] Shutting down…
|
|
306
306
|
[90mstdout[2m | tests/docker-runtime.test.ts[2m > [22m[2mrequireDockerDaemon[2m > [22m[2mexits when the daemon is unavailable
|
|
@@ -311,54 +311,53 @@
|
|
|
311
311
|
|
|
312
312
|
docker: daemon down
|
|
313
313
|
|
|
314
|
-
[32m✓[39m tests/docker-runtime.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
315
|
-
[32m✓[39m tests/hooks-generator.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m
|
|
316
|
-
[33m[2m✓[22m[39m typechecks under strict mode, together with a handler that uses it [33m
|
|
317
|
-
[33m[2m✓[22m[39m rejects a handler for a table that declares no hook [33m
|
|
318
|
-
[33m[2m✓[22m[39m typechecks with a validator written the way the docs will show it [33m
|
|
319
|
-
[32m✓[39m tests/config.test.ts [2m([22m[2m19 tests[22m[2m)[22m[33m
|
|
320
|
-
[33m[2m✓[22m[39m loads a valid supatype.config.ts (plain export default, no package imports) [33m
|
|
321
|
-
[33m[2m✓[22m[39m normalizes shorthand schema string to { path, pg_schema } [33m
|
|
322
|
-
[33m[2m✓[22m[39m loads a supatype.config.js (plain ESM) [33m
|
|
323
|
-
[33m[2m✓[22m[39m loads config without a versions section (latest by default) [33m
|
|
324
|
-
[33m[2m✓[22m[39m prefers supatype.config.ts over supatype.config.js when both exist [33m
|
|
325
|
-
[33m[2m✓[22m[39m supports optional output field in config [33m
|
|
326
|
-
[33m[2m✓[22m[39m merges supatype.local.config.ts over base [33m
|
|
327
|
-
[33m[2m✓[22m[39m loads defineConfig import before @supatype/cli is installed (init scaffold) [33m
|
|
328
|
-
[32m✓[39m tests/db-preflight.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m
|
|
329
|
-
[32m✓[39m tests/field-bounds.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m
|
|
330
|
-
[32m✓[39m tests/cache-clean.test.ts [2m([22m[2m8 tests[22m[2m)[22m[33m
|
|
331
|
-
[33m[2m✓[22m[39m keeps pinned versions and removes the rest [33m
|
|
332
|
-
[33m[2m✓[22m[39m --force removes pinned versions [33m
|
|
333
|
-
[33m[2m✓[22m[39m explicit version removes even when pinned (with warning) [33m
|
|
334
|
-
[32m✓[39m tests/functions-deno-types.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m
|
|
335
|
-
[33m[2m✓[22m[39m
|
|
336
|
-
[33m[2m✓[22m[39m tsc
|
|
337
|
-
|
|
338
|
-
[32m✓[39m tests/
|
|
339
|
-
[32m✓[39m tests/
|
|
340
|
-
[32m✓[39m tests/
|
|
341
|
-
[32m✓[39m tests/
|
|
342
|
-
[32m✓[39m tests/
|
|
343
|
-
[32m✓[39m tests/
|
|
344
|
-
[32m✓[39m tests/env-file.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
314
|
+
[32m✓[39m tests/docker-runtime.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 26[2mms[22m[39m
|
|
315
|
+
[32m✓[39m tests/hooks-generator.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 8413[2mms[22m[39m
|
|
316
|
+
[33m[2m✓[22m[39m typechecks under strict mode, together with a handler that uses it [33m 2834[2mms[22m[39m
|
|
317
|
+
[33m[2m✓[22m[39m rejects a handler for a table that declares no hook [33m 2770[2mms[22m[39m
|
|
318
|
+
[33m[2m✓[22m[39m typechecks with a validator written the way the docs will show it [33m 2745[2mms[22m[39m
|
|
319
|
+
[32m✓[39m tests/config.test.ts [2m([22m[2m19 tests[22m[2m)[22m[33m 8257[2mms[22m[39m
|
|
320
|
+
[33m[2m✓[22m[39m loads a valid supatype.config.ts (plain export default, no package imports) [33m 844[2mms[22m[39m
|
|
321
|
+
[33m[2m✓[22m[39m normalizes shorthand schema string to { path, pg_schema } [33m 881[2mms[22m[39m
|
|
322
|
+
[33m[2m✓[22m[39m loads a supatype.config.js (plain ESM) [33m 818[2mms[22m[39m
|
|
323
|
+
[33m[2m✓[22m[39m loads config without a versions section (latest by default) [33m 757[2mms[22m[39m
|
|
324
|
+
[33m[2m✓[22m[39m prefers supatype.config.ts over supatype.config.js when both exist [33m 901[2mms[22m[39m
|
|
325
|
+
[33m[2m✓[22m[39m supports optional output field in config [33m 843[2mms[22m[39m
|
|
326
|
+
[33m[2m✓[22m[39m merges supatype.local.config.ts over base [33m 1667[2mms[22m[39m
|
|
327
|
+
[33m[2m✓[22m[39m loads defineConfig import before @supatype/cli is installed (init scaffold) [33m 1527[2mms[22m[39m
|
|
328
|
+
[32m✓[39m tests/db-preflight.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
329
|
+
[32m✓[39m tests/field-bounds.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 21[2mms[22m[39m
|
|
330
|
+
[32m✓[39m tests/cache-clean.test.ts [2m([22m[2m8 tests[22m[2m)[22m[33m 2699[2mms[22m[39m
|
|
331
|
+
[33m[2m✓[22m[39m keeps pinned versions and removes the rest [33m 908[2mms[22m[39m
|
|
332
|
+
[33m[2m✓[22m[39m --force removes pinned versions [33m 870[2mms[22m[39m
|
|
333
|
+
[33m[2m✓[22m[39m explicit version removes even when pinned (with warning) [33m 900[2mms[22m[39m
|
|
334
|
+
[32m✓[39m tests/functions-deno-types.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 3746[2mms[22m[39m
|
|
335
|
+
[33m[2m✓[22m[39m tsc fails with Cannot find name Deno without ambient types [33m 2517[2mms[22m[39m
|
|
336
|
+
[33m[2m✓[22m[39m tsc passes for Deno.env after ensureFunctionsDenoTypes [33m 1204[2mms[22m[39m
|
|
337
|
+
[32m✓[39m tests/field-bounds-matrix.test.ts [2m([22m[2m124 tests[22m[2m)[22m[32m 49[2mms[22m[39m
|
|
338
|
+
[32m✓[39m tests/external-database-config.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
339
|
+
[32m✓[39m tests/compose-services.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
340
|
+
[32m✓[39m tests/field-validators.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 80[2mms[22m[39m
|
|
341
|
+
[32m✓[39m tests/command-chrome-coverage.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
342
|
+
[32m✓[39m tests/hook-upload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
343
|
+
[32m✓[39m tests/env-file.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 18[2mms[22m[39m
|
|
345
344
|
[90mstdout[2m | tests/link.test.ts[2m > [22m[2mlink model[2m > [22m[2mmigrates cloud.json into link.json
|
|
345
|
+
[90mstderr[2m | tests/link.test.ts[2m > [22m[2mlink model[2m > [22m[2mmigrates cloud.json into link.json
|
|
346
346
|
[22m[39m created package.json
|
|
347
347
|
created supatype.config.ts
|
|
348
348
|
created schema/index.ts
|
|
349
|
+
[22m[39m[supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
|
|
349
350
|
created .env
|
|
350
351
|
created seed.ts
|
|
352
|
+
|
|
351
353
|
created seeds/.gitkeep
|
|
352
354
|
created public/.gitkeep
|
|
353
355
|
created .gitignore
|
|
354
356
|
|
|
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
|
|
357
|
+
[32m✓[39m tests/link.test.ts [2m([22m[2m4 tests[22m[2m)[22m[33m 3807[2mms[22m[39m
|
|
358
|
+
[33m[2m✓[22m[39m resolveTarget returns cloud mode with /api/v1 prefix [33m 1230[2mms[22m[39m
|
|
359
|
+
[33m[2m✓[22m[39m resolveTarget returns self-host mode with /platform/v1 prefix [33m 1281[2mms[22m[39m
|
|
360
|
+
[33m[2m✓[22m[39m targetSchemaRollback posts to /platform/v1 when linked [33m 1279[2mms[22m[39m
|
|
362
361
|
[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
362
|
[22m[39m created package.json
|
|
364
363
|
created supatype.config.ts
|
|
@@ -369,8 +368,8 @@
|
|
|
369
368
|
created public/.gitkeep
|
|
370
369
|
created .gitignore
|
|
371
370
|
|
|
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
|
|
371
|
+
[32m✓[39m tests/admin-ensure.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 166[2mms[22m[39m
|
|
372
|
+
[32m✓[39m tests/service-role-check.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
374
373
|
[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
374
|
[22m[39m[supatype] Admin user "admin@example.com" created (role: admin).
|
|
376
375
|
[supatype] Log in at /admin after starting the dev server.
|
|
@@ -387,46 +386,47 @@
|
|
|
387
386
|
[22m[39m[supatype] Admin user "admin@example.com" created (role: admin).
|
|
388
387
|
[supatype] Log in at /admin after starting the dev server.
|
|
389
388
|
|
|
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/
|
|
394
|
-
[33m[2m✓[22m[39m
|
|
395
|
-
[33m[2m✓[22m[39m
|
|
396
|
-
|
|
397
|
-
[33m[2m✓[22m[39m
|
|
398
|
-
[33m[2m✓[22m[39m
|
|
399
|
-
[33m[2m✓[22m[39m
|
|
400
|
-
[33m[2m✓[22m[39m
|
|
401
|
-
[33m[2m✓[22m[39m
|
|
402
|
-
[33m[2m✓[22m[39m
|
|
403
|
-
[33m[2m✓[22m[39m
|
|
404
|
-
[33m[2m✓[22m[39m
|
|
405
|
-
|
|
406
|
-
[33m[2m✓[22m[39m
|
|
407
|
-
[33m[2m✓[22m[39m
|
|
389
|
+
[32m✓[39m tests/admin-studio-membership.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m 470[2mms[22m[39m
|
|
390
|
+
[32m✓[39m tests/augmentation-generator.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 23[2mms[22m[39m
|
|
391
|
+
[32m✓[39m tests/pull-utils.test.ts [2m([22m[2m49 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
392
|
+
[32m✓[39m tests/schema-sources.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m 1531[2mms[22m[39m
|
|
393
|
+
[33m[2m✓[22m[39m buildSchemaSourcesPayload includes manifest metadata [33m 734[2mms[22m[39m
|
|
394
|
+
[33m[2m✓[22m[39m restore overwrites modified local files [33m 742[2mms[22m[39m
|
|
395
|
+
[32m✓[39m tests/keys.test.ts [2m([22m[2m11 tests[22m[2m)[22m[33m 21707[2mms[22m[39m
|
|
396
|
+
[33m[2m✓[22m[39m exits 0 with --secret [33m 2102[2mms[22m[39m
|
|
397
|
+
[33m[2m✓[22m[39m outputs ANON_KEY= line [33m 1906[2mms[22m[39m
|
|
398
|
+
[33m[2m✓[22m[39m outputs SERVICE_ROLE_KEY= line [33m 1832[2mms[22m[39m
|
|
399
|
+
[33m[2m✓[22m[39m ANON_KEY is a valid three-part JWT [33m 1714[2mms[22m[39m
|
|
400
|
+
[33m[2m✓[22m[39m SERVICE_ROLE_KEY payload has role: service_role [33m 1673[2mms[22m[39m
|
|
401
|
+
[33m[2m✓[22m[39m JWT has exp in the future [33m 1806[2mms[22m[39m
|
|
402
|
+
[33m[2m✓[22m[39m --exp-years changes the expiry window [33m 3534[2mms[22m[39m
|
|
403
|
+
[33m[2m✓[22m[39m reads JWT_SECRET from environment variable [33m 1820[2mms[22m[39m
|
|
404
|
+
[33m[2m✓[22m[39m reads JWT_SECRET from .env file [33m 1825[2mms[22m[39m
|
|
405
|
+
[33m[2m✓[22m[39m exits non-zero when no secret is available [33m 1640[2mms[22m[39m
|
|
406
|
+
[33m[2m✓[22m[39m keys --help shows --secret and --exp-years options [33m 1844[2mms[22m[39m
|
|
408
407
|
[90mstderr[2m | tests/binary-cache-cloud-overrides.test.ts[2m > [22m[2misLinkedToCloudProject[2m > [22m[2mis true when .supatype/cloud.json has projectSlug
|
|
409
408
|
[22m[39m[supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
|
|
410
409
|
|
|
411
|
-
[32m✓[39m tests/binary-cache-cloud-overrides.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m
|
|
412
|
-
[32m✓[39m tests/
|
|
413
|
-
[32m✓[39m tests/
|
|
414
|
-
[32m✓[39m tests/minisign.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
415
|
-
[32m✓[39m tests/
|
|
416
|
-
[32m✓[39m tests/
|
|
417
|
-
[32m✓[39m tests/
|
|
410
|
+
[32m✓[39m tests/binary-cache-cloud-overrides.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 20[2mms[22m[39m
|
|
411
|
+
[32m✓[39m tests/local-server-image-env.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
412
|
+
[32m✓[39m tests/homebrew-formula.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 252[2mms[22m[39m
|
|
413
|
+
[32m✓[39m tests/minisign.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
414
|
+
[32m✓[39m tests/local-secrets.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
415
|
+
[32m✓[39m tests/engine-floor.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
416
|
+
[32m✓[39m tests/self-host-keys.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
417
|
+
[32m✓[39m tests/readiness-poll.test.ts [2m([22m[2m3 tests[22m[2m)[22m[33m 333[2mms[22m[39m
|
|
418
|
+
[33m[2m✓[22m[39m ends promptly when it carries a deadline [33m 326[2mms[22m[39m
|
|
419
|
+
[32m✓[39m tests/api-schemas.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
418
420
|
[90mstdout[2m | tests/storage-provision.test.ts[2m > [22m[2mprovisionBuckets[2m > [22m[2mPOSTs each bucket to the storage API
|
|
419
421
|
[22m[39m[supatype] Storage bucket "photos" ready.
|
|
420
422
|
|
|
421
423
|
[90mstdout[2m | tests/storage-provision.test.ts[2m > [22m[2mprovisionBuckets[2m > [22m[2mPOSTs each bucket to the storage API
|
|
422
424
|
[22m[39m[supatype] Storage bucket "avatars" ready.
|
|
423
425
|
|
|
424
|
-
[32m✓[39m tests/
|
|
425
|
-
[32m✓[39m tests/
|
|
426
|
-
[32m✓[39m tests/
|
|
427
|
-
|
|
428
|
-
[32m✓[39m tests/target-client-refresh.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
429
|
-
[32m✓[39m tests/proxy-dev-app.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
426
|
+
[32m✓[39m tests/cached-artifact-format.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
427
|
+
[32m✓[39m tests/storage-provision.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
428
|
+
[32m✓[39m tests/target-client-refresh.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
429
|
+
[32m✓[39m tests/proxy-dev-app.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
430
430
|
[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
431
|
[22m[39m created package.json
|
|
432
432
|
created supatype.config.ts
|
|
@@ -447,80 +447,80 @@
|
|
|
447
447
|
created public/.gitkeep
|
|
448
448
|
created .gitignore
|
|
449
449
|
|
|
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/init-dependency-versions.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
458
|
-
[32m✓[39m tests/compose-parsable-defaults.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
459
|
-
[32m✓[39m tests/type-resolver.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
460
|
-
[32m✓[39m tests/engine-push-output.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
461
|
-
[32m✓[39m tests/cli-help.test.ts [2m([22m[2m16 tests[22m[2m)[22m[33m
|
|
462
|
-
[33m[2m✓[22m[39m --help lists all top-level commands [33m
|
|
463
|
-
[33m[2m✓[22m[39m --version prints package.json version [33m
|
|
464
|
-
[33m[2m✓[22m[39m self-update --help describes the command [33m
|
|
465
|
-
[33m[2m✓[22m[39m init --help describes the init command [33m
|
|
466
|
-
[33m[2m✓[22m[39m push --help describes the push command and --yes flag [33m
|
|
467
|
-
[33m[2m✓[22m[39m diff --help describes the diff command [33m
|
|
468
|
-
[33m[2m✓[22m[39m pull --help describes scaffold pull command [33m
|
|
469
|
-
[33m[2m✓[22m[39m doctor --help describes drift report command [33m
|
|
470
|
-
[33m[2m✓[22m[39m introspect --help describes database introspection command [33m
|
|
471
|
-
[33m[2m✓[22m[39m adopt --help describes adoption ceremony command [33m
|
|
472
|
-
[33m[2m✓[22m[39m reset --help shows --yes flag [33m
|
|
473
|
-
[33m[2m✓[22m[39m app --help describes the app command with add/remove subcommands [33m
|
|
474
|
-
[33m[2m✓[22m[39m app add --help shows --static and --port options [33m
|
|
475
|
-
[33m[2m✓[22m[39m self-host --help shows compose only (legacy commands hidden) [33m
|
|
476
|
-
[33m[2m✓[22m[39m self-host compose --help shows compose subcommands [33m
|
|
477
|
-
[33m[2m✓[22m[39m unknown command exits non-zero [33m
|
|
478
|
-
[32m✓[39m tests/command-chrome-wrap.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
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
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
[33m[2m✓[22m[39m
|
|
487
|
-
[33m[2m✓[22m[39m
|
|
488
|
-
[33m[2m✓[22m[39m
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
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/
|
|
496
|
-
[32m✓[39m tests/ui-messages.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m
|
|
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
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
[32m✓[39m tests/studio-admin-roles.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
509
|
-
[32m✓[39m tests/
|
|
510
|
-
[32m✓[39m tests/
|
|
511
|
-
[32m✓[39m tests/
|
|
512
|
-
[32m✓[39m tests/
|
|
513
|
-
[32m✓[39m tests/rest-cache-admin.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
514
|
-
[32m✓[39m tests/init-package-json.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
515
|
-
[32m✓[39m tests/
|
|
516
|
-
[32m✓[39m tests/
|
|
517
|
-
[32m✓[39m tests/
|
|
518
|
-
[32m✓[39m tests/cli-package-version.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
519
|
-
[32m✓[39m tests/postgres-archive-tag.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
520
|
-
[32m✓[39m tests/stdin-after-ink.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
521
|
-
|
|
522
|
-
[2m Test Files [22m [1m[
|
|
523
|
-
[2m Tests [22m [1m[
|
|
524
|
-
[2m Start at [22m
|
|
525
|
-
[2m Duration [22m
|
|
450
|
+
[32m✓[39m tests/service-role-routes.test.ts [2m([22m[2m4 tests[22m[2m)[22m[33m 2190[2mms[22m[39m
|
|
451
|
+
[33m[2m✓[22m[39m reads the declared list [33m 675[2mms[22m[39m
|
|
452
|
+
[33m[2m✓[22m[39m is an empty list when a project declares none [33m 826[2mms[22m[39m
|
|
453
|
+
[33m[2m✓[22m[39m sends what the project declared, hook entries included [33m 685[2mms[22m[39m
|
|
454
|
+
[32m✓[39m tests/app-command.test.ts [2m([22m[2m2 tests[22m[2m)[22m[33m 3695[2mms[22m[39m
|
|
455
|
+
[33m[2m✓[22m[39m sets app.mode=static and static_dir in supatype.config.ts [33m 1771[2mms[22m[39m
|
|
456
|
+
[33m[2m✓[22m[39m creates the static directory when missing [33m 1921[2mms[22m[39m
|
|
457
|
+
[32m✓[39m tests/init-dependency-versions.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 43[2mms[22m[39m
|
|
458
|
+
[32m✓[39m tests/compose-parsable-defaults.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
459
|
+
[32m✓[39m tests/type-resolver.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
460
|
+
[32m✓[39m tests/engine-push-output.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
461
|
+
[32m✓[39m tests/cli-help.test.ts [2m([22m[2m16 tests[22m[2m)[22m[33m 28425[2mms[22m[39m
|
|
462
|
+
[33m[2m✓[22m[39m --help lists all top-level commands [33m 1744[2mms[22m[39m
|
|
463
|
+
[33m[2m✓[22m[39m --version prints package.json version [33m 1808[2mms[22m[39m
|
|
464
|
+
[33m[2m✓[22m[39m self-update --help describes the command [33m 1649[2mms[22m[39m
|
|
465
|
+
[33m[2m✓[22m[39m init --help describes the init command [33m 1945[2mms[22m[39m
|
|
466
|
+
[33m[2m✓[22m[39m push --help describes the push command and --yes flag [33m 1831[2mms[22m[39m
|
|
467
|
+
[33m[2m✓[22m[39m diff --help describes the diff command [33m 1706[2mms[22m[39m
|
|
468
|
+
[33m[2m✓[22m[39m pull --help describes scaffold pull command [33m 1765[2mms[22m[39m
|
|
469
|
+
[33m[2m✓[22m[39m doctor --help describes drift report command [33m 1814[2mms[22m[39m
|
|
470
|
+
[33m[2m✓[22m[39m introspect --help describes database introspection command [33m 1654[2mms[22m[39m
|
|
471
|
+
[33m[2m✓[22m[39m adopt --help describes adoption ceremony command [33m 1823[2mms[22m[39m
|
|
472
|
+
[33m[2m✓[22m[39m reset --help shows --yes flag [33m 1728[2mms[22m[39m
|
|
473
|
+
[33m[2m✓[22m[39m app --help describes the app command with add/remove subcommands [33m 1722[2mms[22m[39m
|
|
474
|
+
[33m[2m✓[22m[39m app add --help shows --static and --port options [33m 1724[2mms[22m[39m
|
|
475
|
+
[33m[2m✓[22m[39m self-host --help shows compose only (legacy commands hidden) [33m 1791[2mms[22m[39m
|
|
476
|
+
[33m[2m✓[22m[39m self-host compose --help shows compose subcommands [33m 1944[2mms[22m[39m
|
|
477
|
+
[33m[2m✓[22m[39m unknown command exits non-zero [33m 1769[2mms[22m[39m
|
|
478
|
+
[32m✓[39m tests/command-chrome-wrap.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
479
|
+
[32m✓[39m tests/cli-install-method.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
480
|
+
[32m✓[39m tests/port-in-use.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 33[2mms[22m[39m
|
|
481
|
+
[32m✓[39m tests/tsx-runner.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 3630[2mms[22m[39m
|
|
482
|
+
[33m[2m✓[22m[39m evaluates a simple expression and returns stdout [33m 457[2mms[22m[39m
|
|
483
|
+
[33m[2m✓[22m[39m evaluates TypeScript syntax (type annotations) [33m 488[2mms[22m[39m
|
|
484
|
+
[33m[2m✓[22m[39m can serialize a JSON object to stdout [33m 479[2mms[22m[39m
|
|
485
|
+
[33m[2m✓[22m[39m returns non-zero exit code on syntax error [33m 544[2mms[22m[39m
|
|
486
|
+
[33m[2m✓[22m[39m returns non-zero exit code on runtime error [33m 511[2mms[22m[39m
|
|
487
|
+
[33m[2m✓[22m[39m captures stderr separately from stdout [33m 478[2mms[22m[39m
|
|
488
|
+
[33m[2m✓[22m[39m runs a .ts file and returns its stdout [33m 667[2mms[22m[39m
|
|
489
|
+
[32m✓[39m tests/archive-name-alias.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
490
|
+
[32m✓[39m tests/ensure-binary.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
491
|
+
[32m✓[39m tests/init-project-detect.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
492
|
+
[32m✓[39m tests/doctor-render.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
493
|
+
[32m✓[39m tests/doctor-service-role.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
494
|
+
[32m✓[39m tests/dev-ports-owner.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
495
|
+
[32m✓[39m tests/required-host-components.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
496
|
+
[32m✓[39m tests/ui-messages.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
497
|
+
[32m✓[39m tests/normalize-admin-config.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
498
|
+
[32m✓[39m tests/ui-confirm.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
499
|
+
[32m✓[39m tests/docker-postgres.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
500
|
+
[32m✓[39m tests/binary-download-lock.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
501
|
+
[32m✓[39m tests/dev-session-lock.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
502
|
+
[32m✓[39m tests/dev-ports.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
503
|
+
[32m✓[39m tests/route-manifest.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
504
|
+
[32m✓[39m tests/dev-ready-panel.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
505
|
+
[32m✓[39m tests/config-load-failure.test.ts [2m([22m[2m2 tests[22m[2m)[22m[33m 4661[2mms[22m[39m
|
|
506
|
+
[33m[2m✓[22m[39m is reported, rather than treated as absent [33m 2711[2mms[22m[39m
|
|
507
|
+
[33m[2m✓[22m[39m does not stop the CLI working with no config at all [33m 1946[2mms[22m[39m
|
|
508
|
+
[32m✓[39m tests/studio-admin-roles.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
509
|
+
[32m✓[39m tests/realtime-launch.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
510
|
+
[32m✓[39m tests/seed-discover.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
511
|
+
[32m✓[39m tests/release-pins.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
512
|
+
[32m✓[39m tests/ensure-dev-api-config.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
513
|
+
[32m✓[39m tests/rest-cache-admin.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 44[2mms[22m[39m
|
|
514
|
+
[32m✓[39m tests/init-package-json.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
515
|
+
[32m✓[39m tests/pg-spawn-env.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
516
|
+
[32m✓[39m tests/migrate-from-v1.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
517
|
+
[32m✓[39m tests/resolve-api-url.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
518
|
+
[32m✓[39m tests/cli-package-version.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
519
|
+
[32m✓[39m tests/postgres-archive-tag.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
520
|
+
[32m✓[39m tests/stdin-after-ink.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
521
|
+
|
|
522
|
+
[2m Test Files [22m [1m[32m85 passed[39m[22m[90m (85)[39m
|
|
523
|
+
[2m Tests [22m [1m[32m819 passed[39m[22m[90m (819)[39m
|
|
524
|
+
[2m Start at [22m 08:09:42
|
|
525
|
+
[2m Duration [22m 58.92s[2m (transform 8.11s, setup 0ms, import 58.53s, tests 96.41s, environment 19ms)[22m
|
|
526
526
|
|
|
@@ -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.2.
|
|
12
|
+
export const EMBEDDED_CLI_VERSION = "0.2.1";
|
|
13
13
|
//# sourceMappingURL=cli-version-embedded.js.map
|
package/dist/commands/keys.d.ts
CHANGED
|
@@ -15,4 +15,18 @@ export declare function generateAndWriteKeys(dir: string, expYears?: number): {
|
|
|
15
15
|
serviceKey: string;
|
|
16
16
|
} | null;
|
|
17
17
|
export declare function resolveSecret(dir?: string): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Mint ANON_KEY / SERVICE_ROLE_KEY into `dir`'s .env only where they are
|
|
20
|
+
* missing or blank, and report which ones were filled.
|
|
21
|
+
*
|
|
22
|
+
* Deliberately not `generateAndWriteKeys`, which rewrites them unconditionally.
|
|
23
|
+
* That is right for `init`, where the project is new, and wrong for anything
|
|
24
|
+
* that runs on an existing deployment: reissuing the anon key on every start
|
|
25
|
+
* would lock out every client already holding one.
|
|
26
|
+
*
|
|
27
|
+
* A self-host `.env` copied from the template arrives with both keys empty, and
|
|
28
|
+
* the server refuses to serve without a service role key outside dev mode. That
|
|
29
|
+
* left the documented quick start unable to start at all.
|
|
30
|
+
*/
|
|
31
|
+
export declare function fillMissingKeys(dir: string, expYears?: number): string[];
|
|
18
32
|
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/commands/keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMxC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8BnD;AAID,oEAAoE;AACpE,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,QAAQ,SAAK,GACZ;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAOzC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,QAAQ,SAAK,GACZ;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAuBhD;AAiBD,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,GAAG,SAAS,CAsB7E"}
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/commands/keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMxC,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8BnD;AAID,oEAAoE;AACpE,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,QAAQ,SAAK,GACZ;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAOzC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,QAAQ,SAAK,GACZ;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAuBhD;AAiBD,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,GAAG,SAAS,CAsB7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,SAAK,GAAG,MAAM,EAAE,CAyBpE"}
|
package/dist/commands/keys.js
CHANGED
|
@@ -106,4 +106,41 @@ export function resolveSecret(dir = process.cwd()) {
|
|
|
106
106
|
}
|
|
107
107
|
return undefined;
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Mint ANON_KEY / SERVICE_ROLE_KEY into `dir`'s .env only where they are
|
|
111
|
+
* missing or blank, and report which ones were filled.
|
|
112
|
+
*
|
|
113
|
+
* Deliberately not `generateAndWriteKeys`, which rewrites them unconditionally.
|
|
114
|
+
* That is right for `init`, where the project is new, and wrong for anything
|
|
115
|
+
* that runs on an existing deployment: reissuing the anon key on every start
|
|
116
|
+
* would lock out every client already holding one.
|
|
117
|
+
*
|
|
118
|
+
* A self-host `.env` copied from the template arrives with both keys empty, and
|
|
119
|
+
* the server refuses to serve without a service role key outside dev mode. That
|
|
120
|
+
* left the documented quick start unable to start at all.
|
|
121
|
+
*/
|
|
122
|
+
export function fillMissingKeys(dir, expYears = 10) {
|
|
123
|
+
const envPath = resolve(dir, ".env");
|
|
124
|
+
if (!existsSync(envPath))
|
|
125
|
+
return [];
|
|
126
|
+
const content = readFileSync(envPath, "utf8");
|
|
127
|
+
const blank = (name) => {
|
|
128
|
+
const current = readEnvVar(content, name);
|
|
129
|
+
return current === undefined || current.trim() === "";
|
|
130
|
+
};
|
|
131
|
+
const needed = ["ANON_KEY", "SERVICE_ROLE_KEY"].filter(blank);
|
|
132
|
+
if (needed.length === 0)
|
|
133
|
+
return [];
|
|
134
|
+
const secret = resolveSecret(dir);
|
|
135
|
+
if (!secret)
|
|
136
|
+
return [];
|
|
137
|
+
const { anonKey, serviceKey } = signKeyPair(secret, expYears);
|
|
138
|
+
const minted = { ANON_KEY: anonKey, SERVICE_ROLE_KEY: serviceKey };
|
|
139
|
+
let next = content;
|
|
140
|
+
for (const name of needed) {
|
|
141
|
+
next = upsertEnvVar(next, name, minted[name]);
|
|
142
|
+
}
|
|
143
|
+
writeFileSync(envPath, next, "utf8");
|
|
144
|
+
return needed;
|
|
145
|
+
}
|
|
109
146
|
//# sourceMappingURL=keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/commands/keys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAA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C,CAAA;IAC7C,MAAM,KAAK,GAAG,CAAC,IAAY,EAAW,EAAE;QACtC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QACzC,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAA;IACvD,CAAC,CAAA;IAED,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC7D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAElC,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;IACjC,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAA;IAEtB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC7D,MAAM,MAAM,GAA2B,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAA;IAE1F,IAAI,IAAI,GAAG,OAAO,CAAA;IAClB,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,IAAI,GAAG,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAW,CAAC,CAAA;IACzD,CAAC;IACD,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;IACpC,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self-host.d.ts","sourceRoot":"","sources":["../../src/commands/self-host.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"self-host.d.ts","sourceRoot":"","sources":["../../src/commands/self-host.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAkBnC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmXvD"}
|
|
@@ -12,6 +12,7 @@ import { spawnSync } from "node:child_process";
|
|
|
12
12
|
import { gzipSync } from "node:zlib";
|
|
13
13
|
import { loadConfig } from "../config.js";
|
|
14
14
|
import { connectionString } from "../project-config.js";
|
|
15
|
+
import { fillMissingKeys } from "./keys.js";
|
|
15
16
|
import { resolveBinary } from "../binary-cache.js";
|
|
16
17
|
import { generateUnits } from "../systemd.js";
|
|
17
18
|
import { readPid } from "../process-manager.js";
|
|
@@ -46,6 +47,14 @@ export function registerSelfHost(program) {
|
|
|
46
47
|
const config = loadConfig(cwd);
|
|
47
48
|
const project = composeProjectName(config.project.name);
|
|
48
49
|
const args = opts.detach ? ["up", "-d"] : ["up"];
|
|
50
|
+
// A .env copied from the template arrives with both keys blank, and the
|
|
51
|
+
// server will not serve without a service role key outside dev mode.
|
|
52
|
+
// Only blanks are filled: reissuing a key an operator is already using
|
|
53
|
+
// would lock out every client holding the old one.
|
|
54
|
+
const filled = fillMissingKeys(cwd);
|
|
55
|
+
if (filled.length > 0) {
|
|
56
|
+
console.log(`[supatype] Minted ${filled.join(" and ")} in .env from JWT_SECRET.`);
|
|
57
|
+
}
|
|
49
58
|
const brand = { intro: "Self-host deployment" };
|
|
50
59
|
const status = await withSpinner("Starting self-host Compose stack", async () => {
|
|
51
60
|
const out = writeSelfHostCompose(cwd, config);
|