@k8ordo/framework 2.3.1 → 4.0.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 (65) hide show
  1. package/README.md +28 -13
  2. package/dist/cli.mjs +3 -3
  3. package/dist/generated.d.mts +13 -13
  4. package/dist/headers-BxB_jJVk.mjs +73 -0
  5. package/dist/index.d.mts +3 -2
  6. package/dist/index.mjs +1 -1
  7. package/dist/paths-type-DXpmjaOr.d.mts +43 -0
  8. package/dist/runtime/app-router.mjs +21 -8
  9. package/dist/runtime/browser-payloads.mjs +1 -1
  10. package/dist/runtime/client-files.d.mts +6 -5
  11. package/dist/runtime/client-files.mjs +17 -9
  12. package/dist/runtime/client-ready.d.mts +7 -1
  13. package/dist/runtime/client-ready.mjs +2 -1
  14. package/dist/runtime/cookies.d.mts +2 -0
  15. package/dist/runtime/cookies.mjs +2 -1
  16. package/dist/runtime/ended.d.mts +7 -0
  17. package/dist/runtime/ended.mjs +14 -0
  18. package/dist/runtime/entry.browser.mjs +1 -1
  19. package/dist/runtime/entry.rsc.d.mts +38 -2
  20. package/dist/runtime/entry.rsc.mjs +97 -31
  21. package/dist/runtime/entry.ssr.d.mts +7 -1
  22. package/dist/runtime/entry.ssr.mjs +12 -6
  23. package/dist/runtime/guard.d.mts +15 -10
  24. package/dist/runtime/guard.mjs +8 -2
  25. package/dist/runtime/mount.mjs +1 -1
  26. package/dist/runtime/page-boundary.mjs +2 -2
  27. package/dist/runtime/params.d.mts +5 -4
  28. package/dist/runtime/params.mjs +2 -2
  29. package/dist/runtime/payload.d.mts +19 -4
  30. package/dist/runtime/payload.mjs +20 -5
  31. package/dist/runtime/prefetch.d.mts +29 -8
  32. package/dist/runtime/prefetch.mjs +95 -24
  33. package/dist/runtime/redirect.d.mts +13 -7
  34. package/dist/runtime/redirect.mjs +25 -9
  35. package/dist/runtime/request-scope.d.mts +37 -2
  36. package/dist/runtime/request-scope.mjs +60 -3
  37. package/dist/runtime/request.d.mts +6 -1
  38. package/dist/runtime/request.mjs +7 -2
  39. package/dist/runtime/route.d.mts +4 -2
  40. package/dist/runtime/route.mjs +13 -5
  41. package/dist/runtime/server.d.mts +5 -5
  42. package/dist/runtime/server.mjs +2 -2
  43. package/dist/runtime/shell.d.mts +2 -1
  44. package/dist/serve.d.mts +4 -0
  45. package/dist/serve.mjs +29 -14
  46. package/dist/static-Be3xIqd8.d.mts +62 -0
  47. package/dist/{static-file-BAjwBMMl.mjs → static-file-BS-WEiwu.mjs} +311 -134
  48. package/dist/{static-host-B-1fAfAw.mjs → static-host-tIDLqV8c.mjs} +1 -1
  49. package/dist/vercel.d.mts +18 -1
  50. package/dist/vercel.mjs +131 -19
  51. package/dist/vite.d.mts +6 -3
  52. package/dist/vite.mjs +366 -156
  53. package/docs/GUIDE.md +173 -46
  54. package/docs/llms.txt +129 -65
  55. package/docs/references/actions.md +14 -5
  56. package/docs/references/boundaries.md +23 -2
  57. package/docs/references/csp.md +91 -2
  58. package/docs/references/deploy.md +154 -25
  59. package/docs/references/errors.md +57 -12
  60. package/docs/references/guards.md +100 -29
  61. package/docs/references/params.md +234 -126
  62. package/docs/references/routing.md +358 -75
  63. package/package.json +18 -13
  64. package/dist/shared-dir-CNXFRZgP.mjs +0 -9
  65. package/dist/static-DnbgGIoy.d.mts +0 -61
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k8ordo/framework",
3
- "version": "2.3.1",
3
+ "version": "4.0.0",
4
4
  "description": "The k8ordo framework: routes/ compiled into React Server Components, run with or without a server.",
5
5
  "keywords": [
6
6
  "k8ordo",
@@ -64,41 +64,46 @@
64
64
  "registry": "https://registry.npmjs.org"
65
65
  },
66
66
  "dependencies": {
67
- "@vitejs/plugin-react": "6.1.2",
68
- "@vitejs/plugin-rsc": "0.5.38",
67
+ "@vitejs/plugin-react": "6.3.0",
68
+ "@vitejs/plugin-rsc": "0.5.39",
69
+ "baseline-browser-mapping": "2.11.39",
69
70
  "compressible": "2.0.18",
70
71
  "fresh": "2.0.0",
71
72
  "mime-types": "3.0.2",
72
73
  "negotiator": "1.1.0",
73
- "range-parser": "1.3.0",
74
+ "range-parser": "2.0.0",
74
75
  "rsc-html-stream": "0.0.8"
75
76
  },
76
77
  "devDependencies": {
77
78
  "@arethetypeswrong/cli": "0.18.5",
78
- "@k8ordo/framework-engine": "^0.1.2",
79
- "@k8ordo/router": "^2.3.1",
79
+ "@k8ordo/framework-engine": "^0.1.4",
80
+ "@k8ordo/router": "^4.0.0",
80
81
  "@types/compressible": "2.0.3",
81
82
  "@types/fresh": "0.5.3",
82
83
  "@types/mime-types": "3.0.1",
83
- "@types/range-parser": "1.2.7",
84
84
  "@types/react": "19.3.0",
85
- "oxc-transform-react": "0.152.0",
85
+ "@vercel/functions": "3.11.3",
86
+ "oxc-transform-react": "0.156.0",
86
87
  "publint": "0.3.25",
87
88
  "react": "19.3.1",
88
89
  "react-dom": "19.3.1",
89
90
  "typescript": "7.0.2",
90
- "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
91
- "vite-plus": "1.4.0",
92
- "vitest": "5.0.5"
91
+ "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8000",
92
+ "vite-plus": "1.7.0",
93
+ "vitest": "5.1.1"
93
94
  },
94
95
  "peerDependencies": {
95
- "@k8ordo/router": "^2.3.1",
96
- "oxc-transform-react": "^0.152.0",
96
+ "@k8ordo/router": "^4.0.0",
97
+ "@vercel/functions": "^3.0.0",
98
+ "oxc-transform-react": ">=0.152.0 <0.157.0",
97
99
  "react": ">=19.3.0",
98
100
  "react-dom": ">=19.3.0",
99
101
  "vite": ">=8.1.0"
100
102
  },
101
103
  "peerDependenciesMeta": {
104
+ "@vercel/functions": {
105
+ "optional": true
106
+ },
102
107
  "oxc-transform-react": {
103
108
  "optional": true
104
109
  }
@@ -1,9 +0,0 @@
1
- import path from "node:path";
2
- // ../framework-engine/dist/plugin/shared-dir.mjs
3
- /** The deepest directory holding both `a` and `b`. */
4
- const sharedDir = (a, b) => {
5
- let dir = a;
6
- while (path.relative(dir, b).startsWith("..")) dir = path.dirname(dir);
7
- return dir;
8
- };
9
- export { sharedDir as t };
@@ -1,61 +0,0 @@
1
- import { Plugin, PluginOption } from "vite";
2
- import "react";
3
- /** What `framework()` takes whatever the mode. */
4
- type EngineOptions = {
5
- /** Where the route files live, relative to the project root. */
6
- readonly routesDir?: string;
7
- /**
8
- * Compiles the client components with React Compiler — the Rust one,
9
- * through `@vitejs/plugin-react`'s `compiler`, which needs
10
- * `oxc-transform-react` installed. Server components are left as they are.
11
- */
12
- readonly reactCompiler?: boolean;
13
- };
14
- /**
15
- * The `Content-Security-Policy` an application wants on every page, as
16
- * directives and their sources. The build writes it into each page's
17
- * `<meta>`, with the hashes of that page's signed inline scripts added.
18
- */
19
- type ContentSecurityPolicy = Readonly<Record<string, readonly string[]>>;
20
- type StaticOptions = EngineOptions & {
21
- /**
22
- * Every route rendered at build time and written to files; no server at
23
- * run time, so nothing that answers a request (Server Actions, guards, the
24
- * request API) builds.
25
- */
26
- readonly mode: 'static';
27
- /**
28
- * Pathnames for routes with parameters, in the table's terms — without
29
- * Vite's `base`. Static rendering cannot invent them, and a build that
30
- * quietly skipped half the site would be worse than one that refuses.
31
- *
32
- * The patterns that need covering are handed in, so a site whose parameter
33
- * takes the same values everywhere — a locale segment, say — expands them
34
- * rather than listing every page twice.
35
- *
36
- * For a page with a `fallback.tsx` beside it, a pathname that still holds
37
- * a parameter (`/ja/posts/:id`) is where its shell stands: the values the
38
- * build did not write are answered there. Without one, the bare pattern
39
- * is the shell's location.
40
- */
41
- readonly paths?: (patterns: readonly string[]) => readonly string[] | Promise<readonly string[]>;
42
- /**
43
- * The origin the site is served from — `https://example.com`. With it the
44
- * build also writes `sitemap.xml`, listing every page it rendered at its
45
- * URL, Vite's `base` included; without it, no sitemap, because a sitemap of
46
- * relative URLs is not one. A `route.ts` that writes `sitemap.xml` as well
47
- * stops the build, naming both: keep one of them.
48
- */
49
- readonly site?: string;
50
- /**
51
- * The `Content-Security-Policy` every page carries, as directives and
52
- * their sources. The framework decides no policy: it writes this one into
53
- * each page's `<meta>`, adding to `script-src` the hashes of its own inline
54
- * scripts on that page — the payload and React's. An inline script of the
55
- * application's is allowed by its hash here, as
56
- * `colorSchemeScriptHash()` gives `@k8ordo/color-scheme`'s. Without it, no
57
- * policy is written.
58
- */
59
- readonly csp?: ContentSecurityPolicy;
60
- };
61
- export { ContentSecurityPolicy as n, EngineOptions as r, StaticOptions as t };