@wular/pnext 0.0.1
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 +153 -0
- package/bin/pnext +67 -0
- package/config/lint/base.js +48 -0
- package/config/ts/base.json +26 -0
- package/config/ts/react.json +13 -0
- package/package.json +70 -0
- package/reference/compat.md +63 -0
- package/reference/config.md +120 -0
- package/reference/css.md +58 -0
- package/reference/dev.md +69 -0
- package/reference/env.md +40 -0
- package/reference/metadata.md +86 -0
- package/reference/navigation.md +149 -0
- package/reference/overview.md +35 -0
- package/reference/performance.md +97 -0
- package/reference/rendering.md +127 -0
- package/reference/routing.md +167 -0
- package/reference/typegen.md +64 -0
- package/src/api/cache.ts +80 -0
- package/src/api/client-cache.ts +9 -0
- package/src/api/client-navigation.ts +279 -0
- package/src/api/dynamic.tsx +102 -0
- package/src/api/link.tsx +119 -0
- package/src/api/navigation.ts +198 -0
- package/src/api/router/events.ts +53 -0
- package/src/api/router/history.ts +70 -0
- package/src/api/router/hub.ts +194 -0
- package/src/api/router/policies.ts +107 -0
- package/src/api/router/runtime.ts +5238 -0
- package/src/api/router/types.ts +299 -0
- package/src/api/router.ts +167 -0
- package/src/api/server.ts +323 -0
- package/src/api/suspense.ts +16 -0
- package/src/cache/context.ts +61 -0
- package/src/cli/adapters/vercel-warm.ts +375 -0
- package/src/cli/adapters/vercel.ts +1310 -0
- package/src/cli/analyze-print.ts +181 -0
- package/src/cli/analyze.ts +328 -0
- package/src/cli/boot-trace.ts +29 -0
- package/src/cli/build.ts +3114 -0
- package/src/cli/dev.ts +276 -0
- package/src/cli/index.ts +196 -0
- package/src/cli/named-bin.ts +119 -0
- package/src/cli/serve-ui.ts +160 -0
- package/src/cli/start.ts +1425 -0
- package/src/client/build.ts +2136 -0
- package/src/client/chunk-fold.ts +526 -0
- package/src/client/entry.ts +1525 -0
- package/src/client/paths.ts +22 -0
- package/src/client/prebuilt.ts +621 -0
- package/src/client/profile.ts +75 -0
- package/src/client/react-compiler.ts +94 -0
- package/src/client/reference-stub.ts +145 -0
- package/src/client/reference.ts +47 -0
- package/src/compat/actions/action-client.ts +531 -0
- package/src/compat/actions/action-dispatch.ts +676 -0
- package/src/compat/actions/action-router.ts +40 -0
- package/src/compat/actions/action-shared.ts +95 -0
- package/src/compat/actions/client-plugin.ts +135 -0
- package/src/compat/actions/client-stub.ts +65 -0
- package/src/compat/actions/config.ts +164 -0
- package/src/compat/actions/detect.ts +208 -0
- package/src/compat/actions/discovery.ts +244 -0
- package/src/compat/actions/early-submit.ts +40 -0
- package/src/compat/actions/endpoint.ts +602 -0
- package/src/compat/actions/flight.ts +52 -0
- package/src/compat/actions/form-state.ts +73 -0
- package/src/compat/actions/hoist.ts +485 -0
- package/src/compat/actions/ids.ts +39 -0
- package/src/compat/actions/index.ts +41 -0
- package/src/compat/actions/instances.ts +144 -0
- package/src/compat/actions/origin.ts +109 -0
- package/src/compat/actions/protocol.ts +125 -0
- package/src/compat/actions/registry.ts +74 -0
- package/src/compat/actions/rewrite.ts +282 -0
- package/src/compat/actions/serve.ts +414 -0
- package/src/compat/actions/server-tag.ts +21 -0
- package/src/compat/actions/unrecognized-error.ts +30 -0
- package/src/compat/adapter/build-complete.ts +257 -0
- package/src/compat/bundler/bun-externals.ts +53 -0
- package/src/compat/bundler/cjs-exports.ts +542 -0
- package/src/compat/bundler/config.ts +363 -0
- package/src/compat/bundler/externals.ts +34 -0
- package/src/compat/bundler/import-meta-url.ts +60 -0
- package/src/compat/bundler/modularize-imports.ts +119 -0
- package/src/compat/bundler/new-url-asset.ts +87 -0
- package/src/compat/bundler/optimize-package-imports.ts +273 -0
- package/src/compat/bundler/polyfill.ts +88 -0
- package/src/compat/bundler/react-compiler.ts +61 -0
- package/src/compat/bundler/react-profiler.tsx +25 -0
- package/src/compat/bundler/relay-transform.ts +116 -0
- package/src/compat/bundler/require-context.ts +281 -0
- package/src/compat/bundler/resolve-extensions.ts +75 -0
- package/src/compat/bundler/source-cache.ts +61 -0
- package/src/compat/bundler/static-imports.ts +25 -0
- package/src/compat/bundler/symlink-imports.ts +119 -0
- package/src/compat/bundler/tsconfig-paths.ts +50 -0
- package/src/compat/bundler/wasm.ts +153 -0
- package/src/compat/bundler/webpack-loaders.ts +685 -0
- package/src/compat/bundler/worker.ts +278 -0
- package/src/compat/cache/build-flags.ts +81 -0
- package/src/compat/cache/build-prerender-errors.ts +163 -0
- package/src/compat/cache/custom-handler.ts +159 -0
- package/src/compat/cache/fetch-patch.ts +745 -0
- package/src/compat/cache/handler.ts +100 -0
- package/src/compat/cache/modern-handler.ts +275 -0
- package/src/compat/cache/resume-data-cache.ts +143 -0
- package/src/compat/cache/revalidate.ts +759 -0
- package/src/compat/cache/runtime-error.ts +124 -0
- package/src/compat/cache/use-cache-transform.ts +961 -0
- package/src/compat/cache/use-cache.ts +1695 -0
- package/src/compat/cache-control.ts +269 -0
- package/src/compat/client/base-path.ts +64 -0
- package/src/compat/client/css-order.ts +36 -0
- package/src/compat/client/errors/control-flow.ts +92 -0
- package/src/compat/client/errors/error-boundary.ts +222 -0
- package/src/compat/client/errors/global-error.ts +238 -0
- package/src/compat/client/errors/install.ts +217 -0
- package/src/compat/client/errors/lazy.ts +53 -0
- package/src/compat/client/errors/primitive-throw.ts +126 -0
- package/src/compat/client/errors/soft-refresh.ts +14 -0
- package/src/compat/client/link-status.ts +86 -0
- package/src/compat/client/nav-compat-runtime.ts +57 -0
- package/src/compat/client/nav-compat.ts +42 -0
- package/src/compat/client/navigation-scroll.ts +154 -0
- package/src/compat/client/optimistic-routing.ts +206 -0
- package/src/compat/client/prefetch-cache.ts +111 -0
- package/src/compat/client/route-announcer.ts +72 -0
- package/src/compat/client/segment-cache-policy.ts +159 -0
- package/src/compat/client/segment-cache.ts +1077 -0
- package/src/compat/client/segment-prefetch.ts +375 -0
- package/src/compat/client/trailing-slash.ts +24 -0
- package/src/compat/css/chunking.ts +254 -0
- package/src/compat/css/inline-css.ts +73 -0
- package/src/compat/css/lightningcss.ts +90 -0
- package/src/compat/css/modules.ts +373 -0
- package/src/compat/css/nonce.ts +30 -0
- package/src/compat/css/sass-plugin.ts +65 -0
- package/src/compat/css/sass.ts +392 -0
- package/src/compat/css/styled-jsx-runtime.ts +80 -0
- package/src/compat/css/styled-jsx.ts +49 -0
- package/src/compat/edge-runtime.ts +71 -0
- package/src/compat/export/client.ts +112 -0
- package/src/compat/export/index.ts +272 -0
- package/src/compat/export/standalone.ts +207 -0
- package/src/compat/image-optimizer/cache.ts +119 -0
- package/src/compat/image-optimizer/detect.ts +143 -0
- package/src/compat/image-optimizer/index.ts +601 -0
- package/src/compat/image-optimizer/source.ts +243 -0
- package/src/compat/index.ts +458 -0
- package/src/compat/lifecycle/after-scope.ts +86 -0
- package/src/compat/lifecycle/after.ts +173 -0
- package/src/compat/lifecycle/error-funnel.ts +306 -0
- package/src/compat/lifecycle/error-serialize.ts +87 -0
- package/src/compat/lifecycle/error-ui.ts +167 -0
- package/src/compat/lifecycle/instrumentation-client.ts +138 -0
- package/src/compat/lifecycle/instrumentation.ts +277 -0
- package/src/compat/lifecycle/node-console.ts +19 -0
- package/src/compat/lifecycle/testmode.ts +263 -0
- package/src/compat/mdx/compile.ts +219 -0
- package/src/compat/mdx/next-mdx-stub.ts +46 -0
- package/src/compat/mdx/plugin.ts +37 -0
- package/src/compat/metadata-route-artifacts.ts +458 -0
- package/src/compat/metadata.ts +295 -0
- package/src/compat/middleware/manifest.ts +210 -0
- package/src/compat/misc/action-return.ts +173 -0
- package/src/compat/next/cache.ts +211 -0
- package/src/compat/next/canonical-url.ts +35 -0
- package/src/compat/next/client-cache.ts +57 -0
- package/src/compat/next/client-navigation.ts +313 -0
- package/src/compat/next/client-only.ts +3 -0
- package/src/compat/next/client-script.tsx +215 -0
- package/src/compat/next/client-server.ts +39 -0
- package/src/compat/next/config-loader.ts +569 -0
- package/src/compat/next/config.ts +29 -0
- package/src/compat/next/constants.cjs +6 -0
- package/src/compat/next/constants.ts +6 -0
- package/src/compat/next/custom-server.ts +236 -0
- package/src/compat/next/dist/client/components/app-router-headers.ts +32 -0
- package/src/compat/next/dist/server/app-render/work-unit-async-storage.external.cjs +38 -0
- package/src/compat/next/dist/server/web/spec-extension/revalidate.ts +1 -0
- package/src/compat/next/dist/server/web/spec-extension/unstable-cache.ts +1 -0
- package/src/compat/next/dist/server/web/spec-extension/unstable-no-store.ts +1 -0
- package/src/compat/next/dynamic.tsx +46 -0
- package/src/compat/next/error.tsx +148 -0
- package/src/compat/next/font/cache.ts +171 -0
- package/src/compat/next/font/google.ts +2 -0
- package/src/compat/next/font/index.ts +8 -0
- package/src/compat/next/font/local.ts +5 -0
- package/src/compat/next/font/runtime-client.ts +71 -0
- package/src/compat/next/font/runtime.ts +974 -0
- package/src/compat/next/font/shared.ts +281 -0
- package/src/compat/next/form.tsx +156 -0
- package/src/compat/next/head.tsx +10 -0
- package/src/compat/next/headers.ts +247 -0
- package/src/compat/next/image/config.ts +196 -0
- package/src/compat/next/image/optimizer.ts +96 -0
- package/src/compat/next/image/patterns.ts +103 -0
- package/src/compat/next/image/shared.ts +141 -0
- package/src/compat/next/image/static-metadata.ts +283 -0
- package/src/compat/next/image/validate.ts +269 -0
- package/src/compat/next/image-client.tsx +215 -0
- package/src/compat/next/image-props.ts +575 -0
- package/src/compat/next/image-usage.ts +102 -0
- package/src/compat/next/image.tsx +56 -0
- package/src/compat/next/index.ts +1 -0
- package/src/compat/next/legacy-image.tsx +97 -0
- package/src/compat/next/link-usage.ts +29 -0
- package/src/compat/next/link-validation-transform.ts +200 -0
- package/src/compat/next/link.tsx +466 -0
- package/src/compat/next/navigation.cjs +21 -0
- package/src/compat/next/navigation.ts +188 -0
- package/src/compat/next/offline.ts +51 -0
- package/src/compat/next/og.ts +324 -0
- package/src/compat/next/optimistic-route-state.ts +188 -0
- package/src/compat/next/preferred-region.ts +39 -0
- package/src/compat/next/redirects.ts +131 -0
- package/src/compat/next/resource-hints.ts +136 -0
- package/src/compat/next/rewrites.ts +350 -0
- package/src/compat/next/root-params.ts +142 -0
- package/src/compat/next/router.cjs +49 -0
- package/src/compat/next/router.ts +143 -0
- package/src/compat/next/script.tsx +355 -0
- package/src/compat/next/server-only.ts +3 -0
- package/src/compat/next/server.ts +28 -0
- package/src/compat/next/svgr.ts +58 -0
- package/src/compat/next/telemetry.ts +77 -0
- package/src/compat/next/user-agent.ts +100 -0
- package/src/compat/next/web-vitals.ts +56 -0
- package/src/compat/otel/api.ts +95 -0
- package/src/compat/otel/client-trace-metadata.ts +71 -0
- package/src/compat/otel/fetch-span.ts +77 -0
- package/src/compat/otel/tracer.ts +944 -0
- package/src/compat/pages/client-plugin.ts +108 -0
- package/src/compat/pages/index.ts +527 -0
- package/src/compat/pages/router-state.ts +94 -0
- package/src/compat/ppr/io.ts +38 -0
- package/src/compat/ppr/missing-root-params.ts +105 -0
- package/src/compat/ppr/root-params-scan.ts +164 -0
- package/src/compat/ppr/root-params-transform.ts +75 -0
- package/src/compat/ppr/root-params.ts +129 -0
- package/src/compat/ppr/segment-config-incompat.ts +34 -0
- package/src/compat/protocol.ts +202 -0
- package/src/compat/react/client.ts +59 -0
- package/src/compat/react/compiler-runtime.ts +60 -0
- package/src/compat/react/dom-client.ts +115 -0
- package/src/compat/react/dom-react-server.ts +20 -0
- package/src/compat/react/dom-server.ts +40 -0
- package/src/compat/react/dom.ts +154 -0
- package/src/compat/react/preact.ts +522 -0
- package/src/compat/react/react-server.ts +84 -0
- package/src/compat/react/router-shim.ts +26 -0
- package/src/compat/react/server-component-use.ts +48 -0
- package/src/compat/react/server-inserted-html.ts +87 -0
- package/src/compat/react/server.ts +156 -0
- package/src/compat/react/view-transition.ts +60 -0
- package/src/compat/register/actions.ts +875 -0
- package/src/compat/register/boot.ts +141 -0
- package/src/compat/register/build-tier.ts +11 -0
- package/src/compat/register/build.ts +182 -0
- package/src/compat/register/bundler.ts +587 -0
- package/src/compat/register/cache.ts +85 -0
- package/src/compat/register/client-errors.ts +18 -0
- package/src/compat/register/config.ts +17 -0
- package/src/compat/register/css-extras.ts +120 -0
- package/src/compat/register/edge-runtime.ts +6 -0
- package/src/compat/register/errors.ts +46 -0
- package/src/compat/register/export.ts +23 -0
- package/src/compat/register/font.ts +36 -0
- package/src/compat/register/hooks.ts +34 -0
- package/src/compat/register/image.ts +133 -0
- package/src/compat/register/index.ts +111 -0
- package/src/compat/register/instrumentation-client.ts +35 -0
- package/src/compat/register/lifecycle.ts +86 -0
- package/src/compat/register/mdx.ts +48 -0
- package/src/compat/register/middleware.ts +36 -0
- package/src/compat/register/misc.ts +44 -0
- package/src/compat/register/otel.ts +288 -0
- package/src/compat/register/pages-api.ts +473 -0
- package/src/compat/register/ppr.ts +56 -0
- package/src/compat/register/protocol.ts +57 -0
- package/src/compat/register/proxy.ts +127 -0
- package/src/compat/register/render.ts +268 -0
- package/src/compat/register/routing.ts +410 -0
- package/src/compat/register/segment.ts +1903 -0
- package/src/compat/register/static-image.ts +21 -0
- package/src/compat/register/typed-routes.ts +35 -0
- package/src/compat/register/usecache.ts +131 -0
- package/src/compat/register/validation.ts +56 -0
- package/src/compat/segment/loading-boundary.ts +113 -0
- package/src/compat/segment/page-slot.ts +200 -0
- package/src/compat/segment/tree.ts +481 -0
- package/src/compat/segment/vary-key.ts +102 -0
- package/src/compat/segment/vary-params.ts +551 -0
- package/src/compat/static-params.ts +33 -0
- package/src/compat/tsconfig-defaults.ts +301 -0
- package/src/compat/typecheck/index.ts +1481 -0
- package/src/compat/typecheck/worker.ts +26 -0
- package/src/compat/typed-routes/index.ts +92 -0
- package/src/compat/typed-routes/manifest.ts +356 -0
- package/src/compat/typed-routes/typegen.ts +566 -0
- package/src/compat/validation/errors.ts +159 -0
- package/src/compat/validation/index.ts +1770 -0
- package/src/compat/validation/prerender-diagnostics.ts +1508 -0
- package/src/compat-bootstrap.ts +67 -0
- package/src/config.ts +218 -0
- package/src/css/build.ts +697 -0
- package/src/css/index.ts +2 -0
- package/src/css/postcss.ts +236 -0
- package/src/css/worker.ts +34 -0
- package/src/dev/client-actions.ts +35 -0
- package/src/dev/client-chunk-store.ts +92 -0
- package/src/dev/client-key-cache.ts +178 -0
- package/src/dev/global-css-cache.ts +212 -0
- package/src/dev/imports.ts +2430 -0
- package/src/dev/module-cache.ts +721 -0
- package/src/dev/module-generations.ts +38 -0
- package/src/dev/module-transform.ts +188 -0
- package/src/dev/node-module-bundle-cache.ts +63 -0
- package/src/dev/restart-cache.ts +10 -0
- package/src/dev/route-bundle-key-cache.ts +154 -0
- package/src/dev/route-facts-cache.ts +223 -0
- package/src/dev/server.ts +1710 -0
- package/src/dynamic/source.ts +307 -0
- package/src/dynamic/tree-shake.ts +262 -0
- package/src/env.ts +92 -0
- package/src/extensions.ts +1898 -0
- package/src/index.ts +34 -0
- package/src/internal.ts +43 -0
- package/src/islands/boundary-error.ts +8 -0
- package/src/islands/static-children.ts +37 -0
- package/src/islands/static-slots.ts +106 -0
- package/src/ppr-postpone.ts +24 -0
- package/src/ppr.ts +784 -0
- package/src/proxy.ts +752 -0
- package/src/render/hooks.ts +384 -0
- package/src/render/index.ts +1 -0
- package/src/render/island-context.ts +47 -0
- package/src/render/metadata.ts +857 -0
- package/src/render/renderer.ts +7391 -0
- package/src/render/resource-hints.ts +44 -0
- package/src/render/slots.tsx +679 -0
- package/src/request/context.ts +396 -0
- package/src/resolve/engine.ts +219 -0
- package/src/resolve/imports.ts +1104 -0
- package/src/resolve/scan-facts.ts +474 -0
- package/src/resolve/source-text.ts +86 -0
- package/src/routing/forwarded.ts +41 -0
- package/src/routing/handler.ts +271 -0
- package/src/routing/href.ts +203 -0
- package/src/routing/metadata.ts +1018 -0
- package/src/routing/request-runtime.ts +43 -0
- package/src/routing/routes.ts +2560 -0
- package/src/routing/slots.ts +432 -0
- package/src/runtime/server.ts +3453 -0
- package/src/runtime/vendor.ts +1160 -0
- package/src/style-modules.d.ts +9 -0
- package/src/typegen.ts +151 -0
- package/src/types.ts +725 -0
- package/src/utils/ansi.ts +9 -0
- package/src/utils/content-type.ts +31 -0
- package/src/utils/decode.ts +7 -0
- package/src/utils/dev-profile.ts +31 -0
- package/src/utils/error-log.ts +29 -0
- package/src/utils/fs-cache.ts +31 -0
- package/src/utils/fs.ts +119 -0
- package/src/utils/html.ts +46 -0
- package/src/utils/serialize.ts +378 -0
- package/src/utils/source.ts +35 -0
- package/src/utils/verbose.ts +39 -0
- package/tsconfig.json +10 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
import type { ComponentChildren } from 'preact';
|
|
2
|
+
|
|
3
|
+
export type RouteMode = 'static' | 'dynamic';
|
|
4
|
+
|
|
5
|
+
export type PrefetchMode = false | 'intent' | 'visible' | 'load';
|
|
6
|
+
|
|
7
|
+
export interface PNextRoutes {
|
|
8
|
+
readonly __pnext_internal_route_brand?: never;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type RoutePath = Extract<Exclude<keyof PNextRoutes, '__pnext_internal_route_brand'>, string>;
|
|
12
|
+
export type RouteParamValue = string | string[];
|
|
13
|
+
|
|
14
|
+
export type RouteParams<Route extends RoutePath> = PNextRoutes[Route] extends {
|
|
15
|
+
params: infer Params extends Record<string, RouteParamValue>;
|
|
16
|
+
}
|
|
17
|
+
? Params
|
|
18
|
+
: Record<string, never>;
|
|
19
|
+
|
|
20
|
+
export type StaticParams<Route extends RoutePath> =
|
|
21
|
+
| RouteParams<Route>[]
|
|
22
|
+
| Promise<RouteParams<Route>[]>;
|
|
23
|
+
|
|
24
|
+
export interface PNextConfig {
|
|
25
|
+
outDir?: string;
|
|
26
|
+
basePath?: string;
|
|
27
|
+
assetPrefix?: string;
|
|
28
|
+
trailingSlash?: boolean;
|
|
29
|
+
// Next's skipTrailingSlashRedirect: serve both slashed and unslashed URLs
|
|
30
|
+
// without a canonical 308/redirect, and never normalize trailing slashes on
|
|
31
|
+
// Link hrefs / client navigation (the raw path is preserved end to end).
|
|
32
|
+
skipTrailingSlashRedirect?: boolean;
|
|
33
|
+
htmlLimitedBots?: RegExp;
|
|
34
|
+
// Emit browser sourcemaps from the production client build. Off by default,
|
|
35
|
+
// matching Next: shipping maps publishes your source to every visitor, and
|
|
36
|
+
// generating them costs real build time. Dev never emits them (the
|
|
37
|
+
// un-minified output is already readable).
|
|
38
|
+
productionBrowserSourceMaps?: boolean;
|
|
39
|
+
workspaceRoot?: string;
|
|
40
|
+
compat?: PNextCompatConfig;
|
|
41
|
+
adapter?: PNextAdapterConfig;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* What a deployment adapter packs into the server function. It ships the closure the runtime can reach, minus
|
|
46
|
+
* build debris and files no runtime reads - serverless size limits are hard. These lists are the escape hatch
|
|
47
|
+
* when that classification is wrong for an app: `exclude` drops more, `keep` overrides a built-in drop.
|
|
48
|
+
* Entries are directory names (`storybook-static`) or file suffixes (`.map`).
|
|
49
|
+
*/
|
|
50
|
+
export interface PNextAdapterConfig {
|
|
51
|
+
exclude?: string[];
|
|
52
|
+
keep?: string[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface PNextCompatConfig {
|
|
56
|
+
next?: boolean;
|
|
57
|
+
react?: boolean;
|
|
58
|
+
reactCompiler?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface MetadataLink {
|
|
62
|
+
rel: string;
|
|
63
|
+
url: string;
|
|
64
|
+
dataPrecedence?: string;
|
|
65
|
+
type?: string;
|
|
66
|
+
media?: string;
|
|
67
|
+
sizes?: string;
|
|
68
|
+
as?: string;
|
|
69
|
+
title?: string;
|
|
70
|
+
hrefLang?: string;
|
|
71
|
+
crossOrigin?: 'anonymous' | 'use-credentials' | '';
|
|
72
|
+
fetchPriority?: 'high' | 'low' | 'auto';
|
|
73
|
+
/** CSP nonce (Next §A8) — set for a manually-nonced next/script preload hint. */
|
|
74
|
+
nonce?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** A generic document resource hint. Compat owns any resource-specific attributes. */
|
|
78
|
+
export interface ResourceHint extends Omit<MetadataLink, 'url'> {
|
|
79
|
+
url?: string;
|
|
80
|
+
attributes?: Readonly<Record<string, string>>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type MetadataTitle =
|
|
84
|
+
| string
|
|
85
|
+
| number
|
|
86
|
+
| { absolute?: string; default?: string; template?: string | null };
|
|
87
|
+
|
|
88
|
+
export type MetadataIcon = string | URL | (Partial<MetadataLink> & { url: string | URL });
|
|
89
|
+
|
|
90
|
+
export interface MetadataIconGroups {
|
|
91
|
+
icon?: MetadataIcon | MetadataIcon[];
|
|
92
|
+
shortcut?: MetadataIcon | MetadataIcon[];
|
|
93
|
+
apple?: MetadataIcon | MetadataIcon[];
|
|
94
|
+
other?: MetadataIcon | MetadataIcon[];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface MetadataAuthor {
|
|
98
|
+
name?: string;
|
|
99
|
+
url?: string | URL;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface MetadataRobots {
|
|
103
|
+
index?: boolean;
|
|
104
|
+
follow?: boolean;
|
|
105
|
+
noarchive?: boolean;
|
|
106
|
+
nosnippet?: boolean;
|
|
107
|
+
noimageindex?: boolean;
|
|
108
|
+
nocache?: boolean;
|
|
109
|
+
googleBot?: MetadataRobots & Record<string, string | number | boolean | undefined>;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type MetadataImage =
|
|
113
|
+
| string
|
|
114
|
+
| URL
|
|
115
|
+
| {
|
|
116
|
+
url: string | URL;
|
|
117
|
+
secureUrl?: string | URL;
|
|
118
|
+
width?: string | number;
|
|
119
|
+
height?: string | number;
|
|
120
|
+
alt?: string;
|
|
121
|
+
type?: string;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export interface MetadataOpenGraph {
|
|
125
|
+
title?: MetadataTitle;
|
|
126
|
+
description?: string;
|
|
127
|
+
url?: string | URL;
|
|
128
|
+
siteName?: string;
|
|
129
|
+
locale?: string;
|
|
130
|
+
type?: string;
|
|
131
|
+
images?: MetadataImage | MetadataImage[];
|
|
132
|
+
videos?: MetadataImage | MetadataImage[];
|
|
133
|
+
audio?: MetadataImage | MetadataImage[];
|
|
134
|
+
publishedTime?: string;
|
|
135
|
+
authors?: string | string[];
|
|
136
|
+
emails?: string | string[];
|
|
137
|
+
phoneNumbers?: string | string[];
|
|
138
|
+
faxNumbers?: string | string[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface MetadataTwitter {
|
|
142
|
+
card?: string;
|
|
143
|
+
site?: string;
|
|
144
|
+
siteId?: string;
|
|
145
|
+
creator?: string;
|
|
146
|
+
creatorId?: string;
|
|
147
|
+
title?: MetadataTitle;
|
|
148
|
+
description?: string;
|
|
149
|
+
images?: MetadataImage | MetadataImage[];
|
|
150
|
+
players?: {
|
|
151
|
+
playerUrl?: string | URL;
|
|
152
|
+
streamUrl?: string | URL;
|
|
153
|
+
width?: string | number;
|
|
154
|
+
height?: string | number;
|
|
155
|
+
};
|
|
156
|
+
app?: {
|
|
157
|
+
name?: string;
|
|
158
|
+
id?: Record<string, string | undefined>;
|
|
159
|
+
url?: Record<string, string | URL | undefined>;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface MetadataAlternates {
|
|
164
|
+
canonical?: string | URL | { url: string | URL };
|
|
165
|
+
languages?: Record<string, string | URL>;
|
|
166
|
+
media?: Record<string, string | URL>;
|
|
167
|
+
types?: Record<
|
|
168
|
+
string,
|
|
169
|
+
| string
|
|
170
|
+
| URL
|
|
171
|
+
| { url: string | URL; title?: string }
|
|
172
|
+
| (string | URL | { url: string | URL; title?: string })[]
|
|
173
|
+
>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface Metadata {
|
|
177
|
+
metadataBase?: string | URL;
|
|
178
|
+
title?: MetadataTitle;
|
|
179
|
+
description?: string;
|
|
180
|
+
lang?: string;
|
|
181
|
+
keywords?: string | number | (string | number)[];
|
|
182
|
+
authors?: string | MetadataAuthor | (string | MetadataAuthor)[];
|
|
183
|
+
generator?: string;
|
|
184
|
+
applicationName?: string;
|
|
185
|
+
referrer?: string;
|
|
186
|
+
robots?: string | MetadataRobots;
|
|
187
|
+
openGraph?: MetadataOpenGraph;
|
|
188
|
+
twitter?: MetadataTwitter;
|
|
189
|
+
alternates?: MetadataAlternates;
|
|
190
|
+
pagination?: {
|
|
191
|
+
previous?: string | URL;
|
|
192
|
+
next?: string | URL;
|
|
193
|
+
};
|
|
194
|
+
icons?: MetadataIcon | MetadataIcon[] | MetadataIconGroups;
|
|
195
|
+
manifest?: string | URL;
|
|
196
|
+
creator?: string;
|
|
197
|
+
publisher?: string;
|
|
198
|
+
formatDetection?: {
|
|
199
|
+
email?: boolean;
|
|
200
|
+
address?: boolean;
|
|
201
|
+
telephone?: boolean;
|
|
202
|
+
url?: boolean;
|
|
203
|
+
};
|
|
204
|
+
verification?: {
|
|
205
|
+
google?: string | string[];
|
|
206
|
+
yahoo?: string | string[];
|
|
207
|
+
yandex?: string | string[];
|
|
208
|
+
other?: Record<string, string | string[]>;
|
|
209
|
+
};
|
|
210
|
+
itunes?: {
|
|
211
|
+
appId?: string;
|
|
212
|
+
appArgument?: string;
|
|
213
|
+
};
|
|
214
|
+
appleWebApp?:
|
|
215
|
+
| boolean
|
|
216
|
+
| {
|
|
217
|
+
capable?: boolean;
|
|
218
|
+
title?: string;
|
|
219
|
+
statusBarStyle?: string;
|
|
220
|
+
startupImage?:
|
|
221
|
+
| string
|
|
222
|
+
| URL
|
|
223
|
+
| { url: string | URL; media?: string }
|
|
224
|
+
| (string | URL | { url: string | URL; media?: string })[];
|
|
225
|
+
};
|
|
226
|
+
facebook?: {
|
|
227
|
+
appId?: string;
|
|
228
|
+
admins?: string | string[];
|
|
229
|
+
};
|
|
230
|
+
pinterest?: {
|
|
231
|
+
richPin?: boolean;
|
|
232
|
+
};
|
|
233
|
+
appLinks?: Record<string, Record<string, string | boolean | undefined>>;
|
|
234
|
+
other?: Record<string, string | string[]>;
|
|
235
|
+
links?: MetadataLink[];
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export type ThemeColor = string | { color: string; media?: string };
|
|
239
|
+
|
|
240
|
+
export interface Viewport {
|
|
241
|
+
width?: string | number;
|
|
242
|
+
initialScale?: number;
|
|
243
|
+
minimumScale?: number;
|
|
244
|
+
maximumScale?: number;
|
|
245
|
+
userScalable?: boolean;
|
|
246
|
+
viewportFit?: 'auto' | 'contain' | 'cover';
|
|
247
|
+
interactiveWidget?: 'resizes-visual' | 'resizes-content' | 'overlays-content';
|
|
248
|
+
themeColor?: ThemeColor | ThemeColor[];
|
|
249
|
+
colorScheme?: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface NextRequestCookie {
|
|
253
|
+
name: string;
|
|
254
|
+
value: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface NextRequestCookies {
|
|
258
|
+
get(name: string): NextRequestCookie | undefined;
|
|
259
|
+
getAll(name?: string): NextRequestCookie[];
|
|
260
|
+
has(name: string): boolean;
|
|
261
|
+
set(name: string, value: string): this;
|
|
262
|
+
delete(name: string): boolean;
|
|
263
|
+
clear(): void;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export interface NextResponseCookies {
|
|
267
|
+
set(options: {
|
|
268
|
+
name: string;
|
|
269
|
+
value: string;
|
|
270
|
+
path?: string;
|
|
271
|
+
maxAge?: number;
|
|
272
|
+
httpOnly?: boolean;
|
|
273
|
+
secure?: boolean;
|
|
274
|
+
sameSite?: 'strict' | 'lax' | 'none';
|
|
275
|
+
}): this;
|
|
276
|
+
set(
|
|
277
|
+
name: string,
|
|
278
|
+
value: string,
|
|
279
|
+
options?: {
|
|
280
|
+
path?: string;
|
|
281
|
+
maxAge?: number;
|
|
282
|
+
httpOnly?: boolean;
|
|
283
|
+
secure?: boolean;
|
|
284
|
+
sameSite?: 'strict' | 'lax' | 'none';
|
|
285
|
+
},
|
|
286
|
+
): this;
|
|
287
|
+
delete(name: string): this;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface NextURL extends URL {
|
|
291
|
+
clone(): NextURL;
|
|
292
|
+
/** The configured basePath prefix ('' when unset), mirroring Next's NextURL. */
|
|
293
|
+
basePath: string;
|
|
294
|
+
/** The active locale ('' without i18n), mirroring Next's NextURL. */
|
|
295
|
+
locale: string;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export interface NextRequest extends Request {
|
|
299
|
+
cookies: NextRequestCookies;
|
|
300
|
+
nextUrl: NextURL;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface NextFetchEvent {
|
|
304
|
+
waitUntil(promise: Promise<unknown>): void;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
type ParamsInput<P> = P extends RoutePath
|
|
308
|
+
? RouteParams<P>
|
|
309
|
+
: P extends Record<string, RouteParamValue>
|
|
310
|
+
? P
|
|
311
|
+
: Record<string, RouteParamValue>;
|
|
312
|
+
|
|
313
|
+
export type PageSearchParams = Record<string, string | string[] | undefined>;
|
|
314
|
+
|
|
315
|
+
export interface PageProps<P = Record<string, RouteParamValue>> {
|
|
316
|
+
params: Promise<ParamsInput<P>>;
|
|
317
|
+
searchParams: Promise<PageSearchParams>;
|
|
318
|
+
request?: NextRequest;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export interface RouteContext<P = Record<string, RouteParamValue>> {
|
|
322
|
+
params: Promise<ParamsInput<P>>;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export type ServerComponentResult = ComponentChildren | void;
|
|
326
|
+
|
|
327
|
+
export type ServerComponent<Props = Record<string, never>> = (
|
|
328
|
+
props: Props,
|
|
329
|
+
) => ServerComponentResult | Promise<ServerComponentResult>;
|
|
330
|
+
|
|
331
|
+
export interface LayoutProps {
|
|
332
|
+
children: ComponentChildren;
|
|
333
|
+
params: Promise<Record<string, RouteParamValue>>;
|
|
334
|
+
searchParams: Promise<PageSearchParams>;
|
|
335
|
+
request?: NextRequest;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export type RouteHandler = {
|
|
339
|
+
bivarianceHack(request: NextRequest, context: RouteContext): Response | Promise<Response>;
|
|
340
|
+
}['bivarianceHack'];
|
|
341
|
+
|
|
342
|
+
/** Kind of intercepting-route marker on a route directory (Next.js convention). */
|
|
343
|
+
export type InterceptionMarker = '(.)' | '(..)' | '(..)(..)' | '(...)';
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Parallel-route render state carried across soft navigations. The client
|
|
347
|
+
* echoes the state embedded in the current document (plus history entries) so
|
|
348
|
+
* the server can re-render unmatched slots from the path they last matched.
|
|
349
|
+
*/
|
|
350
|
+
export interface NavState {
|
|
351
|
+
/** Pathname the children tree rendered from. */
|
|
352
|
+
children?: string;
|
|
353
|
+
/**
|
|
354
|
+
* Search string (`?a=b`, may be empty or absent) the children tree rendered with. On a host render, where
|
|
355
|
+
* interception keeps the current page visible, the children page re-renders with THIS query, not the target
|
|
356
|
+
* URL's - Next's per-segment refetch-URL semantics preserve each slot's searchParams.
|
|
357
|
+
*/
|
|
358
|
+
childrenSearch?: string;
|
|
359
|
+
/**
|
|
360
|
+
* App-relative slot directory -> source URL (`pathname` or
|
|
361
|
+
* `pathname?query`) its content rendered from. The query, when present, is
|
|
362
|
+
* the searchParams the slot's page re-renders with when re-rendered from
|
|
363
|
+
* this recorded source.
|
|
364
|
+
*/
|
|
365
|
+
slots?: Record<string, string>;
|
|
366
|
+
/**
|
|
367
|
+
* The children slot rendered a `default.*` because no page matched this path (Next's `__DEFAULT__`
|
|
368
|
+
* segment). `useSelectedLayoutSegment()` with no parallel-route key reports NOTHING for such a slot - the
|
|
369
|
+
* path's segments belong to whichever parallel slot did match, not to children.
|
|
370
|
+
*/
|
|
371
|
+
childrenDefault?: boolean;
|
|
372
|
+
/**
|
|
373
|
+
* The served document is a fully static (prerendered) route. Inlined so a
|
|
374
|
+
* hard load can seed its prefetch entry with the static reuse window rather
|
|
375
|
+
* than the dynamic default. Mirrors the `/_tree` payload's `isStatic`.
|
|
376
|
+
*/
|
|
377
|
+
isStatic?: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* The route's `x-nextjs-stale-time` window (seconds) from its `use cache`
|
|
380
|
+
* `cacheLife()`, inlined for the same hard-load seeding path. Mirrors the
|
|
381
|
+
* `/_tree` payload's `staleTime`.
|
|
382
|
+
*/
|
|
383
|
+
staleTime?: number;
|
|
384
|
+
/**
|
|
385
|
+
* The served document was resumed from a BAKED SHELL (a fallback shell or a
|
|
386
|
+
* sub-shell), so the markup above its dynamic holes is a prerender even though
|
|
387
|
+
* the document as a whole is not static. The client files a hard load's
|
|
388
|
+
* pre-hydration stage as a reusable static stage on the strength of this;
|
|
389
|
+
* `isStatic` stays false, so the whole-document reuse window is untouched.
|
|
390
|
+
*/
|
|
391
|
+
staticStage?: boolean;
|
|
392
|
+
/**
|
|
393
|
+
* The served document is an interception HOST render: the URL is the intercepted target but the children
|
|
394
|
+
* tree kept rendering the host page. Such a document is bound to its host - the client must NOT reuse it
|
|
395
|
+
* origin-agnostically for a navigation issued from a DIFFERENT host, nor as a direct render of the target.
|
|
396
|
+
* Stamped by the server, which alone knows the pre-rewrite host path; the client cannot infer it by
|
|
397
|
+
* comparing `children` to the browser pathname under a rewrite.
|
|
398
|
+
*/
|
|
399
|
+
hostRender?: boolean;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Metadata for an intercepting route. The entry's own `route`/`pattern` hold
|
|
404
|
+
* the TARGET path the interceptor responds to; interception entries only match
|
|
405
|
+
* soft navigations whose current children path sits at or below `base`.
|
|
406
|
+
*/
|
|
407
|
+
export interface RouteInterception {
|
|
408
|
+
/** The raw marker that prefixed the intercepted segment. */
|
|
409
|
+
marker: InterceptionMarker;
|
|
410
|
+
/** Route path of the level the interceptor renders within (e.g. `/feed`). */
|
|
411
|
+
base: string;
|
|
412
|
+
/** Regex source (anchored by the matcher) for paths at or below `base`. */
|
|
413
|
+
basePattern: string;
|
|
414
|
+
/**
|
|
415
|
+
* Absolute path of the `@slot` directory the interceptor renders into. When
|
|
416
|
+
* set, the interceptor renders as slot content of the current page; when
|
|
417
|
+
* absent, the interceptor page replaces the children tree.
|
|
418
|
+
*/
|
|
419
|
+
slotDir?: string;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export interface RouteManifestEntry {
|
|
423
|
+
id: string;
|
|
424
|
+
kind: 'page' | 'handler';
|
|
425
|
+
route: string;
|
|
426
|
+
pattern: string;
|
|
427
|
+
file: string;
|
|
428
|
+
params: string[];
|
|
429
|
+
catchAll?: string;
|
|
430
|
+
/**
|
|
431
|
+
* The trailing catch-all is optional (`[[...slug]]`): it matches both the
|
|
432
|
+
* parent path and nested paths. When set, `catchAll` holds the param name and
|
|
433
|
+
* the pattern's final group is `(?:/(.*))?`.
|
|
434
|
+
*/
|
|
435
|
+
catchAllOptional?: boolean;
|
|
436
|
+
mode: RouteMode;
|
|
437
|
+
hasStaticParams: boolean;
|
|
438
|
+
usesRequest: boolean;
|
|
439
|
+
/**
|
|
440
|
+
* Route handler that calls a revalidation API (revalidatePath/revalidateTag/
|
|
441
|
+
* expirePath/expireTag). Such a handler performs a side effect that cannot be
|
|
442
|
+
* prerendered, so it stays dynamic even when a `revalidate` export or
|
|
443
|
+
* generateStaticParams would otherwise opt it into static ISR output.
|
|
444
|
+
*/
|
|
445
|
+
handlerUsesRevalidationApi?: boolean;
|
|
446
|
+
/**
|
|
447
|
+
* Route declares `export const dynamic = 'error'` AND statically references a
|
|
448
|
+
* dynamic data API (cookies()/headers()/connection()/searchParams for pages,
|
|
449
|
+
* request.formData/nextUrl/url for handlers). Next fails the build for such a
|
|
450
|
+
* route ("couldn't be rendered statically"); the value is the API label Next
|
|
451
|
+
* names in that error (e.g. `cookies()`, `nextUrl.toString`). Set at scan time
|
|
452
|
+
* and enforced in the build's prerender pass.
|
|
453
|
+
*/
|
|
454
|
+
dynamicErrorApi?: string;
|
|
455
|
+
client: boolean;
|
|
456
|
+
clientReferences: import('./client/reference').ClientReference[];
|
|
457
|
+
cssImports: string[];
|
|
458
|
+
cssAssets?: string[];
|
|
459
|
+
sourceFiles: string[];
|
|
460
|
+
stream?: {
|
|
461
|
+
hasLoadingBoundary?: boolean;
|
|
462
|
+
ancestorClientReferences?: string[];
|
|
463
|
+
};
|
|
464
|
+
clientEntry?: string;
|
|
465
|
+
/** Static import closure of the client entry, for modulepreload links. */
|
|
466
|
+
clientEntryImports?: string[];
|
|
467
|
+
/** Dynamic import closure of the client entry, for low-priority preload links. */
|
|
468
|
+
clientDynamicImports?: string[];
|
|
469
|
+
maxDuration?: number;
|
|
470
|
+
/** Route opts into partial prerendering via `export const experimental_ppr = true`. */
|
|
471
|
+
ppr?: boolean;
|
|
472
|
+
/** Merged Next segment config across the page/handler and its layout chain. */
|
|
473
|
+
segmentConfig?: RouteSegmentConfig;
|
|
474
|
+
/** Code-based metadata route synthesized from robots/sitemap/icon/etc. */
|
|
475
|
+
metadataRoute?: MetadataRouteEntry;
|
|
476
|
+
/** Param sets prerendered at build from params(). Compat aliases generateStaticParams to params. */
|
|
477
|
+
prerenderedParams?: Record<string, RouteParamValue>[];
|
|
478
|
+
/**
|
|
479
|
+
* Per-prerendered-URL vary sets tracked by the BUILD render, keyed by the concrete pathname. A request-time
|
|
480
|
+
* render answered from that prerender executes no user code, so it tracks nothing and would publish
|
|
481
|
+
* "unknown" (exact-URL keying) - these are the sets it publishes instead.
|
|
482
|
+
*/
|
|
483
|
+
prerenderVary?: Record<string, { vary: string[]; layoutVary: string[]; pageVary: string[] }>;
|
|
484
|
+
/** Suspense boundary ids left as dynamic holes in the prebuilt PPR shell. */
|
|
485
|
+
pprHoles?: number[];
|
|
486
|
+
/** Metadata postponed out of the static PPR shell and resumed into the body. */
|
|
487
|
+
pprMetadata?: boolean;
|
|
488
|
+
/**
|
|
489
|
+
* Effective `use cache` cacheLife captured from the route's shell prerender.
|
|
490
|
+
* A prebuilt page never re-runs its cache scopes at serve time, so start.ts
|
|
491
|
+
* re-emits the SWR cache-control + x-nextjs-stale-time headers from this on a
|
|
492
|
+
* pure static HIT/MISS (the render-time header finalizer never fires there).
|
|
493
|
+
*/
|
|
494
|
+
cacheLife?: {
|
|
495
|
+
revalidateSeconds?: number;
|
|
496
|
+
expireSeconds?: number;
|
|
497
|
+
staleSeconds?: number;
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* The `Link` response header captured from the route's shell prerender (font
|
|
501
|
+
* preloads + react-dom preload()/preconnect() hints, capped by
|
|
502
|
+
* reactMaxHeadersLength). A PPR resume replays the shell without re-running
|
|
503
|
+
* the components that emitted the hints, so start.ts re-emits the header
|
|
504
|
+
* from here (mirrors Next serving the prerender's stored headers).
|
|
505
|
+
*/
|
|
506
|
+
linkHeader?: string;
|
|
507
|
+
/**
|
|
508
|
+
* Cache tags collected across the route's shell (and sub-shell) prerenders - cacheTag(),
|
|
509
|
+
* unstable_cache({tags}), fetch({next:{tags}}). A prebuilt PPR shell must stop serving once one of these
|
|
510
|
+
* tags, or the route's path, is revalidated; loadPprShell compares them against the shell file's mtime.
|
|
511
|
+
*/
|
|
512
|
+
cacheTags?: string[];
|
|
513
|
+
/**
|
|
514
|
+
* Prebuilt sub-shells at descending param specificity. Each entry fixes a leading prefix of params
|
|
515
|
+
* (`concreteParams`) - those render buildtime - while the remaining route params hang. Ordered MOST-specific
|
|
516
|
+
* first so the request path serves the deepest matching one; the base shell (all params hang) is the
|
|
517
|
+
* least-specific fallback. `key` is the on-disk signature; `holes` are that shell's own dynamic hole ids.
|
|
518
|
+
*/
|
|
519
|
+
pprSubShells?: {
|
|
520
|
+
key: string;
|
|
521
|
+
concreteParams: Record<string, RouteParamValue>;
|
|
522
|
+
holes: number[];
|
|
523
|
+
}[];
|
|
524
|
+
/**
|
|
525
|
+
* `template.*` files from app root to the route's own segment, parallel to
|
|
526
|
+
* the layout chain. A template re-mounts on navigation where a layout persists.
|
|
527
|
+
*/
|
|
528
|
+
templateFiles?: string[];
|
|
529
|
+
/** `forbidden.*` files nearest-last (root->leaf); COMPAT authInterrupts. */
|
|
530
|
+
forbiddenFiles?: string[];
|
|
531
|
+
/** `unauthorized.*` files nearest-last (root->leaf); COMPAT authInterrupts. */
|
|
532
|
+
unauthorizedFiles?: string[];
|
|
533
|
+
/**
|
|
534
|
+
* Parallel-route `@slot` directories (absolute) along the route's layout
|
|
535
|
+
* chain, root->leaf. Presence means slot content participates in rendering
|
|
536
|
+
* and soft navigations must render dynamically.
|
|
537
|
+
*/
|
|
538
|
+
slotDirs?: string[];
|
|
539
|
+
/**
|
|
540
|
+
* Entry synthesized from a parallel slot's page: the URL is only reachable
|
|
541
|
+
* because a slot matches it. `file` anchors the layout chain; the children
|
|
542
|
+
* tree renders `childrenDefault` (or nothing) instead of importing `file`.
|
|
543
|
+
*/
|
|
544
|
+
synthetic?: boolean;
|
|
545
|
+
/** Slot directory whose page produced this synthetic route. */
|
|
546
|
+
syntheticSlotDir?: string;
|
|
547
|
+
/** `default.*` file rendered as children for a synthetic entry. */
|
|
548
|
+
childrenDefault?: string;
|
|
549
|
+
/** Intercepting-route metadata, when this route is an interceptor. */
|
|
550
|
+
interception?: RouteInterception;
|
|
551
|
+
/**
|
|
552
|
+
* Ship the soft-navigation runtime even without client references. Derived:
|
|
553
|
+
* true exactly when `clientEntryReasons` is non-empty. Kept as its own field
|
|
554
|
+
* because it is what every consumer asks and what the manifest carries.
|
|
555
|
+
*/
|
|
556
|
+
needsRouterEntry?: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* WHY this route needs the client entry - one entry per fact the scan (or the build) observed. The client
|
|
559
|
+
* build gates its feature regions on these, so a `<Link>`-only page never ships the action machinery;
|
|
560
|
+
* collapsing them back into the boolean above loses exactly that.
|
|
561
|
+
*/
|
|
562
|
+
clientEntryReasons?: ClientEntryReason[];
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Why a page ships the client router entry. Each value is a fact some detection site actually observes:
|
|
567
|
+
* compat-parity - Next compat emits its app-router bootstrap on every page
|
|
568
|
+
* parallel-routes - the app uses parallel/intercepting routes (soft nav only)
|
|
569
|
+
* link - the page's graph renders <Link>
|
|
570
|
+
* actions - the page's graph reaches a server action, or a client component passes a function to
|
|
571
|
+
* `<form action>`/`formAction`
|
|
572
|
+
* form - the page's graph renders next/form
|
|
573
|
+
* router-api - the page's graph imports Link or a navigation hook anywhere, scanned for every page
|
|
574
|
+
* including those that already ship an entry: the entry drops the router entirely when no
|
|
575
|
+
* route file can start a soft navigation
|
|
576
|
+
*/
|
|
577
|
+
export type ClientEntryReason =
|
|
578
|
+
| 'compat-parity'
|
|
579
|
+
| 'parallel-routes'
|
|
580
|
+
| 'link'
|
|
581
|
+
| 'router-api'
|
|
582
|
+
| 'actions'
|
|
583
|
+
| 'form'
|
|
584
|
+
| 'control-flow';
|
|
585
|
+
|
|
586
|
+
export type MetadataRouteKind =
|
|
587
|
+
| 'icon'
|
|
588
|
+
| 'apple-icon'
|
|
589
|
+
| 'opengraph-image'
|
|
590
|
+
| 'twitter-image'
|
|
591
|
+
| 'robots'
|
|
592
|
+
| 'sitemap'
|
|
593
|
+
| 'manifest';
|
|
594
|
+
|
|
595
|
+
export interface MetadataRouteEntry {
|
|
596
|
+
kind: MetadataRouteKind;
|
|
597
|
+
generatedParam?: string;
|
|
598
|
+
/**
|
|
599
|
+
* Concrete pathnames the generated-param expansion resolved to at build (generateSitemaps /
|
|
600
|
+
* generateImageMetadata ids). The route pattern itself carries a param so it is never `mode: 'static'`, but
|
|
601
|
+
* every id is known ahead of time - Next lists each expanded pathname as a prerendered route. Recorded
|
|
602
|
+
* during the handler prerender pass.
|
|
603
|
+
*/
|
|
604
|
+
generatedRoutes?: string[];
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
export interface StaticMetadataFileEntry {
|
|
608
|
+
kind: MetadataRouteKind | 'favicon';
|
|
609
|
+
file: string;
|
|
610
|
+
relative: string;
|
|
611
|
+
outputPath: string;
|
|
612
|
+
routeSegments: string[];
|
|
613
|
+
contentType: string;
|
|
614
|
+
width?: number;
|
|
615
|
+
height?: number;
|
|
616
|
+
sizes?: string;
|
|
617
|
+
alt?: string;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
export interface StaticModuleMetadata {
|
|
621
|
+
metadata?: Metadata;
|
|
622
|
+
viewport?: Viewport;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
export interface StaticRouteMetadata {
|
|
626
|
+
favicon?: StaticMetadataFileEntry;
|
|
627
|
+
manifest?: StaticMetadataFileEntry;
|
|
628
|
+
manifestLink?: MetadataLink;
|
|
629
|
+
icons: StaticMetadataFileEntry[];
|
|
630
|
+
appleIcons: StaticMetadataFileEntry[];
|
|
631
|
+
rootIcons: StaticMetadataFileEntry[];
|
|
632
|
+
dynamicIcons?: MetadataLink[];
|
|
633
|
+
dynamicAppleIcons?: MetadataLink[];
|
|
634
|
+
openGraphImage?: MetadataImage;
|
|
635
|
+
dynamicOpenGraphImages?: MetadataImage[];
|
|
636
|
+
twitterImage?: MetadataImage;
|
|
637
|
+
dynamicTwitterImages?: MetadataImage[];
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export interface BuildManifest {
|
|
641
|
+
version: 0;
|
|
642
|
+
root: string;
|
|
643
|
+
appDir: string;
|
|
644
|
+
outDir: string;
|
|
645
|
+
routes: RouteManifestEntry[];
|
|
646
|
+
staticFiles?: Record<string, StaticFileMetadata>;
|
|
647
|
+
staticMetadataFiles?: StaticMetadataFileEntry[];
|
|
648
|
+
staticModuleMetadata?: Record<string, StaticModuleMetadata>;
|
|
649
|
+
staticRouteMetadata?: Record<string, StaticRouteMetadata>;
|
|
650
|
+
/** Compiled proxy/middleware bundle, relative to outDir. */
|
|
651
|
+
proxyModule?: string;
|
|
652
|
+
/** Absolute path to the app-root `global-error.*` file, if present. */
|
|
653
|
+
globalErrorFile?: string;
|
|
654
|
+
/** Server-action registry: wire id -> compiled module + export. COMPAT. */
|
|
655
|
+
actions?: ActionManifestEntry[];
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/** One server-action target in the build manifest. */
|
|
659
|
+
export interface ActionManifestEntry {
|
|
660
|
+
/** Wire id (actionId), sent by the client stub in the next-action header. */
|
|
661
|
+
id: string;
|
|
662
|
+
/**
|
|
663
|
+
* Project-root-relative POSIX path of the action's SOURCE module. Used at
|
|
664
|
+
* startup to recompute the id (actionId with no root), giving parity with the
|
|
665
|
+
* client stub's id regardless of the machine's absolute paths.
|
|
666
|
+
*/
|
|
667
|
+
sourceKey: string;
|
|
668
|
+
/** Compiled server-module path, relative to outDir, for start to import. */
|
|
669
|
+
modulePath: string;
|
|
670
|
+
/** Export name within the module implementing the action. */
|
|
671
|
+
exportName: string;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
export interface StaticFileMetadata {
|
|
675
|
+
status: number;
|
|
676
|
+
headers: [string, string][];
|
|
677
|
+
routeId?: string;
|
|
678
|
+
/** 'page' entries are prebuilt HTML subject to ISR; absent means handler output. */
|
|
679
|
+
kind?: 'page';
|
|
680
|
+
/** ISR TTL in seconds (min of segment config and fetch/unstable_cache revalidates). */
|
|
681
|
+
revalidateSeconds?: number;
|
|
682
|
+
/**
|
|
683
|
+
* Hard-expiry window in seconds from a `use cache` cacheLife(). Past this the
|
|
684
|
+
* stale copy is NO LONGER served: the request blocks on a fresh render (vs
|
|
685
|
+
* revalidateSeconds, which serves stale-while-revalidate).
|
|
686
|
+
*/
|
|
687
|
+
expireSeconds?: number;
|
|
688
|
+
/** `x-nextjs-stale-time` window in seconds from a `use cache` cacheLife(). */
|
|
689
|
+
staleSeconds?: number;
|
|
690
|
+
/** Cache tags the prerender depended on; revalidateTag(tag) marks the file stale. */
|
|
691
|
+
tags?: string[];
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/** Next route segment config exports (`export const dynamic/revalidate/...`). */
|
|
695
|
+
export interface RouteSegmentConfig {
|
|
696
|
+
dynamic?: 'auto' | 'force-dynamic' | 'error' | 'force-static';
|
|
697
|
+
revalidate?: number | false;
|
|
698
|
+
fetchCache?:
|
|
699
|
+
| 'auto'
|
|
700
|
+
| 'default-cache'
|
|
701
|
+
| 'only-cache'
|
|
702
|
+
| 'force-cache'
|
|
703
|
+
| 'force-no-store'
|
|
704
|
+
| 'default-no-store'
|
|
705
|
+
| 'only-no-store';
|
|
706
|
+
/** Param names governed by a `dynamicParams = false` declaration. */
|
|
707
|
+
dynamicParamsFalse?: string[];
|
|
708
|
+
/**
|
|
709
|
+
* The page has its own static params export while a `dynamicParams = false`
|
|
710
|
+
* declaration governs the route: every param tuple must match a prerendered
|
|
711
|
+
* path (Next's fallback: false), not just the governed params.
|
|
712
|
+
*/
|
|
713
|
+
strictDynamicParams?: boolean;
|
|
714
|
+
/** `export const runtime` value, when declared ('edge' | 'nodejs'). */
|
|
715
|
+
runtime?: string;
|
|
716
|
+
/** Next app-shell prefetch policy declared by the route. */
|
|
717
|
+
prefetch?: 'allow-runtime' | 'partial' | 'unstable_eager';
|
|
718
|
+
/**
|
|
719
|
+
* `export const unstable_instant` on the page or a layout in its chain (a boolean or a sample-config object
|
|
720
|
+
* means true; an explicit `false` on a leaf overrides an ancestor's opt-in). A full (`prefetch={true}`)
|
|
721
|
+
* prefetch of an instant route is served as a RUNTIME-PREFETCH prerender: request data is sampled into the
|
|
722
|
+
* response while connection()-gated content is omitted.
|
|
723
|
+
*/
|
|
724
|
+
unstableInstant?: boolean;
|
|
725
|
+
}
|