void 0.10.5 → 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-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/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 +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,72 +0,0 @@
|
|
|
1
|
-
import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
|
|
2
|
-
import { a as join, n as dirname } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
|
|
3
|
-
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
-
//#region src/cli/project.ts
|
|
5
|
-
var project_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
-
isVoidInternalStaging: () => isVoidInternalStaging,
|
|
7
|
-
readProjectConfig: () => readProjectConfig,
|
|
8
|
-
removeProjectConfig: () => removeProjectConfig,
|
|
9
|
-
writeProjectConfig: () => writeProjectConfig
|
|
10
|
-
});
|
|
11
|
-
const PROJECT_FILE = ".void/project.json";
|
|
12
|
-
function readProjectConfigFile(root) {
|
|
13
|
-
const filePath = join(root, PROJECT_FILE);
|
|
14
|
-
try {
|
|
15
|
-
const raw = readFileSync(filePath, "utf-8");
|
|
16
|
-
const config = JSON.parse(raw);
|
|
17
|
-
if (typeof config !== "object" || config === null || Array.isArray(config)) return null;
|
|
18
|
-
return config;
|
|
19
|
-
} catch {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Read the project config from the project root.
|
|
25
|
-
* Returns null if no project.json exists.
|
|
26
|
-
* A file containing only internal metadata is not treated as a linked project.
|
|
27
|
-
*/
|
|
28
|
-
function readProjectConfig(root) {
|
|
29
|
-
const config = readProjectConfigFile(root);
|
|
30
|
-
if (!config || typeof config.projectId !== "string" || typeof config.slug !== "string") return null;
|
|
31
|
-
const result = {
|
|
32
|
-
projectId: config.projectId,
|
|
33
|
-
slug: config.slug
|
|
34
|
-
};
|
|
35
|
-
if (config.voidInternalStaging === true) result.voidInternalStaging = true;
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Internal-only platform developers' staging switch.
|
|
40
|
-
* This intentionally lives with the project link state, not public void.json.
|
|
41
|
-
*/
|
|
42
|
-
function isVoidInternalStaging(root) {
|
|
43
|
-
return readProjectConfigFile(root)?.voidInternalStaging === true;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Write the project config to the project root.
|
|
47
|
-
*/
|
|
48
|
-
function writeProjectConfig(root, config) {
|
|
49
|
-
const filePath = join(root, PROJECT_FILE);
|
|
50
|
-
const existing = readProjectConfigFile(root);
|
|
51
|
-
const next = {
|
|
52
|
-
projectId: config.projectId,
|
|
53
|
-
slug: config.slug
|
|
54
|
-
};
|
|
55
|
-
if (config.voidInternalStaging === true || existing?.voidInternalStaging === true) next.voidInternalStaging = true;
|
|
56
|
-
mkdirSync(dirname(filePath), { recursive: true });
|
|
57
|
-
writeFileSync(filePath, JSON.stringify(next, null, 2) + "\n");
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Remove the project config file. Returns true if removed, false if it didn't exist.
|
|
61
|
-
*/
|
|
62
|
-
function removeProjectConfig(root) {
|
|
63
|
-
const filePath = join(root, PROJECT_FILE);
|
|
64
|
-
try {
|
|
65
|
-
rmSync(filePath);
|
|
66
|
-
return true;
|
|
67
|
-
} catch {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
export { writeProjectConfig as a, removeProjectConfig as i, project_exports as n, readProjectConfig as r, isVoidInternalStaging as t };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
|
|
2
|
-
//#region src/cli/project-slug.ts
|
|
3
|
-
var project_slug_exports = /* @__PURE__ */ __exportAll({ validateProjectSlug: () => validateProjectSlug });
|
|
4
|
-
function validateProjectSlug(value) {
|
|
5
|
-
const slug = (value ?? "").trim();
|
|
6
|
-
if (slug.length === 0) return "Project slug is required.";
|
|
7
|
-
if (!(slug.length === 1 ? /^[a-z0-9]$/.test(slug) : /^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(slug))) return "Slug must be lowercase alphanumeric with dashes.";
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
|
-
export { validateProjectSlug as n, project_slug_exports as t };
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
|
|
2
|
-
import { a as join } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
|
|
3
|
-
import { i as stripSqlExt, r as readJournal } from "./collect-9rO3JFNM.mjs";
|
|
4
|
-
import { a as tokenizeSql, t as DESTRUCTIVE_PRAGMA } from "./plan-aD3wRDqF.mjs";
|
|
5
|
-
import { existsSync, readdirSync } from "node:fs";
|
|
6
|
-
//#region src/migrations/validate.ts
|
|
7
|
-
var validate_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
-
assertJournalCoherence: () => assertJournalCoherence,
|
|
9
|
-
isDestructive: () => isDestructive,
|
|
10
|
-
listDrizzleArtifacts: () => listDrizzleArtifacts,
|
|
11
|
-
validateMigrations: () => validateMigrations
|
|
12
|
-
});
|
|
13
|
-
/**
|
|
14
|
-
* Destructive SQL patterns that are rejected unless the migration
|
|
15
|
-
* contains the `-- void:allow-destructive` pragma comment.
|
|
16
|
-
*/
|
|
17
|
-
const DESTRUCTIVE_PATTERNS = [
|
|
18
|
-
/\bDROP\s+TABLE\b/i,
|
|
19
|
-
/\bDROP\s+VIEW\b/i,
|
|
20
|
-
/\bDROP\s+INDEX\b/i,
|
|
21
|
-
/\bDROP\s+TRIGGER\b/i,
|
|
22
|
-
/\bALTER\s+TABLE\b[\s\S]*\bDROP\s+COLUMN\b/i,
|
|
23
|
-
/\bALTER\s+TABLE\b[\s\S]*\bRENAME\s+TO\b/i,
|
|
24
|
-
/\bALTER\s+TABLE\b[\s\S]*\bRENAME\s+COLUMN\b/i,
|
|
25
|
-
/\bALTER\s+TABLE\b[\s\S]*\bRENAME\b[\s\S]*\bTO\b/i,
|
|
26
|
-
/\bTRUNCATE\b/i,
|
|
27
|
-
/\bINSERT\s+OR\s+REPLACE\b/i
|
|
28
|
-
];
|
|
29
|
-
function splitExecutableStatements(sql) {
|
|
30
|
-
return sql.split(";").map((statement) => statement.trim()).filter(Boolean);
|
|
31
|
-
}
|
|
32
|
-
function hasTopLevelKeyword(statement, keyword) {
|
|
33
|
-
let depth = 0;
|
|
34
|
-
for (let index = 0; index < statement.length; index++) {
|
|
35
|
-
const character = statement[index];
|
|
36
|
-
if (character === "(") {
|
|
37
|
-
depth++;
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
if (character === ")") {
|
|
41
|
-
depth = Math.max(0, depth - 1);
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
if (depth !== 0) continue;
|
|
45
|
-
if (statement.slice(index, index + keyword.length).toUpperCase() === keyword && !/[A-Z0-9_]/i.test(statement[index - 1] ?? "") && !/[A-Z0-9_]/i.test(statement[index + keyword.length] ?? "")) return true;
|
|
46
|
-
}
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
function hasUnboundedWrite(statement) {
|
|
50
|
-
if (/\bDELETE\s+FROM\b/i.test(statement)) return !hasTopLevelKeyword(statement, "WHERE");
|
|
51
|
-
if (/\bUPDATE\b[\s\S]*\bSET\b/i.test(statement)) return !hasTopLevelKeyword(statement, "WHERE");
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Check if a SQL migration contains destructive operations.
|
|
56
|
-
*/
|
|
57
|
-
function isDestructive(sql) {
|
|
58
|
-
const normalized = sql.replace(/\r\n?/g, "\n");
|
|
59
|
-
let executable = "";
|
|
60
|
-
for (const segment of tokenizeSql(normalized)) if (segment.kind === "sql") executable += normalized.slice(segment.start, segment.end);
|
|
61
|
-
else executable += " ".repeat(segment.end - segment.start);
|
|
62
|
-
return splitExecutableStatements(executable).some((statement) => {
|
|
63
|
-
return DESTRUCTIVE_PATTERNS.some((pattern) => pattern.test(statement)) || hasUnboundedWrite(statement);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
function hasDestructivePragma(sql) {
|
|
67
|
-
return sql.replace(/\r\n?/g, "\n").split("\n").some((line) => line.trim() === DESTRUCTIVE_PRAGMA);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Validate migration files. Returns the validated list with destructive flags.
|
|
71
|
-
* Throws if any destructive migration lacks the allow-destructive pragma.
|
|
72
|
-
*/
|
|
73
|
-
function validateMigrations(files) {
|
|
74
|
-
const results = [];
|
|
75
|
-
const errors = [];
|
|
76
|
-
for (const file of files) {
|
|
77
|
-
const destructive = isDestructive(file.sql);
|
|
78
|
-
if (destructive && !hasDestructivePragma(file.sql)) errors.push(file.name);
|
|
79
|
-
results.push({
|
|
80
|
-
name: file.name,
|
|
81
|
-
sql: file.sql,
|
|
82
|
-
destructive
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
if (errors.length > 0) throw new Error(`Destructive migrations detected without pragma:\n` + errors.map((f) => ` - ${f}`).join("\n") + `\n\nAdd "${DESTRUCTIVE_PRAGMA}" to each file to allow the migration locally and on deploy.`);
|
|
86
|
-
return results;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Enumerate drizzle-kit metadata artifacts in a migrations directory.
|
|
90
|
-
* Returns repo-relative paths like `db/migrations/meta/0000_snapshot.json`
|
|
91
|
-
* and `db/migrations/migrations.js`. Empty when none are present.
|
|
92
|
-
*
|
|
93
|
-
* Shared across `assertJournalCoherence`, `void gen migration`, and
|
|
94
|
-
* `void db rename-migrations` so all three agree on what counts as a
|
|
95
|
-
* "partial drizzle-kit state" (journal gone but other metadata lingering).
|
|
96
|
-
*/
|
|
97
|
-
function listDrizzleArtifacts(migrationsDir) {
|
|
98
|
-
const metaDir = join(migrationsDir, "meta");
|
|
99
|
-
const snapshotFiles = existsSync(metaDir) ? readdirSync(metaDir).filter((f) => f.endsWith("_snapshot.json")) : [];
|
|
100
|
-
const bundledPath = join(migrationsDir, "migrations.js");
|
|
101
|
-
const out = [];
|
|
102
|
-
for (const f of snapshotFiles) out.push(`db/migrations/meta/${f}`);
|
|
103
|
-
if (existsSync(bundledPath)) out.push("db/migrations/migrations.js");
|
|
104
|
-
return out;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Assert that every `.sql` file under `migrationsDir` has a matching entry
|
|
108
|
-
* in `meta/_journal.json`, and vice versa.
|
|
109
|
-
*
|
|
110
|
-
* Drift is a silent footgun: the local/remote runners apply files directly
|
|
111
|
-
* from disk, but `drizzle-kit generate` only sees what's in the journal.
|
|
112
|
-
* An orphan file created by hand (or by a botched scaffold/merge) gets
|
|
113
|
-
* applied to D1 without Drizzle ever acknowledging it, and a failed
|
|
114
|
-
* deploy can leave the database in a state that is impossible to recover
|
|
115
|
-
* from without manual SQL edits (see void-sdk/void#6).
|
|
116
|
-
*
|
|
117
|
-
* A missing journal is NOT a drift error. The drift check is a diff
|
|
118
|
-
* between disk and `meta/_journal.json`; with no journal, there is nothing
|
|
119
|
-
* to diff against. Bare-legacy projects — hand-written `.sql` files with no
|
|
120
|
-
* `db/schema.ts`, no drizzle-kit, no `meta/` directory — worked long
|
|
121
|
-
* before this check existed, and the local/remote runners still track
|
|
122
|
-
* applied migrations by filename via `_void_migrations`. Gating those
|
|
123
|
-
* projects here would break `void deploy`, `void db migrate`, `void db
|
|
124
|
-
* reset`, and `void db status` for a valid path with no migration path
|
|
125
|
-
* forward (they cannot run `void db generate` because it requires
|
|
126
|
-
* `db/schema.ts`). We skip the check silently and let the filename-based
|
|
127
|
-
* runners take over.
|
|
128
|
-
*
|
|
129
|
-
* Throws a user-facing error when any mismatch is detected between the
|
|
130
|
-
* journal and disk. Returns silently otherwise.
|
|
131
|
-
*/
|
|
132
|
-
function assertJournalCoherence(migrationsDir, collected) {
|
|
133
|
-
const journal = readJournal(migrationsDir);
|
|
134
|
-
const drizzleArtifacts = listDrizzleArtifacts(migrationsDir);
|
|
135
|
-
if (journal === void 0) {
|
|
136
|
-
if (drizzleArtifacts.length > 0) throw new Error([
|
|
137
|
-
"db/migrations/meta/_journal.json is missing, but other drizzle-kit metadata is still present:",
|
|
138
|
-
...drizzleArtifacts.map((p) => ` - ${p}`),
|
|
139
|
-
"",
|
|
140
|
-
"This is a partial drizzle-kit state. Restore _journal.json from version control, or delete the orphaned metadata files above if you intended to revert to hand-written migrations."
|
|
141
|
-
].join("\n"));
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
if (journal === null || typeof journal !== "object" || Array.isArray(journal) || typeof journal.version !== "string" || typeof journal.dialect !== "string" || !Array.isArray(journal.entries)) throw new Error("db/migrations/meta/_journal.json is malformed: expected an object with string `version`, string `dialect`, and an `entries` array. Restore the file from version control, or delete it if you intended to revert to hand-written migrations.");
|
|
145
|
-
for (let i = 0; i < journal.entries.length; i++) {
|
|
146
|
-
const entry = journal.entries[i];
|
|
147
|
-
if (entry === null || typeof entry !== "object" || typeof entry.idx !== "number" || typeof entry.version !== "string" || typeof entry.tag !== "string" || typeof entry.breakpoints !== "boolean") throw new Error(`db/migrations/meta/_journal.json is malformed: entry at index ${i} is missing required fields (\`idx\`, \`version\`, \`tag\`, \`breakpoints\`). Restore the file from version control, or delete it if you intended to revert to hand-written migrations.`);
|
|
148
|
-
}
|
|
149
|
-
if (journal.entries.length === 0) {
|
|
150
|
-
if (drizzleArtifacts.length === 0) return;
|
|
151
|
-
throw new Error([
|
|
152
|
-
"db/migrations/meta/_journal.json has no entries, but drizzle-kit metadata is still present:",
|
|
153
|
-
...drizzleArtifacts.map((p) => ` - ${p}`),
|
|
154
|
-
"",
|
|
155
|
-
"This is a partial drizzle-kit state. Restore _journal.json from version control (or run `void db generate`), or delete the orphaned metadata files above if you intended to revert to hand-written migrations."
|
|
156
|
-
].join("\n"));
|
|
157
|
-
}
|
|
158
|
-
const tagCounts = /* @__PURE__ */ new Map();
|
|
159
|
-
for (const entry of journal.entries) tagCounts.set(entry.tag, (tagCounts.get(entry.tag) ?? 0) + 1);
|
|
160
|
-
const duplicateTags = [...tagCounts.entries()].filter(([, n]) => n > 1).map(([tag]) => tag);
|
|
161
|
-
if (duplicateTags.length > 0) throw new Error([
|
|
162
|
-
"db/migrations/meta/_journal.json has duplicate migration entries:",
|
|
163
|
-
...duplicateTags.map((t) => ` - ${t} (appears ${tagCounts.get(t)} times)`),
|
|
164
|
-
"",
|
|
165
|
-
"Each migration must have a unique tag. Restore _journal.json from version control, or hand-edit to remove the duplicates."
|
|
166
|
-
].join("\n"));
|
|
167
|
-
const journalTags = new Set(journal.entries.map((e) => e.tag));
|
|
168
|
-
const collectedTags = new Set(collected.map((m) => stripSqlExt(m.name)));
|
|
169
|
-
const orphans = collected.map((m) => m.name).filter((name) => !journalTags.has(stripSqlExt(name)));
|
|
170
|
-
const missing = journal.entries.map((e) => `${e.tag}.sql`).filter((file) => !collectedTags.has(stripSqlExt(file)));
|
|
171
|
-
if (orphans.length === 0 && missing.length === 0) return;
|
|
172
|
-
const lines = ["Migration drift detected between db/migrations/ and db/migrations/meta/_journal.json."];
|
|
173
|
-
if (orphans.length > 0) {
|
|
174
|
-
lines.push("", "These files exist on disk but are not tracked in _journal.json:");
|
|
175
|
-
for (const f of orphans) lines.push(` - db/migrations/${f}`);
|
|
176
|
-
lines.push("", "Delete the orphan file(s), or move their contents into `db/schema.ts` and re-run `void db generate`.");
|
|
177
|
-
}
|
|
178
|
-
if (missing.length > 0) {
|
|
179
|
-
lines.push("", "These entries are in _journal.json but the matching file is missing:");
|
|
180
|
-
for (const f of missing) lines.push(` - db/migrations/${f}`);
|
|
181
|
-
lines.push("", "Restore the missing file(s) from version control, or regenerate migrations.");
|
|
182
|
-
}
|
|
183
|
-
throw new Error(lines.join("\n"));
|
|
184
|
-
}
|
|
185
|
-
//#endregion
|
|
186
|
-
export { validate_exports as i, listDrizzleArtifacts as n, validateMigrations as r, assertJournalCoherence as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|