vinext 1.0.0-beta.8 → 1.0.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 +158 -84
- package/THIRD_PARTY_LICENSES.md +25 -0
- package/dist/_virtual/_rolldown/runtime.js +25 -0
- package/dist/build/action-owner-manifest.d.ts +8 -9
- package/dist/build/action-owner-manifest.js +23 -5
- package/dist/build/assets-ignore.d.ts +3 -4
- package/dist/build/clean-output.d.ts +2 -3
- package/dist/build/client-build-config.d.ts +40 -12
- package/dist/build/client-build-config.js +76 -6
- package/dist/build/css-url-assets.d.ts +4 -5
- package/dist/build/css-url-assets.js +5 -2
- package/dist/build/google-fonts/build-url.d.ts +3 -4
- package/dist/build/google-fonts/fallback-metrics.d.ts +3 -4
- package/dist/build/google-fonts/find-font-files-in-css.d.ts +2 -3
- package/dist/build/google-fonts/font-metadata.d.ts +2 -3
- package/dist/build/google-fonts/get-axes.d.ts +2 -3
- package/dist/build/google-fonts/sort-variants.d.ts +2 -3
- package/dist/build/google-fonts/validate.d.ts +2 -3
- package/dist/build/google-fonts/validate.js +8 -4
- package/dist/build/inject-pregenerated-paths.d.ts +2 -3
- package/dist/build/inject-pregenerated-paths.js +16 -14
- package/dist/build/inline-css.d.ts +3 -4
- package/dist/build/layout-classification-types.d.ts +4 -5
- package/dist/build/layout-classification.d.ts +7 -8
- package/dist/build/lifecycle.d.ts +42 -0
- package/dist/build/lifecycle.js +253 -0
- package/dist/build/module-dependency-cache.d.ts +2 -3
- package/dist/build/next-client-runtime-manifests.d.ts +4 -5
- package/dist/build/nitro-route-rules.d.ts +6 -7
- package/dist/build/nitro-route-rules.js +1 -1
- package/dist/build/pages-client-assets-module.d.ts +4 -8
- package/dist/build/pages-client-assets-module.js +1 -13
- package/dist/build/precompress.d.ts +2 -3
- package/dist/build/prerender-cloudflare-loader.d.ts +4 -0
- package/dist/build/prerender-cloudflare-loader.js +49 -0
- package/dist/build/prerender-paths.d.ts +82 -8
- package/dist/build/prerender-paths.js +814 -99
- package/dist/build/prerender-phase.d.ts +2 -3
- package/dist/build/prerender-server-entry.js +11 -3
- package/dist/build/prerender-server-pool.d.ts +9 -6
- package/dist/build/prerender-server-pool.js +8 -5
- package/dist/build/prerender.d.ts +67 -15
- package/dist/build/prerender.js +177 -64
- package/dist/build/preview-credentials.d.ts +5 -6
- package/dist/build/preview-credentials.js +2 -2
- package/dist/build/public-dir-conflict.d.ts +5 -6
- package/dist/build/public-dir-conflict.js +2 -1
- package/dist/build/report.d.ts +38 -19
- package/dist/build/report.js +73 -4
- package/dist/build/route-classification-injector.d.ts +2 -3
- package/dist/build/route-classification-manifest.d.ts +5 -6
- package/dist/build/run-prerender.d.ts +11 -9
- package/dist/build/run-prerender.js +25 -16
- package/dist/build/server-entry.d.ts +4 -0
- package/dist/build/server-entry.js +28 -0
- package/dist/build/server-manifest.d.ts +8 -3
- package/dist/build/server-manifest.js +14 -2
- package/dist/build/ssr-manifest.d.ts +5 -6
- package/dist/build/standalone.d.ts +2 -3
- package/dist/build/standalone.js +2 -2
- package/dist/build/static-export.d.ts +7 -8
- package/dist/cache/cache-adapters-virtual.d.ts +95 -9
- package/dist/cache/cache-adapters-virtual.js +58 -6
- package/dist/check.d.ts +11 -10
- package/dist/check.js +467 -176
- package/dist/cli-args.d.ts +7 -16
- package/dist/cli-args.js +2 -45
- package/dist/cli-dev-config.d.ts +10 -7
- package/dist/cli-dev-config.js +160 -3
- package/dist/cli.js +124 -435
- package/dist/client/app-nav-failure-handler.d.ts +6 -7
- package/dist/client/client-rewrite-matcher.d.ts +2 -3
- package/dist/client/client-rewrites.d.ts +4 -5
- package/dist/client/dev-error-overlay-store.d.ts +13 -14
- package/dist/client/dev-error-overlay.d.ts +15 -15
- package/dist/client/dev-error-overlay.js +8 -5
- package/dist/client/instrumentation-client-inject.d.ts +3 -4
- package/dist/client/instrumentation-client-state.d.ts +5 -6
- package/dist/client/instrumentation-client.d.ts +3 -4
- package/dist/client/navigation-runtime.d.ts +21 -17
- package/dist/client/navigation-runtime.js +2 -1
- package/dist/client/pages-router-link-navigation.d.ts +4 -5
- package/dist/client/react-instance.d.ts +2 -3
- package/dist/client/validate-module-path.d.ts +2 -3
- package/dist/client/vinext-next-data.d.ts +7 -8
- package/dist/client/window-next.d.ts +4 -5
- package/dist/config/config-matchers.d.ts +16 -16
- package/dist/config/config-matchers.js +10 -7
- package/dist/config/dotenv.d.ts +3 -4
- package/dist/config/dotenv.js +2 -1
- package/dist/config/next-config.d.ts +31 -27
- package/dist/config/next-config.js +163 -16
- package/dist/config/prerender.d.ts +20 -16
- package/dist/config/prerender.js +10 -4
- package/dist/config/request-context.d.ts +5 -6
- package/dist/config/server-external-packages.d.ts +14 -3
- package/dist/config/server-external-packages.js +37 -3
- package/dist/config/tsconfig-paths.d.ts +3 -4
- package/dist/deps/.pnpm/ignore@5.3.2/deps/ignore/index.js +189 -0
- package/dist/deps/.pnpm/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +1057 -0
- package/dist/entries/app-browser-entry.d.ts +5 -6
- package/dist/entries/app-browser-entry.js +3 -2
- package/dist/entries/app-rsc-entry.d.ts +12 -3
- package/dist/entries/app-rsc-entry.js +530 -55
- package/dist/entries/app-rsc-manifest.d.ts +4 -3
- package/dist/entries/app-rsc-manifest.js +27 -8
- package/dist/entries/app-ssr-entry.d.ts +2 -3
- package/dist/entries/app-ssr-entry.js +8 -1
- package/dist/entries/pages-client-entry.d.ts +3 -3
- package/dist/entries/pages-client-entry.js +17 -2
- package/dist/entries/pages-server-entry.d.ts +13 -3
- package/dist/entries/pages-server-entry.js +237 -33
- package/dist/entries/runtime-entry-module.d.ts +4 -5
- package/dist/image/image-adapters-virtual.d.ts +4 -5
- package/dist/index.d.ts +10 -11
- package/dist/index.js +832 -199
- package/dist/init-cloudflare.d.ts +27 -16
- package/dist/init-cloudflare.js +754 -113
- package/dist/init-platform.d.ts +26 -22
- package/dist/init-platform.js +85 -29
- package/dist/init.d.ts +19 -13
- package/dist/init.js +123 -41
- package/dist/plugins/action-owner-manifest.d.ts +3 -4
- package/dist/plugins/action-owner-manifest.js +10 -3
- package/dist/plugins/ast-scope.d.ts +10 -11
- package/dist/plugins/ast-scope.js +10 -22
- package/dist/plugins/ast-utils.d.ts +16 -29
- package/dist/plugins/ast-utils.js +27 -71
- package/dist/plugins/async-hooks-stub.d.ts +2 -3
- package/dist/plugins/client-reference-dedup.d.ts +4 -5
- package/dist/plugins/css-data-url.d.ts +2 -3
- package/dist/plugins/css-module-imports.d.ts +3 -4
- package/dist/plugins/css-module-imports.js +1 -1
- package/dist/plugins/dynamic-preload-metadata.d.ts +3 -4
- package/dist/plugins/dynamic-preload-metadata.js +55 -154
- package/dist/plugins/environment.d.ts +2 -3
- package/dist/plugins/extensionless-dynamic-import.d.ts +2 -3
- package/dist/plugins/extensionless-dynamic-import.js +6 -10
- package/dist/plugins/fonts.d.ts +10 -11
- package/dist/plugins/fonts.js +4 -3
- package/dist/plugins/ignore-dynamic-requests.d.ts +3 -4
- package/dist/plugins/ignore-dynamic-requests.js +60 -89
- package/dist/plugins/import-meta-url.d.ts +6 -7
- package/dist/plugins/import-meta-url.js +31 -43
- package/dist/plugins/instrumentation-client.d.ts +3 -3
- package/dist/plugins/instrumentation-client.js +46 -10
- package/dist/plugins/middleware-export-validation.d.ts +3 -4
- package/dist/plugins/middleware-export-validation.js +3 -3
- package/dist/plugins/middleware-server-only.d.ts +2 -3
- package/dist/plugins/og-asset-ownership.d.ts +3 -4
- package/dist/plugins/og-assets.d.ts +4 -5
- package/dist/plugins/og-assets.js +32 -13
- package/dist/plugins/og-harfbuzz.d.ts +24 -0
- package/dist/plugins/og-harfbuzz.js +260 -0
- package/dist/plugins/optimize-imports.d.ts +7 -7
- package/dist/plugins/optimize-imports.js +32 -44
- package/dist/plugins/pages-node-externals.d.ts +2 -3
- package/dist/plugins/pages-node-externals.js +6 -11
- package/dist/plugins/postcss.d.ts +8 -4
- package/dist/plugins/postcss.js +1 -1
- package/dist/plugins/remove-console.d.ts +2 -3
- package/dist/plugins/remove-console.js +0 -1
- package/dist/plugins/require-condition-resolution.d.ts +3 -4
- package/dist/plugins/require-condition-resolution.js +17 -18
- package/dist/plugins/require-context.d.ts +2 -3
- package/dist/plugins/require-context.js +13 -21
- package/dist/plugins/rsc-client-reference-loaders.d.ts +2 -3
- package/dist/plugins/rsc-client-shim-excludes.d.ts +4 -5
- package/dist/plugins/rsc-client-shim-excludes.js +1 -0
- package/dist/plugins/rsc-reference-validation-normalizer.d.ts +2 -3
- package/dist/plugins/sass.d.ts +7 -8
- package/dist/plugins/sass.js +7 -4
- package/dist/plugins/server-externals-manifest.d.ts +2 -3
- package/dist/plugins/strip-server-exports.d.ts +5 -6
- package/dist/plugins/strip-server-exports.js +1 -1
- package/dist/plugins/styled-jsx.d.ts +2 -3
- package/dist/plugins/styled-jsx.js +7 -7
- package/dist/plugins/transform-cache.d.ts +2 -3
- package/dist/plugins/transform-result.d.ts +3 -4
- package/dist/plugins/transitive-externals.d.ts +2 -3
- package/dist/plugins/typeof-window.d.ts +6 -7
- package/dist/plugins/typeof-window.js +30 -31
- package/dist/plugins/use-cache-callable.d.ts +2 -5
- package/dist/plugins/use-cache-callable.js +43 -22
- package/dist/plugins/wasm-module-import.d.ts +2 -3
- package/dist/plugins/worker-image-imports.d.ts +2 -3
- package/dist/plugins/worker-image-imports.js +6 -8
- package/dist/routing/app-route-graph.d.ts +19 -19
- package/dist/routing/app-route-graph.js +3 -2
- package/dist/routing/app-router.d.ts +20 -5
- package/dist/routing/app-router.js +28 -2
- package/dist/routing/file-matcher.d.ts +9 -10
- package/dist/routing/pages-router.d.ts +6 -6
- package/dist/routing/pages-router.js +1 -1
- package/dist/routing/route-matching.d.ts +4 -5
- package/dist/routing/route-matching.js +4 -2
- package/dist/routing/route-pattern.d.ts +13 -14
- package/dist/routing/route-trie.d.ts +5 -6
- package/dist/routing/route-validation.d.ts +3 -4
- package/dist/routing/route-validation.js +12 -11
- package/dist/routing/utils.d.ts +13 -14
- package/dist/server/accept-encoding.d.ts +9 -10
- package/dist/server/api-handler.d.ts +2 -3
- package/dist/server/api-handler.js +9 -6
- package/dist/server/app-action-forwarding.d.ts +3 -4
- package/dist/server/app-action-forwarding.js +1 -1
- package/dist/server/app-action-request.d.ts +2 -3
- package/dist/server/app-bfcache-id.d.ts +3 -4
- package/dist/server/app-bfcache-identity.d.ts +8 -9
- package/dist/server/app-browser-action-result.d.ts +15 -16
- package/dist/server/app-browser-client-reuse-manifest.d.ts +2 -3
- package/dist/server/app-browser-entry.js +121 -40
- package/dist/server/app-browser-error.d.ts +5 -6
- package/dist/server/app-browser-error.js +9 -3
- package/dist/server/app-browser-history-controller.d.ts +4 -5
- package/dist/server/app-browser-hydration.d.ts +16 -6
- package/dist/server/app-browser-hydration.js +14 -1
- package/dist/server/app-browser-interception-context.d.ts +3 -4
- package/dist/server/app-browser-mpa-navigation.d.ts +4 -5
- package/dist/server/app-browser-navigation-abort.d.ts +3 -4
- package/dist/server/app-browser-navigation-controller.d.ts +8 -8
- package/dist/server/app-browser-navigation-controller.js +9 -5
- package/dist/server/app-browser-navigation-response.d.ts +2 -3
- package/dist/server/app-browser-popstate.d.ts +4 -5
- package/dist/server/app-browser-prefetch-response.d.ts +5 -6
- package/dist/server/app-browser-rsc-redirect.d.ts +4 -5
- package/dist/server/app-browser-server-action-client.d.ts +7 -6
- package/dist/server/app-browser-server-action-client.js +9 -5
- package/dist/server/app-browser-server-action-navigation.d.ts +2 -3
- package/dist/server/app-browser-state.d.ts +17 -17
- package/dist/server/app-browser-state.js +7 -3
- package/dist/server/app-browser-stream.d.ts +4 -5
- package/dist/server/app-browser-stream.js +8 -6
- package/dist/server/app-browser-supplemental-refresh.d.ts +11 -12
- package/dist/server/app-browser-visible-commit.d.ts +6 -7
- package/dist/server/app-browser-visible-commit.js +1 -1
- package/dist/server/app-client-reference-preloader.d.ts +2 -3
- package/dist/server/app-elements-wire-key.d.ts +25 -0
- package/dist/server/app-elements-wire-key.js +69 -0
- package/dist/server/app-elements-wire.d.ts +34 -53
- package/dist/server/app-elements-wire.js +4 -75
- package/dist/server/app-elements.d.ts +5 -5
- package/dist/server/app-elements.js +1 -1
- package/dist/server/app-fallback-renderer.d.ts +4 -4
- package/dist/server/app-fallback-renderer.js +6 -6
- package/dist/server/app-fetch-tracing.d.ts +15 -0
- package/dist/server/app-fetch-tracing.js +38 -0
- package/dist/server/app-history-state.d.ts +26 -27
- package/dist/server/app-history-state.js +19 -11
- package/dist/server/app-hook-warning-suppression.d.ts +2 -3
- package/dist/server/app-hydration-cache-publication.d.ts +3 -4
- package/dist/server/app-inline-css-client.d.ts +3 -4
- package/dist/server/app-interception-context-header.d.ts +2 -3
- package/dist/server/app-layout-param-observation.d.ts +7 -8
- package/dist/server/app-metadata-tracing.d.ts +12 -0
- package/dist/server/app-metadata-tracing.js +17 -0
- package/dist/server/app-middleware.d.ts +15 -7
- package/dist/server/app-middleware.js +30 -5
- package/dist/server/app-mounted-slots-header.d.ts +2 -3
- package/dist/server/app-mounted-slots-header.js +2 -2
- package/dist/server/app-optimistic-routing.d.ts +14 -10
- package/dist/server/app-optimistic-routing.js +16 -3
- package/dist/server/app-page-boundary-render.d.ts +6 -6
- package/dist/server/app-page-boundary-render.js +10 -4
- package/dist/server/app-page-boundary.d.ts +9 -10
- package/dist/server/app-page-boundary.js +2 -1
- package/dist/server/app-page-cache-finalizer.d.ts +32 -8
- package/dist/server/app-page-cache-finalizer.js +118 -14
- package/dist/server/app-page-cache-render.d.ts +8 -5
- package/dist/server/app-page-cache-render.js +22 -5
- package/dist/server/app-page-cache.d.ts +28 -9
- package/dist/server/app-page-cache.js +96 -25
- package/dist/server/app-page-dispatch.d.ts +36 -12
- package/dist/server/app-page-dispatch.js +188 -63
- package/dist/server/app-page-element-builder.d.ts +13 -11
- package/dist/server/app-page-element-builder.js +104 -61
- package/dist/server/app-page-execution.d.ts +14 -14
- package/dist/server/app-page-execution.js +12 -8
- package/dist/server/app-page-head.d.ts +19 -16
- package/dist/server/app-page-head.js +25 -25
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +6 -5
- package/dist/server/app-page-http-access-fallback-metadata.js +9 -2
- package/dist/server/app-page-method.d.ts +5 -11
- package/dist/server/app-page-method.js +2 -9
- package/dist/server/app-page-params.d.ts +5 -6
- package/dist/server/app-page-ppr-runtime.d.ts +2 -2
- package/dist/server/app-page-probe.d.ts +5 -6
- package/dist/server/app-page-probe.js +5 -4
- package/dist/server/app-page-render-identity.d.ts +4 -5
- package/dist/server/app-page-render-observation.d.ts +8 -9
- package/dist/server/app-page-render-observation.js +1 -1
- package/dist/server/app-page-render.d.ts +42 -6
- package/dist/server/app-page-render.js +192 -28
- package/dist/server/app-page-request.d.ts +10 -9
- package/dist/server/app-page-request.js +16 -12
- package/dist/server/app-page-response.d.ts +20 -9
- package/dist/server/app-page-response.js +31 -13
- package/dist/server/app-page-route-wiring.d.ts +15 -15
- package/dist/server/app-page-route-wiring.js +31 -24
- package/dist/server/app-page-search-params-observation.d.ts +26 -5
- package/dist/server/app-page-search-params-observation.js +42 -6
- package/dist/server/app-page-segment-plan.d.ts +2 -3
- package/dist/server/app-page-segment-state.d.ts +11 -12
- package/dist/server/app-page-stream.d.ts +27 -11
- package/dist/server/app-page-stream.js +35 -6
- package/dist/server/app-page-tracing.d.ts +33 -0
- package/dist/server/app-page-tracing.js +49 -0
- package/dist/server/app-pages-bridge.d.ts +6 -6
- package/dist/server/app-pages-bridge.js +19 -4
- package/dist/server/app-post-middleware-context.d.ts +2 -3
- package/dist/server/app-ppr-fallback-shell-render.d.ts +3 -4
- package/dist/server/app-ppr-fallback-shell-render.js +3 -2
- package/dist/server/app-ppr-fallback-shell.d.ts +6 -7
- package/dist/server/app-prerender-endpoints.d.ts +5 -5
- package/dist/server/app-prerender-endpoints.js +26 -12
- package/dist/server/app-prerender-static-params.d.ts +15 -7
- package/dist/server/app-prerender-static-params.js +33 -11
- package/dist/server/app-render-dependency.d.ts +14 -13
- package/dist/server/app-render-dependency.js +5 -1
- package/dist/server/app-request-context.d.ts +3 -4
- package/dist/server/app-request-stage-context.d.ts +5 -0
- package/dist/server/app-request-stage-context.js +11 -0
- package/dist/server/app-request-stage-dispatch.d.ts +25 -0
- package/dist/server/app-request-stage-dispatch.js +54 -0
- package/dist/server/app-request-stage-independent-entry.d.ts +8 -0
- package/dist/server/app-request-stage-independent-entry.js +115 -0
- package/dist/server/app-response-header-provenance.d.ts +13 -7
- package/dist/server/app-response-header-provenance.js +34 -1
- package/dist/server/app-response-stage-entry.d.ts +9 -0
- package/dist/server/app-response-stage-entry.js +87 -0
- package/dist/server/app-route-handler-cache.d.ts +2 -3
- package/dist/server/app-route-handler-cache.js +46 -34
- package/dist/server/app-route-handler-dispatch.d.ts +3 -3
- package/dist/server/app-route-handler-dispatch.js +75 -57
- package/dist/server/app-route-handler-execution.d.ts +18 -13
- package/dist/server/app-route-handler-execution.js +189 -25
- package/dist/server/app-route-handler-middleware-context.d.ts +8 -0
- package/dist/server/app-route-handler-middleware-context.js +15 -0
- package/dist/server/app-route-handler-policy.d.ts +22 -10
- package/dist/server/app-route-handler-policy.js +19 -4
- package/dist/server/app-route-handler-response.d.ts +9 -10
- package/dist/server/app-route-handler-response.js +2 -0
- package/dist/server/app-route-handler-runtime.d.ts +9 -10
- package/dist/server/app-route-handler-runtime.js +20 -16
- package/dist/server/app-route-module-loader.d.ts +6 -7
- package/dist/server/app-route-request-built-ins.d.ts +3 -4
- package/dist/server/app-route-tree-prefetch.d.ts +6 -7
- package/dist/server/app-route-tree-prefetch.js +2 -1
- package/dist/server/app-router-entry.d.ts +2 -0
- package/dist/server/app-router-entry.js +76 -12
- package/dist/server/app-rsc-cache-busting.d.ts +47 -22
- package/dist/server/app-rsc-cache-busting.js +80 -18
- package/dist/server/app-rsc-combined-handler.d.ts +9 -0
- package/dist/server/app-rsc-combined-handler.js +11 -0
- package/dist/server/app-rsc-embedded-chunks.d.ts +6 -7
- package/dist/server/app-rsc-error-handler.d.ts +12 -6
- package/dist/server/app-rsc-error-handler.js +15 -6
- package/dist/server/app-rsc-errors.d.ts +12 -9
- package/dist/server/app-rsc-errors.js +15 -13
- package/dist/server/app-rsc-handler.d.ts +33 -6
- package/dist/server/app-rsc-handler.js +498 -83
- package/dist/server/app-rsc-redirect-flight.d.ts +4 -5
- package/dist/server/app-rsc-render-mode.d.ts +8 -9
- package/dist/server/app-rsc-request-normalization.d.ts +3 -3
- package/dist/server/app-rsc-request-normalization.js +2 -1
- package/dist/server/app-rsc-response-finalizer.d.ts +8 -5
- package/dist/server/app-rsc-response-finalizer.js +24 -7
- package/dist/server/app-rsc-response-stage.d.ts +6 -0
- package/dist/server/app-rsc-response-stage.js +251 -0
- package/dist/server/app-rsc-route-matching.d.ts +4 -4
- package/dist/server/app-rsc-route-matching.js +4 -2
- package/dist/server/app-rsc-state-fingerprint.d.ts +3 -4
- package/dist/server/app-rsc-vary.d.ts +16 -0
- package/dist/server/app-rsc-vary.js +31 -0
- package/dist/server/app-segment-config.d.ts +120 -6
- package/dist/server/app-segment-config.js +264 -12
- package/dist/server/app-server-action-execution.d.ts +16 -12
- package/dist/server/app-server-action-execution.js +88 -35
- package/dist/server/app-ssr-entry.d.ts +14 -4
- package/dist/server/app-ssr-entry.js +64 -17
- package/dist/server/app-ssr-error-meta.d.ts +3 -4
- package/dist/server/app-ssr-error-meta.js +2 -1
- package/dist/server/app-ssr-router-instance.d.ts +2 -3
- package/dist/server/app-ssr-search-params-gate.d.ts +20 -0
- package/dist/server/app-ssr-search-params-gate.js +54 -0
- package/dist/server/app-ssr-stream.d.ts +13 -9
- package/dist/server/app-ssr-stream.js +33 -7
- package/dist/server/app-static-generation.d.ts +4 -5
- package/dist/server/app-visited-response-cache.d.ts +11 -12
- package/dist/server/app-visited-response-cache.js +2 -2
- package/dist/server/app-worker-stages.d.ts +112 -0
- package/dist/server/app-worker-stages.js +105 -0
- package/dist/server/artifact-compatibility.d.ts +11 -12
- package/dist/server/before-interactive-head.d.ts +2 -3
- package/dist/server/bfcache-identity.d.ts +7 -8
- package/dist/server/cache-control.d.ts +39 -11
- package/dist/server/cache-control.js +104 -7
- package/dist/server/cache-headers.d.ts +3 -4
- package/dist/server/cache-proof.d.ts +75 -70
- package/dist/server/cache-proof.js +9 -1
- package/dist/server/cacheability-limits.d.ts +8 -0
- package/dist/server/cacheability-limits.js +9 -0
- package/dist/server/cacheability-manifest.d.ts +68 -0
- package/dist/server/cacheability-manifest.js +241 -0
- package/dist/server/cacheability-request.d.ts +49 -0
- package/dist/server/cacheability-request.js +559 -0
- package/dist/server/client-reuse-manifest.d.ts +17 -18
- package/dist/server/client-reuse-manifest.js +2 -2
- package/dist/server/client-trace-metadata.d.ts +9 -6
- package/dist/server/client-trace-metadata.js +27 -15
- package/dist/server/cloudflare-workers-tracing.d.ts +1 -0
- package/dist/server/cloudflare-workers-tracing.js +8 -0
- package/dist/server/config-headers.d.ts +19 -5
- package/dist/server/config-headers.js +39 -5
- package/dist/server/cookie-utils.d.ts +2 -3
- package/dist/server/csp.d.ts +5 -6
- package/dist/server/default-global-error-module.d.ts +2 -3
- package/dist/server/default-global-not-found-module.d.ts +2 -3
- package/dist/server/default-not-found-module.d.ts +2 -3
- package/dist/server/defer-until-stream-consumed.d.ts +2 -3
- package/dist/server/defer-until-stream-consumed.js +2 -1
- package/dist/server/dev-initial-server-error.d.ts +3 -4
- package/dist/server/dev-initial-server-error.js +2 -1
- package/dist/server/dev-lockfile.d.ts +7 -8
- package/dist/server/dev-lockfile.js +4 -1
- package/dist/server/dev-module-runner.d.ts +2 -3
- package/dist/server/dev-origin-check.d.ts +5 -6
- package/dist/server/dev-route-files.d.ts +2 -3
- package/dist/server/dev-server.d.ts +4 -5
- package/dist/server/dev-server.js +130 -61
- package/dist/server/dev-stack-sourcemap.d.ts +7 -7
- package/dist/server/dev-stack-sourcemap.js +1 -1
- package/dist/server/document-initial-head.d.ts +3 -4
- package/dist/server/edge-api-runtime.d.ts +4 -5
- package/dist/server/fetch-handler.d.ts +3 -2
- package/dist/server/fetch-handler.js +3 -18
- package/dist/server/file-based-metadata.d.ts +2 -3
- package/dist/server/framework-tracer.d.ts +46 -0
- package/dist/server/framework-tracer.js +125 -0
- package/dist/server/fully-buffered-response.d.ts +11 -0
- package/dist/server/fully-buffered-response.js +19 -0
- package/dist/server/headers.d.ts +62 -56
- package/dist/server/headers.js +33 -20
- package/dist/server/html.d.ts +6 -27
- package/dist/server/html.js +16 -1
- package/dist/server/http-conditional.d.ts +5 -6
- package/dist/server/http-date.d.ts +2 -3
- package/dist/server/http-error-responses.d.ts +9 -10
- package/dist/server/http-range.d.ts +4 -5
- package/dist/server/hybrid-route-priority.d.ts +4 -5
- package/dist/server/image-optimization.d.ts +20 -21
- package/dist/server/implicit-tags.d.ts +3 -4
- package/dist/server/instrumentation-runtime.d.ts +17 -21
- package/dist/server/instrumentation-runtime.js +26 -8
- package/dist/server/instrumentation.d.ts +26 -30
- package/dist/server/instrumentation.js +18 -23
- package/dist/server/isr-cache.d.ts +28 -27
- package/dist/server/isr-cache.js +18 -70
- package/dist/server/isr-decision.d.ts +4 -4
- package/dist/server/metadata-route-build-data.d.ts +4 -5
- package/dist/server/metadata-route-cache-policy.d.ts +2 -3
- package/dist/server/metadata-route-response.d.ts +7 -7
- package/dist/server/metadata-route-response.js +68 -2
- package/dist/server/metadata-routes.d.ts +18 -19
- package/dist/server/middleware-matcher-pattern.d.ts +6 -7
- package/dist/server/middleware-matcher.d.ts +13 -6
- package/dist/server/middleware-matcher.js +22 -1
- package/dist/server/middleware-path-to-regexp.d.ts +6 -7
- package/dist/server/middleware-path-to-regexp.js +11 -9
- package/dist/server/middleware-response-headers.d.ts +3 -4
- package/dist/server/middleware-runtime.d.ts +13 -8
- package/dist/server/middleware-runtime.js +54 -10
- package/dist/server/middleware.d.ts +5 -5
- package/dist/server/multi-stage.d.ts +141 -0
- package/dist/server/multi-stage.js +8 -0
- package/dist/server/navigation-planner.d.ts +26 -26
- package/dist/server/navigation-trace.d.ts +11 -12
- package/dist/server/next-error-digest.d.ts +4 -5
- package/dist/server/normalize-path.d.ts +5 -6
- package/dist/server/normalize-path.js +1 -1
- package/dist/server/open-redirect.d.ts +2 -3
- package/dist/server/opentelemetry-api.d.ts +59 -0
- package/dist/server/opentelemetry-api.js +53 -0
- package/dist/server/opentelemetry-tracing.d.ts +5 -0
- package/dist/server/opentelemetry-tracing.js +83 -0
- package/dist/server/operation-token.d.ts +11 -12
- package/dist/server/otel-tracer-extension.d.ts +7 -9
- package/dist/server/otel-tracer-extension.js +37 -36
- package/dist/server/pages-api-route.d.ts +5 -4
- package/dist/server/pages-api-route.js +21 -8
- package/dist/server/pages-asset-tags.d.ts +6 -6
- package/dist/server/pages-asset-tags.js +37 -2
- package/dist/server/pages-body-parser-config.d.ts +4 -5
- package/dist/server/pages-body-parser-config.js +4 -4
- package/dist/server/pages-client-assets.d.ts +11 -5
- package/dist/server/pages-data-route.d.ts +11 -12
- package/dist/server/pages-data-route.js +1 -1
- package/dist/server/pages-default-404.d.ts +3 -4
- package/dist/server/pages-dev-hydration.d.ts +9 -4
- package/dist/server/pages-dev-hydration.js +19 -7
- package/dist/server/pages-dev-module-url.d.ts +3 -4
- package/dist/server/pages-dev-stylesheets.d.ts +5 -6
- package/dist/server/pages-document-asset-props.d.ts +6 -7
- package/dist/server/pages-document-initial-props.d.ts +5 -5
- package/dist/server/pages-document-initial-props.js +4 -2
- package/dist/server/pages-execution-tracing.d.ts +40 -0
- package/dist/server/pages-execution-tracing.js +80 -0
- package/dist/server/pages-get-initial-props.d.ts +9 -10
- package/dist/server/pages-i18n.d.ts +8 -8
- package/dist/server/pages-i18n.js +3 -2
- package/dist/server/pages-media-type.d.ts +4 -5
- package/dist/server/pages-node-compat.d.ts +11 -10
- package/dist/server/pages-node-compat.js +12 -4
- package/dist/server/pages-page-data.d.ts +18 -19
- package/dist/server/pages-page-data.js +11 -10
- package/dist/server/pages-page-handler.d.ts +7 -6
- package/dist/server/pages-page-handler.js +98 -47
- package/dist/server/pages-page-method.d.ts +2 -3
- package/dist/server/pages-page-response.d.ts +14 -10
- package/dist/server/pages-page-response.js +49 -31
- package/dist/server/pages-preview.d.ts +10 -11
- package/dist/server/pages-readiness.d.ts +2 -3
- package/dist/server/pages-request-pipeline.d.ts +16 -12
- package/dist/server/pages-request-pipeline.js +69 -28
- package/dist/server/pages-request-stage-entry.d.ts +23 -0
- package/dist/server/pages-request-stage-entry.js +314 -0
- package/dist/server/pages-response-stage-entry.d.ts +11 -0
- package/dist/server/pages-response-stage-entry.js +106 -0
- package/dist/server/pages-response-stage.d.ts +31 -0
- package/dist/server/pages-response-stage.js +49 -0
- package/dist/server/pages-revalidate.d.ts +3 -4
- package/dist/server/pages-revalidate.js +9 -4
- package/dist/server/pages-route-data-kind.d.ts +18 -0
- package/dist/server/pages-route-data-kind.js +11 -0
- package/dist/server/pages-router-entry.d.ts +1 -25
- package/dist/server/pages-router-entry.js +48 -114
- package/dist/server/pages-serializable-props.d.ts +3 -4
- package/dist/server/pregenerated-concrete-paths.d.ts +9 -7
- package/dist/server/pregenerated-concrete-paths.js +12 -6
- package/dist/server/prerender-cache-life-header.d.ts +3 -4
- package/dist/server/prerender-manifest.d.ts +11 -11
- package/dist/server/prerender-manifest.js +6 -3
- package/dist/server/prerender-route-params.d.ts +16 -9
- package/dist/server/prerender-route-params.js +18 -2
- package/dist/server/prerender-work-unit-setup.d.ts +4 -4
- package/dist/server/prerender-work-unit-setup.js +37 -14
- package/dist/server/prod-server.d.ts +12 -9
- package/dist/server/prod-server.js +129 -36
- package/dist/server/proxy-trust.d.ts +5 -6
- package/dist/server/request-log.d.ts +3 -4
- package/dist/server/request-pipeline.d.ts +17 -21
- package/dist/server/request-pipeline.js +8 -10
- package/dist/server/request-stage.d.ts +5 -0
- package/dist/server/request-stage.js +7 -0
- package/dist/server/request-tracing.d.ts +22 -0
- package/dist/server/request-tracing.js +180 -0
- package/dist/server/response-stage-cacheability.d.ts +37 -0
- package/dist/server/response-stage-cacheability.js +55 -0
- package/dist/server/response-stage-policy.d.ts +23 -0
- package/dist/server/response-stage-policy.js +89 -0
- package/dist/server/response-stage.d.ts +5 -0
- package/dist/server/response-stage.js +7 -0
- package/dist/server/response-start-tracing.d.ts +14 -0
- package/dist/server/response-start-tracing.js +80 -0
- package/dist/server/revalidation-host.d.ts +2 -3
- package/dist/server/revalidation-host.js +2 -1
- package/dist/server/revalidation-request.d.ts +8 -0
- package/dist/server/revalidation-request.js +37 -0
- package/dist/server/rsc-completion-metadata.d.ts +6 -7
- package/dist/server/rsc-stream-hints.d.ts +18 -7
- package/dist/server/rsc-stream-hints.js +70 -35
- package/dist/server/seed-cache.d.ts +2 -3
- package/dist/server/seed-cache.js +8 -7
- package/dist/server/server-action-not-found.d.ts +5 -6
- package/dist/server/server-globals.d.ts +2 -3
- package/dist/server/server-globals.js +13 -0
- package/dist/server/skip-cache-proof.d.ts +4 -4
- package/dist/server/socket-error-backstop.d.ts +5 -6
- package/dist/server/socket-error-backstop.js +1 -1
- package/dist/server/static-file-cache.d.ts +5 -6
- package/dist/server/static-file-cache.js +9 -7
- package/dist/server/static-file-signal.d.ts +16 -0
- package/dist/server/static-file-signal.js +82 -0
- package/dist/server/static-layout-client-reuse-proof.d.ts +4 -5
- package/dist/server/streaming-metadata.d.ts +2 -3
- package/dist/server/tracer.d.ts +5 -0
- package/dist/server/tracer.js +13 -0
- package/dist/server/worker-prerender-discovery.d.ts +18 -0
- package/dist/server/worker-prerender-discovery.js +55 -0
- package/dist/server/worker-revalidation-context.d.ts +2 -3
- package/dist/server/worker-revalidation-context.js +5 -5
- package/dist/server/worker-stages.d.ts +43 -0
- package/dist/server/worker-stages.js +25 -0
- package/dist/server/worker-utils.d.ts +5 -6
- package/dist/server/worker-utils.js +4 -4
- package/dist/server/workers-tracing.d.ts +17 -0
- package/dist/server/workers-tracing.js +27 -0
- package/dist/shims/amp.d.ts +3 -4
- package/dist/shims/app-router-scroll-state.d.ts +9 -10
- package/dist/shims/app-router-scroll.d.ts +4 -5
- package/dist/shims/app-router-scroll.js +2 -1
- package/dist/shims/app.d.ts +5 -6
- package/dist/shims/before-interactive-context.d.ts +5 -6
- package/dist/shims/cache-callable-runtime.d.ts +44 -4
- package/dist/shims/cache-callable-runtime.js +168 -8
- package/dist/shims/cache-for-request.d.ts +2 -3
- package/dist/shims/cache-handler.d.ts +33 -20
- package/dist/shims/cache-handler.js +61 -2
- package/dist/shims/cache-request-state.d.ts +28 -29
- package/dist/shims/cache-runtime.d.ts +23 -21
- package/dist/shims/cache-runtime.js +239 -121
- package/dist/shims/cache.d.ts +15 -15
- package/dist/shims/cache.js +25 -13
- package/dist/shims/cacheability-classification.d.ts +106 -0
- package/dist/shims/cacheability-classification.js +161 -0
- package/dist/shims/cdn-cache-state.d.ts +13 -0
- package/dist/shims/cdn-cache-state.js +23 -0
- package/dist/shims/cdn-cache.d.ts +76 -18
- package/dist/shims/cdn-cache.js +40 -39
- package/dist/shims/client-hook-error.d.ts +3 -4
- package/dist/shims/client-locale.d.ts +2 -3
- package/dist/shims/client-page-root.d.ts +24 -0
- package/dist/shims/client-page-root.js +121 -0
- package/dist/shims/compat-router.d.ts +2 -3
- package/dist/shims/config.d.ts +3 -4
- package/dist/shims/constants.d.ts +73 -74
- package/dist/shims/constants.js +1 -1
- package/dist/shims/default-not-found.d.ts +2 -3
- package/dist/shims/document.d.ts +9 -9
- package/dist/shims/dynamic-preload-chunks.d.ts +2 -3
- package/dist/shims/dynamic-preload-chunks.js +17 -13
- package/dist/shims/dynamic.d.ts +3 -3
- package/dist/shims/error-boundary-navigation.d.ts +3 -4
- package/dist/shims/error-boundary.d.ts +17 -18
- package/dist/shims/error-boundary.js +17 -11
- package/dist/shims/error.d.ts +4 -4
- package/dist/shims/error.js +1 -1
- package/dist/shims/error.react-server.d.ts +3 -4
- package/dist/shims/fetch-cache.d.ts +22 -22
- package/dist/shims/fetch-cache.js +50 -20
- package/dist/shims/font-google-base.d.ts +9 -9
- package/dist/shims/font-google-base.js +2 -1
- package/dist/shims/font-local.d.ts +3 -3
- package/dist/shims/font-local.js +1 -1
- package/dist/shims/font-utils.d.ts +14 -15
- package/dist/shims/form.d.ts +2 -2
- package/dist/shims/form.js +10 -7
- package/dist/shims/hash-scroll.d.ts +5 -6
- package/dist/shims/head-state.d.ts +4 -5
- package/dist/shims/head.d.ts +16 -16
- package/dist/shims/head.js +5 -4
- package/dist/shims/headers.d.ts +68 -32
- package/dist/shims/headers.js +101 -10
- package/dist/shims/i18n-context.d.ts +5 -6
- package/dist/shims/i18n-state.d.ts +4 -5
- package/dist/shims/image-config.d.ts +5 -6
- package/dist/shims/image-config.js +2 -0
- package/dist/shims/image.d.ts +5 -5
- package/dist/shims/image.js +12 -8
- package/dist/shims/internal/als-registry.d.ts +4 -5
- package/dist/shims/internal/api-utils.d.ts +3 -4
- package/dist/shims/internal/app-page-props-cache-key.d.ts +32 -4
- package/dist/shims/internal/app-page-props-cache-key.js +53 -1
- package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +5 -6
- package/dist/shims/internal/app-prefetch-rsc-request.d.ts +13 -0
- package/dist/shims/internal/app-prefetch-rsc-request.js +12 -0
- package/dist/shims/internal/app-route-detection.d.ts +2 -2
- package/dist/shims/internal/app-route-prefetch-policy.d.ts +5 -6
- package/dist/shims/internal/app-route-prefetch-policy.js +1 -0
- package/dist/shims/internal/app-router-context.d.ts +9 -10
- package/dist/shims/internal/cookie-serialize.d.ts +4 -5
- package/dist/shims/internal/format-url-object.d.ts +7 -0
- package/dist/shims/internal/format-url-object.js +53 -0
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +6 -7
- package/dist/shims/internal/hybrid-client-route-owner-direct.js +29 -11
- package/dist/shims/internal/hybrid-client-route-owner.d.ts +3 -3
- package/dist/shims/internal/hybrid-client-route-owner.js +5 -4
- package/dist/shims/internal/interpolate-as.d.ts +5 -6
- package/dist/shims/internal/interpolate-as.js +4 -2
- package/dist/shims/internal/link-status-registry.d.ts +5 -6
- package/dist/shims/internal/make-hanging-promise.d.ts +8 -3
- package/dist/shims/internal/make-hanging-promise.js +13 -2
- package/dist/shims/internal/navigation-untracked.d.ts +2 -3
- package/dist/shims/internal/normalize-router-href.d.ts +15 -0
- package/dist/shims/internal/normalize-router-href.js +41 -0
- package/dist/shims/internal/pages-data-fetch-dedup.d.ts +8 -9
- package/dist/shims/internal/pages-data-target.d.ts +8 -6
- package/dist/shims/internal/pages-data-target.js +32 -36
- package/dist/shims/internal/pages-data-url.d.ts +4 -5
- package/dist/shims/internal/pages-data-url.js +2 -1
- package/dist/shims/internal/pages-router-accessor.d.ts +3 -4
- package/dist/shims/internal/pages-router-components.d.ts +3 -4
- package/dist/shims/internal/route-pattern-for-warning.d.ts +5 -6
- package/dist/shims/internal/route-pattern-for-warning.js +3 -3
- package/dist/shims/internal/router-context.d.ts +2 -3
- package/dist/shims/internal/thenable-well-known-properties.d.ts +10 -0
- package/dist/shims/internal/thenable-well-known-properties.js +33 -0
- package/dist/shims/internal/utils.d.ts +7 -8
- package/dist/shims/internal/work-unit-async-storage.d.ts +12 -11
- package/dist/shims/layout-segment-context.d.ts +3 -4
- package/dist/shims/link-prefetch.d.ts +9 -10
- package/dist/shims/link.d.ts +4 -4
- package/dist/shims/link.js +67 -116
- package/dist/shims/metadata.d.ts +15 -16
- package/dist/shims/metadata.js +40 -36
- package/dist/shims/navigation-context-accessors.d.ts +9 -0
- package/dist/shims/navigation-context-accessors.js +19 -0
- package/dist/shims/navigation-context-state.d.ts +27 -18
- package/dist/shims/navigation-errors.d.ts +18 -19
- package/dist/shims/navigation-state.d.ts +6 -7
- package/dist/shims/navigation.d.ts +80 -68
- package/dist/shims/navigation.js +45 -17
- package/dist/shims/navigation.react-server.d.ts +9 -9
- package/dist/shims/navigation.react-server.js +1 -1
- package/dist/shims/offline.d.ts +2 -3
- package/dist/shims/og.d.ts +2 -2
- package/dist/shims/pages-router-runtime.d.ts +4 -5
- package/dist/shims/ppr-fallback-shell.d.ts +13 -14
- package/dist/shims/readonly-url-search-params.d.ts +2 -3
- package/dist/shims/request-context.d.ts +7 -6
- package/dist/shims/root-params.d.ts +14 -15
- package/dist/shims/router-state.d.ts +5 -6
- package/dist/shims/router-state.js +1 -1
- package/dist/shims/router.d.ts +22 -21
- package/dist/shims/router.js +339 -164
- package/dist/shims/script-nonce-context.d.ts +8 -6
- package/dist/shims/script-nonce-context.js +15 -6
- package/dist/shims/script.d.ts +4 -4
- package/dist/shims/script.js +9 -7
- package/dist/shims/search-params-gate.d.ts +35 -0
- package/dist/shims/search-params-gate.js +32 -0
- package/dist/shims/server.d.ts +19 -51
- package/dist/shims/server.js +14 -28
- package/dist/shims/slot.d.ts +33 -15
- package/dist/shims/slot.js +41 -9
- package/dist/shims/streamed-icons.d.ts +3 -4
- package/dist/shims/thenable-params.d.ts +5 -7
- package/dist/shims/thenable-params.js +3 -24
- package/dist/shims/unified-request-context.d.ts +34 -31
- package/dist/shims/unified-request-context.js +34 -24
- package/dist/shims/unrecognized-action-error.d.ts +3 -4
- package/dist/shims/url-safety.d.ts +5 -6
- package/dist/shims/url-utils.d.ts +18 -12
- package/dist/shims/url-utils.js +10 -1
- package/dist/shims/use-merged-ref.d.ts +2 -3
- package/dist/shims/user-agent.d.ts +31 -0
- package/dist/shims/user-agent.js +16 -0
- package/dist/shims/web-vitals.d.ts +2 -2
- package/dist/typegen.d.ts +3 -4
- package/dist/utils/asset-prefix.d.ts +7 -8
- package/dist/utils/base-path.d.ts +5 -6
- package/dist/utils/built-asset-url.d.ts +2 -3
- package/dist/utils/built-asset-url.js +1 -1
- package/dist/utils/cache-control-metadata.d.ts +4 -5
- package/dist/utils/client-build-manifest.d.ts +6 -7
- package/dist/utils/client-build-manifest.js +2 -1
- package/dist/utils/client-entry-manifest.d.ts +6 -7
- package/dist/utils/client-runtime-metadata.d.ts +8 -3
- package/dist/utils/client-runtime-metadata.js +18 -1
- package/dist/utils/commonjs-loader.d.ts +4 -5
- package/dist/utils/compare.d.ts +2 -3
- package/dist/utils/deployment-id.d.ts +6 -7
- package/dist/utils/dev-error-recovery-event.d.ts +2 -3
- package/dist/utils/dev-stack-sourcemap-endpoint.d.ts +2 -3
- package/dist/utils/domain-locale.d.ts +7 -8
- package/dist/utils/encode-cache-tag.d.ts +3 -4
- package/dist/utils/error-cause.d.ts +2 -3
- package/dist/utils/external-url.d.ts +2 -3
- package/dist/utils/has-trailing-comma.d.ts +3 -4
- package/dist/utils/hash.d.ts +3 -4
- package/dist/utils/html-limited-bots.d.ts +3 -4
- package/dist/utils/lazy-chunks.d.ts +8 -9
- package/dist/utils/lazy-chunks.js +4 -4
- package/dist/utils/manifest-paths.d.ts +5 -6
- package/dist/utils/mdx-scan.d.ts +11 -4
- package/dist/utils/mdx-scan.js +27 -1
- package/dist/utils/middleware-request-headers.d.ts +7 -6
- package/dist/utils/middleware-request-headers.js +6 -1
- package/dist/utils/navigation-signal.d.ts +3 -3
- package/dist/utils/navigation-signal.js +16 -1
- package/dist/utils/number.d.ts +2 -3
- package/dist/utils/package-name.d.ts +3 -4
- package/dist/utils/parse-cookie.d.ts +4 -5
- package/dist/utils/path.d.ts +8 -9
- package/dist/utils/plugin-options.d.ts +2 -3
- package/dist/utils/precompressed-variant.d.ts +3 -4
- package/dist/utils/prerender-output-paths.d.ts +9 -10
- package/dist/utils/prerender-output-paths.js +16 -9
- package/dist/utils/project.d.ts +19 -30
- package/dist/utils/project.js +20 -29
- package/dist/utils/promise.d.ts +2 -3
- package/dist/utils/protocol-headers.d.ts +14 -15
- package/dist/utils/public-file-path.d.ts +2 -3
- package/dist/utils/public-routes.d.ts +2 -3
- package/dist/utils/query.d.ts +14 -9
- package/dist/utils/query.js +22 -1
- package/dist/utils/react-compiler-support.d.ts +6 -7
- package/dist/utils/react-version.d.ts +4 -3
- package/dist/utils/react-version.js +19 -1
- package/dist/utils/record.d.ts +2 -3
- package/dist/utils/redirect-digest.d.ts +3 -4
- package/dist/utils/regex-safety.d.ts +4 -5
- package/dist/utils/regex.d.ts +2 -3
- package/dist/utils/safe-json-file.d.ts +2 -3
- package/dist/utils/sorted-array.d.ts +2 -3
- package/dist/utils/text-stream.d.ts +3 -4
- package/dist/utils/vinext-root.d.ts +2 -3
- package/dist/utils/virtual-module.d.ts +3 -4
- package/dist/utils/vite-cli-invocation.d.ts +21 -0
- package/dist/utils/vite-cli-invocation.js +144 -0
- package/dist/utils/vite-version.d.ts +5 -6
- package/next-package.json +4 -0
- package/package.json +55 -6
package/dist/init.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import path from "./deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
|
|
1
|
+
import path, { toSlash } from "./deps/.pnpm/pathslash@0.1.0/deps/pathslash/dist/index.js";
|
|
2
2
|
import { detectPackageManager, detectPackageManagerName, detectProject, ensureESModule, findViteConfigPath, hasViteConfig, renameCJSConfigs } from "./utils/project.js";
|
|
3
|
-
import { setupCloudflarePlatform, usesCommonJsViteConfig, validateCloudflarePlatformSetup } from "./init-cloudflare.js";
|
|
3
|
+
import { compactResourceName, cssModulesConfigSource, setupCloudflarePlatform, updateViteConfigForCssModules, usesCommonJsViteConfig, validateCloudflarePlatformSetup } from "./init-cloudflare.js";
|
|
4
4
|
import { getReactUpgradeDeps } from "./utils/react-version.js";
|
|
5
5
|
import fs from "node:fs";
|
|
6
6
|
import { spawn, spawnSync } from "node:child_process";
|
|
@@ -57,18 +57,47 @@ function inspectPnpmIgnoredBuilds(root) {
|
|
|
57
57
|
});
|
|
58
58
|
return `${result.stdout ?? ""}\n${result.stderr ?? ""}`;
|
|
59
59
|
}
|
|
60
|
-
function generateViteConfig(_isAppRouter, prerender = false) {
|
|
60
|
+
function generateViteConfig(_isAppRouter, prerender = false, hasCssModules = false) {
|
|
61
61
|
return `import vinext from "vinext";
|
|
62
|
-
import { defineConfig } from "vite";
|
|
62
|
+
import { defineConfig } from "vite";${hasCssModules ? "\nimport { createHash } from \"node:crypto\";\nimport path from \"node:path\";\nimport { patchCssModules } from \"vite-css-modules\";" : ""}
|
|
63
63
|
|
|
64
64
|
export default defineConfig({
|
|
65
|
-
plugins: [${prerender ? `vinext({ prerender: { routes: "*" } })` : "vinext()"}]
|
|
65
|
+
plugins: [${hasCssModules ? "patchCssModules({ exportMode: \"default\" }), " : ""}${prerender ? `vinext({ prerender: { routes: "*" } })` : "vinext()"}],${hasCssModules ? cssModulesConfigSource() : ""}
|
|
66
66
|
});
|
|
67
67
|
`;
|
|
68
68
|
}
|
|
69
|
+
const CSS_MODULE_GLOBS = [
|
|
70
|
+
"**/*.module.{css,scss,sass}",
|
|
71
|
+
"**/.*.module.{css,scss,sass}",
|
|
72
|
+
"**/.*/**/*.module.{css,scss,sass}",
|
|
73
|
+
"**/.*/**/.*.module.{css,scss,sass}"
|
|
74
|
+
];
|
|
75
|
+
const CSS_MODULE_IGNORES = /* @__PURE__ */ new Set([
|
|
76
|
+
"node_modules",
|
|
77
|
+
".git",
|
|
78
|
+
".next",
|
|
79
|
+
".vinext",
|
|
80
|
+
".wrangler",
|
|
81
|
+
".cloudflare"
|
|
82
|
+
]);
|
|
83
|
+
const CSS_MODULE_ROOT_IGNORES = /* @__PURE__ */ new Set([
|
|
84
|
+
"dist",
|
|
85
|
+
"out",
|
|
86
|
+
"build",
|
|
87
|
+
"coverage"
|
|
88
|
+
]);
|
|
89
|
+
function scanCssModuleFiles(root) {
|
|
90
|
+
const canonicalRoot = path.resolve(root);
|
|
91
|
+
return fs.globSync(CSS_MODULE_GLOBS, {
|
|
92
|
+
cwd: root,
|
|
93
|
+
withFileTypes: true,
|
|
94
|
+
exclude: (entry) => entry.isDirectory() && (CSS_MODULE_IGNORES.has(entry.name) || toSlash(entry.parentPath) === canonicalRoot && CSS_MODULE_ROOT_IGNORES.has(entry.name))
|
|
95
|
+
}).some((entry) => /\.module\.(css|scss|sass)$/.test(entry.name));
|
|
96
|
+
}
|
|
69
97
|
/**
|
|
70
|
-
* Add
|
|
71
|
-
*
|
|
98
|
+
* Add Vite scripts to package.json without overwriting custom scripts.
|
|
99
|
+
* Exact scripts generated by older vinext versions are migrated in place.
|
|
100
|
+
* Returns the list of script names that were added or migrated.
|
|
72
101
|
*/
|
|
73
102
|
function addScripts(root, port, platform = "node", options = {}) {
|
|
74
103
|
const pkgPath = path.join(root, "package.json");
|
|
@@ -78,23 +107,33 @@ function addScripts(root, port, platform = "node", options = {}) {
|
|
|
78
107
|
const pkg = JSON.parse(raw);
|
|
79
108
|
if (!pkg.scripts) pkg.scripts = {};
|
|
80
109
|
const added = [];
|
|
81
|
-
const addScript = (name, command) => {
|
|
110
|
+
const addScript = (name, command, legacyCommands = []) => {
|
|
82
111
|
const scriptName = options.scriptNames === "standard" ? name : `${name}:vinext`;
|
|
83
|
-
|
|
112
|
+
const existing = pkg.scripts[scriptName];
|
|
113
|
+
if (existing && !legacyCommands.some((legacy) => typeof legacy === "string" ? existing === legacy : legacy.test(existing))) return;
|
|
114
|
+
if (existing === command) return;
|
|
84
115
|
pkg.scripts[scriptName] = command;
|
|
85
116
|
added.push(scriptName);
|
|
86
117
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
addScript("
|
|
90
|
-
|
|
118
|
+
const devScriptName = options.scriptNames === "standard" ? "dev" : "dev:vinext";
|
|
119
|
+
const legacyDevScript = pkg.scripts[devScriptName];
|
|
120
|
+
addScript("dev", port === void 0 && typeof legacyDevScript === "string" && /^vinext dev(?: --port \d+)?$/.test(legacyDevScript) ? legacyDevScript.replace(/^vinext /, "vite ") : port === false ? "vite dev" : `vite dev --port ${port ?? 3001}`, ["vinext dev", /^vinext dev --port \d+$/]);
|
|
121
|
+
addScript("build", "vite build", ["vinext build"]);
|
|
122
|
+
addScript("start", platform === "cloudflare" ? !options.legacyWrangler ? "vite preview" : "wrangler dev --config dist/server/wrangler.json" : "vinext start");
|
|
123
|
+
if (platform === "cloudflare") {
|
|
124
|
+
addScript("deploy", !options.legacyWrangler ? options.warmCdnCache ? "vinext-cloudflare deploy --warm-cache" : "vinext-cloudflare deploy" : options.warmCdnCache ? "vinext-cloudflare deploy --config dist/server/wrangler.json --warm-cache" : "vinext-cloudflare deploy --config dist/server/wrangler.json");
|
|
125
|
+
if (options.deployResponseStore && !pkg.scripts["deploy:response-store"]) {
|
|
126
|
+
pkg.scripts["deploy:response-store"] = !options.legacyWrangler ? `cf deploy --prebuilt --mode production --worker ${compactResourceName(detectProject(root).projectName, "-response-store", 63)}` : "wrangler deploy --config wrangler.response-store.jsonc";
|
|
127
|
+
added.push("deploy:response-store");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
91
130
|
if (added.length > 0) fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n", "utf-8");
|
|
92
131
|
return added;
|
|
93
132
|
} catch {
|
|
94
133
|
return [];
|
|
95
134
|
}
|
|
96
135
|
}
|
|
97
|
-
function getInitDependencyGroups(isAppRouter, platform) {
|
|
136
|
+
function getInitDependencyGroups(isAppRouter, platform, cloudflare, hasCssModules = false) {
|
|
98
137
|
const dependencies = ["vinext"];
|
|
99
138
|
const devDependencies = ["vite", "@vitejs/plugin-react"];
|
|
100
139
|
if (isAppRouter) {
|
|
@@ -103,15 +142,20 @@ function getInitDependencyGroups(isAppRouter, platform) {
|
|
|
103
142
|
}
|
|
104
143
|
if (platform === "cloudflare") {
|
|
105
144
|
dependencies.push("@vinext/cloudflare");
|
|
106
|
-
|
|
145
|
+
if (cloudflare?.cdnCache === "response-store" && (cloudflare.responseStoreMode ?? "service-binding") === "service-binding") dependencies.push("@cloudflare/workers-response-store");
|
|
146
|
+
if (!cloudflare?.legacyWrangler) {
|
|
147
|
+
devDependencies[0] = "vite@8.3.0";
|
|
148
|
+
devDependencies.push("@cloudflare/vite-plugin@beta", "cf@latest");
|
|
149
|
+
} else devDependencies.push("@cloudflare/vite-plugin@1", "wrangler");
|
|
107
150
|
}
|
|
151
|
+
if (hasCssModules) devDependencies.push("vite-css-modules", "postcss");
|
|
108
152
|
return {
|
|
109
153
|
dependencies,
|
|
110
154
|
devDependencies
|
|
111
155
|
};
|
|
112
156
|
}
|
|
113
|
-
function getInitDeps(isAppRouter, platform) {
|
|
114
|
-
const groups = getInitDependencyGroups(isAppRouter, platform);
|
|
157
|
+
function getInitDeps(isAppRouter, platform, cloudflare, hasCssModules = false) {
|
|
158
|
+
const groups = getInitDependencyGroups(isAppRouter, platform, cloudflare, hasCssModules);
|
|
115
159
|
return [...groups.dependencies, ...groups.devDependencies];
|
|
116
160
|
}
|
|
117
161
|
function isDepInstalled(root, dep) {
|
|
@@ -119,11 +163,13 @@ function isDepInstalled(root, dep) {
|
|
|
119
163
|
if (!fs.existsSync(pkgPath)) return false;
|
|
120
164
|
try {
|
|
121
165
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
122
|
-
|
|
166
|
+
const allDeps = {
|
|
123
167
|
...pkg.dependencies,
|
|
124
168
|
...pkg.devDependencies,
|
|
125
169
|
...pkg.peerDependencies
|
|
126
170
|
};
|
|
171
|
+
const { name, version, hasExplicitVersion } = parseDependencySpecifier(dep);
|
|
172
|
+
return name in allDeps && (!hasExplicitVersion || allDeps[name] === version);
|
|
127
173
|
} catch {
|
|
128
174
|
return false;
|
|
129
175
|
}
|
|
@@ -194,7 +240,7 @@ function addDependencyEntries(root, deps, { dev }) {
|
|
|
194
240
|
async function installDeps(root, deps, exec, { dev = true } = {}) {
|
|
195
241
|
if (deps.length === 0) return "";
|
|
196
242
|
const baseCmd = detectPackageManager(root);
|
|
197
|
-
return await exec(`${dev ? baseCmd : baseCmd.replace(/ -D$/, "")} ${deps.join(" ")}`, {
|
|
243
|
+
return await exec(`${dev ? baseCmd : baseCmd.replace(/ -D$/, "")} ${deps.map((dep) => JSON.stringify(dep)).join(" ")}`, {
|
|
198
244
|
cwd: root,
|
|
199
245
|
stdio: "inherit"
|
|
200
246
|
}) ?? "";
|
|
@@ -204,7 +250,7 @@ async function installDeps(root, deps, exec, { dev = true } = {}) {
|
|
|
204
250
|
* Creates the file if it doesn't exist. Returns true if the file was modified
|
|
205
251
|
* (or created), false if all entries were already present.
|
|
206
252
|
*/
|
|
207
|
-
function updateGitignore(root, platform = "node") {
|
|
253
|
+
function updateGitignore(root, platform = "node", legacyWrangler = false) {
|
|
208
254
|
const gitignorePath = path.join(root, ".gitignore");
|
|
209
255
|
const entries = [
|
|
210
256
|
{
|
|
@@ -225,7 +271,7 @@ function updateGitignore(root, platform = "node") {
|
|
|
225
271
|
".vinext"
|
|
226
272
|
])
|
|
227
273
|
},
|
|
228
|
-
...platform === "cloudflare" ? [{
|
|
274
|
+
...platform === "cloudflare" && legacyWrangler ? [{
|
|
229
275
|
entry: ".wrangler/",
|
|
230
276
|
coveredBy: /* @__PURE__ */ new Set([
|
|
231
277
|
"/.wrangler/",
|
|
@@ -233,6 +279,15 @@ function updateGitignore(root, platform = "node") {
|
|
|
233
279
|
".wrangler/",
|
|
234
280
|
".wrangler"
|
|
235
281
|
])
|
|
282
|
+
}] : [],
|
|
283
|
+
...platform === "cloudflare" && !legacyWrangler ? [{
|
|
284
|
+
entry: ".cloudflare/",
|
|
285
|
+
coveredBy: /* @__PURE__ */ new Set([
|
|
286
|
+
"/.cloudflare/",
|
|
287
|
+
"/.cloudflare",
|
|
288
|
+
".cloudflare/",
|
|
289
|
+
".cloudflare"
|
|
290
|
+
])
|
|
236
291
|
}] : []
|
|
237
292
|
];
|
|
238
293
|
let content = "";
|
|
@@ -248,26 +303,45 @@ function updateGitignore(root, platform = "node") {
|
|
|
248
303
|
return true;
|
|
249
304
|
}
|
|
250
305
|
function setupNodePlatform(context) {
|
|
251
|
-
if (context.viteConfigExists && !context.force)
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
306
|
+
if (context.viteConfigExists && !context.force) {
|
|
307
|
+
if (context.hasCssModules && context.existingViteConfigPath) {
|
|
308
|
+
const current = fs.readFileSync(context.existingViteConfigPath, "utf-8");
|
|
309
|
+
const update = updateViteConfigForCssModules(context.existingViteConfigPath, current);
|
|
310
|
+
if (update.code !== current) fs.writeFileSync(context.existingViteConfigPath, update.code);
|
|
311
|
+
return {
|
|
312
|
+
generatedViteConfig: update.code !== current,
|
|
313
|
+
skippedViteConfig: update.code === current,
|
|
314
|
+
generatedPlatformFiles: [],
|
|
315
|
+
nextSteps: [],
|
|
316
|
+
preservedExistingGenerateScopedName: update.preservedExistingGenerateScopedName
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
return {
|
|
320
|
+
generatedViteConfig: false,
|
|
321
|
+
skippedViteConfig: true,
|
|
322
|
+
generatedPlatformFiles: [],
|
|
323
|
+
nextSteps: [],
|
|
324
|
+
preservedExistingGenerateScopedName: false
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
fs.writeFileSync(context.existingViteConfigPath ?? path.join(context.root, "vite.config.ts"), generateViteConfig(context.isAppRouter, context.prerender, context.hasCssModules), "utf-8");
|
|
258
328
|
return {
|
|
259
329
|
generatedViteConfig: true,
|
|
260
330
|
skippedViteConfig: false,
|
|
261
331
|
generatedPlatformFiles: [],
|
|
262
|
-
nextSteps: []
|
|
332
|
+
nextSteps: [],
|
|
333
|
+
preservedExistingGenerateScopedName: false
|
|
263
334
|
};
|
|
264
335
|
}
|
|
265
336
|
async function init(options) {
|
|
266
337
|
const root = path.resolve(options.root);
|
|
267
|
-
const port = options.port ?? 3001;
|
|
268
338
|
if (!options.platform) throw new Error("A deployment platform must be selected before running vinext init.");
|
|
269
339
|
const platform = options.platform;
|
|
270
340
|
if (platform === "cloudflare" && !options.cloudflare) throw new Error("Cloudflare init options must be resolved before running vinext init.");
|
|
341
|
+
const cloudflareOptions = platform === "cloudflare" && options.prerender ? {
|
|
342
|
+
...options.cloudflare,
|
|
343
|
+
prerender: true
|
|
344
|
+
} : options.cloudflare;
|
|
271
345
|
const exec = options._exec ?? ((cmd, opts) => new Promise((resolve, reject) => {
|
|
272
346
|
const child = spawn(cmd, {
|
|
273
347
|
cwd: opts.cwd,
|
|
@@ -312,15 +386,17 @@ async function init(options) {
|
|
|
312
386
|
}
|
|
313
387
|
const viteConfigExists = hasViteConfig(root);
|
|
314
388
|
const isApp = detectProject(root).isAppRouter;
|
|
389
|
+
const hasCssModules = !options.skipCssModules && scanCssModuleFiles(root);
|
|
315
390
|
const pmName = detectPackageManagerName(root);
|
|
316
391
|
const shouldInstall = options.install ?? true;
|
|
317
392
|
if (platform === "cloudflare") validateCloudflarePlatformSetup({
|
|
318
393
|
root,
|
|
319
394
|
isAppRouter: isApp,
|
|
320
395
|
existingViteConfigPath,
|
|
321
|
-
|
|
396
|
+
hasCssModules,
|
|
322
397
|
today: options._today
|
|
323
|
-
},
|
|
398
|
+
}, cloudflareOptions);
|
|
399
|
+
else if (hasCssModules && existingViteConfigPath && !options.force) updateViteConfigForCssModules(existingViteConfigPath, fs.readFileSync(existingViteConfigPath, "utf-8"));
|
|
324
400
|
if (!options.skipCheck) {
|
|
325
401
|
console.log(" Running compatibility check...\n");
|
|
326
402
|
const { runCheck, formatReport } = await import("./check.js");
|
|
@@ -336,30 +412,34 @@ async function init(options) {
|
|
|
336
412
|
existingViteConfigPath = renamedPath;
|
|
337
413
|
}
|
|
338
414
|
const addedTypeModule = ensureESModule(root);
|
|
339
|
-
const addedScripts = addScripts(root, port, platform, {
|
|
415
|
+
const addedScripts = addScripts(root, options.port, platform, {
|
|
416
|
+
deployResponseStore: options.cloudflare?.cdnCache === "response-store" && (options.cloudflare.responseStoreMode ?? "service-binding") === "service-binding",
|
|
340
417
|
warmCdnCache: options.cloudflare?.warmCdnCache ?? false,
|
|
418
|
+
legacyWrangler: options.cloudflare?.legacyWrangler,
|
|
341
419
|
scriptNames: options.scriptNames
|
|
342
420
|
});
|
|
343
421
|
const setupContext = {
|
|
344
422
|
root,
|
|
345
423
|
isAppRouter: isApp,
|
|
346
424
|
existingViteConfigPath,
|
|
425
|
+
packageManager: pmName,
|
|
347
426
|
viteConfigExists,
|
|
348
427
|
force: options.force ?? false,
|
|
349
428
|
prerender: options.prerender,
|
|
429
|
+
hasCssModules,
|
|
350
430
|
today: options._today
|
|
351
431
|
};
|
|
352
|
-
const platformSetup = platform === "cloudflare" ? setupCloudflarePlatform(setupContext,
|
|
432
|
+
const platformSetup = platform === "cloudflare" ? setupCloudflarePlatform(setupContext, cloudflareOptions) : setupNodePlatform(setupContext);
|
|
353
433
|
const { generatedViteConfig, skippedViteConfig, generatedPlatformFiles } = platformSetup;
|
|
354
|
-
const updatedGitignore = updateGitignore(root, platform);
|
|
355
|
-
const neededDeps = getInitDependencyGroups(isApp, platform);
|
|
434
|
+
const updatedGitignore = updateGitignore(root, platform, options.cloudflare?.legacyWrangler);
|
|
435
|
+
const neededDeps = getInitDependencyGroups(isApp, platform, options.cloudflare, hasCssModules);
|
|
356
436
|
const missingDependencies = neededDeps.dependencies.filter((dep) => !isDepInstalled(root, dep));
|
|
357
437
|
const missingDevDependencies = neededDeps.devDependencies.filter((dep) => !isDepInstalled(root, dep));
|
|
358
438
|
let dependencyInstallNeedsApproval = false;
|
|
359
439
|
const dependencyEntriesAdded = [];
|
|
360
440
|
const devDependencyEntriesAdded = [];
|
|
361
|
-
if (isApp && missingDependencies.includes("react-server-dom-webpack")) {
|
|
362
|
-
const reactUpgrade = getReactUpgradeDeps(root);
|
|
441
|
+
if (isApp && (!shouldInstall || missingDependencies.includes("react-server-dom-webpack"))) {
|
|
442
|
+
const reactUpgrade = getReactUpgradeDeps(root, { fromManifest: !shouldInstall });
|
|
363
443
|
if (reactUpgrade.length > 0) {
|
|
364
444
|
console.log(` ${terminalStyle.cyan(terminalStyle.bold("Upgrading dependencies:"))}`);
|
|
365
445
|
console.log(formatList(reactUpgrade.map((dep) => dep.replace(/@latest$/, "")), " "));
|
|
@@ -426,16 +506,18 @@ async function init(options) {
|
|
|
426
506
|
if (dependencyInstallNeedsApproval) console.log(` ${terminalStyle.yellow("!")} Dependency installation is waiting for build-script approval`);
|
|
427
507
|
if (addedTypeModule) console.log(` ${terminalStyle.green("✓")} Added "type": "module" to package.json`);
|
|
428
508
|
for (const [oldName, newName] of renamedConfigs) console.log(` ${terminalStyle.green("✓")} Renamed ${oldName} \u2192 ${newName}`);
|
|
429
|
-
for (const script of addedScripts) console.log(` ${terminalStyle.green("✓")}
|
|
509
|
+
for (const script of addedScripts) console.log(` ${terminalStyle.green("✓")} Configured ${script} script`);
|
|
430
510
|
if (generatedViteConfig) console.log(` ${terminalStyle.green("✓")} Generated vite.config.ts`);
|
|
431
511
|
for (const file of generatedPlatformFiles) console.log(` ${terminalStyle.green("✓")} Generated ${file}`);
|
|
432
512
|
if (skippedViteConfig) console.log(` ${terminalStyle.yellow("-")} Skipped vite.config.ts (already exists, use --force to overwrite)`);
|
|
433
513
|
if (updatedGitignore) console.log(` ${terminalStyle.green("✓")} Added vinext output directories to .gitignore`);
|
|
514
|
+
if (hasCssModules) console.log(` ${terminalStyle.green("✓")} Configured vite-css-modules for CSS Modules`);
|
|
515
|
+
if (platformSetup.preservedExistingGenerateScopedName) console.log(` ${terminalStyle.yellow("!")} Preserved existing css.modules.generateScopedName; verify it produces identical class names in SSR and client builds`);
|
|
434
516
|
const nextSteps = [...platformSetup.nextSteps];
|
|
435
517
|
if (dependencyInstallNeedsApproval) nextSteps.push("Dependency installation is incomplete because pnpm blocked dependency build scripts:", "1. Review and approve the required build scripts:", " pnpm approve-builds", "2. Finish installing dependencies:", " pnpm install");
|
|
436
518
|
const scriptName = (name) => options.scriptNames === "standard" ? name : `${name}:vinext`;
|
|
437
519
|
const deployCommandStep = platform === "cloudflare" ? ` ${pmName} run ${scriptName("deploy")} Deploy to Cloudflare Workers\n` : "";
|
|
438
|
-
const startCommandDescription = platform === "cloudflare" ? "Start the built Worker locally with Wrangler" : "Start vinext production server";
|
|
520
|
+
const startCommandDescription = platform === "cloudflare" ? !options.cloudflare?.legacyWrangler ? "Preview the built Worker locally" : "Start the built Worker locally with Wrangler" : "Start vinext production server";
|
|
439
521
|
console.log(`
|
|
440
522
|
${terminalStyle.cyan(terminalStyle.bold("Next steps:"))}
|
|
441
523
|
${nextSteps.map((step) => ` ${step}`).join("\n")}${nextSteps.length > 0 ? "\n" : ""}
|
|
@@ -457,4 +539,4 @@ ${deployCommandStep}${options.scriptNames === "standard" ? "" : ` ${pmName} r
|
|
|
457
539
|
};
|
|
458
540
|
}
|
|
459
541
|
//#endregion
|
|
460
|
-
export { addScripts, generateViteConfig, getInitDependencyGroups, getInitDeps, getReactUpgradeDeps, init, isDepInstalled, updateGitignore };
|
|
542
|
+
export { addScripts, generateViteConfig, getInitDependencyGroups, getInitDeps, getReactUpgradeDeps, init, isDepInstalled, scanCssModuleFiles, updateGitignore };
|
|
@@ -2,13 +2,12 @@ import { AppRoute } from "../routing/app-route-graph.js";
|
|
|
2
2
|
import { Plugin, ResolvedConfig } from "vite";
|
|
3
3
|
import { RscPluginManager } from "@vitejs/plugin-rsc";
|
|
4
4
|
//#region src/plugins/action-owner-manifest.d.ts
|
|
5
|
-
declare const ACTION_OWNER_MANIFEST_ID = "virtual:vinext-action-owner-manifest";
|
|
6
|
-
declare function createActionOwnerManifestPlugin(options: {
|
|
5
|
+
export declare const ACTION_OWNER_MANIFEST_ID = "virtual:vinext-action-owner-manifest";
|
|
6
|
+
export declare function createActionOwnerManifestPlugin(options: {
|
|
7
7
|
canonicalizeModuleId: (id: string) => string;
|
|
8
8
|
getManager: (config: ResolvedConfig) => Promise<RscPluginManager | undefined>;
|
|
9
9
|
getRoutes: () => readonly AppRoute[];
|
|
10
10
|
getSharedRoots: () => readonly string[];
|
|
11
11
|
onComplete?: () => void;
|
|
12
12
|
}): Plugin;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { ACTION_OWNER_MANIFEST_ID, createActionOwnerManifestPlugin };
|
|
13
|
+
//#endregion
|
|
@@ -18,6 +18,7 @@ function createActionOwnerManifestPlugin(options) {
|
|
|
18
18
|
let config;
|
|
19
19
|
let routeReachability = /* @__PURE__ */ new Map();
|
|
20
20
|
let manifest = {};
|
|
21
|
+
const rscOutputDirs = /* @__PURE__ */ new Set();
|
|
21
22
|
return {
|
|
22
23
|
name: "vinext:action-owner-manifest",
|
|
23
24
|
configResolved(resolvedConfig) {
|
|
@@ -33,6 +34,9 @@ function createActionOwnerManifestPlugin(options) {
|
|
|
33
34
|
load(id) {
|
|
34
35
|
if (id === RESOLVED_ACTION_OWNER_MANIFEST_ID) return "export default null";
|
|
35
36
|
},
|
|
37
|
+
outputOptions(output) {
|
|
38
|
+
if (this.environment.name === "rsc" && output.dir) rscOutputDirs.add(output.dir);
|
|
39
|
+
},
|
|
36
40
|
async generateBundle() {
|
|
37
41
|
const manager = await options.getManager(config);
|
|
38
42
|
if (!manager) throw new Error("vinext: failed to access @vitejs/plugin-rsc through getPluginApi().");
|
|
@@ -70,11 +74,14 @@ function createActionOwnerManifestPlugin(options) {
|
|
|
70
74
|
buildApp: {
|
|
71
75
|
order: "post",
|
|
72
76
|
async handler(builder) {
|
|
73
|
-
|
|
74
|
-
await
|
|
75
|
-
|
|
77
|
+
if (rscOutputDirs.size === 0) rscOutputDirs.add(builder.config.environments.rsc.build.outDir);
|
|
78
|
+
await Promise.all([...rscOutputDirs].map(async (outDir) => {
|
|
79
|
+
await fs.promises.mkdir(outDir, { recursive: true });
|
|
80
|
+
await fs.promises.writeFile(path.join(outDir, ACTION_OWNER_MANIFEST_FILE), `export default ${safeJsonStringify(manifest)};\n`);
|
|
81
|
+
}));
|
|
76
82
|
routeReachability = /* @__PURE__ */ new Map();
|
|
77
83
|
manifest = {};
|
|
84
|
+
rscOutputDirs.clear();
|
|
78
85
|
options.onComplete?.();
|
|
79
86
|
}
|
|
80
87
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ESTree } from "vite";
|
|
2
2
|
//#region src/plugins/ast-scope.d.ts
|
|
3
|
-
type AstScope = {
|
|
3
|
+
export type AstScope = {
|
|
4
4
|
parent: AstScope | null;
|
|
5
5
|
bindings: Set<string>;
|
|
6
6
|
};
|
|
7
|
-
declare function createAstScope<T extends AstScope>(parent: T | null): AstScope;
|
|
8
|
-
declare function hasAstBinding(scope: AstScope, name: string): boolean;
|
|
9
|
-
declare function isFunctionNode(node:
|
|
10
|
-
declare function collectDirectScopeBindings(node:
|
|
11
|
-
declare function collectLoopScopeBindings(node:
|
|
12
|
-
declare function collectSwitchScopeBindings(node:
|
|
13
|
-
declare function collectVarScopeBindings(node:
|
|
14
|
-
//#endregion
|
|
15
|
-
export { AstScope, collectDirectScopeBindings, collectLoopScopeBindings, collectSwitchScopeBindings, collectVarScopeBindings, createAstScope, hasAstBinding, isFunctionNode };
|
|
7
|
+
export declare function createAstScope<T extends AstScope>(parent: T | null): AstScope;
|
|
8
|
+
export declare function hasAstBinding(scope: AstScope, name: string): boolean;
|
|
9
|
+
export declare function isFunctionNode(node: ESTree.Node): node is ESTree.Function | ESTree.ArrowFunctionExpression;
|
|
10
|
+
export declare function collectDirectScopeBindings(node: ESTree.Node, scope: AstScope, onVariableDeclarator?: (declaration: ESTree.VariableDeclaration, declarator: ESTree.VariableDeclarator) => void): void;
|
|
11
|
+
export declare function collectLoopScopeBindings(node: ESTree.ForStatement | ESTree.ForInStatement | ESTree.ForOfStatement, scope: AstScope, onVariableDeclarator?: (declaration: ESTree.VariableDeclaration, declarator: ESTree.VariableDeclarator) => void): void;
|
|
12
|
+
export declare function collectSwitchScopeBindings(node: ESTree.SwitchStatement, scope: AstScope, onVariableDeclarator?: (declaration: ESTree.VariableDeclaration, declarator: ESTree.VariableDeclarator) => void): void;
|
|
13
|
+
export declare function collectVarScopeBindings(node: ESTree.Node, scope: AstScope, root?: boolean): void;
|
|
14
|
+
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { collectBindingNames, forEachAstChild
|
|
1
|
+
import { collectBindingNames, forEachAstChild } from "./ast-utils.js";
|
|
2
2
|
//#region src/plugins/ast-scope.ts
|
|
3
3
|
function createAstScope(parent) {
|
|
4
4
|
return {
|
|
@@ -14,17 +14,15 @@ function isFunctionNode(node) {
|
|
|
14
14
|
return node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression";
|
|
15
15
|
}
|
|
16
16
|
function collectDirectScopeBindings(node, scope, onVariableDeclarator) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const declaration = statement.type === "ExportNamedDeclaration" || statement.type === "ExportDefaultDeclaration" ? isAstRecord(statement.declaration) ? statement.declaration : null : statement;
|
|
17
|
+
const statements = node.type === "Program" || node.type === "BlockStatement" || node.type === "StaticBlock" || node.type === "TSModuleBlock" ? node.body : node.type === "SwitchCase" ? node.consequent : [];
|
|
18
|
+
for (const statement of statements) {
|
|
19
|
+
const declaration = statement.type === "ExportNamedDeclaration" || statement.type === "ExportDefaultDeclaration" ? statement.declaration : statement;
|
|
21
20
|
if (!declaration) continue;
|
|
22
21
|
if (declaration.type === "ImportDeclaration") {
|
|
23
22
|
if (declaration.importKind === "type") continue;
|
|
24
|
-
for (const specifier of
|
|
23
|
+
for (const specifier of declaration.specifiers) if (specifier.type !== "ImportSpecifier" || specifier.importKind !== "type") collectBindingNames(specifier.local, scope.bindings);
|
|
25
24
|
} else if (declaration.type === "TSImportEqualsDeclaration" && declaration.importKind !== "type") collectBindingNames(declaration.id, scope.bindings);
|
|
26
|
-
else if (declaration.type === "VariableDeclaration" && declaration.declare !== true) for (const declarator of
|
|
27
|
-
if (!isAstRecord(declarator)) continue;
|
|
25
|
+
else if (declaration.type === "VariableDeclaration" && declaration.declare !== true) for (const declarator of declaration.declarations) {
|
|
28
26
|
collectBindingNames(declarator.id, scope.bindings);
|
|
29
27
|
onVariableDeclarator?.(declaration, declarator);
|
|
30
28
|
}
|
|
@@ -34,28 +32,18 @@ function collectDirectScopeBindings(node, scope, onVariableDeclarator) {
|
|
|
34
32
|
}
|
|
35
33
|
function collectLoopScopeBindings(node, scope, onVariableDeclarator) {
|
|
36
34
|
const declarationValue = node.type === "ForStatement" ? node.init : node.left;
|
|
37
|
-
if (!
|
|
38
|
-
|
|
39
|
-
for (const declarator of nodeArray(declarationValue.declarations)) {
|
|
40
|
-
if (!isAstRecord(declarator)) continue;
|
|
35
|
+
if (!declarationValue || declarationValue.type !== "VariableDeclaration" || declarationValue.declare === true) return;
|
|
36
|
+
for (const declarator of declarationValue.declarations) {
|
|
41
37
|
collectBindingNames(declarator.id, scope.bindings);
|
|
42
38
|
onVariableDeclarator?.(declarationValue, declarator);
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
41
|
function collectSwitchScopeBindings(node, scope, onVariableDeclarator) {
|
|
46
|
-
for (const
|
|
47
|
-
if (!isAstRecord(caseValue)) continue;
|
|
48
|
-
collectDirectScopeBindings({
|
|
49
|
-
type: "BlockStatement",
|
|
50
|
-
body: nodeArray(caseValue.consequent)
|
|
51
|
-
}, scope, onVariableDeclarator);
|
|
52
|
-
}
|
|
42
|
+
for (const switchCase of node.cases) collectDirectScopeBindings(switchCase, scope, onVariableDeclarator);
|
|
53
43
|
}
|
|
54
44
|
function collectVarScopeBindings(node, scope, root = true) {
|
|
55
45
|
if (!root && (isFunctionNode(node) || node.type === "StaticBlock" || node.type === "TSModuleBlock")) return;
|
|
56
|
-
if (node.type === "VariableDeclaration" && node.kind === "var" && node.declare !== true)
|
|
57
|
-
for (const declarator of nodeArray(node.declarations)) if (isAstRecord(declarator)) collectBindingNames(declarator.id, scope.bindings);
|
|
58
|
-
}
|
|
46
|
+
if (node.type === "VariableDeclaration" && node.kind === "var" && node.declare !== true) for (const declarator of node.declarations) collectBindingNames(declarator.id, scope.bindings);
|
|
59
47
|
forEachAstChild(node, (child) => collectVarScopeBindings(child, scope, false));
|
|
60
48
|
}
|
|
61
49
|
//#endregion
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
+
import { ESTree } from "vite";
|
|
1
2
|
//#region src/plugins/ast-utils.d.ts
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
start?: number;
|
|
5
|
-
end?: number;
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
};
|
|
8
|
-
type AstRange = AstRecord & {
|
|
9
|
-
start: number;
|
|
10
|
-
end: number;
|
|
11
|
-
};
|
|
12
|
-
type ScriptParserLanguage = "js" | "jsx" | "ts" | "tsx";
|
|
13
|
-
declare const SCRIPT_MODULE_ID_RE: RegExp;
|
|
3
|
+
export type ScriptParserLanguage = "js" | "jsx" | "ts" | "tsx";
|
|
4
|
+
export declare const SCRIPT_MODULE_ID_RE: RegExp;
|
|
14
5
|
/**
|
|
15
6
|
* Cheap pre-parse gate for plugins that only transform *dynamic* `import(...)`.
|
|
16
7
|
*
|
|
@@ -30,13 +21,13 @@ declare const SCRIPT_MODULE_ID_RE: RegExp;
|
|
|
30
21
|
* Usable directly as a Rolldown `transform.filter.code` regex, or via
|
|
31
22
|
* {@link mayContainDynamicImport} for an in-handler prescan.
|
|
32
23
|
*/
|
|
33
|
-
declare const DYNAMIC_IMPORT_PRESCAN: RegExp;
|
|
24
|
+
export declare const DYNAMIC_IMPORT_PRESCAN: RegExp;
|
|
34
25
|
/**
|
|
35
26
|
* Whether `code` might contain a dynamic `import(...)` call. See
|
|
36
27
|
* {@link DYNAMIC_IMPORT_PRESCAN} — a cheap, deliberately over-inclusive regex
|
|
37
28
|
* gate used to avoid parsing static-import-only modules.
|
|
38
29
|
*/
|
|
39
|
-
declare function mayContainDynamicImport(code: string): boolean;
|
|
30
|
+
export declare function mayContainDynamicImport(code: string): boolean;
|
|
40
31
|
/**
|
|
41
32
|
* Select the OXC parser mode for a JavaScript/TypeScript module id.
|
|
42
33
|
*
|
|
@@ -44,32 +35,28 @@ declare function mayContainDynamicImport(code: string): boolean;
|
|
|
44
35
|
* JSX in `.js` files, and every caller using this helper runs before JSX has
|
|
45
36
|
* necessarily been lowered.
|
|
46
37
|
*/
|
|
47
|
-
declare function scriptParserLanguage(id: string): ScriptParserLanguage | null;
|
|
48
|
-
declare function
|
|
49
|
-
declare function
|
|
50
|
-
declare function hasRange(node: AstRecord | null): node is AstRange;
|
|
51
|
-
declare function isIdentifierNamed(value: unknown, name: string): boolean;
|
|
52
|
-
declare function getAstName(value: unknown): string | null;
|
|
38
|
+
export declare function scriptParserLanguage(id: string): ScriptParserLanguage | null;
|
|
39
|
+
export declare function isIdentifierNamed(value: ESTree.Node | null | undefined, name: string): boolean;
|
|
40
|
+
export declare function getAstName(node: ESTree.Node | null | undefined): string | null;
|
|
53
41
|
/** Remove syntax-only wrappers while preserving the underlying expression. */
|
|
54
|
-
declare function unwrapExpression(
|
|
42
|
+
export declare function unwrapExpression(node: ESTree.Node | null | undefined): ESTree.Node | null;
|
|
55
43
|
/** Return the value of a string literal node, without evaluating expressions. */
|
|
56
|
-
declare function stringLiteralValue(
|
|
44
|
+
export declare function stringLiteralValue(node: ESTree.Node | null | undefined): string | null;
|
|
57
45
|
/** Return the value of a boolean literal node, without evaluating expressions. */
|
|
58
|
-
declare function booleanLiteralValue(
|
|
46
|
+
export declare function booleanLiteralValue(node: ESTree.Node | null | undefined): boolean | null;
|
|
59
47
|
/**
|
|
60
48
|
* Return a statically known string literal, including an interpolation-free
|
|
61
49
|
* template literal. This deliberately does not fold concatenations or other
|
|
62
50
|
* expressions.
|
|
63
51
|
*/
|
|
64
|
-
declare function staticStringValue(
|
|
65
|
-
declare function forEachAstChild(node:
|
|
52
|
+
export declare function staticStringValue(node: ESTree.Node | null | undefined): string | null;
|
|
53
|
+
export declare function forEachAstChild(node: ESTree.Node, callback: (child: ESTree.Node) => void): void;
|
|
66
54
|
/**
|
|
67
55
|
* Visit an AST in depth-first order. Returning `false` prunes the current
|
|
68
56
|
* node's subtree, which is useful once a transform has claimed a complete
|
|
69
57
|
* expression. Parent links and source-location metadata are skipped by
|
|
70
58
|
* {@link forEachAstChild}, so OXC's cyclic `parent` references are safe.
|
|
71
59
|
*/
|
|
72
|
-
declare function walkAst(
|
|
73
|
-
declare function collectBindingNames(
|
|
74
|
-
//#endregion
|
|
75
|
-
export { AstRange, AstRecord, DYNAMIC_IMPORT_PRESCAN, SCRIPT_MODULE_ID_RE, ScriptParserLanguage, booleanLiteralValue, collectBindingNames, forEachAstChild, getAstName, hasRange, isAstRecord, isIdentifierNamed, mayContainDynamicImport, nodeArray, scriptParserLanguage, staticStringValue, stringLiteralValue, unwrapExpression, walkAst };
|
|
60
|
+
export declare function walkAst(node: ESTree.Node, visitor: (node: ESTree.Node) => boolean | void): void;
|
|
61
|
+
export declare function collectBindingNames(node: ESTree.Node | null | undefined, target: Set<string>): void;
|
|
62
|
+
//#endregion
|