@absolutejs/absolute 0.19.0-beta.807 → 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.
- package/dist/angular/browser.js +9801 -57
- package/dist/angular/browser.js.map +246 -4
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +14877 -60
- package/dist/angular/index.js.map +281 -4
- package/dist/angular/server.js +5610 -45
- package/dist/angular/server.js.map +51 -3
- package/dist/build.js +18092 -45
- package/dist/build.js.map +99 -3
- package/dist/cli/index.js +317 -86
- package/dist/client/index.js +1091 -70
- package/dist/client/index.js.map +24 -4
- package/dist/core/streamingSlotRegistrar.js +108 -11
- package/dist/core/streamingSlotRegistrar.js.map +4 -3
- package/dist/core/streamingSlotRegistry.js +169 -7
- package/dist/core/streamingSlotRegistry.js.map +5 -3
- package/dist/index.js +19957 -547
- package/dist/index.js.map +116 -3
- package/dist/islands/browser.js +228 -9
- package/dist/islands/browser.js.map +9 -4
- package/dist/islands/index.js +1908 -17
- package/dist/islands/index.js.map +27 -3
- package/dist/react/browser.js +328 -12
- package/dist/react/browser.js.map +12 -4
- package/dist/react/components/index.js +167 -16
- package/dist/react/components/index.js.map +6 -3
- package/dist/react/hooks/index.js +183 -8
- package/dist/react/hooks/index.js.map +7 -3
- package/dist/react/index.js +3627 -36
- package/dist/react/index.js.map +45 -4
- package/dist/react/jsxDevRuntimeCompat.js +61 -2
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/server.js +1789 -18
- package/dist/react/server.js.map +21 -3
- package/dist/src/angular/injectorPatch.d.ts +1 -0
- package/dist/src/angular/islands.d.ts +1 -0
- package/dist/src/client/hydrators/react.d.ts +3 -0
- package/dist/src/client/hydrators/svelte.d.ts +2 -0
- package/dist/src/client/hydrators/vue.d.ts +2 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/svelte/browser.js +247 -12
- package/dist/svelte/browser.js.map +10 -3
- package/dist/svelte/index.js +3732 -37
- package/dist/svelte/index.js.map +47 -4
- package/dist/svelte/server.js +2794 -21
- package/dist/svelte/server.js.map +27 -3
- package/dist/vue/browser.js +348 -12
- package/dist/vue/browser.js.map +12 -4
- package/dist/vue/components/Image.js +240 -7
- package/dist/vue/components/Image.js.map +6 -3
- package/dist/vue/components/index.js +544 -11
- package/dist/vue/components/index.js.map +9 -3
- package/dist/vue/index.js +4212 -52
- package/dist/vue/index.js.map +50 -4
- package/dist/vue/server.js +1849 -18
- package/dist/vue/server.js.map +21 -3
- package/package.json +1 -1
- package/dist/chunk-0867j0r0.js +0 -136
- package/dist/chunk-0867j0r0.js.map +0 -10
- package/dist/chunk-102fp7xe.js +0 -63
- package/dist/chunk-102fp7xe.js.map +0 -10
- package/dist/chunk-11zpfqz6.js +0 -19
- package/dist/chunk-11zpfqz6.js.map +0 -10
- package/dist/chunk-1rfh7hw9.js +0 -319
- package/dist/chunk-1rfh7hw9.js.map +0 -11
- package/dist/chunk-1x4fxm57.js +0 -51
- package/dist/chunk-1x4fxm57.js.map +0 -9
- package/dist/chunk-25v9t56f.js +0 -29
- package/dist/chunk-25v9t56f.js.map +0 -11
- package/dist/chunk-2f21eenc.js +0 -21
- package/dist/chunk-2f21eenc.js.map +0 -10
- package/dist/chunk-2ga2znex.js +0 -13
- package/dist/chunk-2ga2znex.js.map +0 -9
- package/dist/chunk-30yrw0f6.js +0 -33
- package/dist/chunk-30yrw0f6.js.map +0 -10
- package/dist/chunk-3g91wb4f.js +0 -358
- package/dist/chunk-3g91wb4f.js.map +0 -10
- package/dist/chunk-3rea1gam.js +0 -4403
- package/dist/chunk-3rea1gam.js.map +0 -28
- package/dist/chunk-3yjzpcne.js +0 -34
- package/dist/chunk-3yjzpcne.js.map +0 -10
- package/dist/chunk-41bf6aqt.js +0 -17
- package/dist/chunk-41bf6aqt.js.map +0 -9
- package/dist/chunk-4d39r92n.js +0 -81
- package/dist/chunk-4d39r92n.js.map +0 -10
- package/dist/chunk-5003emhv.js +0 -17
- package/dist/chunk-5003emhv.js.map +0 -10
- package/dist/chunk-5f67rsed.js +0 -466
- package/dist/chunk-5f67rsed.js.map +0 -10
- package/dist/chunk-5fhp1jap.js +0 -9169
- package/dist/chunk-5fhp1jap.js.map +0 -236
- package/dist/chunk-629x0yh4.js +0 -20
- package/dist/chunk-629x0yh4.js.map +0 -9
- package/dist/chunk-6pdj08z3.js +0 -73
- package/dist/chunk-6pdj08z3.js.map +0 -12
- package/dist/chunk-6qjbrt0k.js +0 -13
- package/dist/chunk-6qjbrt0k.js.map +0 -9
- package/dist/chunk-6sccb4jr.js +0 -14
- package/dist/chunk-6sccb4jr.js.map +0 -9
- package/dist/chunk-798spvzv.js +0 -50
- package/dist/chunk-798spvzv.js.map +0 -10
- package/dist/chunk-7fw6x3js.js +0 -131
- package/dist/chunk-7fw6x3js.js.map +0 -11
- package/dist/chunk-7kjj42xm.js +0 -11
- package/dist/chunk-7kjj42xm.js.map +0 -10
- package/dist/chunk-7mtstdqn.js +0 -90
- package/dist/chunk-7mtstdqn.js.map +0 -10
- package/dist/chunk-851whwc7.js +0 -17
- package/dist/chunk-851whwc7.js.map +0 -10
- package/dist/chunk-85n68sy6.js +0 -103
- package/dist/chunk-85n68sy6.js.map +0 -10
- package/dist/chunk-8kcfffry.js +0 -35
- package/dist/chunk-8kcfffry.js.map +0 -10
- package/dist/chunk-92fsjfpp.js +0 -1731
- package/dist/chunk-92fsjfpp.js.map +0 -11
- package/dist/chunk-93sqk7be.js +0 -139
- package/dist/chunk-93sqk7be.js.map +0 -12
- package/dist/chunk-9c5tj4k3.js +0 -130
- package/dist/chunk-9c5tj4k3.js.map +0 -10
- package/dist/chunk-9j59emg3.js +0 -184
- package/dist/chunk-9j59emg3.js.map +0 -11
- package/dist/chunk-9ve9jq72.js +0 -203
- package/dist/chunk-9ve9jq72.js.map +0 -10
- package/dist/chunk-9xrsjeem.js +0 -12
- package/dist/chunk-9xrsjeem.js.map +0 -9
- package/dist/chunk-a9mvyp04.js +0 -87
- package/dist/chunk-a9mvyp04.js.map +0 -10
- package/dist/chunk-b3gbnrwe.js +0 -21
- package/dist/chunk-b3gbnrwe.js.map +0 -10
- package/dist/chunk-bgb8k1qs.js +0 -672
- package/dist/chunk-bgb8k1qs.js.map +0 -15
- package/dist/chunk-bmgqm774.js +0 -65
- package/dist/chunk-bmgqm774.js.map +0 -9
- package/dist/chunk-bxfghpma.js +0 -69
- package/dist/chunk-bxfghpma.js.map +0 -10
- package/dist/chunk-c1jfjnka.js +0 -74
- package/dist/chunk-c1jfjnka.js.map +0 -10
- package/dist/chunk-cbkrwmvh.js +0 -80
- package/dist/chunk-cbkrwmvh.js.map +0 -10
- package/dist/chunk-cdxd7sy2.js +0 -71
- package/dist/chunk-cdxd7sy2.js.map +0 -10
- package/dist/chunk-cg95827x.js +0 -21
- package/dist/chunk-cg95827x.js.map +0 -10
- package/dist/chunk-cm0g4q6w.js +0 -149
- package/dist/chunk-cm0g4q6w.js.map +0 -10
- package/dist/chunk-d7mwkzry.js +0 -261
- package/dist/chunk-d7mwkzry.js.map +0 -10
- package/dist/chunk-d9c0am65.js +0 -12
- package/dist/chunk-d9c0am65.js.map +0 -10
- package/dist/chunk-daqghmg8.js +0 -12
- package/dist/chunk-daqghmg8.js.map +0 -9
- package/dist/chunk-e3r9fxaa.js +0 -149
- package/dist/chunk-e3r9fxaa.js.map +0 -10
- package/dist/chunk-e8eecyrq.js +0 -244
- package/dist/chunk-e8eecyrq.js.map +0 -10
- package/dist/chunk-ex2hxe0v.js +0 -160
- package/dist/chunk-ex2hxe0v.js.map +0 -11
- package/dist/chunk-fak944et.js +0 -91
- package/dist/chunk-fak944et.js.map +0 -10
- package/dist/chunk-fygx2ymm.js +0 -118
- package/dist/chunk-fygx2ymm.js.map +0 -12
- package/dist/chunk-g15qj669.js +0 -271
- package/dist/chunk-g15qj669.js.map +0 -11
- package/dist/chunk-gd6wmknh.js +0 -121
- package/dist/chunk-gd6wmknh.js.map +0 -11
- package/dist/chunk-gf0ygptk.js +0 -85
- package/dist/chunk-gf0ygptk.js.map +0 -11
- package/dist/chunk-gytkmthr.js +0 -220
- package/dist/chunk-gytkmthr.js.map +0 -10
- package/dist/chunk-h5bbfn3n.js +0 -28
- package/dist/chunk-h5bbfn3n.js.map +0 -11
- package/dist/chunk-h6mye9r3.js +0 -93
- package/dist/chunk-h6mye9r3.js.map +0 -10
- package/dist/chunk-hcsmxw1v.js +0 -85
- package/dist/chunk-hcsmxw1v.js.map +0 -10
- package/dist/chunk-hyjs4bqs.js +0 -8
- package/dist/chunk-hyjs4bqs.js.map +0 -10
- package/dist/chunk-jn91vzkh.js +0 -66
- package/dist/chunk-jn91vzkh.js.map +0 -10
- package/dist/chunk-jpkjdgsk.js +0 -167
- package/dist/chunk-jpkjdgsk.js.map +0 -11
- package/dist/chunk-jwxt8gnp.js +0 -13
- package/dist/chunk-jwxt8gnp.js.map +0 -9
- package/dist/chunk-kk8w9rh5.js +0 -195
- package/dist/chunk-kk8w9rh5.js.map +0 -10
- package/dist/chunk-kwgh8rmg.js +0 -426
- package/dist/chunk-kwgh8rmg.js.map +0 -14
- package/dist/chunk-m97ze5hz.js +0 -46
- package/dist/chunk-m97ze5hz.js.map +0 -10
- package/dist/chunk-mbazhahf.js +0 -60
- package/dist/chunk-mbazhahf.js.map +0 -10
- package/dist/chunk-mgfwq18r.js +0 -15
- package/dist/chunk-mgfwq18r.js.map +0 -9
- package/dist/chunk-mtgf69xn.js +0 -88
- package/dist/chunk-mtgf69xn.js.map +0 -10
- package/dist/chunk-mtxzyxpg.js +0 -102
- package/dist/chunk-mtxzyxpg.js.map +0 -10
- package/dist/chunk-nehhtthw.js +0 -225
- package/dist/chunk-nehhtthw.js.map +0 -10
- package/dist/chunk-p5504p14.js +0 -16
- package/dist/chunk-p5504p14.js.map +0 -10
- package/dist/chunk-p5zgj77m.js +0 -184
- package/dist/chunk-p5zgj77m.js.map +0 -10
- package/dist/chunk-pnscgw95.js +0 -90
- package/dist/chunk-pnscgw95.js.map +0 -10
- package/dist/chunk-pvpp4pvs.js +0 -17
- package/dist/chunk-pvpp4pvs.js.map +0 -10
- package/dist/chunk-qh75agse.js +0 -95
- package/dist/chunk-qh75agse.js.map +0 -10
- package/dist/chunk-qxq2zcty.js +0 -52
- package/dist/chunk-qxq2zcty.js.map +0 -10
- package/dist/chunk-r6e8pytx.js +0 -22
- package/dist/chunk-r6e8pytx.js.map +0 -9
- package/dist/chunk-r7jmgqnw.js +0 -114
- package/dist/chunk-r7jmgqnw.js.map +0 -10
- package/dist/chunk-s6defjk2.js +0 -116
- package/dist/chunk-s6defjk2.js.map +0 -10
- package/dist/chunk-sd39p726.js +0 -619
- package/dist/chunk-sd39p726.js.map +0 -10
- package/dist/chunk-swrnzs4c.js +0 -63
- package/dist/chunk-swrnzs4c.js.map +0 -10
- package/dist/chunk-tfe3sb44.js +0 -33
- package/dist/chunk-tfe3sb44.js.map +0 -10
- package/dist/chunk-tjr0kcev.js +0 -41
- package/dist/chunk-tjr0kcev.js.map +0 -9
- package/dist/chunk-tx9edm1x.js +0 -34
- package/dist/chunk-tx9edm1x.js.map +0 -10
- package/dist/chunk-txhm2vb5.js +0 -18
- package/dist/chunk-txhm2vb5.js.map +0 -9
- package/dist/chunk-v5vmsxmy.js +0 -526
- package/dist/chunk-v5vmsxmy.js.map +0 -12
- package/dist/chunk-vjhxm8n2.js +0 -29
- package/dist/chunk-vjhxm8n2.js.map +0 -9
- package/dist/chunk-vkrpm7kc.js +0 -247
- package/dist/chunk-vkrpm7kc.js.map +0 -12
- package/dist/chunk-w3m4m5we.js +0 -4925
- package/dist/chunk-w3m4m5we.js.map +0 -12
- package/dist/chunk-wrxtn9ve.js +0 -18
- package/dist/chunk-wrxtn9ve.js.map +0 -10
- package/dist/chunk-x09cskqd.js +0 -377
- package/dist/chunk-x09cskqd.js.map +0 -10
- package/dist/chunk-xnt8c6h2.js +0 -576
- package/dist/chunk-xnt8c6h2.js.map +0 -10
- package/dist/chunk-xw0tx842.js +0 -13
- package/dist/chunk-xw0tx842.js.map +0 -9
- package/dist/chunk-xx5b6b9m.js +0 -69
- package/dist/chunk-xx5b6b9m.js.map +0 -10
- package/dist/chunk-xz1kdswj.js +0 -21
- package/dist/chunk-xz1kdswj.js.map +0 -9
- package/dist/chunk-y84qnsd3.js +0 -32
- package/dist/chunk-y84qnsd3.js.map +0 -10
- package/dist/chunk-ywjn0rad.js +0 -14
- package/dist/chunk-ywjn0rad.js.map +0 -9
- package/dist/chunk-z9nvhm6r.js +0 -13
- package/dist/chunk-z9nvhm6r.js.map +0 -9
- package/dist/chunk-zhmvdpk6.js +0 -15
- package/dist/chunk-zhmvdpk6.js.map +0 -9
- package/dist/chunk-zrg9d4zw.js +0 -784
- package/dist/chunk-zrg9d4zw.js.map +0 -10
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/build/compileTailwind.ts", "../src/utils/startupTimings.ts", "../src/build/islandEntries.ts", "../src/core/staticStreaming.ts", "../src/build/staticIslandPages.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 { statSync } from 'node:fs';\nimport { extname } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport type {\n\tStreamingSlot,\n\tStreamingSlotPatchPayload\n} from '../utils/streamingSlots';\n\nexport type StaticStreamingSlotResolver = () =>\n\t| Promise<StreamingSlotPatchPayload>\n\t| StreamingSlotPatchPayload;\n\nexport type StaticStreamingSlotDefinition = {\n\tresolve: StaticStreamingSlotResolver;\n\ttimeoutMs?: number;\n\terrorHtml?: string;\n};\n\nexport type StaticStreamingSlotDefinitions = Record<\n\tstring,\n\tStaticStreamingSlotResolver | StaticStreamingSlotDefinition\n>;\n\nexport const defineStaticStreamingSlots = <\n\tconst T extends StaticStreamingSlotDefinitions\n>(\n\tslots: T\n) => slots;\n\nconst STATIC_SLOT_TAG_RE =\n\t/<abs-stream-slot\\b([^>]*?)(?:\\/>|>([\\s\\S]*?)<\\/abs-stream-slot>)/gi;\nconst ATTRIBUTE_RE =\n\t/([A-Za-z_:][-A-Za-z0-9_:.]*)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/g;\n\ntype StaticStreamingTagDefinition = {\n\terrorHtml?: string;\n\tfallbackHtml: string;\n\tid: string;\n\tresolver: string;\n\ttimeoutMs?: number;\n};\n\nconst parseAttributes = (attributeString: string) => {\n\tconst attributes = new Map<string, string>();\n\tconst setAttributeFromMatch = (matchParts: RegExpExecArray) => {\n\t\tconst [, key, doubleQuotedValue, singleQuotedValue] = matchParts;\n\t\tif (!key) {\n\t\t\treturn;\n\t\t}\n\n\t\tattributes.set(key, doubleQuotedValue ?? singleQuotedValue ?? '');\n\t};\n\n\tlet match = ATTRIBUTE_RE.exec(attributeString);\n\twhile (match) {\n\t\tsetAttributeFromMatch(match);\n\t\tmatch = ATTRIBUTE_RE.exec(attributeString);\n\t}\n\n\tATTRIBUTE_RE.lastIndex = 0;\n\n\treturn attributes;\n};\n\nconst parseTimeout = (value: string | undefined) => {\n\tif (!value) return undefined;\n\tconst parsed = Number(value);\n\tif (!Number.isFinite(parsed) || parsed < 0) {\n\t\tthrow new Error(\n\t\t\t`Invalid <abs-stream-slot timeout-ms=\"${value}\">. Expected a non-negative number.`\n\t\t);\n\t}\n\n\treturn parsed;\n};\n\nconst parseStaticStreamingTag = (\n\tattributeString: string,\n\tinnerHtml: string | undefined\n): StaticStreamingTagDefinition => {\n\tconst attributes = parseAttributes(attributeString);\n\tconst resolver = attributes.get('resolver');\n\tif (!resolver) {\n\t\tthrow new Error(\n\t\t\t'Static <abs-stream-slot> requires a \"resolver\" attribute.'\n\t\t);\n\t}\n\n\tconst id = attributes.get('id') ?? resolver;\n\n\treturn {\n\t\terrorHtml: attributes.get('error-html') ?? undefined,\n\t\tfallbackHtml:\n\t\t\tinnerHtml?.trim() ?? attributes.get('fallback-html') ?? '',\n\t\tid,\n\t\tresolver,\n\t\ttimeoutMs: parseTimeout(attributes.get('timeout-ms') ?? undefined)\n\t};\n};\n\nexport const extractStaticStreamingTags = (html: string) => {\n\tconst tagRe = new RegExp(STATIC_SLOT_TAG_RE);\n\tconst tags: StaticStreamingTagDefinition[] = [];\n\tlet match = tagRe.exec(html);\n\n\twhile (match) {\n\t\tconst [, rawAttributeString, innerHtml] = match;\n\t\ttags.push(parseStaticStreamingTag(rawAttributeString ?? '', innerHtml));\n\t\tmatch = tagRe.exec(html);\n\t}\n\n\treturn tags;\n};\n\nconst toStaticStreamingSlotDefinition = (\n\tvalue: StaticStreamingSlotResolver | StaticStreamingSlotDefinition\n) => (typeof value === 'function' ? { resolve: value } : value);\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst toStaticStreamingDefinitionEntry = (\n\tentry: unknown\n): StaticStreamingSlotDefinition | StaticStreamingSlotResolver | null => {\n\tif (typeof entry === 'function') {\n\t\treturn () => entry();\n\t}\n\n\tif (!isObjectRecord(entry) || typeof entry.resolve !== 'function') {\n\t\treturn null;\n\t}\n\tconst { resolve } = entry;\n\n\treturn {\n\t\terrorHtml:\n\t\t\ttypeof entry.errorHtml === 'string' ? entry.errorHtml : undefined,\n\t\ttimeoutMs:\n\t\t\ttypeof entry.timeoutMs === 'number' ? entry.timeoutMs : undefined,\n\t\tresolve: () => resolve()\n\t};\n};\n\nconst toStaticStreamingSlotDefinitions = (value: unknown) => {\n\tif (!isObjectRecord(value)) {\n\t\treturn null;\n\t}\n\n\tconst definitions: StaticStreamingSlotDefinitions = {};\n\tfor (const [key, entry] of Object.entries(value)) {\n\t\tconst definition = toStaticStreamingDefinitionEntry(entry);\n\t\tif (!definition) {\n\t\t\treturn null;\n\t\t}\n\n\t\tdefinitions[key] = definition;\n\t}\n\n\treturn definitions;\n};\n\ntype StaticStreamingModuleExports = {\n\tdefault?: unknown;\n\tstreamingSlots?: unknown;\n};\n\nconst resolveStaticStreamingDefinitions = (\n\tmoduleExports: StaticStreamingModuleExports\n) =>\n\ttoStaticStreamingSlotDefinitions(moduleExports.streamingSlots) ??\n\ttoStaticStreamingSlotDefinitions(moduleExports.default);\n\nconst serverModuleExtensions = [\n\t'.server.ts',\n\t'.server.js',\n\t'.server.mjs',\n\t'.slots.ts',\n\t'.slots.js',\n\t'.slots.mjs'\n] as const;\n\nconst resolveSidecarCandidates = (pagePath: string) => {\n\tconst pageExt = extname(pagePath);\n\tif (!pageExt) return [];\n\n\tconst pageStem = pagePath.slice(0, -pageExt.length);\n\n\treturn serverModuleExtensions.map((extension) => `${pageStem}${extension}`);\n};\n\nconst fileExists = async (path: string) => Bun.file(path).exists();\n\nconst loadStaticStreamingModule = async (pagePath: string) => {\n\tconst loadCandidate = async (candidates: string[]) => {\n\t\tconst [candidate, ...remaining] = candidates;\n\t\tif (!candidate) {\n\t\t\treturn null;\n\t\t}\n\t\tif (!(await fileExists(candidate))) {\n\t\t\treturn loadCandidate(remaining);\n\t\t}\n\n\t\tconst version = statSync(candidate).mtimeMs;\n\t\tconst moduleUrl = new URL(pathToFileURL(candidate).href);\n\t\tmoduleUrl.searchParams.set('t', String(version));\n\n\t\tconst moduleExports: StaticStreamingModuleExports = await import(\n\t\t\tmoduleUrl.href\n\t\t);\n\t\tconst definitions = resolveStaticStreamingDefinitions(moduleExports);\n\t\tif (!definitions) {\n\t\t\tthrow new Error(\n\t\t\t\t`Static streaming module \"${candidate}\" must export a default value or named \"streamingSlots\" object.`\n\t\t\t);\n\t\t}\n\n\t\treturn definitions;\n\t};\n\n\treturn loadCandidate(resolveSidecarCandidates(pagePath));\n};\n\nexport const loadStaticStreamingSlots = async (\n\tpagePath: string,\n\thtml: string\n) => {\n\tconst tagDefinitions = extractStaticStreamingTags(html);\n\tif (tagDefinitions.length === 0) {\n\t\treturn [];\n\t}\n\n\tconst definitions = await loadStaticStreamingModule(pagePath);\n\tif (!definitions) {\n\t\tthrow new Error(\n\t\t\t`Static page \"${pagePath}\" uses <abs-stream-slot> but no page-adjacent server module was found. Create a sibling \".server.ts\" file that exports defineStaticStreamingSlots({...}).`\n\t\t);\n\t}\n\n\treturn tagDefinitions.map((tag) => {\n\t\tconst entry = definitions[tag.resolver];\n\t\tif (!entry) {\n\t\t\tthrow new Error(\n\t\t\t\t`Static streaming resolver \"${tag.resolver}\" was not found for \"${pagePath}\".`\n\t\t\t);\n\t\t}\n\n\t\tconst definition = toStaticStreamingSlotDefinition(entry);\n\n\t\treturn {\n\t\t\terrorHtml: tag.errorHtml ?? definition.errorHtml,\n\t\t\tfallbackHtml: tag.fallbackHtml,\n\t\t\tid: tag.id,\n\t\t\tresolve: definition.resolve,\n\t\t\ttimeoutMs: tag.timeoutMs ?? definition.timeoutMs\n\t\t} satisfies StreamingSlot;\n\t});\n};\n",
|
|
9
|
-
"import { readFileSync, writeFileSync } from 'node:fs';\nimport type {\n\tIslandFramework,\n\tIslandHydrate,\n\tIslandRegistryInput,\n\tRuntimeIslandRenderProps\n} from '../../types/island';\nimport { renderStreamingSlotPlaceholder } from '../utils/streamingSlots';\nimport { renderIslandMarkup } from '../core/renderIslandMarkup';\nimport { loadIslandRegistryBuildInfo } from './islandEntries';\nimport { requireCurrentIslandRegistry } from '../core/currentIslandRegistry';\nimport { extractStaticStreamingTags } from '../core/staticStreaming';\n\nconst ISLAND_TAG_RE_SOURCE =\n\t'<(?:absolute-island|island)\\\\b([^>]*?)(?:\\\\/\\\\>|>(?:[\\\\s\\\\S]*?)<\\\\/(?:absolute-island|island)>)';\nconst ATTRIBUTE_RE_SOURCE =\n\t'([A-Za-z_:][-A-Za-z0-9_:.]*)\\\\s*=\\\\s*(?:\"([^\"]*)\"|\\'([^\\']*)\\')';\n\nconst islandFrameworks: IslandFramework[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular'\n];\n\nconst islandHydrationModes = ['load', 'idle', 'visible', 'none'] as const;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst isIslandFramework = (value: string): value is IslandFramework =>\n\tislandFrameworks.some((framework) => framework === value);\n\nconst isIslandHydrationMode = (\n\tvalue: string\n): value is IslandHydrate =>\n\tislandHydrationModes.some((mode) => mode === value);\n\ntype HTMLAttributeMap = Map<string, string>;\n\nconst parseHtmlAttributes = (attributeString: string): HTMLAttributeMap => {\n\tconst attributeRe = new RegExp(ATTRIBUTE_RE_SOURCE, 'g');\n\tconst attributes = new Map<string, string>();\n\tlet match = attributeRe.exec(attributeString);\n\n\twhile (match) {\n\t\tconst [, key, doubleQuotedValue, singleQuotedValue] = match;\n\t\tmatch = attributeRe.exec(attributeString);\n\t\tif (!key) continue;\n\n\t\tconst value = doubleQuotedValue ?? singleQuotedValue ?? '';\n\t\tattributes.set(key, value);\n\t}\n\n\treturn attributes;\n};\n\nconst parseIslandTag = (\n\tattributeString: string\n): RuntimeIslandRenderProps | null => {\n\tconst attributes = parseHtmlAttributes(attributeString);\n\tconst framework = attributes.get('framework');\n\tconst component = attributes.get('component');\n\tconst hydrate = attributes.get('hydrate') ?? 'load';\n\tconst propsSource = attributes.get('props') ?? '{}';\n\n\tif (!framework || !component) {\n\t\treturn null;\n\t}\n\n\tif (!isIslandFramework(framework)) {\n\t\tthrow new Error(`Unsupported static island framework \"${framework}\".`);\n\t}\n\n\tif (!isIslandHydrationMode(hydrate)) {\n\t\tthrow new Error(`Unsupported static island hydrate mode \"${hydrate}\".`);\n\t}\n\n\tlet parsedProps: Record<string, unknown>;\n\ttry {\n\t\tconst candidate: unknown = JSON.parse(propsSource);\n\t\tparsedProps = isRecord(candidate) ? candidate : {};\n\t} catch (error) {\n\t\tthrow new Error(\n\t\t\t`Failed to parse static island props JSON for ${framework}:${component}: ${\n\t\t\t\terror instanceof Error ? error.message : String(error)\n\t\t\t}`,\n\t\t\t{ cause: error }\n\t\t);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tframework,\n\t\thydrate,\n\t\tprops: parsedProps\n\t};\n};\n\nexport const transformStaticPageHtml = async (\n\toriginalHtml: string,\n\tregistry: IslandRegistryInput\n) => {\n\tconst islandTagRe = new RegExp(ISLAND_TAG_RE_SOURCE, 'gi');\n\tif (!islandTagRe.test(originalHtml)) {\n\t\treturn originalHtml;\n\t}\n\n\tislandTagRe.lastIndex = 0;\n\n\tconst segments: { before: string; props: ReturnType<typeof parseIslandTag>; fullMatch: string }[] = [];\n\tlet lastIndex = 0;\n\tlet match = islandTagRe.exec(originalHtml);\n\n\twhile (match) {\n\t\tconst [fullMatch, rawAttributeString] = match;\n\t\tconst attributeString = rawAttributeString ?? '';\n\t\tsegments.push({\n\t\t\tbefore: originalHtml.slice(lastIndex, match.index),\n\t\t\tfullMatch,\n\t\t\tprops: parseIslandTag(attributeString)\n\t\t});\n\t\tlastIndex = match.index + fullMatch.length;\n\t\tmatch = islandTagRe.exec(originalHtml);\n\t}\n\n\tconst renderedSegments = await Promise.all(\n\t\tsegments.map(async (segment) =>\n\t\t\tsegment.before + (segment.props ? await renderIslandMarkup(registry, segment.props) : segment.fullMatch)\n\t\t)\n\t);\n\n\treturn renderedSegments.join('') + originalHtml.slice(lastIndex);\n};\n\nconst HTMX_STREAM_SLOT_TAG_RE =\n\t/<abs-htmx-stream-slot\\b([^>]*?)(?:\\/>|>([\\s\\S]*?)<\\/abs-htmx-stream-slot>)/gi;\n\nconst requireAttribute = (\n\tattributes: HTMLAttributeMap,\n\tname: string\n) => {\n\tconst value = attributes.get(name)?.trim();\n\tif (!value) {\n\t\tthrow new Error(\n\t\t\t`Static <abs-htmx-stream-slot> requires a \"${name}\" attribute.`\n\t\t);\n\t}\n\n\treturn value;\n};\n\nconst injectAttributesIntoSingleRootElement = (\n\tfallbackHtml: string,\n\tattributes: HTMLAttributeMap\n) => {\n\tconst trimmed = fallbackHtml.trim();\n\tif (!trimmed) {\n\t\tthrow new Error(\n\t\t\t'Static <abs-htmx-stream-slot> requires fallback HTML inside the element body.'\n\t\t);\n\t}\n\n\tconst openingTagMatch = trimmed.match(/^<([A-Za-z][\\w:-]*)([^>]*)>/);\n\tif (!openingTagMatch) {\n\t\tthrow new Error(\n\t\t\t'Static <abs-htmx-stream-slot> fallback must start with a single root HTML element.'\n\t\t);\n\t}\n\n\tconst attributeSource = [...attributes.entries()]\n\t\t.map(([key, value]) => `${key}=\"${value}\"`)\n\t\t.join(' ');\n\tif (!attributeSource) {\n\t\treturn trimmed;\n\t}\n\n\tconst [openingTag, tagName, rawExistingAttributes = ''] = openingTagMatch;\n\tconst existingAttributes = rawExistingAttributes.trim();\n\tconst mergedAttributes = existingAttributes\n\t\t? `${existingAttributes} ${attributeSource}`\n\t\t: attributeSource;\n\n\treturn trimmed.replace(openingTag, `<${tagName} ${mergedAttributes}>`);\n};\n\nexport const transformStaticHTMXStreamSlotHtml = (originalHtml: string) => {\n\tlet nextIndex = 0;\n\tlet result = '';\n\tlet match = HTMX_STREAM_SLOT_TAG_RE.exec(originalHtml);\n\n\twhile (match) {\n\t\tconst [fullMatch, rawAttributeString = '', innerHtml = ''] = match;\n\t\tconst attributes = parseHtmlAttributes(rawAttributeString);\n\t\tconst loweredAttributes = new Map<string, string>([\n\t\t\t['hx-get', requireAttribute(attributes, 'src')],\n\t\t\t['hx-trigger', attributes.get('trigger') ?? 'load'],\n\t\t\t['hx-swap', attributes.get('swap') ?? 'outerHTML'],\n\t\t\t['hx-target', attributes.get('target') ?? 'this']\n\t\t]);\n\n\t\tresult += originalHtml.slice(nextIndex, match.index);\n\t\tresult += injectAttributesIntoSingleRootElement(innerHtml, loweredAttributes);\n\t\tnextIndex = match.index + fullMatch.length;\n\t\tmatch = HTMX_STREAM_SLOT_TAG_RE.exec(originalHtml);\n\t}\n\n\treturn result + originalHtml.slice(nextIndex);\n};\n\nexport const transformStaticStreamingSlotHtml = (originalHtml: string) => {\n\tconst slotDefinitions = extractStaticStreamingTags(originalHtml);\n\tif (slotDefinitions.length === 0) {\n\t\treturn originalHtml;\n\t}\n\n\tconst tagRe =\n\t\t/<abs-stream-slot\\b([^>]*?)(?:\\/>|>([\\s\\S]*?)<\\/abs-stream-slot>)/gi;\n\tlet nextIndex = 0;\n\tlet slotIndex = 0;\n\tlet result = '';\n\tlet match = tagRe.exec(originalHtml);\n\n\twhile (match) {\n\t\tconst [fullMatch] = match;\n\t\tconst tag = slotDefinitions[slotIndex++];\n\t\tif (!tag) {\n\t\t\tthrow new Error(\n\t\t\t\t'Static streaming slot transform lost sync with parsed slot definitions.'\n\t\t\t);\n\t\t}\n\t\tresult += originalHtml.slice(nextIndex, match.index);\n\t\tresult += renderStreamingSlotPlaceholder(tag.id, tag.fallbackHtml);\n\t\tnextIndex = match.index + fullMatch.length;\n\t\tmatch = tagRe.exec(originalHtml);\n\t}\n\n\treturn result + originalHtml.slice(nextIndex);\n};\n\nconst transformStaticPage = async (\n\tpagePath: string,\n\tregistry: IslandRegistryInput\n) => {\n\tconst originalHtml = readFileSync(pagePath, 'utf-8');\n\tconst transformedHtml = await transformStaticPageHtml(\n\t\toriginalHtml,\n\t\tregistry\n\t);\n\n\tif (transformedHtml !== originalHtml) {\n\t\twriteFileSync(pagePath, transformedHtml);\n\t}\n};\n\nexport const transformCurrentStaticPageHtml = async (\n\thtml: string,\n\toptions: {\n\t\tenableHTMXStreaming?: boolean;\n\t\tenableStaticStreaming?: boolean;\n\t} = {}\n) => {\n\tconst transformedHTMXStreamingHtml =\n\t\toptions.enableHTMXStreaming === false\n\t\t\t? html\n\t\t\t: transformStaticHTMXStreamSlotHtml(html);\n\tconst transformedStreamingHtml =\n\t\toptions.enableStaticStreaming === false\n\t\t\t? transformedHTMXStreamingHtml\n\t\t\t: transformStaticStreamingSlotHtml(transformedHTMXStreamingHtml);\n\tconst islandTagRe = new RegExp(ISLAND_TAG_RE_SOURCE, 'i');\n\tif (!islandTagRe.test(transformedStreamingHtml)) {\n\t\treturn transformedStreamingHtml;\n\t}\n\n\treturn transformStaticPageHtml(\n\t\ttransformedStreamingHtml,\n\t\trequireCurrentIslandRegistry()\n\t);\n};\nexport const transformStaticPagesWithIslands = async (\n\tregistryPath: string | undefined,\n\tpagePaths: string[]\n) => {\n\tif (!registryPath || pagePaths.length === 0) {\n\t\treturn;\n\t}\n\n\tconst { registry } = await loadIslandRegistryBuildInfo(registryPath);\n\n\tawait Promise.all(\n\t\tpagePaths.map((pagePath) => transformStaticPage(pagePath, registry))\n\t);\n};\n",
|
|
10
|
-
"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"
|
|
11
|
-
],
|
|
12
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAWA,IAAM,uCACL;AAEM,IAAM,sBAAsB,CAAC,aACnC,qCAAqC,KAAK,QAAQ;AAgB5C,IAAM,kBAAkB,OAC9B,OACA,QACA,WACA,yBACI;AAAA,EACJ,MAAM,aAAa,KAAK,WAAW,MAAM;AAAA,EACzC,MAAM,MAAM,QAAQ,UAAU,GAAG,EAAE,WAAW,KAAK,CAAC;AAAA,EACpD,MAAM,yBACL,EAAE,OAAO,OAAO,GAChB,WACA,CAAC,GACD,oBACD;AA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AoB,YAAY,CAC5D,CACD;AAAA,EAEA,OAAO;AAAA;AAED,IAAM,+BAA+B,CAC3C,aACI;AAAA,EACJ,WAAW,+BAA+B;AAAA;",
|
|
13
|
-
"debugId": "EA2793B90D7FF16C64756E2164756E21",
|
|
14
|
-
"names": []
|
|
15
|
-
}
|
package/dist/chunk-bmgqm774.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
function __accessProp(key) {
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
for (let key of __getOwnPropNames(mod))
|
|
23
|
-
if (!__hasOwnProp.call(to, key))
|
|
24
|
-
__defProp(to, key, {
|
|
25
|
-
get: __accessProp.bind(mod, key),
|
|
26
|
-
enumerable: true
|
|
27
|
-
});
|
|
28
|
-
if (canCache)
|
|
29
|
-
cache.set(mod, to);
|
|
30
|
-
return to;
|
|
31
|
-
};
|
|
32
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
-
var __returnValue = (v) => v;
|
|
34
|
-
function __exportSetter(name, newValue) {
|
|
35
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
-
}
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all)
|
|
39
|
-
__defProp(target, name, {
|
|
40
|
-
get: all[name],
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
set: __exportSetter.bind(all, name)
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
47
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
48
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
49
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
50
|
-
else
|
|
51
|
-
for (var i = decorators.length - 1;i >= 0; i--)
|
|
52
|
-
if (d = decorators[i])
|
|
53
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
54
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
55
|
-
};
|
|
56
|
-
var __legacyMetadataTS = (k, v) => {
|
|
57
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
58
|
-
return Reflect.metadata(k, v);
|
|
59
|
-
};
|
|
60
|
-
var __require = import.meta.require;
|
|
61
|
-
|
|
62
|
-
export { __toESM, __commonJS, __export, __legacyDecorateClassTS, __legacyMetadataTS, __require };
|
|
63
|
-
|
|
64
|
-
//# debugId=DFE4B56A8062886B64756E2164756E21
|
|
65
|
-
//# sourceMappingURL=chunk-bmgqm774.js.map
|
package/dist/chunk-bxfghpma.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
__require
|
|
4
|
-
} from "./chunk-bmgqm774.js";
|
|
5
|
-
|
|
6
|
-
// src/build/buildVueVendor.ts
|
|
7
|
-
import { mkdirSync } from "fs";
|
|
8
|
-
import { join } from "path";
|
|
9
|
-
import { rm } from "fs/promises";
|
|
10
|
-
var {build: bunBuild } = globalThis.Bun;
|
|
11
|
-
var vueSpecifiers = ["vue"];
|
|
12
|
-
var toSafeFileName = (specifier) => specifier.replace(/\//g, "_");
|
|
13
|
-
var buildVueVendor = async (buildDir) => {
|
|
14
|
-
const vendorDir = join(buildDir, "vue", "vendor");
|
|
15
|
-
mkdirSync(vendorDir, { recursive: true });
|
|
16
|
-
const tmpDir = join(buildDir, "_vue_vendor_tmp");
|
|
17
|
-
mkdirSync(tmpDir, { recursive: true });
|
|
18
|
-
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
19
|
-
const safeName = toSafeFileName(specifier);
|
|
20
|
-
const entryPath = join(tmpDir, `${safeName}.ts`);
|
|
21
|
-
await Bun.write(entryPath, `export * from '${specifier}';
|
|
22
|
-
`);
|
|
23
|
-
return entryPath;
|
|
24
|
-
}));
|
|
25
|
-
const result = await bunBuild({
|
|
26
|
-
define: {
|
|
27
|
-
__VUE_OPTIONS_API__: "true",
|
|
28
|
-
__VUE_PROD_DEVTOOLS__: "true",
|
|
29
|
-
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "true"
|
|
30
|
-
},
|
|
31
|
-
entrypoints,
|
|
32
|
-
format: "esm",
|
|
33
|
-
minify: false,
|
|
34
|
-
naming: "[name].[ext]",
|
|
35
|
-
outdir: vendorDir,
|
|
36
|
-
splitting: true,
|
|
37
|
-
target: "browser",
|
|
38
|
-
throw: false
|
|
39
|
-
});
|
|
40
|
-
await rm(tmpDir, { force: true, recursive: true });
|
|
41
|
-
if (!result.success) {
|
|
42
|
-
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const { readFileSync, writeFileSync, readdirSync } = await import("fs");
|
|
46
|
-
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
47
|
-
for (const file of files) {
|
|
48
|
-
const filePath = join(vendorDir, file);
|
|
49
|
-
const content = readFileSync(filePath, "utf-8");
|
|
50
|
-
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
51
|
-
continue;
|
|
52
|
-
const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
|
|
53
|
-
if (patched === content)
|
|
54
|
-
continue;
|
|
55
|
-
writeFileSync(filePath, patched);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
var computeVueVendorPaths = () => {
|
|
59
|
-
const paths = {};
|
|
60
|
-
for (const specifier of vueSpecifiers) {
|
|
61
|
-
paths[specifier] = `/vue/vendor/${toSafeFileName(specifier)}.js`;
|
|
62
|
-
}
|
|
63
|
-
return paths;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export { buildVueVendor, computeVueVendorPaths };
|
|
67
|
-
|
|
68
|
-
//# debugId=A45F35047E7DD64064756E2164756E21
|
|
69
|
-
//# sourceMappingURL=chunk-bxfghpma.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/build/buildVueVendor.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { mkdirSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { rm } from 'node:fs/promises';\nimport { build as bunBuild } from 'bun';\n\n/** Bare specifiers that need stable vendor builds for Vue.\n * Vue compiled SFC output imports from vue for the runtime. */\nconst vueSpecifiers = ['vue'];\n\n/** Convert a bare specifier to a safe filename */\nconst toSafeFileName = (specifier: string) =>\n\tspecifier.replace(/\\//g, '_');\n\n/** Build Vue packages into stable vendor files (no content hash).\n * Output goes to {buildDir}/vue/vendor/ with predictable names. */\nexport const buildVueVendor = async (buildDir: string) => {\n\tconst vendorDir = join(buildDir, 'vue', 'vendor');\n\tmkdirSync(vendorDir, { recursive: true });\n\n\tconst tmpDir = join(buildDir, '_vue_vendor_tmp');\n\tmkdirSync(tmpDir, { recursive: true });\n\n\t// Vue is proper ESM — use export * from directly\n\tconst entrypoints = await Promise.all(\n\t\tvueSpecifiers.map(async (specifier) => {\n\t\t\tconst safeName = toSafeFileName(specifier);\n\t\t\tconst entryPath = join(tmpDir, `${safeName}.ts`);\n\t\t\tawait Bun.write(entryPath, `export * from '${specifier}';\\n`);\n\n\t\t\treturn entryPath;\n\t\t})\n\t);\n\n\t// Define Vue feature flags to prevent warnings in browser\n\tconst result = await bunBuild({\n\t\tdefine: {\n\t\t\t__VUE_OPTIONS_API__: 'true',\n\t\t\t__VUE_PROD_DEVTOOLS__: 'true',\n\t\t\t__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'true'\n\t\t},\n\t\tentrypoints,\n\t\tformat: 'esm',\n\t\tminify: false,\n\t\tnaming: '[name].[ext]',\n\t\toutdir: vendorDir,\n\t\tsplitting: true,\n\t\ttarget: 'browser',\n\t\tthrow: false\n\t});\n\n\tawait rm(tmpDir, { force: true, recursive: true });\n\n\tif (!result.success) {\n\t\tconsole.warn('⚠️ Vue vendor build had errors:', result.logs);\n\n\t\treturn;\n\t}\n\n\t// Patch the vendor bundle: guard __VUE_HMR_RUNTIME__ so the vendor\n\t// Vue doesn't overwrite the HMR runtime set by the initial bundle.\n\t// Without this, importing the vendor Vue during HMR nukes all\n\t// component records and reload() can't find existing instances.\n\tconst { readFileSync, writeFileSync, readdirSync } = await import(\n\t\t'node:fs'\n\t);\n\tconst files = readdirSync(vendorDir).filter((f) => f.endsWith('.js'));\n\tfor (const file of files) {\n\t\tconst filePath = join(vendorDir, file);\n\t\tconst content = readFileSync(filePath, 'utf-8');\n\t\tif (!content.includes('__VUE_HMR_RUNTIME__')) continue;\n\n\t\tconst patched = content.replace(\n\t\t\t/getGlobalThis\\(\\)\\.__VUE_HMR_RUNTIME__\\s*=\\s*\\{/,\n\t\t\t'getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {'\n\t\t);\n\t\tif (patched === content) continue;\n\n\t\twriteFileSync(filePath, patched);\n\t}\n};\n\n/** Compute the deterministic vendor paths mapping (no build needed).\n * This can be called before vendor files exist on disk. */\nexport const computeVueVendorPaths = () => {\n\tconst paths: Record<string, string> = {};\n\tfor (const specifier of vueSpecifiers) {\n\t\tpaths[specifier] = `/vue/vendor/${toSafeFileName(specifier)}.js`;\n\t}\n\n\treturn paths;\n};\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;;;;;AAAA;AACA;AACA;AACA;AAIA,IAAM,gBAAgB,CAAC,KAAK;AAG5B,IAAM,iBAAiB,CAAC,cACvB,UAAU,QAAQ,OAAO,GAAG;AAItB,IAAM,iBAAiB,OAAO,aAAqB;AAAA,EACzD,MAAM,YAAY,KAAK,UAAU,OAAO,QAAQ;AAAA,EAChD,UAAU,WAAW,EAAE,WAAW,KAAK,CAAC;AAAA,EAExC,MAAM,SAAS,KAAK,UAAU,iBAAiB;AAAA,EAC/C,UAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;AAAA,EAGrC,MAAM,cAAc,MAAM,QAAQ,IACjC,cAAc,IAAI,OAAO,cAAc;AAAA,IACtC,MAAM,WAAW,eAAe,SAAS;AAAA,IACzC,MAAM,YAAY,KAAK,QAAQ,GAAG,aAAa;AAAA,IAC/C,MAAM,IAAI,MAAM,WAAW,kBAAkB;AAAA,CAAe;AAAA,IAE5D,OAAO;AAAA,GACP,CACF;AAAA,EAGA,MAAM,SAAS,MAAM,SAAS;AAAA,IAC7B,QAAQ;AAAA,MACP,qBAAqB;AAAA,MACrB,uBAAuB;AAAA,MACvB,yCAAyC;AAAA,IAC1C;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,EACR,CAAC;AAAA,EAED,MAAM,GAAG,QAAQ,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EAEjD,IAAI,CAAC,OAAO,SAAS;AAAA,IACpB,QAAQ,KAAK,6CAAkC,OAAO,IAAI;AAAA,IAE1D;AAAA,EACD;AAAA,EAMA,QAAQ,cAAc,eAAe,gBAAgB,MACpD;AAAA,EAED,MAAM,QAAQ,YAAY,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,KAAK,CAAC;AAAA,EACpE,WAAW,QAAQ,OAAO;AAAA,IACzB,MAAM,WAAW,KAAK,WAAW,IAAI;AAAA,IACrC,MAAM,UAAU,aAAa,UAAU,OAAO;AAAA,IAC9C,IAAI,CAAC,QAAQ,SAAS,qBAAqB;AAAA,MAAG;AAAA,IAE9C,MAAM,UAAU,QAAQ,QACvB,mDACA,gFACD;AAAA,IACA,IAAI,YAAY;AAAA,MAAS;AAAA,IAEzB,cAAc,UAAU,OAAO;AAAA,EAChC;AAAA;AAKM,IAAM,wBAAwB,MAAM;AAAA,EAC1C,MAAM,QAAgC,CAAC;AAAA,EACvC,WAAW,aAAa,eAAe;AAAA,IACtC,MAAM,aAAa,eAAe,eAAe,SAAS;AAAA,EAC3D;AAAA,EAEA,OAAO;AAAA;",
|
|
8
|
-
"debugId": "A45F35047E7DD64064756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-c1jfjnka.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
setStreamingSlotCollectionController,
|
|
4
|
-
setStreamingSlotRegistrar
|
|
5
|
-
} from "./chunk-qxq2zcty.js";
|
|
6
|
-
import {
|
|
7
|
-
__require
|
|
8
|
-
} from "./chunk-bmgqm774.js";
|
|
9
|
-
|
|
10
|
-
// src/core/streamingSlotRegistry.ts
|
|
11
|
-
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
12
|
-
var isObjectRecord = (value) => Boolean(value) && typeof value === "object";
|
|
13
|
-
var isAsyncLocalStorage = (value) => isObjectRecord(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
|
14
|
-
var getStorageGlobal = () => {
|
|
15
|
-
const value = Reflect.get(globalThis, STREAMING_SLOT_STORAGE_KEY);
|
|
16
|
-
if (value === null || typeof value === "undefined") {
|
|
17
|
-
return value;
|
|
18
|
-
}
|
|
19
|
-
return isAsyncLocalStorage(value) ? value : undefined;
|
|
20
|
-
};
|
|
21
|
-
var isServerRuntime = () => typeof process !== "undefined" && typeof process.versions?.node === "string";
|
|
22
|
-
var ensureAsyncLocalStorage = async () => {
|
|
23
|
-
const storage = getStorageGlobal();
|
|
24
|
-
if (typeof storage !== "undefined") {
|
|
25
|
-
return storage;
|
|
26
|
-
}
|
|
27
|
-
if (!isServerRuntime()) {
|
|
28
|
-
Reflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, null);
|
|
29
|
-
return getStorageGlobal();
|
|
30
|
-
}
|
|
31
|
-
const mod = await import("async_hooks");
|
|
32
|
-
Reflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, new mod.AsyncLocalStorage);
|
|
33
|
-
return getStorageGlobal();
|
|
34
|
-
};
|
|
35
|
-
var getActiveSlotStore = () => {
|
|
36
|
-
const storage = getStorageGlobal();
|
|
37
|
-
if (!storage)
|
|
38
|
-
return;
|
|
39
|
-
return storage.getStore();
|
|
40
|
-
};
|
|
41
|
-
var registerStreamingSlot = (slot) => {
|
|
42
|
-
const store = getActiveSlotStore();
|
|
43
|
-
if (!store)
|
|
44
|
-
return;
|
|
45
|
-
store.set(slot.id, slot);
|
|
46
|
-
};
|
|
47
|
-
setStreamingSlotRegistrar(registerStreamingSlot);
|
|
48
|
-
setStreamingSlotCollectionController({
|
|
49
|
-
isCollecting: () => getActiveSlotStore() !== undefined
|
|
50
|
-
});
|
|
51
|
-
var hasActiveStreamingSlotRegistry = () => getActiveSlotStore() !== undefined;
|
|
52
|
-
var runWithStreamingSlotRegistry = async (task) => {
|
|
53
|
-
const storage = await ensureAsyncLocalStorage();
|
|
54
|
-
if (!storage) {
|
|
55
|
-
const slots = [];
|
|
56
|
-
return {
|
|
57
|
-
result: await task(),
|
|
58
|
-
slots
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return storage.run(new Map, async () => {
|
|
62
|
-
const result = await task();
|
|
63
|
-
const store = storage.getStore();
|
|
64
|
-
return {
|
|
65
|
-
result,
|
|
66
|
-
slots: store ? [...store.values()] : []
|
|
67
|
-
};
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export { hasActiveStreamingSlotRegistry, runWithStreamingSlotRegistry };
|
|
72
|
-
|
|
73
|
-
//# debugId=78C72EA694A5F2CE64756E2164756E21
|
|
74
|
-
//# sourceMappingURL=chunk-c1jfjnka.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/core/streamingSlotRegistry.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { StreamingSlot } from '../utils/streamingSlots';\nimport {\n\tsetStreamingSlotCollectionController,\n\tsetStreamingSlotRegistrar\n} from './streamingSlotRegistrar';\n\ntype SlotStore = Map<string, StreamingSlot>;\ntype AsyncLocalStorageType =\n\timport('node:async_hooks').AsyncLocalStorage<SlotStore>;\n\nconst STREAMING_SLOT_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotAsyncLocalStorage'\n);\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isAsyncLocalStorage = (value: unknown): value is AsyncLocalStorageType =>\n\tisObjectRecord(value) &&\n\t'getStore' in value &&\n\ttypeof value.getStore === 'function' &&\n\t'run' in value &&\n\ttypeof value.run === 'function';\n\nconst getStorageGlobal = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') {\n\t\treturn value;\n\t}\n\n\treturn isAsyncLocalStorage(value) ? value : undefined;\n};\n\nconst isServerRuntime = () =>\n\ttypeof process !== 'undefined' &&\n\ttypeof process.versions?.node === 'string';\n\nconst ensureAsyncLocalStorage = async () => {\n\tconst storage = getStorageGlobal();\n\tif (typeof storage !== 'undefined') {\n\t\treturn storage;\n\t}\n\tif (!isServerRuntime()) {\n\t\tReflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, null);\n\n\t\treturn getStorageGlobal();\n\t}\n\n\tconst mod = await import('node:async_hooks');\n\tReflect.set(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_STORAGE_KEY,\n\t\tnew mod.AsyncLocalStorage<SlotStore>()\n\t);\n\n\treturn getStorageGlobal();\n};\n\nconst getActiveSlotStore = () => {\n\tconst storage = getStorageGlobal();\n\tif (!storage) return undefined;\n\n\treturn storage.getStore();\n};\n\nconst registerStreamingSlot = (slot: StreamingSlot) => {\n\tconst store = getActiveSlotStore();\n\tif (!store) return;\n\tstore.set(slot.id, slot);\n};\n\nsetStreamingSlotRegistrar(registerStreamingSlot);\nsetStreamingSlotCollectionController({\n\tisCollecting: () => getActiveSlotStore() !== undefined\n});\n\nexport const hasActiveStreamingSlotRegistry = () =>\n\tgetActiveSlotStore() !== undefined;\n\nexport const runWithStreamingSlotRegistry = async <T>(\n\ttask: () => Promise<T> | T\n) => {\n\tconst storage = await ensureAsyncLocalStorage();\n\tif (!storage) {\n\t\tconst slots: StreamingSlot[] = [];\n\n\t\treturn {\n\t\t\tresult: await task(),\n\t\t\tslots\n\t\t};\n\t}\n\n\treturn storage.run(new Map<string, StreamingSlot>(), async () => {\n\t\tconst result = await task();\n\t\tconst store = storage.getStore();\n\n\t\treturn {\n\t\t\tresult,\n\t\t\tslots: store ? [...store.values()] : []\n\t\t};\n\t});\n};\n"
|
|
6
|
-
],
|
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C,cAAc,MAAM,mBAAmB,MAAM;AAC9C,CAAC;AAEM,IAAM,iCAAiC,MAC7C,mBAAmB,MAAM;AAEnB,IAAM,+BAA+B,OAC3C,SACI;AAAA,EACJ,MAAM,UAAU,MAAM,wBAAwB;AAAA,EAC9C,IAAI,CAAC,SAAS;AAAA,IACb,MAAM,QAAyB,CAAC;AAAA,IAEhC,OAAO;AAAA,MACN,QAAQ,MAAM,KAAK;AAAA,MACnB;AAAA,IACD;AAAA,EACD;AAAA,EAEA,OAAO,QAAQ,IAAI,IAAI,KAA8B,YAAY;AAAA,IAChE,MAAM,SAAS,MAAM,KAAK;AAAA,IAC1B,MAAM,QAAQ,QAAQ,SAAS;AAAA,IAE/B,OAAO;AAAA,MACN;AAAA,MACA,OAAO,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC;AAAA,IACvC;AAAA,GACA;AAAA;",
|
|
8
|
-
"debugId": "78C72EA694A5F2CE64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-cbkrwmvh.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
formatTimestamp
|
|
4
|
-
} from "./chunk-gf0ygptk.js";
|
|
5
|
-
|
|
6
|
-
// src/utils/logger.ts
|
|
7
|
-
var colors = {
|
|
8
|
-
blue: "\x1B[34m",
|
|
9
|
-
bold: "\x1B[1m",
|
|
10
|
-
cyan: "\x1B[36m",
|
|
11
|
-
dim: "\x1B[2m",
|
|
12
|
-
green: "\x1B[32m",
|
|
13
|
-
magenta: "\x1B[35m",
|
|
14
|
-
red: "\x1B[31m",
|
|
15
|
-
reset: "\x1B[0m",
|
|
16
|
-
white: "\x1B[37m",
|
|
17
|
-
yellow: "\x1B[33m"
|
|
18
|
-
};
|
|
19
|
-
var frameworkColors = {
|
|
20
|
-
angular: colors.magenta,
|
|
21
|
-
assets: colors.dim,
|
|
22
|
-
css: colors.cyan,
|
|
23
|
-
html: colors.white,
|
|
24
|
-
htmx: colors.white,
|
|
25
|
-
react: colors.blue,
|
|
26
|
-
svelte: colors.yellow,
|
|
27
|
-
vue: colors.green
|
|
28
|
-
};
|
|
29
|
-
var formatPath = (filePath) => {
|
|
30
|
-
const cwd = process.cwd();
|
|
31
|
-
let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
32
|
-
relative = relative.replace(/\\/g, "/");
|
|
33
|
-
if (!relative.startsWith("/")) {
|
|
34
|
-
relative = `/${relative}`;
|
|
35
|
-
}
|
|
36
|
-
return relative;
|
|
37
|
-
};
|
|
38
|
-
var getFrameworkColor = (framework) => frameworkColors[framework] || colors.white;
|
|
39
|
-
var log = (action, options) => {
|
|
40
|
-
const timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;
|
|
41
|
-
const tag = `${colors.cyan}[hmr]${colors.reset}`;
|
|
42
|
-
let message = action;
|
|
43
|
-
if (options?.path) {
|
|
44
|
-
const pathColor = options.framework ? getFrameworkColor(options.framework) : colors.white;
|
|
45
|
-
message += ` ${pathColor}${formatPath(options.path)}${colors.reset}`;
|
|
46
|
-
}
|
|
47
|
-
if (options?.duration !== undefined) {
|
|
48
|
-
message += ` ${colors.dim}(${options.duration}ms)${colors.reset}`;
|
|
49
|
-
}
|
|
50
|
-
console.log(`${timestamp} ${tag} ${message}`);
|
|
51
|
-
};
|
|
52
|
-
var logCssUpdate = (path, framework, duration) => {
|
|
53
|
-
log("css update", { duration, framework: framework ?? "css", path });
|
|
54
|
-
};
|
|
55
|
-
var logError = (message, error) => {
|
|
56
|
-
const timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;
|
|
57
|
-
const tag = `${colors.red}[hmr]${colors.reset}`;
|
|
58
|
-
const errorMsg = error instanceof Error ? error.message : error;
|
|
59
|
-
const fullMessage = `${colors.red}error${colors.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
|
|
60
|
-
console.error(`${timestamp} ${tag} ${fullMessage}`);
|
|
61
|
-
};
|
|
62
|
-
var logHmrUpdate = (path, framework, duration) => {
|
|
63
|
-
log("hmr update", { duration, framework, path });
|
|
64
|
-
};
|
|
65
|
-
var logScriptUpdate = (path, framework, duration) => {
|
|
66
|
-
log("script update", { duration, framework, path });
|
|
67
|
-
};
|
|
68
|
-
var logServerReload = () => {
|
|
69
|
-
log(`${colors.cyan}server module reloaded${colors.reset}`);
|
|
70
|
-
};
|
|
71
|
-
var logWarn = (message) => {
|
|
72
|
-
const timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;
|
|
73
|
-
const tag = `${colors.yellow}[hmr]${colors.reset}`;
|
|
74
|
-
console.log(`${timestamp} ${tag} ${colors.yellow}warning ${message}${colors.reset}`);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export { logCssUpdate, logError, logHmrUpdate, logScriptUpdate, logServerReload, logWarn };
|
|
78
|
-
|
|
79
|
-
//# debugId=B519580838AE15A464756E2164756E21
|
|
80
|
-
//# sourceMappingURL=chunk-cbkrwmvh.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/utils/logger.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * Centralized logger utility for AbsoluteJS\n * Provides formatted output with ANSI colors and timestamps\n */\n\nimport { formatTimestamp, startupBanner } from './startupBanner';\n\nexport { formatTimestamp };\n\n// ANSI color codes\nconst colors = {\n\tblue: '\\x1b[34m',\n\tbold: '\\x1b[1m',\n\t// Core colors\n\tcyan: '\\x1b[36m',\n\tdim: '\\x1b[2m',\n\tgreen: '\\x1b[32m',\n\tmagenta: '\\x1b[35m',\n\tred: '\\x1b[31m',\n\treset: '\\x1b[0m',\n\twhite: '\\x1b[37m',\n\tyellow: '\\x1b[33m'\n} as const;\n\n// Framework color mapping\nconst frameworkColors: Record<string, string> = {\n\tangular: colors.magenta,\n\tassets: colors.dim,\n\tcss: colors.cyan,\n\thtml: colors.white,\n\thtmx: colors.white,\n\treact: colors.blue,\n\tsvelte: colors.yellow,\n\tvue: colors.green\n};\n\n/**\n * Format a file path for display (relative, clean)\n */\nconst formatPath = (filePath: string) => {\n\tconst cwd = process.cwd();\n\tlet relative = filePath.startsWith(cwd)\n\t\t? filePath.slice(cwd.length + 1)\n\t\t: filePath;\n\t// Normalize slashes\n\trelative = relative.replace(/\\\\/g, '/');\n\t// Ensure it starts with /\n\tif (!relative.startsWith('/')) {\n\t\trelative = `/${relative}`;\n\t}\n\n\treturn relative;\n};\n\n/**\n * Get color for a framework\n */\nconst getFrameworkColor = (framework: string) =>\n\tframeworkColors[framework] || colors.white;\n\n/**\n * Core logging function\n */\nconst log = (\n\taction: string,\n\toptions?: {\n\t\tframework?: string;\n\t\tduration?: number;\n\t\tpath?: string;\n\t\tcolor?: string;\n\t}\n) => {\n\tconst timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;\n\tconst tag = `${colors.cyan}[hmr]${colors.reset}`;\n\n\tlet message = action;\n\n\t// Apply framework color to path if present\n\tif (options?.path) {\n\t\tconst pathColor = options.framework\n\t\t\t? getFrameworkColor(options.framework)\n\t\t\t: colors.white;\n\t\tmessage += ` ${pathColor}${formatPath(options.path)}${colors.reset}`;\n\t}\n\n\t// Add duration if present\n\tif (options?.duration !== undefined) {\n\t\tmessage += ` ${colors.dim}(${options.duration}ms)${colors.reset}`;\n\t}\n\n\tconsole.log(`${timestamp} ${tag} ${message}`);\n};\n\n/**\n * Startup banner\n */\nexport const logReady = startupBanner;\n\n/**\n * CSS update message\n * Format: \"10:30:45 AM [hmr] css update /styles/main.css (125ms)\"\n */\nexport const logCssUpdate = (\n\tpath: string,\n\tframework?: string,\n\tduration?: number\n) => {\n\tlog('css update', { duration, framework: framework ?? 'css', path });\n};\n\n/**\n * Build error\n * Format: \"10:30:45 AM [hmr] error Build failed: ...\"\n */\nexport const logError = (message: string, error?: Error | string) => {\n\tconst timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;\n\tconst tag = `${colors.red}[hmr]${colors.reset}`;\n\tconst errorMsg = error instanceof Error ? error.message : error;\n\tconst fullMessage = `${colors.red}error${colors.reset} ${message}${errorMsg ? `: ${errorMsg}` : ''}`;\n\tconsole.error(`${timestamp} ${tag} ${fullMessage}`);\n};\n\n/**\n * HMR update message\n * Format: \"10:30:45 AM [hmr] hmr update /pages/App.tsx\"\n */\nexport const logHmrUpdate = (\n\tpath: string,\n\tframework?: string,\n\tduration?: number\n) => {\n\tlog('hmr update', { duration, framework, path });\n};\n\n/**\n * Generic info message\n */\nexport const logInfo = (message: string) => {\n\tlog(message);\n};\n\n/**\n * Page reload message\n * Format: \"10:30:45 AM [hmr] page reload /src/App.tsx (125ms)\"\n */\nexport const logPageReload = (\n\tpath: string,\n\tframework?: string,\n\tduration?: number\n) => {\n\tlog('page reload', { duration, framework, path });\n};\n\n/**\n * Script update message\n * Format: \"10:30:45 AM [hmr] script update /scripts/counter.ts (125ms)\"\n */\nexport const logScriptUpdate = (\n\tpath: string,\n\tframework?: string,\n\tduration?: number\n) => {\n\tlog('script update', { duration, framework, path });\n};\n\n/**\n * Server module reloaded (Bun --hot triggered a server-side change)\n */\nexport const logServerReload = () => {\n\tlog(`${colors.cyan}server module reloaded${colors.reset}`);\n};\n\n/**\n * Warning message\n * Format: \"10:30:45 AM [hmr] warning ...\"\n */\nexport const logWarn = (message: string) => {\n\tconst timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;\n\tconst tag = `${colors.yellow}[hmr]${colors.reset}`;\n\tconsole.log(\n\t\t`${timestamp} ${tag} ${colors.yellow}warning ${message}${colors.reset}`\n\t);\n};\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;;;;;AAUA,IAAM,SAAS;AAAA,EACd,MAAM;AAAA,EACN,MAAM;AAAA,EAEN,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP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D,IAAM,WAAW,CAAC,SAAiB,UAA2B;AAAA,EACpE,MAAM,YAAY,GAAG,OAAO,MAAM,gBAAgB,IAAI,OAAO;AAAA,EAC7D,MAAM,MAAM,GAAG,OAAO,WAAW,OAAO;AAAA,EACxC,MAAM,WAAW,iBAAiB,QAAQ,MAAM,UAAU;AAAA,EAC1D,MAAM,cAAc,GAAG,OAAO,WAAW,OAAO,SAAS,UAAU,WAAW,KAAK,aAAa;AAAA,EAChG,QAAQ,MAAM,GAAG,aAAa,OAAO,aAAa;AAAA;AAO5C,IAAM,eAAe,CAC3B,MACA,WACA,aACI;AAAA,EACJ,IAAI,cAAc,EAAE,UAAU,WAAW,KAAK,CAAC;AAAA;AA0BzC,IAAM,kBAAkB,CAC9B,MACA,WACA,aACI;AAAA,EACJ,IAAI,iBAAiB,EAAE,UAAU,WAAW,KAAK,CAAC;AAAA;AAM5C,IAAM,kBAAkB,MAAM;AAAA,EACpC,IAAI,GAAG,OAAO,6BAA6B,OAAO,OAAO;AAAA;AAOnD,IAAM,UAAU,CAAC,YAAoB;AAAA,EAC3C,MAAM,YAAY,GAAG,OAAO,MAAM,gBAAgB,IAAI,OAAO;AAAA,EAC7D,MAAM,MAAM,GAAG,OAAO,cAAc,OAAO;AAAA,EAC3C,QAAQ,IACP,GAAG,aAAa,OAAO,OAAO,iBAAiB,UAAU,OAAO,OACjE;AAAA;",
|
|
8
|
-
"debugId": "B519580838AE15A464756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-cdxd7sy2.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
__require
|
|
4
|
-
} from "./chunk-bmgqm774.js";
|
|
5
|
-
|
|
6
|
-
// src/build/buildSvelteVendor.ts
|
|
7
|
-
import { mkdirSync } from "fs";
|
|
8
|
-
import { join } from "path";
|
|
9
|
-
import { rm } from "fs/promises";
|
|
10
|
-
var {build: bunBuild } = globalThis.Bun;
|
|
11
|
-
var svelteSpecifiers = [
|
|
12
|
-
"svelte",
|
|
13
|
-
"svelte/internal",
|
|
14
|
-
"svelte/internal/flags/async",
|
|
15
|
-
"svelte/internal/flags/legacy",
|
|
16
|
-
"svelte/internal/client",
|
|
17
|
-
"svelte/internal/disclose-version",
|
|
18
|
-
"svelte/store"
|
|
19
|
-
];
|
|
20
|
-
var isResolvable = (specifier) => {
|
|
21
|
-
try {
|
|
22
|
-
__require.resolve(specifier);
|
|
23
|
-
return true;
|
|
24
|
-
} catch {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var resolveVendorSpecifiers = () => svelteSpecifiers.filter(isResolvable);
|
|
29
|
-
var toSafeFileName = (specifier) => specifier.replace(/\//g, "_");
|
|
30
|
-
var buildSvelteVendor = async (buildDir) => {
|
|
31
|
-
const specifiers = resolveVendorSpecifiers();
|
|
32
|
-
if (specifiers.length === 0)
|
|
33
|
-
return;
|
|
34
|
-
const vendorDir = join(buildDir, "svelte", "vendor");
|
|
35
|
-
mkdirSync(vendorDir, { recursive: true });
|
|
36
|
-
const tmpDir = join(buildDir, "_svelte_vendor_tmp");
|
|
37
|
-
mkdirSync(tmpDir, { recursive: true });
|
|
38
|
-
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
39
|
-
const safeName = toSafeFileName(specifier);
|
|
40
|
-
const entryPath = join(tmpDir, `${safeName}.ts`);
|
|
41
|
-
await Bun.write(entryPath, `export * from '${specifier}';
|
|
42
|
-
`);
|
|
43
|
-
return entryPath;
|
|
44
|
-
}));
|
|
45
|
-
const result = await bunBuild({
|
|
46
|
-
entrypoints,
|
|
47
|
-
format: "esm",
|
|
48
|
-
minify: false,
|
|
49
|
-
naming: "[name].[ext]",
|
|
50
|
-
outdir: vendorDir,
|
|
51
|
-
splitting: true,
|
|
52
|
-
target: "browser",
|
|
53
|
-
throw: false
|
|
54
|
-
});
|
|
55
|
-
await rm(tmpDir, { force: true, recursive: true });
|
|
56
|
-
if (!result.success) {
|
|
57
|
-
console.warn("\u26A0\uFE0F Svelte vendor build had errors:", result.logs);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var computeSvelteVendorPaths = () => {
|
|
61
|
-
const paths = {};
|
|
62
|
-
for (const specifier of resolveVendorSpecifiers()) {
|
|
63
|
-
paths[specifier] = `/svelte/vendor/${toSafeFileName(specifier)}.js`;
|
|
64
|
-
}
|
|
65
|
-
return paths;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export { buildSvelteVendor, computeSvelteVendorPaths };
|
|
69
|
-
|
|
70
|
-
//# debugId=B465899347FB214664756E2164756E21
|
|
71
|
-
//# sourceMappingURL=chunk-cdxd7sy2.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/build/buildSvelteVendor.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { mkdirSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { rm } from 'node:fs/promises';\nimport { build as bunBuild } from 'bun';\n\n/** Bare specifiers that need stable vendor builds for Svelte.\n * Svelte 5 compiled output imports from svelte/internal/client\n * for the client-side runtime. */\nconst svelteSpecifiers = [\n\t'svelte',\n\t'svelte/internal',\n\t'svelte/internal/flags/async',\n\t'svelte/internal/flags/legacy',\n\t'svelte/internal/client',\n\t'svelte/internal/disclose-version',\n\t'svelte/store'\n];\n\nconst isResolvable = (specifier: string) => {\n\ttry {\n\t\trequire.resolve(specifier);\n\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n/** Resolve which Svelte specifiers are actually installed */\nconst resolveVendorSpecifiers = () =>\n\tsvelteSpecifiers.filter(isResolvable);\n\n/** Convert a bare specifier to a safe filename: svelte/internal/client → svelte_internal_client */\nconst toSafeFileName = (specifier: string) =>\n\tspecifier.replace(/\\//g, '_');\n\n/** Build Svelte packages into stable vendor files (no content hash).\n * Output goes to {buildDir}/svelte/vendor/ with predictable names. */\nexport const buildSvelteVendor = async (buildDir: string) => {\n\tconst specifiers = resolveVendorSpecifiers();\n\tif (specifiers.length === 0) return;\n\n\tconst vendorDir = join(buildDir, 'svelte', 'vendor');\n\tmkdirSync(vendorDir, { recursive: true });\n\n\tconst tmpDir = join(buildDir, '_svelte_vendor_tmp');\n\tmkdirSync(tmpDir, { recursive: true });\n\n\tconst entrypoints = await Promise.all(\n\t\tspecifiers.map(async (specifier) => {\n\t\t\tconst safeName = toSafeFileName(specifier);\n\t\t\tconst entryPath = join(tmpDir, `${safeName}.ts`);\n\t\t\tawait Bun.write(entryPath, `export * from '${specifier}';\\n`);\n\n\t\t\treturn entryPath;\n\t\t})\n\t);\n\n\tconst result = await bunBuild({\n\t\tentrypoints,\n\t\tformat: 'esm',\n\t\tminify: false,\n\t\tnaming: '[name].[ext]',\n\t\toutdir: vendorDir,\n\t\tsplitting: true,\n\t\ttarget: 'browser',\n\t\tthrow: false\n\t});\n\n\tawait rm(tmpDir, { force: true, recursive: true });\n\n\tif (!result.success) {\n\t\tconsole.warn('⚠️ Svelte vendor build had errors:', result.logs);\n\t}\n};\n\n/** Compute the deterministic vendor paths mapping (no build needed).\n * This can be called before vendor files exist on disk. */\nexport const computeSvelteVendorPaths = () => {\n\tconst paths: Record<string, string> = {};\n\tfor (const specifier of resolveVendorSpecifiers()) {\n\t\tpaths[specifier] = `/svelte/vendor/${toSafeFileName(specifier)}.js`;\n\t}\n\n\treturn paths;\n};\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;;;;;AAAA;AACA;AACA;AACA;AAKA,IAAM,mBAAmB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAM,eAAe,CAAC,cAAsB;AAAA,EAC3C,IAAI;AAAA,IACH,kBAAgB,SAAS;AAAA,IAEzB,OAAO;AAAA,IACN,MAAM;AAAA,IACP,OAAO;AAAA;AAAA;AAKT,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|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-cg95827x.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
normalizePath
|
|
4
|
-
} from "./chunk-hyjs4bqs.js";
|
|
5
|
-
|
|
6
|
-
// src/utils/validateSafePath.ts
|
|
7
|
-
import { resolve, relative } from "path";
|
|
8
|
-
var validateSafePath = (targetPath, baseDirectory) => {
|
|
9
|
-
const absoluteBase = resolve(baseDirectory);
|
|
10
|
-
const absoluteTarget = resolve(baseDirectory, targetPath);
|
|
11
|
-
const relativePath = normalizePath(relative(absoluteBase, absoluteTarget));
|
|
12
|
-
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
13
|
-
throw new Error(`Unsafe path: ${targetPath}`);
|
|
14
|
-
}
|
|
15
|
-
return absoluteTarget;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { validateSafePath };
|
|
19
|
-
|
|
20
|
-
//# debugId=ACF897EC8658AF9664756E2164756E21
|
|
21
|
-
//# sourceMappingURL=chunk-cg95827x.js.map
|