@absolutejs/absolute 0.19.0-beta.783 → 0.19.0-beta.784
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/browser.js +57 -9801
- package/dist/angular/browser.js.map +4 -246
- package/dist/angular/index.js +61 -14967
- package/dist/angular/index.js.map +4 -282
- package/dist/angular/server.js +45 -5699
- package/dist/angular/server.js.map +3 -52
- package/dist/build.js +45 -18021
- package/dist/build.js.map +3 -100
- package/dist/chunk-102fp7xe.js +63 -0
- package/dist/chunk-102fp7xe.js.map +10 -0
- package/dist/chunk-11zpfqz6.js +19 -0
- package/dist/chunk-11zpfqz6.js.map +10 -0
- package/dist/chunk-1e9vsfyh.js +100 -0
- package/dist/chunk-1e9vsfyh.js.map +10 -0
- package/dist/chunk-25v9t56f.js +29 -0
- package/dist/chunk-25v9t56f.js.map +11 -0
- package/dist/chunk-2f21eenc.js +21 -0
- package/dist/chunk-2f21eenc.js.map +10 -0
- package/dist/chunk-2ga2znex.js +13 -0
- package/dist/chunk-2ga2znex.js.map +9 -0
- package/dist/chunk-30yrw0f6.js +33 -0
- package/dist/chunk-30yrw0f6.js.map +10 -0
- package/dist/chunk-3c7mpj3m.js +784 -0
- package/dist/chunk-3c7mpj3m.js.map +10 -0
- package/dist/chunk-3g91wb4f.js +358 -0
- package/dist/chunk-3g91wb4f.js.map +10 -0
- package/dist/chunk-3yjzpcne.js +34 -0
- package/dist/chunk-3yjzpcne.js.map +10 -0
- package/dist/chunk-4bq79t8v.js +136 -0
- package/dist/chunk-4bq79t8v.js.map +10 -0
- package/dist/chunk-4d39r92n.js +81 -0
- package/dist/chunk-4d39r92n.js.map +10 -0
- package/dist/chunk-4m75s5xf.js +184 -0
- package/dist/chunk-4m75s5xf.js.map +11 -0
- package/dist/chunk-5003emhv.js +17 -0
- package/dist/chunk-5003emhv.js.map +10 -0
- package/dist/chunk-5fhp1jap.js +9169 -0
- package/dist/chunk-5fhp1jap.js.map +236 -0
- package/dist/chunk-6fkgm9s5.js +569 -0
- package/dist/chunk-6fkgm9s5.js.map +10 -0
- package/dist/chunk-6pdj08z3.js +73 -0
- package/dist/chunk-6pdj08z3.js.map +12 -0
- package/dist/chunk-6qjbrt0k.js +13 -0
- package/dist/chunk-6qjbrt0k.js.map +9 -0
- package/dist/chunk-6sccb4jr.js +14 -0
- package/dist/chunk-6sccb4jr.js.map +9 -0
- package/dist/chunk-73brtyw5.js +16 -0
- package/dist/chunk-73brtyw5.js.map +9 -0
- package/dist/chunk-77cqkarb.js +25 -0
- package/dist/chunk-77cqkarb.js.map +9 -0
- package/dist/chunk-798spvzv.js +50 -0
- package/dist/chunk-798spvzv.js.map +10 -0
- package/dist/chunk-7fw6x3js.js +131 -0
- package/dist/chunk-7fw6x3js.js.map +11 -0
- package/dist/chunk-7kjj42xm.js +11 -0
- package/dist/chunk-7kjj42xm.js.map +10 -0
- package/dist/chunk-851whwc7.js +17 -0
- package/dist/chunk-851whwc7.js.map +10 -0
- package/dist/chunk-85n68sy6.js +103 -0
- package/dist/chunk-85n68sy6.js.map +10 -0
- package/dist/chunk-8feq2qek.js +17 -0
- package/dist/chunk-8feq2qek.js.map +9 -0
- package/dist/chunk-8kcfffry.js +35 -0
- package/dist/chunk-8kcfffry.js.map +10 -0
- package/dist/chunk-93sqk7be.js +139 -0
- package/dist/chunk-93sqk7be.js.map +12 -0
- package/dist/chunk-97572s32.js +262 -0
- package/dist/chunk-97572s32.js.map +12 -0
- package/dist/chunk-9a307ca6.js +1742 -0
- package/dist/chunk-9a307ca6.js.map +11 -0
- package/dist/chunk-9c5tj4k3.js +130 -0
- package/dist/chunk-9c5tj4k3.js.map +10 -0
- package/dist/chunk-9xrsjeem.js +12 -0
- package/dist/chunk-9xrsjeem.js.map +9 -0
- package/dist/chunk-a9mvyp04.js +87 -0
- package/dist/chunk-a9mvyp04.js.map +10 -0
- package/dist/chunk-b3gbnrwe.js +21 -0
- package/dist/chunk-b3gbnrwe.js.map +10 -0
- package/dist/chunk-bmgqm774.js +65 -0
- package/dist/chunk-bmgqm774.js.map +9 -0
- package/dist/chunk-bxfghpma.js +69 -0
- package/dist/chunk-bxfghpma.js.map +10 -0
- package/dist/chunk-c1jfjnka.js +74 -0
- package/dist/chunk-c1jfjnka.js.map +10 -0
- package/dist/chunk-cbkrwmvh.js +80 -0
- package/dist/chunk-cbkrwmvh.js.map +10 -0
- package/dist/chunk-cdxd7sy2.js +71 -0
- package/dist/chunk-cdxd7sy2.js.map +10 -0
- package/dist/chunk-cg95827x.js +21 -0
- package/dist/chunk-cg95827x.js.map +10 -0
- package/dist/chunk-d9c0am65.js +12 -0
- package/dist/chunk-d9c0am65.js.map +10 -0
- package/dist/chunk-daqghmg8.js +12 -0
- package/dist/chunk-daqghmg8.js.map +9 -0
- package/dist/chunk-dr9yqsdb.js +203 -0
- package/dist/chunk-dr9yqsdb.js.map +10 -0
- package/dist/chunk-e8eecyrq.js +244 -0
- package/dist/chunk-e8eecyrq.js.map +10 -0
- package/dist/chunk-ex2hxe0v.js +160 -0
- package/dist/chunk-ex2hxe0v.js.map +11 -0
- package/dist/chunk-ey5hs6x6.js +253 -0
- package/dist/chunk-ey5hs6x6.js.map +11 -0
- package/dist/chunk-fak944et.js +91 -0
- package/dist/chunk-fak944et.js.map +10 -0
- package/dist/chunk-fygx2ymm.js +118 -0
- package/dist/chunk-fygx2ymm.js.map +12 -0
- package/dist/chunk-g15qj669.js +271 -0
- package/dist/chunk-g15qj669.js.map +11 -0
- package/dist/chunk-g3j22qf6.js +51 -0
- package/dist/chunk-g3j22qf6.js.map +9 -0
- package/dist/chunk-gd6wmknh.js +121 -0
- package/dist/chunk-gd6wmknh.js.map +11 -0
- package/dist/chunk-gf0ygptk.js +85 -0
- package/dist/chunk-gf0ygptk.js.map +11 -0
- package/dist/chunk-gq0zxpm0.js +90 -0
- package/dist/chunk-gq0zxpm0.js.map +10 -0
- package/dist/chunk-gytkmthr.js +220 -0
- package/dist/chunk-gytkmthr.js.map +10 -0
- package/dist/chunk-h5bbfn3n.js +28 -0
- package/dist/chunk-h5bbfn3n.js.map +11 -0
- package/dist/chunk-h6mye9r3.js +93 -0
- package/dist/chunk-h6mye9r3.js.map +10 -0
- package/dist/chunk-hcsmxw1v.js +85 -0
- package/dist/chunk-hcsmxw1v.js.map +10 -0
- package/dist/chunk-hep68ja7.js +4444 -0
- package/dist/chunk-hep68ja7.js.map +29 -0
- package/dist/chunk-hhqh49fz.js +149 -0
- package/dist/chunk-hhqh49fz.js.map +10 -0
- package/dist/chunk-hyjs4bqs.js +8 -0
- package/dist/chunk-hyjs4bqs.js.map +10 -0
- package/dist/chunk-hza0n8qm.js +20 -0
- package/dist/chunk-hza0n8qm.js.map +9 -0
- package/dist/chunk-jn91vzkh.js +66 -0
- package/dist/chunk-jn91vzkh.js.map +10 -0
- package/dist/chunk-jwxt8gnp.js +13 -0
- package/dist/chunk-jwxt8gnp.js.map +9 -0
- package/dist/chunk-kk8w9rh5.js +195 -0
- package/dist/chunk-kk8w9rh5.js.map +10 -0
- package/dist/chunk-kndkjsya.js +261 -0
- package/dist/chunk-kndkjsya.js.map +10 -0
- package/dist/chunk-kvq01j35.js +36 -0
- package/dist/chunk-kvq01j35.js.map +10 -0
- package/dist/chunk-mbazhahf.js +60 -0
- package/dist/chunk-mbazhahf.js.map +10 -0
- package/dist/chunk-mgfwq18r.js +15 -0
- package/dist/chunk-mgfwq18r.js.map +9 -0
- package/dist/chunk-mtgf69xn.js +88 -0
- package/dist/chunk-mtgf69xn.js.map +10 -0
- package/dist/chunk-nehhtthw.js +225 -0
- package/dist/chunk-nehhtthw.js.map +10 -0
- package/dist/chunk-nhzf4az4.js +149 -0
- package/dist/chunk-nhzf4az4.js.map +10 -0
- package/dist/chunk-p5504p14.js +16 -0
- package/dist/chunk-p5504p14.js.map +10 -0
- package/dist/chunk-pnscgw95.js +90 -0
- package/dist/chunk-pnscgw95.js.map +10 -0
- package/dist/chunk-pvpp4pvs.js +17 -0
- package/dist/chunk-pvpp4pvs.js.map +10 -0
- package/dist/chunk-qh75agse.js +95 -0
- package/dist/chunk-qh75agse.js.map +10 -0
- package/dist/chunk-qk8kd3hr.js +526 -0
- package/dist/chunk-qk8kd3hr.js.map +12 -0
- package/dist/chunk-qxq2zcty.js +52 -0
- package/dist/chunk-qxq2zcty.js.map +10 -0
- package/dist/chunk-r7jmgqnw.js +114 -0
- package/dist/chunk-r7jmgqnw.js.map +10 -0
- package/dist/chunk-s6defjk2.js +116 -0
- package/dist/chunk-s6defjk2.js.map +10 -0
- package/dist/chunk-sd39p726.js +619 -0
- package/dist/chunk-sd39p726.js.map +10 -0
- package/dist/chunk-smgj0epn.js +18 -0
- package/dist/chunk-smgj0epn.js.map +9 -0
- package/dist/chunk-swrnzs4c.js +63 -0
- package/dist/chunk-swrnzs4c.js.map +10 -0
- package/dist/chunk-t81a331y.js +27 -0
- package/dist/chunk-t81a331y.js.map +10 -0
- package/dist/chunk-tfe3sb44.js +33 -0
- package/dist/chunk-tfe3sb44.js.map +10 -0
- package/dist/chunk-tx9edm1x.js +34 -0
- package/dist/chunk-tx9edm1x.js.map +10 -0
- package/dist/chunk-vkrpm7kc.js +247 -0
- package/dist/chunk-vkrpm7kc.js.map +12 -0
- package/dist/chunk-vvz7dcvq.js +434 -0
- package/dist/chunk-vvz7dcvq.js.map +13 -0
- package/dist/chunk-w3m4m5we.js +4925 -0
- package/dist/chunk-w3m4m5we.js.map +12 -0
- package/dist/chunk-wrxtn9ve.js +18 -0
- package/dist/chunk-wrxtn9ve.js.map +10 -0
- package/dist/chunk-xpkjbmd3.js +428 -0
- package/dist/chunk-xpkjbmd3.js.map +14 -0
- package/dist/chunk-xrmjy8kk.js +454 -0
- package/dist/chunk-xrmjy8kk.js.map +10 -0
- package/dist/chunk-xw0tx842.js +13 -0
- package/dist/chunk-xw0tx842.js.map +9 -0
- package/dist/chunk-xx5b6b9m.js +69 -0
- package/dist/chunk-xx5b6b9m.js.map +10 -0
- package/dist/chunk-xz1kdswj.js +21 -0
- package/dist/chunk-xz1kdswj.js.map +9 -0
- package/dist/chunk-xzvy9hr4.js +377 -0
- package/dist/chunk-xzvy9hr4.js.map +10 -0
- package/dist/chunk-yfqhr31t.js +39 -0
- package/dist/chunk-yfqhr31t.js.map +9 -0
- package/dist/chunk-ygzd5s4z.js +184 -0
- package/dist/chunk-ygzd5s4z.js.map +10 -0
- package/dist/chunk-ywjn0rad.js +14 -0
- package/dist/chunk-ywjn0rad.js.map +9 -0
- package/dist/chunk-z9nvhm6r.js +13 -0
- package/dist/chunk-z9nvhm6r.js.map +9 -0
- package/dist/chunk-zhmvdpk6.js +15 -0
- package/dist/chunk-zhmvdpk6.js.map +9 -0
- package/dist/client/index.js +32 -1112
- package/dist/client/index.js.map +4 -22
- package/dist/core/streamingSlotRegistrar.js +11 -108
- package/dist/core/streamingSlotRegistrar.js.map +3 -4
- package/dist/core/streamingSlotRegistry.js +7 -169
- package/dist/core/streamingSlotRegistry.js.map +3 -5
- package/dist/index.js +536 -19835
- package/dist/index.js.map +3 -117
- package/dist/islands/browser.js +9 -228
- package/dist/islands/browser.js.map +4 -9
- package/dist/islands/index.js +17 -1986
- package/dist/islands/index.js.map +3 -28
- package/dist/react/browser.js +12 -328
- package/dist/react/browser.js.map +4 -12
- package/dist/react/components/index.js +16 -167
- package/dist/react/components/index.js.map +3 -6
- package/dist/react/hooks/index.js +8 -183
- package/dist/react/hooks/index.js.map +3 -7
- package/dist/react/index.js +36 -3705
- package/dist/react/index.js.map +4 -46
- package/dist/react/jsxDevRuntimeCompat.js +2 -61
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/server.js +18 -1789
- package/dist/react/server.js.map +3 -21
- package/dist/src/core/index.d.ts +0 -2
- package/dist/svelte/browser.js +12 -247
- package/dist/svelte/browser.js.map +3 -10
- package/dist/svelte/index.js +37 -3810
- package/dist/svelte/index.js.map +4 -48
- package/dist/svelte/server.js +21 -2787
- package/dist/svelte/server.js.map +3 -27
- package/dist/vue/browser.js +12 -348
- package/dist/vue/browser.js.map +4 -12
- package/dist/vue/components/Image.js +7 -240
- package/dist/vue/components/Image.js.map +3 -6
- package/dist/vue/components/index.js +11 -544
- package/dist/vue/components/index.js.map +3 -9
- package/dist/vue/index.js +52 -4290
- package/dist/vue/index.js.map +4 -51
- package/dist/vue/server.js +18 -1849
- package/dist/vue/server.js.map +3 -21
- package/package.json +7 -7
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/dev/assetStore.ts", "../src/dev/moduleVersionTracker.ts", "../src/dev/webSocket.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { resolve } from 'node:path';\nimport { readdir, unlink } from 'node:fs/promises';\n\nconst mimeTypes: Record<string, string> = {\n\t'.css': 'text/css',\n\t'.html': 'text/html',\n\t'.js': 'application/javascript',\n\t'.json': 'application/json',\n\t'.mjs': 'application/javascript',\n\t'.svg': 'image/svg+xml',\n\t'.woff': 'font/woff',\n\t'.woff2': 'font/woff2'\n};\n\n/** Determine Content-Type from a file path extension */\nexport const getMimeType = (filePath: string) => {\n\tconst ext = filePath.slice(filePath.lastIndexOf('.'));\n\n\treturn mimeTypes[ext] ?? 'application/octet-stream';\n};\n\n/** Matches Bun's hashed output naming: name.XXXXXXXX.ext */\nconst HASHED_FILE_RE = /\\.[a-z0-9]{8}\\.(js|css|mjs)$/;\n\n/** Strip the 8-char hash from a hashed path to get its logical identity.\n * e.g. /react/indexes/ReactExample.abc12345.js → /react/indexes/ReactExample.js */\nconst stripHash = (webPath: string) =>\n\twebPath.replace(/\\.[a-z0-9]{8}(\\.(js|css|mjs))$/, '$1');\n\nconst processWalkEntry = (\n\tentry: import('node:fs').Dirent,\n\tdir: string,\n\tliveByIdentity: Map<string, string>,\n\twalkAndClean: (dir: string) => Promise<void>\n) => {\n\tconst fullPath = resolve(dir, entry.name);\n\tif (entry.isDirectory()) {\n\t\treturn walkAndClean(fullPath);\n\t}\n\tif (!HASHED_FILE_RE.test(entry.name)) {\n\t\treturn null;\n\t}\n\tconst identity = stripHash(fullPath);\n\tconst livePath = liveByIdentity.get(identity);\n\t// Delete if: (a) no live entry exists (page was deleted), or\n\t// (b) a different hash is live (stale version of an existing page).\n\t// Only keep the file when it IS the current live version.\n\tif (livePath !== fullPath) {\n\t\treturn unlink(fullPath).catch(() => {\n\t\t\t/* noop */\n\t\t});\n\t}\n\n\treturn null;\n};\n\n/** Upsert build outputs into the in-memory asset store.\n * Evicts previous entries for the same logical asset (same base name,\n * different hash) so stale paths don't accumulate. */\nexport const cleanStaleAssets = async (\n\tstore: Map<string, Uint8Array>,\n\tmanifest: Record<string, string>,\n\tbuildDir: string\n) => {\n\t// Build a map of logical identity → live disk path\n\tconst liveByIdentity = new Map<string, string>();\n\n\t// Client assets from the in-memory store\n\tfor (const webPath of store.keys()) {\n\t\tconst diskPath = resolve(buildDir, webPath.slice(1));\n\t\tliveByIdentity.set(stripHash(diskPath), diskPath);\n\t}\n\n\t// SSR server files from the manifest (absolute disk paths like\n\t// /home/.../build/svelte/.../SvelteExample.hash.js)\n\tconst absBuildDir = resolve(buildDir);\n\tObject.values(manifest).forEach((val) => {\n\t\tif (!HASHED_FILE_RE.test(val)) return;\n\t\tif (val.startsWith(absBuildDir)) {\n\t\t\tliveByIdentity.set(stripHash(val), val);\n\t\t}\n\t});\n\n\ttry {\n\t\tconst walkAndClean = async (dir: string) => {\n\t\t\tconst entries = await readdir(dir, { withFileTypes: true });\n\t\t\tconst tasks = entries\n\t\t\t\t.map((entry) =>\n\t\t\t\t\tprocessWalkEntry(entry, dir, liveByIdentity, walkAndClean)\n\t\t\t\t)\n\t\t\t\t.filter((task): task is Promise<void> => task !== null);\n\t\t\tawait Promise.all(tasks);\n\t\t};\n\t\tawait walkAndClean(buildDir);\n\t} catch {\n\t\t/* buildDir may not exist */\n\t}\n};\nexport const lookupAsset = (store: Map<string, Uint8Array>, path: string) =>\n\tstore.get(path);\n\nconst processScanEntry = (\n\tentry: import('node:fs').Dirent,\n\tdir: string,\n\tprefix: string,\n\tstore: Map<string, Uint8Array>,\n\tscanDir: (dir: string, prefix: string) => Promise<void>\n) => {\n\tif (entry.isDirectory()) {\n\t\treturn scanDir(resolve(dir, entry.name), `${prefix}${entry.name}/`);\n\t}\n\tif (!entry.name.startsWith('chunk-')) {\n\t\treturn null;\n\t}\n\tconst webPath = `/${prefix}${entry.name}`;\n\tif (store.has(webPath)) {\n\t\treturn null;\n\t}\n\n\treturn Bun.file(resolve(dir, entry.name))\n\t\t.bytes()\n\t\t.then((bytes) => {\n\t\t\tstore.set(webPath, bytes);\n\n\t\t\treturn undefined;\n\t\t})\n\t\t.catch(() => {\n\t\t\t/* noop */\n\t\t});\n};\n\nexport const populateAssetStore = async (\n\tstore: Map<string, Uint8Array>,\n\tmanifest: Record<string, string>,\n\tbuildDir: string\n) => {\n\tconst loadPromises: Promise<void>[] = [];\n\n\t// Build a set of logical identities from the new manifest so we can\n\t// evict old entries with different hashes for the same asset.\n\tconst newIdentities = new Map<string, string>();\n\tfor (const webPath of Object.values(manifest)) {\n\t\tif (!webPath.startsWith('/')) continue;\n\t\tnewIdentities.set(stripHash(webPath), webPath);\n\t}\n\n\t// Evict old store entries that are being replaced by a new hash (same\n\t// identity, different path). The manifest passed in may be PARTIAL — it\n\t// only covers the entries from the current build (e.g. one page during\n\t// HMR fast-paths). Entries whose identity isn't mentioned must be left\n\t// alone: they may belong to other pages that weren't rebuilt, and their\n\t// SSR-rendered HTML still references those hashes.\n\t// Disk-level cleanup of pages that were truly deleted is handled by\n\t// `cleanStaleAssets`. Chunk files (chunk-XXXX.js) are tracked separately\n\t// and are not part of the manifest.\n\tconst staleKeys = [...store.keys()].filter((existingPath) => {\n\t\tif (existingPath.includes('/chunk-')) return false;\n\t\tconst replacement = newIdentities.get(stripHash(existingPath));\n\t\treturn replacement !== undefined && replacement !== existingPath;\n\t});\n\tstaleKeys.forEach((key) => store.delete(key));\n\n\tfor (const webPath of newIdentities.values()) {\n\t\t// Skip entries already in the store — their content hasn't changed\n\t\t// (same hash in the filename). Only load new or replaced assets.\n\t\tif (store.has(webPath)) continue;\n\n\t\tloadPromises.push(\n\t\t\tBun.file(resolve(buildDir, webPath.slice(1)))\n\t\t\t\t.bytes()\n\t\t\t\t.then((bytes) => {\n\t\t\t\t\tstore.set(webPath, bytes);\n\n\t\t\t\t\treturn undefined;\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\t/* file may not exist yet (SSR-only entry) — ignore */\n\t\t\t\t})\n\t\t);\n\t}\n\n\t// Also pick up chunk files produced by Bun code-splitting that aren't\n\t// listed in the manifest (e.g. chunk-XXXX.js).\n\ttry {\n\t\tconst scanDir = async (dir: string, prefix: string) => {\n\t\t\tconst entries = await readdir(dir, { withFileTypes: true });\n\t\t\tconst subTasks = entries\n\t\t\t\t.map((entry) =>\n\t\t\t\t\tprocessScanEntry(entry, dir, prefix, store, scanDir)\n\t\t\t\t)\n\t\t\t\t.filter((task): task is Promise<void> => task !== null);\n\t\t\tawait Promise.all(subTasks);\n\t\t};\n\t\tawait scanDir(buildDir, '');\n\t} catch {\n\t\t/* buildDir may not exist yet */\n\t}\n\n\tawait Promise.all(loadPromises);\n};\n",
|
|
6
|
+
"/* Module Version Tracker for Server-Client Synchronization\n Tracks module versions to ensure server and client stay in sync */\n\n/* Module version: increments each time a module is updated */\nexport type ModuleVersion = number;\n\n/* Module version map: module path -> version */\nexport type ModuleVersions = Map<string, ModuleVersion>;\n\n/* Global module version counter */\nlet globalVersionCounter = 0;\n\n/* Get next version number */\nexport const createModuleVersionTracker = () =>\n\tnew Map<string, ModuleVersion>();\nexport const getNextVersion = () => ++globalVersionCounter;\nexport const incrementModuleVersion = (\n\tversions: ModuleVersions,\n\tmodulePath: string\n) => {\n\tconst newVersion = getNextVersion();\n\tversions.set(modulePath, newVersion);\n\n\treturn newVersion;\n};\nexport const incrementModuleVersions = (\n\tversions: ModuleVersions,\n\tmodulePaths: string[]\n) => {\n\tconst updated = new Map<string, ModuleVersion>();\n\tfor (const path of modulePaths) {\n\t\tconst version = incrementModuleVersion(versions, path);\n\t\tupdated.set(path, version);\n\t}\n\n\treturn updated;\n};\nexport const serializeModuleVersions = (versions: ModuleVersions) => {\n\tconst serialized: Record<string, number> = {};\n\tfor (const [path, version] of versions.entries()) {\n\t\tserialized[path] = version;\n\t}\n\n\treturn serialized;\n};\n",
|
|
7
|
+
"import type { HMRState } from './clientManager';\nimport { serializeModuleVersions } from './moduleVersionTracker';\nimport { type HMRWebSocket, WS_READY_STATE_OPEN } from '../../types/websocket';\nimport type { HMRClientMessage } from '../../types/messages';\nimport { isValidHMRClientMessage } from '../../types/typeGuards';\nimport { logHmrUpdate } from '../utils/logger';\n\nconst trySendMessage = (client: HMRWebSocket, messageStr: string) => {\n\ttry {\n\t\tclient.send(messageStr);\n\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\nexport const broadcastToClients = (\n\tstate: HMRState,\n\tmessage: { type: string; [key: string]: unknown }\n) => {\n\tconst messageStr = JSON.stringify({\n\t\t...message,\n\t\ttimestamp: Date.now()\n\t});\n\n\tconst shouldRemove = (client: HMRWebSocket) => {\n\t\tif (client.readyState !== WS_READY_STATE_OPEN) return true;\n\n\t\treturn !trySendMessage(client, messageStr);\n\t};\n\n\tconst clientsToRemove: HMRWebSocket[] = [];\n\tstate.connectedClients.forEach((client) => {\n\t\tif (shouldRemove(client)) clientsToRemove.push(client);\n\t});\n\n\tclientsToRemove.forEach((client) => {\n\t\tstate.connectedClients.delete(client);\n\t});\n};\nexport const handleClientConnect = (\n\tstate: HMRState,\n\tclient: HMRWebSocket,\n\tmanifest: Record<string, string>\n) => {\n\tstate.connectedClients.add(client);\n\n\tconst serverVersions = serializeModuleVersions(state.moduleVersions);\n\tclient.send(\n\t\tJSON.stringify({\n\t\t\tdata: {\n\t\t\t\tmanifest,\n\t\t\t\tserverVersions\n\t\t\t},\n\t\t\ttimestamp: Date.now(),\n\t\t\ttype: 'manifest'\n\t\t})\n\t);\n\n\tclient.send(\n\t\tJSON.stringify({\n\t\t\tmessage: 'HMR client connected successfully',\n\t\t\ttimestamp: Date.now(),\n\t\t\ttype: 'connected'\n\t\t})\n\t);\n};\nexport const handleClientDisconnect = (\n\tstate: HMRState,\n\tclient: HMRWebSocket\n) => {\n\tstate.connectedClients.delete(client);\n};\n\nconst parseJsonSafe = (raw: string) => JSON.parse(raw);\n\nconst parseMessage = (message: unknown) => {\n\tif (typeof message === 'string') {\n\t\treturn parseJsonSafe(message);\n\t}\n\n\tif (message instanceof Buffer) {\n\t\treturn parseJsonSafe(message.toString());\n\t}\n\n\tif (message instanceof ArrayBuffer) {\n\t\treturn parseJsonSafe(new TextDecoder().decode(new Uint8Array(message)));\n\t}\n\n\tif (ArrayBuffer.isView(message)) {\n\t\tconst view: Uint8Array = new Uint8Array(\n\t\t\tmessage.buffer,\n\t\t\tmessage.byteOffset,\n\t\t\tmessage.byteLength\n\t\t);\n\n\t\treturn parseJsonSafe(new TextDecoder().decode(view));\n\t}\n\n\tif (typeof message === 'object' && message !== null) {\n\t\treturn message;\n\t}\n\n\treturn null;\n};\n\nconst handleParsedMessage = (\n\tstate: HMRState,\n\tclient: HMRWebSocket,\n\tdata: HMRClientMessage\n) => {\n\tswitch (data.type) {\n\t\tcase 'ping':\n\t\t\tclient.send(\n\t\t\t\tJSON.stringify({\n\t\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t\ttype: 'pong'\n\t\t\t\t})\n\t\t\t);\n\t\t\tbreak;\n\n\t\tcase 'request-rebuild':\n\t\t\tbreak;\n\n\t\tcase 'ready':\n\t\t\tif (data.framework) {\n\t\t\t\tstate.activeFrameworks.add(data.framework);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'hmr-timing':\n\t\t\tlogHmrUpdate(\n\t\t\t\tstate.lastHmrPath ?? '',\n\t\t\t\tstate.lastHmrFramework,\n\t\t\t\tdata.duration\n\t\t\t);\n\t\t\tbreak;\n\t}\n};\n\nexport const handleHMRMessage = (\n\tstate: HMRState,\n\tclient: HMRWebSocket,\n\tmessage: unknown\n) => {\n\ttry {\n\t\tconst parsedData = parseMessage(message);\n\t\tif (parsedData === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isValidHMRClientMessage(parsedData)) {\n\t\t\treturn;\n\t\t}\n\n\t\thandleParsedMessage(state, client, parsedData);\n\t} catch {\n\t\t/* ignored */\n\t}\n};\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": ";;;;;;;;;;AAAA;AACA;AAEA,IAAM,YAAoC;AAAA,EACzC,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AACX;AAGO,IAAM,cAAc,CAAC,aAAqB;AAAA,EAChD,MAAM,MAAM,SAAS,MAAM,SAAS,YAAY,GAAG,CAAC;AAAA,EAEpD,OAAO,UAAU,QAAQ;AAAA;AAI1B,IAAM,iBAAiB;AAIvB,IAAM,YAAY,CAAC,YAClB,QAAQ,QAAQ,kCAAkC,IAAI;AAEvD,IAAM,mBAAmB,CACxB,OACA,KACA,gBACA,iBACI;AAAA,EACJ,MAAM,WAAW,QAAQ,KAAK,MAAM,IAAI;AAAA,EACxC,IAAI,MAAM,YAAY,GAAG;AAAA,IACxB,OAAO,aAAa,QAAQ;AAAA,EAC7B;AAAA,EACA,IAAI,CAAC,eAAe,KAAK,MAAM,IAAI,GAAG;AAAA,IACrC,OAAO;AAAA,EACR;AAAA,EACA,MAAM,WAAW,UAAU,QAAQ;AAAA,EACnC,MAAM,WAAW,eAAe,IAAI,QAAQ;AAAA,EAI5C,IAAI,aAAa,UAAU;AAAA,IAC1B,OAAO,OAAO,QAAQ,EAAE,MAAM,MAAM,EAEnC;AAAA,EACF;AAAA,EAEA,OAAO;AAAA;AAMD,IAAM,mBAAmB,OAC/B,OACA,UACA,aACI;AAAA,EAEJ,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B,IAAI,WAC5B,QAAQ,QACR,QAAQ,YACR,QAAQ,UACT;AAAA,IAEA,OAAO,cAAc,IAAI,YAAY,EAAE,OAAO,IAAI,CAAC;AAAA,EACpD;AAAA,EAEA,IAAI,OAAO,YAAY,YAAY,YAAY,MAAM;AAAA,IACpD,OAAO;AAAA,EACR;AAAA,EAEA,OAAO;AAAA;AAGR,IAAM,sBAAsB,CAC3B,OACA,QACA,SACI;AAAA,EACJ,QAAQ,KAAK;AAAA,SACP;AAAA,MACJ,OAAO,KACN,KAAK,UAAU;AAAA,QACd,WAAW,KAAK,IAAI;AAAA,QACpB,MAAM;AAAA,MACP,CAAC,CACF;AAAA,MACA;AAAA,SAEI;AAAA,MACJ;AAAA,SAEI;AAAA,MACJ,IAAI,KAAK,WAAW;AAAA,QACnB,MAAM,iBAAiB,IAAI,KAAK,SAAS;AAAA,MAC1C;AAAA,MACA;AAAA,SAEI;AAAA,MACJ,aACC,MAAM,eAAe,IACrB,MAAM,kBACN,KAAK,QACN;AAAA,MACA;AAAA;AAAA;AAII,IAAM,mBAAmB,CAC/B,OACA,QACA,YACI;AAAA,EACJ,IAAI;AAAA,IACH,MAAM,aAAa,aAAa,OAAO;AAAA,IACvC,IAAI,eAAe,MAAM;AAAA,MACxB;AAAA,IACD;AAAA,IAEA,IAAI,CAAC,wBAAwB,UAAU,GAAG;AAAA,MACzC;AAAA,IACD;AAAA,IAEA,oBAAoB,OAAO,QAAQ,UAAU;AAAA,IAC5C,MAAM;AAAA;",
|
|
10
|
+
"debugId": "B4BC5290E57E33C064756E2164756E21",
|
|
11
|
+
"names": []
|
|
12
|
+
}
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
incrementalTailwindBuild
|
|
4
|
+
} from "./chunk-kndkjsya.js";
|
|
5
|
+
import {
|
|
6
|
+
scanEntryPoints
|
|
7
|
+
} from "./chunk-11zpfqz6.js";
|
|
8
|
+
import {
|
|
9
|
+
extractIslandUsagesFromSource
|
|
10
|
+
} from "./chunk-a9mvyp04.js";
|
|
11
|
+
import {
|
|
12
|
+
getDurationString
|
|
13
|
+
} from "./chunk-gf0ygptk.js";
|
|
14
|
+
import {
|
|
15
|
+
getIslandBuildReference
|
|
16
|
+
} from "./chunk-8kcfffry.js";
|
|
17
|
+
|
|
18
|
+
// src/build/compileTailwind.ts
|
|
19
|
+
import { mkdir } from "fs/promises";
|
|
20
|
+
import { dirname, join } from "path";
|
|
21
|
+
var TAILWIND_CANDIDATE_EXTENSION_PATTERN = /\.(html?|m?[jt]sx?|cjs|vue|svelte|astro|mdx?|css|s[ac]ss|less|styl(?:us)?)$/i;
|
|
22
|
+
var isTailwindCandidate = (filePath) => TAILWIND_CANDIDATE_EXTENSION_PATTERN.test(filePath);
|
|
23
|
+
var compileTailwind = async (input, output, buildPath, styleTransformConfig) => {
|
|
24
|
+
const outputPath = join(buildPath, output);
|
|
25
|
+
await mkdir(dirname(outputPath), { recursive: true });
|
|
26
|
+
await incrementalTailwindBuild({ input, output }, buildPath, [], styleTransformConfig);
|
|
27
|
+
};
|
|
28
|
+
var compileTailwindConfig = async (tailwind, buildPath, styleTransformConfig) => compileTailwind(tailwind.input, tailwind.output, buildPath, styleTransformConfig);
|
|
29
|
+
|
|
30
|
+
// src/utils/startupTimings.ts
|
|
31
|
+
var startupTimingsEnabled = process.env.ABSOLUTE_STARTUP_TIMINGS === "1" || process.env.ABSOLUTE_STARTUP_TIMINGS === "true";
|
|
32
|
+
var formatStartupTimingBlock = (title, steps) => {
|
|
33
|
+
const totalDuration = steps.reduce((sum, step) => sum + step.durationMs, 0);
|
|
34
|
+
return [
|
|
35
|
+
title,
|
|
36
|
+
...steps.map((step) => ` - ${step.label}: ${getDurationString(step.durationMs)}`),
|
|
37
|
+
` Total: ${getDurationString(totalDuration)}`
|
|
38
|
+
].join(`
|
|
39
|
+
`);
|
|
40
|
+
};
|
|
41
|
+
var logStartupTimingBlock = (title, steps) => {
|
|
42
|
+
if (!startupTimingsEnabled || steps.length === 0) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
console.log(formatStartupTimingBlock(title, steps));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// src/build/islandEntries.ts
|
|
49
|
+
import { mkdirSync, rmSync, writeFileSync } from "fs";
|
|
50
|
+
import { dirname as dirname2, extname, join as join2, relative, resolve } from "path";
|
|
51
|
+
import ts from "typescript";
|
|
52
|
+
var frameworks = ["react", "svelte", "vue", "angular"];
|
|
53
|
+
var isRecord = (value) => typeof value === "object" && value !== null;
|
|
54
|
+
var resolveRegistryExport = (mod) => {
|
|
55
|
+
if (isRecord(mod.islandRegistry))
|
|
56
|
+
return mod.islandRegistry;
|
|
57
|
+
if (isRecord(mod.default))
|
|
58
|
+
return mod.default;
|
|
59
|
+
throw new Error("Island registry module must export `islandRegistry` or a default registry object.");
|
|
60
|
+
};
|
|
61
|
+
var hasSvelteImport = (source) => /from\s+['"][^'"]+\.svelte['"]/.test(source);
|
|
62
|
+
var normalizeImportPath = (wrapperPath, targetPath) => {
|
|
63
|
+
const importPath = relative(dirname2(wrapperPath), targetPath).replace(/\\/g, "/");
|
|
64
|
+
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
65
|
+
};
|
|
66
|
+
var isIdentifier = (value) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value);
|
|
67
|
+
var resolveIslandSourcePath = (registryPath, sourcePath) => {
|
|
68
|
+
if (sourcePath.startsWith("file://")) {
|
|
69
|
+
return new URL(sourcePath).pathname;
|
|
70
|
+
}
|
|
71
|
+
return resolve(dirname2(registryPath), sourcePath);
|
|
72
|
+
};
|
|
73
|
+
var getObjectPropertyName = (name) => {
|
|
74
|
+
if (ts.isIdentifier(name) || ts.isStringLiteral(name)) {
|
|
75
|
+
return name.text;
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
};
|
|
79
|
+
var collectDefaultImport = (imports, importClause, source) => {
|
|
80
|
+
if (!importClause.name)
|
|
81
|
+
return;
|
|
82
|
+
imports.set(importClause.name.text, {
|
|
83
|
+
export: "default",
|
|
84
|
+
source
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
var collectNamedImports = (imports, importClause, source) => {
|
|
88
|
+
const bindings = importClause.namedBindings;
|
|
89
|
+
if (!bindings || !ts.isNamedImports(bindings))
|
|
90
|
+
return;
|
|
91
|
+
for (const element of bindings.elements) {
|
|
92
|
+
imports.set(element.name.text, {
|
|
93
|
+
export: element.propertyName?.text ?? element.name.text,
|
|
94
|
+
source
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
var isIslandRegistryHelperImport = (source) => source === "@absolutejs/absolute/islands" || source.endsWith("/islands") || source.endsWith("/core/islands");
|
|
99
|
+
var collectRegistryHelperImports = (importClause, source, registryFactoryNames, registryNamespaceNames) => {
|
|
100
|
+
if (!isIslandRegistryHelperImport(source))
|
|
101
|
+
return;
|
|
102
|
+
const bindings = importClause.namedBindings;
|
|
103
|
+
if (!bindings)
|
|
104
|
+
return;
|
|
105
|
+
if (ts.isNamespaceImport(bindings)) {
|
|
106
|
+
registryNamespaceNames.add(bindings.name.text);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
for (const element of bindings.elements) {
|
|
110
|
+
const importedName = element.propertyName?.text ?? element.name.text;
|
|
111
|
+
if (importedName === "defineIslandRegistry") {
|
|
112
|
+
registryFactoryNames.add(element.name.text);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
var createRegistryEntryValue = (reference) => ({
|
|
117
|
+
component: reference.source,
|
|
118
|
+
export: reference.export,
|
|
119
|
+
source: reference.source
|
|
120
|
+
});
|
|
121
|
+
var addRegistryEntries = (frameworkNode, framework, imports, definitions, registry) => {
|
|
122
|
+
const frameworkRegistry = registry[framework] ?? {};
|
|
123
|
+
registry[framework] = frameworkRegistry;
|
|
124
|
+
for (const property of frameworkNode.properties) {
|
|
125
|
+
if (!ts.isPropertyAssignment(property) && !ts.isShorthandPropertyAssignment(property))
|
|
126
|
+
continue;
|
|
127
|
+
const componentName = getObjectPropertyName(property.name);
|
|
128
|
+
if (!componentName)
|
|
129
|
+
continue;
|
|
130
|
+
const initializer = ts.isPropertyAssignment(property) ? property.initializer : property.name;
|
|
131
|
+
if (!ts.isIdentifier(initializer))
|
|
132
|
+
continue;
|
|
133
|
+
const reference = imports.get(initializer.text);
|
|
134
|
+
if (!reference)
|
|
135
|
+
continue;
|
|
136
|
+
frameworkRegistry[componentName] = createRegistryEntryValue(reference);
|
|
137
|
+
definitions.push({
|
|
138
|
+
buildReference: reference,
|
|
139
|
+
component: componentName,
|
|
140
|
+
framework
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
var processDefineIslandRegistry = (node, imports, definitions, registry) => {
|
|
145
|
+
const [firstArg] = node.arguments;
|
|
146
|
+
if (!firstArg || !ts.isObjectLiteralExpression(firstArg))
|
|
147
|
+
return;
|
|
148
|
+
const validFrameworks = [
|
|
149
|
+
"react",
|
|
150
|
+
"svelte",
|
|
151
|
+
"vue",
|
|
152
|
+
"angular"
|
|
153
|
+
];
|
|
154
|
+
for (const property of firstArg.properties) {
|
|
155
|
+
if (!ts.isPropertyAssignment(property))
|
|
156
|
+
continue;
|
|
157
|
+
const frameworkName = getObjectPropertyName(property.name);
|
|
158
|
+
if (!frameworkName)
|
|
159
|
+
continue;
|
|
160
|
+
const framework = validFrameworks.find((f) => f === frameworkName);
|
|
161
|
+
if (!framework)
|
|
162
|
+
continue;
|
|
163
|
+
if (!ts.isObjectLiteralExpression(property.initializer))
|
|
164
|
+
continue;
|
|
165
|
+
addRegistryEntries(property.initializer, framework, imports, definitions, registry);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
var walkRegistryNode = (node, imports, registryFactoryNames, registryNamespaceNames, definitions, registry) => {
|
|
169
|
+
if (ts.isCallExpression(node) && isDefineIslandRegistryCall(node.expression, registryFactoryNames, registryNamespaceNames)) {
|
|
170
|
+
processDefineIslandRegistry(node, imports, definitions, registry);
|
|
171
|
+
}
|
|
172
|
+
ts.forEachChild(node, (child) => walkRegistryNode(child, imports, registryFactoryNames, registryNamespaceNames, definitions, registry));
|
|
173
|
+
};
|
|
174
|
+
var isDefineIslandRegistryCall = (expression, registryFactoryNames, registryNamespaceNames) => {
|
|
175
|
+
if (ts.isIdentifier(expression)) {
|
|
176
|
+
return registryFactoryNames.has(expression.text);
|
|
177
|
+
}
|
|
178
|
+
return ts.isPropertyAccessExpression(expression) && expression.name.text === "defineIslandRegistry" && ts.isIdentifier(expression.expression) && registryNamespaceNames.has(expression.expression.text);
|
|
179
|
+
};
|
|
180
|
+
var hasIslandRegistryNamedExport = (sourceFile) => {
|
|
181
|
+
for (const statement of sourceFile.statements) {
|
|
182
|
+
if (ts.isVariableStatement(statement) && statement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) && statement.declarationList.declarations.some((declaration) => ts.isIdentifier(declaration.name) && declaration.name.text === "islandRegistry")) {
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
if (!ts.isExportDeclaration(statement) || !statement.exportClause)
|
|
186
|
+
continue;
|
|
187
|
+
if (!ts.isNamedExports(statement.exportClause))
|
|
188
|
+
continue;
|
|
189
|
+
if (statement.exportClause.elements.some((element) => element.name.text === "islandRegistry")) {
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return false;
|
|
194
|
+
};
|
|
195
|
+
var collectImportDeclarations = (sourceFile, registryPath, imports, registryFactoryNames, registryNamespaceNames) => {
|
|
196
|
+
for (const statement of sourceFile.statements) {
|
|
197
|
+
if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier))
|
|
198
|
+
continue;
|
|
199
|
+
const { importClause } = statement;
|
|
200
|
+
if (!importClause)
|
|
201
|
+
continue;
|
|
202
|
+
const source = resolveIslandSourcePath(registryPath, statement.moduleSpecifier.text);
|
|
203
|
+
collectDefaultImport(imports, importClause, source);
|
|
204
|
+
collectNamedImports(imports, importClause, source);
|
|
205
|
+
collectRegistryHelperImports(importClause, statement.moduleSpecifier.text, registryFactoryNames, registryNamespaceNames);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
var parseIslandRegistryBuildInfo = (registrySource, registryPath) => {
|
|
209
|
+
const sourceFile = ts.createSourceFile(registryPath, registrySource, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
210
|
+
const imports = new Map;
|
|
211
|
+
const registryFactoryNames = new Set(["defineIslandRegistry"]);
|
|
212
|
+
const registryNamespaceNames = new Set;
|
|
213
|
+
const definitions = [];
|
|
214
|
+
const registry = {};
|
|
215
|
+
collectImportDeclarations(sourceFile, registryPath, imports, registryFactoryNames, registryNamespaceNames);
|
|
216
|
+
walkRegistryNode(sourceFile, imports, registryFactoryNames, registryNamespaceNames, definitions, registry);
|
|
217
|
+
return {
|
|
218
|
+
definitions,
|
|
219
|
+
hasNamedExport: hasIslandRegistryNamedExport(sourceFile),
|
|
220
|
+
registry
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
var loadDynamicIslandRegistryBuildInfo = async (resolvedRegistryPath) => {
|
|
224
|
+
const registryModule = await import(resolvedRegistryPath);
|
|
225
|
+
const registry = resolveRegistryExport(registryModule);
|
|
226
|
+
const definitions = frameworks.flatMap((framework) => {
|
|
227
|
+
const frameworkRegistry = registry[framework];
|
|
228
|
+
if (!isRecord(frameworkRegistry))
|
|
229
|
+
return [];
|
|
230
|
+
return Object.entries(frameworkRegistry).map(([component, value]) => ({
|
|
231
|
+
buildReference: getIslandBuildReference(value),
|
|
232
|
+
component,
|
|
233
|
+
framework
|
|
234
|
+
}));
|
|
235
|
+
});
|
|
236
|
+
return {
|
|
237
|
+
definitions,
|
|
238
|
+
hasNamedExport: isRecord(registryModule.islandRegistry),
|
|
239
|
+
registry
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
var createRegistryImportCode = (wrapperPath, registryPath, hasNamedExport) => {
|
|
243
|
+
const normalizedPath = normalizeImportPath(wrapperPath, registryPath);
|
|
244
|
+
if (hasNamedExport) {
|
|
245
|
+
return {
|
|
246
|
+
importStatement: `import { islandRegistry as __absoluteIslandRegistry } from ${JSON.stringify(normalizedPath)};`,
|
|
247
|
+
registryReference: "__absoluteIslandRegistry"
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
importStatement: `import __absoluteIslandRegistry from ${JSON.stringify(normalizedPath)};`,
|
|
252
|
+
registryReference: "__absoluteIslandRegistry"
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
var createDirectEntrySource = (wrapperPath, importPath, exportName) => {
|
|
256
|
+
const normalizedImportPath = normalizeImportPath(wrapperPath, importPath);
|
|
257
|
+
if (!exportName || exportName === "default") {
|
|
258
|
+
return `export { default } from ${JSON.stringify(normalizedImportPath)};
|
|
259
|
+
`;
|
|
260
|
+
}
|
|
261
|
+
return `export { ${exportName} as default } from ${JSON.stringify(normalizedImportPath)};
|
|
262
|
+
`;
|
|
263
|
+
};
|
|
264
|
+
var createRegistryEntrySource = (wrapperPath, registryPath, hasNamedExport, framework, component) => {
|
|
265
|
+
const { importStatement, registryReference } = createRegistryImportCode(wrapperPath, registryPath, hasNamedExport);
|
|
266
|
+
const frameworkAccess = isIdentifier(framework) ? `${registryReference}.${framework}` : `${registryReference}[${JSON.stringify(framework)}]`;
|
|
267
|
+
const componentAccess = isIdentifier(component) ? `${frameworkAccess}.${component}` : `${frameworkAccess}[${JSON.stringify(component)}]`;
|
|
268
|
+
return `${importStatement}
|
|
269
|
+
|
|
270
|
+
const component = ${componentAccess};
|
|
271
|
+
|
|
272
|
+
export default component;
|
|
273
|
+
`;
|
|
274
|
+
};
|
|
275
|
+
var shouldUseCompiledClientPath = (framework, sourcePath) => {
|
|
276
|
+
if (framework === "svelte") {
|
|
277
|
+
return /\.svelte(?:\.(?:ts|js))?$/.test(sourcePath);
|
|
278
|
+
}
|
|
279
|
+
if (framework === "vue") {
|
|
280
|
+
return extname(sourcePath) === ".vue";
|
|
281
|
+
}
|
|
282
|
+
if (framework === "angular") {
|
|
283
|
+
return /\.(?:ts|js|tsx|jsx|mjs|cjs)$/.test(sourcePath);
|
|
284
|
+
}
|
|
285
|
+
return false;
|
|
286
|
+
};
|
|
287
|
+
var collectIslandFrameworkSources = (buildInfo) => {
|
|
288
|
+
const sources = {};
|
|
289
|
+
for (const definition of buildInfo.definitions) {
|
|
290
|
+
const { buildReference } = definition;
|
|
291
|
+
if (!buildReference)
|
|
292
|
+
continue;
|
|
293
|
+
const resolvedSourcePath = resolveIslandSourcePath(buildInfo.resolvedRegistryPath, buildReference.source);
|
|
294
|
+
if (!shouldUseCompiledClientPath(definition.framework, resolvedSourcePath))
|
|
295
|
+
continue;
|
|
296
|
+
const frameworkSources = sources[definition.framework] ?? [];
|
|
297
|
+
if (frameworkSources.includes(resolvedSourcePath))
|
|
298
|
+
continue;
|
|
299
|
+
frameworkSources.push(resolvedSourcePath);
|
|
300
|
+
sources[definition.framework] = frameworkSources;
|
|
301
|
+
}
|
|
302
|
+
return sources;
|
|
303
|
+
};
|
|
304
|
+
var generateIslandEntryPoints = async ({
|
|
305
|
+
buildInfo,
|
|
306
|
+
buildPath,
|
|
307
|
+
clientPathMaps = {}
|
|
308
|
+
}) => {
|
|
309
|
+
const generatedRoot = join2(buildPath, "_island_entries");
|
|
310
|
+
rmSync(generatedRoot, { force: true, recursive: true });
|
|
311
|
+
const entries = [];
|
|
312
|
+
for (const definition of buildInfo.definitions) {
|
|
313
|
+
const entryPath = join2(generatedRoot, "islands", definition.framework, `${definition.component}.ts`);
|
|
314
|
+
const { buildReference } = definition;
|
|
315
|
+
const source = buildReference ? resolveIslandSourcePath(buildInfo.resolvedRegistryPath, buildReference.source) : null;
|
|
316
|
+
const compiledSourcePath = source && shouldUseCompiledClientPath(definition.framework, source) ? clientPathMaps[definition.framework]?.get(source) : undefined;
|
|
317
|
+
const entrySource = source && (compiledSourcePath || !shouldUseCompiledClientPath(definition.framework, source)) ? createDirectEntrySource(entryPath, compiledSourcePath ?? source, compiledSourcePath ? undefined : buildReference?.export) : createRegistryEntrySource(entryPath, buildInfo.resolvedRegistryPath, buildInfo.hasNamedExport, definition.framework, definition.component);
|
|
318
|
+
mkdirSync(dirname2(entryPath), { recursive: true });
|
|
319
|
+
writeFileSync(entryPath, entrySource);
|
|
320
|
+
entries.push({
|
|
321
|
+
component: definition.component,
|
|
322
|
+
entryPath,
|
|
323
|
+
framework: definition.framework
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
return {
|
|
327
|
+
entries,
|
|
328
|
+
generatedRoot
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
var loadIslandRegistryBuildInfo = async (registryPath) => {
|
|
332
|
+
const resolvedRegistryPath = resolve(registryPath);
|
|
333
|
+
const registrySource = Bun.file(resolvedRegistryPath);
|
|
334
|
+
const registrySourceText = await registrySource.text();
|
|
335
|
+
const parsedInfo = parseIslandRegistryBuildInfo(registrySourceText, resolvedRegistryPath);
|
|
336
|
+
if (parsedInfo.definitions.length > 0) {
|
|
337
|
+
return {
|
|
338
|
+
definitions: parsedInfo.definitions,
|
|
339
|
+
hasNamedExport: parsedInfo.hasNamedExport,
|
|
340
|
+
registry: parsedInfo.registry,
|
|
341
|
+
resolvedRegistryPath
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
if (hasSvelteImport(registrySourceText)) {
|
|
345
|
+
throw new Error("Unable to statically analyze the island registry. Registries that import .svelte files must use defineIslandRegistry({ ... }) with direct imported component references.");
|
|
346
|
+
}
|
|
347
|
+
const dynamicInfo = await loadDynamicIslandRegistryBuildInfo(resolvedRegistryPath);
|
|
348
|
+
return {
|
|
349
|
+
definitions: dynamicInfo.definitions,
|
|
350
|
+
hasNamedExport: dynamicInfo.hasNamedExport,
|
|
351
|
+
registry: dynamicInfo.registry,
|
|
352
|
+
resolvedRegistryPath
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
// src/islands/pageMetadata.ts
|
|
357
|
+
import { readFileSync } from "fs";
|
|
358
|
+
import { dirname as dirname3, resolve as resolve2 } from "path";
|
|
359
|
+
var pagePatterns = {
|
|
360
|
+
angular: "pages/**/*.{ts,js}",
|
|
361
|
+
html: "pages/**/*.html",
|
|
362
|
+
htmx: "pages/**/*.html",
|
|
363
|
+
react: "pages/**/*.{ts,tsx,js,jsx}",
|
|
364
|
+
svelte: "pages/**/*.svelte",
|
|
365
|
+
vue: "pages/**/*.vue"
|
|
366
|
+
};
|
|
367
|
+
var getPageDirs = (config) => [
|
|
368
|
+
{ dir: config.angularDirectory, framework: "angular" },
|
|
369
|
+
{ dir: config.reactDirectory, framework: "react" },
|
|
370
|
+
{ dir: config.svelteDirectory, framework: "svelte" },
|
|
371
|
+
{ dir: config.vueDirectory, framework: "vue" },
|
|
372
|
+
{ dir: config.htmlDirectory, framework: "html" },
|
|
373
|
+
{ dir: config.htmxDirectory, framework: "htmx" }
|
|
374
|
+
].filter((entry) => typeof entry.dir === "string" && entry.dir.length > 0);
|
|
375
|
+
var buildIslandSourceLookup = async (config) => {
|
|
376
|
+
const registryPath = config.islands?.registry;
|
|
377
|
+
if (!registryPath) {
|
|
378
|
+
return new Map;
|
|
379
|
+
}
|
|
380
|
+
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
381
|
+
const lookup = new Map;
|
|
382
|
+
for (const definition of buildInfo.definitions) {
|
|
383
|
+
const source = definition.buildReference?.source;
|
|
384
|
+
if (!source)
|
|
385
|
+
continue;
|
|
386
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve2(dirname3(buildInfo.resolvedRegistryPath), source);
|
|
387
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve2(resolvedSource));
|
|
388
|
+
}
|
|
389
|
+
return lookup;
|
|
390
|
+
};
|
|
391
|
+
var getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map;
|
|
392
|
+
var metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
393
|
+
const candidate = usage.source;
|
|
394
|
+
return candidate ? resolve2(candidate) === target : false;
|
|
395
|
+
});
|
|
396
|
+
var getPagesUsingIslandSource = (sourcePath) => {
|
|
397
|
+
const target = resolve2(sourcePath);
|
|
398
|
+
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
399
|
+
};
|
|
400
|
+
var resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
401
|
+
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
402
|
+
return sourcePath ? {
|
|
403
|
+
...usage,
|
|
404
|
+
source: sourcePath
|
|
405
|
+
} : usage;
|
|
406
|
+
});
|
|
407
|
+
var loadPageIslandFiles = async (entry, islandSourceLookup, pageMetadata) => {
|
|
408
|
+
const pattern = pagePatterns[entry.framework];
|
|
409
|
+
if (!pattern)
|
|
410
|
+
return;
|
|
411
|
+
const files = await scanEntryPoints(resolve2(entry.dir), pattern);
|
|
412
|
+
for (const filePath of files) {
|
|
413
|
+
const source = readFileSync(filePath, "utf-8");
|
|
414
|
+
const islands = extractIslandUsagesFromSource(source);
|
|
415
|
+
pageMetadata.set(resolve2(filePath), {
|
|
416
|
+
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
417
|
+
pagePath: resolve2(filePath)
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
var loadPageIslandMetadata = async (config) => {
|
|
422
|
+
const pageMetadata = new Map;
|
|
423
|
+
const islandSourceLookup = await buildIslandSourceLookup(config);
|
|
424
|
+
await Promise.all(getPageDirs(config).map((entry) => loadPageIslandFiles(entry, islandSourceLookup, pageMetadata)));
|
|
425
|
+
return pageMetadata;
|
|
426
|
+
};
|
|
427
|
+
var setCurrentPageIslandMetadata = (metadata) => {
|
|
428
|
+
globalThis.__absolutePageIslandMetadata = metadata;
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
export { isTailwindCandidate, compileTailwind, compileTailwindConfig, collectIslandFrameworkSources, generateIslandEntryPoints, loadIslandRegistryBuildInfo, getPagesUsingIslandSource, loadPageIslandMetadata, setCurrentPageIslandMetadata, logStartupTimingBlock };
|
|
432
|
+
|
|
433
|
+
//# debugId=4479D65CB77F51F464756E2164756E21
|
|
434
|
+
//# sourceMappingURL=chunk-vvz7dcvq.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/build/compileTailwind.ts", "../src/utils/startupTimings.ts", "../src/build/islandEntries.ts", "../src/islands/pageMetadata.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { mkdir } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport type {\n\tStylePreprocessorConfig,\n\tTailwindConfig\n} from '../../types/build';\nimport { incrementalTailwindBuild } from './tailwindCompiler';\n\n/* Files Tailwind v4 may scan for candidate utility classes via the `@source`\n directive. When any of these change in dev, the Tailwind output must be\n regenerated so newly referenced utilities show up in the CSS — otherwise\n classes appear in markup with no rules behind them. */\nconst TAILWIND_CANDIDATE_EXTENSION_PATTERN =\n\t/\\.(html?|m?[jt]sx?|cjs|vue|svelte|astro|mdx?|css|s[ac]ss|less|styl(?:us)?)$/i;\n\nexport const isTailwindCandidate = (filePath: string) =>\n\tTAILWIND_CANDIDATE_EXTENSION_PATTERN.test(filePath);\n\n/* Production / cold-start build of the Tailwind output CSS.\n\n Uses the same persistent-compiler path as HMR — calling\n `incrementalTailwindBuild` with no changed-file hint forces a fresh\n compile + full source scan. The compiler instance is then cached for\n the remainder of the process, so subsequent rebuilds (HMR ticks during\n `absolute dev`) get the per-candidate cache for free.\n\n This replaces the old `bun.build` + `bun-plugin-tailwind` pipeline:\n the bundler was being spun up just to drive Tailwind, which made every\n call pay bundler-init cost and discarded Tailwind's internal caches\n between calls. Going directly through `tailwindcss`'s own `compile()`\n API drops both costs and brings the production build into the same\n fast path as dev. */\nexport const compileTailwind = async (\n\tinput: string,\n\toutput: string,\n\tbuildPath: string,\n\tstyleTransformConfig?: StylePreprocessorConfig\n) => {\n\tconst outputPath = join(buildPath, output);\n\tawait mkdir(dirname(outputPath), { recursive: true });\n\tawait incrementalTailwindBuild(\n\t\t{ input, output },\n\t\tbuildPath,\n\t\t[],\n\t\tstyleTransformConfig\n\t);\n};\n\nexport const compileTailwindConfig = async (\n\ttailwind: TailwindConfig,\n\tbuildPath: string,\n\tstyleTransformConfig?: StylePreprocessorConfig\n) =>\n\tcompileTailwind(\n\t\ttailwind.input,\n\t\ttailwind.output,\n\t\tbuildPath,\n\t\tstyleTransformConfig\n\t);\n",
|
|
6
|
+
"import { getDurationString } from './getDurationString';\n\nexport type StartupTimingStep = {\n\tlabel: string;\n\tdurationMs: number;\n};\n\nexport const startupTimingsEnabled =\n\tprocess.env.ABSOLUTE_STARTUP_TIMINGS === '1' ||\n\tprocess.env.ABSOLUTE_STARTUP_TIMINGS === 'true';\n\nexport const formatStartupTimingBlock = (\n\ttitle: string,\n\tsteps: StartupTimingStep[]\n) => {\n\tconst totalDuration = steps.reduce((sum, step) => sum + step.durationMs, 0);\n\n\treturn [\n\t\ttitle,\n\t\t...steps.map(\n\t\t\t(step) => ` - ${step.label}: ${getDurationString(step.durationMs)}`\n\t\t),\n\t\t` Total: ${getDurationString(totalDuration)}`\n\t].join('\\n');\n};\n\nexport const logStartupTimingBlock = (\n\ttitle: string,\n\tsteps: StartupTimingStep[]\n) => {\n\tif (!startupTimingsEnabled || steps.length === 0) {\n\t\treturn;\n\t}\n\n\tconsole.log(formatStartupTimingBlock(title, steps));\n};\n",
|
|
7
|
+
"import { mkdirSync, rmSync, writeFileSync } from 'node:fs';\nimport { dirname, extname, join, relative, resolve } from 'node:path';\nimport ts from 'typescript';\nimport type { IslandFramework, IslandRegistryInput } from '../../types/island';\nimport { getIslandBuildReference } from '../core/islands';\n\ntype RegistryModuleExport = {\n\tdefault?: unknown;\n\tislandRegistry?: unknown;\n};\n\ntype IslandBuildEntry = {\n\tcomponent: string;\n\tentryPath: string;\n\tframework: IslandFramework;\n};\n\ntype IslandDefinition = {\n\tbuildReference: {\n\t\texport?: string;\n\t\tsource: string;\n\t} | null;\n\tcomponent: string;\n\tframework: IslandFramework;\n};\n\ntype IslandRegistryBuildInfo = {\n\tdefinitions: IslandDefinition[];\n\thasNamedExport: boolean;\n\tregistry: IslandRegistryInput;\n\tresolvedRegistryPath: string;\n};\n\ntype ParsedImportReference = {\n\texport?: string;\n\tsource: string;\n};\n\ntype ParsedRegistryBuildInfo = {\n\tdefinitions: IslandDefinition[];\n\thasNamedExport: boolean;\n\tregistry: IslandRegistryInput;\n};\n\ntype IslandEntryPathMaps = Partial<\n\tRecord<IslandFramework, Map<string, string>>\n>;\n\nconst frameworks: IslandFramework[] = ['react', 'svelte', 'vue', 'angular'];\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst resolveRegistryExport = (mod: RegistryModuleExport) => {\n\tif (isRecord(mod.islandRegistry)) return mod.islandRegistry;\n\tif (isRecord(mod.default)) return mod.default;\n\n\tthrow new Error(\n\t\t'Island registry module must export `islandRegistry` or a default registry object.'\n\t);\n};\n\nconst hasSvelteImport = (source: string) =>\n\t/from\\s+['\"][^'\"]+\\.svelte['\"]/.test(source);\n\nconst normalizeImportPath = (wrapperPath: string, targetPath: string) => {\n\tconst importPath = relative(dirname(wrapperPath), targetPath).replace(\n\t\t/\\\\/g,\n\t\t'/'\n\t);\n\n\treturn importPath.startsWith('.') ? importPath : `./${importPath}`;\n};\n\nconst isIdentifier = (value: string) =>\n\t/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value);\n\nconst resolveIslandSourcePath = (registryPath: string, sourcePath: string) => {\n\tif (sourcePath.startsWith('file://')) {\n\t\treturn new URL(sourcePath).pathname;\n\t}\n\n\treturn resolve(dirname(registryPath), sourcePath);\n};\n\nconst getObjectPropertyName = (name: ts.PropertyName) => {\n\tif (ts.isIdentifier(name) || ts.isStringLiteral(name)) {\n\t\treturn name.text;\n\t}\n\n\treturn null;\n};\n\nconst collectDefaultImport = (\n\timports: Map<string, ParsedImportReference>,\n\timportClause: ts.ImportClause,\n\tsource: string\n) => {\n\tif (!importClause.name) return;\n\n\timports.set(importClause.name.text, {\n\t\texport: 'default',\n\t\tsource\n\t});\n};\n\nconst collectNamedImports = (\n\timports: Map<string, ParsedImportReference>,\n\timportClause: ts.ImportClause,\n\tsource: string\n) => {\n\tconst bindings = importClause.namedBindings;\n\tif (!bindings || !ts.isNamedImports(bindings)) return;\n\n\tfor (const element of bindings.elements) {\n\t\timports.set(element.name.text, {\n\t\t\texport: element.propertyName?.text ?? element.name.text,\n\t\t\tsource\n\t\t});\n\t}\n};\n\nconst isIslandRegistryHelperImport = (source: string) =>\n\tsource === '@absolutejs/absolute/islands' ||\n\tsource.endsWith('/islands') ||\n\tsource.endsWith('/core/islands');\n\nconst collectRegistryHelperImports = (\n\timportClause: ts.ImportClause,\n\tsource: string,\n\tregistryFactoryNames: Set<string>,\n\tregistryNamespaceNames: Set<string>\n) => {\n\tif (!isIslandRegistryHelperImport(source)) return;\n\n\tconst bindings = importClause.namedBindings;\n\tif (!bindings) return;\n\n\tif (ts.isNamespaceImport(bindings)) {\n\t\tregistryNamespaceNames.add(bindings.name.text);\n\n\t\treturn;\n\t}\n\n\tfor (const element of bindings.elements) {\n\t\tconst importedName = element.propertyName?.text ?? element.name.text;\n\t\tif (importedName === 'defineIslandRegistry') {\n\t\t\tregistryFactoryNames.add(element.name.text);\n\t\t}\n\t}\n};\n\nconst createRegistryEntryValue = (reference: ParsedImportReference) => ({\n\tcomponent: reference.source,\n\texport: reference.export,\n\tsource: reference.source\n});\n\nconst addRegistryEntries = (\n\tframeworkNode: ts.ObjectLiteralExpression,\n\tframework: IslandFramework,\n\timports: Map<string, ParsedImportReference>,\n\tdefinitions: IslandDefinition[],\n\tregistry: IslandRegistryInput\n) => {\n\tconst frameworkRegistry = registry[framework] ?? {};\n\tregistry[framework] = frameworkRegistry;\n\n\tfor (const property of frameworkNode.properties) {\n\t\tif (\n\t\t\t!ts.isPropertyAssignment(property) &&\n\t\t\t!ts.isShorthandPropertyAssignment(property)\n\t\t)\n\t\t\tcontinue;\n\n\t\tconst componentName = getObjectPropertyName(property.name);\n\t\tif (!componentName) continue;\n\n\t\tconst initializer = ts.isPropertyAssignment(property)\n\t\t\t? property.initializer\n\t\t\t: property.name;\n\t\tif (!ts.isIdentifier(initializer)) continue;\n\n\t\tconst reference = imports.get(initializer.text);\n\t\tif (!reference) continue;\n\n\t\tframeworkRegistry[componentName] = createRegistryEntryValue(reference);\n\t\tdefinitions.push({\n\t\t\tbuildReference: reference,\n\t\t\tcomponent: componentName,\n\t\t\tframework\n\t\t});\n\t}\n};\n\nconst processDefineIslandRegistry = (\n\tnode: ts.CallExpression,\n\timports: Map<string, ParsedImportReference>,\n\tdefinitions: IslandDefinition[],\n\tregistry: IslandRegistryInput\n) => {\n\tconst [firstArg] = node.arguments;\n\tif (!firstArg || !ts.isObjectLiteralExpression(firstArg)) return;\n\n\tconst validFrameworks: IslandFramework[] = [\n\t\t'react',\n\t\t'svelte',\n\t\t'vue',\n\t\t'angular'\n\t];\n\tfor (const property of firstArg.properties) {\n\t\tif (!ts.isPropertyAssignment(property)) continue;\n\t\tconst frameworkName = getObjectPropertyName(property.name);\n\t\tif (!frameworkName) continue;\n\t\tconst framework = validFrameworks.find((f) => f === frameworkName);\n\t\tif (!framework) continue;\n\t\tif (!ts.isObjectLiteralExpression(property.initializer)) continue;\n\n\t\taddRegistryEntries(\n\t\t\tproperty.initializer,\n\t\t\tframework,\n\t\t\timports,\n\t\t\tdefinitions,\n\t\t\tregistry\n\t\t);\n\t}\n};\n\nconst walkRegistryNode = (\n\tnode: ts.Node,\n\timports: Map<string, ParsedImportReference>,\n\tregistryFactoryNames: Set<string>,\n\tregistryNamespaceNames: Set<string>,\n\tdefinitions: IslandDefinition[],\n\tregistry: IslandRegistryInput\n) => {\n\tif (\n\t\tts.isCallExpression(node) &&\n\t\tisDefineIslandRegistryCall(\n\t\t\tnode.expression,\n\t\t\tregistryFactoryNames,\n\t\t\tregistryNamespaceNames\n\t\t)\n\t) {\n\t\tprocessDefineIslandRegistry(node, imports, definitions, registry);\n\t}\n\n\tts.forEachChild(node, (child) =>\n\t\twalkRegistryNode(\n\t\t\tchild,\n\t\t\timports,\n\t\t\tregistryFactoryNames,\n\t\t\tregistryNamespaceNames,\n\t\t\tdefinitions,\n\t\t\tregistry\n\t\t)\n\t);\n};\n\nconst isDefineIslandRegistryCall = (\n\texpression: ts.Expression,\n\tregistryFactoryNames: Set<string>,\n\tregistryNamespaceNames: Set<string>\n) => {\n\tif (ts.isIdentifier(expression)) {\n\t\treturn registryFactoryNames.has(expression.text);\n\t}\n\n\treturn (\n\t\tts.isPropertyAccessExpression(expression) &&\n\t\texpression.name.text === 'defineIslandRegistry' &&\n\t\tts.isIdentifier(expression.expression) &&\n\t\tregistryNamespaceNames.has(expression.expression.text)\n\t);\n};\n\nconst hasIslandRegistryNamedExport = (sourceFile: ts.SourceFile) => {\n\tfor (const statement of sourceFile.statements) {\n\t\tif (\n\t\t\tts.isVariableStatement(statement) &&\n\t\t\tstatement.modifiers?.some(\n\t\t\t\t(modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword\n\t\t\t) &&\n\t\t\tstatement.declarationList.declarations.some(\n\t\t\t\t(declaration) =>\n\t\t\t\t\tts.isIdentifier(declaration.name) &&\n\t\t\t\t\tdeclaration.name.text === 'islandRegistry'\n\t\t\t)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!ts.isExportDeclaration(statement) || !statement.exportClause)\n\t\t\tcontinue;\n\t\tif (!ts.isNamedExports(statement.exportClause)) continue;\n\n\t\tif (\n\t\t\tstatement.exportClause.elements.some(\n\t\t\t\t(element) => element.name.text === 'islandRegistry'\n\t\t\t)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n};\n\nconst collectImportDeclarations = (\n\tsourceFile: ts.SourceFile,\n\tregistryPath: string,\n\timports: Map<string, ParsedImportReference>,\n\tregistryFactoryNames: Set<string>,\n\tregistryNamespaceNames: Set<string>\n) => {\n\tfor (const statement of sourceFile.statements) {\n\t\tif (\n\t\t\t!ts.isImportDeclaration(statement) ||\n\t\t\t!ts.isStringLiteral(statement.moduleSpecifier)\n\t\t)\n\t\t\tcontinue;\n\n\t\tconst { importClause } = statement;\n\t\tif (!importClause) continue;\n\n\t\tconst source = resolveIslandSourcePath(\n\t\t\tregistryPath,\n\t\t\tstatement.moduleSpecifier.text\n\t\t);\n\n\t\tcollectDefaultImport(imports, importClause, source);\n\t\tcollectNamedImports(imports, importClause, source);\n\t\tcollectRegistryHelperImports(\n\t\t\timportClause,\n\t\t\tstatement.moduleSpecifier.text,\n\t\t\tregistryFactoryNames,\n\t\t\tregistryNamespaceNames\n\t\t);\n\t}\n};\n\nconst parseIslandRegistryBuildInfo = (\n\tregistrySource: string,\n\tregistryPath: string\n): ParsedRegistryBuildInfo => {\n\tconst sourceFile = ts.createSourceFile(\n\t\tregistryPath,\n\t\tregistrySource,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tts.ScriptKind.TS\n\t);\n\tconst imports = new Map<string, ParsedImportReference>();\n\tconst registryFactoryNames = new Set<string>(['defineIslandRegistry']);\n\tconst registryNamespaceNames = new Set<string>();\n\tconst definitions: IslandDefinition[] = [];\n\tconst registry: IslandRegistryInput = {};\n\n\tcollectImportDeclarations(\n\t\tsourceFile,\n\t\tregistryPath,\n\t\timports,\n\t\tregistryFactoryNames,\n\t\tregistryNamespaceNames\n\t);\n\twalkRegistryNode(\n\t\tsourceFile,\n\t\timports,\n\t\tregistryFactoryNames,\n\t\tregistryNamespaceNames,\n\t\tdefinitions,\n\t\tregistry\n\t);\n\n\treturn {\n\t\tdefinitions,\n\t\thasNamedExport: hasIslandRegistryNamedExport(sourceFile),\n\t\tregistry\n\t};\n};\n\nconst loadDynamicIslandRegistryBuildInfo = async (\n\tresolvedRegistryPath: string\n) => {\n\tconst registryModule: RegistryModuleExport = await import(\n\t\tresolvedRegistryPath\n\t);\n\tconst registry: IslandRegistryInput = resolveRegistryExport(registryModule);\n\tconst definitions = frameworks.flatMap((framework) => {\n\t\tconst frameworkRegistry = registry[framework];\n\t\tif (!isRecord(frameworkRegistry)) return [];\n\n\t\treturn Object.entries(frameworkRegistry).map(([component, value]) => ({\n\t\t\tbuildReference: getIslandBuildReference(value),\n\t\t\tcomponent,\n\t\t\tframework\n\t\t}));\n\t});\n\n\treturn {\n\t\tdefinitions,\n\t\thasNamedExport: isRecord(registryModule.islandRegistry),\n\t\tregistry\n\t};\n};\n\nconst createRegistryImportCode = (\n\twrapperPath: string,\n\tregistryPath: string,\n\thasNamedExport: boolean\n) => {\n\tconst normalizedPath = normalizeImportPath(wrapperPath, registryPath);\n\n\tif (hasNamedExport) {\n\t\treturn {\n\t\t\timportStatement: `import { islandRegistry as __absoluteIslandRegistry } from ${JSON.stringify(normalizedPath)};`,\n\t\t\tregistryReference: '__absoluteIslandRegistry'\n\t\t};\n\t}\n\n\treturn {\n\t\timportStatement: `import __absoluteIslandRegistry from ${JSON.stringify(normalizedPath)};`,\n\t\tregistryReference: '__absoluteIslandRegistry'\n\t};\n};\n\nconst createDirectEntrySource = (\n\twrapperPath: string,\n\timportPath: string,\n\texportName?: string\n) => {\n\tconst normalizedImportPath = normalizeImportPath(wrapperPath, importPath);\n\tif (!exportName || exportName === 'default') {\n\t\treturn `export { default } from ${JSON.stringify(normalizedImportPath)};\\n`;\n\t}\n\n\treturn `export { ${exportName} as default } from ${JSON.stringify(normalizedImportPath)};\\n`;\n};\n\nconst createRegistryEntrySource = (\n\twrapperPath: string,\n\tregistryPath: string,\n\thasNamedExport: boolean,\n\tframework: IslandFramework,\n\tcomponent: string\n) => {\n\tconst { importStatement, registryReference } = createRegistryImportCode(\n\t\twrapperPath,\n\t\tregistryPath,\n\t\thasNamedExport\n\t);\n\tconst frameworkAccess = isIdentifier(framework)\n\t\t? `${registryReference}.${framework}`\n\t\t: `${registryReference}[${JSON.stringify(framework)}]`;\n\tconst componentAccess = isIdentifier(component)\n\t\t? `${frameworkAccess}.${component}`\n\t\t: `${frameworkAccess}[${JSON.stringify(component)}]`;\n\n\treturn `${importStatement}\n\nconst component = ${componentAccess};\n\nexport default component;\n`;\n};\n\nconst shouldUseCompiledClientPath = (\n\tframework: IslandFramework,\n\tsourcePath: string\n) => {\n\tif (framework === 'svelte') {\n\t\treturn /\\.svelte(?:\\.(?:ts|js))?$/.test(sourcePath);\n\t}\n\n\tif (framework === 'vue') {\n\t\treturn extname(sourcePath) === '.vue';\n\t}\n\n\tif (framework === 'angular') {\n\t\treturn /\\.(?:ts|js|tsx|jsx|mjs|cjs)$/.test(sourcePath);\n\t}\n\n\treturn false;\n};\n\nexport const collectIslandFrameworkSources = (\n\tbuildInfo: IslandRegistryBuildInfo\n) => {\n\tconst sources: Partial<Record<IslandFramework, string[]>> = {};\n\n\tfor (const definition of buildInfo.definitions) {\n\t\tconst { buildReference } = definition;\n\t\tif (!buildReference) continue;\n\n\t\tconst resolvedSourcePath = resolveIslandSourcePath(\n\t\t\tbuildInfo.resolvedRegistryPath,\n\t\t\tbuildReference.source\n\t\t);\n\t\tif (\n\t\t\t!shouldUseCompiledClientPath(\n\t\t\t\tdefinition.framework,\n\t\t\t\tresolvedSourcePath\n\t\t\t)\n\t\t)\n\t\t\tcontinue;\n\n\t\tconst frameworkSources = sources[definition.framework] ?? [];\n\t\tif (frameworkSources.includes(resolvedSourcePath)) continue;\n\n\t\tframeworkSources.push(resolvedSourcePath);\n\t\tsources[definition.framework] = frameworkSources;\n\t}\n\n\treturn sources;\n};\nexport const generateIslandEntryPoints = async ({\n\tbuildInfo,\n\tbuildPath,\n\tclientPathMaps = {}\n}: {\n\tbuildInfo: IslandRegistryBuildInfo;\n\tbuildPath: string;\n\tclientPathMaps?: IslandEntryPathMaps;\n}) => {\n\tconst generatedRoot = join(buildPath, '_island_entries');\n\n\trmSync(generatedRoot, { force: true, recursive: true });\n\n\tconst entries: IslandBuildEntry[] = [];\n\n\tfor (const definition of buildInfo.definitions) {\n\t\tconst entryPath = join(\n\t\t\tgeneratedRoot,\n\t\t\t'islands',\n\t\t\tdefinition.framework,\n\t\t\t`${definition.component}.ts`\n\t\t);\n\t\tconst { buildReference } = definition;\n\t\tconst source = buildReference\n\t\t\t? resolveIslandSourcePath(\n\t\t\t\t\tbuildInfo.resolvedRegistryPath,\n\t\t\t\t\tbuildReference.source\n\t\t\t\t)\n\t\t\t: null;\n\t\tconst compiledSourcePath =\n\t\t\tsource && shouldUseCompiledClientPath(definition.framework, source)\n\t\t\t\t? clientPathMaps[definition.framework]?.get(source)\n\t\t\t\t: undefined;\n\t\tconst entrySource =\n\t\t\tsource &&\n\t\t\t(compiledSourcePath ||\n\t\t\t\t!shouldUseCompiledClientPath(definition.framework, source))\n\t\t\t\t? createDirectEntrySource(\n\t\t\t\t\t\tentryPath,\n\t\t\t\t\t\tcompiledSourcePath ?? source,\n\t\t\t\t\t\tcompiledSourcePath ? undefined : buildReference?.export\n\t\t\t\t\t)\n\t\t\t\t: createRegistryEntrySource(\n\t\t\t\t\t\tentryPath,\n\t\t\t\t\t\tbuildInfo.resolvedRegistryPath,\n\t\t\t\t\t\tbuildInfo.hasNamedExport,\n\t\t\t\t\t\tdefinition.framework,\n\t\t\t\t\t\tdefinition.component\n\t\t\t\t\t);\n\n\t\tmkdirSync(dirname(entryPath), { recursive: true });\n\t\twriteFileSync(entryPath, entrySource);\n\t\tentries.push({\n\t\t\tcomponent: definition.component,\n\t\t\tentryPath,\n\t\t\tframework: definition.framework\n\t\t});\n\t}\n\n\treturn {\n\t\tentries,\n\t\tgeneratedRoot\n\t};\n};\nexport const loadIslandRegistryBuildInfo = async (\n\tregistryPath: string\n): Promise<IslandRegistryBuildInfo> => {\n\tconst resolvedRegistryPath = resolve(registryPath);\n\tconst registrySource = Bun.file(resolvedRegistryPath);\n\tconst registrySourceText = await registrySource.text();\n\tconst parsedInfo = parseIslandRegistryBuildInfo(\n\t\tregistrySourceText,\n\t\tresolvedRegistryPath\n\t);\n\tif (parsedInfo.definitions.length > 0) {\n\t\treturn {\n\t\t\tdefinitions: parsedInfo.definitions,\n\t\t\thasNamedExport: parsedInfo.hasNamedExport,\n\t\t\tregistry: parsedInfo.registry,\n\t\t\tresolvedRegistryPath\n\t\t};\n\t}\n\tif (hasSvelteImport(registrySourceText)) {\n\t\tthrow new Error(\n\t\t\t'Unable to statically analyze the island registry. Registries that import .svelte files must use defineIslandRegistry({ ... }) with direct imported component references.'\n\t\t);\n\t}\n\n\tconst dynamicInfo =\n\t\tawait loadDynamicIslandRegistryBuildInfo(resolvedRegistryPath);\n\n\treturn {\n\t\tdefinitions: dynamicInfo.definitions,\n\t\thasNamedExport: dynamicInfo.hasNamedExport,\n\t\tregistry: dynamicInfo.registry,\n\t\tresolvedRegistryPath\n\t};\n};\n",
|
|
8
|
+
"import { readFileSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport type { BuildConfig } from '../../types/build';\nimport type { IslandFramework } from '../../types/island';\nimport { loadIslandRegistryBuildInfo } from '../build/islandEntries';\nimport { scanEntryPoints } from '../build/scanEntryPoints';\nimport {\n\textractIslandUsagesFromSource,\n\ttype PageIslandUsage\n} from './sourceMetadata';\n\nexport type PageIslandMetadata = {\n\tislands: PageIslandUsage[];\n\tpagePath: string;\n};\n\ndeclare global {\n\tvar __absolutePageIslandMetadata:\n\t\t| Map<string, PageIslandMetadata>\n\t\t| undefined;\n}\n\nconst pagePatterns: Partial<Record<IslandFramework | 'html' | 'htmx', string>> =\n\t{\n\t\tangular: 'pages/**/*.{ts,js}',\n\t\thtml: 'pages/**/*.html',\n\t\thtmx: 'pages/**/*.html',\n\t\treact: 'pages/**/*.{ts,tsx,js,jsx}',\n\t\tsvelte: 'pages/**/*.svelte',\n\t\tvue: 'pages/**/*.vue'\n\t};\n\ntype PageDirectoryEntry = {\n\tdir: string;\n\tframework: keyof typeof pagePatterns;\n};\n\nconst getPageDirs = (config: BuildConfig) =>\n\t(\n\t\t[\n\t\t\t{ dir: config.angularDirectory, framework: 'angular' },\n\t\t\t{ dir: config.reactDirectory, framework: 'react' },\n\t\t\t{ dir: config.svelteDirectory, framework: 'svelte' },\n\t\t\t{ dir: config.vueDirectory, framework: 'vue' },\n\t\t\t{ dir: config.htmlDirectory, framework: 'html' },\n\t\t\t{ dir: config.htmxDirectory, framework: 'htmx' }\n\t\t] satisfies Array<{\n\t\t\tdir: string | undefined;\n\t\t\tframework: keyof typeof pagePatterns;\n\t\t}>\n\t).filter(\n\t\t(entry): entry is PageDirectoryEntry =>\n\t\t\ttypeof entry.dir === 'string' && entry.dir.length > 0\n\t);\n\nconst buildIslandSourceLookup = async (config: BuildConfig) => {\n\tconst registryPath = config.islands?.registry;\n\tif (!registryPath) {\n\t\treturn new Map<string, string>();\n\t}\n\n\tconst buildInfo = await loadIslandRegistryBuildInfo(registryPath);\n\tconst lookup = new Map<string, string>();\n\n\tfor (const definition of buildInfo.definitions) {\n\t\tconst source = definition.buildReference?.source;\n\t\tif (!source) continue;\n\n\t\tconst resolvedSource = source.startsWith('file://')\n\t\t\t? new URL(source).pathname\n\t\t\t: resolve(dirname(buildInfo.resolvedRegistryPath), source);\n\n\t\tlookup.set(\n\t\t\t`${definition.framework}:${definition.component}`,\n\t\t\tresolve(resolvedSource)\n\t\t);\n\t}\n\n\treturn lookup;\n};\n\nexport const getCurrentPageIslandMetadata = () =>\n\tglobalThis.__absolutePageIslandMetadata ??\n\tnew Map<string, PageIslandMetadata>();\nconst metadataUsesSource = (metadata: PageIslandMetadata, target: string) =>\n\tmetadata.islands.some((usage) => {\n\t\tconst candidate = usage.source;\n\n\t\treturn candidate ? resolve(candidate) === target : false;\n\t});\n\nexport const getPagesUsingIslandSource = (sourcePath: string) => {\n\tconst target = resolve(sourcePath);\n\n\treturn [...getCurrentPageIslandMetadata().values()]\n\t\t.filter((metadata) => metadataUsesSource(metadata, target))\n\t\t.map((metadata) => metadata.pagePath);\n};\nconst resolveIslandUsages = (\n\tislands: PageIslandUsage[],\n\tislandSourceLookup: Map<string, string>\n) =>\n\tislands.map((usage) => {\n\t\tconst sourcePath = islandSourceLookup.get(\n\t\t\t`${usage.framework}:${usage.component}`\n\t\t);\n\n\t\treturn sourcePath\n\t\t\t? {\n\t\t\t\t\t...usage,\n\t\t\t\t\tsource: sourcePath\n\t\t\t\t}\n\t\t\t: usage;\n\t});\n\nconst loadPageIslandFiles = async (\n\tentry: PageDirectoryEntry,\n\tislandSourceLookup: Map<string, string>,\n\tpageMetadata: Map<string, PageIslandMetadata>\n) => {\n\tconst pattern = pagePatterns[entry.framework];\n\tif (!pattern) return;\n\n\tconst files = await scanEntryPoints(resolve(entry.dir), pattern);\n\tfor (const filePath of files) {\n\t\tconst source = readFileSync(filePath, 'utf-8');\n\t\tconst islands = extractIslandUsagesFromSource(source);\n\t\tpageMetadata.set(resolve(filePath), {\n\t\t\tislands: resolveIslandUsages(islands, islandSourceLookup),\n\t\t\tpagePath: resolve(filePath)\n\t\t});\n\t}\n};\n\nexport const loadPageIslandMetadata = async (config: BuildConfig) => {\n\tconst pageMetadata = new Map<string, PageIslandMetadata>();\n\tconst islandSourceLookup = await buildIslandSourceLookup(config);\n\n\tawait Promise.all(\n\t\tgetPageDirs(config).map((entry) =>\n\t\t\tloadPageIslandFiles(entry, islandSourceLookup, pageMetadata)\n\t\t)\n\t);\n\n\treturn pageMetadata;\n};\nexport const setCurrentPageIslandMetadata = (\n\tmetadata: Map<string, PageIslandMetadata>\n) => {\n\tglobalThis.__absolutePageIslandMetadata = metadata;\n};\n"
|
|
9
|
+
],
|
|
10
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AACA;AAWA,IAAM,uCACL;AAEM,IAAM,sBAAsB,CAA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