primate 0.32.7 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/lib/app.tsconfig.json +55 -0
  2. package/lib/bin.d.ts +3 -0
  3. package/{src → lib}/bin.js +1 -0
  4. package/lib/commands/build.d.ts +4 -0
  5. package/lib/commands/build.js +9 -0
  6. package/lib/commands/dev.d.ts +3 -0
  7. package/lib/commands/dev.js +8 -0
  8. package/lib/commands/index.d.ts +3 -0
  9. package/lib/commands/index.js +13 -0
  10. package/lib/commands/init.d.ts +2 -0
  11. package/lib/commands/init.js +348 -0
  12. package/lib/commands/serve.d.ts +3 -0
  13. package/lib/commands/serve.js +13 -0
  14. package/lib/commands/test.d.ts +3 -0
  15. package/lib/commands/test.js +133 -0
  16. package/lib/init.d.ts +3 -0
  17. package/lib/init.js +12 -0
  18. package/lib/private/test.d.ts +32 -0
  19. package/lib/private/test.js +8 -0
  20. package/lib/public/Loader.d.ts +2 -0
  21. package/lib/public/Loader.js +2 -0
  22. package/lib/public/Module.d.ts +2 -0
  23. package/lib/public/Module.js +2 -0
  24. package/lib/public/RequestFacade.d.ts +2 -0
  25. package/lib/public/RequestFacade.js +2 -0
  26. package/lib/public/client/app.d.ts +4 -0
  27. package/lib/public/client/app.js +3 -0
  28. package/lib/public/config/i18n.d.ts +2 -0
  29. package/lib/public/config/i18n.js +2 -0
  30. package/lib/public/config/session.d.ts +2 -0
  31. package/lib/public/config/session.js +2 -0
  32. package/lib/public/config.d.ts +2 -0
  33. package/lib/public/config.js +2 -0
  34. package/lib/public/database/default.d.ts +2 -0
  35. package/lib/public/database/default.js +2 -0
  36. package/lib/public/database/wrap.d.ts +2 -0
  37. package/lib/public/database/wrap.js +2 -0
  38. package/lib/public/i18n/locale.d.ts +2 -0
  39. package/lib/public/i18n/locale.js +2 -0
  40. package/lib/public/load-text.d.ts +4 -0
  41. package/lib/public/load-text.js +3 -0
  42. package/lib/public/request/Facade.d.ts +2 -0
  43. package/lib/public/request/Facade.js +2 -0
  44. package/lib/public/response/Status.d.ts +2 -0
  45. package/lib/public/response/Status.js +2 -0
  46. package/lib/public/response/binary.d.ts +2 -0
  47. package/lib/public/response/binary.js +2 -0
  48. package/lib/public/response/error.d.ts +2 -0
  49. package/lib/public/response/error.js +2 -0
  50. package/lib/public/response/json.d.ts +2 -0
  51. package/lib/public/response/json.js +2 -0
  52. package/lib/public/response/redirect.d.ts +2 -0
  53. package/lib/public/response/redirect.js +2 -0
  54. package/lib/public/response/sse.d.ts +2 -0
  55. package/lib/public/response/sse.js +2 -0
  56. package/lib/public/response/text.d.ts +2 -0
  57. package/lib/public/response/text.js +2 -0
  58. package/lib/public/response/view.d.ts +2 -0
  59. package/lib/public/response/view.js +2 -0
  60. package/lib/public/response/ws.d.ts +2 -0
  61. package/lib/public/response/ws.js +2 -0
  62. package/lib/public/response.d.ts +22 -0
  63. package/lib/public/response.js +19 -0
  64. package/lib/public/route.d.ts +3 -0
  65. package/lib/public/route.js +3 -0
  66. package/lib/public/router.d.ts +2 -0
  67. package/lib/public/router.js +2 -0
  68. package/lib/public/s/config.d.ts +2 -0
  69. package/lib/public/s/config.js +2 -0
  70. package/lib/public/s/internal.d.ts +2 -0
  71. package/lib/public/s/internal.js +2 -0
  72. package/lib/public/serve.d.ts +2 -0
  73. package/{src → lib}/public/serve.js +1 -0
  74. package/lib/public/session/Manager.d.ts +2 -0
  75. package/lib/public/session/Manager.js +2 -0
  76. package/lib/public/store.d.ts +4 -0
  77. package/lib/public/store.js +3 -0
  78. package/lib/public/symbol/config.d.ts +2 -0
  79. package/lib/public/symbol/config.js +2 -0
  80. package/lib/public/test.d.ts +2 -0
  81. package/lib/public/test.js +2 -0
  82. package/lib/public/wasm/instantiate.d.ts +2 -0
  83. package/lib/public/wasm/instantiate.js +2 -0
  84. package/lib/runtime/FileRef.d.ts +2 -0
  85. package/lib/runtime/FileRef.js +2 -0
  86. package/package.json +47 -23
  87. package/src/commands/build.js +0 -4
  88. package/src/commands/dev.js +0 -8
  89. package/src/commands/exports.js +0 -5
  90. package/src/commands/serve.js +0 -8
  91. package/src/handlers/error.js +0 -1
  92. package/src/handlers/json.js +0 -1
  93. package/src/handlers/redirect.js +0 -1
  94. package/src/handlers/sse.js +0 -1
  95. package/src/handlers/stream.js +0 -1
  96. package/src/handlers/text.js +0 -1
  97. package/src/handlers/view.js +0 -1
  98. package/src/handlers/ws.js +0 -1
  99. package/src/init.js +0 -12
  100. package/src/public/load-text.js +0 -3
  101. package/src/public/loader.js +0 -30
  102. package/src/public/serve-asset.js +0 -9
  103. package/src/runtime/file.js +0 -3
  104. package/types/index.d.ts +0 -89
@@ -0,0 +1,8 @@
1
+ import verbs from "@primate/core/request/verbs";
2
+ export const tests = [];
3
+ export default {
4
+ ...Object.fromEntries(verbs.map(verb => [verb, (route, tester) => {
5
+ tests.push({ route, tester, verb });
6
+ }])),
7
+ };
8
+ //# sourceMappingURL=test.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/Loader";
2
+ //# sourceMappingURL=Loader.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/Loader";
2
+ //# sourceMappingURL=Loader.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/Module";
2
+ //# sourceMappingURL=Module.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/Module";
2
+ //# sourceMappingURL=Module.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/request/RequestFacade";
2
+ //# sourceMappingURL=RequestFacade.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RequestFacade.js.map
@@ -0,0 +1,4 @@
1
+ import App from "@primate/core/client/App";
2
+ declare const _default: App;
3
+ export default _default;
4
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1,3 @@
1
+ import App from "@primate/core/client/App";
2
+ export default new App();
3
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/i18n/config";
2
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/i18n/config";
2
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/session/config";
2
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/session/config";
2
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/config";
2
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/config";
2
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/database/InMemoryDatabase";
2
+ //# sourceMappingURL=default.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/database/InMemoryDatabase";
2
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/database/wrap";
2
+ //# sourceMappingURL=wrap.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/database/wrap";
2
+ //# sourceMappingURL=wrap.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/i18n/locale";
2
+ //# sourceMappingURL=locale.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/i18n/locale";
2
+ //# sourceMappingURL=locale.js.map
@@ -0,0 +1,4 @@
1
+ import type Path from "@rcompat/fs/Path";
2
+ declare const _default: (path: Path, ...paths: Path[]) => Promise<string>;
3
+ export default _default;
4
+ //# sourceMappingURL=load-text.d.ts.map
@@ -0,0 +1,3 @@
1
+ import FileRef from "@rcompat/fs/FileRef";
2
+ export default (path, ...paths) => FileRef.join(path, ...paths).text();
3
+ //# sourceMappingURL=load-text.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/request/RequestFacade";
2
+ //# sourceMappingURL=Facade.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Facade.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@rcompat/http/Status";
2
+ //# sourceMappingURL=Status.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@rcompat/http/Status";
2
+ //# sourceMappingURL=Status.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/binary";
2
+ //# sourceMappingURL=binary.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/binary";
2
+ //# sourceMappingURL=binary.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/error";
2
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/error";
2
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/json";
2
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/json";
2
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/redirect";
2
+ //# sourceMappingURL=redirect.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/redirect";
2
+ //# sourceMappingURL=redirect.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/sse";
2
+ //# sourceMappingURL=sse.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/sse";
2
+ //# sourceMappingURL=sse.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/text";
2
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/text";
2
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/view";
2
+ //# sourceMappingURL=view.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/view";
2
+ //# sourceMappingURL=view.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/ws";
2
+ //# sourceMappingURL=ws.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/response/ws";
2
+ //# sourceMappingURL=ws.js.map
@@ -0,0 +1,22 @@
1
+ import binary from "@primate/core/response/binary";
2
+ import error from "@primate/core/response/error";
3
+ export type { default as ViewResponse } from "@primate/core/frontend/ViewResponse";
4
+ export type { default as ResponseFunction } from "@primate/core/response/ResponseFunction";
5
+ export type { default as ServeApp } from "@primate/core/ServeApp";
6
+ declare const _default: {
7
+ binary: typeof binary;
8
+ error: typeof error;
9
+ json: (body: unknown, init?: ResponseInit) => (app: import("@primate/core/ServeApp").default) => import("@rcompat/type/MaybePromise").default<Response>;
10
+ redirect: (location: string, status?: 302 | 301 | 300 | 304 | 308 | 303 | 307) => import("@primate/core/response/ResponseFunction").default;
11
+ sse: (body: {
12
+ close?(): undefined;
13
+ open(events: {
14
+ send(name: string, data: unknown): undefined;
15
+ }): undefined;
16
+ }, init?: ResponseInit) => (app: import("@primate/core/ServeApp").default) => import("@rcompat/type/MaybePromise").default<Response>;
17
+ text: (body: string, init?: ResponseInit) => (app: import("@primate/core/ServeApp").default) => import("@rcompat/type/MaybePromise").default<Response>;
18
+ view: import("@primate/core/frontend/ViewResponse").default;
19
+ ws: (actions: import("@rcompat/http/Actions").default) => import("@primate/core/response/ResponseFunction").default;
20
+ };
21
+ export default _default;
22
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1,19 @@
1
+ import binary from "@primate/core/response/binary";
2
+ import error from "@primate/core/response/error";
3
+ import json from "@primate/core/response/json";
4
+ import redirect from "@primate/core/response/redirect";
5
+ import sse from "@primate/core/response/sse";
6
+ import text from "@primate/core/response/text";
7
+ import view from "@primate/core/response/view";
8
+ import ws from "@primate/core/response/ws";
9
+ export default {
10
+ binary,
11
+ error,
12
+ json,
13
+ redirect,
14
+ sse,
15
+ text,
16
+ view,
17
+ ws,
18
+ };
19
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1,3 @@
1
+ import route from "@primate/core/route";
2
+ export default route;
3
+ //# sourceMappingURL=route.d.ts.map
@@ -0,0 +1,3 @@
1
+ import route from "@primate/core/route";
2
+ export default route;
3
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/route/router";
2
+ //# sourceMappingURL=router.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/route/router";
2
+ //# sourceMappingURL=router.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/symbol/config";
2
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/symbol/config";
2
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/i18n/sInternal";
2
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/i18n/sInternal";
2
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/serve";
2
+ //# sourceMappingURL=serve.d.ts.map
@@ -1 +1,2 @@
1
1
  export { default } from "@primate/core/serve";
2
+ //# sourceMappingURL=serve.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/session/Manager";
2
+ //# sourceMappingURL=Manager.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/session/Manager";
2
+ //# sourceMappingURL=Manager.js.map
@@ -0,0 +1,4 @@
1
+ import Store from "@primate/core/database/Store";
2
+ declare const _default: typeof Store.new;
3
+ export default _default;
4
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1,3 @@
1
+ import Store from "@primate/core/database/Store";
2
+ export default Store.new;
3
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/symbol/config";
2
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/symbol/config";
2
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "#test";
2
+ //# sourceMappingURL=test.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "#test";
2
+ //# sourceMappingURL=test.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/wasm/instantiate";
2
+ //# sourceMappingURL=instantiate.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "@primate/core/wasm/instantiate";
2
+ //# sourceMappingURL=instantiate.js.map
@@ -0,0 +1,2 @@
1
+ export { default } from "#runtime/FileRef";
2
+ //# sourceMappingURL=FileRef.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { default } from "#runtime/FileRef";
2
+ //# sourceMappingURL=FileRef.js.map
package/package.json CHANGED
@@ -1,41 +1,65 @@
1
1
  {
2
2
  "name": "primate",
3
- "version": "0.32.7",
4
- "description": "Polymorphic development platform",
5
- "homepage": "https://primatejs.com",
6
- "bugs": "https://github.com/primatejs/primate/issues",
3
+ "version": "0.33.0",
4
+ "description": "The universal web framework",
5
+ "homepage": "https://primate.run",
6
+ "bugs": "https://github.com/primate-run/primate/issues",
7
7
  "license": "MIT",
8
8
  "files": [
9
- "src/**/*.js",
10
- "!src/**/*.spec.js",
11
- "types/*.ts"
9
+ "/lib/app.tsconfig.json",
10
+ "/lib/**/*.js",
11
+ "/lib/**/*.d.ts",
12
+ "!/**/*.spec.*"
12
13
  ],
13
- "bin": "src/bin.js",
14
+ "bin": "lib/bin.js",
14
15
  "repository": {
15
16
  "type": "git",
16
- "url": "https://github.com/primatejs/primate",
17
+ "url": "https://github.com/primate-run/primate",
17
18
  "directory": "packages/primate"
18
19
  },
20
+ "devDependencies": {
21
+ "@rcompat/record": "^0.9.1",
22
+ "pema": "^0.2.0"
23
+ },
19
24
  "dependencies": {
20
- "@rcompat/args": "^0.3.0",
21
- "@rcompat/async": "^0.3.0",
22
- "@rcompat/cli": "^0.5.1",
23
- "@rcompat/fs": "^0.7.0",
24
- "@rcompat/http": "0.6",
25
- "@rcompat/package": "^0.8.0",
26
- "@primate/core": "^0.1.9"
25
+ "@rcompat/args": "^0.8.0",
26
+ "@rcompat/cli": "^0.11.3",
27
+ "@rcompat/fs": "^0.21.1",
28
+ "@rcompat/http": "~0.15.1",
29
+ "@rcompat/package": "^0.22.0",
30
+ "@rcompat/runtime": "^0.6.0",
31
+ "@rcompat/string": "^0.10.0",
32
+ "@primate/core": "^0.2.0"
27
33
  },
28
34
  "engines": {
29
- "node": ">=18"
35
+ "node": ">=20"
30
36
  },
31
37
  "type": "module",
32
- "types": "types/index.d.ts",
38
+ "imports": {
39
+ "#*": {
40
+ "apekit": "./src/private/*.ts",
41
+ "default": "./lib/private/*.js"
42
+ },
43
+ "#runtime/FileRef": "@rcompat/fs/FileRef"
44
+ },
33
45
  "exports": {
34
- "./handler/*": {
35
- "types": "./types/index.d.ts",
36
- "default": "./src/handlers/*.js"
46
+ "./tsconfig": "./lib/app.tsconfig.json",
47
+ "./runtime/*": {
48
+ "apekit": "./src/runtime/*.ts",
49
+ "default": "./lib/runtime/*.js"
37
50
  },
38
- "./*": "./src/public/*.js",
39
- "./runtime/*": "./src/runtime/*.js"
51
+ "./http/*": {
52
+ "apekit": "./src/public/http/*.ts",
53
+ "default": "./lib/public/http/*.js"
54
+ },
55
+ "./*": {
56
+ "apekit": "./src/public/*.ts",
57
+ "default": "./lib/public/*.js"
58
+ }
59
+ },
60
+ "scripts": {
61
+ "build": "npm run clean && tsc && cp src/app.tsconfig.json lib",
62
+ "clean": "rm -rf ./lib",
63
+ "lint": "eslint ."
40
64
  }
41
65
  }
@@ -1,4 +0,0 @@
1
- import build from "@primate/core/build";
2
-
3
- // build for production
4
- export default (target = "web", mode = "production") => build(mode, target);
@@ -1,8 +0,0 @@
1
- import build from "./build.js";
2
- import serve from "./serve.js";
3
-
4
- // build for development and serve
5
- export default async () => {
6
- // will only serve is build is successful
7
- await build("web", "development") === true && serve();
8
- };
@@ -1,5 +0,0 @@
1
- import { default as build } from "./build.js";
2
- import { default as dev } from "./dev.js";
3
- import { default as serve } from "./serve.js";
4
-
5
- export default name => ({ build, dev, serve })[name] ?? dev;
@@ -1,8 +0,0 @@
1
- import root from "@rcompat/package/root";
2
- import tryreturn from "@rcompat/async/tryreturn";
3
- import resolve from "@rcompat/fs/resolve";
4
-
5
- // serve from build directory
6
- export default async (from = "build") =>
7
- (await tryreturn(_ => root()).orelse(_ => resolve()))
8
- .join(`./${from}/serve.js`).import();
@@ -1 +0,0 @@
1
- export { default } from "@primate/core/handler/error";
@@ -1 +0,0 @@
1
- export { default } from "@primate/core/handler/json";
@@ -1 +0,0 @@
1
- export { default } from "@primate/core/handler/redirect";
@@ -1 +0,0 @@
1
- export { default } from "@primate/core/handler/sse";
@@ -1 +0,0 @@
1
- export { default } from "@primate/core/handler/stream";
@@ -1 +0,0 @@
1
- export { default } from "@primate/core/handler/text";
@@ -1 +0,0 @@
1
- export { default } from "@primate/core/handler/view";
@@ -1 +0,0 @@
1
- export { default } from "@primate/core/handler/ws";
package/src/init.js DELETED
@@ -1,12 +0,0 @@
1
- import blue from "@rcompat/cli/color/blue";
2
- import bold from "@rcompat/cli/color/bold";
3
- import print from "@rcompat/cli/print";
4
- import manifest from "@rcompat/package/manifest";
5
- import find from "./commands/exports.js";
6
-
7
- export default async (...args) => {
8
- const [command, ...flags] = args;
9
- const primate = await manifest(import.meta.url);
10
- print(blue(bold(primate.name)), blue(primate.version), "\n");
11
- find(command)(...flags);
12
- };
@@ -1,3 +0,0 @@
1
- import join from "@rcompat/fs/join";
2
-
3
- export default (...parts) => join(...parts).text();
@@ -1,30 +0,0 @@
1
- import serve_asset from "primate/serve-asset";
2
- import file from "@rcompat/fs/file";
3
-
4
- export default ({
5
- pages_app,
6
- pages,
7
- rootfile,
8
- static_root,
9
- }) => {
10
- const buildroot = file(rootfile).join("..");
11
-
12
- return {
13
- page(name) {
14
- return pages[name] ?? pages[pages_app];
15
- },
16
- async asset(pathname) {
17
- const client_file = buildroot.join(`client/${pathname}`);
18
- if (await client_file.isFile()) {
19
- return serve_asset(client_file);
20
- }
21
- if (pathname.startsWith(static_root)) {
22
- const assetname = pathname.slice(static_root.length);
23
- const static_file = buildroot.join(`server/static/${assetname}`);
24
- if (await static_file.isFile()) {
25
- return serve_asset(static_file);
26
- }
27
- }
28
- },
29
- };
30
- };
@@ -1,9 +0,0 @@
1
- import { OK } from "@rcompat/http/status";
2
- import { resolve } from "@rcompat/http/mime";
3
-
4
- export default asset => new Response(asset.stream(), {
5
- status: OK,
6
- headers: {
7
- "Content-Type": resolve(asset.name),
8
- },
9
- });
@@ -1,3 +0,0 @@
1
- import join from "@rcompat/fs/join";
2
-
3
- export default (...parts) => join(...parts);