@torpor/build 0.1.21 → 0.1.22

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 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/site/pathToRegex.ts","../src/site/Router.ts","../src/site/Site.ts","../src/types/RouteType.ts","../src/site/defaultAdapter.ts"],"sourcesContent":["import Router from \"./site/Router\";\nimport Site from \"./site/Site\";\nimport type Adapter from \"./types/Adapter\";\nimport type PageEndPoint from \"./types/PageEndPoint\";\nimport type PageLoadEvent from \"./types/PageLoadEvent\";\nimport type PageServerAction from \"./types/PageServerAction\";\nimport type PageServerEndPoint from \"./types/PageServerEndPoint\";\nimport type PageServerLoad from \"./types/PageServerLoad\";\nimport type ServerEndPoint from \"./types/ServerEndPoint\";\nimport type ServerHook from \"./types/ServerHook\";\nimport type ServerLoadEvent from \"./types/ServerLoadEvent\";\nimport type ServerRequest from \"./types/ServerRequest\";\n\nexport { Site, Router };\n\nexport type {\n\tAdapter,\n\tPageEndPoint,\n\tPageServerEndPoint,\n\tPageServerLoad,\n\tPageServerAction,\n\tServerEndPoint,\n\tServerRequest,\n\tServerHook,\n\tPageLoadEvent,\n\tServerLoadEvent,\n};\n","export default function pathToRegex(path: string): RegExp {\n\tconst pattern =\n\t\tpath\n\t\t\t.split(\"/\")\n\t\t\t// Replace `[slug]` with a grouped match so we can pull out params\n\t\t\t.map((p) => {\n\t\t\t\treturn p.replace(/\\[([^\\/]+?)\\]/, \"(?<$1>[^\\\\/]+?)\");\n\t\t\t})\n\t\t\t.join(\"\\\\/\")\n\t\t\t// Replace globs with regex syntax\n\t\t\t.replaceAll(\"*\", \".*\") +\n\t\t// Ignore trailing slashes -- `/path` should be treated the same as `/path/`\n\t\t\"/*\";\n\treturn new RegExp(`^${pattern}/*$`);\n}\n","import type LayoutHandler from \"../types/LayoutHandler\";\nimport type ManifestRoute from \"../types/ManifestRoute\";\nimport type RouteHandler from \"../types/RouteHandler\";\nimport pathToRegex from \"./pathToRegex\";\n\n/**\n * A router that handles file routes with layouts, hooks, etc.\n */\nexport default class Router {\n\troutes: Route[] = [];\n\n\tconstructor() {}\n\n\t//add(path: string, file: string) {\n\t//\t// TODO: Call the specific addX method based on the file path\n\t//\tthis.addPage(route, file);\n\t//}\n\n\taddPages(routes: ManifestRoute[]): this {\n\t\tfor (let r of routes) {\n\t\t\tthis.routes.push(\n\t\t\t\tnew Route(r.path, {\n\t\t\t\t\tpath: r.path,\n\t\t\t\t\ttype: r.type,\n\t\t\t\t\tendPoint: r.endPoint,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tthis.#sortRoutes();\n\t\treturn this;\n\t}\n\n\t// TODO: Allow calling with the endpoint itself, so that you can setup an app with no scaffold\n\taddPage(path: string, type: number, endPoint: () => Promise<any>): this {\n\t\tthis.routes.push(\n\t\t\tnew Route(path, {\n\t\t\t\tpath,\n\t\t\t\ttype,\n\t\t\t\tendPoint,\n\t\t\t}),\n\t\t);\n\t\tthis.#sortRoutes();\n\t\treturn this;\n\t}\n\n\t/*\n\tloadPage(ev: ServerEvent, file: string): Response {\n\t\tlet page = this.pages.get(file);\n\t\tif (!page) {\n\t\t\tpage = {};\n\t\t\tthis.pages.set(file, page);\n\t\t}\n\t}\n\t*/\n\n\tmatch(path: string, query: URLSearchParams): Match | undefined {\n\t\tfor (let route of this.routes) {\n\t\t\tlet match = path.match(route.regex);\n\t\t\tif (match) {\n\t\t\t\t// Lazy load server endpoints and layouts\n\t\t\t\tif (!route.handler.loaded) {\n\t\t\t\t\tthis.#loadHandler(route.handler, route.path);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\thandler: route.handler,\n\t\t\t\t\tparams: match.groups,\n\t\t\t\t\tquery,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconsole.log(`not found: '${path}'`);\n\t}\n\n\t#loadHandler(handler: RouteHandler, path: string) {\n\t\thandler.layouts = this.#findLayouts(path);\n\t\thandler.serverEndPoint = this.#findServer(path);\n\t\thandler.serverHook = this.#findServerHook(path);\n\t}\n\n\t#findLayouts(path: string): LayoutHandler[] | undefined {\n\t\tlet layouts: LayoutHandler[] = [];\n\t\tlet parts = path\n\t\t\t// Strip the trailing`~/server` (so we don't look for `~/server/_layout`\n\t\t\t// which will never exist)\n\t\t\t.replace(/\\/~server$/, \"\")\n\t\t\t// The path will always start with / so splitting e.g. `/first/second`\n\t\t\t// will result in ['', 'first', 'second'] and checks for `/_layout`,\n\t\t\t// `/first/_layout` and `/second/_layout`\n\t\t\t.split(\"/\");\n\t\tlet basePath = \"\";\n\t\tfor (let i = 0; i < parts.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tbasePath += \"/\" + parts[i];\n\t\t\t}\n\t\t\tconst layoutPath = basePath + \"/_layout\";\n\t\t\tconst layoutRoute = this.routes.find((r) => r.path === layoutPath);\n\t\t\tif (layoutRoute) {\n\t\t\t\tlayouts.push({\n\t\t\t\t\tpath: layoutPath,\n\t\t\t\t\tendPoint: layoutRoute.handler.endPoint,\n\t\t\t\t\tserverEndPoint: this.#findServer(layoutPath),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn layouts.length ? layouts : undefined;\n\t}\n\n\t#findServer(path: string): (() => Promise<any>) | undefined {\n\t\tconst serverPath = path.replace(/\\/$/, \"\") + \"/~server\";\n\t\tconst serverRoute = this.routes.find((r) => r.path === serverPath);\n\t\treturn serverRoute && serverRoute.handler.endPoint;\n\t}\n\n\t#findServerHook(path: string): (() => Promise<any>) | undefined {\n\t\t// TODO: Should this be a collection, like layouts?\n\t\tlet serverHookPath = \"/_hook/~server\";\n\t\t// HACK: Generalise this\n\t\tif (path.startsWith(\"/api/\")) {\n\t\t\tserverHookPath = \"/api\" + serverHookPath;\n\t\t}\n\t\tconst serverHookRoute = this.routes.find((r) => r.path === serverHookPath);\n\t\treturn serverHookRoute && serverHookRoute.handler.endPoint;\n\t}\n\n\t// HACK: We're doing this here as well as in Site, so that you can use the\n\t// Router externally without Site\n\t#sortRoutes() {\n\t\tthis.routes = this.routes.sort((a, b) => {\n\t\t\t// Sort [param]s after paths\n\t\t\t// There might be a quicker/easier way to do this\n\t\t\tfor (let i = 0; i < Math.min(a.path.length, b.path.length); i++) {\n\t\t\t\tif (a.path[i] === \"[\" && b.path[i] !== \"[\") {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (b.path[i] === \"[\" && a.path[i] !== \"[\") {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (a.path[i] === b.path[i]) {\n\t\t\t\t\t// Keep going...\n\t\t\t\t} else {\n\t\t\t\t\treturn a.path[i].localeCompare(b.path[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn a.path.length - b.path.length;\n\t\t});\n\t}\n}\n\nclass Route {\n\tpath: string;\n\tregex: RegExp;\n\thandler: RouteHandler;\n\n\tconstructor(path: string, handler: RouteHandler) {\n\t\tthis.path = path;\n\t\tthis.regex = pathToRegex(path);\n\t\tthis.handler = handler;\n\t}\n}\n\ntype Match = {\n\thandler: RouteHandler;\n\tparams?: Record<string, string>;\n\tquery: URLSearchParams;\n};\n","import { promises as fs } from \"node:fs\";\nimport path from \"node:path\";\nimport { type Plugin, type UserConfig } from \"vite\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\nimport type Adapter from \"../types/Adapter\";\nimport {\n\tHOOK_ROUTE,\n\tHOOK_SERVER_ROUTE,\n\tLAYOUT_ROUTE,\n\tLAYOUT_SERVER_ROUTE,\n\tPAGE_ROUTE,\n\tPAGE_SERVER_ROUTE,\n\tSERVER_ROUTE,\n} from \"../types/RouteType\";\nimport defaultAdapter from \"./defaultAdapter\";\n\n// 1. The user sets this up\n// 2. It is passed into serverEntry and clientEntry through a Vite plugin\n// (defined in manifest.ts)\n// 3. In those files, it is used to build a Router\n\n/**\n * The Site class contains the information necessary to setup a @torpor/build\n * site, including routes, plugins, and options.\n */\nexport default class Site {\n\troot: string;\n\troutes: { path: string; file: string; type: number }[] = [];\n\t// Is default plugins a bad idea?\n\t// HACK: Set loose because otherwise it uses a list of allowed extensions\n\t// TODO: Should probably just do this ourselves and let the user pass in\n\t// tsconfigPaths themselves if they want to do something funky\n\tplugins: Plugin[] = [tsconfigPaths({ loose: true })];\n\t// Is default adapter a bad idea?\n\tadapter: Adapter = defaultAdapter;\n\t/**\n\t * Extra inputs, as absolute file paths, that will be compiled with the\n\t * output. What you do with them after that is up to you. File paths ending\n\t * with server.ts/js will only be compiled with the server output\n\t */\n\tinputs: string[] = [];\n\t/**\n\t * Vite config options. `plugins` and `build` will be overridden.\n\t */\n\tviteConfig?: UserConfig;\n\n\tconstructor() {\n\t\tthis.root = process.cwd();\n\t}\n\n\tasync addRouteFolder(folder: string): Promise<void> {\n\t\tconst routeFolder = path.join(this.root, folder);\n\t\tconst routeFiles = await fs.readdir(routeFolder, { recursive: true });\n\n\t\tfor (let file of routeFiles) {\n\t\t\t// The file must start with `+` or `_` and end with `.js` or `.ts`\n\t\t\tif (/^(\\+|_).+(\\.js|\\.ts)$/.test(path.basename(file))) {\n\t\t\t\tlet routePath = file\n\t\t\t\t\t.replace(/^\\//, \"\")\n\t\t\t\t\t.replace(/(\\.ts|\\.js)$/, \"\")\n\t\t\t\t\t.replace(/_hook.server$/, \"_hook/~server\")\n\t\t\t\t\t.replace(/_layout.server$/, \"_layout/~server\")\n\t\t\t\t\t.replace(/\\+page.server$/, \"~server\")\n\t\t\t\t\t.replace(/\\+server$/, \"\")\n\t\t\t\t\t.replace(/\\+page$/, \"\")\n\t\t\t\t\t.replace(/\\/$/, \"\");\n\t\t\t\troutePath = routePath.length > 0 ? `/${routePath}` : \"/\";\n\t\t\t\tlet type = this.#routeType(file);\n\t\t\t\tfile = path.relative(this.root, path.resolve(routeFolder, file));\n\t\t\t\tthis.routes.push({ path: routePath, file, type });\n\t\t\t}\n\t\t}\n\t\tthis.#sortRoutes();\n\t}\n\n\taddRouteFile(path: string, file: string): void {\n\t\tlet type = this.#routeType(file);\n\t\tthis.routes.push({ path, file, type });\n\t\tthis.#sortRoutes();\n\t}\n\n\t#routeType(file: string): number {\n\t\tlet routePath = file.replace(/^\\//, \"\").replace(/(\\.ts|\\.js)$/, \"\");\n\t\tif (routePath.endsWith(\"+page\")) {\n\t\t\treturn PAGE_ROUTE;\n\t\t} else if (routePath.endsWith(\"+page.server\")) {\n\t\t\treturn PAGE_SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"+server\")) {\n\t\t\treturn SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"_layout\")) {\n\t\t\treturn LAYOUT_ROUTE;\n\t\t} else if (routePath.endsWith(\"_layout.server\")) {\n\t\t\treturn LAYOUT_SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"_hook\")) {\n\t\t\treturn HOOK_ROUTE;\n\t\t} else if (routePath.endsWith(\"_hook.server\")) {\n\t\t\treturn HOOK_SERVER_ROUTE;\n\t\t}\n\t\treturn -1;\n\t}\n\n\t// TODO: You could make your site in a single file, like e.g. Hono...\n\t//addPage(path: string, endPoint: PageEndPoint, serverEndPoint?: PageServerEndPoint) {}\n\t//addEndPoint(path: string, endPoint: ServerEndPoint) {}\n\n\t#sortRoutes() {\n\t\tthis.routes = this.routes.sort((a, b) => {\n\t\t\t// Sort [param]s after paths\n\t\t\t// There might be a quicker/easier way to do this\n\t\t\tfor (let i = 0; i < Math.min(a.path.length, b.path.length); i++) {\n\t\t\t\tif (a.path[i] === \"[\" && b.path[i] !== \"[\") {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (b.path[i] === \"[\" && a.path[i] !== \"[\") {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (a.path[i] === b.path[i]) {\n\t\t\t\t\t// Keep going...\n\t\t\t\t} else {\n\t\t\t\t\treturn a.path[i].localeCompare(b.path[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn a.path.length - b.path.length;\n\t\t});\n\t}\n}\n","export const PAGE_ROUTE = 0;\nexport const PAGE_SERVER_ROUTE = 1;\nexport const SERVER_ROUTE = 3;\nexport const LAYOUT_ROUTE = 4;\nexport const LAYOUT_SERVER_ROUTE = 5;\nexport const HOOK_ROUTE = 6;\nexport const HOOK_SERVER_ROUTE = 7;\n","import Adapter from \"../types/Adapter\";\n\n// TODO: This should be an adapter-auto package that conditionally loads other packages...\n\nconst defaultAdapter: Adapter = {\n\tserve: () => {\n\t\tconsole.log(\"An adapter needs to be set in site.config\");\n\t},\n};\n\nexport default defaultAdapter;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAe,SAAR,YAA6BA,OAAsB;AACzD,QAAM,UACLA,MACE,MAAM,GAAG,EAET,IAAI,CAAC,MAAM;AACX,WAAO,EAAE,QAAQ,iBAAiB,iBAAiB;AAAA,EACpD,CAAC,EACA,KAAK,KAAK,EAEV,WAAW,KAAK,IAAI;AAAA,EAEtB;AACD,SAAO,IAAI,OAAO,IAAI,OAAO,KAAK;AACnC;;;ACNA,IAAqB,SAArB,MAA4B;AAAA,EAC3B,SAAkB,CAAC;AAAA,EAEnB,cAAc;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAOf,SAAS,QAA+B;AACvC,aAAS,KAAK,QAAQ;AACrB,WAAK,OAAO;AAAA,QACX,IAAI,MAAM,EAAE,MAAM;AAAA,UACjB,MAAM,EAAE;AAAA,UACR,MAAM,EAAE;AAAA,UACR,UAAU,EAAE;AAAA,QACb,CAAC;AAAA,MACF;AAAA,IACD;AACA,SAAK,YAAY;AACjB,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,QAAQC,OAAc,MAAc,UAAoC;AACvE,SAAK,OAAO;AAAA,MACX,IAAI,MAAMA,OAAM;AAAA,QACf,MAAAA;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF;AACA,SAAK,YAAY;AACjB,WAAO;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AAK,SAAS,EAAE,KAAK;AAAA,IAC/B,CAAC;AAAA,EACF;AACD;","names":["path","path","tsconfigPaths","path","fs"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/site/pathToRegex.ts","../src/site/Router.ts","../src/site/Site.ts","../src/types/RouteType.ts","../src/site/defaultAdapter.ts"],"sourcesContent":["import Router from \"./site/Router\";\nimport Site from \"./site/Site\";\nimport type Adapter from \"./types/Adapter\";\nimport type PageEndPoint from \"./types/PageEndPoint\";\nimport type PageLoadEvent from \"./types/PageLoadEvent\";\nimport type PageServerAction from \"./types/PageServerAction\";\nimport type PageServerEndPoint from \"./types/PageServerEndPoint\";\nimport type PageServerLoad from \"./types/PageServerLoad\";\nimport type ServerEndPoint from \"./types/ServerEndPoint\";\nimport type ServerHook from \"./types/ServerHook\";\nimport type ServerLoadEvent from \"./types/ServerLoadEvent\";\nimport type ServerRequest from \"./types/ServerRequest\";\n\nexport { Site, Router };\n\nexport type {\n\tAdapter,\n\tPageEndPoint,\n\tPageServerEndPoint,\n\tPageServerLoad,\n\tPageServerAction,\n\tServerEndPoint,\n\tServerRequest,\n\tServerHook,\n\tPageLoadEvent,\n\tServerLoadEvent,\n};\n","export default function pathToRegex(path: string): RegExp {\n\tconst pattern =\n\t\tpath\n\t\t\t.split(\"/\")\n\t\t\t// Replace `[slug]` with a grouped match so we can pull out params\n\t\t\t.map((p) => {\n\t\t\t\treturn p.replace(/\\[([^\\/]+?)\\]/, \"(?<$1>[^\\\\/]+?)\");\n\t\t\t})\n\t\t\t.join(\"\\\\/\")\n\t\t\t// Replace globs with regex syntax\n\t\t\t.replaceAll(\"*\", \".*\") +\n\t\t// Ignore trailing slashes -- `/path` should be treated the same as `/path/`\n\t\t\"/*\";\n\treturn new RegExp(`^${pattern}/*$`);\n}\n","import type LayoutHandler from \"../types/LayoutHandler\";\nimport type ManifestRoute from \"../types/ManifestRoute\";\nimport type RouteHandler from \"../types/RouteHandler\";\nimport pathToRegex from \"./pathToRegex\";\n\n/**\n * A router that handles file routes with layouts, hooks, etc.\n */\nexport default class Router {\n\troutes: Route[] = [];\n\n\tconstructor() {}\n\n\t//add(path: string, file: string) {\n\t//\t// TODO: Call the specific addX method based on the file path\n\t//\tthis.addPage(route, file);\n\t//}\n\n\taddPages(routes: ManifestRoute[]): this {\n\t\tfor (let r of routes) {\n\t\t\tthis.routes.push(\n\t\t\t\tnew Route(r.path, {\n\t\t\t\t\tpath: r.path,\n\t\t\t\t\ttype: r.type,\n\t\t\t\t\tendPoint: r.endPoint,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\tthis.#sortRoutes();\n\t\treturn this;\n\t}\n\n\t// TODO: Allow calling with the endpoint itself, so that you can setup an app with no scaffold\n\taddPage(path: string, type: number, endPoint: () => Promise<any>): this {\n\t\tthis.routes.push(\n\t\t\tnew Route(path, {\n\t\t\t\tpath,\n\t\t\t\ttype,\n\t\t\t\tendPoint,\n\t\t\t}),\n\t\t);\n\t\tthis.#sortRoutes();\n\t\treturn this;\n\t}\n\n\t/*\n\tloadPage(ev: ServerEvent, file: string): Response {\n\t\tlet page = this.pages.get(file);\n\t\tif (!page) {\n\t\t\tpage = {};\n\t\t\tthis.pages.set(file, page);\n\t\t}\n\t}\n\t*/\n\n\tmatch(path: string, query: URLSearchParams): Match | undefined {\n\t\tfor (let route of this.routes) {\n\t\t\tlet match = path.match(route.regex);\n\t\t\tif (match) {\n\t\t\t\t// Lazy load server endpoints and layouts\n\t\t\t\tif (!route.handler.loaded) {\n\t\t\t\t\tthis.#loadHandler(route.handler, route.path);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\thandler: route.handler,\n\t\t\t\t\tparams: match.groups,\n\t\t\t\t\tquery,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tconsole.log(`not found: '${path}'`);\n\t}\n\n\t#loadHandler(handler: RouteHandler, path: string) {\n\t\thandler.layouts = this.#findLayouts(path);\n\t\thandler.serverEndPoint = this.#findServer(path);\n\t\thandler.serverHook = this.#findServerHook(path);\n\t}\n\n\t#findLayouts(path: string): LayoutHandler[] | undefined {\n\t\tlet layouts: LayoutHandler[] = [];\n\t\tlet parts = path\n\t\t\t// Strip the trailing`~/server` (so we don't look for `~/server/_layout`\n\t\t\t// which will never exist)\n\t\t\t.replace(/\\/~server$/, \"\")\n\t\t\t// The path will always start with / so splitting e.g. `/first/second`\n\t\t\t// will result in ['', 'first', 'second'] and checks for `/_layout`,\n\t\t\t// `/first/_layout` and `/second/_layout`\n\t\t\t.split(\"/\");\n\t\tlet basePath = \"\";\n\t\tfor (let i = 0; i < parts.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tbasePath += \"/\" + parts[i];\n\t\t\t}\n\t\t\tconst layoutPath = basePath + \"/_layout\";\n\t\t\tconst layoutRoute = this.routes.find((r) => r.path === layoutPath);\n\t\t\tif (layoutRoute) {\n\t\t\t\tlayouts.push({\n\t\t\t\t\tpath: layoutPath,\n\t\t\t\t\tendPoint: layoutRoute.handler.endPoint,\n\t\t\t\t\tserverEndPoint: this.#findServer(layoutPath),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn layouts.length ? layouts : undefined;\n\t}\n\n\t#findServer(path: string): (() => Promise<any>) | undefined {\n\t\tconst serverPath = path.replace(/\\/$/, \"\") + \"/~server\";\n\t\tconst serverRoute = this.routes.find((r) => r.path === serverPath);\n\t\treturn serverRoute && serverRoute.handler.endPoint;\n\t}\n\n\t#findServerHook(path: string): (() => Promise<any>) | undefined {\n\t\t// TODO: Should this be a collection, like layouts?\n\t\tlet serverHookPath = \"/_hook/~server\";\n\t\t// HACK: Generalise this\n\t\tif (path.startsWith(\"/api/\")) {\n\t\t\tserverHookPath = \"/api\" + serverHookPath;\n\t\t}\n\t\tconst serverHookRoute = this.routes.find((r) => r.path === serverHookPath);\n\t\treturn serverHookRoute && serverHookRoute.handler.endPoint;\n\t}\n\n\t// HACK: We're doing this here as well as in Site, so that you can use the\n\t// Router externally without Site\n\t#sortRoutes() {\n\t\tthis.routes = this.routes.sort((a, b) => {\n\t\t\t// Sort [param]s after paths\n\t\t\t// There might be a quicker/easier way to do this\n\t\t\tfor (let i = 0; i < Math.min(a.path.length, b.path.length); i++) {\n\t\t\t\tif (a.path[i] === \"[\" && b.path[i] !== \"[\") {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (b.path[i] === \"[\" && a.path[i] !== \"[\") {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (a.path[i] === b.path[i]) {\n\t\t\t\t\t// Keep going...\n\t\t\t\t} else {\n\t\t\t\t\treturn a.path[i].localeCompare(b.path[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn a.path.length - b.path.length;\n\t\t});\n\t}\n}\n\nclass Route {\n\tpath: string;\n\tregex: RegExp;\n\thandler: RouteHandler;\n\n\tconstructor(path: string, handler: RouteHandler) {\n\t\tthis.path = path;\n\t\tthis.regex = pathToRegex(path);\n\t\tthis.handler = handler;\n\t}\n}\n\ntype Match = {\n\thandler: RouteHandler;\n\tparams?: Record<string, string>;\n\tquery: URLSearchParams;\n};\n","import { promises as fs } from \"node:fs\";\nimport path from \"node:path\";\nimport { type Plugin, type UserConfig } from \"vite\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\nimport type Adapter from \"../types/Adapter\";\nimport {\n\tHOOK_ROUTE,\n\tHOOK_SERVER_ROUTE,\n\tLAYOUT_ROUTE,\n\tLAYOUT_SERVER_ROUTE,\n\tPAGE_ROUTE,\n\tPAGE_SERVER_ROUTE,\n\tSERVER_ROUTE,\n} from \"../types/RouteType\";\nimport defaultAdapter from \"./defaultAdapter\";\n\n// 1. The user sets this up\n// 2. It is passed into serverEntry and clientEntry through a Vite plugin\n// (defined in manifest.ts)\n// 3. In those files, it is used to build a Router\n\n/**\n * The Site class contains the information necessary to setup a @torpor/build\n * site, including routes, plugins, and options.\n */\nexport default class Site {\n\troot: string;\n\troutes: { path: string; file: string; type: number }[] = [];\n\t// Is default plugins a bad idea?\n\t// HACK: Set loose because otherwise it uses a list of allowed extensions\n\t// TODO: Should probably just do this ourselves and let the user pass in\n\t// tsconfigPaths themselves if they want to do something funky\n\tplugins: Plugin[] = [tsconfigPaths({ loose: true })];\n\t// Is default adapter a bad idea?\n\tadapter: Adapter = defaultAdapter;\n\t/**\n\t * Extra inputs, as absolute file paths, that will be compiled with the\n\t * output. What you do with them after that is up to you. File paths ending\n\t * with server.ts/js will only be compiled with the server output\n\t */\n\tinputs: string[] = [];\n\t/**\n\t * Vite config options. `plugins` and `build.rollupOptions.input` will be\n\t * overridden, so you should set `Site.plugins` and `Site.inputs` instead.\n\t */\n\tviteConfig?: UserConfig;\n\n\tconstructor() {\n\t\tthis.root = process.cwd();\n\t}\n\n\tasync addRouteFolder(folder: string): Promise<void> {\n\t\tconst routeFolder = path.join(this.root, folder);\n\t\tconst routeFiles = await fs.readdir(routeFolder, { recursive: true });\n\n\t\tfor (let file of routeFiles) {\n\t\t\t// The file must start with `+` or `_` and end with `.js` or `.ts`\n\t\t\tif (/^(\\+|_).+(\\.js|\\.ts)$/.test(path.basename(file))) {\n\t\t\t\tlet routePath = file\n\t\t\t\t\t.replace(/^\\//, \"\")\n\t\t\t\t\t.replace(/(\\.ts|\\.js)$/, \"\")\n\t\t\t\t\t.replace(/_hook.server$/, \"_hook/~server\")\n\t\t\t\t\t.replace(/_layout.server$/, \"_layout/~server\")\n\t\t\t\t\t.replace(/\\+page.server$/, \"~server\")\n\t\t\t\t\t.replace(/\\+server$/, \"\")\n\t\t\t\t\t.replace(/\\+page$/, \"\")\n\t\t\t\t\t.replace(/\\/$/, \"\");\n\t\t\t\troutePath = routePath.length > 0 ? `/${routePath}` : \"/\";\n\t\t\t\tlet type = this.#routeType(file);\n\t\t\t\tfile = path.relative(this.root, path.resolve(routeFolder, file));\n\t\t\t\tthis.routes.push({ path: routePath, file, type });\n\t\t\t}\n\t\t}\n\t\tthis.#sortRoutes();\n\t}\n\n\taddRouteFile(path: string, file: string): void {\n\t\tlet type = this.#routeType(file);\n\t\tthis.routes.push({ path, file, type });\n\t\tthis.#sortRoutes();\n\t}\n\n\t#routeType(file: string): number {\n\t\tlet routePath = file.replace(/^\\//, \"\").replace(/(\\.ts|\\.js)$/, \"\");\n\t\tif (routePath.endsWith(\"+page\")) {\n\t\t\treturn PAGE_ROUTE;\n\t\t} else if (routePath.endsWith(\"+page.server\")) {\n\t\t\treturn PAGE_SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"+server\")) {\n\t\t\treturn SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"_layout\")) {\n\t\t\treturn LAYOUT_ROUTE;\n\t\t} else if (routePath.endsWith(\"_layout.server\")) {\n\t\t\treturn LAYOUT_SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"_hook\")) {\n\t\t\treturn HOOK_ROUTE;\n\t\t} else if (routePath.endsWith(\"_hook.server\")) {\n\t\t\treturn HOOK_SERVER_ROUTE;\n\t\t}\n\t\treturn -1;\n\t}\n\n\t// TODO: You could make your site in a single file, like e.g. Hono...\n\t//addPage(path: string, endPoint: PageEndPoint, serverEndPoint?: PageServerEndPoint) {}\n\t//addEndPoint(path: string, endPoint: ServerEndPoint) {}\n\n\t#sortRoutes() {\n\t\tthis.routes = this.routes.sort((a, b) => {\n\t\t\t// Sort [param]s after paths\n\t\t\t// There might be a quicker/easier way to do this\n\t\t\tfor (let i = 0; i < Math.min(a.path.length, b.path.length); i++) {\n\t\t\t\tif (a.path[i] === \"[\" && b.path[i] !== \"[\") {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (b.path[i] === \"[\" && a.path[i] !== \"[\") {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (a.path[i] === b.path[i]) {\n\t\t\t\t\t// Keep going...\n\t\t\t\t} else {\n\t\t\t\t\treturn a.path[i].localeCompare(b.path[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn a.path.length - b.path.length;\n\t\t});\n\t}\n}\n","export const PAGE_ROUTE = 0;\nexport const PAGE_SERVER_ROUTE = 1;\nexport const SERVER_ROUTE = 3;\nexport const LAYOUT_ROUTE = 4;\nexport const LAYOUT_SERVER_ROUTE = 5;\nexport const HOOK_ROUTE = 6;\nexport const HOOK_SERVER_ROUTE = 7;\n","import Adapter from \"../types/Adapter\";\n\n// TODO: This should be an adapter-auto package that conditionally loads other packages...\n\nconst defaultAdapter: Adapter = {\n\tserve: () => {\n\t\tconsole.log(\"An adapter needs to be set in site.config\");\n\t},\n};\n\nexport default defaultAdapter;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAe,SAAR,YAA6BA,OAAsB;AACzD,QAAM,UACLA,MACE,MAAM,GAAG,EAET,IAAI,CAAC,MAAM;AACX,WAAO,EAAE,QAAQ,iBAAiB,iBAAiB;AAAA,EACpD,CAAC,EACA,KAAK,KAAK,EAEV,WAAW,KAAK,IAAI;AAAA,EAEtB;AACD,SAAO,IAAI,OAAO,IAAI,OAAO,KAAK;AACnC;;;ACNA,IAAqB,SAArB,MAA4B;AAAA,EAC3B,SAAkB,CAAC;AAAA,EAEnB,cAAc;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAOf,SAAS,QAA+B;AACvC,aAAS,KAAK,QAAQ;AACrB,WAAK,OAAO;AAAA,QACX,IAAI,MAAM,EAAE,MAAM;AAAA,UACjB,MAAM,EAAE;AAAA,UACR,MAAM,EAAE;AAAA,UACR,UAAU,EAAE;AAAA,QACb,CAAC;AAAA,MACF;AAAA,IACD;AACA,SAAK,YAAY;AACjB,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,QAAQC,OAAc,MAAc,UAAoC;AACvE,SAAK,OAAO;AAAA,MACX,IAAI,MAAMA,OAAM;AAAA,QACf,MAAAA;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAC;AAAA,IACF;AACA,SAAK,YAAY;AACjB,WAAO;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AACA,aAAO,EAAE,KAAK,SAAS,EAAE,KAAK;AAAA,IAC/B,CAAC;AAAA,EACF;AACD;","names":["path","path","tsconfigPaths","path","fs"]}
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Adapter, S as Site } from './Site-D_1tsCGs.cjs';
1
+ export { A as Adapter, S as Site } from './Site-Df7Wivbz.cjs';
2
2
  import { Component } from '@torpor/view';
3
3
  import { C as CookieHelper, H as HeaderHelper } from './Server-BC_dixZQ.cjs';
4
4
  import 'vite';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Adapter, S as Site } from './Site-FvLZBOjq.js';
1
+ export { A as Adapter, S as Site } from './Site-Fbf4Xr1r.js';
2
2
  import { Component } from '@torpor/view';
3
3
  import { C as CookieHelper, H as HeaderHelper } from './Server-BC_dixZQ.js';
4
4
  import 'vite';
package/dist/index.js CHANGED
@@ -41,7 +41,8 @@ var Site = class {
41
41
  */
42
42
  inputs = [];
43
43
  /**
44
- * Vite config options. `plugins` and `build` will be overridden.
44
+ * Vite config options. `plugins` and `build.rollupOptions.input` will be
45
+ * overridden, so you should set `Site.plugins` and `Site.inputs` instead.
45
46
  */
46
47
  viteConfig;
47
48
  constructor() {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/site/Site.ts","../src/site/defaultAdapter.ts"],"sourcesContent":["import { promises as fs } from \"node:fs\";\nimport path from \"node:path\";\nimport { type Plugin, type UserConfig } from \"vite\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\nimport type Adapter from \"../types/Adapter\";\nimport {\n\tHOOK_ROUTE,\n\tHOOK_SERVER_ROUTE,\n\tLAYOUT_ROUTE,\n\tLAYOUT_SERVER_ROUTE,\n\tPAGE_ROUTE,\n\tPAGE_SERVER_ROUTE,\n\tSERVER_ROUTE,\n} from \"../types/RouteType\";\nimport defaultAdapter from \"./defaultAdapter\";\n\n// 1. The user sets this up\n// 2. It is passed into serverEntry and clientEntry through a Vite plugin\n// (defined in manifest.ts)\n// 3. In those files, it is used to build a Router\n\n/**\n * The Site class contains the information necessary to setup a @torpor/build\n * site, including routes, plugins, and options.\n */\nexport default class Site {\n\troot: string;\n\troutes: { path: string; file: string; type: number }[] = [];\n\t// Is default plugins a bad idea?\n\t// HACK: Set loose because otherwise it uses a list of allowed extensions\n\t// TODO: Should probably just do this ourselves and let the user pass in\n\t// tsconfigPaths themselves if they want to do something funky\n\tplugins: Plugin[] = [tsconfigPaths({ loose: true })];\n\t// Is default adapter a bad idea?\n\tadapter: Adapter = defaultAdapter;\n\t/**\n\t * Extra inputs, as absolute file paths, that will be compiled with the\n\t * output. What you do with them after that is up to you. File paths ending\n\t * with server.ts/js will only be compiled with the server output\n\t */\n\tinputs: string[] = [];\n\t/**\n\t * Vite config options. `plugins` and `build` will be overridden.\n\t */\n\tviteConfig?: UserConfig;\n\n\tconstructor() {\n\t\tthis.root = process.cwd();\n\t}\n\n\tasync addRouteFolder(folder: string): Promise<void> {\n\t\tconst routeFolder = path.join(this.root, folder);\n\t\tconst routeFiles = await fs.readdir(routeFolder, { recursive: true });\n\n\t\tfor (let file of routeFiles) {\n\t\t\t// The file must start with `+` or `_` and end with `.js` or `.ts`\n\t\t\tif (/^(\\+|_).+(\\.js|\\.ts)$/.test(path.basename(file))) {\n\t\t\t\tlet routePath = file\n\t\t\t\t\t.replace(/^\\//, \"\")\n\t\t\t\t\t.replace(/(\\.ts|\\.js)$/, \"\")\n\t\t\t\t\t.replace(/_hook.server$/, \"_hook/~server\")\n\t\t\t\t\t.replace(/_layout.server$/, \"_layout/~server\")\n\t\t\t\t\t.replace(/\\+page.server$/, \"~server\")\n\t\t\t\t\t.replace(/\\+server$/, \"\")\n\t\t\t\t\t.replace(/\\+page$/, \"\")\n\t\t\t\t\t.replace(/\\/$/, \"\");\n\t\t\t\troutePath = routePath.length > 0 ? `/${routePath}` : \"/\";\n\t\t\t\tlet type = this.#routeType(file);\n\t\t\t\tfile = path.relative(this.root, path.resolve(routeFolder, file));\n\t\t\t\tthis.routes.push({ path: routePath, file, type });\n\t\t\t}\n\t\t}\n\t\tthis.#sortRoutes();\n\t}\n\n\taddRouteFile(path: string, file: string): void {\n\t\tlet type = this.#routeType(file);\n\t\tthis.routes.push({ path, file, type });\n\t\tthis.#sortRoutes();\n\t}\n\n\t#routeType(file: string): number {\n\t\tlet routePath = file.replace(/^\\//, \"\").replace(/(\\.ts|\\.js)$/, \"\");\n\t\tif (routePath.endsWith(\"+page\")) {\n\t\t\treturn PAGE_ROUTE;\n\t\t} else if (routePath.endsWith(\"+page.server\")) {\n\t\t\treturn PAGE_SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"+server\")) {\n\t\t\treturn SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"_layout\")) {\n\t\t\treturn LAYOUT_ROUTE;\n\t\t} else if (routePath.endsWith(\"_layout.server\")) {\n\t\t\treturn LAYOUT_SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"_hook\")) {\n\t\t\treturn HOOK_ROUTE;\n\t\t} else if (routePath.endsWith(\"_hook.server\")) {\n\t\t\treturn HOOK_SERVER_ROUTE;\n\t\t}\n\t\treturn -1;\n\t}\n\n\t// TODO: You could make your site in a single file, like e.g. Hono...\n\t//addPage(path: string, endPoint: PageEndPoint, serverEndPoint?: PageServerEndPoint) {}\n\t//addEndPoint(path: string, endPoint: ServerEndPoint) {}\n\n\t#sortRoutes() {\n\t\tthis.routes = this.routes.sort((a, b) => {\n\t\t\t// Sort [param]s after paths\n\t\t\t// There might be a quicker/easier way to do this\n\t\t\tfor (let i = 0; i < Math.min(a.path.length, b.path.length); i++) {\n\t\t\t\tif (a.path[i] === \"[\" && b.path[i] !== \"[\") {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (b.path[i] === \"[\" && a.path[i] !== \"[\") {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (a.path[i] === b.path[i]) {\n\t\t\t\t\t// Keep going...\n\t\t\t\t} else {\n\t\t\t\t\treturn a.path[i].localeCompare(b.path[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn a.path.length - b.path.length;\n\t\t});\n\t}\n}\n","import Adapter from \"../types/Adapter\";\n\n// TODO: This should be an adapter-auto package that conditionally loads other packages...\n\nconst defaultAdapter: Adapter = {\n\tserve: () => {\n\t\tconsole.log(\"An adapter needs to be set in site.config\");\n\t},\n};\n\nexport default defaultAdapter;\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,YAAY,UAAU;AAC/B,OAAO,UAAU;AAEjB,OAAO,mBAAmB;;;ACC1B,IAAM,iBAA0B;AAAA,EAC/B,OAAO,MAAM;AACZ,YAAQ,IAAI,2CAA2C;AAAA,EACxD;AACD;AAEA,IAAO,yBAAQ;;;ADef,IAAqB,OAArB,MAA0B;AAAA,EACzB;AAAA,EACA,SAAyD,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAK1D,UAAoB,CAAC,cAAc,EAAE,OAAO,KAAK,CAAC,CAAC;AAAA;AAAA,EAEnD,UAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMnB,SAAmB,CAAC;AAAA;AAAA;AAAA;AAAA,EAIpB;AAAA,EAEA,cAAc;AACb,SAAK,OAAO,QAAQ,IAAI;AAAA,EACzB;AAAA,EAEA,MAAM,eAAe,QAA+B;AACnD,UAAM,cAAc,KAAK,KAAK,KAAK,MAAM,MAAM;AAC/C,UAAM,aAAa,MAAM,GAAG,QAAQ,aAAa,EAAE,WAAW,KAAK,CAAC;AAEpE,aAAS,QAAQ,YAAY;AAE5B,UAAI,wBAAwB,KAAK,KAAK,SAAS,IAAI,CAAC,GAAG;AACtD,YAAI,YAAY,KACd,QAAQ,OAAO,EAAE,EACjB,QAAQ,gBAAgB,EAAE,EAC1B,QAAQ,iBAAiB,eAAe,EACxC,QAAQ,mBAAmB,iBAAiB,EAC5C,QAAQ,kBAAkB,SAAS,EACnC,QAAQ,aAAa,EAAE,EACvB,QAAQ,WAAW,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A,QACR,WAAW,EAAE,KAAK,CAAC,MAAM,OAAO,EAAE,KAAK,CAAC,MAAM,KAAK;AAClD,iBAAO;AAAA,QACR,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG;AAAA,QAEpC,OAAO;AACN,iBAAO,EAAE,KAAK,CAAC,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;AAAA,QACzC;AAAA,MACD;AACA,aAAO,EAAE,KAAK,SAAS,EAAE,KAAK;AAAA,IAC/B,CAAC;AAAA,EACF;AACD;","names":["path"]}
1
+ {"version":3,"sources":["../src/site/Site.ts","../src/site/defaultAdapter.ts"],"sourcesContent":["import { promises as fs } from \"node:fs\";\nimport path from \"node:path\";\nimport { type Plugin, type UserConfig } from \"vite\";\nimport tsconfigPaths from \"vite-tsconfig-paths\";\nimport type Adapter from \"../types/Adapter\";\nimport {\n\tHOOK_ROUTE,\n\tHOOK_SERVER_ROUTE,\n\tLAYOUT_ROUTE,\n\tLAYOUT_SERVER_ROUTE,\n\tPAGE_ROUTE,\n\tPAGE_SERVER_ROUTE,\n\tSERVER_ROUTE,\n} from \"../types/RouteType\";\nimport defaultAdapter from \"./defaultAdapter\";\n\n// 1. The user sets this up\n// 2. It is passed into serverEntry and clientEntry through a Vite plugin\n// (defined in manifest.ts)\n// 3. In those files, it is used to build a Router\n\n/**\n * The Site class contains the information necessary to setup a @torpor/build\n * site, including routes, plugins, and options.\n */\nexport default class Site {\n\troot: string;\n\troutes: { path: string; file: string; type: number }[] = [];\n\t// Is default plugins a bad idea?\n\t// HACK: Set loose because otherwise it uses a list of allowed extensions\n\t// TODO: Should probably just do this ourselves and let the user pass in\n\t// tsconfigPaths themselves if they want to do something funky\n\tplugins: Plugin[] = [tsconfigPaths({ loose: true })];\n\t// Is default adapter a bad idea?\n\tadapter: Adapter = defaultAdapter;\n\t/**\n\t * Extra inputs, as absolute file paths, that will be compiled with the\n\t * output. What you do with them after that is up to you. File paths ending\n\t * with server.ts/js will only be compiled with the server output\n\t */\n\tinputs: string[] = [];\n\t/**\n\t * Vite config options. `plugins` and `build.rollupOptions.input` will be\n\t * overridden, so you should set `Site.plugins` and `Site.inputs` instead.\n\t */\n\tviteConfig?: UserConfig;\n\n\tconstructor() {\n\t\tthis.root = process.cwd();\n\t}\n\n\tasync addRouteFolder(folder: string): Promise<void> {\n\t\tconst routeFolder = path.join(this.root, folder);\n\t\tconst routeFiles = await fs.readdir(routeFolder, { recursive: true });\n\n\t\tfor (let file of routeFiles) {\n\t\t\t// The file must start with `+` or `_` and end with `.js` or `.ts`\n\t\t\tif (/^(\\+|_).+(\\.js|\\.ts)$/.test(path.basename(file))) {\n\t\t\t\tlet routePath = file\n\t\t\t\t\t.replace(/^\\//, \"\")\n\t\t\t\t\t.replace(/(\\.ts|\\.js)$/, \"\")\n\t\t\t\t\t.replace(/_hook.server$/, \"_hook/~server\")\n\t\t\t\t\t.replace(/_layout.server$/, \"_layout/~server\")\n\t\t\t\t\t.replace(/\\+page.server$/, \"~server\")\n\t\t\t\t\t.replace(/\\+server$/, \"\")\n\t\t\t\t\t.replace(/\\+page$/, \"\")\n\t\t\t\t\t.replace(/\\/$/, \"\");\n\t\t\t\troutePath = routePath.length > 0 ? `/${routePath}` : \"/\";\n\t\t\t\tlet type = this.#routeType(file);\n\t\t\t\tfile = path.relative(this.root, path.resolve(routeFolder, file));\n\t\t\t\tthis.routes.push({ path: routePath, file, type });\n\t\t\t}\n\t\t}\n\t\tthis.#sortRoutes();\n\t}\n\n\taddRouteFile(path: string, file: string): void {\n\t\tlet type = this.#routeType(file);\n\t\tthis.routes.push({ path, file, type });\n\t\tthis.#sortRoutes();\n\t}\n\n\t#routeType(file: string): number {\n\t\tlet routePath = file.replace(/^\\//, \"\").replace(/(\\.ts|\\.js)$/, \"\");\n\t\tif (routePath.endsWith(\"+page\")) {\n\t\t\treturn PAGE_ROUTE;\n\t\t} else if (routePath.endsWith(\"+page.server\")) {\n\t\t\treturn PAGE_SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"+server\")) {\n\t\t\treturn SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"_layout\")) {\n\t\t\treturn LAYOUT_ROUTE;\n\t\t} else if (routePath.endsWith(\"_layout.server\")) {\n\t\t\treturn LAYOUT_SERVER_ROUTE;\n\t\t} else if (routePath.endsWith(\"_hook\")) {\n\t\t\treturn HOOK_ROUTE;\n\t\t} else if (routePath.endsWith(\"_hook.server\")) {\n\t\t\treturn HOOK_SERVER_ROUTE;\n\t\t}\n\t\treturn -1;\n\t}\n\n\t// TODO: You could make your site in a single file, like e.g. Hono...\n\t//addPage(path: string, endPoint: PageEndPoint, serverEndPoint?: PageServerEndPoint) {}\n\t//addEndPoint(path: string, endPoint: ServerEndPoint) {}\n\n\t#sortRoutes() {\n\t\tthis.routes = this.routes.sort((a, b) => {\n\t\t\t// Sort [param]s after paths\n\t\t\t// There might be a quicker/easier way to do this\n\t\t\tfor (let i = 0; i < Math.min(a.path.length, b.path.length); i++) {\n\t\t\t\tif (a.path[i] === \"[\" && b.path[i] !== \"[\") {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (b.path[i] === \"[\" && a.path[i] !== \"[\") {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else if (a.path[i] === b.path[i]) {\n\t\t\t\t\t// Keep going...\n\t\t\t\t} else {\n\t\t\t\t\treturn a.path[i].localeCompare(b.path[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn a.path.length - b.path.length;\n\t\t});\n\t}\n}\n","import Adapter from \"../types/Adapter\";\n\n// TODO: This should be an adapter-auto package that conditionally loads other packages...\n\nconst defaultAdapter: Adapter = {\n\tserve: () => {\n\t\tconsole.log(\"An adapter needs to be set in site.config\");\n\t},\n};\n\nexport default defaultAdapter;\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,YAAY,UAAU;AAC/B,OAAO,UAAU;AAEjB,OAAO,mBAAmB;;;ACC1B,IAAM,iBAA0B;AAAA,EAC/B,OAAO,MAA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,"imports":[],"format":"esm"},"src/site/Router.ts":{"bytes":4384,"imports":[{"path":"src/site/pathToRegex.ts","kind":"import-statement","original":"./pathToRegex"}],"format":"esm"},"src/types/RouteType.ts":{"bytes":230,"imports":[],"format":"esm"},"src/site/defaultAdapter.ts":{"bytes":282,"imports":[{"path":"../types/Adapter","kind":"import-statement","external":true}],"format":"esm"},"src/site/Site.ts":{"bytes":4097,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"vite-tsconfig-paths","kind":"import-statement","external":true},{"path":"src/types/RouteType.ts","kind":"import-statement","original":"../types/RouteType"},{"path":"src/site/defaultAdapter.ts","kind":"import-statement","original":"./defaultAdapter"}],"format":"esm"},"src/index.ts":{"bytes":838,"imports":[{"path":"src/site/Router.ts","kind":"import-statement","original":"./site/Router"},{"path":"src/site/Site.ts","kind":"import-statement","original":"./site/Site"}],"format":"esm"},"src/response/response.ts":{"bytes":691,"imports":[],"format":"esm"},"src/response/badRequest.ts":{"bytes":451,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/created.ts":{"bytes":384,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/forbidden.ts":{"bytes":458,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/methodNotAllowed.ts":{"bytes":419,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/transfer.ts":{"bytes":264,"imports":[],"format":"esm"},"src/response/moved.ts":{"bytes":613,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/notFound.ts":{"bytes":671,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/notModified.ts":{"bytes":419,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/ok.ts":{"bytes":684,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/redirect.ts":{"bytes":640,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/seeOther.ts":{"bytes":355,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/serverError.ts":{"bytes":315,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unauthorized.ts":{"bytes":432,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unprocessable.ts":{"bytes":337,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response.ts":{"bytes":886,"imports":[{"path":"src/response/badRequest.ts","kind":"import-statement","original":"./response/badRequest"},{"path":"src/response/created.ts","kind":"import-statement","original":"./response/created"},{"path":"src/response/forbidden.ts","kind":"import-statement","original":"./response/forbidden"},{"path":"src/response/methodNotAllowed.ts","kind":"import-statement","original":"./response/methodNotAllowed"},{"path":"src/response/moved.ts","kind":"import-statement","original":"./response/moved"},{"path":"src/response/notFound.ts","kind":"import-statement","original":"./response/notFound"},{"path":"src/response/notModified.ts","kind":"import-statement","original":"./response/notModified"},{"path":"src/response/ok.ts","kind":"import-statement","original":"./response/ok"},{"path":"src/response/redirect.ts","kind":"import-statement","original":"./response/redirect"},{"path":"src/response/response.ts","kind":"import-statement","original":"./response/response"},{"path":"src/response/seeOther.ts","kind":"import-statement","original":"./response/seeOther"},{"path":"src/response/serverError.ts","kind":"import-statement","original":"./response/serverError"},{"path":"src/response/transfer.ts","kind":"import-statement","original":"./response/transfer"},{"path":"src/response/unauthorized.ts","kind":"import-statement","original":"./response/unauthorized"},{"path":"src/response/unprocessable.ts","kind":"import-statement","original":"./response/unprocessable"}],"format":"esm"},"src/site/manifest.ts":{"bytes":1553,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site","kind":"import-statement","external":true}],"format":"esm"},"src/site/runBuild.ts":{"bytes":2714,"imports":[{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site.ts","kind":"import-statement","external":true},{"path":"src/site/manifest.ts","kind":"import-statement","original":"./manifest.ts"}],"format":"esm"},"src/server/CookieHelper.ts":{"bytes":1078,"imports":[{"path":"cookie","kind":"import-statement","external":true}],"format":"esm"},"src/server/HeaderHelper.ts":{"bytes":571,"imports":[],"format":"esm"},"src/server/ServerEvent.ts":{"bytes":956,"imports":[{"path":"src/server/CookieHelper.ts","kind":"import-statement","original":"./CookieHelper"},{"path":"src/server/HeaderHelper.ts","kind":"import-statement","original":"./HeaderHelper"}],"format":"esm"},"src/server/Server.ts":{"bytes":3639,"imports":[{"path":"src/site/pathToRegex.ts","kind":"import-statement","original":"../site/pathToRegex"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"./ServerEvent"}],"format":"esm"},"src/server/connect/flattenHeaders.ts":{"bytes":1017,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"node:http2","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytes":2363,"imports":[{"path":"http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/readableToBuffer.ts":{"bytes":388,"imports":[{"path":"node:stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/requestToNodeMessage.ts":{"bytes":1109,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/connectMiddleware.ts":{"bytes":2655,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"src/server/connect/flattenHeaders.ts","kind":"import-statement","original":"./flattenHeaders"},{"path":"src/server/connect/nodeMessageToNodeResponse.ts","kind":"import-statement","original":"./nodeMessageToNodeResponse"},{"path":"src/server/connect/readableToBuffer.ts","kind":"import-statement","original":"./readableToBuffer"},{"path":"src/server/connect/requestToNodeMessage.ts","kind":"import-statement","original":"./requestToNodeMessage"}],"format":"esm"},"src/site/prepareTemplate.ts":{"bytes":809,"imports":[],"format":"esm"},"src/site/runDev.ts":{"bytes":3047,"imports":[{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"src/response.ts","kind":"import-statement","original":"../response.ts"},{"path":"src/server/Server.ts","kind":"import-statement","original":"../server/Server.ts"},{"path":"src/server/connect/connectMiddleware.ts","kind":"import-statement","original":"../server/connect/connectMiddleware.ts"},{"path":"./Site.ts","kind":"import-statement","external":true},{"path":"src/site/manifest.ts","kind":"import-statement","original":"./manifest.ts"},{"path":"src/site/prepareTemplate.ts","kind":"import-statement","original":"./prepareTemplate.ts"}],"format":"esm"},"src/server/contentType.ts":{"bytes":2679,"imports":[],"format":"esm"},"src/site/runPreview.ts":{"bytes":2543,"imports":[{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"src/response.ts","kind":"import-statement","original":"../response.ts"},{"path":"src/server/Server.ts","kind":"import-statement","original":"../server/Server.ts"},{"path":"src/server/contentType.ts","kind":"import-statement","original":"../server/contentType.ts"},{"path":"./Site","kind":"import-statement","external":true},{"path":"src/site/prepareTemplate.ts","kind":"import-statement","original":"./prepareTemplate.ts"},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./runBuild"}],"format":"esm"},"src/site/run.ts":{"bytes":1695,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site","kind":"import-statement","external":true},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./runBuild"},{"path":"src/site/runDev.ts","kind":"import-statement","original":"./runDev"},{"path":"src/site/runPreview.ts","kind":"import-statement","original":"./runPreview"}],"format":"esm"},"src/run.ts":{"bytes":197,"imports":[{"path":"src/site/run.ts","kind":"import-statement","original":"./site/run"},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./site/runBuild"},{"path":"src/site/runDev.ts","kind":"import-statement","original":"./site/runDev"},{"path":"src/site/runPreview.ts","kind":"import-statement","original":"./site/runPreview"}],"format":"esm"},"src/server.ts":{"bytes":334,"imports":[{"path":"src/server/CookieHelper.ts","kind":"import-statement","original":"./server/CookieHelper"},{"path":"src/server/HeaderHelper.ts","kind":"import-statement","original":"./server/HeaderHelper"},{"path":"src/server/Server.ts","kind":"import-statement","original":"./server/Server"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"./server/ServerEvent"},{"path":"src/server/connect/connectMiddleware.ts","kind":"import-statement","original":"./server/connect/connectMiddleware"}],"format":"esm"},"src/state/$page.ts":{"bytes":218,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true}],"format":"esm"},"src/state.ts":{"bytes":54,"imports":[{"path":"src/state/$page.ts","kind":"import-statement","original":"./state/$page"}],"format":"esm"},"src/test/runTest.ts":{"bytes":9437,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"src/response/notFound.ts","kind":"import-statement","original":"../response/notFound.ts"},{"path":"src/response/ok.ts","kind":"import-statement","original":"../response/ok.ts"},{"path":"src/response/seeOther.ts","kind":"import-statement","original":"../response/seeOther.ts"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"../server/ServerEvent.ts"},{"path":"src/site/Router.ts","kind":"import-statement","original":"../site/Router.ts"},{"path":"../site/Site","kind":"import-statement","external":true},{"path":"src/state/$page.ts","kind":"import-statement","original":"../state/$page.ts"},{"path":"../types/RouteHandler.ts","kind":"import-statement","external":true},{"path":"src/types/RouteType.ts","kind":"import-statement","original":"../types/RouteType"}],"format":"esm"},"src/test.ts":{"bytes":59,"imports":[{"path":"src/test/runTest.ts","kind":"import-statement","original":"./test/runTest"}],"format":"esm"},"src/bin/index.ts":{"bytes":351,"imports":[{"path":"src/site/run.ts","kind":"import-statement","original":"../site/run"}],"format":"esm"}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16736},"dist/index.cjs":{"imports":[{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite-tsconfig-paths","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":143},"src/site/pathToRegex.ts":{"bytesInOutput":303},"src/site/Router.ts":{"bytesInOutput":3423},"src/site/Site.ts":{"bytesInOutput":3428},"src/types/RouteType.ts":{"bytesInOutput":167},"src/site/defaultAdapter.ts":{"bytesInOutput":154}},"bytes":9290},"dist/response.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10313},"dist/response.cjs":{"imports":[],"exports":[],"entryPoint":"src/response.ts","inputs":{"src/response.ts":{"bytesInOutput":560},"src/response/response.ts":{"bytesInOutput":334},"src/response/badRequest.ts":{"bytesInOutput":60},"src/response/created.ts":{"bytesInOutput":57},"src/response/forbidden.ts":{"bytesInOutput":59},"src/response/methodNotAllowed.ts":{"bytesInOutput":66},"src/response/transfer.ts":{"bytesInOutput":124},"src/response/moved.ts":{"bytesInOutput":63},"src/response/notFound.ts":{"bytesInOutput":58},"src/response/notModified.ts":{"bytesInOutput":69},"src/response/ok.ts":{"bytesInOutput":52},"src/response/redirect.ts":{"bytesInOutput":66},"src/response/seeOther.ts":{"bytesInOutput":66},"src/response/serverError.ts":{"bytesInOutput":61},"src/response/unauthorized.ts":{"bytesInOutput":62},"src/response/unprocessable.ts":{"bytesInOutput":63}},"bytes":3376},"dist/run.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":49401},"dist/run.cjs":{"imports":[{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"@torpor/unplugin/vite","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"@torpor/unplugin/vite","kind":"require-call","external":true},{"path":"dotenv","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"cookie","kind":"require-call","external":true},{"path":"http","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true},{"path":"dotenv","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/run.ts","inputs":{"src/run.ts":{"bytesInOutput":195},"src/site/run.ts":{"bytesInOutput":1556},"src/site/runBuild.ts":{"bytesInOutput":2454},"src/site/manifest.ts":{"bytesInOutput":1256},"src/site/runDev.ts":{"bytesInOutput":1514},"src/response/response.ts":{"bytesInOutput":334},"src/response/serverError.ts":{"bytesInOutput":61},"src/site/pathToRegex.ts":{"bytesInOutput":303},"src/server/CookieHelper.ts":{"bytesInOutput":819},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/server/ServerEvent.ts":{"bytesInOutput":696},"src/server/Server.ts":{"bytesInOutput":2764},"src/server/connect/flattenHeaders.ts":{"bytesInOutput":472},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytesInOutput":1430},"src/server/connect/readableToBuffer.ts":{"bytesInOutput":304},"src/server/connect/requestToNodeMessage.ts":{"bytesInOutput":529},"src/server/connect/connectMiddleware.ts":{"bytesInOutput":1381},"src/site/prepareTemplate.ts":{"bytesInOutput":698},"src/site/runPreview.ts":{"bytesInOutput":1939},"src/server/contentType.ts":{"bytesInOutput":2608}},"bytes":23964},"dist/server.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23404},"dist/server.cjs":{"imports":[{"path":"cookie","kind":"require-call","external":true},{"path":"http","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/server.ts","inputs":{"src/server.ts":{"bytesInOutput":278},"src/server/CookieHelper.ts":{"bytesInOutput":819},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/site/pathToRegex.ts":{"bytesInOutput":301},"src/server/ServerEvent.ts":{"bytesInOutput":696},"src/server/Server.ts":{"bytesInOutput":2756},"src/server/connect/flattenHeaders.ts":{"bytesInOutput":472},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytesInOutput":1430},"src/server/connect/readableToBuffer.ts":{"bytesInOutput":304},"src/server/connect/requestToNodeMessage.ts":{"bytesInOutput":529},"src/server/connect/connectMiddleware.ts":{"bytesInOutput":1381}},"bytes":10720},"dist/state.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":637},"dist/state.cjs":{"imports":[{"path":"@torpor/view","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/state.ts","inputs":{"src/state.ts":{"bytesInOutput":128},"src/state/$page.ts":{"bytesInOutput":192}},"bytes":1258},"dist/test.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32064},"dist/test.cjs":{"imports":[{"path":"path","kind":"require-call","external":true},{"path":"cookie","kind":"require-call","external":true},{"path":"@torpor/view","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/test.ts","inputs":{"src/test.ts":{"bytesInOutput":122},"src/test/runTest.ts":{"bytesInOutput":6091},"src/response/response.ts":{"bytesInOutput":334},"src/response/notFound.ts":{"bytesInOutput":58},"src/response/ok.ts":{"bytesInOutput":52},"src/response/transfer.ts":{"bytesInOutput":124},"src/response/seeOther.ts":{"bytesInOutput":66},"src/server/CookieHelper.ts":{"bytesInOutput":819},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/server/ServerEvent.ts":{"bytesInOutput":696},"src/site/pathToRegex.ts":{"bytesInOutput":303},"src/site/Router.ts":{"bytesInOutput":3423},"src/state/$page.ts":{"bytesInOutput":192},"src/types/RouteType.ts":{"bytesInOutput":167}},"bytes":14737},"dist/bin/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":49855},"dist/bin/index.cjs":{"imports":[{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"@torpor/unplugin/vite","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"@torpor/unplugin/vite","kind":"require-call","external":true},{"path":"dotenv","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"cookie","kind":"require-call","external":true},{"path":"http","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true},{"path":"dotenv","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/bin/index.ts","inputs":{"src/site/run.ts":{"bytesInOutput":1556},"src/site/runBuild.ts":{"bytesInOutput":2454},"src/site/manifest.ts":{"bytesInOutput":1256},"src/site/runDev.ts":{"bytesInOutput":1514},"src/response/response.ts":{"bytesInOutput":334},"src/response/serverError.ts":{"bytesInOutput":61},"src/site/pathToRegex.ts":{"bytesInOutput":303},"src/server/CookieHelper.ts":{"bytesInOutput":819},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/server/ServerEvent.ts":{"bytesInOutput":696},"src/server/Server.ts":{"bytesInOutput":2764},"src/server/connect/flattenHeaders.ts":{"bytesInOutput":472},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytesInOutput":1430},"src/server/connect/readableToBuffer.ts":{"bytesInOutput":304},"src/server/connect/requestToNodeMessage.ts":{"bytesInOutput":529},"src/server/connect/connectMiddleware.ts":{"bytesInOutput":1381},"src/site/prepareTemplate.ts":{"bytesInOutput":698},"src/site/runPreview.ts":{"bytesInOutput":1939},"src/server/contentType.ts":{"bytesInOutput":2608},"src/bin/index.ts":{"bytesInOutput":309}},"bytes":23752}}}
1
+ {"inputs":{"src/site/pathToRegex.ts":{"bytes":459,"imports":[],"format":"esm"},"src/site/Router.ts":{"bytes":4384,"imports":[{"path":"src/site/pathToRegex.ts","kind":"import-statement","original":"./pathToRegex"}],"format":"esm"},"src/types/RouteType.ts":{"bytes":230,"imports":[],"format":"esm"},"src/site/defaultAdapter.ts":{"bytes":282,"imports":[{"path":"../types/Adapter","kind":"import-statement","external":true}],"format":"esm"},"src/site/Site.ts":{"bytes":4181,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"vite-tsconfig-paths","kind":"import-statement","external":true},{"path":"src/types/RouteType.ts","kind":"import-statement","original":"../types/RouteType"},{"path":"src/site/defaultAdapter.ts","kind":"import-statement","original":"./defaultAdapter"}],"format":"esm"},"src/index.ts":{"bytes":838,"imports":[{"path":"src/site/Router.ts","kind":"import-statement","original":"./site/Router"},{"path":"src/site/Site.ts","kind":"import-statement","original":"./site/Site"}],"format":"esm"},"src/response/response.ts":{"bytes":691,"imports":[],"format":"esm"},"src/response/badRequest.ts":{"bytes":451,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/created.ts":{"bytes":384,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/forbidden.ts":{"bytes":458,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/methodNotAllowed.ts":{"bytes":419,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/transfer.ts":{"bytes":264,"imports":[],"format":"esm"},"src/response/moved.ts":{"bytes":613,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/notFound.ts":{"bytes":671,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/notModified.ts":{"bytes":419,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/ok.ts":{"bytes":684,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/redirect.ts":{"bytes":640,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/seeOther.ts":{"bytes":355,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/serverError.ts":{"bytes":315,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unauthorized.ts":{"bytes":432,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unprocessable.ts":{"bytes":337,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response.ts":{"bytes":886,"imports":[{"path":"src/response/badRequest.ts","kind":"import-statement","original":"./response/badRequest"},{"path":"src/response/created.ts","kind":"import-statement","original":"./response/created"},{"path":"src/response/forbidden.ts","kind":"import-statement","original":"./response/forbidden"},{"path":"src/response/methodNotAllowed.ts","kind":"import-statement","original":"./response/methodNotAllowed"},{"path":"src/response/moved.ts","kind":"import-statement","original":"./response/moved"},{"path":"src/response/notFound.ts","kind":"import-statement","original":"./response/notFound"},{"path":"src/response/notModified.ts","kind":"import-statement","original":"./response/notModified"},{"path":"src/response/ok.ts","kind":"import-statement","original":"./response/ok"},{"path":"src/response/redirect.ts","kind":"import-statement","original":"./response/redirect"},{"path":"src/response/response.ts","kind":"import-statement","original":"./response/response"},{"path":"src/response/seeOther.ts","kind":"import-statement","original":"./response/seeOther"},{"path":"src/response/serverError.ts","kind":"import-statement","original":"./response/serverError"},{"path":"src/response/transfer.ts","kind":"import-statement","original":"./response/transfer"},{"path":"src/response/unauthorized.ts","kind":"import-statement","original":"./response/unauthorized"},{"path":"src/response/unprocessable.ts","kind":"import-statement","original":"./response/unprocessable"}],"format":"esm"},"src/site/manifest.ts":{"bytes":1553,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site","kind":"import-statement","external":true}],"format":"esm"},"src/site/runBuild.ts":{"bytes":2986,"imports":[{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site.ts","kind":"import-statement","external":true},{"path":"src/site/manifest.ts","kind":"import-statement","original":"./manifest.ts"}],"format":"esm"},"src/server/CookieHelper.ts":{"bytes":1078,"imports":[{"path":"cookie","kind":"import-statement","external":true}],"format":"esm"},"src/server/HeaderHelper.ts":{"bytes":571,"imports":[],"format":"esm"},"src/server/ServerEvent.ts":{"bytes":956,"imports":[{"path":"src/server/CookieHelper.ts","kind":"import-statement","original":"./CookieHelper"},{"path":"src/server/HeaderHelper.ts","kind":"import-statement","original":"./HeaderHelper"}],"format":"esm"},"src/server/Server.ts":{"bytes":3639,"imports":[{"path":"src/site/pathToRegex.ts","kind":"import-statement","original":"../site/pathToRegex"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"./ServerEvent"}],"format":"esm"},"src/server/connect/flattenHeaders.ts":{"bytes":1017,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"node:http2","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytes":2363,"imports":[{"path":"http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/readableToBuffer.ts":{"bytes":388,"imports":[{"path":"node:stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/requestToNodeMessage.ts":{"bytes":1109,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/connectMiddleware.ts":{"bytes":2655,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"src/server/connect/flattenHeaders.ts","kind":"import-statement","original":"./flattenHeaders"},{"path":"src/server/connect/nodeMessageToNodeResponse.ts","kind":"import-statement","original":"./nodeMessageToNodeResponse"},{"path":"src/server/connect/readableToBuffer.ts","kind":"import-statement","original":"./readableToBuffer"},{"path":"src/server/connect/requestToNodeMessage.ts","kind":"import-statement","original":"./requestToNodeMessage"}],"format":"esm"},"src/site/prepareTemplate.ts":{"bytes":809,"imports":[],"format":"esm"},"src/site/runDev.ts":{"bytes":3047,"imports":[{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"src/response.ts","kind":"import-statement","original":"../response.ts"},{"path":"src/server/Server.ts","kind":"import-statement","original":"../server/Server.ts"},{"path":"src/server/connect/connectMiddleware.ts","kind":"import-statement","original":"../server/connect/connectMiddleware.ts"},{"path":"./Site.ts","kind":"import-statement","external":true},{"path":"src/site/manifest.ts","kind":"import-statement","original":"./manifest.ts"},{"path":"src/site/prepareTemplate.ts","kind":"import-statement","original":"./prepareTemplate.ts"}],"format":"esm"},"src/server/contentType.ts":{"bytes":2679,"imports":[],"format":"esm"},"src/site/runPreview.ts":{"bytes":2543,"imports":[{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"src/response.ts","kind":"import-statement","original":"../response.ts"},{"path":"src/server/Server.ts","kind":"import-statement","original":"../server/Server.ts"},{"path":"src/server/contentType.ts","kind":"import-statement","original":"../server/contentType.ts"},{"path":"./Site","kind":"import-statement","external":true},{"path":"src/site/prepareTemplate.ts","kind":"import-statement","original":"./prepareTemplate.ts"},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./runBuild"}],"format":"esm"},"src/site/run.ts":{"bytes":1695,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site","kind":"import-statement","external":true},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./runBuild"},{"path":"src/site/runDev.ts","kind":"import-statement","original":"./runDev"},{"path":"src/site/runPreview.ts","kind":"import-statement","original":"./runPreview"}],"format":"esm"},"src/run.ts":{"bytes":197,"imports":[{"path":"src/site/run.ts","kind":"import-statement","original":"./site/run"},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./site/runBuild"},{"path":"src/site/runDev.ts","kind":"import-statement","original":"./site/runDev"},{"path":"src/site/runPreview.ts","kind":"import-statement","original":"./site/runPreview"}],"format":"esm"},"src/server.ts":{"bytes":334,"imports":[{"path":"src/server/CookieHelper.ts","kind":"import-statement","original":"./server/CookieHelper"},{"path":"src/server/HeaderHelper.ts","kind":"import-statement","original":"./server/HeaderHelper"},{"path":"src/server/Server.ts","kind":"import-statement","original":"./server/Server"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"./server/ServerEvent"},{"path":"src/server/connect/connectMiddleware.ts","kind":"import-statement","original":"./server/connect/connectMiddleware"}],"format":"esm"},"src/state/$page.ts":{"bytes":218,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true}],"format":"esm"},"src/state.ts":{"bytes":54,"imports":[{"path":"src/state/$page.ts","kind":"import-statement","original":"./state/$page"}],"format":"esm"},"src/test/runTest.ts":{"bytes":9437,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"src/response/notFound.ts","kind":"import-statement","original":"../response/notFound.ts"},{"path":"src/response/ok.ts","kind":"import-statement","original":"../response/ok.ts"},{"path":"src/response/seeOther.ts","kind":"import-statement","original":"../response/seeOther.ts"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"../server/ServerEvent.ts"},{"path":"src/site/Router.ts","kind":"import-statement","original":"../site/Router.ts"},{"path":"../site/Site","kind":"import-statement","external":true},{"path":"src/state/$page.ts","kind":"import-statement","original":"../state/$page.ts"},{"path":"../types/RouteHandler.ts","kind":"import-statement","external":true},{"path":"src/types/RouteType.ts","kind":"import-statement","original":"../types/RouteType"}],"format":"esm"},"src/test.ts":{"bytes":59,"imports":[{"path":"src/test/runTest.ts","kind":"import-statement","original":"./test/runTest"}],"format":"esm"},"src/bin/index.ts":{"bytes":351,"imports":[{"path":"src/site/run.ts","kind":"import-statement","original":"../site/run"}],"format":"esm"}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16827},"dist/index.cjs":{"imports":[{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite-tsconfig-paths","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":143},"src/site/pathToRegex.ts":{"bytesInOutput":303},"src/site/Router.ts":{"bytesInOutput":3423},"src/site/Site.ts":{"bytesInOutput":3513},"src/types/RouteType.ts":{"bytesInOutput":167},"src/site/defaultAdapter.ts":{"bytesInOutput":154}},"bytes":9375},"dist/response.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10313},"dist/response.cjs":{"imports":[],"exports":[],"entryPoint":"src/response.ts","inputs":{"src/response.ts":{"bytesInOutput":560},"src/response/response.ts":{"bytesInOutput":334},"src/response/badRequest.ts":{"bytesInOutput":60},"src/response/created.ts":{"bytesInOutput":57},"src/response/forbidden.ts":{"bytesInOutput":59},"src/response/methodNotAllowed.ts":{"bytesInOutput":66},"src/response/transfer.ts":{"bytesInOutput":124},"src/response/moved.ts":{"bytesInOutput":63},"src/response/notFound.ts":{"bytesInOutput":58},"src/response/notModified.ts":{"bytesInOutput":69},"src/response/ok.ts":{"bytesInOutput":52},"src/response/redirect.ts":{"bytesInOutput":66},"src/response/seeOther.ts":{"bytesInOutput":66},"src/response/serverError.ts":{"bytesInOutput":61},"src/response/unauthorized.ts":{"bytesInOutput":62},"src/response/unprocessable.ts":{"bytesInOutput":63}},"bytes":3376},"dist/run.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":49744},"dist/run.cjs":{"imports":[{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"@torpor/unplugin/vite","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"@torpor/unplugin/vite","kind":"require-call","external":true},{"path":"dotenv","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"cookie","kind":"require-call","external":true},{"path":"http","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true},{"path":"dotenv","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/run.ts","inputs":{"src/run.ts":{"bytesInOutput":195},"src/site/run.ts":{"bytesInOutput":1556},"src/site/runBuild.ts":{"bytesInOutput":2703},"src/site/manifest.ts":{"bytesInOutput":1256},"src/site/runDev.ts":{"bytesInOutput":1514},"src/response/response.ts":{"bytesInOutput":334},"src/response/serverError.ts":{"bytesInOutput":61},"src/site/pathToRegex.ts":{"bytesInOutput":303},"src/server/CookieHelper.ts":{"bytesInOutput":819},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/server/ServerEvent.ts":{"bytesInOutput":696},"src/server/Server.ts":{"bytesInOutput":2764},"src/server/connect/flattenHeaders.ts":{"bytesInOutput":472},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytesInOutput":1430},"src/server/connect/readableToBuffer.ts":{"bytesInOutput":304},"src/server/connect/requestToNodeMessage.ts":{"bytesInOutput":529},"src/server/connect/connectMiddleware.ts":{"bytesInOutput":1381},"src/site/prepareTemplate.ts":{"bytesInOutput":698},"src/site/runPreview.ts":{"bytesInOutput":1939},"src/server/contentType.ts":{"bytesInOutput":2608}},"bytes":24213},"dist/server.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":23404},"dist/server.cjs":{"imports":[{"path":"cookie","kind":"require-call","external":true},{"path":"http","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/server.ts","inputs":{"src/server.ts":{"bytesInOutput":278},"src/server/CookieHelper.ts":{"bytesInOutput":819},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/site/pathToRegex.ts":{"bytesInOutput":301},"src/server/ServerEvent.ts":{"bytesInOutput":696},"src/server/Server.ts":{"bytesInOutput":2756},"src/server/connect/flattenHeaders.ts":{"bytesInOutput":472},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytesInOutput":1430},"src/server/connect/readableToBuffer.ts":{"bytesInOutput":304},"src/server/connect/requestToNodeMessage.ts":{"bytesInOutput":529},"src/server/connect/connectMiddleware.ts":{"bytesInOutput":1381}},"bytes":10720},"dist/state.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":637},"dist/state.cjs":{"imports":[{"path":"@torpor/view","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/state.ts","inputs":{"src/state.ts":{"bytesInOutput":128},"src/state/$page.ts":{"bytesInOutput":192}},"bytes":1258},"dist/test.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32064},"dist/test.cjs":{"imports":[{"path":"path","kind":"require-call","external":true},{"path":"cookie","kind":"require-call","external":true},{"path":"@torpor/view","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/test.ts","inputs":{"src/test.ts":{"bytesInOutput":122},"src/test/runTest.ts":{"bytesInOutput":6091},"src/response/response.ts":{"bytesInOutput":334},"src/response/notFound.ts":{"bytesInOutput":58},"src/response/ok.ts":{"bytesInOutput":52},"src/response/transfer.ts":{"bytesInOutput":124},"src/response/seeOther.ts":{"bytesInOutput":66},"src/server/CookieHelper.ts":{"bytesInOutput":819},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/server/ServerEvent.ts":{"bytesInOutput":696},"src/site/pathToRegex.ts":{"bytesInOutput":303},"src/site/Router.ts":{"bytesInOutput":3423},"src/state/$page.ts":{"bytesInOutput":192},"src/types/RouteType.ts":{"bytesInOutput":167}},"bytes":14737},"dist/bin/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":50198},"dist/bin/index.cjs":{"imports":[{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"@torpor/unplugin/vite","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"@torpor/unplugin/vite","kind":"require-call","external":true},{"path":"dotenv","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"vite","kind":"require-call","external":true},{"path":"cookie","kind":"require-call","external":true},{"path":"http","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true},{"path":"stream","kind":"require-call","external":true},{"path":"dotenv","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/bin/index.ts","inputs":{"src/site/run.ts":{"bytesInOutput":1556},"src/site/runBuild.ts":{"bytesInOutput":2703},"src/site/manifest.ts":{"bytesInOutput":1256},"src/site/runDev.ts":{"bytesInOutput":1514},"src/response/response.ts":{"bytesInOutput":334},"src/response/serverError.ts":{"bytesInOutput":61},"src/site/pathToRegex.ts":{"bytesInOutput":303},"src/server/CookieHelper.ts":{"bytesInOutput":819},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/server/ServerEvent.ts":{"bytesInOutput":696},"src/server/Server.ts":{"bytesInOutput":2764},"src/server/connect/flattenHeaders.ts":{"bytesInOutput":472},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytesInOutput":1430},"src/server/connect/readableToBuffer.ts":{"bytesInOutput":304},"src/server/connect/requestToNodeMessage.ts":{"bytesInOutput":529},"src/server/connect/connectMiddleware.ts":{"bytesInOutput":1381},"src/site/prepareTemplate.ts":{"bytesInOutput":698},"src/site/runPreview.ts":{"bytesInOutput":1939},"src/server/contentType.ts":{"bytesInOutput":2608},"src/bin/index.ts":{"bytesInOutput":309}},"bytes":24001}}}
@@ -1 +1 @@
1
- {"inputs":{"src/site/pathToRegex.ts":{"bytes":459,"imports":[],"format":"esm"},"src/site/Router.ts":{"bytes":4384,"imports":[{"path":"src/site/pathToRegex.ts","kind":"import-statement","original":"./pathToRegex"}],"format":"esm"},"src/types/RouteType.ts":{"bytes":230,"imports":[],"format":"esm"},"src/site/defaultAdapter.ts":{"bytes":282,"imports":[{"path":"../types/Adapter","kind":"import-statement","external":true}],"format":"esm"},"src/site/Site.ts":{"bytes":4097,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"vite-tsconfig-paths","kind":"import-statement","external":true},{"path":"src/types/RouteType.ts","kind":"import-statement","original":"../types/RouteType"},{"path":"src/site/defaultAdapter.ts","kind":"import-statement","original":"./defaultAdapter"}],"format":"esm"},"src/index.ts":{"bytes":838,"imports":[{"path":"src/site/Router.ts","kind":"import-statement","original":"./site/Router"},{"path":"src/site/Site.ts","kind":"import-statement","original":"./site/Site"}],"format":"esm"},"src/response/response.ts":{"bytes":691,"imports":[],"format":"esm"},"src/response/badRequest.ts":{"bytes":451,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/created.ts":{"bytes":384,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/forbidden.ts":{"bytes":458,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/methodNotAllowed.ts":{"bytes":419,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/transfer.ts":{"bytes":264,"imports":[],"format":"esm"},"src/response/moved.ts":{"bytes":613,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/notFound.ts":{"bytes":671,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/notModified.ts":{"bytes":419,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/ok.ts":{"bytes":684,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/redirect.ts":{"bytes":640,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/seeOther.ts":{"bytes":355,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/serverError.ts":{"bytes":315,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unauthorized.ts":{"bytes":432,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unprocessable.ts":{"bytes":337,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response.ts":{"bytes":886,"imports":[{"path":"src/response/badRequest.ts","kind":"import-statement","original":"./response/badRequest"},{"path":"src/response/created.ts","kind":"import-statement","original":"./response/created"},{"path":"src/response/forbidden.ts","kind":"import-statement","original":"./response/forbidden"},{"path":"src/response/methodNotAllowed.ts","kind":"import-statement","original":"./response/methodNotAllowed"},{"path":"src/response/moved.ts","kind":"import-statement","original":"./response/moved"},{"path":"src/response/notFound.ts","kind":"import-statement","original":"./response/notFound"},{"path":"src/response/notModified.ts","kind":"import-statement","original":"./response/notModified"},{"path":"src/response/ok.ts","kind":"import-statement","original":"./response/ok"},{"path":"src/response/redirect.ts","kind":"import-statement","original":"./response/redirect"},{"path":"src/response/response.ts","kind":"import-statement","original":"./response/response"},{"path":"src/response/seeOther.ts","kind":"import-statement","original":"./response/seeOther"},{"path":"src/response/serverError.ts","kind":"import-statement","original":"./response/serverError"},{"path":"src/response/transfer.ts","kind":"import-statement","original":"./response/transfer"},{"path":"src/response/unauthorized.ts","kind":"import-statement","original":"./response/unauthorized"},{"path":"src/response/unprocessable.ts","kind":"import-statement","original":"./response/unprocessable"}],"format":"esm"},"src/site/manifest.ts":{"bytes":1553,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site","kind":"import-statement","external":true}],"format":"esm"},"src/site/runBuild.ts":{"bytes":2714,"imports":[{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site.ts","kind":"import-statement","external":true},{"path":"src/site/manifest.ts","kind":"import-statement","original":"./manifest.ts"}],"format":"esm"},"src/server/CookieHelper.ts":{"bytes":1078,"imports":[{"path":"cookie","kind":"import-statement","external":true}],"format":"esm"},"src/server/HeaderHelper.ts":{"bytes":571,"imports":[],"format":"esm"},"src/server/ServerEvent.ts":{"bytes":956,"imports":[{"path":"src/server/CookieHelper.ts","kind":"import-statement","original":"./CookieHelper"},{"path":"src/server/HeaderHelper.ts","kind":"import-statement","original":"./HeaderHelper"}],"format":"esm"},"src/server/Server.ts":{"bytes":3639,"imports":[{"path":"src/site/pathToRegex.ts","kind":"import-statement","original":"../site/pathToRegex"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"./ServerEvent"}],"format":"esm"},"src/server/connect/flattenHeaders.ts":{"bytes":1017,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"node:http2","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytes":2363,"imports":[{"path":"http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/readableToBuffer.ts":{"bytes":388,"imports":[{"path":"node:stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/requestToNodeMessage.ts":{"bytes":1109,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/connectMiddleware.ts":{"bytes":2655,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"src/server/connect/flattenHeaders.ts","kind":"import-statement","original":"./flattenHeaders"},{"path":"src/server/connect/nodeMessageToNodeResponse.ts","kind":"import-statement","original":"./nodeMessageToNodeResponse"},{"path":"src/server/connect/readableToBuffer.ts","kind":"import-statement","original":"./readableToBuffer"},{"path":"src/server/connect/requestToNodeMessage.ts","kind":"import-statement","original":"./requestToNodeMessage"}],"format":"esm"},"src/site/prepareTemplate.ts":{"bytes":809,"imports":[],"format":"esm"},"src/site/runDev.ts":{"bytes":3047,"imports":[{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"src/response.ts","kind":"import-statement","original":"../response.ts"},{"path":"src/server/Server.ts","kind":"import-statement","original":"../server/Server.ts"},{"path":"src/server/connect/connectMiddleware.ts","kind":"import-statement","original":"../server/connect/connectMiddleware.ts"},{"path":"./Site.ts","kind":"import-statement","external":true},{"path":"src/site/manifest.ts","kind":"import-statement","original":"./manifest.ts"},{"path":"src/site/prepareTemplate.ts","kind":"import-statement","original":"./prepareTemplate.ts"}],"format":"esm"},"src/server/contentType.ts":{"bytes":2679,"imports":[],"format":"esm"},"src/site/runPreview.ts":{"bytes":2543,"imports":[{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"src/response.ts","kind":"import-statement","original":"../response.ts"},{"path":"src/server/Server.ts","kind":"import-statement","original":"../server/Server.ts"},{"path":"src/server/contentType.ts","kind":"import-statement","original":"../server/contentType.ts"},{"path":"./Site","kind":"import-statement","external":true},{"path":"src/site/prepareTemplate.ts","kind":"import-statement","original":"./prepareTemplate.ts"},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./runBuild"}],"format":"esm"},"src/site/run.ts":{"bytes":1695,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site","kind":"import-statement","external":true},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./runBuild"},{"path":"src/site/runDev.ts","kind":"import-statement","original":"./runDev"},{"path":"src/site/runPreview.ts","kind":"import-statement","original":"./runPreview"}],"format":"esm"},"src/run.ts":{"bytes":197,"imports":[{"path":"src/site/run.ts","kind":"import-statement","original":"./site/run"},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./site/runBuild"},{"path":"src/site/runDev.ts","kind":"import-statement","original":"./site/runDev"},{"path":"src/site/runPreview.ts","kind":"import-statement","original":"./site/runPreview"}],"format":"esm"},"src/server.ts":{"bytes":334,"imports":[{"path":"src/server/CookieHelper.ts","kind":"import-statement","original":"./server/CookieHelper"},{"path":"src/server/HeaderHelper.ts","kind":"import-statement","original":"./server/HeaderHelper"},{"path":"src/server/Server.ts","kind":"import-statement","original":"./server/Server"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"./server/ServerEvent"},{"path":"src/server/connect/connectMiddleware.ts","kind":"import-statement","original":"./server/connect/connectMiddleware"}],"format":"esm"},"src/state/$page.ts":{"bytes":218,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true}],"format":"esm"},"src/state.ts":{"bytes":54,"imports":[{"path":"src/state/$page.ts","kind":"import-statement","original":"./state/$page"}],"format":"esm"},"src/test/runTest.ts":{"bytes":9437,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"src/response/notFound.ts","kind":"import-statement","original":"../response/notFound.ts"},{"path":"src/response/ok.ts","kind":"import-statement","original":"../response/ok.ts"},{"path":"src/response/seeOther.ts","kind":"import-statement","original":"../response/seeOther.ts"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"../server/ServerEvent.ts"},{"path":"src/site/Router.ts","kind":"import-statement","original":"../site/Router.ts"},{"path":"../site/Site","kind":"import-statement","external":true},{"path":"src/state/$page.ts","kind":"import-statement","original":"../state/$page.ts"},{"path":"../types/RouteHandler.ts","kind":"import-statement","external":true},{"path":"src/types/RouteType.ts","kind":"import-statement","original":"../types/RouteType"}],"format":"esm"},"src/test.ts":{"bytes":59,"imports":[{"path":"src/test/runTest.ts","kind":"import-statement","original":"./test/runTest"}],"format":"esm"},"src/bin/index.ts":{"bytes":351,"imports":[{"path":"src/site/run.ts","kind":"import-statement","original":"../site/run"}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":7108},"dist/index.js":{"imports":[{"path":"dist/chunk-65K3R3CP.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite-tsconfig-paths","kind":"import-statement","external":true}],"exports":["Router","Site"],"entryPoint":"src/index.ts","inputs":{"src/site/Site.ts":{"bytesInOutput":3247},"src/site/defaultAdapter.ts":{"bytesInOutput":154},"src/index.ts":{"bytesInOutput":0}},"bytes":3706},"dist/response.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/response.js":{"imports":[{"path":"dist/chunk-D6LHMH2C.js","kind":"import-statement"},{"path":"dist/chunk-2QQN3D3K.js","kind":"import-statement"}],"exports":["badRequest","created","forbidden","methodNotAllowed","moved","notFound","notModified","ok","redirect","response","seeOther","serverError","transfer","unauthorized","unprocessable"],"entryPoint":"src/response.ts","inputs":{},"bytes":479},"dist/run.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/run.js":{"imports":[{"path":"dist/chunk-P3DUKHI5.js","kind":"import-statement"},{"path":"dist/chunk-D6LHMH2C.js","kind":"import-statement"},{"path":"dist/chunk-LO7P2LJE.js","kind":"import-statement"},{"path":"dist/chunk-2QQN3D3K.js","kind":"import-statement"},{"path":"dist/chunk-KKFND4HK.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":["run","runBuild","runDev","runPreview"],"entryPoint":"src/run.ts","inputs":{"src/run.ts":{"bytesInOutput":0}},"bytes":285},"dist/server.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/server.js":{"imports":[{"path":"dist/chunk-LO7P2LJE.js","kind":"import-statement"},{"path":"dist/chunk-KKFND4HK.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":["CookieHelper","HeaderHelper","Server","ServerEvent","connectMiddleware"],"entryPoint":"src/server.ts","inputs":{"src/server.ts":{"bytesInOutput":0}},"bytes":273},"dist/state.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/state.js":{"imports":[{"path":"dist/chunk-WMHM5RGZ.js","kind":"import-statement"}],"exports":["$page"],"entryPoint":"src/state.ts","inputs":{"src/state.ts":{"bytesInOutput":0}},"bytes":90},"dist/test.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":14848},"dist/test.js":{"imports":[{"path":"dist/chunk-65K3R3CP.js","kind":"import-statement"},{"path":"dist/chunk-WMHM5RGZ.js","kind":"import-statement"},{"path":"dist/chunk-2QQN3D3K.js","kind":"import-statement"},{"path":"dist/chunk-KKFND4HK.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"},{"path":"path","kind":"import-statement","external":true}],"exports":["runTest"],"entryPoint":"src/test.ts","inputs":{"src/test/runTest.ts":{"bytesInOutput":6044},"src/test.ts":{"bytesInOutput":0}},"bytes":6468},"dist/chunk-65K3R3CP.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":7886},"dist/chunk-65K3R3CP.js":{"imports":[{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":["HOOK_ROUTE","HOOK_SERVER_ROUTE","LAYOUT_ROUTE","LAYOUT_SERVER_ROUTE","PAGE_ROUTE","PAGE_SERVER_ROUTE","Router","SERVER_ROUTE"],"inputs":{"src/site/Router.ts":{"bytesInOutput":3398},"src/types/RouteType.ts":{"bytesInOutput":167}},"bytes":3815},"dist/chunk-WMHM5RGZ.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":512},"dist/chunk-WMHM5RGZ.js":{"imports":[{"path":"@torpor/view","kind":"import-statement","external":true}],"exports":["page_default"],"inputs":{"src/state/$page.ts":{"bytesInOutput":171}},"bytes":221},"dist/bin/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":771},"dist/bin/index.js":{"imports":[{"path":"dist/chunk-P3DUKHI5.js","kind":"import-statement"},{"path":"dist/chunk-D6LHMH2C.js","kind":"import-statement"},{"path":"dist/chunk-LO7P2LJE.js","kind":"import-statement"},{"path":"dist/chunk-2QQN3D3K.js","kind":"import-statement"},{"path":"dist/chunk-KKFND4HK.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":[],"entryPoint":"src/bin/index.ts","inputs":{"src/bin/index.ts":{"bytesInOutput":309}},"bytes":552},"dist/chunk-P3DUKHI5.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":24358},"dist/chunk-P3DUKHI5.js":{"imports":[{"path":"dist/chunk-D6LHMH2C.js","kind":"import-statement"},{"path":"dist/chunk-LO7P2LJE.js","kind":"import-statement"},{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true}],"exports":["run","runBuild","runDev","runPreview"],"inputs":{"src/site/runBuild.ts":{"bytesInOutput":1992},"src/site/manifest.ts":{"bytesInOutput":1168},"src/site/runDev.ts":{"bytesInOutput":1337},"src/site/prepareTemplate.ts":{"bytesInOutput":698},"src/site/runPreview.ts":{"bytesInOutput":1694},"src/server/contentType.ts":{"bytesInOutput":2608},"src/site/run.ts":{"bytesInOutput":1333}},"bytes":11264},"dist/chunk-D6LHMH2C.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":5668},"dist/chunk-D6LHMH2C.js":{"imports":[{"path":"dist/chunk-2QQN3D3K.js","kind":"import-statement"}],"exports":["badRequest","created","forbidden","methodNotAllowed","moved","notModified","redirect","serverError","unauthorized","unprocessable"],"inputs":{"src/response/badRequest.ts":{"bytesInOutput":60},"src/response/created.ts":{"bytesInOutput":57},"src/response/forbidden.ts":{"bytesInOutput":59},"src/response/methodNotAllowed.ts":{"bytesInOutput":66},"src/response/moved.ts":{"bytesInOutput":63},"src/response/notModified.ts":{"bytesInOutput":69},"src/response/redirect.ts":{"bytesInOutput":66},"src/response/serverError.ts":{"bytesInOutput":61},"src/response/unauthorized.ts":{"bytesInOutput":62},"src/response/unprocessable.ts":{"bytesInOutput":63},"src/response.ts":{"bytesInOutput":0}},"bytes":1154},"dist/chunk-LO7P2LJE.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":17697},"dist/chunk-LO7P2LJE.js":{"imports":[{"path":"dist/chunk-KKFND4HK.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"},{"path":"http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"exports":["Server","connectMiddleware"],"inputs":{"src/server/Server.ts":{"bytesInOutput":2756},"src/server/connect/flattenHeaders.ts":{"bytesInOutput":472},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytesInOutput":1380},"src/server/connect/readableToBuffer.ts":{"bytesInOutput":304},"src/server/connect/requestToNodeMessage.ts":{"bytesInOutput":513},"src/server/connect/connectMiddleware.ts":{"bytesInOutput":1381}},"bytes":7207},"dist/chunk-2QQN3D3K.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3633},"dist/chunk-2QQN3D3K.js":{"imports":[],"exports":["notFound","ok","response","seeOther","transfer"],"inputs":{"src/response/response.ts":{"bytesInOutput":334},"src/response/transfer.ts":{"bytesInOutput":124},"src/response/notFound.ts":{"bytesInOutput":58},"src/response/ok.ts":{"bytesInOutput":52},"src/response/seeOther.ts":{"bytesInOutput":66}},"bytes":838},"dist/chunk-KKFND4HK.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4610},"dist/chunk-KKFND4HK.js":{"imports":[{"path":"cookie","kind":"import-statement","external":true}],"exports":["CookieHelper","HeaderHelper","ServerEvent"],"inputs":{"src/server/CookieHelper.ts":{"bytesInOutput":747},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/server/ServerEvent.ts":{"bytesInOutput":696}},"bytes":1990},"dist/chunk-SJVHHGVW.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":860},"dist/chunk-SJVHHGVW.js":{"imports":[],"exports":["pathToRegex"],"inputs":{"src/site/pathToRegex.ts":{"bytesInOutput":301}},"bytes":355}}}
1
+ {"inputs":{"src/site/pathToRegex.ts":{"bytes":459,"imports":[],"format":"esm"},"src/site/Router.ts":{"bytes":4384,"imports":[{"path":"src/site/pathToRegex.ts","kind":"import-statement","original":"./pathToRegex"}],"format":"esm"},"src/types/RouteType.ts":{"bytes":230,"imports":[],"format":"esm"},"src/site/defaultAdapter.ts":{"bytes":282,"imports":[{"path":"../types/Adapter","kind":"import-statement","external":true}],"format":"esm"},"src/site/Site.ts":{"bytes":4181,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"vite-tsconfig-paths","kind":"import-statement","external":true},{"path":"src/types/RouteType.ts","kind":"import-statement","original":"../types/RouteType"},{"path":"src/site/defaultAdapter.ts","kind":"import-statement","original":"./defaultAdapter"}],"format":"esm"},"src/index.ts":{"bytes":838,"imports":[{"path":"src/site/Router.ts","kind":"import-statement","original":"./site/Router"},{"path":"src/site/Site.ts","kind":"import-statement","original":"./site/Site"}],"format":"esm"},"src/response/response.ts":{"bytes":691,"imports":[],"format":"esm"},"src/response/badRequest.ts":{"bytes":451,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/created.ts":{"bytes":384,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/forbidden.ts":{"bytes":458,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/methodNotAllowed.ts":{"bytes":419,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/transfer.ts":{"bytes":264,"imports":[],"format":"esm"},"src/response/moved.ts":{"bytes":613,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/notFound.ts":{"bytes":671,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/notModified.ts":{"bytes":419,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/ok.ts":{"bytes":684,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/redirect.ts":{"bytes":640,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/seeOther.ts":{"bytes":355,"imports":[{"path":"src/response/transfer.ts","kind":"import-statement","original":"./transfer"}],"format":"esm"},"src/response/serverError.ts":{"bytes":315,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unauthorized.ts":{"bytes":432,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unprocessable.ts":{"bytes":337,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response.ts":{"bytes":886,"imports":[{"path":"src/response/badRequest.ts","kind":"import-statement","original":"./response/badRequest"},{"path":"src/response/created.ts","kind":"import-statement","original":"./response/created"},{"path":"src/response/forbidden.ts","kind":"import-statement","original":"./response/forbidden"},{"path":"src/response/methodNotAllowed.ts","kind":"import-statement","original":"./response/methodNotAllowed"},{"path":"src/response/moved.ts","kind":"import-statement","original":"./response/moved"},{"path":"src/response/notFound.ts","kind":"import-statement","original":"./response/notFound"},{"path":"src/response/notModified.ts","kind":"import-statement","original":"./response/notModified"},{"path":"src/response/ok.ts","kind":"import-statement","original":"./response/ok"},{"path":"src/response/redirect.ts","kind":"import-statement","original":"./response/redirect"},{"path":"src/response/response.ts","kind":"import-statement","original":"./response/response"},{"path":"src/response/seeOther.ts","kind":"import-statement","original":"./response/seeOther"},{"path":"src/response/serverError.ts","kind":"import-statement","original":"./response/serverError"},{"path":"src/response/transfer.ts","kind":"import-statement","original":"./response/transfer"},{"path":"src/response/unauthorized.ts","kind":"import-statement","original":"./response/unauthorized"},{"path":"src/response/unprocessable.ts","kind":"import-statement","original":"./response/unprocessable"}],"format":"esm"},"src/site/manifest.ts":{"bytes":1553,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site","kind":"import-statement","external":true}],"format":"esm"},"src/site/runBuild.ts":{"bytes":2986,"imports":[{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site.ts","kind":"import-statement","external":true},{"path":"src/site/manifest.ts","kind":"import-statement","original":"./manifest.ts"}],"format":"esm"},"src/server/CookieHelper.ts":{"bytes":1078,"imports":[{"path":"cookie","kind":"import-statement","external":true}],"format":"esm"},"src/server/HeaderHelper.ts":{"bytes":571,"imports":[],"format":"esm"},"src/server/ServerEvent.ts":{"bytes":956,"imports":[{"path":"src/server/CookieHelper.ts","kind":"import-statement","original":"./CookieHelper"},{"path":"src/server/HeaderHelper.ts","kind":"import-statement","original":"./HeaderHelper"}],"format":"esm"},"src/server/Server.ts":{"bytes":3639,"imports":[{"path":"src/site/pathToRegex.ts","kind":"import-statement","original":"../site/pathToRegex"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"./ServerEvent"}],"format":"esm"},"src/server/connect/flattenHeaders.ts":{"bytes":1017,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"node:http2","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytes":2363,"imports":[{"path":"http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/readableToBuffer.ts":{"bytes":388,"imports":[{"path":"node:stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/requestToNodeMessage.ts":{"bytes":1109,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"format":"esm"},"src/server/connect/connectMiddleware.ts":{"bytes":2655,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"src/server/connect/flattenHeaders.ts","kind":"import-statement","original":"./flattenHeaders"},{"path":"src/server/connect/nodeMessageToNodeResponse.ts","kind":"import-statement","original":"./nodeMessageToNodeResponse"},{"path":"src/server/connect/readableToBuffer.ts","kind":"import-statement","original":"./readableToBuffer"},{"path":"src/server/connect/requestToNodeMessage.ts","kind":"import-statement","original":"./requestToNodeMessage"}],"format":"esm"},"src/site/prepareTemplate.ts":{"bytes":809,"imports":[],"format":"esm"},"src/site/runDev.ts":{"bytes":3047,"imports":[{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"src/response.ts","kind":"import-statement","original":"../response.ts"},{"path":"src/server/Server.ts","kind":"import-statement","original":"../server/Server.ts"},{"path":"src/server/connect/connectMiddleware.ts","kind":"import-statement","original":"../server/connect/connectMiddleware.ts"},{"path":"./Site.ts","kind":"import-statement","external":true},{"path":"src/site/manifest.ts","kind":"import-statement","original":"./manifest.ts"},{"path":"src/site/prepareTemplate.ts","kind":"import-statement","original":"./prepareTemplate.ts"}],"format":"esm"},"src/server/contentType.ts":{"bytes":2679,"imports":[],"format":"esm"},"src/site/runPreview.ts":{"bytes":2543,"imports":[{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"src/response.ts","kind":"import-statement","original":"../response.ts"},{"path":"src/server/Server.ts","kind":"import-statement","original":"../server/Server.ts"},{"path":"src/server/contentType.ts","kind":"import-statement","original":"../server/contentType.ts"},{"path":"./Site","kind":"import-statement","external":true},{"path":"src/site/prepareTemplate.ts","kind":"import-statement","original":"./prepareTemplate.ts"},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./runBuild"}],"format":"esm"},"src/site/run.ts":{"bytes":1695,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"./Site","kind":"import-statement","external":true},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./runBuild"},{"path":"src/site/runDev.ts","kind":"import-statement","original":"./runDev"},{"path":"src/site/runPreview.ts","kind":"import-statement","original":"./runPreview"}],"format":"esm"},"src/run.ts":{"bytes":197,"imports":[{"path":"src/site/run.ts","kind":"import-statement","original":"./site/run"},{"path":"src/site/runBuild.ts","kind":"import-statement","original":"./site/runBuild"},{"path":"src/site/runDev.ts","kind":"import-statement","original":"./site/runDev"},{"path":"src/site/runPreview.ts","kind":"import-statement","original":"./site/runPreview"}],"format":"esm"},"src/server.ts":{"bytes":334,"imports":[{"path":"src/server/CookieHelper.ts","kind":"import-statement","original":"./server/CookieHelper"},{"path":"src/server/HeaderHelper.ts","kind":"import-statement","original":"./server/HeaderHelper"},{"path":"src/server/Server.ts","kind":"import-statement","original":"./server/Server"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"./server/ServerEvent"},{"path":"src/server/connect/connectMiddleware.ts","kind":"import-statement","original":"./server/connect/connectMiddleware"}],"format":"esm"},"src/state/$page.ts":{"bytes":218,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true}],"format":"esm"},"src/state.ts":{"bytes":54,"imports":[{"path":"src/state/$page.ts","kind":"import-statement","original":"./state/$page"}],"format":"esm"},"src/test/runTest.ts":{"bytes":9437,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"src/response/notFound.ts","kind":"import-statement","original":"../response/notFound.ts"},{"path":"src/response/ok.ts","kind":"import-statement","original":"../response/ok.ts"},{"path":"src/response/seeOther.ts","kind":"import-statement","original":"../response/seeOther.ts"},{"path":"src/server/ServerEvent.ts","kind":"import-statement","original":"../server/ServerEvent.ts"},{"path":"src/site/Router.ts","kind":"import-statement","original":"../site/Router.ts"},{"path":"../site/Site","kind":"import-statement","external":true},{"path":"src/state/$page.ts","kind":"import-statement","original":"../state/$page.ts"},{"path":"../types/RouteHandler.ts","kind":"import-statement","external":true},{"path":"src/types/RouteType.ts","kind":"import-statement","original":"../types/RouteType"}],"format":"esm"},"src/test.ts":{"bytes":59,"imports":[{"path":"src/test/runTest.ts","kind":"import-statement","original":"./test/runTest"}],"format":"esm"},"src/bin/index.ts":{"bytes":351,"imports":[{"path":"src/site/run.ts","kind":"import-statement","original":"../site/run"}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":7199},"dist/index.js":{"imports":[{"path":"dist/chunk-65K3R3CP.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite-tsconfig-paths","kind":"import-statement","external":true}],"exports":["Router","Site"],"entryPoint":"src/index.ts","inputs":{"src/site/Site.ts":{"bytesInOutput":3332},"src/site/defaultAdapter.ts":{"bytesInOutput":154},"src/index.ts":{"bytesInOutput":0}},"bytes":3791},"dist/response.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/response.js":{"imports":[{"path":"dist/chunk-D6LHMH2C.js","kind":"import-statement"},{"path":"dist/chunk-2QQN3D3K.js","kind":"import-statement"}],"exports":["badRequest","created","forbidden","methodNotAllowed","moved","notFound","notModified","ok","redirect","response","seeOther","serverError","transfer","unauthorized","unprocessable"],"entryPoint":"src/response.ts","inputs":{},"bytes":479},"dist/run.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/run.js":{"imports":[{"path":"dist/chunk-K72JP24O.js","kind":"import-statement"},{"path":"dist/chunk-D6LHMH2C.js","kind":"import-statement"},{"path":"dist/chunk-LO7P2LJE.js","kind":"import-statement"},{"path":"dist/chunk-2QQN3D3K.js","kind":"import-statement"},{"path":"dist/chunk-KKFND4HK.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":["run","runBuild","runDev","runPreview"],"entryPoint":"src/run.ts","inputs":{"src/run.ts":{"bytesInOutput":0}},"bytes":285},"dist/server.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/server.js":{"imports":[{"path":"dist/chunk-LO7P2LJE.js","kind":"import-statement"},{"path":"dist/chunk-KKFND4HK.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":["CookieHelper","HeaderHelper","Server","ServerEvent","connectMiddleware"],"entryPoint":"src/server.ts","inputs":{"src/server.ts":{"bytesInOutput":0}},"bytes":273},"dist/state.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/state.js":{"imports":[{"path":"dist/chunk-WMHM5RGZ.js","kind":"import-statement"}],"exports":["$page"],"entryPoint":"src/state.ts","inputs":{"src/state.ts":{"bytesInOutput":0}},"bytes":90},"dist/test.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":14848},"dist/test.js":{"imports":[{"path":"dist/chunk-65K3R3CP.js","kind":"import-statement"},{"path":"dist/chunk-WMHM5RGZ.js","kind":"import-statement"},{"path":"dist/chunk-2QQN3D3K.js","kind":"import-statement"},{"path":"dist/chunk-KKFND4HK.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"},{"path":"path","kind":"import-statement","external":true}],"exports":["runTest"],"entryPoint":"src/test.ts","inputs":{"src/test/runTest.ts":{"bytesInOutput":6044},"src/test.ts":{"bytesInOutput":0}},"bytes":6468},"dist/chunk-65K3R3CP.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":7886},"dist/chunk-65K3R3CP.js":{"imports":[{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":["HOOK_ROUTE","HOOK_SERVER_ROUTE","LAYOUT_ROUTE","LAYOUT_SERVER_ROUTE","PAGE_ROUTE","PAGE_SERVER_ROUTE","Router","SERVER_ROUTE"],"inputs":{"src/site/Router.ts":{"bytesInOutput":3398},"src/types/RouteType.ts":{"bytesInOutput":167}},"bytes":3815},"dist/chunk-WMHM5RGZ.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":512},"dist/chunk-WMHM5RGZ.js":{"imports":[{"path":"@torpor/view","kind":"import-statement","external":true}],"exports":["page_default"],"inputs":{"src/state/$page.ts":{"bytesInOutput":171}},"bytes":221},"dist/bin/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":771},"dist/bin/index.js":{"imports":[{"path":"dist/chunk-K72JP24O.js","kind":"import-statement"},{"path":"dist/chunk-D6LHMH2C.js","kind":"import-statement"},{"path":"dist/chunk-LO7P2LJE.js","kind":"import-statement"},{"path":"dist/chunk-2QQN3D3K.js","kind":"import-statement"},{"path":"dist/chunk-KKFND4HK.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":[],"entryPoint":"src/bin/index.ts","inputs":{"src/bin/index.ts":{"bytesInOutput":309}},"bytes":552},"dist/chunk-K72JP24O.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":24701},"dist/chunk-K72JP24O.js":{"imports":[{"path":"dist/chunk-D6LHMH2C.js","kind":"import-statement"},{"path":"dist/chunk-LO7P2LJE.js","kind":"import-statement"},{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"@torpor/unplugin/vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true},{"path":"dotenv","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"vite","kind":"import-statement","external":true}],"exports":["run","runBuild","runDev","runPreview"],"inputs":{"src/site/runBuild.ts":{"bytesInOutput":2241},"src/site/manifest.ts":{"bytesInOutput":1168},"src/site/runDev.ts":{"bytesInOutput":1337},"src/site/prepareTemplate.ts":{"bytesInOutput":698},"src/site/runPreview.ts":{"bytesInOutput":1694},"src/server/contentType.ts":{"bytesInOutput":2608},"src/site/run.ts":{"bytesInOutput":1333}},"bytes":11513},"dist/chunk-D6LHMH2C.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":5668},"dist/chunk-D6LHMH2C.js":{"imports":[{"path":"dist/chunk-2QQN3D3K.js","kind":"import-statement"}],"exports":["badRequest","created","forbidden","methodNotAllowed","moved","notModified","redirect","serverError","unauthorized","unprocessable"],"inputs":{"src/response/badRequest.ts":{"bytesInOutput":60},"src/response/created.ts":{"bytesInOutput":57},"src/response/forbidden.ts":{"bytesInOutput":59},"src/response/methodNotAllowed.ts":{"bytesInOutput":66},"src/response/moved.ts":{"bytesInOutput":63},"src/response/notModified.ts":{"bytesInOutput":69},"src/response/redirect.ts":{"bytesInOutput":66},"src/response/serverError.ts":{"bytesInOutput":61},"src/response/unauthorized.ts":{"bytesInOutput":62},"src/response/unprocessable.ts":{"bytesInOutput":63},"src/response.ts":{"bytesInOutput":0}},"bytes":1154},"dist/chunk-LO7P2LJE.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":17697},"dist/chunk-LO7P2LJE.js":{"imports":[{"path":"dist/chunk-KKFND4HK.js","kind":"import-statement"},{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"},{"path":"http","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true},{"path":"stream","kind":"import-statement","external":true}],"exports":["Server","connectMiddleware"],"inputs":{"src/server/Server.ts":{"bytesInOutput":2756},"src/server/connect/flattenHeaders.ts":{"bytesInOutput":472},"src/server/connect/nodeMessageToNodeResponse.ts":{"bytesInOutput":1380},"src/server/connect/readableToBuffer.ts":{"bytesInOutput":304},"src/server/connect/requestToNodeMessage.ts":{"bytesInOutput":513},"src/server/connect/connectMiddleware.ts":{"bytesInOutput":1381}},"bytes":7207},"dist/chunk-2QQN3D3K.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3633},"dist/chunk-2QQN3D3K.js":{"imports":[],"exports":["notFound","ok","response","seeOther","transfer"],"inputs":{"src/response/response.ts":{"bytesInOutput":334},"src/response/transfer.ts":{"bytesInOutput":124},"src/response/notFound.ts":{"bytesInOutput":58},"src/response/ok.ts":{"bytesInOutput":52},"src/response/seeOther.ts":{"bytesInOutput":66}},"bytes":838},"dist/chunk-KKFND4HK.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4610},"dist/chunk-KKFND4HK.js":{"imports":[{"path":"cookie","kind":"import-statement","external":true}],"exports":["CookieHelper","HeaderHelper","ServerEvent"],"inputs":{"src/server/CookieHelper.ts":{"bytesInOutput":747},"src/server/HeaderHelper.ts":{"bytesInOutput":397},"src/server/ServerEvent.ts":{"bytesInOutput":696}},"bytes":1990},"dist/chunk-SJVHHGVW.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":860},"dist/chunk-SJVHHGVW.js":{"imports":[],"exports":["pathToRegex"],"inputs":{"src/site/pathToRegex.ts":{"bytesInOutput":301}},"bytes":355}}}
package/dist/run.cjs CHANGED
@@ -93,8 +93,8 @@ async function runBuild(site) {
93
93
  if ((0, import_node_fs2.existsSync)(distFolder)) {
94
94
  await import_node_fs2.promises.rm(distFolder, { recursive: true });
95
95
  }
96
- const clientFolder = import_node_path2.default.join(distFolder, "client");
97
- const serverFolder = import_node_path2.default.join(distFolder, "server");
96
+ let clientFolder = import_node_path2.default.join(distFolder, "client");
97
+ let serverFolder = import_node_path2.default.join(distFolder, "server");
98
98
  if (site.adapter.prebuild) {
99
99
  await site.adapter.prebuild(site);
100
100
  }
@@ -104,32 +104,31 @@ async function runBuild(site) {
104
104
  let serverScript = import_node_path2.default.join(siteFolder, "serverEntry.ts");
105
105
  const clientConfig = site.viteConfig ?? {};
106
106
  clientConfig.plugins = [manifest(site), (0, import_vite.default)(), ...site.plugins];
107
- clientConfig.build = {
108
- outDir: clientFolder,
109
- rollupOptions: {
110
- input: [
111
- siteHtml,
112
- clientScript,
113
- ...site.routes.filter((r) => !/server\.(ts|js)$/.test(r.file)).map((r) => import_node_path2.default.resolve(site.root, r.file)),
114
- ...site.inputs.filter((f) => !/server\.(ts|js)$/.test(f))
115
- ]
116
- },
117
- ssrManifest: true
118
- };
107
+ clientConfig.build ??= {};
108
+ clientConfig.build.outDir ??= clientFolder;
109
+ clientFolder = clientConfig.build.outDir;
110
+ clientConfig.build.rollupOptions ??= {};
111
+ clientConfig.build.rollupOptions.input = [
112
+ siteHtml,
113
+ clientScript,
114
+ ...site.routes.filter((r) => !/server\.(ts|js)$/.test(r.file)).map((r) => import_node_path2.default.resolve(site.root, r.file)),
115
+ ...site.inputs.filter((f) => !/server\.(ts|js)$/.test(f))
116
+ ];
117
+ clientConfig.build.ssrManifest = true;
119
118
  await (0, import_vite2.build)((0, import_vite2.defineConfig)(clientConfig));
120
119
  const serverConfig = site.viteConfig ?? {};
121
- serverConfig.plugins = [manifest(site, true), (0, import_vite.default)(), ...site.plugins];
122
- serverConfig.build = {
123
- outDir: serverFolder,
124
- rollupOptions: {
125
- input: [
126
- serverScript,
127
- ...site.routes.map((r) => import_node_path2.default.resolve(site.root, r.file)),
128
- ...site.inputs
129
- ]
130
- },
131
- ssr: serverScript
132
- };
120
+ serverConfig.plugins ??= [];
121
+ serverConfig.plugins.push(manifest(site, true), (0, import_vite.default)(), ...site.plugins);
122
+ serverConfig.build ??= {};
123
+ serverConfig.build.outDir ??= serverFolder;
124
+ serverFolder = serverConfig.build.outDir;
125
+ serverConfig.build.rollupOptions ??= {};
126
+ serverConfig.build.rollupOptions.input = [
127
+ serverScript,
128
+ ...site.routes.map((r) => import_node_path2.default.resolve(site.root, r.file)),
129
+ ...site.inputs
130
+ ];
131
+ serverConfig.build.ssr = serverScript;
133
132
  await (0, import_vite2.build)((0, import_vite2.defineConfig)(serverConfig));
134
133
  siteHtml = import_node_path2.default.join(clientFolder, "site.html");
135
134
  await import_node_fs2.promises.rename(import_node_path2.default.join(clientFolder, "src", "site.html"), siteHtml);