@mapl/web 0.3.1 → 0.3.2

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/README.md CHANGED
@@ -32,11 +32,13 @@ export default {
32
32
  ## AOT compilation (experimental)
33
33
  Build `@mapl/web` to improve startup time.
34
34
 
35
- Setup:
35
+ ### Rolldown
36
+ Dependencies: `rolldown`, `@rollup/plugin-terser`.
36
37
  ```ts
37
38
  // main.ts
38
39
  import { handle, layer, router } from '@mapl/web';
39
40
 
41
+ // Main app
40
42
  export default router(
41
43
  [
42
44
  layer.tap((c) => {
@@ -53,6 +55,9 @@ export default router(
53
55
  },
54
56
  );
55
57
 
58
+ // Additional options
59
+ export const serveOptions = {};
60
+
56
61
  // build.ts
57
62
  import terser from '@rollup/plugin-terser';
58
63
  import build from '@mapl/web/build/rolldown';
@@ -66,7 +71,7 @@ build({
66
71
  plugins: [
67
72
  terser({
68
73
  compress: {
69
- // passes should be >= 2, recommend 3
74
+ // passes should be >= 2
70
75
  passes: 3,
71
76
  },
72
77
  mangle: false,
@@ -1,12 +1,30 @@
1
1
  import { type BuildOptions, type OutputOptions } from "rolldown";
2
2
  export interface MaplBuildOptions {
3
+ /**
4
+ * App entry point
5
+ */
3
6
  input: string;
7
+ /**
8
+ * Output options
9
+ */
4
10
  output: Omit<OutputOptions, "dir"> & {
5
11
  file: string
6
12
  };
13
+ /**
14
+ * App build options
15
+ */
7
16
  buildOptions?: Omit<BuildOptions, "input" | "output">;
17
+ /**
18
+ * App output build options
19
+ */
8
20
  finalizeOptions?: Omit<BuildOptions, "input" | "output">;
21
+ /**
22
+ * Whether to emit asynchronous output
23
+ */
9
24
  asynchronous?: boolean;
25
+ /**
26
+ * Build target
27
+ */
10
28
  target?: "bun";
11
29
  }
12
30
  declare const _default: (opts: MaplBuildOptions) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapl/web",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "A compiled web framework for all runtimes",
5
5
  "keywords": ["fast", "lightweight", "cross-runtime", "framework", "web", "backend"],
6
6
  "repository": {
@@ -17,25 +17,22 @@
17
17
  "@safe-std/error": "^1.0.1",
18
18
  "runtime-compiler": "^1.2.5"
19
19
  },
20
- "optionalDependencies": {
21
- "secure-headers": "^0.0.6"
22
- },
23
20
  "exports": {
24
21
  "./constants": "./constants.js",
25
- "./core": "./core/index.js",
26
- ".": "./index.js",
27
- "./core/context": "./core/context.js",
28
- "./core/handler": "./core/handler.js",
29
- "./core/middleware": "./core/middleware.js",
30
- "./core/utils": "./core/utils.js",
31
22
  "./utils/static-headers": "./utils/static-headers.js",
32
- "./utils/secure-headers": "./utils/secure-headers.js",
33
- "./utils/cors": "./utils/cors.js",
34
- "./build/rolldown": "./build/rolldown.js",
23
+ ".": "./index.js",
35
24
  "./compiler/jit": "./compiler/jit.js",
25
+ "./build/rolldown": "./build/rolldown.js",
26
+ "./utils/cors": "./utils/cors.js",
36
27
  "./compiler/aot": "./compiler/aot.js",
37
- "./compiler/bun/jit": "./compiler/bun/jit.js",
28
+ "./utils/secure-headers": "./utils/secure-headers.js",
29
+ "./core": "./core/index.js",
30
+ "./core/context": "./core/context.js",
38
31
  "./compiler/bun/router": "./compiler/bun/router.js",
39
- "./compiler/bun/aot": "./compiler/bun/aot.js"
32
+ "./core/middleware": "./core/middleware.js",
33
+ "./core/handler": "./core/handler.js",
34
+ "./core/utils": "./core/utils.js",
35
+ "./compiler/bun/aot": "./compiler/bun/aot.js",
36
+ "./compiler/bun/jit": "./compiler/bun/jit.js"
40
37
  }
41
38
  }