@torpor/build 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/bin/index.cjs +1 -1
- package/dist/bin/index.cjs.map +1 -1
- package/dist/bin/index.js +3 -3
- package/dist/{chunk-WMHM5RGZ.js → chunk-565UOT3F.js} +5 -2
- package/dist/chunk-565UOT3F.js.map +1 -0
- package/dist/{chunk-D6LHMH2C.js → chunk-B2UNTYN5.js} +8 -8
- package/dist/chunk-B2UNTYN5.js.map +1 -0
- package/dist/{chunk-LHRCEWBG.js → chunk-UCA7KIGG.js} +2 -2
- package/dist/{chunk-65K3R3CP.js → chunk-UN2WQH2T.js} +4 -2
- package/dist/{chunk-65K3R3CP.js.map → chunk-UN2WQH2T.js.map} +1 -1
- package/dist/{chunk-2QQN3D3K.js → chunk-WVXAN4IV.js} +2 -2
- package/dist/{chunk-2QQN3D3K.js.map → chunk-WVXAN4IV.js.map} +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/response.cjs +7 -7
- package/dist/response.cjs.map +1 -1
- package/dist/response.js +2 -2
- package/dist/run.cjs +1 -1
- package/dist/run.cjs.map +1 -1
- package/dist/run.js +3 -3
- package/dist/state.cjs +4 -1
- package/dist/state.cjs.map +1 -1
- package/dist/state.d.cts +4 -0
- package/dist/state.d.ts +4 -0
- package/dist/state.js +1 -1
- package/dist/test.cjs +31 -14
- package/dist/test.cjs.map +1 -1
- package/dist/test.js +29 -15
- package/dist/test.js.map +1 -1
- package/package.json +4 -4
- package/src/response/badRequest.ts +1 -1
- package/src/response/forbidden.ts +1 -1
- package/src/response/methodNotAllowed.ts +1 -1
- package/src/response/notFound.ts +1 -1
- package/src/response/serverError.ts +1 -1
- package/src/response/unauthorized.ts +1 -1
- package/src/response/unprocessable.ts +1 -1
- package/src/site/Site.ts +3 -0
- package/src/site/clientEntry.ts +34 -17
- package/src/site/serverEntry.ts +68 -17
- package/src/state/$page.ts +4 -5
- package/src/state/Page.ts +8 -0
- package/src/test/runTest.ts +26 -12
- package/src/types/RouteType.ts +1 -0
- package/dist/chunk-D6LHMH2C.js.map +0 -1
- package/dist/chunk-WMHM5RGZ.js.map +0 -1
- /package/dist/{chunk-LHRCEWBG.js.map → chunk-UCA7KIGG.js.map} +0 -0
package/dist/index.cjs.map
CHANGED
|
@@ -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 to merge with the standard Torpor build options.\n\t * `plugins` and `build.rollupOptions.input` will be overridden, so you\n\t * should set `Site.plugins` and `Site.inputs` instead. Other options may be\n\t * overridden or incompatible, so experimentation may be required\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,EAA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ChE,YAAI,EAAE,KAAK,CAAC,MAAM,OAAO,EAAE,KAAK,CAAC,MAAM,KAAK;AAC3C,iBAAO;AAAA,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","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\tERROR_ROUTE,\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 to merge with the standard Torpor build options.\n\t * `plugins` and `build.rollupOptions.input` will be overridden, so you\n\t * should set `Site.plugins` and `Site.inputs` instead. Other options may be\n\t * overridden or incompatible, so experimentation may be required\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} else if (routePath.endsWith(\"_error\")) {\n\t\t\treturn ERROR_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;\nexport const ERROR_ROUTE = 8;\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,c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IACR,WAAW,UAAU,SAAS,QAAQ,GAAG;AACxC,aAAO;AAAA,IACR;AACA,WAAO;AAAA,EACR;AAAA;AAAA;AAAA;AAAA,EAMA,cAAc;AACb,SAAK,SAAS,KAAK,OAAO,KAAK,CAAC,GAAG,MAAM;AAGxC,eAAS,IAAI,GAAG,IAAI,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,GAAG,KAAK;AAChE,YAAI,EAAE,KAAK,CAAC,MAAM,OAAO,EAAE,KAAK,CAAC,MAAM,KAAK;AAC3C,iBAAO;AAAA,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","path","tsconfigPaths","path","fs"]}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ERROR_ROUTE,
|
|
2
3
|
HOOK_ROUTE,
|
|
3
4
|
HOOK_SERVER_ROUTE,
|
|
4
5
|
LAYOUT_ROUTE,
|
|
@@ -7,7 +8,7 @@ import {
|
|
|
7
8
|
PAGE_SERVER_ROUTE,
|
|
8
9
|
Router,
|
|
9
10
|
SERVER_ROUTE
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UN2WQH2T.js";
|
|
11
12
|
import "./chunk-SJVHHGVW.js";
|
|
12
13
|
|
|
13
14
|
// src/site/Site.ts
|
|
@@ -85,6 +86,8 @@ var Site = class {
|
|
|
85
86
|
return HOOK_ROUTE;
|
|
86
87
|
} else if (routePath.endsWith("_hook.server")) {
|
|
87
88
|
return HOOK_SERVER_ROUTE;
|
|
89
|
+
} else if (routePath.endsWith("_error")) {
|
|
90
|
+
return ERROR_ROUTE;
|
|
88
91
|
}
|
|
89
92
|
return -1;
|
|
90
93
|
}
|
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 to merge with the standard Torpor build options.\n\t * `plugins` and `build.rollupOptions.input` will be overridden, so you\n\t * should set `Site.plugins` and `Site.inputs` instead. Other options may be\n\t * overridden or incompatible, so experimentation may be required\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":"
|
|
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\tERROR_ROUTE,\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 to merge with the standard Torpor build options.\n\t * `plugins` and `build.rollupOptions.input` will be overridden, so you\n\t * should set `Site.plugins` and `Site.inputs` instead. Other options may be\n\t * overridden or incompatible, so experimentation may be required\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} else if (routePath.endsWith(\"_error\")) {\n\t\t\treturn ERROR_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;;;ADgBf,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;AAAA;AAAA;AAAA,EAOpB;AAAA,EAEA,cAAc;AACb,SAAK,OAAO,QAAQ,IAAI;AAAA,EACzB;AAAA,EAEA,MAAM,eAAe,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AAA,IACR,WAAW,UAAU,SAAS,OAAO,GAAG;AACvC,aAAO;AAAA,IACR,WAAW,UAAU,SAAS,cAAc,GAAG;AAC9C,aAAO;AAAA,IACR,WAAW,UAAU,SAAS,QAAQ,GAAG;AACxC,aAAO;AAAA,IACR;AACA,WAAO;AAAA,EACR;AAAA;AAAA;AAAA;AAAA,EAMA,cAAc;AACb,SAAK,SAAS,KAAK,OAAO,KAAK,CAAC,GAAG,MAAM;AAGxC,eAAS,IAAI,GAAG,IAAI,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,GAAG,KAAK;AAChE,YAAI,EAAE,KAAK,CAAC,MAAM,OAAO,EAAE,KAAK,CAAC,MAAM,KAAK;AAC3C,iBAAO;AAAA,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"]}
|
package/dist/metafile-cjs.json
CHANGED
|
@@ -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":4321,"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":2902,"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":16981},"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":3655},"src/types/RouteType.ts":{"bytesInOutput":167},"src/site/defaultAdapter.ts":{"bytesInOutput":154}},"bytes":9517},"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":49613},"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":2616},"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":24126},"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":50067},"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":2616},"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":23914}}}
|
|
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":260,"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":4403,"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":468,"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":473,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/methodNotAllowed.ts":{"bytes":443,"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":686,"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":333,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unauthorized.ts":{"bytes":450,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unprocessable.ts":{"bytes":356,"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":2902,"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":231,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true},{"path":"./Page","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":9832,"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":17168},"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":3728},"src/types/RouteType.ts":{"bytesInOutput":188},"src/site/defaultAdapter.ts":{"bytesInOutput":154}},"bytes":9611},"dist/response.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10490},"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":77},"src/response/created.ts":{"bytesInOutput":57},"src/response/forbidden.ts":{"bytesInOutput":74},"src/response/methodNotAllowed.ts":{"bytesInOutput":90},"src/response/transfer.ts":{"bytesInOutput":124},"src/response/moved.ts":{"bytesInOutput":63},"src/response/notFound.ts":{"bytesInOutput":73},"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":79},"src/response/unauthorized.ts":{"bytesInOutput":80},"src/response/unprocessable.ts":{"bytesInOutput":82}},"bytes":3502},"dist/run.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":49638},"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":2616},"src/site/manifest.ts":{"bytesInOutput":1256},"src/site/runDev.ts":{"bytesInOutput":1514},"src/response/response.ts":{"bytesInOutput":334},"src/response/serverError.ts":{"bytesInOutput":79},"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":24144},"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":698},"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":230}},"bytes":1296},"dist/test.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32926},"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":6540},"src/response/response.ts":{"bytesInOutput":334},"src/response/notFound.ts":{"bytesInOutput":73},"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":230},"src/types/RouteType.ts":{"bytesInOutput":167}},"bytes":15239},"dist/bin/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":50092},"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":2616},"src/site/manifest.ts":{"bytesInOutput":1256},"src/site/runDev.ts":{"bytesInOutput":1514},"src/response/response.ts":{"bytesInOutput":334},"src/response/serverError.ts":{"bytesInOutput":79},"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":23932}}}
|
package/dist/metafile-esm.json
CHANGED
|
@@ -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":4321,"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":2902,"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":7353},"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":3474},"src/site/defaultAdapter.ts":{"bytesInOutput":154},"src/index.ts":{"bytesInOutput":0}},"bytes":3933},"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-LHRCEWBG.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-LHRCEWBG.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-LHRCEWBG.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":24570},"dist/chunk-LHRCEWBG.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":2154},"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":11426},"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":260,"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":4403,"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":468,"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":473,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/methodNotAllowed.ts":{"bytes":443,"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":686,"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":333,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unauthorized.ts":{"bytes":450,"imports":[{"path":"src/response/response.ts","kind":"import-statement","original":"./response"}],"format":"esm"},"src/response/unprocessable.ts":{"bytes":356,"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":2902,"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":231,"imports":[{"path":"@torpor/view","kind":"import-statement","external":true},{"path":"./Page","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":9832,"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":7494},"dist/index.js":{"imports":[{"path":"dist/chunk-UN2WQH2T.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":3547},"src/site/defaultAdapter.ts":{"bytesInOutput":154},"src/index.ts":{"bytesInOutput":0}},"bytes":4021},"dist/response.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/response.js":{"imports":[{"path":"dist/chunk-B2UNTYN5.js","kind":"import-statement"},{"path":"dist/chunk-WVXAN4IV.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-UCA7KIGG.js","kind":"import-statement"},{"path":"dist/chunk-B2UNTYN5.js","kind":"import-statement"},{"path":"dist/chunk-LO7P2LJE.js","kind":"import-statement"},{"path":"dist/chunk-WVXAN4IV.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-565UOT3F.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":15596},"dist/test.js":{"imports":[{"path":"dist/chunk-UN2WQH2T.js","kind":"import-statement"},{"path":"dist/chunk-565UOT3F.js","kind":"import-statement"},{"path":"dist/chunk-WVXAN4IV.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":6493},"src/test.ts":{"bytesInOutput":0}},"bytes":6917},"dist/chunk-UN2WQH2T.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":7933},"dist/chunk-UN2WQH2T.js":{"imports":[{"path":"dist/chunk-SJVHHGVW.js","kind":"import-statement"}],"exports":["ERROR_ROUTE","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":188}},"bytes":3851},"dist/chunk-565UOT3F.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":573},"dist/chunk-565UOT3F.js":{"imports":[{"path":"@torpor/view","kind":"import-statement","external":true}],"exports":["page_default"],"inputs":{"src/state/$page.ts":{"bytesInOutput":209}},"bytes":259},"dist/bin/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":771},"dist/bin/index.js":{"imports":[{"path":"dist/chunk-UCA7KIGG.js","kind":"import-statement"},{"path":"dist/chunk-B2UNTYN5.js","kind":"import-statement"},{"path":"dist/chunk-LO7P2LJE.js","kind":"import-statement"},{"path":"dist/chunk-WVXAN4IV.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-UCA7KIGG.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":24570},"dist/chunk-UCA7KIGG.js":{"imports":[{"path":"dist/chunk-B2UNTYN5.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":2154},"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":11426},"dist/chunk-B2UNTYN5.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":5823},"dist/chunk-B2UNTYN5.js":{"imports":[{"path":"dist/chunk-WVXAN4IV.js","kind":"import-statement"}],"exports":["badRequest","created","forbidden","methodNotAllowed","moved","notModified","redirect","serverError","unauthorized","unprocessable"],"inputs":{"src/response/badRequest.ts":{"bytesInOutput":77},"src/response/created.ts":{"bytesInOutput":57},"src/response/forbidden.ts":{"bytesInOutput":74},"src/response/methodNotAllowed.ts":{"bytesInOutput":90},"src/response/moved.ts":{"bytesInOutput":63},"src/response/notModified.ts":{"bytesInOutput":69},"src/response/redirect.ts":{"bytesInOutput":66},"src/response/serverError.ts":{"bytesInOutput":79},"src/response/unauthorized.ts":{"bytesInOutput":80},"src/response/unprocessable.ts":{"bytesInOutput":82},"src/response.ts":{"bytesInOutput":0}},"bytes":1265},"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-WVXAN4IV.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":3655},"dist/chunk-WVXAN4IV.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":73},"src/response/ok.ts":{"bytesInOutput":52},"src/response/seeOther.ts":{"bytesInOutput":66}},"bytes":853},"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/response.cjs
CHANGED
|
@@ -57,7 +57,7 @@ function response(status, body) {
|
|
|
57
57
|
|
|
58
58
|
// src/response/badRequest.ts
|
|
59
59
|
function badRequest(body) {
|
|
60
|
-
return response(400, body);
|
|
60
|
+
return response(400, body ?? "Bad request");
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
// src/response/created.ts
|
|
@@ -67,12 +67,12 @@ function created(body) {
|
|
|
67
67
|
|
|
68
68
|
// src/response/forbidden.ts
|
|
69
69
|
function forbidden(body) {
|
|
70
|
-
return response(403, body);
|
|
70
|
+
return response(403, body ?? "Forbidden");
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// src/response/methodNotAllowed.ts
|
|
74
74
|
function methodNotAllowed(body) {
|
|
75
|
-
return response(405, body);
|
|
75
|
+
return response(405, body ?? "Method not allowed");
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
// src/response/transfer.ts
|
|
@@ -92,7 +92,7 @@ function moved(location) {
|
|
|
92
92
|
|
|
93
93
|
// src/response/notFound.ts
|
|
94
94
|
function notFound(body) {
|
|
95
|
-
return response(404, body);
|
|
95
|
+
return response(404, body ?? "Not found");
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
// src/response/notModified.ts
|
|
@@ -117,17 +117,17 @@ function seeOther(location) {
|
|
|
117
117
|
|
|
118
118
|
// src/response/serverError.ts
|
|
119
119
|
function serverError(body) {
|
|
120
|
-
return response(500, body);
|
|
120
|
+
return response(500, body ?? "Server error");
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
// src/response/unauthorized.ts
|
|
124
124
|
function unauthorized(body) {
|
|
125
|
-
return response(401, body);
|
|
125
|
+
return response(401, body ?? "Unauthorized");
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
// src/response/unprocessable.ts
|
|
129
129
|
function unprocessable(body) {
|
|
130
|
-
return response(422, body);
|
|
130
|
+
return response(422, body ?? "Unprocessable");
|
|
131
131
|
}
|
|
132
132
|
// Annotate the CommonJS export names for ESM import in node:
|
|
133
133
|
0 && (module.exports = {
|