@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
@@ -34,11 +34,11 @@ import {
34
34
  serverRequireAlias,
35
35
  statSignature,
36
36
  vendorLoadsNatively
37
- } from "./index-vvmmknm1.js";
37
+ } from "./index-da0fphj0.js";
38
38
  import {
39
39
  deferredDynamicImportSpecifiers,
40
40
  devDynamicSplitEnabled
41
- } from "./index-91x12ykq.js";
41
+ } from "./index-0r5eqfc7.js";
42
42
  import {
43
43
  clearModuleGraphFailure,
44
44
  forgetModuleEvalError,
@@ -49,12 +49,12 @@ import {
49
49
  setPreplanDrain,
50
50
  setReleaseCompileFlag,
51
51
  throwIfModuleEvalFailed
52
- } from "./index-3xbr4eyv.js";
52
+ } from "./index-912z4mfx.js";
53
53
  import {
54
54
  clientReferenceExportNames,
55
55
  clientReferenceModuleSource,
56
56
  hasUseClientDirective
57
- } from "./index-rn8dyr1f.js";
57
+ } from "./index-42fef2rv.js";
58
58
  import {
59
59
  formatDuration
60
60
  } from "./index-73z4esab.js";
@@ -66,7 +66,7 @@ import {
66
66
  } from "./index-knp0s912.js";
67
67
  import {
68
68
  frameworkFingerprint
69
- } from "./index-c0g2wf3z.js";
69
+ } from "./index-md5jchzy.js";
70
70
  import {
71
71
  build
72
72
  } from "./index-cjgqs13g.js";
@@ -75,7 +75,7 @@ import {
75
75
  toPosixPath,
76
76
  writeFileAtomic,
77
77
  writeText
78
- } from "./index-20ppawv7.js";
78
+ } from "./index-4qsce64w.js";
79
79
  import {
80
80
  traceEnabled,
81
81
  traceValue
@@ -84,17 +84,23 @@ import {
84
84
  frameworkRuntimeAliasEntries,
85
85
  pathToFileHref,
86
86
  pnextAliases
87
- } from "./index-x93hv0sc.js";
87
+ } from "./index-zedjt25v.js";
88
+ import {
89
+ outCachePath
90
+ } from "./index-bzd2ef7t.js";
88
91
  import {
89
92
  productionRelease,
90
93
  releaseModuleHref
91
- } from "./index-tqn2qnnn.js";
94
+ } from "./index-fpghsgb4.js";
92
95
  import {
93
96
  noteCompiledClientReference,
94
97
  ssrClientReference
95
98
  } from "./index-ras0sdab.js";
96
99
  import {
100
+ absolutePathLiterals,
101
+ hasModuleState,
97
102
  importSpecifiers,
103
+ lineComments,
98
104
  moduleSpecifierEdges,
99
105
  outputSpecifiers,
100
106
  rewriteSpecifierLiterals,
@@ -102,7 +108,7 @@ import {
102
108
  stripJsonImportAttributes,
103
109
  transformBailReason,
104
110
  transformServerModule
105
- } from "./index-z4z9zv3b.js";
111
+ } from "./index-x9c55pzy.js";
106
112
  import {
107
113
  cachedExistsSync,
108
114
  externalPackageImportTarget,
@@ -118,9 +124,11 @@ import {
118
124
  resolveLinkedPackageSpecifier,
119
125
  resolveNestedPackageFromImporter,
120
126
  resolvePackageSpecifier,
121
- resolveVendorPackageSpecifier,
127
+ resolveVendorPackageSpecifier
128
+ } from "./index-d1jsmhhk.js";
129
+ import {
122
130
  splitResourceQuery
123
- } from "./index-yz54pxrh.js";
131
+ } from "./index-jt8e1pje.js";
124
132
  import {
125
133
  applyBundledSourceTransforms,
126
134
  extraLoadableExtensions,
@@ -1074,7 +1082,7 @@ function vendorArtifactKey(config, target, conditionTarget, source) {
1074
1082
  var vendorGeneration = (config) => frameworkFingerprint(cacheRoot(config.outPath));
1075
1083
  var vendorPortablePath = (config, file) => devSourceIdentity(file, config.workspaceRoot);
1076
1084
  function vendorArtifactFile(config, key) {
1077
- return path2.join(config.outPath, "cache", "server", "vendor", `${hashBundleSpecifier(key)}.mjs`);
1085
+ return path2.join(outCachePath(config.outPath), "server", "vendor", `${hashBundleSpecifier(key)}.mjs`);
1078
1086
  }
1079
1087
  function resolveVendorEntry(config, specifier, resolveDir, conditionTarget) {
1080
1088
  const key = `${config.root}\x00${conditionTarget}\x00${resolveDir}\x00${specifier}`;
@@ -1258,7 +1266,7 @@ function reusableVendorContent(config, entry, target, conditionTarget) {
1258
1266
  const id = vendorSharedFor(config).get(entry);
1259
1267
  if (!id)
1260
1268
  return;
1261
- const content = vendorContentFile(path2.join(config.outPath, "cache", "server", "vendor"), id);
1269
+ const content = vendorContentFile(path2.join(outCachePath(config.outPath), "server", "vendor"), id);
1262
1270
  return existsSync2(content) ? content : undefined;
1263
1271
  }
1264
1272
  var vendorReuseEnabled = () => process.env.PNEXT_VENDOR_REUSE !== "0";
@@ -1697,7 +1705,6 @@ function packageExportSubpaths(packageRoot) {
1697
1705
  return [];
1698
1706
  }
1699
1707
  }
1700
- var MODULE_STATE = /^(?:export\s+)?(?:const|let|var)\s[^=;]*=\s*(?:(?:\/\*\s*[#@]__PURE__\s*\*\/\s*)?new\s|(?!require\s*\()[\w$.]+\s*\()/m;
1701
1708
  async function statefulPackageFiles(entry, packageRoot) {
1702
1709
  const files = [...await packageReach(entry, packageRoot)];
1703
1710
  const sources = await Promise.all(files.map((file) => packageFileScan(file)));
@@ -1710,7 +1717,7 @@ function packageFileScan(file) {
1710
1717
  if (!scan) {
1711
1718
  scan = readFile2(file, "utf8").then((source) => ({
1712
1719
  imports: packageScanner.scanImports(source).map(({ path: specifier }) => specifier).filter((specifier) => specifier.startsWith(".")),
1713
- stateful: MODULE_STATE.test(source)
1720
+ stateful: hasModuleState(file, source)
1714
1721
  })).catch(() => {
1715
1722
  return;
1716
1723
  });
@@ -2720,7 +2727,7 @@ function enabled() {
2720
2727
  return restartCacheEnabled() && process.env.PNEXT_DEV_BUNDLE_KEY_CACHE !== "0";
2721
2728
  }
2722
2729
  function recordFile(config, routeId) {
2723
- return path3.join(config.outPath, "cache", "route-bundles", `${hash(routeId)}.json`);
2730
+ return path3.join(outCachePath(config.outPath), "route-bundles", `${hash(routeId)}.json`);
2724
2731
  }
2725
2732
  function recordKey(graphKey, files) {
2726
2733
  return hash(`${RECORD_VERSION}
@@ -3924,15 +3931,35 @@ function relocateSource(file, contents, locate, installed = () => false) {
3924
3931
  const specifiers = spliceSource(contents, edits);
3925
3932
  if (!isReleaseCompile())
3926
3933
  return specifiers;
3927
- return specifiers.replace(/(?<!\\)"((?:file:\/\/)?\/[^"\\\n]+)"(\s*:)?/g, (literal, value, key) => {
3934
+ const expression = (value) => {
3928
3935
  const url = value.startsWith("file:");
3929
3936
  const target = locate(url ? fileURLToPath3(value) : value);
3930
3937
  if (!target)
3931
- return literal;
3938
+ return;
3932
3939
  const href = `new URL(${JSON.stringify(relativeTo(target))}, import.meta.url)`;
3933
- const expression = url ? `${href}.href` : `decodeURIComponent(${href}.pathname)`;
3934
- return key ? `[${expression}]${key}` : expression;
3935
- });
3940
+ return url ? `${href}.href` : `decodeURIComponent(${href}.pathname)`;
3941
+ };
3942
+ const literals = absolutePathLiterals(file, specifiers);
3943
+ if (!literals) {
3944
+ return specifiers.replace(/(?<!\\)"((?:file:\/\/)?\/[^"\\\n]+)"(\s*:)?/g, (literal, value, key) => {
3945
+ const replacement = expression(value);
3946
+ if (!replacement)
3947
+ return literal;
3948
+ return key ? `[${replacement}]${key}` : replacement;
3949
+ });
3950
+ }
3951
+ return spliceSource(specifiers, literals.flatMap((literal) => {
3952
+ const replacement = expression(literal.value);
3953
+ if (!replacement)
3954
+ return [];
3955
+ return [
3956
+ {
3957
+ start: literal.start,
3958
+ end: literal.end,
3959
+ value: literal.key ? `[${replacement}]` : replacement
3960
+ }
3961
+ ];
3962
+ }));
3936
3963
  }
3937
3964
  var isInstalled = (file) => file.includes(`${path4.sep}node_modules${path4.sep}`);
3938
3965
  var packageCandidates = new Map;
@@ -4007,13 +4034,18 @@ function releaseArtifactSource(file, contents) {
4007
4034
  const anchors = cacheRoot2 && releaseAnchors.get(cacheRoot2);
4008
4035
  if (!cacheRoot2 || !anchors)
4009
4036
  return contents;
4010
- return relocateSource(file, releaseInputComments(contents), (absolute) => isInside(cacheRoot2, absolute) ? absolute : portableTarget(anchors, absolute), (absolute) => !isInside(cacheRoot2, absolute) && isInstalled(absolute));
4037
+ return relocateSource(file, releaseInputComments(file, contents), (absolute) => isInside(cacheRoot2, absolute) ? absolute : portableTarget(anchors, absolute), (absolute) => !isInside(cacheRoot2, absolute) && isInstalled(absolute));
4011
4038
  }
4012
- function releaseInputComments(contents) {
4013
- return contents.replace(/^\/\/ (?:[\w-]+:)?\.{0,2}\/[^\s]*$/gm, (comment) => {
4039
+ function releaseInputComments(file, contents) {
4040
+ const shorten = (comment) => {
4014
4041
  const installed = comment.indexOf("node_modules/");
4015
4042
  return `// ${installed === -1 ? path4.basename(comment) : comment.slice(installed)}`;
4016
- });
4043
+ };
4044
+ const inputPath = /^ (?:[\w-]+:)?\.{0,2}\/\S*$/;
4045
+ const comments = lineComments(file, contents);
4046
+ if (!comments)
4047
+ return contents.replace(/^\/\/ (?:[\w-]+:)?\.{0,2}\/[^\s]*$/gm, shorten);
4048
+ return spliceSource(contents, comments.filter((comment) => inputPath.test(comment.value)).map((comment) => ({ ...comment, value: shorten(`//${comment.value}`) })));
4017
4049
  }
4018
4050
  function portableTarget(anchors, target) {
4019
4051
  if (anchors.roots.some((root) => isInside(root, target)))
@@ -4031,7 +4063,7 @@ async function writeCompiledFile(file, contents) {
4031
4063
  const anchors = profileRoot && isReleaseCompile() ? releaseAnchors.get(path4.dirname(profileRoot)) : undefined;
4032
4064
  if (profileRoot && (anchors ? /["'](?:file:\/\/)?\/|^\/\/ (?:[\w-]+:)?\.{0,2}\//m.test(contents) : contents.includes("file://"))) {
4033
4065
  const cacheRoot2 = path4.dirname(profileRoot);
4034
- contents = relocateSource(file, anchors ? releaseInputComments(contents) : contents, (absolute) => isInside(cacheRoot2, absolute) ? absolute : anchors && portableTarget(anchors, absolute), (absolute) => !isInside(cacheRoot2, absolute) && isInstalled(absolute));
4066
+ contents = relocateSource(file, anchors ? releaseInputComments(file, contents) : contents, (absolute) => isInside(cacheRoot2, absolute) ? absolute : anchors && portableTarget(anchors, absolute), (absolute) => !isInside(cacheRoot2, absolute) && isInstalled(absolute));
4035
4067
  }
4036
4068
  if (anchors && contents.includes(".json.js"))
4037
4069
  contents = stripJsonImportAttributes(contents, file, (specifier) => compiledJsonModule.test(specifier));
@@ -4199,7 +4231,7 @@ async function writeDevModuleUncached(config, file, visited, options, outFile) {
4199
4231
  }
4200
4232
  source ??= await readText(file);
4201
4233
  if (/\.mdx?$/.test(file) && nextCompatEnabled(config)) {
4202
- const { compileMdx } = await import("./compile-53j02j27.js");
4234
+ const { compileMdx } = await import("./compile-040r79gj.js");
4203
4235
  source = (await compileMdx(source, file, config.root)).code;
4204
4236
  }
4205
4237
  const transformedSource = rewriteServerSource(source, file, {
@@ -5030,7 +5062,7 @@ async function serverCssModuleSource(config, file) {
5030
5062
  const coreBuild = isReleaseCompile() && !reactCompatEnabled2(config);
5031
5063
  if (registered !== undefined || !coreBuild || !file.endsWith(".module.css"))
5032
5064
  return registered;
5033
- const { cssModuleMapping } = await import("./build-spy3dxp4.js");
5065
+ const { cssModuleMapping } = await import("./build-jda155c9.js");
5034
5066
  return `export default ${JSON.stringify(await cssModuleMapping(file))};`;
5035
5067
  }
5036
5068
  function isStaticImageFile(file) {
@@ -5228,7 +5260,7 @@ async function staticImageModuleSource(config, file) {
5228
5260
  const compat = await getAssetExtensions().staticAssetModule({ sourcePath, bytes, emit });
5229
5261
  const source = compat ?? coreStaticAssetModule(sourcePath, bytes, emit);
5230
5262
  for (const relative of emitted) {
5231
- const target = path4.join(config.outPath, "public", ...relative.split("/"));
5263
+ const target = path4.join(config.outPath, "static", ...relative.split("/"));
5232
5264
  await mkdir3(path4.dirname(target), { recursive: true });
5233
5265
  if (!existsSync3(target))
5234
5266
  await copyFile3(sourcePath, target);
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-z88qv16t.js";
5
5
  import {
6
6
  getNextConfig
7
- } from "./index-6e4fqv30.js";
7
+ } from "./index-m63czgq5.js";
8
8
 
9
9
  // src/compat/next/route-state.ts
10
10
  function publicSegments(route) {
@@ -5,20 +5,20 @@ import {
5
5
  devDynamicSplitEnabled,
6
6
  rewriteDeferredDynamicImports,
7
7
  rewriteLiteralDynamicCalls
8
- } from "./index-91x12ykq.js";
8
+ } from "./index-0r5eqfc7.js";
9
9
  import {
10
10
  ISLAND_BOUNDARY_ERROR_DIGEST_ATTRIBUTE,
11
11
  ISLAND_BOUNDARY_ERROR_ELEMENT,
12
12
  ISLAND_BOUNDARY_ERROR_MESSAGE_ATTRIBUTE,
13
13
  ISLAND_STATIC_CHILDREN_ATTRIBUTE,
14
14
  clientEntryName
15
- } from "./index-3tf1xjsp.js";
15
+ } from "./index-yghskk8w.js";
16
16
  import {
17
17
  findLayouts
18
- } from "./index-jepjvcrf.js";
18
+ } from "./index-aarf1brn.js";
19
19
  import {
20
20
  cssModuleClientPlugin
21
- } from "./index-2dv4y4wd.js";
21
+ } from "./index-1y0cesgn.js";
22
22
  import {
23
23
  createVerboseLogger,
24
24
  formatDuration
@@ -26,10 +26,10 @@ import {
26
26
  import {
27
27
  assetContentHash,
28
28
  withAssetPrefix
29
- } from "./index-y2jr2n72.js";
29
+ } from "./index-xrsg0041.js";
30
30
  import {
31
31
  frameworkFingerprint
32
- } from "./index-c0g2wf3z.js";
32
+ } from "./index-md5jchzy.js";
33
33
  import {
34
34
  readSourceSync,
35
35
  readSourceText
@@ -39,14 +39,14 @@ import {
39
39
  listFiles,
40
40
  readText,
41
41
  writeText
42
- } from "./index-20ppawv7.js";
42
+ } from "./index-4qsce64w.js";
43
43
  import {
44
44
  traceEnabled
45
45
  } from "./index-vz0km5qk.js";
46
46
  import {
47
47
  frameworkRuntimeAliasEntries,
48
48
  publicEnvDefines
49
- } from "./index-x93hv0sc.js";
49
+ } from "./index-zedjt25v.js";
50
50
  import {
51
51
  dim
52
52
  } from "./index-6kp9r0d9.js";
@@ -56,12 +56,12 @@ import {
56
56
  } from "./index-ras0sdab.js";
57
57
  import {
58
58
  scanFacts
59
- } from "./index-z4z9zv3b.js";
59
+ } from "./index-x9c55pzy.js";
60
60
  import {
61
61
  getExternalPackagePolicy,
62
62
  resolveImport,
63
63
  resolveLinkedPackageSpecifier
64
- } from "./index-yz54pxrh.js";
64
+ } from "./index-d1jsmhhk.js";
65
65
  import {
66
66
  applyClientSourceAsyncPreTransforms,
67
67
  applyClientSourceTransforms,
@@ -3482,7 +3482,7 @@ async function staticImageModuleSource(config, file) {
3482
3482
  const compat = await getAssetExtensions().staticAssetModule({ sourcePath, bytes, emit });
3483
3483
  const source = compat ?? coreStaticAssetModule(sourcePath, bytes, emit);
3484
3484
  for (const relative of emitted) {
3485
- const target = path5.join(config.outPath, "public", ...relative.split("/"));
3485
+ const target = path5.join(config.outPath, "static", ...relative.split("/"));
3486
3486
  await mkdir(path5.dirname(target), { recursive: true });
3487
3487
  if (!existsSync3(target))
3488
3488
  await copyFile(sourcePath, target);
@@ -4,11 +4,11 @@ import {
4
4
  } from "./index-v1ags1na.js";
5
5
  import {
6
6
  getNextConfig
7
- } from "./index-6e4fqv30.js";
7
+ } from "./index-m63czgq5.js";
8
8
  import {
9
9
  ensureDir,
10
10
  toPosixPath
11
- } from "./index-20ppawv7.js";
11
+ } from "./index-4qsce64w.js";
12
12
 
13
13
  // src/compat/typed-routes/generate.ts
14
14
  import { existsSync as existsSync2 } from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  productionRelease,
4
4
  releaseModuleHref
5
- } from "./index-tqn2qnnn.js";
5
+ } from "./index-fpghsgb4.js";
6
6
  import {
7
7
  __require
8
8
  } from "./index-rt9qq1va.js";
@@ -11,7 +11,7 @@ import {
11
11
  import { setBasePathPrefix, setDefaultPrefetchMode, setTrailingSlashUrls } from "../../../src/routing/href.ts";
12
12
  var modules;
13
13
  var loader;
14
- var compiler = () => modules ??= import("./modules-jn8bmbn8.js");
14
+ var compiler = () => modules ??= import("./modules-730j14cm.js");
15
15
  function serverBundleTargetForRuntime(runtime) {
16
16
  return runtime === "edge" || runtime === "experimental-edge" ? "edge" : "server";
17
17
  }
@@ -26,7 +26,7 @@ function applyServerHrefConfig(config) {
26
26
  async function registerServerRuntime(config, sourceFiles = []) {
27
27
  if (productionRelease(config))
28
28
  return applyServerHrefConfig(config);
29
- (await (loader ??= import("./loader-7yw0j98z.js"))).registerServerRuntime(config, sourceFiles);
29
+ (await (loader ??= import("./loader-w1e0n5sm.js"))).registerServerRuntime(config, sourceFiles);
30
30
  }
31
31
  async function devServerModuleHref(config, file, version, options = {}) {
32
32
  const served = productionRelease(config);
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-ye9hmsvf.js";
5
5
  import {
6
6
  getNextConfig
7
- } from "./index-6e4fqv30.js";
7
+ } from "./index-m63czgq5.js";
8
8
  import {
9
9
  clearRenderBuffer,
10
10
  registerResourceHint,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  readDirListing,
4
4
  toPosixPath
5
- } from "./index-20ppawv7.js";
5
+ } from "./index-4qsce64w.js";
6
6
  import {
7
7
  extraPageExtensions
8
8
  } from "./index-zqpqyg8p.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-bcws5eh2.js";
5
5
  import {
6
6
  getNextConfig
7
- } from "./index-6e4fqv30.js";
7
+ } from "./index-m63czgq5.js";
8
8
  import {
9
9
  currentRequest,
10
10
  getWorkUnit
@@ -0,0 +1,10 @@
1
+ // @bun
2
+ // src/out-paths.ts
3
+ import path from "path";
4
+ var standaloneOutSegment = "standalone";
5
+ function outCachePath(outPath) {
6
+ const owner = path.basename(outPath) === standaloneOutSegment ? path.dirname(outPath) : outPath;
7
+ return path.join(owner, "cache");
8
+ }
9
+
10
+ export { standaloneOutSegment, outCachePath };
@@ -4,18 +4,18 @@ import {
4
4
  } from "./index-2wfv4kvx.js";
5
5
  import {
6
6
  nextCompatEnabled
7
- } from "./index-eeaanp2e.js";
7
+ } from "./index-0qt2vapb.js";
8
8
  import {
9
9
  findProxyFiles,
10
10
  setProxyRewriteObserver
11
- } from "./index-kq8kpzye.js";
11
+ } from "./index-vqs3rebe.js";
12
12
  import {
13
13
  getNextConfig
14
- } from "./index-6e4fqv30.js";
14
+ } from "./index-m63czgq5.js";
15
15
  import {
16
16
  readText,
17
17
  toPosixPath
18
- } from "./index-20ppawv7.js";
18
+ } from "./index-4qsce64w.js";
19
19
  import {
20
20
  recordCanonicalUrl
21
21
  } from "./index-en7n9f7m.js";
@@ -25,7 +25,7 @@ import {
25
25
  } from "./index-grta8ap3.js";
26
26
  import {
27
27
  moduleExportNames
28
- } from "./index-z4z9zv3b.js";
28
+ } from "./index-x9c55pzy.js";
29
29
  import {
30
30
  setProxyExtensions,
31
31
  setProxyResponseProtocol
@@ -6,6 +6,9 @@ import {
6
6
  findWorkspaceRoot,
7
7
  readPackageJson
8
8
  } from "./index-pym1cezq.js";
9
+ import {
10
+ splitResourceQuery
11
+ } from "./index-jt8e1pje.js";
9
12
  import {
10
13
  onExtensionHostReset
11
14
  } from "./index-zqpqyg8p.js";
@@ -104,14 +107,6 @@ function tsConfigFileFor(root) {
104
107
  tsConfigFiles.set(key, file);
105
108
  return file;
106
109
  }
107
- function splitResourceQuery(specifier) {
108
- const offset = specifier.startsWith("#") ? 1 : 0;
109
- const match = /[?#]/.exec(specifier.slice(offset));
110
- if (!match)
111
- return { path: specifier, query: "" };
112
- const index = offset + match.index;
113
- return { path: specifier.slice(0, index), query: specifier.slice(index) };
114
- }
115
110
  function resolveFrom(dir, specifier, conditions, tsConfigRoot) {
116
111
  const { path: request } = splitResourceQuery(specifier);
117
112
  const tsconfig = tsConfigRoot ? tsConfigFileFor(tsConfigRoot) : undefined;
@@ -957,4 +952,4 @@ function stripTrailingCommas(source) {
957
952
  return output;
958
953
  }
959
954
 
960
- export { cachedExistsSync, clearResolverFsCache, splitResourceQuery, setResolveExtensions, setExternalPackagePolicy, getExternalPackagePolicy, setExternalLoadResolver, resolveExternalLoadTarget, packageNameOfSpecifier, packageNameForFile, externalPackageImportTarget, setTsConfigPath, setModuleAliases, resolveModuleAlias, resolveImport, resolveConfiguredTsPath, configuredTsPathPatterns, resolutionRootForFile, resolveNestedPackageFromImporter, provideEntryResolution, providedEntryResolution, resolvePackageSpecifier, resolveVendorPackageSpecifier, clearAppTreeResolutions, resolvePackageImportSpecifier, resolveRuntimeSpecifier, isPackageSubpathUnexported, resolveLinkedPackageSpecifier, isEsmModuleFile, isEsmModuleEntry, isCommonJsModuleSource, isWorkspacePackage, workspacePackageRoots };
955
+ export { cachedExistsSync, clearResolverFsCache, setResolveExtensions, setExternalPackagePolicy, getExternalPackagePolicy, setExternalLoadResolver, resolveExternalLoadTarget, packageNameOfSpecifier, packageNameForFile, externalPackageImportTarget, setTsConfigPath, setModuleAliases, resolveModuleAlias, resolveImport, resolveConfiguredTsPath, configuredTsPathPatterns, resolutionRootForFile, resolveNestedPackageFromImporter, provideEntryResolution, providedEntryResolution, resolvePackageSpecifier, resolveVendorPackageSpecifier, clearAppTreeResolutions, resolvePackageImportSpecifier, resolveRuntimeSpecifier, isPackageSubpathUnexported, resolveLinkedPackageSpecifier, isEsmModuleFile, isEsmModuleEntry, isCommonJsModuleSource, isWorkspacePackage, workspacePackageRoots };
@@ -5,42 +5,46 @@ import {
5
5
  rewriteDynamicCallTargets,
6
6
  rewriteLiteralDynamicCalls,
7
7
  sourceHasDynamicImport
8
- } from "./index-91x12ykq.js";
8
+ } from "./index-0r5eqfc7.js";
9
9
  import {
10
10
  applyServerHrefConfig,
11
11
  isReleaseCompile,
12
12
  serverBundleExtraConditions
13
- } from "./index-3xbr4eyv.js";
13
+ } from "./index-912z4mfx.js";
14
+ import {
15
+ hasModuleDirective
16
+ } from "./index-jbj7ehef.js";
14
17
  import {
15
18
  frameworkFingerprint
16
- } from "./index-c0g2wf3z.js";
19
+ } from "./index-md5jchzy.js";
17
20
  import {
18
21
  build,
19
22
  transform
20
23
  } from "./index-cjgqs13g.js";
21
24
  import {
22
25
  writeFileAtomic
23
- } from "./index-20ppawv7.js";
26
+ } from "./index-4qsce64w.js";
24
27
  import {
25
28
  traceEnabled
26
29
  } from "./index-vz0km5qk.js";
27
- import {
28
- prebundledFile
29
- } from "./index-y36a0ybw.js";
30
30
  import {
31
31
  frameworkRuntimeAliasEntries,
32
32
  pathToFileHref,
33
33
  pnextAliases
34
- } from "./index-x93hv0sc.js";
34
+ } from "./index-zedjt25v.js";
35
+ import {
36
+ outCachePath
37
+ } from "./index-bzd2ef7t.js";
35
38
  import {
39
+ prebundledFile,
36
40
  productionRelease
37
- } from "./index-tqn2qnnn.js";
41
+ } from "./index-fpghsgb4.js";
38
42
  import {
39
43
  cachedExistsSync,
40
44
  resolveExternalLoadTarget,
41
45
  resolveImport,
42
46
  workspacePackageRoots
43
- } from "./index-yz54pxrh.js";
47
+ } from "./index-d1jsmhhk.js";
44
48
  import {
45
49
  applyBundledSourceTransforms,
46
50
  applyServerSourcePreTransforms,
@@ -150,7 +154,7 @@ function devModuleCache(config, options) {
150
154
  return created;
151
155
  }
152
156
  function cacheRoot(outPath) {
153
- return path.join(outPath, "cache", "server");
157
+ return path.join(outCachePath(outPath), "server");
154
158
  }
155
159
  function createDevModuleCache(root, workspaceRoot, options) {
156
160
  const indexFile = path.join(root, "graph.json");
@@ -669,7 +673,7 @@ function registerServerRuntime(config, sourceFiles = []) {
669
673
  const roots = [
670
674
  ...rootPaths(config.root),
671
675
  ...rootPaths(config.appPath),
672
- ...isReleaseCompile() ? [] : rootPaths(path3.join(config.outPath, "cache", "server")),
676
+ ...isReleaseCompile() ? [] : rootPaths(path3.join(outCachePath(config.outPath), "server")),
673
677
  ...rootPaths(path3.join(__PNEXT_PACKAGE_ROOT__ + "/src/runtime", "..")),
674
678
  ...sourceRoots.flatMap(rootPaths)
675
679
  ];
@@ -840,7 +844,7 @@ function nodeModuleSourceLoadsAsIs(source) {
840
844
  function nodeModuleRelativeImports(source) {
841
845
  if (serverDefineOptions().define || source.includes("use cache"))
842
846
  return;
843
- if (/^\s*(?:(?:\/\/[^\n]*\n|\/\*[\s\S]*?\*\/)\s*)*['"]use (?:client|server)['"]/.test(source)) {
847
+ if (hasModuleDirective(source, "use client") || hasModuleDirective(source, "use server")) {
844
848
  return;
845
849
  }
846
850
  try {
@@ -1060,7 +1064,7 @@ async function transformSourceUncached(file, fileStat) {
1060
1064
  const runtime = runtimeConfigForFile(file);
1061
1065
  let raw = await readFile3(file, "utf8");
1062
1066
  if (/\.mdx?$/.test(file) && !file.includes(`${path3.sep}cache${path3.sep}server${path3.sep}`)) {
1063
- const { compileMdx } = await import("./compile-53j02j27.js");
1067
+ const { compileMdx } = await import("./compile-040r79gj.js");
1064
1068
  raw = (await compileMdx(raw, file, runtime?.root ?? path3.dirname(file))).code;
1065
1069
  }
1066
1070
  const source = await inlineModuleScopeRequires(rewriteServerSource(raw, file, {
@@ -1390,7 +1394,7 @@ async function staticImageModuleSource(config, file) {
1390
1394
  const source = compat ?? coreStaticAssetModule(sourcePath, bytes, emit);
1391
1395
  if (config) {
1392
1396
  for (const asset of emitted) {
1393
- const target = path3.join(config.outPath, "public", ...asset.relative.split("/"));
1397
+ const target = path3.join(config.outPath, "static", ...asset.relative.split("/"));
1394
1398
  await mkdir3(path3.dirname(target), { recursive: true });
1395
1399
  if (!existsSync(target))
1396
1400
  await Bun.write(target, asset.bytes);
@@ -6,11 +6,11 @@ import {
6
6
  } from "./index-2vz0wzdn.js";
7
7
  import {
8
8
  withSyncAccess
9
- } from "./index-0374j2b9.js";
9
+ } from "./index-y4d02znn.js";
10
10
  import {
11
11
  assertNoDynamicApiInsideCache,
12
12
  currentRenderCacheMeta
13
- } from "./index-9n2914ww.js";
13
+ } from "./index-akkrvjn6.js";
14
14
  import {
15
15
  currentRequest,
16
16
  currentResponseHeaders,
@@ -12,14 +12,14 @@ import {
12
12
  } from "./index-79ngvam8.js";
13
13
  import {
14
14
  revalidationEventCount
15
- } from "./index-9n2914ww.js";
15
+ } from "./index-akkrvjn6.js";
16
16
  import {
17
17
  getNextConfig,
18
18
  nextConfigReleased
19
- } from "./index-6e4fqv30.js";
19
+ } from "./index-m63czgq5.js";
20
20
  import {
21
21
  pathToFileHref
22
- } from "./index-x93hv0sc.js";
22
+ } from "./index-zedjt25v.js";
23
23
  import {
24
24
  runWithRequest,
25
25
  setPhase
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  insideDataCacheProducer
4
- } from "./index-9n2914ww.js";
4
+ } from "./index-akkrvjn6.js";
5
5
  import {
6
6
  cacheComponents,
7
7
  hangingPromise,