void 0.10.4 → 0.10.6
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/dist/agents-Bmr5tFFb.mjs +1454 -0
- package/dist/{auth-cmd-CblKzAdD.mjs → auth-cmd-DlgNwByu.mjs} +10 -10
- package/dist/{better-auth-shared-D0Mbmx5V.mjs → better-auth-shared-BQooDxbw.mjs} +1 -1
- package/dist/{better-auth-shared-jkksALri.d.mts → better-auth-shared-BvnM9px6.d.mts} +2 -2
- package/dist/{build-cmd-CJQSRupz.mjs → build-cmd-Br8qL0rA.mjs} +15 -17
- package/dist/{cache-CMzjhxHh.mjs → cache-wH-mP8UE.mjs} +10 -12
- package/dist/{cancel-deploy-S2N8NSv6.mjs → cancel-deploy-BEBOEgtu.mjs} +16 -18
- package/dist/cli/cli.mjs +62 -51
- package/dist/{client-YIzxv2ZO.mjs → client-Cj96iiBH.mjs} +118 -8
- package/dist/{config-8dLIngKW.mjs → config-1twldYCW.mjs} +10 -10
- package/dist/{config--wXmVOoe.mjs → config-BdUctCZD.mjs} +6 -6
- package/dist/{create-project-pLQdzEPe.mjs → create-project-DD9n8Ho-.mjs} +28 -23
- package/dist/{db-hAmBumot.mjs → db-DjKE2-A-.mjs} +151 -150
- package/dist/{delete-CfSe3EJO.mjs → delete-D2kr3Kmk.mjs} +13 -15
- package/dist/{deploy-DpOdwtla.mjs → deploy-C4PbkFyE.mjs} +114 -119
- package/dist/{discover-C8N1I4tK.mjs → discover-BuVVSAum.mjs} +4 -4
- package/dist/{dist-5cGIJHQQ.mjs → dist-BuiRJkTd.mjs} +59 -27
- package/dist/{domain-CkowysQx.mjs → domain-_luIsM_B.mjs} +14 -16
- package/dist/{env-CIwG2y7G.mjs → env-CO5XAS9t.mjs} +23 -25
- package/dist/{env-helpers-B_ks681T.d.mts → env-helpers-z4stu8uc.d.mts} +1 -1
- package/dist/{env-types-CaJaIRXU.mjs → env-types-D51bnR-c.mjs} +4 -4
- package/dist/{env-validation-LH6eoyW-.mjs → env-validation-CeC2FL66.mjs} +4 -4
- package/dist/{fetch-error-C6qffTl2.mjs → fetch-error-Dj3crt0e.mjs} +3 -3
- package/dist/{gen-q6McxXgE.mjs → gen-Cf79J4aw.mjs} +42 -44
- package/dist/{github-cmd-BvEKQmcD.mjs → github-cmd-DnqxyOsb.mjs} +197 -91
- package/dist/{handler-B7rCOy21.d.mts → handler-imD0UVDT.d.mts} +4 -5
- package/dist/{headers-BNWymgnH.mjs → headers-BwvFGhkx.mjs} +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +102 -83
- package/dist/{init-CZP69LJu.mjs → init-KirOzVDs.mjs} +132 -134
- package/dist/link-CUmiosyb.mjs +45 -0
- package/dist/{list-B7qXBBjo.mjs → list-3GEw7b6m.mjs} +10 -12
- package/dist/{login-B3l_sDwT.mjs → login-DJReaT_Q.mjs} +14 -15
- package/dist/{logs-AXm660MB.mjs → logs-D-rQ56Lq.mjs} +9 -11
- package/dist/{magic-string.es-C1Fb0uxq.mjs → magic-string.es-ZQjdJFFn.mjs} +3 -3
- package/dist/{mcp-D2plINxM.mjs → mcp-D7yc0dXY.mjs} +2 -3
- package/dist/{node-B07cZs0d.mjs → node-yFFk626c.mjs} +6 -6
- package/dist/{package-json-Bg_GJdJB.mjs → package-json-B0NuUWGd.mjs} +1 -1
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/client.mjs +2 -1
- package/dist/pages/head-client.d.mts +1 -1
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/islands-plugin.mjs +3 -3
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +5 -2
- package/dist/{plugin-inference-C3fLzFvP.mjs → plugin-inference-CJxi_fWI.mjs} +4 -4
- package/dist/{prepare-DRRboRqH.mjs → prepare-C_cVurhP.mjs} +15 -18
- package/dist/{preset-B7ZQZn0u.mjs → preset-CVvwCeIy.mjs} +4 -4
- package/dist/{project-cmd-InegJruy.mjs → project-cmd-DnU7u9QF.mjs} +13 -14
- package/dist/{project-paths-CCMrHYQm.mjs → project-paths-tpdR1mJR.mjs} +2 -2
- package/dist/{project-tsconfig-BTNuNoJ0.mjs → project-tsconfig-D9uSVVpA.mjs} +4 -4
- package/dist/{protocol-6UZCowS1.d.mts → protocol-6hTJ04T1.d.mts} +3 -3
- package/dist/{resolve-project-D4O1_fZz.mjs → resolve-project-D2HI3TrG.mjs} +2 -2
- package/dist/{rollback-CHVE-DeT.mjs → rollback-Yh7bCKob.mjs} +21 -23
- package/dist/{route-types-D03ryMXz.mjs → route-types-CfKfhbIg.mjs} +234 -3
- package/dist/{runner-BQyKUqAL.mjs → runner-h272wcPj.mjs} +4 -5
- package/dist/{runner-pg-EuhrFW3D.mjs → runner-pg-waxJOnBb.mjs} +1 -1
- package/dist/runtime/ai.mjs +2 -2
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +3 -3
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/client-react.d.mts +2 -2
- package/dist/runtime/client-react.mjs +1 -1
- package/dist/runtime/client-solid.d.mts +2 -2
- package/dist/runtime/client-solid.mjs +1 -1
- package/dist/runtime/client-svelte.d.mts +2 -2
- package/dist/runtime/client-svelte.mjs +1 -1
- package/dist/runtime/client-vue.d.mts +2 -2
- package/dist/runtime/client-vue.mjs +1 -1
- package/dist/runtime/client.d.mts +2 -2
- package/dist/runtime/client.mjs +1 -1
- package/dist/runtime/db-pg.d.mts +1 -1
- package/dist/runtime/env-helpers.d.mts +1 -1
- package/dist/runtime/env-public-client.d.mts +1 -1
- package/dist/runtime/env-public-client.mjs +2 -0
- package/dist/runtime/env-public.d.mts +3 -4
- package/dist/runtime/env-public.mjs +3 -1
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/fetch-stream.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +2 -2
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/live-server.mjs +2 -0
- package/dist/runtime/live.d.mts +2 -2
- package/dist/runtime/live.mjs +3 -1
- package/dist/runtime/migration-handler-pg.mjs +1 -1
- package/dist/runtime/migration-handler.mjs +1 -1
- package/dist/runtime/remote/index.mjs +11 -1
- package/dist/runtime/sandbox.d.mts +1 -4
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws-server.mjs +2 -0
- package/dist/runtime/ws.d.mts +3 -3
- package/dist/runtime/ws.mjs +2 -0
- package/dist/{scan-VCAM1oh3.mjs → scan-Dp_Gyzs3.mjs} +3 -3
- package/dist/{scan-DGEp1-1Q.mjs → scan-i7Yz54fv.mjs} +26 -8
- package/dist/{secret-CVKwIOm3.mjs → secret-u7FRvg8d.mjs} +22 -24
- package/dist/{skills-Dl3u05da.mjs → skills-DsdNDtX3.mjs} +6 -7
- package/dist/{subcommand-prompt-B8ng0FTS.mjs → subcommand-prompt-DtES-oP6.mjs} +34 -35
- package/dist/sveltekit.mjs +2 -2
- package/dist/validate-DT7nFMlf.mjs +504 -0
- package/dist/{yarn-pnp-WLW2IHUY.mjs → yarn-pnp-CW8LB6g_.mjs} +1 -1
- package/package.json +19 -19
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +94 -0
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +32 -11
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +45 -0
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +5 -5
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +4 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +29 -12
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/AGENTS.md +1 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/README.md +18 -6
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/build.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/check.md +35 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/create.md +70 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/fmt.md +3 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/index.md +11 -7
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/lint.md +3 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/pack.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/run.md +141 -26
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/staged.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/test.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +145 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/cache.md +16 -28
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/check.md +16 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ci.md +15 -17
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/commit-hooks.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/create.md +255 -2
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/docker.md +175 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/env.md +70 -5
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/github-actions-cache.md +165 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ide-integration.md +2 -2
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/index.md +9 -3
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/install.md +63 -11
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate-rules.md +347 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate.md +27 -3
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/monorepo.md +176 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/pack.md +8 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/run.md +36 -4
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/troubleshooting.md +11 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/upgrade.md +65 -13
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +403 -390
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +2 -1
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/AGENTS.md +1 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/README.md +18 -6
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/build.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/check.md +35 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/create.md +70 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/fmt.md +3 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/index.md +11 -7
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/lint.md +3 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/pack.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/run.md +141 -26
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/staged.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/test.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +145 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/cache.md +16 -28
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/check.md +16 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ci.md +15 -17
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/commit-hooks.md +9 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/create.md +255 -2
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/docker.md +175 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/env.md +70 -5
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/github-actions-cache.md +165 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ide-integration.md +2 -2
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/index.md +9 -3
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/install.md +63 -11
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate-rules.md +347 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate.md +27 -3
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/monorepo.md +176 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/pack.md +8 -0
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/run.md +36 -4
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/troubleshooting.md +11 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/upgrade.md +65 -13
- package/skills/void/docs/reference/cli.md +19 -1
- package/dist/agents-MhSzNMiC.mjs +0 -151
- package/dist/collect-9rO3JFNM.mjs +0 -55
- package/dist/config-hhMYPVRT.mjs +0 -21
- package/dist/dist-abzUneor.mjs +0 -1287
- package/dist/drizzle-DqstQTGq.mjs +0 -232
- package/dist/link-BKLElphS.mjs +0 -47
- package/dist/output-DeiS4oEX.mjs +0 -139
- package/dist/plan-aD3wRDqF.mjs +0 -271
- package/dist/project-CH9pdo16.mjs +0 -72
- package/dist/project-slug-rX3kTOfY.mjs +0 -10
- package/dist/validate-CNWm-PsL.mjs +0 -186
- /package/dist/{auth-migrations-BP-hMzYl.mjs → auth-migrations-BTZ-ATvQ.mjs} +0 -0
- /package/dist/{auth-Dz2CCn4T.d.mts → auth-qgMlYp7Z.d.mts} +0 -0
- /package/dist/{canonical-json-CEyQaVDa.mjs → canonical-json-DuDiiUsQ.mjs} +0 -0
- /package/dist/{cf-access-DKDsgwOU.mjs → cf-access-Bqw81xAf.mjs} +0 -0
- /package/dist/{defer-C-bdSM_b.mjs → defer-YsYDUoii.mjs} +0 -0
- /package/dist/{dotenv-lS94ymhM.mjs → dotenv-D_UbC_vc.mjs} +0 -0
- /package/dist/{env-raw-Dtj1UAoK.mjs → env-raw-CoS20LHP.mjs} +0 -0
- /package/dist/{fetch-error-B6RaJ-eZ.d.mts → fetch-error-Sp1R4mZv.d.mts} +0 -0
- /package/dist/{git-metadata-Ce0AtSZL.mjs → git-metadata-CBKaL0v5.mjs} +0 -0
- /package/dist/{head-eOUCWUNy.d.mts → head-nmvOgFjd.d.mts} +0 -0
- /package/dist/{log-BdD_Fpms.mjs → log-ChfPKsVd.mjs} +0 -0
- /package/dist/{pathe.M-eThtNZ-BrPhGF_K.mjs → pathe.M-eThtNZ-CQzLbt4c.mjs} +0 -0
- /package/dist/{pg-CempqvEJ.mjs → pg-J2HbZIkX.mjs} +0 -0
- /package/dist/{providers-BJIoduK9.d.mts → providers-BNKRacMr.d.mts} +0 -0
- /package/dist/{providers-BwPbdHdi.mjs → providers-CJlNS3kT.mjs} +0 -0
- /package/dist/{proxy-M3pxItg2.mjs → proxy-D-3_D-Gl.mjs} +0 -0
- /package/dist/{chunk-DJd-R1mw.mjs → rolldown-runtime-DJK8HYOj.mjs} +0 -0
- /package/dist/{standard-schema-Cy0lfeWv.d.mts → standard-schema-DJ0HW7QP.d.mts} +0 -0
- /package/dist/{types-BodZGegX.d.mts → types-lLjNE9Qp.d.mts} +0 -0
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { a as join, c as resolve, i as isAbsolute, n as dirname, s as relative, t as basename } from "./pathe.M-eThtNZ-
|
|
2
|
-
import {
|
|
3
|
-
import { n as readProjectPaths } from "./project-paths-
|
|
4
|
-
import { f as getToken, m as isStagingMode, n as PlatformClient } from "./client-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { n as
|
|
15
|
-
import { t as promptForLoginToken } from "./login-B3l_sDwT.mjs";
|
|
16
|
-
import { r as formatProjectCommand } from "./preset-B7ZQZn0u.mjs";
|
|
17
|
-
import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-WLW2IHUY.mjs";
|
|
1
|
+
import { a as join, c as resolve, i as isAbsolute, n as dirname, s as relative, t as basename } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
|
|
2
|
+
import { A as text, D as outro, E as note, S as confirm, T as log, a as cliTitle, j as isCancel, k as select, n as getAgentById, r as getPackageDir, t as detectAgents, w as intro, x as cancel } from "./agents-Bmr5tFFb.mjs";
|
|
3
|
+
import { n as readProjectPaths } from "./project-paths-tpdR1mJR.mjs";
|
|
4
|
+
import { S as writeProjectConfig, b as readProjectConfig, f as getToken, m as isStagingMode, n as PlatformClient } from "./client-Cj96iiBH.mjs";
|
|
5
|
+
import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-D9uSVVpA.mjs";
|
|
6
|
+
import { c as getDatabaseDialect, f as readConfig } from "./config-1twldYCW.mjs";
|
|
7
|
+
import { r as detectFramework } from "./plugin-inference-CJxi_fWI.mjs";
|
|
8
|
+
import { r as parseDotenvFile, t as expandDotenv } from "./dotenv-D_UbC_vc.mjs";
|
|
9
|
+
import { t as MagicString } from "./magic-string.es-ZQjdJFFn.mjs";
|
|
10
|
+
import { n as writeDrizzleConfig } from "./config-BdUctCZD.mjs";
|
|
11
|
+
import { n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-DD9n8Ho-.mjs";
|
|
12
|
+
import { t as promptForLoginToken } from "./login-DJReaT_Q.mjs";
|
|
13
|
+
import { r as formatProjectCommand } from "./preset-CVvwCeIy.mjs";
|
|
14
|
+
import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-CW8LB6g_.mjs";
|
|
18
15
|
import { createRequire } from "node:module";
|
|
19
16
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
20
17
|
import { fileURLToPath } from "node:url";
|
|
@@ -26,19 +23,19 @@ async function ensureToken(root) {
|
|
|
26
23
|
const existing = getToken(root);
|
|
27
24
|
if (existing) return existing;
|
|
28
25
|
const token = await promptForLoginToken(root);
|
|
29
|
-
|
|
26
|
+
log.success(isStagingMode(root) ? "Staging token saved." : "Token saved.");
|
|
30
27
|
return token;
|
|
31
28
|
}
|
|
32
29
|
async function maybeSetupDeployProject(root) {
|
|
33
30
|
const existing = readProjectConfig(root);
|
|
34
31
|
if (existing) {
|
|
35
|
-
|
|
32
|
+
log.info(`Project already linked: ${existing.slug}`);
|
|
36
33
|
return existing;
|
|
37
34
|
}
|
|
38
35
|
const existingToken = getToken(root);
|
|
39
|
-
const shouldSetup = await
|
|
40
|
-
if (
|
|
41
|
-
|
|
36
|
+
const shouldSetup = await confirm({ message: existingToken ? "Link your Void project now?" : "Log in now and link or create a Void project?" });
|
|
37
|
+
if (isCancel(shouldSetup)) {
|
|
38
|
+
cancel("Setup cancelled.");
|
|
42
39
|
process.exit(0);
|
|
43
40
|
}
|
|
44
41
|
if (!shouldSetup) return null;
|
|
@@ -52,7 +49,7 @@ async function maybeSetupDeployProject(root) {
|
|
|
52
49
|
slug: result.project.slug
|
|
53
50
|
};
|
|
54
51
|
writeProjectConfig(root, config);
|
|
55
|
-
|
|
52
|
+
log.success(`Linked project: ${config.slug}`);
|
|
56
53
|
return config;
|
|
57
54
|
}
|
|
58
55
|
return promptAndCreateProject(root, client);
|
|
@@ -135,7 +132,7 @@ function renderEnvTs(entries) {
|
|
|
135
132
|
`export default defineEnv({});`,
|
|
136
133
|
``
|
|
137
134
|
].join("\n");
|
|
138
|
-
const helpers = new Set(["string"]);
|
|
135
|
+
const helpers = /* @__PURE__ */ new Set(["string"]);
|
|
139
136
|
for (const e of entries) helpers.add(e.helper);
|
|
140
137
|
const importList = [
|
|
141
138
|
"string",
|
|
@@ -626,7 +623,7 @@ function parseInitArgs(args) {
|
|
|
626
623
|
agents: parsed.values.agents === true
|
|
627
624
|
};
|
|
628
625
|
}
|
|
629
|
-
const EMPTY_PROJECT_ALLOWED_ENTRIES = new Set([
|
|
626
|
+
const EMPTY_PROJECT_ALLOWED_ENTRIES = /* @__PURE__ */ new Set([
|
|
630
627
|
".git",
|
|
631
628
|
".gitignore",
|
|
632
629
|
"AGENTS.md",
|
|
@@ -673,7 +670,7 @@ const PNPM_ALLOWED_BUILDS = [
|
|
|
673
670
|
"workerd"
|
|
674
671
|
];
|
|
675
672
|
const drizzleKitBin = join(fileURLToPath(import.meta.resolve("drizzle-kit")), "..", "bin.cjs");
|
|
676
|
-
const EMPTY_PROJECT_ALLOWED_PACKAGES = new Set([
|
|
673
|
+
const EMPTY_PROJECT_ALLOWED_PACKAGES = /* @__PURE__ */ new Set([
|
|
677
674
|
"void",
|
|
678
675
|
"hono",
|
|
679
676
|
"vite",
|
|
@@ -695,13 +692,13 @@ const EMPTY_PROJECT_ALLOWED_PACKAGES = new Set([
|
|
|
695
692
|
"@void/svelte",
|
|
696
693
|
"@void/solid"
|
|
697
694
|
]);
|
|
698
|
-
const EMPTY_PROJECT_ALLOWED_ADAPTER_PACKAGES = new Set([
|
|
695
|
+
const EMPTY_PROJECT_ALLOWED_ADAPTER_PACKAGES = /* @__PURE__ */ new Set([
|
|
699
696
|
"@void/react",
|
|
700
697
|
"@void/vue",
|
|
701
698
|
"@void/svelte",
|
|
702
699
|
"@void/solid"
|
|
703
700
|
]);
|
|
704
|
-
const EMPTY_PROJECT_BASE_PACKAGES = new Set([
|
|
701
|
+
const EMPTY_PROJECT_BASE_PACKAGES = /* @__PURE__ */ new Set([
|
|
705
702
|
"void",
|
|
706
703
|
"@void/react",
|
|
707
704
|
"@void/vue",
|
|
@@ -710,9 +707,9 @@ const EMPTY_PROJECT_BASE_PACKAGES = new Set([
|
|
|
710
707
|
]);
|
|
711
708
|
const EMPTY_PROJECT_ALLOWED_SCRIPTS = {
|
|
712
709
|
test: void 0,
|
|
713
|
-
dev: new Set(["vite", "vp dev"]),
|
|
714
|
-
build: new Set(["vite build", "vp build"]),
|
|
715
|
-
preview: new Set(["vite preview", "vp preview"])
|
|
710
|
+
dev: /* @__PURE__ */ new Set(["vite", "vp dev"]),
|
|
711
|
+
build: /* @__PURE__ */ new Set(["vite build", "vp build"]),
|
|
712
|
+
preview: /* @__PURE__ */ new Set(["vite preview", "vp preview"])
|
|
716
713
|
};
|
|
717
714
|
const EMPTY_PROJECT_STARTER_SCRIPT_COMMANDS = new Set(Object.values(EMPTY_PROJECT_ALLOWED_SCRIPTS).flatMap((commands) => commands ? Array.from(commands) : []));
|
|
718
715
|
function isStarterScriptCommand(value) {
|
|
@@ -918,7 +915,7 @@ function validateSubfolderName(root, value) {
|
|
|
918
915
|
}
|
|
919
916
|
async function resolveInitRoot(root) {
|
|
920
917
|
if (!shouldPromptForInitLocation(root)) return root;
|
|
921
|
-
const choice = await
|
|
918
|
+
const choice = await select({
|
|
922
919
|
message: "This folder is not empty. Where should Void initialize?",
|
|
923
920
|
initialValue: "subfolder",
|
|
924
921
|
options: [{
|
|
@@ -931,24 +928,24 @@ async function resolveInitRoot(root) {
|
|
|
931
928
|
hint: "Add package.json, vite.config.ts, and Void files to this directory."
|
|
932
929
|
}]
|
|
933
930
|
});
|
|
934
|
-
if (
|
|
935
|
-
|
|
931
|
+
if (isCancel(choice)) {
|
|
932
|
+
cancel("Setup cancelled.");
|
|
936
933
|
process.exit(0);
|
|
937
934
|
}
|
|
938
935
|
if (choice === "current") return root;
|
|
939
|
-
const folder = await
|
|
936
|
+
const folder = await text({
|
|
940
937
|
message: "New project folder name:",
|
|
941
938
|
placeholder: "my-void-app",
|
|
942
939
|
initialValue: "my-void-app",
|
|
943
940
|
validate: (value) => validateSubfolderName(root, value)
|
|
944
941
|
});
|
|
945
|
-
if (
|
|
946
|
-
|
|
942
|
+
if (isCancel(folder)) {
|
|
943
|
+
cancel("Setup cancelled.");
|
|
947
944
|
process.exit(0);
|
|
948
945
|
}
|
|
949
946
|
const nextRoot = join(root, folder.trim());
|
|
950
947
|
mkdirSync(nextRoot, { recursive: true });
|
|
951
|
-
|
|
948
|
+
log.info(`Scaffolding in ${nextRoot}`);
|
|
952
949
|
return nextRoot;
|
|
953
950
|
}
|
|
954
951
|
function parsePackageManagerField(pkg) {
|
|
@@ -1439,7 +1436,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1439
1436
|
if (!parsed) throw new SyntaxError("Failed to parse tsconfig.json");
|
|
1440
1437
|
tsconfig = parsed;
|
|
1441
1438
|
} catch {
|
|
1442
|
-
|
|
1439
|
+
log.warn("Could not parse tsconfig.json, skipping");
|
|
1443
1440
|
return;
|
|
1444
1441
|
}
|
|
1445
1442
|
let updated = false;
|
|
@@ -1453,7 +1450,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1453
1450
|
else if (Array.isArray(extendsValue)) tsconfig.extends = [...extendsValue, target];
|
|
1454
1451
|
else tsconfig.extends = target;
|
|
1455
1452
|
updated = true;
|
|
1456
|
-
|
|
1453
|
+
log.success("Updated tsconfig.json — added extends .void/tsconfig.json");
|
|
1457
1454
|
}
|
|
1458
1455
|
const compilerOptions = asRecord(tsconfig.compilerOptions) ?? {};
|
|
1459
1456
|
tsconfig.compilerOptions = compilerOptions;
|
|
@@ -1461,13 +1458,13 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1461
1458
|
if (!types.includes("void/env")) {
|
|
1462
1459
|
types.push("void/env");
|
|
1463
1460
|
updated = true;
|
|
1464
|
-
|
|
1461
|
+
log.success("Updated tsconfig.json — added void/env to types");
|
|
1465
1462
|
}
|
|
1466
1463
|
const cfIdx = types.indexOf("@cloudflare/workers-types");
|
|
1467
1464
|
if (cfIdx !== -1) {
|
|
1468
1465
|
types.splice(cfIdx, 1);
|
|
1469
1466
|
updated = true;
|
|
1470
|
-
|
|
1467
|
+
log.success("Removed @cloudflare/workers-types from tsconfig types (included in void/env)");
|
|
1471
1468
|
}
|
|
1472
1469
|
compilerOptions.types = types;
|
|
1473
1470
|
const existingFiles = uniqueStrings(existingPatch.files);
|
|
@@ -1476,7 +1473,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1476
1473
|
if (JSON.stringify(tsconfig.files) !== JSON.stringify(files)) {
|
|
1477
1474
|
tsconfig.files = files;
|
|
1478
1475
|
updated = true;
|
|
1479
|
-
|
|
1476
|
+
log.success("Updated tsconfig.json — merged generated Void type files");
|
|
1480
1477
|
}
|
|
1481
1478
|
}
|
|
1482
1479
|
if (Object.keys(existingPatch.paths).length > 0 || asRecord(compilerOptions.paths) !== null) {
|
|
@@ -1486,7 +1483,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1486
1483
|
if (JSON.stringify(existingPaths) !== JSON.stringify(paths)) {
|
|
1487
1484
|
compilerOptions.paths = paths;
|
|
1488
1485
|
updated = true;
|
|
1489
|
-
|
|
1486
|
+
log.success("Updated tsconfig.json — merged generated Void path aliases");
|
|
1490
1487
|
}
|
|
1491
1488
|
}
|
|
1492
1489
|
if (updated) {
|
|
@@ -1496,7 +1493,7 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1496
1493
|
...rest
|
|
1497
1494
|
};
|
|
1498
1495
|
writeFileSync(tsconfigPath, JSON.stringify(ordered, null, 2) + "\n");
|
|
1499
|
-
} else
|
|
1496
|
+
} else log.success("tsconfig.json looks good");
|
|
1500
1497
|
try {
|
|
1501
1498
|
const pkgPath = join(root, "package.json");
|
|
1502
1499
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
@@ -1511,8 +1508,8 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1511
1508
|
}
|
|
1512
1509
|
if (pkgUpdated) {
|
|
1513
1510
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
1514
|
-
|
|
1515
|
-
|
|
1511
|
+
log.success("Removed @cloudflare/workers-types from package.json (included in void/env)");
|
|
1512
|
+
log.info(`Re-run ${state.packageManager} install to update your lockfile`);
|
|
1516
1513
|
}
|
|
1517
1514
|
} catch {}
|
|
1518
1515
|
} else {
|
|
@@ -1539,8 +1536,8 @@ function setupTsconfig(root, state, pagesFramework) {
|
|
|
1539
1536
|
]
|
|
1540
1537
|
};
|
|
1541
1538
|
writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2) + "\n");
|
|
1542
|
-
|
|
1543
|
-
if (!state.hasTypescript)
|
|
1539
|
+
log.success("Created tsconfig.json");
|
|
1540
|
+
if (!state.hasTypescript) log.info("Don't forget to install typescript");
|
|
1544
1541
|
}
|
|
1545
1542
|
}
|
|
1546
1543
|
/** Today's UTC date as YYYY-MM-DD for wrangler compatibility_date. */
|
|
@@ -1600,9 +1597,9 @@ function setupWranglerConfig(root, framework) {
|
|
|
1600
1597
|
}
|
|
1601
1598
|
if (created || modified) {
|
|
1602
1599
|
writeFileSync(configPath, JSON.stringify(parsed, null, 2) + "\n");
|
|
1603
|
-
if (created)
|
|
1604
|
-
else
|
|
1605
|
-
} else
|
|
1600
|
+
if (created) log.success("Created wrangler.jsonc with compatibility_date and nodejs_als");
|
|
1601
|
+
else log.success("Updated wrangler.jsonc with compatibility_date and nodejs_als");
|
|
1602
|
+
} else log.success("wrangler.jsonc looks good");
|
|
1606
1603
|
}
|
|
1607
1604
|
function withDefaultVoidSchema(config) {
|
|
1608
1605
|
if (typeof config.$schema === "string" && config.$schema.length > 0) return config;
|
|
@@ -1625,34 +1622,34 @@ function ensureVoidWorkerCompatibilityDate(root) {
|
|
|
1625
1622
|
compatibility_date: compatibilityDate
|
|
1626
1623
|
};
|
|
1627
1624
|
writeVoidConfig(root, config);
|
|
1628
|
-
|
|
1625
|
+
log.success("Pinned worker compatibility_date in void.json");
|
|
1629
1626
|
}
|
|
1630
1627
|
function clearConfiguredDatabase(root, messages) {
|
|
1631
1628
|
const config = readConfig(root);
|
|
1632
1629
|
const configPath = join(root, VOID_CONFIG_FILE);
|
|
1633
1630
|
if (config.database !== "pg") {
|
|
1634
|
-
|
|
1631
|
+
log.info(messages.unchanged);
|
|
1635
1632
|
return;
|
|
1636
1633
|
}
|
|
1637
1634
|
delete config.database;
|
|
1638
1635
|
if (Object.keys(config).length === 0) {
|
|
1639
1636
|
unlinkSync(configPath);
|
|
1640
|
-
|
|
1637
|
+
log.success(messages.updated);
|
|
1641
1638
|
return;
|
|
1642
1639
|
}
|
|
1643
1640
|
writeVoidConfig(root, config);
|
|
1644
|
-
|
|
1641
|
+
log.success(messages.updated);
|
|
1645
1642
|
}
|
|
1646
1643
|
function applyDatabaseDialect(root, dialect) {
|
|
1647
1644
|
const config = readConfig(root);
|
|
1648
1645
|
if (dialect === "postgresql") {
|
|
1649
1646
|
if (config.database === "pg") {
|
|
1650
|
-
|
|
1647
|
+
log.info("PostgreSQL already configured in void.json");
|
|
1651
1648
|
return;
|
|
1652
1649
|
}
|
|
1653
1650
|
config.database = "pg";
|
|
1654
1651
|
writeVoidConfig(root, config);
|
|
1655
|
-
|
|
1652
|
+
log.success("Configured PostgreSQL in void.json");
|
|
1656
1653
|
return;
|
|
1657
1654
|
}
|
|
1658
1655
|
clearConfiguredDatabase(root, {
|
|
@@ -1676,7 +1673,7 @@ function applyDatabaseSetup(root, choice) {
|
|
|
1676
1673
|
applyDatabaseDialect(root, choice);
|
|
1677
1674
|
}
|
|
1678
1675
|
async function promptStarterMode() {
|
|
1679
|
-
const choice = await
|
|
1676
|
+
const choice = await select({
|
|
1680
1677
|
message: "Choose a Pages starter:",
|
|
1681
1678
|
options: [
|
|
1682
1679
|
{
|
|
@@ -1696,38 +1693,38 @@ async function promptStarterMode() {
|
|
|
1696
1693
|
}
|
|
1697
1694
|
]
|
|
1698
1695
|
});
|
|
1699
|
-
if (
|
|
1700
|
-
|
|
1696
|
+
if (isCancel(choice)) {
|
|
1697
|
+
cancel("Setup cancelled.");
|
|
1701
1698
|
process.exit(0);
|
|
1702
1699
|
}
|
|
1703
1700
|
return choice;
|
|
1704
1701
|
}
|
|
1705
1702
|
async function promptScaffoldToolchain() {
|
|
1706
|
-
const choice = await
|
|
1703
|
+
const choice = await select({
|
|
1707
1704
|
message: "Choose a Pages scaffold toolchain:",
|
|
1708
1705
|
initialValue: "vite-plus",
|
|
1709
1706
|
options: [...SCAFFOLD_TOOLCHAIN_OPTIONS]
|
|
1710
1707
|
});
|
|
1711
|
-
if (
|
|
1712
|
-
|
|
1708
|
+
if (isCancel(choice)) {
|
|
1709
|
+
cancel("Setup cancelled.");
|
|
1713
1710
|
process.exit(0);
|
|
1714
1711
|
}
|
|
1715
1712
|
return choice;
|
|
1716
1713
|
}
|
|
1717
1714
|
async function promptScaffoldFramework() {
|
|
1718
|
-
const choice = await
|
|
1715
|
+
const choice = await select({
|
|
1719
1716
|
message: "Choose a Pages framework to scaffold:",
|
|
1720
1717
|
options: [...SCAFFOLD_FRAMEWORK_OPTIONS]
|
|
1721
1718
|
});
|
|
1722
|
-
if (
|
|
1723
|
-
|
|
1719
|
+
if (isCancel(choice)) {
|
|
1720
|
+
cancel("Setup cancelled.");
|
|
1724
1721
|
process.exit(0);
|
|
1725
1722
|
}
|
|
1726
1723
|
return choice;
|
|
1727
1724
|
}
|
|
1728
1725
|
async function promptDatabaseSetup(root) {
|
|
1729
1726
|
const currentSetup = detectDatabaseSetup(root);
|
|
1730
|
-
const choice = await
|
|
1727
|
+
const choice = await select({
|
|
1731
1728
|
message: "Choose a database setup for this project:",
|
|
1732
1729
|
initialValue: currentSetup === "none" ? "sqlite" : currentSetup,
|
|
1733
1730
|
options: [
|
|
@@ -1748,8 +1745,8 @@ async function promptDatabaseSetup(root) {
|
|
|
1748
1745
|
}
|
|
1749
1746
|
]
|
|
1750
1747
|
});
|
|
1751
|
-
if (
|
|
1752
|
-
|
|
1748
|
+
if (isCancel(choice)) {
|
|
1749
|
+
cancel("Setup cancelled.");
|
|
1753
1750
|
process.exit(0);
|
|
1754
1751
|
}
|
|
1755
1752
|
return choice;
|
|
@@ -1818,6 +1815,9 @@ function getWorkflowSetupSteps(root, pm) {
|
|
|
1818
1815
|
*/
|
|
1819
1816
|
function getWorkflowYaml(root, pm, slug) {
|
|
1820
1817
|
const { setup, install, runner } = getWorkflowSetupSteps(root, pm);
|
|
1818
|
+
const projectLine = slug ? `VOID_PROJECT: ${slug}` : `# Set a VOID_PROJECT repository variable to your project slug
|
|
1819
|
+
# (Settings → Secrets and variables → Actions → Variables).
|
|
1820
|
+
VOID_PROJECT: \${{ vars.VOID_PROJECT }}`;
|
|
1821
1821
|
return `name: Deploy to Void
|
|
1822
1822
|
on:
|
|
1823
1823
|
push:
|
|
@@ -1841,9 +1841,7 @@ permissions:
|
|
|
1841
1841
|
env:
|
|
1842
1842
|
# Override with a VOID_API_URL repository variable to target staging.
|
|
1843
1843
|
VOID_API_URL: \${{ vars.VOID_API_URL || '${WORKFLOW_DEFAULT_API_URL}' }}
|
|
1844
|
-
${
|
|
1845
|
-
# (Settings → Secrets and variables → Actions → Variables).
|
|
1846
|
-
VOID_PROJECT: \${{ vars.VOID_PROJECT }}`}
|
|
1844
|
+
${projectLine}
|
|
1847
1845
|
|
|
1848
1846
|
jobs:
|
|
1849
1847
|
deploy:
|
|
@@ -1860,15 +1858,15 @@ function setupGithubActions(root, state) {
|
|
|
1860
1858
|
const workflowDir = join(root, ".github", "workflows");
|
|
1861
1859
|
const workflowPath = join(workflowDir, "void-deploy.yml");
|
|
1862
1860
|
if (existsSync(workflowPath)) {
|
|
1863
|
-
|
|
1861
|
+
log.warn("void-deploy.yml already exists, skipping");
|
|
1864
1862
|
return;
|
|
1865
1863
|
}
|
|
1866
1864
|
const slug = readProjectConfig(root)?.slug ?? null;
|
|
1867
1865
|
mkdirSync(workflowDir, { recursive: true });
|
|
1868
1866
|
writeFileSync(workflowPath, getWorkflowYaml(root, state.packageManager, slug));
|
|
1869
|
-
|
|
1870
|
-
if (slug)
|
|
1871
|
-
else
|
|
1867
|
+
log.success("Created .github/workflows/void-deploy.yml");
|
|
1868
|
+
if (slug) note(`Pushes to main will build and deploy "${slug}" via GitHub OIDC — no token to store.\nConnect the repo to your project in the Void dashboard to authorize it.`, "GitHub Actions OIDC deploy");
|
|
1869
|
+
else note("Pushes to main will build and deploy via GitHub OIDC — no token to store.\nSet a VOID_PROJECT repository variable (Settings → Secrets and variables → Actions → Variables)\nto your project slug, and connect the repo to your project in the Void dashboard.", "GitHub Actions OIDC deploy");
|
|
1872
1870
|
}
|
|
1873
1871
|
/**
|
|
1874
1872
|
* Bake a resolved project slug into an already-written `void-deploy.yml`.
|
|
@@ -1888,7 +1886,7 @@ function patchWorkflowProjectSlug(root, slug) {
|
|
|
1888
1886
|
const placeholderBlock = " # Set a VOID_PROJECT repository variable to your project slug\n # (Settings → Secrets and variables → Actions → Variables).\n VOID_PROJECT: ${{ vars.VOID_PROJECT }}";
|
|
1889
1887
|
if (!yaml.includes(placeholderBlock)) return false;
|
|
1890
1888
|
writeFileSync(workflowPath, yaml.replace(placeholderBlock, ` VOID_PROJECT: ${slug}`));
|
|
1891
|
-
|
|
1889
|
+
log.success(`Set VOID_PROJECT: ${slug} in .github/workflows/void-deploy.yml`);
|
|
1892
1890
|
return true;
|
|
1893
1891
|
}
|
|
1894
1892
|
function writeFileIfMissing(root, filePath, content) {
|
|
@@ -1896,13 +1894,13 @@ function writeFileIfMissing(root, filePath, content) {
|
|
|
1896
1894
|
if (existsSync(fullPath)) return;
|
|
1897
1895
|
mkdirSync(dirname(fullPath), { recursive: true });
|
|
1898
1896
|
writeFileSync(fullPath, content);
|
|
1899
|
-
|
|
1897
|
+
log.success(`Created ${filePath}`);
|
|
1900
1898
|
}
|
|
1901
1899
|
function ensureGitignore(root) {
|
|
1902
1900
|
const gitignorePath = join(root, ".gitignore");
|
|
1903
1901
|
if (!existsSync(gitignorePath)) {
|
|
1904
1902
|
writeFileSync(gitignorePath, SCAFFOLD_GITIGNORE_LINES.join("\n") + "\n");
|
|
1905
|
-
|
|
1903
|
+
log.success("Created .gitignore");
|
|
1906
1904
|
return;
|
|
1907
1905
|
}
|
|
1908
1906
|
const content = readFileSync(gitignorePath, "utf-8");
|
|
@@ -1910,7 +1908,7 @@ function ensureGitignore(root) {
|
|
|
1910
1908
|
const missing = SCAFFOLD_GITIGNORE_LINES.filter((line) => !existing.has(line));
|
|
1911
1909
|
if (missing.length === 0) return;
|
|
1912
1910
|
writeFileSync(gitignorePath, content + (content.endsWith("\n") ? "" : "\n") + missing.join("\n") + "\n");
|
|
1913
|
-
|
|
1911
|
+
log.success("Updated .gitignore with Void defaults");
|
|
1914
1912
|
}
|
|
1915
1913
|
function removeTopLevelYamlBlock(yaml, key) {
|
|
1916
1914
|
const lines = yaml.split(/\r?\n/);
|
|
@@ -1957,13 +1955,13 @@ function ensurePnpmAllowBuilds(root, pkg) {
|
|
|
1957
1955
|
const after = insertPnpmAllowBuilds(removeTopLevelYamlBlock(removeTopLevelYamlBlock(before, "onlyBuiltDependencies"), "allowBuilds"));
|
|
1958
1956
|
if (after !== before) {
|
|
1959
1957
|
writeFileSync(workspacePath, after);
|
|
1960
|
-
|
|
1958
|
+
log.success(configRoot === root ? "Updated pnpm-workspace.yaml with approved builds" : `Updated ${relative(root, workspacePath)} with approved builds`);
|
|
1961
1959
|
return true;
|
|
1962
1960
|
}
|
|
1963
1961
|
return false;
|
|
1964
1962
|
}
|
|
1965
1963
|
function installProjectDependencies(root, packageManager) {
|
|
1966
|
-
|
|
1964
|
+
log.step(`Installing dependencies with ${packageManager}`);
|
|
1967
1965
|
const result = spawnSync(packageManager, ["install"], {
|
|
1968
1966
|
cwd: root,
|
|
1969
1967
|
stdio: "inherit",
|
|
@@ -1971,7 +1969,7 @@ function installProjectDependencies(root, packageManager) {
|
|
|
1971
1969
|
});
|
|
1972
1970
|
if (result.error) throw result.error;
|
|
1973
1971
|
if (result.status !== 0) throw new Error(`${packageManager} install failed with exit code ${result.status ?? "unknown"}`);
|
|
1974
|
-
|
|
1972
|
+
log.success(`Installed dependencies with ${packageManager}`);
|
|
1975
1973
|
}
|
|
1976
1974
|
function generateStarterMigration(root, starterMode) {
|
|
1977
1975
|
const dialect = starterMode === "postgresql" ? "postgresql" : "sqlite";
|
|
@@ -1984,7 +1982,7 @@ function generateStarterMigration(root, starterMode) {
|
|
|
1984
1982
|
const originalJournalBytes = existsSync(journalPath) ? readFileSync(journalPath) : null;
|
|
1985
1983
|
const snapshotsBefore = metaDirExistedBefore ? new Set(readdirSync(metaDir).filter((f) => f.endsWith("_snapshot.json"))) : /* @__PURE__ */ new Set();
|
|
1986
1984
|
const sqlFilesBefore = migrationsDirExistedBefore ? new Set(readdirSync(migrationsDir).filter((f) => f.endsWith(".sql"))) : /* @__PURE__ */ new Set();
|
|
1987
|
-
|
|
1985
|
+
log.step("Generating initial Drizzle migration");
|
|
1988
1986
|
const result = spawnSync(process.execPath, [
|
|
1989
1987
|
drizzleKitBin,
|
|
1990
1988
|
"generate",
|
|
@@ -2030,7 +2028,7 @@ function generateStarterMigration(root, starterMode) {
|
|
|
2030
2028
|
const detail = [result.stderr, result.stdout].filter(Boolean).join("\n").trim();
|
|
2031
2029
|
throw new Error(["Failed to generate the starter database migration.", ...detail ? [detail] : []].join("\n\n"));
|
|
2032
2030
|
}
|
|
2033
|
-
|
|
2031
|
+
log.success("Generated initial Drizzle migration");
|
|
2034
2032
|
}
|
|
2035
2033
|
function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchain) {
|
|
2036
2034
|
const packageJsonPath = join(root, "package.json");
|
|
@@ -2081,11 +2079,11 @@ function scaffoldPagesApp(root, packageManager, framework, starterMode, toolchai
|
|
|
2081
2079
|
if (isPnpmProject(root, pkg)) ensurePnpmAllowBuilds(root, pkg);
|
|
2082
2080
|
if (packageManager === "pnpm" && resolveWorkspaceDeferral(root, pkg) === void 0 && (!pkg.packageManager || typeof pkg.packageManager !== "string")) pkg.packageManager = "pnpm@11.0.9";
|
|
2083
2081
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2084
|
-
|
|
2082
|
+
log.success("Updated package.json with starter scripts and dependencies");
|
|
2085
2083
|
for (const [filePath, content] of Object.entries(template.files)) writeFileIfMissing(root, filePath, content);
|
|
2086
2084
|
ensureGitignore(root);
|
|
2087
2085
|
if (starterMode !== "static") applyDatabaseDialect(root, starterMode);
|
|
2088
|
-
if (starterMode === "postgresql")
|
|
2086
|
+
if (starterMode === "postgresql") note(`Add DATABASE_URL to .env.local before running \`${getDevCommand(root)}\`.\nVoid uses that direct connection for local PostgreSQL development.`, "PostgreSQL local dev");
|
|
2089
2087
|
return dependencyAdded;
|
|
2090
2088
|
}
|
|
2091
2089
|
function hasDeclaredDependency(pkg, name) {
|
|
@@ -2149,7 +2147,7 @@ function ensureExistingProjectPackage(root, options = {}) {
|
|
|
2149
2147
|
const pnpmConfigChanged = isPnpmProject(root, pkg) ? ensurePnpmAllowBuilds(root, pkg) : false;
|
|
2150
2148
|
if (changed) {
|
|
2151
2149
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2152
|
-
|
|
2150
|
+
log.success(existedBefore ? plainViteSetup ? "Updated package.json with Void dependencies and Vite scripts" : "Updated package.json with Void dependency" : plainViteSetup ? "Created package.json with Void dependencies and Vite scripts" : "Created package.json with Void dependency");
|
|
2153
2151
|
}
|
|
2154
2152
|
return {
|
|
2155
2153
|
dependencyAdded,
|
|
@@ -2436,15 +2434,15 @@ function getGeneratedViteConfigPath(root) {
|
|
|
2436
2434
|
return readPackageJson(root)?.type === "module" ? "vite.config.ts" : "vite.config.mts";
|
|
2437
2435
|
}
|
|
2438
2436
|
function noteManualViteConfigSetup(configPath) {
|
|
2439
|
-
|
|
2437
|
+
note(`Could not safely update ${configPath ?? "your framework Vite config"} automatically.\n\nAdd \`voidPlugin()\` to the top-level Vite plugins array:\n\nimport { voidPlugin } from "void";\n\nexport default defineConfig({\n plugins: [voidPlugin()],\n});`, "Manual Vite config step");
|
|
2440
2438
|
}
|
|
2441
2439
|
function noteManualFrameworkConfigSetup(framework) {
|
|
2442
2440
|
if (framework.name === "astro") {
|
|
2443
|
-
|
|
2441
|
+
note("Detected Astro. Void init does not patch astro.config.* automatically.\n\nAdd `voidPlugin()` to the Astro Vite plugins option:\n\nimport { voidPlugin } from \"void\";\n\nexport default defineConfig({\n vite: { plugins: [voidPlugin()] },\n});", "Manual Astro config step");
|
|
2444
2442
|
return;
|
|
2445
2443
|
}
|
|
2446
2444
|
if (framework.name === "nuxt") {
|
|
2447
|
-
|
|
2445
|
+
note("Detected Nuxt. Void init does not patch nuxt.config.* automatically.\n\nAdd `voidPlugin()` to the Nuxt Vite plugins option:\n\nimport { voidPlugin } from \"void\";\n\nexport default defineNuxtConfig({\n vite: { plugins: [voidPlugin()] },\n});", "Manual Nuxt config step");
|
|
2448
2446
|
return;
|
|
2449
2447
|
}
|
|
2450
2448
|
noteManualViteConfigSetup();
|
|
@@ -2467,14 +2465,14 @@ function ensureExistingProjectViteConfig(root, framework) {
|
|
|
2467
2465
|
return;
|
|
2468
2466
|
}
|
|
2469
2467
|
if (updated === original) {
|
|
2470
|
-
|
|
2468
|
+
log.info(`${configPath} already includes voidPlugin()`);
|
|
2471
2469
|
return;
|
|
2472
2470
|
}
|
|
2473
2471
|
writeFileSync(fullPath, updated);
|
|
2474
|
-
|
|
2472
|
+
log.success(`Added voidPlugin() to ${configPath}`);
|
|
2475
2473
|
}
|
|
2476
2474
|
function setupExistingProject(root, framework) {
|
|
2477
|
-
|
|
2475
|
+
log.info("Existing project detected. Configuring Void...");
|
|
2478
2476
|
const packageResult = ensureExistingProjectPackage(root, { plainViteSetup: framework?.class !== "c" });
|
|
2479
2477
|
ensureExistingProjectViteConfig(root, framework);
|
|
2480
2478
|
return packageResult;
|
|
@@ -2506,7 +2504,7 @@ export const posts = sqliteTable("posts", {
|
|
|
2506
2504
|
createdAt: text("created_at").notNull().default(sql\`(datetime('now'))\`),
|
|
2507
2505
|
});
|
|
2508
2506
|
`);
|
|
2509
|
-
|
|
2507
|
+
log.success("Created db/schema.ts");
|
|
2510
2508
|
mkdirSync(join(paths.routesDir, "api"), { recursive: true });
|
|
2511
2509
|
writeFileSync(join(paths.routesDir, "api", "posts.ts"), `import { defineHandler } from "void";
|
|
2512
2510
|
import { db } from "void/db";
|
|
@@ -2517,7 +2515,7 @@ export const GET = defineHandler(async () => {
|
|
|
2517
2515
|
return db.select().from(posts);
|
|
2518
2516
|
});
|
|
2519
2517
|
`);
|
|
2520
|
-
|
|
2518
|
+
log.success("Created routes/api/posts.ts");
|
|
2521
2519
|
ensureProjectTsconfig(root, void 0, true, true, { paths });
|
|
2522
2520
|
mkdirSync(paths.ssrDir, { recursive: true });
|
|
2523
2521
|
writeFileSync(join(paths.ssrDir, "demo.ts"), `import { fetch } from "void/client";
|
|
@@ -2531,8 +2529,8 @@ console.log(posts);
|
|
|
2531
2529
|
// posts[0].body ← string (type-checked)
|
|
2532
2530
|
// posts[0].nope ← TypeScript error
|
|
2533
2531
|
`);
|
|
2534
|
-
|
|
2535
|
-
|
|
2532
|
+
log.success("Created src/demo.ts");
|
|
2533
|
+
note(`SQL migration → DB types → Route handler → Route types → Typed fetch
|
|
2536
2534
|
|
|
2537
2535
|
Run \`${devCommand}\` and open src/demo.ts to see the types in action.\nTry changing the migration or handler — types update automatically.`, "Type Safety Demo");
|
|
2538
2536
|
return { packageJsonMutated };
|
|
@@ -2586,7 +2584,7 @@ function ensureVoidDependency(root) {
|
|
|
2586
2584
|
const pnpmConfigChanged = isPnpmProject(root, pkg) ? ensurePnpmAllowBuilds(root, pkg) : false;
|
|
2587
2585
|
if (changed) {
|
|
2588
2586
|
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
2589
|
-
|
|
2587
|
+
log.success(existedBefore ? "Ensured void is in package.json devDependencies" : "Created package.json with void as a devDependency");
|
|
2590
2588
|
}
|
|
2591
2589
|
return changed || pnpmConfigChanged;
|
|
2592
2590
|
}
|
|
@@ -2597,7 +2595,7 @@ function detectInstructionFilePath(root, agents) {
|
|
|
2597
2595
|
return "AGENTS.md";
|
|
2598
2596
|
}
|
|
2599
2597
|
async function pickAgentWhenUndetected() {
|
|
2600
|
-
const choice = await
|
|
2598
|
+
const choice = await select({
|
|
2601
2599
|
message: "Could not detect your coding agent. Which one are you using?",
|
|
2602
2600
|
options: [
|
|
2603
2601
|
{
|
|
@@ -2622,8 +2620,8 @@ async function pickAgentWhenUndetected() {
|
|
|
2622
2620
|
}
|
|
2623
2621
|
]
|
|
2624
2622
|
});
|
|
2625
|
-
if (
|
|
2626
|
-
|
|
2623
|
+
if (isCancel(choice)) {
|
|
2624
|
+
cancel("Setup cancelled.");
|
|
2627
2625
|
process.exit(0);
|
|
2628
2626
|
}
|
|
2629
2627
|
if (choice === "generic") return {
|
|
@@ -2667,18 +2665,18 @@ function injectAgentBlock(root, filePath) {
|
|
|
2667
2665
|
const match = existing.match(MARKER_OPEN_RE);
|
|
2668
2666
|
if (match) {
|
|
2669
2667
|
if (match[1] === version) {
|
|
2670
|
-
|
|
2668
|
+
log.info(`${filePath} already has Void instructions (v${version})`);
|
|
2671
2669
|
return;
|
|
2672
2670
|
}
|
|
2673
2671
|
writeFileSync(fullPath, existing.replace(MARKER_BLOCK_RE, block));
|
|
2674
|
-
|
|
2672
|
+
log.success(`Updated Void instructions in ${filePath} (v${match[1]} → v${version})`);
|
|
2675
2673
|
} else {
|
|
2676
2674
|
writeFileSync(fullPath, existing + (existing.endsWith("\n") ? "\n" : "\n\n") + block + "\n");
|
|
2677
|
-
|
|
2675
|
+
log.success(`Added Void instructions to ${filePath}`);
|
|
2678
2676
|
}
|
|
2679
2677
|
} else {
|
|
2680
2678
|
writeFileSync(fullPath, block + "\n");
|
|
2681
|
-
|
|
2679
|
+
log.success(`Created ${filePath} with Void instructions`);
|
|
2682
2680
|
}
|
|
2683
2681
|
}
|
|
2684
2682
|
function writeMcpConfigForTarget(root, target) {
|
|
@@ -2690,7 +2688,7 @@ function writeMcpConfigForTarget(root, target) {
|
|
|
2690
2688
|
const rootConfig = asRecord(existing[target.rootKey]) ?? {};
|
|
2691
2689
|
existing[target.rootKey] = rootConfig;
|
|
2692
2690
|
if (rootConfig["void"]) {
|
|
2693
|
-
|
|
2691
|
+
log.info(`${target.filePath} already has void MCP config`);
|
|
2694
2692
|
return;
|
|
2695
2693
|
}
|
|
2696
2694
|
rootConfig["void"] = {
|
|
@@ -2700,7 +2698,7 @@ function writeMcpConfigForTarget(root, target) {
|
|
|
2700
2698
|
};
|
|
2701
2699
|
mkdirSync(dirname(fullPath), { recursive: true });
|
|
2702
2700
|
writeFileSync(fullPath, JSON.stringify(existing, null, 2) + "\n");
|
|
2703
|
-
|
|
2701
|
+
log.success(`Added void MCP server to ${target.filePath}`);
|
|
2704
2702
|
}
|
|
2705
2703
|
function pickMcpTarget(root, targets) {
|
|
2706
2704
|
if (targets.length === 1) return targets[0];
|
|
@@ -2720,22 +2718,22 @@ function setupMcpConfig(root, selectedAgents) {
|
|
|
2720
2718
|
hint: agent.mcpHint
|
|
2721
2719
|
});
|
|
2722
2720
|
if (selectedAgents.length === 0) {
|
|
2723
|
-
|
|
2721
|
+
note(JSON.stringify({ void: {
|
|
2724
2722
|
command: "npx",
|
|
2725
2723
|
args: ["void", "mcp"]
|
|
2726
2724
|
} }, null, 2), "Add this MCP server config to your agent");
|
|
2727
2725
|
return;
|
|
2728
2726
|
}
|
|
2729
|
-
for (const { agent, hint } of hintAgents)
|
|
2727
|
+
for (const { agent, hint } of hintAgents) log.info(`${agent.displayName}: ${hint}`);
|
|
2730
2728
|
for (const { agent, targets } of mcpAgents) {
|
|
2731
2729
|
const target = pickMcpTarget(root, targets);
|
|
2732
|
-
|
|
2730
|
+
log.info(`${agent.displayName} MCP target: ${target.filePath}`);
|
|
2733
2731
|
writeMcpConfigForTarget(root, target);
|
|
2734
2732
|
}
|
|
2735
2733
|
}
|
|
2736
2734
|
async function runInitCommand(root, initArgs) {
|
|
2737
2735
|
console.log();
|
|
2738
|
-
|
|
2736
|
+
intro(cliTitle("init"));
|
|
2739
2737
|
const targeted = Boolean(initArgs && (initArgs.tsconfig || initArgs.github || initArgs.agents));
|
|
2740
2738
|
if (!targeted) root = await resolveInitRoot(root);
|
|
2741
2739
|
const framework = detectFramework(root);
|
|
@@ -2746,13 +2744,13 @@ async function runInitCommand(root, initArgs) {
|
|
|
2746
2744
|
let didScaffoldStarter = false;
|
|
2747
2745
|
let scaffoldAddedDependencies = false;
|
|
2748
2746
|
let workspaceSubpackageSkip = false;
|
|
2749
|
-
if (framework)
|
|
2747
|
+
if (framework) log.info(`Detected ${framework.name} framework`);
|
|
2750
2748
|
if (!targeted && !framework && isScaffoldableEmptyProject(root)) {
|
|
2751
|
-
|
|
2749
|
+
log.info("Empty project detected. Scaffolding a Pages starter...");
|
|
2752
2750
|
const scaffoldToolchain = await promptScaffoldToolchain();
|
|
2753
2751
|
if (detectedPagesFramework) {
|
|
2754
2752
|
scaffoldedPagesFramework = detectedPagesFramework;
|
|
2755
|
-
|
|
2753
|
+
log.info(`Detected ${SCAFFOLD_FRAMEWORKS[detectedPagesFramework].label} adapter in package.json`);
|
|
2756
2754
|
} else scaffoldedPagesFramework = await promptScaffoldFramework();
|
|
2757
2755
|
const starterMode = await promptStarterMode();
|
|
2758
2756
|
const scaffoldPackageManager = scaffoldToolchain === "vite-plus" ? "pnpm" : preScaffoldState.packageManager;
|
|
@@ -2763,7 +2761,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2763
2761
|
workspaceSubpackageSkip = true;
|
|
2764
2762
|
const relRoot = relative(deferral.workspaceRoot, root) || ".";
|
|
2765
2763
|
const dbFollowUp = starterMode === "static" ? "" : `\nthen run \`void db generate\` from ./${relRoot} to create the initial migration.`;
|
|
2766
|
-
|
|
2764
|
+
note(`Scaffolded the Pages starter in ./${relRoot}.\n\nRun your workspace install from ${deferral.workspaceRoot} to pick up the new dependencies.${dbFollowUp}`, "Workspace subpackage");
|
|
2767
2765
|
} else if (scaffoldWroteDeps || !voidResolvable) scaffoldAddedDependencies = true;
|
|
2768
2766
|
if (starterMode !== "static") scaffoldedStarterMode = starterMode;
|
|
2769
2767
|
didScaffoldStarter = true;
|
|
@@ -2778,7 +2776,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2778
2776
|
if (deferral) {
|
|
2779
2777
|
workspaceSubpackageSkip = true;
|
|
2780
2778
|
const relRoot = relative(deferral.workspaceRoot, root) || ".";
|
|
2781
|
-
|
|
2779
|
+
note(`Configured Void in ./${relRoot}.\n\nRun your workspace install from ${deferral.workspaceRoot} to sync the lockfile and pick up the updated dependencies.\nIf this init flow scaffolds database files, then run \`void db generate\` from ./${relRoot}.`, "Workspace subpackage");
|
|
2782
2780
|
} else scaffoldAddedDependencies = true;
|
|
2783
2781
|
}
|
|
2784
2782
|
}
|
|
@@ -2798,16 +2796,16 @@ async function runInitCommand(root, initArgs) {
|
|
|
2798
2796
|
const agentSetup = await resolveAgentSetup(root);
|
|
2799
2797
|
injectAgentBlock(root, agentSetup.instructionFilePath);
|
|
2800
2798
|
if (agentSetup.agents.length > 0) {
|
|
2801
|
-
const { linkSkillsForSpecificAgents } = await import("./skills-
|
|
2799
|
+
const { linkSkillsForSpecificAgents } = await import("./skills-DsdNDtX3.mjs");
|
|
2802
2800
|
linkSkillsForSpecificAgents(root, agentSetup.agents);
|
|
2803
|
-
} else
|
|
2801
|
+
} else log.info("Skills linking skipped for generic agent setup");
|
|
2804
2802
|
setupMcpConfig(root, agentSetup.agents);
|
|
2805
2803
|
}
|
|
2806
|
-
if (!targeted && !framework) if (didScaffoldStarter || state.hasRoutes || state.hasMigrations || state.hasPages)
|
|
2804
|
+
if (!targeted && !framework) if (didScaffoldStarter || state.hasRoutes || state.hasMigrations || state.hasPages) log.info("Project already has pages, routes, or migrations, skipping demo");
|
|
2807
2805
|
else if (!state.typescriptWanted) {} else {
|
|
2808
|
-
const scaffold = await
|
|
2809
|
-
if (
|
|
2810
|
-
|
|
2806
|
+
const scaffold = await confirm({ message: "Scaffold demo code? (migration + API route + frontend fetch)" });
|
|
2807
|
+
if (isCancel(scaffold)) {
|
|
2808
|
+
cancel("Setup cancelled.");
|
|
2811
2809
|
process.exit(0);
|
|
2812
2810
|
}
|
|
2813
2811
|
if (scaffold) {
|
|
@@ -2817,7 +2815,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2817
2815
|
if (deferral && (!voidResolvable || packageJsonMutated)) {
|
|
2818
2816
|
workspaceSubpackageSkip = true;
|
|
2819
2817
|
const relRoot = relative(deferral.workspaceRoot, root) || ".";
|
|
2820
|
-
|
|
2818
|
+
note(`Scaffolded the starter demo in ./${relRoot}.\n\n${voidResolvable ? `\`void\` is already hoisted at an ancestor node_modules, but \`./${relRoot}/package.json\` was updated.\nRun your workspace install from ${deferral.workspaceRoot} to sync the lockfile,` : `Run your workspace install from ${deferral.workspaceRoot} to pick up the new \`void\` dep,`}\nthen run \`void db generate\` from ./${relRoot} to create the initial migration.`, "Workspace subpackage");
|
|
2821
2819
|
} else if (!voidResolvable || packageJsonMutated) scaffoldAddedDependencies = true;
|
|
2822
2820
|
scaffoldedStarterMode = "sqlite";
|
|
2823
2821
|
}
|
|
@@ -2825,20 +2823,20 @@ async function runInitCommand(root, initArgs) {
|
|
|
2825
2823
|
const githubStepSkipForSubpackage = isInsideWorkspaceSubpackage(root);
|
|
2826
2824
|
if ((!targeted || initArgs?.github) && !githubStepSkipForSubpackage) if (targeted) setupGithubActions(root, state);
|
|
2827
2825
|
else {
|
|
2828
|
-
const setupGha = await
|
|
2829
|
-
if (
|
|
2830
|
-
|
|
2826
|
+
const setupGha = await confirm({ message: "Create .github/workflows/void-deploy.yml to deploy on pushes to main?" });
|
|
2827
|
+
if (isCancel(setupGha)) {
|
|
2828
|
+
cancel("Setup cancelled.");
|
|
2831
2829
|
process.exit(0);
|
|
2832
2830
|
}
|
|
2833
2831
|
if (setupGha) setupGithubActions(root, state);
|
|
2834
2832
|
}
|
|
2835
|
-
else if (githubStepSkipForSubpackage && (initArgs?.github || !targeted))
|
|
2833
|
+
else if (githubStepSkipForSubpackage && (initArgs?.github || !targeted)) log.info("Skipping GitHub Actions setup: workflow files must live at the repo root, not in a workspace subpackage.");
|
|
2836
2834
|
if (!targeted) {
|
|
2837
2835
|
const scaffoldResult = maybeScaffoldEnvTs(root);
|
|
2838
2836
|
if (scaffoldResult.written) {
|
|
2839
2837
|
const rel = relative(root, scaffoldResult.written) || "env.ts";
|
|
2840
|
-
if (scaffoldResult.entries.length > 0)
|
|
2841
|
-
else
|
|
2838
|
+
if (scaffoldResult.entries.length > 0) log.success(`Scaffolded ${rel} from your .env files — review inferred types before running dev.`);
|
|
2839
|
+
else log.success(`Created empty ${rel} — add your env keys with \`defineEnv({...})\`.`);
|
|
2842
2840
|
}
|
|
2843
2841
|
}
|
|
2844
2842
|
if (scaffoldAddedDependencies) installProjectDependencies(root, state.packageManager);
|
|
@@ -2847,9 +2845,9 @@ async function runInitCommand(root, initArgs) {
|
|
|
2847
2845
|
const linked = await maybeSetupDeployProject(root);
|
|
2848
2846
|
if (linked?.slug) patchWorkflowProjectSlug(root, linked.slug);
|
|
2849
2847
|
}
|
|
2850
|
-
if (workspaceSubpackageSkip) if (scaffoldedStarterMode)
|
|
2851
|
-
else
|
|
2852
|
-
else
|
|
2848
|
+
if (workspaceSubpackageSkip) if (scaffoldedStarterMode) outro("Run your workspace install, then `void db generate` to finish setup.");
|
|
2849
|
+
else outro("Run your workspace install to finish setup.");
|
|
2850
|
+
else outro(`Run \`${getDevCommand(root, framework)}\` to start developing`);
|
|
2853
2851
|
}
|
|
2854
2852
|
//#endregion
|
|
2855
2853
|
export { parseInitArgs, runInitCommand };
|