void 0.23.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS_TEMPLATE.md +1 -1
- package/README.md +19 -106
- package/dist/{account-cmd-C84Ee8cO.mjs → account-cmd-DcR1ywt8.mjs} +5 -5
- package/dist/{auth-CSkdO2Bb.mjs → auth-7wuZ5ob8.mjs} +22 -49
- package/dist/auth-CdgZ9uag.mjs +2 -0
- package/dist/{auth-link-CioEg6uY.mjs → auth-link-Z6E5DYvM.mjs} +5 -6
- package/dist/{auth-router-BsR981d4.mjs → auth-router-BdM4avI8.mjs} +7 -7
- package/dist/{build-cmd-LzvNJORH.mjs → build-cmd-CEE7D-hM.mjs} +7 -8
- package/dist/{cache-C4MvnrMH.mjs → cache-TcZnBLtH.mjs} +6 -7
- package/dist/{cancel-deploy-abUxpP2n.mjs → cancel-deploy-CYoZmcmR.mjs} +4 -6
- package/dist/{cf-access-P0iZnu0q.mjs → cf-access-AHKBzmuu.mjs} +4 -48
- package/dist/{cf-access-DRsQRe6k.mjs → cf-access-TWNzXltp.mjs} +3 -11
- package/dist/cf-build-output-ChY6-XWP.mjs +2 -0
- package/dist/cli/cli.mjs +49 -46
- package/dist/cli/cloudflare-operation-process.mjs +16 -7
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-B4Me-9HE.mjs +2 -0
- package/dist/{client-RV8NVeB8.mjs → client-RsPo8wsP.mjs} +129 -33
- package/dist/{cloudflare-cmd-BcrVyTmJ.mjs → cloudflare-cmd-bhwCxAN6.mjs} +2 -2
- package/dist/{cloudflare-connect-B8uPZ4nx.mjs → cloudflare-connect-CuhRgk3k.mjs} +2 -2
- package/dist/{cloudflare-operations-AiWashgg.mjs → cloudflare-operations-BhbK6yTq.mjs} +1 -1
- package/dist/{cloudflare-operations-fxHb-byx.mjs → cloudflare-operations-CjaV4lZi.mjs} +2 -2
- package/dist/{connect-Bd4kJd9U.mjs → connect-DCvUmPXY.mjs} +13 -10
- package/dist/{create-project-Boczwj5r.mjs → create-project-C734I-Mu.mjs} +1 -1
- package/dist/{create-project-bMf6ffLZ.mjs → create-project-eAPgYq35.mjs} +13 -13
- package/dist/{db-8uG64XLl.mjs → db-C07GEdKF.mjs} +27 -30
- package/dist/{delete-NvbiyeJf.mjs → delete-pKMVsrpJ.mjs} +5 -6
- package/dist/deploy-BDu1vhSH.mjs +2 -0
- package/dist/{deploy-DzAIwqNU.mjs → deploy-DfsAe-T0.mjs} +9567 -9215
- package/dist/{dev-inbox-P0u4tM8Y.mjs → dev-inbox-D64ZKUod.mjs} +5 -6
- package/dist/{domain-y5Tvydvo.mjs → domain-D3uA9ize.mjs} +8 -8
- package/dist/{email-B3umsW75.mjs → email-z3o2cwjH.mjs} +8 -8
- package/dist/{env-BS6qYHDb.mjs → env-3Q8-_2IH.mjs} +7 -9
- package/dist/{env-types-C2_bIk_b.mjs → env-types-D5kds_OZ.mjs} +1 -1
- package/dist/{env-validation-DbTg7-ar.mjs → env-validation-cZBvGWaP.mjs} +1 -1
- package/dist/{env-validation-BPn7vk-V.mjs → env-validation-vBSQ8gw5.mjs} +3 -3
- package/dist/gen-ById9r2j.mjs +2 -0
- package/dist/{gen-B580--vC.mjs → gen-NjwoG9FK.mjs} +2 -4
- package/dist/{github-cmd-v45BdfKX.mjs → github-cmd-DquUq-b1.mjs} +15 -24
- package/dist/{headers-DWi2IXWx.mjs → headers-2rKda9Y6.mjs} +1 -1
- package/dist/help-DPGBwomV.mjs +2 -0
- package/dist/{help-daGKjXGk.mjs → help-DRZXC4fj.mjs} +8 -4
- package/dist/{inbound-aVHEUhKo.mjs → inbound-fRkqcXaC.mjs} +1 -1
- package/dist/index.d.mts +18 -14
- package/dist/index.mjs +2176 -2110
- package/dist/{info-B97bTX9N.mjs → info-BmA3_IFZ.mjs} +1 -3
- package/dist/{init-Bvy7zrBo.mjs → init-DT7yuuyl.mjs} +28 -27
- package/dist/{link-CDqqCjFl.mjs → link-CXOlqh2F.mjs} +6 -7
- package/dist/{list-CZj0dzKY.mjs → list-eEWVJEPn.mjs} +8 -9
- package/dist/{local-d1-2CMnpuW_.mjs → local-d1-Df4XpwhW.mjs} +1 -1
- package/dist/log-vqY3pqwI.mjs +29 -0
- package/dist/login-C98-sw79.mjs +2 -0
- package/dist/{login-UZKFM_u7.mjs → login-pWQHYVu2.mjs} +12 -10
- package/dist/{logs-CUZ6t9t3.mjs → logs-DnxVX7TR.mjs} +11 -13
- package/dist/migrate-CEu2X5DB.mjs +2 -0
- package/dist/{migrate-DHul7PRV.mjs → migrate-CV1on-yJ.mjs} +2 -4
- package/dist/{operator-args-CLgKGlwU.mjs → operator-args-CAVcmwUt.mjs} +12 -5
- package/dist/{operator-auth-8KnOVXVd.mjs → operator-auth-CkmTE3rt.mjs} +2 -2
- package/dist/{operator-client-DUwumHpQ.mjs → operator-client-LmwjxT6q.mjs} +3 -3
- package/dist/{operator-cmd-DBA6dl0m.mjs → operator-cmd-d-IEKgNk.mjs} +6 -6
- package/dist/{output-Dm_A4Tbv.mjs → output-BBsUwdyT.mjs} +22 -14
- package/dist/pages/client.d.mts +3 -0
- package/dist/pages/client.mjs +120 -29
- package/dist/pages/index.mjs +1 -1
- package/dist/{platform-args-BJdRtlLq.mjs → platform-args-Bzf8JPc2.mjs} +11 -3
- package/dist/platform-args-Cq6EjQro.mjs +2 -0
- package/dist/{platform-auth-config-B56E9YP1.mjs → platform-auth-config-0V0lA3pF.mjs} +7 -7
- package/dist/{platform-auth-protection-BDWO_aER.mjs → platform-auth-protection-DFeJ-JkK.mjs} +9 -9
- package/dist/{platform-auth-recovery-1gg4CSRe.mjs → platform-auth-recovery-ICy4muq6.mjs} +7 -7
- package/dist/{platform-cmd-Bt-1w6pY.mjs → platform-cmd-BPySFOew.mjs} +1 -1
- package/dist/{platform-cmd-DMcQStSc.mjs → platform-cmd-D7vSWMvV.mjs} +38 -28
- package/dist/platform-discovery-DDDUvnqp.mjs +27 -0
- package/dist/{platform-domain-BNkcz0OB.mjs → platform-domain-CUdY064e.mjs} +5 -5
- package/dist/{platform-lifecycle-BE6C_jxh.mjs → platform-lifecycle-BaUdTRPU.mjs} +1 -1
- package/dist/{platform-lifecycle-9OyBALhH.mjs → platform-lifecycle-Dm09JNkn.mjs} +4404 -3297
- package/dist/{platform-management-CjwLVQwN.mjs → platform-management-BSEc_ZeG.mjs} +48 -11
- package/dist/platform-management-Bp6aoH2C.mjs +2 -0
- package/dist/{platform-plans-config-BNGKGr4P.mjs → platform-plans-config-B0pOVQyW.mjs} +3 -3
- package/dist/{platform-recovery-D6KSpuFm.mjs → platform-recovery-WOZ95Uze.mjs} +4 -4
- package/dist/{platform-registry-QBa4DK32.mjs → platform-registry-KfNEF84O.mjs} +3 -3
- package/dist/{prepare-B5Mkic5u.mjs → prepare-39EvOhI6.mjs} +2 -4
- package/dist/prepare-CnjcTV2s.mjs +2 -0
- package/dist/{prepare-DOsL0CC9.mjs → prepare-DnaKBi--.mjs} +1 -1
- package/dist/{project-C0Fqu05O.mjs → project-BkbfDs0V.mjs} +15 -82
- package/dist/project-IOjBU8R6.mjs +2 -0
- package/dist/{project-cmd-CNzrqvBv.mjs → project-cmd-Bs5A392E.mjs} +21 -22
- package/dist/{project-team-DQOWPfQT.mjs → project-team-ohAWWaew.mjs} +8 -9
- package/dist/{project-token-CTDYU0Cc.mjs → project-token-CP01Jna6.mjs} +6 -9
- package/dist/{project-zero-trust-BNAkW-_0.mjs → project-zero-trust-BzkVgx35.mjs} +5 -6
- package/dist/prompts-6OSVA7DJ.mjs +2087 -0
- package/dist/prompts-ZAuJlyCj.mjs +2 -0
- package/dist/{provision-C4ORE7G7.mjs → provision-BEv0k-qz.mjs} +1 -1
- package/dist/{provision-CJFgTZY8.mjs → provision-Btj1jppf.mjs} +5 -7
- package/dist/{requests-MhxYnau8.mjs → requests-B3PBuGlX.mjs} +5 -6
- package/dist/{rollback-CJ6iSDoU.mjs → rollback-DDub9GsO.mjs} +9 -10
- package/dist/runtime/ai.mjs +3 -5
- package/dist/runtime/email/testing.mjs +2 -2
- package/dist/runtime/email.mjs +36 -18
- package/dist/runtime/remote/index.mjs +2 -2
- package/dist/runtime/routing.mjs +1 -1
- package/dist/{secret-Dli5fP0B.mjs → secret-3c72lY1U.mjs} +15 -16
- package/dist/{skills-D1II1Juz.mjs → skills-BPQUGClu.mjs} +1 -1
- package/dist/{subcommand-prompt-CY1C4fvl.mjs → subcommand-prompt-Dhom39bd.mjs} +40 -32
- package/dist/sveltekit.d.mts +1 -1
- package/dist/sveltekit.mjs +4 -9
- package/dist/{wrangler-7K-bW_DL.mjs → wrangler-DhUerFkW.mjs} +10 -15
- package/package.json +22 -23
- package/sandbox.Dockerfile +1 -1
- package/skills/void/SKILL.md +6 -1
- package/skills/void/docs/guide/ai.md +24 -86
- package/skills/void/docs/guide/auth.md +0 -2
- package/skills/void/docs/guide/database/d1.md +7 -7
- package/skills/void/docs/guide/deployment.md +58 -102
- package/skills/void/docs/guide/edge/headers.md +1 -1
- package/skills/void/docs/guide/email/domains.md +5 -1
- package/skills/void/docs/guide/email/sending.md +1 -1
- package/skills/void/docs/guide/env-vars.md +1 -5
- package/skills/void/docs/guide/index.md +19 -18
- package/skills/void/docs/guide/kv.md +0 -2
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +49 -47
- package/skills/void/docs/guide/pages-routing/overview.md +2 -2
- package/skills/void/docs/guide/platform/administration/email.md +0 -2
- package/skills/void/docs/guide/platform/administration/operations.md +11 -22
- package/skills/void/docs/guide/platform/administration/plans.md +1 -5
- package/skills/void/docs/guide/platform/administration/zero-trust.md +24 -9
- package/skills/void/docs/guide/platform/development/schema-ci.md +7 -1
- package/skills/void/docs/guide/platform/installation/ci.md +1 -1
- package/skills/void/docs/guide/platform/installation/credentials.md +10 -3
- package/skills/void/docs/guide/platform/installation/domains.md +8 -3
- package/skills/void/docs/guide/platform/installation/first-deployment.md +2 -2
- package/skills/void/docs/guide/platform/installation/maintenance.md +37 -5
- package/skills/void/docs/guide/platform/installation/prerequisites.md +87 -14
- package/skills/void/docs/guide/platform/installation/setup.md +80 -10
- package/skills/void/docs/guide/quickstart.md +37 -80
- package/skills/void/docs/guide/remote-dev.md +1 -1
- package/skills/void/docs/guide/sandboxes.md +36 -46
- package/skills/void/docs/guide/self-hosted-platform.md +20 -0
- package/skills/void/docs/guide/websockets.md +0 -2
- package/skills/void/docs/integrations/frameworks/overview.md +2 -2
- package/skills/void/docs/integrations/frameworks/sveltekit.md +40 -25
- package/skills/void/docs/integrations/nodejs-bun-deno.md +7 -2
- package/skills/void/docs/reference/api/resources.md +27 -0
- package/skills/void/docs/reference/api.md +1 -1
- package/skills/void/docs/reference/cli/auth.md +4 -3
- package/skills/void/docs/reference/cli/database.md +1 -1
- package/skills/void/docs/reference/cli/deploy.md +21 -1
- package/skills/void/docs/reference/cli/platform-installation.md +42 -27
- package/skills/void/docs/reference/cli/platform-operations.md +4 -8
- package/skills/void/docs/reference/cli/platform-zero-trust.md +14 -0
- package/skills/void/docs/reference/cli/platform.md +5 -0
- package/skills/void/docs/reference/config.md +1 -1
- package/skills/void/docs/reference/resource-inference.md +11 -8
- package/dist/auth-CCjt0hcq.mjs +0 -2
- package/dist/cf-build-output-_0HNWysu.mjs +0 -2
- package/dist/client-Cu7jWiF1.mjs +0 -2
- package/dist/deploy-bjXdFCtn.mjs +0 -2
- package/dist/dist-BuDuKZJv.mjs +0 -2
- package/dist/dist-CTBk70IR.mjs +0 -1310
- package/dist/gen-BVaUUumi.mjs +0 -2
- package/dist/help-DofyZuY7.mjs +0 -2
- package/dist/log-ChfPKsVd.mjs +0 -26
- package/dist/login-DYt_An22.mjs +0 -2
- package/dist/migrate-8_2u55MD.mjs +0 -2
- package/dist/platform-args-D3RXyR6h.mjs +0 -2
- package/dist/platform-management-CnyTdcWX.mjs +0 -2
- package/dist/prepare-cgvDMtSb.mjs +0 -2
- package/dist/project-BuUwfj6f.mjs +0 -2
- package/skills/void/docs/guide/env-migration.md +0 -109
- package/dist/{cf-build-output-BPqOT964.mjs → cf-build-output-U8o1Gl6X.mjs} +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as promptForLoginToken } from "./login-
|
|
7
|
-
import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-
|
|
8
|
-
import { t as connectCloudflare } from "./cloudflare-connect-
|
|
1
|
+
import { o as listPlatformConnections, s as normalizePlatformApiUrl } from "./platform-registry-KfNEF84O.mjs";
|
|
2
|
+
import { c as writePlatformSelection, n as readDeploymentPlatform, s as writeDeploymentPlatform } from "./project-BkbfDs0V.mjs";
|
|
3
|
+
import { d as readPlatformToken } from "./auth-7wuZ5ob8.mjs";
|
|
4
|
+
import { K as select, L as log, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
5
|
+
import { a as isExpiredTokenError, r as PlatformClient } from "./client-RsPo8wsP.mjs";
|
|
6
|
+
import { t as promptForLoginToken } from "./login-pWQHYVu2.mjs";
|
|
7
|
+
import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-D7vSWMvV.mjs";
|
|
8
|
+
import { t as connectCloudflare } from "./cloudflare-connect-CuhRgk3k.mjs";
|
|
9
9
|
//#region src/cli/connect.ts
|
|
10
10
|
async function selectVoidPlatform(interactive) {
|
|
11
11
|
if (!interactive) throw new Error("connect: Supply a Void platform URL in non-interactive mode.");
|
|
@@ -31,7 +31,10 @@ async function authenticateConnection(root, discovery, interactive) {
|
|
|
31
31
|
const matchingEnv = Boolean(envToken && envUrl && normalizePlatformApiUrl(envUrl) === discovery.apiUrl);
|
|
32
32
|
const token = matchingEnv ? envToken : readPlatformToken(discovery.apiUrl);
|
|
33
33
|
if (token) try {
|
|
34
|
-
await new PlatformClient(token, {
|
|
34
|
+
await new PlatformClient(token, {
|
|
35
|
+
apiUrl: discovery.apiUrl,
|
|
36
|
+
checkPlatformVersion: false
|
|
37
|
+
}).whoami();
|
|
35
38
|
log.success(`Authenticated with ${discovery.displayName}.`);
|
|
36
39
|
return;
|
|
37
40
|
} catch (error) {
|
|
@@ -71,7 +74,7 @@ async function runConnectCommand(root, args, interactive = Boolean(process.stdin
|
|
|
71
74
|
if (!args.noLogin) await authenticateConnection(root, discovery, interactive);
|
|
72
75
|
saveDiscoveredPlatform(discovery);
|
|
73
76
|
const envUrl = process.env.VOID_API_URL;
|
|
74
|
-
const selected = Boolean(envUrl && normalizePlatformApiUrl(envUrl) !== discovery.apiUrl
|
|
77
|
+
const selected = Boolean(envUrl && normalizePlatformApiUrl(envUrl) !== discovery.apiUrl) ? false : writePlatformSelection(root, discovery);
|
|
75
78
|
log.success(`Connected to ${discovery.displayName} at ${discovery.apiUrl}.`);
|
|
76
79
|
if (!selected) log.info("Saved the connection. The current project link or environment still selects its existing destination.");
|
|
77
80
|
if (args.noLogin) log.info("Connection saved without login. Run `void account login` in a project using this platform when ready.");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createProjectWithSlugRetry } from "./create-project-
|
|
1
|
+
import { t as createProjectWithSlugRetry } from "./create-project-eAPgYq35.mjs";
|
|
2
2
|
export { createProjectWithSlugRetry };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { c as import_picocolors, l as sanitizeTerminalText } from "./output-
|
|
1
|
+
import { l as writeProjectConfig, t as attachSelectedPlatform } from "./project-BkbfDs0V.mjs";
|
|
2
|
+
import { s as getSiteDomain } from "./auth-7wuZ5ob8.mjs";
|
|
3
|
+
import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
+
import { n as PlatformApiError } from "./client-RsPo8wsP.mjs";
|
|
5
|
+
import { c as import_picocolors, l as sanitizeTerminalText } from "./output-BBsUwdyT.mjs";
|
|
6
6
|
import { t as validateProjectSlug } from "./project-slug-23TpquG4.mjs";
|
|
7
7
|
import { n as inferDefaultSlug } from "./resolve-project-BG5ORGID.mjs";
|
|
8
8
|
//#region src/cli/prompt.ts
|
|
@@ -14,7 +14,7 @@ async function promptProjectSetupAction(message = "Set up a Void project:", opti
|
|
|
14
14
|
label: "Create a new project"
|
|
15
15
|
}, ...options.includeLink === false ? [] : [{
|
|
16
16
|
value: "link",
|
|
17
|
-
label: "Link an existing project"
|
|
17
|
+
label: options.link === false ? "Use an existing project" : "Link an existing project"
|
|
18
18
|
}]]
|
|
19
19
|
});
|
|
20
20
|
if (isCancel(result) || typeof result === "symbol") {
|
|
@@ -30,7 +30,7 @@ async function promptProjectSelection(projects, message = "Select a project:", r
|
|
|
30
30
|
}], ...projects.map((p) => ({
|
|
31
31
|
value: p.id,
|
|
32
32
|
label: `${p.slug} (${p.url ?? `${p.slug}.${getSiteDomain(root)}`})`,
|
|
33
|
-
|
|
33
|
+
hint: p.role === "reader" ? "reader (read-only)" : p.role
|
|
34
34
|
}))];
|
|
35
35
|
const result = await select({
|
|
36
36
|
message,
|
|
@@ -43,7 +43,7 @@ async function promptProjectSelection(projects, message = "Select a project:", r
|
|
|
43
43
|
if (result === "__create__") return { action: "create" };
|
|
44
44
|
const project = projects.find((p) => p.id === result);
|
|
45
45
|
if (options.confirmExisting) {
|
|
46
|
-
const confirmed = await confirm({ message: project.role === "reader" ? `Link to ${project.slug} with read-only access? Deploying requires collaborator access or higher.` : `Linking to an existing project. Running \`void deploy\` will overwrite the current deployment of
|
|
46
|
+
const confirmed = await confirm({ message: project.role === "reader" ? `Link to ${project.slug} with read-only access? Deploying requires collaborator access or higher.` : (options.link === false ? "This deployment will overwrite the current deployment of " : `Linking to an existing project. Running \`void deploy\` will overwrite the current deployment of `) + `${project.url ?? `${project.slug}.${getSiteDomain(root)}`}. Continue?` });
|
|
47
47
|
if (isCancel(confirmed) || !confirmed) {
|
|
48
48
|
cancel("Project link cancelled.");
|
|
49
49
|
process.exit(0);
|
|
@@ -57,9 +57,9 @@ async function promptProjectSelection(projects, message = "Select a project:", r
|
|
|
57
57
|
async function promptProjectSlug(defaultSlug) {
|
|
58
58
|
const result = await text({
|
|
59
59
|
message: "Choose a slug for your new Void project:",
|
|
60
|
-
placeholder:
|
|
61
|
-
|
|
62
|
-
validate: validateProjectSlug
|
|
60
|
+
placeholder: defaultSlug,
|
|
61
|
+
defaultValue: defaultSlug,
|
|
62
|
+
validate: (value) => validateProjectSlug(value || defaultSlug)
|
|
63
63
|
});
|
|
64
64
|
if (isCancel(result) || typeof result === "symbol") {
|
|
65
65
|
cancel("Deploy cancelled.");
|
|
@@ -102,14 +102,14 @@ async function createProjectWithSlugRetry(client, initialDefaultSlug, promptSlug
|
|
|
102
102
|
function reportProjectCreationWarnings(project) {
|
|
103
103
|
for (const warning of project.warnings ?? []) log.warn(sanitizeTerminalText(warning));
|
|
104
104
|
}
|
|
105
|
-
async function promptAndCreateProject(root, client) {
|
|
105
|
+
async function promptAndCreateProject(root, client, options = {}) {
|
|
106
106
|
const project = await createProjectWithSlugRetry(client, inferDefaultSlug(root), async (defaultSlug) => promptProjectSlug(defaultSlug));
|
|
107
107
|
if (!project) throw new Error("Project creation cancelled.");
|
|
108
108
|
const config = {
|
|
109
109
|
projectId: project.id,
|
|
110
110
|
slug: project.slug
|
|
111
111
|
};
|
|
112
|
-
writeProjectConfig(root, attachSelectedPlatform(root, config, client.apiUrl));
|
|
112
|
+
if (options.link !== false) writeProjectConfig(root, attachSelectedPlatform(root, config, client.apiUrl));
|
|
113
113
|
if (project.owner_email_destination) {
|
|
114
114
|
const { address } = project.owner_email_destination;
|
|
115
115
|
log.info(`Registering ${address} as a recipient for this project. Cloudflare emails it a verification link unless it is already verified — \`void email destinations\` shows the state.`);
|
|
@@ -3,17 +3,17 @@ import { r as detectFramework } from "./plugin-inference-CXWnn79A.mjs";
|
|
|
3
3
|
import { n as readProjectPaths } from "./project-paths-GgcMozYz.mjs";
|
|
4
4
|
import { h as resolveBindingNames, m as readConfig, u as getDatabaseDialect } from "./config-Br_JZD6u.mjs";
|
|
5
5
|
import { i as writeJournal, n as readJournal, r as stripSqlExt, t as collectMigrations } from "./collect-DiTn9yr6.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { i as
|
|
10
|
-
import {
|
|
6
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-BkbfDs0V.mjs";
|
|
7
|
+
import { t as resolveLocalD1Target } from "./local-d1-Df4XpwhW.mjs";
|
|
8
|
+
import { t as cfAccessHeaders } from "./cf-access-TWNzXltp.mjs";
|
|
9
|
+
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, r as ensurePlatformProxyAccess } from "./cf-access-AHKBzmuu.mjs";
|
|
10
|
+
import { c as getToken, o as getProxyUrl } from "./auth-7wuZ5ob8.mjs";
|
|
11
11
|
import { a as loadLocalEnv } from "./env-_v349JBd.mjs";
|
|
12
|
-
import {
|
|
12
|
+
import { A as confirm, H as outro, L as log, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
13
|
+
import { n as PlatformApiError, r as PlatformClient } from "./client-RsPo8wsP.mjs";
|
|
14
|
+
import { c as import_picocolors, i as dim, o as formatCount } from "./output-BBsUwdyT.mjs";
|
|
13
15
|
import { i as validateMigrations, r as listDrizzleArtifacts, t as assertJournalCoherence } from "./validate-ctOrgiS3.mjs";
|
|
14
|
-
import { n as
|
|
15
|
-
import { a as dim, c as import_picocolors, r as cliTitle } from "./output-Dm_A4Tbv.mjs";
|
|
16
|
-
import { n as formatTimestamp } from "./gen-B580--vC.mjs";
|
|
16
|
+
import { n as formatTimestamp } from "./gen-NjwoG9FK.mjs";
|
|
17
17
|
import { createRequire } from "node:module";
|
|
18
18
|
import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -197,10 +197,7 @@ function validatePendingMigrations(migrations, appliedNames) {
|
|
|
197
197
|
validateMigrations(pending);
|
|
198
198
|
}
|
|
199
199
|
async function runDbCommand(root, args) {
|
|
200
|
-
|
|
201
|
-
if (exportToStdout) process.stderr.write("\n");
|
|
202
|
-
else console.log();
|
|
203
|
-
intro(cliTitle("db"), exportToStdout ? { output: process.stderr } : void 0);
|
|
200
|
+
if (!(args.action === "export" && !args.output)) console.log();
|
|
204
201
|
const dialect = getDatabaseDialect(readConfig(root));
|
|
205
202
|
if (args.action === "push") await runPush(root, dialect);
|
|
206
203
|
else if (args.action === "generate") await runGenerate(root, dialect);
|
|
@@ -273,7 +270,7 @@ async function runConnect(root, dialect, args) {
|
|
|
273
270
|
if (result.dashboardUrl) log.info(`Dashboard: ${result.dashboardUrl}`);
|
|
274
271
|
}
|
|
275
272
|
if (!connectionString) {
|
|
276
|
-
const { text: promptText, isCancel: isCancelCheck } = await import("./
|
|
273
|
+
const { text: promptText, isCancel: isCancelCheck } = await import("./prompts-ZAuJlyCj.mjs");
|
|
277
274
|
const answer = await promptText({
|
|
278
275
|
message: `Enter your ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} connection string:`,
|
|
279
276
|
placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/database" : "postgresql://user:pass@host:5432/database"
|
|
@@ -318,7 +315,7 @@ async function runPush(root, dialect) {
|
|
|
318
315
|
outro("Done.");
|
|
319
316
|
}
|
|
320
317
|
async function runGenerate(root, dialect) {
|
|
321
|
-
const { prepareProject } = await import("./prepare-
|
|
318
|
+
const { prepareProject } = await import("./prepare-CnjcTV2s.mjs");
|
|
322
319
|
const { writeDrizzleConfig } = await import("./config-0acf1oys.mjs");
|
|
323
320
|
await prepareProject(root);
|
|
324
321
|
const authSchemaPath = join(root, ".void", "better-auth-schema.ts");
|
|
@@ -399,7 +396,7 @@ async function runStatus(root, dialect) {
|
|
|
399
396
|
applied_at: ""
|
|
400
397
|
}));
|
|
401
398
|
} else {
|
|
402
|
-
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
399
|
+
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-BhbK6yTq.mjs");
|
|
403
400
|
remoteApplied = (await readCloudflareD1Migrations(resolveCloudflareD1Context(root, resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB"))).map((name) => ({
|
|
404
401
|
name,
|
|
405
402
|
applied_at: ""
|
|
@@ -423,7 +420,7 @@ async function runStatus(root, dialect) {
|
|
|
423
420
|
}
|
|
424
421
|
log.info(lines.join("\n"));
|
|
425
422
|
const localPending = allMigrations.length - localSet.size;
|
|
426
|
-
const parts = [
|
|
423
|
+
const parts = [formatCount(allMigrations.length, "migration")];
|
|
427
424
|
if (localPending > 0) parts.push(`${localPending} pending locally`);
|
|
428
425
|
if (remoteSet !== null) {
|
|
429
426
|
const remotePending = allMigrations.length - remoteSet.size;
|
|
@@ -489,13 +486,13 @@ async function resetDatabase(root, dialect) {
|
|
|
489
486
|
}
|
|
490
487
|
async function runReset(root, dialect) {
|
|
491
488
|
const count = await resetDatabase(root, dialect);
|
|
492
|
-
log.success(`Database reset. Applied ${count
|
|
489
|
+
log.success(`Database reset. Applied ${formatCount(count, "migration")}.`);
|
|
493
490
|
if (dialect === "sqlite") log.info(dim("Restart your dev server if it's running."));
|
|
494
491
|
outro("Done.");
|
|
495
492
|
}
|
|
496
493
|
async function runSeed(root, file, dialect) {
|
|
497
494
|
const migrationCount = await resetDatabase(root, dialect);
|
|
498
|
-
log.step(`Reset database. Applied ${migrationCount
|
|
495
|
+
log.step(`Reset database. Applied ${formatCount(migrationCount, "migration")}.`);
|
|
499
496
|
const seed = resolveSeedTarget(root, file);
|
|
500
497
|
if (seed.kind === "sql") {
|
|
501
498
|
const sql = readFileSync(seed.path, "utf-8");
|
|
@@ -641,7 +638,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
641
638
|
process.exit(0);
|
|
642
639
|
}
|
|
643
640
|
if (dialect === "sqlite") {
|
|
644
|
-
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
641
|
+
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-BhbK6yTq.mjs");
|
|
645
642
|
const rows = await executeCloudflareD1Sql(resolveCloudflareD1Context(root, resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB"), sql);
|
|
646
643
|
if (rows.length > 0) printTable(rows);
|
|
647
644
|
else log.success("Executed successfully.");
|
|
@@ -832,7 +829,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
832
829
|
validateMigrations(pending);
|
|
833
830
|
const applied = await applyMigrations();
|
|
834
831
|
for (const migration of applied) log.step(migration);
|
|
835
|
-
log.success(`Applied ${applied.length
|
|
832
|
+
log.success(`Applied ${formatCount(applied.length, "migration")} to remote database.`);
|
|
836
833
|
outro("Done.");
|
|
837
834
|
return;
|
|
838
835
|
} catch (error) {
|
|
@@ -846,7 +843,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
846
843
|
outro("Done.");
|
|
847
844
|
return;
|
|
848
845
|
}
|
|
849
|
-
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
846
|
+
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-BhbK6yTq.mjs");
|
|
850
847
|
const binding = resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB";
|
|
851
848
|
const context = resolveCloudflareD1Context(root, binding);
|
|
852
849
|
const remoteBefore = new Set(await readCloudflareD1Migrations(context));
|
|
@@ -862,7 +859,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
862
859
|
log.error(getErrorMessage(error));
|
|
863
860
|
process.exit(1);
|
|
864
861
|
}
|
|
865
|
-
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-
|
|
862
|
+
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-BDu1vhSH.mjs");
|
|
866
863
|
const applySet = await checkWranglerMigrationApplySet(context.operation.configPath, parseRootWranglerConfig(context.operation.configPath), binding, context.migrationsDir, rawMigrations);
|
|
867
864
|
if (!applySet.ok) {
|
|
868
865
|
log.error(applySet.reason);
|
|
@@ -876,7 +873,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
876
873
|
process.exit(1);
|
|
877
874
|
}
|
|
878
875
|
for (const migration of pending) log.step(migration.name);
|
|
879
|
-
log.success(`Applied ${pending.length
|
|
876
|
+
log.success(`Applied ${formatCount(pending.length, "migration")} to remote database.`);
|
|
880
877
|
outro("Done.");
|
|
881
878
|
return;
|
|
882
879
|
}
|
|
@@ -924,7 +921,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
924
921
|
if (result.applied.length === 0) log.info("Remote database is up to date.");
|
|
925
922
|
else {
|
|
926
923
|
for (const name of result.applied) log.step(name);
|
|
927
|
-
log.success(`Applied ${result.applied.length
|
|
924
|
+
log.success(`Applied ${formatCount(result.applied.length, "migration")} to remote database.`);
|
|
928
925
|
}
|
|
929
926
|
for (const warning of result.warnings ?? []) log.warn(warning);
|
|
930
927
|
outro("Done.");
|
|
@@ -950,7 +947,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
950
947
|
if (applied.length === 0) log.info("All migrations are up to date.");
|
|
951
948
|
else {
|
|
952
949
|
for (const name of applied) log.step(name);
|
|
953
|
-
log.success(`Applied ${applied.length
|
|
950
|
+
log.success(`Applied ${formatCount(applied.length, "migration")}.`);
|
|
954
951
|
}
|
|
955
952
|
outro("Done.");
|
|
956
953
|
return;
|
|
@@ -975,7 +972,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
975
972
|
if (applied.length === 0) log.info("All migrations are up to date.");
|
|
976
973
|
else {
|
|
977
974
|
for (const name of applied) log.step(name);
|
|
978
|
-
log.success(`Applied ${applied.length
|
|
975
|
+
log.success(`Applied ${formatCount(applied.length, "migration")}.`);
|
|
979
976
|
}
|
|
980
977
|
outro("Done.");
|
|
981
978
|
return;
|
|
@@ -993,7 +990,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
993
990
|
if (applied.length === 0) log.info("All migrations are up to date.");
|
|
994
991
|
else {
|
|
995
992
|
for (const name of applied) log.step(name);
|
|
996
|
-
log.success(`Applied ${applied.length
|
|
993
|
+
log.success(`Applied ${formatCount(applied.length, "migration")}.`);
|
|
997
994
|
log.info(dim("Restart your dev server if it's running."));
|
|
998
995
|
}
|
|
999
996
|
outro("Done.");
|
|
@@ -1319,7 +1316,7 @@ async function runRenameMigrations(root, dialect) {
|
|
|
1319
1316
|
process.exit(1);
|
|
1320
1317
|
}
|
|
1321
1318
|
}
|
|
1322
|
-
log.success(`Renamed ${renames.length
|
|
1319
|
+
log.success(`Renamed ${formatCount(renames.length, "migration")} to timestamp format.`);
|
|
1323
1320
|
outro("Done.");
|
|
1324
1321
|
}
|
|
1325
1322
|
function formatMySqlExportValue(value) {
|
|
@@ -1524,7 +1521,7 @@ async function runSetUrl(root) {
|
|
|
1524
1521
|
log.error("No project linked. Run `void deploy` first or link a project.");
|
|
1525
1522
|
process.exit(1);
|
|
1526
1523
|
}
|
|
1527
|
-
const { text: promptText, isCancel: isCancelCheck } = await import("./
|
|
1524
|
+
const { text: promptText, isCancel: isCancelCheck } = await import("./prompts-ZAuJlyCj.mjs");
|
|
1528
1525
|
const connectionString = await promptText({
|
|
1529
1526
|
message: `Enter your ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} connection string:`,
|
|
1530
1527
|
placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/dbname" : "postgresql://user:pass@host:5432/dbname",
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
import { B as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { a as removeProjectConfig, r as readProjectConfig } from "./project-BkbfDs0V.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-7wuZ5ob8.mjs";
|
|
3
|
+
import { B as note, H as outro, L as log, O as cancel, X as text, tt as isCancel } from "./prompts-6OSVA7DJ.mjs";
|
|
4
|
+
import { r as PlatformClient } from "./client-RsPo8wsP.mjs";
|
|
5
|
+
import { r as createSpinner } from "./output-BBsUwdyT.mjs";
|
|
6
6
|
import { r as resolveProjectBySlug } from "./resolve-project-BG5ORGID.mjs";
|
|
7
7
|
//#region src/cli/delete.ts
|
|
8
8
|
async function runDeleteCommand(root, slug, options) {
|
|
9
9
|
console.log();
|
|
10
|
-
intro(cliTitle("delete"));
|
|
11
10
|
const token = getToken(root);
|
|
12
11
|
if (!token) {
|
|
13
12
|
log.error("Not logged in. Run `void account login` first.");
|