@velastack/patterns 0.13.1 → 0.13.3
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/chunks/app-d-ts-h33RrYIv.js +198 -0
- package/dist/chunks/app-d-ts-h33RrYIv.js.map +1 -0
- package/dist/chunks/app-layout.svelte-CZ0hw-pi.js +51 -0
- package/dist/chunks/app-layout.svelte-CZ0hw-pi.js.map +1 -0
- package/dist/chunks/{generate.runtime-DHJqOJTr.js → generate.runtime-Bv_16lWi.js} +2 -2
- package/dist/chunks/{generate.runtime-DHJqOJTr.js.map → generate.runtime-Bv_16lWi.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DvTbN-no.js → generate.runtime-CZKIKP3B.js} +213 -175
- package/dist/chunks/generate.runtime-CZKIKP3B.js.map +1 -0
- package/dist/chunks/{generate.runtime-BEmSIAop.js → generate.runtime-C_SdcnRs.js} +2 -2
- package/dist/chunks/{generate.runtime-BEmSIAop.js.map → generate.runtime-C_SdcnRs.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DGnXHELM.js → generate.runtime-CsP4c8GY.js} +78 -77
- package/dist/chunks/generate.runtime-CsP4c8GY.js.map +1 -0
- package/dist/chunks/{generate.runtime-DWHoDisZ.js → generate.runtime-CzYArKUA.js} +2 -2
- package/dist/chunks/{generate.runtime-DWHoDisZ.js.map → generate.runtime-CzYArKUA.js.map} +1 -1
- package/dist/chunks/generate.runtime-DZUPtJVF.js +429 -0
- package/dist/chunks/generate.runtime-DZUPtJVF.js.map +1 -0
- package/dist/chunks/{generate.runtime-Cgam_XCc.js → generate.runtime-DaPA2NNL.js} +2 -2
- package/dist/chunks/{generate.runtime-Cgam_XCc.js.map → generate.runtime-DaPA2NNL.js.map} +1 -1
- package/dist/chunks/{generate.runtime-i3tMIA1A.js → generate.runtime-pbIrEsa7.js} +45 -45
- package/dist/chunks/generate.runtime-pbIrEsa7.js.map +1 -0
- package/dist/chunks/i18n-BHCytiiO.js +28 -0
- package/dist/chunks/i18n-BHCytiiO.js.map +1 -0
- package/dist/chunks/test-setup-cZj1tqaf.js +176 -0
- package/dist/chunks/test-setup-cZj1tqaf.js.map +1 -0
- package/dist/chunks/translations-CiJnl574.js +189 -0
- package/dist/chunks/translations-CiJnl574.js.map +1 -0
- package/dist/chunks/{ui-Ct6YQuPw.js → ui-IkdkLwmB.js} +2 -2
- package/dist/chunks/{ui-Ct6YQuPw.js.map → ui-IkdkLwmB.js.map} +1 -1
- package/dist/chunks/write-result-C1GYInL8.js +499 -0
- package/dist/chunks/write-result-C1GYInL8.js.map +1 -0
- package/dist/index.js +735 -725
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/_layout-Dju9EYqa.js +0 -60
- package/dist/chunks/_layout-Dju9EYqa.js.map +0 -1
- package/dist/chunks/generate.runtime-DGnXHELM.js.map +0 -1
- package/dist/chunks/generate.runtime-Dtf3tF3-.js +0 -316
- package/dist/chunks/generate.runtime-Dtf3tF3-.js.map +0 -1
- package/dist/chunks/generate.runtime-DvTbN-no.js.map +0 -1
- package/dist/chunks/generate.runtime-i3tMIA1A.js.map +0 -1
- package/dist/chunks/test-setup-CbwhAJT4.js +0 -176
- package/dist/chunks/test-setup-CbwhAJT4.js.map +0 -1
- package/dist/chunks/write-result-B5KFCqxw.js +0 -487
- package/dist/chunks/write-result-B5KFCqxw.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./dedent-CCUOcPFW.js";
|
|
2
|
-
import { i as t, o as n, r } from "./ts-morph-helpers-B4KZXP44.js";
|
|
3
|
-
import { t as i } from "./package-imports-CcIIHbp5.js";
|
|
4
|
-
import a from "node:fs";
|
|
5
|
-
import o from "node:path";
|
|
6
|
-
import { Project as s, QuoteKind as c } from "ts-morph";
|
|
7
|
-
// src/patterns/enable/i18n/modifies/package-imports.ts
|
|
8
|
-
var l = { "#locales/*": "./src/locales/*" };
|
|
9
|
-
function u(e) {
|
|
10
|
-
return i(e, l);
|
|
11
|
-
}
|
|
12
|
-
// src/patterns/enable/i18n/modifies/+layout.ts
|
|
13
|
-
var d = e`
|
|
14
|
-
import { browser } from '$app/env';
|
|
15
|
-
import { loadLocale } from 'wuchale/load-utils';
|
|
16
|
-
|
|
17
|
-
import { getLocale } from '#locales/main.url.js';
|
|
18
|
-
import '#locales/main.loader.svelte.js';
|
|
19
|
-
import '#locales/js.loader.js';
|
|
20
|
-
`, f = e`
|
|
21
|
-
export const load = async ({ url, data }) => {
|
|
22
|
-
const locale = getLocale(url);
|
|
23
|
-
|
|
24
|
-
if (browser) {
|
|
25
|
-
await loadLocale(locale);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return data;
|
|
29
|
-
};
|
|
30
|
-
`, p = `${d}\n\n${f}`, m = [
|
|
31
|
-
"Merge the wuchale loader into your existing load function in +layout.ts:",
|
|
32
|
-
"",
|
|
33
|
-
p
|
|
34
|
-
].join("\n");
|
|
35
|
-
function h(e) {
|
|
36
|
-
if (!a.existsSync(e)) return a.mkdirSync(o.dirname(e), { recursive: !0 }), a.writeFileSync(e, p + "\n"), {
|
|
37
|
-
status: "success",
|
|
38
|
-
changed: !0
|
|
39
|
-
};
|
|
40
|
-
let i = a.readFileSync(e, "utf8");
|
|
41
|
-
if (i.includes("loadLocale") || i.includes("translateUrl")) return {
|
|
42
|
-
status: "success",
|
|
43
|
-
changed: !1
|
|
44
|
-
};
|
|
45
|
-
if (/\bexport\s+(const|function)\s+load\b/.test(i)) return {
|
|
46
|
-
status: "failed",
|
|
47
|
-
message: m
|
|
48
|
-
};
|
|
49
|
-
let l = new s({
|
|
50
|
-
compilerOptions: { allowJs: !0 },
|
|
51
|
-
manipulationSettings: { quoteKind: c.Single }
|
|
52
|
-
}).addSourceFileAtPath(e);
|
|
53
|
-
return t(l, "$app/env", "browser"), t(l, "wuchale/load-utils", "loadLocale"), t(l, "#locales/main.url.js", "getLocale"), r(l, [{ moduleSpecifier: "#locales/main.loader.svelte.js" }, { moduleSpecifier: "#locales/js.loader.js" }]), l.addStatements(`\n${f}\n`), n(l), l.saveSync(), {
|
|
54
|
-
status: "success",
|
|
55
|
-
changed: !0
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
export { u as i, h as n, l as r, f as t };
|
|
59
|
-
|
|
60
|
-
//# sourceMappingURL=_layout-Dju9EYqa.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_layout-Dju9EYqa.js","names":["dedent","ensureNamedImport","formatLikeSource","ensurePackageImports","fs","path","LOCALES_IMPORTS","modifyPackageImportsI18n","root","IMPORT_SNIPPET","LOAD_STATEMENT","LOAD_SNIPPET","FAILURE_HINT","ensureRootLayoutI18n","layoutPath","existing","sourceFile","Project","QuoteKind","ensureImports"],"sources":["../../src/patterns/enable/i18n/modifies/package-imports.ts","../../src/patterns/enable/i18n/modifies/+layout.ts"],"sourcesContent":["import {\n ensurePackageImports,\n type PackageJsonEditResult,\n} from \"../../../../runtime/package-imports\";\n\n/**\n * The package.json `imports` entry the app's `#locales/*.js` specifiers\n * resolve through. wuchale writes its loaders and data to `src/locales`;\n * SvelteKit 3 deprecates `alias`, so the directory is mapped the way `#lib`\n * is. wuchale's own generated imports are relative and never go through it.\n */\nexport const LOCALES_IMPORTS = { \"#locales/*\": \"./src/locales/*\" };\n\n/** Add `#locales/*` to package.json `imports`; a different value already there is reported. */\nexport function modifyPackageImportsI18n(root: string): PackageJsonEditResult {\n return ensurePackageImports(root, LOCALES_IMPORTS);\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport dedent from \"dedent\";\nimport { Project, QuoteKind } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport {\n ensureImports,\n ensureNamedImport,\n formatLikeSource,\n} from \"../../../../runtime/ts-morph-helpers\";\n\nconst IMPORT_SNIPPET = dedent`\n import { browser } from '$app/env';\n import { loadLocale } from 'wuchale/load-utils';\n\n import { getLocale } from '#locales/main.url.js';\n import '#locales/main.loader.svelte.js';\n import '#locales/js.loader.js';\n`;\n\n/** The load `disable-i18n` looks for to take it out again. */\nexport const LOAD_STATEMENT = dedent`\n export const load = async ({ url, data }) => {\n const locale = getLocale(url);\n\n if (browser) {\n await loadLocale(locale);\n }\n\n return data;\n };\n`;\n\n/** The whole file, for a project that had no root `+layout.ts`. */\nexport const LOAD_SNIPPET = `${IMPORT_SNIPPET}\\n\\n${LOAD_STATEMENT}`;\n\nconst FAILURE_HINT = [\n \"Merge the wuchale loader into your existing load function in +layout.ts:\",\n \"\",\n LOAD_SNIPPET,\n].join(\"\\n\");\n\nexport function ensureRootLayoutI18n(layoutPath: string): ModifyOutcome {\n if (!fs.existsSync(layoutPath)) {\n fs.mkdirSync(path.dirname(layoutPath), { recursive: true });\n fs.writeFileSync(layoutPath, LOAD_SNIPPET + \"\\n\");\n return { status: \"success\", changed: true };\n }\n\n const existing = fs.readFileSync(layoutPath, \"utf8\");\n if (existing.includes(\"loadLocale\") || existing.includes(\"translateUrl\")) {\n return { status: \"success\", changed: false };\n }\n\n if (/\\bexport\\s+(const|function)\\s+load\\b/.test(existing)) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n\n // No load to merge with, but the file may hold other route options\n // (`export const prerender = true`, say), so the load is added to it\n // rather than written over it.\n const project = new Project({\n compilerOptions: { allowJs: true },\n manipulationSettings: { quoteKind: QuoteKind.Single },\n });\n const sourceFile = project.addSourceFileAtPath(layoutPath);\n\n ensureNamedImport(sourceFile, \"$app/env\", \"browser\");\n ensureNamedImport(sourceFile, \"wuchale/load-utils\", \"loadLocale\");\n ensureNamedImport(sourceFile, \"#locales/main.url.js\", \"getLocale\");\n ensureImports(sourceFile, [\n { moduleSpecifier: \"#locales/main.loader.svelte.js\" },\n { moduleSpecifier: \"#locales/js.loader.js\" },\n ]);\n\n sourceFile.addStatements(`\\n${LOAD_STATEMENT}\\n`);\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n return { status: \"success\", changed: true };\n}\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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate.runtime-DGnXHELM.js","names":["FAILURE_HINT","NOT_FOUND_HINT","NOT_FOUND_HINT","getLogger","withPocketbase","getMigrationFile","modifyOutcomeToFile","ensureSiteFile","dedent","withInMemoryScript","ensurePropsBinding","formatLikeSource","ensureImports","SvelteFile","fs","path","modifyLayoutServer","layoutPath","snippet","originalSource","sourceFile","Project","addUserProp","obj","loadArrow","loadFn","varDecl","SyntaxKind","directArrow","init","innerArrow","innerFnExpr","maybeFn","fnLike","params","first","original","nameNode","obp","el","parts","tail","currentName","body","expr","ret","inner","bodyExpr","AUTH_MENU_NAVBAR_ITEM","IMPORT_SNIPPET","FAILURE_HINT$1","NOT_FOUND_HINT$2","modifyRootLayoutSvelte","file","out","source","sf","FAILURE_HINT","NOT_FOUND_HINT$1","modifyHooksServer","hooksServerPath","callExpr","ce","args","firstArg","optionsObj","authProp","authInit","authObj","prProp","prInit","arr","VARIANTS","NOT_FOUND_HINT","modifySidebarMenuButton","filePath","to","variant","from","updated","generate","options","logger","creates","pb","input","migrationDelay","userCollection","verificationTemplate","resetPasswordTemplate","confirmEmailChangeTemplate","migrationFile","modifies","pushResult","layoutServerFile","layoutCandidates","layoutFile","p","hooksServerFile","sidebarMenuButtonFile","siteFile"],"sources":["../../src/patterns/enable/auth/modifies/+layout.server.ts","../../src/patterns/enable/auth/modifies/root-layout.svelte.ts","../../src/patterns/enable/auth/modifies/hooks.server.ts","../../src/patterns/enable/auth/modifies/sidebar-menu-button.svelte.ts","../../src/patterns/enable/auth/generate.runtime.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport { Project, SyntaxKind } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport { formatLikeSource } from \"../../../../runtime/ts-morph-helpers\";\n\nexport function modifyLayoutServer(layoutPath: string): ModifyOutcome {\n if (!fs.existsSync(layoutPath)) {\n const snippet = dedent`\n\t\t\texport const load = async ({ locals }) => {\n\t\t\t\treturn { user: locals.pb.authStore.record };\n\t\t\t};\n\t\t`;\n\n fs.writeFileSync(layoutPath, snippet);\n return { status: \"success\", changed: true };\n }\n\n const originalSource = fs.readFileSync(layoutPath, \"utf8\");\n const project = new Project();\n const sourceFile = project.addSourceFileAtPath(layoutPath);\n\n // helper to add user property to an object literal if missing\n const addUserProp = (obj: import(\"ts-morph\").ObjectLiteralExpression) => {\n const hasUser = !!obj.getProperty(\"user\");\n if (!hasUser) {\n obj.addPropertyAssignment({\n name: \"user\",\n initializer: \"locals.pb.authStore.record\",\n });\n }\n };\n\n // find existing exported load (function or const with arrow)\n let loadArrow: import(\"ts-morph\").ArrowFunction | undefined;\n let loadFn:\n | import(\"ts-morph\").FunctionDeclaration\n | import(\"ts-morph\").FunctionExpression\n | undefined;\n\n const varDecl = sourceFile.getVariableDeclaration(\"load\");\n if (varDecl) {\n const vs = varDecl.getFirstAncestorByKind(SyntaxKind.VariableStatement);\n const isExported = !!vs?.hasExportKeyword();\n if (isExported) {\n const directArrow = varDecl.getInitializerIfKind(\n SyntaxKind.ArrowFunction,\n );\n if (directArrow) {\n loadArrow = directArrow;\n } else {\n const init = varDecl.getInitializer();\n if (init) {\n const innerArrow = init.getFirstDescendantByKind(\n SyntaxKind.ArrowFunction,\n );\n if (innerArrow) {\n loadArrow = innerArrow;\n } else {\n const innerFnExpr = init.getFirstDescendantByKind(\n SyntaxKind.FunctionExpression,\n );\n if (innerFnExpr) {\n loadFn = innerFnExpr;\n }\n }\n }\n }\n }\n }\n\n if (!loadArrow) {\n const maybeFn = sourceFile.getFunction(\"load\");\n if (maybeFn && maybeFn.isExported()) {\n loadFn = maybeFn;\n }\n }\n\n // if no load found, create one\n if (!loadArrow && !loadFn) {\n sourceFile.addFunction({\n isExported: true,\n isAsync: true,\n name: \"load\",\n parameters: [{ name: \"{ locals }\" }],\n statements: `return { user: locals.pb.authStore.record };`,\n });\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n return { status: \"success\", changed: true };\n }\n\n // normalize function-like to a single handle\n const fnLike:\n | import(\"ts-morph\").ArrowFunction\n | import(\"ts-morph\").FunctionDeclaration\n | import(\"ts-morph\").FunctionExpression = (loadArrow ?? loadFn!) as any;\n\n // ensure first parameter destructures locals, preserving existing information\n const params = fnLike.getParameters();\n if (params.length === 0) {\n fnLike.insertParameter(0, { name: \"{ locals }\" });\n } else {\n const first = params[0];\n const original = first.getStructure();\n const nameNode = first.getNameNode();\n if (nameNode.getKind() === SyntaxKind.ObjectBindingPattern) {\n const obp = nameNode as import(\"ts-morph\").ObjectBindingPattern;\n const hasLocals = obp\n .getElements()\n .some((el) => el.getName() === \"locals\");\n if (!hasLocals) {\n const parts = obp\n .getElements()\n .map((el) => el.getText())\n .filter(Boolean);\n const tail = parts.length > 0 ? \", \" + parts.join(\", \") : \"\";\n first.set({\n name: `{ locals${tail} }`,\n type: original.type,\n initializer: (original as any).initializer,\n });\n }\n } else {\n const currentName = first.getName();\n if (currentName !== \"locals\") {\n first.set({\n name: `{ locals, ...${currentName} }`,\n type: original.type,\n initializer: (original as any).initializer,\n });\n }\n }\n }\n\n // add user to returned object literals without altering other properties\n if (loadArrow) {\n const body = loadArrow.getBody();\n if (body.getKind() === SyntaxKind.Block) {\n const returns = body.getDescendantsOfKind(SyntaxKind.ReturnStatement);\n returns.forEach((ret) => {\n const expr = ret.getExpression();\n if (!expr) return;\n if (expr.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(expr as import(\"ts-morph\").ObjectLiteralExpression);\n } else if (expr.getKind() === SyntaxKind.ParenthesizedExpression) {\n const inner = (\n expr as import(\"ts-morph\").ParenthesizedExpression\n ).getExpression();\n if (inner.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(inner as import(\"ts-morph\").ObjectLiteralExpression);\n }\n }\n });\n } else {\n // concise body\n const bodyExpr = body as import(\"ts-morph\").Expression;\n if (bodyExpr.getKind() === SyntaxKind.ParenthesizedExpression) {\n const inner = (\n bodyExpr as import(\"ts-morph\").ParenthesizedExpression\n ).getExpression();\n if (inner.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(inner as import(\"ts-morph\").ObjectLiteralExpression);\n }\n } else if (bodyExpr.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(bodyExpr as import(\"ts-morph\").ObjectLiteralExpression);\n }\n }\n } else if (loadFn) {\n const body = loadFn.getBody();\n if (body) {\n const returns = body.getDescendantsOfKind(SyntaxKind.ReturnStatement);\n returns.forEach((ret) => {\n const expr = ret.getExpression();\n if (!expr) return;\n if (expr.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(expr as import(\"ts-morph\").ObjectLiteralExpression);\n } else if (expr.getKind() === SyntaxKind.ParenthesizedExpression) {\n const inner = (\n expr as import(\"ts-morph\").ParenthesizedExpression\n ).getExpression();\n if (inner.getKind() === SyntaxKind.ObjectLiteralExpression) {\n addUserProp(inner as import(\"ts-morph\").ObjectLiteralExpression);\n }\n }\n });\n }\n }\n\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== originalSource,\n };\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport { SvelteFile } from \"../../../../runtime/svelte-file\";\nimport {\n ensureImports,\n ensurePropsBinding,\n withInMemoryScript,\n} from \"../../../../runtime/ts-morph-helpers\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\nconst AUTH_MENU_NAVBAR_ITEM = `\n\t\t<Navbar.Item\n\t\t\tclass=\"flex flex-col md:flex-row items-center space-y-2 md:space-y-0 md:space-x-4\"\n\t\t>\n\t\t\t<AuthMenu.Root>\n\t\t\t\t{#snippet user()}\n\t\t\t\t\t<AuthMenu.Trigger>\n\t\t\t\t\t\t<UserAvatar user={data.user} />\n\t\t\t\t\t</AuthMenu.Trigger>\n\n\t\t\t\t\t<AuthMenu.Content align=\"end\">\n\t\t\t\t\t\t<AuthMenu.Item href=\"/dashboard\">Dashboard</AuthMenu.Item>\n\t\t\t\t\t\t<AuthMenu.Group>\n\t\t\t\t\t\t\t<AuthMenu.Item href=\"/settings\">Settings</AuthMenu.Item>\n\t\t\t\t\t\t\t<AuthMenu.Item>\n\t\t\t\t\t\t\t\t<form action=\"/logout\" method=\"post\">\n\t\t\t\t\t\t\t\t\t<button type=\"submit\" class=\"contents\">Logout</button>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t</AuthMenu.Item>\n\t\t\t\t\t\t</AuthMenu.Group>\n\t\t\t\t\t</AuthMenu.Content>\n\t\t\t\t{/snippet}\n\n\t\t\t\t{#snippet guest()}\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclass=\"w-full justify-start md:justify-center md:w-auto\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\thref=\"/login\">Login</Button\n\t\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclass=\"w-full justify-start md:justify-center md:w-auto\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\thref=\"/signup\">Sign up</Button\n\t\t\t\t\t>\n\t\t\t\t{/snippet}\n\t\t\t</AuthMenu.Root>\n\t\t</Navbar.Item>\n\t`;\n\nconst IMPORT_SNIPPET = dedent`\n import * as AuthMenu from '#lib/components/ui/auth-menu/index.js';\n import UserAvatar from '#lib/components/user-avatar.svelte';\n`;\n\nconst FAILURE_HINT = [\n \"Add the auth menu inside your <Navbar.List> in the root layout.\",\n \"\",\n \"Imports to add to the <script> tag:\",\n \"\",\n IMPORT_SNIPPET,\n \"\",\n \"Markup to add inside <Navbar.List>:\",\n AUTH_MENU_NAVBAR_ITEM,\n].join(\"\\n\");\n\nconst NOT_FOUND_HINT = [\n \"Create a root layout that includes an auth menu inside <Navbar.List>.\",\n \"\",\n \"Imports for the <script> tag:\",\n \"\",\n IMPORT_SNIPPET,\n \"\",\n \"Markup inside <Navbar.List>:\",\n AUTH_MENU_NAVBAR_ITEM,\n].join(\"\\n\");\n\nexport function modifyRootLayoutSvelte(layoutPath: string): ModifyOutcome {\n if (!fs.existsSync(layoutPath)) {\n return { status: \"not-found\", message: NOT_FOUND_HINT };\n }\n\n const file = SvelteFile.fromPath(layoutPath);\n if (!file.hasElement(\"Navbar.List\")) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n if (file.hasElement(\"AuthMenu.Root\")) {\n return { status: \"success\", changed: false };\n }\n\n file.modifyScript((source) => {\n const { source: out } = withInMemoryScript(source, (sf) => {\n ensureImports(sf, [\n {\n namespaceImport: \"AuthMenu\",\n moduleSpecifier: \"#lib/components/ui/auth-menu/index.js\",\n },\n {\n defaultImport: \"UserAvatar\",\n moduleSpecifier: \"#lib/components/user-avatar.svelte\",\n },\n ]);\n // The menu reads `data.user`; the template's layout takes no props.\n ensurePropsBinding(sf, \"data\");\n });\n return out;\n });\n\n file.insertBeforeClosingTag(\"Navbar.List\", AUTH_MENU_NAVBAR_ITEM);\n file.writeTo(layoutPath);\n return { status: \"success\", changed: file.hasChanged() };\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport { Project, SyntaxKind } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport { formatLikeSource } from \"../../../../runtime/ts-morph-helpers\";\n\nconst FAILURE_HINT = dedent`\n Configure handlePocketbase() with the auth option in hooks.server.ts:\n\n handlePocketbase({\n auth: { protectedRoutes: ['/(app)'] },\n });\n`;\n\nconst NOT_FOUND_HINT = dedent`\n Create src/hooks.server.ts with handlePocketbase:\n\n import { handlePocketbase } from '@velastack/pocketbase';\n\n export const handle = handlePocketbase({\n auth: { protectedRoutes: ['/(app)'] },\n });\n`;\n\nexport function modifyHooksServer(hooksServerPath: string): ModifyOutcome {\n if (!fs.existsSync(hooksServerPath)) {\n return { status: \"not-found\", message: NOT_FOUND_HINT };\n }\n\n const originalSource = fs.readFileSync(hooksServerPath, \"utf8\");\n const project = new Project();\n const sourceFile = project.addSourceFileAtPath(hooksServerPath);\n\n // Find the handlePocketbase(...) call\n const callExpr = sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .find((ce) => ce.getExpression().getText() === \"handlePocketbase\");\n\n if (!callExpr) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n\n const args = callExpr.getArguments();\n if (args.length === 0) {\n callExpr.addArgument(`{ auth: { protectedRoutes: ['/(app)'] } }`);\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n return { status: \"success\", changed: true };\n }\n\n const firstArg = args[0];\n if (firstArg.getKind() !== SyntaxKind.ObjectLiteralExpression) {\n callExpr.insertArgument(0, `{ auth: { protectedRoutes: ['/(app)'] } }`);\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n return { status: \"success\", changed: true };\n }\n\n const optionsObj = firstArg.asKindOrThrow(SyntaxKind.ObjectLiteralExpression);\n\n // Ensure auth property exists\n const authProp = optionsObj.getProperty(\"auth\");\n if (!authProp) {\n optionsObj.addPropertyAssignment({\n name: \"auth\",\n initializer: `{ protectedRoutes: ['/(app)'] }`,\n });\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n return { status: \"success\", changed: true };\n }\n\n // If auth exists, ensure protectedRoutes includes '/(app)'\n if (authProp.getKind() === SyntaxKind.PropertyAssignment) {\n const authInit = (\n authProp as import(\"ts-morph\").PropertyAssignment\n ).getInitializer();\n if (authInit && authInit.getKind() === SyntaxKind.ObjectLiteralExpression) {\n const authObj = authInit as import(\"ts-morph\").ObjectLiteralExpression;\n const prProp = authObj.getProperty(\"protectedRoutes\");\n if (!prProp) {\n authObj.addPropertyAssignment({\n name: \"protectedRoutes\",\n initializer: `['/(app)']`,\n });\n } else if (prProp.getKind() === SyntaxKind.PropertyAssignment) {\n const prInit = (\n prProp as import(\"ts-morph\").PropertyAssignment\n ).getInitializer();\n if (prInit && prInit.getKind() === SyntaxKind.ArrayLiteralExpression) {\n const arr = prInit as import(\"ts-morph\").ArrayLiteralExpression;\n const hasApp = arr\n .getElements()\n .some((el) => el.getText().replace(/['\"`]/g, \"\") === \"/(app)\");\n if (!hasApp) {\n arr.addElement(`'/(app)'`);\n }\n } else {\n (prProp as import(\"ts-morph\").PropertyAssignment).setInitializer(\n `['/(app)']`,\n );\n }\n }\n }\n }\n\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== originalSource,\n };\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\nconst VARIANTS = [\n {\n from: \"'data-active': isActive,\",\n to: \"'data-active': isActive ? true : undefined,\",\n },\n {\n from: '\"data-active\": isActive,',\n to: '\"data-active\": isActive ? true : undefined,',\n },\n];\n\nconst NOT_FOUND_HINT = dedent`\n The shadcn-svelte sidebar component was not installed at the expected path.\n Run: vela enable auth (or install the 'sidebar' shadcn-svelte component).\n`;\n\nexport function modifySidebarMenuButton(filePath: string): ModifyOutcome {\n if (!fs.existsSync(filePath)) {\n return { status: \"not-found\", message: NOT_FOUND_HINT };\n }\n\n const original = fs.readFileSync(filePath, \"utf8\");\n\n if (VARIANTS.some(({ to }) => original.includes(to))) {\n return { status: \"success\", changed: false };\n }\n\n const variant = VARIANTS.find(({ from }) => original.includes(from));\n if (!variant) {\n return { status: \"success\", changed: false };\n }\n\n const updated = original.replace(variant.from, variant.to);\n fs.writeFileSync(filePath, updated, \"utf8\");\n return { status: \"success\", changed: true };\n}\n","import path from \"node:path\";\nimport fs from \"node:fs\";\nimport { Options, Result, File } from \"../../../core/types\";\nimport { getLogger } from \"../../../core/logger\";\nimport {\n getMigrationFile,\n migrationDelay,\n withPocketbase,\n} from \"../../../runtime/pocketbase\";\nimport { modifyOutcomeToFile } from \"../../../runtime/modify-file\";\nimport { ensureSiteFile } from \"../../../runtime/site\";\n\nimport { modifyLayoutServer } from \"./modifies/+layout.server\";\nimport { modifyRootLayoutSvelte } from \"./modifies/root-layout.svelte\";\nimport { modifyHooksServer } from \"./modifies/hooks.server\";\nimport { modifySidebarMenuButton } from \"./modifies/sidebar-menu-button.svelte\";\n\nexport async function generate(options: Options) {\n const { input } = options;\n const logger = getLogger(options);\n\n let creates: File[] = [];\n\n // Update PocketBase\n await withPocketbase(options.root, async (pb) => {\n logger.info(\"Updating PocketBase mail settings\");\n await pb.settings.update({\n meta: {\n senderName: input.senderName,\n senderAddress: input.senderAddress,\n },\n });\n await migrationDelay();\n\n const userCollection = await pb.collections.getOne(\"users\");\n\n if (!userCollection) {\n throw new Error(\"Users collection not found\");\n }\n\n const verificationTemplate =\n userCollection.verificationTemplate.body.replace(\n \"{APP_URL}/_/#/auth/confirm-verification/{TOKEN}\",\n \"{APP_URL}/confirm-verification/{TOKEN}\",\n );\n const resetPasswordTemplate =\n userCollection.resetPasswordTemplate.body.replace(\n \"{APP_URL}/_/#/auth/confirm-reset/{TOKEN}\",\n \"{APP_URL}/confirm-reset/{TOKEN}\",\n );\n const confirmEmailChangeTemplate =\n userCollection.confirmEmailChangeTemplate.body.replace(\n \"{APP_URL}/_/#/auth/confirm-email-change/{TOKEN}\",\n \"{APP_URL}/confirm-email-change/{TOKEN}\",\n );\n\n logger.info(\"Locking down users collection rules and email templates\");\n // Update user auth rules to lock down access to the user's own account\n await pb.collections.update(\"users\", {\n listRule: \"@request.auth.id = id\",\n viewRule: \"@request.auth.id = id\",\n createRule: \"@request.auth.id = id\",\n updateRule: \"@request.auth.id = id\",\n deleteRule: \"@request.auth.id = id\",\n\n // Update email templates to VelaStack auth urls\n verificationTemplate: {\n body: verificationTemplate,\n },\n resetPasswordTemplate: {\n body: resetPasswordTemplate,\n },\n confirmEmailChangeTemplate: {\n body: confirmEmailChangeTemplate,\n },\n });\n await migrationDelay();\n\n const migrationFile = getMigrationFile(\"users\", \"updated\", options);\n if (migrationFile) {\n creates.push({\n path: migrationFile,\n language: \"ts\",\n content: fs.readFileSync(migrationFile, \"utf8\"),\n status: \"success\",\n });\n }\n });\n\n // Modify files\n const modifies: File[] = [];\n const pushResult = (file: File | null) => {\n if (file) modifies.push(file);\n };\n\n logger.info(\"Modifying +layout.server.ts\");\n const layoutServerFile = path.join(\n options.root,\n \"src\",\n \"routes\",\n \"+layout.server.ts\",\n );\n pushResult(\n modifyOutcomeToFile(layoutServerFile, modifyLayoutServer(layoutServerFile)),\n );\n\n logger.info(\"Modifying root layout\");\n // TODO: make this more robust by searching for Navbar.Root > Navbar.List\n // src/routes/(public)/root-layout.svelte is what vela creates by default\n const layoutCandidates = [\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 const layoutFile =\n layoutCandidates.find((p) => fs.existsSync(p)) ?? layoutCandidates[0];\n pushResult(\n modifyOutcomeToFile(layoutFile, modifyRootLayoutSvelte(layoutFile)),\n );\n\n logger.info(\"Modifying hooks.server.ts\");\n const hooksServerFile = path.join(options.root, \"src\", \"hooks.server.ts\");\n pushResult(\n modifyOutcomeToFile(hooksServerFile, modifyHooksServer(hooksServerFile)),\n );\n\n logger.info(\"Modifying sidebar-menu-button.svelte\");\n const sidebarMenuButtonFile = path.join(\n options.root,\n \"src\",\n \"lib\",\n \"components\",\n \"ui\",\n \"sidebar\",\n \"sidebar-menu-button.svelte\",\n );\n pushResult(\n modifyOutcomeToFile(\n sidebarMenuButtonFile,\n modifySidebarMenuButton(sidebarMenuButtonFile),\n ),\n );\n\n // The auth pages and the app sidebar show `site.name`.\n const siteFile = await ensureSiteFile(options);\n\n return {\n creates: siteFile ? [siteFile] : [],\n modifies,\n deletes: [],\n components: [],\n packages: [],\n collections: [],\n collectionPatches: [],\n collectionDrops: [],\n } satisfies Result;\n}\n"],"mappings":";;;;;;;;;;;AAMA,SAAgBgB,EAAmB,GAAmC;CACpE,IAAI,CAACF,EAAG,WAAWG,CAAU,GAAG;EAC9B,IAAMC,IAAU,CAAM;;;;;EAOtB,OAD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CAAC;EACb,UAAU,CAAC;EACX,aAAa,CAAC;EACd,mBAAmB,CAAC;EACpB,iBAAiB,CAAC;CACpB;AACF"}
|
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./logger-t1HxmpG2.js";
|
|
2
|
-
import { a as t, r as n } from "./modify-file-CRZ_gMg0.js";
|
|
3
|
-
import { a as r, o as i, s as a, t as o } from "./config-target-DJbVHwHl.js";
|
|
4
|
-
import { _ as s, c, d as l, h as u, m as d, n as f, o as p, s as m, u as h } from "./ts-morph-helpers-B4KZXP44.js";
|
|
5
|
-
import { r as g } from "./package-imports-CcIIHbp5.js";
|
|
6
|
-
import { r as _, t as v } from "./_layout-Dju9EYqa.js";
|
|
7
|
-
import { t as y } from "./dedent-CCUOcPFW.js";
|
|
8
|
-
import { n as b } from "./compose-handle-Da7m6lV_.js";
|
|
9
|
-
import { t as x } from "./svelte-file-DfplF3BU.js";
|
|
10
|
-
import { r as S } from "./lib-specifier-C3M0WTev.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
|
-
// 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
|
-
// src/patterns/disable/i18n/modifies/vite-config.ts
|
|
48
|
-
function k(e) {
|
|
49
|
-
if (!C.existsSync(e)) return {
|
|
50
|
-
status: "success",
|
|
51
|
-
changed: !1
|
|
52
|
-
};
|
|
53
|
-
let t = C.readFileSync(e, "utf8");
|
|
54
|
-
if (!t.includes("wuchale")) return {
|
|
55
|
-
status: "success",
|
|
56
|
-
changed: !1
|
|
57
|
-
};
|
|
58
|
-
let n = new T({
|
|
59
|
-
compilerOptions: { allowJs: !0 },
|
|
60
|
-
manipulationSettings: { quoteKind: E.Single }
|
|
61
|
-
}).addSourceFileAtPath(e);
|
|
62
|
-
for (;;) {
|
|
63
|
-
let e = !1;
|
|
64
|
-
for (let t of n.getDescendantsOfKind(D.ArrayLiteralExpression)) {
|
|
65
|
-
let n = t.getElements().findIndex((e) => e.getText().replace(/\s/g, "") === "wuchale()");
|
|
66
|
-
if (n >= 0) {
|
|
67
|
-
t.removeElement(n), e = !0;
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (!e) break;
|
|
72
|
-
}
|
|
73
|
-
return h(n, "wuchale/vite"), p(n), n.saveSync(), {
|
|
74
|
-
status: "success",
|
|
75
|
-
changed: n.getFullText() !== t
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
// src/patterns/disable/i18n/modifies/locales-alias.ts
|
|
79
|
-
var A = {
|
|
80
|
-
notFound: "No SvelteKit config to revert.",
|
|
81
|
-
failed: "Remove the $locales alias from the sveltekit() arg in vite.config by hand."
|
|
82
|
-
};
|
|
83
|
-
function j(e) {
|
|
84
|
-
let t = i(e, A);
|
|
85
|
-
if (t.status === "not-found") return {
|
|
86
|
-
filePath: t.filePath,
|
|
87
|
-
outcome: {
|
|
88
|
-
status: "success",
|
|
89
|
-
changed: !1
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
if (t.status === "failed") return {
|
|
93
|
-
filePath: t.filePath,
|
|
94
|
-
outcome: {
|
|
95
|
-
status: "failed",
|
|
96
|
-
message: t.message
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
let { target: n } = t, r = n.configObject.getProperty("alias")?.asKind(D.PropertyAssignment), o = r?.getInitializer()?.asKind(D.ObjectLiteralExpression), s = o?.getProperties().find((e) => e.getText().replace(/['"]/g, "").startsWith("$locales"));
|
|
100
|
-
return r && o && s && (s.remove(), o.getProperties().length === 0 && r.remove()), {
|
|
101
|
-
filePath: n.filePath,
|
|
102
|
-
outcome: a(n)
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
// src/patterns/disable/i18n/modifies/locales-module.ts
|
|
106
|
-
function M(e) {
|
|
107
|
-
let t = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = RegExp(`^[$#]locales/${t}(\\.js)?$`);
|
|
108
|
-
return (e) => n.test(e);
|
|
109
|
-
}
|
|
110
|
-
// src/patterns/disable/i18n/modifies/hooks.server.ts
|
|
111
|
-
var N = "handleWuchale", P = y`
|
|
112
|
-
Take handleWuchale out of the exported handle in src/hooks.server.ts, then
|
|
113
|
-
remove its declaration, the loadLocales(...) calls and the wuchale and
|
|
114
|
-
#locales imports.
|
|
115
|
-
`, F = [
|
|
116
|
-
"wuchale/load-utils/server",
|
|
117
|
-
M("main.url"),
|
|
118
|
-
M("data"),
|
|
119
|
-
M("main.loader.server.svelte"),
|
|
120
|
-
M("js.loader.server")
|
|
121
|
-
];
|
|
122
|
-
function I(e) {
|
|
123
|
-
if (!C.existsSync(e)) return {
|
|
124
|
-
status: "success",
|
|
125
|
-
changed: !1
|
|
126
|
-
};
|
|
127
|
-
let t = C.readFileSync(e, "utf8");
|
|
128
|
-
if (!t.includes(N) && !t.includes("loadLocales(")) return {
|
|
129
|
-
status: "success",
|
|
130
|
-
changed: !1
|
|
131
|
-
};
|
|
132
|
-
let n = new T({
|
|
133
|
-
compilerOptions: { allowJs: !0 },
|
|
134
|
-
manipulationSettings: { quoteKind: E.Single }
|
|
135
|
-
}).addSourceFileAtPath(e);
|
|
136
|
-
for (;;) {
|
|
137
|
-
let e = n.getStatements().find((e) => e.getKind() === D.ExpressionStatement && /^loadLocales\s*\(/.test(e.getText()));
|
|
138
|
-
if (!e) break;
|
|
139
|
-
e.remove();
|
|
140
|
-
}
|
|
141
|
-
if (b(n, N).status === "unsupported") return {
|
|
142
|
-
status: "failed",
|
|
143
|
-
message: P
|
|
144
|
-
};
|
|
145
|
-
u(n, N);
|
|
146
|
-
for (let e of F) h(n, e);
|
|
147
|
-
return l(n, "@sveltejs/kit/hooks", "sequence"), l(n, "@sveltejs/kit/hooks", "Handle"), l(n, "@sveltejs/kit", "Handle"), p(n), f(n), n.saveSync(), {
|
|
148
|
-
status: "success",
|
|
149
|
-
changed: n.getFullText() !== t
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
// src/patterns/disable/i18n/modifies/hooks.ts
|
|
153
|
-
var L = "rerouteDeLocalize", R = y`
|
|
154
|
-
Take rerouteDeLocalize out of the exported reroute in src/hooks.ts, then
|
|
155
|
-
remove its declaration and the wuchale and #locales imports.
|
|
156
|
-
`, z = [
|
|
157
|
-
"wuchale/url",
|
|
158
|
-
M("main.url"),
|
|
159
|
-
M("data")
|
|
160
|
-
], 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*\)$/;
|
|
161
|
-
function H(e) {
|
|
162
|
-
if (!C.existsSync(e)) return {
|
|
163
|
-
status: "success",
|
|
164
|
-
changed: !1
|
|
165
|
-
};
|
|
166
|
-
let t = C.readFileSync(e, "utf8");
|
|
167
|
-
if (!t.includes(L)) return {
|
|
168
|
-
status: "success",
|
|
169
|
-
changed: !1
|
|
170
|
-
};
|
|
171
|
-
let n = new T({
|
|
172
|
-
compilerOptions: { allowJs: !0 },
|
|
173
|
-
manipulationSettings: { quoteKind: E.Single }
|
|
174
|
-
}).addSourceFileAtPath(e), r = n.getVariableDeclaration(L)?.getFirstAncestorByKind(D.VariableStatement), i = n.getVariableDeclaration("reroute"), a = i?.getInitializer()?.getText() ?? "", o = V.test(a), s = o || B.test(a) ? i?.getFirstAncestorByKind(D.VariableStatement) : void 0;
|
|
175
|
-
return n.getStatements().filter((e) => e !== r && e !== s && e.getText().includes(L)).length > 0 ? {
|
|
176
|
-
status: "failed",
|
|
177
|
-
message: R
|
|
178
|
-
} : (o ? i?.setInitializer("({ url }) => negotiateReroute(url.pathname)") : s && u(n, "reroute"), u(n, L), c(n, z), m(n) ? (C.writeFileSync(e, "", "utf8"), {
|
|
179
|
-
status: "success",
|
|
180
|
-
changed: !0
|
|
181
|
-
}) : (p(n), f(n), n.saveSync(), {
|
|
182
|
-
status: "success",
|
|
183
|
-
changed: n.getFullText() !== t
|
|
184
|
-
}));
|
|
185
|
-
}
|
|
186
|
-
// src/patterns/disable/i18n/modifies/app-html.ts
|
|
187
|
-
function U(e) {
|
|
188
|
-
if (!C.existsSync(e)) return {
|
|
189
|
-
status: "success",
|
|
190
|
-
changed: !1
|
|
191
|
-
};
|
|
192
|
-
let t = C.readFileSync(e, "utf8"), n = t.replace(/lang\s*=\s*(?:"%sveltekit\.lang%"|'%sveltekit\.lang%')/g, "lang=\"en\"");
|
|
193
|
-
return n === t ? {
|
|
194
|
-
status: "success",
|
|
195
|
-
changed: !1
|
|
196
|
-
} : (C.writeFileSync(e, n, "utf8"), {
|
|
197
|
-
status: "success",
|
|
198
|
-
changed: !0
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
// src/patterns/disable/i18n/modifies/+layout.ts
|
|
202
|
-
var W = y`
|
|
203
|
-
src/routes/+layout.ts still loads wuchale locales. Remove these from it:
|
|
204
|
-
|
|
205
|
-
import { browser } from '$app/env';
|
|
206
|
-
import { loadLocale } from 'wuchale/load-utils';
|
|
207
|
-
import { getLocale } from '#locales/main.url.js';
|
|
208
|
-
import '#locales/main.loader.svelte.js';
|
|
209
|
-
import '#locales/js.loader.js';
|
|
210
|
-
|
|
211
|
-
and the loadLocale(...) call inside load().
|
|
212
|
-
`, G = [M("main.loader.svelte"), M("js.loader")], K = [
|
|
213
|
-
(e) => /^\$app\/env(ironment)?$/.test(e),
|
|
214
|
-
"wuchale/load-utils",
|
|
215
|
-
M("main.url")
|
|
216
|
-
];
|
|
217
|
-
function q(e) {
|
|
218
|
-
return e.replace(/["']/g, "'").replace(/\s+/g, "");
|
|
219
|
-
}
|
|
220
|
-
function J(e) {
|
|
221
|
-
if (!C.existsSync(e)) return {
|
|
222
|
-
status: "success",
|
|
223
|
-
changed: !1
|
|
224
|
-
};
|
|
225
|
-
let t = C.readFileSync(e, "utf8");
|
|
226
|
-
if (!t.includes("loadLocale") && !/[$#]locales\//.test(t)) return {
|
|
227
|
-
status: "success",
|
|
228
|
-
changed: !1
|
|
229
|
-
};
|
|
230
|
-
let n = new T({
|
|
231
|
-
compilerOptions: { allowJs: !0 },
|
|
232
|
-
manipulationSettings: { quoteKind: E.Single }
|
|
233
|
-
}).addSourceFileAtPath(e), r = n.getVariableStatements().find((e) => e.getDeclarations().some((e) => e.getName() === "load")) ?? n.getFunction("load");
|
|
234
|
-
if (r) {
|
|
235
|
-
if (q(r.getText()) !== q(v)) return {
|
|
236
|
-
status: "failed",
|
|
237
|
-
message: W
|
|
238
|
-
};
|
|
239
|
-
d(n, r);
|
|
240
|
-
}
|
|
241
|
-
for (let e of G) h(n, e);
|
|
242
|
-
return c(n, K), m(n) ? (C.writeFileSync(e, "", "utf8"), {
|
|
243
|
-
status: "success",
|
|
244
|
-
changed: !0
|
|
245
|
-
}) : (p(n), f(n), n.saveSync(), {
|
|
246
|
-
status: "success",
|
|
247
|
-
changed: n.getFullText() !== t
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
// src/patterns/disable/i18n/modifies/root-layout.svelte.ts
|
|
251
|
-
function Y(e) {
|
|
252
|
-
if (!C.existsSync(e)) return {
|
|
253
|
-
status: "success",
|
|
254
|
-
changed: !1
|
|
255
|
-
};
|
|
256
|
-
let t = C.readFileSync(e, "utf8");
|
|
257
|
-
if (!t.includes("LanguageSelect")) return {
|
|
258
|
-
status: "success",
|
|
259
|
-
changed: !1
|
|
260
|
-
};
|
|
261
|
-
let n = x.fromPath(e);
|
|
262
|
-
n.modifyScript((e) => {
|
|
263
|
-
let { source: t } = s(e, (e) => {
|
|
264
|
-
h(e, S("components/language-select.svelte")), f(e);
|
|
265
|
-
});
|
|
266
|
-
return t;
|
|
267
|
-
});
|
|
268
|
-
let r = n.toString();
|
|
269
|
-
return r = r.replace(/[ \t]*<Navbar\.Item>\s*<LanguageSelect\s*\/>\s*<\/Navbar\.Item>[ \t]*\r?\n?/g, ""), r = r.replace(/[ \t]*<LanguageSelect\s*\/>[ \t]*\r?\n?/g, ""), C.writeFileSync(e, r, "utf8"), {
|
|
270
|
-
status: "success",
|
|
271
|
-
changed: r !== t
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
// src/patterns/disable/i18n/generate.runtime.ts
|
|
275
|
-
async function X(i) {
|
|
276
|
-
let a = e(i), s = [], c = [], l = (e) => {
|
|
277
|
-
e && s.push(e);
|
|
278
|
-
};
|
|
279
|
-
a.info("Reverting vite.config");
|
|
280
|
-
let u = r(i.root, o) ?? w.join(i.root, o[0]);
|
|
281
|
-
l(n(u, k(u))), a.info("Removing #locales from package.json imports");
|
|
282
|
-
let d = g(i.root, Object.keys(_), _);
|
|
283
|
-
l(n(d.filePath, d.outcome)), a.info("Reverting the legacy $locales alias");
|
|
284
|
-
let f = j(i.root);
|
|
285
|
-
l(n(f.filePath, f.outcome)), a.info("Reverting hooks.server.ts");
|
|
286
|
-
let p = w.join(i.root, "src", "hooks.server.ts"), m = t(p, I(p));
|
|
287
|
-
l(m.modify), m.delete && c.push(m.delete), a.info("Reverting hooks.ts");
|
|
288
|
-
let h = w.join(i.root, "src", "hooks.ts"), v = t(h, H(h));
|
|
289
|
-
l(v.modify), v.delete && c.push(v.delete), a.info("Reverting app.html");
|
|
290
|
-
let y = w.join(i.root, "src", "app.html");
|
|
291
|
-
l(n(y, U(y))), a.info("Reverting root +layout.ts");
|
|
292
|
-
let b = w.join(i.root, "src", "routes", "+layout.ts"), x = t(b, J(b));
|
|
293
|
-
l(x.modify), x.delete && c.push(x.delete), a.info("Reverting root layout language select");
|
|
294
|
-
let S = [
|
|
295
|
-
w.join(i.root, "src", "routes", "(public)", "root-layout.svelte"),
|
|
296
|
-
w.join(i.root, "src", "routes", "root-layout.svelte"),
|
|
297
|
-
w.join(i.root, "src", "routes", "(public)", "+layout.svelte"),
|
|
298
|
-
w.join(i.root, "src", "routes", "+layout.svelte")
|
|
299
|
-
];
|
|
300
|
-
for (let e of S) C.existsSync(e) && l(n(e, Y(e)));
|
|
301
|
-
a.info("Reverting .gitignore");
|
|
302
|
-
let T = w.join(i.root, ".gitignore");
|
|
303
|
-
return l(n(T, O(T))), {
|
|
304
|
-
creates: [],
|
|
305
|
-
modifies: s,
|
|
306
|
-
deletes: c,
|
|
307
|
-
components: [],
|
|
308
|
-
packages: [],
|
|
309
|
-
collections: [],
|
|
310
|
-
collectionPatches: [],
|
|
311
|
-
collectionDrops: []
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
export { X as generate };
|
|
315
|
-
|
|
316
|
-
//# sourceMappingURL=generate.runtime-Dtf3tF3-.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate.runtime-Dtf3tF3-.js","names":["FAILURE_HINT","I18N_MODULES","FAILURE_HINT","getLogger","revertOutcomeToFile","modifyOutcomeToFile","probeFirstExisting","resolveConfigTarget","saveTarget","VITE_CONFIG_CANDIDATES","withInMemoryScript","removeNamedImportIfUnused","removeTopLevelStatementByIdentifier","removeStatementWithComments","ensureBlankLineAfterImports","formatLikeSource","isEffectivelyEmpty","removeImportByModuleSpecifier","removePackageImports","LOCALES_IMPORTS","LOAD_STATEMENT","dedent","removeHandle","SvelteFile","libModule","fs","path","unmodifyGitignore","gitignorePath","original","lines","out","i","line","j","hasWuchale","updated","unmodifyViteConfig","viteConfigPath","sourceFile","Project","QuoteKind","removed","arr","SyntaxKind","index","el","HINTS","unmodifyLocalesAlias","res","root","aliasProp","target","aliasObj","locales","p","localesModule","escaped","name","pattern","specifier","I18N_HANDLE","FAILURE_HINT$2","I18N_MODULES$1","unmodifyHooksServerI18n","hooksServerPath","stmt","s","moduleSpecifier","DELOCALIZE_HELPER","FAILURE_HINT$1","I18N_MODULES","I18N_ONLY_REROUTE","COMPOSED_REROUTE","unmodifyHooksI18n","hooksPath","helperStatement","rerouteDecl","initText","composed","rerouteStatement","pruneUnusedImports","unmodifyAppHtml","appHtmlPath","FAILURE_HINT","SIDE_EFFECT_MODULES","BINDING_MODULES","normalize","source","unmodifyRootLayoutI18n","layoutPath","loadStatement","d","unmodifyRootLayoutLanguageSelect","file","sf","generate","logger","options","modifies","deletes","pushResult","imports","alias","hooksServerRevert","hooksRevert","layoutRevert","rootLayoutCandidates","candidate"],"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,SAAgB2B,EAAkB,GAAsC;CACtE,IAAI,CAACF,EAAG,WAAWG,CAAa,GAC9B,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAG7C,IAAMC,IAAWJ,EAAG,aAAaG,GAAe,MAAM;CACtD,IAAI,CAACC,EAAS,SAAS,sBAAsB,GAC3C,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAG7C,IAAMC,IAAQD,EAAS,MAAM,IAAI,GAC3BE,IAAgB,CAAC;CACvB,KAAK,IAAIC,IAAI,GAAGA,IAAIF,EAAM,QAAQ,KAAK;EACrC,IAAMG,IAAOH,EAAME;EACnB,IAAIC,MAAS,aAAa;GACxB,IAAIC,IAAIF,IAAI,GACRG,IAAa;GACjB,OAAOD,IAAIJ,EAAM,UAAUA,EAAMI,EAAE,CAAC,KAAK,MAAM,KAI7C,AAHIJ,EAAMI,OAAO,2BACf,IAAa,KAEf;GAEF,IAAIC,GAAY;IACd,IAAID;IACJ;GACF;EACF;EACA,AAAID,MAAS,0BACbF,EAAI,KAAKE,CAAI;CACf;CAEA,IAAIG,IAAUL,EAAI,KAAK,IAAI;CAQ3B,OAPA,IAAUK,EAAQ,QAAQ,WAAW,MAAM,GAEvCA,MAAYP,IACP;EAAE,QAAQ;EAAW,SAAS;CAAM,KAG7CJ,EAAG,cAAcG,GAAeQ,CAAO,GAChC;EAAE,QAAQ;EAAW,SAAS;CAAK;AAC5C;;ACnCA,SAAgBC,EAAmB,GAAuC;CACxE,IAAI,CAACZ,EAAG,WAAWa,CAAc,GAC/B,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAG7C,IAAMT,IAAWJ,EAAG,aAAaa,GAAgB,MAAM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