vinext 1.3.0 → 1.4.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 +5 -2
- package/THIRD_PARTY_LICENSES.md +47 -0
- package/dist/_virtual/_rolldown/runtime.js +4 -3
- package/dist/build/action-owner-manifest.d.ts +3 -2
- package/dist/build/action-owner-manifest.js +18 -2
- package/dist/build/app-page-static-eligibility.d.ts +17 -1
- package/dist/build/app-page-static-eligibility.js +80 -13
- package/dist/build/clean-output.d.ts +2 -1
- package/dist/build/client-build-config.d.ts +13 -3
- package/dist/build/client-build-config.js +46 -9
- package/dist/build/client-reference-async.d.ts +48 -0
- package/dist/build/client-reference-async.js +123 -0
- package/dist/build/client-reference-chunks.d.ts +32 -0
- package/dist/build/client-reference-chunks.js +111 -0
- package/dist/build/client-reference-groups.d.ts +9 -1
- package/dist/build/client-reference-groups.js +40 -2
- package/dist/build/css-url-assets.d.ts +2 -1
- package/dist/build/google-fonts/fallback-metrics.d.ts +2 -1
- package/dist/build/google-fonts/find-font-files-in-css.d.ts +1 -0
- package/dist/build/google-fonts/find-font-files-in-css.js +17 -4
- package/dist/build/google-fonts/font-metadata.d.ts +2 -1
- package/dist/build/google-fonts/validate.d.ts +2 -1
- package/dist/build/inline-css.d.ts +2 -1
- package/dist/build/module-dependency-cache.d.ts +2 -1
- package/dist/build/next-client-runtime-manifests.d.ts +2 -1
- package/dist/build/precompress.d.ts +2 -1
- package/dist/build/precompress.js +1 -1
- package/dist/build/prerender-paths.d.ts +2 -1
- package/dist/build/prerender-phase.d.ts +2 -1
- package/dist/build/prerender-server-pool.js +1 -1
- package/dist/build/prerender.d.ts +3 -2
- package/dist/build/prerender.js +6 -5
- package/dist/build/report.d.ts +2 -15
- package/dist/build/report.js +1 -51
- package/dist/build/run-prerender.d.ts +2 -1
- package/dist/build/server-actions-encryption-key.d.ts +2 -1
- package/dist/build/ssr-manifest.js +25 -2
- package/dist/build/standalone.d.ts +2 -1
- package/dist/cache/cache-adapters-virtual.d.ts +2 -1
- package/dist/cache.js +1 -2
- package/dist/check.d.ts +2 -1
- package/dist/check.js +5 -1
- package/dist/cli-args.d.ts +2 -1
- package/dist/cli.js +5 -0
- package/dist/client/client-redirect-matcher.js +2 -1
- package/dist/client/client-redirects.d.ts +4 -3
- package/dist/client/client-redirects.js +2 -1
- package/dist/client/client-rewrites.d.ts +2 -1
- package/dist/client/dev-error-overlay-store.d.ts +2 -1
- package/dist/client/dev-error-overlay.js +1 -1
- package/dist/client/index.js +1 -2
- package/dist/client/instrumentation-client-state.js +5 -5
- package/dist/client/navigation-runtime.d.ts +16 -2
- package/dist/client/navigation-runtime.js +2 -2
- package/dist/client/pages-router-link-navigation.d.ts +2 -1
- package/dist/client/vinext-next-data.d.ts +25 -1
- package/dist/client/window-next.d.ts +2 -1
- package/dist/config/config-matchers.d.ts +12 -1
- package/dist/config/config-matchers.js +111 -16
- package/dist/config/dotenv.d.ts +2 -1
- package/dist/config/next-config.d.ts +32 -1
- package/dist/config/next-config.js +93 -5
- package/dist/config/tsconfig-paths.d.ts +2 -1
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/dbcs-codec.js +327 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/dbcs-data.js +123 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/index.js +29 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/internal.js +134 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-codec.js +50 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-data-generated.js +455 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/sbcs-data.js +147 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/big5-added.json.js +169 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp936.json.js +2584 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp949.json.js +2220 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/cp950.json.js +227 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/eucjp.json.js +425 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/gb18030-ranges.json.js +427 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/gbk-added.json.js +229 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/tables/shiftjis.json.js +292 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/utf16.js +106 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/encodings/utf7.js +182 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/bom-handling.js +42 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/extend-node.js +147 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/index.js +94 -0
- package/dist/deps/.pnpm/iconv-lite@0.4.24/deps/iconv-lite/lib/streams.js +95 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/detector.js +23 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/index.js +2 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/lookup.js +25 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/bmp.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/cur.js +15 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/dds.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/gif.js +12 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/heif.js +55 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/icns.js +76 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ico.js +39 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/index.js +46 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/j2c.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jp2.js +21 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jpg.js +71 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl-stream.js +42 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl.js +46 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ktx.js +19 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/png.js +28 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/pnm.js +54 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/psd.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/svg.js +79 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tga.js +15 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tiff.js +96 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/utils.js +53 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/webp.js +45 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/utils/bit-reader.js +38 -0
- package/dist/deps/.pnpm/safer-buffer@2.1.2/deps/safer-buffer/safer.js +45 -0
- package/dist/deps/.pnpm/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +2 -2
- package/dist/entries/app-browser-entry.d.ts +20 -5
- package/dist/entries/app-browser-entry.js +79 -6
- package/dist/entries/app-rsc-entry.d.ts +2 -1
- package/dist/entries/app-rsc-entry.js +59 -60
- package/dist/entries/app-rsc-manifest.d.ts +2 -1
- package/dist/entries/app-rsc-manifest.js +56 -4
- package/dist/entries/app-ssr-entry.js +1 -0
- package/dist/entries/pages-entry-helpers.js +1 -2
- package/dist/entries/pages-server-entry.d.ts +2 -1
- package/dist/entries/pages-server-entry.js +34 -9
- package/dist/entries/runtime-entry-module.d.ts +1 -0
- package/dist/entries/runtime-entry-module.js +4 -1
- package/dist/image/image-adapters-virtual.d.ts +2 -1
- package/dist/index.js +184 -103
- package/dist/init-cloudflare.d.ts +1 -3
- package/dist/init-cloudflare.js +10 -48
- package/dist/init-platform.d.ts +2 -0
- package/dist/init-platform.js +4 -0
- package/dist/plugins/client-compile-hints.d.ts +30 -0
- package/dist/plugins/client-compile-hints.js +88 -0
- package/dist/plugins/client-reference-dedup.d.ts +2 -1
- package/dist/plugins/cloudflare-dev-module-urls.d.ts +2 -1
- package/dist/plugins/dynamic-preload-metadata.d.ts +3 -1
- package/dist/plugins/dynamic-preload-metadata.js +1 -1
- package/dist/plugins/environment.d.ts +2 -1
- package/dist/plugins/extensionless-dynamic-import.js +6 -2
- package/dist/plugins/fonts.js +9 -12
- package/dist/plugins/ignore-dynamic-requests.d.ts +2 -1
- package/dist/plugins/import-meta-url.d.ts +2 -1
- package/dist/plugins/next-intl-catalog.d.ts +12 -0
- package/dist/plugins/next-intl-catalog.js +85 -0
- package/dist/plugins/og-assets.d.ts +2 -1
- package/dist/plugins/og-assets.js +2 -3
- package/dist/plugins/optimize-imports.d.ts +2 -1
- package/dist/plugins/pages-node-externals.d.ts +3 -1
- package/dist/plugins/pages-node-externals.js +1 -1
- package/dist/plugins/remove-console.d.ts +2 -1
- package/dist/plugins/require-condition-resolution.d.ts +2 -1
- package/dist/plugins/rsc-client-reference-loaders.d.ts +8 -0
- package/dist/plugins/rsc-client-reference-loaders.js +170 -68
- package/dist/plugins/rsc-client-shim-excludes.js +2 -0
- package/dist/plugins/sass.d.ts +2 -1
- package/dist/plugins/strip-server-exports.d.ts +2 -1
- package/dist/plugins/styled-jsx.d.ts +2 -1
- package/dist/plugins/transform-result.d.ts +2 -1
- package/dist/plugins/typeof-window.d.ts +2 -1
- package/dist/plugins/use-cache-callable.d.ts +1 -1
- package/dist/plugins/use-cache-callable.js +136 -94
- package/dist/plugins/worker-image-imports.js +1 -1
- package/dist/plugins/worker-use-server.d.ts +2 -1
- package/dist/routing/app-route-graph.d.ts +46 -0
- package/dist/routing/app-route-graph.js +131 -51
- package/dist/routing/browser-route-manifest.d.ts +2 -1
- package/dist/routing/optimistic-route-trie.d.ts +2 -1
- package/dist/routing/route-matching.d.ts +2 -1
- package/dist/routing/route-pattern.d.ts +2 -1
- package/dist/server/accept-encoding.d.ts +2 -1
- package/dist/server/api-handler.js +19 -4
- package/dist/server/app-action-forwarding.d.ts +2 -1
- package/dist/server/app-bfcache-identity.d.ts +2 -1
- package/dist/server/app-bfcache-identity.js +1 -1
- package/dist/server/app-browser-action-result.d.ts +2 -1
- package/dist/server/app-browser-entry.js +106 -66
- package/dist/server/app-browser-error.d.ts +2 -1
- package/dist/server/app-browser-history-controller.d.ts +7 -5
- package/dist/server/app-browser-history-controller.js +93 -15
- package/dist/server/app-browser-hydration.d.ts +2 -1
- package/dist/server/app-browser-interception-context.d.ts +2 -1
- package/dist/server/app-browser-navigation-controller.d.ts +2 -2
- package/dist/server/app-browser-navigation-controller.js +16 -12
- package/dist/server/app-browser-popstate.d.ts +2 -1
- package/dist/server/app-browser-rsc-redirect.d.ts +2 -1
- package/dist/server/app-browser-rsc-redirect.js +4 -4
- package/dist/server/app-browser-server-action-client.d.ts +4 -1
- package/dist/server/app-browser-server-action-client.js +4 -3
- package/dist/server/app-browser-state.d.ts +2 -4
- package/dist/server/app-browser-state.js +9 -4
- package/dist/server/app-browser-stream.d.ts +2 -1
- package/dist/server/app-browser-supplemental-refresh.js +16 -1
- package/dist/server/app-browser-visible-commit.d.ts +3 -2
- package/dist/server/app-browser-visible-commit.js +2 -12
- package/dist/server/app-client-reference-manifest.d.ts +31 -0
- package/dist/server/app-client-reference-manifest.js +46 -0
- package/dist/server/app-client-reference-preloader.d.ts +25 -5
- package/dist/server/app-client-reference-preloader.js +22 -7
- package/dist/server/app-elements-wire.d.ts +8 -39
- package/dist/server/app-elements-wire.js +4 -41
- package/dist/server/app-elements.d.ts +4 -2
- package/dist/server/app-elements.js +4 -2
- package/dist/server/app-fallback-renderer.d.ts +9 -2
- package/dist/server/app-fallback-renderer.js +4 -1
- package/dist/server/app-history-state.d.ts +4 -3
- package/dist/server/app-history-state.js +5 -2
- package/dist/server/app-inline-css-client.d.ts +2 -1
- package/dist/server/app-metadata-tracing.d.ts +2 -1
- package/dist/server/app-mounted-layouts.d.ts +21 -0
- package/dist/server/app-mounted-layouts.js +67 -0
- package/dist/server/app-optimistic-routing.d.ts +37 -2
- package/dist/server/app-optimistic-routing.js +75 -2
- package/dist/server/app-page-boundary-render.d.ts +20 -2
- package/dist/server/app-page-boundary-render.js +224 -40
- package/dist/server/app-page-boundary.d.ts +34 -5
- package/dist/server/app-page-boundary.js +41 -8
- package/dist/server/app-page-cache-finalizer.d.ts +14 -2
- package/dist/server/app-page-cache-finalizer.js +71 -30
- package/dist/server/app-page-cache-render.d.ts +10 -2
- package/dist/server/app-page-cache-render.js +14 -2
- package/dist/server/app-page-cache.d.ts +13 -1
- package/dist/server/app-page-cache.js +33 -11
- package/dist/server/app-page-dispatch.d.ts +39 -11
- package/dist/server/app-page-dispatch.js +236 -177
- package/dist/server/app-page-element-builder.d.ts +19 -3
- package/dist/server/app-page-element-builder.js +193 -71
- package/dist/server/app-page-execution.d.ts +43 -51
- package/dist/server/app-page-execution.js +205 -92
- package/dist/server/app-page-head.d.ts +108 -3
- package/dist/server/app-page-head.js +337 -154
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +49 -2
- package/dist/server/app-page-http-access-fallback-metadata.js +77 -2
- package/dist/server/app-page-layout-gate.d.ts +35 -0
- package/dist/server/app-page-layout-gate.js +50 -0
- package/dist/server/app-page-method.d.ts +2 -1
- package/dist/server/app-page-params.d.ts +0 -1
- package/dist/server/app-page-params.js +1 -14
- package/dist/server/app-page-probe.d.ts +5 -22
- package/dist/server/app-page-probe.js +4 -37
- package/dist/server/app-page-render-identity.d.ts +2 -1
- package/dist/server/app-page-render.d.ts +9 -13
- package/dist/server/app-page-render.js +108 -214
- package/dist/server/app-page-request.d.ts +15 -4
- package/dist/server/app-page-request.js +2 -2
- package/dist/server/app-page-response.js +3 -3
- package/dist/server/app-page-route-wiring.d.ts +65 -8
- package/dist/server/app-page-route-wiring.js +259 -103
- package/dist/server/app-page-rsc-render-status.d.ts +29 -2
- package/dist/server/app-page-rsc-render-status.js +121 -13
- package/dist/server/app-page-search-params-observation.d.ts +7 -2
- package/dist/server/app-page-search-params-observation.js +8 -1
- package/dist/server/app-page-segment-plan.d.ts +2 -1
- package/dist/server/app-page-stream.d.ts +33 -1
- package/dist/server/app-page-stream.js +25 -6
- package/dist/server/app-pages-bridge.d.ts +6 -1
- package/dist/server/app-pages-bridge.js +7 -3
- package/dist/server/app-ppr-fallback-shell-render.d.ts +2 -1
- package/dist/server/app-ppr-fallback-shell.d.ts +2 -1
- package/dist/server/app-prerender-endpoints.d.ts +2 -1
- package/dist/server/app-prerender-static-params.d.ts +2 -1
- package/dist/server/app-render-dependency.d.ts +21 -4
- package/dist/server/app-render-dependency.js +100 -33
- package/dist/server/app-request-stage-dispatch.js +1 -1
- package/dist/server/app-request-stage-independent-entry.d.ts +2 -1
- package/dist/server/app-response-stage-entry.d.ts +2 -1
- package/dist/server/app-route-handler-cache.d.ts +2 -1
- package/dist/server/app-route-handler-cache.js +2 -2
- package/dist/server/app-route-handler-dispatch.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.js +15 -10
- package/dist/server/app-route-handler-execution.d.ts +2 -1
- package/dist/server/app-route-handler-execution.js +8 -3
- package/dist/server/app-route-handler-policy.d.ts +1 -1
- package/dist/server/app-route-handler-policy.js +3 -3
- package/dist/server/app-route-handler-response.d.ts +2 -1
- package/dist/server/app-route-handler-response.js +1 -1
- package/dist/server/app-route-handler-runtime.d.ts +2 -1
- package/dist/server/app-route-handler-runtime.js +17 -4
- package/dist/server/app-route-module-loader.d.ts +18 -1
- package/dist/server/app-route-module-loader.js +8 -0
- package/dist/server/app-route-tree-prefetch.d.ts +2 -1
- package/dist/server/app-rsc-cache-busting.d.ts +2 -2
- package/dist/server/app-rsc-cache-busting.js +4 -4
- package/dist/server/app-rsc-error-handler.d.ts +4 -2
- package/dist/server/app-rsc-error-handler.js +9 -1
- package/dist/server/app-rsc-errors.d.ts +10 -1
- package/dist/server/app-rsc-errors.js +8 -1
- package/dist/server/app-rsc-handler.d.ts +7 -6
- package/dist/server/app-rsc-handler.js +36 -34
- package/dist/server/app-rsc-request-normalization.d.ts +0 -4
- package/dist/server/app-rsc-request-normalization.js +1 -4
- package/dist/server/app-rsc-response-finalizer.d.ts +2 -1
- package/dist/server/app-rsc-response-finalizer.js +2 -2
- package/dist/server/app-rsc-response-stage.js +5 -3
- package/dist/server/app-rsc-route-matching.d.ts +38 -1
- package/dist/server/app-rsc-route-matching.js +24 -0
- package/dist/server/app-segment-config.d.ts +2 -1
- package/dist/server/app-segment-config.js +1 -14
- package/dist/server/app-server-action-execution.d.ts +5 -2
- package/dist/server/app-server-action-execution.js +10 -7
- package/dist/server/app-ssr-entry.d.ts +8 -0
- package/dist/server/app-ssr-entry.js +98 -50
- package/dist/server/app-ssr-error-meta.d.ts +2 -1
- package/dist/server/app-ssr-search-params-gate.d.ts +2 -1
- package/dist/server/app-ssr-stream.d.ts +22 -10
- package/dist/server/app-ssr-stream.js +300 -68
- package/dist/server/app-static-generation.d.ts +2 -1
- package/dist/server/app-streamed-client-references.d.ts +39 -0
- package/dist/server/app-streamed-client-references.js +156 -0
- package/dist/server/app-visited-response-cache.d.ts +38 -2
- package/dist/server/app-visited-response-cache.js +46 -5
- package/dist/server/app-worker-stages.d.ts +27 -4
- package/dist/server/app-worker-stages.js +45 -6
- package/dist/server/artifact-compatibility.d.ts +2 -2
- package/dist/server/artifact-compatibility.js +1 -10
- package/dist/server/bfcache-identity.d.ts +2 -1
- package/dist/server/cache-headers.d.ts +2 -1
- package/dist/server/cache-proof.d.ts +1 -115
- package/dist/server/cache-proof.js +1 -544
- package/dist/server/cacheability-request.d.ts +2 -1
- package/dist/server/cacheability-request.js +13 -8
- package/dist/server/config-headers.d.ts +2 -1
- package/dist/server/csp.d.ts +2 -1
- package/dist/server/default-global-not-found-module.d.ts +2 -1
- package/dist/server/default-http-access-fallback-modules.d.ts +33 -0
- package/dist/server/default-http-access-fallback-modules.js +31 -0
- package/dist/server/defer-until-stream-consumed.d.ts +34 -0
- package/dist/server/defer-until-stream-consumed.js +154 -21
- package/dist/server/dev-lockfile.d.ts +32 -2
- package/dist/server/dev-lockfile.js +46 -2
- package/dist/server/dev-module-runner.d.ts +2 -1
- package/dist/server/dev-server.js +14 -6
- package/dist/server/fetch-handler.js +1 -2
- package/dist/server/file-based-metadata.d.ts +2 -1
- package/dist/server/framework-tracer.d.ts +2 -1
- package/dist/server/headers.d.ts +6 -3
- package/dist/server/headers.js +9 -5
- package/dist/server/html.d.ts +1 -0
- package/dist/server/html.js +19 -1
- package/dist/server/http-conditional.d.ts +2 -1
- package/dist/server/http-error-responses.d.ts +2 -1
- package/dist/server/implicit-tags.d.ts +2 -1
- package/dist/server/isr-cache.d.ts +8 -2
- package/dist/server/isr-cache.js +26 -1
- package/dist/server/metadata-route-build-data.d.ts +2 -1
- package/dist/server/metadata-route-build-data.js +1 -1
- package/dist/server/metadata-route-response.d.ts +2 -1
- package/dist/server/metadata-route-response.js +32 -15
- package/dist/server/metadata-routes.d.ts +2 -1
- package/dist/server/middleware-runtime.d.ts +2 -1
- package/dist/server/multi-stage.d.ts +52 -11
- package/dist/server/multi-stage.js +13 -1
- package/dist/server/navigation-planner.js +1 -1
- package/dist/server/navigation-trace.d.ts +2 -1
- package/dist/server/next-error-digest.d.ts +2 -1
- package/dist/server/nitro-public-files-plugin.d.ts +2 -1
- package/dist/server/nitro-public-files.d.ts +2 -1
- package/dist/server/opentelemetry-api.d.ts +2 -1
- package/dist/server/operation-token.d.ts +2 -1
- package/dist/server/pages-api-route.d.ts +2 -1
- package/dist/server/pages-api-route.js +28 -19
- package/dist/server/pages-asset-tags.d.ts +2 -1
- package/dist/server/pages-body-parser-config.d.ts +2 -1
- package/dist/server/pages-client-assets.d.ts +4 -0
- package/dist/server/pages-data-route.d.ts +2 -1
- package/dist/server/pages-document-asset-props.d.ts +2 -1
- package/dist/server/pages-document-initial-props.d.ts +2 -1
- package/dist/server/pages-execution-tracing.d.ts +2 -1
- package/dist/server/pages-execution-tracing.js +1 -1
- package/dist/server/pages-get-initial-props.d.ts +2 -1
- package/dist/server/pages-media-type.d.ts +21 -1
- package/dist/server/pages-media-type.js +69 -5
- package/dist/server/pages-node-compat.js +52 -27
- package/dist/server/pages-page-data.d.ts +7 -1
- package/dist/server/pages-page-data.js +35 -12
- package/dist/server/pages-page-handler.d.ts +3 -2
- package/dist/server/pages-page-handler.js +27 -27
- package/dist/server/pages-page-method.d.ts +2 -1
- package/dist/server/pages-page-response.d.ts +2 -1
- package/dist/server/pages-preview.d.ts +2 -1
- package/dist/server/pages-readiness.d.ts +2 -1
- package/dist/server/pages-request-pipeline.d.ts +10 -1
- package/dist/server/pages-request-pipeline.js +6 -7
- package/dist/server/pages-request-stage-entry.d.ts +2 -1
- package/dist/server/pages-request-stage-entry.js +14 -12
- package/dist/server/pages-response-stage-entry.d.ts +2 -1
- package/dist/server/pages-response-stage-entry.js +9 -3
- package/dist/server/pages-route-data-kind.d.ts +2 -1
- package/dist/server/prerender-cache-life-header.d.ts +2 -1
- package/dist/server/prerender-route-params.d.ts +2 -1
- package/dist/server/prod-server.js +14 -4
- package/dist/server/request-log.d.ts +2 -1
- package/dist/server/request-pipeline.d.ts +6 -0
- package/dist/server/request-pipeline.js +21 -1
- package/dist/server/request-tracing.d.ts +2 -1
- package/dist/server/request-tracing.js +1 -1
- package/dist/server/response-start-tracing.js +7 -29
- package/dist/server/rsc-render-stream.d.ts +4 -0
- package/dist/server/rsc-render-stream.js +25 -0
- package/dist/server/seed-cache.d.ts +2 -1
- package/dist/server/seed-cache.js +1 -1
- package/dist/server/shared-cache-identity.d.ts +23 -0
- package/dist/server/shared-cache-identity.js +36 -0
- package/dist/server/static-file-cache.d.ts +2 -1
- package/dist/server/static-file-cache.js +1 -0
- package/dist/server/worker-revalidation-context.d.ts +2 -1
- package/dist/server/worker-stages.d.ts +18 -4
- package/dist/server/worker-stages.js +23 -4
- package/dist/shims/app.d.ts +2 -1
- package/dist/shims/cache-callable-runtime.d.ts +2 -1
- package/dist/shims/cache-handler.d.ts +8 -3
- package/dist/shims/cache-handler.js +31 -11
- package/dist/shims/cache-request-state.d.ts +17 -20
- package/dist/shims/cache-request-state.js +16 -21
- package/dist/shims/cache-runtime.js +27 -11
- package/dist/shims/cache.d.ts +8 -7
- package/dist/shims/cache.js +17 -19
- package/dist/shims/cacheability-classification.d.ts +2 -0
- package/dist/shims/caught-not-found-boundaries.d.ts +15 -0
- package/dist/shims/caught-not-found-boundaries.js +48 -0
- package/dist/shims/cdn-cache.d.ts +22 -5
- package/dist/shims/cdn-purge-routes.d.ts +2 -1
- package/dist/shims/client-locale.js +2 -1
- package/dist/shims/client-page-root.d.ts +2 -1
- package/dist/shims/client-page-root.js +2 -2
- package/dist/shims/config.d.ts +2 -1
- package/dist/shims/default-forbidden.d.ts +4 -0
- package/dist/shims/default-forbidden.js +18 -0
- package/dist/shims/default-not-found.d.ts +0 -5
- package/dist/shims/default-not-found.js +5 -41
- package/dist/shims/default-unauthorized.d.ts +4 -0
- package/dist/shims/default-unauthorized.js +18 -0
- package/dist/shims/dynamic.js +9 -6
- package/dist/shims/error-boundary.d.ts +39 -3
- package/dist/shims/error-boundary.js +33 -18
- package/dist/shims/fetch-cache-state.d.ts +5 -1
- package/dist/shims/fetch-cache-state.js +1 -3
- package/dist/shims/fetch-cache.d.ts +2 -1
- package/dist/shims/fetch-cache.js +34 -24
- package/dist/shims/font-google.js +1 -2
- package/dist/shims/font-utils.d.ts +3 -2
- package/dist/shims/font-utils.js +5 -3
- package/dist/shims/form.js +3 -3
- package/dist/shims/headers.d.ts +8 -23
- package/dist/shims/headers.js +17 -67
- package/dist/shims/http-access-error-fallback.d.ts +7 -0
- package/dist/shims/http-access-error-fallback.js +47 -0
- package/dist/shims/image.d.ts +1 -22
- package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +22 -2
- package/dist/shims/internal/app-prefetch-fetch-queue.js +71 -18
- package/dist/shims/internal/app-route-prefetch-policy.d.ts +14 -3
- package/dist/shims/internal/app-route-prefetch-policy.js +29 -4
- package/dist/shims/internal/cache-context-accessor.d.ts +2 -1
- package/dist/shims/internal/client-reference-loader.d.ts +7 -0
- package/dist/shims/internal/client-reference-loader.js +91 -0
- package/dist/shims/internal/cookie-serialize.d.ts +2 -1
- package/dist/shims/internal/cookies.js +1 -2
- package/dist/shims/internal/headers-state.d.ts +2 -0
- package/dist/shims/internal/headers-state.js +6 -1
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +2 -1
- package/dist/shims/internal/interpolate-as.d.ts +2 -1
- package/dist/shims/internal/navigation-untracked.js +1 -1
- package/dist/shims/internal/pages-data-target.d.ts +2 -1
- package/dist/shims/internal/pages-data-url.d.ts +2 -1
- package/dist/shims/internal/thenable-well-known-properties.d.ts +2 -1
- package/dist/shims/link.js +197 -52
- package/dist/shims/metadata.d.ts +52 -29
- package/dist/shims/metadata.js +142 -42
- package/dist/shims/navigation-errors.d.ts +2 -1
- package/dist/shims/navigation-server.js +1 -1
- package/dist/shims/navigation.d.ts +95 -8
- package/dist/shims/navigation.js +255 -47
- package/dist/shims/navigation.react-server.js +2 -2
- package/dist/shims/pages-router-runtime.d.ts +2 -1
- package/dist/shims/ppr-fallback-shell.d.ts +2 -1
- package/dist/shims/request-state-types.d.ts +2 -2
- package/dist/shims/router.js +14 -3
- package/dist/shims/slot.d.ts +12 -0
- package/dist/shims/slot.js +37 -9
- package/dist/shims/unified-request-context.d.ts +1 -1
- package/dist/shims/unified-request-context.js +5 -6
- package/dist/typegen.d.ts +2 -1
- package/dist/utils/cache-control-metadata.d.ts +5 -0
- package/dist/utils/cache-control-metadata.js +9 -1
- package/dist/utils/client-build-manifest.d.ts +4 -1
- package/dist/utils/client-build-manifest.js +9 -2
- package/dist/utils/client-entry-manifest.d.ts +13 -0
- package/dist/utils/client-entry-manifest.js +20 -1
- package/dist/utils/client-reference-chunks.d.ts +45 -0
- package/dist/utils/client-reference-chunks.js +30 -0
- package/dist/utils/client-runtime-metadata.d.ts +9 -1
- package/dist/utils/client-runtime-metadata.js +40 -9
- package/dist/utils/compare.d.ts +9 -0
- package/dist/utils/compare.js +15 -1
- package/dist/utils/lazy-chunks.d.ts +14 -0
- package/dist/utils/lazy-chunks.js +27 -1
- package/dist/utils/middleware-request-headers.d.ts +2 -1
- package/dist/utils/project.d.ts +4 -3
- package/dist/utils/project.js +12 -17
- package/dist/utils/query.d.ts +2 -1
- package/dist/utils/regex.d.ts +5 -0
- package/dist/utils/regex.js +11 -1
- package/dist/utils/text-stream.d.ts +10 -5
- package/dist/utils/text-stream.js +6 -6
- package/dist/utils/vite-cli-invocation.d.ts +2 -1
- package/package.json +6 -5
- package/dist/build/layout-classification-types.d.ts +0 -60
- package/dist/build/layout-classification-types.js +0 -1
- package/dist/build/layout-classification.d.ts +0 -61
- package/dist/build/layout-classification.js +0 -98
- package/dist/build/route-classification-injector.d.ts +0 -32
- package/dist/build/route-classification-injector.js +0 -59
- package/dist/build/route-classification-manifest.d.ts +0 -53
- package/dist/build/route-classification-manifest.js +0 -143
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +0 -808
- package/dist/server/app-browser-client-reuse-manifest.d.ts +0 -10
- package/dist/server/app-browser-client-reuse-manifest.js +0 -101
- package/dist/server/app-layout-param-observation.d.ts +0 -41
- package/dist/server/app-layout-param-observation.js +0 -168
- package/dist/server/client-reuse-manifest.d.ts +0 -102
- package/dist/server/client-reuse-manifest.js +0 -209
- package/dist/server/default-not-found-module.d.ts +0 -19
- package/dist/server/default-not-found-module.js +0 -18
- package/dist/server/rsc-stream-hints.d.ts +0 -21
- package/dist/server/rsc-stream-hints.js +0 -227
- package/dist/server/skip-cache-proof.d.ts +0 -60
- package/dist/server/skip-cache-proof.js +0 -168
- package/dist/server/static-layout-client-reuse-proof.d.ts +0 -13
- package/dist/server/static-layout-client-reuse-proof.js +0 -33
- package/dist/utils/sorted-array.d.ts +0 -7
- package/dist/utils/sorted-array.js +0 -20
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path, { toSlash } from "../deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
|
|
2
|
+
import { escapeRegExp } from "../utils/regex.js";
|
|
2
3
|
import { DEFAULT_PAGE_EXTENSIONS, normalizePageExtensions } from "../routing/file-matcher.js";
|
|
3
4
|
import { loadCommonJsModule, shouldRetryAsCommonJs } from "../utils/commonjs-loader.js";
|
|
4
5
|
import { isUnknownRecord } from "../utils/record.js";
|
|
@@ -374,7 +375,8 @@ function warnDeprecatedConfigOptions(config, root) {
|
|
|
374
375
|
["experimental.instrumentationHook", `\`experimental.instrumentationHook\` is no longer needed, because \`instrumentation.js\` is available by default. You can remove it from ${configFileName}.`]
|
|
375
376
|
];
|
|
376
377
|
for (const [propertyPath, warning] of warnings) if (hasConfigProperty(config, propertyPath)) warnConfigOnce(warning);
|
|
377
|
-
|
|
378
|
+
const experimental = readOptionalRecord(config.experimental);
|
|
379
|
+
for (const key of ["skipTrailingSlashRedirect", "cacheComponents"]) if (experimental?.[key] != null) warnConfigOnce(`\`experimental.${key}\` has been moved to \`${key}\`. Please update your ${configFileName} file accordingly.`);
|
|
378
380
|
}
|
|
379
381
|
async function resolveNextConfigInput(config, phase = PHASE_DEVELOPMENT_SERVER) {
|
|
380
382
|
return await resolveConfigValue(config, phase);
|
|
@@ -808,6 +810,28 @@ function validateConfigConditions(type, routes) {
|
|
|
808
810
|
}
|
|
809
811
|
if (invalid.length > 0) throw new Error(`Invalid next.config.js ${type} has/missing condition${invalid.length === 1 ? "" : "s"}:\n${invalid.join("\n")}\nEach item must be { type: header, cookie, query or host, key: string, value?: string }, with a value and no key required for host.`);
|
|
810
812
|
}
|
|
813
|
+
const REDIRECT_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
814
|
+
301,
|
|
815
|
+
302,
|
|
816
|
+
303,
|
|
817
|
+
307,
|
|
818
|
+
308
|
|
819
|
+
]);
|
|
820
|
+
/**
|
|
821
|
+
* Fail config loading on a redirect without a valid status, with the rules of
|
|
822
|
+
* Next.js's checkRedirect (load-custom-routes.ts): `statusCode` must be one of
|
|
823
|
+
* the redirect statuses, and `permanent` a boolean when it is absent.
|
|
824
|
+
*/
|
|
825
|
+
function validateRedirectStatuses(redirects) {
|
|
826
|
+
const invalid = [];
|
|
827
|
+
for (const redirect of redirects) {
|
|
828
|
+
const parts = [];
|
|
829
|
+
if (redirect.statusCode && !REDIRECT_STATUS_CODES.has(redirect.statusCode)) parts.push("`statusCode` is not undefined or valid statusCode");
|
|
830
|
+
if (typeof redirect.permanent !== "boolean" && !redirect.statusCode) parts.push("`permanent` is not set to `true` or `false`");
|
|
831
|
+
if (parts.length > 0) invalid.push(` ${describeSource(redirect.source)}: ${parts.join(", ")}`);
|
|
832
|
+
}
|
|
833
|
+
if (invalid.length > 0) throw new Error(`Invalid next.config.js redirect${invalid.length === 1 ? "" : "s"}:\n${invalid.join("\n")}\nValid redirect statusCode values are ${[...REDIRECT_STATUS_CODES].join(", ")}`);
|
|
834
|
+
}
|
|
811
835
|
/** JSON for a config value, or its type when JSON cannot serialize it. */
|
|
812
836
|
function describeConfigValue(value) {
|
|
813
837
|
try {
|
|
@@ -861,6 +885,7 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
861
885
|
resolveExtensions: null,
|
|
862
886
|
serverResolveExtensions: null,
|
|
863
887
|
cacheComponents: false,
|
|
888
|
+
cachedNavigations: false,
|
|
864
889
|
appNavFailHandling: false,
|
|
865
890
|
gestureTransition: false,
|
|
866
891
|
prefetchInlining: false,
|
|
@@ -874,6 +899,7 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
874
899
|
images: void 0,
|
|
875
900
|
i18n: null,
|
|
876
901
|
mdx: null,
|
|
902
|
+
nextIntlCatalogLoader: null,
|
|
877
903
|
aliases: {},
|
|
878
904
|
allowedDevOrigins: [],
|
|
879
905
|
serverActionsAllowedOrigins: [],
|
|
@@ -950,6 +976,7 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
950
976
|
validateConfigSources("redirect", redirects);
|
|
951
977
|
validateConfigSources("rewrite", allRewrites);
|
|
952
978
|
validateConfigConditions("redirect", redirects);
|
|
979
|
+
validateRedirectStatuses(redirects);
|
|
953
980
|
validateConfigConditions("rewrite", allRewrites);
|
|
954
981
|
const invalidBasePathRewrites = allRewrites.filter((rewrite) => rewrite.basePath === false && !(rewrite.destination.startsWith("http://") || rewrite.destination.startsWith("https://")));
|
|
955
982
|
if (invalidBasePathRewrites.length > 0) throw new Error(invalidBasePathRewrites.map((rewrite) => `The route ${rewrite.source} rewrites urls outside of the basePath. Please use a destination that starts with \`http://\` or \`https://\` https://nextjs.org/docs/messages/invalid-external-rewrite`).concat(`Invalid rewrite${invalidBasePathRewrites.length === 1 ? "" : "s"} found`).join("\n"));
|
|
@@ -986,6 +1013,7 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
986
1013
|
};
|
|
987
1014
|
const allowedDevOrigins = Array.isArray(config.allowedDevOrigins) ? config.allowedDevOrigins : [];
|
|
988
1015
|
const experimental = readOptionalRecord(config.experimental);
|
|
1016
|
+
const cacheComponents = (experimental?.cacheComponents ?? config.cacheComponents) === true;
|
|
989
1017
|
const serverActionsConfig = readOptionalRecord(experimental?.serverActions);
|
|
990
1018
|
const serverActionsAllowedOrigins = readStringArray(serverActionsConfig?.allowedOrigins);
|
|
991
1019
|
const serverActionsBodySizeLimitConfig = readOptionalBodySizeLimit(serverActionsConfig?.bodySizeLimit);
|
|
@@ -1001,7 +1029,7 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
1001
1029
|
const appShells = experimental?.appShells === true;
|
|
1002
1030
|
if (appShells) {
|
|
1003
1031
|
const missingCoFlags = [];
|
|
1004
|
-
if (!
|
|
1032
|
+
if (!cacheComponents) missingCoFlags.push("cacheComponents");
|
|
1005
1033
|
if (!prefetchInlining) missingCoFlags.push("experimental.prefetchInlining");
|
|
1006
1034
|
if (experimental?.varyParams !== true) missingCoFlags.push("experimental.varyParams");
|
|
1007
1035
|
if (experimental?.optimisticRouting !== true) missingCoFlags.push("experimental.optimisticRouting");
|
|
@@ -1022,9 +1050,9 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
1022
1050
|
exclude: lightningCssFeatureNamesToMask(readStringArray(rawLightningCssFeatures?.exclude))
|
|
1023
1051
|
};
|
|
1024
1052
|
if (rawLightningCssFeatures && !useLightningcss) console.warn("[vinext] experimental.lightningCssFeatures is set but experimental.useLightningcss is not enabled. The lightningCssFeatures option has no effect without useLightningcss.");
|
|
1025
|
-
if (experimental?.cachedNavigations === true && !
|
|
1053
|
+
if (experimental?.cachedNavigations === true && !cacheComponents) console.warn("[vinext] `experimental.cachedNavigations` requires `cacheComponents: true` to have any effect. Set `cacheComponents: true` in your next.config, or remove `experimental.cachedNavigations`.");
|
|
1026
1054
|
if (config.webpack !== void 0) {
|
|
1027
|
-
if (mdx || Object.keys(webpackProbe.aliases).length > 0 || webpackProbe.resolveExtensionsCustomized || webpackProbe.instrumentationClientRouteManifest !== void 0) console.warn("[vinext] next.config option \"webpack\" is only partially supported. vinext preserves resolve.alias, resolve.extensions, MDX loader settings, and instrumentation-client route manifests, but other webpack customization is ignored");
|
|
1055
|
+
if (mdx || Object.keys(webpackProbe.aliases).length > 0 || webpackProbe.resolveExtensionsCustomized || webpackProbe.instrumentationClientRouteManifest !== void 0 || webpackProbe.nextIntlCatalogLoader !== null) console.warn("[vinext] next.config option \"webpack\" is only partially supported. vinext preserves resolve.alias, resolve.extensions, MDX loader settings, next-intl message catalog loaders, and instrumentation-client route manifests, but other webpack customization is ignored");
|
|
1028
1056
|
else console.warn("[vinext] next.config option \"webpack\" is not yet supported and will be ignored");
|
|
1029
1057
|
}
|
|
1030
1058
|
const output = readOptionalString(config.output) ?? "";
|
|
@@ -1073,7 +1101,8 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
1073
1101
|
instrumentationClientInject: Array.isArray(config.instrumentationClientInject) ? config.instrumentationClientInject.filter((x) => typeof x === "string") : [],
|
|
1074
1102
|
instrumentationClientRouteManifest: webpackProbe.instrumentationClientRouteManifest,
|
|
1075
1103
|
instrumentationServerValueInjections: webpackProbe.instrumentationServerValueInjections,
|
|
1076
|
-
cacheComponents
|
|
1104
|
+
cacheComponents,
|
|
1105
|
+
cachedNavigations: cacheComponents && experimental?.cachedNavigations === true,
|
|
1077
1106
|
appNavFailHandling: experimental?.appNavFailHandling === true,
|
|
1078
1107
|
gestureTransition: experimental?.gestureTransition === true,
|
|
1079
1108
|
prefetchInlining,
|
|
@@ -1083,6 +1112,7 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
1083
1112
|
images,
|
|
1084
1113
|
i18n,
|
|
1085
1114
|
mdx,
|
|
1115
|
+
nextIntlCatalogLoader: webpackProbe.nextIntlCatalogLoader ?? extractTurbopackNextIntlCatalogLoader(config, root),
|
|
1086
1116
|
aliases,
|
|
1087
1117
|
allowedDevOrigins,
|
|
1088
1118
|
serverActionsAllowedOrigins,
|
|
@@ -1119,6 +1149,7 @@ async function resolveNextConfig(config, root = toSlash(process.cwd()), options
|
|
|
1119
1149
|
lightningCssFeatures
|
|
1120
1150
|
};
|
|
1121
1151
|
detectNextIntlConfig(root, resolved);
|
|
1152
|
+
if (resolved.aliases["use-intl/format-message"]?.includes("format-only") && resolved.nextIntlCatalogLoader === null) console.warn("[vinext] next-intl's `experimental.messages.precompile` is enabled, but vinext could not find next-intl's catalog loader in the webpack or Turbopack config. Messages with arguments or rich text will render their raw ICU source; remove `precompile` to format them at runtime");
|
|
1122
1153
|
if (resolved.basePath !== "" && resolved.basePath !== "/" && resolved.assetPrefix === "") resolved.assetPrefix = resolved.basePath;
|
|
1123
1154
|
return resolved;
|
|
1124
1155
|
}
|
|
@@ -1155,10 +1186,36 @@ function extractTurboAliases(config, root) {
|
|
|
1155
1186
|
...normalizeAliasEntries(readOptionalRecord(topLevelTurbopack?.resolveAlias), root)
|
|
1156
1187
|
};
|
|
1157
1188
|
}
|
|
1189
|
+
function extractTurbopackNextIntlCatalogLoader(config, root) {
|
|
1190
|
+
const experimental = readOptionalRecord(config.experimental);
|
|
1191
|
+
for (const turbo of [readOptionalRecord(config.turbopack), readOptionalRecord(experimental?.turbo)]) {
|
|
1192
|
+
const rules = readOptionalRecord(turbo?.rules);
|
|
1193
|
+
for (const [glob, entry] of Object.entries(rules ?? {})) {
|
|
1194
|
+
const extension = /^\*(\.[^*/{}]+)$/.exec(glob)?.[1];
|
|
1195
|
+
if (!extension) continue;
|
|
1196
|
+
for (const rule of Array.isArray(entry) ? entry : [entry]) {
|
|
1197
|
+
if (!isUnknownRecord(rule) || !Array.isArray(rule.loaders)) continue;
|
|
1198
|
+
const loader = rule.loaders.find((use) => isUnknownRecord(use) && use.loader === NEXT_INTL_CATALOG_LOADER);
|
|
1199
|
+
if (!isUnknownRecord(loader) || !isUnknownRecord(loader.options)) continue;
|
|
1200
|
+
const condition = readOptionalRecord(rule.condition);
|
|
1201
|
+
const dirs = typeof condition?.path === "string" ? /^(?:\{([^{}]+)\}|([^{}]+))\/\*\*\/\*$/.exec(condition.path) : null;
|
|
1202
|
+
const include = (dirs?.[1]?.split(",") ?? (dirs?.[2] ? [dirs[2]] : [])).map((dir) => path.resolve(root, dir));
|
|
1203
|
+
if (include.length === 0) continue;
|
|
1204
|
+
return {
|
|
1205
|
+
include,
|
|
1206
|
+
test: new RegExp(`${escapeRegExp(extension)}$`),
|
|
1207
|
+
options: loader.options
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
return null;
|
|
1213
|
+
}
|
|
1158
1214
|
async function probeWebpackConfig(config, root, dev) {
|
|
1159
1215
|
if (typeof config.webpack !== "function") return {
|
|
1160
1216
|
aliases: {},
|
|
1161
1217
|
mdx: null,
|
|
1218
|
+
nextIntlCatalogLoader: null,
|
|
1162
1219
|
resolveExtensions: null,
|
|
1163
1220
|
serverResolveExtensions: null,
|
|
1164
1221
|
resolveExtensionsCustomized: false,
|
|
@@ -1179,6 +1236,7 @@ async function probeWebpackConfig(config, root, dev) {
|
|
|
1179
1236
|
return {
|
|
1180
1237
|
aliases: normalizeAliasEntries(clientProbe.config.resolve?.alias, root),
|
|
1181
1238
|
mdx: extractMdxOptionsFromRules(clientProbe.rules),
|
|
1239
|
+
nextIntlCatalogLoader: extractNextIntlCatalogLoader(clientProbe.rules),
|
|
1182
1240
|
resolveExtensions: clientProbe.resolveExtensions,
|
|
1183
1241
|
serverResolveExtensions: serverProbe.resolveExtensions,
|
|
1184
1242
|
resolveExtensionsCustomized: clientProbe.resolveExtensions !== null || serverProbe.resolveExtensions !== null,
|
|
@@ -1189,6 +1247,7 @@ async function probeWebpackConfig(config, root, dev) {
|
|
|
1189
1247
|
return {
|
|
1190
1248
|
aliases: {},
|
|
1191
1249
|
mdx: null,
|
|
1250
|
+
nextIntlCatalogLoader: null,
|
|
1192
1251
|
resolveExtensions: null,
|
|
1193
1252
|
serverResolveExtensions: null,
|
|
1194
1253
|
resolveExtensionsCustomized: false,
|
|
@@ -1221,6 +1280,35 @@ function extractInstrumentationClientRouteManifest(rules) {
|
|
|
1221
1280
|
for (const rule of rules) visit(rule);
|
|
1222
1281
|
return manifest;
|
|
1223
1282
|
}
|
|
1283
|
+
const NEXT_INTL_CATALOG_LOADER = "next-intl/extractor/catalogLoader";
|
|
1284
|
+
function extractNextIntlCatalogLoader(rules) {
|
|
1285
|
+
let catalogLoader = null;
|
|
1286
|
+
const visit = (rule) => {
|
|
1287
|
+
if (!rule || typeof rule !== "object") return;
|
|
1288
|
+
if (Array.isArray(rule)) {
|
|
1289
|
+
for (const child of rule) visit(child);
|
|
1290
|
+
return;
|
|
1291
|
+
}
|
|
1292
|
+
if (Array.isArray(rule.oneOf)) for (const child of rule.oneOf) visit(child);
|
|
1293
|
+
if (Array.isArray(rule.rules)) for (const child of rule.rules) visit(child);
|
|
1294
|
+
if (!(rule.test instanceof RegExp)) return;
|
|
1295
|
+
const include = typeof rule.include === "string" ? [rule.include] : rule.include;
|
|
1296
|
+
if (!Array.isArray(include) || include.length === 0) return;
|
|
1297
|
+
if (!include.every((dir) => typeof dir === "string")) return;
|
|
1298
|
+
const uses = Array.isArray(rule.use) ? rule.use : rule.use ? [rule.use] : [];
|
|
1299
|
+
for (const use of uses) {
|
|
1300
|
+
if (!isUnknownRecord(use) || use.loader !== NEXT_INTL_CATALOG_LOADER) continue;
|
|
1301
|
+
if (!isUnknownRecord(use.options)) continue;
|
|
1302
|
+
catalogLoader = {
|
|
1303
|
+
include,
|
|
1304
|
+
test: rule.test,
|
|
1305
|
+
options: use.options
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
};
|
|
1309
|
+
for (const rule of rules) visit(rule);
|
|
1310
|
+
return catalogLoader;
|
|
1311
|
+
}
|
|
1224
1312
|
function matchesWebpackCondition(condition, value) {
|
|
1225
1313
|
if (typeof condition === "string") return value.startsWith(condition);
|
|
1226
1314
|
if (condition instanceof RegExp) {
|
|
@@ -17,4 +17,5 @@ export declare function loadTsconfigResolutionForRoot(projectRoot: string): Tsco
|
|
|
17
17
|
* Back-compat helper for call sites that only need `compilerOptions.paths`.
|
|
18
18
|
*/
|
|
19
19
|
export declare function loadTsconfigPathAliasesForRoot(projectRoot: string): Record<string, string>;
|
|
20
|
-
//#endregion
|
|
20
|
+
//#endregion
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_safer } from "../../../../safer-buffer@2.1.2/deps/safer-buffer/safer.js";
|
|
3
|
+
//#region ../../node_modules/.pnpm/iconv-lite@0.4.24/node_modules/iconv-lite/encodings/dbcs-codec.js
|
|
4
|
+
var require_dbcs_codec = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
+
var Buffer = require_safer().Buffer;
|
|
6
|
+
exports._dbcs = DBCSCodec;
|
|
7
|
+
var UNASSIGNED = -1;
|
|
8
|
+
var GB18030_CODE = -2;
|
|
9
|
+
var SEQ_START = -10;
|
|
10
|
+
var NODE_START = -1e3;
|
|
11
|
+
var UNASSIGNED_NODE = new Array(256);
|
|
12
|
+
var DEF_CHAR = -1;
|
|
13
|
+
for (var i = 0; i < 256; i++) UNASSIGNED_NODE[i] = UNASSIGNED;
|
|
14
|
+
function DBCSCodec(codecOptions, iconv) {
|
|
15
|
+
this.encodingName = codecOptions.encodingName;
|
|
16
|
+
if (!codecOptions) throw new Error("DBCS codec is called without the data.");
|
|
17
|
+
if (!codecOptions.table) throw new Error("Encoding '" + this.encodingName + "' has no data.");
|
|
18
|
+
var mappingTable = codecOptions.table();
|
|
19
|
+
this.decodeTables = [];
|
|
20
|
+
this.decodeTables[0] = UNASSIGNED_NODE.slice(0);
|
|
21
|
+
this.decodeTableSeq = [];
|
|
22
|
+
for (var i = 0; i < mappingTable.length; i++) this._addDecodeChunk(mappingTable[i]);
|
|
23
|
+
this.defaultCharUnicode = iconv.defaultCharUnicode;
|
|
24
|
+
this.encodeTable = [];
|
|
25
|
+
this.encodeTableSeq = [];
|
|
26
|
+
var skipEncodeChars = {};
|
|
27
|
+
if (codecOptions.encodeSkipVals) for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) {
|
|
28
|
+
var val = codecOptions.encodeSkipVals[i];
|
|
29
|
+
if (typeof val === "number") skipEncodeChars[val] = true;
|
|
30
|
+
else for (var j = val.from; j <= val.to; j++) skipEncodeChars[j] = true;
|
|
31
|
+
}
|
|
32
|
+
this._fillEncodeTable(0, 0, skipEncodeChars);
|
|
33
|
+
if (codecOptions.encodeAdd) {
|
|
34
|
+
for (var uChar in codecOptions.encodeAdd) if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);
|
|
35
|
+
}
|
|
36
|
+
this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];
|
|
37
|
+
if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]["?"];
|
|
38
|
+
if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0);
|
|
39
|
+
if (typeof codecOptions.gb18030 === "function") {
|
|
40
|
+
this.gb18030 = codecOptions.gb18030();
|
|
41
|
+
var thirdByteNodeIdx = this.decodeTables.length;
|
|
42
|
+
var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0);
|
|
43
|
+
var fourthByteNodeIdx = this.decodeTables.length;
|
|
44
|
+
var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0);
|
|
45
|
+
for (var i = 129; i <= 254; i++) {
|
|
46
|
+
var secondByteNodeIdx = NODE_START - this.decodeTables[0][i];
|
|
47
|
+
var secondByteNode = this.decodeTables[secondByteNodeIdx];
|
|
48
|
+
for (var j = 48; j <= 57; j++) secondByteNode[j] = NODE_START - thirdByteNodeIdx;
|
|
49
|
+
}
|
|
50
|
+
for (var i = 129; i <= 254; i++) thirdByteNode[i] = NODE_START - fourthByteNodeIdx;
|
|
51
|
+
for (var i = 48; i <= 57; i++) fourthByteNode[i] = GB18030_CODE;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
DBCSCodec.prototype.encoder = DBCSEncoder;
|
|
55
|
+
DBCSCodec.prototype.decoder = DBCSDecoder;
|
|
56
|
+
DBCSCodec.prototype._getDecodeTrieNode = function(addr) {
|
|
57
|
+
var bytes = [];
|
|
58
|
+
for (; addr > 0; addr >>= 8) bytes.push(addr & 255);
|
|
59
|
+
if (bytes.length == 0) bytes.push(0);
|
|
60
|
+
var node = this.decodeTables[0];
|
|
61
|
+
for (var i = bytes.length - 1; i > 0; i--) {
|
|
62
|
+
var val = node[bytes[i]];
|
|
63
|
+
if (val == UNASSIGNED) {
|
|
64
|
+
node[bytes[i]] = NODE_START - this.decodeTables.length;
|
|
65
|
+
this.decodeTables.push(node = UNASSIGNED_NODE.slice(0));
|
|
66
|
+
} else if (val <= NODE_START) node = this.decodeTables[NODE_START - val];
|
|
67
|
+
else throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16));
|
|
68
|
+
}
|
|
69
|
+
return node;
|
|
70
|
+
};
|
|
71
|
+
DBCSCodec.prototype._addDecodeChunk = function(chunk) {
|
|
72
|
+
var curAddr = parseInt(chunk[0], 16);
|
|
73
|
+
var writeTable = this._getDecodeTrieNode(curAddr);
|
|
74
|
+
curAddr = curAddr & 255;
|
|
75
|
+
for (var k = 1; k < chunk.length; k++) {
|
|
76
|
+
var part = chunk[k];
|
|
77
|
+
if (typeof part === "string") for (var l = 0; l < part.length;) {
|
|
78
|
+
var code = part.charCodeAt(l++);
|
|
79
|
+
if (55296 <= code && code < 56320) {
|
|
80
|
+
var codeTrail = part.charCodeAt(l++);
|
|
81
|
+
if (56320 <= codeTrail && codeTrail < 57344) writeTable[curAddr++] = 65536 + (code - 55296) * 1024 + (codeTrail - 56320);
|
|
82
|
+
else throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]);
|
|
83
|
+
} else if (4080 < code && code <= 4095) {
|
|
84
|
+
var len = 4095 - code + 2;
|
|
85
|
+
var seq = [];
|
|
86
|
+
for (var m = 0; m < len; m++) seq.push(part.charCodeAt(l++));
|
|
87
|
+
writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
|
|
88
|
+
this.decodeTableSeq.push(seq);
|
|
89
|
+
} else writeTable[curAddr++] = code;
|
|
90
|
+
}
|
|
91
|
+
else if (typeof part === "number") {
|
|
92
|
+
var charCode = writeTable[curAddr - 1] + 1;
|
|
93
|
+
for (var l = 0; l < part; l++) writeTable[curAddr++] = charCode++;
|
|
94
|
+
} else throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]);
|
|
95
|
+
}
|
|
96
|
+
if (curAddr > 255) throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr);
|
|
97
|
+
};
|
|
98
|
+
DBCSCodec.prototype._getEncodeBucket = function(uCode) {
|
|
99
|
+
var high = uCode >> 8;
|
|
100
|
+
if (this.encodeTable[high] === void 0) this.encodeTable[high] = UNASSIGNED_NODE.slice(0);
|
|
101
|
+
return this.encodeTable[high];
|
|
102
|
+
};
|
|
103
|
+
DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) {
|
|
104
|
+
var bucket = this._getEncodeBucket(uCode);
|
|
105
|
+
var low = uCode & 255;
|
|
106
|
+
if (bucket[low] <= SEQ_START) this.encodeTableSeq[SEQ_START - bucket[low]][DEF_CHAR] = dbcsCode;
|
|
107
|
+
else if (bucket[low] == UNASSIGNED) bucket[low] = dbcsCode;
|
|
108
|
+
};
|
|
109
|
+
DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {
|
|
110
|
+
var uCode = seq[0];
|
|
111
|
+
var bucket = this._getEncodeBucket(uCode);
|
|
112
|
+
var low = uCode & 255;
|
|
113
|
+
var node;
|
|
114
|
+
if (bucket[low] <= SEQ_START) node = this.encodeTableSeq[SEQ_START - bucket[low]];
|
|
115
|
+
else {
|
|
116
|
+
node = {};
|
|
117
|
+
if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low];
|
|
118
|
+
bucket[low] = SEQ_START - this.encodeTableSeq.length;
|
|
119
|
+
this.encodeTableSeq.push(node);
|
|
120
|
+
}
|
|
121
|
+
for (var j = 1; j < seq.length - 1; j++) {
|
|
122
|
+
var oldVal = node[uCode];
|
|
123
|
+
if (typeof oldVal === "object") node = oldVal;
|
|
124
|
+
else {
|
|
125
|
+
node = node[uCode] = {};
|
|
126
|
+
if (oldVal !== void 0) node[DEF_CHAR] = oldVal;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
uCode = seq[seq.length - 1];
|
|
130
|
+
node[uCode] = dbcsCode;
|
|
131
|
+
};
|
|
132
|
+
DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) {
|
|
133
|
+
var node = this.decodeTables[nodeIdx];
|
|
134
|
+
for (var i = 0; i < 256; i++) {
|
|
135
|
+
var uCode = node[i];
|
|
136
|
+
var mbCode = prefix + i;
|
|
137
|
+
if (skipEncodeChars[mbCode]) continue;
|
|
138
|
+
if (uCode >= 0) this._setEncodeChar(uCode, mbCode);
|
|
139
|
+
else if (uCode <= NODE_START) this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars);
|
|
140
|
+
else if (uCode <= SEQ_START) this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
function DBCSEncoder(options, codec) {
|
|
144
|
+
this.leadSurrogate = -1;
|
|
145
|
+
this.seqObj = void 0;
|
|
146
|
+
this.encodeTable = codec.encodeTable;
|
|
147
|
+
this.encodeTableSeq = codec.encodeTableSeq;
|
|
148
|
+
this.defaultCharSingleByte = codec.defCharSB;
|
|
149
|
+
this.gb18030 = codec.gb18030;
|
|
150
|
+
}
|
|
151
|
+
DBCSEncoder.prototype.write = function(str) {
|
|
152
|
+
var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i = 0, j = 0;
|
|
153
|
+
while (true) {
|
|
154
|
+
if (nextChar === -1) {
|
|
155
|
+
if (i == str.length) break;
|
|
156
|
+
var uCode = str.charCodeAt(i++);
|
|
157
|
+
} else {
|
|
158
|
+
var uCode = nextChar;
|
|
159
|
+
nextChar = -1;
|
|
160
|
+
}
|
|
161
|
+
if (55296 <= uCode && uCode < 57344) {
|
|
162
|
+
if (uCode < 56320) {
|
|
163
|
+
if (leadSurrogate === -1) {
|
|
164
|
+
leadSurrogate = uCode;
|
|
165
|
+
continue;
|
|
166
|
+
} else {
|
|
167
|
+
leadSurrogate = uCode;
|
|
168
|
+
uCode = UNASSIGNED;
|
|
169
|
+
}
|
|
170
|
+
} else if (leadSurrogate !== -1) {
|
|
171
|
+
uCode = 65536 + (leadSurrogate - 55296) * 1024 + (uCode - 56320);
|
|
172
|
+
leadSurrogate = -1;
|
|
173
|
+
} else uCode = UNASSIGNED;
|
|
174
|
+
} else if (leadSurrogate !== -1) {
|
|
175
|
+
nextChar = uCode;
|
|
176
|
+
uCode = UNASSIGNED;
|
|
177
|
+
leadSurrogate = -1;
|
|
178
|
+
}
|
|
179
|
+
var dbcsCode = UNASSIGNED;
|
|
180
|
+
if (seqObj !== void 0 && uCode != UNASSIGNED) {
|
|
181
|
+
var resCode = seqObj[uCode];
|
|
182
|
+
if (typeof resCode === "object") {
|
|
183
|
+
seqObj = resCode;
|
|
184
|
+
continue;
|
|
185
|
+
} else if (typeof resCode == "number") dbcsCode = resCode;
|
|
186
|
+
else if (resCode == void 0) {
|
|
187
|
+
resCode = seqObj[DEF_CHAR];
|
|
188
|
+
if (resCode !== void 0) {
|
|
189
|
+
dbcsCode = resCode;
|
|
190
|
+
nextChar = uCode;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
seqObj = void 0;
|
|
194
|
+
} else if (uCode >= 0) {
|
|
195
|
+
var subtable = this.encodeTable[uCode >> 8];
|
|
196
|
+
if (subtable !== void 0) dbcsCode = subtable[uCode & 255];
|
|
197
|
+
if (dbcsCode <= SEQ_START) {
|
|
198
|
+
seqObj = this.encodeTableSeq[SEQ_START - dbcsCode];
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
if (dbcsCode == UNASSIGNED && this.gb18030) {
|
|
202
|
+
var idx = findIdx(this.gb18030.uChars, uCode);
|
|
203
|
+
if (idx != -1) {
|
|
204
|
+
var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);
|
|
205
|
+
newBuf[j++] = 129 + Math.floor(dbcsCode / 12600);
|
|
206
|
+
dbcsCode = dbcsCode % 12600;
|
|
207
|
+
newBuf[j++] = 48 + Math.floor(dbcsCode / 1260);
|
|
208
|
+
dbcsCode = dbcsCode % 1260;
|
|
209
|
+
newBuf[j++] = 129 + Math.floor(dbcsCode / 10);
|
|
210
|
+
dbcsCode = dbcsCode % 10;
|
|
211
|
+
newBuf[j++] = 48 + dbcsCode;
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (dbcsCode === UNASSIGNED) dbcsCode = this.defaultCharSingleByte;
|
|
217
|
+
if (dbcsCode < 256) newBuf[j++] = dbcsCode;
|
|
218
|
+
else if (dbcsCode < 65536) {
|
|
219
|
+
newBuf[j++] = dbcsCode >> 8;
|
|
220
|
+
newBuf[j++] = dbcsCode & 255;
|
|
221
|
+
} else {
|
|
222
|
+
newBuf[j++] = dbcsCode >> 16;
|
|
223
|
+
newBuf[j++] = dbcsCode >> 8 & 255;
|
|
224
|
+
newBuf[j++] = dbcsCode & 255;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
this.seqObj = seqObj;
|
|
228
|
+
this.leadSurrogate = leadSurrogate;
|
|
229
|
+
return newBuf.slice(0, j);
|
|
230
|
+
};
|
|
231
|
+
DBCSEncoder.prototype.end = function() {
|
|
232
|
+
if (this.leadSurrogate === -1 && this.seqObj === void 0) return;
|
|
233
|
+
var newBuf = Buffer.alloc(10), j = 0;
|
|
234
|
+
if (this.seqObj) {
|
|
235
|
+
var dbcsCode = this.seqObj[DEF_CHAR];
|
|
236
|
+
if (dbcsCode !== void 0) {
|
|
237
|
+
if (dbcsCode < 256) newBuf[j++] = dbcsCode;
|
|
238
|
+
else {
|
|
239
|
+
newBuf[j++] = dbcsCode >> 8;
|
|
240
|
+
newBuf[j++] = dbcsCode & 255;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
this.seqObj = void 0;
|
|
244
|
+
}
|
|
245
|
+
if (this.leadSurrogate !== -1) {
|
|
246
|
+
newBuf[j++] = this.defaultCharSingleByte;
|
|
247
|
+
this.leadSurrogate = -1;
|
|
248
|
+
}
|
|
249
|
+
return newBuf.slice(0, j);
|
|
250
|
+
};
|
|
251
|
+
DBCSEncoder.prototype.findIdx = findIdx;
|
|
252
|
+
function DBCSDecoder(options, codec) {
|
|
253
|
+
this.nodeIdx = 0;
|
|
254
|
+
this.prevBuf = Buffer.alloc(0);
|
|
255
|
+
this.decodeTables = codec.decodeTables;
|
|
256
|
+
this.decodeTableSeq = codec.decodeTableSeq;
|
|
257
|
+
this.defaultCharUnicode = codec.defaultCharUnicode;
|
|
258
|
+
this.gb18030 = codec.gb18030;
|
|
259
|
+
}
|
|
260
|
+
DBCSDecoder.prototype.write = function(buf) {
|
|
261
|
+
var newBuf = Buffer.alloc(buf.length * 2), nodeIdx = this.nodeIdx, prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, seqStart = -this.prevBuf.length, uCode;
|
|
262
|
+
if (prevBufOffset > 0) prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);
|
|
263
|
+
for (var i = 0, j = 0; i < buf.length; i++) {
|
|
264
|
+
var curByte = i >= 0 ? buf[i] : prevBuf[i + prevBufOffset];
|
|
265
|
+
var uCode = this.decodeTables[nodeIdx][curByte];
|
|
266
|
+
if (uCode >= 0) {} else if (uCode === UNASSIGNED) {
|
|
267
|
+
i = seqStart;
|
|
268
|
+
uCode = this.defaultCharUnicode.charCodeAt(0);
|
|
269
|
+
} else if (uCode === GB18030_CODE) {
|
|
270
|
+
var curSeq = seqStart >= 0 ? buf.slice(seqStart, i + 1) : prevBuf.slice(seqStart + prevBufOffset, i + 1 + prevBufOffset);
|
|
271
|
+
var ptr = (curSeq[0] - 129) * 12600 + (curSeq[1] - 48) * 1260 + (curSeq[2] - 129) * 10 + (curSeq[3] - 48);
|
|
272
|
+
var idx = findIdx(this.gb18030.gbChars, ptr);
|
|
273
|
+
uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];
|
|
274
|
+
} else if (uCode <= NODE_START) {
|
|
275
|
+
nodeIdx = NODE_START - uCode;
|
|
276
|
+
continue;
|
|
277
|
+
} else if (uCode <= SEQ_START) {
|
|
278
|
+
var seq = this.decodeTableSeq[SEQ_START - uCode];
|
|
279
|
+
for (var k = 0; k < seq.length - 1; k++) {
|
|
280
|
+
uCode = seq[k];
|
|
281
|
+
newBuf[j++] = uCode & 255;
|
|
282
|
+
newBuf[j++] = uCode >> 8;
|
|
283
|
+
}
|
|
284
|
+
uCode = seq[seq.length - 1];
|
|
285
|
+
} else throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte);
|
|
286
|
+
if (uCode > 65535) {
|
|
287
|
+
uCode -= 65536;
|
|
288
|
+
var uCodeLead = 55296 + Math.floor(uCode / 1024);
|
|
289
|
+
newBuf[j++] = uCodeLead & 255;
|
|
290
|
+
newBuf[j++] = uCodeLead >> 8;
|
|
291
|
+
uCode = 56320 + uCode % 1024;
|
|
292
|
+
}
|
|
293
|
+
newBuf[j++] = uCode & 255;
|
|
294
|
+
newBuf[j++] = uCode >> 8;
|
|
295
|
+
nodeIdx = 0;
|
|
296
|
+
seqStart = i + 1;
|
|
297
|
+
}
|
|
298
|
+
this.nodeIdx = nodeIdx;
|
|
299
|
+
this.prevBuf = seqStart >= 0 ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset);
|
|
300
|
+
return newBuf.slice(0, j).toString("ucs2");
|
|
301
|
+
};
|
|
302
|
+
DBCSDecoder.prototype.end = function() {
|
|
303
|
+
var ret = "";
|
|
304
|
+
while (this.prevBuf.length > 0) {
|
|
305
|
+
ret += this.defaultCharUnicode;
|
|
306
|
+
var buf = this.prevBuf.slice(1);
|
|
307
|
+
this.prevBuf = Buffer.alloc(0);
|
|
308
|
+
this.nodeIdx = 0;
|
|
309
|
+
if (buf.length > 0) ret += this.write(buf);
|
|
310
|
+
}
|
|
311
|
+
this.nodeIdx = 0;
|
|
312
|
+
return ret;
|
|
313
|
+
};
|
|
314
|
+
function findIdx(table, val) {
|
|
315
|
+
if (table[0] > val) return -1;
|
|
316
|
+
var l = 0, r = table.length;
|
|
317
|
+
while (l < r - 1) {
|
|
318
|
+
var mid = l + Math.floor((r - l + 1) / 2);
|
|
319
|
+
if (table[mid] <= val) l = mid;
|
|
320
|
+
else r = mid;
|
|
321
|
+
}
|
|
322
|
+
return l;
|
|
323
|
+
}
|
|
324
|
+
}));
|
|
325
|
+
//#endregion
|
|
326
|
+
export default require_dbcs_codec();
|
|
327
|
+
export { require_dbcs_codec };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_shiftjis } from "./tables/shiftjis.json.js";
|
|
3
|
+
import { require_eucjp } from "./tables/eucjp.json.js";
|
|
4
|
+
import { require_cp936 } from "./tables/cp936.json.js";
|
|
5
|
+
import { require_gbk_added } from "./tables/gbk-added.json.js";
|
|
6
|
+
import { require_gb18030_ranges } from "./tables/gb18030-ranges.json.js";
|
|
7
|
+
import { require_cp949 } from "./tables/cp949.json.js";
|
|
8
|
+
import { require_cp950 } from "./tables/cp950.json.js";
|
|
9
|
+
import { require_big5_added } from "./tables/big5-added.json.js";
|
|
10
|
+
//#region ../../node_modules/.pnpm/iconv-lite@0.4.24/node_modules/iconv-lite/encodings/dbcs-data.js
|
|
11
|
+
var require_dbcs_data = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12
|
+
module.exports = {
|
|
13
|
+
"shiftjis": {
|
|
14
|
+
type: "_dbcs",
|
|
15
|
+
table: function() {
|
|
16
|
+
return require_shiftjis();
|
|
17
|
+
},
|
|
18
|
+
encodeAdd: {
|
|
19
|
+
"¥": 92,
|
|
20
|
+
"‾": 126
|
|
21
|
+
},
|
|
22
|
+
encodeSkipVals: [{
|
|
23
|
+
from: 60736,
|
|
24
|
+
to: 63808
|
|
25
|
+
}]
|
|
26
|
+
},
|
|
27
|
+
"csshiftjis": "shiftjis",
|
|
28
|
+
"mskanji": "shiftjis",
|
|
29
|
+
"sjis": "shiftjis",
|
|
30
|
+
"windows31j": "shiftjis",
|
|
31
|
+
"ms31j": "shiftjis",
|
|
32
|
+
"xsjis": "shiftjis",
|
|
33
|
+
"windows932": "shiftjis",
|
|
34
|
+
"ms932": "shiftjis",
|
|
35
|
+
"932": "shiftjis",
|
|
36
|
+
"cp932": "shiftjis",
|
|
37
|
+
"eucjp": {
|
|
38
|
+
type: "_dbcs",
|
|
39
|
+
table: function() {
|
|
40
|
+
return require_eucjp();
|
|
41
|
+
},
|
|
42
|
+
encodeAdd: {
|
|
43
|
+
"¥": 92,
|
|
44
|
+
"‾": 126
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"gb2312": "cp936",
|
|
48
|
+
"gb231280": "cp936",
|
|
49
|
+
"gb23121980": "cp936",
|
|
50
|
+
"csgb2312": "cp936",
|
|
51
|
+
"csiso58gb231280": "cp936",
|
|
52
|
+
"euccn": "cp936",
|
|
53
|
+
"windows936": "cp936",
|
|
54
|
+
"ms936": "cp936",
|
|
55
|
+
"936": "cp936",
|
|
56
|
+
"cp936": {
|
|
57
|
+
type: "_dbcs",
|
|
58
|
+
table: function() {
|
|
59
|
+
return require_cp936();
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"gbk": {
|
|
63
|
+
type: "_dbcs",
|
|
64
|
+
table: function() {
|
|
65
|
+
return require_cp936().concat(require_gbk_added());
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"xgbk": "gbk",
|
|
69
|
+
"isoir58": "gbk",
|
|
70
|
+
"gb18030": {
|
|
71
|
+
type: "_dbcs",
|
|
72
|
+
table: function() {
|
|
73
|
+
return require_cp936().concat(require_gbk_added());
|
|
74
|
+
},
|
|
75
|
+
gb18030: function() {
|
|
76
|
+
return require_gb18030_ranges();
|
|
77
|
+
},
|
|
78
|
+
encodeSkipVals: [128],
|
|
79
|
+
encodeAdd: { "€": 41699 }
|
|
80
|
+
},
|
|
81
|
+
"chinese": "gb18030",
|
|
82
|
+
"windows949": "cp949",
|
|
83
|
+
"ms949": "cp949",
|
|
84
|
+
"949": "cp949",
|
|
85
|
+
"cp949": {
|
|
86
|
+
type: "_dbcs",
|
|
87
|
+
table: function() {
|
|
88
|
+
return require_cp949();
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"cseuckr": "cp949",
|
|
92
|
+
"csksc56011987": "cp949",
|
|
93
|
+
"euckr": "cp949",
|
|
94
|
+
"isoir149": "cp949",
|
|
95
|
+
"korean": "cp949",
|
|
96
|
+
"ksc56011987": "cp949",
|
|
97
|
+
"ksc56011989": "cp949",
|
|
98
|
+
"ksc5601": "cp949",
|
|
99
|
+
"windows950": "cp950",
|
|
100
|
+
"ms950": "cp950",
|
|
101
|
+
"950": "cp950",
|
|
102
|
+
"cp950": {
|
|
103
|
+
type: "_dbcs",
|
|
104
|
+
table: function() {
|
|
105
|
+
return require_cp950();
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"big5": "big5hkscs",
|
|
109
|
+
"big5hkscs": {
|
|
110
|
+
type: "_dbcs",
|
|
111
|
+
table: function() {
|
|
112
|
+
return require_cp950().concat(require_big5_added());
|
|
113
|
+
},
|
|
114
|
+
encodeSkipVals: [41676]
|
|
115
|
+
},
|
|
116
|
+
"cnbig5": "big5hkscs",
|
|
117
|
+
"csbig5": "big5hkscs",
|
|
118
|
+
"xxbig5": "big5hkscs"
|
|
119
|
+
};
|
|
120
|
+
}));
|
|
121
|
+
//#endregion
|
|
122
|
+
export default require_dbcs_data();
|
|
123
|
+
export { require_dbcs_data };
|