@netlify/plugin-nextjs 4.41.3 → 5.0.0-beta.0

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 (239) hide show
  1. package/README.md +61 -17
  2. package/dist/build/cache.js +15 -0
  3. package/dist/build/content/prerendered.js +16 -0
  4. package/dist/build/content/server.js +18 -0
  5. package/dist/build/content/static.js +20 -0
  6. package/dist/build/functions/edge.js +14 -0
  7. package/dist/build/functions/server.js +16 -0
  8. package/dist/build/plugin-context.js +17 -0
  9. package/dist/esm-chunks/chunk-4AJYXTWN.js +17 -0
  10. package/dist/esm-chunks/chunk-62KDS27E.js +77 -0
  11. package/dist/esm-chunks/chunk-AVWFCGVE.js +5536 -0
  12. package/dist/esm-chunks/chunk-B6QMRLBH.js +255 -0
  13. package/dist/esm-chunks/chunk-G2VRYWGL.js +107 -0
  14. package/dist/esm-chunks/chunk-G3GM7JNF.js +92 -0
  15. package/dist/esm-chunks/chunk-GGHAQM5D.js +28 -0
  16. package/dist/esm-chunks/chunk-HPGTYMVD.js +113 -0
  17. package/dist/esm-chunks/chunk-PEBUKFKH.js +89 -0
  18. package/dist/esm-chunks/chunk-R4NHZWGU.js +32 -0
  19. package/dist/esm-chunks/chunk-RSKIKBZH.js +44 -0
  20. package/dist/esm-chunks/chunk-XD5TSLZO.js +85 -0
  21. package/dist/esm-chunks/chunk-ZBX3SNQG.js +561 -0
  22. package/dist/index.js +66 -0
  23. package/dist/run/config.js +18 -0
  24. package/dist/run/constants.js +15 -0
  25. package/dist/run/handlers/cache.cjs +849 -0
  26. package/dist/run/handlers/server.js +3289 -0
  27. package/dist/run/headers.js +19 -0
  28. package/dist/run/next.cjs +1055 -0
  29. package/dist/run/revalidate.js +13 -0
  30. package/edge-runtime/README.md +29 -0
  31. package/edge-runtime/lib/headers.ts +26 -0
  32. package/edge-runtime/lib/middleware.ts +60 -0
  33. package/edge-runtime/lib/next-request.ts +59 -0
  34. package/edge-runtime/lib/response.ts +145 -0
  35. package/edge-runtime/lib/util.ts +26 -0
  36. package/edge-runtime/middleware.ts +40 -0
  37. package/edge-runtime/shim/index.js +8 -0
  38. package/{src/templates → edge-runtime}/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/index.ts +1 -1
  39. package/edge-runtime/vendor/import_map.json +13 -0
  40. package/edge-runtime/vendor.ts +18 -0
  41. package/manifest.yml +1 -1
  42. package/package.json +23 -60
  43. package/index.js +0 -1
  44. package/lib/constants.js +0 -56
  45. package/lib/helpers/analysis.js +0 -115
  46. package/lib/helpers/cache.js +0 -46
  47. package/lib/helpers/compiler.js +0 -119
  48. package/lib/helpers/config.js +0 -192
  49. package/lib/helpers/dev.js +0 -20
  50. package/lib/helpers/edge.js +0 -328
  51. package/lib/helpers/files.js +0 -335
  52. package/lib/helpers/flags.js +0 -46
  53. package/lib/helpers/functions.js +0 -437
  54. package/lib/helpers/functionsMetaData.js +0 -46
  55. package/lib/helpers/matchers.js +0 -41
  56. package/lib/helpers/middlewareWatcher.js +0 -12
  57. package/lib/helpers/pack.js +0 -41
  58. package/lib/helpers/redirects.js +0 -246
  59. package/lib/helpers/types.js +0 -2
  60. package/lib/helpers/utils.js +0 -226
  61. package/lib/helpers/verification.js +0 -182
  62. package/lib/index.js +0 -194
  63. package/lib/templates/blobStorage.js +0 -30
  64. package/lib/templates/getApiHandler.js +0 -120
  65. package/lib/templates/getHandler.js +0 -201
  66. package/lib/templates/getPageResolver.js +0 -54
  67. package/lib/templates/handlerUtils.js +0 -268
  68. package/lib/templates/ipx.js +0 -13
  69. package/lib/templates/requireHooks.js +0 -105
  70. package/lib/templates/server.js +0 -159
  71. package/lib/templates/vendor.js +0 -20
  72. package/src/templates/edge/bundle.js +0 -8
  73. package/src/templates/edge/function-runtime.ts +0 -24
  74. package/src/templates/edge/imageconfig.json +0 -3
  75. package/src/templates/edge/ipx.ts +0 -5
  76. package/src/templates/edge/matchers.json +0 -1
  77. package/src/templates/edge/middleware-runtime.ts +0 -62
  78. package/src/templates/edge/next-dev.js +0 -104
  79. package/src/templates/edge/rsc-data.ts +0 -5
  80. package/src/templates/edge/shims.js +0 -77
  81. package/src/templates/edge-shared/next-utils.ts +0 -407
  82. package/src/templates/edge-shared/nextConfig.json +0 -3
  83. package/src/templates/edge-shared/prerender-manifest.json +0 -7
  84. package/src/templates/edge-shared/rsc-data.ts +0 -78
  85. package/src/templates/edge-shared/utils.test.ts +0 -114
  86. package/src/templates/edge-shared/utils.ts +0 -315
  87. package/src/templates/vendor/import_map.json +0 -13
  88. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.134.0/fmt/colors.ts +0 -0
  89. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.134.0/testing/_diff.ts +0 -0
  90. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.134.0/testing/asserts.ts +0 -0
  91. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/_util/asserts.ts +0 -0
  92. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/_util/os.ts +0 -0
  93. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/abortable.ts +0 -0
  94. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/deadline.ts +0 -0
  95. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/debounce.ts +0 -0
  96. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/deferred.ts +0 -0
  97. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/delay.ts +0 -0
  98. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/mod.ts +0 -0
  99. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/mux_async_iterator.ts +0 -0
  100. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/pool.ts +0 -0
  101. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/retry.ts +0 -0
  102. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/tee.ts +0 -0
  103. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/bytes/index_of_needle.ts +0 -0
  104. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/crypto/timing_safe_equal.ts +0 -0
  105. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/datetime/to_imf.ts +0 -0
  106. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/encoding/base64.ts +0 -0
  107. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/encoding/base64url.ts +0 -0
  108. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/flags/mod.ts +0 -0
  109. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/fmt/colors.ts +0 -0
  110. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/fmt/printf.ts +0 -0
  111. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/http/cookie.ts +0 -0
  112. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_core.ts +0 -0
  113. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_events.d.ts +0 -0
  114. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_events.mjs +0 -0
  115. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_global.d.ts +0 -0
  116. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_next_tick.ts +0 -0
  117. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_process/exiting.ts +0 -0
  118. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_process/process.ts +0 -0
  119. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_process/stdio.mjs +0 -0
  120. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_process/streams.mjs +0 -0
  121. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_stream.d.ts +0 -0
  122. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_stream.mjs +0 -0
  123. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_util/_util_callbackify.ts +0 -0
  124. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_utils.ts +0 -0
  125. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/assert.ts +0 -0
  126. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/assertion_error.ts +0 -0
  127. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/async_hooks.ts +0 -0
  128. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/buffer.ts +0 -0
  129. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/events.ts +0 -0
  130. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/buffer.d.ts +0 -0
  131. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/buffer.mjs +0 -0
  132. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/crypto/_keys.ts +0 -0
  133. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/crypto/constants.ts +0 -0
  134. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/error_codes.ts +0 -0
  135. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/errors.ts +0 -0
  136. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/fixed_queue.ts +0 -0
  137. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/hide_stack_frames.ts +0 -0
  138. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/net.ts +0 -0
  139. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/normalize_encoding.mjs +0 -0
  140. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/options.ts +0 -0
  141. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/primordials.mjs +0 -0
  142. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/process/per_thread.mjs +0 -0
  143. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/readline/callbacks.mjs +0 -0
  144. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/readline/utils.mjs +0 -0
  145. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/streams/destroy.mjs +0 -0
  146. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/streams/end-of-stream.mjs +0 -0
  147. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/streams/utils.mjs +0 -0
  148. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/util/comparisons.ts +0 -0
  149. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/util/debuglog.ts +0 -0
  150. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/util/inspect.mjs +0 -0
  151. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/util/types.ts +0 -0
  152. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/util.mjs +0 -0
  153. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/validators.mjs +0 -0
  154. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_libuv_winerror.ts +0 -0
  155. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_listen.ts +0 -0
  156. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_node.ts +0 -0
  157. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_timingSafeEqual.ts +0 -0
  158. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_utils.ts +0 -0
  159. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_winerror.ts +0 -0
  160. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/ares.ts +0 -0
  161. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/async_wrap.ts +0 -0
  162. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/buffer.ts +0 -0
  163. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/cares_wrap.ts +0 -0
  164. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/config.ts +0 -0
  165. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/connection_wrap.ts +0 -0
  166. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/constants.ts +0 -0
  167. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/contextify.ts +0 -0
  168. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/credentials.ts +0 -0
  169. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/crypto.ts +0 -0
  170. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/errors.ts +0 -0
  171. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/fs.ts +0 -0
  172. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/fs_dir.ts +0 -0
  173. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/fs_event_wrap.ts +0 -0
  174. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/handle_wrap.ts +0 -0
  175. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/heap_utils.ts +0 -0
  176. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/http_parser.ts +0 -0
  177. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/icu.ts +0 -0
  178. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/inspector.ts +0 -0
  179. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/js_stream.ts +0 -0
  180. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/messaging.ts +0 -0
  181. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/mod.ts +0 -0
  182. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/module_wrap.ts +0 -0
  183. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/native_module.ts +0 -0
  184. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/natives.ts +0 -0
  185. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/node_file.ts +0 -0
  186. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/node_options.ts +0 -0
  187. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/options.ts +0 -0
  188. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/os.ts +0 -0
  189. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/performance.ts +0 -0
  190. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/pipe_wrap.ts +0 -0
  191. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/process_methods.ts +0 -0
  192. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/report.ts +0 -0
  193. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/serdes.ts +0 -0
  194. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/signal_wrap.ts +0 -0
  195. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/spawn_sync.ts +0 -0
  196. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/stream_wrap.ts +0 -0
  197. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/string_decoder.ts +0 -0
  198. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/symbols.ts +0 -0
  199. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/task_queue.ts +0 -0
  200. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/tcp_wrap.ts +0 -0
  201. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/timers.ts +0 -0
  202. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/tls_wrap.ts +0 -0
  203. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/trace_events.ts +0 -0
  204. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/tty_wrap.ts +0 -0
  205. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/types.ts +0 -0
  206. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/udp_wrap.ts +0 -0
  207. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/url.ts +0 -0
  208. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/util.ts +0 -0
  209. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/uv.ts +0 -0
  210. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/v8.ts +0 -0
  211. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/worker.ts +0 -0
  212. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/zlib.ts +0 -0
  213. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/process.ts +0 -0
  214. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/stream.ts +0 -0
  215. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/string_decoder.ts +0 -0
  216. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/util/types.ts +0 -0
  217. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/util.ts +0 -0
  218. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/_constants.ts +0 -0
  219. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/_interface.ts +0 -0
  220. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/_util.ts +0 -0
  221. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/common.ts +0 -0
  222. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/glob.ts +0 -0
  223. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/mod.ts +0 -0
  224. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/posix.ts +0 -0
  225. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/separator.ts +0 -0
  226. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/win32.ts +0 -0
  227. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/streams/write_all.ts +0 -0
  228. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/testing/_diff.ts +0 -0
  229. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/testing/_format.ts +0 -0
  230. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/testing/asserts.ts +0 -0
  231. /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/types.d.ts +0 -0
  232. /package/{src/templates → edge-runtime}/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/asyncify.js +0 -0
  233. /package/{src/templates → edge-runtime}/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.d.ts +0 -0
  234. /package/{src/templates → edge-runtime}/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.js +0 -0
  235. /package/{src/templates → edge-runtime}/vendor/deno.land/x/path_to_regexp@v6.2.1/index.ts +0 -0
  236. /package/{src/templates → edge-runtime}/vendor/esm.sh/v91/next@12.2.5/deno/dist/compiled/cookie.js +0 -0
  237. /package/{src/templates → edge-runtime}/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/request.js +0 -0
  238. /package/{src/templates → edge-runtime}/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/response.js +0 -0
  239. /package/{src/templates → edge-runtime}/vendor/raw.githubusercontent.com/worker-tools/resolvable-promise/master/index.ts +0 -0
@@ -1,115 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.extractConfigFromFile = exports.validateConfigValue = exports.isEdgeConfig = void 0;
27
- const fs_1 = __importStar(require("fs"));
28
- const pathe_1 = require("pathe");
29
- const utils_1 = require("./utils");
30
- const isEdgeConfig = (config) => ['experimental-edge', 'edge'].includes(config);
31
- exports.isEdgeConfig = isEdgeConfig;
32
- const validateConfigValue = (config, apiFilePath) => {
33
- if (config.type === "experimental-scheduled" /* ApiRouteType.SCHEDULED */) {
34
- if (!config.schedule) {
35
- console.error(`Invalid config value in ${(0, pathe_1.relative)(process.cwd(), apiFilePath)}: schedule is required when type is "${"experimental-scheduled" /* ApiRouteType.SCHEDULED */}"`);
36
- return false;
37
- }
38
- if ((0, exports.isEdgeConfig)(config.runtime)) {
39
- console.error(`Invalid config value in ${(0, pathe_1.relative)(process.cwd(), apiFilePath)}: edge runtime is not supported for scheduled functions`);
40
- return false;
41
- }
42
- return true;
43
- }
44
- if (!config.type || config.type === "experimental-background" /* ApiRouteType.BACKGROUND */) {
45
- if (config.schedule) {
46
- console.error(`Invalid config value in ${(0, pathe_1.relative)(process.cwd(), apiFilePath)}: schedule is not allowed unless type is "${"experimental-scheduled" /* ApiRouteType.SCHEDULED */}"`);
47
- return false;
48
- }
49
- if (config.type && (0, exports.isEdgeConfig)(config.runtime)) {
50
- console.error(`Invalid config value in ${(0, pathe_1.relative)(process.cwd(), apiFilePath)}: edge runtime is not supported for background functions`);
51
- return false;
52
- }
53
- return true;
54
- }
55
- console.error(`Invalid config value in ${(0, pathe_1.relative)(process.cwd(), apiFilePath)}: type ${config.type} is not supported`);
56
- return false;
57
- };
58
- exports.validateConfigValue = validateConfigValue;
59
- let extractConstValue;
60
- let parseModule;
61
- let hasWarnedAboutNextVersion = false;
62
- /**
63
- * Uses Next's swc static analysis to extract the config values from a file.
64
- */
65
- const extractConfigFromFile = async (apiFilePath, appDir) => {
66
- if (!apiFilePath || !(0, fs_1.existsSync)(apiFilePath)) {
67
- return {};
68
- }
69
- const extractConstValueModulePath = (0, utils_1.findModuleFromBase)({
70
- paths: [appDir],
71
- candidates: ['next/dist/build/analysis/extract-const-value'],
72
- });
73
- const parseModulePath = (0, utils_1.findModuleFromBase)({
74
- paths: [appDir],
75
- candidates: ['next/dist/build/analysis/parse-module'],
76
- });
77
- if (!extractConstValueModulePath || !parseModulePath) {
78
- if (!hasWarnedAboutNextVersion) {
79
- console.log("This version of Next.js doesn't support advanced API routes. Skipping...");
80
- hasWarnedAboutNextVersion = true;
81
- }
82
- // Old Next.js version
83
- return {};
84
- }
85
- if (!extractConstValue && extractConstValueModulePath) {
86
- // eslint-disable-next-line import/no-dynamic-require
87
- extractConstValue = require(extractConstValueModulePath);
88
- }
89
- if (!parseModule && parseModulePath) {
90
- // eslint-disable-next-line prefer-destructuring, @typescript-eslint/no-var-requires, import/no-dynamic-require
91
- parseModule = require(parseModulePath).parseModule;
92
- }
93
- const { extractExportedConstValue, UnsupportedValueError } = extractConstValue;
94
- const fileContent = await fs_1.default.promises.readFile(apiFilePath, 'utf8');
95
- // No need to parse if there's no "config"
96
- if (!fileContent.includes('config')) {
97
- return {};
98
- }
99
- const ast = await parseModule(apiFilePath, fileContent);
100
- let config;
101
- try {
102
- config = extractExportedConstValue(ast, 'config');
103
- }
104
- catch (error) {
105
- if (UnsupportedValueError && error instanceof UnsupportedValueError) {
106
- console.warn(`Unsupported config value in ${(0, pathe_1.relative)(process.cwd(), apiFilePath)}`);
107
- }
108
- return {};
109
- }
110
- if ((0, exports.validateConfigValue)(config, apiFilePath)) {
111
- return config;
112
- }
113
- throw new Error(`Unsupported config value in ${(0, pathe_1.relative)(process.cwd(), apiFilePath)}`);
114
- };
115
- exports.extractConfigFromFile = extractConfigFromFile;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.saveCache = exports.restoreCache = void 0;
4
- const fs_1 = require("fs");
5
- const path_1 = require("path");
6
- const utils_1 = require("./utils");
7
- const findDistDir = (publish) => {
8
- // In normal operation, the dist dir is the same as the publish dir
9
- if (!(0, utils_1.shouldSkip)()) {
10
- return publish;
11
- }
12
- // In this situation, the user has disabled the next-runtime, which means that they might be using next export,
13
- // so we'll look in a few places to find the site root. This allows us to find the .next directory.
14
- for (const root of [(0, path_1.resolve)(publish, '..'), (0, path_1.resolve)(publish, '..', '..')]) {
15
- if ((0, fs_1.existsSync)((0, path_1.join)(root, 'next.config.js'))) {
16
- return (0, path_1.join)(root, '.next');
17
- }
18
- }
19
- return null;
20
- };
21
- const restoreCache = async ({ cache, publish }) => {
22
- const distDir = findDistDir(publish);
23
- if (!distDir) {
24
- return;
25
- }
26
- if (await cache.restore((0, path_1.join)(distDir, 'cache'))) {
27
- console.log('Next.js cache restored.');
28
- }
29
- else {
30
- console.log('No Next.js cache to restore.');
31
- }
32
- };
33
- exports.restoreCache = restoreCache;
34
- const saveCache = async ({ cache, publish }) => {
35
- const distDir = findDistDir(publish);
36
- if (!distDir) {
37
- return;
38
- }
39
- if (await cache.save((0, path_1.join)(distDir, 'cache'))) {
40
- console.log('Next.js cache saved.');
41
- }
42
- else {
43
- console.log('No Next.js cache to save.');
44
- }
45
- };
46
- exports.saveCache = saveCache;
@@ -1,119 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.watchForMiddlewareChanges = void 0;
4
- const fs_1 = require("fs");
5
- const path_1 = require("path");
6
- const esbuild_1 = require("@netlify/esbuild");
7
- const chokidar_1 = require("chokidar");
8
- // For more information on Next.js middleware, see https://nextjs.org/docs/advanced-features/middleware
9
- // These are the locations that a middleware file can exist in a Next.js application
10
- // If other possible locations are added by Next.js, they should be added here.
11
- const MIDDLEWARE_FILE_LOCATIONS = [
12
- 'middleware.js',
13
- 'middleware.ts',
14
- 'src/middleware.js',
15
- 'src/middleware.ts',
16
- ];
17
- const toFileList = (watched) => Object.entries(watched).flatMap(([dir, files]) => files.map((file) => (0, path_1.join)(dir, file)));
18
- /**
19
- * Compile the middleware file using esbuild
20
- */
21
- const buildMiddlewareFile = async (entryPoints, base) => {
22
- try {
23
- await (0, esbuild_1.build)({
24
- entryPoints,
25
- outfile: (0, path_1.join)(base, '.netlify', 'middleware.js'),
26
- bundle: true,
27
- format: 'esm',
28
- target: 'esnext',
29
- absWorkingDir: base,
30
- external: ['next/dist/compiled/@vercel/og'],
31
- });
32
- }
33
- catch (error) {
34
- console.error(error.toString());
35
- }
36
- };
37
- /**
38
- * We only compile middleware if there's exactly one file. If there's more than one, we log a warning and don't compile.
39
- */
40
- const shouldFilesBeCompiled = (watchedFiles, isFirstRun) => {
41
- if (watchedFiles.length === 0) {
42
- if (!isFirstRun) {
43
- // Only log on subsequent builds, because having it on first build makes it seem like a warning, when it's a normal state
44
- console.log('No middleware found');
45
- }
46
- return false;
47
- }
48
- if (watchedFiles.length > 1) {
49
- console.log('Multiple middleware files found:');
50
- console.log(watchedFiles.join('\n'));
51
- console.log('This is not supported.');
52
- return false;
53
- }
54
- return true;
55
- };
56
- const updateWatchedFiles = async (watcher, base, isFirstRun = false) => {
57
- try {
58
- // Start by deleting the old file. If we error out, we don't want to leave the old file around
59
- await fs_1.promises.unlink((0, path_1.join)(base, '.netlify', 'middleware.js'));
60
- }
61
- catch {
62
- // Ignore, because it's fine if it didn't exist
63
- }
64
- // The list of watched files is an object with the directory as the key and an array of files as the value.
65
- // We need to flatten this into a list of files
66
- const watchedFiles = toFileList(watcher.getWatched());
67
- if (!shouldFilesBeCompiled(watchedFiles, isFirstRun)) {
68
- watcher.emit('build');
69
- return;
70
- }
71
- console.log(`${isFirstRun ? 'Building' : 'Rebuilding'} middleware ${watchedFiles[0]}...`);
72
- await buildMiddlewareFile(watchedFiles, base);
73
- console.log('...done');
74
- watcher.emit('build');
75
- };
76
- /**
77
- * Watch for changes to the middleware file location. When a change is detected, recompile the middleware file.
78
- *
79
- * @param base The base directory to watch
80
- * @returns a file watcher and a promise that resolves when the initial scan is complete.
81
- */
82
- const watchForMiddlewareChanges = (base) => {
83
- const watcher = (0, chokidar_1.watch)(MIDDLEWARE_FILE_LOCATIONS, {
84
- // Try and ensure renames just emit one event
85
- atomic: true,
86
- // Don't emit for every watched file, just once after the scan is done
87
- ignoreInitial: true,
88
- cwd: base,
89
- });
90
- watcher
91
- .on('change', (path) => {
92
- console.log(`File ${path} has been changed`);
93
- updateWatchedFiles(watcher, base);
94
- })
95
- .on('add', (path) => {
96
- console.log(`File ${path} has been added`);
97
- updateWatchedFiles(watcher, base);
98
- })
99
- .on('unlink', (path) => {
100
- console.log(`File ${path} has been removed`);
101
- updateWatchedFiles(watcher, base);
102
- });
103
- return {
104
- watcher,
105
- isReady: new Promise((resolve) => {
106
- watcher.on('ready', async () => {
107
- console.log('Initial scan for middleware file complete. Ready for changes.');
108
- // This only happens on the first scan
109
- await updateWatchedFiles(watcher, base, true);
110
- console.log('Ready');
111
- resolve();
112
- });
113
- }),
114
- nextBuild: () => new Promise((resolve) => {
115
- watcher.once('build', resolve);
116
- }),
117
- };
118
- };
119
- exports.watchForMiddlewareChanges = watchForMiddlewareChanges;
@@ -1,192 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.generateCustomHeaders = exports.configureHandlerFunctions = exports.hasManuallyAddedModule = exports.resolveModuleRoot = exports.updateRequiredServerFiles = exports.getRequiredServerFiles = exports.getNextConfig = void 0;
7
- const destr_1 = __importDefault(require("destr"));
8
- const fs_extra_1 = require("fs-extra");
9
- const pathe_1 = require("pathe");
10
- const slash_1 = __importDefault(require("slash"));
11
- const constants_1 = require("../constants");
12
- const utils_1 = require("./utils");
13
- const ROUTES_MANIFEST_FILE = 'routes-manifest.json';
14
- const defaultFailBuild = (message, { error }) => {
15
- throw new Error(`${message}\n${error && error.stack}`);
16
- };
17
- const getNextConfig = async function getNextConfig({ publish, failBuild = defaultFailBuild, }) {
18
- try {
19
- const { config, appDir, ignore } = await (0, fs_extra_1.readJSON)((0, pathe_1.join)(publish, 'required-server-files.json'));
20
- if (!config) {
21
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
22
- // @ts-ignore
23
- return failBuild('Error loading your Next config');
24
- }
25
- const routesManifest = await (0, fs_extra_1.readJSON)((0, pathe_1.join)(publish, ROUTES_MANIFEST_FILE));
26
- // If you need access to other manifest files, you can add them here as well
27
- return { ...config, appDir, ignore, routesManifest };
28
- }
29
- catch (error) {
30
- return failBuild('Error loading your Next config', { error });
31
- }
32
- };
33
- exports.getNextConfig = getNextConfig;
34
- /**
35
- * Returns all of the NextJS configuration stored within 'required-server-files.json'
36
- * To update the configuration within this file, use the 'updateRequiredServerFiles' method.
37
- */
38
- const getRequiredServerFiles = async (publish) => {
39
- const configFile = (0, pathe_1.join)(publish, 'required-server-files.json');
40
- return await (0, fs_extra_1.readJSON)(configFile);
41
- };
42
- exports.getRequiredServerFiles = getRequiredServerFiles;
43
- /**
44
- * Writes a modified configuration object to 'required-server-files.json'.
45
- * To get the full configuration, use the 'getRequiredServerFiles' method.
46
- */
47
- const updateRequiredServerFiles = async (publish, modifiedConfig) => {
48
- const configFile = (0, pathe_1.join)(publish, 'required-server-files.json');
49
- await (0, fs_extra_1.writeJSON)(configFile, modifiedConfig);
50
- };
51
- exports.updateRequiredServerFiles = updateRequiredServerFiles;
52
- const resolveModuleRoot = (moduleName, paths = [process.cwd()]) => {
53
- try {
54
- return (0, pathe_1.dirname)((0, pathe_1.relative)(process.cwd(), require.resolve(`${moduleName}/package.json`, { paths })));
55
- }
56
- catch {
57
- return null;
58
- }
59
- };
60
- exports.resolveModuleRoot = resolveModuleRoot;
61
- const DEFAULT_EXCLUDED_MODULES = ['sharp', 'electron'];
62
- const hasManuallyAddedModule = ({ netlifyConfig, moduleName, }) =>
63
- /* eslint-disable camelcase */
64
- Object.values(netlifyConfig.functions).some(({ included_files = [] }) => included_files.some((inc) => inc.includes(`node_modules/${moduleName}`)));
65
- exports.hasManuallyAddedModule = hasManuallyAddedModule;
66
- /* eslint-enable camelcase */
67
- /**
68
- * Transforms `/api/shows/[id].js` into `/api/shows/*id*.js`,
69
- * so that the file `[id].js` is matched correctly.
70
- */
71
- const escapeGlob = (path) => path.replace(/\[/g, '*').replace(/]/g, '*');
72
- const configureHandlerFunctions = async ({ netlifyConfig, publish, ignore = [], apiLambdas, ssrLambdas, splitApiRoutes, }) => {
73
- var _a;
74
- const config = await (0, exports.getRequiredServerFiles)(publish);
75
- const files = config.files || [];
76
- const cssFilesToInclude = files.filter((f) => f.startsWith(`${publish}/static/css/`));
77
- if (!(0, destr_1.default)(process.env.DISABLE_IPX)) {
78
- (_a = netlifyConfig.functions)[constants_1.IMAGE_FUNCTION_NAME] || (_a[constants_1.IMAGE_FUNCTION_NAME] = {});
79
- netlifyConfig.functions[constants_1.IMAGE_FUNCTION_NAME].node_bundler = 'nft';
80
- }
81
- // If the user has manually added the module to included_files, then don't exclude it
82
- const excludedModules = DEFAULT_EXCLUDED_MODULES.filter((moduleName) => !(0, exports.hasManuallyAddedModule)({ netlifyConfig, moduleName }));
83
- const configureFunction = (functionName) => {
84
- var _a, _b;
85
- (_a = netlifyConfig.functions)[functionName] || (_a[functionName] = { included_files: [], external_node_modules: [] });
86
- netlifyConfig.functions[functionName].node_bundler = 'nft';
87
- (_b = netlifyConfig.functions[functionName]).included_files || (_b.included_files = []);
88
- netlifyConfig.functions[functionName].included_files.push('.env', '.env.local', '.env.production', '.env.production.local', './public/locales/**', './next-i18next.config.js', `${publish}/server/**`, `${publish}/serverless/**`, `${publish}/*.json`, `${publish}/BUILD_ID`, `${publish}/static/chunks/webpack-middleware*.js`, `!${publish}/server/**/*.js.nft.json`, `!${publish}/server/**/*.map`, '!**/node_modules/@next/swc*/**/*', ...cssFilesToInclude, ...ignore.map((path) => `!${(0, slash_1.default)(path)}`));
89
- const nextRoot = (0, exports.resolveModuleRoot)('next');
90
- if (nextRoot) {
91
- netlifyConfig.functions[functionName].included_files.push(`!${nextRoot}/dist/server/lib/squoosh/**/*.wasm`, `!${nextRoot}/dist/next-server/server/lib/squoosh/**/*.wasm`, `!${nextRoot}/dist/compiled/webpack/bundle4.js`, `!${nextRoot}/dist/compiled/webpack/bundle5.js`);
92
- // on Next 13.5+ there is no longer statically analyzable import to styled-jsx/style
93
- // so lambda fails to bundle it. Next require hooks actually try to resolve it
94
- // and fail if it is not bundled, so we forcefully add it to lambda.
95
- const styledJsxRoot = (0, exports.resolveModuleRoot)('styled-jsx', [(0, pathe_1.join)(process.cwd(), nextRoot)]);
96
- if (styledJsxRoot) {
97
- const styledJsxStyleModulePath = (0, pathe_1.join)(styledJsxRoot, 'style.js');
98
- netlifyConfig.functions[functionName].included_files.push(styledJsxStyleModulePath);
99
- }
100
- }
101
- excludedModules.forEach((moduleName) => {
102
- const moduleRoot = (0, exports.resolveModuleRoot)(moduleName);
103
- if (moduleRoot) {
104
- netlifyConfig.functions[functionName].included_files.push(`!${moduleRoot}/**/*`);
105
- }
106
- });
107
- };
108
- const configureLambda = (lambda) => {
109
- var _a, _b;
110
- const { functionName, includedFiles } = lambda;
111
- (_a = netlifyConfig.functions)[functionName] || (_a[functionName] = { included_files: [] });
112
- netlifyConfig.functions[functionName].node_bundler = 'none';
113
- (_b = netlifyConfig.functions[functionName]).included_files || (_b.included_files = []);
114
- netlifyConfig.functions[functionName].included_files.push(...includedFiles.map(escapeGlob));
115
- };
116
- if (ssrLambdas.length === 0) {
117
- configureFunction(constants_1.HANDLER_FUNCTION_NAME);
118
- configureFunction(constants_1.ODB_FUNCTION_NAME);
119
- }
120
- else {
121
- ssrLambdas.forEach(configureLambda);
122
- }
123
- if (splitApiRoutes) {
124
- apiLambdas.forEach(configureLambda);
125
- }
126
- else {
127
- configureFunction('_api_*');
128
- }
129
- };
130
- exports.configureHandlerFunctions = configureHandlerFunctions;
131
- const buildHeader = (buildHeaderParams) => {
132
- const { path, headers } = buildHeaderParams;
133
- return {
134
- for: path,
135
- values: headers.reduce((builtHeaders, { key, value }) => {
136
- builtHeaders[key] = value;
137
- return builtHeaders;
138
- }, {}),
139
- };
140
- };
141
- // Replace the pattern :path* at the end of a path with * since it's a named splat which the Netlify
142
- // configuration does not support.
143
- const sanitizePath = (path) => path.replace(/:[^*/]+\*$/, '*');
144
- /**
145
- * Persist Next.js custom headers to the Netlify configuration so the headers work with static files
146
- * See {@link https://nextjs.org/docs/api-reference/next.config.js/headers} for more information on custom
147
- * headers in Next.js
148
- *
149
- * @param nextConfig - The Next.js configuration
150
- * @param netlifyHeaders - Existing headers that are already configured in the Netlify configuration
151
- */
152
- const generateCustomHeaders = (nextConfig, netlifyHeaders = []) => {
153
- var _a;
154
- // The routesManifest is the contents of the routes-manifest.json file which will already contain the generated
155
- // header paths which take locales and base path into account since this runs after the build. The routes-manifest.json
156
- // file is located at demos/default/.next/routes-manifest.json once you've build the demo site.
157
- const { routesManifest: { headers: customHeaders = [] }, i18n, } = nextConfig;
158
- // Skip `has` based custom headers as they have more complex dynamic conditional header logic
159
- // that currently isn't supported by the Netlify configuration.
160
- // Also, this type of dynamic header logic is most likely not for SSG pages.
161
- for (const { source, headers, locale: localeEnabled } of customHeaders.filter((customHeader) => !customHeader.has)) {
162
- // Explicitly checking false to make the check simpler.
163
- // Locale specific paths are excluded only if localeEnabled is false. There is no true value for localeEnabled. It's either
164
- // false or undefined, where undefined means it's true.
165
- //
166
- // Again, the routesManifest has already been generated taking locales into account, but the check is required
167
- // so the paths can be properly set in the Netlify configuration.
168
- const useLocale = ((_a = i18n === null || i18n === void 0 ? void 0 : i18n.locales) === null || _a === void 0 ? void 0 : _a.length) > 0 && localeEnabled !== false;
169
- if (useLocale) {
170
- const { locales } = i18n;
171
- // escape the locale strings to match the way Next writes the routes-manifest.json file
172
- const joinedLocales = locales.map((locale) => (0, utils_1.escapeStringRegexp)(locale)).join('|');
173
- /**
174
- * converts e.g.
175
- * /:nextInternalLocale(en|fr)/some-path
176
- * to a path for each locale
177
- * /en/some-path and /fr/some-path as well as /some-path (default locale)
178
- */
179
- const defaultLocalePath = sanitizePath(source).replace(`/:nextInternalLocale(${joinedLocales})`, '');
180
- netlifyHeaders.push(buildHeader({ path: defaultLocalePath, headers }));
181
- for (const locale of locales) {
182
- const path = sanitizePath(source).replace(`:nextInternalLocale(${joinedLocales})`, locale);
183
- netlifyHeaders.push(buildHeader({ path, headers }));
184
- }
185
- }
186
- else {
187
- const path = sanitizePath(source);
188
- netlifyHeaders.push(buildHeader({ path, headers }));
189
- }
190
- }
191
- };
192
- exports.generateCustomHeaders = generateCustomHeaders;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.onPreDev = void 0;
7
- const path_1 = require("path");
8
- const execa_1 = __importDefault(require("execa"));
9
- const edge_1 = require("./edge");
10
- // The types haven't been updated yet
11
- const onPreDev = async ({ constants, netlifyConfig }) => {
12
- var _a;
13
- const base = (_a = netlifyConfig.build.base) !== null && _a !== void 0 ? _a : process.cwd();
14
- await (0, edge_1.writeDevEdgeFunction)(constants);
15
- // Don't await this or it will never finish
16
- execa_1.default.node((0, path_1.resolve)(__dirname, '..', '..', 'lib', 'helpers', 'middlewareWatcher.js'), [base, process.env.NODE_ENV === 'test' ? '--once' : ''], {
17
- stdio: 'inherit',
18
- });
19
- };
20
- exports.onPreDev = onPreDev;