@absolutejs/absolute 0.8.15 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/build/compileVue.d.ts +5 -0
  2. package/dist/{src/build → build}/generateManifest.d.ts +1 -1
  3. package/dist/core/build.d.ts +4 -0
  4. package/dist/{src/core → core}/index.d.ts +1 -0
  5. package/dist/core/lookup.d.ts +2 -0
  6. package/dist/core/pageHandlers.d.ts +14 -0
  7. package/dist/{src/index.d.ts → index.d.ts} +1 -1
  8. package/dist/index.js +384 -183
  9. package/dist/index.js.map +11 -9
  10. package/dist/types.d.ts +24 -0
  11. package/eslint.config.mjs +33 -3
  12. package/package.json +6 -6
  13. package/tsconfig.lint.json +20 -0
  14. package/dist/src/core/build.d.ts +0 -2
  15. package/dist/src/core/pageHandlers.d.ts +0 -10
  16. package/dist/src/types.d.ts +0 -20
  17. /package/dist/{src/svelte → build}/compileSvelte.d.ts +0 -0
  18. /package/dist/{src/build → build}/generateReactIndexes.d.ts +0 -0
  19. /package/dist/{src/build → build}/scanEntryPoints.d.ts +0 -0
  20. /package/dist/{src/build → build}/updateScriptTags.d.ts +0 -0
  21. /package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
  22. /package/dist/{src/plugins → plugins}/index.d.ts +0 -0
  23. /package/dist/{src/plugins → plugins}/networkingPlugin.d.ts +0 -0
  24. /package/dist/{src/plugins → plugins}/pageRouterPlugin.d.ts +0 -0
  25. /package/dist/{src/svelte → svelte}/renderToPipeableStream.d.ts +0 -0
  26. /package/dist/{src/svelte → svelte}/renderToReadableStream.d.ts +0 -0
  27. /package/dist/{src/svelte → svelte}/renderToString.d.ts +0 -0
  28. /package/dist/{src/utils → utils}/escapeScriptContent.d.ts +0 -0
  29. /package/dist/{src/utils → utils}/getDurationString.d.ts +0 -0
  30. /package/dist/{src/utils → utils}/index.d.ts +0 -0
  31. /package/dist/{src/utils → utils}/networking.d.ts +0 -0
  32. /package/dist/{src/utils → utils}/validateSafePath.d.ts +0 -0
@@ -0,0 +1,5 @@
1
+ export declare const compileVue: (entryPoints: string[], outputDirectory: string) => Promise<{
2
+ vueClientPaths: string[];
3
+ vueCssPaths: Record<string, string[]>;
4
+ vueServerPaths: string[];
5
+ }>;
@@ -1,2 +1,2 @@
1
1
  import { BuildArtifact } from 'bun';
2
- export declare const generateManifest: (outputs: BuildArtifact[], buildDirectoryAbsolute: string, svelteDirName?: string) => Record<string, string>;
2
+ export declare const generateManifest: (outputs: BuildArtifact[], buildDirectoryAbsolute: string) => Record<string, string>;
@@ -0,0 +1,4 @@
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>;
@@ -1,2 +1,3 @@
1
1
  export * from './build';
2
2
  export * from './pageHandlers';
3
+ export * from './lookup';
@@ -0,0 +1,2 @@
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[];
@@ -0,0 +1,14 @@
1
+ import { ComponentType as ReactComponent } from 'react';
2
+ import { Component as SvelteComponent } from 'svelte';
3
+ import { Component as VueComponent } from 'vue';
4
+ import { PropsArgs } from '../types';
5
+ export declare const handleReactPageRequest: <Props extends Record<string, unknown> = Record<never, never>>(pageComponent: ReactComponent<Props>, index: string, ...props: keyof Props extends never ? [] : [props: Props]) => Promise<Response>;
6
+ type HandleSveltePageRequest = {
7
+ (PageComponent: SvelteComponent<Record<string, never>>, pagePath: string, indexPath: string): Promise<Response>;
8
+ <P extends Record<string, unknown>>(PageComponent: SvelteComponent<P>, pagePath: string, indexPath: string, props: P): Promise<Response>;
9
+ };
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>;
12
+ export declare const handleHTMLPageRequest: (html: string) => Bun.BunFile;
13
+ export declare const handlePageRequest: <Component>(PageComponent: Component, ...props: PropsArgs<Component>) => void;
14
+ export {};
@@ -1,4 +1,4 @@
1
1
  export * from './constants';
2
- export * from './core/index';
2
+ export * from './core';
3
3
  export * from './plugins/index';
4
4
  export * from './utils/index';
package/dist/index.js CHANGED
@@ -11,49 +11,223 @@ var TWO_THIRDS = 2 / 3;
11
11
  var DEFAULT_PORT = 3000;
12
12
  var DEFAULT_CHUNK_SIZE = 16384;
13
13
  // src/core/build.ts
14
- import { rm as rm2, mkdir as mkdir3, cp } from "fs/promises";
15
- import { basename as basename3, join as join3 } from "path";
16
- import { cwd, exit } from "process";
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";
17
17
  var {$, build: bunBuild } = globalThis.Bun;
18
18
 
19
- // src/build/generateManifest.ts
20
- var generateManifest = (outputs, buildDirectoryAbsolute, svelteDirName) => {
21
- const prefix = svelteDirName ? `(?:${svelteDirName}/)?` : "";
22
- const pagesRegex = new RegExp(`^${prefix}pages/`);
23
- const indexesRegex = new RegExp(`^${prefix}indexes/`);
24
- return outputs.reduce((manifest, artifact) => {
25
- let relativePath = artifact.path.startsWith(buildDirectoryAbsolute) ? artifact.path.slice(buildDirectoryAbsolute.length) : artifact.path;
26
- relativePath = relativePath.replace(/^\/+/, "");
27
- const segments = relativePath.split("/");
28
- const fileWithHash = segments.pop();
29
- if (!fileWithHash)
30
- return manifest;
31
- const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
32
- if (indexesRegex.test(relativePath)) {
33
- manifest[`${baseName}Index`] = `/${relativePath}`;
34
- } else if (pagesRegex.test(relativePath)) {
35
- manifest[baseName] = artifact.path;
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, {
46
+ 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`);
56
+ await Promise.all([
57
+ write(ssrPath, ssrJs.code),
58
+ write(clientComponentPath, clientJs.code),
59
+ write(clientIndexPath, bootstrap)
60
+ ]);
61
+ return { clientIndexPath, ssrPath };
62
+ }));
63
+ return {
64
+ svelteClientPaths: builds.map(({ clientIndexPath }) => clientIndexPath),
65
+ svelteServerPaths: builds.map(({ ssrPath }) => ssrPath)
66
+ };
67
+ };
68
+
69
+ // src/build/compileVue.ts
70
+ import { mkdir as mkdir2 } from "fs/promises";
71
+ import { basename as basename2, extname, join as join2, relative } from "path";
72
+ import {
73
+ parse,
74
+ compileScript,
75
+ compileTemplate,
76
+ compileStyle
77
+ } from "@vue/compiler-sfc";
78
+ var {file: file2, write: write2 } = globalThis.Bun;
79
+ var compileVue = async (entryPoints, outputDirectory) => {
80
+ const pagesDir = join2(outputDirectory, "pages");
81
+ const scriptsDir = join2(outputDirectory, "scripts");
82
+ const stylesDir = join2(outputDirectory, "styles");
83
+ const clientDir = join2(outputDirectory, "client");
84
+ const indexesDir = join2(outputDirectory, "indexes");
85
+ await Promise.all([
86
+ mkdir2(pagesDir, { recursive: true }),
87
+ mkdir2(scriptsDir, { recursive: true }),
88
+ mkdir2(stylesDir, { recursive: true }),
89
+ mkdir2(clientDir, { recursive: true }),
90
+ mkdir2(indexesDir, { recursive: true })
91
+ ]);
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';`);
36
132
  } else {
37
- manifest[baseName] = `/${relativePath}`;
133
+ ssrCode = `import { defineComponent } from 'vue';
134
+ ${ssrCode}`;
38
135
  }
39
- return manifest;
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')`
177
+ ].join(`
178
+ `));
179
+ return {
180
+ clientIndexPath,
181
+ cssFiles,
182
+ cssKey: `${name}CSS`,
183
+ serverPath: ssrPath
184
+ };
185
+ }));
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;
40
191
  }, {});
192
+ return { vueClientPaths, vueCssPaths, vueServerPaths };
41
193
  };
42
194
 
195
+ // 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("/");
200
+ const fileWithHash = segments.pop();
201
+ if (!fileWithHash)
202
+ return manifest;
203
+ const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
204
+ if (!baseName)
205
+ return manifest;
206
+ const folder = segments.length > 1 ? segments[1] : segments[0];
207
+ if (folder === "indexes") {
208
+ manifest[`${baseName}Index`] = `/${relative2}`;
209
+ } else if (folder === "pages") {
210
+ manifest[baseName] = artifact.path;
211
+ } else {
212
+ manifest[baseName] = `/${relative2}`;
213
+ }
214
+ return manifest;
215
+ }, {});
216
+
43
217
  // src/build/generateReactIndexes.ts
44
- import { mkdir, rm, writeFile } from "fs/promises";
45
- import { basename, join } from "path";
218
+ import { mkdir as mkdir3, rm, writeFile } from "fs/promises";
219
+ import { basename as basename3, join as join3 } from "path";
46
220
  var {Glob } = globalThis.Bun;
47
221
  var generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory) => {
48
222
  await rm(reactIndexesDirectory, { force: true, recursive: true });
49
- await mkdir(reactIndexesDirectory);
223
+ await mkdir3(reactIndexesDirectory);
50
224
  const pagesGlob = new Glob("*.*");
51
225
  const files = [];
52
- for await (const file of pagesGlob.scan({ cwd: reactPagesDirectory })) {
53
- files.push(file);
226
+ for await (const file3 of pagesGlob.scan({ cwd: reactPagesDirectory })) {
227
+ files.push(file3);
54
228
  }
55
- const promises = files.map(async (file) => {
56
- const fileName = basename(file);
229
+ const promises = files.map(async (file3) => {
230
+ const fileName = basename3(file3);
57
231
  const [componentName] = fileName.split(".");
58
232
  const content = [
59
233
  `import { hydrateRoot } from 'react-dom/client';`,
@@ -71,7 +245,7 @@ var generateReactIndexFiles = async (reactPagesDirectory, reactIndexesDirectory)
71
245
  `hydrateRoot(document, <${componentName} {...window.__INITIAL_PROPS__} />);`
72
246
  ].join(`
73
247
  `);
74
- return writeFile(join(reactIndexesDirectory, `${componentName}Index.tsx`), content);
248
+ return writeFile(join3(reactIndexesDirectory, `${componentName}.tsx`), content);
75
249
  });
76
250
  await Promise.all(promises);
77
251
  };
@@ -81,8 +255,8 @@ var {Glob: Glob2 } = globalThis.Bun;
81
255
  var scanEntryPoints = async (dir, pattern) => {
82
256
  const entryPaths = [];
83
257
  const glob = new Glob2(pattern);
84
- for await (const file of glob.scan({ absolute: true, cwd: dir })) {
85
- entryPaths.push(file);
258
+ for await (const file3 of glob.scan({ absolute: true, cwd: dir })) {
259
+ entryPaths.push(file3);
86
260
  }
87
261
  return entryPaths;
88
262
  };
@@ -103,56 +277,6 @@ var updateScriptTags = async (manifest, htmlDir) => {
103
277
  await Promise.all(tasks);
104
278
  };
105
279
 
106
- // src/svelte/compileSvelte.ts
107
- import { mkdir as mkdir2 } from "fs/promises";
108
- import { basename as basename2, join as join2 } from "path";
109
- import { env } from "process";
110
- var {write, file } = globalThis.Bun;
111
- import { compile, preprocess } from "svelte/compiler";
112
- var compileSvelte = async (entryPoints, outputDirectory) => {
113
- const pagesDir = join2(outputDirectory, "pages");
114
- const clientDir = join2(outputDirectory, "client");
115
- const indexesDir = join2(outputDirectory, "indexes");
116
- await Promise.all([
117
- mkdir2(clientDir, { recursive: true }),
118
- mkdir2(indexesDir, { recursive: true })
119
- ]);
120
- const isDev = env.NODE_ENV === "development";
121
- const builds = await Promise.all(entryPoints.map(async (entry) => {
122
- const source = await file(entry).text();
123
- const { code: pre } = await preprocess(source, {});
124
- const name = basename2(entry, ".svelte");
125
- const { js: ssrJs } = compile(pre, {
126
- css: "injected",
127
- dev: isDev,
128
- filename: entry,
129
- generate: "server"
130
- });
131
- const ssrPath = join2(pagesDir, `${name}.js`);
132
- const { js: clientJs } = compile(pre, {
133
- css: "injected",
134
- dev: isDev,
135
- filename: entry,
136
- generate: "client"
137
- });
138
- const clientComponentPath = join2(clientDir, `${name}.js`);
139
- const bootstrap = `import Component from "../client/${name}.js";
140
- import { hydrate } from "svelte";
141
- hydrate(Component,{target:document.body,props:window.__INITIAL_PROPS__??{}});`;
142
- const clientIndexPath = join2(indexesDir, `${name}.js`);
143
- await Promise.all([
144
- write(ssrPath, ssrJs.code),
145
- write(clientComponentPath, clientJs.code),
146
- write(clientIndexPath, bootstrap)
147
- ]);
148
- return { clientIndexPath, ssrPath };
149
- }));
150
- return {
151
- svelteClientPaths: builds.map(({ clientIndexPath }) => clientIndexPath),
152
- svelteServerPaths: builds.map(({ ssrPath }) => ssrPath)
153
- };
154
- };
155
-
156
280
  // src/utils/getDurationString.ts
157
281
  var getDurationString = (duration) => {
158
282
  let durationString;
@@ -167,17 +291,33 @@ var getDurationString = (duration) => {
167
291
  };
168
292
 
169
293
  // src/utils/validateSafePath.ts
170
- import { resolve, relative, sep } from "path";
294
+ import { resolve, relative as relative2, sep } from "path";
171
295
  var validateSafePath = (targetPath, baseDirectory) => {
172
296
  const absoluteBase = resolve(baseDirectory);
173
297
  const absoluteTarget = resolve(baseDirectory, targetPath);
174
- if (relative(absoluteBase, absoluteTarget).startsWith(`..${sep}`)) {
298
+ if (relative2(absoluteBase, absoluteTarget).startsWith(`..${sep}`)) {
175
299
  throw new Error(`Unsafe path: ${targetPath}`);
176
300
  }
177
301
  return absoluteTarget;
178
302
  };
179
303
 
180
304
  // src/core/build.ts
305
+ var commonAncestor = (paths, fallback) => {
306
+ if (paths.length === 0)
307
+ return fallback;
308
+ const segmentsList = paths.map((p) => p.split(sep2));
309
+ const [first] = segmentsList;
310
+ if (!first)
311
+ return fallback;
312
+ const commonSegments = first.filter((segment, index) => segmentsList.every((pathSegs) => pathSegs[index] === segment));
313
+ return commonSegments.length ? commonSegments.join(sep2) : fallback;
314
+ };
315
+ var isDev = env2.NODE_ENV === "development";
316
+ var vueFeatureFlags = {
317
+ __VUE_OPTIONS_API__: "true",
318
+ __VUE_PROD_DEVTOOLS__: isDev ? "true" : "false",
319
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDev ? "true" : "false"
320
+ };
181
321
  var build = async ({
182
322
  buildDirectory = "build",
183
323
  assetsDirectory,
@@ -185,6 +325,7 @@ var build = async ({
185
325
  htmlDirectory,
186
326
  htmxDirectory,
187
327
  svelteDirectory,
328
+ vueDirectory,
188
329
  tailwind,
189
330
  options
190
331
  }) => {
@@ -192,127 +333,139 @@ var build = async ({
192
333
  const projectRoot = cwd();
193
334
  const buildPath = validateSafePath(buildDirectory, projectRoot);
194
335
  const assetsPath = assetsDirectory && validateSafePath(assetsDirectory, projectRoot);
195
- const reactDirectoryPath = reactDirectory && validateSafePath(reactDirectory, projectRoot);
196
- const htmlDirectoryPath = htmlDirectory && validateSafePath(htmlDirectory, projectRoot);
197
- const htmxPath = htmxDirectory && validateSafePath(htmxDirectory, projectRoot);
198
- const svelteDirectoryPath = svelteDirectory && validateSafePath(svelteDirectory, projectRoot);
199
- const reactIndexesPath = reactDirectoryPath && join3(reactDirectoryPath, "indexes");
200
- const reactPagesPath = reactDirectoryPath && join3(reactDirectoryPath, "pages");
201
- const htmlPagesPath = htmlDirectoryPath && join3(htmlDirectoryPath, "pages");
202
- const htmlScriptsPath = htmlDirectoryPath && join3(htmlDirectoryPath, "scripts");
203
- const sveltePagesPath = svelteDirectoryPath && join3(svelteDirectoryPath, "pages");
204
- const isSingleFrontend = [
205
- reactDirectoryPath,
206
- htmlDirectoryPath,
207
- htmxPath,
208
- svelteDirectoryPath
209
- ].filter(Boolean).length === 1;
210
- const isSvelteOnly = isSingleFrontend && svelteDirectoryPath !== undefined;
211
- const serverOutDir = isSvelteOnly ? join3(buildPath, "pages") : buildPath;
212
- const serverRoot = isSvelteOnly ? join3(svelteDirectoryPath, "pages") : undefined;
213
- const svelteOutDir = isSingleFrontend ? buildPath : join3(buildPath, basename3(svelteDirectoryPath ?? ""));
214
- const svelteDirName = svelteDirectoryPath && basename3(svelteDirectoryPath);
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);
341
+ const reactIndexesPath = reactDir && join4(reactDir, "indexes");
342
+ const reactPagesPath = reactDir && join4(reactDir, "pages");
343
+ const htmlPagesPath = htmlDir && join4(htmlDir, "pages");
344
+ const htmlScriptsPath = htmlDir && join4(htmlDir, "scripts");
345
+ const sveltePagesPath = svelteDir && join4(svelteDir, "pages");
346
+ const vuePagesPath = vueDir && join4(vueDir, "pages");
347
+ const frontends = [reactDir, htmlDir, htmxDir, svelteDir, vueDir].filter(Boolean);
348
+ const isSingle = frontends.length === 1;
349
+ let serverOutDir;
350
+ if (svelteDir) {
351
+ serverOutDir = join4(buildPath, basename4(svelteDir), "pages");
352
+ } else if (vueDir) {
353
+ serverOutDir = join4(buildPath, basename4(vueDir), "pages");
354
+ }
355
+ let serverRoot;
356
+ if (svelteDir) {
357
+ serverRoot = join4(svelteDir, "pages");
358
+ } else if (vueDir) {
359
+ serverRoot = join4(vueDir, "pages");
360
+ }
215
361
  await rm2(buildPath, { force: true, recursive: true });
216
- await mkdir3(buildPath);
217
- if (reactIndexesPath && reactPagesPath) {
362
+ await mkdir4(buildPath);
363
+ if (reactIndexesPath && reactPagesPath)
218
364
  await generateReactIndexFiles(reactPagesPath, reactIndexesPath);
219
- }
220
- if (assetsPath) {
221
- await cp(assetsPath, join3(buildPath, "assets"), {
365
+ if (assetsPath)
366
+ await cp(assetsPath, join4(buildPath, "assets"), {
222
367
  force: true,
223
368
  recursive: true
224
369
  });
225
- }
226
- if (htmxPath) {
227
- await mkdir3(join3(buildPath, "htmx"));
228
- await cp(htmxPath, join3(buildPath, "htmx"), {
370
+ if (htmxDir) {
371
+ await mkdir4(join4(buildPath, "htmx"));
372
+ await cp(htmxDir, join4(buildPath, "htmx"), {
229
373
  force: true,
230
374
  recursive: true
231
375
  });
232
376
  }
233
- if (tailwind) {
234
- await $`bunx @tailwindcss/cli -i ${tailwind.input} -o ${join3(buildPath, tailwind.output)}`;
235
- }
236
- const reactEntryPoints = reactIndexesPath ? await scanEntryPoints(reactIndexesPath, "*.tsx") : [];
237
- const svelteEntryPoints = sveltePagesPath ? await scanEntryPoints(sveltePagesPath, "*.svelte") : [];
238
- const htmlEntryPoints = htmlScriptsPath ? await scanEntryPoints(htmlScriptsPath, "*.{js,ts}") : [];
239
- const { svelteServerPaths, svelteClientPaths } = svelteDirectoryPath ? await compileSvelte(svelteEntryPoints, svelteDirectoryPath) : { svelteClientPaths: [], svelteServerPaths: [] };
240
- const serverEntryPoints = [
241
- ...reactEntryPoints,
242
- ...htmlEntryPoints,
243
- ...svelteServerPaths
377
+ if (tailwind)
378
+ await $`bunx @tailwindcss/cli -i ${tailwind.input} -o ${join4(buildPath, tailwind.output)}`;
379
+ const reactEntries = reactIndexesPath ? await scanEntryPoints(reactIndexesPath, "*.tsx") : [];
380
+ const htmlEntries = htmlScriptsPath ? await scanEntryPoints(htmlScriptsPath, "*.{js,ts}") : [];
381
+ const svelteEntries = sveltePagesPath ? await scanEntryPoints(sveltePagesPath, "*.svelte") : [];
382
+ const vueEntries = vuePagesPath ? await scanEntryPoints(vuePagesPath, "*.vue") : [];
383
+ const { svelteServerPaths, svelteClientPaths } = svelteDir ? await compileSvelte(svelteEntries, svelteDir) : { svelteClientPaths: [], svelteServerPaths: [] };
384
+ const { vueServerPaths, vueClientPaths, vueCssPaths } = vueDir ? await compileVue(vueEntries, vueDir) : { vueClientPaths: [], vueCssPaths: {}, vueServerPaths: [] };
385
+ const serverEntryPoints = [...svelteServerPaths, ...vueServerPaths];
386
+ const clientEntryPoints = [
387
+ ...reactEntries,
388
+ ...svelteClientPaths,
389
+ ...htmlEntries,
390
+ ...vueClientPaths
244
391
  ];
245
- if (serverEntryPoints.length === 0) {
246
- console.warn("No server entry points found, skipping manifest generation");
392
+ if (serverEntryPoints.length === 0 && clientEntryPoints.length === 0) {
393
+ console.warn("No entry points found");
247
394
  return null;
248
395
  }
249
- const { logs: serverLogs, outputs: serverOutputs } = await bunBuild({
250
- entrypoints: serverEntryPoints,
251
- format: "esm",
252
- naming: `[dir]/[name].[hash].[ext]`,
253
- outdir: serverOutDir,
254
- root: serverRoot,
255
- target: "bun"
256
- }).catch((error) => {
257
- console.error("Server build failed:", error);
258
- exit(1);
259
- });
396
+ let serverLogs = [];
397
+ let serverOutputs = [];
398
+ if (serverEntryPoints.length > 0) {
399
+ const { logs, outputs } = await bunBuild({
400
+ entrypoints: serverEntryPoints,
401
+ format: "esm",
402
+ naming: `[dir]/[name].[hash].[ext]`,
403
+ outdir: serverOutDir,
404
+ root: serverRoot,
405
+ target: "bun"
406
+ }).catch((err) => {
407
+ console.error("Server build failed:", err);
408
+ exit(1);
409
+ });
410
+ serverLogs = logs;
411
+ serverOutputs = outputs;
412
+ }
260
413
  let clientLogs = [];
261
414
  let clientOutputs = [];
262
- if (svelteDirectoryPath) {
415
+ if (clientEntryPoints.length > 0) {
416
+ const roots = [reactDir, svelteDir, htmlDir, vueDir].filter((dir) => Boolean(dir));
417
+ const clientRoot = isSingle ? roots[0] ?? projectRoot : commonAncestor(roots, projectRoot);
263
418
  const { logs, outputs } = await bunBuild({
264
- entrypoints: svelteClientPaths,
419
+ define: vueDirectory ? vueFeatureFlags : undefined,
420
+ entrypoints: clientEntryPoints,
265
421
  format: "esm",
266
422
  naming: `[dir]/[name].[hash].[ext]`,
267
- outdir: svelteOutDir,
268
- root: svelteDirectoryPath,
423
+ outdir: buildPath,
424
+ root: clientRoot,
269
425
  target: "browser"
270
- }).catch((error) => {
271
- console.error("Client build failed:", error);
426
+ }).catch((err) => {
427
+ console.error("Client build failed:", err);
272
428
  exit(1);
273
429
  });
274
430
  clientLogs = logs;
275
431
  clientOutputs = outputs;
276
432
  }
277
- [...serverLogs, ...clientLogs].forEach((log) => {
278
- if (log.level === "error")
279
- console.error(log);
280
- else if (log.level === "warning")
281
- console.warn(log);
282
- else
283
- console.info(log);
284
- });
285
- const manifest = generateManifest([...serverOutputs, ...clientOutputs], buildPath, svelteDirName);
286
- if (htmlDirectoryPath && htmlPagesPath) {
287
- const outputHtmlPages = join3(buildPath, basename3(htmlDirectoryPath), "pages");
288
- await mkdir3(outputHtmlPages, { recursive: true });
433
+ const allLogs = [...serverLogs, ...clientLogs];
434
+ 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);
442
+ }
443
+ const manifest = generateManifest([...serverOutputs, ...clientOutputs], buildPath);
444
+ if (htmlDir && htmlPagesPath) {
445
+ const outputHtmlPages = join4(buildPath, basename4(htmlDir), "pages");
446
+ await mkdir4(outputHtmlPages, { recursive: true });
289
447
  await cp(htmlPagesPath, outputHtmlPages, {
290
448
  force: true,
291
449
  recursive: true
292
450
  });
293
451
  await updateScriptTags(manifest, outputHtmlPages);
294
452
  }
295
- if (!options?.preserveIntermediateFiles && svelteDirectoryPath) {
296
- await rm2(join3(svelteDirectoryPath, "indexes"), {
297
- force: true,
298
- recursive: true
299
- });
300
- await rm2(join3(svelteDirectoryPath, "client"), {
301
- force: true,
302
- recursive: true
303
- });
304
- await Promise.all(svelteServerPaths.map((filePath) => rm2(filePath, { force: true })));
453
+ if (!options?.preserveIntermediateFiles && svelteDir) {
454
+ await rm2(join4(svelteDir, "indexes"), { force: true, recursive: true });
455
+ await rm2(join4(svelteDir, "client"), { force: true, recursive: true });
456
+ await Promise.all(svelteServerPaths.map((path) => rm2(path, { force: true })));
305
457
  }
306
- if (!options?.preserveIntermediateFiles && reactIndexesPath) {
458
+ if (!options?.preserveIntermediateFiles && reactIndexesPath)
307
459
  await rm2(reactIndexesPath, { force: true, recursive: true });
308
- }
309
460
  console.log(`Build completed in ${getDurationString(performance.now() - buildStart)}`);
310
- return manifest;
461
+ return { ...manifest, ...vueCssPaths };
311
462
  };
312
463
  // src/core/pageHandlers.ts
313
- var {file: file2 } = globalThis.Bun;
464
+ var {file: file3 } = globalThis.Bun;
314
465
  import { createElement } from "react";
315
466
  import { renderToReadableStream as renderReactToReadableStream } from "react-dom/server";
467
+ import { createSSRApp, h } from "vue";
468
+ import { renderToWebStream as renderVueToWebStream } from "vue/server-renderer";
316
469
 
317
470
  // src/svelte/renderToReadableStream.ts
318
471
  import { render } from "svelte/server";
@@ -326,7 +479,10 @@ var ESCAPE_LOOKUP = {
326
479
  ">": "\\u003E"
327
480
  };
328
481
  var ESCAPE_REGEX = /[&><\u2028\u2029]/g;
329
- var escapeScriptContent = (content) => content.replace(ESCAPE_REGEX, (char) => ESCAPE_LOOKUP[char]);
482
+ var escapeScriptContent = (content) => content.replace(ESCAPE_REGEX, (char) => {
483
+ const escaped = ESCAPE_LOOKUP[char];
484
+ return escaped !== undefined ? escaped : char;
485
+ });
330
486
 
331
487
  // src/svelte/renderToReadableStream.ts
332
488
  var renderToReadableStream = async (component, props, {
@@ -382,26 +538,67 @@ var handleReactPageRequest = async (pageComponent, index, ...props) => {
382
538
  headers: { "Content-Type": "text/html" }
383
539
  });
384
540
  };
385
- var handleSveltePageRequest = async (PageComponent, manifest, props) => {
386
- const componentPath = PageComponent.toString();
387
- const pathSegments = componentPath.split("/");
388
- const lastSegment = pathSegments[pathSegments.length - 1] ?? "";
389
- const componentName = lastSegment.replace(/\.svelte$/, "");
390
- const pagePath = manifest[componentName];
391
- const indexPath = manifest[`${componentName}Index`];
541
+ var handleSveltePageRequest = async (_PageComponent, pagePath, indexPath, props) => {
392
542
  const { default: ImportedPageComponent } = await import(pagePath);
393
543
  const stream = await renderToReadableStream(ImportedPageComponent, props, {
394
- bootstrapModules: [indexPath],
544
+ bootstrapModules: indexPath ? [indexPath] : [],
395
545
  bootstrapScriptContent: `window.__INITIAL_PROPS__=${JSON.stringify(props)}`
396
546
  });
397
547
  return new Response(stream, {
398
548
  headers: { "Content-Type": "text/html" }
399
549
  });
400
550
  };
401
- var handleHTMLPageRequest = (html) => file2(html);
551
+ var handleVuePageRequest = async (_PageComponent, pagePath, indexPath, ...props) => {
552
+ const [maybeProps] = props;
553
+ const { default: ImportedPageComponent } = await import(pagePath);
554
+ const app = createSSRApp({
555
+ render: () => h(ImportedPageComponent, maybeProps ?? {})
556
+ });
557
+ const bodyStream = renderVueToWebStream(app);
558
+ const head = '<!DOCTYPE html><html><head></head><body><div id="app">';
559
+ const tail = `</div><script>window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})}</script><script type="module" src="${indexPath}"></script></body></html>`;
560
+ const stream = new ReadableStream({
561
+ start(controller) {
562
+ controller.enqueue(head);
563
+ const reader = bodyStream.getReader();
564
+ const pumpLoop = () => {
565
+ reader.read().then(({ done, value }) => done ? (controller.enqueue(tail), controller.close()) : (controller.enqueue(value), pumpLoop())).catch((err) => controller.error(err));
566
+ };
567
+ pumpLoop();
568
+ }
569
+ });
570
+ return new Response(stream, {
571
+ headers: { "Content-Type": "text/html" }
572
+ });
573
+ };
574
+ var handleHTMLPageRequest = (html) => file3(html);
575
+ var handlePageRequest = (PageComponent, ...props) => {
576
+ console.log("handlePageRequest coming soon.", PageComponent, props);
577
+ };
578
+ // src/core/lookup.ts
579
+ var asset = (manifest, name) => {
580
+ const assetPath = manifest[name];
581
+ if (assetPath === undefined) {
582
+ throw new Error(`Asset "${name}" not found in manifest.`);
583
+ }
584
+ if (Array.isArray(assetPath)) {
585
+ throw new Error(`"${name}" is an array, use 'assets' instead.`);
586
+ }
587
+ return assetPath;
588
+ };
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
+ };
402
599
  // src/plugins/networkingPlugin.ts
403
600
  import { argv } from "process";
404
- var {env: env2 } = globalThis.Bun;
601
+ var {env: env3 } = globalThis.Bun;
405
602
 
406
603
  // src/utils/networking.ts
407
604
  import os from "os";
@@ -416,8 +613,8 @@ var getLocalIPAddress = () => {
416
613
  };
417
614
 
418
615
  // src/plugins/networkingPlugin.ts
419
- var host = env2.HOST ?? "localhost";
420
- var port = env2.PORT ?? DEFAULT_PORT;
616
+ var host = env3.HOST ?? "localhost";
617
+ var port = env3.PORT ?? DEFAULT_PORT;
421
618
  var localIP;
422
619
  var args = argv;
423
620
  var hostFlag = args.includes("--host");
@@ -444,11 +641,15 @@ export {
444
641
  updateScriptTags,
445
642
  pageRouterPlugin,
446
643
  networkingPlugin,
644
+ handleVuePageRequest,
447
645
  handleSveltePageRequest,
448
646
  handleReactPageRequest,
647
+ handlePageRequest,
449
648
  handleHTMLPageRequest,
450
649
  getLocalIPAddress,
451
650
  build,
651
+ assets,
652
+ asset,
452
653
  TWO_THIRDS,
453
654
  TIME_PRECISION,
454
655
  SECONDS_IN_A_MINUTE,
@@ -461,5 +662,5 @@ export {
461
662
  DEFAULT_CHUNK_SIZE
462
663
  };
463
664
 
464
- //# debugId=F0D0DE61A724A5EB64756E2164756E21
665
+ //# debugId=F6760E8AC62BE5FB64756E2164756E21
465
666
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,24 +1,26 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/constants.ts", "../src/core/build.ts", "../src/build/generateManifest.ts", "../src/build/generateReactIndexes.ts", "../src/build/scanEntryPoints.ts", "../src/build/updateScriptTags.ts", "../src/svelte/compileSvelte.ts", "../src/utils/getDurationString.ts", "../src/utils/validateSafePath.ts", "../src/core/pageHandlers.ts", "../src/svelte/renderToReadableStream.ts", "../src/utils/escapeScriptContent.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/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"],
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 } from 'node:path';\nimport { cwd, exit } from 'node:process';\nimport { $, BuildArtifact, build as bunBuild } from 'bun';\nimport { generateManifest } from '../build/generateManifest';\nimport { generateReactIndexFiles } from '../build/generateReactIndexes';\nimport { scanEntryPoints } from '../build/scanEntryPoints';\nimport { updateScriptTags } from '../build/updateScriptTags';\nimport { compileSvelte } from '../svelte/compileSvelte';\nimport { BuildConfig } from '../types';\nimport { getDurationString } from '../utils/getDurationString';\nimport { validateSafePath } from '../utils/validateSafePath';\n\nexport const build = async ({\n\tbuildDirectory = 'build',\n\tassetsDirectory,\n\treactDirectory,\n\thtmlDirectory,\n\thtmxDirectory,\n\tsvelteDirectory,\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 reactDirectoryPath =\n\t\treactDirectory && validateSafePath(reactDirectory, projectRoot);\n\tconst htmlDirectoryPath =\n\t\thtmlDirectory && validateSafePath(htmlDirectory, projectRoot);\n\tconst htmxPath =\n\t\thtmxDirectory && validateSafePath(htmxDirectory, projectRoot);\n\tconst svelteDirectoryPath =\n\t\tsvelteDirectory && validateSafePath(svelteDirectory, projectRoot);\n\n\tconst reactIndexesPath =\n\t\treactDirectoryPath && join(reactDirectoryPath, 'indexes');\n\tconst reactPagesPath =\n\t\treactDirectoryPath && join(reactDirectoryPath, 'pages');\n\tconst htmlPagesPath = htmlDirectoryPath && join(htmlDirectoryPath, 'pages');\n\tconst htmlScriptsPath =\n\t\thtmlDirectoryPath && join(htmlDirectoryPath, 'scripts');\n\tconst sveltePagesPath =\n\t\tsvelteDirectoryPath && join(svelteDirectoryPath, 'pages');\n\n\tconst isSingleFrontend =\n\t\t[\n\t\t\treactDirectoryPath,\n\t\t\thtmlDirectoryPath,\n\t\t\thtmxPath,\n\t\t\tsvelteDirectoryPath\n\t\t].filter(Boolean).length === 1;\n\tconst isSvelteOnly = isSingleFrontend && svelteDirectoryPath !== undefined;\n\n\tconst serverOutDir = isSvelteOnly ? join(buildPath, 'pages') : buildPath;\n\tconst serverRoot = isSvelteOnly\n\t\t? join(svelteDirectoryPath, 'pages')\n\t\t: undefined;\n\tconst svelteOutDir = isSingleFrontend\n\t\t? buildPath\n\t\t: join(buildPath, basename(svelteDirectoryPath ?? ''));\n\tconst svelteDirName = svelteDirectoryPath && basename(svelteDirectoryPath);\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\t}\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\t}\n\n\tif (htmxPath) {\n\t\tawait mkdir(join(buildPath, 'htmx'));\n\t\tawait cp(htmxPath, 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\t}\n\n\tconst reactEntryPoints = reactIndexesPath\n\t\t? await scanEntryPoints(reactIndexesPath, '*.tsx')\n\t\t: [];\n\tconst svelteEntryPoints = sveltePagesPath\n\t\t? await scanEntryPoints(sveltePagesPath, '*.svelte')\n\t\t: [];\n\tconst htmlEntryPoints = htmlScriptsPath\n\t\t? await scanEntryPoints(htmlScriptsPath, '*.{js,ts}')\n\t\t: [];\n\n\tconst { svelteServerPaths, svelteClientPaths } = svelteDirectoryPath\n\t\t? await compileSvelte(svelteEntryPoints, svelteDirectoryPath)\n\t\t: { svelteClientPaths: [], svelteServerPaths: [] };\n\n\tconst serverEntryPoints = [\n\t\t...reactEntryPoints,\n\t\t...htmlEntryPoints,\n\t\t...svelteServerPaths\n\t];\n\n\tif (serverEntryPoints.length === 0) {\n\t\tconsole.warn(\n\t\t\t'No server entry points found, skipping manifest generation'\n\t\t);\n\n\t\treturn null;\n\t}\n\n\tconst { logs: serverLogs, outputs: serverOutputs } = await bunBuild({\n\t\tentrypoints: serverEntryPoints,\n\t\tformat: 'esm',\n\t\tnaming: `[dir]/[name].[hash].[ext]`,\n\t\toutdir: serverOutDir,\n\t\troot: serverRoot,\n\t\ttarget: 'bun'\n\t}).catch((error) => {\n\t\tconsole.error('Server build failed:', error);\n\t\texit(1);\n\t});\n\n\tlet clientLogs: (BuildMessage | ResolveMessage)[] = [];\n\tlet clientOutputs: BuildArtifact[] = [];\n\n\tif (svelteDirectoryPath) {\n\t\tconst { logs, outputs } = await bunBuild({\n\t\t\tentrypoints: svelteClientPaths,\n\t\t\tformat: 'esm',\n\t\t\tnaming: `[dir]/[name].[hash].[ext]`,\n\t\t\toutdir: svelteOutDir,\n\t\t\troot: svelteDirectoryPath,\n\t\t\ttarget: 'browser'\n\t\t}).catch((error) => {\n\t\t\tconsole.error('Client build failed:', error);\n\t\t\texit(1);\n\t\t});\n\n\t\tclientLogs = logs;\n\t\tclientOutputs = outputs;\n\t}\n\n\t[...serverLogs, ...clientLogs].forEach((log) => {\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],\n\t\tbuildPath,\n\t\tsvelteDirName\n\t);\n\n\tif (htmlDirectoryPath && htmlPagesPath) {\n\t\tconst outputHtmlPages = join(\n\t\t\tbuildPath,\n\t\t\tbasename(htmlDirectoryPath),\n\t\t\t'pages'\n\t\t);\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 && svelteDirectoryPath) {\n\t\tawait rm(join(svelteDirectoryPath, 'indexes'), {\n\t\t\tforce: true,\n\t\t\trecursive: true\n\t\t});\n\t\tawait rm(join(svelteDirectoryPath, 'client'), {\n\t\t\tforce: true,\n\t\t\trecursive: true\n\t\t});\n\t\tawait Promise.all(\n\t\t\tsvelteServerPaths.map((filePath) => rm(filePath, { force: true }))\n\t\t);\n\t}\n\n\tif (!options?.preserveIntermediateFiles && reactIndexesPath) {\n\t\tawait rm(reactIndexesPath, { force: true, recursive: true });\n\t}\n\n\tconsole.log(\n\t\t`Build completed in ${getDurationString(performance.now() - buildStart)}`\n\t);\n\n\treturn manifest;\n};\n",
7
- "import { BuildArtifact } from 'bun';\n\nexport const generateManifest = (\n\toutputs: BuildArtifact[],\n\tbuildDirectoryAbsolute: string,\n\tsvelteDirName?: string\n) => {\n\tconst prefix = svelteDirName ? `(?:${svelteDirName}/)?` : '';\n\tconst pagesRegex = new RegExp(`^${prefix}pages/`);\n\tconst indexesRegex = new RegExp(`^${prefix}indexes/`);\n\n\treturn outputs.reduce<Record<string, string>>((manifest, artifact) => {\n\t\tlet relativePath = artifact.path.startsWith(buildDirectoryAbsolute)\n\t\t\t? artifact.path.slice(buildDirectoryAbsolute.length)\n\t\t\t: artifact.path;\n\t\trelativePath = relativePath.replace(/^\\/+/, '');\n\t\tconst segments = relativePath.split('/');\n\t\tconst fileWithHash = segments.pop();\n\t\tif (!fileWithHash) return manifest;\n\t\tconst [baseName] = fileWithHash.split(`.${artifact.hash}.`);\n\n\t\tif (indexesRegex.test(relativePath)) {\n\t\t\tmanifest[`${baseName}Index`] = `/${relativePath}`;\n\t\t} else if (pagesRegex.test(relativePath)) {\n\t\t\tmanifest[baseName] = artifact.path;\n\t\t} else {\n\t\t\tmanifest[baseName] = `/${relativePath}`;\n\t\t}\n\n\t\treturn manifest;\n\t}, {});\n};\n",
8
- "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}Index.tsx`),\n\t\t\tcontent\n\t\t);\n\t});\n\tawait Promise.all(promises);\n};\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",
10
+ "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",
9
11
  "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",
10
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",
11
- "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",
12
13
  "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",
13
14
  "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",
14
- "import { file } from 'bun';\nimport { ComponentType, createElement } from 'react';\nimport { renderToReadableStream as renderReactToReadableStream } from 'react-dom/server';\nimport { Component } from 'svelte';\nimport { renderToReadableStream as renderSvelteToReadableStream } from '../svelte/renderToReadableStream';\n\nexport const handleReactPageRequest = async <\n\tProps extends Record<string, unknown> = Record<never, never>\n>(\n\tpageComponent: ComponentType<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: Component<Record<string, never>>,\n\t\tmanifest: Record<string, string>\n\t): Promise<Response>;\n\t<P extends Record<string, unknown>>(\n\t\tPageComponent: Component<P>,\n\t\tmanifest: Record<string, string>,\n\t\tprops: P\n\t): Promise<Response>;\n};\n\nexport const handleSveltePageRequest: HandleSveltePageRequest = async <\n\tP extends Record<string, unknown>\n>(\n\tPageComponent: Component<P>,\n\tmanifest: Record<string, string>,\n\tprops?: P\n) => {\n\tconst componentPath = PageComponent.toString();\n\tconst pathSegments = componentPath.split('/');\n\tconst lastSegment = pathSegments[pathSegments.length - 1] ?? '';\n\tconst componentName = lastSegment.replace(/\\.svelte$/, '');\n\n\tconst pagePath = manifest[componentName];\n\tconst indexPath = manifest[`${componentName}Index`];\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],\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 handleHTMLPageRequest = (html: string) => file(html);\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",
15
16
  "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",
16
- "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) => ESCAPE_LOOKUP[char]);\n",
17
+ "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",
17
19
  "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",
18
20
  "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",
19
21
  "export const pageRouterPlugin = () => {\n\tconsole.log('Page Router Plugin Not Implemented Yet');\n};\n"
20
22
  ],
21
- "mappings": ";;AAAO,IAAM,sBAAsB;AAC5B,IAAM,2B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AAI,UAAU;AAAA,IACb,QAAQ,IAAI,sCAAsC,MAAM;AAAA,IACxD,QAAQ,IACP,qCAAqC,WAAW,MACjD;AAAA,EACD,EAAO;AAAA,IACN,QAAQ,IAAI,4BAA4B,QAAQ,MAAM;AAAA;AAAA,CAGzD;;AEnCM,IAAM,mBAAmB,MAAM;AAAA,EACrC,QAAQ,IAAI,wCAAwC;AAAA;",
24
+ "debugId": "F6760E8AC62BE5FB64756E2164756E21",
23
25
  "names": []
24
26
  }
@@ -0,0 +1,24 @@
1
+ import { ComponentType as ReactComponent } from 'react';
2
+ import { Component as SvelteComponent } from 'svelte';
3
+ import { Component as VueComponent } from 'vue';
4
+ export type BuildOptions = {
5
+ preserveIntermediateFiles?: boolean;
6
+ };
7
+ export type BuildConfig = {
8
+ buildDirectory?: string;
9
+ assetsDirectory?: string;
10
+ reactDirectory?: string;
11
+ vueDirectory?: string;
12
+ angularDirectory?: string;
13
+ astroDirectory?: string;
14
+ svelteDirectory?: string;
15
+ htmlDirectory?: string;
16
+ htmxDirectory?: string;
17
+ tailwind?: {
18
+ input: string;
19
+ output: string;
20
+ };
21
+ options?: BuildOptions;
22
+ };
23
+ export type PropsOf<Component> = Component extends ReactComponent<infer Props> ? Props : Component extends SvelteComponent<infer Props> ? Props : Component extends VueComponent<infer Props> ? Props : Record<string, never>;
24
+ export type PropsArgs<C> = keyof PropsOf<C> extends never ? [] : [PropsOf<C>];
package/eslint.config.mjs CHANGED
@@ -35,14 +35,14 @@ export default defineConfig([
35
35
  files: ['**/*.{ts,tsx}'],
36
36
  languageOptions: {
37
37
  globals: {
38
- ...globals.browser,
38
+ // TODO: These should only be applied to the src/core/build.ts file.
39
39
  BuildMessage: 'readonly',
40
40
  ResolveMessage: 'readonly'
41
41
  },
42
42
  parser: tsParser,
43
43
  parserOptions: {
44
44
  createDefaultProgram: true,
45
- project: './tsconfig.json',
45
+ project: './tsconfig.lint.json',
46
46
  tsconfigRootDir: __dirname
47
47
  }
48
48
  },
@@ -60,6 +60,11 @@ export default defineConfig([
60
60
  {
61
61
  files: ['**/*.{js,mjs,cjs,ts,tsx,jsx}'],
62
62
  ignores: ['node_modules/**'],
63
+ languageOptions: {
64
+ globals: {
65
+ ...globals.browser
66
+ }
67
+ },
63
68
  plugins: {
64
69
  absolute: absolutePlugin,
65
70
  import: importPlugin,
@@ -184,7 +189,12 @@ export default defineConfig([
184
189
  }
185
190
  },
186
191
  {
187
- files: ['eslint.config.mjs'],
192
+ files: [
193
+ 'eslint.config.mjs',
194
+ 'example/vue/scripts/*.ts',
195
+ 'example/vue/pages/*.js',
196
+ 'example/vue/client/*.js'
197
+ ],
188
198
  rules: {
189
199
  'import/no-default-export': 'off'
190
200
  }
@@ -201,5 +211,25 @@ export default defineConfig([
201
211
  rules: {
202
212
  'import/no-unused-modules': 'off'
203
213
  }
214
+ },
215
+ {
216
+ files: ['example/vue/scripts/*.ts'],
217
+ rules: {
218
+ 'absolute/explicit-object-types': 'off',
219
+ 'no-duplicate-imports': 'off'
220
+ }
221
+ },
222
+ {
223
+ files: ['example/vue/pages/*.js', 'example/vue/client/*.js'],
224
+ rules: {
225
+ '@typescript-eslint/no-unused-vars': 'off',
226
+ 'func-style': 'off'
227
+ }
228
+ },
229
+ {
230
+ files: ['example/vue/client/*.js'],
231
+ rules: {
232
+ 'absolute/explicit-object-types': 'off'
233
+ }
204
234
  }
205
235
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/absolute",
3
- "version": "0.8.15",
3
+ "version": "0.9.0",
4
4
  "description": "A fullstack meta-framework for building web applications with TypeScript",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,7 +11,7 @@
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 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.json",
15
15
  "test": "echo \"Error: no test specified\" && exit 1",
16
16
  "format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,json,mjs,md,svelte}\"",
17
17
  "lint": "eslint ./",
@@ -23,16 +23,16 @@
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.34.7",
27
+ "vue": "^3.5.17"
27
28
  },
28
29
  "devDependencies": {
29
30
  "@elysiajs/static": "1.3.0",
30
31
  "@stylistic/eslint-plugin-ts": "4.2.0",
31
32
  "@tailwindcss/cli": "4.1.7",
32
- "@types/bun": "1.2.14",
33
+ "@types/bun": "1.2.17",
33
34
  "@types/react": "19.1.5",
34
35
  "@types/react-dom": "19.1.5",
35
- "@types/vue": "2.0.0",
36
36
  "autoprefixer": "10.4.21",
37
37
  "elysia": "1.3.1",
38
38
  "eslint": "9.26.0",
@@ -48,6 +48,6 @@
48
48
  "tailwindcss": "4.1.7",
49
49
  "typescript": "5.8.3",
50
50
  "typescript-eslint": "8.32.0",
51
- "vue": "3.4.26"
51
+ "vue": "3.5.17"
52
52
  }
53
53
  }
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "allowJs": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "jsx": "react-jsx",
8
+ "esModuleInterop": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "outDir": "dist",
11
+ "strict": true,
12
+ "declaration": true,
13
+ "skipLibCheck": true,
14
+ "noUncheckedIndexedAccess": true,
15
+ "noImplicitAny": true,
16
+ "lib": ["DOM", "DOM.Iterable", "ESNext"]
17
+ },
18
+ "include": ["src/**/*", "example/**/*"],
19
+ "exclude": ["node_modules"]
20
+ }
@@ -1,2 +0,0 @@
1
- import { BuildConfig } from '../types';
2
- export declare const build: ({ buildDirectory, assetsDirectory, reactDirectory, htmlDirectory, htmxDirectory, svelteDirectory, tailwind, options }: BuildConfig) => Promise<Record<string, string> | null>;
@@ -1,10 +0,0 @@
1
- import { ComponentType } from 'react';
2
- import { Component } from 'svelte';
3
- export declare const handleReactPageRequest: <Props extends Record<string, unknown> = Record<never, never>>(pageComponent: ComponentType<Props>, index: string, ...props: keyof Props extends never ? [] : [props: Props]) => Promise<Response>;
4
- type HandleSveltePageRequest = {
5
- (PageComponent: Component<Record<string, never>>, manifest: Record<string, string>): Promise<Response>;
6
- <P extends Record<string, unknown>>(PageComponent: Component<P>, manifest: Record<string, string>, props: P): Promise<Response>;
7
- };
8
- export declare const handleSveltePageRequest: HandleSveltePageRequest;
9
- export declare const handleHTMLPageRequest: (html: string) => Bun.BunFile;
10
- export {};
@@ -1,20 +0,0 @@
1
- type BuildOptions = {
2
- preserveIntermediateFiles?: boolean;
3
- };
4
- export type BuildConfig = {
5
- buildDirectory?: string;
6
- assetsDirectory?: string;
7
- reactDirectory?: string;
8
- vueDirectory?: string;
9
- angularDirectory?: string;
10
- astroDirectory?: string;
11
- svelteDirectory?: string;
12
- htmlDirectory?: string;
13
- htmxDirectory?: string;
14
- tailwind?: {
15
- input: string;
16
- output: string;
17
- };
18
- options?: BuildOptions;
19
- };
20
- export {};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes