@velastack/patterns 0.3.3 → 0.4.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/README.md +44 -2
- package/dist/chunks/_layout-kkgN0IF7.js +62 -0
- package/dist/chunks/_layout-kkgN0IF7.js.map +1 -0
- package/dist/chunks/{collections-CrOvS2E7.js → collections-Dz2fvKnz.js} +2 -2
- package/dist/chunks/{collections-CrOvS2E7.js.map → collections-Dz2fvKnz.js.map} +1 -1
- package/dist/chunks/{compose-handle-B-CkDcQD.js → compose-handle-D_Rz3Fzo.js} +10 -4
- package/dist/chunks/compose-handle-D_Rz3Fzo.js.map +1 -0
- package/dist/chunks/{config-target-Bln26FJe.js → config-target-Dx3w6WSk.js} +59 -70
- package/dist/chunks/config-target-Dx3w6WSk.js.map +1 -0
- package/dist/chunks/constants-BjyMU5s8.js +6 -0
- package/dist/chunks/constants-BjyMU5s8.js.map +1 -0
- package/dist/chunks/dispatch-CXOXPLFk.js +6 -0
- package/dist/chunks/dispatch-CXOXPLFk.js.map +1 -0
- package/dist/chunks/env-vars-C1NUX-bf.js +268 -0
- package/dist/chunks/env-vars-C1NUX-bf.js.map +1 -0
- package/dist/chunks/env-vars-Cr4lbMD_.js +21 -0
- package/dist/chunks/env-vars-Cr4lbMD_.js.map +1 -0
- package/dist/chunks/env-vars-De0Xs0L2.js +20 -0
- package/dist/chunks/env-vars-De0Xs0L2.js.map +1 -0
- package/dist/chunks/env-vars-file-B_6esJW3.js +34 -0
- package/dist/chunks/env-vars-file-B_6esJW3.js.map +1 -0
- package/dist/chunks/env-vars-mnRA0hOe.js +19 -0
- package/dist/chunks/env-vars-mnRA0hOe.js.map +1 -0
- package/dist/chunks/generate-BW3l5Fxw.js +252 -0
- package/dist/chunks/{generate-Ca_6FlPi.js.map → generate-BW3l5Fxw.js.map} +1 -1
- package/dist/chunks/{generate-CyuY2Ci7.js → generate-DeaBlnK6.js} +25 -24
- package/dist/chunks/generate-DeaBlnK6.js.map +1 -0
- package/dist/chunks/generate-DetW_gbr.js +68 -0
- package/dist/chunks/generate-DetW_gbr.js.map +1 -0
- package/dist/chunks/{generate-DwADTUob.js → generate-Gcc8iRkZ.js} +9 -6
- package/dist/chunks/{generate-DwADTUob.js.map → generate-Gcc8iRkZ.js.map} +1 -1
- package/dist/chunks/{generate-DQeWOEPY.js → generate-WMJo3QGZ.js} +9 -6
- package/dist/chunks/generate-WMJo3QGZ.js.map +1 -0
- package/dist/chunks/generate.runtime-1-91UmM8.js +85 -0
- package/dist/chunks/generate.runtime-1-91UmM8.js.map +1 -0
- package/dist/chunks/generate.runtime-6FXJM8hT.js +67 -0
- package/dist/chunks/generate.runtime-6FXJM8hT.js.map +1 -0
- package/dist/chunks/generate.runtime-B1jVAnDI.js +155 -0
- package/dist/chunks/generate.runtime-B1jVAnDI.js.map +1 -0
- package/dist/chunks/generate.runtime-BA3tDKnn.js +147 -0
- package/dist/chunks/generate.runtime-BA3tDKnn.js.map +1 -0
- package/dist/chunks/{generate.runtime-4FDxnvCl.js → generate.runtime-BO778G0r.js} +5 -5
- package/dist/chunks/{generate.runtime-4FDxnvCl.js.map → generate.runtime-BO778G0r.js.map} +1 -1
- package/dist/chunks/{generate.runtime-D1DNAY6k.js → generate.runtime-BXkZob1O.js} +8 -8
- package/dist/chunks/generate.runtime-BXkZob1O.js.map +1 -0
- package/dist/chunks/{generate.runtime-Um77JfwC.js → generate.runtime-B_UVGa3q.js} +7 -7
- package/dist/chunks/{generate.runtime-Um77JfwC.js.map → generate.runtime-B_UVGa3q.js.map} +1 -1
- package/dist/chunks/{generate.runtime-FdZw277n.js → generate.runtime-C6bSvGMb.js} +108 -142
- package/dist/chunks/generate.runtime-C6bSvGMb.js.map +1 -0
- package/dist/chunks/generate.runtime-C8zJRNYG.js +124 -0
- package/dist/chunks/generate.runtime-C8zJRNYG.js.map +1 -0
- package/dist/chunks/{generate.runtime-BKiJvE8I.js → generate.runtime-CA7Ofjlx.js} +104 -100
- package/dist/chunks/generate.runtime-CA7Ofjlx.js.map +1 -0
- package/dist/chunks/generate.runtime-CCr1lvo4.js +43 -0
- package/dist/chunks/generate.runtime-CCr1lvo4.js.map +1 -0
- package/dist/chunks/generate.runtime-CYagyR5c.js +326 -0
- package/dist/chunks/generate.runtime-CYagyR5c.js.map +1 -0
- package/dist/chunks/{generate.runtime-n9AFWtPp.js → generate.runtime-Ce_rwzNa.js} +4 -4
- package/dist/chunks/{generate.runtime-n9AFWtPp.js.map → generate.runtime-Ce_rwzNa.js.map} +1 -1
- package/dist/chunks/{generate.runtime-cQGLxuZM.js → generate.runtime-CexC1Oky.js} +4 -4
- package/dist/chunks/{generate.runtime-cQGLxuZM.js.map → generate.runtime-CexC1Oky.js.map} +1 -1
- package/dist/chunks/{generate.runtime-AYQVW1S-.js → generate.runtime-CnPraLKv.js} +35 -31
- package/dist/chunks/generate.runtime-CnPraLKv.js.map +1 -0
- package/dist/chunks/generate.runtime-CslAvllQ.js +112 -0
- package/dist/chunks/generate.runtime-CslAvllQ.js.map +1 -0
- package/dist/chunks/{generate.runtime-onBnOiS7.js → generate.runtime-CuNhY5hn.js} +10 -10
- package/dist/chunks/generate.runtime-CuNhY5hn.js.map +1 -0
- package/dist/chunks/{generate.runtime-B45MvtYm.js → generate.runtime-DD51OSuL.js} +14 -14
- package/dist/chunks/generate.runtime-DD51OSuL.js.map +1 -0
- package/dist/chunks/generate.runtime-DHBRyMAq.js +65 -0
- package/dist/chunks/generate.runtime-DHBRyMAq.js.map +1 -0
- package/dist/chunks/generate.runtime-DV3WmZtb.js +35 -0
- package/dist/chunks/generate.runtime-DV3WmZtb.js.map +1 -0
- package/dist/chunks/generate.runtime-D_sQOeQa.js +164 -0
- package/dist/chunks/generate.runtime-D_sQOeQa.js.map +1 -0
- package/dist/chunks/{generate.runtime-ofdnLtxS.js → generate.runtime-DqD3PW-W.js} +3 -3
- package/dist/chunks/{generate.runtime-ofdnLtxS.js.map → generate.runtime-DqD3PW-W.js.map} +1 -1
- package/dist/chunks/{generate.runtime-VgVwRiiN.js → generate.runtime-Dtgw9IQO.js} +8 -8
- package/dist/chunks/generate.runtime-Dtgw9IQO.js.map +1 -0
- package/dist/chunks/{generate.runtime-CN5c2xH8.js → generate.runtime-IlBCcXvv.js} +14 -14
- package/dist/chunks/generate.runtime-IlBCcXvv.js.map +1 -0
- package/dist/chunks/{generate.runtime-BSRFv4cJ.js → generate.runtime-cwvAoKoH.js} +3 -3
- package/dist/chunks/{generate.runtime-BSRFv4cJ.js.map → generate.runtime-cwvAoKoH.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DG-3G00z.js → generate.runtime-kvxmTlQb.js} +3 -3
- package/dist/chunks/{generate.runtime-DG-3G00z.js.map → generate.runtime-kvxmTlQb.js.map} +1 -1
- package/dist/chunks/generate.runtime-pVLzzpUM.js +122 -0
- package/dist/chunks/generate.runtime-pVLzzpUM.js.map +1 -0
- package/dist/chunks/{generate.runtime-BFOXm2DD.js → generate.runtime-zJpEufTc.js} +10 -10
- package/dist/chunks/generate.runtime-zJpEufTc.js.map +1 -0
- package/dist/chunks/lib-specifier-Cngo1zF_.js +33 -0
- package/dist/chunks/lib-specifier-Cngo1zF_.js.map +1 -0
- package/dist/chunks/{modify-file-Dwfv0dCI.js → modify-file-BlDeeurK.js} +3 -3
- package/dist/chunks/{modify-file-Dwfv0dCI.js.map → modify-file-BlDeeurK.js.map} +1 -1
- package/dist/chunks/{modify-svelte-config-remote-BUU_EaDf.js → modify-svelte-config-remote-p0TfVzxm.js} +8 -10
- package/dist/chunks/modify-svelte-config-remote-p0TfVzxm.js.map +1 -0
- package/dist/chunks/nav-user-BRIHOOpG.js +6 -0
- package/dist/chunks/nav-user-BRIHOOpG.js.map +1 -0
- package/dist/chunks/package-imports-Bbw3iMPg.js +173 -0
- package/dist/chunks/package-imports-Bbw3iMPg.js.map +1 -0
- package/dist/chunks/{pocketbase-BkhUywtb.js → pocketbase-Dry6ry17.js} +2 -2
- package/dist/chunks/{pocketbase-BkhUywtb.js.map → pocketbase-Dry6ry17.js.map} +1 -1
- package/dist/chunks/{providers-BL9vJP_9.js → providers-BHR6-XZ7.js} +11 -4
- package/dist/chunks/providers-BHR6-XZ7.js.map +1 -0
- package/dist/chunks/{shared-C8GtNxpm.js → shared-CZC4d7Uj.js} +2 -2
- package/dist/chunks/{shared-C8GtNxpm.js.map → shared-CZC4d7Uj.js.map} +1 -1
- package/dist/chunks/{site-BdMX8qrH.js → site-BwCA18Sv.js} +2 -2
- package/dist/chunks/{site-BdMX8qrH.js.map → site-BwCA18Sv.js.map} +1 -1
- package/dist/chunks/table-core-AjBpYi-y.js +127 -0
- package/dist/chunks/table-core-AjBpYi-y.js.map +1 -0
- package/dist/chunks/{test-setup-DHEFKEHE.js → test-setup-DEmWd9Ul.js} +76 -67
- package/dist/chunks/test-setup-DEmWd9Ul.js.map +1 -0
- package/dist/chunks/{ts-morph-helpers-CeduA--o.js → ts-morph-helpers-CDW4lhox.js} +77 -63
- package/dist/chunks/ts-morph-helpers-CDW4lhox.js.map +1 -0
- package/dist/chunks/ui-DD4NltyN.js.map +1 -1
- package/dist/chunks/{ui-TlEuI2Sz.js → ui-X698F10c.js} +47 -47
- package/dist/chunks/{ui-TlEuI2Sz.js.map → ui-X698F10c.js.map} +1 -1
- package/dist/chunks/{unmodify-load-jfdcVZ_a.js → unmodify-load-CyGzC1Hu.js} +2 -2
- package/dist/chunks/{unmodify-load-jfdcVZ_a.js.map → unmodify-load-CyGzC1Hu.js.map} +1 -1
- package/dist/chunks/write-result-B68lvI57.js +511 -0
- package/dist/chunks/write-result-B68lvI57.js.map +1 -0
- package/dist/index.d.ts +302 -157
- package/dist/index.js +2124 -2066
- package/dist/index.js.map +1 -1
- package/package.json +10 -9
- package/dist/chunks/_layout-B7ujvjnA.js +0 -55
- package/dist/chunks/_layout-B7ujvjnA.js.map +0 -1
- package/dist/chunks/compose-handle-B-CkDcQD.js.map +0 -1
- package/dist/chunks/config-target-Bln26FJe.js.map +0 -1
- package/dist/chunks/constants-BYkd9jeJ.js +0 -6
- package/dist/chunks/constants-BYkd9jeJ.js.map +0 -1
- package/dist/chunks/dispatch-BRnt8PcW.js +0 -6
- package/dist/chunks/dispatch-BRnt8PcW.js.map +0 -1
- package/dist/chunks/generate-6snrlnpA.js +0 -64
- package/dist/chunks/generate-6snrlnpA.js.map +0 -1
- package/dist/chunks/generate-Ca_6FlPi.js +0 -252
- package/dist/chunks/generate-CyuY2Ci7.js.map +0 -1
- package/dist/chunks/generate-DQeWOEPY.js.map +0 -1
- package/dist/chunks/generate.runtime-AYQVW1S-.js.map +0 -1
- package/dist/chunks/generate.runtime-B2aFFaac.js +0 -117
- package/dist/chunks/generate.runtime-B2aFFaac.js.map +0 -1
- package/dist/chunks/generate.runtime-B45MvtYm.js.map +0 -1
- package/dist/chunks/generate.runtime-BFOXm2DD.js.map +0 -1
- package/dist/chunks/generate.runtime-BHkFmI2Y.js +0 -146
- package/dist/chunks/generate.runtime-BHkFmI2Y.js.map +0 -1
- package/dist/chunks/generate.runtime-BKiJvE8I.js.map +0 -1
- package/dist/chunks/generate.runtime-BUqsF3AF.js +0 -123
- package/dist/chunks/generate.runtime-BUqsF3AF.js.map +0 -1
- package/dist/chunks/generate.runtime-BsaSyTnU.js +0 -82
- package/dist/chunks/generate.runtime-BsaSyTnU.js.map +0 -1
- package/dist/chunks/generate.runtime-CMnvmeVt.js +0 -111
- package/dist/chunks/generate.runtime-CMnvmeVt.js.map +0 -1
- package/dist/chunks/generate.runtime-CN5c2xH8.js.map +0 -1
- package/dist/chunks/generate.runtime-CgoSrP55.js +0 -146
- package/dist/chunks/generate.runtime-CgoSrP55.js.map +0 -1
- package/dist/chunks/generate.runtime-D1DNAY6k.js.map +0 -1
- package/dist/chunks/generate.runtime-DQwSY6Nc.js +0 -38
- package/dist/chunks/generate.runtime-DQwSY6Nc.js.map +0 -1
- package/dist/chunks/generate.runtime-D_yqWLcI.js +0 -66
- package/dist/chunks/generate.runtime-D_yqWLcI.js.map +0 -1
- package/dist/chunks/generate.runtime-Drmahmdl.js +0 -313
- package/dist/chunks/generate.runtime-Drmahmdl.js.map +0 -1
- package/dist/chunks/generate.runtime-FdZw277n.js.map +0 -1
- package/dist/chunks/generate.runtime-Lh1cW9Tz.js +0 -94
- package/dist/chunks/generate.runtime-Lh1cW9Tz.js.map +0 -1
- package/dist/chunks/generate.runtime-QGHToXRY.js +0 -32
- package/dist/chunks/generate.runtime-QGHToXRY.js.map +0 -1
- package/dist/chunks/generate.runtime-VgVwRiiN.js.map +0 -1
- package/dist/chunks/generate.runtime-YyIVd4oy.js +0 -61
- package/dist/chunks/generate.runtime-YyIVd4oy.js.map +0 -1
- package/dist/chunks/generate.runtime-onBnOiS7.js.map +0 -1
- package/dist/chunks/modify-svelte-config-remote-BUU_EaDf.js.map +0 -1
- package/dist/chunks/nav-user-BYI-h8Od.js +0 -6
- package/dist/chunks/nav-user-BYI-h8Od.js.map +0 -1
- package/dist/chunks/providers-BL9vJP_9.js.map +0 -1
- package/dist/chunks/table-core-G9Shld4F.js +0 -126
- package/dist/chunks/table-core-G9Shld4F.js.map +0 -1
- package/dist/chunks/test-setup-DHEFKEHE.js.map +0 -1
- package/dist/chunks/ts-morph-helpers-CeduA--o.js.map +0 -1
- package/dist/chunks/write-result-Djy0SZXX.js +0 -376
- package/dist/chunks/write-result-Djy0SZXX.js.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { t as e } from "./errors-DR3gF_7a.js";
|
|
2
|
+
import { n as t } from "./constants-BjyMU5s8.js";
|
|
3
|
+
import { i as n, o as r, s as i } from "./providers-BHR6-XZ7.js";
|
|
4
|
+
import { n as a, s as o } from "./generate-BW3l5Fxw.js";
|
|
5
|
+
import { n as s } from "./logger-CQONztPm.js";
|
|
6
|
+
import { t as c } from "./env-BPfk1VAw.js";
|
|
7
|
+
import { modifyOutcomeToFile as l } from "./modify-file-BlDeeurK.js";
|
|
8
|
+
import { modifyEnvVarsFiles as u } from "./env-vars-C1NUX-bf.js";
|
|
9
|
+
import { o as d } from "./config-target-Dx3w6WSk.js";
|
|
10
|
+
import { c as f } from "./write-result-B68lvI57.js";
|
|
11
|
+
import p from "node:path";
|
|
12
|
+
//#region src/patterns/enable/ai/generate.runtime.ts
|
|
13
|
+
var m = f(t), h = [
|
|
14
|
+
`AI needs a server, and this project builds with ${m}.`,
|
|
15
|
+
"The chat endpoint streams each reply from the server with a private API key, which a static site cannot do.",
|
|
16
|
+
"Switch to a server adapter first: `vela enable backend` moves the project to @sveltejs/adapter-node."
|
|
17
|
+
].join("\n");
|
|
18
|
+
function g(e) {
|
|
19
|
+
let t = d(e);
|
|
20
|
+
return t.status === "resolved" && t.target.sourceFile.getImportDeclarations().some((e) => e.getModuleSpecifierValue() === m);
|
|
21
|
+
}
|
|
22
|
+
async function _(t) {
|
|
23
|
+
if (g(t.root)) throw new e(h);
|
|
24
|
+
let d = s(t), f = r(a, t), m = [], _ = [];
|
|
25
|
+
d.info("Declaring the API key in src/env.ts");
|
|
26
|
+
let v = u(t.root, n(f));
|
|
27
|
+
v.create && m.push(v.create), v.modify && _.push(v.modify), d.info("Updating .env");
|
|
28
|
+
let y = p.join(t.root, ".env"), b = l(y, c(y, o(f, i(t))));
|
|
29
|
+
return b && _.push(b), {
|
|
30
|
+
creates: m,
|
|
31
|
+
modifies: _,
|
|
32
|
+
deletes: [],
|
|
33
|
+
components: [],
|
|
34
|
+
packages: [],
|
|
35
|
+
collections: [],
|
|
36
|
+
collectionPatches: [],
|
|
37
|
+
collectionDrops: []
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { _ as generate };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=generate.runtime-CCr1lvo4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.runtime-CCr1lvo4.js","names":[],"sources":["../../src/patterns/enable/ai/generate.runtime.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { File, Options, Result } from \"../../../core/types\";\nimport { InvalidArgumentError } from \"../../../core/errors\";\nimport { getLogger } from \"../../../core/logger\";\nimport { ADAPTER_STATIC as ADAPTER_STATIC_SPEC } from \"../../../core/constants\";\nimport {\n providerEnvVars,\n resolveProvider,\n suppliedProviderEnv,\n} from \"../../../core/providers\";\nimport { resolveConfigTarget } from \"../../../runtime/config-target\";\nimport { modifyEnv } from \"../../../runtime/env\";\nimport { modifyEnvVarsFiles } from \"../../../runtime/env-vars\";\nimport { modifyOutcomeToFile } from \"../../../runtime/modify-file\";\nimport { packageName } from \"../../../runtime/write-result\";\nimport { envEditsFor, META } from \"./generate\";\n\n// The config imports the package, not the versioned spec the constant installs.\nconst ADAPTER_STATIC = packageName(ADAPTER_STATIC_SPEC);\n\nexport const STATIC_ADAPTER_MESSAGE = [\n `AI needs a server, and this project builds with ${ADAPTER_STATIC}.`,\n \"The chat endpoint streams each reply from the server with a private API key, which a static site cannot do.\",\n \"Switch to a server adapter first: `vela enable backend` moves the project to @sveltejs/adapter-node.\",\n].join(\"\\n\");\n\n/**\n * Whether the SvelteKit config the project builds with imports\n * adapter-static. A config that cannot be resolved does not count: the\n * pattern only refuses what it can see.\n */\nexport function usesStaticAdapter(root: string): boolean {\n const res = resolveConfigTarget(root);\n if (res.status !== \"resolved\") return false;\n return res.target.sourceFile\n .getImportDeclarations()\n .some((decl) => decl.getModuleSpecifierValue() === ADAPTER_STATIC);\n}\n\nexport async function generate(options: Options) {\n if (usesStaticAdapter(options.root)) {\n throw new InvalidArgumentError(STATIC_ADAPTER_MESSAGE);\n }\n\n const logger = getLogger(options);\n const provider = resolveProvider(META, options);\n const creates: File[] = [];\n const modifies: File[] = [];\n\n // SvelteKit 3 exposes only declared variables: `src/lib/server/ai.ts`\n // imports the provider's key from `$app/env/private`.\n logger.info(\"Declaring the API key in src/env.ts\");\n const envVars = modifyEnvVarsFiles(options.root, providerEnvVars(provider));\n if (envVars.create) creates.push(envVars.create);\n if (envVars.modify) modifies.push(envVars.modify);\n\n logger.info(\"Updating .env\");\n const envPath = path.join(options.root, \".env\");\n const envFile = modifyOutcomeToFile(\n envPath,\n modifyEnv(envPath, envEditsFor(provider, suppliedProviderEnv(options))),\n );\n if (envFile) modifies.push(envFile);\n\n return {\n creates,\n modifies,\n deletes: [],\n components: [],\n packages: [],\n collections: [],\n collectionPatches: [],\n collectionDrops: [],\n } satisfies Result;\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAM,IAAiB,EAAY,CAAmB,GAEzC,IAAyB;CACpC,mDAAmD,EAAe;CAClE;CACA;AACF,CAAC,CAAC,KAAK,IAAI;AAOX,SAAgB,EAAkB,GAAuB;CACvD,IAAM,IAAM,EAAoB,CAAI;CAEpC,OADI,EAAI,WAAW,cACZ,EAAI,OAAO,WACf,sBAAsB,CAAC,CACvB,MAAM,MAAS,EAAK,wBAAwB,MAAM,CAAc;AACrE;AAEA,eAAsB,EAAS,GAAkB;CAC/C,IAAI,EAAkB,EAAQ,IAAI,GAChC,MAAM,IAAI,EAAqB,CAAsB;CAGvD,IAAM,IAAS,EAAU,CAAO,GAC1B,IAAW,EAAgB,GAAM,CAAO,GACxC,IAAkB,CAAC,GACnB,IAAmB,CAAC;CAI1B,EAAO,KAAK,qCAAqC;CACjD,IAAM,IAAU,EAAmB,EAAQ,MAAM,EAAgB,CAAQ,CAAC;CAI1E,AAHI,EAAQ,UAAQ,EAAQ,KAAK,EAAQ,MAAM,GAC3C,EAAQ,UAAQ,EAAS,KAAK,EAAQ,MAAM,GAEhD,EAAO,KAAK,eAAe;CAC3B,IAAM,IAAU,EAAK,KAAK,EAAQ,MAAM,MAAM,GACxC,IAAU,EACd,GACA,EAAU,GAAS,EAAY,GAAU,EAAoB,CAAO,CAAC,CAAC,CACxE;CAGA,OAFI,KAAS,EAAS,KAAK,CAAO,GAE3B;EACL;EACA;EACA,SAAS,CAAC;EACV,YAAY,CAAC;EACb,UAAU,CAAC;EACX,aAAa,CAAC;EACd,mBAAmB,CAAC;EACpB,iBAAiB,CAAC;CACpB;AACF"}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { r as e } from "./lib-specifier-Cngo1zF_.js";
|
|
2
|
+
import { t } from "./dedent-Gq6Krl4n.js";
|
|
3
|
+
import { n } from "./logger-CQONztPm.js";
|
|
4
|
+
import { _ as r, c as i, d as a, h as o, m as s, n as c, o as l, s as u, u as d } from "./ts-morph-helpers-CDW4lhox.js";
|
|
5
|
+
import { modifyOutcomeToFile as f, revertOutcomeToFile as p } from "./modify-file-BlDeeurK.js";
|
|
6
|
+
import { t as m } from "./svelte-file-B3RfgVdt.js";
|
|
7
|
+
import { n as h } from "./compose-handle-D_Rz3Fzo.js";
|
|
8
|
+
import { a as g, o as _, s as v, t as y } from "./config-target-Dx3w6WSk.js";
|
|
9
|
+
import { i as b } from "./package-imports-Bbw3iMPg.js";
|
|
10
|
+
import { r as x, t as S } from "./_layout-kkgN0IF7.js";
|
|
11
|
+
import C from "node:fs";
|
|
12
|
+
import w from "node:path";
|
|
13
|
+
import { Project as T, QuoteKind as E, SyntaxKind as D } from "ts-morph";
|
|
14
|
+
//#region src/patterns/disable/i18n/modifies/gitignore.ts
|
|
15
|
+
function O(e) {
|
|
16
|
+
if (!C.existsSync(e)) return {
|
|
17
|
+
status: "success",
|
|
18
|
+
changed: !1
|
|
19
|
+
};
|
|
20
|
+
let t = C.readFileSync(e, "utf8");
|
|
21
|
+
if (!t.includes("src/locales/.wuchale")) return {
|
|
22
|
+
status: "success",
|
|
23
|
+
changed: !1
|
|
24
|
+
};
|
|
25
|
+
let n = t.split("\n"), r = [];
|
|
26
|
+
for (let e = 0; e < n.length; e++) {
|
|
27
|
+
let t = n[e];
|
|
28
|
+
if (t === "# Wuchale") {
|
|
29
|
+
let t = e + 1, r = !1;
|
|
30
|
+
for (; t < n.length && n[t].trim() !== "";) n[t] === "src/locales/.wuchale" && (r = !0), t++;
|
|
31
|
+
if (r) {
|
|
32
|
+
e = t;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
t !== "src/locales/.wuchale" && r.push(t);
|
|
37
|
+
}
|
|
38
|
+
let i = r.join("\n");
|
|
39
|
+
return i = i.replace(/\n{3,}/g, "\n\n"), i === t ? {
|
|
40
|
+
status: "success",
|
|
41
|
+
changed: !1
|
|
42
|
+
} : (C.writeFileSync(e, i), {
|
|
43
|
+
status: "success",
|
|
44
|
+
changed: !0
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/patterns/disable/i18n/modifies/vite-config.ts
|
|
49
|
+
function k(e) {
|
|
50
|
+
if (!C.existsSync(e)) return {
|
|
51
|
+
status: "success",
|
|
52
|
+
changed: !1
|
|
53
|
+
};
|
|
54
|
+
let t = C.readFileSync(e, "utf8");
|
|
55
|
+
if (!t.includes("wuchale")) return {
|
|
56
|
+
status: "success",
|
|
57
|
+
changed: !1
|
|
58
|
+
};
|
|
59
|
+
let n = new T({
|
|
60
|
+
compilerOptions: { allowJs: !0 },
|
|
61
|
+
manipulationSettings: { quoteKind: E.Single }
|
|
62
|
+
}).addSourceFileAtPath(e);
|
|
63
|
+
for (;;) {
|
|
64
|
+
let e = !1;
|
|
65
|
+
for (let t of n.getDescendantsOfKind(D.ArrayLiteralExpression)) {
|
|
66
|
+
let n = t.getElements().findIndex((e) => e.getText().replace(/\s/g, "") === "wuchale()");
|
|
67
|
+
if (n >= 0) {
|
|
68
|
+
t.removeElement(n), e = !0;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (!e) break;
|
|
73
|
+
}
|
|
74
|
+
return d(n, "wuchale/vite"), l(n), n.saveSync(), {
|
|
75
|
+
status: "success",
|
|
76
|
+
changed: n.getFullText() !== t
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/patterns/disable/i18n/modifies/locales-alias.ts
|
|
81
|
+
var A = {
|
|
82
|
+
notFound: "No SvelteKit config to revert.",
|
|
83
|
+
failed: "Remove the $locales alias from the sveltekit() arg in vite.config by hand."
|
|
84
|
+
};
|
|
85
|
+
function j(e) {
|
|
86
|
+
let t = _(e, A);
|
|
87
|
+
if (t.status === "not-found") return {
|
|
88
|
+
filePath: t.filePath,
|
|
89
|
+
outcome: {
|
|
90
|
+
status: "success",
|
|
91
|
+
changed: !1
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
if (t.status === "failed") return {
|
|
95
|
+
filePath: t.filePath,
|
|
96
|
+
outcome: {
|
|
97
|
+
status: "failed",
|
|
98
|
+
message: t.message
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
let { target: n } = t, r = n.configObject.getProperty("alias")?.asKind(D.PropertyAssignment), i = r?.getInitializer()?.asKind(D.ObjectLiteralExpression), a = i?.getProperties().find((e) => e.getText().replace(/['"]/g, "").startsWith("$locales"));
|
|
102
|
+
return r && i && a && (a.remove(), i.getProperties().length === 0 && r.remove()), {
|
|
103
|
+
filePath: n.filePath,
|
|
104
|
+
outcome: v(n)
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/patterns/disable/i18n/modifies/locales-module.ts
|
|
109
|
+
function M(e) {
|
|
110
|
+
let t = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = RegExp(`^[$#]locales/${t}(\\.js)?$`);
|
|
111
|
+
return (e) => n.test(e);
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/patterns/disable/i18n/modifies/hooks.server.ts
|
|
115
|
+
var N = "handleWuchale", P = t`
|
|
116
|
+
Take handleWuchale out of the exported handle in src/hooks.server.ts, then
|
|
117
|
+
remove its declaration, the loadLocales(...) calls and the wuchale and
|
|
118
|
+
#locales imports.
|
|
119
|
+
`, F = [
|
|
120
|
+
"wuchale/load-utils/server",
|
|
121
|
+
M("main.url"),
|
|
122
|
+
M("data"),
|
|
123
|
+
M("main.loader.server.svelte"),
|
|
124
|
+
M("js.loader.server")
|
|
125
|
+
];
|
|
126
|
+
function I(e) {
|
|
127
|
+
if (!C.existsSync(e)) return {
|
|
128
|
+
status: "success",
|
|
129
|
+
changed: !1
|
|
130
|
+
};
|
|
131
|
+
let t = C.readFileSync(e, "utf8");
|
|
132
|
+
if (!t.includes(N) && !t.includes("loadLocales(")) return {
|
|
133
|
+
status: "success",
|
|
134
|
+
changed: !1
|
|
135
|
+
};
|
|
136
|
+
let n = new T({
|
|
137
|
+
compilerOptions: { allowJs: !0 },
|
|
138
|
+
manipulationSettings: { quoteKind: E.Single }
|
|
139
|
+
}).addSourceFileAtPath(e);
|
|
140
|
+
for (;;) {
|
|
141
|
+
let e = n.getStatements().find((e) => e.getKind() === D.ExpressionStatement && /^loadLocales\s*\(/.test(e.getText()));
|
|
142
|
+
if (!e) break;
|
|
143
|
+
e.remove();
|
|
144
|
+
}
|
|
145
|
+
if (h(n, N).status === "unsupported") return {
|
|
146
|
+
status: "failed",
|
|
147
|
+
message: P
|
|
148
|
+
};
|
|
149
|
+
o(n, N);
|
|
150
|
+
for (let e of F) d(n, e);
|
|
151
|
+
return a(n, "@sveltejs/kit/hooks", "sequence"), a(n, "@sveltejs/kit/hooks", "Handle"), a(n, "@sveltejs/kit", "Handle"), l(n), c(n), n.saveSync(), {
|
|
152
|
+
status: "success",
|
|
153
|
+
changed: n.getFullText() !== t
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/patterns/disable/i18n/modifies/hooks.ts
|
|
158
|
+
var L = "rerouteDeLocalize", R = t`
|
|
159
|
+
Take rerouteDeLocalize out of the exported reroute in src/hooks.ts, then
|
|
160
|
+
remove its declaration and the wuchale and #locales imports.
|
|
161
|
+
`, z = [
|
|
162
|
+
"wuchale/url",
|
|
163
|
+
M("main.url"),
|
|
164
|
+
M("data")
|
|
165
|
+
], B = /^\(\s*\{\s*url\s*\}\s*\)\s*=>\s*rerouteDeLocalize\(\s*url\.pathname\s*\)$/, V = /^\(\s*\{\s*url\s*\}\s*\)\s*=>\s*rerouteDeLocalize\(\s*negotiateReroute\(\s*url\.pathname\s*\)\s*\)$/;
|
|
166
|
+
function H(e) {
|
|
167
|
+
if (!C.existsSync(e)) return {
|
|
168
|
+
status: "success",
|
|
169
|
+
changed: !1
|
|
170
|
+
};
|
|
171
|
+
let t = C.readFileSync(e, "utf8");
|
|
172
|
+
if (!t.includes(L)) return {
|
|
173
|
+
status: "success",
|
|
174
|
+
changed: !1
|
|
175
|
+
};
|
|
176
|
+
let n = new T({
|
|
177
|
+
compilerOptions: { allowJs: !0 },
|
|
178
|
+
manipulationSettings: { quoteKind: E.Single }
|
|
179
|
+
}).addSourceFileAtPath(e), r = n.getVariableDeclaration(L)?.getFirstAncestorByKind(D.VariableStatement), a = n.getVariableDeclaration("reroute"), s = a?.getInitializer()?.getText() ?? "", d = V.test(s), f = d || B.test(s) ? a?.getFirstAncestorByKind(D.VariableStatement) : void 0;
|
|
180
|
+
return n.getStatements().filter((e) => e !== r && e !== f && e.getText().includes(L)).length > 0 ? {
|
|
181
|
+
status: "failed",
|
|
182
|
+
message: R
|
|
183
|
+
} : (d ? a?.setInitializer("({ url }) => negotiateReroute(url.pathname)") : f && o(n, "reroute"), o(n, L), i(n, z), u(n) ? (C.writeFileSync(e, "", "utf8"), {
|
|
184
|
+
status: "success",
|
|
185
|
+
changed: !0
|
|
186
|
+
}) : (l(n), c(n), n.saveSync(), {
|
|
187
|
+
status: "success",
|
|
188
|
+
changed: n.getFullText() !== t
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/patterns/disable/i18n/modifies/app-html.ts
|
|
193
|
+
function U(e) {
|
|
194
|
+
if (!C.existsSync(e)) return {
|
|
195
|
+
status: "success",
|
|
196
|
+
changed: !1
|
|
197
|
+
};
|
|
198
|
+
let t = C.readFileSync(e, "utf8"), n = t.replace(/lang\s*=\s*(?:"%sveltekit\.lang%"|'%sveltekit\.lang%')/g, "lang=\"en\"");
|
|
199
|
+
return n === t ? {
|
|
200
|
+
status: "success",
|
|
201
|
+
changed: !1
|
|
202
|
+
} : (C.writeFileSync(e, n, "utf8"), {
|
|
203
|
+
status: "success",
|
|
204
|
+
changed: !0
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/patterns/disable/i18n/modifies/+layout.ts
|
|
209
|
+
var W = t`
|
|
210
|
+
src/routes/+layout.ts still loads wuchale locales. Remove these from it:
|
|
211
|
+
|
|
212
|
+
import { browser } from '$app/env';
|
|
213
|
+
import { loadLocale } from 'wuchale/load-utils';
|
|
214
|
+
import { getLocale } from '#locales/main.url.js';
|
|
215
|
+
import '#locales/main.loader.svelte.js';
|
|
216
|
+
import '#locales/js.loader.js';
|
|
217
|
+
|
|
218
|
+
and the loadLocale(...) call inside load().
|
|
219
|
+
`, G = [M("main.loader.svelte"), M("js.loader")], K = [
|
|
220
|
+
(e) => /^\$app\/env(ironment)?$/.test(e),
|
|
221
|
+
"wuchale/load-utils",
|
|
222
|
+
M("main.url")
|
|
223
|
+
];
|
|
224
|
+
function q(e) {
|
|
225
|
+
return e.replace(/["']/g, "'").replace(/\s+/g, "");
|
|
226
|
+
}
|
|
227
|
+
function J(e) {
|
|
228
|
+
if (!C.existsSync(e)) return {
|
|
229
|
+
status: "success",
|
|
230
|
+
changed: !1
|
|
231
|
+
};
|
|
232
|
+
let t = C.readFileSync(e, "utf8");
|
|
233
|
+
if (!t.includes("loadLocale") && !/[$#]locales\//.test(t)) return {
|
|
234
|
+
status: "success",
|
|
235
|
+
changed: !1
|
|
236
|
+
};
|
|
237
|
+
let n = new T({
|
|
238
|
+
compilerOptions: { allowJs: !0 },
|
|
239
|
+
manipulationSettings: { quoteKind: E.Single }
|
|
240
|
+
}).addSourceFileAtPath(e), r = n.getVariableStatements().find((e) => e.getDeclarations().some((e) => e.getName() === "load")) ?? n.getFunction("load");
|
|
241
|
+
if (r) {
|
|
242
|
+
if (q(r.getText()) !== q(S)) return {
|
|
243
|
+
status: "failed",
|
|
244
|
+
message: W
|
|
245
|
+
};
|
|
246
|
+
s(n, r);
|
|
247
|
+
}
|
|
248
|
+
for (let e of G) d(n, e);
|
|
249
|
+
return i(n, K), u(n) ? (C.writeFileSync(e, "", "utf8"), {
|
|
250
|
+
status: "success",
|
|
251
|
+
changed: !0
|
|
252
|
+
}) : (l(n), c(n), n.saveSync(), {
|
|
253
|
+
status: "success",
|
|
254
|
+
changed: n.getFullText() !== t
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/patterns/disable/i18n/modifies/root-layout.svelte.ts
|
|
259
|
+
function Y(t) {
|
|
260
|
+
if (!C.existsSync(t)) return {
|
|
261
|
+
status: "success",
|
|
262
|
+
changed: !1
|
|
263
|
+
};
|
|
264
|
+
let n = C.readFileSync(t, "utf8");
|
|
265
|
+
if (!n.includes("LanguageSelect")) return {
|
|
266
|
+
status: "success",
|
|
267
|
+
changed: !1
|
|
268
|
+
};
|
|
269
|
+
let i = m.fromPath(t);
|
|
270
|
+
i.modifyScript((t) => {
|
|
271
|
+
let { source: n } = r(t, (t) => {
|
|
272
|
+
d(t, e("components/language-select.svelte")), c(t);
|
|
273
|
+
});
|
|
274
|
+
return n;
|
|
275
|
+
});
|
|
276
|
+
let a = i.toString();
|
|
277
|
+
return a = a.replace(/[ \t]*<Navbar\.Item>\s*<LanguageSelect\s*\/>\s*<\/Navbar\.Item>[ \t]*\r?\n?/g, ""), a = a.replace(/[ \t]*<LanguageSelect\s*\/>[ \t]*\r?\n?/g, ""), C.writeFileSync(t, a, "utf8"), {
|
|
278
|
+
status: "success",
|
|
279
|
+
changed: a !== n
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region src/patterns/disable/i18n/generate.runtime.ts
|
|
284
|
+
async function X(e) {
|
|
285
|
+
let t = n(e), r = [], i = [], a = (e) => {
|
|
286
|
+
e && r.push(e);
|
|
287
|
+
};
|
|
288
|
+
t.info("Reverting vite.config");
|
|
289
|
+
let o = g(e.root, y) ?? w.join(e.root, y[0]);
|
|
290
|
+
a(f(o, k(o))), t.info("Removing #locales from package.json imports");
|
|
291
|
+
let s = b(e.root, Object.keys(x), x);
|
|
292
|
+
a(f(s.filePath, s.outcome)), t.info("Reverting the legacy $locales alias");
|
|
293
|
+
let c = j(e.root);
|
|
294
|
+
a(f(c.filePath, c.outcome)), t.info("Reverting hooks.server.ts");
|
|
295
|
+
let l = w.join(e.root, "src", "hooks.server.ts"), u = p(l, I(l));
|
|
296
|
+
a(u.modify), u.delete && i.push(u.delete), t.info("Reverting hooks.ts");
|
|
297
|
+
let d = w.join(e.root, "src", "hooks.ts"), m = p(d, H(d));
|
|
298
|
+
a(m.modify), m.delete && i.push(m.delete), t.info("Reverting app.html");
|
|
299
|
+
let h = w.join(e.root, "src", "app.html");
|
|
300
|
+
a(f(h, U(h))), t.info("Reverting root +layout.ts");
|
|
301
|
+
let _ = w.join(e.root, "src", "routes", "+layout.ts"), v = p(_, J(_));
|
|
302
|
+
a(v.modify), v.delete && i.push(v.delete), t.info("Reverting root layout language select");
|
|
303
|
+
let S = [
|
|
304
|
+
w.join(e.root, "src", "routes", "(public)", "root-layout.svelte"),
|
|
305
|
+
w.join(e.root, "src", "routes", "root-layout.svelte"),
|
|
306
|
+
w.join(e.root, "src", "routes", "(public)", "+layout.svelte"),
|
|
307
|
+
w.join(e.root, "src", "routes", "+layout.svelte")
|
|
308
|
+
];
|
|
309
|
+
for (let e of S) C.existsSync(e) && a(f(e, Y(e)));
|
|
310
|
+
t.info("Reverting .gitignore");
|
|
311
|
+
let T = w.join(e.root, ".gitignore");
|
|
312
|
+
return a(f(T, O(T))), {
|
|
313
|
+
creates: [],
|
|
314
|
+
modifies: r,
|
|
315
|
+
deletes: i,
|
|
316
|
+
components: [],
|
|
317
|
+
packages: [],
|
|
318
|
+
collections: [],
|
|
319
|
+
collectionPatches: [],
|
|
320
|
+
collectionDrops: []
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
//#endregion
|
|
324
|
+
export { X as generate };
|
|
325
|
+
|
|
326
|
+
//# sourceMappingURL=generate.runtime-CYagyR5c.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.runtime-CYagyR5c.js","names":[],"sources":["../../src/patterns/disable/i18n/modifies/gitignore.ts","../../src/patterns/disable/i18n/modifies/vite-config.ts","../../src/patterns/disable/i18n/modifies/locales-alias.ts","../../src/patterns/disable/i18n/modifies/locales-module.ts","../../src/patterns/disable/i18n/modifies/hooks.server.ts","../../src/patterns/disable/i18n/modifies/hooks.ts","../../src/patterns/disable/i18n/modifies/app-html.ts","../../src/patterns/disable/i18n/modifies/+layout.ts","../../src/patterns/disable/i18n/modifies/root-layout.svelte.ts","../../src/patterns/disable/i18n/generate.runtime.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\nexport function unmodifyGitignore(gitignorePath: string): ModifyOutcome {\n if (!fs.existsSync(gitignorePath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(gitignorePath, \"utf8\");\n if (!original.includes(\"src/locales/.wuchale\")) {\n return { status: \"success\", changed: false };\n }\n\n const lines = original.split(\"\\n\");\n const out: string[] = [];\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n if (line === \"# Wuchale\") {\n let j = i + 1;\n let hasWuchale = false;\n while (j < lines.length && lines[j].trim() !== \"\") {\n if (lines[j] === \"src/locales/.wuchale\") {\n hasWuchale = true;\n }\n j++;\n }\n if (hasWuchale) {\n i = j;\n continue;\n }\n }\n if (line === \"src/locales/.wuchale\") continue;\n out.push(line);\n }\n\n let updated = out.join(\"\\n\");\n updated = updated.replace(/\\n{3,}/g, \"\\n\\n\");\n\n if (updated === original) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(gitignorePath, updated);\n return { status: \"success\", changed: true };\n}\n","import fs from \"node:fs\";\nimport { Project, QuoteKind, SyntaxKind } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport {\n removeImportByModuleSpecifier,\n formatLikeSource,\n} from \"../../../../runtime/ts-morph-helpers\";\n\n/** Remove `wuchale()` from the Vite plugins and its import. */\nexport function unmodifyViteConfig(viteConfigPath: string): ModifyOutcome {\n if (!fs.existsSync(viteConfigPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(viteConfigPath, \"utf8\");\n if (!original.includes(\"wuchale\")) {\n return { status: \"success\", changed: false };\n }\n\n const project = new Project({\n compilerOptions: { allowJs: true },\n manipulationSettings: { quoteKind: QuoteKind.Single },\n });\n const sourceFile = project.addSourceFileAtPath(viteConfigPath);\n\n // One removal at a time: manipulating the tree invalidates sibling nodes.\n for (;;) {\n let removed = false;\n for (const arr of sourceFile.getDescendantsOfKind(\n SyntaxKind.ArrayLiteralExpression,\n )) {\n const index = arr\n .getElements()\n .findIndex((el) => el.getText().replace(/\\s/g, \"\") === \"wuchale()\");\n if (index >= 0) {\n arr.removeElement(index);\n removed = true;\n break;\n }\n }\n if (!removed) break;\n }\n\n removeImportByModuleSpecifier(sourceFile, \"wuchale/vite\");\n\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== original,\n };\n}\n","import { SyntaxKind } from \"ts-morph\";\nimport {\n resolveConfigTarget,\n saveTarget,\n type ConfigModifyResult,\n} from \"../../../../runtime/config-target\";\n\nconst HINTS = {\n notFound: \"No SvelteKit config to revert.\",\n failed:\n \"Remove the $locales alias from the sveltekit() arg in vite.config by hand.\",\n};\n\n/**\n * Remove the `$locales` alias enable-i18n wrote before SvelteKit 3, which\n * `sv migrate sveltekit-3` moves into the inline `sveltekit({...})` arg;\n * `alias` goes too once it is empty. Projects enabled since then map\n * `#locales/*` in package.json `imports` instead.\n */\nexport function unmodifyLocalesAlias(root: string): ConfigModifyResult {\n const res = resolveConfigTarget(root, HINTS);\n // Nothing to revert in a project without a config.\n if (res.status === \"not-found\") {\n return {\n filePath: res.filePath,\n outcome: { status: \"success\", changed: false },\n };\n }\n if (res.status === \"failed\") {\n return {\n filePath: res.filePath,\n outcome: { status: \"failed\", message: res.message },\n };\n }\n\n const { target } = res;\n const aliasProp = target.configObject\n .getProperty(\"alias\")\n ?.asKind(SyntaxKind.PropertyAssignment);\n const aliasObj = aliasProp\n ?.getInitializer()\n ?.asKind(SyntaxKind.ObjectLiteralExpression);\n const locales = aliasObj\n ?.getProperties()\n .find((p) => p.getText().replace(/['\"]/g, \"\").startsWith(\"$locales\"));\n if (aliasProp && aliasObj && locales) {\n locales.remove();\n if (aliasObj.getProperties().length === 0) aliasProp.remove();\n }\n return { filePath: target.filePath, outcome: saveTarget(target) };\n}\n","/**\n * Matches an import of wuchale's `src/locales/<name>.js` the way enable-i18n\n * writes it (`#locales/main.url.js`), and the `$locales/main.url` alias form\n * it wrote before SvelteKit 3, so disabling works on either.\n */\nexport function localesModule(name: string): (specifier: string) => boolean {\n const escaped = name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const pattern = new RegExp(`^[$#]locales/${escaped}(\\\\.js)?$`);\n return (specifier) => pattern.test(specifier);\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport { Project, QuoteKind, SyntaxKind } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport { removeHandle } from \"../../../../runtime/compose-handle\";\nimport {\n ensureBlankLineAfterImports,\n removeImportByModuleSpecifier,\n removeNamedImportIfUnused,\n removeTopLevelStatementByIdentifier,\n formatLikeSource,\n} from \"../../../../runtime/ts-morph-helpers\";\nimport { localesModule } from \"./locales-module\";\n\nconst I18N_HANDLE = \"handleWuchale\";\nconst FAILURE_HINT = dedent`\n Take handleWuchale out of the exported handle in src/hooks.server.ts, then\n remove its declaration, the loadLocales(...) calls and the wuchale and\n #locales imports.\n`;\n\nconst I18N_MODULES = [\n \"wuchale/load-utils/server\",\n localesModule(\"main.url\"),\n localesModule(\"data\"),\n localesModule(\"main.loader.server.svelte\"),\n localesModule(\"js.loader.server\"),\n];\n\n/**\n * Undo `modifyHooksServerI18n`: drop the locale bootstrap, the wuchale handle\n * and its imports, and unwrap `sequence(handleWuchale, ...)`. A file that\n * enable-i18n created comes out empty, for the caller to delete.\n */\nexport function unmodifyHooksServerI18n(\n hooksServerPath: string,\n): ModifyOutcome {\n if (!fs.existsSync(hooksServerPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(hooksServerPath, \"utf8\");\n if (!original.includes(I18N_HANDLE) && !original.includes(\"loadLocales(\")) {\n return { status: \"success\", changed: false };\n }\n\n const project = new Project({\n compilerOptions: { allowJs: true },\n manipulationSettings: { quoteKind: QuoteKind.Single },\n });\n const sourceFile = project.addSourceFileAtPath(hooksServerPath);\n\n // loadLocales(...) bootstrap calls, one at a time (removal invalidates siblings).\n for (;;) {\n const stmt = sourceFile\n .getStatements()\n .find(\n (s) =>\n s.getKind() === SyntaxKind.ExpressionStatement &&\n /^loadLocales\\s*\\(/.test(s.getText()),\n );\n if (!stmt) break;\n stmt.remove();\n }\n\n // `export const handle = handleWuchale` goes altogether; a sequence loses\n // the argument, or unwraps to the handle it composed with.\n const removed = removeHandle(sourceFile, I18N_HANDLE);\n if (removed.status === \"unsupported\") {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n\n removeTopLevelStatementByIdentifier(sourceFile, I18N_HANDLE);\n for (const moduleSpecifier of I18N_MODULES) {\n removeImportByModuleSpecifier(sourceFile, moduleSpecifier);\n }\n removeNamedImportIfUnused(sourceFile, \"@sveltejs/kit/hooks\", \"sequence\");\n removeNamedImportIfUnused(sourceFile, \"@sveltejs/kit/hooks\", \"Handle\");\n // A project from before SvelteKit 3 imports it from the package root.\n removeNamedImportIfUnused(sourceFile, \"@sveltejs/kit\", \"Handle\");\n\n formatLikeSource(sourceFile);\n ensureBlankLineAfterImports(sourceFile);\n sourceFile.saveSync();\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== original,\n };\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport { Project, QuoteKind, SyntaxKind } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport {\n ensureBlankLineAfterImports,\n isEffectivelyEmpty,\n pruneUnusedImports,\n removeTopLevelStatementByIdentifier,\n formatLikeSource,\n} from \"../../../../runtime/ts-morph-helpers\";\nimport { localesModule } from \"./locales-module\";\n\nconst DELOCALIZE_HELPER = \"rerouteDeLocalize\";\n\nconst FAILURE_HINT = dedent`\n Take rerouteDeLocalize out of the exported reroute in src/hooks.ts, then\n remove its declaration and the wuchale and #locales imports.\n`;\n\nconst I18N_MODULES = [\n \"wuchale/url\",\n localesModule(\"main.url\"),\n localesModule(\"data\"),\n];\n\n/** The two reroutes `modifyHooksI18n` writes: on its own, and composed. */\nconst I18N_ONLY_REROUTE =\n /^\\(\\s*\\{\\s*url\\s*\\}\\s*\\)\\s*=>\\s*rerouteDeLocalize\\(\\s*url\\.pathname\\s*\\)$/;\nconst COMPOSED_REROUTE =\n /^\\(\\s*\\{\\s*url\\s*\\}\\s*\\)\\s*=>\\s*rerouteDeLocalize\\(\\s*negotiateReroute\\(\\s*url\\.pathname\\s*\\)\\s*\\)$/;\n\n/**\n * Undo `modifyHooksI18n`: drop the de-localizer and its imports, leaving the\n * negotiation reroute it may have been composed with. A file that enable-i18n\n * created comes out empty, for the caller to delete.\n */\nexport function unmodifyHooksI18n(hooksPath: string): ModifyOutcome {\n if (!fs.existsSync(hooksPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(hooksPath, \"utf8\");\n if (!original.includes(DELOCALIZE_HELPER)) {\n return { status: \"success\", changed: false };\n }\n\n const project = new Project({\n compilerOptions: { allowJs: true },\n manipulationSettings: { quoteKind: QuoteKind.Single },\n });\n const sourceFile = project.addSourceFileAtPath(hooksPath);\n\n const helperStatement = sourceFile\n .getVariableDeclaration(DELOCALIZE_HELPER)\n ?.getFirstAncestorByKind(SyntaxKind.VariableStatement);\n\n const rerouteDecl = sourceFile.getVariableDeclaration(\"reroute\");\n const initText = rerouteDecl?.getInitializer()?.getText() ?? \"\";\n const composed = COMPOSED_REROUTE.test(initText);\n const rerouteStatement =\n composed || I18N_ONLY_REROUTE.test(initText)\n ? rerouteDecl?.getFirstAncestorByKind(SyntaxKind.VariableStatement)\n : undefined;\n\n // Anything else reading the de-localizer is code enable-i18n did not write,\n // so undoing it is the developer's call.\n const otherReaders = sourceFile\n .getStatements()\n .filter(\n (s) =>\n s !== helperStatement &&\n s !== rerouteStatement &&\n s.getText().includes(DELOCALIZE_HELPER),\n );\n if (otherReaders.length > 0) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n\n if (composed) {\n // content-negotiation's reroute is underneath; it stays.\n rerouteDecl?.setInitializer(\"({ url }) => negotiateReroute(url.pathname)\");\n } else if (rerouteStatement) {\n removeTopLevelStatementByIdentifier(sourceFile, \"reroute\");\n }\n\n removeTopLevelStatementByIdentifier(sourceFile, DELOCALIZE_HELPER);\n pruneUnusedImports(sourceFile, I18N_MODULES);\n\n if (isEffectivelyEmpty(sourceFile)) {\n // Emptied rather than removed: the runtime turns an empty hooks.ts into a\n // delete entry, so the removal is written and reported like any other.\n fs.writeFileSync(hooksPath, \"\", \"utf8\");\n return { status: \"success\", changed: true };\n }\n\n formatLikeSource(sourceFile);\n ensureBlankLineAfterImports(sourceFile);\n sourceFile.saveSync();\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== original,\n };\n}\n","import fs from \"node:fs\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\n/**\n * Put a real language back. `%sveltekit.lang%` is not a SvelteKit\n * placeholder; only the wuchale hook replaced it, so without that hook it\n * would be served literally.\n */\nexport function unmodifyAppHtml(appHtmlPath: string): ModifyOutcome {\n if (!fs.existsSync(appHtmlPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(appHtmlPath, \"utf8\");\n const updated = original.replace(\n /lang\\s*=\\s*(?:\"%sveltekit\\.lang%\"|'%sveltekit\\.lang%')/g,\n 'lang=\"en\"',\n );\n if (updated === original) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(appHtmlPath, updated, \"utf8\");\n return { status: \"success\", changed: true };\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport { Project, QuoteKind, type Statement } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport { LOAD_STATEMENT } from \"../../../enable/i18n/modifies/+layout\";\nimport {\n ensureBlankLineAfterImports,\n isEffectivelyEmpty,\n pruneUnusedImports,\n removeImportByModuleSpecifier,\n removeStatementWithComments,\n formatLikeSource,\n type ModuleMatch,\n} from \"../../../../runtime/ts-morph-helpers\";\nimport { localesModule } from \"./locales-module\";\n\nconst FAILURE_HINT = dedent`\n src/routes/+layout.ts still loads wuchale locales. Remove these from it:\n\n import { browser } from '$app/env';\n import { loadLocale } from 'wuchale/load-utils';\n import { getLocale } from '#locales/main.url.js';\n import '#locales/main.loader.svelte.js';\n import '#locales/js.loader.js';\n\n and the loadLocale(...) call inside load().\n`;\n\nconst SIDE_EFFECT_MODULES = [\n localesModule(\"main.loader.svelte\"),\n localesModule(\"js.loader\"),\n];\nconst BINDING_MODULES: ModuleMatch[] = [\n // `$app/env`, or the module it replaced before SvelteKit 3.\n (specifier) => /^\\$app\\/env(ironment)?$/.test(specifier),\n \"wuchale/load-utils\",\n localesModule(\"main.url\"),\n];\n\nfunction normalize(source: string): string {\n return source.replace(/[\"']/g, \"'\").replace(/\\s+/g, \"\");\n}\n\n/**\n * Undo `ensureRootLayoutI18n`: drop the wuchale load and its imports, leaving\n * whatever else the file holds. A file enable-i18n wrote whole comes out\n * empty, for the caller to delete.\n */\nexport function unmodifyRootLayoutI18n(layoutPath: string): ModifyOutcome {\n if (!fs.existsSync(layoutPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(layoutPath, \"utf8\");\n if (!original.includes(\"loadLocale\") && !/[$#]locales\\//.test(original)) {\n return { status: \"success\", changed: false };\n }\n\n const project = new Project({\n compilerOptions: { allowJs: true },\n manipulationSettings: { quoteKind: QuoteKind.Single },\n });\n const sourceFile = project.addSourceFileAtPath(layoutPath);\n\n const loadStatement: Statement | undefined =\n sourceFile\n .getVariableStatements()\n .find((s) => s.getDeclarations().some((d) => d.getName() === \"load\")) ??\n sourceFile.getFunction(\"load\");\n\n if (loadStatement) {\n // A load that grew code of its own needs a hand; only the one enable-i18n\n // wrote is safe to take out wholesale.\n if (normalize(loadStatement.getText()) !== normalize(LOAD_STATEMENT)) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n removeStatementWithComments(sourceFile, loadStatement);\n }\n\n for (const moduleSpecifier of SIDE_EFFECT_MODULES) {\n removeImportByModuleSpecifier(sourceFile, moduleSpecifier);\n }\n pruneUnusedImports(sourceFile, BINDING_MODULES);\n\n if (isEffectivelyEmpty(sourceFile)) {\n // Emptied rather than removed: the runtime turns an empty +layout.ts into\n // a delete entry, so the removal is written and reported like any other.\n fs.writeFileSync(layoutPath, \"\", \"utf8\");\n return { status: \"success\", changed: true };\n }\n\n formatLikeSource(sourceFile);\n ensureBlankLineAfterImports(sourceFile);\n sourceFile.saveSync();\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== original,\n };\n}\n","import fs from \"node:fs\";\nimport { SvelteFile } from \"../../../../runtime/svelte-file\";\nimport {\n ensureBlankLineAfterImports,\n removeImportByModuleSpecifier,\n withInMemoryScript,\n} from \"../../../../runtime/ts-morph-helpers\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport { libModule } from \"../../../../runtime/lib-specifier\";\n\n/** Take the language select (and the nav item enable-i18n wrapped it in) back out. */\nexport function unmodifyRootLayoutLanguageSelect(\n layoutPath: string,\n): ModifyOutcome {\n if (!fs.existsSync(layoutPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(layoutPath, \"utf8\");\n if (!original.includes(\"LanguageSelect\")) {\n return { status: \"success\", changed: false };\n }\n\n const file = SvelteFile.fromPath(layoutPath);\n file.modifyScript((source) => {\n const { source: out } = withInMemoryScript(source, (sf) => {\n removeImportByModuleSpecifier(\n sf,\n libModule(\"components/language-select.svelte\"),\n );\n ensureBlankLineAfterImports(sf);\n });\n return out;\n });\n\n let updated = file.toString();\n updated = updated.replace(\n /[ \\t]*<Navbar\\.Item>\\s*<LanguageSelect\\s*\\/>\\s*<\\/Navbar\\.Item>[ \\t]*\\r?\\n?/g,\n \"\",\n );\n updated = updated.replace(/[ \\t]*<LanguageSelect\\s*\\/>[ \\t]*\\r?\\n?/g, \"\");\n\n fs.writeFileSync(layoutPath, updated, \"utf8\");\n return { status: \"success\", changed: updated !== original };\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { File, Options, Result } from \"../../../core/types\";\nimport { getLogger } from \"../../../core/logger\";\nimport {\n modifyOutcomeToFile,\n revertOutcomeToFile,\n} from \"../../../runtime/modify-file\";\nimport {\n probeFirstExisting,\n VITE_CONFIG_CANDIDATES,\n} from \"../../../runtime/config-target\";\nimport { unmodifyGitignore } from \"./modifies/gitignore\";\nimport { unmodifyViteConfig } from \"./modifies/vite-config\";\nimport { unmodifyLocalesAlias } from \"./modifies/locales-alias\";\nimport { removePackageImports } from \"../../../runtime/package-imports\";\nimport { LOCALES_IMPORTS } from \"../../enable/i18n/modifies/package-imports\";\nimport { unmodifyHooksServerI18n } from \"./modifies/hooks.server\";\nimport { unmodifyHooksI18n } from \"./modifies/hooks\";\nimport { unmodifyAppHtml } from \"./modifies/app-html\";\nimport { unmodifyRootLayoutI18n } from \"./modifies/+layout\";\nimport { unmodifyRootLayoutLanguageSelect } from \"./modifies/root-layout.svelte\";\n\nexport async function generate(options: Options) {\n const logger = getLogger(options);\n const modifies: File[] = [];\n const deletes: File[] = [];\n const pushResult = (file: File | null) => {\n if (file) modifies.push(file);\n };\n\n logger.info(\"Reverting vite.config\");\n const viteConfigPath =\n probeFirstExisting(options.root, VITE_CONFIG_CANDIDATES) ??\n path.join(options.root, VITE_CONFIG_CANDIDATES[0]);\n pushResult(\n modifyOutcomeToFile(viteConfigPath, unmodifyViteConfig(viteConfigPath)),\n );\n\n logger.info(\"Removing #locales from package.json imports\");\n // Only while it still maps where enable-i18n pointed it.\n const imports = removePackageImports(\n options.root,\n Object.keys(LOCALES_IMPORTS),\n LOCALES_IMPORTS,\n );\n pushResult(modifyOutcomeToFile(imports.filePath, imports.outcome));\n\n // A project enabled before SvelteKit 3 has the `$locales` alias instead,\n // moved into the sveltekit() arg by `vela migrate sveltekit-3`.\n logger.info(\"Reverting the legacy $locales alias\");\n const alias = unmodifyLocalesAlias(options.root);\n pushResult(modifyOutcomeToFile(alias.filePath, alias.outcome));\n\n logger.info(\"Reverting hooks.server.ts\");\n const hooksServerPath = path.join(options.root, \"src\", \"hooks.server.ts\");\n // enable-i18n may have created it; emptied, it goes.\n const hooksServerRevert = revertOutcomeToFile(\n hooksServerPath,\n unmodifyHooksServerI18n(hooksServerPath),\n );\n pushResult(hooksServerRevert.modify);\n if (hooksServerRevert.delete) deletes.push(hooksServerRevert.delete);\n\n logger.info(\"Reverting hooks.ts\");\n const hooksPath = path.join(options.root, \"src\", \"hooks.ts\");\n // The de-localizing reroute may be all it holds; emptied, it goes.\n const hooksRevert = revertOutcomeToFile(\n hooksPath,\n unmodifyHooksI18n(hooksPath),\n );\n pushResult(hooksRevert.modify);\n if (hooksRevert.delete) deletes.push(hooksRevert.delete);\n\n logger.info(\"Reverting app.html\");\n const appHtmlPath = path.join(options.root, \"src\", \"app.html\");\n pushResult(modifyOutcomeToFile(appHtmlPath, unmodifyAppHtml(appHtmlPath)));\n\n logger.info(\"Reverting root +layout.ts\");\n const layoutPath = path.join(options.root, \"src\", \"routes\", \"+layout.ts\");\n // enable-i18n may have written the whole file; emptied, it goes.\n const layoutRevert = revertOutcomeToFile(\n layoutPath,\n unmodifyRootLayoutI18n(layoutPath),\n );\n pushResult(layoutRevert.modify);\n if (layoutRevert.delete) deletes.push(layoutRevert.delete);\n\n logger.info(\"Reverting root layout language select\");\n const rootLayoutCandidates = [\n path.join(options.root, \"src\", \"routes\", \"(public)\", \"root-layout.svelte\"),\n path.join(options.root, \"src\", \"routes\", \"root-layout.svelte\"),\n path.join(options.root, \"src\", \"routes\", \"(public)\", \"+layout.svelte\"),\n path.join(options.root, \"src\", \"routes\", \"+layout.svelte\"),\n ];\n for (const candidate of rootLayoutCandidates) {\n if (!fs.existsSync(candidate)) continue;\n pushResult(\n modifyOutcomeToFile(\n candidate,\n unmodifyRootLayoutLanguageSelect(candidate),\n ),\n );\n }\n\n logger.info(\"Reverting .gitignore\");\n const gitignorePath = path.join(options.root, \".gitignore\");\n pushResult(\n modifyOutcomeToFile(gitignorePath, unmodifyGitignore(gitignorePath)),\n );\n\n return {\n creates: [],\n modifies,\n deletes,\n components: [],\n packages: [],\n collections: [],\n collectionPatches: [],\n collectionDrops: [],\n } satisfies Result;\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,SAAgB,EAAkB,GAAsC;CACtE,IAAI,CAAC,EAAG,WAAW,CAAa,GAC9B,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAG7C,IAAM,IAAW,EAAG,aAAa,GAAe,MAAM;CACtD,IAAI,CAAC,EAAS,SAAS,sBAAsB,GAC3C,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAG7C,IAAM,IAAQ,EAAS,MAAM,IAAI,GAC3B,IAAgB,CAAC;CACvB,KAAK,IAAI,IAAI,GAAG,IAAI,EAAM,QAAQ,KAAK;EACrC,IAAM,IAAO,EAAM;EACnB,IAAI,MAAS,aAAa;GACxB,IAAI,IAAI,IAAI,GACR,IAAa;GACjB,OAAO,IAAI,EAAM,UAAU,EAAM,EAAE,CAAC,KAAK,MAAM,KAI7C,AAHI,EAAM,OAAO,2BACf,IAAa,KAEf;GAEF,IAAI,GAAY;IACd,IAAI;IACJ;GACF;EACF;EACI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|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as e } from "./logger-CQONztPm.js";
|
|
2
|
-
import { t } from "./shared-
|
|
3
|
-
import { f as n, o as r } from "./ts-morph-helpers-
|
|
4
|
-
import { modifyOutcomeToFile as i } from "./modify-file-
|
|
2
|
+
import { t } from "./shared-CZC4d7Uj.js";
|
|
3
|
+
import { f as n, o as r } from "./ts-morph-helpers-CDW4lhox.js";
|
|
4
|
+
import { modifyOutcomeToFile as i } from "./modify-file-BlDeeurK.js";
|
|
5
5
|
import { t as a } from "./svelte-file-B3RfgVdt.js";
|
|
6
6
|
import o from "node:fs";
|
|
7
7
|
import s from "node:path";
|
|
@@ -91,4 +91,4 @@ async function f(n) {
|
|
|
91
91
|
//#endregion
|
|
92
92
|
export { f as generate };
|
|
93
93
|
|
|
94
|
-
//# sourceMappingURL=generate.runtime-
|
|
94
|
+
//# sourceMappingURL=generate.runtime-Ce_rwzNa.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.runtime-
|
|
1
|
+
{"version":3,"file":"generate.runtime-Ce_rwzNa.js","names":[],"sources":["../../src/patterns/disable/api-keys/modifies/hooks.server.ts","../../src/patterns/disable/api-keys/modifies/nav-user.svelte.ts","../../src/patterns/disable/api-keys/generate.runtime.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport { Project, SyntaxKind } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport { formatLikeSource } from \"../../../../runtime/ts-morph-helpers\";\n\nexport function unmodifyHooksServer(hooksServerPath: string): ModifyOutcome {\n if (!fs.existsSync(hooksServerPath)) {\n return { status: \"success\", changed: false };\n }\n\n const originalSource = fs.readFileSync(hooksServerPath, \"utf8\");\n const project = new Project();\n const sourceFile = project.addSourceFileAtPath(hooksServerPath);\n\n const callExpr = sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .find((ce) => ce.getExpression().getText() === \"handlePocketbase\");\n if (!callExpr) return { status: \"success\", changed: false };\n\n const [firstArg] = callExpr.getArguments();\n if (!firstArg || firstArg.getKind() !== SyntaxKind.ObjectLiteralExpression) {\n return { status: \"success\", changed: false };\n }\n\n const optionsObj = firstArg.asKindOrThrow(SyntaxKind.ObjectLiteralExpression);\n const apiProp = optionsObj.getProperty(\"api\");\n if (!apiProp || apiProp.getKind() !== SyntaxKind.PropertyAssignment) {\n return { status: \"success\", changed: false };\n }\n\n const apiInit = (\n apiProp as import(\"ts-morph\").PropertyAssignment\n ).getInitializer();\n if (!apiInit || apiInit.getKind() !== SyntaxKind.ObjectLiteralExpression) {\n return { status: \"success\", changed: false };\n }\n\n const apiObj = apiInit as import(\"ts-morph\").ObjectLiteralExpression;\n const apiKeysProp = apiObj.getProperty(\"apiKeys\");\n if (!apiKeysProp) {\n return { status: \"success\", changed: false };\n }\n\n apiKeysProp.remove();\n\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== originalSource,\n };\n}\n","import fs from \"node:fs\";\nimport { SvelteFile } from \"../../../../runtime/svelte-file\";\nimport { removeNavItemFromScript } from \"../../../../runtime/ts-morph-helpers\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\nexport function unmodifyNavUser(navUserPath: string): ModifyOutcome {\n if (!fs.existsSync(navUserPath)) {\n return { status: \"success\", changed: false };\n }\n\n const source = fs.readFileSync(navUserPath, \"utf8\");\n if (!source.includes(\"/api-keys\")) {\n return { status: \"success\", changed: false };\n }\n\n const file = new SvelteFile(source);\n let wasRemoved = false;\n\n const tryRemove = (run: (fn: (s: string) => string) => boolean) => {\n if (wasRemoved) return;\n run((src) => {\n const result = removeNavItemFromScript(\n src,\n \"API Keys\",\n \"@lucide/svelte/icons/key-round\",\n );\n if (result.wasRemoved) wasRemoved = true;\n return result.source;\n });\n };\n\n tryRemove((fn) => file.modifyModuleScript(fn));\n if (!wasRemoved) tryRemove((fn) => file.modifyScript(fn));\n\n if (!wasRemoved) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(navUserPath, file.toString(), \"utf8\");\n return { status: \"success\", changed: true };\n}\n","import path from \"node:path\";\nimport type { File, Options, Result } from \"../../../core/types\";\nimport { getLogger } from \"../../../core/logger\";\nimport { modifyOutcomeToFile } from \"../../../runtime/modify-file\";\nimport { unmodifyHooksServer } from \"./modifies/hooks.server\";\nimport { unmodifyNavUser } from \"./modifies/nav-user.svelte\";\nimport { planDropsForCollections } from \"../../destroy/shared\";\n\nexport async function generate(options: Options) {\n const logger = getLogger(options);\n const modifies: File[] = [];\n const pushResult = (file: File | null) => {\n if (file) modifies.push(file);\n };\n\n logger.info(\"Reverting hooks.server.ts\");\n const hooksServerPath = path.join(options.root, \"src\", \"hooks.server.ts\");\n pushResult(\n modifyOutcomeToFile(hooksServerPath, unmodifyHooksServer(hooksServerPath)),\n );\n\n logger.info(\"Reverting nav-user.svelte\");\n const navUserPath = path.join(\n options.root,\n \"src\",\n \"lib\",\n \"components\",\n \"nav-user.svelte\",\n );\n pushResult(modifyOutcomeToFile(navUserPath, unmodifyNavUser(navUserPath)));\n\n const collectionDrops = await planDropsForCollections([\"api_keys\"], options);\n\n return {\n creates: [],\n modifies,\n deletes: [],\n components: [],\n packages: [],\n collections: [],\n collectionPatches: [],\n collectionDrops,\n } satisfies Result;\n}\n"],"mappings":";;;;;;;;;AAKA,SAAgB,EAAoB,GAAwC;CAC1E,IAAI,CAAC,EAAG,WAAW,CAAe,GAChC,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAG7C,IAAM,IAAiB,EAAG,aAAa,GAAiB,MAAM,GAExD,IAAa,IADC,EACD,CAAA,CAAQ,oBAAoB,CAAe,GAExD,IAAW,EACd,qBAAqB,EAAW,cAAc,CAAC,CAC/C,MAAM,MAAO,EAAG,cAAc,CAAC,CAAC,QAAQ,MAAM,kBAAkB;CACnE,IAAI,CAAC,GAAU,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAE1D,IAAM,CAAC,KAAY,EAA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AAQ;EAAW,SAAS;CAAM;AAK/C;;;AChCA,eAAsB,EAAS,GAAkB;CAC/C,IAAM,IAAS,EAAU,CAAO,GAC1B,IAAmB,CAAC,GACpB,KAAc,MAAsB;EACxC,AAAI,KAAM,EAAS,KAAK,CAAI;CAC9B;CAEA,EAAO,KAAK,2BAA2B;CACvC,IAAM,IAAkB,EAAK,KAAK,EAAQ,MAAM,OAAO,iBAAiB;CAKxE,AAJA,EACE,EAAoB,GAAiB,EAAoB,CAAe,CAAC,CAC3E,GAEA,EAAO,KAAK,2BAA2B;CACvC,IAAM,IAAc,EAAK,KACvB,EAAQ,MACR,OACA,OACA,cACA,iBACF;CAKA,OAJA,EAAW,EAAoB,GAAa,EAAgB,CAAW,CAAC,CAAC,GAIlE;EACL,SAAS,CAAC;EACV;EACA,SAAS,CAAC;EACV,YAAY,CAAC;EACb,UAAU,CAAC;EACX,aAAa,CAAC;EACd,mBAAmB,CAAC;EACpB,iBAAA,MAV4B,EAAwB,CAAC,UAAU,GAAG,CAAO;CAW3E;AACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./dedent-Gq6Krl4n.js";
|
|
2
2
|
import { n as t } from "./logger-CQONztPm.js";
|
|
3
|
-
import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./dispatch-
|
|
4
|
-
import { _ as l, o as u, r as d } from "./ts-morph-helpers-
|
|
5
|
-
import { modifyOutcomeToFile as f } from "./modify-file-
|
|
3
|
+
import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./dispatch-CXOXPLFk.js";
|
|
4
|
+
import { _ as l, o as u, r as d } from "./ts-morph-helpers-CDW4lhox.js";
|
|
5
|
+
import { modifyOutcomeToFile as f } from "./modify-file-BlDeeurK.js";
|
|
6
6
|
import { t as p } from "./svelte-file-B3RfgVdt.js";
|
|
7
7
|
import m from "node:fs";
|
|
8
8
|
import h from "node:path";
|
|
@@ -266,4 +266,4 @@ async function B(e) {
|
|
|
266
266
|
//#endregion
|
|
267
267
|
export { B as generate };
|
|
268
268
|
|
|
269
|
-
//# sourceMappingURL=generate.runtime-
|
|
269
|
+
//# sourceMappingURL=generate.runtime-CexC1Oky.js.map
|