void 0.10.5 → 0.10.7
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-UoCwfDQv.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-CVyuBHjP.mjs → build-cmd-Br8qL0rA.mjs} +15 -17
- package/dist/{cache-ACORQCIq.mjs → cache-wH-mP8UE.mjs} +10 -12
- package/dist/{cancel-deploy-Gi8zmoZC.mjs → cancel-deploy-BEBOEgtu.mjs} +16 -18
- package/dist/cli/cli.mjs +47 -49
- package/dist/{client-BlbnA92X.mjs → client-Cj96iiBH.mjs} +74 -8
- package/dist/{config-8dLIngKW.mjs → config-1twldYCW.mjs} +10 -10
- package/dist/{config-CbJS4Krx.mjs → config-BdUctCZD.mjs} +4 -4
- package/dist/{create-project-LjvkYziS.mjs → create-project-DD9n8Ho-.mjs} +28 -23
- package/dist/{db-C00yjN01.mjs → db-DjKE2-A-.mjs} +147 -149
- package/dist/{delete-CplfvTgU.mjs → delete-D2kr3Kmk.mjs} +13 -15
- package/dist/{deploy-CISNL5uK.mjs → deploy-C4PbkFyE.mjs} +97 -100
- package/dist/{discover-ZWuBvt22.mjs → discover-BuVVSAum.mjs} +3 -3
- package/dist/{dist-5cGIJHQQ.mjs → dist-BuiRJkTd.mjs} +59 -27
- package/dist/{domain-B4HpcgNG.mjs → domain-_luIsM_B.mjs} +14 -16
- package/dist/{env-DNMJpeVF.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-BS8cZead.mjs → env-types-D51bnR-c.mjs} +3 -3
- package/dist/{env-validation-BxbtBbjh.mjs → env-validation-CeC2FL66.mjs} +4 -4
- package/dist/{fetch-error-C6qffTl2.mjs → fetch-error-Dj3crt0e.mjs} +3 -3
- package/dist/{gen-C0pV2gRQ.mjs → gen-Cf79J4aw.mjs} +42 -44
- package/dist/{github-cmd-CwtLD1yI.mjs → github-cmd-DnqxyOsb.mjs} +88 -90
- 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-D58GxCtt.mjs → init-KirOzVDs.mjs} +132 -134
- package/dist/link-CUmiosyb.mjs +45 -0
- package/dist/{list-CbNNjXTm.mjs → list-3GEw7b6m.mjs} +10 -12
- package/dist/{login-CvxxF_9z.mjs → login-DJReaT_Q.mjs} +14 -15
- package/dist/{logs-BDZ9AuhM.mjs → logs-D-rQ56Lq.mjs} +9 -11
- package/dist/{magic-string.es-C1Fb0uxq.mjs → magic-string.es-ZQjdJFFn.mjs} +3 -3
- package/dist/{mcp-C8BjRt_z.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-D04iL1mW.mjs → plugin-inference-CJxi_fWI.mjs} +3 -3
- package/dist/{prepare-DUo9q8cM.mjs → prepare-C_cVurhP.mjs} +15 -18
- package/dist/{preset-D0My64KQ.mjs → preset-CVvwCeIy.mjs} +4 -4
- package/dist/{project-cmd-Dd1gNRdd.mjs → project-cmd-DnU7u9QF.mjs} +13 -14
- package/dist/{project-paths-CCMrHYQm.mjs → project-paths-tpdR1mJR.mjs} +2 -2
- package/dist/{project-tsconfig-DMBV55K2.mjs → project-tsconfig-D9uSVVpA.mjs} +2 -2
- 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-DzmCCrFg.mjs → rollback-Yh7bCKob.mjs} +21 -23
- package/dist/{route-types-BpSJEW20.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---8wfN58.mjs → scan-i7Yz54fv.mjs} +26 -8
- package/dist/{secret-CMLYWkE-.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 +1 -1
- 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/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 +5 -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-ZFmboqY3.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,39 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as runLoginCommand } from "./login-
|
|
1
|
+
import { T as log } from "./agents-Bmr5tFFb.mjs";
|
|
2
|
+
import { f as getToken, g as removeToken, n as PlatformClient } from "./client-Cj96iiBH.mjs";
|
|
3
|
+
import { n as runLoginCommand } from "./login-DJReaT_Q.mjs";
|
|
4
4
|
import { execSync } from "node:child_process";
|
|
5
5
|
//#region src/cli/auth-cmd.ts
|
|
6
6
|
async function runAuthCommand(root, args) {
|
|
7
7
|
switch (args.subcommand) {
|
|
8
8
|
case "login": return runLoginCommand(root);
|
|
9
9
|
case "logout":
|
|
10
|
-
if (removeToken(root))
|
|
11
|
-
else
|
|
10
|
+
if (removeToken(root)) log.success("Logged out.");
|
|
11
|
+
else log.info("Not logged in.");
|
|
12
12
|
return;
|
|
13
13
|
case "whoami": {
|
|
14
14
|
const token = getToken(root);
|
|
15
15
|
if (!token) {
|
|
16
|
-
|
|
16
|
+
log.error("Not logged in. Run `void auth login` first.");
|
|
17
17
|
process.exit(1);
|
|
18
18
|
}
|
|
19
19
|
const user = await new PlatformClient(token, { root }).whoami();
|
|
20
|
-
|
|
20
|
+
log.info(`${user.login} (${user.plan})`);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
case "token": {
|
|
24
24
|
if (!getToken(root)) await runLoginCommand(root);
|
|
25
25
|
const token = getToken(root);
|
|
26
26
|
if (!token) {
|
|
27
|
-
|
|
27
|
+
log.error("Login failed. Run `void auth login` to try again.");
|
|
28
28
|
process.exit(1);
|
|
29
29
|
}
|
|
30
30
|
const platform = process.platform;
|
|
31
31
|
const cmd = platform === "darwin" ? "pbcopy" : platform === "win32" ? "clip" : "xclip -selection clipboard";
|
|
32
32
|
try {
|
|
33
33
|
execSync(cmd, { input: token });
|
|
34
|
-
|
|
34
|
+
log.success("Token copied to clipboard.");
|
|
35
35
|
} catch {
|
|
36
|
-
|
|
36
|
+
log.warn("Could not copy to clipboard. Re-run `void login` to generate a new token.");
|
|
37
37
|
}
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as isVoidSocialAuthProvider, r as getVoidAuthProviderEnvNames } from "./providers-
|
|
1
|
+
import { a as isVoidSocialAuthProvider, r as getVoidAuthProviderEnvNames } from "./providers-CJlNS3kT.mjs";
|
|
2
2
|
import { authContext } from "./runtime/auth.mjs";
|
|
3
3
|
import { randomBytes, scrypt, timingSafeEqual } from "node:crypto";
|
|
4
4
|
import { betterAuth } from "better-auth";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as VoidAuthConfig, n as AuthState } from "./auth-
|
|
2
|
-
import { t as VoidAuthProvider } from "./providers-
|
|
1
|
+
import { i as VoidAuthConfig, n as AuthState } from "./auth-qgMlYp7Z.mjs";
|
|
2
|
+
import { t as VoidAuthProvider } from "./providers-BNKRacMr.mjs";
|
|
3
3
|
import { DBFieldAttribute } from "better-auth/db";
|
|
4
4
|
import { BetterAuthOptions, betterAuth } from "better-auth";
|
|
5
5
|
import { Context } from "hono";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as getToken, n as PlatformClient, t as PlatformApiError } from "./client-
|
|
3
|
-
import {
|
|
4
|
-
import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
5
|
-
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D4O1_fZz.mjs";
|
|
1
|
+
import { D as outro, T as log, a as cliTitle, s as dim, u as import_picocolors, w as intro } from "./agents-Bmr5tFFb.mjs";
|
|
2
|
+
import { b as readProjectConfig, f as getToken, n as PlatformClient, t as PlatformApiError } from "./client-Cj96iiBH.mjs";
|
|
3
|
+
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D2HI3TrG.mjs";
|
|
6
4
|
import { appendFileSync, writeFileSync } from "node:fs";
|
|
7
5
|
//#region src/cli/build-cmd.ts
|
|
8
6
|
const POLL_MS = 1e3;
|
|
@@ -61,10 +59,10 @@ async function runBuildCommand(root, args) {
|
|
|
61
59
|
}
|
|
62
60
|
async function runBuildLogsCommand(root, args) {
|
|
63
61
|
console.log();
|
|
64
|
-
|
|
62
|
+
intro(cliTitle("build logs"));
|
|
65
63
|
const token = getToken(root);
|
|
66
64
|
if (!token) {
|
|
67
|
-
|
|
65
|
+
log.error("Not logged in. Run `void auth login` first.");
|
|
68
66
|
process.exit(1);
|
|
69
67
|
}
|
|
70
68
|
const client = new PlatformClient(token, { root });
|
|
@@ -73,14 +71,14 @@ async function runBuildLogsCommand(root, args) {
|
|
|
73
71
|
if (requestedSlug) {
|
|
74
72
|
const resolved = resolveProjectBySlug(await client.listProjects(), requestedSlug);
|
|
75
73
|
if (!resolved) {
|
|
76
|
-
|
|
74
|
+
log.error(`build: No project found with slug '${requestedSlug}'.`);
|
|
77
75
|
process.exit(1);
|
|
78
76
|
}
|
|
79
77
|
projectId = resolved.projectId;
|
|
80
78
|
} else {
|
|
81
79
|
const linked = readProjectConfig(root);
|
|
82
80
|
if (!linked) {
|
|
83
|
-
|
|
81
|
+
log.error("build: No project specified. Pass a project with --project <slug>, set VOID_PROJECT, or link one with `void project link`.");
|
|
84
82
|
process.exit(1);
|
|
85
83
|
}
|
|
86
84
|
projectId = linked.projectId;
|
|
@@ -89,32 +87,32 @@ async function runBuildLogsCommand(root, args) {
|
|
|
89
87
|
if (!buildId) {
|
|
90
88
|
const builds = await client.listBuilds(projectId, 1);
|
|
91
89
|
if (builds.length === 0) {
|
|
92
|
-
|
|
90
|
+
outro("No builds found. Push to your connected branch to trigger one.");
|
|
93
91
|
return;
|
|
94
92
|
}
|
|
95
93
|
buildId = builds[0].id;
|
|
96
94
|
}
|
|
97
95
|
const write = args.output ? (line) => appendFileSync(args.output, `${line}\n`) : (line) => console.log(line);
|
|
98
|
-
const onRetry = (err) =>
|
|
96
|
+
const onRetry = (err) => log.warn(`build: transient error while following (${err instanceof Error ? err.message : String(err)}); retrying…`);
|
|
99
97
|
let first;
|
|
100
98
|
for (;;) try {
|
|
101
99
|
first = await client.getBuildLogs(projectId, buildId, 0);
|
|
102
100
|
break;
|
|
103
101
|
} catch (err) {
|
|
104
102
|
if (isFatalFollowError(err)) {
|
|
105
|
-
if (err instanceof PlatformApiError && err.status === 404)
|
|
106
|
-
else
|
|
103
|
+
if (err instanceof PlatformApiError && err.status === 404) log.error(`build: Build '${buildId}' not found for this project.`);
|
|
104
|
+
else log.error(err instanceof Error ? err.message : String(err));
|
|
107
105
|
process.exit(1);
|
|
108
106
|
}
|
|
109
107
|
if (!args.follow) {
|
|
110
|
-
|
|
108
|
+
log.error(err instanceof Error ? err.message : String(err));
|
|
111
109
|
process.exit(1);
|
|
112
110
|
}
|
|
113
111
|
onRetry(err);
|
|
114
112
|
await sleep(POLL_MS);
|
|
115
113
|
}
|
|
116
114
|
if (first.external) {
|
|
117
|
-
|
|
115
|
+
log.message(`This build ran on GitHub Actions. View logs:\n${import_picocolors.default.cyan(first.external)}`);
|
|
118
116
|
return;
|
|
119
117
|
}
|
|
120
118
|
if (args.output) writeFileSync(args.output, "");
|
|
@@ -131,10 +129,10 @@ async function runBuildLogsCommand(root, args) {
|
|
|
131
129
|
onRetry
|
|
132
130
|
}));
|
|
133
131
|
if (!terminal) {
|
|
134
|
-
|
|
132
|
+
outro(dim("Build still running — pass -f to follow."));
|
|
135
133
|
return;
|
|
136
134
|
}
|
|
137
|
-
|
|
135
|
+
outro(dim(`Build ${status}.`));
|
|
138
136
|
}
|
|
139
137
|
//#endregion
|
|
140
138
|
export { runBuildCommand };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as getToken, n as PlatformClient } from "./client-
|
|
3
|
-
import {
|
|
4
|
-
import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
5
|
-
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D4O1_fZz.mjs";
|
|
1
|
+
import { D as outro, T as log, a as cliTitle, o as createSpinner, s as dim, w as intro } from "./agents-Bmr5tFFb.mjs";
|
|
2
|
+
import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Cj96iiBH.mjs";
|
|
3
|
+
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D2HI3TrG.mjs";
|
|
6
4
|
//#region src/cli/cache.ts
|
|
7
5
|
async function runPurgeCacheCommand(root, projectSlug) {
|
|
8
6
|
console.log();
|
|
9
|
-
|
|
7
|
+
intro(cliTitle("project purge-cache"));
|
|
10
8
|
const token = getToken(root);
|
|
11
9
|
if (!token) {
|
|
12
|
-
|
|
10
|
+
log.error("Not logged in. Run `void auth login` first.");
|
|
13
11
|
process.exit(1);
|
|
14
12
|
}
|
|
15
13
|
const client = new PlatformClient(token, { root });
|
|
@@ -18,14 +16,14 @@ async function runPurgeCacheCommand(root, projectSlug) {
|
|
|
18
16
|
if (requestedSlug) {
|
|
19
17
|
const config = resolveProjectBySlug(await client.listProjects(), requestedSlug);
|
|
20
18
|
if (!config) {
|
|
21
|
-
|
|
19
|
+
log.error(`project: No project found with slug '${requestedSlug}'.`);
|
|
22
20
|
process.exit(1);
|
|
23
21
|
}
|
|
24
22
|
projectId = config.projectId;
|
|
25
23
|
} else {
|
|
26
24
|
const linked = readProjectConfig(root);
|
|
27
25
|
if (!linked) {
|
|
28
|
-
|
|
26
|
+
log.error("No linked project. Run `void project link` first.");
|
|
29
27
|
process.exit(1);
|
|
30
28
|
}
|
|
31
29
|
projectId = linked.projectId;
|
|
@@ -35,13 +33,13 @@ async function runPurgeCacheCommand(root, projectSlug) {
|
|
|
35
33
|
try {
|
|
36
34
|
const result = await client.purgeCache(projectId);
|
|
37
35
|
s.stop("Cache purged.");
|
|
38
|
-
|
|
36
|
+
log.success(`Purged ${result.purged} cached page(s).`);
|
|
39
37
|
} catch (err) {
|
|
40
38
|
s.stop("Cache purge failed.");
|
|
41
|
-
|
|
39
|
+
log.error(err instanceof Error ? err.message : String(err));
|
|
42
40
|
process.exit(1);
|
|
43
41
|
}
|
|
44
|
-
|
|
42
|
+
outro(dim("Edge cache will clear within seconds."));
|
|
45
43
|
}
|
|
46
44
|
//#endregion
|
|
47
45
|
export { runPurgeCacheCommand };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as getToken, n as PlatformClient } from "./client-
|
|
3
|
-
import { c as R, g as ge, v as ue, x as q, y as ye } from "./dist-abzUneor.mjs";
|
|
4
|
-
import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
1
|
+
import { D as outro, S as confirm, T as log, a as cliTitle, j as isCancel, w as intro } from "./agents-Bmr5tFFb.mjs";
|
|
2
|
+
import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Cj96iiBH.mjs";
|
|
5
3
|
//#region src/cli/cancel-deploy.ts
|
|
6
|
-
const ACTIVE_STATUSES = new Set([
|
|
4
|
+
const ACTIVE_STATUSES = /* @__PURE__ */ new Set([
|
|
7
5
|
"pending",
|
|
8
6
|
"uploading",
|
|
9
7
|
"migrating",
|
|
@@ -11,15 +9,15 @@ const ACTIVE_STATUSES = new Set([
|
|
|
11
9
|
]);
|
|
12
10
|
async function runCancelDeployCommand(root, deployId) {
|
|
13
11
|
console.log();
|
|
14
|
-
|
|
12
|
+
intro(cliTitle("project cancel"));
|
|
15
13
|
const token = getToken(root);
|
|
16
14
|
if (!token) {
|
|
17
|
-
|
|
15
|
+
log.error("Not logged in. Run `void auth login` first.");
|
|
18
16
|
process.exit(1);
|
|
19
17
|
}
|
|
20
18
|
const linked = readProjectConfig(root);
|
|
21
19
|
if (!linked) {
|
|
22
|
-
|
|
20
|
+
log.error("No linked project found. Run `void project link` first.");
|
|
23
21
|
process.exit(1);
|
|
24
22
|
}
|
|
25
23
|
const client = new PlatformClient(token, { root });
|
|
@@ -27,29 +25,29 @@ async function runCancelDeployCommand(root, deployId) {
|
|
|
27
25
|
const target = deployId ? deployments.find((d) => d.id === deployId) : deployments.find((d) => ACTIVE_STATUSES.has(d.status));
|
|
28
26
|
if (!target) {
|
|
29
27
|
if (deployId) {
|
|
30
|
-
|
|
28
|
+
log.error(`project: Deployment '${deployId}' was not found.`);
|
|
31
29
|
process.exit(1);
|
|
32
30
|
}
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
log.warn("No active deploy found.");
|
|
32
|
+
outro("Nothing canceled.");
|
|
35
33
|
return;
|
|
36
34
|
}
|
|
37
35
|
if (!ACTIVE_STATUSES.has(target.status)) {
|
|
38
36
|
if (deployId) {
|
|
39
|
-
|
|
37
|
+
log.error(`project: Deployment '${target.id}' is already '${target.status}'.`);
|
|
40
38
|
process.exit(1);
|
|
41
39
|
}
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
log.warn(`project: Deployment '${target.id}' is already '${target.status}'.`);
|
|
41
|
+
outro("Nothing canceled.");
|
|
44
42
|
return;
|
|
45
43
|
}
|
|
46
|
-
const ok = await
|
|
47
|
-
if (
|
|
48
|
-
|
|
44
|
+
const ok = await confirm({ message: `Cancel deployment ${formatDeployment(target)}?` });
|
|
45
|
+
if (isCancel(ok) || !ok) {
|
|
46
|
+
outro("Canceled.");
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
51
49
|
await client.cancelDeployment(linked.projectId, target.id);
|
|
52
|
-
|
|
50
|
+
outro(`Cancellation requested for deployment ${target.id}.`);
|
|
53
51
|
}
|
|
54
52
|
function formatDeployment(deployment) {
|
|
55
53
|
const suffix = deployment.commit ? ` (${deployment.commit.slice(0, 7)})` : "";
|
package/dist/cli/cli.mjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as join } from "../pathe.M-eThtNZ-
|
|
3
|
-
import {
|
|
4
|
-
import { c as R, u as Se, y as ye } from "../dist-abzUneor.mjs";
|
|
5
|
-
import { r as getPackageDir } from "../agents-MhSzNMiC.mjs";
|
|
2
|
+
import { a as join } from "../pathe.M-eThtNZ-CQzLbt4c.mjs";
|
|
3
|
+
import { D as outro, E as note, T as log, d as sectionTitle, i as categoryTitle, l as helpLine, r as getPackageDir, u as import_picocolors } from "../agents-Bmr5tFFb.mjs";
|
|
6
4
|
import { readFileSync } from "node:fs";
|
|
7
5
|
import { parseArgs } from "node:util";
|
|
8
6
|
//#region src/cli/args.ts
|
|
@@ -477,7 +475,7 @@ const genSubcommands = [
|
|
|
477
475
|
description: "Generate a queue consumer file"
|
|
478
476
|
}
|
|
479
477
|
];
|
|
480
|
-
const COLUMN_TYPES = new Set([
|
|
478
|
+
const COLUMN_TYPES = /* @__PURE__ */ new Set([
|
|
481
479
|
"string",
|
|
482
480
|
"text",
|
|
483
481
|
"datetime",
|
|
@@ -486,7 +484,7 @@ const COLUMN_TYPES = new Set([
|
|
|
486
484
|
"real",
|
|
487
485
|
"blob"
|
|
488
486
|
]);
|
|
489
|
-
const VALID_METHODS = new Set([
|
|
487
|
+
const VALID_METHODS = /* @__PURE__ */ new Set([
|
|
490
488
|
"get",
|
|
491
489
|
"post",
|
|
492
490
|
"put",
|
|
@@ -1534,7 +1532,7 @@ function withProjectOption(summary, usage) {
|
|
|
1534
1532
|
}
|
|
1535
1533
|
function printGlobalHelp() {
|
|
1536
1534
|
printVoidHeader();
|
|
1537
|
-
|
|
1535
|
+
note([
|
|
1538
1536
|
globalCommandLine(["init"], "void init"),
|
|
1539
1537
|
...globalOptionLines(["init"]),
|
|
1540
1538
|
"",
|
|
@@ -1579,8 +1577,8 @@ function printGlobalHelp() {
|
|
|
1579
1577
|
helpLine("void help <command>", "Show command-specific help"),
|
|
1580
1578
|
helpLine("void <command> --help", "Show command-specific help")
|
|
1581
1579
|
].join("\n"), sectionTitle("Commands"));
|
|
1582
|
-
|
|
1583
|
-
|
|
1580
|
+
note([helpLine("VOID_TOKEN", "Auth token (or use `void auth login`)"), helpLine("VOID_PROJECT", "Deploy target project name override")].join("\n"), sectionTitle("Environment"));
|
|
1581
|
+
outro("https://void.cloud");
|
|
1584
1582
|
}
|
|
1585
1583
|
function printVoidHeader() {
|
|
1586
1584
|
const version = JSON.parse(readFileSync(join(getPackageDir(), "package.json"), "utf-8")).version;
|
|
@@ -1610,7 +1608,7 @@ function printHelpPage(path) {
|
|
|
1610
1608
|
appendHelpSection(lines, "Options", page.options);
|
|
1611
1609
|
appendHelpSection(lines, "Examples", page.examples);
|
|
1612
1610
|
if (page.commands) lines.push("", `Run \`void help ${path.join(" ")} <command>\` for command-specific help.`);
|
|
1613
|
-
|
|
1611
|
+
note(lines.join("\n"), sectionTitle(`void ${path.join(" ")}`));
|
|
1614
1612
|
}
|
|
1615
1613
|
function appendHelpSection(lines, title, entries) {
|
|
1616
1614
|
if (!entries || entries.length === 0) return;
|
|
@@ -1686,7 +1684,7 @@ function parsePrepareArgs(args) {
|
|
|
1686
1684
|
}
|
|
1687
1685
|
//#endregion
|
|
1688
1686
|
//#region src/cli/project-args.ts
|
|
1689
|
-
const LOG_LEVELS = new Set([
|
|
1687
|
+
const LOG_LEVELS = /* @__PURE__ */ new Set([
|
|
1690
1688
|
"error",
|
|
1691
1689
|
"warn",
|
|
1692
1690
|
"info",
|
|
@@ -1921,13 +1919,13 @@ async function runSubcommandGroup(command, subcommands, parse, run) {
|
|
|
1921
1919
|
const sub = args[1];
|
|
1922
1920
|
try {
|
|
1923
1921
|
if ((!sub || sub.startsWith("-")) && process.stdin.isTTY) {
|
|
1924
|
-
const { promptSubcommand } = await import("../subcommand-prompt-
|
|
1922
|
+
const { promptSubcommand } = await import("../subcommand-prompt-DtES-oP6.mjs");
|
|
1925
1923
|
const result = await promptSubcommand(command, subcommands);
|
|
1926
1924
|
if (!result) process.exit(0);
|
|
1927
1925
|
await run(root, parse(buildArgs(result, args.slice(1))));
|
|
1928
1926
|
} else await run(root, parse(args.slice(1)));
|
|
1929
1927
|
} catch (err) {
|
|
1930
|
-
|
|
1928
|
+
log.error(err instanceof Error ? err.message : String(err));
|
|
1931
1929
|
process.exit(1);
|
|
1932
1930
|
}
|
|
1933
1931
|
}
|
|
@@ -1938,7 +1936,7 @@ if (helpPath) if (helpPath.length === 0) printGlobalHelp();
|
|
|
1938
1936
|
else try {
|
|
1939
1937
|
printHelpPage(helpPath);
|
|
1940
1938
|
} catch (err) {
|
|
1941
|
-
|
|
1939
|
+
log.error(err instanceof Error ? err.message : String(err));
|
|
1942
1940
|
process.exit(1);
|
|
1943
1941
|
}
|
|
1944
1942
|
else if (command === "deploy") {
|
|
@@ -1947,10 +1945,10 @@ else if (command === "deploy") {
|
|
|
1947
1945
|
try {
|
|
1948
1946
|
deployArgs = parseDeployArgs(args.slice(1));
|
|
1949
1947
|
} catch (err) {
|
|
1950
|
-
|
|
1948
|
+
log.error(err instanceof Error ? err.message : String(err));
|
|
1951
1949
|
process.exit(1);
|
|
1952
1950
|
}
|
|
1953
|
-
import("../deploy-
|
|
1951
|
+
import("../deploy-C4PbkFyE.mjs").then((n) => n.t).then(({ runDeploy }) => {
|
|
1954
1952
|
runDeploy(root, {
|
|
1955
1953
|
projectSlug: deployArgs.projectSlug,
|
|
1956
1954
|
dir: deployArgs.dir,
|
|
@@ -1958,57 +1956,57 @@ else if (command === "deploy") {
|
|
|
1958
1956
|
skipBuild: deployArgs.skipBuild,
|
|
1959
1957
|
debug: deployArgs.debug
|
|
1960
1958
|
}).catch((err) => {
|
|
1961
|
-
|
|
1959
|
+
log.error(err.message ?? err);
|
|
1962
1960
|
process.exit(1);
|
|
1963
1961
|
});
|
|
1964
1962
|
});
|
|
1965
|
-
} else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-cmd-
|
|
1966
|
-
else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-
|
|
1967
|
-
else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-
|
|
1968
|
-
else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-
|
|
1969
|
-
else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-
|
|
1970
|
-
else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-
|
|
1971
|
-
else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-
|
|
1972
|
-
else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-
|
|
1973
|
-
else if (command === "build") runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-
|
|
1963
|
+
} else if (command === "auth") runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-cmd-DlgNwByu.mjs").then(({ runAuthCommand }) => runAuthCommand(root, parsed)));
|
|
1964
|
+
else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-DnU7u9QF.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
|
|
1965
|
+
else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-u7FRvg8d.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
|
|
1966
|
+
else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-_luIsM_B.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
|
|
1967
|
+
else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-DjKE2-A-.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
|
|
1968
|
+
else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-CO5XAS9t.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
|
|
1969
|
+
else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-Cf79J4aw.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
|
|
1970
|
+
else if (command === "github") runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-DnqxyOsb.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed)));
|
|
1971
|
+
else if (command === "build") runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-Br8qL0rA.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)));
|
|
1974
1972
|
else if (command === "prepare") {
|
|
1975
1973
|
const root = process.cwd();
|
|
1976
1974
|
let prepareArgs;
|
|
1977
1975
|
try {
|
|
1978
1976
|
prepareArgs = parsePrepareArgs(args.slice(1));
|
|
1979
1977
|
} catch (err) {
|
|
1980
|
-
|
|
1978
|
+
log.error(err instanceof Error ? err.message : String(err));
|
|
1981
1979
|
process.exit(1);
|
|
1982
1980
|
}
|
|
1983
|
-
import("../prepare-
|
|
1981
|
+
import("../prepare-C_cVurhP.mjs").then(({ runPrepareCommand }) => {
|
|
1984
1982
|
runPrepareCommand(root, prepareArgs).catch((err) => {
|
|
1985
|
-
|
|
1983
|
+
log.error(err.message ?? err);
|
|
1986
1984
|
process.exit(1);
|
|
1987
1985
|
});
|
|
1988
1986
|
});
|
|
1989
1987
|
} else if (command === "init") {
|
|
1990
1988
|
const root = process.cwd();
|
|
1991
|
-
import("../init-
|
|
1989
|
+
import("../init-KirOzVDs.mjs").then(({ runInitCommand, parseInitArgs }) => {
|
|
1992
1990
|
let initArgs;
|
|
1993
1991
|
try {
|
|
1994
1992
|
initArgs = parseInitArgs(args.slice(1));
|
|
1995
1993
|
} catch (err) {
|
|
1996
|
-
|
|
1994
|
+
log.error(err instanceof Error ? err.message : String(err));
|
|
1997
1995
|
process.exit(1);
|
|
1998
1996
|
}
|
|
1999
1997
|
runInitCommand(root, initArgs).catch((err) => {
|
|
2000
|
-
|
|
1998
|
+
log.error(err.message ?? err);
|
|
2001
1999
|
process.exit(1);
|
|
2002
2000
|
});
|
|
2003
2001
|
});
|
|
2004
|
-
} else if (command === "mcp") import("../mcp-
|
|
2002
|
+
} else if (command === "mcp") import("../mcp-D7yc0dXY.mjs").then(({ runMcp }) => {
|
|
2005
2003
|
runMcp();
|
|
2006
2004
|
});
|
|
2007
2005
|
else if (command === "-v" || command === "--version") {
|
|
2008
2006
|
const version = JSON.parse(readFileSync(join(getPackageDir(), "package.json"), "utf-8")).version;
|
|
2009
2007
|
console.log(version);
|
|
2010
2008
|
} else if (command && command !== "help" && command !== "--help" && command !== "-h") {
|
|
2011
|
-
|
|
2009
|
+
log.error(`cli: Unknown command '${command}'. Run \`void --help\` for usage.`);
|
|
2012
2010
|
process.exit(1);
|
|
2013
2011
|
} else if (!command && process.stdin.isTTY) {
|
|
2014
2012
|
const topLevelCommands = [
|
|
@@ -2080,38 +2078,38 @@ else if (command === "-v" || command === "--version") {
|
|
|
2080
2078
|
];
|
|
2081
2079
|
(async () => {
|
|
2082
2080
|
printVoidHeader();
|
|
2083
|
-
const { promptSubcommand } = await import("../subcommand-prompt-
|
|
2081
|
+
const { promptSubcommand } = await import("../subcommand-prompt-DtES-oP6.mjs");
|
|
2084
2082
|
const result = await promptSubcommand("", topLevelCommands);
|
|
2085
2083
|
if (!result) process.exit(0);
|
|
2086
2084
|
const cmd = result.subcommand;
|
|
2087
2085
|
const root = process.cwd();
|
|
2088
2086
|
switch (cmd) {
|
|
2089
2087
|
case "init": {
|
|
2090
|
-
const { runInitCommand, parseInitArgs } = await import("../init-
|
|
2088
|
+
const { runInitCommand, parseInitArgs } = await import("../init-KirOzVDs.mjs");
|
|
2091
2089
|
await runInitCommand(root, parseInitArgs([]));
|
|
2092
2090
|
return;
|
|
2093
2091
|
}
|
|
2094
2092
|
case "deploy": {
|
|
2095
|
-
const { runDeploy } = await import("../deploy-
|
|
2093
|
+
const { runDeploy } = await import("../deploy-C4PbkFyE.mjs").then((n) => n.t);
|
|
2096
2094
|
await runDeploy(root);
|
|
2097
2095
|
return;
|
|
2098
2096
|
}
|
|
2099
2097
|
case "mcp": {
|
|
2100
|
-
const { runMcp } = await import("../mcp-
|
|
2098
|
+
const { runMcp } = await import("../mcp-D7yc0dXY.mjs");
|
|
2101
2099
|
runMcp();
|
|
2102
2100
|
return;
|
|
2103
2101
|
}
|
|
2104
|
-
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-cmd-
|
|
2105
|
-
case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-
|
|
2106
|
-
case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-
|
|
2107
|
-
case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-
|
|
2108
|
-
case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-
|
|
2109
|
-
case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-
|
|
2110
|
-
case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-
|
|
2111
|
-
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-
|
|
2112
|
-
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-
|
|
2102
|
+
case "auth": return runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (r, p) => import("../auth-cmd-DlgNwByu.mjs").then(({ runAuthCommand }) => runAuthCommand(r, p)));
|
|
2103
|
+
case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-DnU7u9QF.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
|
|
2104
|
+
case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-u7FRvg8d.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
|
|
2105
|
+
case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-_luIsM_B.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
|
|
2106
|
+
case "github": return runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (r, p) => import("../github-cmd-DnqxyOsb.mjs").then(({ runGithubCommand }) => runGithubCommand(r, p)));
|
|
2107
|
+
case "build": return runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (r, p) => import("../build-cmd-Br8qL0rA.mjs").then(({ runBuildCommand }) => runBuildCommand(r, p)));
|
|
2108
|
+
case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-DjKE2-A-.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
|
|
2109
|
+
case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-CO5XAS9t.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
|
|
2110
|
+
case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-Cf79J4aw.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
|
|
2113
2111
|
case "prepare": {
|
|
2114
|
-
const { runPrepareCommand } = await import("../prepare-
|
|
2112
|
+
const { runPrepareCommand } = await import("../prepare-C_cVurhP.mjs");
|
|
2115
2113
|
await runPrepareCommand(root, parsePrepareArgs([]));
|
|
2116
2114
|
return;
|
|
2117
2115
|
}
|
|
@@ -2120,7 +2118,7 @@ else if (command === "-v" || command === "--version") {
|
|
|
2120
2118
|
return;
|
|
2121
2119
|
}
|
|
2122
2120
|
})().catch((err) => {
|
|
2123
|
-
|
|
2121
|
+
log.error(err instanceof Error ? err.message : String(err));
|
|
2124
2122
|
process.exit(1);
|
|
2125
2123
|
});
|
|
2126
2124
|
} else printGlobalHelp();
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { n as __exportAll } from "./
|
|
2
|
-
import { a as join } from "./pathe.M-eThtNZ-
|
|
3
|
-
import {
|
|
4
|
-
import { t as cfAccessHeaders } from "./cf-access-
|
|
5
|
-
import {
|
|
6
|
-
import { r as getPackageDir } from "./agents-MhSzNMiC.mjs";
|
|
7
|
-
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-DJK8HYOj.mjs";
|
|
2
|
+
import { a as join, n as dirname } from "./pathe.M-eThtNZ-CQzLbt4c.mjs";
|
|
3
|
+
import { r as getPackageDir, u as import_picocolors } from "./agents-Bmr5tFFb.mjs";
|
|
4
|
+
import { t as cfAccessHeaders } from "./cf-access-Bqw81xAf.mjs";
|
|
5
|
+
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
8
6
|
import { createHash, randomBytes } from "node:crypto";
|
|
9
7
|
import { homedir } from "node:os";
|
|
10
8
|
import { Entry } from "@napi-rs/keyring";
|
|
@@ -81,6 +79,74 @@ function isGatedHost(apiUrl) {
|
|
|
81
79
|
}
|
|
82
80
|
}
|
|
83
81
|
//#endregion
|
|
82
|
+
//#region src/cli/project.ts
|
|
83
|
+
var project_exports = /* @__PURE__ */ __exportAll({
|
|
84
|
+
isVoidInternalStaging: () => isVoidInternalStaging,
|
|
85
|
+
readProjectConfig: () => readProjectConfig,
|
|
86
|
+
removeProjectConfig: () => removeProjectConfig,
|
|
87
|
+
writeProjectConfig: () => writeProjectConfig
|
|
88
|
+
});
|
|
89
|
+
const PROJECT_FILE = ".void/project.json";
|
|
90
|
+
function readProjectConfigFile(root) {
|
|
91
|
+
const filePath = join(root, PROJECT_FILE);
|
|
92
|
+
try {
|
|
93
|
+
const raw = readFileSync(filePath, "utf-8");
|
|
94
|
+
const config = JSON.parse(raw);
|
|
95
|
+
if (typeof config !== "object" || config === null || Array.isArray(config)) return null;
|
|
96
|
+
return config;
|
|
97
|
+
} catch {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Read the project config from the project root.
|
|
103
|
+
* Returns null if no project.json exists.
|
|
104
|
+
* A file containing only internal metadata is not treated as a linked project.
|
|
105
|
+
*/
|
|
106
|
+
function readProjectConfig(root) {
|
|
107
|
+
const config = readProjectConfigFile(root);
|
|
108
|
+
if (!config || typeof config.projectId !== "string" || typeof config.slug !== "string") return null;
|
|
109
|
+
const result = {
|
|
110
|
+
projectId: config.projectId,
|
|
111
|
+
slug: config.slug
|
|
112
|
+
};
|
|
113
|
+
if (config.voidInternalStaging === true) result.voidInternalStaging = true;
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Internal-only platform developers' staging switch.
|
|
118
|
+
* This intentionally lives with the project link state, not public void.json.
|
|
119
|
+
*/
|
|
120
|
+
function isVoidInternalStaging(root) {
|
|
121
|
+
return readProjectConfigFile(root)?.voidInternalStaging === true;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Write the project config to the project root.
|
|
125
|
+
*/
|
|
126
|
+
function writeProjectConfig(root, config) {
|
|
127
|
+
const filePath = join(root, PROJECT_FILE);
|
|
128
|
+
const existing = readProjectConfigFile(root);
|
|
129
|
+
const next = {
|
|
130
|
+
projectId: config.projectId,
|
|
131
|
+
slug: config.slug
|
|
132
|
+
};
|
|
133
|
+
if (config.voidInternalStaging === true || existing?.voidInternalStaging === true) next.voidInternalStaging = true;
|
|
134
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
135
|
+
writeFileSync(filePath, JSON.stringify(next, null, 2) + "\n");
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Remove the project config file. Returns true if removed, false if it didn't exist.
|
|
139
|
+
*/
|
|
140
|
+
function removeProjectConfig(root) {
|
|
141
|
+
const filePath = join(root, PROJECT_FILE);
|
|
142
|
+
try {
|
|
143
|
+
rmSync(filePath);
|
|
144
|
+
return true;
|
|
145
|
+
} catch {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
84
150
|
//#region src/cli/auth.ts
|
|
85
151
|
const CONFIG_DIR = join(homedir(), ".void");
|
|
86
152
|
const CONFIG_PATH = join(CONFIG_DIR, "config.json");
|
|
@@ -961,4 +1027,4 @@ var PlatformClient = class {
|
|
|
961
1027
|
}
|
|
962
1028
|
};
|
|
963
1029
|
//#endregion
|
|
964
|
-
export { runLogin as _, isExpiredTokenError as a, createCodeChallenge as c, getSiteDomain as d, getToken as f, removeToken as g, openBrowser as h, isCliOutdatedError as i, createCodeVerifier as l, isStagingMode as m, PlatformClient as n, parsePlatformErrorBody as o, getTokenSource as p, client_exports as r, awaitBrowserCallback as s, PlatformApiError as t, getApiUrl as u, saveToken as v,
|
|
1030
|
+
export { ensureCloudflaredToken as C, writeProjectConfig as S, runLogin as _, isExpiredTokenError as a, readProjectConfig as b, createCodeChallenge as c, getSiteDomain as d, getToken as f, removeToken as g, openBrowser as h, isCliOutdatedError as i, createCodeVerifier as l, isStagingMode as m, PlatformClient as n, parsePlatformErrorBody as o, getTokenSource as p, client_exports as r, awaitBrowserCallback as s, PlatformApiError as t, getApiUrl as u, saveToken as v, removeProjectConfig as x, project_exports as y };
|