@velastack/patterns 0.2.3 → 0.2.4

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.
@@ -1,6 +1,6 @@
1
1
  import { n as e } from "./logger-CQONztPm.js";
2
2
  import { modifyOutcomeToFile as t } from "./modify-file-PVKmDJHk.js";
3
- import { i as n, n as r, o as i } from "./test-setup-BGhcb0Qm.js";
3
+ import { i as n, n as r, o as i } from "./test-setup-BBb4kcoO.js";
4
4
  import a from "node:path";
5
5
  //#region src/patterns/disable/backend/generate.runtime.ts
6
6
  async function o(o) {
@@ -25,4 +25,4 @@ async function o(o) {
25
25
  //#endregion
26
26
  export { o as generate };
27
27
 
28
- //# sourceMappingURL=generate.runtime-qsPylve5.js.map
28
+ //# sourceMappingURL=generate.runtime-Bb_j7P3G.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.runtime-qsPylve5.js","names":[],"sources":["../../src/patterns/disable/backend/generate.runtime.ts"],"sourcesContent":["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 { unmodifySvelteConfig } from \"../../enable/backend/modifies/svelte-config\";\nimport { unmodifyGitignore } from \"../../enable/backend/modifies/gitignore\";\nimport { unmodifyTestSetup } from \"../../enable/backend/modifies/test-setup\";\n\nexport async function generate(options: Options) {\n const logger = getLogger(options);\n const modifies: File[] = [];\n\n logger.info(\"Reverting adapter config\");\n const revert = unmodifySvelteConfig(options.root);\n const svelteConfigFile = modifyOutcomeToFile(revert.filePath, revert.outcome);\n if (svelteConfigFile) modifies.push(svelteConfigFile);\n\n logger.info(\"Reverting .gitignore\");\n const gitignorePath = path.join(options.root, \".gitignore\");\n const gitignoreFile = modifyOutcomeToFile(\n gitignorePath,\n unmodifyGitignore(gitignorePath),\n );\n if (gitignoreFile) modifies.push(gitignoreFile);\n\n logger.info(\"Reverting test/setup.ts\");\n const testSetupPath = path.join(options.root, \"test\", \"setup.ts\");\n const testSetupFile = modifyOutcomeToFile(\n testSetupPath,\n unmodifyTestSetup(testSetupPath),\n );\n if (testSetupFile) modifies.push(testSetupFile);\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":";;;;;AAQA,eAAsB,EAAS,GAAkB;CAC/C,IAAM,IAAS,EAAU,CAAO,GAC1B,IAAmB,CAAC;CAE1B,EAAO,KAAK,0BAA0B;CACtC,IAAM,IAAS,EAAqB,EAAQ,IAAI,GAC1C,IAAmB,EAAoB,EAAO,UAAU,EAAO,OAAO;CAG5E,AAFI,KAAkB,EAAS,KAAK,CAAgB,GAEpD,EAAO,KAAK,sBAAsB;CAClC,IAAM,IAAgB,EAAK,KAAK,EAAQ,MAAM,YAAY,GACpD,IAAgB,EACpB,GACA,EAAkB,CAAa,CACjC;CAGA,AAFI,KAAe,EAAS,KAAK,CAAa,GAE9C,EAAO,KAAK,yBAAyB;CACrC,IAAM,IAAgB,EAAK,KAAK,EAAQ,MAAM,QAAQ,UAAU,GAC1D,IAAgB,EACpB,GACA,EAAkB,CAAa,CACjC;CAGA,OAFI,KAAe,EAAS,KAAK,CAAa,GAEvC;EACL,SAAS,CAAC;EACV;EACA,SAAS,CAAC;EACV,YAAY,CAAC;EACb,UAAU,CAAC;EACX,aAAa,CAAC;EACd,mBAAmB,CAAC;EACpB,iBAAiB,CAAC;CACpB;AACF"}
1
+ {"version":3,"file":"generate.runtime-Bb_j7P3G.js","names":[],"sources":["../../src/patterns/disable/backend/generate.runtime.ts"],"sourcesContent":["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 { unmodifySvelteConfig } from \"../../enable/backend/modifies/svelte-config\";\nimport { unmodifyGitignore } from \"../../enable/backend/modifies/gitignore\";\nimport { unmodifyTestSetup } from \"../../enable/backend/modifies/test-setup\";\n\nexport async function generate(options: Options) {\n const logger = getLogger(options);\n const modifies: File[] = [];\n\n logger.info(\"Reverting adapter config\");\n const revert = unmodifySvelteConfig(options.root);\n const svelteConfigFile = modifyOutcomeToFile(revert.filePath, revert.outcome);\n if (svelteConfigFile) modifies.push(svelteConfigFile);\n\n logger.info(\"Reverting .gitignore\");\n const gitignorePath = path.join(options.root, \".gitignore\");\n const gitignoreFile = modifyOutcomeToFile(\n gitignorePath,\n unmodifyGitignore(gitignorePath),\n );\n if (gitignoreFile) modifies.push(gitignoreFile);\n\n logger.info(\"Reverting test/setup.ts\");\n const testSetupPath = path.join(options.root, \"test\", \"setup.ts\");\n const testSetupFile = modifyOutcomeToFile(\n testSetupPath,\n unmodifyTestSetup(testSetupPath),\n );\n if (testSetupFile) modifies.push(testSetupFile);\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":";;;;;AAQA,eAAsB,EAAS,GAAkB;CAC/C,IAAM,IAAS,EAAU,CAAO,GAC1B,IAAmB,CAAC;CAE1B,EAAO,KAAK,0BAA0B;CACtC,IAAM,IAAS,EAAqB,EAAQ,IAAI,GAC1C,IAAmB,EAAoB,EAAO,UAAU,EAAO,OAAO;CAG5E,AAFI,KAAkB,EAAS,KAAK,CAAgB,GAEpD,EAAO,KAAK,sBAAsB;CAClC,IAAM,IAAgB,EAAK,KAAK,EAAQ,MAAM,YAAY,GACpD,IAAgB,EACpB,GACA,EAAkB,CAAa,CACjC;CAGA,AAFI,KAAe,EAAS,KAAK,CAAa,GAE9C,EAAO,KAAK,yBAAyB;CACrC,IAAM,IAAgB,EAAK,KAAK,EAAQ,MAAM,QAAQ,UAAU,GAC1D,IAAgB,EACpB,GACA,EAAkB,CAAa,CACjC;CAGA,OAFI,KAAe,EAAS,KAAK,CAAa,GAEvC;EACL,SAAS,CAAC;EACV;EACA,SAAS,CAAC;EACV,YAAY,CAAC;EACb,UAAU,CAAC;EACX,aAAa,CAAC;EACd,mBAAmB,CAAC;EACpB,iBAAiB,CAAC;CACpB;AACF"}
@@ -1,6 +1,6 @@
1
1
  import { n as e } from "./logger-CQONztPm.js";
2
2
  import { modifyOutcomeToFile as t } from "./modify-file-PVKmDJHk.js";
3
- import { a as n, r, t as i } from "./test-setup-BGhcb0Qm.js";
3
+ import { a as n, r, t as i } from "./test-setup-BBb4kcoO.js";
4
4
  import a from "node:path";
5
5
  //#region src/patterns/enable/backend/generate.runtime.ts
6
6
  async function o(o) {
@@ -25,4 +25,4 @@ async function o(o) {
25
25
  //#endregion
26
26
  export { o as generate };
27
27
 
28
- //# sourceMappingURL=generate.runtime-BgW9zLGZ.js.map
28
+ //# sourceMappingURL=generate.runtime-C7hKMakQ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.runtime-BgW9zLGZ.js","names":[],"sources":["../../src/patterns/enable/backend/generate.runtime.ts"],"sourcesContent":["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 { modifySvelteConfig } from \"./modifies/svelte-config\";\nimport { modifyGitignore } from \"./modifies/gitignore\";\nimport { modifyTestSetup } from \"./modifies/test-setup\";\n\nexport async function generate(options: Options) {\n const logger = getLogger(options);\n const modifies: File[] = [];\n\n logger.info(\"Modifying adapter config\");\n const adapter = modifySvelteConfig(options.root);\n const svelteConfigFile = modifyOutcomeToFile(\n adapter.filePath,\n adapter.outcome,\n );\n if (svelteConfigFile) modifies.push(svelteConfigFile);\n\n logger.info(\"Modifying .gitignore\");\n const gitignorePath = path.join(options.root, \".gitignore\");\n const gitignoreFile = modifyOutcomeToFile(\n gitignorePath,\n modifyGitignore(gitignorePath),\n );\n if (gitignoreFile) modifies.push(gitignoreFile);\n\n logger.info(\"Modifying test/setup.ts\");\n const testSetupPath = path.join(options.root, \"test\", \"setup.ts\");\n const testSetupFile = modifyOutcomeToFile(\n testSetupPath,\n modifyTestSetup(testSetupPath),\n );\n if (testSetupFile) modifies.push(testSetupFile);\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":";;;;;AAQA,eAAsB,EAAS,GAAkB;CAC/C,IAAM,IAAS,EAAU,CAAO,GAC1B,IAAmB,CAAC;CAE1B,EAAO,KAAK,0BAA0B;CACtC,IAAM,IAAU,EAAmB,EAAQ,IAAI,GACzC,IAAmB,EACvB,EAAQ,UACR,EAAQ,OACV;CAGA,AAFI,KAAkB,EAAS,KAAK,CAAgB,GAEpD,EAAO,KAAK,sBAAsB;CAClC,IAAM,IAAgB,EAAK,KAAK,EAAQ,MAAM,YAAY,GACpD,IAAgB,EACpB,GACA,EAAgB,CAAa,CAC/B;CAGA,AAFI,KAAe,EAAS,KAAK,CAAa,GAE9C,EAAO,KAAK,yBAAyB;CACrC,IAAM,IAAgB,EAAK,KAAK,EAAQ,MAAM,QAAQ,UAAU,GAC1D,IAAgB,EACpB,GACA,EAAgB,CAAa,CAC/B;CAGA,OAFI,KAAe,EAAS,KAAK,CAAa,GAEvC;EACL,SAAS,CAAC;EACV;EACA,SAAS,CAAC;EACV,YAAY,CAAC;EACb,UAAU,CAAC;EACX,aAAa,CAAC;EACd,mBAAmB,CAAC;EACpB,iBAAiB,CAAC;CACpB;AACF"}
1
+ {"version":3,"file":"generate.runtime-C7hKMakQ.js","names":[],"sources":["../../src/patterns/enable/backend/generate.runtime.ts"],"sourcesContent":["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 { modifySvelteConfig } from \"./modifies/svelte-config\";\nimport { modifyGitignore } from \"./modifies/gitignore\";\nimport { modifyTestSetup } from \"./modifies/test-setup\";\n\nexport async function generate(options: Options) {\n const logger = getLogger(options);\n const modifies: File[] = [];\n\n logger.info(\"Modifying adapter config\");\n const adapter = modifySvelteConfig(options.root);\n const svelteConfigFile = modifyOutcomeToFile(\n adapter.filePath,\n adapter.outcome,\n );\n if (svelteConfigFile) modifies.push(svelteConfigFile);\n\n logger.info(\"Modifying .gitignore\");\n const gitignorePath = path.join(options.root, \".gitignore\");\n const gitignoreFile = modifyOutcomeToFile(\n gitignorePath,\n modifyGitignore(gitignorePath),\n );\n if (gitignoreFile) modifies.push(gitignoreFile);\n\n logger.info(\"Modifying test/setup.ts\");\n const testSetupPath = path.join(options.root, \"test\", \"setup.ts\");\n const testSetupFile = modifyOutcomeToFile(\n testSetupPath,\n modifyTestSetup(testSetupPath),\n );\n if (testSetupFile) modifies.push(testSetupFile);\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":";;;;;AAQA,eAAsB,EAAS,GAAkB;CAC/C,IAAM,IAAS,EAAU,CAAO,GAC1B,IAAmB,CAAC;CAE1B,EAAO,KAAK,0BAA0B;CACtC,IAAM,IAAU,EAAmB,EAAQ,IAAI,GACzC,IAAmB,EACvB,EAAQ,UACR,EAAQ,OACV;CAGA,AAFI,KAAkB,EAAS,KAAK,CAAgB,GAEpD,EAAO,KAAK,sBAAsB;CAClC,IAAM,IAAgB,EAAK,KAAK,EAAQ,MAAM,YAAY,GACpD,IAAgB,EACpB,GACA,EAAgB,CAAa,CAC/B;CAGA,AAFI,KAAe,EAAS,KAAK,CAAa,GAE9C,EAAO,KAAK,yBAAyB;CACrC,IAAM,IAAgB,EAAK,KAAK,EAAQ,MAAM,QAAQ,UAAU,GAC1D,IAAgB,EACpB,GACA,EAAgB,CAAa,CAC/B;CAGA,OAFI,KAAe,EAAS,KAAK,CAAa,GAEvC;EACL,SAAS,CAAC;EACV;EACA,SAAS,CAAC;EACV,YAAY,CAAC;EACb,UAAU,CAAC;EACX,aAAa,CAAC;EACd,mBAAmB,CAAC;EACpB,iBAAiB,CAAC;CACpB;AACF"}
@@ -3,26 +3,30 @@ import { o as t, s as n } from "./config-target-DOi8kI_f.js";
3
3
  import r from "node:fs";
4
4
  import { SyntaxKind as i } from "ts-morph";
5
5
  //#region src/patterns/enable/backend/modifies/svelte-config.ts
6
- var a = e`
7
- Switch the SvelteKit adapter to @sveltejs/adapter-auto:
6
+ var a = "@sveltejs/adapter-node", o = "@sveltejs/adapter-static", s = "@sveltejs/adapter-auto", c = e`
7
+ Switch the SvelteKit adapter to ${a}:
8
8
 
9
- import adapter from '@sveltejs/adapter-auto';
9
+ import adapter from '${a}';
10
10
 
11
11
  // ...
12
12
  adapter: adapter()
13
- `, o = e`
14
- Configure @sveltejs/adapter-auto via the sveltekit() plugin in vite.config.ts.
13
+ `, l = e`
14
+ Configure ${a} via the sveltekit() plugin in vite.config.ts.
15
15
  `;
16
- function s(e) {
17
- return e.getImportDeclarations().find((e) => e.getModuleSpecifierValue() === "@sveltejs/adapter-static" || e.getModuleSpecifierValue() === "@sveltejs/adapter-auto");
16
+ function u(e) {
17
+ return e.getImportDeclarations().find((e) => [
18
+ o,
19
+ s,
20
+ a
21
+ ].includes(e.getModuleSpecifierValue()));
18
22
  }
19
- function c(e) {
23
+ function d(e) {
20
24
  return e.getDescendantsOfKind(i.CallExpression).filter((e) => e.getExpression().getText() === "adapter");
21
25
  }
22
- function l(e) {
26
+ function f(e) {
23
27
  let r = t(e, {
24
- notFound: o,
25
- failed: a
28
+ notFound: l,
29
+ failed: c
26
30
  });
27
31
  if (r.status !== "resolved") return {
28
32
  filePath: r.filePath,
@@ -31,16 +35,16 @@ function l(e) {
31
35
  message: r.message
32
36
  }
33
37
  };
34
- let { target: i } = r, l = s(i.sourceFile);
35
- if (!l) return {
38
+ let { target: i } = r, o = u(i.sourceFile);
39
+ if (!o) return {
36
40
  filePath: i.filePath,
37
41
  outcome: {
38
42
  status: "failed",
39
- message: a
43
+ message: c
40
44
  }
41
45
  };
42
- l.getModuleSpecifierValue() === "@sveltejs/adapter-static" && l.setModuleSpecifier("@sveltejs/adapter-auto");
43
- for (let e of c(i.sourceFile)) {
46
+ o.getModuleSpecifierValue() !== a && o.setModuleSpecifier(a);
47
+ for (let e of d(i.sourceFile)) {
44
48
  let t = e.getArguments();
45
49
  for (let n = t.length - 1; n >= 0; n--) e.removeArgument(n);
46
50
  }
@@ -49,10 +53,10 @@ function l(e) {
49
53
  outcome: n(i)
50
54
  };
51
55
  }
52
- function u(e) {
56
+ function p(e) {
53
57
  let r = t(e, {
54
- notFound: o,
55
- failed: a
58
+ notFound: l,
59
+ failed: c
56
60
  });
57
61
  if (r.status !== "resolved") return {
58
62
  filePath: r.filePath,
@@ -61,16 +65,16 @@ function u(e) {
61
65
  changed: !1
62
66
  }
63
67
  };
64
- let { target: i } = r, l = s(i.sourceFile);
65
- if (!l) return {
68
+ let { target: i } = r, a = u(i.sourceFile);
69
+ if (!a) return {
66
70
  filePath: i.filePath,
67
71
  outcome: {
68
72
  status: "success",
69
73
  changed: !1
70
74
  }
71
75
  };
72
- l.getModuleSpecifierValue() === "@sveltejs/adapter-auto" && l.setModuleSpecifier("@sveltejs/adapter-static");
73
- for (let e of c(i.sourceFile)) e.getArguments().length === 0 && e.addArgument("{ fallback: '200.html' }");
76
+ a.getModuleSpecifierValue() !== o && a.setModuleSpecifier(o);
77
+ for (let e of d(i.sourceFile)) e.getArguments().length === 0 && e.addArgument("{ fallback: '200.html' }");
74
78
  return {
75
79
  filePath: i.filePath,
76
80
  outcome: n(i)
@@ -78,7 +82,7 @@ function u(e) {
78
82
  }
79
83
  //#endregion
80
84
  //#region src/patterns/enable/backend/modifies/gitignore.ts
81
- var d = "# PocketBase\n/data/*\n!/data/fixtures\n!/data/seeds\n!/data/hooks\n", f = e`
85
+ var m = "# PocketBase\n/data/*\n!/data/fixtures\n!/data/seeds\n!/data/hooks\n", h = e`
82
86
  Create a .gitignore at the project root with the PocketBase block:
83
87
 
84
88
  # PocketBase
@@ -87,23 +91,23 @@ var d = "# PocketBase\n/data/*\n!/data/fixtures\n!/data/seeds\n!/data/hooks\n",
87
91
  !/data/seeds
88
92
  !/data/hooks
89
93
  `;
90
- function p(e) {
94
+ function g(e) {
91
95
  if (!r.existsSync(e)) return {
92
96
  status: "not-found",
93
- message: f
97
+ message: h
94
98
  };
95
99
  let t = r.readFileSync(e, "utf8");
96
100
  if (t.includes("# PocketBase") && t.includes("/data/*")) return {
97
101
  status: "success",
98
102
  changed: !1
99
103
  };
100
- let n = t + (t.endsWith("\n") ? "\n" : "\n\n") + d;
104
+ let n = t + (t.endsWith("\n") ? "\n" : "\n\n") + m;
101
105
  return r.writeFileSync(e, n, "utf8"), {
102
106
  status: "success",
103
107
  changed: !0
104
108
  };
105
109
  }
106
- function m(e) {
110
+ function _(e) {
107
111
  if (!r.existsSync(e)) return {
108
112
  status: "success",
109
113
  changed: !1
@@ -124,7 +128,7 @@ function m(e) {
124
128
  }
125
129
  //#endregion
126
130
  //#region src/patterns/enable/backend/modifies/test-setup.ts
127
- var h = "import { beforeEach, afterEach, beforeAll } from 'vitest';\nimport supertest, { type Agent } from 'supertest';\nimport PocketBase from 'pocketbase-sveltekit';\nimport type { TestContext } from '@velastack/pocketbase/testing';\n\nconst admin = new PocketBase(process.env.POCKETBASE_URL!) as App.Locals['admin'];\nconst pb = new PocketBase(process.env.POCKETBASE_URL!) as App.Locals['pb'];\n\nconst testUserPassword = 'password';\n\nasync function authenticateUser(agent: Agent, user: { email: string }) {\n await agent.post('/login').type('form').send({\n type: 'password',\n email: user.email,\n password: testUserPassword\n });\n}\n\nbeforeAll(async () => {\n await admin\n // @ts-ignore\n .collection('_superusers')\n .authWithPassword(\n process.env.POCKETBASE_SUPERUSER_EMAIL!,\n process.env.POCKETBASE_SUPERUSER_PASSWORD!\n );\n});\n\nbeforeEach(async (context: TestContext) => {\n context.request = supertest(process.env.VITE_TEST_URL!);\n context.agent = supertest.agent(process.env.VITE_TEST_URL!) as TestContext['agent'];\n context.admin = admin;\n context.pb = pb;\n context.user = await context.admin.collection('users').create({\n email: `test-${Math.random().toString(36).slice(2)}@example.com`,\n password: testUserPassword,\n passwordConfirm: testUserPassword\n });\n context.agent.authenticateUser = () => authenticateUser(context.agent, context.user);\n await context.pb.collection('users').authWithPassword(context.user.email, testUserPassword);\n});\n\nafterEach(async (context: TestContext) => {\n await context.pb.authStore.clear();\n await context.admin.collection('users').delete(context.user.id);\n});\n", g = "import { beforeEach } from 'vitest';\nimport supertest from 'supertest';\n\nbeforeEach(async (context: any) => {\n context.request = supertest(process.env.VITE_TEST_URL!);\n context.agent = supertest.agent(process.env.VITE_TEST_URL!);\n});\n", _ = e`
131
+ var v = "import { beforeEach, afterEach, beforeAll } from 'vitest';\nimport supertest, { type Agent } from 'supertest';\nimport PocketBase from 'pocketbase-sveltekit';\nimport type { TestContext } from '@velastack/pocketbase/testing';\n\nconst admin = new PocketBase(process.env.POCKETBASE_URL!) as App.Locals['admin'];\nconst pb = new PocketBase(process.env.POCKETBASE_URL!) as App.Locals['pb'];\n\nconst testUserPassword = 'password';\n\nasync function authenticateUser(agent: Agent, user: { email: string }) {\n await agent.post('/login').type('form').send({\n type: 'password',\n email: user.email,\n password: testUserPassword\n });\n}\n\nbeforeAll(async () => {\n await admin\n // @ts-ignore\n .collection('_superusers')\n .authWithPassword(\n process.env.POCKETBASE_SUPERUSER_EMAIL!,\n process.env.POCKETBASE_SUPERUSER_PASSWORD!\n );\n});\n\nbeforeEach(async (context: TestContext) => {\n context.request = supertest(process.env.VITE_TEST_URL!);\n context.agent = supertest.agent(process.env.VITE_TEST_URL!) as TestContext['agent'];\n context.admin = admin;\n context.pb = pb;\n context.user = await context.admin.collection('users').create({\n email: `test-${Math.random().toString(36).slice(2)}@example.com`,\n password: testUserPassword,\n passwordConfirm: testUserPassword\n });\n context.agent.authenticateUser = () => authenticateUser(context.agent, context.user);\n await context.pb.collection('users').authWithPassword(context.user.email, testUserPassword);\n});\n\nafterEach(async (context: TestContext) => {\n await context.pb.authStore.clear();\n await context.admin.collection('users').delete(context.user.id);\n});\n", y = "import { beforeEach } from 'vitest';\nimport supertest from 'supertest';\n\nbeforeEach(async (context: any) => {\n context.request = supertest(process.env.VITE_TEST_URL!);\n context.agent = supertest.agent(process.env.VITE_TEST_URL!);\n});\n", b = e`
128
132
  Create test/setup.ts. The default minimal-template setup wires supertest:
129
133
 
130
134
  import { beforeEach } from 'vitest';
@@ -135,28 +139,28 @@ var h = "import { beforeEach, afterEach, beforeAll } from 'vitest';\nimport supe
135
139
  context.agent = supertest.agent(process.env.VITE_TEST_URL!);
136
140
  });
137
141
  `;
138
- function v(e) {
139
- return r.existsSync(e) ? r.readFileSync(e, "utf8") === h ? {
142
+ function x(e) {
143
+ return r.existsSync(e) ? r.readFileSync(e, "utf8") === v ? {
140
144
  status: "success",
141
145
  changed: !1
142
- } : (r.writeFileSync(e, h, "utf8"), {
146
+ } : (r.writeFileSync(e, v, "utf8"), {
143
147
  status: "success",
144
148
  changed: !0
145
149
  }) : {
146
150
  status: "not-found",
147
- message: _
151
+ message: b
148
152
  };
149
153
  }
150
- function y(e) {
151
- return !r.existsSync(e) || r.readFileSync(e, "utf8") === g ? {
154
+ function S(e) {
155
+ return !r.existsSync(e) || r.readFileSync(e, "utf8") === y ? {
152
156
  status: "success",
153
157
  changed: !1
154
- } : (r.writeFileSync(e, g, "utf8"), {
158
+ } : (r.writeFileSync(e, y, "utf8"), {
155
159
  status: "success",
156
160
  changed: !0
157
161
  });
158
162
  }
159
163
  //#endregion
160
- export { l as a, m as i, y as n, u as o, p as r, v as t };
164
+ export { f as a, _ as i, S as n, p as o, g as r, x as t };
161
165
 
162
- //# sourceMappingURL=test-setup-BGhcb0Qm.js.map
166
+ //# sourceMappingURL=test-setup-BBb4kcoO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup-BBb4kcoO.js","names":[],"sources":["../../src/patterns/enable/backend/modifies/svelte-config.ts","../../src/patterns/enable/backend/modifies/gitignore.ts","../../src/patterns/enable/backend/modifies/test-setup.ts"],"sourcesContent":["import dedent from \"dedent\";\nimport { SyntaxKind } from \"ts-morph\";\nimport {\n resolveConfigTarget,\n saveTarget,\n type ConfigModifyResult,\n type ConfigTarget,\n} from \"../../../../runtime/config-target\";\n\nconst ADAPTER_NODE = \"@sveltejs/adapter-node\";\nconst ADAPTER_STATIC = \"@sveltejs/adapter-static\";\nconst ADAPTER_AUTO = \"@sveltejs/adapter-auto\";\n\nconst FAILURE_HINT = dedent`\n Switch the SvelteKit adapter to ${ADAPTER_NODE}:\n\n import adapter from '${ADAPTER_NODE}';\n\n // ...\n adapter: adapter()\n`;\n\nconst NOT_FOUND_HINT = dedent`\n Configure ${ADAPTER_NODE} via the sveltekit() plugin in vite.config.ts.\n`;\n\n/**\n * The adapters this pattern moves between. adapter-auto is included because\n * that is what `sv create` ships, and a project that never chose is one the\n * backend is free to decide for.\n */\nfunction findAdapterImport(sourceFile: ConfigTarget[\"sourceFile\"]) {\n return sourceFile\n .getImportDeclarations()\n .find((decl) =>\n [ADAPTER_STATIC, ADAPTER_AUTO, ADAPTER_NODE].includes(\n decl.getModuleSpecifierValue(),\n ),\n );\n}\n\nfunction adapterCalls(sourceFile: ConfigTarget[\"sourceFile\"]) {\n return sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((ce) => ce.getExpression().getText() === \"adapter\");\n}\n\n/**\n * Switch the adapter to `@sveltejs/adapter-node` and drop its arguments, in\n * whichever file holds the adapter import + `adapter()` call (vite.config when\n * the project uses inline config, else svelte.config). A project with a\n * backend is served from a Node process, which is what `vela deploy` runs.\n * Operates on the import and call expression directly, so it never needs the\n * config object.\n */\nexport function modifySvelteConfig(root: string): ConfigModifyResult {\n const res = resolveConfigTarget(root, {\n notFound: NOT_FOUND_HINT,\n failed: FAILURE_HINT,\n });\n if (res.status !== \"resolved\") {\n return {\n filePath: res.filePath,\n outcome: { status: res.status, message: res.message },\n };\n }\n const { target } = res;\n const adapterImport = findAdapterImport(target.sourceFile);\n if (!adapterImport) {\n return {\n filePath: target.filePath,\n outcome: { status: \"failed\", message: FAILURE_HINT },\n };\n }\n\n if (adapterImport.getModuleSpecifierValue() !== ADAPTER_NODE) {\n adapterImport.setModuleSpecifier(ADAPTER_NODE);\n }\n\n for (const call of adapterCalls(target.sourceFile)) {\n const args = call.getArguments();\n for (let i = args.length - 1; i >= 0; i--) {\n call.removeArgument(i);\n }\n }\n\n return { filePath: target.filePath, outcome: saveTarget(target) };\n}\n\n/**\n * Reverse of {@link modifySvelteConfig}: switch back to\n * `@sveltejs/adapter-static` and restore the `{ fallback: '200.html' }` arg.\n * Lenient — if no config or no adapter import is found, it's a no-op success.\n */\nexport function unmodifySvelteConfig(root: string): ConfigModifyResult {\n const res = resolveConfigTarget(root, {\n notFound: NOT_FOUND_HINT,\n failed: FAILURE_HINT,\n });\n if (res.status !== \"resolved\") {\n // Nothing to revert — treat missing/unparseable config as a no-op.\n return {\n filePath: res.filePath,\n outcome: { status: \"success\", changed: false },\n };\n }\n const { target } = res;\n const adapterImport = findAdapterImport(target.sourceFile);\n if (!adapterImport) {\n return {\n filePath: target.filePath,\n outcome: { status: \"success\", changed: false },\n };\n }\n\n if (adapterImport.getModuleSpecifierValue() !== ADAPTER_STATIC) {\n adapterImport.setModuleSpecifier(ADAPTER_STATIC);\n }\n\n for (const call of adapterCalls(target.sourceFile)) {\n if (call.getArguments().length === 0) {\n call.addArgument(\"{ fallback: '200.html' }\");\n }\n }\n\n return { filePath: target.filePath, outcome: saveTarget(target) };\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\nconst POCKETBASE_BLOCK = `# PocketBase\n/data/*\n!/data/fixtures\n!/data/seeds\n!/data/hooks\n`;\n\nconst NOT_FOUND_HINT = dedent`\n Create a .gitignore at the project root with the PocketBase block:\n\n # PocketBase\n /data/*\n !/data/fixtures\n !/data/seeds\n !/data/hooks\n`;\n\nexport function modifyGitignore(gitignorePath: string): ModifyOutcome {\n if (!fs.existsSync(gitignorePath)) {\n return { status: \"not-found\", message: NOT_FOUND_HINT };\n }\n\n const original = fs.readFileSync(gitignorePath, \"utf8\");\n\n if (original.includes(\"# PocketBase\") && original.includes(\"/data/*\")) {\n return { status: \"success\", changed: false };\n }\n\n const separator = original.endsWith(\"\\n\") ? \"\\n\" : \"\\n\\n\";\n const next = original + separator + POCKETBASE_BLOCK;\n fs.writeFileSync(gitignorePath, next, \"utf8\");\n\n return { status: \"success\", changed: true };\n}\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\n if (!original.includes(\"# PocketBase\")) {\n return { status: \"success\", changed: false };\n }\n\n const withBlockRemoved = original.replace(\n /\\n*# PocketBase\\n\\/data\\/\\*\\n!\\/data\\/fixtures\\n!\\/data\\/seeds\\n!\\/data\\/hooks\\n?/,\n \"\\n\",\n );\n\n const cleaned = withBlockRemoved.replace(/\\n{3,}$/, \"\\n\");\n\n if (cleaned === original) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(gitignorePath, cleaned, \"utf8\");\n return { status: \"success\", changed: true };\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\n// Source of truth: velastack-cli/templates/minimal/test/setup.ts\nconst WITH_BACKEND = `import { beforeEach, afterEach, beforeAll } from 'vitest';\nimport supertest, { type Agent } from 'supertest';\nimport PocketBase from 'pocketbase-sveltekit';\nimport type { TestContext } from '@velastack/pocketbase/testing';\n\nconst admin = new PocketBase(process.env.POCKETBASE_URL!) as App.Locals['admin'];\nconst pb = new PocketBase(process.env.POCKETBASE_URL!) as App.Locals['pb'];\n\nconst testUserPassword = 'password';\n\nasync function authenticateUser(agent: Agent, user: { email: string }) {\n\\tawait agent.post('/login').type('form').send({\n\\t\\ttype: 'password',\n\\t\\temail: user.email,\n\\t\\tpassword: testUserPassword\n\\t});\n}\n\nbeforeAll(async () => {\n\\tawait admin\n\\t\\t// @ts-ignore\n\\t\\t.collection('_superusers')\n\\t\\t.authWithPassword(\n\\t\\t\\tprocess.env.POCKETBASE_SUPERUSER_EMAIL!,\n\\t\\t\\tprocess.env.POCKETBASE_SUPERUSER_PASSWORD!\n\\t\\t);\n});\n\nbeforeEach(async (context: TestContext) => {\n\\tcontext.request = supertest(process.env.VITE_TEST_URL!);\n\\tcontext.agent = supertest.agent(process.env.VITE_TEST_URL!) as TestContext['agent'];\n\\tcontext.admin = admin;\n\\tcontext.pb = pb;\n\\tcontext.user = await context.admin.collection('users').create({\n\\t\\temail: \\`test-\\${Math.random().toString(36).slice(2)}@example.com\\`,\n\\t\\tpassword: testUserPassword,\n\\t\\tpasswordConfirm: testUserPassword\n\\t});\n\\tcontext.agent.authenticateUser = () => authenticateUser(context.agent, context.user);\n\\tawait context.pb.collection('users').authWithPassword(context.user.email, testUserPassword);\n});\n\nafterEach(async (context: TestContext) => {\n\\tawait context.pb.authStore.clear();\n\\tawait context.admin.collection('users').delete(context.user.id);\n});\n`;\n\n// Source of truth: velastack-cli/templates/static/test/setup.ts\nconst WITHOUT_BACKEND = `import { beforeEach } from 'vitest';\nimport supertest from 'supertest';\n\nbeforeEach(async (context: any) => {\n\\tcontext.request = supertest(process.env.VITE_TEST_URL!);\n\\tcontext.agent = supertest.agent(process.env.VITE_TEST_URL!);\n});\n`;\n\nconst NOT_FOUND_HINT = dedent`\n Create test/setup.ts. The default minimal-template setup wires supertest:\n\n import { beforeEach } from 'vitest';\n import supertest from 'supertest';\n\n beforeEach(async (context: any) => {\n context.request = supertest(process.env.VITE_TEST_URL!);\n context.agent = supertest.agent(process.env.VITE_TEST_URL!);\n });\n`;\n\nexport function modifyTestSetup(testSetupPath: string): ModifyOutcome {\n if (!fs.existsSync(testSetupPath)) {\n return { status: \"not-found\", message: NOT_FOUND_HINT };\n }\n\n const original = fs.readFileSync(testSetupPath, \"utf8\");\n if (original === WITH_BACKEND) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(testSetupPath, WITH_BACKEND, \"utf8\");\n return { status: \"success\", changed: true };\n}\n\nexport function unmodifyTestSetup(testSetupPath: string): ModifyOutcome {\n if (!fs.existsSync(testSetupPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(testSetupPath, \"utf8\");\n if (original === WITHOUT_BACKEND) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(testSetupPath, WITHOUT_BACKEND, \"utf8\");\n return { status: \"success\", changed: true };\n}\n"],"mappings":";;;;;AASA,IAAM,IAAe,0BACf,IAAiB,4BACjB,IAAe,0BAEf,IAAe,CAAM;oCACS,EAAa;;yBAExB,EAAa;;;;GAMhC,IAAiB,CAAM;cACf,EAAa;;AAQ3B,SAAS,EAAkB,GAAwC;CACjE,OAAO,EACJ,sBAAsB,CAAC,CACvB,MAAM,MACL;EAAC;EAAgB;EAAc;CAAY,CAAC,CAAC,SAC3C,EAAK,wBAAwB,CAC/B,CACF;AACJ;AAEA,SAAS,EAAa,GAAwC;CAC5D,OAAO,EACJ,qBAAqB,EAAW,cAAc,CAAC,CAC/C,QAAQ,MAAO,EAAG,cAAc,CAAC,CAAC,QAAQ,MAAM,SAAS;AAC9D;AAUA,SAAgB,EAAmB,GAAkC;CACnE,IAAM,IAAM,EAAoB,GAAM;EACpC,UAAU;EACV,QAAQ;CACV,CAAC;CACD,IAAI,EAAI,WAAW,YACjB,OAAO;EACL,UAAU,EAAI;EACd,SAAS;GAAE,QAAQ,EAAI;GAAQ,SAAS,EAAI;EAAQ;CACtD;CAEF,IAAM,EAAE,cAAW,GACb,IAAgB,EAAkB,EAAO,UAAU;CACzD,IAAI,CAAC,GACH,OAAO;EACL,UAAU,EAAO;EACjB,SAAS;GAAE,QAAQ;GAAU,SAAS;EAAa;CACrD;CAGF,AAAI,EAAc,wBAAwB,MAAM,KAC9C,EAAc,mBAAmB,CAAY;CAG/C,KAAK,IAAM,KAAQ,EAAa,EAAO,UAAU,GAAG;EAClD,IAAM,IAAO,EAAK,aAAa;EAC/B,KAAK,IAAI,IAAI,EAAK,SAAS,GAAG,KAAK,GAAG,KACpC,EAAK,eAAe,CAAC;CAEzB;CAEA,OAAO;EAAE,UAAU,EAAO;EAAU,SAAS,EAAW,CAAM;CAAE;AAClE;AAOA,SAAgB,EAAqB,GAAkC;CACrE,IAAM,IAAM,EAAoB,GAAM;EACpC,UAAU;EACV,QAAQ;CACV,CAAC;CACD,IAAI,EAAI,WAAW,YAEjB,OAAO;EACL,UAAU,EAAI;EACd,SAAS;GAAE,QAAQ;GAAW,SAAS;EAAM;CAC/C;CAEF,IAAM,EAAE,cAAW,GACb,IAAgB,EAAkB,EAAO,UAAU;CACzD,IAAI,CAAC,GACH,OAAO;EACL,UAAU,EAAO;EACjB,SAAS;GAAE,QAAQ;GAAW,SAAS;EAAM;CAC/C;CAGF,AAAI,EAAc,wBAAwB,MAAM,KAC9C,EAAc,mBAAmB,CAAc;CAGjD,KAAK,IAAM,KAAQ,EAAa,EAAO,UAAU,GAC/C,AAAI,EAAK,aAAa,CAAC,CAAC,WAAW,KACjC,EAAK,YAAY,0BAA0B;CAI/C,OAAO;EAAE,UAAU,EAAO;EAAU,SAAS,EAAW,CAAM;CAAE;AAClE;;;AC1HA,IAAM,IAAmB,wEAOnB,IAAiB,CAAM;;;;;;;;;AAU7B,SAAgB,EAAgB,GAAsC;CACpE,IAAI,CAAC,EAAG,WAAW,CAAa,GAC9B,OAAO;EAAE,QAAQ;EAAa,SAAS;CAAe;CAGxD,IAAM,IAAW,EAAG,aAAa,GAAe,MAAM;CAEtD,IAAI,EAAS,SAAS,cAAc,KAAK,EAAS,SAAS,SAAS,GAClE,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAI7C,IAAM,IAAO,KADK,EAAS,SAAS,IAAI,IAAI,OAAO,UACf;CAGpC,OAFA,EAAG,cAAc,GAAe,GAAM,MAAM,GAErC;EAAE,QAAQ;EAAW,SAAS;CAAK;AAC5C;AAEA,SAAgB,EAAkB,GAAsC;CACtE,IAAI,CAAC,EAAG,WAAW,CAAa,GAC9B,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAG7C,IAAM,IAAW,EAAG,aAAa,GAAe,MAAM;CAEtD,IAAI,CAAC,EAAS,SAAS,cAAc,GACnC,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAQ7C,IAAM,IALmB,EAAS,QAChC,qFACA,IAGc,CAAA,CAAiB,QAAQ,WAAW,IAAI;CAOxD,OALI,MAAY,IACP;EAAE,QAAQ;EAAW,SAAS;CAAM,KAG7C,EAAG,cAAc,GAAe,GAAS,MAAM,GACxC;EAAE,QAAQ;EAAW,SAAS;CAAK;AAC5C;;;AC1DA,IAAM,IAAe,6mDAiDf,IAAkB,qPASlB,IAAiB,CAAM;;;;;;;;;;;AAY7B,SAAgB,EAAgB,GAAsC;CAWpE,OAVK,EAAG,WAAW,CAAa,IAIf,EAAG,aAAa,GAAe,MAC5C,MAAa,IACR;EAAE,QAAQ;EAAW,SAAS;CAAM,KAG7C,EAAG,cAAc,GAAe,GAAc,MAAM,GAC7C;EAAE,QAAQ;EAAW,SAAS;CAAK,KATjC;EAAE,QAAQ;EAAa,SAAS;CAAe;AAU1D;AAEA,SAAgB,EAAkB,GAAsC;CAWtE,OAVI,CAAC,EAAG,WAAW,CAAa,KAIf,EAAG,aAAa,GAAe,MAC5C,MAAa,IACR;EAAE,QAAQ;EAAW,SAAS;CAAM,KAG7C,EAAG,cAAc,GAAe,GAAiB,MAAM,GAChD;EAAE,QAAQ;EAAW,SAAS;CAAK;AAC5C"}
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ var ue = Object.create, de = Object.defineProperty, fe = Object.getOwnPropertyDe
26
26
  throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
27
27
  }), be = {
28
28
  name: "@velastack/patterns",
29
- version: "0.2.3",
29
+ version: "0.2.4",
30
30
  description: "Registry of VelaStack patterns: generators and modifications applied to SvelteKit projects by the VelaStack CLI.",
31
31
  type: "module",
32
32
  private: !1,
@@ -2612,7 +2612,7 @@ async function Kn(e) {
2612
2612
  }
2613
2613
  //#endregion
2614
2614
  //#region src/patterns/generate/form-remote/generate.preview.ts
2615
- var qn = /* #__PURE__ */ Object.assign({ "./preview-modifies/svelte.config.js": "import adapter from \"@sveltejs/adapter-auto\";\nimport { vitePreprocess } from \"@sveltejs/vite-plugin-svelte\";\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n preprocess: vitePreprocess(),\n kit: {\n adapter,\n // [!code highlight:3]\n experimental: {\n remoteFunctions: true,\n },\n },\n // [!code highlight:5]\n compilerOptions: {\n experimental: {\n async: true,\n },\n },\n};\n\nexport default config;\n" }), Jn = "./preview-modifies/";
2615
+ var qn = /* #__PURE__ */ Object.assign({ "./preview-modifies/svelte.config.js": "import adapter from \"@sveltejs/adapter-node\";\nimport { vitePreprocess } from \"@sveltejs/vite-plugin-svelte\";\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n preprocess: vitePreprocess(),\n kit: {\n adapter,\n // [!code highlight:3]\n experimental: {\n remoteFunctions: true,\n },\n },\n // [!code highlight:5]\n compilerOptions: {\n experimental: {\n async: true,\n },\n },\n};\n\nexport default config;\n" }), Jn = "./preview-modifies/";
2616
2616
  async function Yn(e) {
2617
2617
  return {
2618
2618
  creates: [],
@@ -3667,7 +3667,7 @@ async function ki(e) {
3667
3667
  }
3668
3668
  //#endregion
3669
3669
  //#region src/patterns/generate/scaffold-remote/generate.preview.ts
3670
- var Ai = /* #__PURE__ */ Object.assign({ "./preview-modifies/svelte.config.js": "import adapter from \"@sveltejs/adapter-auto\";\nimport { vitePreprocess } from \"@sveltejs/vite-plugin-svelte\";\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n preprocess: vitePreprocess(),\n kit: {\n adapter,\n // [!code highlight:3]\n experimental: {\n remoteFunctions: true,\n },\n },\n // [!code highlight:5]\n compilerOptions: {\n experimental: {\n async: true,\n },\n },\n};\n\nexport default config;\n" }), ji = "./preview-modifies/";
3670
+ var Ai = /* #__PURE__ */ Object.assign({ "./preview-modifies/svelte.config.js": "import adapter from \"@sveltejs/adapter-node\";\nimport { vitePreprocess } from \"@sveltejs/vite-plugin-svelte\";\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n preprocess: vitePreprocess(),\n kit: {\n adapter,\n // [!code highlight:3]\n experimental: {\n remoteFunctions: true,\n },\n },\n // [!code highlight:5]\n compilerOptions: {\n experimental: {\n async: true,\n },\n },\n};\n\nexport default config;\n" }), ji = "./preview-modifies/";
3671
3671
  async function Mi(e) {
3672
3672
  return {
3673
3673
  creates: [],
@@ -4236,7 +4236,7 @@ var cs = /* #__PURE__ */ Object.assign({
4236
4236
  "./preview-modifies/src/hooks.server.ts": "import { env } from \"$env/dynamic/private\";\nimport { handlePocketbase } from \"@velastack/pocketbase\";\n\nexport const handle = handlePocketbase({\n pocketbaseUrl: env.POCKETBASE_URL,\n superuserEmail: env.POCKETBASE_SUPERUSER_EMAIL,\n superuserPassword: env.POCKETBASE_SUPERUSER_PASSWORD,\n // [!code highlight:1]\n auth: { protectedRoutes: [\"/(app)\"] },\n});\n",
4237
4237
  "./preview-modifies/src/routes/(public)/root-layout.svelte": "<script lang=\"ts\">\n import favicon from \"$lib/assets/favicon.svg\";\n\n import { toggleMode } from \"mode-watcher\";\n import * as Navbar from \"$lib/components/ui/navbar\";\n import { Button } from \"$lib/components/ui/button\";\n // [!code highlight:2]\n import * as AuthMenu from \"$lib/components/ui/auth-menu\";\n import * as Avatar from \"$lib/components/ui/avatar\";\n\n let { children, data } = $props();\n<\/script>\n\n<div class=\"min-h-dvh grid grid-rows-[max-content_1fr_max-content] root-layout\">\n <Navbar.Root>\n <Navbar.Brand href=\"/\">\n <Navbar.Logo src={favicon} alt=\"Logo\" />\n </Navbar.Brand>\n\n <Navbar.MobileToggle />\n\n <Navbar.List>\n <Navbar.Item>\n <Button\n class=\"w-full justify-start md:justify-center md:w-auto\"\n href=\"/\"\n variant=\"ghost\"\n >\n Home\n </Button>\n </Navbar.Item>\n\n <!-- [!code highlight:44] -->\n <Navbar.Item\n class=\"flex flex-col md:flex-row items-center space-y-2 md:space-y-0 md:space-x-4\"\n >\n <AuthMenu.Root>\n {#snippet user()}\n <AuthMenu.Trigger>\n <Avatar.Root>\n {#if data.user?.avatar}\n <Avatar.Image\n src=\"/api/files/users/{data.user?.id}/{data.user?.avatar}\"\n alt={data.user?.email}\n />\n {/if}\n <Avatar.Fallback>\n {data.user?.email?.charAt(0).toUpperCase()}\n </Avatar.Fallback>\n </Avatar.Root>\n </AuthMenu.Trigger>\n <AuthMenu.Content align=\"end\">\n <AuthMenu.Item href=\"/dashboard\">Dashboard</AuthMenu.Item>\n <AuthMenu.Group>\n <AuthMenu.Item href=\"/settings\">Settings</AuthMenu.Item>\n <AuthMenu.Item>\n <form action=\"/logout\" method=\"post\">\n <button type=\"submit\" class=\"contents\">Logout</button>\n </form>\n </AuthMenu.Item>\n </AuthMenu.Group>\n </AuthMenu.Content>\n {/snippet}\n {#snippet guest()}\n <Button\n class=\"w-full justify-start md:justify-center md:w-auto\"\n variant=\"ghost\"\n href=\"/login\">Login</Button\n >\n <Button\n class=\"w-full justify-start md:justify-center md:w-auto\"\n variant=\"outline\"\n href=\"/signup\">Sign up</Button\n >\n {/snippet}\n </AuthMenu.Root>\n </Navbar.Item>\n </Navbar.List>\n </Navbar.Root>\n\n {@render children?.()}\n\n <footer class=\"border-t border-border py-4\">\n <div\n class=\"mx-auto flex max-w-7xl px-4 flex-col items-center justify-between gap-3 sm:flex-row\"\n >\n <p class=\"text-muted-foreground text-sm\">\n &copy; {new Date().getFullYear()}\n {data.meta.appName}. All rights reserved.\n </p>\n <nav class=\"flex items-center gap-4 text-sm\">\n <Button onclick={toggleMode} variant=\"ghost\" size=\"icon\">\n <Navbar.Mode />\n </Button>\n <a href=\"/privacy\" class=\"underline-offset-4 hover:underline\">Privacy</a\n >\n <a href=\"/terms\" class=\"underline-offset-4 hover:underline\">Terms</a>\n </nav>\n </div>\n </footer>\n</div>\n\n<style lang=\"postcss\">\n @reference \"tailwindcss\";\n\n .root-layout :global(section[data-role=\"content\"]) {\n @apply container mx-auto max-w-7xl px-4 py-8 w-full;\n }\n</style>\n",
4238
4238
  "./preview-modifies/src/routes/+layout.server.ts": "import { loadFlash } from \"sveltekit-flash-message/server\";\n\nexport const load = loadFlash(async ({ locals }) => {\n return {\n // [!code highlight:1]\n user: locals.pb.authStore.record,\n };\n});\n",
4239
- "./preview-modifies/svelte.config.js": "import adapter from \"@sveltejs/adapter-auto\";\nimport { vitePreprocess } from \"@sveltejs/vite-plugin-svelte\";\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n preprocess: vitePreprocess(),\n kit: {\n adapter,\n // [!code highlight:3]\n experimental: {\n remoteFunctions: true,\n },\n },\n // [!code highlight:5]\n compilerOptions: {\n experimental: {\n async: true,\n },\n },\n};\n\nexport default config;\n"
4239
+ "./preview-modifies/svelte.config.js": "import adapter from \"@sveltejs/adapter-node\";\nimport { vitePreprocess } from \"@sveltejs/vite-plugin-svelte\";\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n preprocess: vitePreprocess(),\n kit: {\n adapter,\n // [!code highlight:3]\n experimental: {\n remoteFunctions: true,\n },\n },\n // [!code highlight:5]\n compilerOptions: {\n experimental: {\n async: true,\n },\n },\n};\n\nexport default config;\n"
4240
4240
  }), ls = "./preview-modifies/";
4241
4241
  async function us(e) {
4242
4242
  return {
@@ -4584,7 +4584,8 @@ async function oc(e) {
4584
4584
  packages: [
4585
4585
  "@velastack/pocketbase",
4586
4586
  "@velastack/kit",
4587
- "pocketbase-sveltekit"
4587
+ "pocketbase-sveltekit",
4588
+ "@sveltejs/adapter-node"
4588
4589
  ],
4589
4590
  collections: [],
4590
4591
  collectionPatches: [],
@@ -4594,7 +4595,7 @@ async function oc(e) {
4594
4595
  //#endregion
4595
4596
  //#region src/patterns/enable/backend/generate.preview.ts
4596
4597
  var sc = /* #__PURE__ */ Object.assign({
4597
- "./preview-modifies/svelte.config.js": "import adapter from '@sveltejs/adapter-auto';\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n compilerOptions: {\n runes: ({ filename }) => (filename.split(/[/\\\\]/).includes('node_modules') ? undefined : true)\n },\n kit: {\n adapter: adapter()\n }\n};\n\nexport default config;\n",
4598
+ "./preview-modifies/svelte.config.js": "import adapter from '@sveltejs/adapter-node';\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n compilerOptions: {\n runes: ({ filename }) => (filename.split(/[/\\\\]/).includes('node_modules') ? undefined : true)\n },\n kit: {\n adapter: adapter()\n }\n};\n\nexport default config;\n",
4598
4599
  "./preview-modifies/test/setup.ts": "import { beforeEach, afterEach, beforeAll } from 'vitest';\nimport supertest, { type Agent } from 'supertest';\nimport PocketBase from 'pocketbase-sveltekit';\nimport type { TestContext } from '@velastack/pocketbase/testing';\n\nconst admin = new PocketBase(process.env.POCKETBASE_URL!) as App.Locals['admin'];\nconst pb = new PocketBase(process.env.POCKETBASE_URL!) as App.Locals['pb'];\n\nconst testUserPassword = 'password';\n\nasync function authenticateUser(agent: Agent, user: { email: string }) {\n await agent.post('/login').type('form').send({\n type: 'password',\n email: user.email,\n password: testUserPassword\n });\n}\n\nbeforeAll(async () => {\n await admin\n // @ts-ignore\n .collection('_superusers')\n .authWithPassword(\n process.env.POCKETBASE_SUPERUSER_EMAIL!,\n process.env.POCKETBASE_SUPERUSER_PASSWORD!\n );\n});\n\nbeforeEach(async (context: TestContext) => {\n context.request = supertest(process.env.VITE_TEST_URL!);\n context.agent = supertest.agent(process.env.VITE_TEST_URL!) as TestContext['agent'];\n context.admin = admin;\n context.pb = pb;\n context.user = await context.admin.collection('users').create({\n email: `test-${Math.random().toString(36).slice(2)}@example.com`,\n password: testUserPassword,\n passwordConfirm: testUserPassword\n });\n context.agent.authenticateUser = () => authenticateUser(context.agent, context.user);\n await context.pb.collection('users').authWithPassword(context.user.email, testUserPassword);\n});\n\nafterEach(async (context: TestContext) => {\n await context.pb.authStore.clear();\n await context.admin.collection('users').delete(context.user.id);\n});\n"
4599
4600
  }), cc = "./preview-modifies/";
4600
4601
  async function lc(e) {
@@ -4626,7 +4627,7 @@ async function mc(e) {
4626
4627
  let r = await lc(e);
4627
4628
  return n(i([t, r]), e);
4628
4629
  }
4629
- let { generate: r } = await import("./chunks/generate.runtime-BgW9zLGZ.js"), a = await r(e), { writeResult: o } = await import("./chunks/write-result-BHCOxcsA.js");
4630
+ let { generate: r } = await import("./chunks/generate.runtime-C7hKMakQ.js"), a = await r(e), { writeResult: o } = await import("./chunks/write-result-BHCOxcsA.js");
4630
4631
  return o(await n(i([t, a]), e), e);
4631
4632
  }
4632
4633
  var hc = {
@@ -4636,7 +4637,7 @@ var hc = {
4636
4637
  docs: pc,
4637
4638
  plan: "open",
4638
4639
  title: "Enable Backend",
4639
- summary: "Adds the PocketBase backend: installs @velastack/pocketbase and pocketbase-sveltekit, wires up hooks.server.ts, scaffolds the data/ directory, and switches the SvelteKit adapter from static to auto.",
4640
+ summary: "Adds the PocketBase backend: installs @velastack/pocketbase and pocketbase-sveltekit, wires up hooks.server.ts, scaffolds the data/ directory, and switches the SvelteKit adapter to adapter-node.",
4640
4641
  requires: {
4641
4642
  auth: !1,
4642
4643
  api: !1,
@@ -4729,7 +4730,7 @@ async function Uc(e) {
4729
4730
  var Wc = /* #__PURE__ */ Object.assign({
4730
4731
  "./preview-modifies/src/routes/(public)/root-layout.svelte": "<script lang=\"ts\">\n import favicon from '$lib/assets/favicon.svg';\n\n import { toggleMode } from 'mode-watcher';\n import * as Navbar from '$lib/components/ui/navbar';\n import { Button } from '$lib/components/ui/button';\n\n let { children, data } = $props();\n<\/script>\n\n<div class=\"min-h-dvh grid grid-rows-[max-content_1fr_max-content] root-layout\">\n <Navbar.Root>\n <Navbar.Brand href=\"/\">\n <Navbar.Logo src={favicon} alt=\"Logo\" />\n </Navbar.Brand>\n\n <Navbar.MobileToggle />\n\n <Navbar.List>\n <Navbar.Item>\n <Button class=\"w-full justify-start md:justify-center md:w-auto\" href=\"/\" variant=\"ghost\">\n Home\n </Button>\n </Navbar.Item>\n <!-- [!code highlight:5] -->\n <Navbar.Item>\n <Button class=\"w-full justify-start md:justify-center md:w-auto\" href=\"/blog\" variant=\"ghost\">\n Blog\n </Button>\n </Navbar.Item>\n </Navbar.List>\n </Navbar.Root>\n\n {@render children?.()}\n\n <footer class=\"border-t border-border py-4\">\n <div\n class=\"mx-auto flex max-w-7xl px-4 flex-col items-center justify-between gap-3 sm:flex-row\"\n >\n <p class=\"text-muted-foreground text-sm\">\n &copy; {new Date().getFullYear()}\n {data.meta.appName}. All rights reserved.\n </p>\n <nav class=\"flex items-center gap-4 text-sm\">\n <Button onclick={toggleMode} variant=\"ghost\" size=\"icon\">\n <Navbar.Mode />\n </Button>\n <a href=\"/privacy\" class=\"underline-offset-4 hover:underline\">Privacy</a>\n <a href=\"/terms\" class=\"underline-offset-4 hover:underline\">Terms</a>\n </nav>\n </div>\n </footer>\n</div>\n\n<style lang=\"postcss\">\n @reference \"tailwindcss\";\n\n .root-layout :global(section[data-role='content']) {\n @apply container mx-auto max-w-7xl px-4 py-8 w-full;\n }\n</style>\n",
4731
4732
  "./preview-modifies/src/routes/+layout.svelte": "<script lang=\"ts\">\n import '../app.css';\n // [!code highlight:1]\n import '../css/prism-vsc-dark-plus.css';\n\n import { ModeWatcher } from 'mode-watcher';\n import { getFlash } from 'sveltekit-flash-message';\n import { toast } from 'svelte-sonner';\n import { page } from '$app/state';\n import { Toaster } from '$lib/components/ui/sonner';\n import { MetaTags, deepMerge } from 'svelte-meta-tags';\n\n let { data, children } = $props();\n const flash = getFlash(page);\n\n $effect(() => {\n if (!$flash || $flash.type !== 'toast') {\n return;\n }\n\n toast.message($flash.message);\n\n $flash = undefined;\n });\n\n let metaTags = $derived(deepMerge(data.baseMetaTags, page.data.pageMetaTags));\n<\/script>\n\n<svelte:head>\n <title>{data.meta.appName}</title>\n</svelte:head>\n\n<MetaTags {...metaTags} />\n<ModeWatcher />\n<Toaster />\n\n{@render children?.()}\n",
4732
- "./preview-modifies/svelte.config.js": "import adapter from \"@sveltejs/adapter-auto\";\n// [!code highlight:1]\nimport { mdsvex } from \"mdsvex\";\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n // [!code highlight:2]\n extensions: [\".svelte\", \".svx\"],\n preprocess: [mdsvex()],\n compilerOptions: {\n // Force runes mode for the project, except for libraries. Can be removed in svelte 6.\n runes: ({ filename }) =>\n filename.split(/[/\\\\]/).includes(\"node_modules\") ? undefined : true,\n },\n kit: {\n // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.\n // If your environment is not supported, or you settled on a specific environment, switch out the adapter.\n // See https://svelte.dev/docs/kit/adapters for more information about adapters.\n adapter: adapter(),\n },\n};\n\nexport default config;\n"
4733
+ "./preview-modifies/svelte.config.js": "import adapter from \"@sveltejs/adapter-node\";\n// [!code highlight:1]\nimport { mdsvex } from \"mdsvex\";\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n // [!code highlight:2]\n extensions: [\".svelte\", \".svx\"],\n preprocess: [mdsvex()],\n compilerOptions: {\n // Force runes mode for the project, except for libraries. Can be removed in svelte 6.\n runes: ({ filename }) =>\n filename.split(/[/\\\\]/).includes(\"node_modules\") ? undefined : true,\n },\n kit: {\n adapter: adapter(),\n },\n};\n\nexport default config;\n"
4733
4734
  }), Gc = "./preview-modifies/";
4734
4735
  async function Kc(e) {
4735
4736
  return {
@@ -4804,7 +4805,7 @@ var Qc = {
4804
4805
  }, $c = /* #__PURE__ */ Object.assign({
4805
4806
  "./preview-modifies/src/routes/+layout.server.ts": "import { loadFlash } from 'sveltekit-flash-message/server';\nimport { defineBaseMetaTags } from 'svelte-meta-tags';\nimport { error, redirect } from '@sveltejs/kit';\nimport { loadCms } from '$lib/cms';\n\nexport const load = loadFlash(async (event) => {\n const { locals, url } = event;\n const canonical = new URL(url.pathname, url.origin).href;\n\n const baseTags = defineBaseMetaTags({\n title: '',\n titleTemplate: `%s | ${locals.meta.appName}`,\n description: '',\n canonical,\n openGraph: {\n type: 'website',\n url: canonical,\n images: [\n {\n url: `${locals.meta.appURL}/og.jpg`,\n alt: locals.meta.appName,\n width: 1200,\n height: 630\n }\n ]\n }\n });\n\n // [!code highlight:6]\n const { cms, notFound, gone, redirectTo } = await loadCms(event, {\n locale: 'en'\n });\n if (redirectTo) redirect(308, redirectTo);\n if (gone) error(410, 'Gone');\n if (notFound) error(404, 'Not found');\n\n return {\n meta: locals.meta,\n cms,\n ...baseTags\n };\n});\n",
4806
4807
  "./preview-modifies/src/routes/+layout.svelte": "<script lang=\"ts\">\n import '../app.css';\n\n import favicon from '$lib/assets/favicon.svg';\n\n import { ModeWatcher } from 'mode-watcher';\n import { getFlash } from 'sveltekit-flash-message';\n import { toast } from 'svelte-sonner';\n import { page } from '$app/state';\n import { Toaster } from '$lib/components/ui/sonner';\n import { MetaTags, deepMerge } from 'svelte-meta-tags';\n // [!code highlight:1]\n import { AdminBar } from '@velastack/cms';\n\n let { data, children } = $props();\n const flash = getFlash(page);\n\n $effect(() => {\n if (!$flash || $flash.type !== 'toast') {\n return;\n }\n\n toast.message($flash.message);\n\n $flash = undefined;\n });\n\n let metaTags = $derived(deepMerge(data.baseMetaTags, page.data.pageMetaTags));\n<\/script>\n\n<svelte:head>\n <title>{data.meta.appName}</title>\n <link rel=\"icon\" href={favicon} />\n</svelte:head>\n\n<MetaTags {...metaTags} />\n<ModeWatcher />\n<Toaster />\n<!-- [!code highlight:1] -->\n<AdminBar />\n\n{@render children?.()}\n",
4807
- "./preview-modifies/vite.config.ts": "// [!code highlight:1]\nimport { cms } from '@velastack/cms/vite';\nimport { defineConfig } from 'vite';\nimport tailwindcss from '@tailwindcss/vite';\nimport { sveltekit } from '@sveltejs/kit/vite';\nimport adapter from '@sveltejs/adapter-auto';\n\nexport default defineConfig({\n plugins: [\n tailwindcss(),\n // [!code highlight:1]\n cms(),\n sveltekit({\n compilerOptions: {\n runes: ({ filename }) =>\n filename.split(/[/\\\\]/).includes('node_modules') ? undefined : true\n },\n adapter: adapter(),\n // Prerendering has no request to take an origin from, so without this\n // every canonical link and `og:url` on a prerendered page would be built\n // from SvelteKit's placeholder host. `vela build` sets it from the domain\n // the target is deployed on; unset, SvelteKit's default stands.\n ...(process.env.VELA_ORIGIN\n ? { prerender: { origin: process.env.VELA_ORIGIN } }\n : {})\n })\n ]\n});\n"
4808
+ "./preview-modifies/vite.config.ts": "// [!code highlight:1]\nimport { cms } from '@velastack/cms/vite';\nimport { defineConfig } from 'vite';\nimport tailwindcss from '@tailwindcss/vite';\nimport { sveltekit } from '@sveltejs/kit/vite';\nimport adapter from '@sveltejs/adapter-node';\n\nexport default defineConfig({\n plugins: [\n tailwindcss(),\n // [!code highlight:1]\n cms(),\n sveltekit({\n compilerOptions: {\n runes: ({ filename }) =>\n filename.split(/[/\\\\]/).includes('node_modules') ? undefined : true\n },\n adapter: adapter(),\n // Prerendering has no request to take an origin from, so without this\n // every canonical link and `og:url` on a prerendered page would be built\n // from SvelteKit's placeholder host. `vela build` sets it from the domain\n // the target is deployed on; unset, SvelteKit's default stands.\n ...(process.env.VELA_ORIGIN\n ? { prerender: { origin: process.env.VELA_ORIGIN } }\n : {})\n })\n ]\n});\n"
4808
4809
  }), el = "./preview-modifies/";
4809
4810
  async function tl(e) {
4810
4811
  return {
@@ -5026,7 +5027,7 @@ var Fl = /* #__PURE__ */ Object.assign({
5026
5027
  "./preview-modifies/src/hooks.server.ts": "import { env } from \"$env/dynamic/private\";\nimport { handlePocketbase } from \"@velastack/pocketbase\";\n// [!code highlight:6]\nimport { sequence } from \"@sveltejs/kit/hooks\";\nimport { runWithLocale, loadLocales } from \"wuchale/load-utils/server\";\nimport { getLocale } from \"$locales/main.url\";\nimport { locales } from \"$locales/data\";\nimport * as main from \"$locales/main.loader.server.svelte.js\";\nimport * as js from \"$locales/js.loader.server.js\";\n\n// [!code highlight:2]\nloadLocales(main.key, main.loadCount, main.loadCatalog, locales);\nloadLocales(js.key, js.loadCount, js.loadCatalog, locales);\n\n// [!code highlight:9]\nconst handleWuchale = async ({ event, resolve }: any) => {\n const locale = getLocale(event.url);\n return await runWithLocale(locale, () =>\n resolve(event, {\n transformPageChunk: ({ html }: { html: string }) =>\n html.replace(\"%sveltekit.lang%\", locale),\n }),\n );\n};\n\nexport const handle = sequence(\n // [!code highlight:1]\n handleWuchale,\n handlePocketbase({\n pocketbaseUrl: env.POCKETBASE_URL,\n superuserEmail: env.POCKETBASE_SUPERUSER_EMAIL,\n superuserPassword: env.POCKETBASE_SUPERUSER_PASSWORD,\n }),\n);\n",
5027
5028
  "./preview-modifies/src/routes/(public)/root-layout.svelte": "<script lang=\"ts\">\n import favicon from '$lib/assets/favicon.svg';\n\n import { toggleMode } from 'mode-watcher';\n import * as Navbar from '$lib/components/ui/navbar';\n import { Button } from '$lib/components/ui/button';\n // [!code highlight]\n import LanguageSelect from '$lib/components/language-select.svelte';\n\n let { children, data } = $props();\n<\/script>\n\n<div class=\"min-h-dvh grid grid-rows-[max-content_1fr_max-content] root-layout\">\n <Navbar.Root>\n <Navbar.Brand href=\"/\">\n <Navbar.Logo src={favicon} alt=\"Logo\" />\n </Navbar.Brand>\n\n <Navbar.MobileToggle />\n\n <Navbar.List>\n <Navbar.Item>\n <Button class=\"w-full justify-start md:justify-center md:w-auto\" href=\"/\" variant=\"ghost\">\n Home\n </Button>\n </Navbar.Item>\n <!-- [!code highlight:3] -->\n <Navbar.Item>\n <LanguageSelect />\n </Navbar.Item>\n </Navbar.List>\n </Navbar.Root>\n\n {@render children?.()}\n\n <footer class=\"border-t border-border py-4\">\n <div\n class=\"mx-auto flex max-w-7xl px-4 flex-col items-center justify-between gap-3 sm:flex-row\"\n >\n <p class=\"text-muted-foreground text-sm\">\n &copy; {new Date().getFullYear()}\n {data.meta.appName}. All rights reserved.\n </p>\n <nav class=\"flex items-center gap-4 text-sm\">\n <Button onclick={toggleMode} variant=\"ghost\" size=\"icon\">\n <Navbar.Mode />\n </Button>\n <a href=\"/privacy\" class=\"underline-offset-4 hover:underline\">Privacy</a>\n <a href=\"/terms\" class=\"underline-offset-4 hover:underline\">Terms</a>\n </nav>\n </div>\n </footer>\n</div>\n\n<style lang=\"postcss\">\n @reference \"tailwindcss\";\n\n .root-layout :global(section[data-role='content']) {\n @apply container mx-auto max-w-7xl px-4 py-8 w-full;\n }\n</style>\n",
5028
5029
  "./preview-modifies/src/routes/+layout.ts": "import { browser } from \"$app/environment\";\n// [!code highlight:4]\nimport { loadLocale } from \"wuchale/load-utils\";\nimport { getLocale } from \"$locales/main.url\";\nimport \"$locales/main.loader.svelte\";\nimport \"$locales/js.loader\";\n\nexport const load = async ({ url, data }) => {\n // [!code highlight:5]\n const locale = getLocale(url);\n\n if (browser) {\n await loadLocale(locale);\n }\n\n return data;\n};\n",
5029
- "./preview-modifies/svelte.config.js": "import adapter from \"@sveltejs/adapter-auto\";\nimport { vitePreprocess } from \"@sveltejs/vite-plugin-svelte\";\n\nconst config = {\n preprocess: vitePreprocess(),\n kit: {\n adapter,\n // [!code highlight:3]\n alias: {\n $locales: \"src/locales\",\n },\n },\n};\n\nexport default config;\n",
5030
+ "./preview-modifies/svelte.config.js": "import adapter from \"@sveltejs/adapter-node\";\nimport { vitePreprocess } from \"@sveltejs/vite-plugin-svelte\";\n\nconst config = {\n preprocess: vitePreprocess(),\n kit: {\n adapter,\n // [!code highlight:3]\n alias: {\n $locales: \"src/locales\",\n },\n },\n};\n\nexport default config;\n",
5030
5031
  "./preview-modifies/vite.config.ts": "import { defineConfig } from \"vite\";\nimport { sveltekit } from \"@sveltejs/kit/vite\";\nimport tailwindcss from \"@tailwindcss/vite\";\n// [!code highlight:1]\nimport { wuchale } from \"wuchale/vite\";\n\nexport default defineConfig({\n // [!code highlight:1]\n plugins: [wuchale(), tailwindcss(), sveltekit()],\n});\n"
5031
5032
  }), Il = "./preview-modifies/";
5032
5033
  async function Ll(e) {
@@ -6858,7 +6859,7 @@ async function Rp(e) {
6858
6859
  status: "success"
6859
6860
  }]).sort((e, t) => e.path.localeCompare(t.path)),
6860
6861
  components: [],
6861
- packages: [],
6862
+ packages: ["@sveltejs/adapter-static"],
6862
6863
  collections: [],
6863
6864
  collectionPatches: [],
6864
6865
  collectionDrops: []
@@ -6870,7 +6871,7 @@ var zp = "disable-backend", Bp = "1.0.0", Vp = "src/patterns/disable/backend", H
6870
6871
  async function Up(e) {
6871
6872
  let t = await Rp(e);
6872
6873
  if (e.env !== "runtime") return n(t, e);
6873
- let { generate: r } = await import("./chunks/generate.runtime-qsPylve5.js"), a = await r(e), o = await n(i([t, a]), e);
6874
+ let { generate: r } = await import("./chunks/generate.runtime-Bb_j7P3G.js"), a = await r(e), o = await n(i([t, a]), e);
6874
6875
  if (e.input.destructive !== !0) return o;
6875
6876
  let { writeResult: s } = await import("./chunks/write-result-BHCOxcsA.js");
6876
6877
  return s(o, e);