@absolutejs/absolute 0.19.0-beta.808 → 0.19.0-beta.809

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 (260) hide show
  1. package/dist/angular/browser.js +9801 -57
  2. package/dist/angular/browser.js.map +246 -4
  3. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  4. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  5. package/dist/angular/index.js +14877 -60
  6. package/dist/angular/index.js.map +281 -4
  7. package/dist/angular/server.js +5610 -45
  8. package/dist/angular/server.js.map +51 -3
  9. package/dist/build.js +18092 -45
  10. package/dist/build.js.map +99 -3
  11. package/dist/cli/index.js +317 -86
  12. package/dist/client/index.js +1100 -40
  13. package/dist/client/index.js.map +24 -4
  14. package/dist/core/streamingSlotRegistrar.js +108 -11
  15. package/dist/core/streamingSlotRegistrar.js.map +4 -3
  16. package/dist/core/streamingSlotRegistry.js +169 -7
  17. package/dist/core/streamingSlotRegistry.js.map +5 -3
  18. package/dist/index.js +19957 -547
  19. package/dist/index.js.map +116 -3
  20. package/dist/islands/browser.js +228 -9
  21. package/dist/islands/browser.js.map +9 -4
  22. package/dist/islands/index.js +1908 -17
  23. package/dist/islands/index.js.map +27 -3
  24. package/dist/react/browser.js +328 -12
  25. package/dist/react/browser.js.map +12 -4
  26. package/dist/react/components/index.js +167 -16
  27. package/dist/react/components/index.js.map +6 -3
  28. package/dist/react/hooks/index.js +183 -8
  29. package/dist/react/hooks/index.js.map +7 -3
  30. package/dist/react/index.js +3627 -36
  31. package/dist/react/index.js.map +45 -4
  32. package/dist/react/jsxDevRuntimeCompat.js +61 -2
  33. package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
  34. package/dist/react/server.js +1789 -18
  35. package/dist/react/server.js.map +21 -3
  36. package/dist/src/angular/injectorPatch.d.ts +1 -0
  37. package/dist/src/index.d.ts +1 -0
  38. package/dist/svelte/browser.js +247 -12
  39. package/dist/svelte/browser.js.map +10 -3
  40. package/dist/svelte/index.js +3732 -37
  41. package/dist/svelte/index.js.map +47 -4
  42. package/dist/svelte/server.js +2794 -21
  43. package/dist/svelte/server.js.map +27 -3
  44. package/dist/vue/browser.js +348 -12
  45. package/dist/vue/browser.js.map +12 -4
  46. package/dist/vue/components/Image.js +240 -7
  47. package/dist/vue/components/Image.js.map +6 -3
  48. package/dist/vue/components/index.js +544 -11
  49. package/dist/vue/components/index.js.map +9 -3
  50. package/dist/vue/index.js +4212 -52
  51. package/dist/vue/index.js.map +50 -4
  52. package/dist/vue/server.js +1849 -18
  53. package/dist/vue/server.js.map +21 -3
  54. package/package.json +1 -1
  55. package/dist/chunk-0867j0r0.js +0 -136
  56. package/dist/chunk-0867j0r0.js.map +0 -10
  57. package/dist/chunk-0kdc6r16.js +0 -20
  58. package/dist/chunk-0kdc6r16.js.map +0 -10
  59. package/dist/chunk-102fp7xe.js +0 -63
  60. package/dist/chunk-102fp7xe.js.map +0 -10
  61. package/dist/chunk-11zpfqz6.js +0 -19
  62. package/dist/chunk-11zpfqz6.js.map +0 -10
  63. package/dist/chunk-1rfh7hw9.js +0 -319
  64. package/dist/chunk-1rfh7hw9.js.map +0 -11
  65. package/dist/chunk-25v9t56f.js +0 -29
  66. package/dist/chunk-25v9t56f.js.map +0 -11
  67. package/dist/chunk-2f21eenc.js +0 -21
  68. package/dist/chunk-2f21eenc.js.map +0 -10
  69. package/dist/chunk-2ga2znex.js +0 -13
  70. package/dist/chunk-2ga2znex.js.map +0 -9
  71. package/dist/chunk-30yrw0f6.js +0 -33
  72. package/dist/chunk-30yrw0f6.js.map +0 -10
  73. package/dist/chunk-38jwhqcw.js +0 -4410
  74. package/dist/chunk-38jwhqcw.js.map +0 -28
  75. package/dist/chunk-3g91wb4f.js +0 -358
  76. package/dist/chunk-3g91wb4f.js.map +0 -10
  77. package/dist/chunk-3yjzpcne.js +0 -34
  78. package/dist/chunk-3yjzpcne.js.map +0 -10
  79. package/dist/chunk-41bf6aqt.js +0 -17
  80. package/dist/chunk-41bf6aqt.js.map +0 -9
  81. package/dist/chunk-4d39r92n.js +0 -81
  82. package/dist/chunk-4d39r92n.js.map +0 -10
  83. package/dist/chunk-5003emhv.js +0 -17
  84. package/dist/chunk-5003emhv.js.map +0 -10
  85. package/dist/chunk-5f67rsed.js +0 -466
  86. package/dist/chunk-5f67rsed.js.map +0 -10
  87. package/dist/chunk-5fhp1jap.js +0 -9169
  88. package/dist/chunk-5fhp1jap.js.map +0 -236
  89. package/dist/chunk-6pdj08z3.js +0 -73
  90. package/dist/chunk-6pdj08z3.js.map +0 -12
  91. package/dist/chunk-6qjbrt0k.js +0 -13
  92. package/dist/chunk-6qjbrt0k.js.map +0 -9
  93. package/dist/chunk-6sccb4jr.js +0 -14
  94. package/dist/chunk-6sccb4jr.js.map +0 -9
  95. package/dist/chunk-798spvzv.js +0 -50
  96. package/dist/chunk-798spvzv.js.map +0 -10
  97. package/dist/chunk-7fw6x3js.js +0 -131
  98. package/dist/chunk-7fw6x3js.js.map +0 -11
  99. package/dist/chunk-7kjj42xm.js +0 -11
  100. package/dist/chunk-7kjj42xm.js.map +0 -10
  101. package/dist/chunk-7mtstdqn.js +0 -90
  102. package/dist/chunk-7mtstdqn.js.map +0 -10
  103. package/dist/chunk-851whwc7.js +0 -17
  104. package/dist/chunk-851whwc7.js.map +0 -10
  105. package/dist/chunk-85n68sy6.js +0 -103
  106. package/dist/chunk-85n68sy6.js.map +0 -10
  107. package/dist/chunk-8kcfffry.js +0 -35
  108. package/dist/chunk-8kcfffry.js.map +0 -10
  109. package/dist/chunk-8qqxc1h2.js +0 -426
  110. package/dist/chunk-8qqxc1h2.js.map +0 -14
  111. package/dist/chunk-92fsjfpp.js +0 -1731
  112. package/dist/chunk-92fsjfpp.js.map +0 -11
  113. package/dist/chunk-93sqk7be.js +0 -139
  114. package/dist/chunk-93sqk7be.js.map +0 -12
  115. package/dist/chunk-94gvx0hg.js +0 -28
  116. package/dist/chunk-94gvx0hg.js.map +0 -10
  117. package/dist/chunk-9c5tj4k3.js +0 -130
  118. package/dist/chunk-9c5tj4k3.js.map +0 -10
  119. package/dist/chunk-9ve9jq72.js +0 -203
  120. package/dist/chunk-9ve9jq72.js.map +0 -10
  121. package/dist/chunk-9xrsjeem.js +0 -12
  122. package/dist/chunk-9xrsjeem.js.map +0 -9
  123. package/dist/chunk-a9mvyp04.js +0 -87
  124. package/dist/chunk-a9mvyp04.js.map +0 -10
  125. package/dist/chunk-b3gbnrwe.js +0 -21
  126. package/dist/chunk-b3gbnrwe.js.map +0 -10
  127. package/dist/chunk-bmgqm774.js +0 -65
  128. package/dist/chunk-bmgqm774.js.map +0 -9
  129. package/dist/chunk-bxfghpma.js +0 -69
  130. package/dist/chunk-bxfghpma.js.map +0 -10
  131. package/dist/chunk-c1jfjnka.js +0 -74
  132. package/dist/chunk-c1jfjnka.js.map +0 -10
  133. package/dist/chunk-cbkrwmvh.js +0 -80
  134. package/dist/chunk-cbkrwmvh.js.map +0 -10
  135. package/dist/chunk-cdxd7sy2.js +0 -71
  136. package/dist/chunk-cdxd7sy2.js.map +0 -10
  137. package/dist/chunk-cg95827x.js +0 -21
  138. package/dist/chunk-cg95827x.js.map +0 -10
  139. package/dist/chunk-cm0g4q6w.js +0 -149
  140. package/dist/chunk-cm0g4q6w.js.map +0 -10
  141. package/dist/chunk-cwfy538a.js +0 -51
  142. package/dist/chunk-cwfy538a.js.map +0 -9
  143. package/dist/chunk-d7mwkzry.js +0 -261
  144. package/dist/chunk-d7mwkzry.js.map +0 -10
  145. package/dist/chunk-d8w0qm28.js +0 -184
  146. package/dist/chunk-d8w0qm28.js.map +0 -11
  147. package/dist/chunk-d9c0am65.js +0 -12
  148. package/dist/chunk-d9c0am65.js.map +0 -10
  149. package/dist/chunk-daqghmg8.js +0 -12
  150. package/dist/chunk-daqghmg8.js.map +0 -9
  151. package/dist/chunk-e3r9fxaa.js +0 -149
  152. package/dist/chunk-e3r9fxaa.js.map +0 -10
  153. package/dist/chunk-e8eecyrq.js +0 -244
  154. package/dist/chunk-e8eecyrq.js.map +0 -10
  155. package/dist/chunk-ex2hxe0v.js +0 -160
  156. package/dist/chunk-ex2hxe0v.js.map +0 -11
  157. package/dist/chunk-fak944et.js +0 -91
  158. package/dist/chunk-fak944et.js.map +0 -10
  159. package/dist/chunk-ff70rnhd.js +0 -672
  160. package/dist/chunk-ff70rnhd.js.map +0 -15
  161. package/dist/chunk-fygx2ymm.js +0 -118
  162. package/dist/chunk-fygx2ymm.js.map +0 -12
  163. package/dist/chunk-g15qj669.js +0 -271
  164. package/dist/chunk-g15qj669.js.map +0 -11
  165. package/dist/chunk-gd6wmknh.js +0 -121
  166. package/dist/chunk-gd6wmknh.js.map +0 -11
  167. package/dist/chunk-gf0ygptk.js +0 -85
  168. package/dist/chunk-gf0ygptk.js.map +0 -11
  169. package/dist/chunk-gytkmthr.js +0 -220
  170. package/dist/chunk-gytkmthr.js.map +0 -10
  171. package/dist/chunk-h5bbfn3n.js +0 -28
  172. package/dist/chunk-h5bbfn3n.js.map +0 -11
  173. package/dist/chunk-h6mye9r3.js +0 -93
  174. package/dist/chunk-h6mye9r3.js.map +0 -10
  175. package/dist/chunk-hcsmxw1v.js +0 -85
  176. package/dist/chunk-hcsmxw1v.js.map +0 -10
  177. package/dist/chunk-hyjs4bqs.js +0 -8
  178. package/dist/chunk-hyjs4bqs.js.map +0 -10
  179. package/dist/chunk-j88z31ep.js +0 -25
  180. package/dist/chunk-j88z31ep.js.map +0 -10
  181. package/dist/chunk-jn91vzkh.js +0 -66
  182. package/dist/chunk-jn91vzkh.js.map +0 -10
  183. package/dist/chunk-jpkjdgsk.js +0 -167
  184. package/dist/chunk-jpkjdgsk.js.map +0 -11
  185. package/dist/chunk-jwxt8gnp.js +0 -13
  186. package/dist/chunk-jwxt8gnp.js.map +0 -9
  187. package/dist/chunk-kk8w9rh5.js +0 -195
  188. package/dist/chunk-kk8w9rh5.js.map +0 -10
  189. package/dist/chunk-m97ze5hz.js +0 -46
  190. package/dist/chunk-m97ze5hz.js.map +0 -10
  191. package/dist/chunk-mbazhahf.js +0 -60
  192. package/dist/chunk-mbazhahf.js.map +0 -10
  193. package/dist/chunk-mgfwq18r.js +0 -15
  194. package/dist/chunk-mgfwq18r.js.map +0 -9
  195. package/dist/chunk-mtgf69xn.js +0 -88
  196. package/dist/chunk-mtgf69xn.js.map +0 -10
  197. package/dist/chunk-mtxzyxpg.js +0 -102
  198. package/dist/chunk-mtxzyxpg.js.map +0 -10
  199. package/dist/chunk-nehhtthw.js +0 -225
  200. package/dist/chunk-nehhtthw.js.map +0 -10
  201. package/dist/chunk-p5504p14.js +0 -16
  202. package/dist/chunk-p5504p14.js.map +0 -10
  203. package/dist/chunk-pnscgw95.js +0 -90
  204. package/dist/chunk-pnscgw95.js.map +0 -10
  205. package/dist/chunk-pvpp4pvs.js +0 -17
  206. package/dist/chunk-pvpp4pvs.js.map +0 -10
  207. package/dist/chunk-qh75agse.js +0 -95
  208. package/dist/chunk-qh75agse.js.map +0 -10
  209. package/dist/chunk-qxq2zcty.js +0 -52
  210. package/dist/chunk-qxq2zcty.js.map +0 -10
  211. package/dist/chunk-r6e8pytx.js +0 -22
  212. package/dist/chunk-r6e8pytx.js.map +0 -9
  213. package/dist/chunk-r7jmgqnw.js +0 -114
  214. package/dist/chunk-r7jmgqnw.js.map +0 -10
  215. package/dist/chunk-s6defjk2.js +0 -116
  216. package/dist/chunk-s6defjk2.js.map +0 -10
  217. package/dist/chunk-sd39p726.js +0 -619
  218. package/dist/chunk-sd39p726.js.map +0 -10
  219. package/dist/chunk-swrnzs4c.js +0 -63
  220. package/dist/chunk-swrnzs4c.js.map +0 -10
  221. package/dist/chunk-tfe3sb44.js +0 -33
  222. package/dist/chunk-tfe3sb44.js.map +0 -10
  223. package/dist/chunk-tjr0kcev.js +0 -41
  224. package/dist/chunk-tjr0kcev.js.map +0 -9
  225. package/dist/chunk-tx9edm1x.js +0 -34
  226. package/dist/chunk-tx9edm1x.js.map +0 -10
  227. package/dist/chunk-txhm2vb5.js +0 -18
  228. package/dist/chunk-txhm2vb5.js.map +0 -9
  229. package/dist/chunk-v5vmsxmy.js +0 -526
  230. package/dist/chunk-v5vmsxmy.js.map +0 -12
  231. package/dist/chunk-vjhxm8n2.js +0 -29
  232. package/dist/chunk-vjhxm8n2.js.map +0 -9
  233. package/dist/chunk-vkrpm7kc.js +0 -247
  234. package/dist/chunk-vkrpm7kc.js.map +0 -12
  235. package/dist/chunk-w3m4m5we.js +0 -4925
  236. package/dist/chunk-w3m4m5we.js.map +0 -12
  237. package/dist/chunk-wrxtn9ve.js +0 -18
  238. package/dist/chunk-wrxtn9ve.js.map +0 -10
  239. package/dist/chunk-wwzvp0zn.js +0 -192
  240. package/dist/chunk-wwzvp0zn.js.map +0 -10
  241. package/dist/chunk-x09cskqd.js +0 -377
  242. package/dist/chunk-x09cskqd.js.map +0 -10
  243. package/dist/chunk-xnt8c6h2.js +0 -576
  244. package/dist/chunk-xnt8c6h2.js.map +0 -10
  245. package/dist/chunk-xw0tx842.js +0 -13
  246. package/dist/chunk-xw0tx842.js.map +0 -9
  247. package/dist/chunk-xx5b6b9m.js +0 -69
  248. package/dist/chunk-xx5b6b9m.js.map +0 -10
  249. package/dist/chunk-xz1kdswj.js +0 -21
  250. package/dist/chunk-xz1kdswj.js.map +0 -9
  251. package/dist/chunk-y84qnsd3.js +0 -32
  252. package/dist/chunk-y84qnsd3.js.map +0 -10
  253. package/dist/chunk-ywjn0rad.js +0 -14
  254. package/dist/chunk-ywjn0rad.js.map +0 -9
  255. package/dist/chunk-z9nvhm6r.js +0 -13
  256. package/dist/chunk-z9nvhm6r.js.map +0 -9
  257. package/dist/chunk-zhmvdpk6.js +0 -15
  258. package/dist/chunk-zhmvdpk6.js.map +0 -9
  259. package/dist/chunk-zrg9d4zw.js +0 -784
  260. package/dist/chunk-zrg9d4zw.js.map +0 -10
@@ -1,261 +0,0 @@
1
- // @bun
2
- import {
3
- compileStyleSource
4
- } from "./chunk-xnt8c6h2.js";
5
- import {
6
- __require
7
- } from "./chunk-bmgqm774.js";
8
-
9
- // src/build/tailwindCompiler.ts
10
- import { createHash } from "crypto";
11
- import { existsSync, readFileSync } from "fs";
12
- import { readFile, stat } from "fs/promises";
13
- import { dirname, isAbsolute, resolve } from "path";
14
- var compilerCache = new Map;
15
- var cachedTailwindCompile = null;
16
- var loadTailwindCompile = async () => {
17
- if (cachedTailwindCompile)
18
- return cachedTailwindCompile;
19
- try {
20
- const mod = await import("./chunk-w3m4m5we.js");
21
- cachedTailwindCompile = mod.compile;
22
- return mod.compile;
23
- } catch {
24
- throw new Error("Tailwind incremental dev compiler requires `tailwindcss` to be installed.");
25
- }
26
- };
27
- var recordDependency = async (deps, path) => {
28
- try {
29
- const mtime = (await stat(path)).mtimeMs;
30
- deps.set(path, mtime);
31
- } catch {
32
- deps.set(path, 0);
33
- }
34
- };
35
- var resolveBareCssImport = (id, base) => {
36
- const slashIndex = id.indexOf("/");
37
- const pkgName = id.startsWith("@") ? id.split("/").slice(0, 2).join("/") : slashIndex === -1 ? id : id.slice(0, slashIndex);
38
- const subpath = id.slice(pkgName.length);
39
- if (subpath !== "") {
40
- return Bun.resolveSync(id, base);
41
- }
42
- let pkgJsonPath;
43
- try {
44
- pkgJsonPath = Bun.resolveSync(`${pkgName}/package.json`, base);
45
- } catch {
46
- return Bun.resolveSync(id, base);
47
- }
48
- const pkgDir = dirname(pkgJsonPath);
49
- let pkg = {};
50
- try {
51
- pkg = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
52
- } catch {
53
- return Bun.resolveSync(id, base);
54
- }
55
- const exportsField = pkg.exports;
56
- const styleFromExports = exportsField?.["."]?.style;
57
- const candidates = [
58
- styleFromExports,
59
- typeof pkg.style === "string" ? pkg.style : undefined,
60
- "index.css",
61
- "dist/index.css"
62
- ].filter((entry) => typeof entry === "string");
63
- for (const candidate of candidates) {
64
- const candidatePath = resolve(pkgDir, candidate);
65
- if (existsSync(candidatePath))
66
- return candidatePath;
67
- }
68
- return Bun.resolveSync(id, base);
69
- };
70
- var createLoadStylesheet = (deps) => async (id, base) => {
71
- const path = id.startsWith(".") || isAbsolute(id) ? resolve(base, id) : resolveBareCssImport(id, base);
72
- const content = await readFile(path, "utf-8");
73
- await recordDependency(deps, path);
74
- return { base: dirname(path), content, path };
75
- };
76
- var loadModule = async (id, base, _kind) => {
77
- const path = id.startsWith(".") || isAbsolute(id) ? resolve(base, id) : Bun.resolveSync(id, base);
78
- const module = await import(path);
79
- return { base: dirname(path), module, path };
80
- };
81
- var buildCompilerEntry = async (cssPath) => {
82
- const compile = await loadTailwindCompile();
83
- const absPath = resolve(cssPath);
84
- const css = await readFile(absPath, "utf-8");
85
- const cssMtimeMs = (await stat(absPath)).mtimeMs;
86
- const cssDependencies = new Map;
87
- cssDependencies.set(absPath, cssMtimeMs);
88
- const compiler = await compile(css, {
89
- base: dirname(absPath),
90
- loadModule,
91
- loadStylesheet: createLoadStylesheet(cssDependencies)
92
- });
93
- return {
94
- candidateCounts: new Map,
95
- compiler,
96
- cssDependencies,
97
- cssMtimeMs,
98
- cssPath: absPath,
99
- lastEmittedHash: null,
100
- perFileCandidates: new Map,
101
- sources: [...compiler.sources]
102
- };
103
- };
104
- var CANDIDATE_PATTERN = /[A-Za-z!\-_][\w:\-/[\]().!,#%@&'"=]*[\w\])]/g;
105
- var extractCandidates = (source) => {
106
- const out = new Set;
107
- for (const match of source.matchAll(CANDIDATE_PATTERN)) {
108
- out.add(match[0]);
109
- }
110
- return out;
111
- };
112
- var hashCss = (css) => createHash("sha1").update(css).digest("hex");
113
- var fileMatchesSources = (file, sources) => {
114
- if (sources.length === 0)
115
- return true;
116
- const absFile = resolve(file);
117
- for (const source of sources) {
118
- if (source.negated)
119
- continue;
120
- const absolutePattern = resolve(source.base, source.pattern);
121
- const glob = new Bun.Glob(absolutePattern);
122
- if (glob.match(absFile))
123
- return true;
124
- }
125
- return false;
126
- };
127
- var incrementCandidateCount = (entry, candidate) => {
128
- const current = entry.candidateCounts.get(candidate) ?? 0;
129
- entry.candidateCounts.set(candidate, current + 1);
130
- };
131
- var decrementCandidateCount = (entry, candidate) => {
132
- const current = entry.candidateCounts.get(candidate) ?? 0;
133
- const next = current - 1;
134
- if (next <= 0) {
135
- entry.candidateCounts.delete(candidate);
136
- return;
137
- }
138
- entry.candidateCounts.set(candidate, next);
139
- };
140
- var replaceFileCandidates = (entry, file, freshCandidates) => {
141
- const previous = entry.perFileCandidates.get(file);
142
- if (previous) {
143
- for (const candidate of previous)
144
- decrementCandidateCount(entry, candidate);
145
- }
146
- entry.perFileCandidates.set(file, freshCandidates);
147
- for (const candidate of freshCandidates)
148
- incrementCandidateCount(entry, candidate);
149
- };
150
- var splitGlobAtFirstMeta = (absolutePattern) => {
151
- const firstMetaIndex = absolutePattern.search(/[*?{[]/);
152
- if (firstMetaIndex === -1) {
153
- return { glob: "", root: absolutePattern };
154
- }
155
- const lastSlashBeforeMeta = absolutePattern.lastIndexOf("/", firstMetaIndex);
156
- return {
157
- glob: absolutePattern.slice(lastSlashBeforeMeta + 1),
158
- root: absolutePattern.slice(0, lastSlashBeforeMeta) || "/"
159
- };
160
- };
161
- var collectFilesForSources = async (sources) => {
162
- const seen = new Set;
163
- const collected = [];
164
- const scans = sources.filter((source) => !source.negated).map(async (source) => {
165
- const absolutePattern = resolve(source.base, source.pattern);
166
- const { glob: relativePattern, root } = splitGlobAtFirstMeta(absolutePattern);
167
- if (!relativePattern)
168
- return [];
169
- const glob = new Bun.Glob(relativePattern);
170
- const matches = [];
171
- for await (const relative of glob.scan({
172
- absolute: false,
173
- cwd: root,
174
- onlyFiles: true
175
- })) {
176
- matches.push(resolve(root, relative));
177
- }
178
- return matches;
179
- });
180
- const results = await Promise.all(scans);
181
- for (const absolute of results.flat()) {
182
- if (seen.has(absolute))
183
- continue;
184
- seen.add(absolute);
185
- collected.push(absolute);
186
- }
187
- return collected;
188
- };
189
- var ingestFile = async (entry, absolute) => {
190
- try {
191
- const text = await readFile(absolute, "utf-8");
192
- replaceFileCandidates(entry, absolute, extractCandidates(text));
193
- } catch {}
194
- };
195
- var populateCandidatesFromAllSources = async (entry) => {
196
- const files = await collectFilesForSources(entry.sources);
197
- await Promise.all(files.map((file) => ingestFile(entry, file)));
198
- };
199
- var isCompilerStale = async (entry) => {
200
- const checks = [...entry.cssDependencies.entries()].map(async ([path, knownMtime]) => {
201
- try {
202
- const mtime = (await stat(path)).mtimeMs;
203
- return mtime !== knownMtime;
204
- } catch {
205
- return true;
206
- }
207
- });
208
- const results = await Promise.all(checks);
209
- return results.some(Boolean);
210
- };
211
- var getCompilerEntry = async (cssPath) => {
212
- const key = resolve(cssPath);
213
- const cached = compilerCache.get(key);
214
- if (cached && !await isCompilerStale(cached))
215
- return cached;
216
- const fresh = await buildCompilerEntry(cssPath);
217
- await populateCandidatesFromAllSources(fresh);
218
- compilerCache.set(key, fresh);
219
- return fresh;
220
- };
221
- var disposeTailwindCompiler = (cssPath) => {
222
- if (!cssPath) {
223
- compilerCache.clear();
224
- return;
225
- }
226
- compilerCache.delete(resolve(cssPath));
227
- };
228
- var incrementalTailwindBuild = async (tailwind, buildPath, changedFiles, styleTransformConfig) => {
229
- const startedAt = performance.now();
230
- const entry = await getCompilerEntry(tailwind.input);
231
- const inputAbs = entry.cssPath;
232
- const filesToRescan = [];
233
- for (const file of changedFiles) {
234
- const abs = resolve(file);
235
- if (abs === inputAbs)
236
- continue;
237
- if (!fileMatchesSources(abs, entry.sources))
238
- continue;
239
- filesToRescan.push(abs);
240
- }
241
- await Promise.all(filesToRescan.map((file) => ingestFile(entry, file)));
242
- const rawCss = entry.compiler.build([...entry.candidateCounts.keys()]);
243
- const outputPath = resolve(buildPath, tailwind.output);
244
- const finalCss = await compileStyleSource(outputPath, rawCss, "css", styleTransformConfig);
245
- const hash = hashCss(finalCss);
246
- const durationMs = performance.now() - startedAt;
247
- if (hash === entry.lastEmittedHash) {
248
- return { cssChanged: false, durationMs };
249
- }
250
- await Bun.write(outputPath, finalCss);
251
- entry.lastEmittedHash = hash;
252
- return { cssChanged: true, durationMs };
253
- };
254
- var warmTailwindCompiler = async (tailwind) => {
255
- await getCompilerEntry(tailwind.input);
256
- };
257
-
258
- export { extractCandidates, disposeTailwindCompiler, incrementalTailwindBuild, warmTailwindCompiler };
259
-
260
- //# debugId=98DF22AA58613E2464756E2164756E21
261
- //# sourceMappingURL=chunk-d7mwkzry.js.map
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/build/tailwindCompiler.ts"],
4
- "sourcesContent": [
5
- "/* Persistent Tailwind v4 compiler for incremental dev rebuilds.\n\n The naive path (re-running bun.build with bun-plugin-tailwind) pays the\n bundler init cost on every HMR tick. For a dev workflow where most edits\n only add or remove a few utility classes, that's wasted work — Tailwind v4\n has a per-candidate cache built into its compiler, but only if you keep\n the compiler instance alive.\n\n This module mirrors the strategy used by @tailwindcss/vite: hold one\n compiled instance keyed by the input CSS path, scan only changed files\n for new candidate tokens, and call `compiler.build(allCandidates)` to\n produce CSS. Tailwind reuses its internal cache for candidates it has\n already compiled, so the marginal cost per HMR is just the file scan\n plus CSS serialization.\n\n We also content-hash the emitted CSS and skip the broadcast (and the\n disk write) when it hasn't changed — this avoids needless browser\n stylesheet refetches when an edit doesn't add/remove any utilities. */\n\nimport { createHash } from 'node:crypto';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { readFile, stat } from 'node:fs/promises';\nimport { dirname, isAbsolute, resolve } from 'node:path';\nimport { compileStyleSource } from './stylePreprocessor';\nimport type {\n\tStylePreprocessorConfig,\n\tTailwindConfig\n} from '../../types/build';\n\ntype TailwindCompile = typeof import('tailwindcss').compile;\ntype TailwindCompiler = Awaited<ReturnType<TailwindCompile>>;\ntype TailwindSource = TailwindCompiler['sources'][number];\n\ntype CompilerEntry = {\n\tcompiler: TailwindCompiler;\n\tcssPath: string;\n\tcssMtimeMs: number;\n\tsources: TailwindSource[];\n\t/* Every CSS file the compiler pulled in via @import (the input CSS\n\t itself plus anything it transitively loaded). If one of these changes,\n\t the parsed AST is stale and we have to rebuild the compiler — Tailwind\n\t only resolves imports once at compile() time. */\n\tcssDependencies: Map<string, number>;\n\t/* Ref-counted union of candidates across the whole source tree. We\n\t count rather than track presence so that a class still referenced by\n\t another file isn't dropped when it disappears from one. */\n\tcandidateCounts: Map<string, number>;\n\tperFileCandidates: Map<string, Set<string>>;\n\tlastEmittedHash: string | null;\n};\n\n/* Cache one compiler per absolute input-CSS path. Multiple entries are\n possible if a project ever wires more than one Tailwind input, though in\n practice there's usually just one. */\nconst compilerCache = new Map<string, CompilerEntry>();\n\nlet cachedTailwindCompile: TailwindCompile | null = null;\n\nconst loadTailwindCompile = async () => {\n\tif (cachedTailwindCompile) return cachedTailwindCompile;\n\ttry {\n\t\tconst mod = await import('tailwindcss');\n\n\t\tcachedTailwindCompile = mod.compile;\n\n\t\treturn mod.compile;\n\t} catch {\n\t\tthrow new Error(\n\t\t\t'Tailwind incremental dev compiler requires `tailwindcss` to be installed.'\n\t\t);\n\t}\n};\n\nconst recordDependency = async (deps: Map<string, number>, path: string) => {\n\ttry {\n\t\tconst mtime = (await stat(path)).mtimeMs;\n\t\tdeps.set(path, mtime);\n\t} catch {\n\t\tdeps.set(path, 0);\n\t}\n};\n\n/* Resolve a bare specifier (e.g. `tailwindcss`) to its CSS entry point.\n\n Bun's default resolver follows the `import` / `require` conditions and\n would hand back the package's JS entry (e.g. `tailwindcss/dist/lib.mjs`).\n Tailwind's `@import \"tailwindcss\"` is a *CSS* import — it needs the\n `style` exports condition (or a sensible fallback) instead.\n\n The strategy:\n 1. Resolve `<id>/package.json` to find the package directory.\n 2. Look at `exports[\".\"].style` — Tailwind v4 sets this; it's the\n modern way to expose a CSS entry from a package.\n 3. Fall back to the legacy top-level `style` field.\n 4. Fall back to common file conventions (`index.css`, `dist/index.css`).\n\n Anything not in that shape (subpath imports like `tailwindcss/preflight`)\n falls through to Bun's regular resolver, which handles `.css` subpaths\n correctly. */\nconst resolveBareCssImport = (id: string, base: string) => {\n\tconst slashIndex = id.indexOf('/');\n\tconst pkgName = id.startsWith('@')\n\t\t? id.split('/').slice(0, 2).join('/')\n\t\t: slashIndex === -1\n\t\t\t? id\n\t\t\t: id.slice(0, slashIndex);\n\tconst subpath = id.slice(pkgName.length);\n\n\tif (subpath !== '') {\n\t\treturn Bun.resolveSync(id, base);\n\t}\n\n\tlet pkgJsonPath: string;\n\ttry {\n\t\tpkgJsonPath = Bun.resolveSync(`${pkgName}/package.json`, base);\n\t} catch {\n\t\treturn Bun.resolveSync(id, base);\n\t}\n\n\tconst pkgDir = dirname(pkgJsonPath);\n\tlet pkg: Record<string, unknown> = {};\n\ttry {\n\t\tpkg = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'));\n\t} catch {\n\t\treturn Bun.resolveSync(id, base);\n\t}\n\n\tconst exportsField = pkg.exports as\n\t\t| { '.'?: { style?: string } }\n\t\t| undefined;\n\tconst styleFromExports = exportsField?.['.']?.style;\n\tconst candidates = [\n\t\tstyleFromExports,\n\t\ttypeof pkg.style === 'string' ? pkg.style : undefined,\n\t\t'index.css',\n\t\t'dist/index.css'\n\t].filter((entry): entry is string => typeof entry === 'string');\n\n\tfor (const candidate of candidates) {\n\t\tconst candidatePath = resolve(pkgDir, candidate);\n\t\tif (existsSync(candidatePath)) return candidatePath;\n\t}\n\n\treturn Bun.resolveSync(id, base);\n};\n\n/* Resolve `@import` and `@source` paths relative to the importing file.\n The factory closes over the dependency map so every imported stylesheet\n is tracked for change detection. */\nconst createLoadStylesheet =\n\t(deps: Map<string, number>) => async (id: string, base: string) => {\n\t\tconst path =\n\t\t\tid.startsWith('.') || isAbsolute(id)\n\t\t\t\t? resolve(base, id)\n\t\t\t\t: resolveBareCssImport(id, base);\n\t\tconst content = await readFile(path, 'utf-8');\n\t\tawait recordDependency(deps, path);\n\n\t\treturn { base: dirname(path), content, path };\n\t};\n\nconst loadModule = async (\n\tid: string,\n\tbase: string,\n\t_kind: 'plugin' | 'config'\n) => {\n\tconst path =\n\t\tid.startsWith('.') || isAbsolute(id)\n\t\t\t? resolve(base, id)\n\t\t\t: Bun.resolveSync(id, base);\n\tconst module = await import(path);\n\n\treturn { base: dirname(path), module, path };\n};\n\nconst buildCompilerEntry = async (cssPath: string): Promise<CompilerEntry> => {\n\tconst compile = await loadTailwindCompile();\n\tconst absPath = resolve(cssPath);\n\tconst css = await readFile(absPath, 'utf-8');\n\tconst cssMtimeMs = (await stat(absPath)).mtimeMs;\n\tconst cssDependencies = new Map<string, number>();\n\tcssDependencies.set(absPath, cssMtimeMs);\n\tconst compiler = await compile(css, {\n\t\tbase: dirname(absPath),\n\t\tloadModule,\n\t\tloadStylesheet: createLoadStylesheet(cssDependencies)\n\t});\n\n\treturn {\n\t\tcandidateCounts: new Map<string, number>(),\n\t\tcompiler,\n\t\tcssDependencies,\n\t\tcssMtimeMs,\n\t\tcssPath: absPath,\n\t\tlastEmittedHash: null,\n\t\tperFileCandidates: new Map(),\n\t\tsources: [...compiler.sources]\n\t};\n};\n\n/* Permissive candidate extractor — matches anything that *could* be a\n Tailwind utility class. The compiler discards inputs that don't resolve\n to real utilities, so a superset is fine.\n\n The class character set covers v4 syntax including:\n - variants : `hover:`, `dark:`, `md:`, `data-[open]:`\n - modifiers : `text-blue/50`\n - arbitraries: `bg-[var(--c)]`, `min-h-[260px]`, `bg-[#fff]`\n - negation : `-mx-4`, `!important`\n - groups : `group-hover:opacity-50`\n\n Tokens must start with a letter / `-` / `!` (so we don't pull in pure\n numbers) and end with a word char or `]` or `)` (so we don't include\n trailing punctuation). */\nconst CANDIDATE_PATTERN = /[A-Za-z!\\-_][\\w:\\-/[\\]().!,#%@&'\"=]*[\\w\\])]/g;\n\nexport const extractCandidates = (source: string) => {\n\tconst out = new Set<string>();\n\tfor (const match of source.matchAll(CANDIDATE_PATTERN)) {\n\t\tout.add(match[0]);\n\t}\n\n\treturn out;\n};\n\nconst hashCss = (css: string) => createHash('sha1').update(css).digest('hex');\n\n// Match a file path against a Tailwind `@source` pattern.\n//\n// Tailwind hands us sources as { base, pattern, negated } where pattern\n// is interpreted relative to base and may contain `..` segments to walk\n// up the tree. `path.resolve(base, pattern)` collapses the `..` while\n// leaving the glob metacharacters intact, giving us an absolute glob\n// pattern that we can match against the absolute file path directly —\n// no prefix-and-substring dance, no glob-aware path walking.\nconst fileMatchesSources = (file: string, sources: TailwindSource[]) => {\n\tif (sources.length === 0) return true;\n\tconst absFile = resolve(file);\n\tfor (const source of sources) {\n\t\tif (source.negated) continue;\n\t\tconst absolutePattern = resolve(source.base, source.pattern);\n\t\tconst glob = new Bun.Glob(absolutePattern);\n\t\tif (glob.match(absFile)) return true;\n\t}\n\n\treturn false;\n};\n\nconst incrementCandidateCount = (entry: CompilerEntry, candidate: string) => {\n\tconst current = entry.candidateCounts.get(candidate) ?? 0;\n\tentry.candidateCounts.set(candidate, current + 1);\n};\n\nconst decrementCandidateCount = (entry: CompilerEntry, candidate: string) => {\n\tconst current = entry.candidateCounts.get(candidate) ?? 0;\n\tconst next = current - 1;\n\tif (next <= 0) {\n\t\tentry.candidateCounts.delete(candidate);\n\n\t\treturn;\n\t}\n\tentry.candidateCounts.set(candidate, next);\n};\n\nconst replaceFileCandidates = (\n\tentry: CompilerEntry,\n\tfile: string,\n\tfreshCandidates: Set<string>\n) => {\n\tconst previous = entry.perFileCandidates.get(file);\n\tif (previous) {\n\t\tfor (const candidate of previous)\n\t\t\tdecrementCandidateCount(entry, candidate);\n\t}\n\tentry.perFileCandidates.set(file, freshCandidates);\n\tfor (const candidate of freshCandidates)\n\t\tincrementCandidateCount(entry, candidate);\n};\n\n// Split an absolute glob like /abs/src/frontend/<glob> into a literal\n// scan root (/abs/src/frontend) and a relative glob portion. Bun.Glob.scan\n// needs a real directory as `cwd`; passing a glob there silently scans\n// nothing.\nconst splitGlobAtFirstMeta = (absolutePattern: string) => {\n\tconst firstMetaIndex = absolutePattern.search(/[*?{[]/);\n\tif (firstMetaIndex === -1) {\n\t\treturn { glob: '', root: absolutePattern };\n\t}\n\tconst lastSlashBeforeMeta = absolutePattern.lastIndexOf(\n\t\t'/',\n\t\tfirstMetaIndex\n\t);\n\n\treturn {\n\t\tglob: absolutePattern.slice(lastSlashBeforeMeta + 1),\n\t\troot: absolutePattern.slice(0, lastSlashBeforeMeta) || '/'\n\t};\n};\n\nconst collectFilesForSources = async (sources: TailwindSource[]) => {\n\tconst seen = new Set<string>();\n\tconst collected: string[] = [];\n\tconst scans = sources\n\t\t.filter((source) => !source.negated)\n\t\t.map(async (source) => {\n\t\t\tconst absolutePattern = resolve(source.base, source.pattern);\n\t\t\tconst { glob: relativePattern, root } =\n\t\t\t\tsplitGlobAtFirstMeta(absolutePattern);\n\t\t\tif (!relativePattern) return [];\n\t\t\tconst glob = new Bun.Glob(relativePattern);\n\t\t\tconst matches: string[] = [];\n\t\t\tfor await (const relative of glob.scan({\n\t\t\t\tabsolute: false,\n\t\t\t\tcwd: root,\n\t\t\t\tonlyFiles: true\n\t\t\t})) {\n\t\t\t\tmatches.push(resolve(root, relative));\n\t\t\t}\n\n\t\t\treturn matches;\n\t\t});\n\tconst results = await Promise.all(scans);\n\tfor (const absolute of results.flat()) {\n\t\tif (seen.has(absolute)) continue;\n\t\tseen.add(absolute);\n\t\tcollected.push(absolute);\n\t}\n\n\treturn collected;\n};\n\nconst ingestFile = async (entry: CompilerEntry, absolute: string) => {\n\ttry {\n\t\tconst text = await readFile(absolute, 'utf-8');\n\t\treplaceFileCandidates(entry, absolute, extractCandidates(text));\n\t} catch {\n\t\t// File vanished between glob and read — skip silently.\n\t}\n};\n\nconst populateCandidatesFromAllSources = async (entry: CompilerEntry) => {\n\tconst files = await collectFilesForSources(entry.sources);\n\tawait Promise.all(files.map((file) => ingestFile(entry, file)));\n};\n\nconst isCompilerStale = async (entry: CompilerEntry) => {\n\tconst checks = [...entry.cssDependencies.entries()].map(\n\t\tasync ([path, knownMtime]) => {\n\t\t\ttry {\n\t\t\t\tconst mtime = (await stat(path)).mtimeMs;\n\n\t\t\t\treturn mtime !== knownMtime;\n\t\t\t} catch {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t);\n\tconst results = await Promise.all(checks);\n\n\treturn results.some(Boolean);\n};\n\nconst getCompilerEntry = async (cssPath: string) => {\n\tconst key = resolve(cssPath);\n\tconst cached = compilerCache.get(key);\n\tif (cached && !(await isCompilerStale(cached))) return cached;\n\n\tconst fresh = await buildCompilerEntry(cssPath);\n\tawait populateCandidatesFromAllSources(fresh);\n\tcompilerCache.set(key, fresh);\n\n\treturn fresh;\n};\n\n/* Drop the cached compiler — used when the dev server stops or the\n Tailwind input CSS itself changes and needs a full re-parse. */\nexport const disposeTailwindCompiler = (cssPath?: string) => {\n\tif (!cssPath) {\n\t\tcompilerCache.clear();\n\n\t\treturn;\n\t}\n\tcompilerCache.delete(resolve(cssPath));\n};\n\n/* Run a fast incremental Tailwind build. Returns whether the emitted CSS\n actually changed — callers can use that to skip the broadcast. */\nexport const incrementalTailwindBuild = async (\n\ttailwind: TailwindConfig,\n\tbuildPath: string,\n\tchangedFiles: string[],\n\tstyleTransformConfig?: StylePreprocessorConfig\n) => {\n\tconst startedAt = performance.now();\n\tconst entry = await getCompilerEntry(tailwind.input);\n\tconst inputAbs = entry.cssPath;\n\tconst filesToRescan: string[] = [];\n\n\tfor (const file of changedFiles) {\n\t\tconst abs = resolve(file);\n\t\tif (abs === inputAbs) continue;\n\t\tif (!fileMatchesSources(abs, entry.sources)) continue;\n\t\tfilesToRescan.push(abs);\n\t}\n\n\tawait Promise.all(filesToRescan.map((file) => ingestFile(entry, file)));\n\n\tconst rawCss = entry.compiler.build([...entry.candidateCounts.keys()]);\n\tconst outputPath = resolve(buildPath, tailwind.output);\n\tconst finalCss = await compileStyleSource(\n\t\toutputPath,\n\t\trawCss,\n\t\t'css',\n\t\tstyleTransformConfig\n\t);\n\tconst hash = hashCss(finalCss);\n\tconst durationMs = performance.now() - startedAt;\n\n\tif (hash === entry.lastEmittedHash) {\n\t\treturn { cssChanged: false, durationMs };\n\t}\n\n\tawait Bun.write(outputPath, finalCss);\n\tentry.lastEmittedHash = hash;\n\n\treturn { cssChanged: true, durationMs };\n};\n\n/* Pre-build the compiler at dev startup so the first HMR tick doesn't\n pay the parse-and-scan cost. Safe to call multiple times — it's a no-op\n once cached. */\nexport const warmTailwindCompiler = async (tailwind: TailwindConfig) => {\n\tawait getCompilerEntry(tailwind.input);\n};\n"
6
- ],
7
- "mappings": ";;;;;;;;;AAmBA;AACA;AACA;AACA;AAgCA,IAAM,gBAAgB,IAAI;AAE1B,IAAI,wBAAgD;AAEpD,IAAM,sBAAsB,YAAY;AAAA,EACvC,IAAI;AAAA,IAAuB,OAAO;AAAA,EAClC,IAAI;AAAA,IACH,MAAM,MAAM,MAAa;AAAA,IAEzB,wBAAwB,IAAI;AAAA,IAE5B,OAAO,IAAI;AAAA,IACV,MAAM;AAAA,IACP,MAAM,IAAI,MACT,2EACD;AAAA;AAAA;AAIF,IAAM,mBAAmB,OAAO,MAA2B,SAAiB;AAAA,EAC3E,IAAI;AAAA,IACH,MAAM,SAAS,MAAM,KAAK,IAAI,GAAG;AAAA,IACjC,KAAK,IAAI,MAAM,KAAK;AAAA,IACnB,MAAM;AAAA,IACP,KAAK,IAAI,MAAM,CAAC;AAAA;AAAA;AAqBlB,IAAM,uBAAuB,CAAC,IAAY,SAAiB;AAAA,EAC1D,MAAM,aAAa,GAAG,QAAQ,GAAG;AAAA,EACjC,MAAM,UAAU,GAAG,WAAW,GAAG,IAC9B,GAAG,MAAM,GAAG,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,IAClC,eAAe,KACd,KACA,GAAG,MAAM,GAAG,UAAU;AAAA,EAC1B,MAAM,UAAU,GAAG,MAAM,QAAQ,MAAM;AAAA,EAEvC,IAAI,YAAY,IAAI;AAAA,IACnB,OAAO,IAAI,YAAY,IAAI,IAAI;AAAA,EAChC;AAAA,EAEA,IAAI;AAAA,EACJ,IAAI;AAAA,IACH,cAAc,IAAI,YAAY,GAAG,wBAAwB,IAAI;A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ACvB;AAAA,EAEA,MAAM,QAAQ,IAAI,cAAc,IAAI,CAAC,SAAS,WAAW,OAAO,IAAI,CAAC,CAAC;AAAA,EAEtE,MAAM,SAAS,MAAM,SAAS,MAAM,CAAC,GAAG,MAAM,gBAAgB,KAAK,CAAC,CAAC;AAAA,EACrE,MAAM,aAAa,QAAQ,WAAW,SAAS,MAAM;AAAA,EACrD,MAAM,WAAW,MAAM,mBACtB,YACA,QACA,OACA,oBACD;AAAA,EACA,MAAM,OAAO,QAAQ,QAAQ;AAAA,EAC7B,MAAM,aAAa,YAAY,IAAI,IAAI;AAAA,EAEvC,IAAI,SAAS,MAAM,iBAAiB;AAAA,IACnC,OAAO,EAAE,YAAY,OAAO,WAAW;AAAA,EACxC;AAAA,EAEA,MAAM,IAAI,MAAM,YAAY,QAAQ;AAAA,EACpC,MAAM,kBAAkB;AAAA,EAExB,OAAO,EAAE,YAAY,MAAM,WAAW;AAAA;AAMhC,IAAM,uBAAuB,OAAO,aAA6B;AAAA,EACvE,MAAM,iBAAiB,SAAS,KAAK;AAAA;",
8
- "debugId": "98DF22AA58613E2464756E2164756E21",
9
- "names": []
10
- }
@@ -1,184 +0,0 @@
1
- // @bun
2
- import {
3
- compileSvelteServerModule
4
- } from "./chunk-9ve9jq72.js";
5
- import {
6
- getIslandMarkerAttributes,
7
- serializeIslandAttributes
8
- } from "./chunk-2f21eenc.js";
9
- import {
10
- getIslandBuildReference,
11
- getIslandComponent
12
- } from "./chunk-8kcfffry.js";
13
- import {
14
- __require
15
- } from "./chunk-bmgqm774.js";
16
-
17
- // src/core/islandSsr.ts
18
- var renderAngularIslandToHtmlInternal = async (component, props, islandId) => {
19
- const { renderAngularIslandToHtml } = await import("./chunk-wwzvp0zn.js");
20
- return renderAngularIslandToHtml(component, props, islandId);
21
- };
22
- var renderAngularIslandToHtml = renderAngularIslandToHtmlInternal;
23
- var renderReactIslandToHtml = (component, props) => import("react").then(({ createElement }) => import("react-dom/server").then(({ renderToStaticMarkup }) => renderToStaticMarkup(createElement(component, props))));
24
- var renderSvelteIslandToHtml = (component, props) => import("svelte/server").then(({ render }) => {
25
- const { body } = render(component, { props });
26
- return body;
27
- });
28
- var renderVueIslandToHtml = (component, props) => import("vue").then(({ createSSRApp, h: createVueVNode }) => {
29
- const app = createSSRApp({
30
- render: () => createVueVNode(component, props)
31
- });
32
- return import("vue/server-renderer").then(({ renderToString }) => renderToString(app));
33
- });
34
-
35
- // src/core/renderIslandMarkup.ts
36
- var islandSequence = 0;
37
- var resolvedServerComponentCache = new Map;
38
- var resolvedServerBuildComponentCache = new Map;
39
- var nextIslandId = () => {
40
- islandSequence += 1;
41
- return `island-${islandSequence}`;
42
- };
43
- var isRecord = (value) => typeof value === "object" && value !== null;
44
- var isReactServerIslandComponent = (value) => typeof value === "function";
45
- var isSvelteServerIslandComponent = (value) => typeof value === "function";
46
- var isVueServerIslandComponent = (value) => typeof value === "function" || isRecord(value);
47
- var isAngularServerIslandComponent = (value) => typeof value === "function";
48
- var resolveBuildReferencePath = (source, registryPath) => {
49
- if (source.startsWith("file://"))
50
- return new URL(source).pathname;
51
- if (source.startsWith("."))
52
- return new URL(source, registryPath).pathname;
53
- return source;
54
- };
55
- var loadAndCompileServerBuildComponent = async (buildReferencePath) => {
56
- const compiledModulePath = await compileSvelteServerModule(buildReferencePath);
57
- const loadedModule = await import(compiledModulePath);
58
- return "default" in loadedModule ? loadedModule.default : loadedModule;
59
- };
60
- var loadServerBuildComponent = async (buildReferencePath) => {
61
- const cachedBuildComponent = resolvedServerBuildComponentCache.get(buildReferencePath);
62
- if (cachedBuildComponent) {
63
- return cachedBuildComponent;
64
- }
65
- const loadPromise = loadAndCompileServerBuildComponent(buildReferencePath);
66
- resolvedServerBuildComponentCache.set(buildReferencePath, loadPromise);
67
- return loadPromise;
68
- };
69
- var loadServerImportComponent = async (resolvedComponent, exportName) => {
70
- const resolvedModulePath = resolvedComponent.startsWith(".") ? new URL(resolvedComponent, import.meta.url).pathname : resolvedComponent;
71
- const importTarget = resolvedModulePath.endsWith(".svelte") ? await compileSvelteServerModule(resolvedModulePath) : resolvedModulePath;
72
- const loadedModule = await import(importTarget);
73
- if (exportName && exportName !== "default" && exportName in loadedModule) {
74
- return loadedModule[exportName];
75
- }
76
- return "default" in loadedModule ? loadedModule.default : loadedModule;
77
- };
78
- var resolveIslandComponent = async (component) => {
79
- const buildReference = getIslandBuildReference(component);
80
- const buildReferencePath = buildReference?.source ? resolveBuildReferencePath(buildReference.source, import.meta.url) : null;
81
- if (buildReferencePath?.endsWith(".svelte")) {
82
- return loadServerBuildComponent(buildReferencePath);
83
- }
84
- if (buildReferencePath) {
85
- return loadServerImportComponent(buildReferencePath, buildReference?.export);
86
- }
87
- const resolvedComponent = getIslandComponent(component);
88
- if (typeof resolvedComponent !== "string") {
89
- return resolvedComponent;
90
- }
91
- return loadServerImportComponent(resolvedComponent);
92
- };
93
- var resolveServerIslandComponent = async (component) => {
94
- const cachedResolvedComponent = resolvedServerComponentCache.get(component);
95
- if (cachedResolvedComponent) {
96
- return cachedResolvedComponent;
97
- }
98
- const resolutionPromise = resolveIslandComponent(component);
99
- resolvedServerComponentCache.set(component, resolutionPromise);
100
- return resolutionPromise;
101
- };
102
- var resolveReactServerIslandComponent = async (component) => {
103
- const resolvedComponent = await resolveServerIslandComponent(component);
104
- if (!isReactServerIslandComponent(resolvedComponent)) {
105
- throw new Error("Resolved React island is not a valid React component.");
106
- }
107
- return resolvedComponent;
108
- };
109
- var resolveSvelteServerIslandComponent = async (component) => {
110
- const resolvedComponent = await resolveServerIslandComponent(component);
111
- if (!isSvelteServerIslandComponent(resolvedComponent)) {
112
- throw new Error("Resolved Svelte island is not a valid Svelte component.");
113
- }
114
- return resolvedComponent;
115
- };
116
- var resolveVueServerIslandComponent = async (component) => {
117
- const resolvedComponent = await resolveServerIslandComponent(component);
118
- if (!isVueServerIslandComponent(resolvedComponent)) {
119
- throw new Error("Resolved Vue island is not a valid Vue component.");
120
- }
121
- return resolvedComponent;
122
- };
123
- var resolveAngularServerIslandComponent = async (component) => {
124
- const resolvedComponent = await resolveServerIslandComponent(component);
125
- if (!isAngularServerIslandComponent(resolvedComponent)) {
126
- throw new Error("Resolved Angular island is not a valid Angular component.");
127
- }
128
- return resolvedComponent;
129
- };
130
- var renderIslandMarkup = async (registry, props) => {
131
- const result = await renderIslandResult(registry, props);
132
- return `<div ${serializeIslandAttributes(result.attributes)}>${result.html}</div>`;
133
- };
134
- var renderIslandResult = async (registry, props) => {
135
- const islandId = nextIslandId();
136
- const attributes = getIslandMarkerAttributes(props);
137
- if (props.framework === "react") {
138
- const entry = registry.react?.[props.component];
139
- if (!entry) {
140
- throw new Error(`Island component "${props.component}" is not registered for framework "react".`);
141
- }
142
- const component = await resolveReactServerIslandComponent(entry);
143
- const html = await renderReactIslandToHtml(component, props.props);
144
- return { attributes, html };
145
- }
146
- if (props.framework === "svelte") {
147
- const entry = registry.svelte?.[props.component];
148
- if (!entry) {
149
- throw new Error(`Island component "${props.component}" is not registered for framework "svelte".`);
150
- }
151
- const component = await resolveSvelteServerIslandComponent(entry);
152
- const html = await renderSvelteIslandToHtml(component, props.props);
153
- return { attributes, html };
154
- }
155
- if (props.framework === "vue") {
156
- const entry = registry.vue?.[props.component];
157
- if (!entry) {
158
- throw new Error(`Island component "${props.component}" is not registered for framework "vue".`);
159
- }
160
- const component = await resolveVueServerIslandComponent(entry);
161
- const html = await renderVueIslandToHtml(component, props.props);
162
- return { attributes, html };
163
- }
164
- if (props.framework === "angular") {
165
- const entry = registry.angular?.[props.component];
166
- if (!entry) {
167
- throw new Error(`Island component "${props.component}" is not registered for framework "angular".`);
168
- }
169
- const component = await resolveAngularServerIslandComponent(entry);
170
- const html = await renderAngularIslandToHtml(component, props.props, islandId);
171
- return {
172
- attributes: {
173
- ...getIslandMarkerAttributes(props, islandId)
174
- },
175
- html
176
- };
177
- }
178
- throw new Error(`Framework "${props.framework}" is not implemented in this prototype.`);
179
- };
180
-
181
- export { renderIslandMarkup, renderIslandResult };
182
-
183
- //# debugId=422A05E95D6E1A7B64756E2164756E21
184
- //# sourceMappingURL=chunk-d8w0qm28.js.map
@@ -1,11 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/core/islandSsr.ts", "../src/core/renderIslandMarkup.ts"],
4
- "sourcesContent": [
5
- "type ReactComponentType<Props extends Record<string, unknown>> =\n\timport('react').ComponentType<Props>;\n\nconst renderAngularIslandToHtmlInternal = async (\n\tcomponent: import('@angular/core').Type<object>,\n\tprops: Record<string, unknown>,\n\tislandId: string\n) => {\n\tconst { renderAngularIslandToHtml } = await import('../angular/islands');\n\n\treturn renderAngularIslandToHtml(component, props, islandId);\n};\nexport const renderAngularIslandToHtml = renderAngularIslandToHtmlInternal;\nexport const renderReactIslandToHtml = <Props extends Record<string, unknown>>(\n\tcomponent: ReactComponentType<Props>,\n\tprops: Props\n) =>\n\timport('react').then(({ createElement }) =>\n\t\timport('react-dom/server').then(({ renderToStaticMarkup }) =>\n\t\t\trenderToStaticMarkup(createElement(component, props))\n\t\t)\n\t);\nexport const renderSvelteIslandToHtml = <Props extends Record<string, unknown>>(\n\tcomponent: import('svelte').Component<Props>,\n\tprops: Props\n) =>\n\timport('svelte/server').then(({ render }) => {\n\t\tconst { body } = render(component, { props });\n\n\t\treturn body;\n\t});\nexport const renderVueIslandToHtml = <Props extends Record<string, unknown>>(\n\tcomponent: import('vue').Component<Props>,\n\tprops: Props\n) =>\n\timport('vue').then(({ createSSRApp, h: createVueVNode }) => {\n\t\tconst app = createSSRApp({\n\t\t\trender: () => createVueVNode(component, props)\n\t\t});\n\n\t\treturn import('vue/server-renderer').then(({ renderToString }) =>\n\t\t\trenderToString(app)\n\t\t);\n\t});\n",
6
- "import type {\n\tIslandRegistry,\n\tIslandRegistryInput,\n\tRuntimeIslandRenderProps\n} from '../../types/island';\nimport {\n\trenderAngularIslandToHtml,\n\trenderReactIslandToHtml,\n\trenderSvelteIslandToHtml,\n\trenderVueIslandToHtml\n} from './islandSsr';\nimport { compileSvelteServerModule } from './svelteServerModule';\nimport {\n\tgetIslandMarkerAttributes,\n\tserializeIslandAttributes\n} from './islandMarkupAttributes';\nimport { getIslandBuildReference, getIslandComponent } from './islands';\n\nlet islandSequence = 0;\nconst resolvedServerComponentCache = new Map<unknown, Promise<unknown>>();\nconst resolvedServerBuildComponentCache = new Map<string, Promise<unknown>>();\n\nconst nextIslandId = () => {\n\tislandSequence += 1;\n\n\treturn `island-${islandSequence}`;\n};\n\ntype AngularServerIslandComponent = import('@angular/core').Type<object>;\ntype ReactServerIslandComponent = import('react').ComponentType<\n\tRecord<string, unknown>\n>;\ntype SvelteServerIslandComponent = import('svelte').Component<\n\tRecord<string, unknown>\n>;\ntype VueServerIslandComponent = import('vue').Component<\n\tRecord<string, unknown>\n>;\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst isReactServerIslandComponent = (\n\tvalue: unknown\n): value is ReactServerIslandComponent => typeof value === 'function';\n\nconst isSvelteServerIslandComponent = (\n\tvalue: unknown\n): value is SvelteServerIslandComponent => typeof value === 'function';\n\nconst isVueServerIslandComponent = (\n\tvalue: unknown\n): value is VueServerIslandComponent =>\n\ttypeof value === 'function' || isRecord(value);\n\nconst isAngularServerIslandComponent = (\n\tvalue: unknown\n): value is AngularServerIslandComponent => typeof value === 'function';\n\nconst resolveBuildReferencePath = (source: string, registryPath: string) => {\n\tif (source.startsWith('file://')) return new URL(source).pathname;\n\tif (source.startsWith('.')) return new URL(source, registryPath).pathname;\n\n\treturn source;\n};\n\nconst loadAndCompileServerBuildComponent = async (\n\tbuildReferencePath: string\n) => {\n\tconst compiledModulePath =\n\t\tawait compileSvelteServerModule(buildReferencePath);\n\tconst loadedModule = await import(compiledModulePath);\n\n\treturn 'default' in loadedModule ? loadedModule.default : loadedModule;\n};\n\nconst loadServerBuildComponent = async (buildReferencePath: string) => {\n\tconst cachedBuildComponent =\n\t\tresolvedServerBuildComponentCache.get(buildReferencePath);\n\tif (cachedBuildComponent) {\n\t\treturn cachedBuildComponent;\n\t}\n\n\tconst loadPromise = loadAndCompileServerBuildComponent(buildReferencePath);\n\tresolvedServerBuildComponentCache.set(buildReferencePath, loadPromise);\n\n\treturn loadPromise;\n};\n\nconst loadServerImportComponent = async (\n\tresolvedComponent: string,\n\texportName?: string\n) => {\n\tconst resolvedModulePath = resolvedComponent.startsWith('.')\n\t\t? new URL(resolvedComponent, import.meta.url).pathname\n\t\t: resolvedComponent;\n\tconst importTarget = resolvedModulePath.endsWith('.svelte')\n\t\t? await compileSvelteServerModule(resolvedModulePath)\n\t\t: resolvedModulePath;\n\tconst loadedModule = await import(importTarget);\n\n\tif (exportName && exportName !== 'default' && exportName in loadedModule) {\n\t\treturn loadedModule[exportName];\n\t}\n\n\treturn 'default' in loadedModule ? loadedModule.default : loadedModule;\n};\n\nconst resolveIslandComponent = async (component: unknown) => {\n\tconst buildReference = getIslandBuildReference(component);\n\tconst buildReferencePath = buildReference?.source\n\t\t? resolveBuildReferencePath(buildReference.source, import.meta.url)\n\t\t: null;\n\tif (buildReferencePath?.endsWith('.svelte')) {\n\t\treturn loadServerBuildComponent(buildReferencePath);\n\t}\n\tif (buildReferencePath) {\n\t\treturn loadServerImportComponent(\n\t\t\tbuildReferencePath,\n\t\t\tbuildReference?.export\n\t\t);\n\t}\n\n\tconst resolvedComponent = getIslandComponent(component);\n\tif (typeof resolvedComponent !== 'string') {\n\t\treturn resolvedComponent;\n\t}\n\n\treturn loadServerImportComponent(resolvedComponent);\n};\n\nconst resolveServerIslandComponent = async (component: unknown) => {\n\tconst cachedResolvedComponent = resolvedServerComponentCache.get(component);\n\tif (cachedResolvedComponent) {\n\t\treturn cachedResolvedComponent;\n\t}\n\n\tconst resolutionPromise = resolveIslandComponent(component);\n\n\tresolvedServerComponentCache.set(component, resolutionPromise);\n\n\treturn resolutionPromise;\n};\n\nconst resolveReactServerIslandComponent = async (component: unknown) => {\n\tconst resolvedComponent = await resolveServerIslandComponent(component);\n\tif (!isReactServerIslandComponent(resolvedComponent)) {\n\t\tthrow new Error(\n\t\t\t'Resolved React island is not a valid React component.'\n\t\t);\n\t}\n\n\treturn resolvedComponent;\n};\n\nconst resolveSvelteServerIslandComponent = async (component: unknown) => {\n\tconst resolvedComponent = await resolveServerIslandComponent(component);\n\tif (!isSvelteServerIslandComponent(resolvedComponent)) {\n\t\tthrow new Error(\n\t\t\t'Resolved Svelte island is not a valid Svelte component.'\n\t\t);\n\t}\n\n\treturn resolvedComponent;\n};\n\nconst resolveVueServerIslandComponent = async (component: unknown) => {\n\tconst resolvedComponent = await resolveServerIslandComponent(component);\n\tif (!isVueServerIslandComponent(resolvedComponent)) {\n\t\tthrow new Error('Resolved Vue island is not a valid Vue component.');\n\t}\n\n\treturn resolvedComponent;\n};\n\nconst resolveAngularServerIslandComponent = async (component: unknown) => {\n\tconst resolvedComponent = await resolveServerIslandComponent(component);\n\tif (!isAngularServerIslandComponent(resolvedComponent)) {\n\t\tthrow new Error(\n\t\t\t'Resolved Angular island is not a valid Angular component.'\n\t\t);\n\t}\n\n\treturn resolvedComponent;\n};\n\nexport const renderIslandMarkup = async <T extends IslandRegistryInput>(\n\tregistry: IslandRegistry<T> | T,\n\tprops: RuntimeIslandRenderProps\n) => {\n\tconst result = await renderIslandResult(registry, props);\n\n\treturn `<div ${serializeIslandAttributes(result.attributes)}>${result.html}</div>`;\n};\nexport const renderIslandResult = async <T extends IslandRegistryInput>(\n\tregistry: IslandRegistry<T> | T,\n\tprops: RuntimeIslandRenderProps\n) => {\n\tconst islandId = nextIslandId();\n\tconst attributes = getIslandMarkerAttributes(props);\n\n\tif (props.framework === 'react') {\n\t\tconst entry = registry.react?.[props.component];\n\t\tif (!entry) {\n\t\t\tthrow new Error(\n\t\t\t\t`Island component \"${props.component}\" is not registered for framework \"react\".`\n\t\t\t);\n\t\t}\n\t\tconst component = await resolveReactServerIslandComponent(entry);\n\t\tconst html = await renderReactIslandToHtml(component, props.props);\n\n\t\treturn { attributes, html };\n\t}\n\n\tif (props.framework === 'svelte') {\n\t\tconst entry = registry.svelte?.[props.component];\n\t\tif (!entry) {\n\t\t\tthrow new Error(\n\t\t\t\t`Island component \"${props.component}\" is not registered for framework \"svelte\".`\n\t\t\t);\n\t\t}\n\t\tconst component = await resolveSvelteServerIslandComponent(entry);\n\t\tconst html = await renderSvelteIslandToHtml(component, props.props);\n\n\t\treturn { attributes, html };\n\t}\n\n\tif (props.framework === 'vue') {\n\t\tconst entry = registry.vue?.[props.component];\n\t\tif (!entry) {\n\t\t\tthrow new Error(\n\t\t\t\t`Island component \"${props.component}\" is not registered for framework \"vue\".`\n\t\t\t);\n\t\t}\n\t\tconst component = await resolveVueServerIslandComponent(entry);\n\t\tconst html = await renderVueIslandToHtml(component, props.props);\n\n\t\treturn { attributes, html };\n\t}\n\n\tif (props.framework === 'angular') {\n\t\tconst entry = registry.angular?.[props.component];\n\t\tif (!entry) {\n\t\t\tthrow new Error(\n\t\t\t\t`Island component \"${props.component}\" is not registered for framework \"angular\".`\n\t\t\t);\n\t\t}\n\t\tconst component = await resolveAngularServerIslandComponent(entry);\n\t\tconst html = await renderAngularIslandToHtml(\n\t\t\tcomponent,\n\t\t\tprops.props,\n\t\t\tislandId\n\t\t);\n\n\t\treturn {\n\t\t\tattributes: {\n\t\t\t\t...getIslandMarkerAttributes(props, islandId)\n\t\t\t},\n\t\t\thtml\n\t\t};\n\t}\n\n\tthrow new Error(\n\t\t`Framework \"${props.framework}\" is not implemented in this prototype.`\n\t);\n};\n"
7
- ],
8
- "mappings": ";;;;;;;;;;;;;;;;;AAGA,IAAM,oCAAoC,OACzC,WACA,OACA,aACI;AAAA,EACJ,QAAQ,8BAA8B,MAAa;AAAA,EAEnD,OAAO,0BAA0B,WAAW,OAAO,QAAQ;AAAA;AAErD,IAAM,4BAA4B;AAClC,IAAM,0BAA0B,CACtC,WACA,UAEO,gBAAS,KAAK,GAAG,oBAChB,2BAAoB,KAAK,GAAG,2BAClC,qBAAqB,cAAc,WAAW,KAAK,CAAC,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AA,MACA;AAAA,IACD;AAAA,EACD;AAAA,EAEA,MAAM,IAAI,MACT,cAAc,MAAM,kDACrB;AAAA;",
9
- "debugId": "422A05E95D6E1A7B64756E2164756E21",
10
- "names": []
11
- }
@@ -1,12 +0,0 @@
1
- // @bun
2
- // src/core/ssrCache.ts
3
- var dirtyFrameworks = new Set;
4
- var isSsrCacheDirty = (framework) => dirtyFrameworks.has(framework);
5
- var markSsrCacheDirty = (framework) => {
6
- dirtyFrameworks.add(framework);
7
- };
8
-
9
- export { isSsrCacheDirty, markSsrCacheDirty };
10
-
11
- //# debugId=B46F4F2C39173BCD64756E2164756E21
12
- //# sourceMappingURL=chunk-d9c0am65.js.map
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/core/ssrCache.ts"],
4
- "sourcesContent": [
5
- "import type { IslandFramework } from '../../types/island';\n\nconst dirtyFrameworks = new Set<IslandFramework>();\n\nexport const isSsrCacheDirty = (framework: IslandFramework) =>\n\tdirtyFrameworks.has(framework);\nexport const markSsrCacheDirty = (framework: IslandFramework) => {\n\tdirtyFrameworks.add(framework);\n};\n"
6
- ],
7
- "mappings": ";;AAEA,IAAM,kBAAkB,IAAI;AAErB,IAAM,kBAAkB,CAAC,cAC/B,gBAAgB,IAAI,SAAS;AACvB,IAAM,oBAAoB,CAAC,cAA+B;AAAA,EAChE,gBAAgB,IAAI,SAAS;AAAA;",
8
- "debugId": "B46F4F2C39173BCD64756E2164756E21",
9
- "names": []
10
- }
@@ -1,12 +0,0 @@
1
- // @bun
2
- import {
3
- commonAncestor
4
- } from "./chunk-b3gbnrwe.js";
5
- import"./chunk-hyjs4bqs.js";
6
- import"./chunk-bmgqm774.js";
7
- export {
8
- commonAncestor
9
- };
10
-
11
- //# debugId=470B84F8382E797064756E2164756E21
12
- //# sourceMappingURL=chunk-daqghmg8.js.map
@@ -1,9 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [
5
- ],
6
- "mappings": "",
7
- "debugId": "470B84F8382E797064756E2164756E21",
8
- "names": []
9
- }