@wular/pnext 0.1.5 → 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 (302) hide show
  1. package/bin/pnext +9 -2
  2. package/dist/server/_chunks/aliases-j47a10ce.js +44 -0
  3. package/dist/server/_chunks/analyze-arswqe6s.js +445 -0
  4. package/dist/server/_chunks/boot-af0mv3dy.js +36 -0
  5. package/dist/server/_chunks/build-spy3dxp4.js +84 -0
  6. package/dist/server/_chunks/build-t9h0hec3.js +3550 -0
  7. package/dist/server/_chunks/build-tier-m7yvqz61.js +2472 -0
  8. package/dist/server/_chunks/compile-53j02j27.js +22 -0
  9. package/dist/server/_chunks/config-1yzwexq6.js +27 -0
  10. package/dist/server/_chunks/config-n2z7yxps.js +22 -0
  11. package/dist/server/_chunks/create-meec9hs6.js +134 -0
  12. package/dist/server/_chunks/dev-fjmqg6en.js +220 -0
  13. package/dist/server/_chunks/esbuild-yyktfrtt.js +15 -0
  14. package/dist/server/_chunks/generate-n9sh6hzt.js +21 -0
  15. package/dist/server/_chunks/index-0374j2b9.js +66 -0
  16. package/dist/server/_chunks/index-06nyqntx.js +213 -0
  17. package/dist/server/_chunks/index-1011cscr.js +5263 -0
  18. package/dist/server/_chunks/index-11sfk4hb.js +170 -0
  19. package/dist/server/_chunks/index-20ppawv7.js +297 -0
  20. package/dist/server/_chunks/index-2dv4y4wd.js +1065 -0
  21. package/dist/server/_chunks/index-2vz0wzdn.js +59 -0
  22. package/dist/server/_chunks/index-2wfv4kvx.js +182 -0
  23. package/dist/server/_chunks/index-357na4a8.js +109 -0
  24. package/dist/server/_chunks/index-3b3at80h.js +109 -0
  25. package/dist/server/_chunks/index-3tf1xjsp.js +6166 -0
  26. package/dist/server/_chunks/index-3xbr4eyv.js +105 -0
  27. package/dist/server/_chunks/index-4399bvd2.js +18 -0
  28. package/dist/server/_chunks/index-4hgjrqh7.js +851 -0
  29. package/dist/server/_chunks/index-4q2gbfwk.js +2530 -0
  30. package/dist/server/_chunks/index-4t92hdxd.js +172 -0
  31. package/dist/server/_chunks/index-4zzebszd.js +10 -0
  32. package/dist/server/_chunks/index-5gyr4emz.js +107 -0
  33. package/dist/server/_chunks/index-5hr4062s.js +70 -0
  34. package/dist/server/_chunks/index-68m3mwbd.js +84 -0
  35. package/dist/server/_chunks/index-6b009mt0.js +56 -0
  36. package/dist/server/_chunks/index-6e4fqv30.js +588 -0
  37. package/dist/server/_chunks/index-6gex3pfa.js +15 -0
  38. package/dist/server/_chunks/index-6kp9r0d9.js +11 -0
  39. package/dist/server/_chunks/index-6q7zvrap.js +134 -0
  40. package/dist/server/_chunks/index-73z4esab.js +38 -0
  41. package/dist/server/_chunks/index-79ngvam8.js +60 -0
  42. package/dist/server/_chunks/index-7wc9n8be.js +25 -0
  43. package/dist/server/_chunks/index-8k7pfejn.js +1599 -0
  44. package/dist/server/_chunks/index-8kcxdfya.js +206 -0
  45. package/dist/server/_chunks/index-91x12ykq.js +274 -0
  46. package/dist/server/_chunks/index-9ch50vtq.js +18 -0
  47. package/dist/server/_chunks/index-9hx2641q.js +28 -0
  48. package/dist/server/_chunks/index-9n2914ww.js +535 -0
  49. package/dist/server/_chunks/index-9ych9ma8.js +207 -0
  50. package/dist/server/_chunks/index-b6wtkdp4.js +24 -0
  51. package/dist/server/_chunks/index-bcws5eh2.js +35 -0
  52. package/dist/server/_chunks/index-c0g2wf3z.js +92 -0
  53. package/dist/server/_chunks/index-cf4rvxv6.js +95 -0
  54. package/dist/server/_chunks/index-cjgqs13g.js +65 -0
  55. package/dist/server/_chunks/index-ckkdpht5.js +41 -0
  56. package/dist/server/_chunks/index-cyfednwb.js +87 -0
  57. package/dist/server/_chunks/index-danncfhy.js +311 -0
  58. package/dist/server/_chunks/index-dg0f05zs.js +199 -0
  59. package/dist/server/_chunks/index-e3a6yx84.js +18 -0
  60. package/dist/server/_chunks/index-e88tyv35.js +45 -0
  61. package/dist/server/_chunks/index-eajaspjk.js +1253 -0
  62. package/dist/server/_chunks/index-eeaanp2e.js +483 -0
  63. package/dist/server/_chunks/index-egykcqg3.js +101 -0
  64. package/dist/server/_chunks/index-en7n9f7m.js +22 -0
  65. package/dist/server/_chunks/index-ezgj0tr1.js +88 -0
  66. package/dist/server/_chunks/index-fkp000p1.js +590 -0
  67. package/dist/server/_chunks/index-fn1chkkd.js +214 -0
  68. package/dist/server/_chunks/index-fp8r0sqs.js +64 -0
  69. package/dist/server/_chunks/index-ggk2j965.js +9432 -0
  70. package/dist/server/_chunks/index-grta8ap3.js +238 -0
  71. package/dist/server/_chunks/index-h2a70tg4.js +7 -0
  72. package/dist/server/_chunks/index-h4xy648y.js +51 -0
  73. package/dist/server/_chunks/index-hkdfj58q.js +92 -0
  74. package/dist/server/_chunks/index-j2zrcp1k.js +66 -0
  75. package/dist/server/_chunks/index-jcsjq3d1.js +20 -0
  76. package/dist/server/_chunks/index-jepjvcrf.js +198 -0
  77. package/dist/server/_chunks/index-jks0x0a1.js +14 -0
  78. package/dist/server/_chunks/index-jx7bqvw1.js +57 -0
  79. package/dist/server/_chunks/index-k1g3epw0.js +1299 -0
  80. package/dist/server/_chunks/index-knp0s912.js +7 -0
  81. package/dist/server/_chunks/index-kq8kpzye.js +472 -0
  82. package/dist/server/_chunks/index-kqyy1d4f.js +50 -0
  83. package/dist/server/_chunks/index-kresp2n8.js +445 -0
  84. package/dist/server/_chunks/index-ms9v9tnx.js +31 -0
  85. package/dist/server/_chunks/index-n4hxpng2.js +11 -0
  86. package/dist/server/_chunks/index-ncnes8c6.js +17 -0
  87. package/dist/server/_chunks/index-nqh3xhdc.js +57 -0
  88. package/dist/server/_chunks/index-nyrba2kr.js +4130 -0
  89. package/dist/server/_chunks/index-p77b4kcx.js +296 -0
  90. package/dist/server/_chunks/index-pym1cezq.js +39 -0
  91. package/dist/server/_chunks/index-q738kkhj.js +100 -0
  92. package/dist/server/_chunks/index-qjj6gddn.js +54 -0
  93. package/dist/server/_chunks/index-qm6kmhqs.js +110 -0
  94. package/dist/server/_chunks/index-qn4z5s3c.js +819 -0
  95. package/dist/server/_chunks/index-qpwsgt3a.js +158 -0
  96. package/dist/server/_chunks/index-r97ptz1q.js +97 -0
  97. package/dist/server/_chunks/index-ras0sdab.js +26 -0
  98. package/dist/server/_chunks/index-rcs322t1.js +19 -0
  99. package/dist/server/_chunks/index-rn8dyr1f.js +126 -0
  100. package/dist/server/_chunks/index-rt9qq1va.js +4 -0
  101. package/dist/server/_chunks/index-rthrsed5.js +356 -0
  102. package/dist/server/_chunks/index-sctcgyvv.js +185 -0
  103. package/dist/server/_chunks/index-sjpckxqn.js +213 -0
  104. package/dist/server/_chunks/index-sq3kvz3g.js +200 -0
  105. package/dist/server/_chunks/index-stbk3jhn.js +31 -0
  106. package/dist/server/_chunks/index-sv8m6789.js +266 -0
  107. package/dist/server/_chunks/index-tgcakdxc.js +125 -0
  108. package/dist/server/_chunks/index-tgsfjmep.js +74 -0
  109. package/dist/server/_chunks/index-tq0pc7eg.js +154 -0
  110. package/dist/server/_chunks/index-tq1f96v7.js +51 -0
  111. package/dist/server/_chunks/index-tqn2qnnn.js +241 -0
  112. package/dist/server/_chunks/index-tvqkq6e6.js +128 -0
  113. package/dist/server/_chunks/index-v1ags1na.js +132 -0
  114. package/dist/server/_chunks/index-vvmmknm1.js +1431 -0
  115. package/dist/server/_chunks/index-vvq7rqtn.js +329 -0
  116. package/dist/server/_chunks/index-vz0km5qk.js +33 -0
  117. package/dist/server/_chunks/index-w6h8m6vp.js +138 -0
  118. package/dist/server/_chunks/index-web361b8.js +138 -0
  119. package/dist/server/_chunks/index-wpfhfbs4.js +194 -0
  120. package/dist/server/_chunks/index-x0y005nh.js +283 -0
  121. package/dist/server/_chunks/index-x3yn4ywm.js +22 -0
  122. package/dist/server/_chunks/index-x93hv0sc.js +271 -0
  123. package/dist/server/_chunks/index-xvj80c3a.js +30 -0
  124. package/dist/server/_chunks/index-xywjg2vc.js +100 -0
  125. package/dist/server/_chunks/index-y2jr2n72.js +152 -0
  126. package/dist/server/_chunks/index-y36a0ybw.js +57 -0
  127. package/dist/server/_chunks/index-ye9hmsvf.js +47 -0
  128. package/dist/server/_chunks/index-yhxkxghe.js +56 -0
  129. package/dist/server/_chunks/index-ym67zqxp.js +130 -0
  130. package/dist/server/_chunks/index-ytjvpbm2.js +736 -0
  131. package/dist/server/_chunks/index-yz54pxrh.js +960 -0
  132. package/dist/server/_chunks/index-z4z9zv3b.js +733 -0
  133. package/dist/server/_chunks/index-z84ab1w0.js +1270 -0
  134. package/dist/server/_chunks/index-z88qv16t.js +11 -0
  135. package/dist/server/_chunks/index-zqpqyg8p.js +666 -0
  136. package/dist/server/_chunks/loader-7yw0j98z.js +78 -0
  137. package/dist/server/_chunks/modules-jn8bmbn8.js +74 -0
  138. package/dist/server/_chunks/pipeline-yy9jhydf.js +832 -0
  139. package/dist/server/_chunks/production-jar9ztm3.js +44 -0
  140. package/dist/server/_chunks/proxy-config-j84dgksn.js +21 -0
  141. package/dist/server/_chunks/proxy-w1d0wmsn.js +33 -0
  142. package/dist/server/_chunks/router-k1reahfn.js +498 -0
  143. package/dist/server/_chunks/routes-2s277fc6.js +64 -0
  144. package/dist/server/_chunks/run-pvd8bs1t.js +696 -0
  145. package/dist/server/_chunks/server-mt4a994c.js +1835 -0
  146. package/dist/server/_chunks/tsconfig-defaults-1nb3308g.js +20 -0
  147. package/dist/server/_chunks/typegen-0qr0459b.js +35 -0
  148. package/dist/server/api/client-cache.js +14 -0
  149. package/dist/server/cli/index.js +378 -0
  150. package/dist/server/cli/start.js +137 -0
  151. package/dist/server/client/reference.js +16 -0
  152. package/dist/server/compat/next/cache.js +56 -0
  153. package/dist/server/compat/next/canonical-url.js +13 -0
  154. package/dist/server/compat/next/client-cache.js +57 -0
  155. package/dist/server/compat/next/client-navigation.js +232 -0
  156. package/dist/server/compat/next/client-only.js +1 -0
  157. package/dist/server/compat/next/client-script.js +178 -0
  158. package/dist/server/compat/next/client-server.js +34 -0
  159. package/dist/server/compat/next/config-headers.js +32 -0
  160. package/dist/server/compat/next/config-loader.js +25 -0
  161. package/dist/server/compat/next/config.js +10 -0
  162. package/dist/server/compat/next/constants.js +18 -0
  163. package/dist/server/compat/next/custom-server.js +10 -0
  164. package/dist/server/compat/next/dist/client/components/app-router-headers.js +48 -0
  165. package/dist/server/compat/next/dist/server/web/spec-extension/revalidate.js +27 -0
  166. package/dist/server/compat/next/dist/server/web/spec-extension/unstable-cache.js +25 -0
  167. package/dist/server/compat/next/dist/server/web/spec-extension/unstable-no-store.js +25 -0
  168. package/dist/server/compat/next/dynamic.js +32 -0
  169. package/dist/server/compat/next/error.js +112 -0
  170. package/dist/server/compat/next/font/cache.js +14 -0
  171. package/dist/server/compat/next/font/google.js +3 -0
  172. package/dist/server/compat/next/font/index.js +1 -0
  173. package/dist/server/compat/next/font/local.js +22 -0
  174. package/dist/server/compat/next/font/runtime-client.js +33 -0
  175. package/dist/server/compat/next/font/runtime.js +41 -0
  176. package/dist/server/compat/next/font/shared.js +22 -0
  177. package/dist/server/compat/next/form.js +129 -0
  178. package/dist/server/compat/next/head.js +10 -0
  179. package/dist/server/compat/next/headers.js +30 -0
  180. package/dist/server/compat/next/image/client.js +11 -0
  181. package/dist/server/compat/next/image/config.js +18 -0
  182. package/dist/server/compat/next/image/optimizer.js +25 -0
  183. package/dist/server/compat/next/image/patterns.js +12 -0
  184. package/dist/server/compat/next/image/props.js +16 -0
  185. package/dist/server/compat/next/image/shared.js +86 -0
  186. package/dist/server/compat/next/image/static-metadata.js +32 -0
  187. package/dist/server/compat/next/image/validate.js +8 -0
  188. package/dist/server/compat/next/image.js +59 -0
  189. package/dist/server/compat/next/index.js +1 -0
  190. package/dist/server/compat/next/legacy-image.js +78 -0
  191. package/dist/server/compat/next/legacy-request-apis.js +24 -0
  192. package/dist/server/compat/next/link-transform.js +14 -0
  193. package/dist/server/compat/next/link.js +14 -0
  194. package/dist/server/compat/next/navigation.js +190 -0
  195. package/dist/server/compat/next/offline.js +45 -0
  196. package/dist/server/compat/next/og.js +8 -0
  197. package/dist/server/compat/next/preferred-region.js +8 -0
  198. package/dist/server/compat/next/redirects.js +30 -0
  199. package/dist/server/compat/next/resource-hints.js +30 -0
  200. package/dist/server/compat/next/rewrites.js +41 -0
  201. package/dist/server/compat/next/root-params.js +121 -0
  202. package/dist/server/compat/next/route-state.js +23 -0
  203. package/dist/server/compat/next/router.js +103 -0
  204. package/dist/server/compat/next/script.js +37 -0
  205. package/dist/server/compat/next/server-only.js +1 -0
  206. package/dist/server/compat/next/server.js +131 -0
  207. package/dist/server/compat/next/svgr.js +14 -0
  208. package/dist/server/compat/next/telemetry.js +10 -0
  209. package/dist/server/compat/next/usage.js +13 -0
  210. package/dist/server/compat/next/user-agent.js +12 -0
  211. package/dist/server/compat/next/web-vitals.js +35 -0
  212. package/dist/server/compat/react/action-state.js +11 -0
  213. package/dist/server/compat/react/client-lite.js +83 -0
  214. package/dist/server/compat/react/client.js +131 -0
  215. package/dist/server/compat/react/compiler-runtime.js +42 -0
  216. package/dist/server/compat/react/dom-client.js +106 -0
  217. package/dist/server/compat/react/dom-react-server.js +37 -0
  218. package/dist/server/compat/react/dom-server.js +40 -0
  219. package/dist/server/compat/react/dom.js +52 -0
  220. package/dist/server/compat/react/hooks-extra.js +12 -0
  221. package/dist/server/compat/react/internals.js +14 -0
  222. package/dist/server/compat/react/parity.js +11 -0
  223. package/dist/server/compat/react/preact.js +113 -0
  224. package/dist/server/compat/react/react-server.js +133 -0
  225. package/dist/server/compat/react/router-shim.js +8 -0
  226. package/dist/server/compat/react/server-component-use.js +14 -0
  227. package/dist/server/compat/react/server-inserted-html.js +14 -0
  228. package/dist/server/compat/react/server.js +194 -0
  229. package/dist/server/compat/react/style-values.js +10 -0
  230. package/dist/server/compat/react/use.js +10 -0
  231. package/dist/server/compat/react/view-transition.js +12 -0
  232. package/dist/server/generation.json +1 -0
  233. package/package.json +4 -1
  234. package/src/api/dynamic.tsx +2 -0
  235. package/src/api/server.ts +24 -6
  236. package/src/cli/adapters/vercel-warm.ts +315 -61
  237. package/src/cli/adapters/vercel.ts +348 -71
  238. package/src/cli/build.ts +58 -33
  239. package/src/cli/index.ts +23 -10
  240. package/src/cli/serve/entry.ts +21 -159
  241. package/src/cli/serve/immutable.ts +31 -0
  242. package/src/cli/serve/pipeline.ts +82 -84
  243. package/src/cli/start.ts +3 -1
  244. package/src/client/chunk-fold.ts +19 -6
  245. package/src/client/react-tier.ts +3 -2
  246. package/src/client/reference-stub.ts +21 -2
  247. package/src/compat/actions/client-plugin.ts +4 -2
  248. package/src/compat/actions/config.ts +6 -5
  249. package/src/compat/actions/extensions.ts +2 -3
  250. package/src/compat/aliases.ts +8 -1
  251. package/src/compat/bundler/config.ts +88 -0
  252. package/src/compat/bundler/optimize-package-imports.ts +86 -26
  253. package/src/compat/bundler/relay-transform.ts +15 -3
  254. package/src/compat/cache-control.ts +16 -8
  255. package/src/compat/css/modules.ts +18 -5
  256. package/src/compat/lifecycle/error-funnel.ts +1 -1
  257. package/src/compat/lifecycle/instrumentation.ts +117 -24
  258. package/src/compat/lifecycle/testmode.ts +3 -2
  259. package/src/compat/next/config-loader.ts +137 -13
  260. package/src/compat/next/font/runtime.ts +22 -2
  261. package/src/compat/next/og.ts +3 -3
  262. package/src/compat/next/usage.ts +3 -2
  263. package/src/compat/pages/api.ts +83 -14
  264. package/src/compat/pages/router.ts +30 -14
  265. package/src/compat/register/bundler.ts +3 -1
  266. package/src/compat/register/middleware.ts +1 -1
  267. package/src/compat/register/otel.ts +5 -9
  268. package/src/compat/register/render.ts +3 -1
  269. package/src/compat/register/use-cache.ts +3 -1
  270. package/src/compat/release.ts +46 -0
  271. package/src/compat/segment/serve.ts +1 -1
  272. package/src/compat/validation/validate.ts +10 -7
  273. package/src/config.ts +51 -7
  274. package/src/css/assets.ts +213 -0
  275. package/src/css/build.ts +174 -238
  276. package/src/dev/server.ts +27 -8
  277. package/src/extensions.ts +4 -0
  278. package/src/render/hooks.ts +13 -0
  279. package/src/render/renderer.ts +52 -32
  280. package/src/request/context.ts +9 -0
  281. package/src/resolve/dynamic.ts +3 -1
  282. package/src/resolve/imports.ts +12 -52
  283. package/src/resolve/package-json.ts +56 -0
  284. package/src/resolve/scan-facts.ts +65 -0
  285. package/src/routing/href.ts +10 -3
  286. package/src/routing/match.ts +287 -0
  287. package/src/routing/metadata-files.ts +19 -5
  288. package/src/routing/proxy-config.ts +137 -0
  289. package/src/routing/proxy.ts +35 -134
  290. package/src/routing/routes.ts +22 -281
  291. package/src/runtime/fingerprint.ts +23 -8
  292. package/src/runtime/load.ts +170 -0
  293. package/src/runtime/loader.ts +215 -43
  294. package/src/runtime/module-cache.ts +13 -0
  295. package/src/runtime/modules.ts +370 -81
  296. package/src/runtime/prebundle.ts +81 -0
  297. package/src/runtime/production.ts +391 -0
  298. package/src/runtime/release-graph.ts +334 -0
  299. package/src/runtime/vendor-build.ts +724 -13
  300. package/src/runtime/vendor.ts +16 -3
  301. package/src/types.ts +2 -0
  302. package/src/utils/fs.ts +89 -3
@@ -0,0 +1,20 @@
1
+ // @bun
2
+ import {
3
+ writeTsconfigDefaults
4
+ } from "./index-9ych9ma8.js";
5
+ import"./index-6e4fqv30.js";
6
+ import"./index-cjgqs13g.js";
7
+ import"./index-jks0x0a1.js";
8
+ import"./index-6b009mt0.js";
9
+ import"./index-4zzebszd.js";
10
+ import"./index-sq3kvz3g.js";
11
+ import"./index-ckkdpht5.js";
12
+ import"./index-20ppawv7.js";
13
+ import"./index-tqn2qnnn.js";
14
+ import"./index-kresp2n8.js";
15
+ import"./index-e3a6yx84.js";
16
+ import"./index-7wc9n8be.js";
17
+ import"./index-rt9qq1va.js";
18
+ export {
19
+ writeTsconfigDefaults
20
+ };
@@ -0,0 +1,35 @@
1
+ // @bun
2
+ import {
3
+ typegenProject,
4
+ writeTypegen
5
+ } from "./index-wpfhfbs4.js";
6
+ import"./index-8k7pfejn.js";
7
+ import"./index-91x12ykq.js";
8
+ import"./index-jepjvcrf.js";
9
+ import"./index-2dv4y4wd.js";
10
+ import"./index-73z4esab.js";
11
+ import"./index-y2jr2n72.js";
12
+ import"./index-web361b8.js";
13
+ import"./index-fp8r0sqs.js";
14
+ import"./index-cjgqs13g.js";
15
+ import"./index-p77b4kcx.js";
16
+ import"./index-20ppawv7.js";
17
+ import"./index-5gyr4emz.js";
18
+ import"./index-x93hv0sc.js";
19
+ import"./index-tqn2qnnn.js";
20
+ import"./index-6kp9r0d9.js";
21
+ import"./index-ras0sdab.js";
22
+ import"./index-grta8ap3.js";
23
+ import"./index-kresp2n8.js";
24
+ import"./index-e3a6yx84.js";
25
+ import"./index-z4z9zv3b.js";
26
+ import"./index-yz54pxrh.js";
27
+ import"./index-7wc9n8be.js";
28
+ import"./index-pym1cezq.js";
29
+ import"./index-zqpqyg8p.js";
30
+ import"./index-qjj6gddn.js";
31
+ import"./index-rt9qq1va.js";
32
+ export {
33
+ typegenProject,
34
+ writeTypegen
35
+ };
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import"../_chunks/index-rt9qq1va.js";
3
+
4
+ // src/api/client-cache.ts
5
+ function cache(fn) {
6
+ return (...args) => fn(...args);
7
+ }
8
+ function cacheSignal() {
9
+ return null;
10
+ }
11
+ export {
12
+ cache,
13
+ cacheSignal
14
+ };
@@ -0,0 +1,378 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+ import { join as __pnextJoin } from "node:path";
4
+ const __PNEXT_PACKAGE_ROOT__ = __pnextJoin(import.meta.dirname, "../../..");
5
+ import {
6
+ markBoot
7
+ } from "../_chunks/index-tq1f96v7.js";
8
+ import {
9
+ commandBinaryName,
10
+ nameEsbuildProcess,
11
+ namedBunBinary
12
+ } from "../_chunks/index-cyfednwb.js";
13
+ import"../_chunks/index-vz0km5qk.js";
14
+ import {
15
+ bold,
16
+ cyan,
17
+ dim
18
+ } from "../_chunks/index-6kp9r0d9.js";
19
+ import {
20
+ __require
21
+ } from "../_chunks/index-rt9qq1va.js";
22
+
23
+ // src/cli/index.ts
24
+ import { existsSync, readFileSync, statSync } from "fs";
25
+ import path from "path";
26
+ var MIN_BUN = "1.3.10";
27
+ var BROKEN_BUN = new Set(["1.3.14"]);
28
+ var VERSION = packageVersion();
29
+ var COMMANDS = new Set([
30
+ "dev",
31
+ "build",
32
+ "start",
33
+ "analyze",
34
+ "typegen",
35
+ "create",
36
+ "migrate",
37
+ "info"
38
+ ]);
39
+ if (typeof Bun === "undefined") {
40
+ console.error(`pnext requires Bun >=${MIN_BUN}. Install it from https://bun.sh/get`);
41
+ process.exit(1);
42
+ }
43
+ var bunVersion = Bun.version.split("-")[0] ?? Bun.version;
44
+ if (BROKEN_BUN.has(bunVersion)) {
45
+ console.error(`pnext does not support Bun ${Bun.version}: it crashes the process at runtime. ` + "Upgrade to latest Bun with `bun upgrade`.");
46
+ process.exit(1);
47
+ } else if (!Bun.semver.satisfies(bunVersion, `>=${MIN_BUN}`)) {
48
+ console.error(`pnext requires Bun >=${MIN_BUN}, found ${Bun.version}. Upgrade with \`bun upgrade\`.`);
49
+ process.exit(1);
50
+ }
51
+ var [, , command, ...args] = process.argv;
52
+ markBoot("cli:entry");
53
+ namedBunBinary(commandBinaryName(command));
54
+ if (command !== "start")
55
+ nameEsbuildProcess();
56
+ markBoot("cli:naming");
57
+ try {
58
+ if (command === "--version" || command === "-v") {
59
+ console.log(VERSION);
60
+ } else if (command === "--help" || command === "-h" || !command) {
61
+ printHelp();
62
+ } else if (COMMANDS.has(command) && (args.includes("--help") || args.includes("-h"))) {
63
+ printCommandHelp(command);
64
+ } else if (command === "dev") {
65
+ warnUnknownFlags(command, args);
66
+ const { dev } = await import("../_chunks/dev-fjmqg6en.js");
67
+ await dev({
68
+ root: positionalRoot(args),
69
+ port: optionNumber(args, "--port"),
70
+ hostname: optionString(args, "--hostname")
71
+ });
72
+ } else if (command === "build") {
73
+ warnUnknownFlags(command, args);
74
+ const { buildProject } = await import("../_chunks/build-t9h0hec3.js");
75
+ await buildProject(positionalRoot(args), {
76
+ adapter: adapterOption(args),
77
+ verbose: args.includes("--verbose"),
78
+ debugBuildPaths: optionString(args, "--debug-build-paths"),
79
+ buildMode: buildModeOption(args),
80
+ debugPrerender: args.includes("--debug-prerender")
81
+ });
82
+ await (await import("../_chunks/build-spy3dxp4.js")).stopCssWorker();
83
+ process.exit(0);
84
+ } else if (command === "start") {
85
+ warnUnknownFlags(command, args);
86
+ const root = positionalRoot(args);
87
+ const { start } = await prebundleServes(root) ? await import("./start.js") : await import(new URL("./start.ts", Bun.pathToFileURL(__PNEXT_PACKAGE_ROOT__ + "/src/cli/index.ts").href).href);
88
+ await start({
89
+ root,
90
+ port: optionNumber(args, "--port"),
91
+ hostname: optionString(args, "--hostname")
92
+ });
93
+ } else if (command === "analyze") {
94
+ warnUnknownFlags(command, args);
95
+ const { analyzeProject } = await import("../_chunks/analyze-arswqe6s.js");
96
+ const { route, root } = analyzePositionals(args);
97
+ const result = await analyzeProject(root, {
98
+ compression: analyzeCompression(args),
99
+ route
100
+ });
101
+ if (args.includes("--json")) {
102
+ console.log(JSON.stringify(result, null, 2));
103
+ } else {
104
+ const { printAnalyzeResult } = await import("../_chunks/analyze-arswqe6s.js");
105
+ printAnalyzeResult(result, { route, files: args.includes("--files") });
106
+ }
107
+ } else if (command === "typegen") {
108
+ warnUnknownFlags(command, args);
109
+ const { typegenProject } = await import("../_chunks/typegen-0qr0459b.js");
110
+ const result = await typegenProject(positionalRoot(args));
111
+ console.log(`Generated ${result.routes} route types, ${result.aliases} aliases, and ${result.checks} checks at ${result.file}`);
112
+ process.exit(0);
113
+ } else if (command === "create") {
114
+ warnUnknownFlags(command, args);
115
+ const { createApp } = await import("../_chunks/create-meec9hs6.js");
116
+ await createApp(positionals(args)[0], { install: !args.includes("--no-install") });
117
+ process.exit(0);
118
+ } else if (command === "migrate") {
119
+ warnUnknownFlags(command, args);
120
+ const { migrateApp } = await import("../_chunks/run-pvd8bs1t.js");
121
+ const code = await migrateApp(positionalRoot(args), { dryRun: args.includes("--dry-run") });
122
+ process.exit(code);
123
+ } else if (command === "info") {
124
+ warnUnknownFlags(command, args);
125
+ printInfo();
126
+ } else {
127
+ printHelp();
128
+ process.exit(command ? 1 : 0);
129
+ }
130
+ } catch (error) {
131
+ const formatted = formatCliError(error);
132
+ if (formatted.message.trim())
133
+ console.error(formatted.message);
134
+ else
135
+ console.error(error instanceof Error ? error.stack ?? `${error.name}: ${error.message}` : String(error));
136
+ if (formatted.trace)
137
+ console.log(`
138
+ ${formatted.trace}`);
139
+ process.exit(1);
140
+ }
141
+ function formatCliError(error) {
142
+ const message = error instanceof Error ? error.message : String(error);
143
+ const traceStart = message.indexOf(`
144
+ pnext client import trace for route `);
145
+ if (traceStart === -1)
146
+ return { message };
147
+ return {
148
+ message: message.slice(0, traceStart),
149
+ trace: message.slice(traceStart + 1)
150
+ };
151
+ }
152
+ async function prebundleServes(root = process.cwd()) {
153
+ if (typeof { version: "0.1.7", fingerprint: "3e1b3462bd8a29ed", entries: ["cli/index", "cli/start", "client/reference", "api/client-cache", "compat/next/canonical-url", "compat/next/link-transform", "compat/next/client-navigation", "compat/next/og", "compat/next/link", "compat/next/usage", "compat/next/client-script", "compat/next/headers", "compat/next/custom-server", "compat/next/legacy-image", "compat/next/router", "compat/next/navigation", "compat/next/dist/server/web/spec-extension/unstable-no-store", "compat/next/dist/server/web/spec-extension/unstable-cache", "compat/next/dist/server/web/spec-extension/revalidate", "compat/next/dist/client/components/app-router-headers", "compat/next/web-vitals", "compat/next/root-params", "compat/next/route-state", "compat/next/server-only", "compat/next/client-server", "compat/next/legacy-request-apis", "compat/next/redirects", "compat/next/resource-hints", "compat/next/svgr", "compat/next/client-only", "compat/next/image/props", "compat/next/image/optimizer", "compat/next/image/validate", "compat/next/image/shared", "compat/next/image/patterns", "compat/next/image/config", "compat/next/image/client", "compat/next/image/static-metadata", "compat/next/user-agent", "compat/next/client-cache", "compat/next/head", "compat/next/dynamic", "compat/next/telemetry", "compat/next/offline", "compat/next/cache", "compat/next/constants", "compat/next/error", "compat/next/script", "compat/next/index", "compat/next/font/shared", "compat/next/font/runtime", "compat/next/font/google", "compat/next/font/cache", "compat/next/font/runtime-client", "compat/next/font/local", "compat/next/font/index", "compat/next/config-loader", "compat/next/config", "compat/next/image", "compat/next/server", "compat/next/rewrites", "compat/next/preferred-region", "compat/next/config-headers", "compat/next/form", "compat/react/dom", "compat/react/hooks-extra", "compat/react/react-server", "compat/react/dom-client", "compat/react/style-values", "compat/react/compiler-runtime", "compat/react/router-shim", "compat/react/dom-server", "compat/react/dom-react-server", "compat/react/server-component-use", "compat/react/action-state", "compat/react/client", "compat/react/client-lite", "compat/react/server-inserted-html", "compat/react/parity", "compat/react/preact", "compat/react/use", "compat/react/view-transition", "compat/react/internals", "compat/react/server"] } !== "object")
154
+ return true;
155
+ const [{ DEFAULT_OUT_DIR }, { locateRelease, readBuildIndex }] = await Promise.all([
156
+ import("../_chunks/config-1yzwexq6.js"),
157
+ import("../_chunks/production-jar9ztm3.js")
158
+ ]);
159
+ const outPath = locateRelease(path.resolve(root), DEFAULT_OUT_DIR);
160
+ return !outPath || readBuildIndex(outPath).framework === { version: "0.1.7", fingerprint: "3e1b3462bd8a29ed", entries: ["cli/index", "cli/start", "client/reference", "api/client-cache", "compat/next/canonical-url", "compat/next/link-transform", "compat/next/client-navigation", "compat/next/og", "compat/next/link", "compat/next/usage", "compat/next/client-script", "compat/next/headers", "compat/next/custom-server", "compat/next/legacy-image", "compat/next/router", "compat/next/navigation", "compat/next/dist/server/web/spec-extension/unstable-no-store", "compat/next/dist/server/web/spec-extension/unstable-cache", "compat/next/dist/server/web/spec-extension/revalidate", "compat/next/dist/client/components/app-router-headers", "compat/next/web-vitals", "compat/next/root-params", "compat/next/route-state", "compat/next/server-only", "compat/next/client-server", "compat/next/legacy-request-apis", "compat/next/redirects", "compat/next/resource-hints", "compat/next/svgr", "compat/next/client-only", "compat/next/image/props", "compat/next/image/optimizer", "compat/next/image/validate", "compat/next/image/shared", "compat/next/image/patterns", "compat/next/image/config", "compat/next/image/client", "compat/next/image/static-metadata", "compat/next/user-agent", "compat/next/client-cache", "compat/next/head", "compat/next/dynamic", "compat/next/telemetry", "compat/next/offline", "compat/next/cache", "compat/next/constants", "compat/next/error", "compat/next/script", "compat/next/index", "compat/next/font/shared", "compat/next/font/runtime", "compat/next/font/google", "compat/next/font/cache", "compat/next/font/runtime-client", "compat/next/font/local", "compat/next/font/index", "compat/next/config-loader", "compat/next/config", "compat/next/image", "compat/next/server", "compat/next/rewrites", "compat/next/preferred-region", "compat/next/config-headers", "compat/next/form", "compat/react/dom", "compat/react/hooks-extra", "compat/react/react-server", "compat/react/dom-client", "compat/react/style-values", "compat/react/compiler-runtime", "compat/react/router-shim", "compat/react/dom-server", "compat/react/dom-react-server", "compat/react/server-component-use", "compat/react/action-state", "compat/react/client", "compat/react/client-lite", "compat/react/server-inserted-html", "compat/react/parity", "compat/react/preact", "compat/react/use", "compat/react/view-transition", "compat/react/internals", "compat/react/server"] }.fingerprint && VERSION === { version: "0.1.7", fingerprint: "3e1b3462bd8a29ed", entries: ["cli/index", "cli/start", "client/reference", "api/client-cache", "compat/next/canonical-url", "compat/next/link-transform", "compat/next/client-navigation", "compat/next/og", "compat/next/link", "compat/next/usage", "compat/next/client-script", "compat/next/headers", "compat/next/custom-server", "compat/next/legacy-image", "compat/next/router", "compat/next/navigation", "compat/next/dist/server/web/spec-extension/unstable-no-store", "compat/next/dist/server/web/spec-extension/unstable-cache", "compat/next/dist/server/web/spec-extension/revalidate", "compat/next/dist/client/components/app-router-headers", "compat/next/web-vitals", "compat/next/root-params", "compat/next/route-state", "compat/next/server-only", "compat/next/client-server", "compat/next/legacy-request-apis", "compat/next/redirects", "compat/next/resource-hints", "compat/next/svgr", "compat/next/client-only", "compat/next/image/props", "compat/next/image/optimizer", "compat/next/image/validate", "compat/next/image/shared", "compat/next/image/patterns", "compat/next/image/config", "compat/next/image/client", "compat/next/image/static-metadata", "compat/next/user-agent", "compat/next/client-cache", "compat/next/head", "compat/next/dynamic", "compat/next/telemetry", "compat/next/offline", "compat/next/cache", "compat/next/constants", "compat/next/error", "compat/next/script", "compat/next/index", "compat/next/font/shared", "compat/next/font/runtime", "compat/next/font/google", "compat/next/font/cache", "compat/next/font/runtime-client", "compat/next/font/local", "compat/next/font/index", "compat/next/config-loader", "compat/next/config", "compat/next/image", "compat/next/server", "compat/next/rewrites", "compat/next/preferred-region", "compat/next/config-headers", "compat/next/form", "compat/react/dom", "compat/react/hooks-extra", "compat/react/react-server", "compat/react/dom-client", "compat/react/style-values", "compat/react/compiler-runtime", "compat/react/router-shim", "compat/react/dom-server", "compat/react/dom-react-server", "compat/react/server-component-use", "compat/react/action-state", "compat/react/client", "compat/react/client-lite", "compat/react/server-inserted-html", "compat/react/parity", "compat/react/preact", "compat/react/use", "compat/react/view-transition", "compat/react/internals", "compat/react/server"] }.version;
161
+ }
162
+ function positionalRoot(args2) {
163
+ return positionals(args2)[0];
164
+ }
165
+ function analyzePositionals(args2) {
166
+ let route;
167
+ let root;
168
+ for (const arg of positionals(args2)) {
169
+ if (!route && arg.startsWith("/") && !isProjectDirectory(arg))
170
+ route = arg;
171
+ else
172
+ root ??= arg;
173
+ }
174
+ return { route, root };
175
+ }
176
+ function isProjectDirectory(candidate) {
177
+ if (!isDirectory(candidate))
178
+ return false;
179
+ return ["package.json", ".pnext", "app", path.join("src", "app")].some((entry) => existsSync(path.join(candidate, entry)));
180
+ }
181
+ function positionals(args2) {
182
+ const out = [];
183
+ for (let index = 0;index < args2.length; index += 1) {
184
+ const arg = args2[index];
185
+ if (!arg)
186
+ continue;
187
+ if (arg === "--port" || arg === "--adapter" || arg === "--hostname" || arg === "--debug-build-paths" || arg === "--experimental-build-mode") {
188
+ index += 1;
189
+ continue;
190
+ }
191
+ if (!arg.startsWith("--"))
192
+ out.push(arg);
193
+ }
194
+ return out;
195
+ }
196
+ function isDirectory(candidate) {
197
+ try {
198
+ return statSync(candidate).isDirectory();
199
+ } catch {
200
+ return false;
201
+ }
202
+ }
203
+ function optionNumber(args2, name) {
204
+ const index = args2.indexOf(name);
205
+ if (index === -1)
206
+ return;
207
+ const value = args2[index + 1];
208
+ return value ? Number(value) : undefined;
209
+ }
210
+ function optionString(args2, name) {
211
+ const inline = args2.find((arg) => arg.startsWith(`${name}=`));
212
+ if (inline !== undefined)
213
+ return inline.slice(name.length + 1);
214
+ const index = args2.indexOf(name);
215
+ if (index === -1)
216
+ return;
217
+ return args2[index + 1];
218
+ }
219
+ function buildModeOption(args2) {
220
+ const value = optionString(args2, "--experimental-build-mode");
221
+ if (value === "compile" || value === "generate")
222
+ return value;
223
+ if (value !== undefined) {
224
+ console.error(`error: option '--experimental-build-mode <mode>' argument '${value}' is invalid. Expected 'compile' or 'generate'.`);
225
+ process.exit(1);
226
+ }
227
+ return;
228
+ }
229
+ function adapterOption(args2) {
230
+ const index = args2.indexOf("--adapter");
231
+ if (index === -1)
232
+ return;
233
+ const adapter = args2[index + 1];
234
+ if (adapter === "vercel")
235
+ return adapter;
236
+ throw new Error(`Unsupported adapter: ${adapter ?? ""}`);
237
+ }
238
+ function analyzeCompression(args2) {
239
+ return args2.includes("--brotli") ? "brotli" : "gzip";
240
+ }
241
+ function packageVersion() {
242
+ const packageJson = JSON.parse(readFileSync(new URL("../../package.json", Bun.pathToFileURL(__PNEXT_PACKAGE_ROOT__ + "/src/cli/index.ts").href), "utf8"));
243
+ return typeof packageJson.version === "string" ? packageJson.version : "unknown";
244
+ }
245
+ function warnUnknownFlags(command2, args2) {
246
+ const flags = commandFlags(command2);
247
+ for (const arg of args2) {
248
+ if (!arg.startsWith("-") || arg === "--")
249
+ continue;
250
+ const name = arg.startsWith("--") ? arg.split("=", 1)[0] : arg;
251
+ if (!flags.has(name))
252
+ console.warn(`Warning: unknown option '${name}' was ignored.`);
253
+ }
254
+ }
255
+ function commandFlags(command2) {
256
+ const flags = new Set(["--help", "-h"]);
257
+ if (command2 === "dev" || command2 === "start") {
258
+ flags.add("--port");
259
+ flags.add("--hostname");
260
+ }
261
+ if (command2 === "build") {
262
+ for (const flag of [
263
+ "--adapter",
264
+ "--verbose",
265
+ "--experimental-build-mode",
266
+ "--debug-build-paths",
267
+ "--debug-prerender"
268
+ ])
269
+ flags.add(flag);
270
+ }
271
+ if (command2 === "analyze")
272
+ for (const flag of ["--json", "--files", "--brotli"])
273
+ flags.add(flag);
274
+ if (command2 === "create")
275
+ flags.add("--no-install");
276
+ if (command2 === "migrate")
277
+ flags.add("--dry-run");
278
+ return flags;
279
+ }
280
+ function printInfo() {
281
+ const config = configPresence(process.cwd());
282
+ console.log(`pnext info
283
+ pnext: ${VERSION}
284
+ bun: ${Bun.version}
285
+ os: ${process.platform} ${process.arch}
286
+ package manager: ${packageManager(process.cwd())}
287
+ pnext.config: ${config.pnext}
288
+ next.config: ${config.next}`);
289
+ }
290
+ function packageManager(root) {
291
+ if (existsSync(path.join(root, "bun.lock")) || existsSync(path.join(root, "bun.lockb")))
292
+ return "bun";
293
+ if (existsSync(path.join(root, "pnpm-lock.yaml")))
294
+ return "pnpm";
295
+ if (existsSync(path.join(root, "yarn.lock")))
296
+ return "yarn";
297
+ if (existsSync(path.join(root, "package-lock.json")))
298
+ return "npm";
299
+ return "unknown";
300
+ }
301
+ function configPresence(root) {
302
+ const find = (base) => {
303
+ const file = ["js", "mjs", "cjs", "ts"].map((extension) => `${base}.${extension}`).find((file2) => existsSync(path.join(root, file2)));
304
+ return file ?? "none";
305
+ };
306
+ return { pnext: find("pnext.config"), next: find("next.config") };
307
+ }
308
+ function printHelp() {
309
+ const commands = [
310
+ ["dev", "Start the development server."],
311
+ ["build", "Create a production build."],
312
+ ["start", "Start the production server."],
313
+ ["analyze", "Analyze production bundle output."],
314
+ ["typegen", "Generate route TypeScript definitions."],
315
+ ["create", "Create a new pnext application."],
316
+ ["migrate", "Migrate a Next.js application to pnext."],
317
+ ["info", "Print environment details for bug reports."]
318
+ ];
319
+ const flags = [
320
+ ["--port <port>", "Port to listen on (default: 3000)."],
321
+ ["--hostname <hostname>", "Hostname to listen on (default: 0.0.0.0)."],
322
+ ["--version, -v", "Print the pnext version."],
323
+ ["--help, -h", "Show this help message."]
324
+ ];
325
+ const row = ([name, text], width) => ` ${cyan(name.padEnd(width))} ${dim(text)}`;
326
+ console.log(`\u26A1 ${bold("pnext")} ${dim(VERSION)}
327
+
328
+ ${bold("Usage:")} pnext ${cyan("<command>")} [options]
329
+
330
+ ${bold("Commands:")}
331
+ ${commands.map((entry) => row(entry, 9)).join(`
332
+ `)}
333
+
334
+ ${bold("Common flags:")}
335
+ ${flags.map((entry) => row(entry, 21)).join(`
336
+ `)}
337
+
338
+ ${bold("Docs:")} ${cyan("https://pnext.dev")}`);
339
+ }
340
+ function printCommandHelp(command2) {
341
+ const help = {
342
+ dev: `Usage: pnext dev [directory] [options]
343
+
344
+ Flags:
345
+ --port <port> Port to listen on (default: 3000).
346
+ --hostname <hostname> Hostname to listen on (default: 0.0.0.0).`,
347
+ build: `Usage: pnext build [directory] [options]
348
+
349
+ Flags:
350
+ --adapter <adapter> Deployment adapter (vercel).
351
+ --verbose Print detailed build output.
352
+ --experimental-build-mode <mode> Build mode: compile or generate.
353
+ --debug-build-paths <patterns> Build matching routes only.
354
+ --debug-prerender Debug prerender failures.`,
355
+ start: `Usage: pnext start [directory] [options]
356
+
357
+ Flags:
358
+ --port <port> Port to listen on (default: 3000).
359
+ --hostname <hostname> Hostname to listen on (default: 0.0.0.0).`,
360
+ analyze: `Usage: pnext analyze [route] [directory] [options]
361
+
362
+ Flags:
363
+ --json Print JSON output.
364
+ --files Include individual files.
365
+ --brotli Report Brotli compression.`,
366
+ typegen: "Usage: pnext typegen [directory]",
367
+ create: `Usage: pnext create <directory> [options]
368
+
369
+ Flags:
370
+ --no-install Skip dependency installation.`,
371
+ migrate: `Usage: pnext migrate [directory] [options]
372
+
373
+ Flags:
374
+ --dry-run Preview changes without writing.`,
375
+ info: "Usage: pnext info"
376
+ };
377
+ console.log(help[command2]);
378
+ }
@@ -0,0 +1,137 @@
1
+ // @bun
2
+ import {
3
+ browserHost,
4
+ ensurePortFree,
5
+ openBrowser,
6
+ printServerReady
7
+ } from "../_chunks/index-q738kkhj.js";
8
+ import {
9
+ bootstrapCompat
10
+ } from "../_chunks/index-5gyr4emz.js";
11
+ import {
12
+ registerPrebundleResolve
13
+ } from "../_chunks/index-y36a0ybw.js";
14
+ import {
15
+ loadConfig
16
+ } from "../_chunks/index-x93hv0sc.js";
17
+ import {
18
+ markErrorLogged
19
+ } from "../_chunks/index-jcsjq3d1.js";
20
+ import"../_chunks/index-tqn2qnnn.js";
21
+ import"../_chunks/index-6kp9r0d9.js";
22
+ import {
23
+ drainWorkUnits
24
+ } from "../_chunks/index-grta8ap3.js";
25
+ import"../_chunks/index-kresp2n8.js";
26
+ import {
27
+ isPostpone
28
+ } from "../_chunks/index-e3a6yx84.js";
29
+ import"../_chunks/index-pym1cezq.js";
30
+ import {
31
+ getBuildExtensions
32
+ } from "../_chunks/index-zqpqyg8p.js";
33
+ import"../_chunks/index-qjj6gddn.js";
34
+ import {
35
+ __require
36
+ } from "../_chunks/index-rt9qq1va.js";
37
+
38
+ // src/cli/start.ts
39
+ import { readFile } from "fs/promises";
40
+ import path from "path";
41
+ async function createRequestHandler(options = {}) {
42
+ registerPrebundleResolve();
43
+ const { createRequestHandler: create } = await import("../_chunks/pipeline-yy9jhydf.js");
44
+ return create(options);
45
+ }
46
+ async function maybeBuiltFile(...args) {
47
+ const { maybeBuiltFile: impl } = await import("../_chunks/pipeline-yy9jhydf.js");
48
+ return impl(...args);
49
+ }
50
+ async function start(options = {}) {
51
+ const startedAt = Date.now();
52
+ const port = options.port ?? 3000;
53
+ const hostname = options.hostname ?? "0.0.0.0";
54
+ const config = await guardUnservableOutputMode(options.root);
55
+ const manifest = await readProductionManifest(config);
56
+ await ensurePortFree(port, hostname);
57
+ let handler;
58
+ let pending;
59
+ const ensureHandler = () => pending ??= createRequestHandler({ root: options.root, config, manifest }).then((ready) => {
60
+ handler = ready;
61
+ return ready;
62
+ });
63
+ const server = Bun.serve({
64
+ hostname,
65
+ port,
66
+ fetch: (request, server2) => handler ? handler(request, server2) : ensureHandler().then((ready) => ready(request, server2))
67
+ });
68
+ printServerReady({
69
+ mode: "production",
70
+ hostname,
71
+ port: server.port ?? port,
72
+ elapsedMs: Date.now() - startedAt
73
+ });
74
+ ensureHandler().catch(() => {
75
+ return;
76
+ });
77
+ openBrowser(`http://${browserHost(hostname)}:${server.port ?? port}`);
78
+ installShutdownHandlers(server);
79
+ installProcessErrorHandlers();
80
+ return server;
81
+ }
82
+ function installProcessErrorHandlers() {
83
+ const globalWithFlag = globalThis;
84
+ if (globalWithFlag.__pnextProcessErrorHandlers)
85
+ return;
86
+ globalWithFlag.__pnextProcessErrorHandlers = true;
87
+ const report = (reason) => {
88
+ if (isPostpone(reason))
89
+ return;
90
+ if (markErrorLogged(reason))
91
+ console.error(reason);
92
+ };
93
+ process.on("unhandledRejection", report);
94
+ process.on("uncaughtException", report);
95
+ }
96
+ async function readProductionManifest(config) {
97
+ try {
98
+ return JSON.parse(await readFile(path.join(config.outPath, "manifest.json"), "utf8"));
99
+ } catch (error) {
100
+ if (error.code === "ENOENT") {
101
+ throw new Error("No production build found. Run 'pnext build' first.");
102
+ }
103
+ throw error;
104
+ }
105
+ }
106
+ async function guardUnservableOutputMode(root) {
107
+ const config = await loadConfig(root, { serve: true });
108
+ await bootstrapCompat(config);
109
+ const mode = getBuildExtensions().compat.nextOutputMode();
110
+ if (mode === "export") {
111
+ console.error('"next start" does not work with "output: export" configuration. Use "npx serve@latest out" instead.');
112
+ process.exit(1);
113
+ }
114
+ if (mode === "standalone" && !process.env.__NEXT_PRIVATE_STANDALONE_CONFIG) {
115
+ console.warn('"next start" does not work with "output: standalone" configuration. Use "node .next/standalone/server.js" instead.');
116
+ }
117
+ return config;
118
+ }
119
+ function installShutdownHandlers(server) {
120
+ let shuttingDown = false;
121
+ const shutdown = async () => {
122
+ if (shuttingDown)
123
+ return;
124
+ shuttingDown = true;
125
+ server.stop();
126
+ await drainWorkUnits();
127
+ process.exit(0);
128
+ };
129
+ process.on("SIGINT", shutdown);
130
+ process.on("SIGTERM", shutdown);
131
+ }
132
+ export {
133
+ createRequestHandler,
134
+ maybeBuiltFile,
135
+ readProductionManifest,
136
+ start
137
+ };
@@ -0,0 +1,16 @@
1
+ // @bun
2
+ import {
3
+ clientReferenceId,
4
+ clientReferenceSymbol,
5
+ compiledClientReferenceFiles,
6
+ noteCompiledClientReference,
7
+ ssrClientReference
8
+ } from "../_chunks/index-ras0sdab.js";
9
+ import"../_chunks/index-rt9qq1va.js";
10
+ export {
11
+ clientReferenceId,
12
+ clientReferenceSymbol,
13
+ compiledClientReferenceFiles,
14
+ noteCompiledClientReference,
15
+ ssrClientReference
16
+ };
@@ -0,0 +1,56 @@
1
+ // @bun
2
+ import {
3
+ cacheLife,
4
+ cacheTag,
5
+ expirePath,
6
+ expireTag,
7
+ refresh,
8
+ revalidatePath,
9
+ revalidateTag,
10
+ unstable_cache,
11
+ unstable_cacheLife,
12
+ unstable_cacheTag,
13
+ unstable_expirePath,
14
+ unstable_expireTag,
15
+ unstable_noStore,
16
+ unstable_refresh,
17
+ updateTag
18
+ } from "../../_chunks/index-tq0pc7eg.js";
19
+ import {
20
+ io
21
+ } from "../../_chunks/index-9hx2641q.js";
22
+ import"../../_chunks/index-eajaspjk.js";
23
+ import"../../_chunks/index-9n2914ww.js";
24
+ import"../../_chunks/index-bcws5eh2.js";
25
+ import"../../_chunks/index-6e4fqv30.js";
26
+ import"../../_chunks/index-cjgqs13g.js";
27
+ import"../../_chunks/index-jks0x0a1.js";
28
+ import"../../_chunks/index-6b009mt0.js";
29
+ import"../../_chunks/index-4zzebszd.js";
30
+ import"../../_chunks/index-sq3kvz3g.js";
31
+ import"../../_chunks/index-ckkdpht5.js";
32
+ import"../../_chunks/index-jcsjq3d1.js";
33
+ import"../../_chunks/index-grta8ap3.js";
34
+ import"../../_chunks/index-kresp2n8.js";
35
+ import"../../_chunks/index-e3a6yx84.js";
36
+ import"../../_chunks/index-7wc9n8be.js";
37
+ import"../../_chunks/index-qjj6gddn.js";
38
+ import"../../_chunks/index-rt9qq1va.js";
39
+ export {
40
+ cacheLife,
41
+ cacheTag,
42
+ expirePath,
43
+ expireTag,
44
+ io,
45
+ refresh,
46
+ revalidatePath,
47
+ revalidateTag,
48
+ unstable_cache,
49
+ unstable_cacheLife,
50
+ unstable_cacheTag,
51
+ unstable_expirePath,
52
+ unstable_expireTag,
53
+ unstable_noStore,
54
+ unstable_refresh,
55
+ updateTag
56
+ };