@qzsy/vinext 0.1.7

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 (803) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +773 -0
  3. package/dist/build/assets-ignore.d.ts +32 -0
  4. package/dist/build/assets-ignore.js +48 -0
  5. package/dist/build/clean-output.d.ts +13 -0
  6. package/dist/build/clean-output.js +34 -0
  7. package/dist/build/client-build-config.d.ts +171 -0
  8. package/dist/build/client-build-config.js +270 -0
  9. package/dist/build/css-url-assets.d.ts +29 -0
  10. package/dist/build/css-url-assets.js +213 -0
  11. package/dist/build/google-fonts/build-url.d.ts +9 -0
  12. package/dist/build/google-fonts/build-url.js +28 -0
  13. package/dist/build/google-fonts/fallback-metrics-data.js +14029 -0
  14. package/dist/build/google-fonts/fallback-metrics.d.ts +12 -0
  15. package/dist/build/google-fonts/fallback-metrics.js +44 -0
  16. package/dist/build/google-fonts/find-font-files-in-css.d.ts +16 -0
  17. package/dist/build/google-fonts/find-font-files-in-css.js +28 -0
  18. package/dist/build/google-fonts/font-data.js +24983 -0
  19. package/dist/build/google-fonts/font-metadata.d.ts +16 -0
  20. package/dist/build/google-fonts/font-metadata.js +5 -0
  21. package/dist/build/google-fonts/get-axes.d.ts +6 -0
  22. package/dist/build/google-fonts/get-axes.js +37 -0
  23. package/dist/build/google-fonts/sort-variants.d.ts +4 -0
  24. package/dist/build/google-fonts/sort-variants.js +12 -0
  25. package/dist/build/google-fonts/validate.d.ts +27 -0
  26. package/dist/build/google-fonts/validate.js +54 -0
  27. package/dist/build/inline-css.d.ts +6 -0
  28. package/dist/build/inline-css.js +48 -0
  29. package/dist/build/layout-classification-types.d.ts +61 -0
  30. package/dist/build/layout-classification-types.js +1 -0
  31. package/dist/build/layout-classification.d.ts +59 -0
  32. package/dist/build/layout-classification.js +98 -0
  33. package/dist/build/next-client-runtime-manifests.d.ts +14 -0
  34. package/dist/build/next-client-runtime-manifests.js +39 -0
  35. package/dist/build/nitro-route-rules.d.ts +49 -0
  36. package/dist/build/nitro-route-rules.js +79 -0
  37. package/dist/build/precompress.d.ts +27 -0
  38. package/dist/build/precompress.js +110 -0
  39. package/dist/build/prerender.d.ts +209 -0
  40. package/dist/build/prerender.js +932 -0
  41. package/dist/build/report.d.ts +132 -0
  42. package/dist/build/report.js +504 -0
  43. package/dist/build/route-classification-injector.d.ts +34 -0
  44. package/dist/build/route-classification-injector.js +59 -0
  45. package/dist/build/route-classification-manifest.d.ts +52 -0
  46. package/dist/build/route-classification-manifest.js +143 -0
  47. package/dist/build/run-prerender.d.ts +61 -0
  48. package/dist/build/run-prerender.js +224 -0
  49. package/dist/build/server-manifest.d.ts +18 -0
  50. package/dist/build/server-manifest.js +22 -0
  51. package/dist/build/ssr-manifest.d.ts +18 -0
  52. package/dist/build/ssr-manifest.js +69 -0
  53. package/dist/build/standalone.d.ts +31 -0
  54. package/dist/build/standalone.js +203 -0
  55. package/dist/build/static-export.d.ts +55 -0
  56. package/dist/build/static-export.js +60 -0
  57. package/dist/cache/cache-adapters-virtual.d.ts +50 -0
  58. package/dist/cache/cache-adapters-virtual.js +45 -0
  59. package/dist/cache.d.ts +2 -0
  60. package/dist/cache.js +2 -0
  61. package/dist/check.d.ts +87 -0
  62. package/dist/check.js +1037 -0
  63. package/dist/cli-args.d.ts +33 -0
  64. package/dist/cli-args.js +124 -0
  65. package/dist/cli.d.ts +1 -0
  66. package/dist/cli.js +744 -0
  67. package/dist/client/app-nav-failure-handler.d.ts +8 -0
  68. package/dist/client/app-nav-failure-handler.js +44 -0
  69. package/dist/client/empty-module.d.ts +1 -0
  70. package/dist/client/empty-module.js +1 -0
  71. package/dist/client/instrumentation-client-inject.d.ts +33 -0
  72. package/dist/client/instrumentation-client-inject.js +55 -0
  73. package/dist/client/instrumentation-client-state.d.ts +9 -0
  74. package/dist/client/instrumentation-client-state.js +17 -0
  75. package/dist/client/instrumentation-client.d.ts +7 -0
  76. package/dist/client/instrumentation-client.js +6 -0
  77. package/dist/client/navigation-runtime.d.ts +70 -0
  78. package/dist/client/navigation-runtime.js +169 -0
  79. package/dist/client/pages-router-link-navigation.d.ts +61 -0
  80. package/dist/client/pages-router-link-navigation.js +42 -0
  81. package/dist/client/validate-module-path.d.ts +17 -0
  82. package/dist/client/validate-module-path.js +24 -0
  83. package/dist/client/vinext-next-data.d.ts +44 -0
  84. package/dist/client/vinext-next-data.js +50 -0
  85. package/dist/client/window-next.d.ts +168 -0
  86. package/dist/client/window-next.js +57 -0
  87. package/dist/cloudflare/index.d.ts +3 -0
  88. package/dist/cloudflare/index.js +3 -0
  89. package/dist/cloudflare/src/cache/cdn-adapter.runtime.js +102 -0
  90. package/dist/cloudflare/src/cache/kv-data-adapter.runtime.d.ts +126 -0
  91. package/dist/cloudflare/src/cache/kv-data-adapter.runtime.js +435 -0
  92. package/dist/cloudflare/src/utils/cache-control-metadata.js +20 -0
  93. package/dist/cloudflare/tpr.d.ts +82 -0
  94. package/dist/cloudflare/tpr.js +558 -0
  95. package/dist/config/config-matchers.d.ts +257 -0
  96. package/dist/config/config-matchers.js +1046 -0
  97. package/dist/config/dotenv.d.ts +56 -0
  98. package/dist/config/dotenv.js +88 -0
  99. package/dist/config/next-config.d.ts +540 -0
  100. package/dist/config/next-config.js +1050 -0
  101. package/dist/config/tsconfig-paths.d.ts +21 -0
  102. package/dist/config/tsconfig-paths.js +157 -0
  103. package/dist/deploy.d.ts +190 -0
  104. package/dist/deploy.js +1033 -0
  105. package/dist/entries/app-browser-entry.d.ts +29 -0
  106. package/dist/entries/app-browser-entry.js +83 -0
  107. package/dist/entries/app-rsc-entry.d.ts +81 -0
  108. package/dist/entries/app-rsc-entry.js +943 -0
  109. package/dist/entries/app-rsc-manifest.d.ts +53 -0
  110. package/dist/entries/app-rsc-manifest.js +294 -0
  111. package/dist/entries/app-ssr-entry.d.ts +15 -0
  112. package/dist/entries/app-ssr-entry.js +24 -0
  113. package/dist/entries/pages-client-entry.d.ts +11 -0
  114. package/dist/entries/pages-client-entry.js +204 -0
  115. package/dist/entries/pages-entry-helpers.d.ts +2 -0
  116. package/dist/entries/pages-entry-helpers.js +2 -0
  117. package/dist/entries/pages-server-entry.d.ts +11 -0
  118. package/dist/entries/pages-server-entry.js +398 -0
  119. package/dist/entries/runtime-entry-module.d.ts +25 -0
  120. package/dist/entries/runtime-entry-module.js +46 -0
  121. package/dist/index.d.ts +115 -0
  122. package/dist/index.js +2661 -0
  123. package/dist/init.d.ts +69 -0
  124. package/dist/init.js +253 -0
  125. package/dist/plugins/ast-utils.d.ts +20 -0
  126. package/dist/plugins/ast-utils.js +78 -0
  127. package/dist/plugins/async-hooks-stub.d.ts +18 -0
  128. package/dist/plugins/async-hooks-stub.js +40 -0
  129. package/dist/plugins/client-reference-dedup.d.ts +35 -0
  130. package/dist/plugins/client-reference-dedup.js +189 -0
  131. package/dist/plugins/css-data-url.d.ts +6 -0
  132. package/dist/plugins/css-data-url.js +83 -0
  133. package/dist/plugins/dynamic-preload-metadata.d.ts +13 -0
  134. package/dist/plugins/dynamic-preload-metadata.js +413 -0
  135. package/dist/plugins/extensionless-dynamic-import.d.ts +6 -0
  136. package/dist/plugins/extensionless-dynamic-import.js +155 -0
  137. package/dist/plugins/fonts.d.ts +95 -0
  138. package/dist/plugins/fonts.js +711 -0
  139. package/dist/plugins/import-meta-url.d.ts +16 -0
  140. package/dist/plugins/import-meta-url.js +353 -0
  141. package/dist/plugins/instrumentation-client.d.ts +6 -0
  142. package/dist/plugins/instrumentation-client.js +27 -0
  143. package/dist/plugins/middleware-export-validation.d.ts +5 -0
  144. package/dist/plugins/middleware-export-validation.js +36 -0
  145. package/dist/plugins/middleware-server-only.d.ts +53 -0
  146. package/dist/plugins/middleware-server-only.js +90 -0
  147. package/dist/plugins/og-asset-ownership.d.ts +27 -0
  148. package/dist/plugins/og-asset-ownership.js +285 -0
  149. package/dist/plugins/og-assets.d.ts +50 -0
  150. package/dist/plugins/og-assets.js +229 -0
  151. package/dist/plugins/optimize-imports.d.ts +42 -0
  152. package/dist/plugins/optimize-imports.js +587 -0
  153. package/dist/plugins/postcss.d.ts +26 -0
  154. package/dist/plugins/postcss.js +96 -0
  155. package/dist/plugins/remove-console.d.ts +21 -0
  156. package/dist/plugins/remove-console.js +177 -0
  157. package/dist/plugins/require-context.d.ts +6 -0
  158. package/dist/plugins/require-context.js +185 -0
  159. package/dist/plugins/rsc-client-reference-loaders.d.ts +6 -0
  160. package/dist/plugins/rsc-client-reference-loaders.js +46 -0
  161. package/dist/plugins/rsc-client-shim-excludes.d.ts +6 -0
  162. package/dist/plugins/rsc-client-shim-excludes.js +35 -0
  163. package/dist/plugins/sass.d.ts +62 -0
  164. package/dist/plugins/sass.js +268 -0
  165. package/dist/plugins/server-externals-manifest.d.ts +26 -0
  166. package/dist/plugins/server-externals-manifest.js +81 -0
  167. package/dist/plugins/strip-server-exports.d.ts +21 -0
  168. package/dist/plugins/strip-server-exports.js +519 -0
  169. package/dist/plugins/typeof-window.d.ts +14 -0
  170. package/dist/plugins/typeof-window.js +150 -0
  171. package/dist/plugins/wasm-module-import.d.ts +15 -0
  172. package/dist/plugins/wasm-module-import.js +50 -0
  173. package/dist/routing/app-route-graph.d.ts +336 -0
  174. package/dist/routing/app-route-graph.js +1518 -0
  175. package/dist/routing/app-router.d.ts +30 -0
  176. package/dist/routing/app-router.js +59 -0
  177. package/dist/routing/file-matcher.d.ts +60 -0
  178. package/dist/routing/file-matcher.js +147 -0
  179. package/dist/routing/pages-router.d.ts +48 -0
  180. package/dist/routing/pages-router.js +163 -0
  181. package/dist/routing/route-matching.d.ts +27 -0
  182. package/dist/routing/route-matching.js +42 -0
  183. package/dist/routing/route-pattern.d.ts +64 -0
  184. package/dist/routing/route-pattern.js +165 -0
  185. package/dist/routing/route-trie.d.ts +67 -0
  186. package/dist/routing/route-trie.js +143 -0
  187. package/dist/routing/route-validation.d.ts +10 -0
  188. package/dist/routing/route-validation.js +101 -0
  189. package/dist/routing/utils.d.ts +117 -0
  190. package/dist/routing/utils.js +242 -0
  191. package/dist/server/accept-encoding.d.ts +29 -0
  192. package/dist/server/accept-encoding.js +95 -0
  193. package/dist/server/api-handler.d.ts +17 -0
  194. package/dist/server/api-handler.js +276 -0
  195. package/dist/server/app-action-request.d.ts +4 -0
  196. package/dist/server/app-action-request.js +9 -0
  197. package/dist/server/app-bfcache-id.d.ts +5 -0
  198. package/dist/server/app-bfcache-id.js +5 -0
  199. package/dist/server/app-bfcache-identity.d.ts +36 -0
  200. package/dist/server/app-bfcache-identity.js +156 -0
  201. package/dist/server/app-browser-action-result.d.ts +64 -0
  202. package/dist/server/app-browser-action-result.js +111 -0
  203. package/dist/server/app-browser-client-reuse-manifest.d.ts +12 -0
  204. package/dist/server/app-browser-client-reuse-manifest.js +101 -0
  205. package/dist/server/app-browser-entry.d.ts +1 -0
  206. package/dist/server/app-browser-entry.js +1087 -0
  207. package/dist/server/app-browser-error.d.ts +13 -0
  208. package/dist/server/app-browser-error.js +52 -0
  209. package/dist/server/app-browser-history-controller.d.ts +104 -0
  210. package/dist/server/app-browser-history-controller.js +210 -0
  211. package/dist/server/app-browser-hydration.d.ts +32 -0
  212. package/dist/server/app-browser-hydration.js +29 -0
  213. package/dist/server/app-browser-interception-context.d.ts +24 -0
  214. package/dist/server/app-browser-interception-context.js +43 -0
  215. package/dist/server/app-browser-mpa-navigation.d.ts +16 -0
  216. package/dist/server/app-browser-mpa-navigation.js +42 -0
  217. package/dist/server/app-browser-navigation-controller.d.ts +109 -0
  218. package/dist/server/app-browser-navigation-controller.js +465 -0
  219. package/dist/server/app-browser-popstate.d.ts +26 -0
  220. package/dist/server/app-browser-popstate.js +44 -0
  221. package/dist/server/app-browser-rsc-redirect.d.ts +38 -0
  222. package/dist/server/app-browser-rsc-redirect.js +64 -0
  223. package/dist/server/app-browser-server-action-client.d.ts +32 -0
  224. package/dist/server/app-browser-server-action-client.js +128 -0
  225. package/dist/server/app-browser-server-action-navigation.d.ts +6 -0
  226. package/dist/server/app-browser-server-action-navigation.js +9 -0
  227. package/dist/server/app-browser-state.d.ts +140 -0
  228. package/dist/server/app-browser-state.js +315 -0
  229. package/dist/server/app-browser-stream.d.ts +28 -0
  230. package/dist/server/app-browser-stream.js +122 -0
  231. package/dist/server/app-browser-visible-commit.d.ts +78 -0
  232. package/dist/server/app-browser-visible-commit.js +241 -0
  233. package/dist/server/app-client-reference-preloader.d.ts +14 -0
  234. package/dist/server/app-client-reference-preloader.js +44 -0
  235. package/dist/server/app-elements-wire.d.ts +192 -0
  236. package/dist/server/app-elements-wire.js +443 -0
  237. package/dist/server/app-elements.d.ts +9 -0
  238. package/dist/server/app-elements.js +18 -0
  239. package/dist/server/app-fallback-renderer.d.ts +89 -0
  240. package/dist/server/app-fallback-renderer.js +136 -0
  241. package/dist/server/app-history-state.d.ts +85 -0
  242. package/dist/server/app-history-state.js +223 -0
  243. package/dist/server/app-hook-warning-suppression.d.ts +6 -0
  244. package/dist/server/app-hook-warning-suppression.js +10 -0
  245. package/dist/server/app-inline-css-client.d.ts +6 -0
  246. package/dist/server/app-inline-css-client.js +35 -0
  247. package/dist/server/app-interception-context-header.d.ts +32 -0
  248. package/dist/server/app-interception-context-header.js +42 -0
  249. package/dist/server/app-layout-param-observation.d.ts +43 -0
  250. package/dist/server/app-layout-param-observation.js +168 -0
  251. package/dist/server/app-middleware.d.ts +46 -0
  252. package/dist/server/app-middleware.js +168 -0
  253. package/dist/server/app-mounted-slots-header.d.ts +35 -0
  254. package/dist/server/app-mounted-slots-header.js +58 -0
  255. package/dist/server/app-optimistic-routing.d.ts +53 -0
  256. package/dist/server/app-optimistic-routing.js +227 -0
  257. package/dist/server/app-page-boundary-render.d.ts +85 -0
  258. package/dist/server/app-page-boundary-render.js +305 -0
  259. package/dist/server/app-page-boundary.d.ts +102 -0
  260. package/dist/server/app-page-boundary.js +120 -0
  261. package/dist/server/app-page-cache-finalizer.d.ts +62 -0
  262. package/dist/server/app-page-cache-finalizer.js +122 -0
  263. package/dist/server/app-page-cache-render.d.ts +53 -0
  264. package/dist/server/app-page-cache-render.js +91 -0
  265. package/dist/server/app-page-cache.d.ts +83 -0
  266. package/dist/server/app-page-cache.js +272 -0
  267. package/dist/server/app-page-dispatch.d.ts +223 -0
  268. package/dist/server/app-page-dispatch.js +610 -0
  269. package/dist/server/app-page-element-builder.d.ts +96 -0
  270. package/dist/server/app-page-element-builder.js +205 -0
  271. package/dist/server/app-page-execution.d.ts +138 -0
  272. package/dist/server/app-page-execution.js +328 -0
  273. package/dist/server/app-page-head.d.ts +65 -0
  274. package/dist/server/app-page-head.js +228 -0
  275. package/dist/server/app-page-method.d.ts +15 -0
  276. package/dist/server/app-page-method.js +25 -0
  277. package/dist/server/app-page-params.d.ts +8 -0
  278. package/dist/server/app-page-params.js +39 -0
  279. package/dist/server/app-page-ppr-runtime.d.ts +7 -0
  280. package/dist/server/app-page-ppr-runtime.js +70 -0
  281. package/dist/server/app-page-probe.d.ts +134 -0
  282. package/dist/server/app-page-probe.js +276 -0
  283. package/dist/server/app-page-render-identity.d.ts +21 -0
  284. package/dist/server/app-page-render-identity.js +40 -0
  285. package/dist/server/app-page-render-observation.d.ts +36 -0
  286. package/dist/server/app-page-render-observation.js +82 -0
  287. package/dist/server/app-page-render.d.ts +111 -0
  288. package/dist/server/app-page-render.js +602 -0
  289. package/dist/server/app-page-request.d.ts +137 -0
  290. package/dist/server/app-page-request.js +216 -0
  291. package/dist/server/app-page-response.d.ts +68 -0
  292. package/dist/server/app-page-response.js +120 -0
  293. package/dist/server/app-page-route-wiring.d.ts +151 -0
  294. package/dist/server/app-page-route-wiring.js +452 -0
  295. package/dist/server/app-page-search-params-observation.d.ts +10 -0
  296. package/dist/server/app-page-search-params-observation.js +20 -0
  297. package/dist/server/app-page-segment-state.d.ts +9 -0
  298. package/dist/server/app-page-segment-state.js +80 -0
  299. package/dist/server/app-page-stream.d.ts +151 -0
  300. package/dist/server/app-page-stream.js +143 -0
  301. package/dist/server/app-pages-bridge.d.ts +63 -0
  302. package/dist/server/app-pages-bridge.js +63 -0
  303. package/dist/server/app-post-middleware-context.d.ts +15 -0
  304. package/dist/server/app-post-middleware-context.js +26 -0
  305. package/dist/server/app-ppr-fallback-shell-render.d.ts +18 -0
  306. package/dist/server/app-ppr-fallback-shell-render.js +26 -0
  307. package/dist/server/app-ppr-fallback-shell.d.ts +33 -0
  308. package/dist/server/app-ppr-fallback-shell.js +89 -0
  309. package/dist/server/app-prerender-endpoints.d.ts +18 -0
  310. package/dist/server/app-prerender-endpoints.js +94 -0
  311. package/dist/server/app-prerender-static-params.d.ts +30 -0
  312. package/dist/server/app-prerender-static-params.js +81 -0
  313. package/dist/server/app-render-dependency.d.ts +14 -0
  314. package/dist/server/app-render-dependency.js +41 -0
  315. package/dist/server/app-request-context.d.ts +20 -0
  316. package/dist/server/app-request-context.js +29 -0
  317. package/dist/server/app-route-handler-cache.d.ts +46 -0
  318. package/dist/server/app-route-handler-cache.js +78 -0
  319. package/dist/server/app-route-handler-dispatch.d.ts +49 -0
  320. package/dist/server/app-route-handler-dispatch.js +163 -0
  321. package/dist/server/app-route-handler-execution.d.ts +86 -0
  322. package/dist/server/app-route-handler-execution.js +128 -0
  323. package/dist/server/app-route-handler-policy.d.ts +55 -0
  324. package/dist/server/app-route-handler-policy.js +58 -0
  325. package/dist/server/app-route-handler-response.d.ts +28 -0
  326. package/dist/server/app-route-handler-response.js +145 -0
  327. package/dist/server/app-route-handler-runtime.d.ts +39 -0
  328. package/dist/server/app-route-handler-runtime.js +250 -0
  329. package/dist/server/app-route-module-loader.d.ts +91 -0
  330. package/dist/server/app-route-module-loader.js +83 -0
  331. package/dist/server/app-router-entry.d.ts +13 -0
  332. package/dist/server/app-router-entry.js +49 -0
  333. package/dist/server/app-rsc-cache-busting.d.ts +64 -0
  334. package/dist/server/app-rsc-cache-busting.js +206 -0
  335. package/dist/server/app-rsc-embedded-chunks.d.ts +8 -0
  336. package/dist/server/app-rsc-embedded-chunks.js +32 -0
  337. package/dist/server/app-rsc-error-handler.d.ts +20 -0
  338. package/dist/server/app-rsc-error-handler.js +28 -0
  339. package/dist/server/app-rsc-errors.d.ts +40 -0
  340. package/dist/server/app-rsc-errors.js +60 -0
  341. package/dist/server/app-rsc-handler.d.ts +201 -0
  342. package/dist/server/app-rsc-handler.js +538 -0
  343. package/dist/server/app-rsc-render-mode.d.ts +11 -0
  344. package/dist/server/app-rsc-render-mode.js +25 -0
  345. package/dist/server/app-rsc-request-normalization.d.ts +48 -0
  346. package/dist/server/app-rsc-request-normalization.js +75 -0
  347. package/dist/server/app-rsc-response-finalizer.d.ts +37 -0
  348. package/dist/server/app-rsc-response-finalizer.js +54 -0
  349. package/dist/server/app-rsc-route-matching.d.ts +93 -0
  350. package/dist/server/app-rsc-route-matching.js +134 -0
  351. package/dist/server/app-segment-config.d.ts +46 -0
  352. package/dist/server/app-segment-config.js +113 -0
  353. package/dist/server/app-server-action-execution.d.ts +219 -0
  354. package/dist/server/app-server-action-execution.js +767 -0
  355. package/dist/server/app-ssr-entry.d.ts +52 -0
  356. package/dist/server/app-ssr-entry.js +295 -0
  357. package/dist/server/app-ssr-error-meta.d.ts +13 -0
  358. package/dist/server/app-ssr-error-meta.js +48 -0
  359. package/dist/server/app-ssr-router-instance.d.ts +6 -0
  360. package/dist/server/app-ssr-router-instance.js +24 -0
  361. package/dist/server/app-ssr-stream.d.ts +60 -0
  362. package/dist/server/app-ssr-stream.js +408 -0
  363. package/dist/server/app-static-generation.d.ts +15 -0
  364. package/dist/server/app-static-generation.js +19 -0
  365. package/dist/server/app-visited-response-cache.d.ts +23 -0
  366. package/dist/server/app-visited-response-cache.js +19 -0
  367. package/dist/server/artifact-compatibility.d.ts +54 -0
  368. package/dist/server/artifact-compatibility.js +91 -0
  369. package/dist/server/before-interactive-head.d.ts +17 -0
  370. package/dist/server/before-interactive-head.js +35 -0
  371. package/dist/server/cache-control.d.ts +37 -0
  372. package/dist/server/cache-control.js +56 -0
  373. package/dist/server/cache-headers.d.ts +6 -0
  374. package/dist/server/cache-headers.js +17 -0
  375. package/dist/server/cache-proof.d.ts +364 -0
  376. package/dist/server/cache-proof.js +794 -0
  377. package/dist/server/client-reuse-manifest.d.ts +104 -0
  378. package/dist/server/client-reuse-manifest.js +209 -0
  379. package/dist/server/client-trace-metadata.d.ts +30 -0
  380. package/dist/server/client-trace-metadata.js +81 -0
  381. package/dist/server/cookie-utils.d.ts +12 -0
  382. package/dist/server/cookie-utils.js +18 -0
  383. package/dist/server/csp.d.ts +10 -0
  384. package/dist/server/csp.js +41 -0
  385. package/dist/server/default-global-error-module.d.ts +19 -0
  386. package/dist/server/default-global-error-module.js +18 -0
  387. package/dist/server/default-not-found-module.d.ts +19 -0
  388. package/dist/server/default-not-found-module.js +18 -0
  389. package/dist/server/defer-until-stream-consumed.d.ts +7 -0
  390. package/dist/server/defer-until-stream-consumed.js +34 -0
  391. package/dist/server/dev-error-overlay-store.d.ts +39 -0
  392. package/dist/server/dev-error-overlay-store.js +86 -0
  393. package/dist/server/dev-error-overlay.d.ts +51 -0
  394. package/dist/server/dev-error-overlay.js +1341 -0
  395. package/dist/server/dev-initial-server-error.d.ts +9 -0
  396. package/dist/server/dev-initial-server-error.js +26 -0
  397. package/dist/server/dev-lockfile.d.ts +109 -0
  398. package/dist/server/dev-lockfile.js +179 -0
  399. package/dist/server/dev-module-runner.d.ts +30 -0
  400. package/dist/server/dev-module-runner.js +91 -0
  401. package/dist/server/dev-origin-check.d.ts +62 -0
  402. package/dist/server/dev-origin-check.js +156 -0
  403. package/dist/server/dev-route-files.d.ts +6 -0
  404. package/dist/server/dev-route-files.js +71 -0
  405. package/dist/server/dev-server.d.ts +58 -0
  406. package/dist/server/dev-server.js +1114 -0
  407. package/dist/server/dev-stack-sourcemap-endpoint.d.ts +4 -0
  408. package/dist/server/dev-stack-sourcemap-endpoint.js +4 -0
  409. package/dist/server/dev-stack-sourcemap.d.ts +43 -0
  410. package/dist/server/dev-stack-sourcemap.js +443 -0
  411. package/dist/server/document-initial-head.d.ts +6 -0
  412. package/dist/server/document-initial-head.js +33 -0
  413. package/dist/server/edge-api-runtime.d.ts +4 -0
  414. package/dist/server/edge-api-runtime.js +6 -0
  415. package/dist/server/file-based-metadata.d.ts +29 -0
  416. package/dist/server/file-based-metadata.js +401 -0
  417. package/dist/server/headers.d.ts +114 -0
  418. package/dist/server/headers.js +136 -0
  419. package/dist/server/html.d.ts +28 -0
  420. package/dist/server/html.js +41 -0
  421. package/dist/server/http-error-responses.d.ts +91 -0
  422. package/dist/server/http-error-responses.js +105 -0
  423. package/dist/server/hybrid-route-priority.d.ts +22 -0
  424. package/dist/server/hybrid-route-priority.js +33 -0
  425. package/dist/server/image-optimization.d.ts +130 -0
  426. package/dist/server/image-optimization.js +247 -0
  427. package/dist/server/implicit-tags.d.ts +6 -0
  428. package/dist/server/implicit-tags.js +44 -0
  429. package/dist/server/instrumentation-runtime.d.ts +49 -0
  430. package/dist/server/instrumentation-runtime.js +35 -0
  431. package/dist/server/instrumentation.d.ts +85 -0
  432. package/dist/server/instrumentation.js +130 -0
  433. package/dist/server/isr-cache.d.ts +127 -0
  434. package/dist/server/isr-cache.js +282 -0
  435. package/dist/server/isr-decision.d.ts +79 -0
  436. package/dist/server/isr-decision.js +70 -0
  437. package/dist/server/metadata-route-build-data.d.ts +24 -0
  438. package/dist/server/metadata-route-build-data.js +148 -0
  439. package/dist/server/metadata-route-response.d.ts +16 -0
  440. package/dist/server/metadata-route-response.js +205 -0
  441. package/dist/server/metadata-routes.d.ts +139 -0
  442. package/dist/server/metadata-routes.js +433 -0
  443. package/dist/server/middleware-matcher.d.ts +14 -0
  444. package/dist/server/middleware-matcher.js +111 -0
  445. package/dist/server/middleware-request-headers.d.ts +11 -0
  446. package/dist/server/middleware-request-headers.js +65 -0
  447. package/dist/server/middleware-response-headers.d.ts +12 -0
  448. package/dist/server/middleware-response-headers.js +42 -0
  449. package/dist/server/middleware-runtime.d.ts +67 -0
  450. package/dist/server/middleware-runtime.js +240 -0
  451. package/dist/server/middleware.d.ts +62 -0
  452. package/dist/server/middleware.js +114 -0
  453. package/dist/server/navigation-planner.d.ts +308 -0
  454. package/dist/server/navigation-planner.js +831 -0
  455. package/dist/server/navigation-trace.d.ts +68 -0
  456. package/dist/server/navigation-trace.js +71 -0
  457. package/dist/server/next-error-digest.d.ts +44 -0
  458. package/dist/server/next-error-digest.js +40 -0
  459. package/dist/server/normalize-path.d.ts +38 -0
  460. package/dist/server/normalize-path.js +70 -0
  461. package/dist/server/open-redirect.d.ts +12 -0
  462. package/dist/server/open-redirect.js +21 -0
  463. package/dist/server/operation-token.d.ts +40 -0
  464. package/dist/server/operation-token.js +85 -0
  465. package/dist/server/otel-tracer-extension.d.ts +45 -0
  466. package/dist/server/otel-tracer-extension.js +89 -0
  467. package/dist/server/pages-api-route.d.ts +83 -0
  468. package/dist/server/pages-api-route.js +75 -0
  469. package/dist/server/pages-asset-tags.d.ts +78 -0
  470. package/dist/server/pages-asset-tags.js +126 -0
  471. package/dist/server/pages-body-parser-config.d.ts +59 -0
  472. package/dist/server/pages-body-parser-config.js +77 -0
  473. package/dist/server/pages-data-route.d.ts +121 -0
  474. package/dist/server/pages-data-route.js +157 -0
  475. package/dist/server/pages-default-404.d.ts +30 -0
  476. package/dist/server/pages-default-404.js +38 -0
  477. package/dist/server/pages-dev-module-url.d.ts +4 -0
  478. package/dist/server/pages-dev-module-url.js +15 -0
  479. package/dist/server/pages-document-initial-props.d.ts +77 -0
  480. package/dist/server/pages-document-initial-props.js +109 -0
  481. package/dist/server/pages-get-initial-props.d.ts +67 -0
  482. package/dist/server/pages-get-initial-props.js +92 -0
  483. package/dist/server/pages-i18n.d.ts +106 -0
  484. package/dist/server/pages-i18n.js +183 -0
  485. package/dist/server/pages-media-type.d.ts +15 -0
  486. package/dist/server/pages-media-type.js +24 -0
  487. package/dist/server/pages-node-compat.d.ts +55 -0
  488. package/dist/server/pages-node-compat.js +235 -0
  489. package/dist/server/pages-page-data.d.ts +223 -0
  490. package/dist/server/pages-page-data.js +484 -0
  491. package/dist/server/pages-page-handler.d.ts +100 -0
  492. package/dist/server/pages-page-handler.js +403 -0
  493. package/dist/server/pages-page-method.d.ts +47 -0
  494. package/dist/server/pages-page-method.js +17 -0
  495. package/dist/server/pages-page-response.d.ts +138 -0
  496. package/dist/server/pages-page-response.js +285 -0
  497. package/dist/server/pages-readiness.d.ts +36 -0
  498. package/dist/server/pages-readiness.js +21 -0
  499. package/dist/server/pages-request-pipeline.d.ts +116 -0
  500. package/dist/server/pages-request-pipeline.js +311 -0
  501. package/dist/server/pages-revalidate.d.ts +15 -0
  502. package/dist/server/pages-revalidate.js +19 -0
  503. package/dist/server/pages-serializable-props.d.ts +24 -0
  504. package/dist/server/pages-serializable-props.js +67 -0
  505. package/dist/server/pregenerated-concrete-paths.d.ts +16 -0
  506. package/dist/server/pregenerated-concrete-paths.js +61 -0
  507. package/dist/server/prerender-manifest.d.ts +33 -0
  508. package/dist/server/prerender-manifest.js +54 -0
  509. package/dist/server/prerender-route-params.d.ts +23 -0
  510. package/dist/server/prerender-route-params.js +113 -0
  511. package/dist/server/prerender-work-unit-setup.d.ts +6 -0
  512. package/dist/server/prerender-work-unit-setup.js +28 -0
  513. package/dist/server/prod-server.d.ts +148 -0
  514. package/dist/server/prod-server.js +1136 -0
  515. package/dist/server/proxy-trust.d.ts +40 -0
  516. package/dist/server/proxy-trust.js +68 -0
  517. package/dist/server/request-log.d.ts +39 -0
  518. package/dist/server/request-log.js +56 -0
  519. package/dist/server/request-pipeline.d.ts +187 -0
  520. package/dist/server/request-pipeline.js +447 -0
  521. package/dist/server/rsc-stream-hints.d.ts +10 -0
  522. package/dist/server/rsc-stream-hints.js +41 -0
  523. package/dist/server/seed-cache.d.ts +29 -0
  524. package/dist/server/seed-cache.js +125 -0
  525. package/dist/server/server-action-not-found.d.ts +21 -0
  526. package/dist/server/server-action-not-found.js +62 -0
  527. package/dist/server/server-globals.d.ts +4 -0
  528. package/dist/server/server-globals.js +35 -0
  529. package/dist/server/skip-cache-proof.d.ts +61 -0
  530. package/dist/server/skip-cache-proof.js +168 -0
  531. package/dist/server/socket-error-backstop.d.ts +34 -0
  532. package/dist/server/socket-error-backstop.js +200 -0
  533. package/dist/server/static-file-cache.d.ts +56 -0
  534. package/dist/server/static-file-cache.js +231 -0
  535. package/dist/server/static-layout-client-reuse-proof.d.ts +15 -0
  536. package/dist/server/static-layout-client-reuse-proof.js +33 -0
  537. package/dist/server/streaming-metadata.d.ts +4 -0
  538. package/dist/server/streaming-metadata.js +8 -0
  539. package/dist/server/worker-utils.d.ts +7 -0
  540. package/dist/server/worker-utils.js +99 -0
  541. package/dist/shims/amp.d.ts +19 -0
  542. package/dist/shims/amp.js +23 -0
  543. package/dist/shims/app-router-scroll-state.d.ts +15 -0
  544. package/dist/shims/app-router-scroll-state.js +61 -0
  545. package/dist/shims/app-router-scroll.d.ts +29 -0
  546. package/dist/shims/app-router-scroll.js +141 -0
  547. package/dist/shims/app.d.ts +42 -0
  548. package/dist/shims/app.js +48 -0
  549. package/dist/shims/before-interactive-context.d.ts +40 -0
  550. package/dist/shims/before-interactive-context.js +8 -0
  551. package/dist/shims/cache-for-request.d.ts +57 -0
  552. package/dist/shims/cache-for-request.js +72 -0
  553. package/dist/shims/cache-handler.d.ts +106 -0
  554. package/dist/shims/cache-handler.js +176 -0
  555. package/dist/shims/cache-request-state.d.ts +47 -0
  556. package/dist/shims/cache-request-state.js +126 -0
  557. package/dist/shims/cache-runtime.d.ts +83 -0
  558. package/dist/shims/cache-runtime.js +452 -0
  559. package/dist/shims/cache.d.ts +145 -0
  560. package/dist/shims/cache.js +401 -0
  561. package/dist/shims/cdn-cache.d.ts +125 -0
  562. package/dist/shims/cdn-cache.js +100 -0
  563. package/dist/shims/client-hook-error.d.ts +13 -0
  564. package/dist/shims/client-hook-error.js +17 -0
  565. package/dist/shims/client-locale.d.ts +14 -0
  566. package/dist/shims/client-locale.js +11 -0
  567. package/dist/shims/client-only.d.ts +1 -0
  568. package/dist/shims/client-only.js +1 -0
  569. package/dist/shims/compat-router.d.ts +16 -0
  570. package/dist/shims/compat-router.js +25 -0
  571. package/dist/shims/config.d.ts +28 -0
  572. package/dist/shims/config.js +21 -0
  573. package/dist/shims/constants.d.ts +130 -0
  574. package/dist/shims/constants.js +167 -0
  575. package/dist/shims/default-global-error.d.ts +31 -0
  576. package/dist/shims/default-global-error.js +179 -0
  577. package/dist/shims/default-not-found.d.ts +11 -0
  578. package/dist/shims/default-not-found.js +59 -0
  579. package/dist/shims/document.d.ts +92 -0
  580. package/dist/shims/document.js +76 -0
  581. package/dist/shims/dynamic-preload-chunks.d.ts +8 -0
  582. package/dist/shims/dynamic-preload-chunks.js +79 -0
  583. package/dist/shims/dynamic.d.ts +35 -0
  584. package/dist/shims/dynamic.js +204 -0
  585. package/dist/shims/error-boundary-navigation.d.ts +7 -0
  586. package/dist/shims/error-boundary-navigation.js +44 -0
  587. package/dist/shims/error-boundary.d.ts +155 -0
  588. package/dist/shims/error-boundary.js +342 -0
  589. package/dist/shims/error.d.ts +31 -0
  590. package/dist/shims/error.js +123 -0
  591. package/dist/shims/error.react-server.d.ts +9 -0
  592. package/dist/shims/error.react-server.js +6 -0
  593. package/dist/shims/fetch-cache.d.ts +136 -0
  594. package/dist/shims/fetch-cache.js +766 -0
  595. package/dist/shims/font-google-base.d.ts +83 -0
  596. package/dist/shims/font-google-base.js +290 -0
  597. package/dist/shims/font-google.d.ts +2 -0
  598. package/dist/shims/font-google.js +2 -0
  599. package/dist/shims/font-local.d.ts +50 -0
  600. package/dist/shims/font-local.js +195 -0
  601. package/dist/shims/font-utils.d.ts +56 -0
  602. package/dist/shims/font-utils.js +107 -0
  603. package/dist/shims/form.d.ts +19 -0
  604. package/dist/shims/form.js +236 -0
  605. package/dist/shims/hash-scroll.d.ts +10 -0
  606. package/dist/shims/hash-scroll.js +47 -0
  607. package/dist/shims/head-state.d.ts +16 -0
  608. package/dist/shims/head-state.js +43 -0
  609. package/dist/shims/head.d.ts +73 -0
  610. package/dist/shims/head.js +340 -0
  611. package/dist/shims/headers.d.ts +253 -0
  612. package/dist/shims/headers.js +754 -0
  613. package/dist/shims/i18n-context.d.ts +22 -0
  614. package/dist/shims/i18n-context.js +42 -0
  615. package/dist/shims/i18n-state.d.ts +14 -0
  616. package/dist/shims/i18n-state.js +38 -0
  617. package/dist/shims/image-config.d.ts +45 -0
  618. package/dist/shims/image-config.js +85 -0
  619. package/dist/shims/image.d.ts +55 -0
  620. package/dist/shims/image.js +582 -0
  621. package/dist/shims/internal/als-registry.d.ts +14 -0
  622. package/dist/shims/internal/als-registry.js +80 -0
  623. package/dist/shims/internal/api-utils.d.ts +14 -0
  624. package/dist/shims/internal/api-utils.js +1 -0
  625. package/dist/shims/internal/app-page-props-cache-key.d.ts +5 -0
  626. package/dist/shims/internal/app-page-props-cache-key.js +16 -0
  627. package/dist/shims/internal/app-route-detection.d.ts +39 -0
  628. package/dist/shims/internal/app-route-detection.js +62 -0
  629. package/dist/shims/internal/app-router-context.d.ts +31 -0
  630. package/dist/shims/internal/app-router-context.js +28 -0
  631. package/dist/shims/internal/cookie-serialize.d.ts +45 -0
  632. package/dist/shims/internal/cookie-serialize.js +49 -0
  633. package/dist/shims/internal/cookies.d.ts +2 -0
  634. package/dist/shims/internal/cookies.js +2 -0
  635. package/dist/shims/internal/hybrid-client-route-owner.d.ts +31 -0
  636. package/dist/shims/internal/hybrid-client-route-owner.js +143 -0
  637. package/dist/shims/internal/interpolate-as.d.ts +25 -0
  638. package/dist/shims/internal/interpolate-as.js +196 -0
  639. package/dist/shims/internal/link-status-registry.d.ts +43 -0
  640. package/dist/shims/internal/link-status-registry.js +42 -0
  641. package/dist/shims/internal/make-hanging-promise.d.ts +15 -0
  642. package/dist/shims/internal/make-hanging-promise.js +44 -0
  643. package/dist/shims/internal/navigation-untracked.d.ts +35 -0
  644. package/dist/shims/internal/navigation-untracked.js +56 -0
  645. package/dist/shims/internal/pages-data-fetch-dedup.d.ts +54 -0
  646. package/dist/shims/internal/pages-data-fetch-dedup.js +121 -0
  647. package/dist/shims/internal/pages-data-target.d.ts +62 -0
  648. package/dist/shims/internal/pages-data-target.js +98 -0
  649. package/dist/shims/internal/pages-data-url.d.ts +41 -0
  650. package/dist/shims/internal/pages-data-url.js +71 -0
  651. package/dist/shims/internal/pages-router-accessor.d.ts +19 -0
  652. package/dist/shims/internal/pages-router-accessor.js +13 -0
  653. package/dist/shims/internal/route-pattern-for-warning.d.ts +27 -0
  654. package/dist/shims/internal/route-pattern-for-warning.js +40 -0
  655. package/dist/shims/internal/router-context.d.ts +7 -0
  656. package/dist/shims/internal/router-context.js +13 -0
  657. package/dist/shims/internal/utils.d.ts +52 -0
  658. package/dist/shims/internal/utils.js +27 -0
  659. package/dist/shims/internal/work-unit-async-storage.d.ts +30 -0
  660. package/dist/shims/internal/work-unit-async-storage.js +17 -0
  661. package/dist/shims/layout-segment-context.d.ts +24 -0
  662. package/dist/shims/layout-segment-context.js +39 -0
  663. package/dist/shims/legacy-image.d.ts +41 -0
  664. package/dist/shims/legacy-image.js +49 -0
  665. package/dist/shims/link-prefetch.d.ts +41 -0
  666. package/dist/shims/link-prefetch.js +43 -0
  667. package/dist/shims/link.d.ts +102 -0
  668. package/dist/shims/link.js +687 -0
  669. package/dist/shims/metadata.d.ts +285 -0
  670. package/dist/shims/metadata.js +820 -0
  671. package/dist/shims/navigation-context-state.d.ts +40 -0
  672. package/dist/shims/navigation-context-state.js +116 -0
  673. package/dist/shims/navigation-errors.d.ts +55 -0
  674. package/dist/shims/navigation-errors.js +110 -0
  675. package/dist/shims/navigation-server.d.ts +3 -0
  676. package/dist/shims/navigation-server.js +3 -0
  677. package/dist/shims/navigation-state.d.ts +25 -0
  678. package/dist/shims/navigation-state.js +66 -0
  679. package/dist/shims/navigation.d.ts +286 -0
  680. package/dist/shims/navigation.js +1206 -0
  681. package/dist/shims/navigation.react-server.d.ts +14 -0
  682. package/dist/shims/navigation.react-server.js +32 -0
  683. package/dist/shims/offline.d.ts +4 -0
  684. package/dist/shims/offline.js +15 -0
  685. package/dist/shims/og.d.ts +17 -0
  686. package/dist/shims/og.js +48 -0
  687. package/dist/shims/pages-router-runtime.d.ts +12 -0
  688. package/dist/shims/pages-router-runtime.js +24 -0
  689. package/dist/shims/ppr-fallback-shell.d.ts +33 -0
  690. package/dist/shims/ppr-fallback-shell.js +170 -0
  691. package/dist/shims/readonly-url-search-params.d.ts +13 -0
  692. package/dist/shims/readonly-url-search-params.js +26 -0
  693. package/dist/shims/request-context.d.ts +58 -0
  694. package/dist/shims/request-context.js +45 -0
  695. package/dist/shims/request-state-types.d.ts +12 -0
  696. package/dist/shims/request-state-types.js +1 -0
  697. package/dist/shims/root-params.d.ts +12 -0
  698. package/dist/shims/root-params.js +30 -0
  699. package/dist/shims/router-state.d.ts +32 -0
  700. package/dist/shims/router-state.js +39 -0
  701. package/dist/shims/router.d.ts +192 -0
  702. package/dist/shims/router.js +1786 -0
  703. package/dist/shims/script-nonce-context.d.ts +11 -0
  704. package/dist/shims/script-nonce-context.js +23 -0
  705. package/dist/shims/script.d.ts +43 -0
  706. package/dist/shims/script.js +370 -0
  707. package/dist/shims/server-only.d.ts +1 -0
  708. package/dist/shims/server-only.js +1 -0
  709. package/dist/shims/server.d.ts +323 -0
  710. package/dist/shims/server.js +729 -0
  711. package/dist/shims/slot.d.ts +45 -0
  712. package/dist/shims/slot.js +230 -0
  713. package/dist/shims/thenable-params.d.ts +11 -0
  714. package/dist/shims/thenable-params.js +176 -0
  715. package/dist/shims/unified-request-context.d.ts +68 -0
  716. package/dist/shims/unified-request-context.js +86 -0
  717. package/dist/shims/unrecognized-action-error.d.ts +34 -0
  718. package/dist/shims/unrecognized-action-error.js +39 -0
  719. package/dist/shims/url-safety.d.ts +34 -0
  720. package/dist/shims/url-safety.js +70 -0
  721. package/dist/shims/url-utils.d.ts +51 -0
  722. package/dist/shims/url-utils.js +156 -0
  723. package/dist/shims/use-merged-ref.d.ts +6 -0
  724. package/dist/shims/use-merged-ref.js +38 -0
  725. package/dist/shims/web-vitals.d.ts +8 -0
  726. package/dist/shims/web-vitals.js +22 -0
  727. package/dist/typegen.d.ts +9 -0
  728. package/dist/typegen.js +228 -0
  729. package/dist/utils/asset-prefix.d.ts +96 -0
  730. package/dist/utils/asset-prefix.js +122 -0
  731. package/dist/utils/base-path.d.ts +31 -0
  732. package/dist/utils/base-path.js +45 -0
  733. package/dist/utils/built-asset-url.d.ts +4 -0
  734. package/dist/utils/built-asset-url.js +11 -0
  735. package/dist/utils/cache-control-metadata.d.ts +4 -0
  736. package/dist/utils/cache-control-metadata.js +12 -0
  737. package/dist/utils/client-build-manifest.d.ts +21 -0
  738. package/dist/utils/client-build-manifest.js +87 -0
  739. package/dist/utils/client-entry-manifest.d.ts +11 -0
  740. package/dist/utils/client-entry-manifest.js +29 -0
  741. package/dist/utils/client-runtime-metadata.d.ts +45 -0
  742. package/dist/utils/client-runtime-metadata.js +63 -0
  743. package/dist/utils/commonjs-loader.d.ts +16 -0
  744. package/dist/utils/commonjs-loader.js +100 -0
  745. package/dist/utils/compare.d.ts +4 -0
  746. package/dist/utils/compare.js +8 -0
  747. package/dist/utils/deployment-id.d.ts +8 -0
  748. package/dist/utils/deployment-id.js +22 -0
  749. package/dist/utils/dev-error-recovery-event.d.ts +4 -0
  750. package/dist/utils/dev-error-recovery-event.js +4 -0
  751. package/dist/utils/domain-locale.d.ts +26 -0
  752. package/dist/utils/domain-locale.js +50 -0
  753. package/dist/utils/encode-cache-tag.d.ts +30 -0
  754. package/dist/utils/encode-cache-tag.js +36 -0
  755. package/dist/utils/error-cause.d.ts +4 -0
  756. package/dist/utils/error-cause.js +95 -0
  757. package/dist/utils/has-trailing-comma.d.ts +24 -0
  758. package/dist/utils/has-trailing-comma.js +62 -0
  759. package/dist/utils/hash.d.ts +24 -0
  760. package/dist/utils/hash.js +55 -0
  761. package/dist/utils/html-limited-bots.d.ts +21 -0
  762. package/dist/utils/html-limited-bots.js +35 -0
  763. package/dist/utils/lazy-chunks.d.ts +59 -0
  764. package/dist/utils/lazy-chunks.js +112 -0
  765. package/dist/utils/manifest-paths.d.ts +30 -0
  766. package/dist/utils/manifest-paths.js +66 -0
  767. package/dist/utils/mdx-scan.d.ts +9 -0
  768. package/dist/utils/mdx-scan.js +34 -0
  769. package/dist/utils/navigation-signal.d.ts +4 -0
  770. package/dist/utils/navigation-signal.js +12 -0
  771. package/dist/utils/number.d.ts +4 -0
  772. package/dist/utils/number.js +6 -0
  773. package/dist/utils/parse-cookie.d.ts +13 -0
  774. package/dist/utils/parse-cookie.js +52 -0
  775. package/dist/utils/path.d.ts +22 -0
  776. package/dist/utils/path.js +30 -0
  777. package/dist/utils/prerender-output-paths.d.ts +14 -0
  778. package/dist/utils/prerender-output-paths.js +22 -0
  779. package/dist/utils/project.d.ts +76 -0
  780. package/dist/utils/project.js +213 -0
  781. package/dist/utils/promise.d.ts +4 -0
  782. package/dist/utils/promise.js +6 -0
  783. package/dist/utils/public-routes.d.ts +4 -0
  784. package/dist/utils/public-routes.js +48 -0
  785. package/dist/utils/query.d.ts +49 -0
  786. package/dist/utils/query.js +122 -0
  787. package/dist/utils/record.d.ts +4 -0
  788. package/dist/utils/record.js +6 -0
  789. package/dist/utils/regex.d.ts +4 -0
  790. package/dist/utils/regex.js +6 -0
  791. package/dist/utils/safe-json-file.d.ts +17 -0
  792. package/dist/utils/safe-json-file.js +23 -0
  793. package/dist/utils/sorted-array.d.ts +8 -0
  794. package/dist/utils/sorted-array.js +20 -0
  795. package/dist/utils/text-stream.d.ts +28 -0
  796. package/dist/utils/text-stream.js +64 -0
  797. package/dist/utils/vinext-root.d.ts +23 -0
  798. package/dist/utils/vinext-root.js +29 -0
  799. package/dist/utils/virtual-module.d.ts +5 -0
  800. package/dist/utils/virtual-module.js +0 -0
  801. package/dist/utils/vite-version.d.ts +21 -0
  802. package/dist/utils/vite-version.js +42 -0
  803. package/package.json +145 -0
package/dist/check.js ADDED
@@ -0,0 +1,1037 @@
1
+ import { detectPackageManager, findDir } from "./utils/project.js";
2
+ import { normalizePathSeparators } from "./utils/path.js";
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import { parseAst } from "vite";
6
+ //#region src/check.ts
7
+ /**
8
+ * vinext check — compatibility scanner for Next.js apps
9
+ *
10
+ * Scans an existing Next.js app and produces a compatibility report
11
+ * showing what will work, what needs changes, and an overall score.
12
+ */
13
+ /** Sort order for statuses: unsupported first, then partial, then supported. */
14
+ const STATUS_ORDER = {
15
+ unsupported: 0,
16
+ partial: 1,
17
+ supported: 2
18
+ };
19
+ /** Comparator for sorting items by status (unsupported first). */
20
+ function compareByStatus(a, b) {
21
+ return STATUS_ORDER[a.status] - STATUS_ORDER[b.status];
22
+ }
23
+ /**
24
+ * App Router file conventions. Each convention lists the extensions that the
25
+ * Next.js docs recognise for that file type — note that the boundary files
26
+ * (loading/error/not-found) only exist as React components, so they don't
27
+ * accept `.ts`/`.js`.
28
+ */
29
+ const APP_ROUTER_EXTENSIONS = {
30
+ page: [
31
+ ".tsx",
32
+ ".jsx",
33
+ ".ts",
34
+ ".js"
35
+ ],
36
+ layout: [
37
+ ".tsx",
38
+ ".jsx",
39
+ ".ts",
40
+ ".js"
41
+ ],
42
+ loading: [".tsx", ".jsx"],
43
+ error: [".tsx", ".jsx"],
44
+ "not-found": [".tsx", ".jsx"]
45
+ };
46
+ /** True if `file` is an App Router file of the given convention. */
47
+ function isAppRouterFile(file, type) {
48
+ return APP_ROUTER_EXTENSIONS[type].some((ext) => file.endsWith(`${type}${ext}`));
49
+ }
50
+ const IMPORT_SUPPORT = {
51
+ next: {
52
+ status: "supported",
53
+ detail: "type-only exports (Metadata, NextPage, etc.)"
54
+ },
55
+ "next/link": { status: "supported" },
56
+ "next/image": {
57
+ status: "supported",
58
+ detail: "uses @unpic/react (no local optimization yet)"
59
+ },
60
+ "next/legacy/image": {
61
+ status: "supported",
62
+ detail: "pre-Next.js 13 Image API with layout prop; translated to modern Image"
63
+ },
64
+ "next/router": { status: "supported" },
65
+ "next/compat/router": {
66
+ status: "supported",
67
+ detail: "useRouter() returns null in App Router, router object in Pages Router"
68
+ },
69
+ "next/navigation": { status: "supported" },
70
+ "next/headers": { status: "supported" },
71
+ "next/server": {
72
+ status: "supported",
73
+ detail: "NextRequest/NextResponse shimmed"
74
+ },
75
+ "next/cache": {
76
+ status: "supported",
77
+ detail: "revalidateTag, revalidatePath, unstable_cache, io, cacheLife, cacheTag"
78
+ },
79
+ "next/dynamic": { status: "supported" },
80
+ "next/head": { status: "supported" },
81
+ "next/script": { status: "supported" },
82
+ "next/font/google": {
83
+ status: "partial",
84
+ detail: "fonts loaded from CDN, not self-hosted at build time"
85
+ },
86
+ "next/font/local": {
87
+ status: "supported",
88
+ detail: "className and variable modes both work; no build-time subsetting"
89
+ },
90
+ "next/og": {
91
+ status: "supported",
92
+ detail: "ImageResponse via @vercel/og"
93
+ },
94
+ "next/config": { status: "supported" },
95
+ "next/amp": {
96
+ status: "unsupported",
97
+ detail: "AMP is not supported"
98
+ },
99
+ "next/offline": {
100
+ status: "partial",
101
+ detail: "useOffline() hook available; offline retry behavior deferred"
102
+ },
103
+ "next/document": {
104
+ status: "supported",
105
+ detail: "custom _document.tsx"
106
+ },
107
+ "next/app": {
108
+ status: "supported",
109
+ detail: "custom _app.tsx"
110
+ },
111
+ "next/error": { status: "supported" },
112
+ "next/form": {
113
+ status: "supported",
114
+ detail: "Form component with client-side navigation"
115
+ },
116
+ "next/web-vitals": {
117
+ status: "supported",
118
+ detail: "reportWebVitals helper"
119
+ },
120
+ "next/constants": {
121
+ status: "supported",
122
+ detail: "PHASE_* constants"
123
+ },
124
+ "next/third-parties/google": {
125
+ status: "unsupported",
126
+ detail: "third-party script optimization not implemented"
127
+ },
128
+ "server-only": { status: "supported" },
129
+ "client-only": { status: "supported" },
130
+ "next/dist/shared/lib/router-context.shared-runtime": {
131
+ status: "supported",
132
+ detail: "RouterContext for Pages Router; used by testing utilities and older libraries"
133
+ },
134
+ "next/dist/shared/lib/app-router-context.shared-runtime": {
135
+ status: "supported",
136
+ detail: "AppRouterContext and layout contexts; used by testing utilities and UI libraries"
137
+ },
138
+ "next/dist/shared/lib/app-router-context": {
139
+ status: "supported",
140
+ detail: "AppRouterContext and layout contexts; used by testing utilities and UI libraries"
141
+ },
142
+ "next/dist/shared/lib/utils": {
143
+ status: "supported",
144
+ detail: "execOnce, getLocationOrigin and other shared utilities"
145
+ },
146
+ "next/dist/server/api-utils": {
147
+ status: "supported",
148
+ detail: "NextApiRequestCookies and Pages Router API route utilities"
149
+ },
150
+ "next/dist/server/web/spec-extension/cookies": {
151
+ status: "supported",
152
+ detail: "RequestCookies / ResponseCookies — shimmed via @edge-runtime/cookies"
153
+ },
154
+ "next/dist/compiled/@edge-runtime/cookies": {
155
+ status: "supported",
156
+ detail: "RequestCookies / ResponseCookies — shimmed via @edge-runtime/cookies"
157
+ },
158
+ "next/dist/server/app-render/work-unit-async-storage.external": {
159
+ status: "supported",
160
+ detail: "request-scoped AsyncLocalStorage for App Router server components"
161
+ },
162
+ "next/dist/client/components/work-unit-async-storage.external": {
163
+ status: "supported",
164
+ detail: "request-scoped AsyncLocalStorage for App Router server components"
165
+ },
166
+ "next/dist/client/components/request-async-storage.external": {
167
+ status: "supported",
168
+ detail: "request-scoped AsyncLocalStorage (legacy path alias)"
169
+ },
170
+ "next/dist/client/components/request-async-storage": {
171
+ status: "supported",
172
+ detail: "request-scoped AsyncLocalStorage (legacy path alias)"
173
+ },
174
+ "next/dist/client/components/navigation": {
175
+ status: "supported",
176
+ detail: "internal navigation module; re-exports next/navigation"
177
+ },
178
+ "next/dist/server/config-shared": {
179
+ status: "supported",
180
+ detail: "shared config utilities; re-exports next/dist/shared/lib/utils"
181
+ }
182
+ };
183
+ const CONFIG_SUPPORT = {
184
+ basePath: { status: "supported" },
185
+ trailingSlash: { status: "supported" },
186
+ redirects: { status: "supported" },
187
+ rewrites: { status: "supported" },
188
+ headers: { status: "supported" },
189
+ i18n: {
190
+ status: "supported",
191
+ detail: "path-prefix routing; domain routing for Pages Router"
192
+ },
193
+ env: { status: "supported" },
194
+ images: {
195
+ status: "partial",
196
+ detail: "remotePatterns validated, no local optimization"
197
+ },
198
+ allowedDevOrigins: {
199
+ status: "supported",
200
+ detail: "dev server cross-origin allowlist"
201
+ },
202
+ output: {
203
+ status: "supported",
204
+ detail: "'export' mode and 'standalone' output (dist/standalone/server.js)"
205
+ },
206
+ transpilePackages: {
207
+ status: "supported",
208
+ detail: "Vite handles this natively"
209
+ },
210
+ webpack: {
211
+ status: "unsupported",
212
+ detail: "Vite replaces webpack — custom webpack configs need migration"
213
+ },
214
+ enablePrerenderSourceMaps: {
215
+ status: "supported",
216
+ detail: "sourcemap-resolved stack traces during prerender"
217
+ },
218
+ "experimental.ppr": {
219
+ status: "unsupported",
220
+ detail: "partial prerendering not yet implemented"
221
+ },
222
+ "experimental.typedRoutes": {
223
+ status: "unsupported",
224
+ detail: "typed routes not implemented"
225
+ },
226
+ "experimental.serverActions": {
227
+ status: "supported",
228
+ detail: "server actions via 'use server' directive"
229
+ },
230
+ "experimental.prefetchInlining": {
231
+ status: "partial",
232
+ detail: "config recognized; Link prefetch preserves pending/dedup semantics, but vinext does not implement per-segment cache storage"
233
+ },
234
+ "experimental.outputHashSalt": {
235
+ status: "supported",
236
+ detail: "salt mixed into output content hashes for cache-busting"
237
+ },
238
+ "experimental.swcEnvOptions": {
239
+ status: "unsupported",
240
+ detail: "not applicable; vinext uses Vite instead of SWC. A Vite-compatible polyfill solution may be explored in the future."
241
+ },
242
+ "experimental.appShells": {
243
+ status: "partial",
244
+ detail: "config recognized and validated; the flag is forwarded to client bundles via process.env.__NEXT_APP_SHELLS for feature gating, but actual App Shell prefetching behavior requires the segment-cache architecture which vinext does not yet implement (issue #1614)"
245
+ },
246
+ "experimental.inlineCss": {
247
+ status: "supported",
248
+ detail: "App Router production HTML inlines stylesheet links as <style> in <head>; next/font CSS is merged into the first inline style"
249
+ },
250
+ "experimental.varyParams": {
251
+ status: "partial",
252
+ detail: "config recognized; vinext does not implement root-param-aware cache keying"
253
+ },
254
+ "experimental.optimisticRouting": {
255
+ status: "partial",
256
+ detail: "config recognized; vinext does not implement optimistic client navigation"
257
+ },
258
+ "experimental.cachedNavigations": {
259
+ status: "partial",
260
+ detail: "config recognized; vinext does not implement navigation result caching"
261
+ },
262
+ "i18n.domains": {
263
+ status: "partial",
264
+ detail: "supported for Pages Router; App Router unchanged"
265
+ },
266
+ reactStrictMode: {
267
+ status: "partial",
268
+ detail: "config option recognized but not yet enforced; root is not wrapped in <React.StrictMode>"
269
+ },
270
+ poweredByHeader: {
271
+ status: "supported",
272
+ detail: "not sent (matching Next.js default when disabled)"
273
+ }
274
+ };
275
+ const LIBRARY_SUPPORT = {
276
+ "next-themes": { status: "supported" },
277
+ nuqs: { status: "supported" },
278
+ "next-view-transitions": { status: "supported" },
279
+ "@vercel/analytics": {
280
+ status: "supported",
281
+ detail: "analytics script injected client-side"
282
+ },
283
+ "next-intl": {
284
+ status: "supported",
285
+ detail: "auto-detected from i18n/request.{ts,tsx,js,jsx}; createNextIntlPlugin wrapper not needed"
286
+ },
287
+ "@clerk/nextjs": {
288
+ status: "partial",
289
+ detail: "clerkMiddleware, auth.protect, ClerkProvider, client hooks work; auth() in Server Components requires next/headers shim (wip)"
290
+ },
291
+ "@auth/nextjs": {
292
+ status: "unsupported",
293
+ detail: "relies on Next.js internal auth handlers; consider migrating to better-auth"
294
+ },
295
+ "next-auth": {
296
+ status: "unsupported",
297
+ detail: "relies on Next.js API route internals; consider migrating to better-auth (see https://authjs.dev/getting-started/migrate-to-better-auth)"
298
+ },
299
+ "better-auth": {
300
+ status: "supported",
301
+ detail: "uses only public next/* APIs (headers, cookies, NextRequest/NextResponse)"
302
+ },
303
+ "@sentry/nextjs": {
304
+ status: "partial",
305
+ detail: "client-side works, server integration needs manual setup"
306
+ },
307
+ "@t3-oss/env-nextjs": { status: "supported" },
308
+ tailwindcss: { status: "supported" },
309
+ "styled-components": {
310
+ status: "supported",
311
+ detail: "SSR via useServerInsertedHTML"
312
+ },
313
+ "@emotion/react": {
314
+ status: "supported",
315
+ detail: "SSR via useServerInsertedHTML"
316
+ },
317
+ "lucide-react": { status: "supported" },
318
+ "framer-motion": { status: "supported" },
319
+ "@radix-ui/react-dialog": { status: "supported" },
320
+ "shadcn-ui": { status: "supported" },
321
+ zod: { status: "supported" },
322
+ "react-hook-form": { status: "supported" },
323
+ prisma: {
324
+ status: "supported",
325
+ detail: "works on Cloudflare Workers with Prisma Accelerate"
326
+ },
327
+ drizzle: {
328
+ status: "supported",
329
+ detail: "works with D1 on Cloudflare Workers"
330
+ }
331
+ };
332
+ /**
333
+ * Recursively find all source files in a directory.
334
+ */
335
+ function findSourceFiles(dir, extensions = [
336
+ ".ts",
337
+ ".tsx",
338
+ ".js",
339
+ ".jsx",
340
+ ".mjs"
341
+ ]) {
342
+ const results = [];
343
+ if (!fs.existsSync(dir)) return results;
344
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
345
+ for (const entry of entries) {
346
+ const fullPath = normalizePathSeparators(path.join(dir, entry.name));
347
+ if (entry.isDirectory()) {
348
+ if (entry.name === "node_modules" || entry.name === ".next" || entry.name === "dist" || entry.name === ".git") continue;
349
+ results.push(...findSourceFiles(fullPath, extensions));
350
+ } else if (extensions.some((ext) => entry.name.endsWith(ext))) results.push(fullPath);
351
+ }
352
+ return results;
353
+ }
354
+ function isIdentStart(c) {
355
+ return c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "_" || c === "$";
356
+ }
357
+ function isIdentChar(c) {
358
+ return c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "_" || c === "$";
359
+ }
360
+ const CJS_GLOBALS = new Set(["__dirname", "__filename"]);
361
+ const REGEX_PRECEDING_KEYWORDS = new Set([
362
+ "return",
363
+ "typeof",
364
+ "instanceof",
365
+ "in",
366
+ "of",
367
+ "new",
368
+ "delete",
369
+ "void",
370
+ "do",
371
+ "else",
372
+ "yield",
373
+ "await",
374
+ "case",
375
+ "throw"
376
+ ]);
377
+ /**
378
+ * Report whether `content` makes a free use of the CommonJS globals `__dirname` or
379
+ * `__filename` in real code — i.e. not inside a string literal, comment, regex
380
+ * literal, or plain template literal. Identifiers inside a template expression
381
+ * (`` `${__dirname}` ``) DO count, since that is real code.
382
+ *
383
+ * This is a hand-written single-pass scanner rather than a regex on purpose. The
384
+ * previous implementation used an alternation regex whose string-body sub-pattern
385
+ * `(?:[^"\\]|\\.)*` is a star over an alternation group; V8 cannot compile that into
386
+ * a tight loop, so it pushes one backtrack frame per character and overflows the
387
+ * regex stack ("Maximum call stack size exceeded") on very large files — e.g. a
388
+ * multi-megabyte minified bundle or a long/unterminated string literal. This scanner
389
+ * runs in O(n) time and O(template-nesting) stack, so it cannot blow up on large input.
390
+ *
391
+ * It is a lexer-grade scanner, not a parser: it tracks just enough state (string /
392
+ * template / comment / regex contexts, and whether a `/` is in expression position)
393
+ * to avoid mistaking quotes inside one context for the start of another. Where the
394
+ * division-vs-regex distinction is ambiguous it biases toward division, because a
395
+ * misread division is usually harmless (it never consumes a following identifier)
396
+ * whereas a misread regex would swallow the rest of the line and could hide a later
397
+ * __dirname.
398
+ *
399
+ * Known limitation: telling a value-position regex literal apart from division after
400
+ * a `}` needs real parser context (was the `}` a block or an object?). We bias to
401
+ * division, so a regex used in value position — e.g. a statement-start regex after a
402
+ * block `}`, like `function f(){} /'/.test(x)` — is read as division; if its body
403
+ * contains an unpaired quote/backtick, that quote opens a string that can mask a
404
+ * __dirname *on the same line*. This is rare in hand-written source, the multi-line
405
+ * case is unaffected (string scanning stops at the newline), and the check is only
406
+ * advisory — so we accept it rather than pull in a full parser.
407
+ */
408
+ function hasFreeCjsGlobal(content) {
409
+ const n = content.length;
410
+ const stack = [{
411
+ kind: "code",
412
+ depth: 0,
413
+ isExpr: false,
414
+ prevType: "op"
415
+ }];
416
+ let i = 0;
417
+ while (i < n) {
418
+ const top = stack[stack.length - 1];
419
+ const ch = content[i];
420
+ if (top.kind === "template") {
421
+ if (ch === "\\") {
422
+ i += 2;
423
+ continue;
424
+ }
425
+ if (ch === "`") {
426
+ stack.pop();
427
+ const outer = stack[stack.length - 1];
428
+ if (outer) outer.prevType = "value";
429
+ i++;
430
+ continue;
431
+ }
432
+ if (ch === "$" && content[i + 1] === "{") {
433
+ stack.push({
434
+ kind: "code",
435
+ depth: 0,
436
+ isExpr: true,
437
+ prevType: "op"
438
+ });
439
+ i += 2;
440
+ continue;
441
+ }
442
+ i++;
443
+ continue;
444
+ }
445
+ if (ch === "/" && content[i + 1] === "/") {
446
+ i += 2;
447
+ while (i < n && content[i] !== "\n") i++;
448
+ continue;
449
+ }
450
+ if (ch === "/" && content[i + 1] === "*") {
451
+ i += 2;
452
+ while (i < n && !(content[i] === "*" && content[i + 1] === "/")) i++;
453
+ i += 2;
454
+ continue;
455
+ }
456
+ if (ch === "/") {
457
+ if (top.prevType === "op") {
458
+ i++;
459
+ let inClass = false;
460
+ while (i < n) {
461
+ const c = content[i];
462
+ if (c === "\\") {
463
+ i += 2;
464
+ continue;
465
+ }
466
+ if (c === "\n") break;
467
+ if (c === "[") inClass = true;
468
+ else if (c === "]") inClass = false;
469
+ else if (c === "/" && !inClass) {
470
+ i++;
471
+ break;
472
+ }
473
+ i++;
474
+ }
475
+ while (i < n && isIdentChar(content[i])) i++;
476
+ top.prevType = "value";
477
+ continue;
478
+ }
479
+ top.prevType = "op";
480
+ i++;
481
+ continue;
482
+ }
483
+ if (ch === "\"" || ch === "'") {
484
+ i++;
485
+ while (i < n) {
486
+ const c = content[i];
487
+ if (c === "\\") {
488
+ i += 2;
489
+ continue;
490
+ }
491
+ if (c === ch || c === "\n") break;
492
+ i++;
493
+ }
494
+ i++;
495
+ top.prevType = "value";
496
+ continue;
497
+ }
498
+ if (ch === "`") {
499
+ stack.push({
500
+ kind: "template",
501
+ depth: 0,
502
+ isExpr: false,
503
+ prevType: "op"
504
+ });
505
+ i++;
506
+ continue;
507
+ }
508
+ if (ch === "{") {
509
+ top.depth++;
510
+ top.prevType = "op";
511
+ i++;
512
+ continue;
513
+ }
514
+ if (ch === "}") {
515
+ if (top.isExpr && top.depth === 0) stack.pop();
516
+ else {
517
+ if (top.depth > 0) top.depth--;
518
+ top.prevType = "value";
519
+ }
520
+ i++;
521
+ continue;
522
+ }
523
+ if (isIdentStart(ch)) {
524
+ const start = i;
525
+ i++;
526
+ while (i < n && isIdentChar(content[i])) i++;
527
+ const ident = content.slice(start, i);
528
+ if (CJS_GLOBALS.has(ident)) return true;
529
+ top.prevType = REGEX_PRECEDING_KEYWORDS.has(ident) ? "op" : "value";
530
+ continue;
531
+ }
532
+ if (ch >= "0" && ch <= "9") {
533
+ i++;
534
+ while (i < n && (isIdentChar(content[i]) || content[i] === ".")) i++;
535
+ top.prevType = "value";
536
+ continue;
537
+ }
538
+ if (ch === "+" && content[i + 1] === "+" || ch === "-" && content[i + 1] === "-") {
539
+ i += 2;
540
+ continue;
541
+ }
542
+ if (ch === ")" || ch === "]") top.prevType = "value";
543
+ else if (ch !== " " && ch !== " " && ch !== "\n" && ch !== "\r") top.prevType = "op";
544
+ i++;
545
+ }
546
+ return false;
547
+ }
548
+ /**
549
+ * Scan source files for `import ... from 'next/...'` statements.
550
+ */
551
+ function scanImports(root) {
552
+ const files = findSourceFiles(root);
553
+ const importUsage = /* @__PURE__ */ new Map();
554
+ const importRegex = /(?:import\s+(?:[\w{},\s*]+\s+from\s+)?|require\s*\()['"]([^'"]+)['"]\)?/g;
555
+ const typeOnlyImportRegex = /import\s+type\s+/;
556
+ for (const file of files) {
557
+ const content = fs.readFileSync(file, "utf-8");
558
+ let match;
559
+ while ((match = importRegex.exec(content)) !== null) {
560
+ const mod = match[1];
561
+ const lineStart = content.lastIndexOf("\n", match.index) + 1;
562
+ const line = content.slice(lineStart, match.index + match[0].length);
563
+ if (typeOnlyImportRegex.test(line)) continue;
564
+ if (mod.startsWith("next/") || mod === "next" || mod === "server-only" || mod === "client-only") {
565
+ const normalized = mod === "next" ? "next" : mod;
566
+ if (!importUsage.has(normalized)) importUsage.set(normalized, []);
567
+ const relFile = normalizePathSeparators(path.relative(root, file));
568
+ const usedInFiles = importUsage.get(normalized) ?? [];
569
+ if (!usedInFiles.includes(relFile)) usedInFiles.push(relFile);
570
+ }
571
+ }
572
+ }
573
+ const items = [];
574
+ for (const [mod, usedFiles] of importUsage) {
575
+ const support = IMPORT_SUPPORT[mod.startsWith("next/") && mod.endsWith(".js") ? mod.replace(/\.js$/, "") : mod];
576
+ if (support) items.push({
577
+ name: mod,
578
+ status: support.status,
579
+ detail: support.detail,
580
+ files: usedFiles
581
+ });
582
+ else items.push({
583
+ name: mod,
584
+ status: "unsupported",
585
+ detail: "not recognized by vinext",
586
+ files: usedFiles
587
+ });
588
+ }
589
+ items.sort(compareByStatus);
590
+ return items;
591
+ }
592
+ /** The property key name of an object property, or null for spreads/computed keys. */
593
+ function propertyKeyName(prop) {
594
+ if (prop.type !== "Property" || prop.computed) return null;
595
+ const { key } = prop;
596
+ if (key.type === "Identifier") return key.name;
597
+ if (key.type === "Literal" && typeof key.value === "string") return key.value;
598
+ return null;
599
+ }
600
+ /**
601
+ * Parse a next.config file and collect the option keys off its exported config
602
+ * object — top-level keys plus, for each object-valued property, its child keys
603
+ * (used for dot-notation options like `experimental.ppr`).
604
+ *
605
+ * Uses Vite's `parseAst` (the bundled oxc parser) instead of scanning text, so
606
+ * comments, string values, and other non-key mentions of an option name are
607
+ * never mistaken for a real config option. Returns empty sets if the file cannot
608
+ * be parsed — the check is advisory, so a parse failure simply reports nothing.
609
+ */
610
+ function collectConfigKeys(source) {
611
+ const top = /* @__PURE__ */ new Set();
612
+ const nested = /* @__PURE__ */ new Map();
613
+ let program;
614
+ try {
615
+ program = parseAst(source, { lang: "ts" });
616
+ } catch {
617
+ return {
618
+ top,
619
+ nested
620
+ };
621
+ }
622
+ const vars = /* @__PURE__ */ new Map();
623
+ for (const node of program.body) {
624
+ if (node.type !== "VariableDeclaration") continue;
625
+ for (const decl of node.declarations) if (decl.id.type === "Identifier" && decl.init) vars.set(decl.id.name, decl.init);
626
+ }
627
+ function collectReturnArgs(stmt, out) {
628
+ if (!stmt) return;
629
+ if (stmt.type === "ReturnStatement") {
630
+ if (stmt.argument) out.push(stmt.argument);
631
+ } else if (stmt.type === "BlockStatement") for (const s of stmt.body) collectReturnArgs(s, out);
632
+ else if (stmt.type === "IfStatement") {
633
+ collectReturnArgs(stmt.consequent, out);
634
+ collectReturnArgs(stmt.alternate, out);
635
+ } else if (stmt.type === "SwitchStatement") for (const c of stmt.cases) for (const s of c.consequent) collectReturnArgs(s, out);
636
+ else if (stmt.type === "TryStatement") {
637
+ collectReturnArgs(stmt.block, out);
638
+ if (stmt.handler) collectReturnArgs(stmt.handler.body, out);
639
+ collectReturnArgs(stmt.finalizer, out);
640
+ }
641
+ }
642
+ function resolveObjects(node, depth = 0) {
643
+ if (!node || depth > 10) return [];
644
+ if (node.type === "ObjectExpression") return [node];
645
+ if (node.type === "Identifier") return resolveObjects(vars.get(node.name), depth + 1);
646
+ if (node.type === "CallExpression") {
647
+ for (const arg of node.arguments) {
648
+ const objs = resolveObjects(arg, depth + 1);
649
+ if (objs.length) return objs;
650
+ }
651
+ return [];
652
+ }
653
+ if (node.type === "ConditionalExpression") return [...resolveObjects(node.consequent, depth + 1), ...resolveObjects(node.alternate, depth + 1)];
654
+ if (node.type === "ArrowFunctionExpression" || node.type === "FunctionExpression" || node.type === "FunctionDeclaration") {
655
+ const body = node.body;
656
+ if (!body) return [];
657
+ if (body.type !== "BlockStatement") return resolveObjects(body, depth + 1);
658
+ const returns = [];
659
+ collectReturnArgs(body, returns);
660
+ return returns.flatMap((arg) => resolveObjects(arg, depth + 1));
661
+ }
662
+ if (node.type === "TSAsExpression" || node.type === "TSSatisfiesExpression" || node.type === "ParenthesizedExpression") return resolveObjects(node.expression, depth + 1);
663
+ return [];
664
+ }
665
+ let configObjs = [];
666
+ for (const node of program.body) {
667
+ if (node.type === "ExportDefaultDeclaration") configObjs = resolveObjects(node.declaration);
668
+ else if (node.type === "ExpressionStatement" && node.expression.type === "AssignmentExpression") {
669
+ const { left, right } = node.expression;
670
+ if (left.type === "MemberExpression" && !left.computed && left.object.type === "Identifier" && left.object.name === "module" && left.property.type === "Identifier" && left.property.name === "exports") configObjs = resolveObjects(right);
671
+ }
672
+ if (configObjs.length) break;
673
+ }
674
+ for (const configObj of configObjs) for (const prop of configObj.properties) {
675
+ const name = propertyKeyName(prop);
676
+ if (!name) continue;
677
+ top.add(name);
678
+ const childObjs = resolveObjects(prop.value);
679
+ if (!childObjs.length) continue;
680
+ const children = nested.get(name) ?? /* @__PURE__ */ new Set();
681
+ for (const childObj of childObjs) for (const childProp of childObj.properties) {
682
+ const childName = propertyKeyName(childProp);
683
+ if (childName) children.add(childName);
684
+ }
685
+ nested.set(name, children);
686
+ }
687
+ return {
688
+ top,
689
+ nested
690
+ };
691
+ }
692
+ /**
693
+ * Analyze next.config.js/mjs/ts for supported and unsupported options.
694
+ */
695
+ function analyzeConfig(root) {
696
+ const configFiles = [
697
+ "next.config.ts",
698
+ "next.config.mts",
699
+ "next.config.mjs",
700
+ "next.config.js",
701
+ "next.config.cjs"
702
+ ];
703
+ let configPath = null;
704
+ for (const f of configFiles) {
705
+ const p = path.join(root, f);
706
+ if (fs.existsSync(p)) {
707
+ configPath = p;
708
+ break;
709
+ }
710
+ }
711
+ if (!configPath) return [{
712
+ name: "next.config",
713
+ status: "supported",
714
+ detail: "no config file found (defaults are fine)"
715
+ }];
716
+ const present = collectConfigKeys(fs.readFileSync(configPath, "utf-8"));
717
+ const items = [];
718
+ for (const opt of [
719
+ "basePath",
720
+ "trailingSlash",
721
+ "redirects",
722
+ "rewrites",
723
+ "headers",
724
+ "i18n",
725
+ "env",
726
+ "images",
727
+ "allowedDevOrigins",
728
+ "output",
729
+ "transpilePackages",
730
+ "webpack",
731
+ "reactStrictMode",
732
+ "poweredByHeader"
733
+ ]) {
734
+ if (!present.top.has(opt)) continue;
735
+ const support = CONFIG_SUPPORT[opt];
736
+ if (support) items.push({
737
+ name: opt,
738
+ status: support.status,
739
+ detail: support.detail
740
+ });
741
+ else items.push({
742
+ name: opt,
743
+ status: "unsupported",
744
+ detail: "not recognized"
745
+ });
746
+ }
747
+ for (const key of Object.keys(CONFIG_SUPPORT)) {
748
+ if (!key.includes(".")) continue;
749
+ const dot = key.indexOf(".");
750
+ if (present.nested.get(key.slice(0, dot))?.has(key.slice(dot + 1))) items.push({
751
+ name: key,
752
+ ...CONFIG_SUPPORT[key]
753
+ });
754
+ }
755
+ items.sort(compareByStatus);
756
+ return items;
757
+ }
758
+ /**
759
+ * Check package.json dependencies for known libraries.
760
+ */
761
+ function checkLibraries(root) {
762
+ const pkgPath = path.join(root, "package.json");
763
+ if (!fs.existsSync(pkgPath)) return [];
764
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
765
+ const allDeps = {
766
+ ...pkg.dependencies,
767
+ ...pkg.devDependencies
768
+ };
769
+ const items = [];
770
+ for (const [lib, support] of Object.entries(LIBRARY_SUPPORT)) if (allDeps[lib]) items.push({
771
+ name: lib,
772
+ status: support.status,
773
+ detail: support.detail
774
+ });
775
+ items.sort(compareByStatus);
776
+ return items;
777
+ }
778
+ /**
779
+ * Check file conventions (pages, app directory, middleware, etc.)
780
+ */
781
+ function checkConventions(root) {
782
+ const items = [];
783
+ const pagesDir = findDir(root, "pages", path.join("src", "pages"));
784
+ const appDirPath = findDir(root, "app", path.join("src", "app"));
785
+ const hasPages = pagesDir !== null;
786
+ const hasApp = appDirPath !== null;
787
+ const hasProxy = fs.existsSync(path.join(root, "proxy.ts")) || fs.existsSync(path.join(root, "proxy.js"));
788
+ const hasMiddleware = fs.existsSync(path.join(root, "middleware.ts")) || fs.existsSync(path.join(root, "middleware.js"));
789
+ if (pagesDir !== null) {
790
+ const isSrc = pagesDir.includes(path.join("src", "pages"));
791
+ items.push({
792
+ name: isSrc ? "Pages Router (src/pages/)" : "Pages Router (pages/)",
793
+ status: "supported"
794
+ });
795
+ const pageFiles = findSourceFiles(pagesDir);
796
+ const pages = pageFiles.filter((f) => !f.includes("/api/") && !f.includes("_app") && !f.includes("_document") && !f.includes("_error"));
797
+ const apiRoutes = pageFiles.filter((f) => f.includes("/api/"));
798
+ items.push({
799
+ name: `${pages.length} page(s)`,
800
+ status: "supported"
801
+ });
802
+ if (apiRoutes.length) items.push({
803
+ name: `${apiRoutes.length} API route(s)`,
804
+ status: "supported"
805
+ });
806
+ if (pageFiles.some((f) => f.includes("_app"))) items.push({
807
+ name: "Custom _app",
808
+ status: "supported"
809
+ });
810
+ if (pageFiles.some((f) => f.includes("_document"))) items.push({
811
+ name: "Custom _document",
812
+ status: "supported"
813
+ });
814
+ }
815
+ if (appDirPath !== null) {
816
+ const isSrc = appDirPath.includes(path.join("src", "app"));
817
+ items.push({
818
+ name: isSrc ? "App Router (src/app/)" : "App Router (app/)",
819
+ status: "supported"
820
+ });
821
+ const appFiles = findSourceFiles(appDirPath);
822
+ const pages = appFiles.filter((f) => isAppRouterFile(f, "page"));
823
+ const layouts = appFiles.filter((f) => isAppRouterFile(f, "layout"));
824
+ const routes = appFiles.filter((f) => f.endsWith("route.tsx") || f.endsWith("route.ts") || f.endsWith("route.js"));
825
+ const loadings = appFiles.filter((f) => isAppRouterFile(f, "loading"));
826
+ const errors = appFiles.filter((f) => isAppRouterFile(f, "error"));
827
+ const notFounds = appFiles.filter((f) => isAppRouterFile(f, "not-found"));
828
+ items.push({
829
+ name: `${pages.length} page(s)`,
830
+ status: "supported"
831
+ });
832
+ if (layouts.length) items.push({
833
+ name: `${layouts.length} layout(s)`,
834
+ status: "supported"
835
+ });
836
+ if (routes.length) items.push({
837
+ name: `${routes.length} route handler(s)`,
838
+ status: "supported"
839
+ });
840
+ if (loadings.length) items.push({
841
+ name: `${loadings.length} loading boundary(ies)`,
842
+ status: "supported"
843
+ });
844
+ if (errors.length) items.push({
845
+ name: `${errors.length} error boundary(ies)`,
846
+ status: "supported"
847
+ });
848
+ if (notFounds.length) items.push({
849
+ name: `${notFounds.length} not-found page(s)`,
850
+ status: "supported"
851
+ });
852
+ }
853
+ if (hasProxy) items.push({
854
+ name: "proxy.ts (Next.js 16)",
855
+ status: "supported"
856
+ });
857
+ else if (hasMiddleware) items.push({
858
+ name: "middleware.ts (deprecated in Next.js 16)",
859
+ status: "supported"
860
+ });
861
+ if (!hasPages && !hasApp) items.push({
862
+ name: "No pages/ or app/ directory found",
863
+ status: "unsupported",
864
+ detail: "vinext requires a pages/ or app/ directory"
865
+ });
866
+ const pkgPath = path.join(root, "package.json");
867
+ if (fs.existsSync(pkgPath)) {
868
+ if (JSON.parse(fs.readFileSync(pkgPath, "utf-8")).type !== "module") items.push({
869
+ name: "Missing \"type\": \"module\" in package.json",
870
+ status: "unsupported",
871
+ detail: "required for Vite — vinext init will add it automatically"
872
+ });
873
+ }
874
+ const allSourceFiles = findSourceFiles(root);
875
+ const viewTransitionRegex = /import\s+\{[^}]*\bViewTransition\b[^}]*\}\s+from\s+['"]react['"]/;
876
+ const viewTransitionFiles = [];
877
+ const cjsGlobalFiles = [];
878
+ for (const file of allSourceFiles) {
879
+ const content = fs.readFileSync(file, "utf-8");
880
+ const rel = normalizePathSeparators(path.relative(root, file));
881
+ if (viewTransitionRegex.test(content)) viewTransitionFiles.push(rel);
882
+ if (hasFreeCjsGlobal(content)) cjsGlobalFiles.push(rel);
883
+ }
884
+ if (viewTransitionFiles.length > 0) items.push({
885
+ name: "ViewTransition (React canary API)",
886
+ status: "partial",
887
+ detail: "vinext auto-shims with a passthrough fallback, view transitions won't animate",
888
+ files: viewTransitionFiles
889
+ });
890
+ for (const configFile of [
891
+ "postcss.config.mjs",
892
+ "postcss.config.js",
893
+ "postcss.config.cjs"
894
+ ]) {
895
+ const configPath = path.join(root, configFile);
896
+ if (fs.existsSync(configPath)) {
897
+ const content = fs.readFileSync(configPath, "utf-8");
898
+ if (/plugins\s*:\s*\[\s*['"]/.test(content)) items.push({
899
+ name: `PostCSS string-form plugins (${configFile})`,
900
+ status: "partial",
901
+ detail: "string-form PostCSS plugins need resolution — vinext handles this automatically"
902
+ });
903
+ break;
904
+ }
905
+ }
906
+ if (cjsGlobalFiles.length > 0) items.push({
907
+ name: "__dirname / __filename (CommonJS globals)",
908
+ status: "unsupported",
909
+ detail: "CJS globals unavailable in ESM — use fileURLToPath(import.meta.url) / dirname(...), or import.meta.dirname / import.meta.filename (Node 22+)",
910
+ files: cjsGlobalFiles
911
+ });
912
+ return items;
913
+ }
914
+ /**
915
+ * Run the full compatibility check.
916
+ */
917
+ function runCheck(root) {
918
+ const imports = scanImports(root);
919
+ const config = analyzeConfig(root);
920
+ const libraries = checkLibraries(root);
921
+ const conventions = checkConventions(root);
922
+ const allItems = [
923
+ ...imports,
924
+ ...config,
925
+ ...libraries,
926
+ ...conventions
927
+ ];
928
+ const supported = allItems.filter((i) => i.status === "supported").length;
929
+ const partial = allItems.filter((i) => i.status === "partial").length;
930
+ const unsupported = allItems.filter((i) => i.status === "unsupported").length;
931
+ const total = allItems.length;
932
+ return {
933
+ imports,
934
+ config,
935
+ libraries,
936
+ conventions,
937
+ summary: {
938
+ supported,
939
+ partial,
940
+ unsupported,
941
+ total,
942
+ score: total > 0 ? Math.round((supported + partial * .5) / total * 100) : 100
943
+ }
944
+ };
945
+ }
946
+ /**
947
+ * Format the check result as a colored terminal report.
948
+ */
949
+ function formatReport(result, opts) {
950
+ const lines = [];
951
+ const hasAppRouter = result.conventions.some((item) => item.name === "App Router (app/)" || item.name === "App Router (src/app/)");
952
+ const statusIcon = (s) => s === "supported" ? "\x1B[32m✓\x1B[0m" : s === "partial" ? "\x1B[33m~\x1B[0m" : "\x1B[31m✗\x1B[0m";
953
+ lines.push("");
954
+ lines.push(" \x1B[1mvinext compatibility report\x1B[0m");
955
+ lines.push(" " + "=".repeat(40));
956
+ lines.push("");
957
+ if (result.imports.length > 0) {
958
+ const importSupported = result.imports.filter((i) => i.status === "supported").length;
959
+ lines.push(` \x1b[1mImports\x1b[0m: ${importSupported}/${result.imports.length} fully supported`);
960
+ for (const item of result.imports) {
961
+ const suffix = item.detail ? ` \x1b[90m— ${item.detail}\x1b[0m` : "";
962
+ const fileCount = item.files ? ` \x1b[90m(${item.files.length} file${item.files.length === 1 ? "" : "s"})\x1b[0m` : "";
963
+ lines.push(` ${statusIcon(item.status)} ${item.name}${fileCount}${suffix}`);
964
+ }
965
+ lines.push("");
966
+ }
967
+ if (result.config.length > 0) {
968
+ const configSupported = result.config.filter((i) => i.status === "supported").length;
969
+ lines.push(` \x1b[1mConfig\x1b[0m: ${configSupported}/${result.config.length} options supported`);
970
+ for (const item of result.config) {
971
+ const suffix = item.detail ? ` \x1b[90m— ${item.detail}\x1b[0m` : "";
972
+ lines.push(` ${statusIcon(item.status)} ${item.name}${suffix}`);
973
+ }
974
+ lines.push("");
975
+ }
976
+ if (result.libraries.length > 0) {
977
+ const libSupported = result.libraries.filter((i) => i.status === "supported").length;
978
+ lines.push(` \x1b[1mLibraries\x1b[0m: ${libSupported}/${result.libraries.length} compatible`);
979
+ for (const item of result.libraries) {
980
+ const suffix = item.detail ? ` \x1b[90m— ${item.detail}\x1b[0m` : "";
981
+ lines.push(` ${statusIcon(item.status)} ${item.name}${suffix}`);
982
+ }
983
+ lines.push("");
984
+ }
985
+ if (result.conventions.length > 0) {
986
+ lines.push(` \x1b[1mProject structure\x1b[0m:`);
987
+ for (const item of result.conventions) {
988
+ const suffix = item.detail ? ` \x1b[90m— ${item.detail}\x1b[0m` : "";
989
+ lines.push(` ${statusIcon(item.status)} ${item.name}${suffix}`);
990
+ }
991
+ lines.push("");
992
+ }
993
+ const { score, supported, partial, unsupported } = result.summary;
994
+ const scoreColor = score >= 90 ? "\x1B[32m" : score >= 70 ? "\x1B[33m" : "\x1B[31m";
995
+ lines.push(" " + "-".repeat(40));
996
+ lines.push(` \x1b[1mOverall\x1b[0m: ${scoreColor}${score}% compatible\x1b[0m (${supported} supported, ${partial} partial, ${unsupported} issues)`);
997
+ if (unsupported > 0) {
998
+ lines.push("");
999
+ lines.push(" \x1B[1mIssues to address:\x1B[0m");
1000
+ const allItems = [
1001
+ ...result.imports,
1002
+ ...result.config,
1003
+ ...result.libraries,
1004
+ ...result.conventions
1005
+ ];
1006
+ for (const item of allItems) if (item.status === "unsupported") {
1007
+ lines.push(` \x1b[31m✗\x1b[0m ${item.name}${item.detail ? ` — ${item.detail}` : ""}`);
1008
+ if (item.files && item.files.length > 0) for (const f of item.files) lines.push(` \x1b[90m${f}\x1b[0m`);
1009
+ }
1010
+ }
1011
+ if (result.summary.partial > 0) {
1012
+ lines.push("");
1013
+ lines.push(" \x1B[1mPartial support (may need attention):\x1B[0m");
1014
+ const allItems = [
1015
+ ...result.imports,
1016
+ ...result.config,
1017
+ ...result.libraries,
1018
+ ...result.conventions
1019
+ ];
1020
+ for (const item of allItems) if (item.status === "partial") lines.push(` \x1b[33m~\x1b[0m ${item.name}${item.detail ? ` — ${item.detail}` : ""}`);
1021
+ }
1022
+ if (!opts?.calledFromInit) {
1023
+ lines.push("");
1024
+ lines.push(" \x1B[1mRecommended next steps:\x1B[0m");
1025
+ lines.push(` Run \x1b[36mvinext init\x1b[0m to set up your project automatically`);
1026
+ lines.push("");
1027
+ lines.push(" Or manually:");
1028
+ lines.push(` 1. Add \x1b[36m"type": "module"\x1b[0m to package.json`);
1029
+ lines.push(` 2. Install: \x1b[36m${detectPackageManager(process.cwd())} vinext vite @vitejs/plugin-react${hasAppRouter ? " @vitejs/plugin-rsc react-server-dom-webpack" : ""}\x1b[0m`);
1030
+ lines.push(` 3. Create vite.config.ts (see docs)`);
1031
+ lines.push(` 4. Run: \x1b[36mnpx vite dev\x1b[0m`);
1032
+ }
1033
+ lines.push("");
1034
+ return lines.join("\n");
1035
+ }
1036
+ //#endregion
1037
+ export { analyzeConfig, checkConventions, checkLibraries, formatReport, hasFreeCjsGlobal, runCheck, scanImports };