@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.
- package/README.md +61 -17
- package/dist/build/cache.js +15 -0
- package/dist/build/content/prerendered.js +16 -0
- package/dist/build/content/server.js +18 -0
- package/dist/build/content/static.js +20 -0
- package/dist/build/functions/edge.js +14 -0
- package/dist/build/functions/server.js +16 -0
- package/dist/build/plugin-context.js +17 -0
- package/dist/esm-chunks/chunk-4AJYXTWN.js +17 -0
- package/dist/esm-chunks/chunk-62KDS27E.js +77 -0
- package/dist/esm-chunks/chunk-AVWFCGVE.js +5536 -0
- package/dist/esm-chunks/chunk-B6QMRLBH.js +255 -0
- package/dist/esm-chunks/chunk-G2VRYWGL.js +107 -0
- package/dist/esm-chunks/chunk-G3GM7JNF.js +92 -0
- package/dist/esm-chunks/chunk-GGHAQM5D.js +28 -0
- package/dist/esm-chunks/chunk-HPGTYMVD.js +113 -0
- package/dist/esm-chunks/chunk-PEBUKFKH.js +89 -0
- package/dist/esm-chunks/chunk-R4NHZWGU.js +32 -0
- package/dist/esm-chunks/chunk-RSKIKBZH.js +44 -0
- package/dist/esm-chunks/chunk-XD5TSLZO.js +85 -0
- package/dist/esm-chunks/chunk-ZBX3SNQG.js +561 -0
- package/dist/index.js +66 -0
- package/dist/run/config.js +18 -0
- package/dist/run/constants.js +15 -0
- package/dist/run/handlers/cache.cjs +849 -0
- package/dist/run/handlers/server.js +3289 -0
- package/dist/run/headers.js +19 -0
- package/dist/run/next.cjs +1055 -0
- package/dist/run/revalidate.js +13 -0
- package/edge-runtime/README.md +29 -0
- package/edge-runtime/lib/headers.ts +26 -0
- package/edge-runtime/lib/middleware.ts +60 -0
- package/edge-runtime/lib/next-request.ts +59 -0
- package/edge-runtime/lib/response.ts +145 -0
- package/edge-runtime/lib/util.ts +26 -0
- package/edge-runtime/middleware.ts +40 -0
- package/edge-runtime/shim/index.js +8 -0
- package/{src/templates → edge-runtime}/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/index.ts +1 -1
- package/edge-runtime/vendor/import_map.json +13 -0
- package/edge-runtime/vendor.ts +18 -0
- package/manifest.yml +1 -1
- package/package.json +23 -60
- package/index.js +0 -1
- package/lib/constants.js +0 -56
- package/lib/helpers/analysis.js +0 -115
- package/lib/helpers/cache.js +0 -46
- package/lib/helpers/compiler.js +0 -119
- package/lib/helpers/config.js +0 -192
- package/lib/helpers/dev.js +0 -20
- package/lib/helpers/edge.js +0 -328
- package/lib/helpers/files.js +0 -335
- package/lib/helpers/flags.js +0 -46
- package/lib/helpers/functions.js +0 -437
- package/lib/helpers/functionsMetaData.js +0 -46
- package/lib/helpers/matchers.js +0 -41
- package/lib/helpers/middlewareWatcher.js +0 -12
- package/lib/helpers/pack.js +0 -41
- package/lib/helpers/redirects.js +0 -246
- package/lib/helpers/types.js +0 -2
- package/lib/helpers/utils.js +0 -226
- package/lib/helpers/verification.js +0 -182
- package/lib/index.js +0 -194
- package/lib/templates/blobStorage.js +0 -30
- package/lib/templates/getApiHandler.js +0 -120
- package/lib/templates/getHandler.js +0 -201
- package/lib/templates/getPageResolver.js +0 -54
- package/lib/templates/handlerUtils.js +0 -268
- package/lib/templates/ipx.js +0 -13
- package/lib/templates/requireHooks.js +0 -105
- package/lib/templates/server.js +0 -159
- package/lib/templates/vendor.js +0 -20
- package/src/templates/edge/bundle.js +0 -8
- package/src/templates/edge/function-runtime.ts +0 -24
- package/src/templates/edge/imageconfig.json +0 -3
- package/src/templates/edge/ipx.ts +0 -5
- package/src/templates/edge/matchers.json +0 -1
- package/src/templates/edge/middleware-runtime.ts +0 -62
- package/src/templates/edge/next-dev.js +0 -104
- package/src/templates/edge/rsc-data.ts +0 -5
- package/src/templates/edge/shims.js +0 -77
- package/src/templates/edge-shared/next-utils.ts +0 -407
- package/src/templates/edge-shared/nextConfig.json +0 -3
- package/src/templates/edge-shared/prerender-manifest.json +0 -7
- package/src/templates/edge-shared/rsc-data.ts +0 -78
- package/src/templates/edge-shared/utils.test.ts +0 -114
- package/src/templates/edge-shared/utils.ts +0 -315
- package/src/templates/vendor/import_map.json +0 -13
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.134.0/fmt/colors.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.134.0/testing/_diff.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.134.0/testing/asserts.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/_util/asserts.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/_util/os.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/abortable.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/deadline.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/debounce.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/deferred.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/delay.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/mod.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/mux_async_iterator.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/pool.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/retry.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/async/tee.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/bytes/index_of_needle.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/crypto/timing_safe_equal.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/datetime/to_imf.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/encoding/base64.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/encoding/base64url.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/flags/mod.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/fmt/colors.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/fmt/printf.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/http/cookie.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_core.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_events.d.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_events.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_global.d.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_next_tick.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_process/exiting.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_process/process.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_process/stdio.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_process/streams.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_stream.d.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_stream.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_util/_util_callbackify.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/_utils.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/assert.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/assertion_error.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/async_hooks.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/buffer.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/events.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/buffer.d.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/buffer.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/crypto/_keys.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/crypto/constants.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/error_codes.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/errors.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/fixed_queue.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/hide_stack_frames.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/net.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/normalize_encoding.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/options.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/primordials.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/process/per_thread.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/readline/callbacks.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/readline/utils.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/streams/destroy.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/streams/end-of-stream.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/streams/utils.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/util/comparisons.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/util/debuglog.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/util/inspect.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/util/types.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/util.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal/validators.mjs +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_libuv_winerror.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_listen.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_node.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_timingSafeEqual.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_utils.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/_winerror.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/ares.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/async_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/buffer.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/cares_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/config.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/connection_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/constants.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/contextify.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/credentials.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/crypto.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/errors.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/fs.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/fs_dir.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/fs_event_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/handle_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/heap_utils.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/http_parser.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/icu.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/inspector.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/js_stream.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/messaging.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/mod.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/module_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/native_module.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/natives.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/node_file.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/node_options.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/options.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/os.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/performance.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/pipe_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/process_methods.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/report.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/serdes.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/signal_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/spawn_sync.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/stream_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/string_decoder.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/symbols.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/task_queue.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/tcp_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/timers.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/tls_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/trace_events.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/tty_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/types.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/udp_wrap.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/url.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/util.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/uv.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/v8.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/worker.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/internal_binding/zlib.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/process.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/stream.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/string_decoder.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/util/types.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/node/util.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/_constants.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/_interface.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/_util.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/common.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/glob.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/mod.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/posix.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/separator.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/path/win32.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/streams/write_all.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/testing/_diff.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/testing/_format.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/testing/asserts.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/std@0.175.0/types.d.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/asyncify.js +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.d.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.js +0 -0
- /package/{src/templates → edge-runtime}/vendor/deno.land/x/path_to_regexp@v6.2.1/index.ts +0 -0
- /package/{src/templates → edge-runtime}/vendor/esm.sh/v91/next@12.2.5/deno/dist/compiled/cookie.js +0 -0
- /package/{src/templates → edge-runtime}/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/request.js +0 -0
- /package/{src/templates → edge-runtime}/vendor/esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/response.js +0 -0
- /package/{src/templates → edge-runtime}/vendor/raw.githubusercontent.com/worker-tools/resolvable-promise/master/index.ts +0 -0
package/lib/helpers/edge.js
DELETED
|
@@ -1,328 +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.writeEdgeFunctions = exports.getEdgeFunctionPatternForPage = exports.generateRscDataEdgeManifest = exports.writeDevEdgeFunction = exports.cleanupEdgeFunctions = exports.sanitizeEdgePath = exports.loadPrerenderManifest = exports.loadAppPathRoutesManifest = exports.loadMiddlewareManifest = exports.isAppDirRoute = void 0;
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const path_1 = require("path");
|
|
9
|
-
const chalk_1 = require("chalk");
|
|
10
|
-
const destr_1 = __importDefault(require("destr"));
|
|
11
|
-
const fs_extra_1 = require("fs-extra");
|
|
12
|
-
const outdent_1 = require("outdent");
|
|
13
|
-
const constants_1 = require("../constants");
|
|
14
|
-
const config_1 = require("./config");
|
|
15
|
-
const functionsMetaData_1 = require("./functionsMetaData");
|
|
16
|
-
const matchers_1 = require("./matchers");
|
|
17
|
-
const maybeLoadJson = (path) => {
|
|
18
|
-
if ((0, fs_1.existsSync)(path)) {
|
|
19
|
-
return (0, fs_extra_1.readJSON)(path);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const isAppDirRoute = (route, appPathRoutesManifest) => Boolean(appPathRoutesManifest) && Object.values(appPathRoutesManifest).includes(route);
|
|
23
|
-
exports.isAppDirRoute = isAppDirRoute;
|
|
24
|
-
const loadMiddlewareManifest = (netlifyConfig) => maybeLoadJson((0, path_1.resolve)(netlifyConfig.build.publish, 'server', 'middleware-manifest.json'));
|
|
25
|
-
exports.loadMiddlewareManifest = loadMiddlewareManifest;
|
|
26
|
-
const loadAppPathRoutesManifest = (netlifyConfig) => maybeLoadJson((0, path_1.resolve)(netlifyConfig.build.publish, 'app-path-routes-manifest.json'));
|
|
27
|
-
exports.loadAppPathRoutesManifest = loadAppPathRoutesManifest;
|
|
28
|
-
const loadPrerenderManifest = (netlifyConfig) => (0, fs_extra_1.readJSON)((0, path_1.resolve)(netlifyConfig.build.publish, 'prerender-manifest.json'));
|
|
29
|
-
exports.loadPrerenderManifest = loadPrerenderManifest;
|
|
30
|
-
/**
|
|
31
|
-
* Convert the Next middleware name into a valid Edge Function name
|
|
32
|
-
*/
|
|
33
|
-
const sanitizeName = (name) => `next_${name.replace(/\W/g, '_')}`;
|
|
34
|
-
/**
|
|
35
|
-
* Convert the images path to strip the origin (until domain-level Edge functions are supported)
|
|
36
|
-
*/
|
|
37
|
-
const sanitizeEdgePath = (imagesPath) => new URL(imagesPath, process.env.URL || 'http://n').pathname;
|
|
38
|
-
exports.sanitizeEdgePath = sanitizeEdgePath;
|
|
39
|
-
// Slightly different spacing in different versions!
|
|
40
|
-
const IMPORT_UNSUPPORTED = [
|
|
41
|
-
`Object.defineProperty(globalThis,"__import_unsupported"`,
|
|
42
|
-
` Object.defineProperty(globalThis, "__import_unsupported"`,
|
|
43
|
-
];
|
|
44
|
-
/**
|
|
45
|
-
* Concatenates the Next edge function code with the required chunks and adds an export
|
|
46
|
-
*/
|
|
47
|
-
const getMiddlewareBundle = async ({ edgeFunctionDefinition, netlifyConfig, }) => {
|
|
48
|
-
const { publish } = netlifyConfig.build;
|
|
49
|
-
const shims = await fs_1.promises.readFile(getEdgeTemplatePath('shims.js'), 'utf8');
|
|
50
|
-
const chunks = [shims];
|
|
51
|
-
chunks.push(`export const _DEFINITION = ${JSON.stringify(edgeFunctionDefinition)}`);
|
|
52
|
-
if ('wasm' in edgeFunctionDefinition) {
|
|
53
|
-
for (const { name, filePath } of edgeFunctionDefinition.wasm) {
|
|
54
|
-
const wasm = await fs_1.promises.readFile((0, path_1.join)(publish, filePath));
|
|
55
|
-
chunks.push(`const ${name} = _base64Decode(${JSON.stringify(wasm.toString('base64'))}).buffer`);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
if ('assets' in edgeFunctionDefinition) {
|
|
59
|
-
chunks.push(`const _ASSETS = {}`);
|
|
60
|
-
for (const { name, filePath } of edgeFunctionDefinition.assets) {
|
|
61
|
-
const wasm = await fs_1.promises.readFile((0, path_1.join)(publish, filePath));
|
|
62
|
-
chunks.push(`_ASSETS[${JSON.stringify(name)}] = ${JSON.stringify(wasm.toString('base64'))}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
for (const file of edgeFunctionDefinition.files) {
|
|
66
|
-
const filePath = (0, path_1.join)(publish, file);
|
|
67
|
-
let data = await fs_1.promises.readFile(filePath, 'utf8');
|
|
68
|
-
// Next defines an immutable global variable, which is fine unless you have more than one in the bundle
|
|
69
|
-
// This adds a check to see if the global is already defined
|
|
70
|
-
data = IMPORT_UNSUPPORTED.reduce((acc, val) => acc.replace(val, `('__import_unsupported' in globalThis)||${val}`), data);
|
|
71
|
-
chunks.push('{', data, '}');
|
|
72
|
-
}
|
|
73
|
-
const exports = /* js */ `export default _ENTRIES["middleware_${edgeFunctionDefinition.name}"].default;`;
|
|
74
|
-
chunks.push(exports);
|
|
75
|
-
return chunks.join('\n');
|
|
76
|
-
};
|
|
77
|
-
const getEdgeTemplatePath = (file) => (0, path_1.join)(__dirname, '..', '..', 'src', 'templates', 'edge', file);
|
|
78
|
-
const copyEdgeSourceFile = ({ file, target, edgeFunctionDir, }) => fs_1.promises.copyFile(getEdgeTemplatePath(file), (0, path_1.join)(edgeFunctionDir, target !== null && target !== void 0 ? target : file));
|
|
79
|
-
const writeEdgeFunction = async ({ edgeFunctionDefinition, edgeFunctionRoot, netlifyConfig, functionName, matchers = [], middleware = false, }) => {
|
|
80
|
-
const edgeFunctionDir = (0, path_1.join)(edgeFunctionRoot, functionName);
|
|
81
|
-
const bundle = await getMiddlewareBundle({
|
|
82
|
-
edgeFunctionDefinition,
|
|
83
|
-
netlifyConfig,
|
|
84
|
-
});
|
|
85
|
-
await (0, fs_extra_1.ensureDir)(edgeFunctionDir);
|
|
86
|
-
await fs_1.promises.writeFile((0, path_1.join)(edgeFunctionDir, 'bundle.js'), bundle);
|
|
87
|
-
await copyEdgeSourceFile({
|
|
88
|
-
edgeFunctionDir,
|
|
89
|
-
file: middleware ? 'middleware-runtime.ts' : 'function-runtime.ts',
|
|
90
|
-
target: 'index.ts',
|
|
91
|
-
});
|
|
92
|
-
if (middleware) {
|
|
93
|
-
// Functions don't have complex matchers, so we can rely on the Netlify matcher
|
|
94
|
-
await (0, fs_extra_1.writeJson)((0, path_1.join)(edgeFunctionDir, 'matchers.json'), matchers);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const generateEdgeFunctionMiddlewareMatchers = ({ edgeFunctionDefinition, nextConfig, }) => {
|
|
98
|
-
// The v1 middleware manifest has a single regexp, but the v2 has an array of matchers
|
|
99
|
-
if ('regexp' in edgeFunctionDefinition) {
|
|
100
|
-
return [{ regexp: edgeFunctionDefinition.regexp }];
|
|
101
|
-
}
|
|
102
|
-
if (nextConfig.i18n) {
|
|
103
|
-
return edgeFunctionDefinition.matchers.map((matcher) => ({
|
|
104
|
-
...matcher,
|
|
105
|
-
regexp: (0, matchers_1.makeLocaleOptional)(matcher.regexp),
|
|
106
|
-
}));
|
|
107
|
-
}
|
|
108
|
-
return edgeFunctionDefinition.matchers;
|
|
109
|
-
};
|
|
110
|
-
const middlewareMatcherToEdgeFunctionDefinition = (matcher, name, generator, cache) => {
|
|
111
|
-
const pattern = (0, matchers_1.transformCaptureGroups)((0, matchers_1.stripLookahead)(matcher.regexp));
|
|
112
|
-
return { function: name, pattern, name, cache, generator };
|
|
113
|
-
};
|
|
114
|
-
const cleanupEdgeFunctions = ({ INTERNAL_EDGE_FUNCTIONS_SRC = '.netlify/edge-functions', }) => (0, fs_extra_1.emptyDir)(INTERNAL_EDGE_FUNCTIONS_SRC);
|
|
115
|
-
exports.cleanupEdgeFunctions = cleanupEdgeFunctions;
|
|
116
|
-
const writeDevEdgeFunction = async ({ INTERNAL_EDGE_FUNCTIONS_SRC = '.netlify/edge-functions', }) => {
|
|
117
|
-
const generator = await (0, functionsMetaData_1.getPluginVersion)();
|
|
118
|
-
const manifest = {
|
|
119
|
-
functions: [
|
|
120
|
-
{
|
|
121
|
-
function: 'next-dev',
|
|
122
|
-
name: 'netlify dev handler',
|
|
123
|
-
path: '/*',
|
|
124
|
-
generator,
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
version: 1,
|
|
128
|
-
import_map: 'vendor/import_map.json',
|
|
129
|
-
};
|
|
130
|
-
const edgeFunctionRoot = (0, path_1.resolve)(INTERNAL_EDGE_FUNCTIONS_SRC);
|
|
131
|
-
await (0, fs_extra_1.emptyDir)(edgeFunctionRoot);
|
|
132
|
-
await (0, fs_extra_1.writeJson)((0, path_1.join)(edgeFunctionRoot, 'manifest.json'), manifest);
|
|
133
|
-
await (0, fs_extra_1.copy)(getEdgeTemplatePath('../vendor'), (0, path_1.join)(edgeFunctionRoot, 'vendor'));
|
|
134
|
-
await (0, fs_extra_1.copy)(getEdgeTemplatePath('../edge-shared'), (0, path_1.join)(edgeFunctionRoot, 'edge-shared'));
|
|
135
|
-
const edgeFunctionDir = (0, path_1.join)(edgeFunctionRoot, 'next-dev');
|
|
136
|
-
await (0, fs_extra_1.ensureDir)(edgeFunctionDir);
|
|
137
|
-
await copyEdgeSourceFile({ edgeFunctionDir, file: 'next-dev.js', target: 'index.js' });
|
|
138
|
-
};
|
|
139
|
-
exports.writeDevEdgeFunction = writeDevEdgeFunction;
|
|
140
|
-
/**
|
|
141
|
-
* Writes an edge function that routes RSC data requests to the `.rsc` route
|
|
142
|
-
*/
|
|
143
|
-
const generateRscDataEdgeManifest = async ({ prerenderManifest, appPathRoutesManifest, packagePath = '', }) => {
|
|
144
|
-
const generator = await (0, functionsMetaData_1.getPluginVersion)();
|
|
145
|
-
if (!prerenderManifest || !appPathRoutesManifest) {
|
|
146
|
-
return [];
|
|
147
|
-
}
|
|
148
|
-
const staticAppdirRoutes = [];
|
|
149
|
-
for (const [path, route] of Object.entries(prerenderManifest.routes)) {
|
|
150
|
-
if ((0, exports.isAppDirRoute)(route.srcRoute, appPathRoutesManifest) && route.dataRoute) {
|
|
151
|
-
staticAppdirRoutes.push(path, route.dataRoute);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
const dynamicAppDirRoutes = [];
|
|
155
|
-
for (const [path, route] of Object.entries(prerenderManifest.dynamicRoutes)) {
|
|
156
|
-
if ((0, exports.isAppDirRoute)(path, appPathRoutesManifest) && route.dataRouteRegex) {
|
|
157
|
-
dynamicAppDirRoutes.push(route.routeRegex, route.dataRouteRegex);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
if (staticAppdirRoutes.length === 0 && dynamicAppDirRoutes.length === 0) {
|
|
161
|
-
return [];
|
|
162
|
-
}
|
|
163
|
-
const edgeFunctionDir = (0, path_1.resolve)(packagePath, '.netlify', 'edge-functions', 'rsc-data');
|
|
164
|
-
await (0, fs_extra_1.ensureDir)(edgeFunctionDir);
|
|
165
|
-
await copyEdgeSourceFile({ edgeFunctionDir, file: 'rsc-data.ts' });
|
|
166
|
-
return [
|
|
167
|
-
...staticAppdirRoutes.map((path) => ({
|
|
168
|
-
function: 'rsc-data',
|
|
169
|
-
name: 'RSC data routing',
|
|
170
|
-
path,
|
|
171
|
-
generator,
|
|
172
|
-
})),
|
|
173
|
-
...dynamicAppDirRoutes.map((pattern) => ({
|
|
174
|
-
function: 'rsc-data',
|
|
175
|
-
name: 'RSC data routing',
|
|
176
|
-
pattern,
|
|
177
|
-
generator,
|
|
178
|
-
})),
|
|
179
|
-
];
|
|
180
|
-
};
|
|
181
|
-
exports.generateRscDataEdgeManifest = generateRscDataEdgeManifest;
|
|
182
|
-
const getEdgeFunctionPatternForPage = ({ edgeFunctionDefinition, pageRegexMap, appPathRoutesManifest, }) => {
|
|
183
|
-
// We don't just use the matcher from the edge function definition, because it doesn't handle trailing slashes
|
|
184
|
-
var _a, _b;
|
|
185
|
-
// appDir functions have a name that _isn't_ the route name, but rather the route with `/page` appended
|
|
186
|
-
const regexp = pageRegexMap.get((_a = appPathRoutesManifest === null || appPathRoutesManifest === void 0 ? void 0 : appPathRoutesManifest[edgeFunctionDefinition.page]) !== null && _a !== void 0 ? _a : edgeFunctionDefinition.page);
|
|
187
|
-
if (regexp) {
|
|
188
|
-
return regexp;
|
|
189
|
-
}
|
|
190
|
-
if ('regexp' in edgeFunctionDefinition) {
|
|
191
|
-
return edgeFunctionDefinition.regexp.replace(/([^/])\$$/, '$1/?$');
|
|
192
|
-
}
|
|
193
|
-
// If we need to fall back to the matcher, we need to add an optional trailing slash
|
|
194
|
-
return (_b = edgeFunctionDefinition.matchers) === null || _b === void 0 ? void 0 : _b[0].regexp.replace(/([^/])\$$/, '$1/?$');
|
|
195
|
-
};
|
|
196
|
-
exports.getEdgeFunctionPatternForPage = getEdgeFunctionPatternForPage;
|
|
197
|
-
/**
|
|
198
|
-
* Writes Edge Functions for the Next middleware
|
|
199
|
-
*/
|
|
200
|
-
// eslint-disable-next-line max-lines-per-function
|
|
201
|
-
const writeEdgeFunctions = async ({ netlifyConfig, routesManifest, constants: { PACKAGE_PATH = '' }, }) => {
|
|
202
|
-
const generator = await (0, functionsMetaData_1.getPluginVersion)();
|
|
203
|
-
const manifest = {
|
|
204
|
-
functions: [],
|
|
205
|
-
layers: [],
|
|
206
|
-
version: 1,
|
|
207
|
-
};
|
|
208
|
-
const edgeFunctionRoot = (0, path_1.resolve)(PACKAGE_PATH, '.netlify', 'edge-functions');
|
|
209
|
-
await (0, fs_extra_1.emptyDir)(edgeFunctionRoot);
|
|
210
|
-
const { publish } = netlifyConfig.build;
|
|
211
|
-
const nextConfigFile = await (0, config_1.getRequiredServerFiles)(publish);
|
|
212
|
-
const nextConfig = nextConfigFile.config;
|
|
213
|
-
await (0, fs_extra_1.copy)(getEdgeTemplatePath('../vendor'), (0, path_1.join)(edgeFunctionRoot, 'vendor'));
|
|
214
|
-
await (0, fs_extra_1.copy)(getEdgeTemplatePath('../edge-shared'), (0, path_1.join)(edgeFunctionRoot, 'edge-shared'));
|
|
215
|
-
await (0, fs_extra_1.writeJSON)((0, path_1.join)(edgeFunctionRoot, 'edge-shared', 'nextConfig.json'), nextConfig);
|
|
216
|
-
await (0, fs_extra_1.copy)((0, path_1.join)(publish, 'prerender-manifest.json'), (0, path_1.join)(edgeFunctionRoot, 'edge-shared', 'prerender-manifest.json'));
|
|
217
|
-
// early return if edge is disabled
|
|
218
|
-
if ((0, destr_1.default)(process.env.NEXT_DISABLE_NETLIFY_EDGE)) {
|
|
219
|
-
console.log('Environment variable NEXT_DISABLE_NETLIFY_EDGE has been set, skipping Netlify Edge Function creation.');
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
const rscFunctions = await (0, exports.generateRscDataEdgeManifest)({
|
|
223
|
-
packagePath: PACKAGE_PATH,
|
|
224
|
-
prerenderManifest: await (0, exports.loadPrerenderManifest)(netlifyConfig),
|
|
225
|
-
appPathRoutesManifest: await (0, exports.loadAppPathRoutesManifest)(netlifyConfig),
|
|
226
|
-
});
|
|
227
|
-
manifest.functions.push(...rscFunctions);
|
|
228
|
-
const middlewareManifest = await (0, exports.loadMiddlewareManifest)(netlifyConfig);
|
|
229
|
-
if (!middlewareManifest) {
|
|
230
|
-
console.error("Couldn't find the middleware manifest");
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
let usesEdge = false;
|
|
234
|
-
for (const middleware of middlewareManifest.sortedMiddleware) {
|
|
235
|
-
usesEdge = true;
|
|
236
|
-
const edgeFunctionDefinition = middlewareManifest.middleware[middleware];
|
|
237
|
-
const functionName = sanitizeName(edgeFunctionDefinition.name);
|
|
238
|
-
const matchers = generateEdgeFunctionMiddlewareMatchers({
|
|
239
|
-
edgeFunctionDefinition,
|
|
240
|
-
edgeFunctionRoot,
|
|
241
|
-
nextConfig,
|
|
242
|
-
});
|
|
243
|
-
await writeEdgeFunction({
|
|
244
|
-
edgeFunctionDefinition,
|
|
245
|
-
edgeFunctionRoot,
|
|
246
|
-
netlifyConfig,
|
|
247
|
-
functionName,
|
|
248
|
-
matchers,
|
|
249
|
-
middleware: true,
|
|
250
|
-
});
|
|
251
|
-
manifest.functions.push(...matchers.map((matcher) => middlewareMatcherToEdgeFunctionDefinition(matcher, functionName, generator)));
|
|
252
|
-
}
|
|
253
|
-
// Functions (i.e. not middleware, but edge SSR and API routes)
|
|
254
|
-
if (typeof middlewareManifest.functions === 'object') {
|
|
255
|
-
// When using the app dir, we also need to check if the EF matches a page
|
|
256
|
-
const appPathRoutesManifest = await (0, exports.loadAppPathRoutesManifest)(netlifyConfig);
|
|
257
|
-
// A map of all route pages to their page regex. This is used for pages dir and appDir.
|
|
258
|
-
const pageRegexMap = new Map([...(routesManifest.dynamicRoutes || []), ...(routesManifest.staticRoutes || [])].map((route) => [
|
|
259
|
-
route.page,
|
|
260
|
-
route.regex,
|
|
261
|
-
]));
|
|
262
|
-
// Create a map of pages-dir routes to their data route regex (appDir uses the same route as the HTML)
|
|
263
|
-
const dataRoutesMap = new Map([...(routesManifest.dataRoutes || [])].map((route) => [route.page, route.dataRouteRegex]));
|
|
264
|
-
for (const edgeFunctionDefinition of Object.values(middlewareManifest.functions)) {
|
|
265
|
-
usesEdge = true;
|
|
266
|
-
const functionName = sanitizeName(edgeFunctionDefinition.name);
|
|
267
|
-
await writeEdgeFunction({
|
|
268
|
-
edgeFunctionDefinition,
|
|
269
|
-
edgeFunctionRoot,
|
|
270
|
-
netlifyConfig,
|
|
271
|
-
functionName,
|
|
272
|
-
});
|
|
273
|
-
const pattern = (0, exports.getEdgeFunctionPatternForPage)({
|
|
274
|
-
edgeFunctionDefinition,
|
|
275
|
-
pageRegexMap,
|
|
276
|
-
appPathRoutesManifest,
|
|
277
|
-
});
|
|
278
|
-
manifest.functions.push({
|
|
279
|
-
function: functionName,
|
|
280
|
-
name: edgeFunctionDefinition.name,
|
|
281
|
-
pattern,
|
|
282
|
-
cache: 'manual',
|
|
283
|
-
generator,
|
|
284
|
-
});
|
|
285
|
-
// pages-dir page routes also have a data route. If there's a match, add an entry mapping that to the function too
|
|
286
|
-
const dataRoute = dataRoutesMap.get(edgeFunctionDefinition.page);
|
|
287
|
-
if (dataRoute) {
|
|
288
|
-
manifest.functions.push({
|
|
289
|
-
function: functionName,
|
|
290
|
-
name: edgeFunctionDefinition.name,
|
|
291
|
-
pattern: dataRoute,
|
|
292
|
-
cache: 'manual',
|
|
293
|
-
generator,
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
if ((0, destr_1.default)(process.env.NEXT_FORCE_EDGE_IMAGES) &&
|
|
299
|
-
!(0, destr_1.default)(process.env.NEXT_DISABLE_EDGE_IMAGES) &&
|
|
300
|
-
!(0, destr_1.default)(process.env.DISABLE_IPX)) {
|
|
301
|
-
usesEdge = true;
|
|
302
|
-
console.log('Using Netlify Edge Functions for image format detection. Set env var "NEXT_DISABLE_EDGE_IMAGES=true" to disable.');
|
|
303
|
-
const edgeFunctionDir = (0, path_1.join)(edgeFunctionRoot, 'ipx');
|
|
304
|
-
await (0, fs_extra_1.ensureDir)(edgeFunctionDir);
|
|
305
|
-
await copyEdgeSourceFile({ edgeFunctionDir, file: 'ipx.ts', target: 'index.ts' });
|
|
306
|
-
await (0, fs_extra_1.copyFile)((0, path_1.join)('.netlify', 'functions-internal', constants_1.IMAGE_FUNCTION_NAME, 'imageconfig.json'), (0, path_1.join)(edgeFunctionDir, 'imageconfig.json'));
|
|
307
|
-
manifest.functions.push({
|
|
308
|
-
function: 'ipx',
|
|
309
|
-
name: 'next/image handler',
|
|
310
|
-
path: nextConfig.images.path ? (0, exports.sanitizeEdgePath)(nextConfig.images.path) : '/_next/image',
|
|
311
|
-
generator,
|
|
312
|
-
});
|
|
313
|
-
manifest.layers.push({
|
|
314
|
-
name: 'https://ipx-edge-function-layer.netlify.app/mod.ts',
|
|
315
|
-
flag: 'ipx-edge-function-layer-url',
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
console.log('You are not using Netlify Edge Functions for image format detection. Set env var "NEXT_FORCE_EDGE_IMAGES=true" to enable.');
|
|
320
|
-
}
|
|
321
|
-
if (usesEdge) {
|
|
322
|
-
console.log((0, outdent_1.outdent) `
|
|
323
|
-
✨ Deploying middleware and functions to ${(0, chalk_1.greenBright) `Netlify Edge Functions`} ✨
|
|
324
|
-
`);
|
|
325
|
-
}
|
|
326
|
-
await (0, fs_extra_1.writeJson)((0, path_1.join)(edgeFunctionRoot, 'manifest.json'), manifest);
|
|
327
|
-
};
|
|
328
|
-
exports.writeEdgeFunctions = writeEdgeFunctions;
|
package/lib/helpers/files.js
DELETED
|
@@ -1,335 +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.removeMetadataFiles = exports.movePublicFiles = exports.getDependenciesOfFile = exports.getSourceFileForPage = exports.getServerFile = exports.moveStaticPages = exports.getMiddleware = exports.matchesRewrite = exports.matchesRedirect = exports.matchMiddleware = exports.stripLocale = exports.isDynamicRoute = void 0;
|
|
7
|
-
const os_1 = require("os");
|
|
8
|
-
const chalk_1 = require("chalk");
|
|
9
|
-
const fs_extra_1 = require("fs-extra");
|
|
10
|
-
const globby_1 = __importDefault(require("globby"));
|
|
11
|
-
const outdent_1 = require("outdent");
|
|
12
|
-
const p_limit_1 = __importDefault(require("p-limit"));
|
|
13
|
-
const pathe_1 = require("pathe");
|
|
14
|
-
const slash_1 = __importDefault(require("slash"));
|
|
15
|
-
const constants_1 = require("../constants");
|
|
16
|
-
const blobStorage_1 = require("../templates/blobStorage");
|
|
17
|
-
const edge_1 = require("./edge");
|
|
18
|
-
const utils_1 = require("./utils");
|
|
19
|
-
const TEST_ROUTE = /(|\/)\[[^/]+?](\/|\.html|$)/;
|
|
20
|
-
const isDynamicRoute = (route) => TEST_ROUTE.test(route);
|
|
21
|
-
exports.isDynamicRoute = isDynamicRoute;
|
|
22
|
-
const stripLocale = (rawPath, locales = []) => {
|
|
23
|
-
const [locale, ...segments] = rawPath.split('/');
|
|
24
|
-
if (locales.includes(locale)) {
|
|
25
|
-
return segments.join('/');
|
|
26
|
-
}
|
|
27
|
-
return rawPath;
|
|
28
|
-
};
|
|
29
|
-
exports.stripLocale = stripLocale;
|
|
30
|
-
const matchMiddleware = (middleware, filePath) => (middleware === null || middleware === void 0 ? void 0 : middleware.includes('')) ||
|
|
31
|
-
(middleware === null || middleware === void 0 ? void 0 : middleware.find((middlewarePath) => filePath === middlewarePath || filePath === `${middlewarePath}.html` || filePath.startsWith(`${middlewarePath}/`)));
|
|
32
|
-
exports.matchMiddleware = matchMiddleware;
|
|
33
|
-
const matchesRedirect = (file, redirects) => {
|
|
34
|
-
if (!Array.isArray(redirects)) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return redirects.some((redirect) => {
|
|
38
|
-
if (!redirect.regex || redirect.internal) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
// Strips the extension from the file path
|
|
42
|
-
return new RegExp(redirect.regex).test(`/${file.slice(0, -5)}`);
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
exports.matchesRedirect = matchesRedirect;
|
|
46
|
-
const matchesRewrite = (file, rewrites) => {
|
|
47
|
-
if (Array.isArray(rewrites)) {
|
|
48
|
-
return (0, exports.matchesRedirect)(file, rewrites);
|
|
49
|
-
}
|
|
50
|
-
if (!Array.isArray(rewrites === null || rewrites === void 0 ? void 0 : rewrites.beforeFiles)) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
return (0, exports.matchesRedirect)(file, rewrites.beforeFiles);
|
|
54
|
-
};
|
|
55
|
-
exports.matchesRewrite = matchesRewrite;
|
|
56
|
-
const getMiddleware = async (publish) => {
|
|
57
|
-
var _a;
|
|
58
|
-
if (process.env.NEXT_DISABLE_NETLIFY_EDGE !== 'true' && process.env.NEXT_DISABLE_NETLIFY_EDGE !== '1') {
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
61
|
-
const manifestPath = (0, pathe_1.join)(publish, 'server', 'middleware-manifest.json');
|
|
62
|
-
if ((0, fs_extra_1.existsSync)(manifestPath)) {
|
|
63
|
-
const manifest = await (0, fs_extra_1.readJson)(manifestPath, { throws: false });
|
|
64
|
-
return (_a = manifest === null || manifest === void 0 ? void 0 : manifest.sortedMiddleware) !== null && _a !== void 0 ? _a : [];
|
|
65
|
-
}
|
|
66
|
-
return [];
|
|
67
|
-
};
|
|
68
|
-
exports.getMiddleware = getMiddleware;
|
|
69
|
-
// eslint-disable-next-line max-lines-per-function
|
|
70
|
-
const moveStaticPages = async ({ netlifyConfig, target, nextConfig, netliBlob, }) => {
|
|
71
|
-
const { i18n, basePath } = nextConfig;
|
|
72
|
-
console.log('Moving static page files to serve from CDN...');
|
|
73
|
-
const outputDir = (0, pathe_1.join)(netlifyConfig.build.publish, target === 'serverless' ? 'serverless' : 'server');
|
|
74
|
-
const buildId = (0, fs_extra_1.readFileSync)((0, pathe_1.join)(netlifyConfig.build.publish, 'BUILD_ID'), 'utf8').trim();
|
|
75
|
-
const dataDir = (0, pathe_1.join)('_next', 'data', buildId);
|
|
76
|
-
await (0, fs_extra_1.ensureDir)((0, pathe_1.join)(netlifyConfig.build.publish, dataDir));
|
|
77
|
-
// Load the middleware manifest so we can check if a file matches it before moving
|
|
78
|
-
const middlewarePaths = await (0, exports.getMiddleware)(netlifyConfig.build.publish);
|
|
79
|
-
const middleware = middlewarePaths.map((path) => path.slice(1));
|
|
80
|
-
const prerenderManifest = await (0, edge_1.loadPrerenderManifest)(netlifyConfig);
|
|
81
|
-
const { redirects, rewrites } = await (0, fs_extra_1.readJson)((0, pathe_1.join)(netlifyConfig.build.publish, 'routes-manifest.json'));
|
|
82
|
-
const isrFiles = new Set();
|
|
83
|
-
const shortRevalidateRoutes = [];
|
|
84
|
-
Object.entries(prerenderManifest.routes).forEach(([route, ssgRoute]) => {
|
|
85
|
-
const { initialRevalidateSeconds } = ssgRoute;
|
|
86
|
-
const trimmedPath = route === '/' ? 'index' : route.slice(1);
|
|
87
|
-
if (initialRevalidateSeconds) {
|
|
88
|
-
// Find all files used by ISR routes
|
|
89
|
-
isrFiles.add(`${trimmedPath}.html`);
|
|
90
|
-
isrFiles.add(`${trimmedPath}.json`);
|
|
91
|
-
isrFiles.add(`${trimmedPath}.rsc`);
|
|
92
|
-
if (initialRevalidateSeconds < constants_1.MINIMUM_REVALIDATE_SECONDS) {
|
|
93
|
-
shortRevalidateRoutes.push({ Route: route, Revalidate: initialRevalidateSeconds });
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
let fileCount = 0;
|
|
98
|
-
let blobCount = 0;
|
|
99
|
-
const filesManifest = {};
|
|
100
|
-
const blobsManifest = new Set();
|
|
101
|
-
const getSourceAndTargetPath = (file) => {
|
|
102
|
-
const source = (0, pathe_1.join)(outputDir, file);
|
|
103
|
-
// Strip the initial 'app' or 'pages' directory from the output path
|
|
104
|
-
const pathname = file.split('/').slice(1).join('/');
|
|
105
|
-
// .rsc data files go next to the html file
|
|
106
|
-
const isData = file.endsWith('.json');
|
|
107
|
-
const targetFile = isData ? (0, pathe_1.join)(dataDir, pathname) : pathname;
|
|
108
|
-
const targetPath = basePath ? (0, pathe_1.join)(basePath, targetFile) : targetFile;
|
|
109
|
-
return {
|
|
110
|
-
targetPath,
|
|
111
|
-
source,
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
const moveFile = async (file) => {
|
|
115
|
-
const { source, targetPath } = getSourceAndTargetPath(file);
|
|
116
|
-
fileCount += 1;
|
|
117
|
-
filesManifest[file] = targetPath;
|
|
118
|
-
const dest = (0, pathe_1.join)(netlifyConfig.build.publish, targetPath);
|
|
119
|
-
try {
|
|
120
|
-
await (0, fs_extra_1.move)(source, dest);
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
console.warn('Error moving file', source, error);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
const uploadFileToBlobStorageAndDelete = async (file) => {
|
|
127
|
-
const { source } = getSourceAndTargetPath(file);
|
|
128
|
-
blobsManifest.add(file);
|
|
129
|
-
const content = await (0, fs_extra_1.readFile)(source, 'utf8');
|
|
130
|
-
blobCount += 1;
|
|
131
|
-
await netliBlob.set((0, blobStorage_1.getNormalizedBlobKey)(file), content);
|
|
132
|
-
await (0, fs_extra_1.remove)(source);
|
|
133
|
-
};
|
|
134
|
-
// Move all static files, except nft manifests
|
|
135
|
-
const pages = await (0, globby_1.default)(['{app,pages}/**/*.{html,json,rsc}', '!**/*.js.nft.{html,json}'], {
|
|
136
|
-
cwd: outputDir,
|
|
137
|
-
dot: true,
|
|
138
|
-
});
|
|
139
|
-
const matchingMiddleware = new Set();
|
|
140
|
-
const matchedPages = new Set();
|
|
141
|
-
const matchedRedirects = new Set();
|
|
142
|
-
const matchedRewrites = new Set();
|
|
143
|
-
// Limit concurrent file moves to number of cpus or 2 if there is only 1
|
|
144
|
-
const limit = (0, p_limit_1.default)(Math.max(2, (0, os_1.cpus)().length));
|
|
145
|
-
const promises = pages.map((rawPath) => {
|
|
146
|
-
// Convert to POSIX path
|
|
147
|
-
const filePath = (0, slash_1.default)(rawPath);
|
|
148
|
-
// Remove the initial 'app' or 'pages' directory from the output path
|
|
149
|
-
const pagePath = filePath.split('/').slice(1).join('/');
|
|
150
|
-
if (isrFiles.has(pagePath)) {
|
|
151
|
-
if (netliBlob) {
|
|
152
|
-
// if netliblob is enabled, we will move ISR assets to blob store and delete files after that
|
|
153
|
-
// to minimize the number of files needed in lambda
|
|
154
|
-
return limit(uploadFileToBlobStorageAndDelete, filePath);
|
|
155
|
-
}
|
|
156
|
-
// Don't move ISR files, as they're used for the first request
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
if ((0, exports.isDynamicRoute)(pagePath)) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
if ((0, exports.matchesRedirect)(pagePath, redirects)) {
|
|
163
|
-
matchedRedirects.add(pagePath);
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
if ((0, exports.matchesRewrite)(pagePath, rewrites)) {
|
|
167
|
-
matchedRewrites.add(pagePath);
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
// Middleware matches against the unlocalised path
|
|
171
|
-
const unlocalizedPath = (0, exports.stripLocale)(pagePath, i18n === null || i18n === void 0 ? void 0 : i18n.locales);
|
|
172
|
-
const middlewarePath = (0, exports.matchMiddleware)(middleware, unlocalizedPath);
|
|
173
|
-
// If a file matches middleware it can't be offloaded to the CDN, and needs to stay at the origin to be served by next/server
|
|
174
|
-
if (middlewarePath) {
|
|
175
|
-
matchingMiddleware.add(middlewarePath);
|
|
176
|
-
matchedPages.add(filePath);
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
return limit(moveFile, filePath);
|
|
180
|
-
});
|
|
181
|
-
await Promise.all(promises);
|
|
182
|
-
console.log(`Moved ${fileCount} files to CDN`);
|
|
183
|
-
if (netliBlob) {
|
|
184
|
-
console.log(`Moved ${blobCount} files to Blob Storage`);
|
|
185
|
-
}
|
|
186
|
-
if (matchedPages.size !== 0) {
|
|
187
|
-
console.log((0, chalk_1.yellowBright)((0, outdent_1.outdent) `
|
|
188
|
-
Skipped moving ${matchedPages.size} ${matchedPages.size === 1 ? 'file because it matches' : 'files because they match'} middleware, so cannot be deployed to the CDN and will be served from the origin instead.
|
|
189
|
-
This is fine, but we're letting you know because it may not be what you expect.
|
|
190
|
-
`));
|
|
191
|
-
console.log((0, outdent_1.outdent) `
|
|
192
|
-
The following middleware matched statically-rendered pages:
|
|
193
|
-
|
|
194
|
-
${(0, chalk_1.yellowBright)([...matchingMiddleware].map((mid) => `- /${mid}/_middleware`).join('\n'))}
|
|
195
|
-
${constants_1.DIVIDER}
|
|
196
|
-
`);
|
|
197
|
-
// There could potentially be thousands of matching pages, so we don't want to spam the console with this
|
|
198
|
-
if (matchedPages.size < 50) {
|
|
199
|
-
console.log((0, outdent_1.outdent) `
|
|
200
|
-
The following files matched middleware and were not moved to the CDN:
|
|
201
|
-
|
|
202
|
-
${(0, chalk_1.yellowBright)([...matchedPages].map((mid) => `- ${mid}`).join('\n'))}
|
|
203
|
-
${constants_1.DIVIDER}
|
|
204
|
-
`);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
if (matchedRedirects.size !== 0 || matchedRewrites.size !== 0) {
|
|
208
|
-
console.log((0, chalk_1.yellowBright)((0, outdent_1.outdent) `
|
|
209
|
-
Skipped moving ${matchedRedirects.size + matchedRewrites.size} files because they match redirects or beforeFiles rewrites, so cannot be deployed to the CDN and will be served from the origin instead.
|
|
210
|
-
`));
|
|
211
|
-
if (matchedRedirects.size < 50 && matchedRedirects.size !== 0) {
|
|
212
|
-
console.log((0, outdent_1.outdent) `
|
|
213
|
-
The following files matched redirects and were not moved to the CDN:
|
|
214
|
-
|
|
215
|
-
${(0, chalk_1.yellowBright)([...matchedRedirects].map((mid) => `- ${mid}`).join('\n'))}
|
|
216
|
-
${constants_1.DIVIDER}
|
|
217
|
-
`);
|
|
218
|
-
}
|
|
219
|
-
if (matchedRewrites.size < 50 && matchedRewrites.size !== 0) {
|
|
220
|
-
console.log((0, outdent_1.outdent) `
|
|
221
|
-
The following files matched beforeFiles rewrites and were not moved to the CDN:
|
|
222
|
-
|
|
223
|
-
${(0, chalk_1.yellowBright)([...matchedRewrites].map((mid) => `- ${mid}`).join('\n'))}
|
|
224
|
-
${constants_1.DIVIDER}
|
|
225
|
-
`);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
// Write the manifests for use in the serverless functions
|
|
229
|
-
await (0, fs_extra_1.writeJson)((0, pathe_1.join)(netlifyConfig.build.publish, 'static-manifest.json'), Object.entries(filesManifest));
|
|
230
|
-
await (0, fs_extra_1.writeJson)((0, pathe_1.join)(netlifyConfig.build.publish, 'blobs-manifest.json'), [...blobsManifest]);
|
|
231
|
-
if (i18n === null || i18n === void 0 ? void 0 : i18n.defaultLocale) {
|
|
232
|
-
const rootPath = basePath ? (0, pathe_1.join)(netlifyConfig.build.publish, basePath) : netlifyConfig.build.publish;
|
|
233
|
-
// Copy the default locale into the root
|
|
234
|
-
const defaultLocaleDir = (0, pathe_1.join)(rootPath, i18n.defaultLocale);
|
|
235
|
-
if ((0, fs_extra_1.existsSync)(defaultLocaleDir)) {
|
|
236
|
-
await (0, fs_extra_1.copy)(defaultLocaleDir, `${rootPath}/`);
|
|
237
|
-
}
|
|
238
|
-
const defaultLocaleIndex = (0, pathe_1.join)(rootPath, `${i18n.defaultLocale}.html`);
|
|
239
|
-
const indexHtml = (0, pathe_1.join)(rootPath, 'index.html');
|
|
240
|
-
if ((0, fs_extra_1.existsSync)(defaultLocaleIndex) && !(0, fs_extra_1.existsSync)(indexHtml)) {
|
|
241
|
-
await (0, fs_extra_1.copy)(defaultLocaleIndex, indexHtml, { overwrite: false }).catch(() => {
|
|
242
|
-
/* ignore */
|
|
243
|
-
});
|
|
244
|
-
await (0, fs_extra_1.copy)((0, pathe_1.join)(rootPath, `${i18n.defaultLocale}.json`), (0, pathe_1.join)(rootPath, 'index.json'), {
|
|
245
|
-
overwrite: false,
|
|
246
|
-
}).catch(() => {
|
|
247
|
-
/* ignore */
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
if (shortRevalidateRoutes.length !== 0) {
|
|
252
|
-
console.log((0, outdent_1.outdent) `
|
|
253
|
-
The following routes use "revalidate" values of under ${constants_1.MINIMUM_REVALIDATE_SECONDS} seconds, which is not supported.
|
|
254
|
-
They will use a revalidate time of ${constants_1.MINIMUM_REVALIDATE_SECONDS} seconds instead.
|
|
255
|
-
`);
|
|
256
|
-
console.table(shortRevalidateRoutes);
|
|
257
|
-
// TODO: add these docs
|
|
258
|
-
// console.log(
|
|
259
|
-
// outdent`
|
|
260
|
-
// For more information, see https://ntl.fyi/next-revalidate-time
|
|
261
|
-
// ${DIVIDER}
|
|
262
|
-
// `,
|
|
263
|
-
// )
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
exports.moveStaticPages = moveStaticPages;
|
|
267
|
-
/**
|
|
268
|
-
* The file we need has moved around a bit over the past few versions,
|
|
269
|
-
* so we iterate through the options until we find it
|
|
270
|
-
*/
|
|
271
|
-
const getServerFile = (root, includeBase = true) => {
|
|
272
|
-
const candidates = ['next/dist/server/next-server', 'next/dist/next-server/server/next-server'];
|
|
273
|
-
if (includeBase) {
|
|
274
|
-
candidates.unshift('next/dist/server/base-server');
|
|
275
|
-
}
|
|
276
|
-
return (0, utils_1.findModuleFromBase)({ candidates, paths: [root] });
|
|
277
|
-
};
|
|
278
|
-
exports.getServerFile = getServerFile;
|
|
279
|
-
// Next.js already defines a default `pageExtensions` array in its `required-server-files.json` file
|
|
280
|
-
// In case it gets `undefined`, this is a fallback
|
|
281
|
-
const SOURCE_FILE_EXTENSIONS = ['js', 'jsx', 'ts', 'tsx'];
|
|
282
|
-
/**
|
|
283
|
-
* Find the source file for a given page route
|
|
284
|
-
*/
|
|
285
|
-
const getSourceFileForPage = (page, roots, pageExtensions = SOURCE_FILE_EXTENSIONS) => {
|
|
286
|
-
for (const root of roots) {
|
|
287
|
-
for (const extension of pageExtensions) {
|
|
288
|
-
const file = (0, pathe_1.join)(root, `${page}.${extension}`);
|
|
289
|
-
if ((0, fs_extra_1.existsSync)(file)) {
|
|
290
|
-
return file;
|
|
291
|
-
}
|
|
292
|
-
const fileAtFolderIndex = (0, pathe_1.join)(root, page, `index.${extension}`);
|
|
293
|
-
if ((0, fs_extra_1.existsSync)(fileAtFolderIndex)) {
|
|
294
|
-
return fileAtFolderIndex;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
console.log('Could not find source file for page', page);
|
|
299
|
-
};
|
|
300
|
-
exports.getSourceFileForPage = getSourceFileForPage;
|
|
301
|
-
/**
|
|
302
|
-
* Reads the node file trace file for a given file, and resolves the dependencies
|
|
303
|
-
*/
|
|
304
|
-
const getDependenciesOfFile = async (file) => {
|
|
305
|
-
const nft = `${file}.nft.json`;
|
|
306
|
-
if (!(0, fs_extra_1.existsSync)(nft)) {
|
|
307
|
-
return [];
|
|
308
|
-
}
|
|
309
|
-
const dependencies = (await (0, fs_extra_1.readJson)(nft, 'utf8'));
|
|
310
|
-
return dependencies.files.map((dep) => (0, pathe_1.resolve)((0, pathe_1.dirname)(file), dep));
|
|
311
|
-
};
|
|
312
|
-
exports.getDependenciesOfFile = getDependenciesOfFile;
|
|
313
|
-
const movePublicFiles = async ({ appDir, outdir, publish, basePath, }) => {
|
|
314
|
-
// `outdir` is a config property added when using Next.js with Nx. It's typically
|
|
315
|
-
// a relative path outside of the appDir, e.g. '../../dist/apps/<app-name>', and
|
|
316
|
-
// the parent directory of the .next directory.
|
|
317
|
-
// If it exists, copy the files from the public folder there in order to include
|
|
318
|
-
// any files that were generated during the build. Otherwise, copy the public
|
|
319
|
-
// directory from the original app directory.
|
|
320
|
-
const publicDir = outdir ? (0, pathe_1.join)(appDir, outdir, 'public') : (0, pathe_1.join)(appDir, 'public');
|
|
321
|
-
if ((0, fs_extra_1.existsSync)(publicDir)) {
|
|
322
|
-
await (0, fs_extra_1.copy)(publicDir, `${publish}${basePath}/`);
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
exports.movePublicFiles = movePublicFiles;
|
|
326
|
-
const removeMetadataFiles = async (publish) => {
|
|
327
|
-
// Limit concurrent deletions to number of cpus or 2 if there is only 1
|
|
328
|
-
const limit = (0, p_limit_1.default)(Math.max(2, (0, os_1.cpus)().length));
|
|
329
|
-
const removePromises = constants_1.HIDDEN_PATHS.map((HIDDEN_PATH) => {
|
|
330
|
-
const pathToDelete = (0, pathe_1.join)(publish, HIDDEN_PATH);
|
|
331
|
-
return limit(() => (0, fs_extra_1.remove)(pathToDelete));
|
|
332
|
-
});
|
|
333
|
-
await Promise.all(removePromises);
|
|
334
|
-
};
|
|
335
|
-
exports.removeMetadataFiles = removeMetadataFiles;
|