void 0.21.2 → 0.21.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.
Files changed (184) hide show
  1. package/dist/{account-cmd-D8OC-U7y.mjs → account-cmd-DGt9cpRe.mjs} +4 -4
  2. package/dist/{agents-gni4eqBu.mjs → agents-B_pX_HmQ.mjs} +1 -1
  3. package/dist/ast-CPGPjb0V.mjs +18 -0
  4. package/dist/{auth-CAw7zHqj.mjs → auth-CZuiVsFh.mjs} +1 -1
  5. package/dist/{auth-B9_D6ygs.mjs → auth-DLNN0D3Z.mjs} +4 -4
  6. package/dist/{auth-link-BYFeMJAp.mjs → auth-link-Cl9vOuf7.mjs} +4 -4
  7. package/dist/{auth-router-OHZNmrb_.mjs → auth-router-D4ZcMUSf.mjs} +6 -6
  8. package/dist/{better-auth-shared-BoVwA5Vm.d.mts → better-auth-shared-BVkjZ3vM.d.mts} +1 -0
  9. package/dist/{better-auth-shared-syGYYmnY.mjs → better-auth-shared-rsBGBvWJ.mjs} +3 -6
  10. package/dist/{build-cmd-Bft7EY51.mjs → build-cmd-Dpt0jd-x.mjs} +4 -4
  11. package/dist/{cache-CKV1Gz2w.mjs → cache-7_UeZdTk.mjs} +4 -4
  12. package/dist/{cancel-deploy-BAKmkX4f.mjs → cancel-deploy-D23R1RXT.mjs} +3 -3
  13. package/dist/{cf-access-rAZxzMkL.mjs → cf-access-P0iZnu0q.mjs} +1 -1
  14. package/dist/{cf-build-output-CTdlo6Rt.mjs → cf-build-output-CGT03qCD.mjs} +2 -2
  15. package/dist/cli/cf-compat.mjs +2 -2
  16. package/dist/cli/cli.mjs +47 -43
  17. package/dist/cli/env-schema-probe.mjs +3 -3
  18. package/dist/client-4cDVv7BO.mjs +2 -0
  19. package/dist/{client-PdAJ-F0t.mjs → client-QTl6ko_D.mjs} +28 -5
  20. package/dist/{cloudflare-auth-BCmTc1X_.mjs → cloudflare-auth-B9jPCkV2.mjs} +1 -1
  21. package/dist/{cloudflare-cmd-D6PrKn7o.mjs → cloudflare-cmd-BjNxR1XF.mjs} +3 -3
  22. package/dist/{cloudflare-connect-DloREDlc.mjs → cloudflare-connect-CCUozPOe.mjs} +3 -3
  23. package/dist/{cloudflare-operations-BHNJVDbN.mjs → cloudflare-operations-BipGMJ5O.mjs} +1 -1
  24. package/dist/{cloudflare-operations-CPEdHYhM.mjs → cloudflare-operations-sMZXpk_S.mjs} +4 -4
  25. package/dist/collect-DLyFDiKW.mjs +2 -0
  26. package/dist/{collect-DXHNWHcT.mjs → collect-DiTn9yr6.mjs} +1 -1
  27. package/dist/config-0acf1oys.mjs +2 -0
  28. package/dist/{config-DywxBLQC.d.mts → config-CF69HgXc.d.mts} +7 -0
  29. package/dist/{config-Dxr6cTXn.mjs → config-CafTW6Cz.mjs} +12 -1
  30. package/dist/{config-BSe70f4T.mjs → config-D8MOgiQV.mjs} +3 -3
  31. package/dist/config-DPByhVck.mjs +32 -0
  32. package/dist/config-entry.d.mts +1 -1
  33. package/dist/{config--T87TD8T.mjs → config-s7Xj7tPb.mjs} +1 -1
  34. package/dist/{config-write-y3CBI_ux.mjs → config-write-BSduPMY8.mjs} +3 -3
  35. package/dist/{connect-DLx1pRYk.mjs → connect-4Ph5Y0QE.mjs} +7 -7
  36. package/dist/{create-project-JV9-6ICF.mjs → create-project-BniEV0OW.mjs} +1 -1
  37. package/dist/{create-project-BZBl_gQ0.mjs → create-project-DBfFSZKY.mjs} +4 -4
  38. package/dist/{db-B98_UV4H.mjs → db-DzJRn-qz.mjs} +123 -55
  39. package/dist/{delete-BEEyqlwd.mjs → delete-D6dZ9B6B.mjs} +4 -4
  40. package/dist/deploy-BH0grP4y.mjs +2 -0
  41. package/dist/{deploy-Bsymb0_c.mjs → deploy-CsMJrPfM.mjs} +520 -260
  42. package/dist/discover-AMCBXivQ.mjs +2 -0
  43. package/dist/{discover-C4O6YxVS.mjs → discover-BcPPiF1o.mjs} +2 -2
  44. package/dist/{dist-4WkAWhWx.mjs → dist-BVqXeR_h.mjs} +9 -1
  45. package/dist/dist-_UUlL6bg.mjs +2 -0
  46. package/dist/{domain-Av2AkLQP.mjs → domain-Dmhvb2oU.mjs} +4 -4
  47. package/dist/{email-C5kaZXzJ.mjs → email--tEtMoj_.mjs} +1 -1
  48. package/dist/{email-CUqa6TtH.mjs → email-BRKOG2RG.mjs} +9 -9
  49. package/dist/{entry-DdRFGK0y.mjs → entry-CF5wvH4w.mjs} +4 -21
  50. package/dist/{env-D4RIGEzz.mjs → env-Csi-tMbT.mjs} +7 -7
  51. package/dist/{env-Yz4HcvHs.mjs → env-D5liuQYR.mjs} +5 -2
  52. package/dist/{env-DX_v-Q-v.mjs → env-_v349JBd.mjs} +1 -1
  53. package/dist/{env-types-CWDtqHgw.mjs → env-types-C2_bIk_b.mjs} +2 -2
  54. package/dist/{env-validation-BsFEXps5.mjs → env-validation-BB4GkLxn.mjs} +4 -4
  55. package/dist/{env-validation-DIDGM7h4.mjs → env-validation-BXge7uyK.mjs} +1 -1
  56. package/dist/{gen-pg-Ojg8Y.mjs → gen-Dz3X1Qab.mjs} +8 -8
  57. package/dist/gen-Vnv2f65C.mjs +2 -0
  58. package/dist/{generate-C0VY6RVf.mjs → generate-GDbL7sUr.mjs} +2 -2
  59. package/dist/{github-cmd-BEK4VprE.mjs → github-cmd-BED3_9JD.mjs} +4 -4
  60. package/dist/{headers-B_HBMgi0.mjs → headers-BOg_velo.mjs} +2 -2
  61. package/dist/{help-iQOt7WHk.mjs → help-DC7gdz7L.mjs} +7 -3
  62. package/dist/help-DQMfeKMz.mjs +2 -0
  63. package/dist/index.mjs +132 -158
  64. package/dist/{init-D5niUPAz.mjs → init-CRGDXzVC.mjs} +105 -289
  65. package/dist/{link-3lGrfXzd.mjs → link-CsHOinF7.mjs} +5 -5
  66. package/dist/{list-CVjGr_C6.mjs → list-CDb-4bZ1.mjs} +5 -5
  67. package/dist/{local-d1-DzykTWY8.mjs → local-d1-CC8sKFGu.mjs} +3 -3
  68. package/dist/{login-BgQJzxAl.mjs → login-BQyISZuW.mjs} +3 -3
  69. package/dist/login-r2gL8l7B.mjs +2 -0
  70. package/dist/{logs-DbzD-QDf.mjs → logs-BdfiOezj.mjs} +4 -4
  71. package/dist/{migrate-BV8qHiCb.mjs → migrate-B8KuoYsO.mjs} +69 -44
  72. package/dist/migrate-TsHGBnDA.mjs +2 -0
  73. package/dist/{node-Cupyf7-s.mjs → node-BM43oz4G.mjs} +5 -5
  74. package/dist/{operator-auth-BkVgJqv-.mjs → operator-auth-8KnOVXVd.mjs} +2 -2
  75. package/dist/{operator-client-A0iex2yi.mjs → operator-client-DUwumHpQ.mjs} +2 -2
  76. package/dist/{operator-cmd-CR6Lxzt0.mjs → operator-cmd-Co-PeaeD.mjs} +6 -6
  77. package/dist/{package-json-iCbMg5XF.mjs → package-json-DXfiT1jV.mjs} +1 -1
  78. package/dist/pages/index.d.mts +1 -1
  79. package/dist/pages/index.mjs +11 -6
  80. package/dist/pages/islands-plugin.d.mts +271 -1
  81. package/dist/pages/islands-plugin.mjs +95 -18
  82. package/dist/parse-filename-DioPHiR9.mjs +77 -0
  83. package/dist/{platform-auth-config-De7BqRJm.mjs → platform-auth-config-TSw8edHw.mjs} +5 -5
  84. package/dist/{platform-auth-protection-Dcat-6zu.mjs → platform-auth-protection-Ba1XqGhn.mjs} +6 -6
  85. package/dist/{platform-auth-recovery-C9gsM640.mjs → platform-auth-recovery-BkT3EsF2.mjs} +5 -5
  86. package/dist/{platform-cmd-Cl9Uhzru.mjs → platform-cmd-C8OqhqPt.mjs} +1 -1
  87. package/dist/{platform-cmd-CudokNIg.mjs → platform-cmd-CRSKfu8k.mjs} +5 -5
  88. package/dist/{platform-domain-Ckpd2kXw.mjs → platform-domain-j9YCXRm6.mjs} +3 -3
  89. package/dist/{platform-lifecycle-DVzM2T4j.mjs → platform-lifecycle-78H0XQUA.mjs} +277 -229
  90. package/dist/{platform-lifecycle-DlpiGcjr.mjs → platform-lifecycle-DDc9zCeJ.mjs} +1 -1
  91. package/dist/{platform-management-ibuS1as0.mjs → platform-management-6w8-DUjC.mjs} +2 -2
  92. package/dist/{platform-management-44Bxd3YC.mjs → platform-management-DzKNsMlt.mjs} +1 -1
  93. package/dist/{platform-recovery-D_KmvdSk.mjs → platform-recovery-Do8VOyDE.mjs} +3 -3
  94. package/dist/{platform-registry-BJbgZLS1.mjs → platform-registry-QBa4DK32.mjs} +1 -1
  95. package/dist/{plugin-inference-DsvtJLll.mjs → plugin-inference-BMfKRSqE.mjs} +188 -85
  96. package/dist/prepare-BZXkjdNe.mjs +2 -0
  97. package/dist/{prepare-pcWcxSCh.mjs → prepare-C3kt3Rst.mjs} +11 -11
  98. package/dist/{prepare-_T-Haxrr.mjs → prepare-DyZ-Yok5.mjs} +1 -1
  99. package/dist/{prerender-render-Cf_WDE9W.mjs → prerender-render-D9qbLs2f.mjs} +1 -1
  100. package/dist/prerender-render.mjs +1 -1
  101. package/dist/{preset-Dowh9tTt.mjs → preset-UHj9ARyP.mjs} +4 -4
  102. package/dist/{project-BEBFDFLz.mjs → project-BuUwfj6f.mjs} +1 -1
  103. package/dist/{project-CWNIPoXc.mjs → project-C0Fqu05O.mjs} +2 -2
  104. package/dist/{project-cmd-BuF9doku.mjs → project-cmd-B44I8J_W.mjs} +15 -15
  105. package/dist/{project-paths-CKQ-Q5JS.mjs → project-paths-GgcMozYz.mjs} +1 -1
  106. package/dist/{project-team-B1Tia8vd.mjs → project-team-BkbYIsXN.mjs} +4 -4
  107. package/dist/{project-token-Bwxjf4y6.mjs → project-token-C8xEEQnB.mjs} +4 -4
  108. package/dist/{project-tsconfig-CwfqUnVp.mjs → project-tsconfig-B8GeM0RM.mjs} +2 -2
  109. package/dist/{provision-Cck2m3jJ.mjs → provision-BhreDAOS.mjs} +141 -78
  110. package/dist/provision-DNtrtaVD.mjs +3 -0
  111. package/dist/{requests-CphRF98D.mjs → requests-DFyhBMaf.mjs} +3 -3
  112. package/dist/{resolve-project-Xvis70DG.mjs → resolve-project-BG5ORGID.mjs} +1 -1
  113. package/dist/resolve-project-DtbidV4y.mjs +2 -0
  114. package/dist/{rollback-BYHJV2yD.mjs → rollback-DHHxXZiS.mjs} +4 -4
  115. package/dist/{route-types-Id82-veQ.mjs → route-types-Clm4WD0B.mjs} +39 -16
  116. package/dist/{runner-CQs_cDSG.mjs → runner-B8wXwWlo.mjs} +1 -1
  117. package/dist/{runner-mysql-1o47achK.mjs → runner-mysql-CEG5JozK.mjs} +1 -1
  118. package/dist/{runner-mysql-BhwMk2Bm.mjs → runner-mysql-DmWchSWJ.mjs} +1 -1
  119. package/dist/{runner-BGVsGgkb.mjs → runner-p-dMs2UN.mjs} +3 -3
  120. package/dist/{runner-pg-D7z01mQS.mjs → runner-pg-Bh4AgZdj.mjs} +1 -1
  121. package/dist/{runner-pg-CJ_JeGF6.mjs → runner-pg-D4OPlil-.mjs} +1 -1
  122. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  123. package/dist/runtime/better-auth-mysql.mjs +1 -1
  124. package/dist/runtime/better-auth-pg.d.mts +1 -1
  125. package/dist/runtime/better-auth-pg.mjs +1 -1
  126. package/dist/runtime/better-auth.d.mts +1 -1
  127. package/dist/runtime/better-auth.mjs +2 -2
  128. package/dist/runtime/db.mjs +8 -5
  129. package/dist/runtime/durable.mjs +1 -1
  130. package/dist/runtime/email/testing.mjs +1 -1
  131. package/dist/runtime/env-public.mjs +1 -1
  132. package/dist/runtime/env.d.mts +1 -1
  133. package/dist/runtime/env.mjs +1 -1
  134. package/dist/runtime/kv.mjs +1 -1
  135. package/dist/runtime/live-server.mjs +38 -23
  136. package/dist/runtime/queues.mjs +1 -1
  137. package/dist/runtime/sandbox.mjs +1 -1
  138. package/dist/runtime/storage.mjs +1 -1
  139. package/dist/runtime/ws-server.d.mts +1 -1
  140. package/dist/runtime/ws-server.mjs +1 -1
  141. package/dist/{scan-DJbooZm2.mjs → scan-4tfN-PSn.mjs} +113 -99
  142. package/dist/{scan-DdDvRCU1.mjs → scan-ClYmX3sa.mjs} +35 -137
  143. package/dist/{secret-Rt9c4Ttw.mjs → secret-DN9sSNiV.mjs} +6 -6
  144. package/dist/{skills-B-690E7h.mjs → skills-O6FUaizK.mjs} +2 -2
  145. package/dist/sveltekit.mjs +1 -1
  146. package/dist/{validate-qNhV00PD.mjs → validate-CIUwFpjB.mjs} +2 -2
  147. package/dist/validate-EKmJWxmy.mjs +2 -0
  148. package/dist/{wrangler-D01qs6VB.mjs → wrangler-BymcxrRa.mjs} +3 -3
  149. package/dist/{yarn-pnp-CVEc3gE7.mjs → yarn-pnp-BV4AzNul.mjs} +1 -1
  150. package/package.json +7 -7
  151. package/schema.json +18 -0
  152. package/skills/void/docs/guide/app-types.md +1 -1
  153. package/skills/void/docs/guide/auth.md +2 -2
  154. package/skills/void/docs/guide/database/d1.md +6 -0
  155. package/skills/void/docs/guide/durable-state.md +1 -1
  156. package/skills/void/docs/guide/edge/rewrites.md +2 -3
  157. package/skills/void/docs/guide/env-migration.md +1 -1
  158. package/skills/void/docs/guide/pages-routing/markdown.md +1 -1
  159. package/skills/void/docs/guide/platform/development/local.md +1 -1
  160. package/skills/void/docs/guide/platform/installation/prerequisites.md +2 -2
  161. package/skills/void/docs/guide/platform/installation/setup.md +1 -1
  162. package/skills/void/docs/guide/server-routing.md +2 -3
  163. package/skills/void/docs/guide/ssr.md +4 -10
  164. package/skills/void/docs/guide/websockets.md +1 -1
  165. package/skills/void/docs/integrations/cloudflare.md +2 -0
  166. package/skills/void/docs/reference/api.md +1 -1
  167. package/skills/void/docs/reference/cli.md +9 -3
  168. package/skills/void/docs/reference/config.md +11 -0
  169. package/skills/void/docs/reference/resource-inference.md +1 -1
  170. package/dist/client-DAAivdid.mjs +0 -2
  171. package/dist/collect-DAUItMDS.mjs +0 -2
  172. package/dist/config-DDIFxQYx.mjs +0 -2
  173. package/dist/config-uP7ZDtVZ.mjs +0 -21
  174. package/dist/deploy-CsjbRNyv.mjs +0 -2
  175. package/dist/discover-BBzDZe_o.mjs +0 -2
  176. package/dist/dist-D7-nEOXi.mjs +0 -2
  177. package/dist/gen-B87rlalt.mjs +0 -2
  178. package/dist/help-r_vrpH_d.mjs +0 -2
  179. package/dist/login-Bz0zEPoy.mjs +0 -2
  180. package/dist/migrate-BXY3B3m7.mjs +0 -2
  181. package/dist/prepare-D4CkM3_v.mjs +0 -2
  182. package/dist/provision-CNgEBkVA.mjs +0 -3
  183. package/dist/resolve-project-BTotl8Nn.mjs +0 -2
  184. package/dist/validate-DqJ33oHj.mjs +0 -2
@@ -1,14 +1,95 @@
1
- import { n as dirname, u as resolve } from "../dist-4WkAWhWx.mjs";
2
- import { n as resolveEffectiveLayoutChain, t as scanPages } from "../scan-DJbooZm2.mjs";
1
+ import { n as dirname, u as resolve } from "../dist-BVqXeR_h.mjs";
2
+ import { n as isIdentifier, r as isLiteral } from "../ast-CPGPjb0V.mjs";
3
+ import { n as resolveEffectiveLayoutChain, t as scanPages } from "../scan-4tfN-PSn.mjs";
4
+ import { t as MagicString } from "../dist-BR1quN_w.mjs";
3
5
  import { existsSync, readFileSync, readdirSync } from "node:fs";
4
- import { normalizePath } from "vite";
6
+ import { normalizePath, parseSync } from "vite";
7
+ //#region src/pages/island-imports.ts
8
+ /** Collect stylesheet imports from authored modules without treating dynamic imports or text as dependencies. */
9
+ function findStaticCssImports(code, filename) {
10
+ if (!code.includes("import")) return [];
11
+ const scripts = /\.(?:vue|svelte)$/.test(filename) ? [...code.matchAll(/<script\b[^>]*>([\s\S]*?)<\/script\s*>/gi)].map((match) => ({
12
+ source: match[1],
13
+ filename: filename.replace(/\.(?:vue|svelte)$/, ".ts")
14
+ })) : [{
15
+ source: code,
16
+ filename
17
+ }];
18
+ const imports = [];
19
+ for (const script of scripts) {
20
+ if (!script.source.includes("import")) continue;
21
+ const program = parseSync(script.filename, script.source).program;
22
+ for (const node of program.body ?? []) {
23
+ const source = node.source;
24
+ if (node.type !== "ImportDeclaration" || !isLiteral(source) || typeof source.value !== "string" || !/\.(?:css|scss|sass|less|styl|stylus|pcss|postcss)$/.test(source.value) || node.start === void 0 || node.end === void 0) continue;
25
+ imports.push({
26
+ statement: script.source.slice(node.start, node.end),
27
+ specifier: source.value
28
+ });
29
+ }
30
+ }
31
+ return imports;
32
+ }
33
+ function editIslandSource(code, edits, options) {
34
+ const ms = new MagicString(code);
35
+ for (const edit of edits) ms.overwrite(edit.start, edit.end, edit.text);
36
+ for (const insertion of options?.insert ?? []) ms.appendLeft(insertion.offset, insertion.text);
37
+ if (options?.prepend) ms.prepend(options.prepend);
38
+ if (options?.append) ms.append(options.append);
39
+ return {
40
+ code: ms.toString(),
41
+ map: ms.generateMap({ hires: true })
42
+ };
43
+ }
44
+ /** Read island import attributes from JS/TS, or script blocks inside an SFC. */
45
+ function findIslandImports(code, filename) {
46
+ if (!code.includes("import") || !code.includes("island")) return [];
47
+ const scripts = [];
48
+ if (/\.(?:vue|svelte)$/.test(filename)) for (const match of code.matchAll(/<script\b[^>]*>([\s\S]*?)<\/script\s*>/gi)) {
49
+ const source = match[1];
50
+ scripts.push({
51
+ source,
52
+ offset: match.index + match[0].indexOf(source),
53
+ filename: filename.replace(/\.(?:vue|svelte)$/, ".ts")
54
+ });
55
+ }
56
+ else scripts.push({
57
+ source: code,
58
+ offset: 0,
59
+ filename
60
+ });
61
+ const imports = [];
62
+ for (const script of scripts) {
63
+ if (!script.source.includes("island")) continue;
64
+ const program = parseSync(script.filename, script.source).program;
65
+ for (const node of program.body ?? []) {
66
+ if (node.type !== "ImportDeclaration") continue;
67
+ const specifiers = node.specifiers;
68
+ const attributes = node.attributes;
69
+ const first = specifiers?.[0];
70
+ const attribute = attributes?.[0];
71
+ const key = attribute?.key;
72
+ const value = attribute?.value;
73
+ const source = node.source;
74
+ if (specifiers?.length !== 1 || first?.type !== "ImportDefaultSpecifier" || !isIdentifier(first.local) || attributes?.length !== 1 || !isIdentifier(key) || key.name !== "island" || !isLiteral(value) || typeof value.value !== "string" || !isLiteral(source) || typeof source.value !== "string" || source.start === void 0 || source.end === void 0 || node.start === void 0 || node.end === void 0) continue;
75
+ imports.push({
76
+ start: script.offset + node.start,
77
+ end: script.offset + node.end,
78
+ importName: first.local.name,
79
+ specifierRaw: script.source.slice(source.start, source.end),
80
+ specifier: source.value,
81
+ hydrate: value.value
82
+ });
83
+ }
84
+ }
85
+ return imports;
86
+ }
87
+ //#endregion
5
88
  //#region src/pages/islands-plugin.ts
6
89
  const ISLANDS_RENDERER_ID = "virtual:void-islands-renderer";
7
90
  const ISLANDS_CLIENT_ENTRY_ID = "virtual:void-islands-client";
8
- const ISLAND_IMPORT_RE = /import\s+([$_A-Za-z][$_\w]*)\s+from\s+("[^"]+"|'[^']+')\s+with\s*\{\s*island\s*:\s*("[^"]+"|'[^']+')\s*,?\s*\}/g;
9
- function hasIslandImports(code) {
10
- ISLAND_IMPORT_RE.lastIndex = 0;
11
- return ISLAND_IMPORT_RE.test(code);
91
+ function hasIslandImports(code, filename) {
92
+ return findIslandImports(code, filename).length > 0;
12
93
  }
13
94
  /** Resolve a relative import specifier to an absolute path by checking extensions. */
14
95
  function resolveSpecifier(specifier, importerDir, extensions) {
@@ -35,7 +116,7 @@ function needsIslandClientBundle(dir, islandFilePattern, checkStyleBlocks) {
35
116
  const name = entry.name;
36
117
  if (islandFilePattern.test(name) || name.startsWith("layout.") || name.startsWith("_")) {
37
118
  const content = readFileSync(resolve(entry.parentPath, name), "utf-8");
38
- if (hasIslandImports(content)) return true;
119
+ if (hasIslandImports(content, name)) return true;
39
120
  if (styleRe && styleRe.test(content)) return true;
40
121
  if (cssImportRe.test(content)) return true;
41
122
  }
@@ -56,16 +137,12 @@ function rewriteCssImportForVirtualModule(matchedLine, specifier, sourceFilePath
56
137
  const absPath = normalizePath(resolve(dirname(sourceFilePath), specifier));
57
138
  return `import ${JSON.stringify(absPath)};`;
58
139
  }
59
- return matchedLine.trim() + ";";
140
+ const statement = matchedLine.trim();
141
+ return statement.endsWith(";") ? statement : statement + ";";
60
142
  }
61
143
  /** Extract CSS import statements from a file and return them as @import rules. */
62
144
  function extractCssImports(filePath) {
63
- const code = readFileSync(filePath, "utf-8");
64
- const re = /^\s*import\b[^"']*["']([^"']+\.(?:css|scss|sass|less|styl|stylus|pcss|postcss))["']/gm;
65
- const imports = [];
66
- let match;
67
- while ((match = re.exec(code)) !== null) imports.push(`@import ${JSON.stringify(match[1])};`);
68
- return imports.join("\n");
145
+ return findStaticCssImports(readFileSync(filePath, "utf-8"), filePath).map(({ specifier }) => `@import ${JSON.stringify(specifier)};`).join("\n");
69
146
  }
70
147
  /** Compute which island pages need client-side JavaScript. */
71
148
  function computePagesNeedingClientJS(pageScan, pagesDir, resolvedConfig) {
@@ -75,7 +152,7 @@ function computePagesNeedingClientJS(pageScan, pagesDir, resolvedConfig) {
75
152
  for (const layout of pageScan.layouts) {
76
153
  if (!layout.island) continue;
77
154
  const filePath = resolve(pagesDir, layout.filePath);
78
- if (hasIslandImports(readFileSync(filePath, "utf-8"))) layoutDirsWithIslands.add(layout.directory);
155
+ if (hasIslandImports(readFileSync(filePath, "utf-8"), filePath)) layoutDirsWithIslands.add(layout.directory);
79
156
  }
80
157
  const result = /* @__PURE__ */ new Set();
81
158
  for (const page of pageScan.pages) {
@@ -85,7 +162,7 @@ function computePagesNeedingClientJS(pageScan, pagesDir, resolvedConfig) {
85
162
  continue;
86
163
  }
87
164
  const filePath = resolve(pagesDir, page.componentPath);
88
- if (hasIslandImports(readFileSync(filePath, "utf-8"))) {
165
+ if (hasIslandImports(readFileSync(filePath, "utf-8"), filePath)) {
89
166
  result.add(page.componentId);
90
167
  continue;
91
168
  }
@@ -133,4 +210,4 @@ function watchPagesForRescan(server, pagesDir, root, onRescan) {
133
210
  return { flush: () => pending ?? Promise.resolve() };
134
211
  }
135
212
  //#endregion
136
- export { ISLANDS_CLIENT_ENTRY_ID, ISLANDS_RENDERER_ID, computePagesNeedingClientJS, extractCssImports, needsIslandClientBundle, resolveSpecifier, rewriteCssImportForVirtualModule, watchPagesForRescan };
213
+ export { ISLANDS_CLIENT_ENTRY_ID, ISLANDS_RENDERER_ID, computePagesNeedingClientJS, editIslandSource, extractCssImports, findIslandImports, findStaticCssImports, needsIslandClientBundle, resolveSpecifier, rewriteCssImportForVirtualModule, watchPagesForRescan };
@@ -0,0 +1,77 @@
1
+ //#region src/router/parse-filename.ts
2
+ const EXTENSIONS = [
3
+ ".ts",
4
+ ".mts",
5
+ ".js",
6
+ ".mjs"
7
+ ];
8
+ const ENV_SUFFIXES = ["dev", "prod"];
9
+ function parsePath(relativePath, isWebSocketRoute) {
10
+ const filePath = relativePath;
11
+ let path = relativePath.replace(/\\/g, "/");
12
+ for (const ext of EXTENSIONS) if (path.endsWith(ext)) {
13
+ path = path.slice(0, -ext.length);
14
+ break;
15
+ }
16
+ if (isWebSocketRoute && path.endsWith(".ws")) path = path.slice(0, -3);
17
+ const segments = path.split("/");
18
+ let filename = segments.pop();
19
+ let env = null;
20
+ for (const suffix of ENV_SUFFIXES) if (filename.endsWith(`.${suffix}`)) {
21
+ env = suffix;
22
+ filename = filename.slice(0, -(suffix.length + 1));
23
+ break;
24
+ }
25
+ segments.push(filename);
26
+ if (segments[segments.length - 1] === "index") segments.pop();
27
+ const filtered = segments.filter((s) => !s.startsWith("(") || !s.endsWith(")"));
28
+ const params = [];
29
+ let catchAll = false;
30
+ return {
31
+ pattern: "/" + filtered.map((segment) => {
32
+ if (segment.startsWith("[...") && segment.endsWith("]")) {
33
+ const paramName = segment.slice(4, -1);
34
+ catchAll = true;
35
+ if (paramName) {
36
+ params.push(paramName);
37
+ return `:${paramName}{.+}`;
38
+ }
39
+ return "*";
40
+ }
41
+ if (segment.startsWith("[") && segment.endsWith("]")) {
42
+ const paramName = segment.slice(1, -1);
43
+ params.push(paramName);
44
+ return `:${paramName}`;
45
+ }
46
+ return segment;
47
+ }).join("/"),
48
+ methods: [],
49
+ params,
50
+ catchAll,
51
+ env,
52
+ filePath
53
+ };
54
+ }
55
+ /**
56
+ * Parse a route filename (relative to routes/) into a RouteDefinition.
57
+ *
58
+ * Rules (applied in order):
59
+ * 1. Strip file extension (.ts, .js, .mts, .mjs)
60
+ * 2. Check for env suffix (.dev, .prod) → strip and record
61
+ * 3. Strip trailing "index" segment
62
+ * 4. Remove route group directories: (groupname)
63
+ * 5. Convert [param] → :param, [...param] → :param{.+}, [...] → *
64
+ * 6. Prefix with /
65
+ */
66
+ function parseRouteFilename(relativePath) {
67
+ return parsePath(relativePath, false);
68
+ }
69
+ /** Parse a `.ws.*` route filename into a regular route definition. */
70
+ function parseWebSocketFilename(relativePath) {
71
+ return parsePath(relativePath, true);
72
+ }
73
+ function isRouteEnabledForEnvironment(route, environment) {
74
+ return environment === void 0 || route.env === null || route.env === environment;
75
+ }
76
+ //#endregion
77
+ export { parseRouteFilename as n, parseWebSocketFilename as r, isRouteEnabledForEnvironment as t };
@@ -1,7 +1,7 @@
1
- import { d as openBrowser } from "./auth-B9_D6ygs.mjs";
1
+ import { d as openBrowser } from "./auth-DLNN0D3Z.mjs";
2
2
  import { B as text, E as confirm, F as password, I as select, M as multiselect, W as isCancel } from "./dist-Dn6nn2IU.mjs";
3
- import { n as OperatorClient } from "./operator-client-A0iex2yi.mjs";
4
- import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-BkVgJqv-.mjs";
3
+ import { n as OperatorClient } from "./operator-client-DUwumHpQ.mjs";
4
+ import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-8KnOVXVd.mjs";
5
5
  import { execFile } from "node:child_process";
6
6
  import { parsePlatformAdmissionPolicy, parsePlatformLoginConfiguration } from "@void/platform";
7
7
  import { stripVTControlCharacters } from "node:util";
@@ -140,11 +140,11 @@ async function configurationInput(args, existing) {
140
140
  }
141
141
  async function runPlatformAuthConfig(args) {
142
142
  if (args.action === "recover") {
143
- const { runPlatformAuthRecovery } = await import("./platform-auth-recovery-C9gsM640.mjs");
143
+ const { runPlatformAuthRecovery } = await import("./platform-auth-recovery-BkT3EsF2.mjs");
144
144
  return runPlatformAuthRecovery(args);
145
145
  }
146
146
  if (args.action === "protection") {
147
- const { runPlatformProtectionConfig } = await import("./platform-auth-protection-Dcat-6zu.mjs");
147
+ const { runPlatformProtectionConfig } = await import("./platform-auth-protection-Ba1XqGhn.mjs");
148
148
  return runPlatformProtectionConfig(args);
149
149
  }
150
150
  const origin = resolveOperatorOrigin(args.connection);
@@ -1,11 +1,11 @@
1
1
  import { t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
2
- import { d as readInstallationRecoverySecrets, h as resolveInstallationManifest, s as normalizePlatformApiUrl, t as acquirePlatformLifecycleLock, u as promoteInstallationSecrets, v as writeInstallationManifest, y as writePendingInstallationSecrets } from "./platform-registry-BJbgZLS1.mjs";
3
- import { n as ensurePlatformAccessToken } from "./cf-access-rAZxzMkL.mjs";
2
+ import { d as readInstallationRecoverySecrets, h as resolveInstallationManifest, s as normalizePlatformApiUrl, t as acquirePlatformLifecycleLock, u as promoteInstallationSecrets, v as writeInstallationManifest, y as writePendingInstallationSecrets } from "./platform-registry-QBa4DK32.mjs";
3
+ import { n as ensurePlatformAccessToken } from "./cf-access-P0iZnu0q.mjs";
4
4
  import { E as confirm, W as isCancel } from "./dist-Dn6nn2IU.mjs";
5
- import { n as OperatorClient } from "./operator-client-A0iex2yi.mjs";
6
- import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-BkVgJqv-.mjs";
7
- import { D as preparePlatformAccessSetup, E as parsePlatformAccessSetupSpec, O as PlatformCloudflareClient, T as checkpointPlatformAccessResources, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-DVzM2T4j.mjs";
8
- import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-ibuS1as0.mjs";
5
+ import { n as OperatorClient } from "./operator-client-DUwumHpQ.mjs";
6
+ import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-8KnOVXVd.mjs";
7
+ import { D as preparePlatformAccessSetup, E as parsePlatformAccessSetupSpec, O as PlatformCloudflareClient, T as checkpointPlatformAccessResources, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-78H0XQUA.mjs";
8
+ import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-6w8-DUjC.mjs";
9
9
  import { createHmac } from "node:crypto";
10
10
  import { parsePlatformAccessProtection, platformProtectionProofMessage } from "@void/platform";
11
11
  import { readFile } from "node:fs/promises";
@@ -1,9 +1,9 @@
1
- import { d as openBrowser } from "./auth-B9_D6ygs.mjs";
2
- import { d as readInstallationRecoverySecrets, h as resolveInstallationManifest, t as acquirePlatformLifecycleLock } from "./platform-registry-BJbgZLS1.mjs";
1
+ import { d as openBrowser } from "./auth-DLNN0D3Z.mjs";
2
+ import { d as readInstallationRecoverySecrets, h as resolveInstallationManifest, t as acquirePlatformLifecycleLock } from "./platform-registry-QBa4DK32.mjs";
3
3
  import { E as confirm, W as isCancel } from "./dist-Dn6nn2IU.mjs";
4
- import { a as resolveOperatorOrigin } from "./operator-auth-BkVgJqv-.mjs";
5
- import { O as PlatformCloudflareClient, f as platformDatabaseClientUrl, n as resolvePlatformInstallDatabaseUrl, s as acquirePlatformDatabaseLifecycleLockConnection, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-DVzM2T4j.mjs";
6
- import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-ibuS1as0.mjs";
4
+ import { a as resolveOperatorOrigin } from "./operator-auth-8KnOVXVd.mjs";
5
+ import { O as PlatformCloudflareClient, f as platformDatabaseClientUrl, n as resolvePlatformInstallDatabaseUrl, s as acquirePlatformDatabaseLifecycleLockConnection, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-78H0XQUA.mjs";
6
+ import { c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-6w8-DUjC.mjs";
7
7
  import { createCipheriv, createDecipheriv, createHash, createHmac, hkdfSync, randomBytes, randomUUID } from "node:crypto";
8
8
  import { execFile } from "node:child_process";
9
9
  import { parsePlatformAccessProtection, parsePlatformAdmissionPolicy, parsePlatformLoginConfiguration, platformAuthenticationRecoveryMessage, validatePlatformAdmissionPolicy } from "@void/platform";
@@ -1,2 +1,2 @@
1
- import { r as runPlatformCommand, t as discoverPlatform } from "./platform-cmd-CudokNIg.mjs";
1
+ import { r as runPlatformCommand, t as discoverPlatform } from "./platform-cmd-CRSKfu8k.mjs";
2
2
  export { discoverPlatform, runPlatformCommand };
@@ -1,7 +1,7 @@
1
1
  import { c as import_picocolors } from "./output-CCH48AMM.mjs";
2
2
  import { t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
3
- import { _ as selectPlatformConnection, g as savePlatformConnection, o as listPlatformConnections, r as getActivePlatformConnection, s as normalizePlatformApiUrl } from "./platform-registry-BJbgZLS1.mjs";
4
- import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, t as ensureCloudflaredToken } from "./cf-access-rAZxzMkL.mjs";
3
+ import { _ as selectPlatformConnection, g as savePlatformConnection, o as listPlatformConnections, r as getActivePlatformConnection, s as normalizePlatformApiUrl } from "./platform-registry-QBa4DK32.mjs";
4
+ import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, t as ensureCloudflaredToken } from "./cf-access-P0iZnu0q.mjs";
5
5
  import { B as text, I as select, W as isCancel, j as log } from "./dist-Dn6nn2IU.mjs";
6
6
  import { parsePlatformDiscoveryDocument } from "@void/platform";
7
7
  //#region src/cli/platform-cmd.ts
@@ -92,12 +92,12 @@ function saveDiscoveredPlatform(discovery) {
92
92
  }
93
93
  async function runPlatformCommand(_root, args) {
94
94
  if (args.subcommand === "config") {
95
- const { runPlatformAuthConfig } = await import("./platform-auth-config-De7BqRJm.mjs");
95
+ const { runPlatformAuthConfig } = await import("./platform-auth-config-TSw8edHw.mjs");
96
96
  await runPlatformAuthConfig(args);
97
97
  return;
98
98
  }
99
99
  if (args.subcommand === "operator") {
100
- const { runOperatorCommand } = await import("./operator-cmd-CR6Lxzt0.mjs");
100
+ const { runOperatorCommand } = await import("./operator-cmd-Co-PeaeD.mjs");
101
101
  await runOperatorCommand(args);
102
102
  return;
103
103
  }
@@ -129,7 +129,7 @@ async function runPlatformCommand(_root, args) {
129
129
  console.log(`Capabilities: ${Object.entries(discovery.capabilities).filter(([, enabled]) => enabled).map(([name]) => name).join(", ")}`);
130
130
  return;
131
131
  }
132
- const { runPlatformLifecycleCommand } = await import("./platform-lifecycle-DlpiGcjr.mjs");
132
+ const { runPlatformLifecycleCommand } = await import("./platform-lifecycle-DDc9zCeJ.mjs");
133
133
  await runPlatformLifecycleCommand(args);
134
134
  }
135
135
  //#endregion
@@ -1,8 +1,8 @@
1
1
  import { t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
2
- import { d as readInstallationRecoverySecrets, g as savePlatformConnection, t as acquirePlatformLifecycleLock, v as writeInstallationManifest } from "./platform-registry-BJbgZLS1.mjs";
2
+ import { d as readInstallationRecoverySecrets, g as savePlatformConnection, t as acquirePlatformLifecycleLock, v as writeInstallationManifest } from "./platform-registry-QBa4DK32.mjs";
3
3
  import { B as text, E as confirm, N as note, W as isCancel, j as log } from "./dist-Dn6nn2IU.mjs";
4
- import { C as assertPlatformOperatorCredentialCanApplyPlan, O as PlatformCloudflareClient, _ as createPlatformInstallPlan, c as createPlatformHealthProbeToken, h as recordPlatformWorkerTraffic, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, p as recordResource, t as assertNoninteractivePlatformMutationAcknowledged, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-DVzM2T4j.mjs";
5
- import { a as resolveInstalledPlatformManifest, c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-ibuS1as0.mjs";
4
+ import { C as assertPlatformOperatorCredentialCanApplyPlan, O as PlatformCloudflareClient, _ as createPlatformInstallPlan, c as createPlatformHealthProbeToken, h as recordPlatformWorkerTraffic, n as resolvePlatformInstallDatabaseUrl, o as acquirePlatformDatabaseLifecycleLock, p as recordResource, t as assertNoninteractivePlatformMutationAcknowledged, w as resolvePlatformCloudflareCredential } from "./platform-lifecycle-78H0XQUA.mjs";
5
+ import { a as resolveInstalledPlatformManifest, c as selectAuthoritativePlatformManifest, u as verifyPlatformInstallationOwnership } from "./platform-management-6w8-DUjC.mjs";
6
6
  import { randomUUID } from "node:crypto";
7
7
  import { PLATFORM_APPLICATION_KEY, PLATFORM_REMOTE_INSTALLATION_MANIFEST_KEY, createApplicationRoutes, createPlatformDeploymentManifest, normalizeApplicationDomain } from "@void/platform";
8
8
  //#region src/cli/platform-domain.ts