@wular/pnext 0.1.7 → 0.1.9

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 (172) hide show
  1. package/dist/server/_chunks/{aliases-j47a10ce.js → aliases-fhv4dt06.js} +7 -5
  2. package/dist/server/_chunks/{analyze-arswqe6s.js → analyze-09kx9q6r.js} +17 -13
  3. package/dist/server/_chunks/{boot-af0mv3dy.js → boot-8aj7efqk.js} +13 -11
  4. package/dist/server/_chunks/{build-spy3dxp4.js → build-jda155c9.js} +7 -5
  5. package/dist/server/_chunks/{build-tier-m7yvqz61.js → build-tier-qrkpfsk1.js} +59 -75
  6. package/dist/server/_chunks/{build-t9h0hec3.js → build-wspv5h60.js} +1004 -1191
  7. package/dist/server/_chunks/{compile-53j02j27.js → compile-040r79gj.js} +2 -2
  8. package/dist/server/_chunks/{config-n2z7yxps.js → config-7h84p6q8.js} +6 -4
  9. package/dist/server/_chunks/{config-1yzwexq6.js → config-d4hqyygy.js} +12 -3
  10. package/dist/server/_chunks/{create-meec9hs6.js → create-skj8wzt5.js} +4 -3
  11. package/dist/server/_chunks/{dev-fjmqg6en.js → dev-pennd36n.js} +2 -2
  12. package/dist/server/_chunks/{generate-n9sh6hzt.js → generate-d8vb1d21.js} +5 -4
  13. package/dist/server/_chunks/{index-eeaanp2e.js → index-0qt2vapb.js} +3 -3
  14. package/dist/server/_chunks/{index-91x12ykq.js → index-0r5eqfc7.js} +6 -1
  15. package/dist/server/_chunks/{index-9ych9ma8.js → index-0wm2p3ks.js} +2 -2
  16. package/dist/server/_chunks/{index-357na4a8.js → index-141vcwk6.js} +1 -1
  17. package/dist/server/_chunks/{index-2dv4y4wd.js → index-1y0cesgn.js} +16 -10
  18. package/dist/server/_chunks/{index-ytjvpbm2.js → index-26gwrm07.js} +3 -3
  19. package/dist/server/_chunks/{index-8k7pfejn.js → index-3r6qpe8a.js} +7 -7
  20. package/dist/server/_chunks/{index-rn8dyr1f.js → index-42fef2rv.js} +8 -48
  21. package/dist/server/_chunks/{index-ncnes8c6.js → index-47gx7trn.js} +2 -2
  22. package/dist/server/_chunks/{index-20ppawv7.js → index-4qsce64w.js} +3 -3
  23. package/dist/server/_chunks/{index-1011cscr.js → index-4vf121ws.js} +61 -29
  24. package/dist/server/_chunks/{index-cf4rvxv6.js → index-52k54ykj.js} +1 -1
  25. package/dist/server/_chunks/{index-nyrba2kr.js → index-53fnn598.js} +11 -11
  26. package/dist/server/_chunks/{index-4hgjrqh7.js → index-6tb725m8.js} +2 -2
  27. package/dist/server/_chunks/{index-3xbr4eyv.js → index-912z4mfx.js} +3 -3
  28. package/dist/server/_chunks/{index-sjpckxqn.js → index-9f49w76j.js} +1 -1
  29. package/dist/server/_chunks/{index-jepjvcrf.js → index-aarf1brn.js} +1 -1
  30. package/dist/server/_chunks/{index-9n2914ww.js → index-akkrvjn6.js} +1 -1
  31. package/dist/server/_chunks/index-bzd2ef7t.js +10 -0
  32. package/dist/server/_chunks/{index-sv8m6789.js → index-cqcwwxfp.js} +5 -5
  33. package/dist/server/_chunks/{index-yz54pxrh.js → index-d1jsmhhk.js} +4 -9
  34. package/dist/server/_chunks/{index-vvmmknm1.js → index-da0fphj0.js} +19 -15
  35. package/dist/server/_chunks/{index-sctcgyvv.js → index-drwv61cc.js} +2 -2
  36. package/dist/server/_chunks/{index-z84ab1w0.js → index-e176wk6x.js} +3 -3
  37. package/dist/server/_chunks/{index-9hx2641q.js → index-entm8bmz.js} +1 -1
  38. package/dist/server/_chunks/index-fpghsgb4.js +352 -0
  39. package/dist/server/_chunks/{index-jx7bqvw1.js → index-hr63fvzn.js} +1 -1
  40. package/dist/server/_chunks/{index-eajaspjk.js → index-j0m1jxqa.js} +1 -1
  41. package/dist/server/_chunks/index-jbj7ehef.js +50 -0
  42. package/dist/server/_chunks/{index-egykcqg3.js → index-jexsy9a8.js} +1 -1
  43. package/dist/server/_chunks/{index-fkp000p1.js → index-jjppzw0s.js} +2 -2
  44. package/dist/server/_chunks/index-jt8e1pje.js +12 -0
  45. package/dist/server/_chunks/{index-ggk2j965.js → index-kpdph69z.js} +56 -50
  46. package/dist/server/_chunks/{index-6e4fqv30.js → index-m63czgq5.js} +2 -0
  47. package/dist/server/_chunks/{index-c0g2wf3z.js → index-md5jchzy.js} +1 -1
  48. package/dist/server/_chunks/{index-tvqkq6e6.js → index-n814hcky.js} +1 -1
  49. package/dist/server/_chunks/{index-06nyqntx.js → index-q3r9z8mq.js} +1 -1
  50. package/dist/server/_chunks/{index-4q2gbfwk.js → index-qjrh7w2g.js} +2 -2
  51. package/dist/server/_chunks/{index-3b3at80h.js → index-s61bx2aj.js} +6 -3
  52. package/dist/server/_chunks/{index-ym67zqxp.js → index-tf4j19ge.js} +1 -1
  53. package/dist/server/_chunks/{index-qn4z5s3c.js → index-typcbcsv.js} +3 -3
  54. package/dist/server/_chunks/{index-p77b4kcx.js → index-veycp46e.js} +1 -1
  55. package/dist/server/_chunks/{index-11sfk4hb.js → index-vmr35jjw.js} +1 -1
  56. package/dist/server/_chunks/{index-kq8kpzye.js → index-vqs3rebe.js} +3 -3
  57. package/dist/server/_chunks/{index-danncfhy.js → index-wm36rj4v.js} +1 -1
  58. package/dist/server/_chunks/{index-z4z9zv3b.js → index-x9c55pzy.js} +141 -3
  59. package/dist/server/_chunks/{index-y2jr2n72.js → index-xrsg0041.js} +4 -4
  60. package/dist/server/_chunks/{index-k1g3epw0.js → index-xs3411qh.js} +10 -10
  61. package/dist/server/_chunks/{index-0374j2b9.js → index-y4d02znn.js} +1 -1
  62. package/dist/server/_chunks/{index-wpfhfbs4.js → index-y71a76dn.js} +4 -4
  63. package/dist/server/_chunks/{index-qm6kmhqs.js → index-y7mzvq2q.js} +1 -1
  64. package/dist/server/_chunks/{index-hkdfj58q.js → index-y9bygr95.js} +1 -1
  65. package/dist/server/_chunks/{index-3tf1xjsp.js → index-yghskk8w.js} +11 -11
  66. package/dist/server/_chunks/{index-5gyr4emz.js → index-yzcpr3yw.js} +4 -4
  67. package/dist/server/_chunks/{index-x93hv0sc.js → index-zedjt25v.js} +23 -10
  68. package/dist/server/_chunks/{index-tq0pc7eg.js → index-zfrwq472.js} +3 -3
  69. package/dist/server/_chunks/{loader-7yw0j98z.js → loader-w1e0n5sm.js} +12 -10
  70. package/dist/server/_chunks/{modules-jn8bmbn8.js → modules-730j14cm.js} +14 -12
  71. package/dist/server/_chunks/{pipeline-yy9jhydf.js → pipeline-yjdnwbhm.js} +25 -21
  72. package/dist/server/_chunks/{production-jar9ztm3.js → production-1xe9b7wd.js} +14 -3
  73. package/dist/server/_chunks/{proxy-config-j84dgksn.js → proxy-config-9r9e0jvn.js} +7 -5
  74. package/dist/server/_chunks/{proxy-w1d0wmsn.js → proxy-pnevsbfd.js} +12 -10
  75. package/dist/server/_chunks/{router-k1reahfn.js → router-rzge0vz8.js} +10 -7
  76. package/dist/server/_chunks/{routes-2s277fc6.js → routes-0x8wjvcj.js} +12 -10
  77. package/dist/server/_chunks/{run-pvd8bs1t.js → run-tk90r3ac.js} +5 -4
  78. package/dist/server/_chunks/{server-mt4a994c.js → server-gev78ejc.js} +38 -34
  79. package/dist/server/_chunks/{tsconfig-defaults-1nb3308g.js → tsconfig-defaults-qe9wd6ne.js} +5 -4
  80. package/dist/server/_chunks/{typegen-0qr0459b.js → typegen-0yw8sry8.js} +15 -13
  81. package/dist/server/cli/index.js +12 -15
  82. package/dist/server/cli/start.js +35 -14
  83. package/dist/server/compat/next/cache.js +5 -5
  84. package/dist/server/compat/next/config-headers.js +8 -6
  85. package/dist/server/compat/next/config-loader.js +1 -1
  86. package/dist/server/compat/next/dist/server/web/spec-extension/revalidate.js +5 -5
  87. package/dist/server/compat/next/dist/server/web/spec-extension/unstable-cache.js +5 -5
  88. package/dist/server/compat/next/dist/server/web/spec-extension/unstable-no-store.js +5 -5
  89. package/dist/server/compat/next/dynamic.js +3 -14
  90. package/dist/server/compat/next/font/cache.js +6 -4
  91. package/dist/server/compat/next/font/local.js +7 -5
  92. package/dist/server/compat/next/font/runtime.js +7 -5
  93. package/dist/server/compat/next/headers.js +4 -4
  94. package/dist/server/compat/next/image/config.js +2 -2
  95. package/dist/server/compat/next/image/optimizer.js +3 -3
  96. package/dist/server/compat/next/image/static-metadata.js +4 -4
  97. package/dist/server/compat/next/legacy-request-apis.js +3 -3
  98. package/dist/server/compat/next/link-transform.js +4 -3
  99. package/dist/server/compat/next/navigation.js +5 -4
  100. package/dist/server/compat/next/redirects.js +8 -6
  101. package/dist/server/compat/next/resource-hints.js +2 -2
  102. package/dist/server/compat/next/rewrites.js +7 -5
  103. package/dist/server/compat/next/root-params.js +3 -3
  104. package/dist/server/compat/next/route-state.js +2 -2
  105. package/dist/server/compat/next/script.js +2 -2
  106. package/dist/server/compat/next/server.js +5 -5
  107. package/dist/server/generation.json +1 -1
  108. package/package.json +1 -1
  109. package/reference/compat.md +1 -1
  110. package/reference/config.md +2 -2
  111. package/reference/dev.md +1 -1
  112. package/reference/getting-started.md +1 -1
  113. package/reference/rendering.md +4 -4
  114. package/src/api/dynamic.tsx +84 -4
  115. package/src/cli/adapters/vercel-warm.ts +40 -29
  116. package/src/cli/adapters/vercel.ts +101 -1265
  117. package/src/cli/analyze.ts +3 -2
  118. package/src/cli/build/cache.ts +6 -6
  119. package/src/cli/build.ts +33 -33
  120. package/src/cli/index.ts +4 -6
  121. package/src/cli/serve/pipeline.ts +16 -10
  122. package/src/cli/serve/standalone-worker.ts +8 -0
  123. package/src/cli/serve/standalone.ts +727 -0
  124. package/src/cli/start.ts +29 -8
  125. package/src/client/build.ts +1 -1
  126. package/src/client/reference-stub.ts +2 -34
  127. package/src/compat/actions/extensions.ts +3 -2
  128. package/src/compat/bundler/require-context.ts +2 -1
  129. package/src/compat/bundler/webpack-loaders.ts +3 -2
  130. package/src/compat/bundler/worker.ts +2 -2
  131. package/src/compat/css/inline-css.ts +1 -1
  132. package/src/compat/export/build-complete.ts +1 -1
  133. package/src/compat/export/emit.ts +4 -4
  134. package/src/compat/export/standalone.ts +30 -65
  135. package/src/compat/image-optimizer/optimize.ts +1 -1
  136. package/src/compat/lifecycle/instrumentation-client.ts +4 -3
  137. package/src/compat/metadata-artifacts.ts +1 -1
  138. package/src/compat/next/config-loader.ts +3 -0
  139. package/src/compat/next/dynamic.tsx +10 -23
  140. package/src/compat/next/font/cache.ts +2 -1
  141. package/src/compat/next/font/runtime.ts +1 -1
  142. package/src/compat/register/image.ts +1 -1
  143. package/src/compat/typecheck/check.ts +6 -4
  144. package/src/config.ts +28 -5
  145. package/src/css/assets.ts +1 -1
  146. package/src/css/build.ts +16 -9
  147. package/src/dev/client-chunk-store.ts +2 -1
  148. package/src/dev/restart/client-key.ts +2 -1
  149. package/src/dev/restart/global-css.ts +2 -1
  150. package/src/dev/restart/route-bundle-key.ts +2 -1
  151. package/src/dev/restart/route-facts.ts +2 -1
  152. package/src/dev/server.ts +8 -7
  153. package/src/out-paths.ts +10 -0
  154. package/src/render/renderer.ts +1 -1
  155. package/src/resolve/dynamic.ts +4 -0
  156. package/src/resolve/engine.ts +2 -12
  157. package/src/resolve/scan-facts.ts +185 -1
  158. package/src/routing/metadata-files.ts +1 -1
  159. package/src/runtime/loader.ts +5 -3
  160. package/src/runtime/module-cache.ts +2 -1
  161. package/src/runtime/modules.ts +50 -16
  162. package/src/runtime/prebundle.ts +23 -3
  163. package/src/runtime/production.ts +105 -40
  164. package/src/runtime/release-graph.ts +21 -13
  165. package/src/runtime/vendor-build.ts +45 -23
  166. package/src/types.ts +2 -3
  167. package/src/utils/directive.ts +40 -0
  168. package/src/utils/fs.ts +7 -2
  169. package/src/utils/resource-query.ts +12 -0
  170. package/dist/server/_chunks/index-tqn2qnnn.js +0 -241
  171. package/dist/server/_chunks/index-y36a0ybw.js +0 -57
  172. package/src/cli/serve/entry.ts +0 -52
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  isCommonJsModuleSource
4
- } from "./index-yz54pxrh.js";
4
+ } from "./index-d1jsmhhk.js";
5
5
  import {
6
6
  loadNative
7
7
  } from "./index-7wc9n8be.js";
@@ -151,6 +151,7 @@ var emptyRewriteFacts = {
151
151
  edges: [],
152
152
  imports: [],
153
153
  importMetas: [],
154
+ computedImports: [],
154
155
  unreliable: false
155
156
  };
156
157
  var memo = new Map;
@@ -341,11 +342,14 @@ function parseFacts(file, source, lang) {
341
342
  }
342
343
  imports.sort((a, b) => a.index - b.index);
343
344
  const dynamicImports = [];
345
+ const computedImports = [];
344
346
  for (const entry of result.module.dynamicImports) {
345
347
  const raw = source.slice(entry.moduleRequest.start, entry.moduleRequest.end);
346
348
  const specifier = literalSpecifier(raw);
347
- if (specifier === undefined)
349
+ if (specifier === undefined) {
350
+ computedImports.push({ start: entry.start, end: entry.end });
348
351
  continue;
352
+ }
349
353
  dynamicImports.push({ specifier, index: entry.start });
350
354
  const lead = raw.length - raw.trimStart().length;
351
355
  edges.push({
@@ -380,6 +384,7 @@ function parseFacts(file, source, lang) {
380
384
  edges,
381
385
  imports: importStatements,
382
386
  importMetas: result.module.importMetas.map((meta) => ({ start: meta.start, end: meta.end })),
387
+ computedImports,
383
388
  unreliable: result.errors.length > 0
384
389
  }
385
390
  };
@@ -503,6 +508,139 @@ function child(node, key) {
503
508
  const value = node?.[key];
504
509
  return isNode(value) ? value : undefined;
505
510
  }
511
+ var noMetaRefs = {
512
+ urls: [],
513
+ resolves: [],
514
+ readsLocation: false,
515
+ computedImports: [],
516
+ unreliable: false
517
+ };
518
+ var metaRefMemo = new Map;
519
+ var locationMembers = new Set(["url", "dirname", "filename", "resolve"]);
520
+ function importMetaRefs(file, source) {
521
+ if (stylesheetOrData.test(file))
522
+ return noMetaRefs;
523
+ if (!source.includes("import.meta") && !source.includes("import("))
524
+ return noMetaRefs;
525
+ const record = rewriteFacts(file, source);
526
+ if (record.importMetas.length === 0)
527
+ return { ...noMetaRefs, computedImports: record.computedImports, unreliable: record.unreliable };
528
+ const lang = langForFile2(file);
529
+ const key = `${lang}\x00${source.length}\x00${bun.hash(source).toString()}`;
530
+ const cached = metaRefMemo.get(key);
531
+ if (cached)
532
+ return cached;
533
+ const result = parseSync(file, source, { lang });
534
+ const refs = {
535
+ ...noMetaRefs,
536
+ urls: [],
537
+ resolves: [],
538
+ computedImports: record.computedImports
539
+ };
540
+ refs.unreliable = result.errors.length > 0;
541
+ const isImportMeta = (node) => node?.type === "MetaProperty" && child(node, "meta")?.name === "import" && child(node, "property")?.name === "meta";
542
+ const memberName = (node) => node.computed ? stringValue(child(node, "property")) : child(node, "property")?.name;
543
+ const literal = (node) => {
544
+ if (!node)
545
+ return;
546
+ const value = stringValue(node) ?? (node.type === "TemplateLiteral" && node.expressions.length === 0 ? node.quasis[0]?.value?.cooked : undefined);
547
+ return value === undefined ? undefined : { specifier: value, start: node.start, end: node.end };
548
+ };
549
+ const visit = (value, parent) => {
550
+ if (Array.isArray(value)) {
551
+ for (const item of value)
552
+ visit(item, parent);
553
+ return;
554
+ }
555
+ if (!isNode(value))
556
+ return;
557
+ if (isImportMeta(value)) {
558
+ const member = parent?.type === "MemberExpression" && parent.object === value;
559
+ if (!member || locationMembers.has(memberName(parent) ?? ""))
560
+ refs.readsLocation = true;
561
+ } else if (value.type === "NewExpression" && child(value, "callee")?.name === "URL") {
562
+ const [target, base] = value.arguments;
563
+ const span = literal(target);
564
+ if (span && base?.type === "MemberExpression" && isImportMeta(child(base, "object"))) {
565
+ if (memberName(base) === "url")
566
+ refs.urls.push(span);
567
+ }
568
+ } else if (value.type === "CallExpression") {
569
+ const callee = child(value, "callee");
570
+ if (callee?.type === "MemberExpression" && isImportMeta(child(callee, "object"))) {
571
+ const span = literal(value.arguments[0]);
572
+ if (span && memberName(callee) === "resolve")
573
+ refs.resolves.push(span);
574
+ }
575
+ }
576
+ for (const key2 in value) {
577
+ if (key2 !== "start" && key2 !== "end" && key2 !== "type")
578
+ visit(value[key2], value);
579
+ }
580
+ };
581
+ visit(result.program, undefined);
582
+ metaRefMemo.set(key, refs);
583
+ return refs;
584
+ }
585
+ function hasModuleState(file, source) {
586
+ const result = parseSync(file, source, { lang: langForFile2(file) });
587
+ const pureEnds = new Set(result.comments.filter((comment) => /^\s*[#@]__PURE__\s*$/.test(comment.value)).map((comment) => comment.end));
588
+ const annotatedPure = (node) => {
589
+ for (let index = node.start - 1;index >= 0; index -= 1) {
590
+ if (pureEnds.has(index + 1))
591
+ return true;
592
+ if (!/\s/.test(source[index]))
593
+ return false;
594
+ }
595
+ return false;
596
+ };
597
+ const plainCallee = (node) => node?.type === "Identifier" || node?.type === "MemberExpression" && !node.computed && plainCallee(child(node, "object"));
598
+ const declarations = result.program.body.flatMap((statement) => {
599
+ const declaration = statement.type === "ExportNamedDeclaration" ? child(statement, "declaration") : statement;
600
+ return declaration?.type === "VariableDeclaration" ? declaration.declarations : [];
601
+ });
602
+ return declarations.some((declarator) => {
603
+ const init = unwrapExpression(child(declarator, "init"));
604
+ if (init?.type === "NewExpression")
605
+ return true;
606
+ if (init?.type !== "CallExpression")
607
+ return false;
608
+ const callee = child(init, "callee");
609
+ return plainCallee(callee) && callee?.name !== "require" && !annotatedPure(init);
610
+ });
611
+ }
612
+ function absolutePathLiterals(file, source) {
613
+ const result = parseSync(file, source, { lang: langForFile2(file) });
614
+ if (result.errors.length > 0)
615
+ return;
616
+ const found = [];
617
+ const visit = (value, parent) => {
618
+ if (Array.isArray(value)) {
619
+ for (const item of value)
620
+ visit(item, parent);
621
+ return;
622
+ }
623
+ if (!isNode(value))
624
+ return;
625
+ const literal = stringValue(value);
626
+ if (literal !== undefined && (literal.startsWith("/") || literal.startsWith("file:///"))) {
627
+ const key = parent?.type === "Property" && parent.key === value && !parent.computed;
628
+ found.push({ value: literal, start: value.start, end: value.end, key });
629
+ }
630
+ for (const key in value) {
631
+ if (key !== "start" && key !== "end" && key !== "type")
632
+ visit(value[key], value);
633
+ }
634
+ };
635
+ visit(result.program, undefined);
636
+ return found;
637
+ }
638
+ function lineComments(file, source) {
639
+ const result = parseSync(file, source, { lang: langForFile2(file) });
640
+ if (result.errors.length > 0)
641
+ return;
642
+ return result.comments.filter((comment) => comment.type === "Line").map((comment) => ({ value: comment.value, start: comment.start, end: comment.end }));
643
+ }
506
644
  function stripJsonImportAttributes(source, file, compiled) {
507
645
  const result = parseSync(file, source, { lang: "js", sourceType: "module" });
508
646
  if (result.errors.length > 0)
@@ -730,4 +868,4 @@ function langForFile2(file) {
730
868
  return /\.[mc]?ts$/.test(file) ? "ts" : "tsx";
731
869
  }
732
870
 
733
- export { transformBailReason, transformServerModule, outputSpecifiers, spliceSource, scanFacts, importSpecifiers, moduleExportNames, moduleExportStars, dynamicCallFacts, rewriteFacts, moduleSpecifierEdges, rewriteSpecifierLiterals, scanFactsStats, stripJsonImportAttributes };
871
+ export { transformBailReason, transformServerModule, outputSpecifiers, spliceSource, scanFacts, importSpecifiers, moduleExportNames, moduleExportStars, dynamicCallFacts, rewriteFacts, moduleSpecifierEdges, rewriteSpecifierLiterals, scanFactsStats, importMetaRefs, hasModuleState, absolutePathLiterals, lineComments, stripJsonImportAttributes };
@@ -6,10 +6,10 @@ import {
6
6
  cssModuleScopePath,
7
7
  ensureDir,
8
8
  readText
9
- } from "./index-20ppawv7.js";
9
+ } from "./index-4qsce64w.js";
10
10
  import {
11
11
  productionRelease
12
- } from "./index-tqn2qnnn.js";
12
+ } from "./index-fpghsgb4.js";
13
13
  import {
14
14
  getCssExtensions
15
15
  } from "./index-zqpqyg8p.js";
@@ -34,7 +34,7 @@ import { readFile, writeFile } from "fs/promises";
34
34
  import path from "path";
35
35
  var build;
36
36
  async function globalCssHref(config) {
37
- const sources = productionRelease(config)?.globalCss ?? (await (build ??= import("./build-spy3dxp4.js"))).globalCssSources(config);
37
+ const sources = productionRelease(config)?.globalCss ?? (await (build ??= import("./build-jda155c9.js"))).globalCssSources(config);
38
38
  return sources.length > 0 ? assetHref(config, "global.css") : undefined;
39
39
  }
40
40
  var emittedAssets = new Map;
@@ -79,7 +79,7 @@ function routeCssHref(route, config) {
79
79
  return assets.map((asset) => assetHref(config, asset));
80
80
  }
81
81
  async function emitFontCssStylesheet(config, routeId, fontCss, baseAsset, options) {
82
- const outDir = path.join(config.outPath, options.dev ? "cache" : "public", "assets");
82
+ const outDir = path.join(config.outPath, options.dev ? "cache" : "static", "assets");
83
83
  await ensureDir(outDir);
84
84
  const baseFile = baseAsset ? path.join(outDir, baseAsset) : undefined;
85
85
  const baseCss = baseFile && existsSync(baseFile) ? await readFile(baseFile, "utf8") : "";
@@ -5,10 +5,10 @@ import {
5
5
  } from "./index-2wfv4kvx.js";
6
6
  import {
7
7
  transpilePackages
8
- } from "./index-danncfhy.js";
8
+ } from "./index-wm36rj4v.js";
9
9
  import {
10
10
  selectRouteForRequest
11
- } from "./index-jepjvcrf.js";
11
+ } from "./index-aarf1brn.js";
12
12
  import {
13
13
  compatAliases,
14
14
  missingCompatImportError,
@@ -17,10 +17,10 @@ import {
17
17
  reactCompatEnabled,
18
18
  reactCompilerOptions,
19
19
  reactServerLayerAliases
20
- } from "./index-eeaanp2e.js";
20
+ } from "./index-0qt2vapb.js";
21
21
  import {
22
22
  findProxyFiles
23
- } from "./index-kq8kpzye.js";
23
+ } from "./index-vqs3rebe.js";
24
24
  import {
25
25
  getRequestRuntime
26
26
  } from "./index-z88qv16t.js";
@@ -29,19 +29,19 @@ import {
29
29
  } from "./index-2vz0wzdn.js";
30
30
  import {
31
31
  getNextConfig
32
- } from "./index-6e4fqv30.js";
32
+ } from "./index-m63czgq5.js";
33
33
  import {
34
34
  build
35
35
  } from "./index-cjgqs13g.js";
36
36
  import {
37
37
  cssModuleScopePath
38
- } from "./index-20ppawv7.js";
38
+ } from "./index-4qsce64w.js";
39
39
  import {
40
40
  markErrorLogged
41
41
  } from "./index-jcsjq3d1.js";
42
42
  import {
43
43
  productionRelease
44
- } from "./index-tqn2qnnn.js";
44
+ } from "./index-fpghsgb4.js";
45
45
  import {
46
46
  getWorkUnit
47
47
  } from "./index-grta8ap3.js";
@@ -54,7 +54,7 @@ import {
54
54
  resolveImport,
55
55
  resolvePackageSpecifier,
56
56
  setModuleAliases
57
- } from "./index-yz54pxrh.js";
57
+ } from "./index-d1jsmhhk.js";
58
58
  import {
59
59
  loadNative
60
60
  } from "./index-7wc9n8be.js";
@@ -170,7 +170,7 @@ function nextCssModuleChunkPlugin(config) {
170
170
  setup(build2) {
171
171
  build2.onLoad({ filter: /\.css$/ }, async ({ path: file }) => {
172
172
  const source = nextCssSource(file, config.root);
173
- const raw = (await (cssBuild ??= import("./build-spy3dxp4.js"))).hoistCssImports(readFileSync(source, "utf8"));
173
+ const raw = (await (cssBuild ??= import("./build-jda155c9.js"))).hoistCssImports(readFileSync(source, "utf8"));
174
174
  const contents = file.endsWith(".module.css") ? transformCssModule(raw, source, config.root) : rewriteTransparentBodyChildren(raw);
175
175
  return {
176
176
  contents: maybeLightningcssTransform(contents, source, config.root),
@@ -1291,7 +1291,7 @@ function resolveTranspiledRouteDependency() {
1291
1291
  async function validateProxyFiles(config) {
1292
1292
  if (findProxyFiles(config, NEXT_PROXY_NAMES).length === 0)
1293
1293
  return;
1294
- const { registerProxyExtensions } = await import("./proxy-w1d0wmsn.js");
1294
+ const { registerProxyExtensions } = await import("./proxy-pnevsbfd.js");
1295
1295
  registerProxyExtensions(config);
1296
1296
  await getProxyExtensions().validateFiles(config);
1297
1297
  }
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  currentRenderCacheMeta
4
- } from "./index-9n2914ww.js";
4
+ } from "./index-akkrvjn6.js";
5
5
  import {
6
6
  legacyRequestAPIs
7
7
  } from "./index-grta8ap3.js";
@@ -1,20 +1,20 @@
1
1
  // @bun
2
2
  import {
3
3
  scanRoutes
4
- } from "./index-8k7pfejn.js";
4
+ } from "./index-3r6qpe8a.js";
5
5
  import {
6
6
  ensureDir,
7
7
  includeTypes,
8
8
  toPosixPath,
9
9
  writeFileAtomic
10
- } from "./index-20ppawv7.js";
10
+ } from "./index-4qsce64w.js";
11
11
  import {
12
12
  bootstrapCompatBoot,
13
13
  generateCompatRouteTypes
14
- } from "./index-5gyr4emz.js";
14
+ } from "./index-yzcpr3yw.js";
15
15
  import {
16
16
  loadConfig
17
- } from "./index-x93hv0sc.js";
17
+ } from "./index-zedjt25v.js";
18
18
 
19
19
  // src/cli/typegen.ts
20
20
  import { existsSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  getNextConfig
4
- } from "./index-6e4fqv30.js";
4
+ } from "./index-m63czgq5.js";
5
5
 
6
6
  // src/compat/mdx/compile.ts
7
7
  import { existsSync } from "fs";
@@ -6,7 +6,7 @@ import {
6
6
  parseConditions,
7
7
  splitDestination,
8
8
  substitute
9
- } from "./index-z84ab1w0.js";
9
+ } from "./index-e176wk6x.js";
10
10
 
11
11
  // src/compat/next/redirects.ts
12
12
  async function loadCompatRedirects(root) {
@@ -4,7 +4,7 @@ import {
4
4
  findGlobalError,
5
5
  findLayouts,
6
6
  serverActionsUnsupportedMessage
7
- } from "./index-jepjvcrf.js";
7
+ } from "./index-aarf1brn.js";
8
8
  import {
9
9
  devClientModuleHref,
10
10
  devServerModuleHref,
@@ -13,7 +13,7 @@ import {
13
13
  importModuleOnce,
14
14
  registerServerRuntime,
15
15
  serverBundleTargetForRuntime
16
- } from "./index-3xbr4eyv.js";
16
+ } from "./index-912z4mfx.js";
17
17
  import {
18
18
  assetHref,
19
19
  emitFontCssStylesheet,
@@ -23,7 +23,7 @@ import {
23
23
  routeCssAssetNames,
24
24
  routeCssHref,
25
25
  withAssetPrefix
26
- } from "./index-y2jr2n72.js";
26
+ } from "./index-xrsg0041.js";
27
27
  import {
28
28
  getActionModuleExtensions,
29
29
  getActiveMetadataExtensions,
@@ -72,23 +72,23 @@ import {
72
72
  runInParamsScope,
73
73
  serializeProps,
74
74
  slotBoundarySymbol
75
- } from "./index-fkp000p1.js";
75
+ } from "./index-jjppzw0s.js";
76
76
  import {
77
77
  matchSegments,
78
78
  pathnameSegments,
79
79
  slotDirectoriesIn
80
- } from "./index-p77b4kcx.js";
80
+ } from "./index-veycp46e.js";
81
81
  import {
82
82
  pnextVersionRange,
83
83
  readText,
84
84
  toPosixPath
85
- } from "./index-20ppawv7.js";
85
+ } from "./index-4qsce64w.js";
86
86
  import {
87
87
  traceEnabled
88
88
  } from "./index-vz0km5qk.js";
89
89
  import {
90
90
  pathToFileHref
91
- } from "./index-x93hv0sc.js";
91
+ } from "./index-zedjt25v.js";
92
92
  import {
93
93
  markErrorLogged
94
94
  } from "./index-jcsjq3d1.js";
@@ -98,7 +98,7 @@ import {
98
98
  servedAppFiles,
99
99
  servedConventions,
100
100
  servedRelease
101
- } from "./index-tqn2qnnn.js";
101
+ } from "./index-fpghsgb4.js";
102
102
  import {
103
103
  clientReferenceId,
104
104
  clientReferenceSymbol,
@@ -290,7 +290,7 @@ function staticMetadataLink(file) {
290
290
  };
291
291
  }
292
292
  function staticMetadataOutputFile(outPath, file) {
293
- return path.join(outPath, "public", file.outputPath);
293
+ return path.join(outPath, "static", file.outputPath);
294
294
  }
295
295
  function metadataHasOwnImages(metadata, field) {
296
296
  const value = metadata[field];
@@ -2181,7 +2181,7 @@ async function importClientModule(file, options) {
2181
2181
  }
2182
2182
  async function syntheticRouteCss(config, id, scan) {
2183
2183
  if (!productionRelease(config))
2184
- return scan(await import("./routes-2s277fc6.js"));
2184
+ return scan(await import("./routes-0x8wjvcj.js"));
2185
2185
  const name = `${id}.css`;
2186
2186
  return emittedAssetName(config, name) === name ? [] : [name];
2187
2187
  }
@@ -3618,7 +3618,7 @@ function withDevReloadScript(html, request) {
3618
3618
  return appendToDocumentBody(html, devReloadScript(documentNonce(request)));
3619
3619
  }
3620
3620
  function withGlobalErrorStylesheet(html, config) {
3621
- const asset = `${config.outPath}/public/assets/${emittedAssetName(config, "global-error.css")}`;
3621
+ const asset = `${config.outPath}/static/assets/${emittedAssetName(config, "global-error.css")}`;
3622
3622
  if (!existsSync2(asset))
3623
3623
  return html;
3624
3624
  const link = `<link rel="stylesheet" href="${assetHref(config, "global-error.css")}">`;
@@ -83,22 +83,22 @@ function bootstrapCompatBoot(config) {
83
83
  installFetchHostNormalization();
84
84
  if (!compatEnabled(config))
85
85
  return Promise.resolve();
86
- bootRegistration ??= import("./boot-af0mv3dy.js").then((module) => module.registerCompatBootExtensions(config));
86
+ bootRegistration ??= import("./boot-8aj7efqk.js").then((module) => module.registerCompatBootExtensions(config));
87
87
  return bootRegistration;
88
88
  }
89
89
  function bootstrapCompat(config, options = {}) {
90
90
  installFetchHostNormalization();
91
91
  if (!compatEnabled(config))
92
92
  return Promise.resolve();
93
- registration ??= bootstrapCompatBoot(config).then(() => import("./index-ggk2j965.js")).then((module) => module.registerCompatExtensions(config, options));
93
+ registration ??= bootstrapCompatBoot(config).then(() => import("./index-kpdph69z.js")).then((module) => module.registerCompatExtensions(config, options));
94
94
  return registration;
95
95
  }
96
96
  async function generateCompatRouteTypes(config, routes) {
97
97
  if (!config.compat?.next)
98
98
  return;
99
99
  const [{ writeTsconfigDefaults }, { generateTypedRoutes }] = await Promise.all([
100
- import("./tsconfig-defaults-1nb3308g.js"),
101
- import("./generate-n9sh6hzt.js")
100
+ import("./tsconfig-defaults-qe9wd6ne.js"),
101
+ import("./generate-d8vb1d21.js")
102
102
  ]);
103
103
  await writeTsconfigDefaults(config);
104
104
  await generateTypedRoutes(config, routes);
@@ -1,12 +1,18 @@
1
1
  // @bun
2
2
  import { join as __pnextJoin } from "node:path";
3
3
  const __PNEXT_PACKAGE_ROOT__ = __pnextJoin(import.meta.dirname, "../../..");
4
+ import {
5
+ standaloneOutSegment
6
+ } from "./index-bzd2ef7t.js";
4
7
  import {
5
8
  attachRelease,
6
- locateRelease,
9
+ buildIndexFile,
10
+ linkStandaloneOrigins,
7
11
  readBuildIndex,
8
- releaseConfig
9
- } from "./index-tqn2qnnn.js";
12
+ releaseConfig,
13
+ releaseSourceRoot,
14
+ servingReleaseDir
15
+ } from "./index-fpghsgb4.js";
10
16
  import {
11
17
  setLegacyRequestAPIs
12
18
  } from "./index-grta8ap3.js";
@@ -115,7 +121,7 @@ async function resolveConfigSource(config, root, options) {
115
121
  if (!config.compat?.next)
116
122
  return {};
117
123
  if (!configSource) {
118
- await import("./config-n2z7yxps.js").then((module) => module.registerConfigSource());
124
+ await import("./config-7h84p6q8.js").then((module) => module.registerConfigSource());
119
125
  }
120
126
  if (!configSource)
121
127
  return {};
@@ -123,7 +129,7 @@ async function resolveConfigSource(config, root, options) {
123
129
  }
124
130
  async function loadConfig(rootInput = process.cwd(), options = {}) {
125
131
  const root = canonicalRoot(path2.resolve(rootInput));
126
- const released = options.serve ? locateRelease(root, DEFAULT_OUT_DIR) : undefined;
132
+ const released = options.serve ? servingReleaseDir() : undefined;
127
133
  if (released)
128
134
  return loadReleasedConfig(root, released, options);
129
135
  await loadEnv(root, options);
@@ -144,6 +150,10 @@ async function loadConfig(rootInput = process.cwd(), options = {}) {
144
150
  const sourceOverrides = stripUndefined(await resolveConfigSource(config, root, options));
145
151
  const merged = { ...defaultConfig, ...config, ...sourceOverrides };
146
152
  const outRootPath = path2.resolve(root, merged.outDir);
153
+ const release = path2.join(outRootPath, standaloneOutSegment);
154
+ if (options.serve && existsSync(buildIndexFile(release))) {
155
+ return loadReleasedConfig(root, release, { ...options, warnings: false });
156
+ }
147
157
  const appPath = await resolveAppPath(root, config, options.dev ? undefined : path2.join(outRootPath, "pnext-pages-compat"));
148
158
  const workspaceRoot = canonicalRoot(config.workspaceRoot ? path2.resolve(root, config.workspaceRoot) : findWorkspaceRoot(root) ?? root);
149
159
  return {
@@ -160,7 +170,7 @@ async function loadConfig(rootInput = process.cwd(), options = {}) {
160
170
  workspaceRoot,
161
171
  appPath,
162
172
  publicPath: path2.resolve(root, "public"),
163
- outPath: options.dev ? path2.join(outRootPath, devOutSegment) : outRootPath,
173
+ outPath: path2.join(outRootPath, options.dev ? devOutSegment : standaloneOutSegment),
164
174
  outRootPath,
165
175
  typesPath: path2.join(outRootPath, "types"),
166
176
  checksPath: path2.join(outRootPath, "typecheck", "checks")
@@ -168,7 +178,9 @@ async function loadConfig(rootInput = process.cwd(), options = {}) {
168
178
  }
169
179
  async function loadReleasedConfig(root, outPath, options) {
170
180
  const index = readBuildIndex(outPath);
171
- const config = releaseConfig(index.config, root, outPath);
181
+ linkStandaloneOrigins(outPath);
182
+ const sourceRoot = releaseSourceRoot(outPath, index.config.outPath);
183
+ const config = releaseConfig(index.config, sourceRoot, outPath);
172
184
  await loadEnv(root, options);
173
185
  setLegacyRequestAPIs(typeof config.compat?.next === "object" && config.compat.next.legacyRequestAPIs === true);
174
186
  setCacheComponents(false);
@@ -235,6 +247,7 @@ function frameworkRuntimeAliasEntries() {
235
247
  };
236
248
  return frameworkRuntimeAliases;
237
249
  }
250
+ var frameworkRuntimeSpecifiers = () => Object.keys(frameworkRuntimeAliasEntries());
238
251
  function resolveRuntimeModule(specifier) {
239
252
  return fileURLToPath(import.meta.resolve(specifier));
240
253
  }
@@ -252,14 +265,14 @@ async function resolveAppPath(root, config, pagesBase) {
252
265
  const hasPages = existsSync(pagesPath);
253
266
  if (existsSync(rootApp)) {
254
267
  if (hasPages) {
255
- const { materializePagesApp: materializePagesApp2 } = await import("./router-k1reahfn.js");
268
+ const { materializePagesApp: materializePagesApp2 } = await import("./router-rzge0vz8.js");
256
269
  const hybrid = await materializePagesApp2(root, pagesBase);
257
270
  if (hybrid)
258
271
  return hybrid;
259
272
  }
260
273
  return rootApp;
261
274
  }
262
- const { materializePagesApp } = await import("./router-k1reahfn.js");
275
+ const { materializePagesApp } = await import("./router-rzge0vz8.js");
263
276
  const pagesApp = await materializePagesApp(root, pagesBase);
264
277
  if (pagesApp)
265
278
  return pagesApp;
@@ -268,4 +281,4 @@ async function resolveAppPath(root, config, pagesBase) {
268
281
  return path2.join(root, "src", "app");
269
282
  }
270
283
 
271
- export { DEFAULT_OUT_DIR, registerConfigSource, loadConfig, devOutSegment, pathToFileHref, publicEnvDefines, frameworkRuntimeAliasEntries, pnextAliases };
284
+ export { DEFAULT_OUT_DIR, registerConfigSource, loadConfig, devOutSegment, pathToFileHref, publicEnvDefines, frameworkRuntimeAliasEntries, frameworkRuntimeSpecifiers, pnextAliases };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  recordUseCacheLife,
4
4
  recordUseCacheTags
5
- } from "./index-eajaspjk.js";
5
+ } from "./index-j0m1jxqa.js";
6
6
  import {
7
7
  bumpRevalidationEvent,
8
8
  cachedData,
@@ -15,10 +15,10 @@ import {
15
15
  recordCacheNoStore,
16
16
  recordCacheRevalidate,
17
17
  recordCacheTags
18
- } from "./index-9n2914ww.js";
18
+ } from "./index-akkrvjn6.js";
19
19
  import {
20
20
  getNextConfig
21
- } from "./index-6e4fqv30.js";
21
+ } from "./index-m63czgq5.js";
22
22
  import {
23
23
  currentRequest,
24
24
  getWorkUnit
@@ -23,28 +23,30 @@ import {
23
23
  statSignature,
24
24
  transformCacheFile,
25
25
  vendorLoadsNatively
26
- } from "./index-vvmmknm1.js";
27
- import"./index-91x12ykq.js";
26
+ } from "./index-da0fphj0.js";
27
+ import"./index-0r5eqfc7.js";
28
28
  import {
29
29
  pagesApiBundleTargetForRuntime,
30
30
  serverBundleTargetForRuntime,
31
31
  setServerBundleConditions
32
- } from "./index-3xbr4eyv.js";
33
- import"./index-c0g2wf3z.js";
32
+ } from "./index-912z4mfx.js";
33
+ import"./index-jbj7ehef.js";
34
+ import"./index-md5jchzy.js";
34
35
  import"./index-cjgqs13g.js";
35
- import"./index-20ppawv7.js";
36
+ import"./index-4qsce64w.js";
36
37
  import"./index-vz0km5qk.js";
37
- import"./index-y36a0ybw.js";
38
- import"./index-x93hv0sc.js";
39
- import"./index-tqn2qnnn.js";
38
+ import"./index-zedjt25v.js";
39
+ import"./index-bzd2ef7t.js";
40
+ import"./index-fpghsgb4.js";
40
41
  import"./index-ras0sdab.js";
41
42
  import"./index-grta8ap3.js";
42
43
  import"./index-kresp2n8.js";
43
44
  import"./index-e3a6yx84.js";
44
- import"./index-z4z9zv3b.js";
45
- import"./index-yz54pxrh.js";
45
+ import"./index-x9c55pzy.js";
46
+ import"./index-d1jsmhhk.js";
46
47
  import"./index-7wc9n8be.js";
47
48
  import"./index-pym1cezq.js";
49
+ import"./index-jt8e1pje.js";
48
50
  import"./index-zqpqyg8p.js";
49
51
  import"./index-qjj6gddn.js";
50
52
  import"./index-rt9qq1va.js";