@wular/pnext 0.1.5 → 0.1.7
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/bin/pnext +9 -2
- package/dist/server/_chunks/aliases-j47a10ce.js +44 -0
- package/dist/server/_chunks/analyze-arswqe6s.js +445 -0
- package/dist/server/_chunks/boot-af0mv3dy.js +36 -0
- package/dist/server/_chunks/build-spy3dxp4.js +84 -0
- package/dist/server/_chunks/build-t9h0hec3.js +3550 -0
- package/dist/server/_chunks/build-tier-m7yvqz61.js +2472 -0
- package/dist/server/_chunks/compile-53j02j27.js +22 -0
- package/dist/server/_chunks/config-1yzwexq6.js +27 -0
- package/dist/server/_chunks/config-n2z7yxps.js +22 -0
- package/dist/server/_chunks/create-meec9hs6.js +134 -0
- package/dist/server/_chunks/dev-fjmqg6en.js +220 -0
- package/dist/server/_chunks/esbuild-yyktfrtt.js +15 -0
- package/dist/server/_chunks/generate-n9sh6hzt.js +21 -0
- package/dist/server/_chunks/index-0374j2b9.js +66 -0
- package/dist/server/_chunks/index-06nyqntx.js +213 -0
- package/dist/server/_chunks/index-1011cscr.js +5263 -0
- package/dist/server/_chunks/index-11sfk4hb.js +170 -0
- package/dist/server/_chunks/index-20ppawv7.js +297 -0
- package/dist/server/_chunks/index-2dv4y4wd.js +1065 -0
- package/dist/server/_chunks/index-2vz0wzdn.js +59 -0
- package/dist/server/_chunks/index-2wfv4kvx.js +182 -0
- package/dist/server/_chunks/index-357na4a8.js +109 -0
- package/dist/server/_chunks/index-3b3at80h.js +109 -0
- package/dist/server/_chunks/index-3tf1xjsp.js +6166 -0
- package/dist/server/_chunks/index-3xbr4eyv.js +105 -0
- package/dist/server/_chunks/index-4399bvd2.js +18 -0
- package/dist/server/_chunks/index-4hgjrqh7.js +851 -0
- package/dist/server/_chunks/index-4q2gbfwk.js +2530 -0
- package/dist/server/_chunks/index-4t92hdxd.js +172 -0
- package/dist/server/_chunks/index-4zzebszd.js +10 -0
- package/dist/server/_chunks/index-5gyr4emz.js +107 -0
- package/dist/server/_chunks/index-5hr4062s.js +70 -0
- package/dist/server/_chunks/index-68m3mwbd.js +84 -0
- package/dist/server/_chunks/index-6b009mt0.js +56 -0
- package/dist/server/_chunks/index-6e4fqv30.js +588 -0
- package/dist/server/_chunks/index-6gex3pfa.js +15 -0
- package/dist/server/_chunks/index-6kp9r0d9.js +11 -0
- package/dist/server/_chunks/index-6q7zvrap.js +134 -0
- package/dist/server/_chunks/index-73z4esab.js +38 -0
- package/dist/server/_chunks/index-79ngvam8.js +60 -0
- package/dist/server/_chunks/index-7wc9n8be.js +25 -0
- package/dist/server/_chunks/index-8k7pfejn.js +1599 -0
- package/dist/server/_chunks/index-8kcxdfya.js +206 -0
- package/dist/server/_chunks/index-91x12ykq.js +274 -0
- package/dist/server/_chunks/index-9ch50vtq.js +18 -0
- package/dist/server/_chunks/index-9hx2641q.js +28 -0
- package/dist/server/_chunks/index-9n2914ww.js +535 -0
- package/dist/server/_chunks/index-9ych9ma8.js +207 -0
- package/dist/server/_chunks/index-b6wtkdp4.js +24 -0
- package/dist/server/_chunks/index-bcws5eh2.js +35 -0
- package/dist/server/_chunks/index-c0g2wf3z.js +92 -0
- package/dist/server/_chunks/index-cf4rvxv6.js +95 -0
- package/dist/server/_chunks/index-cjgqs13g.js +65 -0
- package/dist/server/_chunks/index-ckkdpht5.js +41 -0
- package/dist/server/_chunks/index-cyfednwb.js +87 -0
- package/dist/server/_chunks/index-danncfhy.js +311 -0
- package/dist/server/_chunks/index-dg0f05zs.js +199 -0
- package/dist/server/_chunks/index-e3a6yx84.js +18 -0
- package/dist/server/_chunks/index-e88tyv35.js +45 -0
- package/dist/server/_chunks/index-eajaspjk.js +1253 -0
- package/dist/server/_chunks/index-eeaanp2e.js +483 -0
- package/dist/server/_chunks/index-egykcqg3.js +101 -0
- package/dist/server/_chunks/index-en7n9f7m.js +22 -0
- package/dist/server/_chunks/index-ezgj0tr1.js +88 -0
- package/dist/server/_chunks/index-fkp000p1.js +590 -0
- package/dist/server/_chunks/index-fn1chkkd.js +214 -0
- package/dist/server/_chunks/index-fp8r0sqs.js +64 -0
- package/dist/server/_chunks/index-ggk2j965.js +9432 -0
- package/dist/server/_chunks/index-grta8ap3.js +238 -0
- package/dist/server/_chunks/index-h2a70tg4.js +7 -0
- package/dist/server/_chunks/index-h4xy648y.js +51 -0
- package/dist/server/_chunks/index-hkdfj58q.js +92 -0
- package/dist/server/_chunks/index-j2zrcp1k.js +66 -0
- package/dist/server/_chunks/index-jcsjq3d1.js +20 -0
- package/dist/server/_chunks/index-jepjvcrf.js +198 -0
- package/dist/server/_chunks/index-jks0x0a1.js +14 -0
- package/dist/server/_chunks/index-jx7bqvw1.js +57 -0
- package/dist/server/_chunks/index-k1g3epw0.js +1299 -0
- package/dist/server/_chunks/index-knp0s912.js +7 -0
- package/dist/server/_chunks/index-kq8kpzye.js +472 -0
- package/dist/server/_chunks/index-kqyy1d4f.js +50 -0
- package/dist/server/_chunks/index-kresp2n8.js +445 -0
- package/dist/server/_chunks/index-ms9v9tnx.js +31 -0
- package/dist/server/_chunks/index-n4hxpng2.js +11 -0
- package/dist/server/_chunks/index-ncnes8c6.js +17 -0
- package/dist/server/_chunks/index-nqh3xhdc.js +57 -0
- package/dist/server/_chunks/index-nyrba2kr.js +4130 -0
- package/dist/server/_chunks/index-p77b4kcx.js +296 -0
- package/dist/server/_chunks/index-pym1cezq.js +39 -0
- package/dist/server/_chunks/index-q738kkhj.js +100 -0
- package/dist/server/_chunks/index-qjj6gddn.js +54 -0
- package/dist/server/_chunks/index-qm6kmhqs.js +110 -0
- package/dist/server/_chunks/index-qn4z5s3c.js +819 -0
- package/dist/server/_chunks/index-qpwsgt3a.js +158 -0
- package/dist/server/_chunks/index-r97ptz1q.js +97 -0
- package/dist/server/_chunks/index-ras0sdab.js +26 -0
- package/dist/server/_chunks/index-rcs322t1.js +19 -0
- package/dist/server/_chunks/index-rn8dyr1f.js +126 -0
- package/dist/server/_chunks/index-rt9qq1va.js +4 -0
- package/dist/server/_chunks/index-rthrsed5.js +356 -0
- package/dist/server/_chunks/index-sctcgyvv.js +185 -0
- package/dist/server/_chunks/index-sjpckxqn.js +213 -0
- package/dist/server/_chunks/index-sq3kvz3g.js +200 -0
- package/dist/server/_chunks/index-stbk3jhn.js +31 -0
- package/dist/server/_chunks/index-sv8m6789.js +266 -0
- package/dist/server/_chunks/index-tgcakdxc.js +125 -0
- package/dist/server/_chunks/index-tgsfjmep.js +74 -0
- package/dist/server/_chunks/index-tq0pc7eg.js +154 -0
- package/dist/server/_chunks/index-tq1f96v7.js +51 -0
- package/dist/server/_chunks/index-tqn2qnnn.js +241 -0
- package/dist/server/_chunks/index-tvqkq6e6.js +128 -0
- package/dist/server/_chunks/index-v1ags1na.js +132 -0
- package/dist/server/_chunks/index-vvmmknm1.js +1431 -0
- package/dist/server/_chunks/index-vvq7rqtn.js +329 -0
- package/dist/server/_chunks/index-vz0km5qk.js +33 -0
- package/dist/server/_chunks/index-w6h8m6vp.js +138 -0
- package/dist/server/_chunks/index-web361b8.js +138 -0
- package/dist/server/_chunks/index-wpfhfbs4.js +194 -0
- package/dist/server/_chunks/index-x0y005nh.js +283 -0
- package/dist/server/_chunks/index-x3yn4ywm.js +22 -0
- package/dist/server/_chunks/index-x93hv0sc.js +271 -0
- package/dist/server/_chunks/index-xvj80c3a.js +30 -0
- package/dist/server/_chunks/index-xywjg2vc.js +100 -0
- package/dist/server/_chunks/index-y2jr2n72.js +152 -0
- package/dist/server/_chunks/index-y36a0ybw.js +57 -0
- package/dist/server/_chunks/index-ye9hmsvf.js +47 -0
- package/dist/server/_chunks/index-yhxkxghe.js +56 -0
- package/dist/server/_chunks/index-ym67zqxp.js +130 -0
- package/dist/server/_chunks/index-ytjvpbm2.js +736 -0
- package/dist/server/_chunks/index-yz54pxrh.js +960 -0
- package/dist/server/_chunks/index-z4z9zv3b.js +733 -0
- package/dist/server/_chunks/index-z84ab1w0.js +1270 -0
- package/dist/server/_chunks/index-z88qv16t.js +11 -0
- package/dist/server/_chunks/index-zqpqyg8p.js +666 -0
- package/dist/server/_chunks/loader-7yw0j98z.js +78 -0
- package/dist/server/_chunks/modules-jn8bmbn8.js +74 -0
- package/dist/server/_chunks/pipeline-yy9jhydf.js +832 -0
- package/dist/server/_chunks/production-jar9ztm3.js +44 -0
- package/dist/server/_chunks/proxy-config-j84dgksn.js +21 -0
- package/dist/server/_chunks/proxy-w1d0wmsn.js +33 -0
- package/dist/server/_chunks/router-k1reahfn.js +498 -0
- package/dist/server/_chunks/routes-2s277fc6.js +64 -0
- package/dist/server/_chunks/run-pvd8bs1t.js +696 -0
- package/dist/server/_chunks/server-mt4a994c.js +1835 -0
- package/dist/server/_chunks/tsconfig-defaults-1nb3308g.js +20 -0
- package/dist/server/_chunks/typegen-0qr0459b.js +35 -0
- package/dist/server/api/client-cache.js +14 -0
- package/dist/server/cli/index.js +378 -0
- package/dist/server/cli/start.js +137 -0
- package/dist/server/client/reference.js +16 -0
- package/dist/server/compat/next/cache.js +56 -0
- package/dist/server/compat/next/canonical-url.js +13 -0
- package/dist/server/compat/next/client-cache.js +57 -0
- package/dist/server/compat/next/client-navigation.js +232 -0
- package/dist/server/compat/next/client-only.js +1 -0
- package/dist/server/compat/next/client-script.js +178 -0
- package/dist/server/compat/next/client-server.js +34 -0
- package/dist/server/compat/next/config-headers.js +32 -0
- package/dist/server/compat/next/config-loader.js +25 -0
- package/dist/server/compat/next/config.js +10 -0
- package/dist/server/compat/next/constants.js +18 -0
- package/dist/server/compat/next/custom-server.js +10 -0
- package/dist/server/compat/next/dist/client/components/app-router-headers.js +48 -0
- package/dist/server/compat/next/dist/server/web/spec-extension/revalidate.js +27 -0
- package/dist/server/compat/next/dist/server/web/spec-extension/unstable-cache.js +25 -0
- package/dist/server/compat/next/dist/server/web/spec-extension/unstable-no-store.js +25 -0
- package/dist/server/compat/next/dynamic.js +32 -0
- package/dist/server/compat/next/error.js +112 -0
- package/dist/server/compat/next/font/cache.js +14 -0
- package/dist/server/compat/next/font/google.js +3 -0
- package/dist/server/compat/next/font/index.js +1 -0
- package/dist/server/compat/next/font/local.js +22 -0
- package/dist/server/compat/next/font/runtime-client.js +33 -0
- package/dist/server/compat/next/font/runtime.js +41 -0
- package/dist/server/compat/next/font/shared.js +22 -0
- package/dist/server/compat/next/form.js +129 -0
- package/dist/server/compat/next/head.js +10 -0
- package/dist/server/compat/next/headers.js +30 -0
- package/dist/server/compat/next/image/client.js +11 -0
- package/dist/server/compat/next/image/config.js +18 -0
- package/dist/server/compat/next/image/optimizer.js +25 -0
- package/dist/server/compat/next/image/patterns.js +12 -0
- package/dist/server/compat/next/image/props.js +16 -0
- package/dist/server/compat/next/image/shared.js +86 -0
- package/dist/server/compat/next/image/static-metadata.js +32 -0
- package/dist/server/compat/next/image/validate.js +8 -0
- package/dist/server/compat/next/image.js +59 -0
- package/dist/server/compat/next/index.js +1 -0
- package/dist/server/compat/next/legacy-image.js +78 -0
- package/dist/server/compat/next/legacy-request-apis.js +24 -0
- package/dist/server/compat/next/link-transform.js +14 -0
- package/dist/server/compat/next/link.js +14 -0
- package/dist/server/compat/next/navigation.js +190 -0
- package/dist/server/compat/next/offline.js +45 -0
- package/dist/server/compat/next/og.js +8 -0
- package/dist/server/compat/next/preferred-region.js +8 -0
- package/dist/server/compat/next/redirects.js +30 -0
- package/dist/server/compat/next/resource-hints.js +30 -0
- package/dist/server/compat/next/rewrites.js +41 -0
- package/dist/server/compat/next/root-params.js +121 -0
- package/dist/server/compat/next/route-state.js +23 -0
- package/dist/server/compat/next/router.js +103 -0
- package/dist/server/compat/next/script.js +37 -0
- package/dist/server/compat/next/server-only.js +1 -0
- package/dist/server/compat/next/server.js +131 -0
- package/dist/server/compat/next/svgr.js +14 -0
- package/dist/server/compat/next/telemetry.js +10 -0
- package/dist/server/compat/next/usage.js +13 -0
- package/dist/server/compat/next/user-agent.js +12 -0
- package/dist/server/compat/next/web-vitals.js +35 -0
- package/dist/server/compat/react/action-state.js +11 -0
- package/dist/server/compat/react/client-lite.js +83 -0
- package/dist/server/compat/react/client.js +131 -0
- package/dist/server/compat/react/compiler-runtime.js +42 -0
- package/dist/server/compat/react/dom-client.js +106 -0
- package/dist/server/compat/react/dom-react-server.js +37 -0
- package/dist/server/compat/react/dom-server.js +40 -0
- package/dist/server/compat/react/dom.js +52 -0
- package/dist/server/compat/react/hooks-extra.js +12 -0
- package/dist/server/compat/react/internals.js +14 -0
- package/dist/server/compat/react/parity.js +11 -0
- package/dist/server/compat/react/preact.js +113 -0
- package/dist/server/compat/react/react-server.js +133 -0
- package/dist/server/compat/react/router-shim.js +8 -0
- package/dist/server/compat/react/server-component-use.js +14 -0
- package/dist/server/compat/react/server-inserted-html.js +14 -0
- package/dist/server/compat/react/server.js +194 -0
- package/dist/server/compat/react/style-values.js +10 -0
- package/dist/server/compat/react/use.js +10 -0
- package/dist/server/compat/react/view-transition.js +12 -0
- package/dist/server/generation.json +1 -0
- package/package.json +4 -1
- package/src/api/dynamic.tsx +2 -0
- package/src/api/server.ts +24 -6
- package/src/cli/adapters/vercel-warm.ts +315 -61
- package/src/cli/adapters/vercel.ts +348 -71
- package/src/cli/build.ts +58 -33
- package/src/cli/index.ts +23 -10
- package/src/cli/serve/entry.ts +21 -159
- package/src/cli/serve/immutable.ts +31 -0
- package/src/cli/serve/pipeline.ts +82 -84
- package/src/cli/start.ts +3 -1
- package/src/client/chunk-fold.ts +19 -6
- package/src/client/react-tier.ts +3 -2
- package/src/client/reference-stub.ts +21 -2
- package/src/compat/actions/client-plugin.ts +4 -2
- package/src/compat/actions/config.ts +6 -5
- package/src/compat/actions/extensions.ts +2 -3
- package/src/compat/aliases.ts +8 -1
- package/src/compat/bundler/config.ts +88 -0
- package/src/compat/bundler/optimize-package-imports.ts +86 -26
- package/src/compat/bundler/relay-transform.ts +15 -3
- package/src/compat/cache-control.ts +16 -8
- package/src/compat/css/modules.ts +18 -5
- package/src/compat/lifecycle/error-funnel.ts +1 -1
- package/src/compat/lifecycle/instrumentation.ts +117 -24
- package/src/compat/lifecycle/testmode.ts +3 -2
- package/src/compat/next/config-loader.ts +137 -13
- package/src/compat/next/font/runtime.ts +22 -2
- package/src/compat/next/og.ts +3 -3
- package/src/compat/next/usage.ts +3 -2
- package/src/compat/pages/api.ts +83 -14
- package/src/compat/pages/router.ts +30 -14
- package/src/compat/register/bundler.ts +3 -1
- package/src/compat/register/middleware.ts +1 -1
- package/src/compat/register/otel.ts +5 -9
- package/src/compat/register/render.ts +3 -1
- package/src/compat/register/use-cache.ts +3 -1
- package/src/compat/release.ts +46 -0
- package/src/compat/segment/serve.ts +1 -1
- package/src/compat/validation/validate.ts +10 -7
- package/src/config.ts +51 -7
- package/src/css/assets.ts +213 -0
- package/src/css/build.ts +174 -238
- package/src/dev/server.ts +27 -8
- package/src/extensions.ts +4 -0
- package/src/render/hooks.ts +13 -0
- package/src/render/renderer.ts +52 -32
- package/src/request/context.ts +9 -0
- package/src/resolve/dynamic.ts +3 -1
- package/src/resolve/imports.ts +12 -52
- package/src/resolve/package-json.ts +56 -0
- package/src/resolve/scan-facts.ts +65 -0
- package/src/routing/href.ts +10 -3
- package/src/routing/match.ts +287 -0
- package/src/routing/metadata-files.ts +19 -5
- package/src/routing/proxy-config.ts +137 -0
- package/src/routing/proxy.ts +35 -134
- package/src/routing/routes.ts +22 -281
- package/src/runtime/fingerprint.ts +23 -8
- package/src/runtime/load.ts +170 -0
- package/src/runtime/loader.ts +215 -43
- package/src/runtime/module-cache.ts +13 -0
- package/src/runtime/modules.ts +370 -81
- package/src/runtime/prebundle.ts +81 -0
- package/src/runtime/production.ts +391 -0
- package/src/runtime/release-graph.ts +334 -0
- package/src/runtime/vendor-build.ts +724 -13
- package/src/runtime/vendor.ts +16 -3
- package/src/types.ts +2 -0
- package/src/utils/fs.ts +89 -3
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
escapeRegex
|
|
4
|
+
} from "./index-qjj6gddn.js";
|
|
5
|
+
|
|
6
|
+
// src/extensions.ts
|
|
7
|
+
var { Bun: bun } = globalThis;
|
|
8
|
+
function createExtensionHost() {
|
|
9
|
+
return {
|
|
10
|
+
compatMode: createCompatModeExtensions(),
|
|
11
|
+
render: createRenderExtensions(),
|
|
12
|
+
request: createRequestExtensions(),
|
|
13
|
+
runtime: createRuntimeExtensions(),
|
|
14
|
+
build: createBuildExtensions(),
|
|
15
|
+
routing: createRoutingExtensions(),
|
|
16
|
+
proxy: createProxyExtensions(),
|
|
17
|
+
proxyResponse: createProxyResponseProtocol(),
|
|
18
|
+
routerProtocol: createRouterProtocolExtensions(),
|
|
19
|
+
bundler: createBundlerExtensions(),
|
|
20
|
+
importAlias: createImportAliasExtensions(),
|
|
21
|
+
asset: createAssetExtensions(),
|
|
22
|
+
loadable: []
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var activeHost = createExtensionHost();
|
|
26
|
+
var ANCHOR = Symbol.for("pnext.extensionHost");
|
|
27
|
+
globalThis[ANCHOR] ??= activeHost;
|
|
28
|
+
var resetHandlers = [];
|
|
29
|
+
var clientEntryReasonCache = new Map;
|
|
30
|
+
function onExtensionHostReset(handler) {
|
|
31
|
+
resetHandlers.push(handler);
|
|
32
|
+
}
|
|
33
|
+
function restoreWithExtensionHost(registry) {
|
|
34
|
+
const defaults = { ...registry };
|
|
35
|
+
onExtensionHostReset(() => {
|
|
36
|
+
for (const key of Object.keys(registry))
|
|
37
|
+
delete registry[key];
|
|
38
|
+
Object.assign(registry, defaults);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function createCompatModeExtensions() {
|
|
42
|
+
return {
|
|
43
|
+
nextEnabled: () => false,
|
|
44
|
+
reactEnabled: () => false,
|
|
45
|
+
reactCompilerOptions: () => {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function getCompatModeExtensions() {
|
|
51
|
+
return activeHost.compatMode;
|
|
52
|
+
}
|
|
53
|
+
function setCompatModeExtensions(overrides) {
|
|
54
|
+
Object.assign(activeHost.compatMode, overrides);
|
|
55
|
+
}
|
|
56
|
+
function createRenderExtensions() {
|
|
57
|
+
return {
|
|
58
|
+
clientRouteState: (_route, state) => state,
|
|
59
|
+
wrapServerComponentInvoke: (invoke) => invoke(),
|
|
60
|
+
onRenderInit: () => {
|
|
61
|
+
return;
|
|
62
|
+
},
|
|
63
|
+
serializeServerActionProp: () => {
|
|
64
|
+
return;
|
|
65
|
+
},
|
|
66
|
+
collectRenderMeta: async (produce, _options) => ({ value: await produce(), tags: [] }),
|
|
67
|
+
currentCacheStaleSeconds: () => {
|
|
68
|
+
return;
|
|
69
|
+
},
|
|
70
|
+
genericErrorTitle: () => {
|
|
71
|
+
return;
|
|
72
|
+
},
|
|
73
|
+
islandCommentWireFormat: () => false,
|
|
74
|
+
serializeError: () => {
|
|
75
|
+
return;
|
|
76
|
+
},
|
|
77
|
+
httpAccessFallbackUi: () => {
|
|
78
|
+
return;
|
|
79
|
+
},
|
|
80
|
+
defaultGlobalErrorUi: () => {
|
|
81
|
+
return;
|
|
82
|
+
},
|
|
83
|
+
globalErrorReportScript: () => {
|
|
84
|
+
return;
|
|
85
|
+
},
|
|
86
|
+
wrapThrownValue: () => {
|
|
87
|
+
return;
|
|
88
|
+
},
|
|
89
|
+
formatErrorLog: () => {
|
|
90
|
+
return;
|
|
91
|
+
},
|
|
92
|
+
globalNotFoundEnabled: () => false,
|
|
93
|
+
trackVaryParams: (value) => value,
|
|
94
|
+
legacySyncProps: (promise) => promise,
|
|
95
|
+
prerenderSidecar: {
|
|
96
|
+
begin: () => {
|
|
97
|
+
return;
|
|
98
|
+
},
|
|
99
|
+
collect: () => Promise.resolve(undefined),
|
|
100
|
+
persist: () => Promise.resolve(),
|
|
101
|
+
seed: () => {
|
|
102
|
+
return;
|
|
103
|
+
},
|
|
104
|
+
isStale: () => false
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function getRenderExtensions() {
|
|
109
|
+
return activeHost.render;
|
|
110
|
+
}
|
|
111
|
+
function setRenderExtensions(overrides) {
|
|
112
|
+
Object.assign(activeHost.render, overrides);
|
|
113
|
+
}
|
|
114
|
+
function createRequestExtensions() {
|
|
115
|
+
return {
|
|
116
|
+
interceptors: [],
|
|
117
|
+
warmHooks: [],
|
|
118
|
+
outsideBasePathInterceptors: [],
|
|
119
|
+
responseFinalizers: [],
|
|
120
|
+
onRequestError: () => {
|
|
121
|
+
return;
|
|
122
|
+
},
|
|
123
|
+
staticStaleness: () => false,
|
|
124
|
+
staticStalenessReason: () => {
|
|
125
|
+
return;
|
|
126
|
+
},
|
|
127
|
+
onDemandRevalidatePath: () => {
|
|
128
|
+
return;
|
|
129
|
+
},
|
|
130
|
+
revalidateBypassToken: () => {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function getRequestExtensions() {
|
|
136
|
+
return activeHost.request;
|
|
137
|
+
}
|
|
138
|
+
function registerRequestInterceptors(...interceptors) {
|
|
139
|
+
activeHost.request.interceptors.push(...interceptors);
|
|
140
|
+
}
|
|
141
|
+
function registerRequestWarmHooks(...hooks) {
|
|
142
|
+
activeHost.request.warmHooks.push(...hooks);
|
|
143
|
+
}
|
|
144
|
+
function runRequestWarmHooks(config) {
|
|
145
|
+
for (const hook of activeHost.request.warmHooks) {
|
|
146
|
+
try {
|
|
147
|
+
hook(config);
|
|
148
|
+
} catch {}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function registerOutsideBasePathInterceptors(...interceptors) {
|
|
152
|
+
activeHost.request.outsideBasePathInterceptors.push(...interceptors);
|
|
153
|
+
}
|
|
154
|
+
function registerResponseFinalizers(...finalizers) {
|
|
155
|
+
activeHost.request.responseFinalizers.push(...finalizers);
|
|
156
|
+
}
|
|
157
|
+
function registerRevalidateBypassToken(token) {
|
|
158
|
+
activeHost.request.revalidateBypassToken = token;
|
|
159
|
+
}
|
|
160
|
+
async function finalizeResponse(response, request, info) {
|
|
161
|
+
const finalizers = activeHost.request.responseFinalizers;
|
|
162
|
+
const ctx = {
|
|
163
|
+
request,
|
|
164
|
+
routeKind: info.routeKind,
|
|
165
|
+
...info.routeMode ? { routeMode: info.routeMode } : {},
|
|
166
|
+
...info.hints ? { hints: info.hints } : {},
|
|
167
|
+
status: response.status,
|
|
168
|
+
headers: response.headers
|
|
169
|
+
};
|
|
170
|
+
for (const finalizer of finalizers)
|
|
171
|
+
await finalizer(ctx);
|
|
172
|
+
applyDocumentCacheControl(ctx, info.dev === true);
|
|
173
|
+
if (ctx.status === response.status)
|
|
174
|
+
return response;
|
|
175
|
+
return new Response(response.body, {
|
|
176
|
+
status: ctx.status,
|
|
177
|
+
statusText: response.statusText,
|
|
178
|
+
headers: response.headers
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
var DYNAMIC_DOCUMENT_CACHE_CONTROL = "private, no-cache, no-store, max-age=0, must-revalidate";
|
|
182
|
+
var DEV_DOCUMENT_CACHE_CONTROL = "no-cache, must-revalidate";
|
|
183
|
+
var DOCUMENT_EXPIRE_SECONDS = 31536000;
|
|
184
|
+
function applyDocumentCacheControl(ctx, dev) {
|
|
185
|
+
if (ctx.routeKind !== "html")
|
|
186
|
+
return;
|
|
187
|
+
if (ctx.headers.has("cache-control"))
|
|
188
|
+
return;
|
|
189
|
+
if (!(ctx.headers.get("content-type") ?? "").startsWith("text/html"))
|
|
190
|
+
return;
|
|
191
|
+
if (dev) {
|
|
192
|
+
ctx.headers.set("cache-control", DEV_DOCUMENT_CACHE_CONTROL);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (ctx.status !== 200) {
|
|
196
|
+
ctx.headers.set("cache-control", DYNAMIC_DOCUMENT_CACHE_CONTROL);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const revalidate = ctx.routeMode === "isr" ? ctx.hints?.revalidateSeconds : undefined;
|
|
200
|
+
if (typeof revalidate === "number" && revalidate > 0) {
|
|
201
|
+
const swr = Math.max(0, DOCUMENT_EXPIRE_SECONDS - revalidate);
|
|
202
|
+
ctx.headers.set("cache-control", `s-maxage=${revalidate}, stale-while-revalidate=${swr}`);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
ctx.headers.set("cache-control", ctx.routeMode === "static" ? `s-maxage=${DOCUMENT_EXPIRE_SECONDS}` : DYNAMIC_DOCUMENT_CACHE_CONTROL);
|
|
206
|
+
}
|
|
207
|
+
function setRequestExtensions(overrides) {
|
|
208
|
+
Object.assign(activeHost.request, overrides);
|
|
209
|
+
}
|
|
210
|
+
async function reportRequestError(error, requestInfo, context) {
|
|
211
|
+
try {
|
|
212
|
+
await activeHost.request.onRequestError(error, requestInfo, context);
|
|
213
|
+
} catch (reportError) {
|
|
214
|
+
console.error("onRequestError funnel failed:", reportError);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function createRuntimeExtensions() {
|
|
218
|
+
return { withEdgeRuntime: (callback) => callback() };
|
|
219
|
+
}
|
|
220
|
+
function setRuntimeExtensions(overrides) {
|
|
221
|
+
Object.assign(activeHost.runtime, overrides);
|
|
222
|
+
}
|
|
223
|
+
function withRouteRuntime(runtime, callback) {
|
|
224
|
+
const edge = runtime === "edge" || runtime === "experimental-edge";
|
|
225
|
+
const previous = process.env.NEXT_RUNTIME;
|
|
226
|
+
process.env.NEXT_RUNTIME = edge ? "edge" : "nodejs";
|
|
227
|
+
try {
|
|
228
|
+
const result = edge ? activeHost.runtime.withEdgeRuntime(callback) : callback();
|
|
229
|
+
if (isThenable(result)) {
|
|
230
|
+
return Promise.resolve(result).finally(() => restoreNextRuntime(previous));
|
|
231
|
+
}
|
|
232
|
+
restoreNextRuntime(previous);
|
|
233
|
+
return result;
|
|
234
|
+
} catch (error) {
|
|
235
|
+
restoreNextRuntime(previous);
|
|
236
|
+
throw error;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function restoreNextRuntime(value) {
|
|
240
|
+
if (value === undefined) {
|
|
241
|
+
delete process.env.NEXT_RUNTIME;
|
|
242
|
+
} else {
|
|
243
|
+
process.env.NEXT_RUNTIME = value;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function isThenable(value) {
|
|
247
|
+
return typeof value?.then === "function";
|
|
248
|
+
}
|
|
249
|
+
function createBuildExtensions() {
|
|
250
|
+
const compat = {
|
|
251
|
+
withVaryParamsTracking: async (produce) => ({ value: await produce() }),
|
|
252
|
+
varyNamesFor: () => [],
|
|
253
|
+
warnMetadataIssues: () => Promise.resolve(),
|
|
254
|
+
nextOutputExport: () => false,
|
|
255
|
+
nextOutputMode: () => {
|
|
256
|
+
return;
|
|
257
|
+
},
|
|
258
|
+
nextScriptWorkersEnabled: () => false,
|
|
259
|
+
defaultExpireTimeSeconds: () => {
|
|
260
|
+
return;
|
|
261
|
+
},
|
|
262
|
+
takeCacheLifeStash: () => {
|
|
263
|
+
return;
|
|
264
|
+
},
|
|
265
|
+
takeFontLinkHeader: () => {
|
|
266
|
+
return;
|
|
267
|
+
},
|
|
268
|
+
normalizeStaticParamsModule: (module) => module,
|
|
269
|
+
defaultDynamicStaleTimeSeconds: 30,
|
|
270
|
+
defaultStaticStaleTimeSeconds: 300,
|
|
271
|
+
buildRootTreePrefetch: (options) => {
|
|
272
|
+
const staleTime = options.staleTimeSeconds ?? (options.isStatic ? compat.defaultStaticStaleTimeSeconds : compat.defaultDynamicStaleTimeSeconds);
|
|
273
|
+
const bodySize = options.bodySizeBytes ?? 0;
|
|
274
|
+
const budget = options.inlineBudgetBytes ?? 32 * 1024;
|
|
275
|
+
const canInlineBody = options.isStatic && !options.postponed && bodySize <= budget;
|
|
276
|
+
return {
|
|
277
|
+
tree: {
|
|
278
|
+
name: "",
|
|
279
|
+
param: null,
|
|
280
|
+
slots: {
|
|
281
|
+
children: {
|
|
282
|
+
name: "__PAGE__",
|
|
283
|
+
param: null,
|
|
284
|
+
slots: null,
|
|
285
|
+
prefetchHints: canInlineBody ? 128 : 256,
|
|
286
|
+
...options.bodySizeBytes !== undefined ? { sizeBytes: options.bodySizeBytes } : {},
|
|
287
|
+
...canInlineBody ? {} : { segmentPath: "/" }
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
prefetchHints: 16 | (canInlineBody ? 64 : 0)
|
|
291
|
+
},
|
|
292
|
+
staleTime,
|
|
293
|
+
isStatic: options.isStatic
|
|
294
|
+
};
|
|
295
|
+
},
|
|
296
|
+
rootTreePrefetchText: (payload, format = "json") => {
|
|
297
|
+
const json = JSON.stringify(payload);
|
|
298
|
+
return format === "flight" ? `0:${json}` : json;
|
|
299
|
+
},
|
|
300
|
+
buildSegmentMeta: (options) => {
|
|
301
|
+
const inlined = !options.postponed && options.bodySizeBytes !== undefined && options.bodySizeBytes <= (options.inlineBudgetBytes ?? 32 * 1024);
|
|
302
|
+
return {
|
|
303
|
+
status: options.status,
|
|
304
|
+
staleTime: options.staleTime,
|
|
305
|
+
postponed: options.postponed,
|
|
306
|
+
segmentPaths: ["/_tree", "/"],
|
|
307
|
+
...options.bodySizeBytes !== undefined ? { segmentSizes: { "/": options.bodySizeBytes } } : {},
|
|
308
|
+
...inlined ? { inlinedSegmentPaths: ["/"] } : {},
|
|
309
|
+
...options.prefetchHints ? { prefetchHints: options.prefetchHints } : {}
|
|
310
|
+
};
|
|
311
|
+
},
|
|
312
|
+
diagnoseCacheComponentsPrerender: () => {
|
|
313
|
+
return;
|
|
314
|
+
},
|
|
315
|
+
prerenderFailureFooter: () => "",
|
|
316
|
+
diagnosticLeadsWithErrorLine: () => false,
|
|
317
|
+
recordBuildFlags: () => {
|
|
318
|
+
return;
|
|
319
|
+
},
|
|
320
|
+
segmentDir: (outPath, routeId) => `${outPath}/segments/${routeId}`,
|
|
321
|
+
treeSegmentFile: (outPath, routeId) => `${compat.segmentDir(outPath, routeId)}/_tree.segment.rsc`,
|
|
322
|
+
bodySegmentFile: (outPath, routeId) => `${compat.segmentDir(outPath, routeId)}/index.segment.rsc`,
|
|
323
|
+
segmentMetaFile: (outPath, routeId) => `${compat.segmentDir(outPath, routeId)}/route.segment.meta`
|
|
324
|
+
};
|
|
325
|
+
return { steps: [], completeHooks: [], initHooks: [], parallelPhases: [], compat };
|
|
326
|
+
}
|
|
327
|
+
function getBuildExtensions() {
|
|
328
|
+
return activeHost.build;
|
|
329
|
+
}
|
|
330
|
+
function setBuildCompatExtensions(overrides) {
|
|
331
|
+
Object.assign(activeHost.build.compat, overrides);
|
|
332
|
+
}
|
|
333
|
+
function registerBuildSteps(...steps) {
|
|
334
|
+
activeHost.build.steps.push(...steps);
|
|
335
|
+
}
|
|
336
|
+
function registerBuildCompleteHooks(...hooks) {
|
|
337
|
+
activeHost.build.completeHooks.push(...hooks);
|
|
338
|
+
}
|
|
339
|
+
function registerBuildParallelPhases(...phases) {
|
|
340
|
+
for (const phase of phases) {
|
|
341
|
+
phase.run.catch((error) => {
|
|
342
|
+
parallelPhaseErrors.set(phase, error);
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
activeHost.build.parallelPhases.push(...phases);
|
|
346
|
+
}
|
|
347
|
+
var parallelPhaseErrors = new WeakMap;
|
|
348
|
+
function clearBuildParallelPhases() {
|
|
349
|
+
activeHost.build.parallelPhases.length = 0;
|
|
350
|
+
}
|
|
351
|
+
function buildParallelPhaseError() {
|
|
352
|
+
for (const phase of activeHost.build.parallelPhases) {
|
|
353
|
+
if (parallelPhaseErrors.has(phase))
|
|
354
|
+
return parallelPhaseErrors.get(phase);
|
|
355
|
+
}
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
function registerInitHooks(...hooks) {
|
|
359
|
+
activeHost.build.initHooks.push(...hooks);
|
|
360
|
+
}
|
|
361
|
+
function runInitHooks(config, context = { build: false }) {
|
|
362
|
+
for (const hook of activeHost.build.initHooks)
|
|
363
|
+
hook(config, context);
|
|
364
|
+
}
|
|
365
|
+
function createRoutingExtensions() {
|
|
366
|
+
return {
|
|
367
|
+
conventions: [],
|
|
368
|
+
usageDetection: [],
|
|
369
|
+
dependencyClassification: [],
|
|
370
|
+
clientEntryDetection: [],
|
|
371
|
+
pageExtensions: [],
|
|
372
|
+
alwaysClientEntryReasons: new Set
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
function registerRouteConventions(...conventions) {
|
|
376
|
+
activeHost.routing.conventions.push(...conventions);
|
|
377
|
+
}
|
|
378
|
+
function registerUsageDetectors(...detectors) {
|
|
379
|
+
activeHost.routing.usageDetection.push(...detectors);
|
|
380
|
+
}
|
|
381
|
+
function registerRouteDependencyClassifiers(...classifiers) {
|
|
382
|
+
activeHost.routing.dependencyClassification.push(...classifiers);
|
|
383
|
+
}
|
|
384
|
+
function registerClientEntryDetectors(...detectors) {
|
|
385
|
+
activeHost.routing.clientEntryDetection.push(...detectors);
|
|
386
|
+
clientEntryReasonCache.clear();
|
|
387
|
+
}
|
|
388
|
+
var loadableExtensionListeners = [];
|
|
389
|
+
function onLoadableExtensionsChanged(listener) {
|
|
390
|
+
loadableExtensionListeners.push(listener);
|
|
391
|
+
}
|
|
392
|
+
function registerLoadableExtensions(...extensions) {
|
|
393
|
+
const loadable = activeHost.loadable;
|
|
394
|
+
const fresh = [...new Set(extensions)].filter((ext) => !loadable.includes(ext));
|
|
395
|
+
if (fresh.length === 0)
|
|
396
|
+
return;
|
|
397
|
+
loadable.push(...fresh);
|
|
398
|
+
for (const listener of loadableExtensionListeners)
|
|
399
|
+
listener();
|
|
400
|
+
}
|
|
401
|
+
function extraLoadableExtensions() {
|
|
402
|
+
return [...new Set([...activeHost.routing.pageExtensions, ...activeHost.loadable])];
|
|
403
|
+
}
|
|
404
|
+
function registerPageExtensions(...extensions) {
|
|
405
|
+
const { pageExtensions } = activeHost.routing;
|
|
406
|
+
const fresh = [...new Set(extensions)].filter((ext) => !pageExtensions.includes(ext));
|
|
407
|
+
if (fresh.length === 0)
|
|
408
|
+
return;
|
|
409
|
+
pageExtensions.push(...fresh);
|
|
410
|
+
for (const listener of loadableExtensionListeners)
|
|
411
|
+
listener();
|
|
412
|
+
}
|
|
413
|
+
function registerAlwaysClientEntryReason(reason) {
|
|
414
|
+
activeHost.routing.alwaysClientEntryReasons.add(reason);
|
|
415
|
+
}
|
|
416
|
+
function alwaysClientEntryReasons() {
|
|
417
|
+
return [...activeHost.routing.alwaysClientEntryReasons];
|
|
418
|
+
}
|
|
419
|
+
function extraPageExtensions() {
|
|
420
|
+
return activeHost.routing.pageExtensions;
|
|
421
|
+
}
|
|
422
|
+
function extraBoundaryConventionNames() {
|
|
423
|
+
return activeHost.routing.conventions.filter((c) => c.boundary).map((c) => c.name);
|
|
424
|
+
}
|
|
425
|
+
function sourceUsesRegisteredRequestApi(source) {
|
|
426
|
+
return activeHost.routing.usageDetection.some((detect) => detect(source));
|
|
427
|
+
}
|
|
428
|
+
function classifyRouteDependencies(context) {
|
|
429
|
+
const classification = {};
|
|
430
|
+
for (const classify of activeHost.routing.dependencyClassification) {
|
|
431
|
+
const result = classify(context);
|
|
432
|
+
if (!result)
|
|
433
|
+
continue;
|
|
434
|
+
if (result.usesRequest)
|
|
435
|
+
classification.usesRequest = true;
|
|
436
|
+
}
|
|
437
|
+
return classification;
|
|
438
|
+
}
|
|
439
|
+
function sourceClientEntryReasons(source) {
|
|
440
|
+
const key = `${source.length}\x00${bun.hash(source).toString(36)}`;
|
|
441
|
+
const cached = clientEntryReasonCache.get(key);
|
|
442
|
+
if (cached)
|
|
443
|
+
return cached;
|
|
444
|
+
const reasons = [];
|
|
445
|
+
for (const { reason, detect } of activeHost.routing.clientEntryDetection) {
|
|
446
|
+
if (!reasons.includes(reason) && detect(source))
|
|
447
|
+
reasons.push(reason);
|
|
448
|
+
}
|
|
449
|
+
clientEntryReasonCache.set(key, reasons);
|
|
450
|
+
return reasons;
|
|
451
|
+
}
|
|
452
|
+
function createProxyExtensions() {
|
|
453
|
+
return {
|
|
454
|
+
names: ["proxy"],
|
|
455
|
+
validateFiles: () => Promise.resolve(),
|
|
456
|
+
handlerExport: (module) => module.proxy ?? module.default,
|
|
457
|
+
skipUrlNormalize: () => false,
|
|
458
|
+
locale: () => "",
|
|
459
|
+
onExternalRewrite: (request) => {
|
|
460
|
+
return;
|
|
461
|
+
},
|
|
462
|
+
clientMaxBodySize: () => 10 * 1024 * 1024
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
function getProxyExtensions() {
|
|
466
|
+
return activeHost.proxy;
|
|
467
|
+
}
|
|
468
|
+
function setProxyExtensions(overrides) {
|
|
469
|
+
Object.assign(activeHost.proxy, overrides);
|
|
470
|
+
}
|
|
471
|
+
function createBundlerExtensions() {
|
|
472
|
+
return {
|
|
473
|
+
serverSourcePreTransforms: [],
|
|
474
|
+
serverSourceTransforms: [],
|
|
475
|
+
clientSourceTransforms: [],
|
|
476
|
+
clientSourceAsyncPreTransforms: [],
|
|
477
|
+
bundledSourceTransforms: [],
|
|
478
|
+
clientEsbuildPlugins: () => [],
|
|
479
|
+
serverEsbuildPlugins: () => [],
|
|
480
|
+
serverBundleEntry: () => {
|
|
481
|
+
return;
|
|
482
|
+
},
|
|
483
|
+
serverDefines: () => ({}),
|
|
484
|
+
clientDefines: () => ({}),
|
|
485
|
+
clientInjects: () => [],
|
|
486
|
+
resolveRouteDependency: () => {
|
|
487
|
+
return;
|
|
488
|
+
},
|
|
489
|
+
clientPureFunctions: () => [],
|
|
490
|
+
staticClientChunks: () => []
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
function getBundlerExtensions() {
|
|
494
|
+
return activeHost.bundler;
|
|
495
|
+
}
|
|
496
|
+
function serverDefineOptions() {
|
|
497
|
+
const define = activeHost.bundler.serverDefines();
|
|
498
|
+
return Object.keys(define).length > 0 ? { define } : {};
|
|
499
|
+
}
|
|
500
|
+
function registerServerSourceTransforms(...transforms) {
|
|
501
|
+
activeHost.bundler.serverSourceTransforms.push(...transforms);
|
|
502
|
+
activeHost.serverSniff = undefined;
|
|
503
|
+
}
|
|
504
|
+
function registerServerSourcePreTransforms(...transforms) {
|
|
505
|
+
activeHost.bundler.serverSourcePreTransforms.push(...transforms);
|
|
506
|
+
activeHost.serverSniff = undefined;
|
|
507
|
+
}
|
|
508
|
+
function registerClientSourceTransforms(...transforms) {
|
|
509
|
+
activeHost.bundler.clientSourceTransforms.push(...transforms);
|
|
510
|
+
}
|
|
511
|
+
function registerClientSourceAsyncPreTransforms(...transforms) {
|
|
512
|
+
activeHost.bundler.clientSourceAsyncPreTransforms.push(...transforms);
|
|
513
|
+
}
|
|
514
|
+
function registerBundledSourceTransforms(...transforms) {
|
|
515
|
+
activeHost.bundler.bundledSourceTransforms.push(...transforms);
|
|
516
|
+
}
|
|
517
|
+
function withSniff(sniff, transform) {
|
|
518
|
+
return Object.assign((source, file, root) => transform(source, file, root), { sniff });
|
|
519
|
+
}
|
|
520
|
+
function sniffHit(source, sniff) {
|
|
521
|
+
for (const token of sniff) {
|
|
522
|
+
if (typeof token === "string" ? source.includes(token) : token.test(source))
|
|
523
|
+
return true;
|
|
524
|
+
}
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
function serverSourceSniff() {
|
|
528
|
+
const host = activeHost;
|
|
529
|
+
if (host.serverSniff)
|
|
530
|
+
return host.serverSniff;
|
|
531
|
+
const tokens = new Set;
|
|
532
|
+
for (const transform of [
|
|
533
|
+
...host.bundler.serverSourcePreTransforms,
|
|
534
|
+
...host.bundler.serverSourceTransforms
|
|
535
|
+
]) {
|
|
536
|
+
if (!transform.sniff)
|
|
537
|
+
return host.serverSniff = { pattern: undefined };
|
|
538
|
+
for (const token of transform.sniff) {
|
|
539
|
+
tokens.add(`(?:${typeof token === "string" ? escapeRegex(token) : token.source})`);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
return host.serverSniff = { pattern: new RegExp(tokens.size ? [...tokens].join("|") : "(?!)") };
|
|
543
|
+
}
|
|
544
|
+
function sourceNeedsServerTransforms(source) {
|
|
545
|
+
const { pattern } = serverSourceSniff();
|
|
546
|
+
return !pattern || pattern.test(source);
|
|
547
|
+
}
|
|
548
|
+
function applyTransforms(transforms, source, file, root) {
|
|
549
|
+
let next = source;
|
|
550
|
+
for (const transform of transforms) {
|
|
551
|
+
if (transform.sniff && !sniffHit(next, transform.sniff))
|
|
552
|
+
continue;
|
|
553
|
+
next = transform(next, file, root);
|
|
554
|
+
}
|
|
555
|
+
return next;
|
|
556
|
+
}
|
|
557
|
+
function setBundlerExtensions(overrides) {
|
|
558
|
+
Object.assign(activeHost.bundler, overrides);
|
|
559
|
+
}
|
|
560
|
+
function applyServerSourcePreTransforms(source, file, root) {
|
|
561
|
+
return applyTransforms(activeHost.bundler.serverSourcePreTransforms, source, file, root);
|
|
562
|
+
}
|
|
563
|
+
function applyServerSourceTransforms(source, file, root) {
|
|
564
|
+
return applyTransforms(activeHost.bundler.serverSourceTransforms, source, file, root);
|
|
565
|
+
}
|
|
566
|
+
function applyClientSourceTransforms(source, file, root) {
|
|
567
|
+
return applyTransforms(activeHost.bundler.clientSourceTransforms, source, file, root);
|
|
568
|
+
}
|
|
569
|
+
function hasClientSourceAsyncPreTransforms() {
|
|
570
|
+
return activeHost.bundler.clientSourceAsyncPreTransforms.length > 0;
|
|
571
|
+
}
|
|
572
|
+
async function applyClientSourceAsyncPreTransforms(source, file, root) {
|
|
573
|
+
let next = source;
|
|
574
|
+
for (const transform of activeHost.bundler.clientSourceAsyncPreTransforms) {
|
|
575
|
+
if (transform.sniff && !sniffHit(next, transform.sniff))
|
|
576
|
+
continue;
|
|
577
|
+
next = await transform(next, file, root);
|
|
578
|
+
}
|
|
579
|
+
return next;
|
|
580
|
+
}
|
|
581
|
+
function applyBundledSourceTransforms(source, file) {
|
|
582
|
+
return applyTransforms(activeHost.bundler.bundledSourceTransforms, source, file);
|
|
583
|
+
}
|
|
584
|
+
function createImportAliasExtensions() {
|
|
585
|
+
return {
|
|
586
|
+
aliases: () => ({}),
|
|
587
|
+
clientSsrAliases: () => ({}),
|
|
588
|
+
missingImportError: () => {
|
|
589
|
+
return;
|
|
590
|
+
},
|
|
591
|
+
reactServerLayerAliases: () => ({})
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
function getImportAliasExtensions() {
|
|
595
|
+
return activeHost.importAlias;
|
|
596
|
+
}
|
|
597
|
+
function setImportAliasExtensions(overrides) {
|
|
598
|
+
Object.assign(activeHost.importAlias, overrides);
|
|
599
|
+
}
|
|
600
|
+
function createProxyResponseProtocol() {
|
|
601
|
+
return {
|
|
602
|
+
nextHeader: "x-pnext-middleware-next",
|
|
603
|
+
rewriteHeader: "x-pnext-middleware-rewrite"
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function setProxyResponseProtocol(overrides) {
|
|
607
|
+
Object.assign(activeHost.proxyResponse, overrides);
|
|
608
|
+
}
|
|
609
|
+
function createRouterProtocolExtensions() {
|
|
610
|
+
return {
|
|
611
|
+
prefetchRequestHeaders: () => [],
|
|
612
|
+
shellOnlyRequest: () => false
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
function getRouterProtocolExtensions() {
|
|
616
|
+
return activeHost.routerProtocol;
|
|
617
|
+
}
|
|
618
|
+
function setRouterProtocolExtensions(overrides) {
|
|
619
|
+
Object.assign(activeHost.routerProtocol, overrides);
|
|
620
|
+
}
|
|
621
|
+
function createAssetExtensions() {
|
|
622
|
+
return {
|
|
623
|
+
staticAssetPublicPrefixes: () => ["/__pnext/static/media/"],
|
|
624
|
+
staticAssetRelativePath: ({ base, hash, ext }) => `__pnext/static/media/${base}.${hash}${ext}`,
|
|
625
|
+
staticAssetModule: () => {
|
|
626
|
+
return;
|
|
627
|
+
},
|
|
628
|
+
hasLoaderRuleFor: () => false,
|
|
629
|
+
loaderRuleModule: () => {
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
function getAssetExtensions() {
|
|
635
|
+
return activeHost.asset;
|
|
636
|
+
}
|
|
637
|
+
function setAssetExtensions(overrides) {
|
|
638
|
+
Object.assign(activeHost.asset, overrides);
|
|
639
|
+
}
|
|
640
|
+
var cssExtensions = {
|
|
641
|
+
extraCssExtensions: () => [],
|
|
642
|
+
resolveCssDependency: () => {
|
|
643
|
+
return;
|
|
644
|
+
},
|
|
645
|
+
deferRootNotFoundCss: () => false,
|
|
646
|
+
inlineStylesheets: () => {
|
|
647
|
+
return;
|
|
648
|
+
},
|
|
649
|
+
cssChunkPlugins: () => [],
|
|
650
|
+
resolveCssModule: () => {
|
|
651
|
+
return;
|
|
652
|
+
},
|
|
653
|
+
loadCssModuleForClient: () => {
|
|
654
|
+
return;
|
|
655
|
+
},
|
|
656
|
+
planRouteCssChunks: () => new Map
|
|
657
|
+
};
|
|
658
|
+
restoreWithExtensionHost(cssExtensions);
|
|
659
|
+
function getCssExtensions() {
|
|
660
|
+
return cssExtensions;
|
|
661
|
+
}
|
|
662
|
+
function setCssExtensions(overrides) {
|
|
663
|
+
Object.assign(cssExtensions, overrides);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
export { onExtensionHostReset, restoreWithExtensionHost, getCompatModeExtensions, setCompatModeExtensions, getRenderExtensions, setRenderExtensions, getRequestExtensions, registerRequestInterceptors, registerRequestWarmHooks, runRequestWarmHooks, registerOutsideBasePathInterceptors, registerResponseFinalizers, registerRevalidateBypassToken, finalizeResponse, setRequestExtensions, reportRequestError, setRuntimeExtensions, withRouteRuntime, getBuildExtensions, setBuildCompatExtensions, registerBuildSteps, registerBuildCompleteHooks, registerBuildParallelPhases, clearBuildParallelPhases, buildParallelPhaseError, registerInitHooks, runInitHooks, registerRouteConventions, registerUsageDetectors, registerRouteDependencyClassifiers, registerClientEntryDetectors, onLoadableExtensionsChanged, registerLoadableExtensions, extraLoadableExtensions, registerPageExtensions, registerAlwaysClientEntryReason, alwaysClientEntryReasons, extraPageExtensions, extraBoundaryConventionNames, sourceUsesRegisteredRequestApi, classifyRouteDependencies, sourceClientEntryReasons, getProxyExtensions, setProxyExtensions, getBundlerExtensions, serverDefineOptions, registerServerSourceTransforms, registerServerSourcePreTransforms, registerClientSourceTransforms, registerClientSourceAsyncPreTransforms, registerBundledSourceTransforms, withSniff, sourceNeedsServerTransforms, setBundlerExtensions, applyServerSourcePreTransforms, applyServerSourceTransforms, applyClientSourceTransforms, hasClientSourceAsyncPreTransforms, applyClientSourceAsyncPreTransforms, applyBundledSourceTransforms, getImportAliasExtensions, setImportAliasExtensions, setProxyResponseProtocol, getRouterProtocolExtensions, setRouterProtocolExtensions, getAssetExtensions, setAssetExtensions, getCssExtensions, setCssExtensions };
|