@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,213 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
escapeHtml
|
|
4
|
+
} from "./index-ye9hmsvf.js";
|
|
5
|
+
import {
|
|
6
|
+
getNextConfig
|
|
7
|
+
} from "./index-6e4fqv30.js";
|
|
8
|
+
import {
|
|
9
|
+
clearRenderBuffer,
|
|
10
|
+
registerResourceHint,
|
|
11
|
+
renderBuffer,
|
|
12
|
+
takeRenderBuffer
|
|
13
|
+
} from "./index-yhxkxghe.js";
|
|
14
|
+
|
|
15
|
+
// src/compat/next/script.tsx
|
|
16
|
+
import { jsx } from "preact/jsx-runtime";
|
|
17
|
+
function Script({
|
|
18
|
+
strategy = "afterInteractive",
|
|
19
|
+
children,
|
|
20
|
+
stylesheets,
|
|
21
|
+
...scriptProps
|
|
22
|
+
}) {
|
|
23
|
+
const src = typeof scriptProps.src === "string" ? scriptProps.src : undefined;
|
|
24
|
+
const dedupKey = typeof scriptProps.id === "string" && scriptProps.id || src;
|
|
25
|
+
if (dedupKey) {
|
|
26
|
+
const keys = executedScriptKeys();
|
|
27
|
+
if (keys.has(dedupKey))
|
|
28
|
+
return null;
|
|
29
|
+
keys.add(dedupKey);
|
|
30
|
+
}
|
|
31
|
+
const manualNonce = typeof scriptProps.nonce === "string" ? scriptProps.nonce : undefined;
|
|
32
|
+
if (src && strategy !== "lazyOnload") {
|
|
33
|
+
registerResourceHint({
|
|
34
|
+
rel: "preload",
|
|
35
|
+
url: src,
|
|
36
|
+
as: "script",
|
|
37
|
+
...manualNonce ? { nonce: manualNonce } : {},
|
|
38
|
+
...typeof scriptProps.crossOrigin === "string" ? { crossOrigin: scriptProps.crossOrigin } : {}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (stylesheets) {
|
|
42
|
+
for (const url of stylesheets) {
|
|
43
|
+
registerResourceHint({ rel: "stylesheet", url });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (strategy === "beforeInteractive") {
|
|
47
|
+
headScripts().push({
|
|
48
|
+
props: { "data-nscript": "beforeInteractive", ...scriptProps },
|
|
49
|
+
content: inlineScriptContent(scriptProps, children)
|
|
50
|
+
});
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
if (strategy === "worker" && nextScriptWorkersEnabled()) {
|
|
54
|
+
const partytownProps = {
|
|
55
|
+
...scriptProps,
|
|
56
|
+
type: "text/partytown",
|
|
57
|
+
"data-nscript": "worker"
|
|
58
|
+
};
|
|
59
|
+
const workerInline = typeof children === "string" ? { dangerouslySetInnerHTML: { __html: children } } : {};
|
|
60
|
+
return /* @__PURE__ */ jsx("script", {
|
|
61
|
+
...partytownProps,
|
|
62
|
+
...workerInline
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const deferredContent = inlineScriptContent(scriptProps, children);
|
|
66
|
+
deferredScripts().push({
|
|
67
|
+
strategy: strategy === "lazyOnload" ? "lazyOnload" : "afterInteractive",
|
|
68
|
+
attrs: deferredAttrs({ ...scriptProps, ...manualNonce ? { nonce: manualNonce } : {} }),
|
|
69
|
+
...typeof scriptProps.id === "string" ? { id: scriptProps.id } : {},
|
|
70
|
+
...src ? { src } : {},
|
|
71
|
+
...deferredContent !== undefined ? { content: deferredContent } : {}
|
|
72
|
+
});
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
function nextScriptWorkersEnabled() {
|
|
76
|
+
const experimental = getNextConfig().experimental;
|
|
77
|
+
return experimental?.nextScriptWorkers === true;
|
|
78
|
+
}
|
|
79
|
+
var PARTYTOWN_LIB_PATH = "/_next/static/~partytown/";
|
|
80
|
+
function partytownHeadScripts() {
|
|
81
|
+
const config = getNextConfig();
|
|
82
|
+
if (config.experimental?.nextScriptWorkers !== true)
|
|
83
|
+
return [];
|
|
84
|
+
const partytownConfig = {
|
|
85
|
+
lib: PARTYTOWN_LIB_PATH,
|
|
86
|
+
...config.partytown ?? {}
|
|
87
|
+
};
|
|
88
|
+
return [
|
|
89
|
+
{
|
|
90
|
+
props: { "data-partytown-config": "" },
|
|
91
|
+
content: `partytown = ${JSON.stringify(partytownConfig)};`
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
props: { "data-partytown": "" },
|
|
95
|
+
content: partytownSnippet(partytownConfig.lib)
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
function renderPartytownHeadScripts() {
|
|
100
|
+
return partytownHeadScripts().map(renderHeadScript).join("");
|
|
101
|
+
}
|
|
102
|
+
function partytownSnippet(lib) {
|
|
103
|
+
return `!(function(w,p,f,c){` + `c=w[p]=Object.assign(w[p]||{},{lib:${JSON.stringify(lib)}});` + `c.forward=c.forward||[];` + `f=document.createElement('script');` + `f.async=!0;f.src=c.lib+'partytown.js';` + `document.head.appendChild(f);` + `})(window,'partytown');`;
|
|
104
|
+
}
|
|
105
|
+
function deferredScripts() {
|
|
106
|
+
return renderBuffer("deferred");
|
|
107
|
+
}
|
|
108
|
+
function clearDeferredScripts() {
|
|
109
|
+
clearRenderBuffer("deferred");
|
|
110
|
+
}
|
|
111
|
+
function takeDeferredScripts() {
|
|
112
|
+
return takeRenderBuffer("deferred");
|
|
113
|
+
}
|
|
114
|
+
var DEFERRED_SKIP_PROPS = new Set(["src", "strategy", "dangerouslysetinnerhtml", "id"]);
|
|
115
|
+
function deferredAttrs(props) {
|
|
116
|
+
const attrs = {};
|
|
117
|
+
for (const [key, value] of Object.entries(props)) {
|
|
118
|
+
const name = attrName(key);
|
|
119
|
+
if (!isAttrName(name) || DEFERRED_SKIP_PROPS.has(name) || name.startsWith("on"))
|
|
120
|
+
continue;
|
|
121
|
+
if (value == null || value === false || typeof value === "function")
|
|
122
|
+
continue;
|
|
123
|
+
if (value === true) {
|
|
124
|
+
attrs[name] = "";
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (name === "class" && Array.isArray(value)) {
|
|
128
|
+
const className = value.filter((item) => typeof item === "string" || typeof item === "number").join(" ");
|
|
129
|
+
if (className)
|
|
130
|
+
attrs[name] = className;
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "bigint") {
|
|
134
|
+
attrs[name] = String(value);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return attrs;
|
|
138
|
+
}
|
|
139
|
+
var scriptDedupRegistry = new WeakMap;
|
|
140
|
+
function executedScriptKeys() {
|
|
141
|
+
const arr = renderBuffer("hints");
|
|
142
|
+
let keys = scriptDedupRegistry.get(arr);
|
|
143
|
+
if (!keys) {
|
|
144
|
+
keys = new Set;
|
|
145
|
+
scriptDedupRegistry.set(arr, keys);
|
|
146
|
+
}
|
|
147
|
+
return keys;
|
|
148
|
+
}
|
|
149
|
+
function headScripts() {
|
|
150
|
+
return renderBuffer("head");
|
|
151
|
+
}
|
|
152
|
+
function clearHeadScripts() {
|
|
153
|
+
clearRenderBuffer("head");
|
|
154
|
+
}
|
|
155
|
+
function takeHeadScripts() {
|
|
156
|
+
return takeRenderBuffer("head");
|
|
157
|
+
}
|
|
158
|
+
function renderHeadScripts() {
|
|
159
|
+
return takeHeadScripts().map(renderHeadScript).join(`
|
|
160
|
+
`);
|
|
161
|
+
}
|
|
162
|
+
function renderHeadScript(script) {
|
|
163
|
+
const attrs = scriptAttrs(script.props);
|
|
164
|
+
const open = attrs ? `<script ${attrs}>` : "<script>";
|
|
165
|
+
return script.content === undefined ? `${open}</script>` : `${open}${escapeScriptText(script.content)}</script>`;
|
|
166
|
+
}
|
|
167
|
+
function inlineScriptContent(props, children) {
|
|
168
|
+
if (typeof children === "string")
|
|
169
|
+
return children;
|
|
170
|
+
const dangerous = props.dangerouslySetInnerHTML;
|
|
171
|
+
if (dangerous && typeof dangerous === "object" && typeof dangerous.__html === "string") {
|
|
172
|
+
return dangerous.__html;
|
|
173
|
+
}
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
function scriptAttrs(props) {
|
|
177
|
+
const attrs = Object.entries(props).flatMap(([key, value]) => scriptAttr(attrName(key), value));
|
|
178
|
+
return attrs.join(" ");
|
|
179
|
+
}
|
|
180
|
+
function scriptAttr(name, value) {
|
|
181
|
+
if (!isAttrName(name))
|
|
182
|
+
return [];
|
|
183
|
+
if (value == null || value === false || typeof value === "function")
|
|
184
|
+
return [];
|
|
185
|
+
if (name === "strategy" || name === "dangerouslysetinnerhtml" || name.startsWith("on"))
|
|
186
|
+
return [];
|
|
187
|
+
if (value === true)
|
|
188
|
+
return [name];
|
|
189
|
+
if (name === "class" && Array.isArray(value)) {
|
|
190
|
+
const className = value.filter((item) => typeof item === "string" || typeof item === "number").join(" ");
|
|
191
|
+
return className ? [`class="${escapeHtml(className)}"`] : [];
|
|
192
|
+
}
|
|
193
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "bigint") {
|
|
194
|
+
return [];
|
|
195
|
+
}
|
|
196
|
+
return [`${name}="${escapeHtml(value)}"`];
|
|
197
|
+
}
|
|
198
|
+
function attrName(key) {
|
|
199
|
+
if (key === "className")
|
|
200
|
+
return "class";
|
|
201
|
+
if (key === "htmlFor")
|
|
202
|
+
return "for";
|
|
203
|
+
return key.toLowerCase();
|
|
204
|
+
}
|
|
205
|
+
function isAttrName(name) {
|
|
206
|
+
return /^[a-zA-Z_:][a-zA-Z0-9:._-]*$/.test(name);
|
|
207
|
+
}
|
|
208
|
+
var scriptTerminator = /(<\/|<)(s)(cript)/gi;
|
|
209
|
+
function escapeScriptText(text) {
|
|
210
|
+
return text.replace(scriptTerminator, (_, prefix, s, suffix) => `${prefix}${s === "s" ? "\\u0073" : "\\u0053"}${suffix}`);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export { Script, PARTYTOWN_LIB_PATH, partytownHeadScripts, renderPartytownHeadScripts, clearDeferredScripts, takeDeferredScripts, clearHeadScripts, takeHeadScripts, renderHeadScripts };
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/compat/next/image/validate.ts
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import path from "path";
|
|
5
|
+
var LOADERS = ["default", "imgix", "cloudinary", "akamai", "custom"];
|
|
6
|
+
var FORMATS = ["image/avif", "image/webp"];
|
|
7
|
+
var DISPOSITIONS = ["inline", "attachment"];
|
|
8
|
+
var REMOTE_PATTERN_KEYS = new Set(["protocol", "hostname", "port", "pathname", "search"]);
|
|
9
|
+
var LOCAL_PATTERN_KEYS = new Set(["pathname", "search"]);
|
|
10
|
+
function hasDefaultExport(file) {
|
|
11
|
+
let source;
|
|
12
|
+
try {
|
|
13
|
+
source = fs.readFileSync(file, "utf8");
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return /\bexport\s+default\b/.test(source) || /\bmodule\.exports\s*=/.test(source);
|
|
18
|
+
}
|
|
19
|
+
function received(value) {
|
|
20
|
+
if (value === null)
|
|
21
|
+
return "null";
|
|
22
|
+
if (Array.isArray(value))
|
|
23
|
+
return "array";
|
|
24
|
+
return typeof value;
|
|
25
|
+
}
|
|
26
|
+
function quotedUnion(options) {
|
|
27
|
+
return options.map((option) => `'${option}'`).join(" | ");
|
|
28
|
+
}
|
|
29
|
+
function collectImagesConfigErrors(config, root) {
|
|
30
|
+
const errors = [];
|
|
31
|
+
const assetPrefix = config.assetPrefix;
|
|
32
|
+
if (typeof assetPrefix === "string" && assetPrefix !== "" && !assetPrefix.startsWith("/")) {
|
|
33
|
+
try {
|
|
34
|
+
new URL(assetPrefix);
|
|
35
|
+
} catch {
|
|
36
|
+
errors.push("Invalid assetPrefix provided. Original error: TypeError: Invalid URL");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const images = config.images;
|
|
40
|
+
if (images === undefined || images === null)
|
|
41
|
+
return errors;
|
|
42
|
+
if (typeof images !== "object" || Array.isArray(images)) {
|
|
43
|
+
errors.push(`Expected object, received ${received(images)} at "images"`);
|
|
44
|
+
return errors;
|
|
45
|
+
}
|
|
46
|
+
const img = images;
|
|
47
|
+
validateSizeArray(errors, img.deviceSizes, "images.deviceSizes");
|
|
48
|
+
validateSizeArray(errors, img.imageSizes, "images.imageSizes");
|
|
49
|
+
if (img.domains !== undefined) {
|
|
50
|
+
if (!Array.isArray(img.domains)) {
|
|
51
|
+
errors.push(`Expected array, received ${received(img.domains)} at "images.domains"`);
|
|
52
|
+
} else if (img.domains.length > 50) {
|
|
53
|
+
errors.push('Array must contain at most 50 element(s) at "images.domains"');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (img.qualities !== undefined) {
|
|
57
|
+
if (!Array.isArray(img.qualities)) {
|
|
58
|
+
errors.push(`Expected array, received ${received(img.qualities)} at "images.qualities"`);
|
|
59
|
+
} else {
|
|
60
|
+
if (img.qualities.length < 1) {
|
|
61
|
+
errors.push('Array must contain at least 1 element(s) at "images.qualities"');
|
|
62
|
+
}
|
|
63
|
+
if (img.qualities.length > 20) {
|
|
64
|
+
errors.push('Array must contain at most 20 element(s) at "images.qualities"');
|
|
65
|
+
}
|
|
66
|
+
img.qualities.forEach((quality, index) => {
|
|
67
|
+
if (typeof quality !== "number") {
|
|
68
|
+
errors.push(`Expected number, received ${received(quality)} at "images.qualities[${index}]"`);
|
|
69
|
+
} else if (!Number.isInteger(quality)) {
|
|
70
|
+
errors.push(`Expected integer, received float at "images.qualities[${index}]"`);
|
|
71
|
+
} else if (quality < 1) {
|
|
72
|
+
errors.push(`Number must be greater than or equal to 1 at "images.qualities[${index}]"`);
|
|
73
|
+
} else if (quality > 100) {
|
|
74
|
+
errors.push(`Number must be less than or equal to 100 at "images.qualities[${index}]"`);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (img.localPatterns !== undefined) {
|
|
80
|
+
if (!Array.isArray(img.localPatterns)) {
|
|
81
|
+
errors.push(`Expected array, received ${received(img.localPatterns)} at "images.localPatterns"`);
|
|
82
|
+
} else {
|
|
83
|
+
if (img.localPatterns.length > 25) {
|
|
84
|
+
errors.push('Array must contain at most 25 element(s) at "images.localPatterns"');
|
|
85
|
+
}
|
|
86
|
+
img.localPatterns.forEach((pattern, index) => {
|
|
87
|
+
if (!pattern || typeof pattern !== "object")
|
|
88
|
+
return;
|
|
89
|
+
const unknown = Object.keys(pattern).filter((key) => !LOCAL_PATTERN_KEYS.has(key));
|
|
90
|
+
if (unknown.length > 0) {
|
|
91
|
+
errors.push(`Unrecognized key(s) in object: ${unknown.map((key) => `'${key}'`).join(", ")} at "images.localPatterns[${index}]"`);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (img.remotePatterns !== undefined) {
|
|
97
|
+
if (!Array.isArray(img.remotePatterns)) {
|
|
98
|
+
errors.push(`Expected array, received ${received(img.remotePatterns)} at "images.remotePatterns"`);
|
|
99
|
+
} else {
|
|
100
|
+
if (img.remotePatterns.length > 50) {
|
|
101
|
+
errors.push('Array must contain at most 50 element(s) at "images.remotePatterns"');
|
|
102
|
+
}
|
|
103
|
+
img.remotePatterns.forEach((pattern, index) => {
|
|
104
|
+
if (pattern instanceof URL) {
|
|
105
|
+
const protocol = pattern.protocol.replace(/:$/, "");
|
|
106
|
+
if (protocol !== "http" && protocol !== "https") {
|
|
107
|
+
errors.push(`Specified images.remotePatterns must have protocol "http" or "https" received "${protocol}"`);
|
|
108
|
+
}
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (!pattern || typeof pattern !== "object") {
|
|
112
|
+
errors.push(`Expected object, received ${received(pattern)} at "images.remotePatterns[${index}]"`);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const obj = pattern;
|
|
116
|
+
const unknown = Object.keys(obj).filter((key) => !REMOTE_PATTERN_KEYS.has(key));
|
|
117
|
+
if (unknown.length > 0) {
|
|
118
|
+
errors.push(`Unrecognized key(s) in object: ${unknown.map((key) => `'${key}'`).join(", ")} at "images.remotePatterns[${index}]"`);
|
|
119
|
+
}
|
|
120
|
+
if (typeof obj.hostname !== "string") {
|
|
121
|
+
errors.push(`"images.remotePatterns[${index}].hostname" is missing, expected string`);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (img.loader !== undefined) {
|
|
127
|
+
if (typeof img.loader !== "string" || !LOADERS.includes(img.loader)) {
|
|
128
|
+
errors.push(`Expected ${quotedUnion(LOADERS)}, received '${received(img.loader) === "string" ? img.loader : received(img.loader)}' at "images.loader"`);
|
|
129
|
+
} else if (img.loader !== "default" && img.loader !== "custom") {
|
|
130
|
+
const loader = img.loader;
|
|
131
|
+
if (typeof img.path !== "string" || img.path === "" || img.path === "/_next/image") {
|
|
132
|
+
errors.push(`Specified images.loader property (${loader}) also requires images.path property to be assigned to a URL prefix.`);
|
|
133
|
+
}
|
|
134
|
+
if (typeof img.loaderFile === "string" && img.loaderFile !== "") {
|
|
135
|
+
errors.push(`Specified images.loader property (${loader}) cannot be used with images.loaderFile property. Please set images.loader to "custom".`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (typeof img.loaderFile === "string" && img.loaderFile !== "") {
|
|
140
|
+
const absolute = img.loaderFile.startsWith("/") ? path.join(root, img.loaderFile) : path.resolve(root, img.loaderFile);
|
|
141
|
+
if (!fs.existsSync(absolute)) {
|
|
142
|
+
errors.push(`Specified images.loaderFile does not exist at "${absolute}".`);
|
|
143
|
+
} else if (!hasDefaultExport(absolute)) {
|
|
144
|
+
errors.push(`images.loaderFile detected but the file is missing default export.
|
|
145
|
+
` + "Read more: https://nextjs.org/docs/messages/invalid-images-config");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (img.formats !== undefined) {
|
|
149
|
+
if (!Array.isArray(img.formats)) {
|
|
150
|
+
errors.push(`Expected array, received ${received(img.formats)} at "images.formats"`);
|
|
151
|
+
} else {
|
|
152
|
+
img.formats.forEach((format, index) => {
|
|
153
|
+
if (!FORMATS.includes(format)) {
|
|
154
|
+
errors.push(`Expected ${quotedUnion(FORMATS)}, received '${String(format)}' at "images.formats[${index}]"`);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (img.contentDispositionType !== undefined && !DISPOSITIONS.includes(img.contentDispositionType)) {
|
|
160
|
+
errors.push(`Expected ${quotedUnion(DISPOSITIONS)}, received '${typeof img.contentDispositionType === "string" ? img.contentDispositionType : received(img.contentDispositionType)}' at "images.contentDispositionType"`);
|
|
161
|
+
}
|
|
162
|
+
if (img.contentSecurityPolicy !== undefined && typeof img.contentSecurityPolicy !== "string") {
|
|
163
|
+
errors.push(`Expected string, received ${received(img.contentSecurityPolicy)} at "images.contentSecurityPolicy"`);
|
|
164
|
+
}
|
|
165
|
+
if (img.minimumCacheTTL !== undefined) {
|
|
166
|
+
if (typeof img.minimumCacheTTL !== "number") {
|
|
167
|
+
errors.push(`Expected number, received ${received(img.minimumCacheTTL)} at "images.minimumCacheTTL"`);
|
|
168
|
+
} else if (img.minimumCacheTTL < 0) {
|
|
169
|
+
errors.push('Number must be greater than or equal to 0 at "images.minimumCacheTTL"');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
for (const key of ["dangerouslyAllowSVG", "unoptimized", "disableStaticImages"]) {
|
|
173
|
+
if (img[key] !== undefined && typeof img[key] !== "boolean") {
|
|
174
|
+
errors.push(`Expected boolean, received ${received(img[key])} at "images.${key}"`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return errors;
|
|
178
|
+
}
|
|
179
|
+
function validateSizeArray(errors, value, label) {
|
|
180
|
+
if (value === undefined)
|
|
181
|
+
return;
|
|
182
|
+
if (!Array.isArray(value)) {
|
|
183
|
+
errors.push(`Expected array, received ${received(value)} at "${label}"`);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
if (value.length > 25) {
|
|
187
|
+
errors.push(`Array must contain at most 25 element(s) at "${label}"`);
|
|
188
|
+
}
|
|
189
|
+
value.forEach((size, index) => {
|
|
190
|
+
if (typeof size !== "number") {
|
|
191
|
+
errors.push(`Expected number, received ${received(size)} at "${label}[${index}]"`);
|
|
192
|
+
} else if (size < 1) {
|
|
193
|
+
errors.push(`Number must be greater than or equal to 1 at "${label}[${index}]"`);
|
|
194
|
+
} else if (size > 1e4) {
|
|
195
|
+
errors.push(`Number must be less than or equal to 10000 at "${label}[${index}]"`);
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export { collectImagesConfigErrors };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/compat/next/dist/client/components/app-router-headers.ts
|
|
3
|
+
var RSC_HEADER = "rsc";
|
|
4
|
+
var ACTION_HEADER = "next-action";
|
|
5
|
+
var NEXT_ROUTER_STATE_TREE_HEADER = "next-router-state-tree";
|
|
6
|
+
var NEXT_ROUTER_PREFETCH_HEADER = "next-router-prefetch";
|
|
7
|
+
var NEXT_ROUTER_SEGMENT_PREFETCH_HEADER = "next-router-segment-prefetch";
|
|
8
|
+
var NEXT_HMR_REFRESH_HEADER = "next-hmr-refresh";
|
|
9
|
+
var NEXT_HMR_REFRESH_HASH_COOKIE = "__next_hmr_refresh_hash__";
|
|
10
|
+
var NEXT_URL = "next-url";
|
|
11
|
+
var RSC_CONTENT_TYPE_HEADER = "text/x-component";
|
|
12
|
+
var NEXT_INSTANT_TEST_COOKIE = "next-instant-navigation-testing";
|
|
13
|
+
var FLIGHT_HEADERS = [
|
|
14
|
+
RSC_HEADER,
|
|
15
|
+
NEXT_ROUTER_STATE_TREE_HEADER,
|
|
16
|
+
NEXT_ROUTER_PREFETCH_HEADER,
|
|
17
|
+
NEXT_HMR_REFRESH_HEADER,
|
|
18
|
+
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER
|
|
19
|
+
];
|
|
20
|
+
var NEXT_RSC_UNION_QUERY = "_rsc";
|
|
21
|
+
var NEXT_ROUTER_STALE_TIME_HEADER = "x-nextjs-stale-time";
|
|
22
|
+
var NEXT_DID_POSTPONE_HEADER = "x-nextjs-postponed";
|
|
23
|
+
var NEXT_REWRITTEN_PATH_HEADER = "x-nextjs-rewritten-path";
|
|
24
|
+
var NEXT_REWRITTEN_QUERY_HEADER = "x-nextjs-rewritten-query";
|
|
25
|
+
var NEXT_IS_PRERENDER_HEADER = "x-nextjs-prerender";
|
|
26
|
+
var NEXT_ACTION_NOT_FOUND_HEADER = "x-nextjs-action-not-found";
|
|
27
|
+
var NEXT_REQUEST_ID_HEADER = "x-nextjs-request-id";
|
|
28
|
+
var NEXT_HTML_REQUEST_ID_HEADER = "x-nextjs-html-request-id";
|
|
29
|
+
var NEXT_ACTION_REVALIDATED_HEADER = "x-action-revalidated";
|
|
30
|
+
|
|
31
|
+
export { RSC_HEADER, ACTION_HEADER, NEXT_ROUTER_STATE_TREE_HEADER, NEXT_ROUTER_PREFETCH_HEADER, NEXT_ROUTER_SEGMENT_PREFETCH_HEADER, NEXT_HMR_REFRESH_HEADER, NEXT_HMR_REFRESH_HASH_COOKIE, NEXT_URL, RSC_CONTENT_TYPE_HEADER, NEXT_INSTANT_TEST_COOKIE, FLIGHT_HEADERS, NEXT_RSC_UNION_QUERY, NEXT_ROUTER_STALE_TIME_HEADER, NEXT_DID_POSTPONE_HEADER, NEXT_REWRITTEN_PATH_HEADER, NEXT_REWRITTEN_QUERY_HEADER, NEXT_IS_PRERENDER_HEADER, NEXT_ACTION_NOT_FOUND_HEADER, NEXT_REQUEST_ID_HEADER, NEXT_HTML_REQUEST_ID_HEADER, NEXT_ACTION_REVALIDATED_HEADER };
|