qalita 2.5.4__py3-none-any.whl → 2.6.1__py3-none-any.whl

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 (213) hide show
  1. qalita/_frontend/.next/static/_0oyfpC7N2IGDMa04TT9R/_clientMiddlewareManifest.json +6 -0
  2. qalita/_frontend/.next/static/chunks/236f7e5abd6f09ff.js +4 -0
  3. qalita/_frontend/.next/static/chunks/30ea11065999f7ac.js +1 -0
  4. qalita/_frontend/.next/static/chunks/4dd28bc3f722184a.js +2 -0
  5. qalita/_frontend/.next/static/chunks/711d597b816a80c1.js +1 -0
  6. qalita/_frontend/.next/static/chunks/7340adf74ff47ec0.js +1 -0
  7. qalita/_frontend/.next/static/chunks/a6dad97d9634a72d.js.map +1 -0
  8. qalita/_frontend/.next/static/chunks/{e393fec0d8ba175d.js → ecf559101be0ae12.js} +3 -3
  9. qalita/_frontend/.next/static/chunks/turbopack-25186fc8e1264445.js +4 -0
  10. qalita/_frontend/node_modules/@img/sharp-libvips-linux-x64/versions.json +30 -0
  11. qalita/_frontend/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
  12. qalita/_frontend/node_modules/@next/env/package.json +4 -4
  13. qalita/_frontend/node_modules/next/dist/build/analyze/index.js +242 -0
  14. qalita/_frontend/node_modules/next/dist/build/define-env.js +22 -13
  15. qalita/_frontend/node_modules/next/dist/build/entries.js +5 -5
  16. qalita/_frontend/node_modules/next/dist/build/generate-routes-manifest.js +91 -0
  17. qalita/_frontend/node_modules/next/dist/build/index.js +172 -223
  18. qalita/_frontend/node_modules/next/dist/build/output/log.js +4 -7
  19. qalita/_frontend/node_modules/next/dist/build/segment-config/app/app-segments.js +23 -99
  20. qalita/_frontend/node_modules/next/dist/build/segment-config/app/collect-root-param-keys.js +3 -3
  21. qalita/_frontend/node_modules/next/dist/build/spinner.js +3 -3
  22. qalita/_frontend/node_modules/next/dist/build/static-paths/app/extract-pathname-route-param-segments-from-loader-tree.js +137 -0
  23. qalita/_frontend/node_modules/next/dist/build/static-paths/app.js +69 -210
  24. qalita/_frontend/node_modules/next/dist/build/static-paths/utils.js +83 -11
  25. qalita/_frontend/node_modules/next/dist/build/swc/index.js +10 -6
  26. qalita/_frontend/node_modules/next/dist/build/templates/app-page.js +21 -14
  27. qalita/_frontend/node_modules/next/dist/build/templates/app-route.js +8 -10
  28. qalita/_frontend/node_modules/next/dist/build/templates/edge-app-route.js +7 -10
  29. qalita/_frontend/node_modules/next/dist/build/templates/edge-ssr-app.js +16 -20
  30. qalita/_frontend/node_modules/next/dist/build/templates/edge-ssr.js +20 -14
  31. qalita/_frontend/node_modules/next/dist/build/templates/edge-wrapper.js +24 -0
  32. qalita/_frontend/node_modules/next/dist/build/templates/middleware.js +7 -6
  33. qalita/_frontend/node_modules/next/dist/build/templates/pages-edge-api.js +3 -2
  34. qalita/_frontend/node_modules/next/dist/build/turbopack-analyze/index.js +116 -0
  35. qalita/_frontend/node_modules/next/dist/build/turbopack-build/impl.js +2 -1
  36. qalita/_frontend/node_modules/next/dist/build/type-check.js +7 -8
  37. qalita/_frontend/node_modules/next/dist/build/utils.js +45 -4
  38. qalita/_frontend/node_modules/next/dist/build/validate-app-paths.js +242 -0
  39. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-app-loader/index.js +20 -2
  40. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js +2 -5
  41. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-edge-ssr-loader/index.js +4 -11
  42. qalita/_frontend/node_modules/next/dist/build/webpack/loaders/next-root-params-loader.js +1 -1
  43. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/flight-manifest-plugin.js +1 -1
  44. qalita/_frontend/node_modules/next/dist/build/webpack/plugins/middleware-plugin.js +3 -0
  45. qalita/_frontend/node_modules/next/dist/build/webpack-build/impl.js +1 -0
  46. qalita/_frontend/node_modules/next/dist/build/webpack-config.js +35 -3
  47. qalita/_frontend/node_modules/next/dist/cli/next-test.js +3 -5
  48. qalita/_frontend/node_modules/next/dist/client/components/app-router-headers.js +5 -0
  49. qalita/_frontend/node_modules/next/dist/client/components/app-router-instance.js +3 -11
  50. qalita/_frontend/node_modules/next/dist/client/components/app-router.js +8 -28
  51. qalita/_frontend/node_modules/next/dist/client/components/navigation-devtools.js +5 -7
  52. qalita/_frontend/node_modules/next/dist/client/components/navigation.js +4 -3
  53. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/create-initial-router-state.js +3 -22
  54. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +6 -18
  55. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js +844 -590
  56. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/hmr-refresh-reducer.js +4 -76
  57. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js +21 -18
  58. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/refresh-reducer.js +48 -85
  59. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/restore-reducer.js +25 -10
  60. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/server-action-reducer.js +126 -113
  61. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/reducers/server-patch-reducer.js +30 -39
  62. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js +0 -1
  63. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/router-reducer.js +2 -2
  64. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/cache-map.js +13 -18
  65. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/cache.js +27 -14
  66. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/lru.js +3 -1
  67. qalita/_frontend/node_modules/next/dist/client/components/segment-cache/navigation.js +176 -133
  68. qalita/_frontend/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +12 -12
  69. qalita/_frontend/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +12 -12
  70. qalita/_frontend/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +3 -3
  71. qalita/_frontend/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +10 -10
  72. qalita/_frontend/node_modules/next/dist/compiled/react-is/package.json +1 -1
  73. qalita/_frontend/node_modules/next/dist/lib/build-custom-route.js +4 -4
  74. qalita/_frontend/node_modules/next/dist/lib/constants.js +0 -5
  75. qalita/_frontend/node_modules/next/dist/lib/default-transpiled-packages.json +1 -0
  76. qalita/_frontend/node_modules/next/dist/lib/generate-interception-routes-rewrites.js +0 -1
  77. qalita/_frontend/node_modules/next/dist/lib/helpers/get-npx-command.js +3 -3
  78. qalita/_frontend/node_modules/next/dist/lib/inline-static-env.js +1 -1
  79. qalita/_frontend/node_modules/next/dist/lib/known-edge-safe-packages.json +1 -0
  80. qalita/_frontend/node_modules/next/dist/lib/metadata/metadata.js +17 -11
  81. qalita/_frontend/node_modules/next/dist/lib/needs-experimental-react.js +2 -2
  82. qalita/_frontend/node_modules/next/dist/lib/resolve-build-paths.js +44 -76
  83. qalita/_frontend/node_modules/next/dist/lib/server-external-packages.jsonc +103 -0
  84. qalita/_frontend/node_modules/next/dist/lib/static-env.js +6 -6
  85. qalita/_frontend/node_modules/next/dist/lib/turbopack-warning.js +3 -5
  86. qalita/_frontend/node_modules/next/dist/lib/typescript/runTypeCheck.js +61 -5
  87. qalita/_frontend/node_modules/next/dist/lib/typescript/type-paths.js +56 -0
  88. qalita/_frontend/node_modules/next/dist/lib/typescript/writeConfigurationDefaults.js +6 -17
  89. qalita/_frontend/node_modules/next/dist/lib/verify-typescript-setup.js +10 -2
  90. qalita/_frontend/node_modules/next/dist/lib/worker.js +17 -9
  91. qalita/_frontend/node_modules/next/dist/server/app-render/action-handler.js +113 -77
  92. qalita/_frontend/node_modules/next/dist/server/app-render/app-render-prerender-utils.js +36 -15
  93. qalita/_frontend/node_modules/next/dist/server/app-render/app-render-render-utils.js +36 -15
  94. qalita/_frontend/node_modules/next/dist/server/app-render/app-render-scheduling.js +188 -0
  95. qalita/_frontend/node_modules/next/dist/server/app-render/app-render.js +804 -748
  96. qalita/_frontend/node_modules/next/dist/server/app-render/collect-segment-data.js +8 -2
  97. qalita/_frontend/node_modules/next/dist/server/app-render/create-component-styles-and-scripts.js +1 -1
  98. qalita/_frontend/node_modules/next/dist/server/app-render/create-error-handler.js +42 -75
  99. qalita/_frontend/node_modules/next/dist/server/app-render/dynamic-rendering.js +127 -14
  100. qalita/_frontend/node_modules/next/dist/server/app-render/encryption-utils.js +3 -108
  101. qalita/_frontend/node_modules/next/dist/server/app-render/encryption.js +4 -3
  102. qalita/_frontend/node_modules/next/dist/server/app-render/flight-render-result.js +3 -2
  103. qalita/_frontend/node_modules/next/dist/server/app-render/get-css-inlined-link-tags.js +9 -8
  104. qalita/_frontend/node_modules/next/dist/server/app-render/get-layer-assets.js +1 -1
  105. qalita/_frontend/node_modules/next/dist/server/app-render/manifests-singleton.js +257 -0
  106. qalita/_frontend/node_modules/next/dist/server/app-render/prospective-render-utils.js +25 -8
  107. qalita/_frontend/node_modules/next/dist/server/app-render/staged-rendering.js +161 -15
  108. qalita/_frontend/node_modules/next/dist/server/app-render/use-flight-response.js +67 -20
  109. qalita/_frontend/node_modules/next/dist/server/app-render/walk-tree-with-flight-router-state.js +2 -2
  110. qalita/_frontend/node_modules/next/dist/server/async-storage/work-store.js +2 -1
  111. qalita/_frontend/node_modules/next/dist/server/base-server.js +32 -23
  112. qalita/_frontend/node_modules/next/dist/server/capsize-font-metrics.json +181516 -0
  113. qalita/_frontend/node_modules/next/dist/server/config-schema.js +8 -1
  114. qalita/_frontend/node_modules/next/dist/server/config-shared.js +83 -2
  115. qalita/_frontend/node_modules/next/dist/server/config.js +24 -17
  116. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-rspack.js +171 -0
  117. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +37 -25
  118. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-types.js +1 -0
  119. qalita/_frontend/node_modules/next/dist/server/dev/hot-reloader-webpack.js +62 -57
  120. qalita/_frontend/node_modules/next/dist/server/dev/log-requests.js +11 -3
  121. qalita/_frontend/node_modules/next/dist/server/dev/messages.js +10 -0
  122. qalita/_frontend/node_modules/next/dist/server/dev/serialized-errors.js +67 -0
  123. qalita/_frontend/node_modules/next/dist/server/dev/static-paths-worker.js +10 -0
  124. qalita/_frontend/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  125. qalita/_frontend/node_modules/next/dist/server/lib/chrome-devtools-workspace.js +2 -2
  126. qalita/_frontend/node_modules/next/dist/server/lib/dev-bundler-service.js +6 -10
  127. qalita/_frontend/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +4 -4
  128. qalita/_frontend/node_modules/next/dist/server/lib/lazy-result.js +1 -1
  129. qalita/_frontend/node_modules/next/dist/server/lib/patch-fetch.js +9 -9
  130. qalita/_frontend/node_modules/next/dist/server/lib/router-server.js +43 -29
  131. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/build-prefetch-segment-data-route.js +0 -21
  132. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/filesystem.js +2 -7
  133. qalita/_frontend/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +8 -4
  134. qalita/_frontend/node_modules/next/dist/server/lib/start-server.js +3 -3
  135. qalita/_frontend/node_modules/next/dist/server/lib/trace/tracer.js +4 -0
  136. qalita/_frontend/node_modules/next/dist/server/load-components.js +3 -9
  137. qalita/_frontend/node_modules/next/dist/server/next-server.js +19 -18
  138. qalita/_frontend/node_modules/next/dist/server/next.js +1 -1
  139. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js +570 -0
  140. qalita/_frontend/node_modules/next/dist/server/node-environment-extensions/utils.js +60 -3
  141. qalita/_frontend/node_modules/next/dist/server/node-environment.js +1 -0
  142. qalita/_frontend/node_modules/next/dist/server/patch-error-inspect.js +7 -4
  143. qalita/_frontend/node_modules/next/dist/server/request/fallback-params.js +23 -66
  144. qalita/_frontend/node_modules/next/dist/server/route-modules/app-route/module.js +2 -2
  145. qalita/_frontend/node_modules/next/dist/server/route-modules/pages/pages-handler.js +6 -3
  146. qalita/_frontend/node_modules/next/dist/server/route-modules/route-module.js +79 -18
  147. qalita/_frontend/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +28 -4
  148. qalita/_frontend/node_modules/next/dist/server/typescript/rules/config.js +50 -6
  149. qalita/_frontend/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +68 -23
  150. qalita/_frontend/node_modules/next/dist/server/web/edge-route-module-wrapper.js +7 -5
  151. qalita/_frontend/node_modules/next/dist/server/web/sandbox/context.js +8 -9
  152. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +2 -1
  153. qalita/_frontend/node_modules/next/dist/server/web/spec-extension/revalidate.js +7 -3
  154. qalita/_frontend/node_modules/next/dist/shared/lib/action-revalidation-kind.js +31 -0
  155. qalita/_frontend/node_modules/next/dist/shared/lib/constants.js +6 -1
  156. qalita/_frontend/node_modules/next/dist/shared/lib/deployment-id.js +36 -0
  157. qalita/_frontend/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  158. qalita/_frontend/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js +5 -0
  159. qalita/_frontend/node_modules/next/dist/shared/lib/router/routes/app.js +122 -0
  160. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +20 -49
  161. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +6 -6
  162. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/interception-prefix-from-param-type.js +33 -0
  163. qalita/_frontend/node_modules/next/dist/shared/lib/router/utils/resolve-param-value.js +116 -0
  164. qalita/_frontend/node_modules/next/dist/shared/lib/segment-cache/output-export-prefetch-encoding.js +3 -24
  165. qalita/_frontend/node_modules/next/dist/shared/lib/segment.js +5 -0
  166. qalita/_frontend/node_modules/next/dist/shared/lib/turbopack/utils.js +6 -5
  167. qalita/_frontend/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  168. qalita/_frontend/node_modules/next/dist/telemetry/events/build.js +11 -0
  169. qalita/_frontend/node_modules/next/dist/telemetry/events/version.js +2 -2
  170. qalita/_frontend/node_modules/next/package.json +20 -18
  171. qalita/_frontend/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
  172. qalita/_frontend/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
  173. qalita/_frontend/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
  174. qalita/_frontend/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
  175. qalita/_frontend/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
  176. qalita/_frontend/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
  177. qalita/_frontend/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
  178. qalita/_frontend/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
  179. qalita/_frontend/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
  180. qalita/_frontend/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
  181. qalita/_frontend/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
  182. qalita/_frontend/node_modules/typescript/lib/typesMap.json +497 -0
  183. qalita/_frontend/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
  184. qalita/_frontend/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
  185. qalita/_frontend/package.json +3 -3
  186. qalita/_frontend/server.js +1 -1
  187. qalita/commands/pack.py +3 -3
  188. qalita/commands/source.py +1 -1
  189. qalita/internal/utils.py +11 -7
  190. qalita/web/app.py +20 -4
  191. {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/METADATA +1 -1
  192. {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/RECORD +197 -168
  193. qalita/_frontend/.next/static/chunks/023d923a37d494fc.js +0 -1
  194. qalita/_frontend/.next/static/chunks/247eb132b7f7b574.js +0 -1
  195. qalita/_frontend/.next/static/chunks/bba035711c7e37a2.js +0 -4
  196. qalita/_frontend/.next/static/chunks/c903f9580a4b6572.js +0 -2
  197. qalita/_frontend/.next/static/chunks/cbd55ab9639e1e66.js +0 -1
  198. qalita/_frontend/.next/static/chunks/turbopack-1ad58da399056f41.js +0 -3
  199. qalita/_frontend/node_modules/next/dist/build/deployment-id.js +0 -18
  200. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/apply-flight-data.js +0 -53
  201. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/apply-router-state-patch-to-tree.js +0 -105
  202. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fill-cache-with-new-subtree-data.js +0 -110
  203. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.js +0 -131
  204. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/handle-segment-mismatch.js +0 -25
  205. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/invalidate-cache-by-router-state.js +0 -32
  206. qalita/_frontend/node_modules/next/dist/client/components/router-reducer/refetch-inactive-parallel-segments.js +0 -104
  207. qalita/_frontend/node_modules/next/dist/server/app-render/action-utils.js +0 -90
  208. qalita/_frontend/node_modules/next/dist/server/normalizers/request/prefetch-rsc.js +0 -31
  209. /qalita/_frontend/.next/static/{X4_AlYMbCyee-ZVLjCYMg → _0oyfpC7N2IGDMa04TT9R}/_buildManifest.js +0 -0
  210. /qalita/_frontend/.next/static/{X4_AlYMbCyee-ZVLjCYMg → _0oyfpC7N2IGDMa04TT9R}/_ssgManifest.js +0 -0
  211. {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/WHEEL +0 -0
  212. {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/entry_points.txt +0 -0
  213. {qalita-2.5.4.dist-info → qalita-2.6.1.dist-info}/licenses/LICENSE +0 -0
@@ -86,7 +86,6 @@ const _formatmanifest = require("./manifests/formatter/format-manifest");
86
86
  const _builddiagnostics = require("../diagnostics/build-diagnostics");
87
87
  const _appinfolog = require("../server/lib/app-info-log");
88
88
  const _utils2 = require("../export/utils");
89
- const _buildcustomroute = require("../lib/build-custom-route");
90
89
  const _trace1 = require("../lib/memory/trace");
91
90
  const _encryptionutilsserver = require("../server/app-render/encryption-utils-server");
92
91
  const _uploadtrace = /*#__PURE__*/ _interop_require_default(require("../trace/upload-trace"));
@@ -95,7 +94,6 @@ const _fallback = require("../lib/fallback");
95
94
  const _renderingmode = require("./rendering-mode");
96
95
  const _invarianterror = require("../shared/lib/invariant-error");
97
96
  const _isbot = require("../shared/lib/router/utils/is-bot");
98
- const _buildprefetchsegmentdataroute = require("../server/lib/router-utils/build-prefetch-segment-data-route");
99
97
  const _turbopackbuild = require("./turbopack-build");
100
98
  const _utils3 = require("../shared/lib/turbopack/utils");
101
99
  const _inlinestaticenv = require("../lib/inline-static-env");
@@ -110,6 +108,9 @@ const _sortableroutes = require("../shared/lib/router/utils/sortable-routes");
110
108
  const _promises = require("fs/promises");
111
109
  const _routetypesutils = require("../server/lib/router-utils/route-types-utils");
112
110
  const _lockfile = require("./lockfile");
111
+ const _buildprefetchsegmentdataroute = require("../server/lib/router-utils/build-prefetch-segment-data-route");
112
+ const _generateroutesmanifest = require("./generate-routes-manifest");
113
+ const _validateapppaths = require("./validate-app-paths");
113
114
  function _interop_require_default(obj) {
114
115
  return obj && obj.__esModule ? obj : {
115
116
  default: obj
@@ -167,18 +168,6 @@ function _interop_require_wildcard(obj, nodeInterop) {
167
168
  _constants.NEXT_CACHE_REVALIDATED_TAGS_HEADER,
168
169
  _constants.NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER
169
170
  ];
170
- function pageToRoute(page, sourcePage) {
171
- const routeRegex = (0, _routeregex.getNamedRouteRegex)(page, {
172
- prefixRouteKeys: true
173
- });
174
- return {
175
- sourcePage,
176
- page,
177
- regex: (0, _loadcustomroutes.normalizeRouteRegex)(routeRegex.re.source),
178
- routeKeys: routeRegex.routeKeys,
179
- namedRegex: routeRegex.namedRegex
180
- };
181
- }
182
171
  function getCacheDir(distDir) {
183
172
  const cacheDir = _path.default.join(distDir, 'cache');
184
173
  if (_ciinfo.isCI && !_ciinfo.hasNextSupport) {
@@ -216,10 +205,15 @@ async function writeClientSsgManifest(prerenderManifest, { buildId, distDir, loc
216
205
  await writeFileUtf8(_path.default.join(distDir, _constants1.CLIENT_STATIC_FILES_PATH, buildId, '_ssgManifest.js'), clientSsgManifestContent);
217
206
  }
218
207
  async function writeFunctionsConfigManifest(distDir, manifest) {
219
- await writeManifest(_path.default.join(distDir, _constants1.SERVER_DIRECTORY, _constants1.FUNCTIONS_CONFIG_MANIFEST), manifest);
208
+ let sortedManifest = {
209
+ version: manifest.version,
210
+ functions: Object.fromEntries(Object.entries(manifest.functions).sort(([a], [b])=>a.localeCompare(b)))
211
+ };
212
+ await writeManifest(_path.default.join(distDir, _constants1.SERVER_DIRECTORY, _constants1.FUNCTIONS_CONFIG_MANIFEST), sortedManifest);
220
213
  }
221
214
  async function writeRequiredServerFilesManifest(distDir, requiredServerFiles) {
222
- await writeManifest(_path.default.join(distDir, _constants1.SERVER_FILES_MANIFEST), requiredServerFiles);
215
+ await writeManifest(_path.default.join(distDir, _constants1.SERVER_FILES_MANIFEST + '.json'), requiredServerFiles);
216
+ await writeFileUtf8(_path.default.join(distDir, _constants1.SERVER_FILES_MANIFEST + '.js'), `self.__SERVER_FILES_MANIFEST=${(0, _formatmanifest.formatManifest)(requiredServerFiles)}`);
223
217
  }
224
218
  async function writeImagesManifest(distDir, config) {
225
219
  var _config_images, _config_images1;
@@ -267,7 +261,7 @@ async function writeStandaloneDirectory(nextBuildSpan, distDir, pageKeys, denorm
267
261
  requiredServerFiles.appDir, distDir, pageKeys.pages, denormalizedAppPages, outputFileTracingRoot, requiredServerFiles.config, middlewareManifest, hasNodeMiddleware, hasInstrumentationHook, staticPages);
268
262
  for (const file of [
269
263
  ...requiredServerFiles.files,
270
- _path.default.join(requiredServerFiles.config.distDir, _constants1.SERVER_FILES_MANIFEST),
264
+ _path.default.join(requiredServerFiles.config.distDir, _constants1.SERVER_FILES_MANIFEST + '.json'),
271
265
  ...loadedEnvFiles.reduce((acc, envFile)=>{
272
266
  if ([
273
267
  '.env',
@@ -373,11 +367,13 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
373
367
  _buildcontext.NextBuildContext.isCompileMode = isCompileMode;
374
368
  _buildcontext.NextBuildContext.analyze = experimentalAnalyze;
375
369
  const buildStartTime = Date.now();
370
+ let appType;
376
371
  let loadedConfig;
372
+ let staticWorker;
377
373
  try {
378
374
  const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
379
375
  buildMode: experimentalBuildMode,
380
- version: "16.0.10"
376
+ version: "16.1.1"
381
377
  });
382
378
  _buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
383
379
  _buildcontext.NextBuildContext.dir = dir;
@@ -436,7 +432,7 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
436
432
  // when using compile mode static env isn't inlined so we
437
433
  // need to populate in normal runtime env
438
434
  if (isCompileMode || isGenerateMode) {
439
- (0, _staticenv.populateStaticEnv)(config);
435
+ (0, _staticenv.populateStaticEnv)(config, config.deploymentId);
440
436
  }
441
437
  const customRoutes = await nextBuildSpan.traceChild('load-custom-routes').traceAsyncFn(()=>(0, _loadcustomroutes.default)(config));
442
438
  const { headers, rewrites, redirects } = customRoutes;
@@ -484,6 +480,13 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
484
480
  (0, _trace.setGlobal)('telemetry', telemetry);
485
481
  const publicDir = _path.default.join(dir, 'public');
486
482
  const { pagesDir, appDir } = (0, _findpagesdir.findPagesDir)(dir);
483
+ if (pagesDir && appDir) {
484
+ appType = 'hybrid';
485
+ } else if (pagesDir) {
486
+ appType = 'pages';
487
+ } else if (appDir) {
488
+ appType = 'app';
489
+ }
487
490
  if (!appDirOnly && !pagesDir) {
488
491
  appDirOnly = true;
489
492
  }
@@ -537,7 +540,11 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
537
540
  telemetry,
538
541
  nextBuildSpan,
539
542
  config,
540
- cacheDir
543
+ cacheDir,
544
+ debugBuildPaths: debugBuildAppPaths !== undefined || debugBuildPagePaths !== undefined ? {
545
+ app: debugBuildAppPaths,
546
+ pages: debugBuildPagePaths
547
+ } : undefined
541
548
  };
542
549
  if (appDir && 'exportPathMap' in config) {
543
550
  const errorMessage = 'The "exportPathMap" configuration cannot be used with the "app" directory. Please use generateStaticParams() instead.';
@@ -704,6 +711,11 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
704
711
  }
705
712
  }
706
713
  const appPaths = Array.from(appPageKeys);
714
+ // Validate that the app paths are valid. This is currently duplicating
715
+ // the logic from packages/next/src/shared/lib/router/utils/sorted-routes.ts
716
+ // but is instead specifically focused on code that can be shared
717
+ // eventually with the development code.
718
+ (0, _validateapppaths.validateAppPaths)(appPaths);
707
719
  // Interception routes are modelled as beforeFiles rewrites
708
720
  rewrites.beforeFiles.push(...(0, _generateinterceptionroutesrewrites.generateInterceptionRoutesRewrites)(appPaths, config.basePath));
709
721
  _buildcontext.NextBuildContext.rewrites = rewrites;
@@ -832,73 +844,17 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
832
844
  const isAuthInterruptsEnabled = Boolean(config.experimental.authInterrupts);
833
845
  const isAppPPREnabled = (0, _ppr.checkIsAppPPREnabled)(config.experimental.ppr);
834
846
  const routesManifestPath = _path.default.join(distDir, _constants1.ROUTES_MANIFEST);
835
- const dynamicRoutes = [];
836
- /**
837
- * A map of all the pages to their sourcePage value. This is only used for
838
- * routes that have PPR enabled and clientSegmentEnabled is true.
839
- */ const sourcePages = new Map();
840
- const routesManifest = nextBuildSpan.traceChild('generate-routes-manifest').traceFn(()=>{
841
- const sortedRoutes = (0, _sortableroutes.sortPages)([
842
- ...pageKeys.pages,
843
- ...pageKeys.app ?? []
844
- ]);
845
- const staticRoutes = [];
846
- for (const route of sortedRoutes){
847
- if ((0, _utils.isDynamicRoute)(route)) {
848
- dynamicRoutes.push(pageToRoute(route, // This property is only relevant when PPR is enabled.
849
- undefined));
850
- } else if (!(0, _utils1.isReservedPage)(route) || // don't consider /api reserved here
851
- route.match(/^\/(api(\/|$))/)) {
852
- staticRoutes.push(pageToRoute(route));
853
- }
854
- }
855
- return {
856
- version: 3,
857
- pages404: true,
858
- caseSensitive: !!config.experimental.caseSensitiveRoutes,
859
- basePath: config.basePath,
860
- redirects: redirects.map((r)=>(0, _buildcustomroute.buildCustomRoute)('redirect', r, restrictedRedirectPaths)),
861
- headers: headers.map((r)=>(0, _buildcustomroute.buildCustomRoute)('header', r)),
862
- rewrites: {
863
- beforeFiles: rewrites.beforeFiles.map((r)=>(0, _buildcustomroute.buildCustomRoute)('rewrite', r)),
864
- afterFiles: rewrites.afterFiles.map((r)=>(0, _buildcustomroute.buildCustomRoute)('rewrite', r)),
865
- fallback: rewrites.fallback.map((r)=>(0, _buildcustomroute.buildCustomRoute)('rewrite', r))
866
- },
867
- dynamicRoutes,
868
- staticRoutes,
869
- dataRoutes: [],
870
- i18n: config.i18n || undefined,
871
- rsc: {
872
- header: _approuterheaders.RSC_HEADER,
873
- // This vary header is used as a default. It is technically re-assigned in `base-server`,
874
- // and may include an additional Vary option for `Next-URL`.
875
- varyHeader: `${_approuterheaders.RSC_HEADER}, ${_approuterheaders.NEXT_ROUTER_STATE_TREE_HEADER}, ${_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER}, ${_approuterheaders.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER}`,
876
- prefetchHeader: _approuterheaders.NEXT_ROUTER_PREFETCH_HEADER,
877
- didPostponeHeader: _approuterheaders.NEXT_DID_POSTPONE_HEADER,
878
- contentTypeHeader: _approuterheaders.RSC_CONTENT_TYPE_HEADER,
879
- suffix: _constants.RSC_SUFFIX,
880
- prefetchSuffix: _constants.RSC_PREFETCH_SUFFIX,
881
- prefetchSegmentHeader: _approuterheaders.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,
882
- prefetchSegmentSuffix: _constants.RSC_SEGMENT_SUFFIX,
883
- prefetchSegmentDirSuffix: _constants.RSC_SEGMENTS_DIR_SUFFIX,
884
- clientParamParsing: config.cacheComponents ?? false,
885
- clientParamParsingOrigins: config.experimental.clientParamParsingOrigins,
886
- dynamicRSCPrerender: isAppPPREnabled && config.cacheComponents === true
887
- },
888
- rewriteHeaders: {
889
- pathHeader: _approuterheaders.NEXT_REWRITTEN_PATH_HEADER,
890
- queryHeader: _approuterheaders.NEXT_REWRITTEN_QUERY_HEADER
891
- },
892
- skipProxyUrlNormalize: config.skipProxyUrlNormalize,
893
- ppr: isAppPPREnabled ? {
894
- chain: {
895
- headers: {
896
- [_constants.NEXT_RESUME_HEADER]: '1'
897
- }
898
- }
899
- } : undefined
900
- };
901
- });
847
+ // Generate the routes manifest using the extracted helper
848
+ const { routesManifest, dynamicRoutes, sourcePages } = nextBuildSpan.traceChild('generate-routes-manifest').traceFn(()=>(0, _generateroutesmanifest.generateRoutesManifest)({
849
+ appType,
850
+ pageKeys,
851
+ config,
852
+ redirects,
853
+ headers,
854
+ rewrites,
855
+ restrictedRedirectPaths,
856
+ isAppPPREnabled
857
+ }));
902
858
  // For pages directory, we run type checking after route collection but before build.
903
859
  if (!appDir && !isCompileMode) {
904
860
  await (0, _typecheck.startTypeChecking)(typeCheckingOptions);
@@ -915,7 +871,7 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
915
871
  // Files outside of the distDir can be "type": "module"
916
872
  await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
917
873
  // These are written to distDir, so they need to come after creating and cleaning distDr.
918
- await (0, _builddiagnostics.recordFrameworkVersion)("16.0.10");
874
+ await (0, _builddiagnostics.recordFrameworkVersion)("16.1.1");
919
875
  await (0, _builddiagnostics.updateBuildDiagnostics)({
920
876
  buildStage: 'start'
921
877
  });
@@ -1061,6 +1017,98 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
1061
1017
  await (0, _typecheck.startTypeChecking)(typeCheckingOptions);
1062
1018
  (0, _trace1.traceMemoryUsage)('Finished type checking', nextBuildSpan);
1063
1019
  }
1020
+ const requiredServerFilesManifest = await nextBuildSpan.traceChild('generate-required-server-files').traceAsyncFn(async ()=>{
1021
+ let runtimeConfig = (0, _configshared.getNextConfigRuntime)(config);
1022
+ const normalizedCacheHandlers = {};
1023
+ for (const [key, value] of Object.entries(runtimeConfig.cacheHandlers || {})){
1024
+ if (key && value) {
1025
+ normalizedCacheHandlers[key] = _path.default.relative(distDir, value);
1026
+ }
1027
+ }
1028
+ const serverFilesManifest = {
1029
+ version: 1,
1030
+ config: {
1031
+ ...runtimeConfig,
1032
+ ..._ciinfo.hasNextSupport ? {
1033
+ compress: false
1034
+ } : {},
1035
+ cacheHandler: runtimeConfig.cacheHandler ? _path.default.relative(distDir, runtimeConfig.cacheHandler) : runtimeConfig.cacheHandler,
1036
+ cacheHandlers: normalizedCacheHandlers,
1037
+ experimental: {
1038
+ ...runtimeConfig.experimental,
1039
+ trustHostHeader: _ciinfo.hasNextSupport,
1040
+ isExperimentalCompile: isCompileMode
1041
+ }
1042
+ },
1043
+ appDir: dir,
1044
+ relativeAppDir: _path.default.relative(outputFileTracingRoot, dir),
1045
+ files: [
1046
+ _constants1.ROUTES_MANIFEST,
1047
+ _path.default.relative(distDir, pagesManifestPath),
1048
+ _constants1.BUILD_MANIFEST,
1049
+ _constants1.PRERENDER_MANIFEST,
1050
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.FUNCTIONS_CONFIG_MANIFEST),
1051
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_MANIFEST),
1052
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_BUILD_MANIFEST + '.js'),
1053
+ ...bundler !== _bundler.Bundler.Turbopack ? [
1054
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_REACT_LOADABLE_MANIFEST + '.js'),
1055
+ _constants1.REACT_LOADABLE_MANIFEST
1056
+ ] : [],
1057
+ ...appDir ? [
1058
+ ...config.experimental.sri ? [
1059
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.SUBRESOURCE_INTEGRITY_MANIFEST + '.js'),
1060
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.SUBRESOURCE_INTEGRITY_MANIFEST + '.json')
1061
+ ] : [],
1062
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.APP_PATHS_MANIFEST),
1063
+ _path.default.join(_constants1.APP_PATH_ROUTES_MANIFEST),
1064
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.SERVER_REFERENCE_MANIFEST + '.js'),
1065
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.SERVER_REFERENCE_MANIFEST + '.json')
1066
+ ] : [],
1067
+ ...pagesDir && bundler !== _bundler.Bundler.Turbopack ? [
1068
+ _constants1.DYNAMIC_CSS_MANIFEST + '.json',
1069
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.DYNAMIC_CSS_MANIFEST + '.js')
1070
+ ] : [],
1071
+ _constants1.BUILD_ID_FILE,
1072
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.NEXT_FONT_MANIFEST + '.js'),
1073
+ _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.NEXT_FONT_MANIFEST + '.json'),
1074
+ _constants1.SERVER_FILES_MANIFEST + '.json'
1075
+ ].filter(_nonnullable.nonNullable).map((file)=>_path.default.join(config.distDir, file)),
1076
+ ignore: []
1077
+ };
1078
+ if (hasInstrumentationHook) {
1079
+ serverFilesManifest.files.push(_path.default.join(config.distDir, _constants1.SERVER_DIRECTORY, `${_constants.INSTRUMENTATION_HOOK_FILENAME}.js`));
1080
+ // If there are edge routes, append the edge instrumentation hook
1081
+ // Turbopack generates this chunk with a hashed name and references it in middleware-manifest.
1082
+ let edgeInstrumentationHook = _path.default.join(config.distDir, _constants1.SERVER_DIRECTORY, `edge-${_constants.INSTRUMENTATION_HOOK_FILENAME}.js`);
1083
+ if (bundler !== _bundler.Bundler.Turbopack && (0, _fs.existsSync)(_path.default.join(dir, edgeInstrumentationHook))) {
1084
+ serverFilesManifest.files.push(edgeInstrumentationHook);
1085
+ }
1086
+ }
1087
+ if (config.experimental.optimizeCss) {
1088
+ const globOrig = require('next/dist/compiled/glob');
1089
+ const cssFilePaths = await new Promise((resolve, reject)=>{
1090
+ globOrig('**/*.css', {
1091
+ cwd: _path.default.join(distDir, 'static')
1092
+ }, (err, files)=>{
1093
+ if (err) {
1094
+ return reject(err);
1095
+ }
1096
+ resolve(files);
1097
+ });
1098
+ });
1099
+ serverFilesManifest.files.push(...cssFilePaths.map((filePath)=>_path.default.join(config.distDir, 'static', filePath)));
1100
+ }
1101
+ // Under standalone mode, we need to ensure that the cache entry debug
1102
+ // handler is copied so that it can be used in the test. This is required
1103
+ // for the turbopack test to run as it's more strict about the build
1104
+ // directories. This is only used for testing and is not used in
1105
+ // production.
1106
+ if (process.env.__NEXT_TEST_MODE && process.env.NEXT_PRIVATE_DEBUG_CACHE_ENTRY_HANDLERS) {
1107
+ serverFilesManifest.files.push(_path.default.relative(dir, _path.default.isAbsolute(process.env.NEXT_PRIVATE_DEBUG_CACHE_ENTRY_HANDLERS) ? process.env.NEXT_PRIVATE_DEBUG_CACHE_ENTRY_HANDLERS : _path.default.join(dir, process.env.NEXT_PRIVATE_DEBUG_CACHE_ENTRY_HANDLERS)));
1108
+ }
1109
+ return serverFilesManifest;
1110
+ });
1111
+ await writeRequiredServerFilesManifest(distDir, requiredServerFilesManifest);
1064
1112
  const numberOfWorkers = getNumberOfWorkers(config);
1065
1113
  const collectingPageDataStart = process.hrtime();
1066
1114
  const postCompileSpinner = (0, _spinner.default)(`Collecting page data using ${numberOfWorkers} worker${numberOfWorkers > 1 ? 's' : ''}`);
@@ -1092,7 +1140,7 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
1092
1140
  await writeManifest(_path.default.join(distDir, _constants1.APP_PATH_ROUTES_MANIFEST), appPathRoutes);
1093
1141
  }
1094
1142
  process.env.NEXT_PHASE = _constants1.PHASE_PRODUCTION_BUILD;
1095
- const worker = createStaticWorker(config, {
1143
+ staticWorker = createStaticWorker(config, {
1096
1144
  numberOfWorkers,
1097
1145
  debuggerPortOffset: -1
1098
1146
  });
@@ -1115,7 +1163,7 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
1115
1163
  const { configFileName } = config;
1116
1164
  const sriEnabled = Boolean((_config_experimental_sri = config.experimental.sri) == null ? void 0 : _config_experimental_sri.algorithm);
1117
1165
  const nonStaticErrorPageSpan = staticCheckSpan.traceChild('check-static-error-page');
1118
- const errorPageHasCustomGetInitialProps = nonStaticErrorPageSpan.traceAsyncFn(async ()=>hasCustomErrorPage && await worker.hasCustomGetInitialProps({
1166
+ const errorPageHasCustomGetInitialProps = nonStaticErrorPageSpan.traceAsyncFn(async ()=>hasCustomErrorPage && await staticWorker.hasCustomGetInitialProps({
1119
1167
  page: '/_error',
1120
1168
  distDir,
1121
1169
  checkingApp: false,
@@ -1123,7 +1171,7 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
1123
1171
  }));
1124
1172
  const errorPageStaticResult = nonStaticErrorPageSpan.traceAsyncFn(async ()=>{
1125
1173
  var _config_i18n, _config_i18n1;
1126
- return hasCustomErrorPage && worker.isPageStatic({
1174
+ return hasCustomErrorPage && staticWorker.isPageStatic({
1127
1175
  dir,
1128
1176
  page: '/_error',
1129
1177
  distDir,
@@ -1142,13 +1190,13 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
1142
1190
  });
1143
1191
  });
1144
1192
  const appPageToCheck = '/_app';
1145
- const customAppGetInitialPropsPromise = hasUserPagesRoutes ? worker.hasCustomGetInitialProps({
1193
+ const customAppGetInitialPropsPromise = hasUserPagesRoutes ? staticWorker.hasCustomGetInitialProps({
1146
1194
  page: appPageToCheck,
1147
1195
  distDir,
1148
1196
  checkingApp: true,
1149
1197
  sriEnabled
1150
1198
  }) : Promise.resolve(false);
1151
- const namedExportsPromise = hasUserPagesRoutes ? worker.getDefinedNamedExports({
1199
+ const namedExportsPromise = hasUserPagesRoutes ? staticWorker.getDefinedNamedExports({
1152
1200
  page: appPageToCheck,
1153
1201
  distDir,
1154
1202
  sriEnabled
@@ -1263,7 +1311,7 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
1263
1311
  let isPageStaticSpan = checkPageSpan.traceChild('is-page-static');
1264
1312
  let workerResult = await isPageStaticSpan.traceAsyncFn(()=>{
1265
1313
  var _config_i18n, _config_i18n1;
1266
- return worker.isPageStatic({
1314
+ return staticWorker.isPageStatic({
1267
1315
  dir,
1268
1316
  page,
1269
1317
  originalAppPath,
@@ -1455,77 +1503,6 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
1455
1503
  console.warn((0, _picocolors.bold)((0, _picocolors.yellow)(`Warning: `)) + (0, _picocolors.yellow)(`You have opted-out of Automatic Static Optimization due to \`getInitialProps\` in \`pages/_app\`. This does not opt-out pages with \`getStaticProps\``));
1456
1504
  console.warn('Read more: https://nextjs.org/docs/messages/opt-out-auto-static-optimization\n');
1457
1505
  }
1458
- const { cacheHandler } = config;
1459
- const instrumentationHookEntryFiles = [];
1460
- if (hasInstrumentationHook) {
1461
- instrumentationHookEntryFiles.push(_path.default.join(_constants1.SERVER_DIRECTORY, `${_constants.INSTRUMENTATION_HOOK_FILENAME}.js`));
1462
- // If there's edge routes, append the edge instrumentation hook
1463
- // Turbopack generates this chunk with a hashed name and references it in middleware-manifest.
1464
- if (bundler !== _bundler.Bundler.Turbopack && (edgeRuntimeAppCount || edgeRuntimePagesCount)) {
1465
- instrumentationHookEntryFiles.push(_path.default.join(_constants1.SERVER_DIRECTORY, `edge-${_constants.INSTRUMENTATION_HOOK_FILENAME}.js`));
1466
- }
1467
- }
1468
- const requiredServerFilesManifest = nextBuildSpan.traceChild('generate-required-server-files').traceFn(()=>{
1469
- const normalizedCacheHandlers = {};
1470
- for (const [key, value] of Object.entries(config.cacheHandlers || {})){
1471
- if (key && value) {
1472
- normalizedCacheHandlers[key] = _path.default.relative(distDir, value);
1473
- }
1474
- }
1475
- const serverFilesManifest = {
1476
- version: 1,
1477
- config: {
1478
- ...config,
1479
- configFile: undefined,
1480
- ..._ciinfo.hasNextSupport ? {
1481
- compress: false
1482
- } : {},
1483
- cacheHandler: cacheHandler ? _path.default.relative(distDir, cacheHandler) : config.cacheHandler,
1484
- cacheHandlers: normalizedCacheHandlers,
1485
- experimental: {
1486
- ...config.experimental,
1487
- trustHostHeader: _ciinfo.hasNextSupport,
1488
- isExperimentalCompile: isCompileMode
1489
- }
1490
- },
1491
- appDir: dir,
1492
- relativeAppDir: _path.default.relative(outputFileTracingRoot, dir),
1493
- files: [
1494
- _constants1.ROUTES_MANIFEST,
1495
- _path.default.relative(distDir, pagesManifestPath),
1496
- _constants1.BUILD_MANIFEST,
1497
- _constants1.PRERENDER_MANIFEST,
1498
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.FUNCTIONS_CONFIG_MANIFEST),
1499
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_MANIFEST),
1500
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_BUILD_MANIFEST + '.js'),
1501
- ...bundler !== _bundler.Bundler.Turbopack ? [
1502
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.MIDDLEWARE_REACT_LOADABLE_MANIFEST + '.js'),
1503
- _constants1.REACT_LOADABLE_MANIFEST
1504
- ] : [],
1505
- ...appDir ? [
1506
- ...config.experimental.sri ? [
1507
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.SUBRESOURCE_INTEGRITY_MANIFEST + '.js'),
1508
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.SUBRESOURCE_INTEGRITY_MANIFEST + '.json')
1509
- ] : [],
1510
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.APP_PATHS_MANIFEST),
1511
- _path.default.join(_constants1.APP_PATH_ROUTES_MANIFEST),
1512
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.SERVER_REFERENCE_MANIFEST + '.js'),
1513
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.SERVER_REFERENCE_MANIFEST + '.json')
1514
- ] : [],
1515
- ...pagesDir && bundler !== _bundler.Bundler.Turbopack ? [
1516
- _constants1.DYNAMIC_CSS_MANIFEST + '.json',
1517
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.DYNAMIC_CSS_MANIFEST + '.js')
1518
- ] : [],
1519
- _constants1.BUILD_ID_FILE,
1520
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.NEXT_FONT_MANIFEST + '.js'),
1521
- _path.default.join(_constants1.SERVER_DIRECTORY, _constants1.NEXT_FONT_MANIFEST + '.json'),
1522
- _constants1.SERVER_FILES_MANIFEST,
1523
- ...instrumentationHookEntryFiles
1524
- ].filter(_nonnullable.nonNullable).map((file)=>_path.default.join(config.distDir, file)),
1525
- ignore: []
1526
- };
1527
- return serverFilesManifest;
1528
- });
1529
1506
  const middlewareFile = (0, _normalizepathsep.normalizePathSep)(proxyFilePath || middlewareFilePath || '');
1530
1507
  let hasNodeMiddleware = false;
1531
1508
  if (middlewareFile) {
@@ -1609,28 +1586,6 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
1609
1586
  throw err;
1610
1587
  }
1611
1588
  await (0, _writebuildid.writeBuildId)(distDir, buildId);
1612
- if (config.experimental.optimizeCss) {
1613
- const globOrig = require('next/dist/compiled/glob');
1614
- const cssFilePaths = await new Promise((resolve, reject)=>{
1615
- globOrig('**/*.css', {
1616
- cwd: _path.default.join(distDir, 'static')
1617
- }, (err, files)=>{
1618
- if (err) {
1619
- return reject(err);
1620
- }
1621
- resolve(files);
1622
- });
1623
- });
1624
- requiredServerFilesManifest.files.push(...cssFilePaths.map((filePath)=>_path.default.join(config.distDir, 'static', filePath)));
1625
- }
1626
- // Under standalone mode, we need to ensure that the cache entry debug
1627
- // handler is copied so that it can be used in the test. This is required
1628
- // for the turbopack test to run as it's more strict about the build
1629
- // directories. This is only used for testing and is not used in
1630
- // production.
1631
- if (process.env.__NEXT_TEST_MODE && process.env.NEXT_PRIVATE_DEBUG_CACHE_ENTRY_HANDLERS) {
1632
- requiredServerFilesManifest.files.push(_path.default.relative(dir, _path.default.isAbsolute(process.env.NEXT_PRIVATE_DEBUG_CACHE_ENTRY_HANDLERS) ? process.env.NEXT_PRIVATE_DEBUG_CACHE_ENTRY_HANDLERS : _path.default.join(dir, process.env.NEXT_PRIVATE_DEBUG_CACHE_ENTRY_HANDLERS)));
1633
- }
1634
1589
  const features = [
1635
1590
  {
1636
1591
  featureName: 'experimental/cacheComponents',
@@ -1663,7 +1618,6 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
1663
1618
  payload: feature
1664
1619
  };
1665
1620
  }));
1666
- await writeRequiredServerFilesManifest(distDir, requiredServerFilesManifest);
1667
1621
  // we don't need to inline for turbopack build as
1668
1622
  // it will handle it's own caching separate of compile
1669
1623
  if (isGenerateMode && bundler !== _bundler.Bundler.Turbopack) {
@@ -1857,7 +1811,7 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
1857
1811
  statusMessage: `Generating static pages using ${numberOfWorkers} worker${numberOfWorkers > 1 ? 's' : ''}`,
1858
1812
  numWorkers: numberOfWorkers,
1859
1813
  appDirOnly
1860
- }, nextBuildSpan);
1814
+ }, nextBuildSpan, staticWorker);
1861
1815
  // If there was no result, there's nothing more to do.
1862
1816
  if (!exportResult) return;
1863
1817
  const getFallbackMode = (route)=>{
@@ -2026,19 +1980,6 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
2026
1980
  } else {
2027
1981
  dataRoute = _path.default.posix.join(`${normalizedRoute}${_constants.RSC_SUFFIX}`);
2028
1982
  }
2029
- let prefetchDataRoute = null;
2030
- // While we may only write the `.rsc` when the route does not
2031
- // have PPR enabled, we still want to generate the route when
2032
- // deployed so it doesn't 404. If the app has PPR enabled, we
2033
- // should add this key.
2034
- if (!isAppRouteHandler && isAppPPREnabled && // Don't add a prefetch data route if we have
2035
- // cacheComponents enabled. This is
2036
- // because we don't actually use the prefetch data route in
2037
- // this case. This only applies if we have PPR enabled for
2038
- // this route.
2039
- !(config.cacheComponents && isRoutePPREnabled)) {
2040
- prefetchDataRoute = _path.default.posix.join(`${normalizedRoute}${_constants.RSC_PREFETCH_SUFFIX}`);
2041
- }
2042
1983
  const meta = (0, _utils1.collectMeta)(metadata);
2043
1984
  const status = route.pathname === _entryconstants.UNDERSCORE_NOT_FOUND_ROUTE ? 404 : meta.status;
2044
1985
  prerenderManifest.routes[route.pathname] = {
@@ -2051,7 +1992,7 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
2051
1992
  initialExpireSeconds: cacheControl.expire,
2052
1993
  srcRoute: page,
2053
1994
  dataRoute,
2054
- prefetchDataRoute,
1995
+ prefetchDataRoute: undefined,
2055
1996
  allowHeader: ALLOWED_HEADERS
2056
1997
  };
2057
1998
  } else {
@@ -2111,20 +2052,12 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
2111
2052
  let prefetchDataRoute = null;
2112
2053
  let dynamicRoute = routesManifest.dynamicRoutes.find((r)=>r.page === route.pathname);
2113
2054
  if (!isAppRouteHandler && isAppPPREnabled) {
2114
- if (// Don't add a prefetch data route if we have
2115
- // cacheComponents enabled. This is
2116
- // because we don't actually use the prefetch data route in
2117
- // this case. This only applies if we have PPR enabled for
2118
- // this route.
2119
- !config.cacheComponents || !isRoutePPREnabled) {
2120
- prefetchDataRoute = _path.default.posix.join(`${normalizedRoute}${_constants.RSC_PREFETCH_SUFFIX}`);
2121
- }
2122
2055
  // If the dynamic route wasn't found, then we need to create
2123
2056
  // it. This ensures that for each fallback shell there's an
2124
2057
  // entry in the app routes manifest which enables routing for
2125
2058
  // this fallback shell.
2126
2059
  if (!dynamicRoute) {
2127
- dynamicRoute = pageToRoute(route.pathname, page);
2060
+ dynamicRoute = (0, _utils1.pageToRoute)(route.pathname, page);
2128
2061
  sourcePages.set(route.pathname, page);
2129
2062
  // This route is not for the internal router, but instead
2130
2063
  // for external routers.
@@ -2166,14 +2099,6 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
2166
2099
  builtSegmentDataRoute.destination = builtSegmentDataRoute.destination.replace('/__PAGE__.segment.rsc', '$segment');
2167
2100
  dynamicRoute.prefetchSegmentDataRoutes ??= [];
2168
2101
  dynamicRoute.prefetchSegmentDataRoutes.push(builtSegmentDataRoute);
2169
- } else if (route.fallbackRootParams && route.fallbackRootParams.length > 0) {
2170
- dynamicRoute.hasFallbackRootParams = true;
2171
- dynamicRoute.prefetchSegmentDataRoutes = [
2172
- (0, _buildprefetchsegmentdataroute.buildInversePrefetchSegmentDataRoute)(dynamicRoute.page, // We use the special segment path of `/_tree` because it's
2173
- // the first one sent by the client router so it's the only
2174
- // one we need to rewrite to the regular prefetch RSC route.
2175
- '/_tree')
2176
- ];
2177
2102
  }
2178
2103
  }
2179
2104
  pageInfos.set(route.pathname, {
@@ -2456,8 +2381,13 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
2456
2381
  buildTracesStart = process.hrtime();
2457
2382
  buildTracesSpinner = (0, _spinner.default)('Collecting build traces');
2458
2383
  }
2459
- // ensure the worker is not left hanging
2460
- worker.end();
2384
+ // When output: export we want to end the worker later as it's still used for writeFullyStaticExport
2385
+ if (config.output !== 'export') {
2386
+ // ensure the worker is not left hanging
2387
+ staticWorker == null ? void 0 : staticWorker.end();
2388
+ staticWorker = undefined // Reset staticWorker to make sure it does not end in `finally`
2389
+ ;
2390
+ }
2461
2391
  const analysisEnd = process.hrtime(analysisBegin);
2462
2392
  telemetry.record((0, _events.eventBuildOptimize)(pagesPaths, {
2463
2393
  durationInSeconds: analysisEnd[0],
@@ -2593,6 +2523,11 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
2593
2523
  _log.info(`Build ran with "compile" mode, to finalize the build run either "generate" or "generate-env" mode as well`);
2594
2524
  }
2595
2525
  if (config.output === 'export') {
2526
+ // TODO: When writeFullyStaticExport doesn't fail when staticWorker is passed moved this after writeFullyStaticExport.
2527
+ // End the worker here when it's output: export.
2528
+ staticWorker.end();
2529
+ staticWorker = undefined // Reset staticWorker to make sure it does not end in `finally`
2530
+ ;
2596
2531
  await nextBuildSpan.traceChild('output-export-full-static-export').traceAsyncFn(async ()=>{
2597
2532
  await writeFullyStaticExport(config, dir, enabledDirectories, configOutDir, nextBuildSpan, appDirOnly);
2598
2533
  });
@@ -2611,7 +2546,7 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
2611
2546
  configOutDir: _path.default.join(dir, configOutDir),
2612
2547
  staticPages,
2613
2548
  serverPropsPages,
2614
- nextVersion: "16.0.10",
2549
+ nextVersion: "16.1.1",
2615
2550
  tracingRoot: outputFileTracingRoot,
2616
2551
  hasNodeMiddleware,
2617
2552
  hasInstrumentationHook,
@@ -2657,6 +2592,16 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
2657
2592
  }));
2658
2593
  await nextBuildSpan.traceChild('telemetry-flush').traceAsyncFn(()=>telemetry.flush());
2659
2594
  await shutdownPromise;
2595
+ if (_buildcontext.NextBuildContext.analyze) {
2596
+ await (0, _promises.cp)(_path.default.join(__dirname, '../bundle-analyzer'), _path.default.join(dir, '.next/diagnostics/analyze'), {
2597
+ recursive: true
2598
+ });
2599
+ await (0, _promises.mkdir)(_path.default.join(dir, '.next/diagnostics/analyze/data'), {
2600
+ recursive: true
2601
+ });
2602
+ // Write an index of routes for the route picker
2603
+ await (0, _promises.writeFile)(_path.default.join(dir, '.next/diagnostics/analyze/data/routes.json'), JSON.stringify(routesManifest.dynamicRoutes.map((r)=>r.page).concat(routesManifest.staticRoutes.map((r)=>r.page)), null, 2));
2604
+ }
2660
2605
  });
2661
2606
  } catch (e) {
2662
2607
  const telemetry = _shared.traceGlobals.get('telemetry');
@@ -2669,6 +2614,10 @@ async function build(dir, experimentalAnalyze = false, reactProductionProfiling
2669
2614
  }
2670
2615
  throw e;
2671
2616
  } finally{
2617
+ // @ts-expect-error Existence of staticWorker is checked here intentionally.
2618
+ if (staticWorker) {
2619
+ staticWorker.end();
2620
+ }
2672
2621
  // Ensure we wait for lockfile patching if present
2673
2622
  await _swc.lockfilePatchPromise.cur;
2674
2623
  // Flush telemetry before finishing (waits for async operations like setTimeout in debug mode)
@@ -85,17 +85,14 @@ function prefixedLog(prefixType, ...message) {
85
85
  // Ensure if there's ANSI escape codes it's concatenated into one string.
86
86
  // Chrome DevTool can only handle color if it's in one string.
87
87
  if (message.length === 1 && typeof message[0] === 'string') {
88
- console[consoleMethod](' ' + prefix + ' ' + message[0]);
88
+ console[consoleMethod](prefix + ' ' + message[0]);
89
89
  } else {
90
- console[consoleMethod](' ' + prefix, ...message);
90
+ console[consoleMethod](prefix, ...message);
91
91
  }
92
92
  }
93
93
  }
94
- function bootstrap(...message) {
95
- // logging format: ' <prefix> <message>'
96
- // e.g. ' ✓ Compiled successfully'
97
- // Add spaces to align with the indent of other logs
98
- console.log(' ' + message.join(' '));
94
+ function bootstrap(message) {
95
+ console.log(message);
99
96
  }
100
97
  function wait(...message) {
101
98
  prefixedLog('wait', ...message);