@nifrajs/web 2.0.0 → 2.2.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 (102) hide show
  1. package/dist/build-vite.d.ts +68 -0
  2. package/dist/build-vite.d.ts.map +1 -0
  3. package/dist/build-vite.js +487 -0
  4. package/dist/build-vite.js.map +1 -0
  5. package/dist/build.d.ts +112 -25
  6. package/dist/build.d.ts.map +1 -1
  7. package/dist/build.js +283 -64
  8. package/dist/build.js.map +1 -1
  9. package/dist/bun-dev-entry.d.ts +83 -0
  10. package/dist/bun-dev-entry.d.ts.map +1 -0
  11. package/dist/bun-dev-entry.js +136 -0
  12. package/dist/bun-dev-entry.js.map +1 -0
  13. package/dist/client.d.ts.map +1 -1
  14. package/dist/client.js +10 -0
  15. package/dist/client.js.map +1 -1
  16. package/dist/deferred.d.ts +3 -2
  17. package/dist/deferred.d.ts.map +1 -1
  18. package/dist/deferred.js +11 -8
  19. package/dist/deferred.js.map +1 -1
  20. package/dist/dev-port.d.ts +36 -0
  21. package/dist/dev-port.d.ts.map +1 -0
  22. package/dist/dev-port.js +48 -0
  23. package/dist/dev-port.js.map +1 -0
  24. package/dist/dev.d.ts +61 -4
  25. package/dist/dev.d.ts.map +1 -1
  26. package/dist/dev.js +419 -60
  27. package/dist/dev.js.map +1 -1
  28. package/dist/draft.d.ts +37 -0
  29. package/dist/draft.d.ts.map +1 -1
  30. package/dist/draft.js +87 -4
  31. package/dist/draft.js.map +1 -1
  32. package/dist/fs.d.ts +14 -1
  33. package/dist/fs.d.ts.map +1 -1
  34. package/dist/fs.js +7 -1
  35. package/dist/fs.js.map +1 -1
  36. package/dist/index.d.ts +116 -5
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +565 -53
  39. package/dist/index.js.map +1 -1
  40. package/dist/internal/timing-safe-equal.d.ts +16 -0
  41. package/dist/internal/timing-safe-equal.d.ts.map +1 -0
  42. package/dist/internal/timing-safe-equal.js +26 -0
  43. package/dist/internal/timing-safe-equal.js.map +1 -0
  44. package/dist/isr.d.ts.map +1 -1
  45. package/dist/isr.js +1 -14
  46. package/dist/isr.js.map +1 -1
  47. package/dist/llms-txt.d.ts.map +1 -1
  48. package/dist/llms-txt.js +12 -6
  49. package/dist/llms-txt.js.map +1 -1
  50. package/dist/manifest.d.ts +51 -8
  51. package/dist/manifest.d.ts.map +1 -1
  52. package/dist/manifest.js +130 -14
  53. package/dist/manifest.js.map +1 -1
  54. package/dist/module-graph.d.ts +91 -0
  55. package/dist/module-graph.d.ts.map +1 -0
  56. package/dist/module-graph.js +92 -0
  57. package/dist/module-graph.js.map +1 -0
  58. package/dist/plugins/css-modules.d.ts.map +1 -1
  59. package/dist/plugins/css-modules.js +0 -0
  60. package/dist/plugins/css-modules.js.map +1 -1
  61. package/dist/plugins/vite-leak-guard.d.ts +45 -0
  62. package/dist/plugins/vite-leak-guard.d.ts.map +1 -0
  63. package/dist/plugins/vite-leak-guard.js +67 -0
  64. package/dist/plugins/vite-leak-guard.js.map +1 -0
  65. package/dist/public-dir.d.ts +36 -0
  66. package/dist/public-dir.d.ts.map +1 -0
  67. package/dist/public-dir.js +89 -0
  68. package/dist/public-dir.js.map +1 -0
  69. package/dist/route-manifest.d.ts +91 -0
  70. package/dist/route-manifest.d.ts.map +1 -0
  71. package/dist/route-manifest.js +128 -0
  72. package/dist/route-manifest.js.map +1 -0
  73. package/dist/router.d.ts +64 -1
  74. package/dist/router.d.ts.map +1 -1
  75. package/dist/router.js +114 -31
  76. package/dist/router.js.map +1 -1
  77. package/dist/vite.d.ts +10 -4
  78. package/dist/vite.d.ts.map +1 -1
  79. package/dist/vite.js +44 -12
  80. package/dist/vite.js.map +1 -1
  81. package/package.json +17 -2
  82. package/src/build-vite.ts +606 -0
  83. package/src/build.ts +432 -73
  84. package/src/bun-dev-entry.ts +184 -0
  85. package/src/client.ts +8 -0
  86. package/src/deferred.ts +13 -6
  87. package/src/dev-port.ts +63 -0
  88. package/src/dev.ts +467 -65
  89. package/src/draft.ts +116 -4
  90. package/src/fs.ts +22 -4
  91. package/src/index.ts +727 -57
  92. package/src/internal/timing-safe-equal.ts +24 -0
  93. package/src/isr.ts +1 -13
  94. package/src/llms-txt.ts +13 -5
  95. package/src/manifest.ts +188 -13
  96. package/src/module-graph.ts +146 -0
  97. package/src/plugins/css-modules.ts +0 -0
  98. package/src/plugins/vite-leak-guard.ts +110 -0
  99. package/src/public-dir.ts +108 -0
  100. package/src/route-manifest.ts +240 -0
  101. package/src/router.ts +198 -34
  102. package/src/vite.ts +62 -20
@@ -0,0 +1,68 @@
1
+ import { type BuildClientOptions, type BuildManifest, type BuildTarget, type BuildTargetOptions, type BuildTargetResult, type Bundler, type ServerBuild } from "./build.js";
2
+ /** Options for {@link buildClientVite} — the Bun {@link BuildClientOptions} minus Bun-plugin specifics,
3
+ * plus the Vite plugin list the app injects for its transforms. */
4
+ export interface BuildClientViteOptions extends Omit<BuildClientOptions, "plugins"> {
5
+ /** Vite plugins for the app's client transforms (e.g. `react()`, `vue()`). */
6
+ readonly vitePlugins?: readonly unknown[];
7
+ /** Vite project root (default: the parent of `routesDir`). Manifest keys are relative to it. */
8
+ readonly root?: string;
9
+ }
10
+ /**
11
+ * Build the client bundle with Vite, emitting the SAME {@link BuildManifest} `buildClient` (Bun) does:
12
+ * a content-hashed entry, per-route chunk lists, aggregate + per-route CSS, and copied `public/` files.
13
+ *
14
+ * The route→chunk and route→CSS mappings come from Vite's own `.vite/manifest.json` (`build.manifest`),
15
+ * which records each entry's emitted `file` and its transitive `css` - exactly the two facts the Bun path
16
+ * reconstructs from Bun's metafile. `viteLeakGuard()` runs during the build, so a client leak fails here
17
+ * with the same error as the Bun build rather than shipping.
18
+ */
19
+ export declare function buildClientVite(options: BuildClientViteOptions): Promise<BuildManifest>;
20
+ /** Options for {@link buildServerVite} — the same surface as `buildServer` minus Bun-plugin specifics. */
21
+ export interface BuildServerViteOptions {
22
+ readonly routesDir: string;
23
+ readonly serverEntry: string;
24
+ readonly outDir: string;
25
+ readonly clientEntry: string;
26
+ readonly styles?: readonly string[] | undefined;
27
+ readonly routeStyles?: Readonly<Record<string, readonly string[]>> | undefined;
28
+ readonly resolve?: (file: string) => string;
29
+ readonly manifestFile?: string;
30
+ readonly vitePlugins?: readonly unknown[];
31
+ readonly conditions?: readonly string[];
32
+ readonly define?: Readonly<Record<string, string>>;
33
+ readonly minify?: boolean;
34
+ /** The runtime the worker targets — mirrors `buildServer`. `browser` = the edge (workerd/edge-light). */
35
+ readonly target?: "browser" | "node" | "bun";
36
+ /** Vite project root (default: the parent of `routesDir`). */
37
+ readonly root?: string;
38
+ }
39
+ /**
40
+ * Build the SSR worker with Vite, emitting the SAME {@link ServerBuild} `buildServer` (Bun) does: a
41
+ * self-contained worker bundle whose path is returned as `worker`.
42
+ *
43
+ * Like `buildServer`, it codegens the statically-analyzable `server-manifest` next to the entry (so no
44
+ * `node:fs` route scan runs on a disk-less edge), then bundles. `ssr.noExternal` bundles the app + adapter
45
+ * + `@nifrajs/*` into ONE file (the self-contained worker), while `node:` builtins stay external on the
46
+ * `node`/`bun` targets that provide them. `NIFRA_SSR_BUNDLED` is defined so the web-react adapter uses the
47
+ * bundled, deduped react-dom rather than re-rooting to a disk copy at runtime - the same tag `buildServer`
48
+ * sets, and the reason a bundled SSR output does not hit the dual-React crash.
49
+ *
50
+ * The client-leak guards are deliberately NOT run here: a server bundle's `node:` imports are legitimate.
51
+ */
52
+ export declare function buildServerVite(options: BuildServerViteOptions): Promise<ServerBuild>;
53
+ /**
54
+ * The Vite build STRATEGY — plugged into `buildTargetWith`. `plugins` arriving through the shared
55
+ * orchestrator are the app's Vite plugins (the escape hatch's whole reason), cast to Vite's plugin type.
56
+ */
57
+ export declare const viteBundler: Bundler;
58
+ /**
59
+ * Build a full deploy dir for `target` using the Vite/Rollup pipeline - the escape hatch for apps that
60
+ * need a Vite-only transform in production. Identical output shape to {@link import("./build.js").buildTarget}
61
+ * (same deploy dir, same server entry, same prerender + size report), because both delegate to the ONE
62
+ * `buildTargetWith` orchestrator; only the two bundling steps differ.
63
+ *
64
+ * Pass the app's Vite plugins via `clientPlugins` / `serverPlugins` (the shared option names) - here they
65
+ * are Vite plugins, not Bun plugins.
66
+ */
67
+ export declare function buildTargetVite(target: BuildTarget, options: BuildTargetOptions): Promise<BuildTargetResult>;
68
+ //# sourceMappingURL=build-vite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-vite.d.ts","sourceRoot":"","sources":["../src/build-vite.ts"],"names":[],"mappings":"AAqBA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EAIZ,KAAK,WAAW,EACjB,MAAM,YAAY,CAAA;AAkInB;mEACmE;AACnE,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC;IACjF,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;IACzC,gGAAgG;IAChG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,aAAa,CAAC,CA+L7F;AAED,0GAA0G;AAC1G,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IAC/C,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAAA;IAC9E,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IAC3C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB,yGAAyG;IACzG,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,KAAK,CAAA;IAC5C,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAmED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,CAwF3F;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,OAwBzB,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAE5B"}
@@ -0,0 +1,487 @@
1
+ /**
2
+ * `@nifrajs/web/build-vite` — the **Vite/Rollup production build**: the escape hatch, not the default.
3
+ *
4
+ * nifra's production default is Bun (`@nifrajs/web/build`), and stays so - it is faster and Bun-native,
5
+ * which is what nifra competes on. This exists for the one case that default cannot serve: an app whose
6
+ * client depends on a Vite-only transform with no Bun equivalent. For those, `buildClientVite` /
7
+ * `buildServerVite` produce the SAME artifacts as the Bun build - the same `BuildManifest`, the same
8
+ * `ServerBuild` - through Vite instead, and `buildTargetVite` assembles the same per-target deploy dir.
9
+ *
10
+ * Crucially this is NOT a second orchestrator. `buildTarget`'s deploy assembly, server-entry codegen,
11
+ * prerender and size report are bundler-agnostic; they live in `build.ts` behind `buildTargetWith`, which
12
+ * takes a {@link Bundler} strategy. This file only supplies the Vite strategy - the two bundling steps -
13
+ * so a change to how a deploy dir is shaped happens in one place for both pipelines.
14
+ *
15
+ * And it does not arrive without the client-leak guards: `buildClientVite` wires `viteLeakGuard()`, so
16
+ * server-only code or a `node:` builtin reaching the browser fails the Vite build with the identical
17
+ * error the Bun build raises. A second production pipeline without those guards is exactly the hole the
18
+ * bundler-neutral module graph was built to close.
19
+ */
20
+ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
21
+ import { dirname, join, relative, resolve as resolvePath } from "node:path";
22
+ import { buildTargetWith, copyPublicDir, publicEnvDefines, } from "./build.js";
23
+ import { discoverRoutes } from "./fs.js";
24
+ import { generateClientEntry, generateServerManifest } from "./index.js";
25
+ import { viteLeakGuard } from "./plugins/vite-leak-guard.js";
26
+ /**
27
+ * Restore V8's `Error.captureStackTrace` contract on a runtime that is stricter than it.
28
+ *
29
+ * `captureStackTrace` is a V8 API, and V8 decorates ANY object handed to it. Some runtimes instead
30
+ * require a real Error - one with the internal slot, which `Object.create(Error.prototype)` and
31
+ * `new SubclassWithErrorPrototype()` do NOT have - and throw "First argument must be an Error object".
32
+ *
33
+ * That breaks importing vite outright. Vite bundles `follow-redirects`, which builds its error types the
34
+ * pre-class way:
35
+ *
36
+ * function CustomError(props) { Error.captureStackTrace(this, this.constructor); … }
37
+ * CustomError.prototype = new (baseClass || Error)()
38
+ *
39
+ * The last line CONSTRUCTS `baseClass` while defining the subclass, so `this` is an object that inherits
40
+ * from Error but was never built by it - and the throw happens at module evaluation, before vite exports
41
+ * anything. Every Vite build then fails with a message about stack traces, naming nothing about vite.
42
+ *
43
+ * Decorating a stack is best-effort by definition, so swallowing the rejection loses nothing: the shim
44
+ * delegates, and only suppresses the refusal. Installed once, and deliberately not restored - the strict
45
+ * behaviour is the deviation, and a library evaluated later would hit the same wall.
46
+ */
47
+ function relaxCaptureStackTrace() {
48
+ const strict = Error.captureStackTrace;
49
+ if (typeof strict !== "function" ||
50
+ Object.prototype.toString.call(new Error()) !== "[object Error]") {
51
+ return;
52
+ }
53
+ // Probe rather than sniff a version: construct exactly what follow-redirects does and see if it is
54
+ // refused. A runtime that already follows V8 keeps its own implementation untouched.
55
+ const inherited = Object.create(Error.prototype);
56
+ try {
57
+ strict.call(Error, inherited);
58
+ return; // permissive already - nothing to fix
59
+ }
60
+ catch {
61
+ // stricter than V8; fall through and wrap
62
+ }
63
+ try {
64
+ Error.captureStackTrace = ((target, constructorOpt) => {
65
+ try {
66
+ ;
67
+ strict.call(Error, target, constructorOpt);
68
+ }
69
+ catch {
70
+ // The runtime refused to decorate this object. A missing `.stack` is not worth failing over.
71
+ }
72
+ });
73
+ }
74
+ catch {
75
+ // The property is frozen or non-writable. Nothing can be done about the import that follows, but
76
+ // failing HERE would replace vite's own error with an assignment error - strictly less informative
77
+ // than letting the import fail and be reported by `loadVite`.
78
+ }
79
+ }
80
+ /** Load the app's Vite. Resolved from `root` so it's the project's copy, not this package's. */
81
+ async function loadVite() {
82
+ relaxCaptureStackTrace();
83
+ try {
84
+ return (await import("vite"));
85
+ }
86
+ catch (cause) {
87
+ // Two different failures arrive here and must not be conflated. `vite` is an OPTIONAL peer, so a
88
+ // project without it fails to RESOLVE - the common case, and the one worth naming. But vite can
89
+ // also resolve and fail while EVALUATING, which is not a missing dependency at all: vite 8 loads
90
+ // rolldown's native binding on import, and a binding that will not load surfaces here too. Telling
91
+ // that user to install what they already installed sends them the wrong way, so only a resolution
92
+ // failure claims a missing package; anything else is reported as what it is.
93
+ const message = cause instanceof Error ? cause.message : String(cause);
94
+ const unresolved = /cannot find (?:package|module)|ERR_MODULE_NOT_FOUND/i.test(message);
95
+ throw new Error(unresolved
96
+ ? "[nifra/web] the Vite production build needs `vite` installed in this project (it is an " +
97
+ "optional peer dependency, so it is not installed for you). Add it, or use the default Bun " +
98
+ `build. Underlying error: ${message}`
99
+ : `[nifra/web] \`vite\` resolved but failed to load, so the Vite production build cannot run: ${message}. ` +
100
+ "This is vite (or a native dependency of it) failing on this runtime, not a nifra build error - " +
101
+ "check that the installed vite works here, or use the default Bun build.", { cause });
102
+ }
103
+ }
104
+ // Vite derives `isProduction` from the process-global NODE_ENV even when an explicit `mode` is supplied.
105
+ // Programmatic builds therefore have to pin it, but two overlapping calls must never observe each other's
106
+ // mode. Serialize only this unavoidable Vite window; the previous value is captured after acquiring the
107
+ // lock and restored before the next build starts. Rejections release the lock too.
108
+ let nodeEnvBuildTail = Promise.resolve();
109
+ async function withSerializedNodeEnv(mode, run) {
110
+ const previousBuild = nodeEnvBuildTail;
111
+ let release;
112
+ nodeEnvBuildTail = new Promise((resolve) => {
113
+ release = resolve;
114
+ });
115
+ await previousBuild;
116
+ const previous = process.env.NODE_ENV;
117
+ process.env.NODE_ENV = mode;
118
+ try {
119
+ return await run();
120
+ }
121
+ finally {
122
+ // An env value is always a string when set; `undefined` means the key was absent, so remove it rather
123
+ // than assign `undefined` (which `exactOptionalPropertyTypes` rejects and which would stringify anyway).
124
+ if (previous === undefined)
125
+ delete process.env.NODE_ENV;
126
+ else
127
+ process.env.NODE_ENV = previous;
128
+ release();
129
+ }
130
+ }
131
+ /**
132
+ * Build the client bundle with Vite, emitting the SAME {@link BuildManifest} `buildClient` (Bun) does:
133
+ * a content-hashed entry, per-route chunk lists, aggregate + per-route CSS, and copied `public/` files.
134
+ *
135
+ * The route→chunk and route→CSS mappings come from Vite's own `.vite/manifest.json` (`build.manifest`),
136
+ * which records each entry's emitted `file` and its transitive `css` - exactly the two facts the Bun path
137
+ * reconstructs from Bun's metafile. `viteLeakGuard()` runs during the build, so a client leak fails here
138
+ * with the same error as the Bun build rather than shipping.
139
+ */
140
+ export async function buildClientVite(options) {
141
+ const { routesDir, outDir, clientModule } = options;
142
+ const root = resolvePath(options.root ?? dirname(routesDir));
143
+ const resolve = options.resolve ?? ((file) => `${routesDir}/${file}`);
144
+ const publicPath = options.publicPath ?? "/assets/";
145
+ mkdirSync(outDir, { recursive: true });
146
+ const routeManifest = discoverRoutes(routesDir);
147
+ // The generated bootstrap, written beside the project so its imports resolve the app's deps (same
148
+ // reasoning as buildClient). A unique dir avoids clobbering a user file / colliding with parallel builds.
149
+ const entryDir = mkdtempSync(resolvePath(dirname(routesDir), ".nifra-vite-client-"));
150
+ const entryFile = `${entryDir}/_nifra-entry.ts`;
151
+ writeFileSync(entryFile, `globalThis.process ??= { env: {} };\n${generateClientEntry(routeManifest, { clientModule, resolve })}`);
152
+ // Every unique route/layout/_404 file — each an additional entry so Vite emits a named chunk per file
153
+ // the bootstrap's lazy import dedupes to, giving the per-route chunk + CSS mapping below.
154
+ const routeFiles = [
155
+ ...new Set([
156
+ ...routeManifest.routes.map((r) => r.file),
157
+ ...Object.values(routeManifest.layouts).map((l) => l.file),
158
+ ...(routeManifest.notFound ? [routeManifest.notFound.file] : []),
159
+ ]),
160
+ ].sort();
161
+ // Vite manifest keys are the input path RELATIVE TO ROOT — precompute them so the lookup below is exact
162
+ // (survives same-basename collisions like `index.tsx` + `blog/index.tsx`).
163
+ const keyOf = (absPath) => relative(root, absPath).replaceAll("\\", "/");
164
+ const entryKey = keyOf(entryFile);
165
+ const input = { _nifra: entryFile };
166
+ const fileKey = new Map(); // route/layout file → its manifest key
167
+ for (const file of routeFiles) {
168
+ const abs = resolvePath(resolve(file));
169
+ // FLAT input names (no `/`), so Vite emits `routes_index_tsx-HASH.js` in `outDir` directly, not a
170
+ // nested `routes/…` dir — the deploy assembly + size report map asset URLs by basename and expect a
171
+ // flat layout. The manifest LOOKUP below is keyed by the src path (`keyOf`), independent of this name.
172
+ input[keyOf(abs).replace(/[^\w]/g, "_")] = abs;
173
+ fileKey.set(file, keyOf(abs));
174
+ }
175
+ // Pin Vite's MODE to match the NODE_ENV we define. @vitejs/plugin-react picks the JSX runtime by mode -
176
+ // `jsx` (production) vs `jsxDEV` (development) - so if mode and NODE_ENV disagree, the transform emits
177
+ // `jsxDEV` calls while `react/jsx-dev-runtime` guards `jsxDEV` behind `NODE_ENV !== "production"` and
178
+ // leaves it undefined → `jsxDEV is not a function` at SSR. Vite's default mode follows the ambient
179
+ // NODE_ENV (e.g. "test" under `bun test`), so it MUST be set explicitly, not left to default.
180
+ const mode = options.minify === false ? "development" : "production";
181
+ const buildEnv = (typeof Bun !== "undefined" ? Bun.env : undefined) ?? process.env;
182
+ const publicDefines = publicEnvDefines(options.publicEnvPrefix ?? "PUBLIC_", buildEnv);
183
+ const vite = await loadVite();
184
+ const leakGuard = viteLeakGuard();
185
+ try {
186
+ await withSerializedNodeEnv(mode, () => vite.build({
187
+ root,
188
+ base: publicPath,
189
+ mode,
190
+ logLevel: "silent",
191
+ // Nifra owns publicDir copying so direct and target builds share symlink confinement and
192
+ // deploy-root placement. Vite's automatic copy would put root files inside /assets.
193
+ publicDir: false,
194
+ define: {
195
+ ...publicDefines,
196
+ "process.env.NODE_ENV": JSON.stringify(mode),
197
+ ...(options.define ?? {}),
198
+ },
199
+ resolve: {
200
+ // Mirror the Bun build's reactDedupePlugin: one physical react/react-dom, or a hook-using route
201
+ // gets a second dispatcher. No-op when the app isn't React.
202
+ dedupe: ["react", "react-dom"],
203
+ ...(options.conditions ? { conditions: [...options.conditions] } : {}),
204
+ },
205
+ plugins: [...(options.vitePlugins ?? [])],
206
+ build: {
207
+ outDir,
208
+ emptyOutDir: false, // buildTargetWith owns outDir lifecycle; never let Vite wipe sibling files
209
+ manifest: true,
210
+ minify: options.minify !== false,
211
+ rollupOptions: {
212
+ // Keep `node:` builtins as external specifiers so the leak guard sees `node:crypto` and can
213
+ // name it. Left to itself, rolldown-vite SILENTLY rewrites a `node:` import to a
214
+ // `__vite-browser-external` stub for "browser compatibility" - the code builds, ships, and the
215
+ // builtin is a no-op at runtime, which is a worse footgun than Bun's polyfill and invisible
216
+ // without this. External here means the guard fails the build (below) with the exact builtin.
217
+ external: [/^node:/],
218
+ input,
219
+ // The leak guard is a Rollup plugin — last, so it sees the final graph.
220
+ plugins: [leakGuard],
221
+ output: {
222
+ entryFileNames: "[name]-[hash].js",
223
+ chunkFileNames: "[name]-[hash].js",
224
+ assetFileNames: "[name]-[hash][extname]",
225
+ },
226
+ },
227
+ },
228
+ }));
229
+ }
230
+ catch (error) {
231
+ // Re-raise the guard's own message. The plugin already threw it, but a plugin error is reported
232
+ // through the bundler, which builds its own error to do so - and on some Bun + rolldown pairings
233
+ // that construction fails, replacing a precise "node:crypto reached the client bundle" with an
234
+ // internal complaint naming nothing. Raising it here puts the message beyond anything that can
235
+ // rewrite it; the bundler's error is kept as `cause` for the rest of the context.
236
+ if (leakGuard.leak !== undefined)
237
+ throw new Error(leakGuard.leak, { cause: error });
238
+ throw error;
239
+ }
240
+ finally {
241
+ rmSync(entryDir, { recursive: true, force: true });
242
+ }
243
+ const viteManifestDir = join(outDir, ".vite");
244
+ const viteManifest = JSON.parse(readFileSync(join(viteManifestDir, "manifest.json"), "utf8"));
245
+ // Vite's source-keyed build manifest is an internal mapping input, not a deploy artifact.
246
+ rmSync(viteManifestDir, { recursive: true, force: true });
247
+ const url = (file) => `${publicPath}${file}`;
248
+ const bootstrap = viteManifest[entryKey];
249
+ if (bootstrap === undefined) {
250
+ throw new Error(`[nifra/web] Vite build produced no manifest entry for the bootstrap (${entryKey}). ` +
251
+ "The client build did not emit the generated entry.");
252
+ }
253
+ // routes: each route id → its layout chain + own chunk URLs (per-file entry chunks, like the Bun path).
254
+ const chunkFor = (file) => {
255
+ const key = fileKey.get(file);
256
+ const entry = key !== undefined ? viteManifest[key] : undefined;
257
+ return entry !== undefined ? url(entry.file) : undefined;
258
+ };
259
+ const chainFiles = (route) => [
260
+ ...route.layoutIds.map((id) => routeManifest.layouts[id]?.file ?? ""),
261
+ route.file,
262
+ ];
263
+ const routes = {};
264
+ for (const route of routeManifest.routes) {
265
+ routes[route.id] = chainFiles(route)
266
+ .map(chunkFor)
267
+ .filter((u) => u !== undefined);
268
+ }
269
+ if (routeManifest.notFound) {
270
+ const c = chunkFor(routeManifest.notFound.file);
271
+ routes._404 = c !== undefined ? [c] : [];
272
+ }
273
+ // CSS per route — Vite's manifest `css` is the transitive stylesheet set for that entry.
274
+ const stylesFor = (files) => {
275
+ const urls = new Set();
276
+ for (const file of files) {
277
+ const key = fileKey.get(file);
278
+ const entry = key !== undefined ? viteManifest[key] : undefined;
279
+ for (const css of entry?.css ?? [])
280
+ urls.add(url(css));
281
+ }
282
+ return [...urls];
283
+ };
284
+ // CSS aggregate — every stylesheet the app emits, the always-safe fallback.
285
+ const allCss = new Set();
286
+ for (const entry of Object.values(viteManifest)) {
287
+ for (const css of entry.css ?? [])
288
+ allCss.add(url(css));
289
+ }
290
+ const css = [...allCss];
291
+ const routeStyles = {};
292
+ if (css.length > 0) {
293
+ for (const route of routeManifest.routes)
294
+ routeStyles[route.id] = stylesFor(chainFiles(route));
295
+ if (routeManifest.notFound)
296
+ routeStyles._404 = stylesFor([routeManifest.notFound.file]);
297
+ }
298
+ // assets — every emitted file + stylesheet across the manifest (chunks, entries, css).
299
+ const assets = new Set();
300
+ for (const entry of Object.values(viteManifest)) {
301
+ assets.add(url(entry.file));
302
+ for (const css of entry.css ?? [])
303
+ assets.add(url(css));
304
+ for (const asset of entry.assets ?? [])
305
+ assets.add(url(asset));
306
+ }
307
+ const publicDir = options.publicDir === false ? undefined : (options.publicDir ?? "public");
308
+ const publicFiles = publicDir !== undefined && existsSync(publicDir) ? await copyPublicDir(publicDir, outDir) : [];
309
+ const manifest = {
310
+ entry: url(bootstrap.file),
311
+ assets: [...assets],
312
+ routes,
313
+ ...(publicFiles.length > 0 ? { publicFiles } : {}),
314
+ ...(css.length > 0 ? { css } : {}),
315
+ ...(Object.keys(routeStyles).length > 0 ? { routeStyles } : {}),
316
+ };
317
+ writeFileSync(`${outDir}/manifest.json`, JSON.stringify(manifest, null, 2));
318
+ return manifest;
319
+ }
320
+ /** Fail closed if Rollup would leave a Node builtin import in a workerd/edge worker. */
321
+ function edgeBuiltinGuard() {
322
+ const plugin = {
323
+ name: "nifra:edge-node-builtin-guard",
324
+ generateBundle(_options, bundle) {
325
+ const builtins = new Set();
326
+ const importers = new Set();
327
+ for (const output of Object.values(bundle)) {
328
+ if (output.type !== "chunk")
329
+ continue;
330
+ for (const specifier of [...(output.imports ?? []), ...(output.dynamicImports ?? [])]) {
331
+ if (specifier.startsWith("node:"))
332
+ builtins.add(specifier);
333
+ }
334
+ for (const id of output.moduleIds ?? []) {
335
+ const info = this.getModuleInfo(id);
336
+ const imports = [...(info?.importedIds ?? []), ...(info?.dynamicallyImportedIds ?? [])];
337
+ if (imports.some((specifier) => specifier.startsWith("node:")))
338
+ importers.add(id);
339
+ }
340
+ }
341
+ if (builtins.size === 0)
342
+ return;
343
+ const leak = `[nifra/web] Node built-in(s) reached an edge server bundle: ${[...builtins].sort().join(", ")}. ` +
344
+ `Imported by: ${[...importers].sort().join(", ") || "unknown module"}. ` +
345
+ "Move the import behind a Node/Bun target or replace it with an edge-compatible API.";
346
+ // Record, then throw - see `leak`.
347
+ plugin.leak = leak;
348
+ this.error(new Error(leak));
349
+ },
350
+ };
351
+ return plugin;
352
+ }
353
+ /**
354
+ * Build the SSR worker with Vite, emitting the SAME {@link ServerBuild} `buildServer` (Bun) does: a
355
+ * self-contained worker bundle whose path is returned as `worker`.
356
+ *
357
+ * Like `buildServer`, it codegens the statically-analyzable `server-manifest` next to the entry (so no
358
+ * `node:fs` route scan runs on a disk-less edge), then bundles. `ssr.noExternal` bundles the app + adapter
359
+ * + `@nifrajs/*` into ONE file (the self-contained worker), while `node:` builtins stay external on the
360
+ * `node`/`bun` targets that provide them. `NIFRA_SSR_BUNDLED` is defined so the web-react adapter uses the
361
+ * bundled, deduped react-dom rather than re-rooting to a disk copy at runtime - the same tag `buildServer`
362
+ * sets, and the reason a bundled SSR output does not hit the dual-React crash.
363
+ *
364
+ * The client-leak guards are deliberately NOT run here: a server bundle's `node:` imports are legitimate.
365
+ */
366
+ export async function buildServerVite(options) {
367
+ const { routesDir, serverEntry, outDir, clientEntry, styles, routeStyles } = options;
368
+ const root = resolvePath(options.root ?? dirname(routesDir));
369
+ const entryDir = dirname(serverEntry);
370
+ const manifestFile = options.manifestFile ?? "server-manifest.ts";
371
+ const rel = relative(entryDir, routesDir).replaceAll("\\", "/");
372
+ const resolve = options.resolve ?? ((file) => `./${rel}/${file}`);
373
+ mkdirSync(outDir, { recursive: true });
374
+ const target = options.target ?? "browser";
375
+ const edge = target === "browser";
376
+ // Same conditions as buildServer: the edge target needs workerd/edge-light so react-dom resolves its
377
+ // edge server build; node/bun resolve their own via the target condition.
378
+ const conditions = options.conditions ?? (edge ? ["workerd", "edge-light", "browser"] : [target]);
379
+ const routeManifest = discoverRoutes(routesDir);
380
+ writeFileSync(`${entryDir}/${manifestFile}`, generateServerManifest(routeManifest, { resolve, clientEntry, styles, routeStyles }));
381
+ // Pin the mode to match NODE_ENV — the react plugin's JSX runtime (jsx vs jsxDEV) follows it, and a
382
+ // mismatch throws `jsxDEV is not a function` at SSR (see buildClientVite for the full reasoning).
383
+ const mode = options.minify === false ? "development" : "production";
384
+ const vite = await loadVite();
385
+ const edgeGuard = edgeBuiltinGuard();
386
+ try {
387
+ await withSerializedNodeEnv(mode, () => vite.build({
388
+ root,
389
+ mode,
390
+ logLevel: "silent",
391
+ define: {
392
+ "process.env.NODE_ENV": JSON.stringify(mode),
393
+ // Tag the bundle so @nifrajs/web-react uses the bundled+deduped react-dom (no runtime re-root →
394
+ // no second React core). Layered after any caller define so it cannot be overridden.
395
+ ...(options.define ?? {}),
396
+ "process.env.NIFRA_SSR_BUNDLED": '"1"',
397
+ "globalThis.__NIFRA_EDGE_RUNTIME__": edge ? "true" : "false",
398
+ },
399
+ resolve: {
400
+ dedupe: ["react", "react-dom"],
401
+ conditions: [...conditions],
402
+ },
403
+ plugins: [...(options.vitePlugins ?? [])],
404
+ build: {
405
+ outDir,
406
+ emptyOutDir: false,
407
+ minify: options.minify !== false,
408
+ ssr: serverEntry,
409
+ rollupOptions: {
410
+ // Keep builtins external so Node/Bun use their native implementations. Edge builds add a
411
+ // generateBundle guard below, so an external specifier can never silently ship to workerd.
412
+ external: [/^node:/],
413
+ ...(edge ? { plugins: [edgeGuard] } : {}),
414
+ // ONE self-contained `server.js`. `inlineDynamicImports` forces the ENTRY chunk to absorb
415
+ // every module - the app, the adapter, react/react-dom, @nifrajs/* - so no second chunk is
416
+ // emitted. It is NOT redundant with `ssr.noExternal`: `noExternal` decides what gets bundled,
417
+ // this decides how many files it lands in. Without it the `node` SSR target splits vendor deps
418
+ // (verified: a React app emits `assets/react-<hash>.js`), and the deploy assembly copies only
419
+ // the entry, so the server dies at boot with ERR_MODULE_NOT_FOUND on a path that was never
420
+ // written. bun/deno/edge happen not to split today, which is exactly why the node regression
421
+ // went unnoticed - relying on a bundler's default chunking is not a contract.
422
+ // (Under rolldown-vite this option logs a cosmetic deprecation, silenced by `logLevel: silent`.)
423
+ output: { entryFileNames: "server.js", inlineDynamicImports: true },
424
+ },
425
+ // Bundle the app + adapter + @nifrajs/* into one self-contained worker (like Bun's eager output),
426
+ // rather than externalizing node_modules the way a default Vite SSR build does.
427
+ ssrEmitAssets: false,
428
+ },
429
+ ssr: {
430
+ noExternal: true,
431
+ ...(edge ? { target: "webworker" } : {}),
432
+ },
433
+ }));
434
+ }
435
+ catch (error) {
436
+ // Re-raise the guard's own message from here, where no bundler error-reporting path can rewrite it
437
+ // (see the same handling in buildClientVite).
438
+ if (edgeGuard.leak !== undefined)
439
+ throw new Error(edgeGuard.leak, { cause: error });
440
+ throw error;
441
+ }
442
+ const worker = join(outDir, "server.js");
443
+ if (!existsSync(worker)) {
444
+ throw new Error(`[nifra/web] Vite SSR build produced no ${worker}`);
445
+ }
446
+ return { worker, outputs: [worker] };
447
+ }
448
+ /**
449
+ * The Vite build STRATEGY — plugged into `buildTargetWith`. `plugins` arriving through the shared
450
+ * orchestrator are the app's Vite plugins (the escape hatch's whole reason), cast to Vite's plugin type.
451
+ */
452
+ export const viteBundler = {
453
+ buildClient: (input) => buildClientVite({
454
+ routesDir: input.routesDir,
455
+ outDir: input.outDir,
456
+ clientModule: input.clientModule,
457
+ ...(input.plugins ? { vitePlugins: input.plugins } : {}),
458
+ ...(input.conditions ? { conditions: input.conditions } : {}),
459
+ ...(input.define ? { define: input.define } : {}),
460
+ ...(input.publicDir !== undefined ? { publicDir: input.publicDir } : {}),
461
+ ...(input.publicEnvPrefix !== undefined ? { publicEnvPrefix: input.publicEnvPrefix } : {}),
462
+ ...(input.root ? { root: input.root } : {}),
463
+ }),
464
+ buildServer: (input) => buildServerVite({
465
+ routesDir: input.routesDir,
466
+ serverEntry: input.serverEntry,
467
+ outDir: input.outDir,
468
+ clientEntry: input.clientEntry,
469
+ target: input.target,
470
+ ...(input.plugins ? { vitePlugins: input.plugins } : {}),
471
+ ...(input.define ? { define: input.define } : {}),
472
+ ...(input.root ? { root: input.root } : {}),
473
+ }),
474
+ };
475
+ /**
476
+ * Build a full deploy dir for `target` using the Vite/Rollup pipeline - the escape hatch for apps that
477
+ * need a Vite-only transform in production. Identical output shape to {@link import("./build.ts").buildTarget}
478
+ * (same deploy dir, same server entry, same prerender + size report), because both delegate to the ONE
479
+ * `buildTargetWith` orchestrator; only the two bundling steps differ.
480
+ *
481
+ * Pass the app's Vite plugins via `clientPlugins` / `serverPlugins` (the shared option names) - here they
482
+ * are Vite plugins, not Bun plugins.
483
+ */
484
+ export function buildTargetVite(target, options) {
485
+ return buildTargetWith(target, options, viteBundler);
486
+ }
487
+ //# sourceMappingURL=build-vite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-vite.js","sourceRoot":"","sources":["../src/build-vite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAA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