@absolutejs/absolute 0.19.0-beta.808 → 0.19.0-beta.809
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +1100 -40
- 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/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-0kdc6r16.js +0 -20
- package/dist/chunk-0kdc6r16.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-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-38jwhqcw.js +0 -4410
- package/dist/chunk-38jwhqcw.js.map +0 -28
- package/dist/chunk-3g91wb4f.js +0 -358
- package/dist/chunk-3g91wb4f.js.map +0 -10
- 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-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-8qqxc1h2.js +0 -426
- package/dist/chunk-8qqxc1h2.js.map +0 -14
- 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-94gvx0hg.js +0 -28
- package/dist/chunk-94gvx0hg.js.map +0 -10
- package/dist/chunk-9c5tj4k3.js +0 -130
- package/dist/chunk-9c5tj4k3.js.map +0 -10
- 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-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-cwfy538a.js +0 -51
- package/dist/chunk-cwfy538a.js.map +0 -9
- package/dist/chunk-d7mwkzry.js +0 -261
- package/dist/chunk-d7mwkzry.js.map +0 -10
- package/dist/chunk-d8w0qm28.js +0 -184
- package/dist/chunk-d8w0qm28.js.map +0 -11
- 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-ff70rnhd.js +0 -672
- package/dist/chunk-ff70rnhd.js.map +0 -15
- 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-j88z31ep.js +0 -25
- package/dist/chunk-j88z31ep.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-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-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-wwzvp0zn.js +0 -192
- package/dist/chunk-wwzvp0zn.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
package/dist/chunk-h6mye9r3.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./chunk-bmgqm774.js";
|
|
3
|
-
|
|
4
|
-
// src/utils/generateSitemap.ts
|
|
5
|
-
var {write } = globalThis.Bun;
|
|
6
|
-
var DEFAULT_PRIORITY = 0.8;
|
|
7
|
-
var escapeXml = (str) => str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
8
|
-
var isExcluded = (path, patterns) => {
|
|
9
|
-
for (const pattern of patterns) {
|
|
10
|
-
if (typeof pattern === "string" && path === pattern)
|
|
11
|
-
return true;
|
|
12
|
-
if (pattern instanceof RegExp && pattern.test(path))
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
return false;
|
|
16
|
-
};
|
|
17
|
-
var PAGE_HANDLER_NAMES = [
|
|
18
|
-
"handleReactPageRequest",
|
|
19
|
-
"handleSveltePageRequest",
|
|
20
|
-
"handleVuePageRequest",
|
|
21
|
-
"handleAngularPageRequest",
|
|
22
|
-
"handleHTMLPageRequest",
|
|
23
|
-
"handleHTMXPageRequest"
|
|
24
|
-
];
|
|
25
|
-
var isPageHandler = (handler) => {
|
|
26
|
-
if (typeof handler !== "function")
|
|
27
|
-
return false;
|
|
28
|
-
const source = handler.toString();
|
|
29
|
-
return PAGE_HANDLER_NAMES.some((name) => source.includes(name));
|
|
30
|
-
};
|
|
31
|
-
var discoverPageRoutes = (routes, exclude) => {
|
|
32
|
-
const seen = new Set;
|
|
33
|
-
return routes.filter((route) => {
|
|
34
|
-
if (route.method !== "GET")
|
|
35
|
-
return false;
|
|
36
|
-
if (route.path.includes("*") || route.path.includes(":"))
|
|
37
|
-
return false;
|
|
38
|
-
if (seen.has(route.path))
|
|
39
|
-
return false;
|
|
40
|
-
if (isExcluded(route.path, exclude))
|
|
41
|
-
return false;
|
|
42
|
-
if (!isPageHandler(route.handler))
|
|
43
|
-
return false;
|
|
44
|
-
seen.add(route.path);
|
|
45
|
-
return true;
|
|
46
|
-
}).map((route) => route.path);
|
|
47
|
-
};
|
|
48
|
-
var buildSitemapXml = (pageRoutes, baseUrl, config) => {
|
|
49
|
-
const normalizedBase = baseUrl.replace(/\/$/, "");
|
|
50
|
-
const entries = [];
|
|
51
|
-
for (const path of pageRoutes) {
|
|
52
|
-
const override = config.overrides?.[path];
|
|
53
|
-
const changefreq = override?.changefreq ?? config.defaultChangefreq ?? "weekly";
|
|
54
|
-
const priority = override?.priority ?? config.defaultPriority ?? DEFAULT_PRIORITY;
|
|
55
|
-
const lastmod = override?.lastmod;
|
|
56
|
-
const url = escapeXml(`${normalizedBase}${path}`);
|
|
57
|
-
let entry = ` <url>
|
|
58
|
-
<loc>${url}</loc>`;
|
|
59
|
-
if (lastmod)
|
|
60
|
-
entry += `
|
|
61
|
-
<lastmod>${lastmod}</lastmod>`;
|
|
62
|
-
entry += `
|
|
63
|
-
<changefreq>${changefreq}</changefreq>`;
|
|
64
|
-
entry += `
|
|
65
|
-
<priority>${priority}</priority>`;
|
|
66
|
-
entry += `
|
|
67
|
-
</url>`;
|
|
68
|
-
entries.push(entry);
|
|
69
|
-
}
|
|
70
|
-
return [
|
|
71
|
-
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
72
|
-
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
|
|
73
|
-
...entries,
|
|
74
|
-
"</urlset>"
|
|
75
|
-
].join(`
|
|
76
|
-
`);
|
|
77
|
-
};
|
|
78
|
-
var generateSitemap = async (routes, serverUrl, outDir, config = {}) => {
|
|
79
|
-
const exclude = config.exclude ?? [];
|
|
80
|
-
const discoveredRoutes = discoverPageRoutes(routes, exclude);
|
|
81
|
-
const dynamicRoutes = config.routes ? await config.routes() : [];
|
|
82
|
-
const filteredDynamic = dynamicRoutes.filter((path) => !isExcluded(path, exclude));
|
|
83
|
-
const allRoutes = [...discoveredRoutes, ...filteredDynamic];
|
|
84
|
-
const baseUrl = config.baseUrl ?? serverUrl;
|
|
85
|
-
const xml = buildSitemapXml(allRoutes, baseUrl, config);
|
|
86
|
-
await write(`${outDir}/sitemap.xml`, xml);
|
|
87
|
-
};
|
|
88
|
-
export {
|
|
89
|
-
generateSitemap
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
//# debugId=7BD7FD53AB9DEADD64756E2164756E21
|
|
93
|
-
//# sourceMappingURL=chunk-h6mye9r3.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/utils/generateSitemap.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { write } from 'bun';\nimport type { SitemapConfig } from '../../types/sitemap';\n\nconst DEFAULT_PRIORITY = 0.8;\n\nconst escapeXml = (str: string) =>\n\tstr\n\t\t.replace(/&/g, '&')\n\t\t.replace(/</g, '<')\n\t\t.replace(/>/g, '>')\n\t\t.replace(/\"/g, '"')\n\t\t.replace(/'/g, ''');\n\nconst isExcluded = (path: string, patterns: (string | RegExp)[]) => {\n\tfor (const pattern of patterns) {\n\t\tif (typeof pattern === 'string' && path === pattern) return true;\n\t\tif (pattern instanceof RegExp && pattern.test(path)) return true;\n\t}\n\n\treturn false;\n};\n\nconst PAGE_HANDLER_NAMES = [\n\t'handleReactPageRequest',\n\t'handleSveltePageRequest',\n\t'handleVuePageRequest',\n\t'handleAngularPageRequest',\n\t'handleHTMLPageRequest',\n\t'handleHTMXPageRequest'\n];\n\nconst isPageHandler = (handler: unknown) => {\n\tif (typeof handler !== 'function') return false;\n\tconst source = handler.toString();\n\n\treturn PAGE_HANDLER_NAMES.some((name) => source.includes(name));\n};\n\nconst discoverPageRoutes = (\n\troutes: { method: string; path: string; handler?: unknown }[],\n\texclude: (string | RegExp)[]\n) => {\n\tconst seen = new Set<string>();\n\n\treturn routes\n\t\t.filter((route) => {\n\t\t\tif (route.method !== 'GET') return false;\n\t\t\tif (route.path.includes('*') || route.path.includes(':'))\n\t\t\t\treturn false;\n\t\t\tif (seen.has(route.path)) return false;\n\t\t\tif (isExcluded(route.path, exclude)) return false;\n\t\t\tif (!isPageHandler(route.handler)) return false;\n\n\t\t\tseen.add(route.path);\n\n\t\t\treturn true;\n\t\t})\n\t\t.map((route) => route.path);\n};\n\nconst buildSitemapXml = (\n\tpageRoutes: string[],\n\tbaseUrl: string,\n\tconfig: SitemapConfig\n) => {\n\tconst normalizedBase = baseUrl.replace(/\\/$/, '');\n\tconst entries: string[] = [];\n\n\tfor (const path of pageRoutes) {\n\t\tconst override = config.overrides?.[path];\n\t\tconst changefreq =\n\t\t\toverride?.changefreq ?? config.defaultChangefreq ?? 'weekly';\n\t\tconst priority =\n\t\t\toverride?.priority ?? config.defaultPriority ?? DEFAULT_PRIORITY;\n\t\tconst lastmod = override?.lastmod;\n\t\tconst url = escapeXml(`${normalizedBase}${path}`);\n\n\t\tlet entry = ` <url>\\n <loc>${url}</loc>`;\n\n\t\tif (lastmod) entry += `\\n <lastmod>${lastmod}</lastmod>`;\n\n\t\tentry += `\\n <changefreq>${changefreq}</changefreq>`;\n\t\tentry += `\\n <priority>${priority}</priority>`;\n\t\tentry += '\\n </url>';\n\n\t\tentries.push(entry);\n\t}\n\n\treturn [\n\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>',\n\t\t'<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">',\n\t\t...entries,\n\t\t'</urlset>'\n\t].join('\\n');\n};\n\nexport const generateSitemap = async (\n\troutes: { method: string; path: string; handler?: unknown }[],\n\tserverUrl: string,\n\toutDir: string,\n\tconfig: SitemapConfig = {}\n) => {\n\tconst exclude = config.exclude ?? [];\n\tconst discoveredRoutes = discoverPageRoutes(routes, exclude);\n\n\tconst dynamicRoutes = config.routes ? await config.routes() : [];\n\tconst filteredDynamic = dynamicRoutes.filter(\n\t\t(path) => !isExcluded(path, exclude)\n\t);\n\n\tconst allRoutes = [...discoveredRoutes, ...filteredDynamic];\n\tconst baseUrl = config.baseUrl ?? serverUrl;\n\tconst xml = buildSitemapXml(allRoutes, baseUrl, config);\n\n\tawait write(`${outDir}/sitemap.xml`, xml);\n};\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;;;AAAA;AAGA,IAAM,mBAAmB;AAEzB,IAAM,YAAY,CAAC,QAClB,IACE,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,QAAQ;AAEzB,IAAM,aAAa,CAAC,MAAc,aAAkC;AAAA,EACnE,WAAW,WAAW,UAAU;AAAA,IAC/B,IAAI,OAAO,YAAY,YAAY,SAAS;AAAA,MAAS,OAAO;AAAA,IAC5D,IAAI,mBAAmB,UAAU,QAAQ,KAAK,IAAI;AAAA,MAAG,OAAO;AAAA,EAC7D;AAAA,EAEA,OAAO;AAAA;AAGR,IAAM,qBAAqB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAM,gBAAgB,CAAC,YAAqB;AAAA,EAC3C,IA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SAAS;AAAA;AAAA,IAET,QAAQ,KAAK,KAAK;AAAA,EACnB;AAAA,EAEA,OAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA,GAAG;AAAA,IACH;AAAA,EACD,EAAE,KAAK;AAAA,CAAI;AAAA;AAGL,IAAM,kBAAkB,OAC9B,QACA,WACA,QACA,SAAwB,CAAC,MACrB;AAAA,EACJ,MAAM,UAAU,OAAO,WAAW,CAAC;AAAA,EACnC,MAAM,mBAAmB,mBAAmB,QAAQ,OAAO;AAAA,EAE3D,MAAM,gBAAgB,OAAO,SAAS,MAAM,OAAO,OAAO,IAAI,CAAC;AAAA,EAC/D,MAAM,kBAAkB,cAAc,OACrC,CAAC,SAAS,CAAC,WAAW,MAAM,OAAO,CACpC;AAAA,EAEA,MAAM,YAAY,CAAC,GAAG,kBAAkB,GAAG,eAAe;AAAA,EAC1D,MAAM,UAAU,OAAO,WAAW;AAAA,EAClC,MAAM,MAAM,gBAAgB,WAAW,SAAS,MAAM;AAAA,EAEtD,MAAM,MAAM,GAAG,sBAAsB,GAAG;AAAA;",
|
|
8
|
-
"debugId": "7BD7FD53AB9DEADD64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-hcsmxw1v.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
nativeRewriteImports
|
|
4
|
-
} from "./chunk-jn91vzkh.js";
|
|
5
|
-
|
|
6
|
-
// src/build/rewriteReactImports.ts
|
|
7
|
-
var escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
8
|
-
var rewriterCache = new Map;
|
|
9
|
-
var cacheKey = (vendorPaths) => {
|
|
10
|
-
const entries = Object.entries(vendorPaths).sort(([left], [right]) => left.localeCompare(right));
|
|
11
|
-
let key = "";
|
|
12
|
-
for (const [k, v] of entries) {
|
|
13
|
-
key += `${k}\x00${v}\x00`;
|
|
14
|
-
}
|
|
15
|
-
return key;
|
|
16
|
-
};
|
|
17
|
-
var getOrCompileRewriter = (vendorPaths) => {
|
|
18
|
-
const key = cacheKey(vendorPaths);
|
|
19
|
-
const cached = rewriterCache.get(key);
|
|
20
|
-
if (cached)
|
|
21
|
-
return cached;
|
|
22
|
-
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
23
|
-
const lookup = new Map(replacements);
|
|
24
|
-
const alt = replacements.map(([spec]) => escapeRegex(spec)).join("|");
|
|
25
|
-
const fromRegex = new RegExp(`(from\\s*["'])(${alt})(["'])`, "g");
|
|
26
|
-
const sideEffectRegex = new RegExp(`(import\\s*["'])(${alt})(["']\\s*;?)`, "g");
|
|
27
|
-
const dynamicRegex = new RegExp(`(import\\s*\\(\\s*["'])(${alt})(["']\\s*\\))`, "g");
|
|
28
|
-
const rewriter = {
|
|
29
|
-
dynamicRegex,
|
|
30
|
-
fromRegex,
|
|
31
|
-
lookup,
|
|
32
|
-
sideEffectRegex
|
|
33
|
-
};
|
|
34
|
-
rewriterCache.set(key, rewriter);
|
|
35
|
-
return rewriter;
|
|
36
|
-
};
|
|
37
|
-
var applyAllReplacements = (content, rewriter) => {
|
|
38
|
-
const replacer = (_match, prefix, specifier, suffix) => {
|
|
39
|
-
const webPath = rewriter.lookup.get(specifier);
|
|
40
|
-
if (!webPath)
|
|
41
|
-
return _match;
|
|
42
|
-
return `${prefix}${webPath}${suffix}`;
|
|
43
|
-
};
|
|
44
|
-
rewriter.fromRegex.lastIndex = 0;
|
|
45
|
-
rewriter.sideEffectRegex.lastIndex = 0;
|
|
46
|
-
rewriter.dynamicRegex.lastIndex = 0;
|
|
47
|
-
let result = content;
|
|
48
|
-
result = result.replace(rewriter.fromRegex, replacer);
|
|
49
|
-
result = result.replace(rewriter.sideEffectRegex, replacer);
|
|
50
|
-
result = result.replace(rewriter.dynamicRegex, replacer);
|
|
51
|
-
return result;
|
|
52
|
-
};
|
|
53
|
-
var REFRESH_STUBS = "window.$RefreshReg$||(window.$RefreshReg$=function(){});" + `window.$RefreshSig$||(window.$RefreshSig$=function(){return function(t){return t}});
|
|
54
|
-
`;
|
|
55
|
-
var patchRefreshGlobals = async (outputPaths) => {
|
|
56
|
-
const jsFiles = outputPaths.filter((path) => path.endsWith(".js"));
|
|
57
|
-
await Promise.all(jsFiles.map(async (filePath) => {
|
|
58
|
-
const content = await Bun.file(filePath).text();
|
|
59
|
-
if (!content.includes("$RefreshReg$(") && !content.includes("$RefreshSig$("))
|
|
60
|
-
return;
|
|
61
|
-
if (content.startsWith("window.$RefreshReg$"))
|
|
62
|
-
return;
|
|
63
|
-
await Bun.write(filePath, REFRESH_STUBS + content);
|
|
64
|
-
}));
|
|
65
|
-
};
|
|
66
|
-
var rewriteReactImports = async (outputPaths, vendorPaths) => {
|
|
67
|
-
const jsFiles = outputPaths.filter((path) => path.endsWith(".js"));
|
|
68
|
-
if (jsFiles.length === 0)
|
|
69
|
-
return;
|
|
70
|
-
const rewriter = getOrCompileRewriter(vendorPaths);
|
|
71
|
-
const replacements = Object.entries(vendorPaths).sort(([keyA], [keyB]) => keyB.length - keyA.length);
|
|
72
|
-
await Promise.all(jsFiles.map(async (filePath) => {
|
|
73
|
-
const original = await Bun.file(filePath).text();
|
|
74
|
-
const native = nativeRewriteImports(original, replacements);
|
|
75
|
-
const content = native ?? applyAllReplacements(original, rewriter);
|
|
76
|
-
if (content !== original) {
|
|
77
|
-
await Bun.write(filePath, content);
|
|
78
|
-
}
|
|
79
|
-
}));
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export { patchRefreshGlobals, rewriteReactImports };
|
|
83
|
-
|
|
84
|
-
//# debugId=E11DB2F08438174D64756E2164756E21
|
|
85
|
-
//# sourceMappingURL=chunk-hcsmxw1v.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/build/rewriteReactImports.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/** Post-process bundled output files to rewrite bare React specifiers\n * (e.g. `from \"react\"`) to stable vendor paths (e.g. `from \"/vendor/react.js\"`).\n *\n * Uses native Zig scanner when available (15x faster on large files),\n * falls back to JS regex on Windows or when native addon is missing. */\n\nimport { nativeRewriteImports } from './nativeRewrite';\n\nconst escapeRegex = (str: string) =>\n\tstr.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\ntype CompiledRewriter = {\n\tfromRegex: RegExp;\n\tsideEffectRegex: RegExp;\n\tdynamicRegex: RegExp;\n\tlookup: Map<string, string>;\n};\n\nconst rewriterCache = new Map<string, CompiledRewriter>();\n\nconst cacheKey = (vendorPaths: Record<string, string>) => {\n\tconst entries = Object.entries(vendorPaths).sort(\n\t\t([left], [right]) => left.localeCompare(right)\n\t);\n\tlet key = '';\n\tfor (const [k, v] of entries) {\n\t\tkey += `${k}\\0${v}\\0`;\n\t}\n\n\treturn key;\n};\n\nconst getOrCompileRewriter = (vendorPaths: Record<string, string>) => {\n\tconst key = cacheKey(vendorPaths);\n\tconst cached = rewriterCache.get(key);\n\tif (cached) return cached;\n\n\tconst replacements = Object.entries(vendorPaths).sort(\n\t\t([keyA], [keyB]) => keyB.length - keyA.length\n\t);\n\n\tconst lookup = new Map<string, string>(replacements);\n\tconst alt = replacements.map(([spec]) => escapeRegex(spec)).join('|');\n\n\tconst fromRegex = new RegExp(`(from\\\\s*[\"'])(${alt})([\"'])`, 'g');\n\tconst sideEffectRegex = new RegExp(\n\t\t`(import\\\\s*[\"'])(${alt})([\"']\\\\s*;?)`,\n\t\t'g'\n\t);\n\tconst dynamicRegex = new RegExp(\n\t\t`(import\\\\s*\\\\(\\\\s*[\"'])(${alt})([\"']\\\\s*\\\\))`,\n\t\t'g'\n\t);\n\n\tconst rewriter: CompiledRewriter = {\n\t\tdynamicRegex,\n\t\tfromRegex,\n\t\tlookup,\n\t\tsideEffectRegex\n\t};\n\trewriterCache.set(key, rewriter);\n\n\treturn rewriter;\n};\n\nconst applyAllReplacements = (\n\tcontent: string,\n\trewriter: CompiledRewriter\n) => {\n\tconst replacer = (\n\t\t_match: string,\n\t\tprefix: string,\n\t\tspecifier: string,\n\t\tsuffix: string\n\t) => {\n\t\tconst webPath = rewriter.lookup.get(specifier);\n\t\tif (!webPath) return _match;\n\n\t\treturn `${prefix}${webPath}${suffix}`;\n\t};\n\n\trewriter.fromRegex.lastIndex = 0;\n\trewriter.sideEffectRegex.lastIndex = 0;\n\trewriter.dynamicRegex.lastIndex = 0;\n\n\tlet result = content;\n\tresult = result.replace(rewriter.fromRegex, replacer);\n\tresult = result.replace(rewriter.sideEffectRegex, replacer);\n\tresult = result.replace(rewriter.dynamicRegex, replacer);\n\n\treturn result;\n};\n\n/** Bun's reactFastRefresh transform injects bare $RefreshReg$/$RefreshSig$\n * calls into component code. With code splitting, component chunks can\n * evaluate before the chunk containing reactRefreshSetup (which defines\n * the globals), because Bun doesn't guarantee chunk import order matches\n * source import order. Prepending no-op stubs to affected chunks ensures\n * the globals always exist. The real react-refresh runtime overrides them. */\nconst REFRESH_STUBS =\n\t'window.$RefreshReg$||(window.$RefreshReg$=function(){});' +\n\t'window.$RefreshSig$||(window.$RefreshSig$=function(){return function(t){return t}});\\n';\n\nexport const patchRefreshGlobals = async (outputPaths: string[]) => {\n\tconst jsFiles = outputPaths.filter((path) => path.endsWith('.js'));\n\n\tawait Promise.all(\n\t\tjsFiles.map(async (filePath) => {\n\t\t\tconst content = await Bun.file(filePath).text();\n\t\t\tif (\n\t\t\t\t!content.includes('$RefreshReg$(') &&\n\t\t\t\t!content.includes('$RefreshSig$(')\n\t\t\t)\n\t\t\t\treturn;\n\t\t\tif (content.startsWith('window.$RefreshReg$')) return;\n\t\t\tawait Bun.write(filePath, REFRESH_STUBS + content);\n\t\t})\n\t);\n};\n\nexport const rewriteReactImports = async (\n\toutputPaths: string[],\n\tvendorPaths: Record<string, string>\n) => {\n\tconst jsFiles = outputPaths.filter((path) => path.endsWith('.js'));\n\tif (jsFiles.length === 0) return;\n\n\tconst rewriter = getOrCompileRewriter(vendorPaths);\n\n\tconst replacements = Object.entries(vendorPaths).sort(\n\t\t([keyA], [keyB]) => keyB.length - keyA.length\n\t);\n\n\tawait Promise.all(\n\t\tjsFiles.map(async (filePath) => {\n\t\t\tconst original = await Bun.file(filePath).text();\n\n\t\t\t// Try native Zig scanner first (15x faster on large files)\n\t\t\tconst native = nativeRewriteImports(original, replacements);\n\t\t\tconst content =\n\t\t\t\tnative ?? applyAllReplacements(original, rewriter);\n\n\t\t\tif (content !== original) {\n\t\t\t\tawait Bun.write(filePath, content);\n\t\t\t}\n\t\t})\n\t);\n};\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;;;;;AAQA,IAAM,cAAc,CAAC,QACpB,IAAI,QAAQ,uBAAuB,MAAM;AAS1C,IAAM,gBAAgB,IAAI;AAE1B,IAAM,WAAW,CAAC,gBAAwC;AAAA,EACzD,MAAM,UAAU,OAAO,QAAQ,WAAW,EAAE,KAC3C,EAAE,QAAQ,WAAW,KAAK,cAAc,KAAK,CAC9C;AAAA,EACA,IAAI,MAAM;AAAA,EACV,YAAY,GAAG,MAAM,SAAS;AAAA,IAC7B,OAAO,GAAG,QAAM;AAAA,EACjB;AAAA,EAEA,OAAO;AAAA;AAGR,IAAM,uBAAuB,CAAC,gBAAwC;AAAA,EACrE,MAAM,MAAM,SAAS,WAAW;AAAA,EAChC,MAAM,SAAS,cAAc,IAAI,GAAG;AAAA,EACpC,IAAI;AAAA,IAAQ,OAAO;AAAA,EAEnB,MAAM,eAAe,OAAO,QAAQ,WAAW,EAAE,KAChD,EAAE,QAAQ,UAAU,KAAK,SAAS,KAAK,MACxC;AAAA,EAEA,MAAM,SAAS,IAAI,IAAoB,YAAY;AAAA,EACnD,MAAM,MAAM,aAAa,IAAI,EAAE,UAAU,YAAY,IAAI,CAAC,EAAE,KAAK,GAAG;AAAA,EAEpE,MAAM,YAAY,IAAI,OAAO,kBAAkB,cAAc,GAAG;AAAA,EAChE,M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AAGM,IAAM,sBAAsB,OAClC,aACA,gBACI;AAAA,EACJ,MAAM,UAAU,YAAY,OAAO,CAAC,SAAS,KAAK,SAAS,KAAK,CAAC;AAAA,EACjE,IAAI,QAAQ,WAAW;AAAA,IAAG;AAAA,EAE1B,MAAM,WAAW,qBAAqB,WAAW;AAAA,EAEjD,MAAM,eAAe,OAAO,QAAQ,WAAW,EAAE,KAChD,EAAE,QAAQ,UAAU,KAAK,SAAS,KAAK,MACxC;AAAA,EAEA,MAAM,QAAQ,IACb,QAAQ,IAAI,OAAO,aAAa;AAAA,IAC/B,MAAM,WAAW,MAAM,IAAI,KAAK,QAAQ,EAAE,KAAK;AAAA,IAG/C,MAAM,SAAS,qBAAqB,UAAU,YAAY;AAAA,IAC1D,MAAM,UACL,UAAU,qBAAqB,UAAU,QAAQ;AAAA,IAElD,IAAI,YAAY,UAAU;AAAA,MACzB,MAAM,IAAI,MAAM,UAAU,OAAO;AAAA,IAClC;AAAA,GACA,CACF;AAAA;",
|
|
8
|
-
"debugId": "E11DB2F08438174D64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-hyjs4bqs.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/utils/normalizePath.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * Normalize file paths to use forward slashes for cross-platform compatibility.\n * Windows uses backslashes, but this codebase standardizes on forward slashes.\n */\nexport const normalizePath = (path: string) => path.replace(/\\\\/g, '/');\n\n/**\n * Normalize all paths in an array.\n */\nexport const normalizePaths = (paths: string[]) => paths.map(normalizePath);\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;AAIO,IAAM,gBAAgB,CAAC,SAAiB,KAAK,QAAQ,OAAO,GAAG;",
|
|
8
|
-
"debugId": "7C9EFCBF611DC4AE64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-j88z31ep.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./chunk-bmgqm774.js";
|
|
3
|
-
|
|
4
|
-
// src/client/hydrators/vue.ts
|
|
5
|
-
import { createSSRApp, h } from "vue";
|
|
6
|
-
var vueIslandApps = new WeakMap;
|
|
7
|
-
var isPropsRecord = (value) => typeof value === "object" && value !== null;
|
|
8
|
-
var isVueComponent = (value) => typeof value === "function" || isPropsRecord(value);
|
|
9
|
-
var hydrateVueIsland = (component, element, props) => {
|
|
10
|
-
if (vueIslandApps.has(element)) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
const app = createSSRApp({
|
|
14
|
-
render: () => h(component, isPropsRecord(props) ? props : undefined)
|
|
15
|
-
});
|
|
16
|
-
app.mount(element);
|
|
17
|
-
vueIslandApps.set(element, app);
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
isVueComponent,
|
|
21
|
-
hydrateVueIsland
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
//# debugId=C386C8F55A536C7164756E2164756E21
|
|
25
|
-
//# sourceMappingURL=chunk-j88z31ep.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/client/hydrators/vue.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { createSSRApp, h, type App as VueApp } from 'vue';\n\nconst vueIslandApps = new WeakMap<HTMLElement, VueApp>();\n\nconst isPropsRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nexport const isVueComponent = (\n\tvalue: unknown\n): value is import('vue').Component<Record<string, unknown>> =>\n\ttypeof value === 'function' || isPropsRecord(value);\n\nexport const hydrateVueIsland = (\n\tcomponent: import('vue').Component<Record<string, unknown>>,\n\telement: HTMLElement,\n\tprops: unknown\n) => {\n\tif (vueIslandApps.has(element)) {\n\t\treturn;\n\t}\n\n\tconst app = createSSRApp({\n\t\trender: () => h(component, isPropsRecord(props) ? props : undefined)\n\t});\n\tapp.mount(element);\n\tvueIslandApps.set(element, app);\n};\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;;;AAAA;AAEA,IAAM,gBAAgB,IAAI;AAE1B,IAAM,gBAAgB,CAAC,UACtB,OAAO,UAAU,YAAY,UAAU;AAEjC,IAAM,iBAAiB,CAC7B,UAEA,OAAO,UAAU,cAAc,cAAc,KAAK;AAE5C,IAAM,mBAAmB,CAC/B,WACA,SACA,UACI;AAAA,EACJ,IAAI,cAAc,IAAI,OAAO,GAAG;AAAA,IAC/B;AAAA,EACD;AAAA,EAEA,MAAM,MAAM,aAAa;AAAA,IACxB,QAAQ,MAAM,EAAE,WAAW,cAAc,KAAK,IAAI,QAAQ,SAAS;AAAA,EACpE,CAAC;AAAA,EACD,IAAI,MAAM,OAAO;AAAA,EACjB,cAAc,IAAI,SAAS,GAAG;AAAA;",
|
|
8
|
-
"debugId": "C386C8F55A536C7164756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-jn91vzkh.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// src/build/nativeRewrite.ts
|
|
3
|
-
import { dlopen, FFIType, ptr } from "bun:ffi";
|
|
4
|
-
import { platform, arch } from "os";
|
|
5
|
-
import { resolve } from "path";
|
|
6
|
-
var ffiDefinition = {
|
|
7
|
-
rewrite_imports: {
|
|
8
|
-
args: [
|
|
9
|
-
FFIType.ptr,
|
|
10
|
-
FFIType.u64,
|
|
11
|
-
FFIType.ptr,
|
|
12
|
-
FFIType.u64,
|
|
13
|
-
FFIType.ptr,
|
|
14
|
-
FFIType.ptr
|
|
15
|
-
],
|
|
16
|
-
returns: FFIType.i32
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
var nativeLib = null;
|
|
20
|
-
var loadNative = () => {
|
|
21
|
-
if (nativeLib !== null)
|
|
22
|
-
return nativeLib;
|
|
23
|
-
const osPlatform = platform();
|
|
24
|
-
const cpu = arch();
|
|
25
|
-
const platformMap = {
|
|
26
|
-
"darwin-arm64": "darwin-arm64/fast_ops.dylib",
|
|
27
|
-
"darwin-x64": "darwin-x64/fast_ops.dylib",
|
|
28
|
-
"linux-arm64": "linux-arm64/fast_ops.so",
|
|
29
|
-
"linux-x64": "linux-x64/fast_ops.so",
|
|
30
|
-
"win32-arm64": "windows-arm64/fast_ops.dll",
|
|
31
|
-
"win32-x64": "windows-x64/fast_ops.dll"
|
|
32
|
-
};
|
|
33
|
-
const libPath = platformMap[`${osPlatform}-${cpu}`];
|
|
34
|
-
if (!libPath)
|
|
35
|
-
return null;
|
|
36
|
-
try {
|
|
37
|
-
const fullPath = resolve(import.meta.dir, "../../native/packages", libPath);
|
|
38
|
-
const lib = dlopen(fullPath, ffiDefinition);
|
|
39
|
-
nativeLib = lib.symbols;
|
|
40
|
-
return nativeLib;
|
|
41
|
-
} catch {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var nativeRewriteImports = (content, replacements) => {
|
|
46
|
-
const lib = loadNative();
|
|
47
|
-
if (!lib)
|
|
48
|
-
return null;
|
|
49
|
-
const jsonStr = JSON.stringify(replacements);
|
|
50
|
-
const contentBuf = Buffer.from(content);
|
|
51
|
-
const jsonBuf = Buffer.from(jsonStr);
|
|
52
|
-
const outBuf = Buffer.alloc(content.length * 2);
|
|
53
|
-
const outLenBuf = new BigUint64Array([BigInt(outBuf.length)]);
|
|
54
|
-
const result = lib.rewrite_imports(ptr(contentBuf), contentBuf.length, ptr(jsonBuf), jsonBuf.length, ptr(outBuf), ptr(new Uint8Array(outLenBuf.buffer)));
|
|
55
|
-
if (result < 0)
|
|
56
|
-
return null;
|
|
57
|
-
if (result === 0)
|
|
58
|
-
return content;
|
|
59
|
-
const outLen = Number(outLenBuf[0]);
|
|
60
|
-
return outBuf.subarray(0, outLen).toString("utf-8");
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export { nativeRewriteImports };
|
|
64
|
-
|
|
65
|
-
//# debugId=24F357D4DEE84F5564756E2164756E21
|
|
66
|
-
//# sourceMappingURL=chunk-jn91vzkh.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/build/nativeRewrite.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/** Native Zig import rewriter — 15x faster than JS regex on large files.\n * Falls back to JS if the native addon isn't available (Windows, missing .so). */\n\nimport { dlopen, FFIType, ptr } from 'bun:ffi';\nimport { platform, arch } from 'node:os';\nimport { resolve } from 'node:path';\n\nconst ffiDefinition = {\n\trewrite_imports: {\n\t\targs: [\n\t\t\tFFIType.ptr,\n\t\t\tFFIType.u64,\n\t\t\tFFIType.ptr,\n\t\t\tFFIType.u64,\n\t\t\tFFIType.ptr,\n\t\t\tFFIType.ptr\n\t\t],\n\t\treturns: FFIType.i32\n\t}\n} as const;\n\ntype NativeLib = ReturnType<typeof dlopen<typeof ffiDefinition>>['symbols'];\n\nlet nativeLib: NativeLib | null = null;\n\nconst loadNative = () => {\n\tif (nativeLib !== null) return nativeLib;\n\n\tconst osPlatform = platform();\n\tconst cpu = arch();\n\n\tconst platformMap: Record<string, string> = {\n\t\t'darwin-arm64': 'darwin-arm64/fast_ops.dylib',\n\t\t'darwin-x64': 'darwin-x64/fast_ops.dylib',\n\t\t'linux-arm64': 'linux-arm64/fast_ops.so',\n\t\t'linux-x64': 'linux-x64/fast_ops.so',\n\t\t'win32-arm64': 'windows-arm64/fast_ops.dll',\n\t\t'win32-x64': 'windows-x64/fast_ops.dll'\n\t};\n\n\tconst libPath = platformMap[`${osPlatform}-${cpu}`];\n\tif (!libPath) return null;\n\n\ttry {\n\t\tconst fullPath = resolve(\n\t\t\timport.meta.dir,\n\t\t\t'../../native/packages',\n\t\t\tlibPath\n\t\t);\n\t\tconst lib = dlopen(fullPath, ffiDefinition);\n\t\tnativeLib = lib.symbols;\n\n\t\treturn nativeLib;\n\t} catch {\n\t\treturn null;\n\t}\n};\n\n/** Rewrite import specifiers in a string using the native Zig scanner.\n * Returns the rewritten string, or null if native isn't available. */\nexport const nativeRewriteImports = (\n\tcontent: string,\n\treplacements: [string, string][]\n) => {\n\tconst lib = loadNative();\n\tif (!lib) return null;\n\n\t// Format replacements as JSON array of [specifier, webPath] pairs\n\tconst jsonStr = JSON.stringify(replacements);\n\tconst contentBuf = Buffer.from(content);\n\tconst jsonBuf = Buffer.from(jsonStr);\n\tconst outBuf = Buffer.alloc(content.length * 2);\n\n\t// outLenPtr is a pointer to a usize (8 bytes on 64-bit)\n\tconst outLenBuf = new BigUint64Array([BigInt(outBuf.length)]);\n\n\tconst result = lib.rewrite_imports(\n\t\tptr(contentBuf),\n\t\tcontentBuf.length,\n\t\tptr(jsonBuf),\n\t\tjsonBuf.length,\n\t\tptr(outBuf),\n\t\tptr(new Uint8Array(outLenBuf.buffer))\n\t);\n\n\tif (result < 0) return null;\n\tif (result === 0) return content; // no changes\n\n\tconst outLen = Number(outLenBuf[0]);\n\n\treturn outBuf.subarray(0, outLen).toString('utf-8');\n};\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";;AAGA;AACA;AACA;AAEA,IAAM,gBAAgB;AAAA,EACrB,iBAAiB;AAAA,IAChB,MAAM;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,QAAQ;AAAA,IACT;AAAA,IACA,SAAS,QAAQ;AAAA,EAClB;AACD;AAIA,IAAI,YAA8B;AAElC,IAAM,aAAa,MAAM;AAAA,EACxB,IAAI,cAAc;AAAA,IAAM,OAAO;AAAA,EAE/B,MAAM,aAAa,SAAS;AAAA,EAC5B,MAAM,MAAM,KAAK;AAAA,EAEjB,MAAM,cAAsC;AAAA,IAC3C,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,e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
import {
|
|
3
|
-
resolveAngularRuntimePath
|
|
4
|
-
} from "./chunk-m97ze5hz.js";
|
|
5
|
-
import {
|
|
6
|
-
generateClientScriptCode,
|
|
7
|
-
getAndClearClientScripts
|
|
8
|
-
} from "./chunk-pnscgw95.js";
|
|
9
|
-
import {
|
|
10
|
-
toScreamingSnake
|
|
11
|
-
} from "./chunk-p5504p14.js";
|
|
12
|
-
import {
|
|
13
|
-
buildAbsoluteHttpTransferCacheOptions,
|
|
14
|
-
buildRequestProviders
|
|
15
|
-
} from "./chunk-25v9t56f.js";
|
|
16
|
-
import {
|
|
17
|
-
__require
|
|
18
|
-
} from "./chunk-bmgqm774.js";
|
|
19
|
-
|
|
20
|
-
// src/angular/angularDeps.ts
|
|
21
|
-
var initDominoAdapter = (platformServer) => {
|
|
22
|
-
try {
|
|
23
|
-
platformServer.\u{275}DominoAdapter?.makeCurrent?.();
|
|
24
|
-
} catch (err) {
|
|
25
|
-
console.error("Failed to initialize DominoAdapter:", err);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var loadAngularDeps = async () => {
|
|
29
|
-
if (true) {
|
|
30
|
-
await import(resolveAngularRuntimePath("@angular/compiler"));
|
|
31
|
-
}
|
|
32
|
-
const { applyPatches } = await import("./chunk-cm0g4q6w.js");
|
|
33
|
-
await applyPatches();
|
|
34
|
-
const [platformBrowser, platformServer, common, core] = await Promise.all([
|
|
35
|
-
import(resolveAngularRuntimePath("@angular/platform-browser")),
|
|
36
|
-
import(resolveAngularRuntimePath("@angular/platform-server")),
|
|
37
|
-
import(resolveAngularRuntimePath("@angular/common")),
|
|
38
|
-
import(resolveAngularRuntimePath("@angular/core"))
|
|
39
|
-
]);
|
|
40
|
-
if (false) {}
|
|
41
|
-
initDominoAdapter(platformServer);
|
|
42
|
-
return {
|
|
43
|
-
APP_BASE_HREF: common.APP_BASE_HREF,
|
|
44
|
-
bootstrapApplication: platformBrowser.bootstrapApplication,
|
|
45
|
-
DomSanitizer: platformBrowser.DomSanitizer,
|
|
46
|
-
ENVIRONMENT_INITIALIZER: core.ENVIRONMENT_INITIALIZER,
|
|
47
|
-
inject: core.inject,
|
|
48
|
-
provideClientHydration: platformBrowser.provideClientHydration,
|
|
49
|
-
provideServerRendering: platformServer.provideServerRendering,
|
|
50
|
-
provideZonelessChangeDetection: core.provideZonelessChangeDetection,
|
|
51
|
-
reflectComponentType: core.reflectComponentType,
|
|
52
|
-
renderApplication: platformServer.renderApplication,
|
|
53
|
-
REQUEST: core.REQUEST,
|
|
54
|
-
REQUEST_CONTEXT: core.REQUEST_CONTEXT,
|
|
55
|
-
RESPONSE_INIT: core.RESPONSE_INIT,
|
|
56
|
-
Sanitizer: core.Sanitizer,
|
|
57
|
-
SecurityContext: core.SecurityContext,
|
|
58
|
-
withHttpTransferCacheOptions: platformBrowser.withHttpTransferCacheOptions
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
var angularDeps = null;
|
|
62
|
-
var getAngularDeps = () => {
|
|
63
|
-
if (!angularDeps) {
|
|
64
|
-
angularDeps = loadAngularDeps();
|
|
65
|
-
}
|
|
66
|
-
return angularDeps;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// src/angular/ssrRender.ts
|
|
70
|
-
var routePropsCache = new Map;
|
|
71
|
-
var cacheRouteData = (pagePath, data) => {
|
|
72
|
-
const cacheKey = pagePath.split("?")[0] ?? pagePath;
|
|
73
|
-
routePropsCache.set(cacheKey, data);
|
|
74
|
-
};
|
|
75
|
-
var getCachedRouteData = (pagePath) => routePropsCache.get(pagePath);
|
|
76
|
-
var selectorCache = new Map;
|
|
77
|
-
var buildProviders = (deps, sanitizer, maybeProps, tokenMap, request, requestContext, responseInit, userProviders = []) => {
|
|
78
|
-
const providers = [
|
|
79
|
-
deps.provideServerRendering(),
|
|
80
|
-
deps.provideClientHydration(deps.withHttpTransferCacheOptions(buildAbsoluteHttpTransferCacheOptions())),
|
|
81
|
-
deps.provideZonelessChangeDetection(),
|
|
82
|
-
{ provide: deps.APP_BASE_HREF, useValue: "/" },
|
|
83
|
-
{
|
|
84
|
-
provide: deps.DomSanitizer,
|
|
85
|
-
useValue: sanitizer
|
|
86
|
-
},
|
|
87
|
-
{ provide: deps.Sanitizer, useValue: sanitizer },
|
|
88
|
-
...buildRequestProviders(deps, request, requestContext, responseInit),
|
|
89
|
-
...userProviders
|
|
90
|
-
];
|
|
91
|
-
if (!maybeProps) {
|
|
92
|
-
return providers;
|
|
93
|
-
}
|
|
94
|
-
const propProviders = Object.entries(maybeProps).map(([propName, propValue]) => ({
|
|
95
|
-
token: tokenMap.get(toScreamingSnake(propName)),
|
|
96
|
-
value: propValue
|
|
97
|
-
})).filter((entry) => entry.token).map((entry) => ({ provide: entry.token, useValue: entry.value }));
|
|
98
|
-
return [...providers, ...propProviders];
|
|
99
|
-
};
|
|
100
|
-
var clearSelectorCache = () => selectorCache.clear();
|
|
101
|
-
var isInjectionToken = (value) => {
|
|
102
|
-
if (!value || typeof value !== "object") {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
return "ngMetadataName" in value && value.ngMetadataName === "InjectionToken";
|
|
106
|
-
};
|
|
107
|
-
var discoverTokens = (pageModule) => new Map(Object.entries(pageModule).filter(([, value]) => isInjectionToken(value)));
|
|
108
|
-
var resolveSelector = (deps, pagePath, PageComponent) => {
|
|
109
|
-
const cached = selectorCache.get(pagePath);
|
|
110
|
-
if (cached) {
|
|
111
|
-
return cached;
|
|
112
|
-
}
|
|
113
|
-
const selector = deps.reflectComponentType(PageComponent)?.selector ?? "ng-app";
|
|
114
|
-
selectorCache.set(pagePath, selector);
|
|
115
|
-
return selector;
|
|
116
|
-
};
|
|
117
|
-
var injectBeforeClose = (html, snippet) => {
|
|
118
|
-
if (html.includes("</body>")) {
|
|
119
|
-
return html.replace("</body>", `${snippet}</body>`);
|
|
120
|
-
}
|
|
121
|
-
if (html.includes("</html>")) {
|
|
122
|
-
return html.replace("</html>", `${snippet}</html>`);
|
|
123
|
-
}
|
|
124
|
-
return html + snippet;
|
|
125
|
-
};
|
|
126
|
-
var injectSsrScripts = (html, requestId, indexPath, props) => {
|
|
127
|
-
let result = html;
|
|
128
|
-
const registeredScripts = getAndClearClientScripts(requestId);
|
|
129
|
-
if (registeredScripts.length > 0) {
|
|
130
|
-
result = injectBeforeClose(result, generateClientScriptCode(registeredScripts));
|
|
131
|
-
}
|
|
132
|
-
if (props) {
|
|
133
|
-
result = injectBeforeClose(result, `<script>window.__ABS_ANGULAR_PAGE_PROPS__ = ${JSON.stringify(props)};</script>`);
|
|
134
|
-
}
|
|
135
|
-
if (indexPath) {
|
|
136
|
-
const escapedIndexPath = JSON.stringify(indexPath);
|
|
137
|
-
result = injectBeforeClose(result, `<script>import(${escapedIndexPath});</script>`);
|
|
138
|
-
}
|
|
139
|
-
return result;
|
|
140
|
-
};
|
|
141
|
-
var renderAngularApp = async (deps, PageComponent, providers, document, url = "/") => {
|
|
142
|
-
const bootstrap = (context) => deps.bootstrapApplication(PageComponent, { providers }, context);
|
|
143
|
-
return withSuppressedAngularDevLogs(() => deps.renderApplication(bootstrap, {
|
|
144
|
-
document,
|
|
145
|
-
platformProviders: [],
|
|
146
|
-
url
|
|
147
|
-
}));
|
|
148
|
-
};
|
|
149
|
-
var withSuppressedAngularDevLogs = async (render) => {
|
|
150
|
-
const origLog = console.log;
|
|
151
|
-
console.log = (...args) => {
|
|
152
|
-
if (typeof args[0] === "string" && args[0].includes("development mode")) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
origLog.apply(console, args);
|
|
156
|
-
};
|
|
157
|
-
try {
|
|
158
|
-
return await render();
|
|
159
|
-
} finally {
|
|
160
|
-
console.log = origLog;
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export { getAngularDeps, cacheRouteData, getCachedRouteData, buildProviders, clearSelectorCache, discoverTokens, resolveSelector, injectSsrScripts, renderAngularApp, withSuppressedAngularDevLogs };
|
|
165
|
-
|
|
166
|
-
//# debugId=B7A848C26CC37E7664756E2164756E21
|
|
167
|
-
//# sourceMappingURL=chunk-jpkjdgsk.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/angular/angularDeps.ts", "../src/angular/ssrRender.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { AngularDeps } from '../../types/angular';\nimport { resolveAngularRuntimePath } from './resolveAngularPackage';\n\nconst initDominoAdapter = (platformServer: {\n\tɵDominoAdapter?: { makeCurrent?: () => void };\n}) => {\n\ttry {\n\t\tplatformServer.ɵDominoAdapter?.makeCurrent?.();\n\t} catch (err) {\n\t\tconsole.error('Failed to initialize DominoAdapter:', err);\n\t}\n};\n\nconst loadAngularDeps = async () => {\n\t// JIT compiler is only needed in development, where user pages are\n\t// runtime-compiled by `compileAngularFileJIT` and emit partial\n\t// declarations that need the compiler facade to link. In production\n\t// the linker has already processed every partial declaration into\n\t// final ɵdir/ɵcmp/ɵfac at vendor build time, so the compiler isn't\n\t// imported and isn't part of the prod vendor bundle.\n\tif (process.env.NODE_ENV !== 'production') {\n\t\tawait import(resolveAngularRuntimePath('@angular/compiler'));\n\t}\n\n\t// angularPatch imports @angular/platform-server internally, so it\n\t// must also run after the compiler is available.\n\tconst { applyPatches } = await import('./angularPatch');\n\tawait applyPatches();\n\n\t// Now safe to load all Angular packages in parallel\n\tconst [platformBrowser, platformServer, common, core] = await Promise.all([\n\t\timport(resolveAngularRuntimePath('@angular/platform-browser')),\n\t\timport(resolveAngularRuntimePath('@angular/platform-server')),\n\t\timport(resolveAngularRuntimePath('@angular/common')),\n\t\timport(resolveAngularRuntimePath('@angular/core'))\n\t]);\n\n\tif (process.env.NODE_ENV !== 'development') {\n\t\tcore.enableProdMode();\n\t}\n\n\tinitDominoAdapter(platformServer);\n\n\treturn {\n\t\tAPP_BASE_HREF: common.APP_BASE_HREF,\n\t\tbootstrapApplication: platformBrowser.bootstrapApplication,\n\t\tDomSanitizer: platformBrowser.DomSanitizer,\n\t\tENVIRONMENT_INITIALIZER: core.ENVIRONMENT_INITIALIZER,\n\t\tinject: core.inject,\n\t\tprovideClientHydration: platformBrowser.provideClientHydration,\n\t\tprovideServerRendering: platformServer.provideServerRendering,\n\t\tprovideZonelessChangeDetection: core.provideZonelessChangeDetection,\n\t\treflectComponentType: core.reflectComponentType,\n\t\trenderApplication: platformServer.renderApplication,\n\t\tREQUEST: core.REQUEST,\n\t\tREQUEST_CONTEXT: core.REQUEST_CONTEXT,\n\t\tRESPONSE_INIT: core.RESPONSE_INIT,\n\t\tSanitizer: core.Sanitizer,\n\t\tSecurityContext: core.SecurityContext,\n\t\twithHttpTransferCacheOptions:\n\t\t\tplatformBrowser.withHttpTransferCacheOptions\n\t};\n};\n\nlet angularDeps: Promise<AngularDeps> | null = null;\n\nexport const getAngularDeps = () => {\n\tif (!angularDeps) {\n\t\tangularDeps = loadAngularDeps();\n\t}\n\n\treturn angularDeps;\n};\n",
|
|
6
|
-
"import type { EnvironmentProviders, Provider, Type } from '@angular/core';\nimport type { BootstrapContext } from '@angular/platform-browser';\nimport type { AngularDeps, CachedRouteData } from '../../types/angular';\nimport { toScreamingSnake } from '../utils/stringModifiers';\nimport {\n\tgetAndClearClientScripts,\n\tgenerateClientScriptCode\n} from '../utils/registerClientScript';\nimport { buildAbsoluteHttpTransferCacheOptions } from './httpTransferCache';\nimport { buildRequestProviders } from './requestProviders';\n\n// --- Last-used props cache for HMR ---\n// Stores { props, headTag } from the most recent real request per route\n// so HMR re-renders with the same data the user last saw (Vite/Next behavior).\n\nconst routePropsCache = new Map<string, CachedRouteData>();\n\nexport const cacheRouteData = (pagePath: string, data: CachedRouteData) => {\n\tconst cacheKey = pagePath.split('?')[0] ?? pagePath;\n\troutePropsCache.set(cacheKey, data);\n};\nexport const getCachedRouteData = (pagePath: string) =>\n\troutePropsCache.get(pagePath);\n\n// --- Selector cache ---\n\nconst selectorCache = new Map<string, string>();\nexport const buildProviders = (\n\tdeps: AngularDeps,\n\tsanitizer: InstanceType<AngularDeps['DomSanitizer']>,\n\tmaybeProps: Record<string, unknown> | undefined,\n\ttokenMap: Map<string, unknown>,\n\trequest: Request | undefined,\n\trequestContext: unknown,\n\tresponseInit: ResponseInit | undefined,\n\tuserProviders: ReadonlyArray<Provider | EnvironmentProviders> = []\n) => {\n\tconst providers: (Provider | EnvironmentProviders)[] = [\n\t\tdeps.provideServerRendering(),\n\t\tdeps.provideClientHydration(\n\t\t\tdeps.withHttpTransferCacheOptions(\n\t\t\t\tbuildAbsoluteHttpTransferCacheOptions()\n\t\t\t)\n\t\t),\n\t\tdeps.provideZonelessChangeDetection(),\n\t\t{ provide: deps.APP_BASE_HREF, useValue: '/' },\n\t\t{\n\t\t\tprovide: deps.DomSanitizer,\n\t\t\tuseValue: sanitizer\n\t\t},\n\t\t{ provide: deps.Sanitizer, useValue: sanitizer },\n\t\t...buildRequestProviders(deps, request, requestContext, responseInit),\n\t\t...userProviders\n\t];\n\n\tif (!maybeProps) {\n\t\treturn providers;\n\t}\n\n\tconst propProviders = Object.entries(maybeProps)\n\t\t.map(([propName, propValue]) => ({\n\t\t\ttoken: tokenMap.get(toScreamingSnake(propName)),\n\t\t\tvalue: propValue\n\t\t}))\n\t\t.filter((entry) => entry.token)\n\t\t.map((entry) => ({ provide: entry.token, useValue: entry.value }));\n\n\treturn [...providers, ...propProviders];\n};\nexport const clearSelectorCache = () => selectorCache.clear();\n\nconst isInjectionToken = (value: unknown) => {\n\tif (!value || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\t'ngMetadataName' in value && value.ngMetadataName === 'InjectionToken'\n\t);\n};\n\nexport const discoverTokens = (pageModule: Record<string, unknown>) =>\n\tnew Map(\n\t\tObject.entries(pageModule).filter(([, value]) =>\n\t\t\tisInjectionToken(value)\n\t\t)\n\t);\nexport const resolveSelector = (\n\tdeps: AngularDeps,\n\tpagePath: string,\n\tPageComponent: Type<unknown>\n) => {\n\tconst cached = selectorCache.get(pagePath);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst selector =\n\t\tdeps.reflectComponentType(PageComponent)?.selector ?? 'ng-app';\n\tselectorCache.set(pagePath, selector);\n\n\treturn selector;\n};\n\n// --- Inject HTML helper ---\n\nconst injectBeforeClose = (html: string, snippet: string) => {\n\tif (html.includes('</body>')) {\n\t\treturn html.replace('</body>', `${snippet}</body>`);\n\t}\n\tif (html.includes('</html>')) {\n\t\treturn html.replace('</html>', `${snippet}</html>`);\n\t}\n\n\treturn html + snippet;\n};\n\n// --- Post-render HTML injection ---\n\nexport const injectSsrScripts = (\n\thtml: string,\n\trequestId: string,\n\tindexPath: string,\n\tprops?: Record<string, unknown>\n) => {\n\tlet result = html;\n\n\tconst registeredScripts = getAndClearClientScripts(requestId);\n\tif (registeredScripts.length > 0) {\n\t\tresult = injectBeforeClose(\n\t\t\tresult,\n\t\t\tgenerateClientScriptCode(registeredScripts)\n\t\t);\n\t}\n\n\tif (props) {\n\t\tresult = injectBeforeClose(\n\t\t\tresult,\n\t\t\t`<script>window.__ABS_ANGULAR_PAGE_PROPS__ = ${JSON.stringify(props)};</script>`\n\t\t);\n\t}\n\n\tif (indexPath) {\n\t\tconst escapedIndexPath = JSON.stringify(indexPath);\n\t\tresult = injectBeforeClose(\n\t\t\tresult,\n\t\t\t`<script>import(${escapedIndexPath});</script>`\n\t\t);\n\t}\n\n\treturn result;\n};\nexport const renderAngularApp = async (\n\tdeps: AngularDeps,\n\tPageComponent: Type<unknown>,\n\tproviders: (Provider | EnvironmentProviders)[],\n\tdocument: string | Document,\n\turl: string = '/'\n) => {\n\tconst bootstrap = (context: BootstrapContext) =>\n\t\tdeps.bootstrapApplication(PageComponent, { providers }, context);\n\n\treturn withSuppressedAngularDevLogs(() =>\n\t\tdeps.renderApplication(bootstrap, {\n\t\t\tdocument,\n\t\t\tplatformProviders: [],\n\t\t\turl\n\t\t})\n\t);\n};\nexport const withSuppressedAngularDevLogs = async <T>(\n\trender: () => Promise<T>\n) => {\n\tconst origLog = console.log;\n\tconsole.log = (...args: unknown[]) => {\n\t\tif (\n\t\t\ttypeof args[0] === 'string' &&\n\t\t\targs[0].includes('development mode')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\torigLog.apply(console, args);\n\t};\n\n\ttry {\n\t\treturn await render();\n\t} finally {\n\t\tconsole.log = origLog;\n\t}\n};\n"
|
|
7
|
-
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAGA,IAAM,oBAAoB,CAAC,mBAErB;AAAA,EACL,IAAI;AAAA,IACH,eAAe,sBAAe,cAAc;AAAA,IAC3C,OAAO,KAAK;AAAA,IACb,QAAQ,MAAM,uCAAuC,GAAG;AAAA;AAAA;AAI1D,IAAM,kBAAkB,YAAY;AAAA,EAOnC,IAAI,MAAuC;AAAA,IAC1C,MAAa,iCAA0B,mBAAmB;AAAA,EAC3D;AAAA,EAIA,QAAQ,iBAAiB,MAAa;AAAA,EACtC,MAAM,aAAa;AAAA,EAGnB,OAAO,iBAAiB,gBAAgB,QAAQ,QAAQ,MAAM,QAAQ,IAAI;AAAA,IAClE,iCAA0B,2BAA2B;AAAA,IACrD,iCAA0B,0BAA0B;AAAA,IACpD,iCAA0B,iBAAiB;AAAA,IAC3C,iCAA0B,eAAe;AAAA,EACjD,CAAC;AAAA,EAED,IAAI,OAAwC,CAE5C;AAAA,EAEA,kBAAkB,cAAc;AAAA,EAEhC,OAAO;AAAA,IACN,eAAe,OAAO;AAAA,IACtB,sBAAsB,gBAAgB;AAAA,IACtC,cAAc,gBAAgB;AAAA,IAC9B,yBAAyB,KAAK;AAAA,IAC9B,QAAQ,KAAK;AAAA,IACb,wBAAwB,gBAAgB;AAAA,IACxC,wBAAwB,eAAe;AAAA,IACvC,gCAAgC,KAAK;AAAA,IACrC,sBAAsB,KAAK;AAAA,IAC3B,mBAAmB,eAAe;AAAA,IAClC,SAAS,KAAK;AAAA,IACd,iBAAiB,KAAK;AAAA,IACtB,eAAe,KAAK;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ACA,+CAA+C,KAAK,UAAU,KAAK,aACpE;AAAA,EACD;AAAA,EAEA,IAAI,WAAW;AAAA,IACd,MAAM,mBAAmB,KAAK,UAAU,SAAS;AAAA,IACjD,SAAS,kBACR,QACA,kBAAkB,6BACnB;AAAA,EACD;AAAA,EAEA,OAAO;AAAA;AAED,IAAM,mBAAmB,OAC/B,MACA,eACA,WACA,UACA,MAAc,QACV;AAAA,EACJ,MAAM,YAAY,CAAC,YAClB,KAAK,qBAAqB,eAAe,EAAE,UAAU,GAAG,OAAO;AAAA,EAEhE,OAAO,6BAA6B,MACnC,KAAK,kBAAkB,WAAW;AAAA,IACjC;AAAA,IACA,mBAAmB,CAAC;AAAA,IACpB;AAAA,EACD,CAAC,CACF;AAAA;AAEM,IAAM,+BAA+B,OAC3C,WACI;AAAA,EACJ,MAAM,UAAU,QAAQ;AAAA,EACxB,QAAQ,MAAM,IAAI,SAAoB;AAAA,IACrC,IACC,OAAO,KAAK,OAAO,YACnB,KAAK,GAAG,SAAS,kBAAkB,GAClC;AAAA,MACD;AAAA,IACD;AAAA,IACA,QAAQ,MAAM,SAAS,IAAI;AAAA;AAAA,EAG5B,IAAI;AAAA,IACH,OAAO,MAAM,OAAO;AAAA,YACnB;AAAA,IACD,QAAQ,MAAM;AAAA;AAAA;",
|
|
9
|
-
"debugId": "B7A848C26CC37E7664756E2164756E21",
|
|
10
|
-
"names": []
|
|
11
|
-
}
|
package/dist/chunk-jwxt8gnp.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
updateAssetPaths
|
|
4
|
-
} from "./chunk-93sqk7be.js";
|
|
5
|
-
import"./chunk-11zpfqz6.js";
|
|
6
|
-
import"./chunk-p5504p14.js";
|
|
7
|
-
import"./chunk-bmgqm774.js";
|
|
8
|
-
export {
|
|
9
|
-
updateAssetPaths
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
//# debugId=22F4A6E9A0F2B2A364756E2164756E21
|
|
13
|
-
//# sourceMappingURL=chunk-jwxt8gnp.js.map
|