@absolutejs/absolute 0.9.0 → 0.9.1

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.
@@ -1,4 +1,10 @@
1
- export declare const compileSvelte: (entryPoints: string[], outputDirectory: string) => Promise<{
1
+ type Built = {
2
+ ssr: string;
3
+ client: string;
4
+ };
5
+ type Cache = Map<string, Built>;
6
+ export declare const compileSvelte: (entryPoints: string[], outRoot: string, cache?: Cache) => Promise<{
2
7
  svelteClientPaths: string[];
3
8
  svelteServerPaths: string[];
4
9
  }>;
10
+ export {};
@@ -1,5 +1,5 @@
1
- export declare const compileVue: (entryPoints: string[], outputDirectory: string) => Promise<{
2
- vueClientPaths: string[];
3
- vueCssPaths: Record<string, string[]>;
1
+ export declare const compileVue: (pageEntryPoints: string[], outputDirectory: string) => Promise<{
2
+ vueCssPaths: string[];
3
+ vueIndexPaths: string[];
4
4
  vueServerPaths: string[];
5
5
  }>;
@@ -1,2 +1,2 @@
1
1
  import { BuildArtifact } from 'bun';
2
- export declare const generateManifest: (outputs: BuildArtifact[], buildDirectoryAbsolute: string) => Record<string, string>;
2
+ export declare const generateManifest: (outputs: BuildArtifact[], buildPath: string) => Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare const updateHTMLAssetPaths: (manifest: Record<string, string>, htmlDir: string) => Promise<void>;
@@ -1,4 +1,2 @@
1
1
  import { BuildConfig } from '../types';
2
- export declare const build: ({ buildDirectory, assetsDirectory, reactDirectory, htmlDirectory, htmxDirectory, svelteDirectory, vueDirectory, tailwind, options }: BuildConfig) => Promise<{
3
- [x: string]: string | string[];
4
- } | null>;
2
+ export declare const build: ({ buildDirectory, assetsDirectory, reactDirectory, htmlDirectory, htmxDirectory, svelteDirectory, vueDirectory, tailwind, options }: BuildConfig) => Promise<Record<string, string>>;
@@ -1,2 +1 @@
1
- export declare const asset: (manifest: Record<string, string | string[]>, name: string) => string;
2
- export declare const assets: (manifest: Record<string, string | string[]>, name: string) => string[];
1
+ export declare const asset: (manifest: Record<string, string>, name: string) => string;
@@ -8,7 +8,7 @@ type HandleSveltePageRequest = {
8
8
  <P extends Record<string, unknown>>(PageComponent: SvelteComponent<P>, pagePath: string, indexPath: string, props: P): Promise<Response>;
9
9
  };
10
10
  export declare const handleSveltePageRequest: HandleSveltePageRequest;
11
- export declare const handleVuePageRequest: <Props extends Record<string, unknown> = Record<never, never>>(_PageComponent: VueComponent<Props>, pagePath: string, indexPath: string, ...props: keyof Props extends never ? [] : [props: Props]) => Promise<Response>;
11
+ export declare const handleVuePageRequest: <Props extends Record<string, unknown> = Record<never, never>>(_PageComponent: VueComponent<Props>, pagePath: string, indexPath: string, headTag?: `<head>${string}</head>`, ...props: keyof Props extends never ? [] : [props: Props]) => Promise<Response>;
12
12
  export declare const handleHTMLPageRequest: (html: string) => Bun.BunFile;
13
13
  export declare const handlePageRequest: <Component>(PageComponent: Component, ...props: PropsArgs<Component>) => void;
14
14
  export {};
package/dist/index.js CHANGED
@@ -12,204 +12,318 @@ var DEFAULT_PORT = 3000;
12
12
  var DEFAULT_CHUNK_SIZE = 16384;
13
13
  // src/core/build.ts
14
14
  import { rm as rm2, mkdir as mkdir4, cp } from "fs/promises";
15
- import { basename as basename4, join as join4, sep as sep2 } from "path";
16
- import { cwd, env as env2, exit } from "process";
15
+ import { basename as basename4, join as join4, sep as sep3 } from "path";
16
+ import { cwd as cwd3, env as env2, exit } from "process";
17
17
  var {$, build: bunBuild } = globalThis.Bun;
18
18
 
19
19
  // src/build/compileSvelte.ts
20
- import { mkdir } from "fs/promises";
21
- import { basename, join } from "path";
22
- import { env } from "process";
23
- var {write, file } = globalThis.Bun;
24
- import { compile, preprocess } from "svelte/compiler";
25
- var compileSvelte = async (entryPoints, outputDirectory) => {
26
- const pagesDir = join(outputDirectory, "pages");
27
- const clientDir = join(outputDirectory, "client");
28
- const indexesDir = join(outputDirectory, "indexes");
29
- await Promise.all([
30
- mkdir(clientDir, { recursive: true }),
31
- mkdir(indexesDir, { recursive: true })
32
- ]);
33
- const isDev = env.NODE_ENV === "development";
34
- const builds = await Promise.all(entryPoints.map(async (entry) => {
35
- const source = await file(entry).text();
36
- const { code: pre } = await preprocess(source, {});
37
- const name = basename(entry, ".svelte");
38
- const { js: ssrJs } = compile(pre, {
39
- css: "injected",
40
- dev: isDev,
41
- filename: entry,
42
- generate: "server"
43
- });
44
- const ssrPath = join(pagesDir, `${name}.js`);
45
- const { js: clientJs } = compile(pre, {
20
+ import { mkdir, stat } from "fs/promises";
21
+ import {
22
+ dirname,
23
+ join,
24
+ basename,
25
+ extname,
26
+ resolve,
27
+ relative,
28
+ sep
29
+ } from "path";
30
+ import { cwd, env } from "process";
31
+ var {write, file, Transpiler } = globalThis.Bun;
32
+ import { compile, compileModule, preprocess } from "svelte/compiler";
33
+ var exists = async (filepath) => {
34
+ try {
35
+ await stat(filepath);
36
+ return true;
37
+ } catch {
38
+ return false;
39
+ }
40
+ };
41
+ var resolveSvelte = async (spec, from) => {
42
+ const basePath = resolve(dirname(from), spec);
43
+ const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
44
+ if (!explicit) {
45
+ const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
46
+ const paths = extensions.map((ext) => `${basePath}${ext}`);
47
+ const checks = await Promise.all(paths.map(exists));
48
+ const match = paths.find((_, index) => checks[index]);
49
+ return match ?? null;
50
+ }
51
+ if (await exists(basePath))
52
+ return basePath;
53
+ if (!basePath.endsWith(".svelte"))
54
+ return null;
55
+ const tsPath = `${basePath}.ts`;
56
+ if (await exists(tsPath))
57
+ return tsPath;
58
+ const jsPath = `${basePath}.js`;
59
+ if (await exists(jsPath))
60
+ return jsPath;
61
+ return null;
62
+ };
63
+ var transpiler = new Transpiler({ loader: "ts", target: "browser" });
64
+ var projectRoot = cwd();
65
+ var compileSvelte = async (entryPoints, outRoot, cache = new Map) => {
66
+ const clientFolder = "client";
67
+ const indexFolder = "indexes";
68
+ const pagesFolder = "pages";
69
+ await Promise.all([clientFolder, indexFolder, pagesFolder].map((d) => mkdir(join(outRoot, d), { recursive: true })));
70
+ const dev = env.NODE_ENV === "development";
71
+ const build = async (src) => {
72
+ const memo = cache.get(src);
73
+ if (memo)
74
+ return memo;
75
+ const raw = await file(src).text();
76
+ const isModule = src.endsWith(".svelte.ts") || src.endsWith(".svelte.js");
77
+ const prepped = isModule ? raw : (await preprocess(raw, {})).code;
78
+ const transpiledCode = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler.transformSync(prepped) : prepped;
79
+ const relDir = dirname(relative(projectRoot, src));
80
+ const baseName = basename(src).replace(/\.svelte(\.(ts|js))?$/, "");
81
+ const importPaths = Array.from(transpiledCode.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((m) => m[1]).filter((p) => p !== undefined);
82
+ const resolveResults = await Promise.all(importPaths.map((p) => resolveSvelte(p, src)));
83
+ const childSources = resolveResults.filter((path) => path !== undefined);
84
+ await Promise.all(childSources.map((p) => build(p)));
85
+ const generate = (mode) => (isModule ? compileModule(transpiledCode, { dev, filename: src }).js.code : compile(transpiledCode, {
46
86
  css: "injected",
47
- dev: isDev,
48
- filename: entry,
49
- generate: "client"
50
- });
51
- const clientComponentPath = join(clientDir, `${name}.js`);
52
- const bootstrap = `import Component from "../client/${name}.js";
53
- import { hydrate } from "svelte";
54
- hydrate(Component,{target:document.body,props:window.__INITIAL_PROPS__??{}});`;
55
- const clientIndexPath = join(indexesDir, `${name}.js`);
87
+ dev,
88
+ filename: src,
89
+ generate: mode
90
+ }).js.code).replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
91
+ const ssrPath = join(outRoot, pagesFolder, relDir, `${baseName}.js`);
92
+ const clientPath = join(outRoot, clientFolder, relDir, `${baseName}.js`);
56
93
  await Promise.all([
57
- write(ssrPath, ssrJs.code),
58
- write(clientComponentPath, clientJs.code),
59
- write(clientIndexPath, bootstrap)
94
+ mkdir(dirname(ssrPath), { recursive: true }),
95
+ mkdir(dirname(clientPath), { recursive: true })
60
96
  ]);
61
- return { clientIndexPath, ssrPath };
97
+ if (isModule) {
98
+ const bundle = generate("client");
99
+ await Promise.all([
100
+ write(ssrPath, bundle),
101
+ write(clientPath, bundle)
102
+ ]);
103
+ } else {
104
+ const serverBundle = generate("server");
105
+ const clientBundle = generate("client");
106
+ await Promise.all([
107
+ write(ssrPath, serverBundle),
108
+ write(clientPath, clientBundle)
109
+ ]);
110
+ }
111
+ const built = { client: clientPath, ssr: ssrPath };
112
+ cache.set(src, built);
113
+ return built;
114
+ };
115
+ const roots = await Promise.all(entryPoints.map(build));
116
+ await Promise.all(roots.map(({ client }) => {
117
+ const relClientDir = dirname(relative(join(outRoot, clientFolder), client));
118
+ const name = basename(client, extname(client));
119
+ const indexDir = join(outRoot, indexFolder, relClientDir);
120
+ const importPathRaw = relative(indexDir, client).split(sep).join("/");
121
+ const importPath = importPathRaw.startsWith(".") ? importPathRaw : `./${importPathRaw}`;
122
+ const indexPath = join(indexDir, `${name}.js`);
123
+ const boot = `import C from "${importPath}";
124
+ import { hydrate } from "svelte";
125
+ hydrate(C,{target:document.body,props:window.__INITIAL_PROPS__??{}});`;
126
+ return mkdir(indexDir, { recursive: true }).then(() => write(indexPath, boot));
62
127
  }));
63
128
  return {
64
- svelteClientPaths: builds.map(({ clientIndexPath }) => clientIndexPath),
65
- svelteServerPaths: builds.map(({ ssrPath }) => ssrPath)
129
+ svelteClientPaths: roots.map(({ client }) => {
130
+ const rel = dirname(relative(join(outRoot, clientFolder), client));
131
+ return join(outRoot, indexFolder, rel, basename(client));
132
+ }),
133
+ svelteServerPaths: roots.map(({ ssr }) => ssr)
66
134
  };
67
135
  };
68
136
 
69
137
  // src/build/compileVue.ts
70
138
  import { mkdir as mkdir2 } from "fs/promises";
71
- import { basename as basename2, extname, join as join2, relative } from "path";
139
+ import { basename as basename2, dirname as dirname2, join as join2, relative as relative2, resolve as resolve2 } from "path";
140
+ import { cwd as cwd2 } from "process";
72
141
  import {
73
142
  parse,
74
143
  compileScript,
75
144
  compileTemplate,
76
145
  compileStyle
77
146
  } from "@vue/compiler-sfc";
78
- var {file: file2, write: write2 } = globalThis.Bun;
79
- var compileVue = async (entryPoints, outputDirectory) => {
147
+ var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
148
+
149
+ // src/utils/stringModifiers.ts
150
+ var normalizeSlug = (str) => str.trim().replace(/\s+/g, "-").replace(/[^A-Za-z0-9\-_]+/g, "").replace(/[-_]{2,}/g, "-");
151
+ var toPascal = (str) => normalizeSlug(str).split(/[-_]/).filter(Boolean).map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1).toLowerCase()).join("");
152
+ var toKebab = (str) => normalizeSlug(str).replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
153
+
154
+ // src/build/compileVue.ts
155
+ var transpiler2 = new Transpiler2({ loader: "ts", target: "browser" });
156
+ var projectRoot2 = cwd2();
157
+ var extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined);
158
+ var toJsFileName = (path) => {
159
+ if (path.endsWith(".vue")) {
160
+ return path.replace(/\.vue$/, ".js");
161
+ }
162
+ if (path.endsWith(".ts")) {
163
+ return path.replace(/\.ts$/, ".js");
164
+ }
165
+ return `${path}.js`;
166
+ };
167
+ var stripModuleExports = (sourceCode) => sourceCode.replace(/export\s+default/, "const script =").replace(/^export\s+/gm, "");
168
+ var buildVueFile = async (absolutePath, outputDirs, cache, isEntryPage = false) => {
169
+ if (cache.has(absolutePath))
170
+ return cache.get(absolutePath);
171
+ const relativePath = relative2(projectRoot2, absolutePath).replace(/\\/g, "/");
172
+ const relativePathWithoutExt = relativePath.replace(/\.vue$/, "");
173
+ const componentName = basename2(absolutePath, ".vue");
174
+ const kebabId = toKebab(componentName);
175
+ const sourceCode = await file2(absolutePath).text();
176
+ const { descriptor } = parse(sourceCode, { filename: absolutePath });
177
+ const originalSetupCode = descriptor.scriptSetup?.content ?? descriptor.script?.content ?? "";
178
+ const relativeImports = extractImports(originalSetupCode);
179
+ const childVueImports = relativeImports.filter((importPath) => importPath.startsWith(".") && importPath.endsWith(".vue"));
180
+ const tsHelperImports = relativeImports.filter((importPath) => importPath.startsWith(".") && !importPath.endsWith(".vue"));
181
+ const childBuildResults = await Promise.all(childVueImports.map((importPath) => buildVueFile(resolve2(dirname2(absolutePath), importPath), outputDirs, cache, false)));
182
+ const compiledScript = compileScript(descriptor, {
183
+ id: kebabId,
184
+ inlineTemplate: false
185
+ });
186
+ const transformedScript = transpiler2.transformSync(stripModuleExports(compiledScript.content)).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_, quote, importPath, endQuote) => quote + toJsFileName(importPath) + endQuote);
187
+ const renderBlock = (forServer) => compileTemplate({
188
+ compilerOptions: {
189
+ bindingMetadata: compiledScript.bindings,
190
+ prefixIdentifiers: true
191
+ },
192
+ filename: absolutePath,
193
+ id: kebabId,
194
+ scoped: descriptor.styles.some((s) => s.scoped),
195
+ source: descriptor.template?.content ?? "",
196
+ ssr: forServer,
197
+ ssrCssVars: descriptor.cssVars
198
+ }).code.replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_, quote, importPath, endQuote) => quote + toJsFileName(importPath) + endQuote);
199
+ const ownCssCodes = descriptor.styles.map((styleBlock) => compileStyle({
200
+ filename: absolutePath,
201
+ id: kebabId,
202
+ scoped: styleBlock.scoped,
203
+ source: styleBlock.content,
204
+ trim: true
205
+ }).code);
206
+ const aggregatedCssCodes = [
207
+ ...ownCssCodes,
208
+ ...childBuildResults.flatMap((result) => result.cssCodes)
209
+ ];
210
+ let emittedCssPaths = [];
211
+ if (isEntryPage && aggregatedCssCodes.length) {
212
+ const cssOutputPath = join2(outputDirs.css, `${toKebab(componentName)}.css`);
213
+ await mkdir2(dirname2(cssOutputPath), { recursive: true });
214
+ await write2(cssOutputPath, aggregatedCssCodes.join(`
215
+ `));
216
+ emittedCssPaths = [cssOutputPath];
217
+ }
218
+ const buildModule = (renderCode, renderFunctionName) => {
219
+ const vueHeader = 'import { defineComponent } from "vue";';
220
+ return [
221
+ transformedScript,
222
+ renderCode,
223
+ vueHeader,
224
+ `export default defineComponent({ ...script, ${renderFunctionName} });`
225
+ ].join(`
226
+ `);
227
+ };
228
+ const clientModuleCode = buildModule(renderBlock(false), "render");
229
+ const serverModuleCode = buildModule(renderBlock(true), "ssrRender");
230
+ const clientOutPath = join2(outputDirs.client, `${relativePathWithoutExt}.js`);
231
+ const serverOutPath = join2(outputDirs.server, `${relativePathWithoutExt}.js`);
232
+ await mkdir2(dirname2(clientOutPath), { recursive: true });
233
+ await mkdir2(dirname2(serverOutPath), { recursive: true });
234
+ await write2(clientOutPath, clientModuleCode);
235
+ await write2(serverOutPath, serverModuleCode);
236
+ const buildResult = {
237
+ clientPath: clientOutPath,
238
+ cssCodes: aggregatedCssCodes,
239
+ cssPaths: emittedCssPaths,
240
+ serverPath: serverOutPath,
241
+ tsHelperPaths: [
242
+ ...tsHelperImports.map((helper) => resolve2(dirname2(absolutePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
243
+ ...childBuildResults.flatMap((result) => result.tsHelperPaths)
244
+ ]
245
+ };
246
+ cache.set(absolutePath, buildResult);
247
+ return buildResult;
248
+ };
249
+ var compileVue = async (pageEntryPoints, outputDirectory) => {
250
+ const clientDir = join2(outputDirectory, "client");
251
+ const indexDir = join2(outputDirectory, "indexes");
80
252
  const pagesDir = join2(outputDirectory, "pages");
81
- const scriptsDir = join2(outputDirectory, "scripts");
82
253
  const stylesDir = join2(outputDirectory, "styles");
83
- const clientDir = join2(outputDirectory, "client");
84
- const indexesDir = join2(outputDirectory, "indexes");
85
254
  await Promise.all([
86
- mkdir2(pagesDir, { recursive: true }),
87
- mkdir2(scriptsDir, { recursive: true }),
88
- mkdir2(stylesDir, { recursive: true }),
89
255
  mkdir2(clientDir, { recursive: true }),
90
- mkdir2(indexesDir, { recursive: true })
256
+ mkdir2(indexDir, { recursive: true }),
257
+ mkdir2(pagesDir, { recursive: true }),
258
+ mkdir2(stylesDir, { recursive: true })
91
259
  ]);
92
- const results = await Promise.all(entryPoints.map(async (entry) => {
93
- const source = await file2(entry).text();
94
- const filename = basename2(entry);
95
- const name = basename2(entry, extname(entry));
96
- const { descriptor } = parse(source, { filename });
97
- const cssFiles = await Promise.all(descriptor.styles.map(async (styleBlock, idx) => {
98
- const outName = descriptor.styles.length === 1 ? `${name}.css` : `${name}.${idx}.css`;
99
- const { code } = compileStyle({
100
- filename,
101
- id: name,
102
- scoped: Boolean(styleBlock.scoped),
103
- source: styleBlock.content,
104
- trim: true
105
- });
106
- await write2(join2(stylesDir, outName), code);
107
- return outName;
108
- }));
109
- const scriptBlock = compileScript(descriptor, {
110
- id: name,
111
- inlineTemplate: false
112
- });
113
- const scriptPath = join2(scriptsDir, `${name}.ts`);
114
- const cleanedScript = scriptBlock.content.replace(/setup\(\s*__props\s*:\s*any/g, "setup(__props");
115
- await write2(scriptPath, cleanedScript);
116
- const ssrTpl = compileTemplate({
117
- compilerOptions: {
118
- bindingMetadata: scriptBlock.bindings,
119
- prefixIdentifiers: true
120
- },
121
- filename,
122
- id: name,
123
- source: descriptor.template?.content ?? "",
124
- ssr: true,
125
- ssrCssVars: descriptor.cssVars
126
- });
127
- const serverImport = `import scriptMod, * as named from '../scripts/${name}.ts';`;
128
- let ssrCode = ssrTpl.code.replace(/(import\s+[^\n]+["']vue\/server-renderer["'][^\n]*\n)/, `$1${serverImport}
129
- `);
130
- if (/import\s*\{[^}]+\}\s*from\s*['"]vue['"]/.test(ssrCode)) {
131
- ssrCode = ssrCode.replace(/import\s*\{([^}]+)\}\s*from\s*['"]vue['"];?/, (_, imports) => `import { defineComponent, ${imports.trim()} } from 'vue';`);
132
- } else {
133
- ssrCode = `import { defineComponent } from 'vue';
134
- ${ssrCode}`;
135
- }
136
- const ssrPath = join2(pagesDir, `${name}.js`);
137
- await write2(ssrPath, [
138
- ssrCode,
139
- `export default defineComponent({ ...scriptMod, ...named, ssrRender });`
140
- ].join(`
141
- `));
142
- const clientTpl = compileTemplate({
143
- compilerOptions: {
144
- bindingMetadata: scriptBlock.bindings,
145
- cacheHandlers: true,
146
- hoistStatic: true,
147
- mode: "module",
148
- prefixIdentifiers: true
149
- },
150
- filename,
151
- id: name,
152
- source: descriptor.template?.content ?? ""
153
- });
154
- let clientCode = clientTpl.code;
155
- const clientImport = `import scriptMod, * as named from '../scripts/${name}.ts'`;
156
- if (/import\s*\{[^}]+\}\s*from\s*['"]vue['"]/.test(clientCode)) {
157
- clientCode = clientCode.replace(/import\s*\{([^}]+)\}\s*from\s*['"]vue['"];?/, (_, imports) => `import { defineComponent, ${imports.trim()} } from 'vue';
158
- ${clientImport}`);
159
- } else {
160
- clientCode = `import { defineComponent } from 'vue';
161
- ${clientImport}
162
- ${clientCode}`;
163
- }
164
- const clientComponentPath = join2(clientDir, `${name}.js`);
165
- await write2(clientComponentPath, [
166
- clientCode,
167
- `export default defineComponent({ ...scriptMod, ...named, render })`
168
- ].join(`
169
- `));
170
- const clientIndexPath = join2(indexesDir, `${name}.js`);
171
- await write2(clientIndexPath, [
172
- `import Comp from '${relative(indexesDir, clientComponentPath)}'`,
173
- `import { createSSRApp } from 'vue'`,
174
- `const props = window.__INITIAL_PROPS__ ?? {}`,
175
- `const app = createSSRApp(Comp, props)`,
176
- `app.mount('#app')`
260
+ const buildCache = new Map;
261
+ const tsHelperSet = new Set;
262
+ const pageResults = await Promise.all(pageEntryPoints.map(async (pageEntry) => {
263
+ const buildResult = await buildVueFile(resolve2(pageEntry), { client: clientDir, css: stylesDir, server: pagesDir }, buildCache, true);
264
+ buildResult.tsHelperPaths.forEach((p) => tsHelperSet.add(p));
265
+ const relPath = relative2(projectRoot2, pageEntry).replace(/\.vue$/, "");
266
+ const indexPath = join2(indexDir, `${relPath}.js`);
267
+ const clientEntryPath = join2(clientDir, `${relPath}.js`);
268
+ await mkdir2(dirname2(indexPath), { recursive: true });
269
+ await write2(indexPath, [
270
+ `import Comp from "${relative2(dirname2(indexPath), clientEntryPath)}";`,
271
+ 'import { createSSRApp } from "vue";',
272
+ "const props = window.__INITIAL_PROPS__ ?? {};",
273
+ 'createSSRApp(Comp, props).mount("#root");'
177
274
  ].join(`
178
275
  `));
179
276
  return {
180
- clientIndexPath,
181
- cssFiles,
182
- cssKey: `${name}CSS`,
183
- serverPath: ssrPath
277
+ cssPaths: buildResult.cssPaths,
278
+ indexPath,
279
+ serverPath: buildResult.serverPath
184
280
  };
185
281
  }));
186
- const vueClientPaths = results.map(({ clientIndexPath }) => clientIndexPath);
187
- const vueServerPaths = results.map(({ serverPath }) => serverPath);
188
- const vueCssPaths = results.reduce((acc, { cssKey, cssFiles }) => {
189
- acc[cssKey] = cssFiles;
190
- return acc;
191
- }, {});
192
- return { vueClientPaths, vueCssPaths, vueServerPaths };
282
+ await Promise.all(Array.from(tsHelperSet).map(async (src) => {
283
+ const code = transpiler2.transformSync(await file2(src).text());
284
+ const rel = relative2(projectRoot2, src).replace(/\.ts$/, ".js");
285
+ const clientDest = join2(clientDir, rel);
286
+ const serverDest = join2(pagesDir, rel);
287
+ await Promise.all([
288
+ mkdir2(dirname2(clientDest), { recursive: true }),
289
+ mkdir2(dirname2(serverDest), { recursive: true })
290
+ ]);
291
+ await Promise.all([
292
+ write2(clientDest, code),
293
+ write2(serverDest, code)
294
+ ]);
295
+ }));
296
+ return {
297
+ vueCssPaths: pageResults.flatMap((pageResult) => pageResult.cssPaths),
298
+ vueIndexPaths: pageResults.map((pageResult) => pageResult.indexPath),
299
+ vueServerPaths: pageResults.map((pageResult) => pageResult.serverPath)
300
+ };
193
301
  };
194
302
 
195
303
  // src/build/generateManifest.ts
196
- var generateManifest = (outputs, buildDirectoryAbsolute) => outputs.reduce((manifest, artifact) => {
197
- let relative2 = artifact.path.startsWith(buildDirectoryAbsolute) ? artifact.path.slice(buildDirectoryAbsolute.length) : artifact.path;
198
- relative2 = relative2.replace(/^\/+/, "");
199
- const segments = relative2.split("/");
304
+ import { extname as extname2 } from "path";
305
+ var generateManifest = (outputs, buildPath) => outputs.reduce((manifest, artifact) => {
306
+ let relative3 = artifact.path.startsWith(buildPath) ? artifact.path.slice(buildPath.length) : artifact.path;
307
+ relative3 = relative3.replace(/^\/+/, "");
308
+ const segments = relative3.split("/");
200
309
  const fileWithHash = segments.pop();
201
310
  if (!fileWithHash)
202
311
  return manifest;
203
312
  const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
204
313
  if (!baseName)
205
314
  return manifest;
315
+ const ext = extname2(fileWithHash);
316
+ if (ext === ".css") {
317
+ manifest[`${toPascal(baseName)}CSS`] = `/${relative3}`;
318
+ return manifest;
319
+ }
206
320
  const folder = segments.length > 1 ? segments[1] : segments[0];
207
321
  if (folder === "indexes") {
208
- manifest[`${baseName}Index`] = `/${relative2}`;
322
+ manifest[`${baseName}Index`] = `/${relative3}`;
209
323
  } else if (folder === "pages") {
210
- manifest[baseName] = artifact.path;
324
+ manifest[baseName] ??= artifact.path;
211
325
  } else {
212
- manifest[baseName] = `/${relative2}`;
326
+ manifest[baseName] = `/${relative3}`;
213
327
  }
214
328
  return manifest;
215
329
  }, {});
@@ -261,17 +375,21 @@ var scanEntryPoints = async (dir, pattern) => {
261
375
  return entryPaths;
262
376
  };
263
377
 
264
- // src/build/updateScriptTags.ts
378
+ // src/build/updateHTMLAssetPaths.ts
265
379
  import { readFile, writeFile as writeFile2 } from "fs/promises";
266
- var updateScriptTags = async (manifest, htmlDir) => {
380
+ var updateHTMLAssetPaths = async (manifest, htmlDir) => {
267
381
  const htmlFiles = await scanEntryPoints(htmlDir, "*.html");
382
+ const assetRegex = /((?:<script[^>]+src=|<link[^>]*?rel=["']stylesheet["'][^>]*?href=)["'])(\/?(?:.*\/)?)([^./"']+)(?:\.[^."'/]+)?(\.(?:js|ts|css))(["'][^>]*>)/g;
268
383
  const tasks = htmlFiles.map(async (filePath) => {
269
384
  const original = await readFile(filePath, "utf8");
270
- const updated = Object.entries(manifest).reduce((html, [scriptName, newPath]) => {
271
- const esc = scriptName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
272
- const regex = new RegExp(`(<script[^>]+src=["'])(/?(?:.*/)?${esc})(?:\\.[^."'/]+)?(\\.js)(["'][^>]*>)`, "g");
273
- return html.replace(regex, (_, prefix, __, ___, suffix) => `${prefix}${newPath}${suffix}`);
274
- }, original);
385
+ const updated = original.replace(assetRegex, (match, prefix, _dir, name, ext, suffix) => {
386
+ const key = ext === ".css" ? `${toPascal(name)}CSS` : name;
387
+ const newPath = manifest[key];
388
+ if (newPath)
389
+ return `${prefix}${newPath}${suffix}`;
390
+ console.error(`error: no manifest entry for ${ext.slice(1)} "${name}" referenced in ${filePath}`);
391
+ return match;
392
+ });
275
393
  await writeFile2(filePath, updated, "utf8");
276
394
  });
277
395
  await Promise.all(tasks);
@@ -291,11 +409,11 @@ var getDurationString = (duration) => {
291
409
  };
292
410
 
293
411
  // src/utils/validateSafePath.ts
294
- import { resolve, relative as relative2, sep } from "path";
412
+ import { resolve as resolve3, relative as relative3, sep as sep2 } from "path";
295
413
  var validateSafePath = (targetPath, baseDirectory) => {
296
- const absoluteBase = resolve(baseDirectory);
297
- const absoluteTarget = resolve(baseDirectory, targetPath);
298
- if (relative2(absoluteBase, absoluteTarget).startsWith(`..${sep}`)) {
414
+ const absoluteBase = resolve3(baseDirectory);
415
+ const absoluteTarget = resolve3(baseDirectory, targetPath);
416
+ if (relative3(absoluteBase, absoluteTarget).startsWith(`..${sep2}`)) {
299
417
  throw new Error(`Unsafe path: ${targetPath}`);
300
418
  }
301
419
  return absoluteTarget;
@@ -305,12 +423,12 @@ var validateSafePath = (targetPath, baseDirectory) => {
305
423
  var commonAncestor = (paths, fallback) => {
306
424
  if (paths.length === 0)
307
425
  return fallback;
308
- const segmentsList = paths.map((p) => p.split(sep2));
426
+ const segmentsList = paths.map((p) => p.split(sep3));
309
427
  const [first] = segmentsList;
310
428
  if (!first)
311
429
  return fallback;
312
430
  const commonSegments = first.filter((segment, index) => segmentsList.every((pathSegs) => pathSegs[index] === segment));
313
- return commonSegments.length ? commonSegments.join(sep2) : fallback;
431
+ return commonSegments.length ? commonSegments.join(sep3) : fallback;
314
432
  };
315
433
  var isDev = env2.NODE_ENV === "development";
316
434
  var vueFeatureFlags = {
@@ -320,7 +438,7 @@ var vueFeatureFlags = {
320
438
  };
321
439
  var build = async ({
322
440
  buildDirectory = "build",
323
- assetsDirectory,
441
+ assetsDirectory = "assets",
324
442
  reactDirectory,
325
443
  htmlDirectory,
326
444
  htmxDirectory,
@@ -330,14 +448,14 @@ var build = async ({
330
448
  options
331
449
  }) => {
332
450
  const buildStart = performance.now();
333
- const projectRoot = cwd();
334
- const buildPath = validateSafePath(buildDirectory, projectRoot);
335
- const assetsPath = assetsDirectory && validateSafePath(assetsDirectory, projectRoot);
336
- const reactDir = reactDirectory && validateSafePath(reactDirectory, projectRoot);
337
- const htmlDir = htmlDirectory && validateSafePath(htmlDirectory, projectRoot);
338
- const htmxDir = htmxDirectory && validateSafePath(htmxDirectory, projectRoot);
339
- const svelteDir = svelteDirectory && validateSafePath(svelteDirectory, projectRoot);
340
- const vueDir = vueDirectory && validateSafePath(vueDirectory, projectRoot);
451
+ const projectRoot3 = cwd3();
452
+ const buildPath = validateSafePath(buildDirectory, projectRoot3);
453
+ const assetsPath = assetsDirectory && validateSafePath(assetsDirectory, projectRoot3);
454
+ const reactDir = reactDirectory && validateSafePath(reactDirectory, projectRoot3);
455
+ const htmlDir = htmlDirectory && validateSafePath(htmlDirectory, projectRoot3);
456
+ const htmxDir = htmxDirectory && validateSafePath(htmxDirectory, projectRoot3);
457
+ const svelteDir = svelteDirectory && validateSafePath(svelteDirectory, projectRoot3);
458
+ const vueDir = vueDirectory && validateSafePath(vueDirectory, projectRoot3);
341
459
  const reactIndexesPath = reactDir && join4(reactDir, "indexes");
342
460
  const reactPagesPath = reactDir && join4(reactDir, "pages");
343
461
  const htmlPagesPath = htmlDir && join4(htmlDir, "pages");
@@ -347,17 +465,15 @@ var build = async ({
347
465
  const frontends = [reactDir, htmlDir, htmxDir, svelteDir, vueDir].filter(Boolean);
348
466
  const isSingle = frontends.length === 1;
349
467
  let serverOutDir;
350
- if (svelteDir) {
468
+ if (svelteDir)
351
469
  serverOutDir = join4(buildPath, basename4(svelteDir), "pages");
352
- } else if (vueDir) {
470
+ else if (vueDir)
353
471
  serverOutDir = join4(buildPath, basename4(vueDir), "pages");
354
- }
355
472
  let serverRoot;
356
- if (svelteDir) {
473
+ if (svelteDir)
357
474
  serverRoot = join4(svelteDir, "pages");
358
- } else if (vueDir) {
475
+ else if (vueDir)
359
476
  serverRoot = join4(vueDir, "pages");
360
- }
361
477
  await rm2(buildPath, { force: true, recursive: true });
362
478
  await mkdir4(buildPath);
363
479
  if (reactIndexesPath && reactPagesPath)
@@ -380,18 +496,27 @@ var build = async ({
380
496
  const htmlEntries = htmlScriptsPath ? await scanEntryPoints(htmlScriptsPath, "*.{js,ts}") : [];
381
497
  const svelteEntries = sveltePagesPath ? await scanEntryPoints(sveltePagesPath, "*.svelte") : [];
382
498
  const vueEntries = vuePagesPath ? await scanEntryPoints(vuePagesPath, "*.vue") : [];
499
+ const htmlCssEntries = htmlDir ? await scanEntryPoints(join4(htmlDir, "styles"), "*.css") : [];
500
+ const reactCssEntries = reactDir ? await scanEntryPoints(join4(reactDir, "styles"), "*.css") : [];
501
+ const svelteCssEntries = svelteDir ? await scanEntryPoints(join4(svelteDir, "styles"), "*.css") : [];
383
502
  const { svelteServerPaths, svelteClientPaths } = svelteDir ? await compileSvelte(svelteEntries, svelteDir) : { svelteClientPaths: [], svelteServerPaths: [] };
384
- const { vueServerPaths, vueClientPaths, vueCssPaths } = vueDir ? await compileVue(vueEntries, vueDir) : { vueClientPaths: [], vueCssPaths: {}, vueServerPaths: [] };
503
+ const { vueServerPaths, vueIndexPaths, vueCssPaths } = vueDir ? await compileVue(vueEntries, vueDir) : { vueCssPaths: [], vueIndexPaths: [], vueServerPaths: [] };
385
504
  const serverEntryPoints = [...svelteServerPaths, ...vueServerPaths];
386
505
  const clientEntryPoints = [
387
506
  ...reactEntries,
388
507
  ...svelteClientPaths,
389
508
  ...htmlEntries,
390
- ...vueClientPaths
509
+ ...vueIndexPaths
510
+ ];
511
+ const cssEntryPoints = [
512
+ ...vueCssPaths,
513
+ ...reactCssEntries,
514
+ ...svelteCssEntries,
515
+ ...htmlCssEntries
391
516
  ];
392
517
  if (serverEntryPoints.length === 0 && clientEntryPoints.length === 0) {
393
- console.warn("No entry points found");
394
- return null;
518
+ console.warn("No entry points found, manifest will be empty.");
519
+ return {};
395
520
  }
396
521
  let serverLogs = [];
397
522
  let serverOutputs = [];
@@ -414,7 +539,7 @@ var build = async ({
414
539
  let clientOutputs = [];
415
540
  if (clientEntryPoints.length > 0) {
416
541
  const roots = [reactDir, svelteDir, htmlDir, vueDir].filter((dir) => Boolean(dir));
417
- const clientRoot = isSingle ? roots[0] ?? projectRoot : commonAncestor(roots, projectRoot);
542
+ const clientRoot = isSingle ? roots[0] ?? projectRoot3 : commonAncestor(roots, projectRoot3);
418
543
  const { logs, outputs } = await bunBuild({
419
544
  define: vueDirectory ? vueFeatureFlags : undefined,
420
545
  entrypoints: clientEntryPoints,
@@ -430,17 +555,31 @@ var build = async ({
430
555
  clientLogs = logs;
431
556
  clientOutputs = outputs;
432
557
  }
433
- const allLogs = [...serverLogs, ...clientLogs];
558
+ let cssLogs = [];
559
+ let cssOutputs = [];
560
+ if (cssEntryPoints.length > 0) {
561
+ const { logs, outputs } = await bunBuild({
562
+ entrypoints: cssEntryPoints,
563
+ naming: `[name].[hash].[ext]`,
564
+ outdir: join4(buildPath, basename4(assetsPath), "css"),
565
+ target: "browser"
566
+ }).catch((err) => {
567
+ console.error("CSS build failed:", err);
568
+ exit(1);
569
+ });
570
+ cssLogs = logs;
571
+ cssOutputs = outputs;
572
+ }
573
+ const allLogs = [...serverLogs, ...clientLogs, ...cssLogs];
434
574
  for (const log of allLogs) {
435
- if (typeof log !== "object" || log === null || !("level" in log))
436
- continue;
437
- if (log.level === "error" && (console.error(log), 1))
438
- continue;
439
- if (log.level === "warning" && (console.warn(log), 1))
440
- continue;
441
- console.info(log);
575
+ if (log.level === "error")
576
+ console.error(log);
577
+ else if (log.level === "warning")
578
+ console.warn(log);
579
+ else
580
+ console.info(log);
442
581
  }
443
- const manifest = generateManifest([...serverOutputs, ...clientOutputs], buildPath);
582
+ const manifest = generateManifest([...serverOutputs, ...clientOutputs, ...cssOutputs], buildPath);
444
583
  if (htmlDir && htmlPagesPath) {
445
584
  const outputHtmlPages = join4(buildPath, basename4(htmlDir), "pages");
446
585
  await mkdir4(outputHtmlPages, { recursive: true });
@@ -448,17 +587,31 @@ var build = async ({
448
587
  force: true,
449
588
  recursive: true
450
589
  });
451
- await updateScriptTags(manifest, outputHtmlPages);
590
+ await updateHTMLAssetPaths(manifest, outputHtmlPages);
452
591
  }
453
592
  if (!options?.preserveIntermediateFiles && svelteDir) {
454
593
  await rm2(join4(svelteDir, "indexes"), { force: true, recursive: true });
455
594
  await rm2(join4(svelteDir, "client"), { force: true, recursive: true });
456
595
  await Promise.all(svelteServerPaths.map((path) => rm2(path, { force: true })));
596
+ await rm2(join4(svelteDir, "pages", "example"), {
597
+ force: true,
598
+ recursive: true
599
+ });
600
+ }
601
+ if (!options?.preserveIntermediateFiles && vueDir) {
602
+ await rm2(join4(vueDir, "indexes"), { force: true, recursive: true });
603
+ await rm2(join4(vueDir, "client"), { force: true, recursive: true });
604
+ await rm2(join4(vueDir, "styles"), { force: true, recursive: true });
605
+ await Promise.all(vueServerPaths.map((path) => rm2(path, { force: true })));
606
+ await rm2(join4(vueDir, "pages", "example"), {
607
+ force: true,
608
+ recursive: true
609
+ });
457
610
  }
458
611
  if (!options?.preserveIntermediateFiles && reactIndexesPath)
459
612
  await rm2(reactIndexesPath, { force: true, recursive: true });
460
613
  console.log(`Build completed in ${getDurationString(performance.now() - buildStart)}`);
461
- return { ...manifest, ...vueCssPaths };
614
+ return manifest;
462
615
  };
463
616
  // src/core/pageHandlers.ts
464
617
  var {file: file3 } = globalThis.Bun;
@@ -548,14 +701,14 @@ var handleSveltePageRequest = async (_PageComponent, pagePath, indexPath, props)
548
701
  headers: { "Content-Type": "text/html" }
549
702
  });
550
703
  };
551
- var handleVuePageRequest = async (_PageComponent, pagePath, indexPath, ...props) => {
704
+ var handleVuePageRequest = async (_PageComponent, pagePath, indexPath, headTag = "<head></head>", ...props) => {
552
705
  const [maybeProps] = props;
553
706
  const { default: ImportedPageComponent } = await import(pagePath);
554
707
  const app = createSSRApp({
555
708
  render: () => h(ImportedPageComponent, maybeProps ?? {})
556
709
  });
557
710
  const bodyStream = renderVueToWebStream(app);
558
- const head = '<!DOCTYPE html><html><head></head><body><div id="app">';
711
+ const head = `<!DOCTYPE html><html>${headTag}<body><div id="root">`;
559
712
  const tail = `</div><script>window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})}</script><script type="module" src="${indexPath}"></script></body></html>`;
560
713
  const stream = new ReadableStream({
561
714
  start(controller) {
@@ -581,21 +734,8 @@ var asset = (manifest, name) => {
581
734
  if (assetPath === undefined) {
582
735
  throw new Error(`Asset "${name}" not found in manifest.`);
583
736
  }
584
- if (Array.isArray(assetPath)) {
585
- throw new Error(`"${name}" is an array, use 'assets' instead.`);
586
- }
587
737
  return assetPath;
588
738
  };
589
- var assets = (manifest, name) => {
590
- const assetPaths = manifest[name];
591
- if (assetPaths === undefined) {
592
- throw new Error(`Assets "${name}" not found in manifest.`);
593
- }
594
- if (!Array.isArray(assetPaths)) {
595
- throw new Error(`"${name}" is not an array, use 'asset' instead.`);
596
- }
597
- return assetPaths;
598
- };
599
739
  // src/plugins/networkingPlugin.ts
600
740
  import { argv } from "process";
601
741
  var {env: env3 } = globalThis.Bun;
@@ -637,8 +777,26 @@ var networkingPlugin = (app) => app.listen({
637
777
  var pageRouterPlugin = () => {
638
778
  console.log("Page Router Plugin Not Implemented Yet");
639
779
  };
780
+ // src/utils/generateHeadElement.ts
781
+ var generateHeadElement = ({
782
+ cssPath,
783
+ title = "AbsoluteJS",
784
+ description = "A page created using AbsoluteJS",
785
+ font,
786
+ icon = "/assets/ico/favicon.ico"
787
+ } = {}) => `<head>
788
+ <meta charset="UTF-8">
789
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
790
+ <title>${title}</title>
791
+ <meta name="description" content="${description}">
792
+ <link rel="icon" href="${icon}" type="image/x-icon">
793
+ ${font ? `<link rel="preconnect" href="https://fonts.googleapis.com">
794
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
795
+ <link href="https://fonts.googleapis.com/css2?family=${font}:wght@100..900&display=swap" rel="stylesheet">` : ""}
796
+ ${cssPath ? `<link rel="stylesheet" href="${cssPath}" type="text/css">` : ""}
797
+ </head>`;
640
798
  export {
641
- updateScriptTags,
799
+ updateHTMLAssetPaths,
642
800
  pageRouterPlugin,
643
801
  networkingPlugin,
644
802
  handleVuePageRequest,
@@ -647,8 +805,8 @@ export {
647
805
  handlePageRequest,
648
806
  handleHTMLPageRequest,
649
807
  getLocalIPAddress,
808
+ generateHeadElement,
650
809
  build,
651
- assets,
652
810
  asset,
653
811
  TWO_THIRDS,
654
812
  TIME_PRECISION,
@@ -662,5 +820,5 @@ export {
662
820
  DEFAULT_CHUNK_SIZE
663
821
  };
664
822
 
665
- //# debugId=F6760E8AC62BE5FB64756E2164756E21
823
+ //# debugId=919FA38EE8B07AC264756E2164756E21
666
824
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,26 +1,28 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/constants.ts", "../src/core/build.ts", "../src/build/compileSvelte.ts", "../src/build/compileVue.ts", "../src/build/generateManifest.ts", "../src/build/generateReactIndexes.ts", "../src/build/scanEntryPoints.ts", "../src/build/updateScriptTags.ts", "../src/utils/getDurationString.ts", "../src/utils/validateSafePath.ts", "../src/core/pageHandlers.ts", "../src/svelte/renderToReadableStream.ts", "../src/utils/escapeScriptContent.ts", "../src/core/lookup.ts", "../src/plugins/networkingPlugin.ts", "../src/utils/networking.ts", "../src/plugins/pageRouterPlugin.ts"],
3
+ "sources": ["../src/constants.ts", "../src/core/build.ts", "../src/build/compileSvelte.ts", "../src/build/compileVue.ts", "../src/utils/stringModifiers.ts", "../src/build/generateManifest.ts", "../src/build/generateReactIndexes.ts", "../src/build/scanEntryPoints.ts", "../src/build/updateHTMLAssetPaths.ts", "../src/utils/getDurationString.ts", "../src/utils/validateSafePath.ts", "../src/core/pageHandlers.ts", "../src/svelte/renderToReadableStream.ts", "../src/utils/escapeScriptContent.ts", "../src/core/lookup.ts", "../src/plugins/networkingPlugin.ts", "../src/utils/networking.ts", "../src/plugins/pageRouterPlugin.ts", "../src/utils/generateHeadElement.ts"],
4
4
  "sourcesContent": [
5
5
  "export const SECONDS_IN_A_MINUTE = 60;\nexport const MILLISECONDS_IN_A_SECOND = 1000;\nexport const MILLISECONDS_IN_A_MINUTE =\n\tMILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;\nexport const MINUTES_IN_AN_HOUR = 60;\nexport const HOURS_IN_DAY = 24;\nexport const MILLISECONDS_IN_A_DAY =\n\tMILLISECONDS_IN_A_SECOND *\n\tSECONDS_IN_A_MINUTE *\n\tMINUTES_IN_AN_HOUR *\n\tHOURS_IN_DAY;\nexport const TIME_PRECISION = 2;\nexport const TWO_THIRDS = 2 / 3;\nexport const DEFAULT_PORT = 3000;\nexport const DEFAULT_CHUNK_SIZE = 16_384;\n",
6
- "import { rm, mkdir, cp } from 'node:fs/promises';\nimport { basename, join, sep } from 'node:path';\nimport { cwd, env, exit } from 'node:process';\nimport { $, build as bunBuild, BuildArtifact } from 'bun';\nimport { compileSvelte } from '../build/compileSvelte';\nimport { compileVue } from '../build/compileVue';\nimport { generateManifest } from '../build/generateManifest';\nimport { generateReactIndexFiles } from '../build/generateReactIndexes';\nimport { scanEntryPoints } from '../build/scanEntryPoints';\nimport { updateScriptTags } from '../build/updateScriptTags';\nimport { BuildConfig } from '../types';\nimport { getDurationString } from '../utils/getDurationString';\nimport { validateSafePath } from '../utils/validateSafePath';\n\nconst commonAncestor = (paths: string[], fallback: string) => {\n\tif (paths.length === 0) return fallback;\n\tconst segmentsList = paths.map((p) => p.split(sep));\n\tconst [first] = segmentsList;\n\tif (!first) return fallback;\n\tconst commonSegments = first.filter((segment, index) =>\n\t\tsegmentsList.every((pathSegs) => pathSegs[index] === segment)\n\t);\n\n\treturn commonSegments.length ? commonSegments.join(sep) : fallback;\n};\n\nconst isDev = env.NODE_ENV === 'development';\n\nconst vueFeatureFlags: Record<string, string> = {\n\t__VUE_OPTIONS_API__: 'true',\n\t__VUE_PROD_DEVTOOLS__: isDev ? 'true' : 'false',\n\t__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDev ? 'true' : 'false'\n};\n\nexport const build = async ({\n\tbuildDirectory = 'build',\n\tassetsDirectory,\n\treactDirectory,\n\thtmlDirectory,\n\thtmxDirectory,\n\tsvelteDirectory,\n\tvueDirectory,\n\ttailwind,\n\toptions\n}: BuildConfig) => {\n\tconst buildStart = performance.now();\n\tconst projectRoot = cwd();\n\n\tconst buildPath = validateSafePath(buildDirectory, projectRoot);\n\tconst assetsPath =\n\t\tassetsDirectory && validateSafePath(assetsDirectory, projectRoot);\n\tconst reactDir =\n\t\treactDirectory && validateSafePath(reactDirectory, projectRoot);\n\tconst htmlDir =\n\t\thtmlDirectory && validateSafePath(htmlDirectory, projectRoot);\n\tconst htmxDir =\n\t\thtmxDirectory && validateSafePath(htmxDirectory, projectRoot);\n\tconst svelteDir =\n\t\tsvelteDirectory && validateSafePath(svelteDirectory, projectRoot);\n\tconst vueDir = vueDirectory && validateSafePath(vueDirectory, projectRoot);\n\n\tconst reactIndexesPath = reactDir && join(reactDir, 'indexes');\n\tconst reactPagesPath = reactDir && join(reactDir, 'pages');\n\tconst htmlPagesPath = htmlDir && join(htmlDir, 'pages');\n\tconst htmlScriptsPath = htmlDir && join(htmlDir, 'scripts');\n\tconst sveltePagesPath = svelteDir && join(svelteDir, 'pages');\n\tconst vuePagesPath = vueDir && join(vueDir, 'pages');\n\n\tconst frontends = [reactDir, htmlDir, htmxDir, svelteDir, vueDir].filter(\n\t\tBoolean\n\t);\n\tconst isSingle = frontends.length === 1;\n\n\tlet serverOutDir;\n\tif (svelteDir) {\n\t\tserverOutDir = join(buildPath, basename(svelteDir), 'pages');\n\t} else if (vueDir) {\n\t\tserverOutDir = join(buildPath, basename(vueDir), 'pages');\n\t}\n\n\tlet serverRoot;\n\tif (svelteDir) {\n\t\tserverRoot = join(svelteDir, 'pages');\n\t} else if (vueDir) {\n\t\tserverRoot = join(vueDir, 'pages');\n\t}\n\n\tawait rm(buildPath, { force: true, recursive: true });\n\tawait mkdir(buildPath);\n\n\tif (reactIndexesPath && reactPagesPath)\n\t\tawait generateReactIndexFiles(reactPagesPath, reactIndexesPath);\n\tif (assetsPath)\n\t\tawait cp(assetsPath, join(buildPath, 'assets'), {\n\t\t\tforce: true,\n\t\t\trecursive: true\n\t\t});\n\tif (htmxDir) {\n\t\tawait mkdir(join(buildPath, 'htmx'));\n\t\tawait cp(htmxDir, join(buildPath, 'htmx'), {\n\t\t\tforce: true,\n\t\t\trecursive: true\n\t\t});\n\t}\n\tif (tailwind)\n\t\tawait $`bunx @tailwindcss/cli -i ${tailwind.input} -o ${join(buildPath, tailwind.output)}`;\n\n\tconst reactEntries = reactIndexesPath\n\t\t? await scanEntryPoints(reactIndexesPath, '*.tsx')\n\t\t: [];\n\tconst htmlEntries = htmlScriptsPath\n\t\t? await scanEntryPoints(htmlScriptsPath, '*.{js,ts}')\n\t\t: [];\n\tconst svelteEntries = sveltePagesPath\n\t\t? await scanEntryPoints(sveltePagesPath, '*.svelte')\n\t\t: [];\n\tconst vueEntries = vuePagesPath\n\t\t? await scanEntryPoints(vuePagesPath, '*.vue')\n\t\t: [];\n\n\tconst { svelteServerPaths, svelteClientPaths } = svelteDir\n\t\t? await compileSvelte(svelteEntries, svelteDir)\n\t\t: { svelteClientPaths: [], svelteServerPaths: [] };\n\n\tconst { vueServerPaths, vueClientPaths, vueCssPaths } = vueDir\n\t\t? await compileVue(vueEntries, vueDir)\n\t\t: { vueClientPaths: [], vueCssPaths: {}, vueServerPaths: [] };\n\n\tconst serverEntryPoints = [...svelteServerPaths, ...vueServerPaths];\n\tconst clientEntryPoints = [\n\t\t...reactEntries,\n\t\t...svelteClientPaths,\n\t\t...htmlEntries,\n\t\t...vueClientPaths\n\t];\n\n\tif (serverEntryPoints.length === 0 && clientEntryPoints.length === 0) {\n\t\tconsole.warn('No entry points found');\n\n\t\treturn null;\n\t}\n\n\tlet serverLogs: (BuildMessage | ResolveMessage)[] = [];\n\tlet serverOutputs: BuildArtifact[] = [];\n\n\tif (serverEntryPoints.length > 0) {\n\t\tconst { logs, outputs } = await bunBuild({\n\t\t\tentrypoints: serverEntryPoints,\n\t\t\tformat: 'esm',\n\t\t\tnaming: `[dir]/[name].[hash].[ext]`,\n\t\t\toutdir: serverOutDir,\n\t\t\troot: serverRoot,\n\t\t\ttarget: 'bun'\n\t\t}).catch((err) => {\n\t\t\tconsole.error('Server build failed:', err);\n\t\t\texit(1);\n\t\t});\n\t\tserverLogs = logs;\n\t\tserverOutputs = outputs;\n\t}\n\n\tlet clientLogs: (BuildMessage | ResolveMessage)[] = [];\n\tlet clientOutputs: BuildArtifact[] = [];\n\n\tif (clientEntryPoints.length > 0) {\n\t\tconst roots: string[] = [reactDir, svelteDir, htmlDir, vueDir].filter(\n\t\t\t(dir): dir is string => Boolean(dir)\n\t\t);\n\t\tconst clientRoot = isSingle\n\t\t\t? (roots[0] ?? projectRoot)\n\t\t\t: commonAncestor(roots, projectRoot);\n\t\tconst { logs, outputs } = await bunBuild({\n\t\t\tdefine: vueDirectory ? vueFeatureFlags : undefined,\n\t\t\tentrypoints: clientEntryPoints,\n\t\t\tformat: 'esm',\n\t\t\tnaming: `[dir]/[name].[hash].[ext]`,\n\t\t\toutdir: buildPath,\n\t\t\troot: clientRoot,\n\t\t\ttarget: 'browser'\n\t\t}).catch((err) => {\n\t\t\tconsole.error('Client build failed:', err);\n\t\t\texit(1);\n\t\t});\n\t\tclientLogs = logs;\n\t\tclientOutputs = outputs;\n\t}\n\n\tconst allLogs = [...serverLogs, ...clientLogs];\n\tfor (const log of allLogs) {\n\t\tif (typeof log !== 'object' || log === null || !('level' in log))\n\t\t\tcontinue;\n\t\tif (log.level === 'error' && (console.error(log), 1)) continue;\n\t\tif (log.level === 'warning' && (console.warn(log), 1)) continue;\n\t\tconsole.info(log);\n\t}\n\n\tconst manifest = generateManifest(\n\t\t[...serverOutputs, ...clientOutputs],\n\t\tbuildPath\n\t);\n\n\tif (htmlDir && htmlPagesPath) {\n\t\tconst outputHtmlPages = join(buildPath, basename(htmlDir), 'pages');\n\t\tawait mkdir(outputHtmlPages, { recursive: true });\n\t\tawait cp(htmlPagesPath, outputHtmlPages, {\n\t\t\tforce: true,\n\t\t\trecursive: true\n\t\t});\n\t\tawait updateScriptTags(manifest, outputHtmlPages);\n\t}\n\n\tif (!options?.preserveIntermediateFiles && svelteDir) {\n\t\tawait rm(join(svelteDir, 'indexes'), { force: true, recursive: true });\n\t\tawait rm(join(svelteDir, 'client'), { force: true, recursive: true });\n\t\tawait Promise.all(\n\t\t\tsvelteServerPaths.map((path) => rm(path, { force: true }))\n\t\t);\n\t}\n\n\tif (!options?.preserveIntermediateFiles && reactIndexesPath)\n\t\tawait rm(reactIndexesPath, { force: true, recursive: true });\n\n\tconsole.log(\n\t\t`Build completed in ${getDurationString(performance.now() - buildStart)}`\n\t);\n\n\treturn { ...manifest, ...vueCssPaths };\n};\n",
7
- "import { mkdir } from 'node:fs/promises';\nimport { basename, join } from 'node:path';\nimport { env } from 'node:process';\nimport { write, file } from 'bun';\nimport { compile, preprocess } from 'svelte/compiler';\n\nexport const compileSvelte = async (\n\tentryPoints: string[],\n\toutputDirectory: string\n) => {\n\tconst pagesDir = join(outputDirectory, 'pages');\n\tconst clientDir = join(outputDirectory, 'client');\n\tconst indexesDir = join(outputDirectory, 'indexes');\n\n\tawait Promise.all([\n\t\tmkdir(clientDir, { recursive: true }),\n\t\tmkdir(indexesDir, { recursive: true })\n\t]);\n\n\tconst isDev = env.NODE_ENV === 'development';\n\n\tconst builds = await Promise.all(\n\t\tentryPoints.map(async (entry) => {\n\t\t\tconst source = await file(entry).text();\n\t\t\tconst { code: pre } = await preprocess(source, {});\n\n\t\t\tconst name = basename(entry, '.svelte');\n\n\t\t\tconst { js: ssrJs } = compile(pre, {\n\t\t\t\tcss: 'injected',\n\t\t\t\tdev: isDev,\n\t\t\t\tfilename: entry,\n\t\t\t\tgenerate: 'server'\n\t\t\t});\n\t\t\tconst ssrPath = join(pagesDir, `${name}.js`);\n\n\t\t\tconst { js: clientJs } = compile(pre, {\n\t\t\t\tcss: 'injected',\n\t\t\t\tdev: isDev,\n\t\t\t\tfilename: entry,\n\t\t\t\tgenerate: 'client'\n\t\t\t});\n\t\t\tconst clientComponentPath = join(clientDir, `${name}.js`);\n\n\t\t\tconst bootstrap = `import Component from \"../client/${name}.js\";\nimport { hydrate } from \"svelte\";\nhydrate(Component,{target:document.body,props:window.__INITIAL_PROPS__??{}});`;\n\t\t\tconst clientIndexPath = join(indexesDir, `${name}.js`);\n\n\t\t\tawait Promise.all([\n\t\t\t\twrite(ssrPath, ssrJs.code),\n\t\t\t\twrite(clientComponentPath, clientJs.code),\n\t\t\t\twrite(clientIndexPath, bootstrap)\n\t\t\t]);\n\n\t\t\treturn { clientIndexPath, ssrPath };\n\t\t})\n\t);\n\n\treturn {\n\t\tsvelteClientPaths: builds.map(({ clientIndexPath }) => clientIndexPath),\n\t\tsvelteServerPaths: builds.map(({ ssrPath }) => ssrPath)\n\t};\n};\n",
8
- "import { mkdir } from 'node:fs/promises';\nimport { basename, extname, join, relative } from 'node:path';\nimport {\n\tparse,\n\tcompileScript,\n\tcompileTemplate,\n\tcompileStyle\n} from '@vue/compiler-sfc';\nimport { file, write } from 'bun';\n\nexport const compileVue = async (\n\tentryPoints: string[],\n\toutputDirectory: string\n) => {\n\tconst pagesDir = join(outputDirectory, 'pages');\n\tconst scriptsDir = join(outputDirectory, 'scripts');\n\tconst stylesDir = join(outputDirectory, 'styles');\n\tconst clientDir = join(outputDirectory, 'client');\n\tconst indexesDir = join(outputDirectory, 'indexes');\n\n\tawait Promise.all([\n\t\tmkdir(pagesDir, { recursive: true }),\n\t\tmkdir(scriptsDir, { recursive: true }),\n\t\tmkdir(stylesDir, { recursive: true }),\n\t\tmkdir(clientDir, { recursive: true }),\n\t\tmkdir(indexesDir, { recursive: true })\n\t]);\n\n\tconst results = await Promise.all(\n\t\tentryPoints.map(async (entry) => {\n\t\t\tconst source = await file(entry).text();\n\t\t\tconst filename = basename(entry);\n\t\t\tconst name = basename(entry, extname(entry));\n\t\t\tconst { descriptor } = parse(source, { filename });\n\n\t\t\tconst cssFiles = await Promise.all(\n\t\t\t\tdescriptor.styles.map(async (styleBlock, idx) => {\n\t\t\t\t\tconst outName =\n\t\t\t\t\t\tdescriptor.styles.length === 1\n\t\t\t\t\t\t\t? `${name}.css`\n\t\t\t\t\t\t\t: `${name}.${idx}.css`;\n\t\t\t\t\tconst { code } = compileStyle({\n\t\t\t\t\t\tfilename,\n\t\t\t\t\t\tid: name,\n\t\t\t\t\t\tscoped: Boolean(styleBlock.scoped),\n\t\t\t\t\t\tsource: styleBlock.content,\n\t\t\t\t\t\ttrim: true\n\t\t\t\t\t});\n\t\t\t\t\tawait write(join(stylesDir, outName), code);\n\n\t\t\t\t\treturn outName;\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tconst scriptBlock = compileScript(descriptor, {\n\t\t\t\tid: name,\n\t\t\t\tinlineTemplate: false\n\t\t\t});\n\t\t\tconst scriptPath = join(scriptsDir, `${name}.ts`);\n\t\t\tconst cleanedScript = scriptBlock.content.replace(\n\t\t\t\t/setup\\(\\s*__props\\s*:\\s*any/g,\n\t\t\t\t'setup(__props'\n\t\t\t);\n\t\t\tawait write(scriptPath, cleanedScript);\n\n\t\t\tconst ssrTpl = compileTemplate({\n\t\t\t\tcompilerOptions: {\n\t\t\t\t\tbindingMetadata: scriptBlock.bindings,\n\t\t\t\t\tprefixIdentifiers: true\n\t\t\t\t},\n\t\t\t\tfilename,\n\t\t\t\tid: name,\n\t\t\t\tsource: descriptor.template?.content ?? '',\n\t\t\t\tssr: true,\n\t\t\t\tssrCssVars: descriptor.cssVars\n\t\t\t});\n\n\t\t\tconst serverImport = `import scriptMod, * as named from '../scripts/${name}.ts';`;\n\t\t\tlet ssrCode = ssrTpl.code.replace(\n\t\t\t\t/(import\\s+[^\\n]+[\"']vue\\/server-renderer[\"'][^\\n]*\\n)/,\n\t\t\t\t`$1${serverImport}\\n`\n\t\t\t);\n\t\t\tif (/import\\s*\\{[^}]+\\}\\s*from\\s*['\"]vue['\"]/.test(ssrCode)) {\n\t\t\t\tssrCode = ssrCode.replace(\n\t\t\t\t\t/import\\s*\\{([^}]+)\\}\\s*from\\s*['\"]vue['\"];?/,\n\t\t\t\t\t(_, imports) =>\n\t\t\t\t\t\t`import { defineComponent, ${imports.trim()} } from 'vue';`\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tssrCode = `import { defineComponent } from 'vue';\\n${ssrCode}`;\n\t\t\t}\n\n\t\t\tconst ssrPath = join(pagesDir, `${name}.js`);\n\t\t\tawait write(\n\t\t\t\tssrPath,\n\t\t\t\t[\n\t\t\t\t\tssrCode,\n\t\t\t\t\t`export default defineComponent({ ...scriptMod, ...named, ssrRender });`\n\t\t\t\t].join('\\n')\n\t\t\t);\n\n\t\t\tconst clientTpl = compileTemplate({\n\t\t\t\tcompilerOptions: {\n\t\t\t\t\tbindingMetadata: scriptBlock.bindings,\n\t\t\t\t\tcacheHandlers: true,\n\t\t\t\t\thoistStatic: true,\n\t\t\t\t\tmode: 'module',\n\t\t\t\t\tprefixIdentifiers: true\n\t\t\t\t},\n\t\t\t\tfilename,\n\t\t\t\tid: name,\n\t\t\t\tsource: descriptor.template?.content ?? ''\n\t\t\t});\n\n\t\t\tlet clientCode = clientTpl.code;\n\t\t\tconst clientImport = `import scriptMod, * as named from '../scripts/${name}.ts'`;\n\t\t\tif (/import\\s*\\{[^}]+\\}\\s*from\\s*['\"]vue['\"]/.test(clientCode)) {\n\t\t\t\tclientCode = clientCode.replace(\n\t\t\t\t\t/import\\s*\\{([^}]+)\\}\\s*from\\s*['\"]vue['\"];?/,\n\t\t\t\t\t(_, imports) =>\n\t\t\t\t\t\t`import { defineComponent, ${imports.trim()} } from 'vue';\\n${clientImport}`\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tclientCode = `import { defineComponent } from 'vue';\\n${clientImport}\\n${clientCode}`;\n\t\t\t}\n\n\t\t\tconst clientComponentPath = join(clientDir, `${name}.js`);\n\t\t\tawait write(\n\t\t\t\tclientComponentPath,\n\t\t\t\t[\n\t\t\t\t\tclientCode,\n\t\t\t\t\t`export default defineComponent({ ...scriptMod, ...named, render })`\n\t\t\t\t].join('\\n')\n\t\t\t);\n\n\t\t\tconst clientIndexPath = join(indexesDir, `${name}.js`);\n\t\t\tawait write(\n\t\t\t\tclientIndexPath,\n\t\t\t\t[\n\t\t\t\t\t`import Comp from '${relative(indexesDir, clientComponentPath)}'`,\n\t\t\t\t\t`import { createSSRApp } from 'vue'`,\n\t\t\t\t\t`const props = window.__INITIAL_PROPS__ ?? {}`,\n\t\t\t\t\t`const app = createSSRApp(Comp, props)`,\n\t\t\t\t\t`app.mount('#app')`\n\t\t\t\t].join('\\n')\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tclientIndexPath,\n\t\t\t\tcssFiles,\n\t\t\t\tcssKey: `${name}CSS`,\n\t\t\t\tserverPath: ssrPath\n\t\t\t};\n\t\t})\n\t);\n\n\tconst vueClientPaths = results.map(\n\t\t({ clientIndexPath }) => clientIndexPath\n\t);\n\tconst vueServerPaths = results.map(({ serverPath }) => serverPath);\n\tconst vueCssPaths = results.reduce<Record<string, string[]>>(\n\t\t(acc, { cssKey, cssFiles }) => {\n\t\t\tacc[cssKey] = cssFiles;\n\n\t\t\treturn acc;\n\t\t},\n\t\t{}\n\t);\n\n\treturn { vueClientPaths, vueCssPaths, vueServerPaths };\n};\n",
9
- "import { BuildArtifact } from 'bun';\n\nexport const generateManifest = (\n\toutputs: BuildArtifact[],\n\tbuildDirectoryAbsolute: string\n) =>\n\toutputs.reduce<Record<string, string>>((manifest, artifact) => {\n\t\tlet relative = artifact.path.startsWith(buildDirectoryAbsolute)\n\t\t\t? artifact.path.slice(buildDirectoryAbsolute.length)\n\t\t\t: artifact.path;\n\t\trelative = relative.replace(/^\\/+/, '');\n\n\t\tconst segments = relative.split('/');\n\t\tconst fileWithHash = segments.pop();\n\t\tif (!fileWithHash) return manifest;\n\n\t\tconst [baseName] = fileWithHash.split(`.${artifact.hash}.`);\n\t\tif (!baseName) return manifest;\n\n\t\tconst folder = segments.length > 1 ? segments[1] : segments[0];\n\n\t\tif (folder === 'indexes') {\n\t\t\tmanifest[`${baseName}Index`] = `/${relative}`;\n\t\t} else if (folder === 'pages') {\n\t\t\tmanifest[baseName] = artifact.path;\n\t\t} else {\n\t\t\tmanifest[baseName] = `/${relative}`;\n\t\t}\n\n\t\treturn manifest;\n\t}, {});\n",
6
+ "import { rm, mkdir, cp } from 'node:fs/promises';\nimport { basename, join, sep } from 'node:path';\nimport { cwd, env, exit } from 'node:process';\nimport { $, build as bunBuild, BuildArtifact } from 'bun';\nimport { compileSvelte } from '../build/compileSvelte';\nimport { compileVue } from '../build/compileVue';\nimport { generateManifest } from '../build/generateManifest';\nimport { generateReactIndexFiles } from '../build/generateReactIndexes';\nimport { scanEntryPoints } from '../build/scanEntryPoints';\nimport { updateHTMLAssetPaths } from '../build/updateHTMLAssetPaths';\nimport { BuildConfig } from '../types';\nimport { getDurationString } from '../utils/getDurationString';\nimport { validateSafePath } from '../utils/validateSafePath';\n\nconst commonAncestor = (paths: string[], fallback: string) => {\n\tif (paths.length === 0) return fallback;\n\tconst segmentsList = paths.map((p) => p.split(sep));\n\tconst [first] = segmentsList;\n\tif (!first) return fallback;\n\tconst commonSegments = first.filter((segment, index) =>\n\t\tsegmentsList.every((pathSegs) => pathSegs[index] === segment)\n\t);\n\n\treturn commonSegments.length ? commonSegments.join(sep) : fallback;\n};\n\nconst isDev = env.NODE_ENV === 'development';\n\nconst vueFeatureFlags: Record<string, string> = {\n\t__VUE_OPTIONS_API__: 'true',\n\t__VUE_PROD_DEVTOOLS__: isDev ? 'true' : 'false',\n\t__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDev ? 'true' : 'false'\n};\n\nexport const build = async ({\n\tbuildDirectory = 'build',\n\tassetsDirectory = 'assets',\n\treactDirectory,\n\thtmlDirectory,\n\thtmxDirectory,\n\tsvelteDirectory,\n\tvueDirectory,\n\ttailwind,\n\toptions\n}: BuildConfig) => {\n\tconst buildStart = performance.now();\n\tconst projectRoot = cwd();\n\n\tconst buildPath = validateSafePath(buildDirectory, projectRoot);\n\tconst assetsPath =\n\t\tassetsDirectory && validateSafePath(assetsDirectory, projectRoot);\n\tconst reactDir =\n\t\treactDirectory && validateSafePath(reactDirectory, projectRoot);\n\tconst htmlDir =\n\t\thtmlDirectory && validateSafePath(htmlDirectory, projectRoot);\n\tconst htmxDir =\n\t\thtmxDirectory && validateSafePath(htmxDirectory, projectRoot);\n\tconst svelteDir =\n\t\tsvelteDirectory && validateSafePath(svelteDirectory, projectRoot);\n\tconst vueDir = vueDirectory && validateSafePath(vueDirectory, projectRoot);\n\n\tconst reactIndexesPath = reactDir && join(reactDir, 'indexes');\n\tconst reactPagesPath = reactDir && join(reactDir, 'pages');\n\tconst htmlPagesPath = htmlDir && join(htmlDir, 'pages');\n\tconst htmlScriptsPath = htmlDir && join(htmlDir, 'scripts');\n\tconst sveltePagesPath = svelteDir && join(svelteDir, 'pages');\n\tconst vuePagesPath = vueDir && join(vueDir, 'pages');\n\n\tconst frontends = [reactDir, htmlDir, htmxDir, svelteDir, vueDir].filter(\n\t\tBoolean\n\t);\n\tconst isSingle = frontends.length === 1;\n\n\tlet serverOutDir;\n\tif (svelteDir) serverOutDir = join(buildPath, basename(svelteDir), 'pages');\n\telse if (vueDir) serverOutDir = join(buildPath, basename(vueDir), 'pages');\n\n\tlet serverRoot;\n\tif (svelteDir) serverRoot = join(svelteDir, 'pages');\n\telse if (vueDir) serverRoot = join(vueDir, 'pages');\n\n\tawait rm(buildPath, { force: true, recursive: true });\n\tawait mkdir(buildPath);\n\n\tif (reactIndexesPath && reactPagesPath)\n\t\tawait generateReactIndexFiles(reactPagesPath, reactIndexesPath);\n\n\tif (assetsPath)\n\t\tawait cp(assetsPath, join(buildPath, 'assets'), {\n\t\t\tforce: true,\n\t\t\trecursive: true\n\t\t});\n\n\tif (htmxDir) {\n\t\tawait mkdir(join(buildPath, 'htmx'));\n\t\tawait cp(htmxDir, join(buildPath, 'htmx'), {\n\t\t\tforce: true,\n\t\t\trecursive: true\n\t\t});\n\t}\n\n\tif (tailwind)\n\t\tawait $`bunx @tailwindcss/cli -i ${tailwind.input} -o ${join(buildPath, tailwind.output)}`;\n\n\tconst reactEntries = reactIndexesPath\n\t\t? await scanEntryPoints(reactIndexesPath, '*.tsx')\n\t\t: [];\n\tconst htmlEntries = htmlScriptsPath\n\t\t? await scanEntryPoints(htmlScriptsPath, '*.{js,ts}')\n\t\t: [];\n\tconst svelteEntries = sveltePagesPath\n\t\t? await scanEntryPoints(sveltePagesPath, '*.svelte')\n\t\t: [];\n\tconst vueEntries = vuePagesPath\n\t\t? await scanEntryPoints(vuePagesPath, '*.vue')\n\t\t: [];\n\n\tconst htmlCssEntries = htmlDir\n\t\t? await scanEntryPoints(join(htmlDir, 'styles'), '*.css')\n\t\t: [];\n\tconst reactCssEntries = reactDir\n\t\t? await scanEntryPoints(join(reactDir, 'styles'), '*.css')\n\t\t: [];\n\tconst svelteCssEntries = svelteDir\n\t\t? await scanEntryPoints(join(svelteDir, 'styles'), '*.css')\n\t\t: [];\n\n\tconst { svelteServerPaths, svelteClientPaths } = svelteDir\n\t\t? await compileSvelte(svelteEntries, svelteDir)\n\t\t: { svelteClientPaths: [], svelteServerPaths: [] };\n\n\tconst { vueServerPaths, vueIndexPaths, vueCssPaths } = vueDir\n\t\t? await compileVue(vueEntries, vueDir)\n\t\t: { vueCssPaths: [], vueIndexPaths: [], vueServerPaths: [] };\n\n\tconst serverEntryPoints = [...svelteServerPaths, ...vueServerPaths];\n\tconst clientEntryPoints = [\n\t\t...reactEntries,\n\t\t...svelteClientPaths,\n\t\t...htmlEntries,\n\t\t...vueIndexPaths\n\t];\n\tconst cssEntryPoints = [\n\t\t...vueCssPaths,\n\t\t...reactCssEntries,\n\t\t...svelteCssEntries,\n\t\t...htmlCssEntries\n\t];\n\n\tif (serverEntryPoints.length === 0 && clientEntryPoints.length === 0) {\n\t\tconsole.warn('No entry points found, manifest will be empty.');\n\n\t\treturn {};\n\t}\n\n\tlet serverLogs: (BuildMessage | ResolveMessage)[] = [];\n\tlet serverOutputs: BuildArtifact[] = [];\n\n\tif (serverEntryPoints.length > 0) {\n\t\tconst { logs, outputs } = await bunBuild({\n\t\t\tentrypoints: serverEntryPoints,\n\t\t\tformat: 'esm',\n\t\t\tnaming: `[dir]/[name].[hash].[ext]`,\n\t\t\toutdir: serverOutDir,\n\t\t\troot: serverRoot,\n\t\t\ttarget: 'bun'\n\t\t}).catch((err) => {\n\t\t\tconsole.error('Server build failed:', err);\n\t\t\texit(1);\n\t\t});\n\t\tserverLogs = logs;\n\t\tserverOutputs = outputs;\n\t}\n\n\tlet clientLogs: (BuildMessage | ResolveMessage)[] = [];\n\tlet clientOutputs: BuildArtifact[] = [];\n\n\tif (clientEntryPoints.length > 0) {\n\t\tconst roots: string[] = [reactDir, svelteDir, htmlDir, vueDir].filter(\n\t\t\t(dir): dir is string => Boolean(dir)\n\t\t);\n\t\tconst clientRoot = isSingle\n\t\t\t? (roots[0] ?? projectRoot)\n\t\t\t: commonAncestor(roots, projectRoot);\n\t\tconst { logs, outputs } = await bunBuild({\n\t\t\tdefine: vueDirectory ? vueFeatureFlags : undefined,\n\t\t\tentrypoints: clientEntryPoints,\n\t\t\tformat: 'esm',\n\t\t\tnaming: `[dir]/[name].[hash].[ext]`,\n\t\t\toutdir: buildPath,\n\t\t\troot: clientRoot,\n\t\t\ttarget: 'browser'\n\t\t}).catch((err) => {\n\t\t\tconsole.error('Client build failed:', err);\n\t\t\texit(1);\n\t\t});\n\t\tclientLogs = logs;\n\t\tclientOutputs = outputs;\n\t}\n\n\tlet cssLogs: (BuildMessage | ResolveMessage)[] = [];\n\tlet cssOutputs: BuildArtifact[] = [];\n\n\tif (cssEntryPoints.length > 0) {\n\t\tconst { logs, outputs } = await bunBuild({\n\t\t\tentrypoints: cssEntryPoints,\n\t\t\tnaming: `[name].[hash].[ext]`,\n\t\t\toutdir: join(buildPath, basename(assetsPath), 'css'),\n\t\t\ttarget: 'browser'\n\t\t}).catch((err) => {\n\t\t\tconsole.error('CSS build failed:', err);\n\t\t\texit(1);\n\t\t});\n\t\tcssLogs = logs;\n\t\tcssOutputs = outputs;\n\t}\n\n\tconst allLogs = [...serverLogs, ...clientLogs, ...cssLogs];\n\tfor (const log of allLogs) {\n\t\tif (log.level === 'error') console.error(log);\n\t\telse if (log.level === 'warning') console.warn(log);\n\t\telse console.info(log);\n\t}\n\n\tconst manifest = generateManifest(\n\t\t[...serverOutputs, ...clientOutputs, ...cssOutputs],\n\t\tbuildPath\n\t);\n\n\tif (htmlDir && htmlPagesPath) {\n\t\tconst outputHtmlPages = join(buildPath, basename(htmlDir), 'pages');\n\t\tawait mkdir(outputHtmlPages, { recursive: true });\n\t\tawait cp(htmlPagesPath, outputHtmlPages, {\n\t\t\tforce: true,\n\t\t\trecursive: true\n\t\t});\n\t\tawait updateHTMLAssetPaths(manifest, outputHtmlPages);\n\t}\n\n\tif (!options?.preserveIntermediateFiles && svelteDir) {\n\t\tawait rm(join(svelteDir, 'indexes'), { force: true, recursive: true });\n\t\tawait rm(join(svelteDir, 'client'), { force: true, recursive: true });\n\t\tawait Promise.all(\n\t\t\tsvelteServerPaths.map((path) => rm(path, { force: true }))\n\t\t);\n\t\t// TODO: remove when the files are generated inline instead of output\n\t\tawait rm(join(svelteDir, 'pages', 'example'), {\n\t\t\tforce: true,\n\t\t\trecursive: true\n\t\t});\n\t}\n\n\tif (!options?.preserveIntermediateFiles && vueDir) {\n\t\tawait rm(join(vueDir, 'indexes'), { force: true, recursive: true });\n\t\tawait rm(join(vueDir, 'client'), { force: true, recursive: true });\n\t\tawait rm(join(vueDir, 'styles'), { force: true, recursive: true });\n\t\tawait Promise.all(\n\t\t\tvueServerPaths.map((path) => rm(path, { force: true }))\n\t\t);\n\t\t// TODO: remove when the files are generated inline instead of output\n\t\tawait rm(join(vueDir, 'pages', 'example'), {\n\t\t\tforce: true,\n\t\t\trecursive: true\n\t\t});\n\t}\n\n\tif (!options?.preserveIntermediateFiles && reactIndexesPath)\n\t\tawait rm(reactIndexesPath, { force: true, recursive: true });\n\n\tconsole.log(\n\t\t`Build completed in ${getDurationString(performance.now() - buildStart)}`\n\t);\n\n\treturn manifest;\n};\n",
7
+ "import { mkdir, stat } from 'node:fs/promises';\nimport {\n\tdirname,\n\tjoin,\n\tbasename,\n\textname,\n\tresolve,\n\trelative,\n\tsep\n} from 'node:path';\nimport { cwd, env } from 'node:process';\nimport { write, file, Transpiler } from 'bun';\nimport { compile, compileModule, preprocess } from 'svelte/compiler';\n\ntype Built = { ssr: string; client: string };\ntype Cache = Map<string, Built>;\n\nconst exists = async (filepath: string) => {\n\ttry {\n\t\tawait stat(filepath);\n\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\nconst resolveSvelte = async (spec: string, from: string) => {\n\tconst basePath = resolve(dirname(from), spec);\n\tconst explicit = /\\.(svelte|svelte\\.(?:ts|js))$/.test(basePath);\n\n\tif (!explicit) {\n\t\tconst extensions = ['.svelte', '.svelte.ts', '.svelte.js'];\n\t\tconst paths = extensions.map((ext) => `${basePath}${ext}`);\n\t\tconst checks = await Promise.all(paths.map(exists));\n\t\tconst match = paths.find((_, index) => checks[index]);\n\n\t\treturn match ?? null;\n\t}\n\n\tif (await exists(basePath)) return basePath;\n\tif (!basePath.endsWith('.svelte')) return null;\n\n\tconst tsPath = `${basePath}.ts`;\n\tif (await exists(tsPath)) return tsPath;\n\n\tconst jsPath = `${basePath}.js`;\n\tif (await exists(jsPath)) return jsPath;\n\n\treturn null;\n};\n\nconst transpiler = new Transpiler({ loader: 'ts', target: 'browser' });\nconst projectRoot = cwd();\n\nexport const compileSvelte = async (\n\tentryPoints: string[],\n\toutRoot: string,\n\tcache: Cache = new Map()\n) => {\n\tconst clientFolder = 'client';\n\tconst indexFolder = 'indexes';\n\tconst pagesFolder = 'pages';\n\n\tawait Promise.all(\n\t\t[clientFolder, indexFolder, pagesFolder].map((d) =>\n\t\t\tmkdir(join(outRoot, d), { recursive: true })\n\t\t)\n\t);\n\n\tconst dev = env.NODE_ENV === 'development';\n\n\tconst build = async (src: string) => {\n\t\tconst memo = cache.get(src);\n\t\tif (memo) return memo;\n\n\t\tconst raw = await file(src).text();\n\t\tconst isModule =\n\t\t\tsrc.endsWith('.svelte.ts') || src.endsWith('.svelte.js');\n\t\tconst prepped = isModule ? raw : (await preprocess(raw, {})).code;\n\t\tconst transpiledCode =\n\t\t\tsrc.endsWith('.ts') || src.endsWith('.svelte.ts')\n\t\t\t\t? transpiler.transformSync(prepped)\n\t\t\t\t: prepped;\n\n\t\tconst relDir = dirname(relative(projectRoot, src));\n\t\tconst baseName = basename(src).replace(/\\.svelte(\\.(ts|js))?$/, '');\n\n\t\tconst importPaths = Array.from(\n\t\t\ttranspiledCode.matchAll(/from\\s+['\"]([^'\"]+)['\"]/g)\n\t\t)\n\t\t\t.map((m) => m[1])\n\t\t\t.filter((p): p is string => p !== undefined);\n\n\t\tconst resolveResults = await Promise.all(\n\t\t\timportPaths.map((p) => resolveSvelte(p, src))\n\t\t);\n\t\tconst childSources = resolveResults.filter(\n\t\t\t(path): path is string => path !== undefined\n\t\t);\n\t\tawait Promise.all(childSources.map((p) => build(p)));\n\n\t\tconst generate = (mode: 'server' | 'client') =>\n\t\t\t(isModule\n\t\t\t\t? compileModule(transpiledCode, { dev, filename: src }).js.code\n\t\t\t\t: compile(transpiledCode, {\n\t\t\t\t\t\tcss: 'injected',\n\t\t\t\t\t\tdev,\n\t\t\t\t\t\tfilename: src,\n\t\t\t\t\t\tgenerate: mode\n\t\t\t\t\t}).js.code\n\t\t\t).replace(/\\.svelte(?:\\.(?:ts|js))?(['\"])/g, '.js$1');\n\n\t\tconst ssrPath = join(outRoot, pagesFolder, relDir, `${baseName}.js`);\n\t\tconst clientPath = join(\n\t\t\toutRoot,\n\t\t\tclientFolder,\n\t\t\trelDir,\n\t\t\t`${baseName}.js`\n\t\t);\n\n\t\tawait Promise.all([\n\t\t\tmkdir(dirname(ssrPath), { recursive: true }),\n\t\t\tmkdir(dirname(clientPath), { recursive: true })\n\t\t]);\n\n\t\tif (isModule) {\n\t\t\tconst bundle = generate('client');\n\t\t\tawait Promise.all([\n\t\t\t\twrite(ssrPath, bundle),\n\t\t\t\twrite(clientPath, bundle)\n\t\t\t]);\n\t\t} else {\n\t\t\tconst serverBundle = generate('server');\n\t\t\tconst clientBundle = generate('client');\n\t\t\tawait Promise.all([\n\t\t\t\twrite(ssrPath, serverBundle),\n\t\t\t\twrite(clientPath, clientBundle)\n\t\t\t]);\n\t\t}\n\n\t\tconst built: Built = { client: clientPath, ssr: ssrPath };\n\t\tcache.set(src, built);\n\n\t\treturn built;\n\t};\n\n\tconst roots = await Promise.all(entryPoints.map(build));\n\n\tawait Promise.all(\n\t\troots.map(({ client }) => {\n\t\t\tconst relClientDir = dirname(\n\t\t\t\trelative(join(outRoot, clientFolder), client)\n\t\t\t);\n\t\t\tconst name = basename(client, extname(client));\n\t\t\tconst indexDir = join(outRoot, indexFolder, relClientDir);\n\t\t\tconst importPathRaw = relative(indexDir, client)\n\t\t\t\t.split(sep)\n\t\t\t\t.join('/');\n\t\t\tconst importPath = importPathRaw.startsWith('.')\n\t\t\t\t? importPathRaw\n\t\t\t\t: `./${importPathRaw}`;\n\n\t\t\tconst indexPath = join(indexDir, `${name}.js`);\n\t\t\tconst boot = `import C from \"${importPath}\";\nimport { hydrate } from \"svelte\";\nhydrate(C,{target:document.body,props:window.__INITIAL_PROPS__??{}});`;\n\n\t\t\treturn mkdir(indexDir, { recursive: true }).then(() =>\n\t\t\t\twrite(indexPath, boot)\n\t\t\t);\n\t\t})\n\t);\n\n\treturn {\n\t\tsvelteClientPaths: roots.map(({ client }) => {\n\t\t\tconst rel = dirname(relative(join(outRoot, clientFolder), client));\n\n\t\t\treturn join(outRoot, indexFolder, rel, basename(client));\n\t\t}),\n\t\tsvelteServerPaths: roots.map(({ ssr }) => ssr)\n\t};\n};\n",
8
+ "import { mkdir } from 'node:fs/promises';\nimport { basename, dirname, join, relative, resolve } from 'node:path';\nimport { cwd } from 'node:process';\nimport {\n\tparse,\n\tcompileScript,\n\tcompileTemplate,\n\tcompileStyle\n} from '@vue/compiler-sfc';\nimport { file, write, Transpiler } from 'bun';\nimport { toKebab } from '../utils/stringModifiers';\n\nconst transpiler = new Transpiler({ loader: 'ts', target: 'browser' });\nconst projectRoot = cwd();\n\ntype BuildResult = {\n\tclientPath: string;\n\tserverPath: string;\n\tcssPaths: string[];\n\tcssCodes: string[];\n\ttsHelperPaths: string[];\n};\n\nconst extractImports = (sourceCode: string) =>\n\tArray.from(sourceCode.matchAll(/import\\s+[\\s\\S]+?['\"]([^'\"]+)['\"]/g))\n\t\t.map((match) => match[1])\n\t\t.filter((importPath): importPath is string => importPath !== undefined);\n\nconst toJsFileName = (path: string) => {\n\tif (path.endsWith('.vue')) {\n\t\treturn path.replace(/\\.vue$/, '.js');\n\t}\n\tif (path.endsWith('.ts')) {\n\t\treturn path.replace(/\\.ts$/, '.js');\n\t}\n\n\treturn `${path}.js`;\n};\n\nconst stripModuleExports = (sourceCode: string) =>\n\tsourceCode\n\t\t.replace(/export\\s+default/, 'const script =')\n\t\t.replace(/^export\\s+/gm, '');\n\nconst buildVueFile = async (\n\tabsolutePath: string,\n\toutputDirs: { client: string; server: string; css: string },\n\tcache: Map<string, BuildResult>,\n\tisEntryPage = false\n) => {\n\tif (cache.has(absolutePath)) return cache.get(absolutePath)!;\n\n\tconst relativePath = relative(projectRoot, absolutePath).replace(\n\t\t/\\\\/g,\n\t\t'/'\n\t);\n\tconst relativePathWithoutExt = relativePath.replace(/\\.vue$/, '');\n\tconst componentName = basename(absolutePath, '.vue');\n\tconst kebabId = toKebab(componentName);\n\n\tconst sourceCode = await file(absolutePath).text();\n\tconst { descriptor } = parse(sourceCode, { filename: absolutePath });\n\tconst originalSetupCode =\n\t\tdescriptor.scriptSetup?.content ?? descriptor.script?.content ?? '';\n\n\tconst relativeImports = extractImports(originalSetupCode);\n\tconst childVueImports = relativeImports.filter(\n\t\t(importPath): importPath is string =>\n\t\t\timportPath.startsWith('.') && importPath.endsWith('.vue')\n\t);\n\tconst tsHelperImports = relativeImports.filter(\n\t\t(importPath): importPath is string =>\n\t\t\timportPath.startsWith('.') && !importPath.endsWith('.vue')\n\t);\n\n\tconst childBuildResults = await Promise.all(\n\t\tchildVueImports.map((importPath) =>\n\t\t\tbuildVueFile(\n\t\t\t\tresolve(dirname(absolutePath), importPath),\n\t\t\t\toutputDirs,\n\t\t\t\tcache,\n\t\t\t\tfalse\n\t\t\t)\n\t\t)\n\t);\n\n\tconst compiledScript = compileScript(descriptor, {\n\t\tid: kebabId,\n\t\tinlineTemplate: false\n\t});\n\n\tconst transformedScript = transpiler\n\t\t.transformSync(stripModuleExports(compiledScript.content))\n\t\t.replace(\n\t\t\t/(['\"])(\\.{1,2}\\/[^'\"]+)(['\"])/g,\n\t\t\t(_, quote, importPath, endQuote) =>\n\t\t\t\tquote + toJsFileName(importPath) + endQuote\n\t\t);\n\n\tconst renderBlock = (forServer: boolean) =>\n\t\tcompileTemplate({\n\t\t\tcompilerOptions: {\n\t\t\t\tbindingMetadata: compiledScript.bindings,\n\t\t\t\tprefixIdentifiers: true\n\t\t\t},\n\t\t\tfilename: absolutePath,\n\t\t\tid: kebabId,\n\t\t\tscoped: descriptor.styles.some((s) => s.scoped),\n\t\t\tsource: descriptor.template?.content ?? '',\n\t\t\tssr: forServer,\n\t\t\tssrCssVars: descriptor.cssVars\n\t\t}).code.replace(\n\t\t\t/(['\"])(\\.{1,2}\\/[^'\"]+)(['\"])/g,\n\t\t\t(_, quote, importPath, endQuote) =>\n\t\t\t\tquote + toJsFileName(importPath) + endQuote\n\t\t);\n\n\tconst ownCssCodes = descriptor.styles.map(\n\t\t(styleBlock) =>\n\t\t\tcompileStyle({\n\t\t\t\tfilename: absolutePath,\n\t\t\t\tid: kebabId,\n\t\t\t\tscoped: styleBlock.scoped,\n\t\t\t\tsource: styleBlock.content,\n\t\t\t\ttrim: true\n\t\t\t}).code\n\t);\n\n\tconst aggregatedCssCodes = [\n\t\t...ownCssCodes,\n\t\t...childBuildResults.flatMap((result) => result.cssCodes)\n\t];\n\n\tlet emittedCssPaths: string[] = [];\n\tif (isEntryPage && aggregatedCssCodes.length) {\n\t\tconst cssOutputPath = join(\n\t\t\toutputDirs.css,\n\t\t\t`${toKebab(componentName)}.css`\n\t\t);\n\t\tawait mkdir(dirname(cssOutputPath), { recursive: true });\n\t\tawait write(cssOutputPath, aggregatedCssCodes.join('\\n'));\n\t\temittedCssPaths = [cssOutputPath];\n\t}\n\n\tconst buildModule = (\n\t\trenderCode: string,\n\t\trenderFunctionName: 'render' | 'ssrRender'\n\t) => {\n\t\tconst vueHeader = 'import { defineComponent } from \"vue\";';\n\n\t\treturn [\n\t\t\ttransformedScript,\n\t\t\trenderCode,\n\t\t\tvueHeader,\n\t\t\t`export default defineComponent({ ...script, ${renderFunctionName} });`\n\t\t].join('\\n');\n\t};\n\n\tconst clientModuleCode = buildModule(renderBlock(false), 'render');\n\tconst serverModuleCode = buildModule(renderBlock(true), 'ssrRender');\n\n\tconst clientOutPath = join(\n\t\toutputDirs.client,\n\t\t`${relativePathWithoutExt}.js`\n\t);\n\tconst serverOutPath = join(\n\t\toutputDirs.server,\n\t\t`${relativePathWithoutExt}.js`\n\t);\n\tawait mkdir(dirname(clientOutPath), { recursive: true });\n\tawait mkdir(dirname(serverOutPath), { recursive: true });\n\tawait write(clientOutPath, clientModuleCode);\n\tawait write(serverOutPath, serverModuleCode);\n\n\tconst buildResult: BuildResult = {\n\t\tclientPath: clientOutPath,\n\t\tcssCodes: aggregatedCssCodes,\n\t\tcssPaths: emittedCssPaths,\n\t\tserverPath: serverOutPath,\n\t\ttsHelperPaths: [\n\t\t\t...tsHelperImports.map((helper) =>\n\t\t\t\tresolve(\n\t\t\t\t\tdirname(absolutePath),\n\t\t\t\t\thelper.endsWith('.ts') ? helper : `${helper}.ts`\n\t\t\t\t)\n\t\t\t),\n\t\t\t...childBuildResults.flatMap((result) => result.tsHelperPaths)\n\t\t]\n\t};\n\tcache.set(absolutePath, buildResult);\n\n\treturn buildResult;\n};\n\nexport const compileVue = async (\n\tpageEntryPoints: string[],\n\toutputDirectory: string\n) => {\n\tconst clientDir = join(outputDirectory, 'client');\n\tconst indexDir = join(outputDirectory, 'indexes');\n\tconst pagesDir = join(outputDirectory, 'pages');\n\tconst stylesDir = join(outputDirectory, 'styles');\n\n\tawait Promise.all([\n\t\tmkdir(clientDir, { recursive: true }),\n\t\tmkdir(indexDir, { recursive: true }),\n\t\tmkdir(pagesDir, { recursive: true }),\n\t\tmkdir(stylesDir, { recursive: true })\n\t]);\n\n\tconst buildCache = new Map<string, BuildResult>();\n\tconst tsHelperSet = new Set<string>();\n\n\tconst pageResults = await Promise.all(\n\t\tpageEntryPoints.map(async (pageEntry) => {\n\t\t\tconst buildResult = await buildVueFile(\n\t\t\t\tresolve(pageEntry),\n\t\t\t\t{ client: clientDir, css: stylesDir, server: pagesDir },\n\t\t\t\tbuildCache,\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t\tbuildResult.tsHelperPaths.forEach((p) => tsHelperSet.add(p));\n\n\t\t\tconst relPath = relative(projectRoot, pageEntry).replace(\n\t\t\t\t/\\.vue$/,\n\t\t\t\t''\n\t\t\t);\n\t\t\tconst indexPath = join(indexDir, `${relPath}.js`);\n\t\t\tconst clientEntryPath = join(clientDir, `${relPath}.js`);\n\n\t\t\tawait mkdir(dirname(indexPath), { recursive: true });\n\t\t\tawait write(\n\t\t\t\tindexPath,\n\t\t\t\t[\n\t\t\t\t\t`import Comp from \"${relative(dirname(indexPath), clientEntryPath)}\";`,\n\t\t\t\t\t'import { createSSRApp } from \"vue\";',\n\t\t\t\t\t'const props = window.__INITIAL_PROPS__ ?? {};',\n\t\t\t\t\t'createSSRApp(Comp, props).mount(\"#root\");'\n\t\t\t\t].join('\\n')\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tcssPaths: buildResult.cssPaths,\n\t\t\t\tindexPath,\n\t\t\t\tserverPath: buildResult.serverPath\n\t\t\t};\n\t\t})\n\t);\n\n\tawait Promise.all(\n\t\tArray.from(tsHelperSet).map(async (src) => {\n\t\t\tconst code = transpiler.transformSync(await file(src).text());\n\t\t\tconst rel = relative(projectRoot, src).replace(/\\.ts$/, '.js');\n\t\t\tconst clientDest = join(clientDir, rel);\n\t\t\tconst serverDest = join(pagesDir, rel);\n\n\t\t\tawait Promise.all([\n\t\t\t\tmkdir(dirname(clientDest), { recursive: true }),\n\t\t\t\tmkdir(dirname(serverDest), { recursive: true })\n\t\t\t]);\n\n\t\t\tawait Promise.all([\n\t\t\t\twrite(clientDest, code),\n\t\t\t\twrite(serverDest, code)\n\t\t\t]);\n\t\t})\n\t);\n\n\treturn {\n\t\tvueCssPaths: pageResults.flatMap((pageResult) => pageResult.cssPaths),\n\t\tvueIndexPaths: pageResults.map((pageResult) => pageResult.indexPath),\n\t\tvueServerPaths: pageResults.map((pageResult) => pageResult.serverPath)\n\t};\n};\n",
9
+ "const normalizeSlug = (str: string) =>\n\tstr\n\t\t.trim()\n\t\t.replace(/\\s+/g, '-')\n\t\t.replace(/[^A-Za-z0-9\\-_]+/g, '')\n\t\t.replace(/[-_]{2,}/g, '-');\n\nexport const toPascal = (str: string) =>\n\tnormalizeSlug(str)\n\t\t.split(/[-_]/)\n\t\t.filter(Boolean)\n\t\t.map(\n\t\t\t(segment) =>\n\t\t\t\tsegment.charAt(0).toUpperCase() + segment.slice(1).toLowerCase()\n\t\t)\n\t\t.join('');\n\nexport const toKebab = (str: string) =>\n\tnormalizeSlug(str)\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n\t\t.toLowerCase();\n",
10
+ "import { extname } from 'node:path';\nimport { BuildArtifact } from 'bun';\nimport { toPascal } from '../utils/stringModifiers';\n\nexport const generateManifest = (outputs: BuildArtifact[], buildPath: string) =>\n\toutputs.reduce<Record<string, string>>((manifest, artifact) => {\n\t\tlet relative = artifact.path.startsWith(buildPath)\n\t\t\t? artifact.path.slice(buildPath.length)\n\t\t\t: artifact.path;\n\t\trelative = relative.replace(/^\\/+/, '');\n\n\t\tconst segments = relative.split('/');\n\t\tconst fileWithHash = segments.pop();\n\t\tif (!fileWithHash) return manifest;\n\n\t\tconst [baseName] = fileWithHash.split(`.${artifact.hash}.`);\n\t\tif (!baseName) return manifest;\n\n\t\tconst ext = extname(fileWithHash);\n\t\tif (ext === '.css') {\n\t\t\tmanifest[`${toPascal(baseName)}CSS`] = `/${relative}`;\n\n\t\t\treturn manifest;\n\t\t}\n\n\t\tconst folder = segments.length > 1 ? segments[1] : segments[0];\n\n\t\tif (folder === 'indexes') {\n\t\t\tmanifest[`${baseName}Index`] = `/${relative}`;\n\t\t} else if (folder === 'pages') {\n\t\t\tmanifest[baseName] ??= artifact.path;\n\t\t} else {\n\t\t\tmanifest[baseName] = `/${relative}`;\n\t\t}\n\n\t\treturn manifest;\n\t}, {});\n",
10
11
  "import { mkdir, rm, writeFile } from 'fs/promises';\nimport { basename, join } from 'path';\nimport { Glob } from 'bun';\n\nexport const generateReactIndexFiles = async (\n\treactPagesDirectory: string,\n\treactIndexesDirectory: string\n) => {\n\tawait rm(reactIndexesDirectory, { force: true, recursive: true });\n\tawait mkdir(reactIndexesDirectory);\n\n\tconst pagesGlob = new Glob('*.*');\n\tconst files: string[] = [];\n\tfor await (const file of pagesGlob.scan({ cwd: reactPagesDirectory })) {\n\t\tfiles.push(file);\n\t}\n\tconst promises = files.map(async (file) => {\n\t\tconst fileName = basename(file);\n\t\tconst [componentName] = fileName.split('.');\n\t\tconst content = [\n\t\t\t`import { hydrateRoot } from 'react-dom/client';`,\n\t\t\t`import type { ComponentType } from 'react'`,\n\t\t\t`import { ${componentName} } from '../pages/${componentName}';\\n`,\n\t\t\t`type PropsOf<C> = C extends ComponentType<infer P> ? P : never;\\n`,\n\t\t\t`declare global {`,\n\t\t\t`\\tinterface Window {`,\n\t\t\t`\\t\\t__INITIAL_PROPS__: PropsOf<typeof ${componentName}>`,\n\t\t\t`\\t}`,\n\t\t\t`}\\n`,\n\t\t\t`hydrateRoot(document, <${componentName} {...window.__INITIAL_PROPS__} />);`\n\t\t].join('\\n');\n\n\t\treturn writeFile(\n\t\t\tjoin(reactIndexesDirectory, `${componentName}.tsx`),\n\t\t\tcontent\n\t\t);\n\t});\n\tawait Promise.all(promises);\n};\n",
11
12
  "import { Glob } from 'bun';\n\nexport const scanEntryPoints = async (dir: string, pattern: string) => {\n\tconst entryPaths: string[] = [];\n\tconst glob = new Glob(pattern);\n\tfor await (const file of glob.scan({ absolute: true, cwd: dir })) {\n\t\tentryPaths.push(file);\n\t}\n\n\treturn entryPaths;\n};\n",
12
- "import { readFile, writeFile } from 'node:fs/promises';\nimport { scanEntryPoints } from './scanEntryPoints';\n\nexport const updateScriptTags = async (\n\tmanifest: Record<string, string>,\n\thtmlDir: string\n) => {\n\tconst htmlFiles = await scanEntryPoints(htmlDir, '*.html');\n\n\tconst tasks = htmlFiles.map(async (filePath) => {\n\t\tconst original = await readFile(filePath, 'utf8');\n\t\tconst updated = Object.entries(manifest).reduce(\n\t\t\t(html, [scriptName, newPath]) => {\n\t\t\t\tconst esc = scriptName.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\t\t\t\tconst regex = new RegExp(\n\t\t\t\t\t`(<script[^>]+src=[\"'])(/?(?:.*/)?${esc})(?:\\\\.[^.\"'/]+)?(\\\\.js)([\"'][^>]*>)`,\n\t\t\t\t\t'g'\n\t\t\t\t);\n\n\t\t\t\treturn html.replace(\n\t\t\t\t\tregex,\n\t\t\t\t\t(_, prefix, __, ___, suffix) =>\n\t\t\t\t\t\t`${prefix}${newPath}${suffix}`\n\t\t\t\t);\n\t\t\t},\n\t\t\toriginal\n\t\t);\n\n\t\tawait writeFile(filePath, updated, 'utf8');\n\t});\n\n\tawait Promise.all(tasks);\n};\n",
13
+ "import { readFile, writeFile } from 'node:fs/promises';\nimport { toPascal } from '../utils/stringModifiers';\nimport { scanEntryPoints } from './scanEntryPoints';\n\nexport const updateHTMLAssetPaths = async (\n\tmanifest: Record<string, string>,\n\thtmlDir: string\n) => {\n\tconst htmlFiles = await scanEntryPoints(htmlDir, '*.html');\n\tconst assetRegex =\n\t\t/((?:<script[^>]+src=|<link[^>]*?rel=[\"']stylesheet[\"'][^>]*?href=)[\"'])(\\/?(?:.*\\/)?)([^./\"']+)(?:\\.[^.\"'/]+)?(\\.(?:js|ts|css))([\"'][^>]*>)/g;\n\n\tconst tasks = htmlFiles.map(async (filePath) => {\n\t\tconst original = await readFile(filePath, 'utf8');\n\t\tconst updated = original.replace(\n\t\t\tassetRegex,\n\t\t\t(match, prefix, _dir, name, ext, suffix) => {\n\t\t\t\tconst key = ext === '.css' ? `${toPascal(name)}CSS` : name;\n\t\t\t\tconst newPath = manifest[key];\n\t\t\t\tif (newPath) return `${prefix}${newPath}${suffix}`;\n\t\t\t\tconsole.error(\n\t\t\t\t\t`error: no manifest entry for ${ext.slice(1)} \"${name}\" referenced in ${filePath}`\n\t\t\t\t);\n\n\t\t\t\treturn match;\n\t\t\t}\n\t\t);\n\t\tawait writeFile(filePath, updated, 'utf8');\n\t});\n\n\tawait Promise.all(tasks);\n};\n",
13
14
  "import {\n\tMILLISECONDS_IN_A_SECOND,\n\tTIME_PRECISION,\n\tMILLISECONDS_IN_A_MINUTE\n} from '../constants';\n\nexport const getDurationString = (duration: number) => {\n\tlet durationString;\n\n\tif (duration < MILLISECONDS_IN_A_SECOND) {\n\t\tdurationString = `${duration.toFixed(TIME_PRECISION)}ms`;\n\t} else if (duration < MILLISECONDS_IN_A_MINUTE) {\n\t\tdurationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;\n\t} else {\n\t\tdurationString = `${(duration / MILLISECONDS_IN_A_MINUTE).toFixed(TIME_PRECISION)}m`;\n\t}\n\n\treturn durationString;\n};\n",
14
15
  "import { resolve, relative, sep } from 'node:path';\n\nexport const validateSafePath = (targetPath: string, baseDirectory: string) => {\n\tconst absoluteBase = resolve(baseDirectory);\n\tconst absoluteTarget = resolve(baseDirectory, targetPath);\n\tif (relative(absoluteBase, absoluteTarget).startsWith(`..${sep}`)) {\n\t\tthrow new Error(`Unsafe path: ${targetPath}`);\n\t}\n\n\treturn absoluteTarget;\n};\n",
15
- "import { file } from 'bun';\nimport { ComponentType as ReactComponent, createElement } from 'react';\nimport { renderToReadableStream as renderReactToReadableStream } from 'react-dom/server';\nimport { Component as SvelteComponent } from 'svelte';\nimport { Component as VueComponent, createSSRApp, h } from 'vue';\nimport { renderToWebStream as renderVueToWebStream } from 'vue/server-renderer';\nimport { renderToReadableStream as renderSvelteToReadableStream } from '../svelte/renderToReadableStream';\nimport { PropsArgs } from '../types';\n\nexport const handleReactPageRequest = async <\n\tProps extends Record<string, unknown> = Record<never, never>\n>(\n\tpageComponent: ReactComponent<Props>,\n\tindex: string,\n\t...props: keyof Props extends never ? [] : [props: Props]\n) => {\n\tconst [maybeProps] = props;\n\tconst element =\n\t\tmaybeProps !== undefined\n\t\t\t? createElement(pageComponent, maybeProps)\n\t\t\t: createElement(pageComponent);\n\n\tconst stream = await renderReactToReadableStream(element, {\n\t\tbootstrapModules: [index],\n\t\tbootstrapScriptContent: maybeProps\n\t\t\t? `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps)}`\n\t\t\t: undefined\n\t});\n\n\treturn new Response(stream, {\n\t\theaders: { 'Content-Type': 'text/html' }\n\t});\n};\n\n// Declare overloads matching Svelte’s own component API to preserve correct type inference\ntype HandleSveltePageRequest = {\n\t(\n\t\tPageComponent: SvelteComponent<Record<string, never>>,\n\t\tpagePath: string,\n\t\tindexPath: string\n\t): Promise<Response>;\n\t<P extends Record<string, unknown>>(\n\t\tPageComponent: SvelteComponent<P>,\n\t\tpagePath: string,\n\t\tindexPath: string,\n\t\tprops: P\n\t): Promise<Response>;\n};\n\nexport const handleSveltePageRequest: HandleSveltePageRequest = async <\n\tP extends Record<string, unknown>\n>(\n\t_PageComponent: SvelteComponent<P>,\n\tpagePath: string,\n\tindexPath: string,\n\tprops?: P\n) => {\n\tconst { default: ImportedPageComponent } = await import(pagePath);\n\n\tconst stream = await renderSvelteToReadableStream(\n\t\tImportedPageComponent,\n\t\tprops,\n\t\t{\n\t\t\tbootstrapModules: indexPath ? [indexPath] : [],\n\t\t\tbootstrapScriptContent: `window.__INITIAL_PROPS__=${JSON.stringify(\n\t\t\t\tprops\n\t\t\t)}`\n\t\t}\n\t);\n\n\treturn new Response(stream, {\n\t\theaders: { 'Content-Type': 'text/html' }\n\t});\n};\n\nexport const handleVuePageRequest = async <\n\tProps extends Record<string, unknown> = Record<never, never>\n>(\n\t_PageComponent: VueComponent<Props>,\n\tpagePath: string,\n\tindexPath: string,\n\t...props: keyof Props extends never ? [] : [props: Props]\n) => {\n\tconst [maybeProps] = props;\n\n\tconst { default: ImportedPageComponent } = await import(pagePath);\n\n\tconst app = createSSRApp({\n\t\trender: () => h(ImportedPageComponent, maybeProps ?? {})\n\t});\n\n\tconst bodyStream = renderVueToWebStream(app);\n\n\tconst head = '<!DOCTYPE html><html><head></head><body><div id=\"app\">';\n\tconst tail = `</div><script>window.__INITIAL_PROPS__=${JSON.stringify(\n\t\tmaybeProps ?? {}\n\t)}</script><script type=\"module\" src=\"${indexPath}\"></script></body></html>`;\n\n\tconst stream = new ReadableStream({\n\t\tstart(controller) {\n\t\t\tcontroller.enqueue(head);\n\t\t\tconst reader = bodyStream.getReader();\n\t\t\tconst pumpLoop = () => {\n\t\t\t\treader\n\t\t\t\t\t.read()\n\t\t\t\t\t.then(({ done, value }) =>\n\t\t\t\t\t\tdone\n\t\t\t\t\t\t\t? (controller.enqueue(tail), controller.close())\n\t\t\t\t\t\t\t: (controller.enqueue(value), pumpLoop())\n\t\t\t\t\t)\n\t\t\t\t\t.catch((err) => controller.error(err));\n\t\t\t};\n\t\t\tpumpLoop();\n\t\t}\n\t});\n\n\treturn new Response(stream, {\n\t\theaders: { 'Content-Type': 'text/html' }\n\t});\n};\n\nexport const handleHTMLPageRequest = (html: string) => file(html);\n\nexport const handlePageRequest = <Component>(\n\tPageComponent: Component,\n\t...props: PropsArgs<Component>\n) => {\n\tconsole.log('handlePageRequest coming soon.', PageComponent, props);\n};\n",
16
+ "import { file } from 'bun';\nimport { ComponentType as ReactComponent, createElement } from 'react';\nimport { renderToReadableStream as renderReactToReadableStream } from 'react-dom/server';\nimport { Component as SvelteComponent } from 'svelte';\nimport { Component as VueComponent, createSSRApp, h } from 'vue';\nimport { renderToWebStream as renderVueToWebStream } from 'vue/server-renderer';\nimport { renderToReadableStream as renderSvelteToReadableStream } from '../svelte/renderToReadableStream';\nimport { PropsArgs } from '../types';\n\nexport const handleReactPageRequest = async <\n\tProps extends Record<string, unknown> = Record<never, never>\n>(\n\tpageComponent: ReactComponent<Props>,\n\tindex: string,\n\t...props: keyof Props extends never ? [] : [props: Props]\n) => {\n\tconst [maybeProps] = props;\n\tconst element =\n\t\tmaybeProps !== undefined\n\t\t\t? createElement(pageComponent, maybeProps)\n\t\t\t: createElement(pageComponent);\n\n\tconst stream = await renderReactToReadableStream(element, {\n\t\tbootstrapModules: [index],\n\t\tbootstrapScriptContent: maybeProps\n\t\t\t? `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps)}`\n\t\t\t: undefined\n\t});\n\n\treturn new Response(stream, {\n\t\theaders: { 'Content-Type': 'text/html' }\n\t});\n};\n\n// Declare overloads matching Svelte’s own component API to preserve correct type inference\ntype HandleSveltePageRequest = {\n\t(\n\t\tPageComponent: SvelteComponent<Record<string, never>>,\n\t\tpagePath: string,\n\t\tindexPath: string\n\t): Promise<Response>;\n\t<P extends Record<string, unknown>>(\n\t\tPageComponent: SvelteComponent<P>,\n\t\tpagePath: string,\n\t\tindexPath: string,\n\t\tprops: P\n\t): Promise<Response>;\n};\n\nexport const handleSveltePageRequest: HandleSveltePageRequest = async <\n\tP extends Record<string, unknown>\n>(\n\t_PageComponent: SvelteComponent<P>,\n\tpagePath: string,\n\tindexPath: string,\n\tprops?: P\n) => {\n\tconst { default: ImportedPageComponent } = await import(pagePath);\n\n\tconst stream = await renderSvelteToReadableStream(\n\t\tImportedPageComponent,\n\t\tprops,\n\t\t{\n\t\t\tbootstrapModules: indexPath ? [indexPath] : [],\n\t\t\tbootstrapScriptContent: `window.__INITIAL_PROPS__=${JSON.stringify(\n\t\t\t\tprops\n\t\t\t)}`\n\t\t}\n\t);\n\n\treturn new Response(stream, {\n\t\theaders: { 'Content-Type': 'text/html' }\n\t});\n};\n\nexport const handleVuePageRequest = async <\n\tProps extends Record<string, unknown> = Record<never, never>\n>(\n\t_PageComponent: VueComponent<Props>,\n\tpagePath: string,\n\tindexPath: string,\n\theadTag: `<head>${string}</head>` = '<head></head>',\n\t...props: keyof Props extends never ? [] : [props: Props]\n) => {\n\tconst [maybeProps] = props;\n\n\tconst { default: ImportedPageComponent } = await import(pagePath);\n\n\tconst app = createSSRApp({\n\t\trender: () => h(ImportedPageComponent, maybeProps ?? {})\n\t});\n\n\tconst bodyStream = renderVueToWebStream(app);\n\n\tconst head = `<!DOCTYPE html><html>${headTag}<body><div id=\"root\">`;\n\tconst tail = `</div><script>window.__INITIAL_PROPS__=${JSON.stringify(\n\t\tmaybeProps ?? {}\n\t)}</script><script type=\"module\" src=\"${indexPath}\"></script></body></html>`;\n\n\tconst stream = new ReadableStream({\n\t\tstart(controller) {\n\t\t\tcontroller.enqueue(head);\n\t\t\tconst reader = bodyStream.getReader();\n\t\t\tconst pumpLoop = () => {\n\t\t\t\treader\n\t\t\t\t\t.read()\n\t\t\t\t\t.then(({ done, value }) =>\n\t\t\t\t\t\tdone\n\t\t\t\t\t\t\t? (controller.enqueue(tail), controller.close())\n\t\t\t\t\t\t\t: (controller.enqueue(value), pumpLoop())\n\t\t\t\t\t)\n\t\t\t\t\t.catch((err) => controller.error(err));\n\t\t\t};\n\t\t\tpumpLoop();\n\t\t}\n\t});\n\n\treturn new Response(stream, {\n\t\theaders: { 'Content-Type': 'text/html' }\n\t});\n};\n\nexport const handleHTMLPageRequest = (html: string) => file(html);\n\nexport const handlePageRequest = <Component>(\n\tPageComponent: Component,\n\t...props: PropsArgs<Component>\n) => {\n\tconsole.log('handlePageRequest coming soon.', PageComponent, props);\n};\n",
16
17
  "import type { Component } from 'svelte';\nimport { render } from 'svelte/server';\nimport { DEFAULT_CHUNK_SIZE } from '../constants';\nimport { escapeScriptContent } from '../utils/escapeScriptContent';\n\nexport type RenderStreamOptions = {\n\tbootstrapScriptContent?: string;\n\tbootstrapScripts?: string[];\n\tbootstrapModules?: string[];\n\tnonce?: string;\n\tonError?: (error: unknown) => void;\n\tprogressiveChunkSize?: number;\n\tsignal?: AbortSignal;\n};\n\nexport const renderToReadableStream = async <\n\tProps extends Record<string, unknown> = Record<string, never>\n>(\n\tcomponent: Component<Props>,\n\tprops?: Props,\n\t{\n\t\tbootstrapScriptContent,\n\t\tbootstrapScripts = [],\n\t\tbootstrapModules = [],\n\t\tnonce,\n\t\tonError = console.error,\n\t\tprogressiveChunkSize = DEFAULT_CHUNK_SIZE,\n\t\tsignal\n\t}: RenderStreamOptions = {}\n) => {\n\ttry {\n\t\tconst { head, body } =\n\t\t\ttypeof props === 'undefined'\n\t\t\t\t? // @ts-expect-error Svelte's render function can't determine which overload to choose when the component is generic\n\t\t\t\t\trender(component)\n\t\t\t\t: render(component, { props });\n\t\tconst nonceAttr = nonce ? ` nonce=\"${nonce}\"` : '';\n\t\tconst scripts =\n\t\t\t(bootstrapScriptContent\n\t\t\t\t? `<script${nonceAttr}>${escapeScriptContent(bootstrapScriptContent)}</script>`\n\t\t\t\t: '') +\n\t\t\tbootstrapScripts\n\t\t\t\t.map((src) => `<script${nonceAttr} src=\"${src}\"></script>`)\n\t\t\t\t.join('') +\n\t\t\tbootstrapModules\n\t\t\t\t.map(\n\t\t\t\t\t(src) =>\n\t\t\t\t\t\t`<script${nonceAttr} type=\"module\" src=\"${src}\"></script>`\n\t\t\t\t)\n\t\t\t\t.join('');\n\t\tconst encoder = new TextEncoder();\n\t\t// Warning: this encodes the entire document into memory in one buffer\n\t\tconst full = encoder.encode(\n\t\t\t`<!DOCTYPE html><html lang=\"en\"><head>${head}</head><body>${body}${scripts}</body></html>`\n\t\t);\n\n\t\tlet offset = 0;\n\n\t\treturn new ReadableStream<Uint8Array>({\n\t\t\ttype: 'bytes',\n\t\t\tcancel(reason) {\n\t\t\t\tonError?.(reason);\n\t\t\t},\n\t\t\tpull(controller) {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tcontroller.close();\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (offset >= full.length) {\n\t\t\t\t\tcontroller.close();\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst end = Math.min(\n\t\t\t\t\toffset + progressiveChunkSize,\n\t\t\t\t\tfull.length\n\t\t\t\t);\n\t\t\t\tcontroller.enqueue(full.subarray(offset, end));\n\t\t\t\toffset = end;\n\t\t\t}\n\t\t});\n\t} catch (error) {\n\t\tonError?.(error);\n\t\tthrow error;\n\t}\n};\n",
17
18
  "const ESCAPE_LOOKUP: Record<string, string> = {\n\t'\\u2028': '\\\\u2028',\n\t'\\u2029': '\\\\u2029',\n\t'&': '\\\\u0026',\n\t'<': '\\\\u003C',\n\t'>': '\\\\u003E'\n};\n\nconst ESCAPE_REGEX = /[&><\\u2028\\u2029]/g;\n\nexport const escapeScriptContent = (content: string) =>\n\tcontent.replace(ESCAPE_REGEX, (char) => {\n\t\tconst escaped = ESCAPE_LOOKUP[char];\n\n\t\treturn escaped !== undefined ? escaped : char;\n\t});\n",
18
- "export const asset = (\n\tmanifest: Record<string, string | string[]>,\n\tname: string\n) => {\n\tconst assetPath = manifest[name];\n\tif (assetPath === undefined) {\n\t\tthrow new Error(`Asset \"${name}\" not found in manifest.`);\n\t}\n\tif (Array.isArray(assetPath)) {\n\t\tthrow new Error(`\"${name}\" is an array, use 'assets' instead.`);\n\t}\n\n\treturn assetPath;\n};\n\nexport const assets = (\n\tmanifest: Record<string, string | string[]>,\n\tname: string\n) => {\n\tconst assetPaths = manifest[name];\n\tif (assetPaths === undefined) {\n\t\tthrow new Error(`Assets \"${name}\" not found in manifest.`);\n\t}\n\tif (!Array.isArray(assetPaths)) {\n\t\tthrow new Error(`\"${name}\" is not an array, use 'asset' instead.`);\n\t}\n\n\treturn assetPaths;\n};\n",
19
+ "export const asset = (manifest: Record<string, string>, name: string) => {\n\tconst assetPath = manifest[name];\n\tif (assetPath === undefined) {\n\t\tthrow new Error(`Asset \"${name}\" not found in manifest.`);\n\t}\n\n\treturn assetPath;\n};\n",
19
20
  "import { argv } from 'node:process';\nimport { env } from 'bun';\nimport { Elysia } from 'elysia';\nimport { DEFAULT_PORT } from '../constants';\nimport { getLocalIPAddress } from '../utils/networking';\n\nlet host = env.HOST ?? 'localhost';\nconst port = env.PORT ?? DEFAULT_PORT;\nlet localIP: string | undefined;\n\nconst args = argv;\nconst hostFlag = args.includes('--host');\n\nif (hostFlag) {\n\tlocalIP = getLocalIPAddress();\n\thost = '0.0.0.0';\n}\n\nexport const networkingPlugin = (app: Elysia) =>\n\tapp.listen(\n\t\t{\n\t\t\thostname: host,\n\t\t\tport: port\n\t\t},\n\t\t() => {\n\t\t\t//TODO: I dont think this works properly\n\t\t\tif (hostFlag) {\n\t\t\t\tconsole.log(`Server started on http://localhost:${port}`);\n\t\t\t\tconsole.log(\n\t\t\t\t\t`Server started on network: http://${localIP}:${port}`\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconsole.log(`Server started on http://${host}:${port}`);\n\t\t\t}\n\t\t}\n\t);\n",
20
21
  "import os from 'os';\n\nexport const getLocalIPAddress = () => {\n\tconst interfaces = os.networkInterfaces();\n\tconst addresses = Object.values(interfaces)\n\t\t.flat()\n\t\t.filter(\n\t\t\t(iface): iface is os.NetworkInterfaceInfo => iface !== undefined\n\t\t);\n\tconst ipAddress = addresses.find(\n\t\t(iface) => iface.family === 'IPv4' && !iface.internal\n\t);\n\n\tif (ipAddress) return ipAddress.address; // Return the first non-internal IPv4 address\n\n\tconsole.warn('No IP address found, falling back to localhost');\n\n\treturn 'localhost'; // Fallback to localhost if no IP found\n};\n",
21
- "export const pageRouterPlugin = () => {\n\tconsole.log('Page Router Plugin Not Implemented Yet');\n};\n"
22
+ "export const pageRouterPlugin = () => {\n\tconsole.log('Page Router Plugin Not Implemented Yet');\n};\n",
23
+ "type GenerateHeadElementProps = {\n\tcssPath?: string;\n\ttitle?: string;\n\ticon?: string;\n\tdescription?: string;\n\tfont?: string;\n};\n\nexport const generateHeadElement = ({\n\tcssPath,\n\ttitle = 'AbsoluteJS',\n\tdescription = 'A page created using AbsoluteJS',\n\tfont,\n\ticon = '/assets/ico/favicon.ico'\n}: GenerateHeadElementProps = {}) =>\n\t`<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${title}</title>\n <meta name=\"description\" content=\"${description}\">\n <link rel=\"icon\" href=\"${icon}\" type=\"image/x-icon\">\n ${\n\t\tfont\n\t\t\t? `<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n <link href=\"https://fonts.googleapis.com/css2?family=${font}:wght@100..900&display=swap\" rel=\"stylesheet\">`\n\t\t\t: ''\n }\n ${cssPath ? `<link rel=\"stylesheet\" href=\"${cssPath}\" type=\"text/css\">` : ''}\n</head>` as const;\n"
22
24
  ],
23
- "mappings": ";;AAAO,IAAM,sBAAsB;AAC5B,IAAM,2BAA2B;AACjC,IAAM,2BACZ,2BAA2B;AACrB,IAAM,qBAAqB;AAC3B,IAAM,eAAe;AACrB,IAAM,wBACZ,2BACA,sBACA,qBACA;AACM,IAAM,iBAAiB;AACvB,IAAM,aAAa,IAAI;AACvB,IAAM,eAAe;AACrB,IAAM,qBAAqB;;ACdlC,eAAS,cAAI;AACb,qBAAS,mBAAU,cAAM;AACzB,qBAAc;AACd;;;ACHA;AACA;AACA;AACA;AACA;AAEO,IAAM,gBAAgB,OAC5B,aACA,oBACI;AAAA,EACJ,MAAM,WAAW,KAAK,iBAAiB,OAAO;AAAA,EAC9C,MAAM,YAAY,KAAK,iBAAiB,QAAQ;AAAA,EAChD,MAAM,aAAa,KAAK,iBAAiB,SAAS;AAAA,EAElD,MAAM,QAAQ,IAAI;AAAA,IACjB,MAAM,WAAW,EAAE,WAAW,KAAK,CAAC;AAAA,IACpC,MAAM,YAAY,EAAE,WAAW,KAAK,CAAC;AAAA,EACtC,CAAC;AAAA,EAED,MAAM,QAAQ,IAAI,aAAa;AAAA,EAE/B,MAAM,SAAS,MAAM,QAAQ,IAC5B,YAAY,IAAI,OAAO,UAAU;AAAA,IAChC,MAAM,SAAS,MAAM,KAAK,KAAK,EAAE,KAAK;AAAA,IACtC,QAAQ,MAAM,QAAQ,MAAM,WAAW,QAAQ,CAAC,CAAC;AAAA,IAEjD,MAAM,OAAO,SAAS,OAAO,SAAS;AAAA,IAEtC,QAAQ,IAAI,UAAU,QAAQ,KAAK;AAAA,MAClC,KAAK;AAAA,MACL,KAAK;AAAA,MACL,UAAU;AAAA,MACV,UAAU;A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U;AAAA,sCAC2B;AAAA,2BACX;AAAA,IAEzB,OACG;AAAA;AAAA,yDAEoD,uDACpD;AAAA,IAED,UAAU,gCAAgC,8BAA8B;AAAA;",
26
+ "debugId": "919FA38EE8B07AC264756E2164756E21",
25
27
  "names": []
26
28
  }
@@ -0,0 +1,17 @@
1
+ type GenerateHeadElementProps = {
2
+ cssPath?: string;
3
+ title?: string;
4
+ icon?: string;
5
+ description?: string;
6
+ font?: string;
7
+ };
8
+ export declare const generateHeadElement: ({ cssPath, title, description, font, icon }?: GenerateHeadElementProps) => `<head>
9
+ <meta charset="UTF-8">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
11
+ <title>${string}</title>
12
+ <meta name="description" content="${string}">
13
+ <link rel="icon" href="${string}" type="image/x-icon">
14
+ ${string}
15
+ ${string}
16
+ </head>`;
17
+ export {};
@@ -1,2 +1,3 @@
1
1
  export * from './networking';
2
- export * from '../build/updateScriptTags';
2
+ export * from '../build/updateHTMLAssetPaths';
3
+ export * from './generateHeadElement';
@@ -0,0 +1,2 @@
1
+ export declare const toPascal: (str: string) => string;
2
+ export declare const toKebab: (str: string) => string;
package/eslint.config.mjs CHANGED
@@ -183,7 +183,11 @@ export default defineConfig([
183
183
  },
184
184
 
185
185
  {
186
- files: ['eslint.config.mjs', 'src/constants.ts'],
186
+ files: [
187
+ 'eslint.config.mjs',
188
+ 'src/constants.ts',
189
+ 'example/vue/client/*.js'
190
+ ],
187
191
  rules: {
188
192
  'no-magic-numbers': 'off'
189
193
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/absolute",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "A fullstack meta-framework for building web applications with TypeScript",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,9 +11,9 @@
11
11
  "license": "CC BY-NC 4.0",
12
12
  "author": "Alex Kahn",
13
13
  "scripts": {
14
- "build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external react --external react-dom --external vue --external @vue/compiler-sfc --external svelte --external elysia && tsc --emitDeclarationOnly --project tsconfig.json",
14
+ "build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external react --external react-dom --external vue --external @vue/compiler-sfc --external svelte --external elysia && tsc --emitDeclarationOnly --project tsconfig.build.json",
15
15
  "test": "echo \"Error: no test specified\" && exit 1",
16
- "format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json,mjs,md,svelte}\"",
16
+ "format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json,mjs,md,svelte,html,vue}\"",
17
17
  "lint": "eslint ./",
18
18
  "typecheck": "bun run tsc --noEmit",
19
19
  "dev": "bun run --watch example/server.ts",
@@ -23,7 +23,7 @@
23
23
  "elysia": "^1.3.0",
24
24
  "react": "^19.1.0",
25
25
  "react-dom": "^19.1.0",
26
- "svelte": "^5.34.7",
26
+ "svelte": "^5.35.2",
27
27
  "vue": "^3.5.17"
28
28
  },
29
29
  "devDependencies": {
@@ -44,7 +44,7 @@
44
44
  "prettier": "3.5.3",
45
45
  "prettier-plugin-svelte": "3.4.0",
46
46
  "react": "19.1.0",
47
- "svelte": "5.34.7",
47
+ "svelte": "5.35.2",
48
48
  "tailwindcss": "4.1.7",
49
49
  "typescript": "5.8.3",
50
50
  "typescript-eslint": "8.32.0",
@@ -15,6 +15,6 @@
15
15
  "noImplicitAny": true,
16
16
  "lib": ["DOM", "DOM.Iterable", "ESNext"]
17
17
  },
18
- "include": ["src/**/*", "example/**/*"],
18
+ "include": ["src/**/*"],
19
19
  "exclude": ["node_modules"]
20
20
  }
@@ -1 +0,0 @@
1
- export declare const updateScriptTags: (manifest: Record<string, string>, htmlDir: string) => Promise<void>;