vinext 0.0.38 → 0.0.40

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 (245) hide show
  1. package/README.md +33 -20
  2. package/dist/build/nitro-route-rules.d.ts +50 -0
  3. package/dist/build/nitro-route-rules.js +81 -0
  4. package/dist/build/nitro-route-rules.js.map +1 -0
  5. package/dist/build/precompress.d.ts +17 -0
  6. package/dist/build/precompress.js +102 -0
  7. package/dist/build/precompress.js.map +1 -0
  8. package/dist/build/prerender.d.ts +27 -22
  9. package/dist/build/prerender.js +17 -17
  10. package/dist/build/prerender.js.map +1 -1
  11. package/dist/build/report.d.ts +3 -4
  12. package/dist/build/report.js.map +1 -1
  13. package/dist/build/run-prerender.d.ts +3 -4
  14. package/dist/build/run-prerender.js.map +1 -1
  15. package/dist/build/standalone.d.ts +32 -0
  16. package/dist/build/standalone.js +206 -0
  17. package/dist/build/standalone.js.map +1 -0
  18. package/dist/build/static-export.d.ts +17 -29
  19. package/dist/build/static-export.js.map +1 -1
  20. package/dist/check.d.ts +4 -4
  21. package/dist/check.js +1 -1
  22. package/dist/check.js.map +1 -1
  23. package/dist/cli.js +31 -4
  24. package/dist/cli.js.map +1 -1
  25. package/dist/client/instrumentation-client.d.ts +2 -2
  26. package/dist/client/instrumentation-client.js.map +1 -1
  27. package/dist/client/vinext-next-data.d.ts +5 -8
  28. package/dist/cloudflare/index.js +1 -1
  29. package/dist/cloudflare/kv-cache-handler.d.ts +5 -3
  30. package/dist/cloudflare/kv-cache-handler.js +1 -1
  31. package/dist/cloudflare/kv-cache-handler.js.map +1 -1
  32. package/dist/cloudflare/tpr.d.ts +35 -27
  33. package/dist/cloudflare/tpr.js +36 -12
  34. package/dist/cloudflare/tpr.js.map +1 -1
  35. package/dist/config/config-matchers.d.ts +2 -2
  36. package/dist/config/config-matchers.js +1 -1
  37. package/dist/config/config-matchers.js.map +1 -1
  38. package/dist/config/dotenv.d.ts +4 -4
  39. package/dist/config/dotenv.js.map +1 -1
  40. package/dist/config/next-config.d.ts +40 -61
  41. package/dist/config/next-config.js +5 -4
  42. package/dist/config/next-config.js.map +1 -1
  43. package/dist/deploy.d.ts +25 -41
  44. package/dist/deploy.js +1 -1
  45. package/dist/deploy.js.map +1 -1
  46. package/dist/entries/app-rsc-entry.d.ts +8 -11
  47. package/dist/entries/app-rsc-entry.js +133 -249
  48. package/dist/entries/app-rsc-entry.js.map +1 -1
  49. package/dist/entries/pages-server-entry.js +1 -3
  50. package/dist/entries/pages-server-entry.js.map +1 -1
  51. package/dist/index.d.ts +49 -28
  52. package/dist/index.js +238 -83
  53. package/dist/index.js.map +1 -1
  54. package/dist/init.d.ts +14 -26
  55. package/dist/init.js +8 -2
  56. package/dist/init.js.map +1 -1
  57. package/dist/plugins/client-reference-dedup.js.map +1 -1
  58. package/dist/plugins/fix-use-server-closure-collision.js.map +1 -1
  59. package/dist/plugins/fonts.d.ts +18 -1
  60. package/dist/plugins/fonts.js +107 -8
  61. package/dist/plugins/fonts.js.map +1 -1
  62. package/dist/plugins/optimize-imports.d.ts +2 -2
  63. package/dist/plugins/optimize-imports.js +4 -4
  64. package/dist/plugins/optimize-imports.js.map +1 -1
  65. package/dist/plugins/server-externals-manifest.d.ts +37 -0
  66. package/dist/plugins/server-externals-manifest.js +83 -0
  67. package/dist/plugins/server-externals-manifest.js.map +1 -0
  68. package/dist/routing/app-router.d.ts +37 -55
  69. package/dist/routing/app-router.js +37 -22
  70. package/dist/routing/app-router.js.map +1 -1
  71. package/dist/routing/file-matcher.d.ts +2 -2
  72. package/dist/routing/file-matcher.js.map +1 -1
  73. package/dist/routing/pages-router.d.ts +6 -11
  74. package/dist/routing/pages-router.js.map +1 -1
  75. package/dist/routing/route-trie.d.ts +2 -2
  76. package/dist/routing/route-trie.js.map +1 -1
  77. package/dist/server/api-handler.js.map +1 -1
  78. package/dist/server/app-browser-entry.js +270 -39
  79. package/dist/server/app-browser-entry.js.map +1 -1
  80. package/dist/server/app-browser-stream.d.ts +6 -6
  81. package/dist/server/app-browser-stream.js.map +1 -1
  82. package/dist/server/app-page-boundary-render.d.ts +8 -8
  83. package/dist/server/app-page-boundary-render.js +2 -2
  84. package/dist/server/app-page-boundary-render.js.map +1 -1
  85. package/dist/server/app-page-boundary.d.ts +13 -11
  86. package/dist/server/app-page-boundary.js +1 -1
  87. package/dist/server/app-page-boundary.js.map +1 -1
  88. package/dist/server/app-page-cache.d.ts +10 -10
  89. package/dist/server/app-page-cache.js.map +1 -1
  90. package/dist/server/app-page-execution.d.ts +10 -10
  91. package/dist/server/app-page-execution.js.map +1 -1
  92. package/dist/server/app-page-probe.d.ts +2 -2
  93. package/dist/server/app-page-probe.js.map +1 -1
  94. package/dist/server/app-page-render.d.ts +4 -4
  95. package/dist/server/app-page-render.js.map +1 -1
  96. package/dist/server/app-page-request.d.ts +12 -12
  97. package/dist/server/app-page-request.js.map +1 -1
  98. package/dist/server/app-page-response.d.ts +30 -19
  99. package/dist/server/app-page-response.js +26 -7
  100. package/dist/server/app-page-response.js.map +1 -1
  101. package/dist/server/app-page-route-wiring.d.ts +79 -0
  102. package/dist/server/app-page-route-wiring.js +165 -0
  103. package/dist/server/app-page-route-wiring.js.map +1 -0
  104. package/dist/server/app-page-stream.d.ts +18 -18
  105. package/dist/server/app-page-stream.js +3 -0
  106. package/dist/server/app-page-stream.js.map +1 -1
  107. package/dist/server/app-route-handler-cache.d.ts +2 -2
  108. package/dist/server/app-route-handler-cache.js.map +1 -1
  109. package/dist/server/app-route-handler-execution.d.ts +6 -6
  110. package/dist/server/app-route-handler-execution.js.map +1 -1
  111. package/dist/server/app-route-handler-policy.d.ts +8 -8
  112. package/dist/server/app-route-handler-policy.js.map +1 -1
  113. package/dist/server/app-route-handler-response.d.ts +6 -6
  114. package/dist/server/app-route-handler-response.js +4 -1
  115. package/dist/server/app-route-handler-response.js.map +1 -1
  116. package/dist/server/app-route-handler-runtime.d.ts +4 -4
  117. package/dist/server/app-route-handler-runtime.js.map +1 -1
  118. package/dist/server/app-router-entry.d.ts +6 -1
  119. package/dist/server/app-router-entry.js +9 -2
  120. package/dist/server/app-router-entry.js.map +1 -1
  121. package/dist/server/app-ssr-entry.d.ts +4 -4
  122. package/dist/server/app-ssr-entry.js.map +1 -1
  123. package/dist/server/app-ssr-stream.d.ts +2 -2
  124. package/dist/server/app-ssr-stream.js +1 -3
  125. package/dist/server/app-ssr-stream.js.map +1 -1
  126. package/dist/server/dev-module-runner.d.ts +2 -2
  127. package/dist/server/dev-module-runner.js.map +1 -1
  128. package/dist/server/dev-server.js +5 -7
  129. package/dist/server/dev-server.js.map +1 -1
  130. package/dist/server/image-optimization.d.ts +7 -12
  131. package/dist/server/image-optimization.js.map +1 -1
  132. package/dist/server/instrumentation.d.ts +8 -12
  133. package/dist/server/instrumentation.js +1 -1
  134. package/dist/server/instrumentation.js.map +1 -1
  135. package/dist/server/isr-cache.d.ts +2 -2
  136. package/dist/server/isr-cache.js.map +1 -1
  137. package/dist/server/metadata-routes.d.ts +14 -19
  138. package/dist/server/metadata-routes.js.map +1 -1
  139. package/dist/server/middleware.d.ts +9 -17
  140. package/dist/server/middleware.js +1 -1
  141. package/dist/server/middleware.js.map +1 -1
  142. package/dist/server/pages-api-route.d.ts +6 -6
  143. package/dist/server/pages-api-route.js.map +1 -1
  144. package/dist/server/pages-i18n.d.ts +4 -4
  145. package/dist/server/pages-i18n.js.map +1 -1
  146. package/dist/server/pages-node-compat.d.ts +10 -10
  147. package/dist/server/pages-node-compat.js.map +1 -1
  148. package/dist/server/pages-page-data.d.ts +22 -22
  149. package/dist/server/pages-page-data.js.map +1 -1
  150. package/dist/server/pages-page-response.d.ts +8 -8
  151. package/dist/server/pages-page-response.js.map +1 -1
  152. package/dist/server/prod-server.d.ts +20 -15
  153. package/dist/server/prod-server.js +198 -55
  154. package/dist/server/prod-server.js.map +1 -1
  155. package/dist/server/seed-cache.js.map +1 -1
  156. package/dist/server/static-file-cache.d.ts +57 -0
  157. package/dist/server/static-file-cache.js +219 -0
  158. package/dist/server/static-file-cache.js.map +1 -0
  159. package/dist/server/worker-utils.d.ts +4 -1
  160. package/dist/server/worker-utils.js +31 -1
  161. package/dist/server/worker-utils.js.map +1 -1
  162. package/dist/shims/app.d.ts +2 -2
  163. package/dist/shims/cache-runtime.d.ts +6 -9
  164. package/dist/shims/cache-runtime.js.map +1 -1
  165. package/dist/shims/cache.d.ts +28 -31
  166. package/dist/shims/cache.js.map +1 -1
  167. package/dist/shims/config.d.ts +2 -2
  168. package/dist/shims/config.js.map +1 -1
  169. package/dist/shims/dynamic.d.ts +2 -2
  170. package/dist/shims/dynamic.js +5 -7
  171. package/dist/shims/dynamic.js.map +1 -1
  172. package/dist/shims/error-boundary.d.ts +19 -10
  173. package/dist/shims/error-boundary.js +23 -3
  174. package/dist/shims/error-boundary.js.map +1 -1
  175. package/dist/shims/error.d.ts +2 -2
  176. package/dist/shims/error.js.map +1 -1
  177. package/dist/shims/fetch-cache.d.ts +4 -4
  178. package/dist/shims/fetch-cache.js.map +1 -1
  179. package/dist/shims/font-google-base.d.ts +4 -4
  180. package/dist/shims/font-google-base.js.map +1 -1
  181. package/dist/shims/font-local.d.ts +6 -6
  182. package/dist/shims/font-local.js.map +1 -1
  183. package/dist/shims/form.d.ts +4 -8
  184. package/dist/shims/form.js +4 -6
  185. package/dist/shims/form.js.map +1 -1
  186. package/dist/shims/head-state.d.ts +2 -2
  187. package/dist/shims/head-state.js.map +1 -1
  188. package/dist/shims/head.d.ts +2 -2
  189. package/dist/shims/head.js +18 -20
  190. package/dist/shims/head.js.map +1 -1
  191. package/dist/shims/headers.d.ts +4 -4
  192. package/dist/shims/headers.js.map +1 -1
  193. package/dist/shims/i18n-context.d.ts +2 -2
  194. package/dist/shims/i18n-context.js.map +1 -1
  195. package/dist/shims/i18n-state.d.ts +2 -2
  196. package/dist/shims/i18n-state.js.map +1 -1
  197. package/dist/shims/image-config.d.ts +2 -2
  198. package/dist/shims/image-config.js.map +1 -1
  199. package/dist/shims/image.d.ts +5 -6
  200. package/dist/shims/image.js.map +1 -1
  201. package/dist/shims/internal/app-router-context.d.ts +6 -6
  202. package/dist/shims/internal/app-router-context.js.map +1 -1
  203. package/dist/shims/internal/utils.d.ts +2 -2
  204. package/dist/shims/internal/utils.js.map +1 -1
  205. package/dist/shims/layout-segment-context.d.ts +12 -5
  206. package/dist/shims/layout-segment-context.js +9 -4
  207. package/dist/shims/layout-segment-context.js.map +1 -1
  208. package/dist/shims/legacy-image.d.ts +5 -8
  209. package/dist/shims/legacy-image.js.map +1 -1
  210. package/dist/shims/link.d.ts +21 -31
  211. package/dist/shims/link.js +4 -58
  212. package/dist/shims/link.js.map +1 -1
  213. package/dist/shims/metadata.d.ts +23 -31
  214. package/dist/shims/metadata.js.map +1 -1
  215. package/dist/shims/navigation-state.d.ts +2 -2
  216. package/dist/shims/navigation-state.js.map +1 -1
  217. package/dist/shims/navigation.d.ts +118 -18
  218. package/dist/shims/navigation.js +377 -116
  219. package/dist/shims/navigation.js.map +1 -1
  220. package/dist/shims/request-context.d.ts +2 -2
  221. package/dist/shims/request-context.js.map +1 -1
  222. package/dist/shims/router-state.d.ts +4 -4
  223. package/dist/shims/router-state.js.map +1 -1
  224. package/dist/shims/router.d.ts +28 -47
  225. package/dist/shims/router.js +127 -38
  226. package/dist/shims/router.js.map +1 -1
  227. package/dist/shims/script.d.ts +16 -31
  228. package/dist/shims/script.js.map +1 -1
  229. package/dist/shims/server.d.ts +27 -14
  230. package/dist/shims/server.js +91 -73
  231. package/dist/shims/server.js.map +1 -1
  232. package/dist/shims/slot.d.ts +28 -0
  233. package/dist/shims/slot.js +49 -0
  234. package/dist/shims/slot.js.map +1 -0
  235. package/dist/shims/unified-request-context.d.ts +3 -5
  236. package/dist/shims/unified-request-context.js.map +1 -1
  237. package/dist/shims/web-vitals.d.ts +2 -2
  238. package/dist/shims/web-vitals.js.map +1 -1
  239. package/dist/utils/lazy-chunks.d.ts +34 -0
  240. package/dist/utils/lazy-chunks.js +50 -0
  241. package/dist/utils/lazy-chunks.js.map +1 -0
  242. package/dist/utils/vinext-root.d.ts +24 -0
  243. package/dist/utils/vinext-root.js +31 -0
  244. package/dist/utils/vinext-root.js.map +1 -0
  245. package/package.json +1 -2
@@ -6,14 +6,14 @@
6
6
  * In real Next.js, this sends Core Web Vitals to an analytics endpoint.
7
7
  * Apps can use the web-vitals library directly instead.
8
8
  */
9
- interface WebVitalsMetric {
9
+ type WebVitalsMetric = {
10
10
  id: string;
11
11
  name: string;
12
12
  value: number;
13
13
  rating?: "good" | "needs-improvement" | "poor";
14
14
  delta: number;
15
15
  navigationType?: "navigate" | "reload" | "back-forward" | "prerender";
16
- }
16
+ };
17
17
  type ReportWebVitalsCallback = (metric: WebVitalsMetric) => void;
18
18
  /**
19
19
  * Register a callback to receive Core Web Vitals metrics.
@@ -1 +1 @@
1
- {"version":3,"file":"web-vitals.js","names":[],"sources":["../../src/shims/web-vitals.ts"],"sourcesContent":["/**\n * next/web-vitals shim\n *\n * Provides useReportWebVitals() — a no-op hook for compatibility.\n * In real Next.js, this sends Core Web Vitals to an analytics endpoint.\n * Apps can use the web-vitals library directly instead.\n */\n\ninterface WebVitalsMetric {\n id: string;\n name: string;\n value: number;\n rating?: \"good\" | \"needs-improvement\" | \"poor\";\n delta: number;\n navigationType?: \"navigate\" | \"reload\" | \"back-forward\" | \"prerender\";\n}\n\ntype ReportWebVitalsCallback = (metric: WebVitalsMetric) => void;\n\n/**\n * Register a callback to receive Core Web Vitals metrics.\n * No-op in our implementation — use the `web-vitals` library directly\n * for production metrics collection.\n */\nexport function useReportWebVitals(_callback: ReportWebVitalsCallback): void {\n // No-op — apps should use the web-vitals library directly\n // or their own analytics integration.\n}\n\nexport type { WebVitalsMetric, ReportWebVitalsCallback };\n"],"mappings":";;;;;;AAwBA,SAAgB,mBAAmB,WAA0C"}
1
+ {"version":3,"file":"web-vitals.js","names":[],"sources":["../../src/shims/web-vitals.ts"],"sourcesContent":["/**\n * next/web-vitals shim\n *\n * Provides useReportWebVitals() — a no-op hook for compatibility.\n * In real Next.js, this sends Core Web Vitals to an analytics endpoint.\n * Apps can use the web-vitals library directly instead.\n */\n\ntype WebVitalsMetric = {\n id: string;\n name: string;\n value: number;\n rating?: \"good\" | \"needs-improvement\" | \"poor\";\n delta: number;\n navigationType?: \"navigate\" | \"reload\" | \"back-forward\" | \"prerender\";\n};\n\ntype ReportWebVitalsCallback = (metric: WebVitalsMetric) => void;\n\n/**\n * Register a callback to receive Core Web Vitals metrics.\n * No-op in our implementation — use the `web-vitals` library directly\n * for production metrics collection.\n */\nexport function useReportWebVitals(_callback: ReportWebVitalsCallback): void {\n // No-op — apps should use the web-vitals library directly\n // or their own analytics integration.\n}\n\nexport type { WebVitalsMetric, ReportWebVitalsCallback };\n"],"mappings":";;;;;;AAwBA,SAAgB,mBAAmB,WAA0C"}
@@ -0,0 +1,34 @@
1
+ //#region src/utils/lazy-chunks.d.ts
2
+ /**
3
+ * Build-manifest chunk metadata used to compute lazy chunks.
4
+ */
5
+ type BuildManifestChunk = {
6
+ file: string;
7
+ isEntry?: boolean;
8
+ isDynamicEntry?: boolean;
9
+ imports?: string[];
10
+ dynamicImports?: string[];
11
+ css?: string[];
12
+ assets?: string[];
13
+ };
14
+ /**
15
+ * Compute the set of chunk filenames that are ONLY reachable through dynamic
16
+ * imports (i.e. behind React.lazy(), next/dynamic, or manual import()).
17
+ *
18
+ * These chunks should NOT be modulepreloaded in the HTML — they will be
19
+ * fetched on demand when the dynamic import executes.
20
+ *
21
+ * Algorithm: Starting from all entry chunks in the build manifest, walk the
22
+ * static `imports` tree (breadth-first). Any chunk file NOT reached by this
23
+ * walk is only reachable through `dynamicImports` and is therefore "lazy".
24
+ *
25
+ * @param buildManifest - Vite's build manifest (manifest.json), which is a
26
+ * Record<string, ManifestChunk> where each chunk has `file`, `imports`,
27
+ * `dynamicImports`, `isEntry`, and `isDynamicEntry` fields.
28
+ * @returns Array of chunk filenames (e.g. "assets/mermaid-NOHMQCX5.js") that
29
+ * should be excluded from modulepreload hints.
30
+ */
31
+ declare function computeLazyChunks(buildManifest: Record<string, BuildManifestChunk>): string[];
32
+ //#endregion
33
+ export { BuildManifestChunk, computeLazyChunks };
34
+ //# sourceMappingURL=lazy-chunks.d.ts.map
@@ -0,0 +1,50 @@
1
+ //#region src/utils/lazy-chunks.ts
2
+ /**
3
+ * Compute the set of chunk filenames that are ONLY reachable through dynamic
4
+ * imports (i.e. behind React.lazy(), next/dynamic, or manual import()).
5
+ *
6
+ * These chunks should NOT be modulepreloaded in the HTML — they will be
7
+ * fetched on demand when the dynamic import executes.
8
+ *
9
+ * Algorithm: Starting from all entry chunks in the build manifest, walk the
10
+ * static `imports` tree (breadth-first). Any chunk file NOT reached by this
11
+ * walk is only reachable through `dynamicImports` and is therefore "lazy".
12
+ *
13
+ * @param buildManifest - Vite's build manifest (manifest.json), which is a
14
+ * Record<string, ManifestChunk> where each chunk has `file`, `imports`,
15
+ * `dynamicImports`, `isEntry`, and `isDynamicEntry` fields.
16
+ * @returns Array of chunk filenames (e.g. "assets/mermaid-NOHMQCX5.js") that
17
+ * should be excluded from modulepreload hints.
18
+ */
19
+ function computeLazyChunks(buildManifest) {
20
+ const eagerFiles = /* @__PURE__ */ new Set();
21
+ const visited = /* @__PURE__ */ new Set();
22
+ const queue = [];
23
+ for (const key of Object.keys(buildManifest)) if (buildManifest[key].isEntry) queue.push(key);
24
+ while (queue.length > 0) {
25
+ const key = queue.shift();
26
+ if (!key || visited.has(key)) continue;
27
+ visited.add(key);
28
+ const chunk = buildManifest[key];
29
+ if (!chunk) continue;
30
+ eagerFiles.add(chunk.file);
31
+ if (chunk.css) for (const cssFile of chunk.css) eagerFiles.add(cssFile);
32
+ if (chunk.imports) {
33
+ for (const imp of chunk.imports) if (!visited.has(imp)) queue.push(imp);
34
+ }
35
+ }
36
+ const lazyChunks = [];
37
+ const allFiles = /* @__PURE__ */ new Set();
38
+ for (const key of Object.keys(buildManifest)) {
39
+ const chunk = buildManifest[key];
40
+ if (chunk.file && !allFiles.has(chunk.file)) {
41
+ allFiles.add(chunk.file);
42
+ if (!eagerFiles.has(chunk.file) && chunk.file.endsWith(".js")) lazyChunks.push(chunk.file);
43
+ }
44
+ }
45
+ return lazyChunks;
46
+ }
47
+ //#endregion
48
+ export { computeLazyChunks };
49
+
50
+ //# sourceMappingURL=lazy-chunks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy-chunks.js","names":[],"sources":["../../src/utils/lazy-chunks.ts"],"sourcesContent":["/**\n * Build-manifest chunk metadata used to compute lazy chunks.\n */\nexport type BuildManifestChunk = {\n file: string;\n isEntry?: boolean;\n isDynamicEntry?: boolean;\n imports?: string[];\n dynamicImports?: string[];\n css?: string[];\n assets?: string[];\n};\n\n/**\n * Compute the set of chunk filenames that are ONLY reachable through dynamic\n * imports (i.e. behind React.lazy(), next/dynamic, or manual import()).\n *\n * These chunks should NOT be modulepreloaded in the HTML — they will be\n * fetched on demand when the dynamic import executes.\n *\n * Algorithm: Starting from all entry chunks in the build manifest, walk the\n * static `imports` tree (breadth-first). Any chunk file NOT reached by this\n * walk is only reachable through `dynamicImports` and is therefore \"lazy\".\n *\n * @param buildManifest - Vite's build manifest (manifest.json), which is a\n * Record<string, ManifestChunk> where each chunk has `file`, `imports`,\n * `dynamicImports`, `isEntry`, and `isDynamicEntry` fields.\n * @returns Array of chunk filenames (e.g. \"assets/mermaid-NOHMQCX5.js\") that\n * should be excluded from modulepreload hints.\n */\nexport function computeLazyChunks(buildManifest: Record<string, BuildManifestChunk>): string[] {\n // Collect all chunk files that are statically reachable from entries\n const eagerFiles = new Set<string>();\n const visited = new Set<string>();\n const queue: string[] = [];\n\n // Start BFS from all entry chunks\n for (const key of Object.keys(buildManifest)) {\n const chunk = buildManifest[key];\n if (chunk.isEntry) {\n queue.push(key);\n }\n }\n\n while (queue.length > 0) {\n const key = queue.shift();\n if (!key || visited.has(key)) continue;\n visited.add(key);\n\n const chunk = buildManifest[key];\n if (!chunk) continue;\n\n // Mark this chunk's file as eager\n eagerFiles.add(chunk.file);\n\n // Also mark its CSS as eager (CSS should always be preloaded to avoid FOUC)\n if (chunk.css) {\n for (const cssFile of chunk.css) {\n eagerFiles.add(cssFile);\n }\n }\n\n // Follow only static imports — NOT dynamicImports\n if (chunk.imports) {\n for (const imp of chunk.imports) {\n if (!visited.has(imp)) {\n queue.push(imp);\n }\n }\n }\n }\n\n // Any JS file in the manifest that's NOT in eagerFiles is a lazy chunk\n const lazyChunks: string[] = [];\n const allFiles = new Set<string>();\n for (const key of Object.keys(buildManifest)) {\n const chunk = buildManifest[key];\n if (chunk.file && !allFiles.has(chunk.file)) {\n allFiles.add(chunk.file);\n if (!eagerFiles.has(chunk.file) && chunk.file.endsWith(\".js\")) {\n lazyChunks.push(chunk.file);\n }\n }\n }\n\n return lazyChunks;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8BA,SAAgB,kBAAkB,eAA6D;CAE7F,MAAM,6BAAa,IAAI,KAAa;CACpC,MAAM,0BAAU,IAAI,KAAa;CACjC,MAAM,QAAkB,EAAE;AAG1B,MAAK,MAAM,OAAO,OAAO,KAAK,cAAc,CAE1C,KADc,cAAc,KAClB,QACR,OAAM,KAAK,IAAI;AAInB,QAAO,MAAM,SAAS,GAAG;EACvB,MAAM,MAAM,MAAM,OAAO;AACzB,MAAI,CAAC,OAAO,QAAQ,IAAI,IAAI,CAAE;AAC9B,UAAQ,IAAI,IAAI;EAEhB,MAAM,QAAQ,cAAc;AAC5B,MAAI,CAAC,MAAO;AAGZ,aAAW,IAAI,MAAM,KAAK;AAG1B,MAAI,MAAM,IACR,MAAK,MAAM,WAAW,MAAM,IAC1B,YAAW,IAAI,QAAQ;AAK3B,MAAI,MAAM;QACH,MAAM,OAAO,MAAM,QACtB,KAAI,CAAC,QAAQ,IAAI,IAAI,CACnB,OAAM,KAAK,IAAI;;;CAOvB,MAAM,aAAuB,EAAE;CAC/B,MAAM,2BAAW,IAAI,KAAa;AAClC,MAAK,MAAM,OAAO,OAAO,KAAK,cAAc,EAAE;EAC5C,MAAM,QAAQ,cAAc;AAC5B,MAAI,MAAM,QAAQ,CAAC,SAAS,IAAI,MAAM,KAAK,EAAE;AAC3C,YAAS,IAAI,MAAM,KAAK;AACxB,OAAI,CAAC,WAAW,IAAI,MAAM,KAAK,IAAI,MAAM,KAAK,SAAS,MAAM,CAC3D,YAAW,KAAK,MAAM,KAAK;;;AAKjC,QAAO"}
@@ -0,0 +1,24 @@
1
+ //#region src/utils/vinext-root.d.ts
2
+ /**
3
+ * Resolve the root directory of the vinext package at runtime.
4
+ *
5
+ * Both the CLI pre-flight check (`cli.ts`) and the standalone output emitter
6
+ * (`build/standalone.ts`) need to locate vinext's package root so they can
7
+ * verify that `dist/` exists and copy vinext's runtime files into standalone
8
+ * output. Centralising the logic here ensures the two callers stay in sync.
9
+ *
10
+ * The resolution works for both the compiled output layout and for running
11
+ * directly from source:
12
+ *
13
+ * - Compiled layout: this file lives at `dist/utils/vinext-root.js`
14
+ * → two levels up (`../..`) is the package root.
15
+ * - Source layout: this file lives at `src/utils/vinext-root.ts`
16
+ * → two levels up (`../..`) is the package root.
17
+ *
18
+ * If an explicit root is provided (e.g. from a test fixture), it is returned
19
+ * as-is after resolving to an absolute path.
20
+ */
21
+ declare function resolveVinextPackageRoot(explicitRoot?: string): string;
22
+ //#endregion
23
+ export { resolveVinextPackageRoot };
24
+ //# sourceMappingURL=vinext-root.d.ts.map
@@ -0,0 +1,31 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ //#region src/utils/vinext-root.ts
4
+ /**
5
+ * Resolve the root directory of the vinext package at runtime.
6
+ *
7
+ * Both the CLI pre-flight check (`cli.ts`) and the standalone output emitter
8
+ * (`build/standalone.ts`) need to locate vinext's package root so they can
9
+ * verify that `dist/` exists and copy vinext's runtime files into standalone
10
+ * output. Centralising the logic here ensures the two callers stay in sync.
11
+ *
12
+ * The resolution works for both the compiled output layout and for running
13
+ * directly from source:
14
+ *
15
+ * - Compiled layout: this file lives at `dist/utils/vinext-root.js`
16
+ * → two levels up (`../..`) is the package root.
17
+ * - Source layout: this file lives at `src/utils/vinext-root.ts`
18
+ * → two levels up (`../..`) is the package root.
19
+ *
20
+ * If an explicit root is provided (e.g. from a test fixture), it is returned
21
+ * as-is after resolving to an absolute path.
22
+ */
23
+ function resolveVinextPackageRoot(explicitRoot) {
24
+ if (explicitRoot) return path.resolve(explicitRoot);
25
+ const currentDir = path.dirname(fileURLToPath(import.meta.url));
26
+ return path.resolve(currentDir, "..", "..");
27
+ }
28
+ //#endregion
29
+ export { resolveVinextPackageRoot };
30
+
31
+ //# sourceMappingURL=vinext-root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vinext-root.js","names":[],"sources":["../../src/utils/vinext-root.ts"],"sourcesContent":["import path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * Resolve the root directory of the vinext package at runtime.\n *\n * Both the CLI pre-flight check (`cli.ts`) and the standalone output emitter\n * (`build/standalone.ts`) need to locate vinext's package root so they can\n * verify that `dist/` exists and copy vinext's runtime files into standalone\n * output. Centralising the logic here ensures the two callers stay in sync.\n *\n * The resolution works for both the compiled output layout and for running\n * directly from source:\n *\n * - Compiled layout: this file lives at `dist/utils/vinext-root.js`\n * → two levels up (`../..`) is the package root.\n * - Source layout: this file lives at `src/utils/vinext-root.ts`\n * → two levels up (`../..`) is the package root.\n *\n * If an explicit root is provided (e.g. from a test fixture), it is returned\n * as-is after resolving to an absolute path.\n */\nexport function resolveVinextPackageRoot(explicitRoot?: string): string {\n if (explicitRoot) {\n return path.resolve(explicitRoot);\n }\n const currentDir = path.dirname(fileURLToPath(import.meta.url));\n // src/utils/vinext-root.ts → ../.. → package root\n // dist/utils/vinext-root.js → ../.. → package root\n return path.resolve(currentDir, \"..\", \"..\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgB,yBAAyB,cAA+B;AACtE,KAAI,aACF,QAAO,KAAK,QAAQ,aAAa;CAEnC,MAAM,aAAa,KAAK,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAG/D,QAAO,KAAK,QAAQ,YAAY,MAAM,KAAK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vinext",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "description": "Run Next.js apps on Vite. Drop-in replacement for the next CLI.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -58,7 +58,6 @@
58
58
  "@unpic/react": "^1.0.2",
59
59
  "@vercel/og": "^0.8.6",
60
60
  "magic-string": "^0.30.21",
61
- "rsc-html-stream": "^0.0.7",
62
61
  "vite-plugin-commonjs": "^0.10.4",
63
62
  "vite-tsconfig-paths": "^6.1.1"
64
63
  },