@wular/pnext 0.1.7 → 0.1.8
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/dist/server/_chunks/{aliases-j47a10ce.js → aliases-pycbtjt1.js} +7 -5
- package/dist/server/_chunks/{analyze-arswqe6s.js → analyze-4d9e00g9.js} +17 -13
- package/dist/server/_chunks/{boot-af0mv3dy.js → boot-bhemypxz.js} +13 -11
- package/dist/server/_chunks/{build-spy3dxp4.js → build-c991dv65.js} +7 -5
- package/dist/server/_chunks/{build-t9h0hec3.js → build-kh5e3x48.js} +977 -1186
- package/dist/server/_chunks/{build-tier-m7yvqz61.js → build-tier-0a96kmx3.js} +59 -75
- package/dist/server/_chunks/{compile-53j02j27.js → compile-040r79gj.js} +2 -2
- package/dist/server/_chunks/{config-n2z7yxps.js → config-0tvz03a6.js} +6 -4
- package/dist/server/_chunks/{config-1yzwexq6.js → config-27rj7830.js} +12 -3
- package/dist/server/_chunks/{create-meec9hs6.js → create-9rvwshsp.js} +4 -3
- package/dist/server/_chunks/{dev-fjmqg6en.js → dev-ex9exynt.js} +2 -2
- package/dist/server/_chunks/{generate-n9sh6hzt.js → generate-myw9hef7.js} +5 -4
- package/dist/server/_chunks/{index-91x12ykq.js → index-0r5eqfc7.js} +6 -1
- package/dist/server/_chunks/{index-3xbr4eyv.js → index-0yjv5v47.js} +3 -3
- package/dist/server/_chunks/{index-ncnes8c6.js → index-11xpbfej.js} +2 -2
- package/dist/server/_chunks/{index-357na4a8.js → index-141vcwk6.js} +1 -1
- package/dist/server/_chunks/{index-nyrba2kr.js → index-1pzm1hdy.js} +11 -11
- package/dist/server/_chunks/{index-fkp000p1.js → index-29pq0kax.js} +2 -2
- package/dist/server/_chunks/{index-wpfhfbs4.js → index-38xpdxwd.js} +4 -4
- package/dist/server/_chunks/{index-tvqkq6e6.js → index-3e075kny.js} +1 -1
- package/dist/server/_chunks/{index-kq8kpzye.js → index-3ycf5ckv.js} +3 -3
- package/dist/server/_chunks/{index-20ppawv7.js → index-4da76t62.js} +3 -3
- package/dist/server/_chunks/{index-cf4rvxv6.js → index-52k54ykj.js} +1 -1
- package/dist/server/_chunks/{index-x93hv0sc.js → index-71885zaq.js} +23 -10
- package/dist/server/_chunks/{index-jepjvcrf.js → index-8ct7rqy3.js} +1 -1
- package/dist/server/_chunks/{index-sjpckxqn.js → index-9f49w76j.js} +1 -1
- package/dist/server/_chunks/{index-4hgjrqh7.js → index-9hz3s0m8.js} +2 -2
- package/dist/server/_chunks/{index-9n2914ww.js → index-akkrvjn6.js} +1 -1
- package/dist/server/_chunks/{index-9ych9ma8.js → index-b7j671dj.js} +2 -2
- package/dist/server/_chunks/index-bzd2ef7t.js +10 -0
- package/dist/server/_chunks/{index-p77b4kcx.js → index-cn86z041.js} +1 -1
- package/dist/server/_chunks/{index-hkdfj58q.js → index-cvr4z22m.js} +1 -1
- package/dist/server/_chunks/{index-y2jr2n72.js → index-d158y67j.js} +4 -4
- package/dist/server/_chunks/{index-yz54pxrh.js → index-d1jsmhhk.js} +4 -9
- package/dist/server/_chunks/{index-ggk2j965.js → index-dgr390q7.js} +56 -50
- package/dist/server/_chunks/{index-sctcgyvv.js → index-drwv61cc.js} +2 -2
- package/dist/server/_chunks/{index-9hx2641q.js → index-entm8bmz.js} +1 -1
- package/dist/server/_chunks/{index-jx7bqvw1.js → index-evhd413j.js} +1 -1
- package/dist/server/_chunks/{index-1011cscr.js → index-fjv96re1.js} +61 -29
- package/dist/server/_chunks/{index-c0g2wf3z.js → index-gcmj16xy.js} +1 -1
- package/dist/server/_chunks/{index-ytjvpbm2.js → index-gkndxkxf.js} +3 -3
- package/dist/server/_chunks/index-hdbwtdv2.js +352 -0
- package/dist/server/_chunks/{index-z84ab1w0.js → index-he6n2bvp.js} +3 -3
- package/dist/server/_chunks/{index-eajaspjk.js → index-j0m1jxqa.js} +1 -1
- package/dist/server/_chunks/{index-4q2gbfwk.js → index-j681c48a.js} +2 -2
- package/dist/server/_chunks/index-jbj7ehef.js +50 -0
- package/dist/server/_chunks/{index-8k7pfejn.js → index-jn9rbhrx.js} +7 -7
- package/dist/server/_chunks/index-jt8e1pje.js +12 -0
- package/dist/server/_chunks/{index-eeaanp2e.js → index-kdhxpwyq.js} +3 -3
- package/dist/server/_chunks/{index-6e4fqv30.js → index-m63czgq5.js} +2 -0
- package/dist/server/_chunks/{index-2dv4y4wd.js → index-n629dy38.js} +16 -10
- package/dist/server/_chunks/{index-sv8m6789.js → index-nf3df4jy.js} +5 -5
- package/dist/server/_chunks/{index-06nyqntx.js → index-q3r9z8mq.js} +1 -1
- package/dist/server/_chunks/{index-3b3at80h.js → index-qcrvt6er.js} +6 -3
- package/dist/server/_chunks/{index-egykcqg3.js → index-rgj5mx84.js} +1 -1
- package/dist/server/_chunks/{index-vvmmknm1.js → index-rjegyfx4.js} +19 -15
- package/dist/server/_chunks/{index-ym67zqxp.js → index-tf4j19ge.js} +1 -1
- package/dist/server/_chunks/{index-5gyr4emz.js → index-tq3b39a5.js} +4 -4
- package/dist/server/_chunks/{index-qn4z5s3c.js → index-typcbcsv.js} +3 -3
- package/dist/server/_chunks/{index-11sfk4hb.js → index-vmr35jjw.js} +1 -1
- package/dist/server/_chunks/{index-danncfhy.js → index-wm36rj4v.js} +1 -1
- package/dist/server/_chunks/{index-3tf1xjsp.js → index-x2m17v9c.js} +11 -11
- package/dist/server/_chunks/{index-z4z9zv3b.js → index-x9c55pzy.js} +141 -3
- package/dist/server/_chunks/{index-k1g3epw0.js → index-xh1nbk46.js} +10 -10
- package/dist/server/_chunks/{index-0374j2b9.js → index-y4d02znn.js} +1 -1
- package/dist/server/_chunks/{index-qm6kmhqs.js → index-y7mzvq2q.js} +1 -1
- package/dist/server/_chunks/{index-rn8dyr1f.js → index-yrjkqtfj.js} +8 -48
- package/dist/server/_chunks/{index-tq0pc7eg.js → index-zfrwq472.js} +3 -3
- package/dist/server/_chunks/{loader-7yw0j98z.js → loader-5en7wpt5.js} +12 -10
- package/dist/server/_chunks/{modules-jn8bmbn8.js → modules-t92favpj.js} +14 -12
- package/dist/server/_chunks/{pipeline-yy9jhydf.js → pipeline-4t9q43ht.js} +25 -21
- package/dist/server/_chunks/{production-jar9ztm3.js → production-385bw8df.js} +14 -3
- package/dist/server/_chunks/{proxy-config-j84dgksn.js → proxy-config-60gprphe.js} +7 -5
- package/dist/server/_chunks/{proxy-w1d0wmsn.js → proxy-gfhmktbk.js} +12 -10
- package/dist/server/_chunks/{router-k1reahfn.js → router-xnrva921.js} +10 -7
- package/dist/server/_chunks/{routes-2s277fc6.js → routes-ht868pdc.js} +12 -10
- package/dist/server/_chunks/{run-pvd8bs1t.js → run-d40d63ag.js} +5 -4
- package/dist/server/_chunks/{server-mt4a994c.js → server-2p8fgqq2.js} +38 -34
- package/dist/server/_chunks/{tsconfig-defaults-1nb3308g.js → tsconfig-defaults-bcn34eqb.js} +5 -4
- package/dist/server/_chunks/{typegen-0qr0459b.js → typegen-dvtcjtaw.js} +15 -13
- package/dist/server/cli/index.js +12 -15
- package/dist/server/cli/start.js +35 -14
- package/dist/server/compat/next/cache.js +5 -5
- package/dist/server/compat/next/config-headers.js +8 -6
- package/dist/server/compat/next/config-loader.js +1 -1
- package/dist/server/compat/next/dist/server/web/spec-extension/revalidate.js +5 -5
- package/dist/server/compat/next/dist/server/web/spec-extension/unstable-cache.js +5 -5
- package/dist/server/compat/next/dist/server/web/spec-extension/unstable-no-store.js +5 -5
- package/dist/server/compat/next/dynamic.js +3 -14
- package/dist/server/compat/next/font/cache.js +6 -4
- package/dist/server/compat/next/font/local.js +7 -5
- package/dist/server/compat/next/font/runtime.js +7 -5
- package/dist/server/compat/next/headers.js +4 -4
- package/dist/server/compat/next/image/config.js +2 -2
- package/dist/server/compat/next/image/optimizer.js +3 -3
- package/dist/server/compat/next/image/static-metadata.js +4 -4
- package/dist/server/compat/next/legacy-request-apis.js +3 -3
- package/dist/server/compat/next/link-transform.js +4 -3
- package/dist/server/compat/next/navigation.js +5 -4
- package/dist/server/compat/next/redirects.js +8 -6
- package/dist/server/compat/next/resource-hints.js +2 -2
- package/dist/server/compat/next/rewrites.js +7 -5
- package/dist/server/compat/next/root-params.js +3 -3
- package/dist/server/compat/next/route-state.js +2 -2
- package/dist/server/compat/next/script.js +2 -2
- package/dist/server/compat/next/server.js +5 -5
- package/dist/server/generation.json +1 -1
- package/package.json +1 -1
- package/reference/compat.md +1 -1
- package/reference/config.md +2 -2
- package/reference/dev.md +1 -1
- package/reference/getting-started.md +1 -1
- package/reference/rendering.md +4 -4
- package/src/api/dynamic.tsx +84 -4
- package/src/cli/adapters/vercel-warm.ts +40 -29
- package/src/cli/adapters/vercel.ts +95 -1262
- package/src/cli/analyze.ts +3 -2
- package/src/cli/build/cache.ts +6 -6
- package/src/cli/build.ts +33 -33
- package/src/cli/index.ts +4 -6
- package/src/cli/serve/pipeline.ts +16 -10
- package/src/cli/serve/standalone-worker.ts +8 -0
- package/src/cli/serve/standalone.ts +703 -0
- package/src/cli/start.ts +29 -8
- package/src/client/build.ts +1 -1
- package/src/client/reference-stub.ts +2 -34
- package/src/compat/actions/extensions.ts +3 -2
- package/src/compat/bundler/require-context.ts +2 -1
- package/src/compat/bundler/webpack-loaders.ts +3 -2
- package/src/compat/bundler/worker.ts +2 -2
- package/src/compat/css/inline-css.ts +1 -1
- package/src/compat/export/build-complete.ts +1 -1
- package/src/compat/export/emit.ts +4 -4
- package/src/compat/export/standalone.ts +30 -65
- package/src/compat/image-optimizer/optimize.ts +1 -1
- package/src/compat/lifecycle/instrumentation-client.ts +4 -3
- package/src/compat/metadata-artifacts.ts +1 -1
- package/src/compat/next/config-loader.ts +3 -0
- package/src/compat/next/dynamic.tsx +10 -23
- package/src/compat/next/font/cache.ts +2 -1
- package/src/compat/next/font/runtime.ts +1 -1
- package/src/compat/register/image.ts +1 -1
- package/src/compat/typecheck/check.ts +6 -4
- package/src/config.ts +28 -5
- package/src/css/assets.ts +1 -1
- package/src/css/build.ts +16 -9
- package/src/dev/client-chunk-store.ts +2 -1
- package/src/dev/restart/client-key.ts +2 -1
- package/src/dev/restart/global-css.ts +2 -1
- package/src/dev/restart/route-bundle-key.ts +2 -1
- package/src/dev/restart/route-facts.ts +2 -1
- package/src/dev/server.ts +8 -7
- package/src/out-paths.ts +10 -0
- package/src/render/renderer.ts +1 -1
- package/src/resolve/dynamic.ts +4 -0
- package/src/resolve/engine.ts +2 -12
- package/src/resolve/scan-facts.ts +185 -1
- package/src/routing/metadata-files.ts +1 -1
- package/src/runtime/loader.ts +5 -3
- package/src/runtime/module-cache.ts +2 -1
- package/src/runtime/modules.ts +50 -16
- package/src/runtime/prebundle.ts +23 -3
- package/src/runtime/production.ts +105 -40
- package/src/runtime/release-graph.ts +21 -13
- package/src/runtime/vendor-build.ts +45 -23
- package/src/types.ts +2 -3
- package/src/utils/directive.ts +40 -0
- package/src/utils/fs.ts +7 -2
- package/src/utils/resource-query.ts +12 -0
- package/dist/server/_chunks/index-tqn2qnnn.js +0 -241
- package/dist/server/_chunks/index-y36a0ybw.js +0 -57
- package/src/cli/serve/entry.ts +0 -52
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
hashedAssetName,
|
|
12
12
|
isCssModuleFile,
|
|
13
13
|
recordEmittedAsset
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-d158y67j.js";
|
|
15
15
|
import {
|
|
16
16
|
readSourceSync
|
|
17
17
|
} from "./index-fp8r0sqs.js";
|
|
@@ -21,13 +21,16 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
ensureDir,
|
|
23
23
|
readText
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-4da76t62.js";
|
|
25
|
+
import {
|
|
26
|
+
outCachePath
|
|
27
|
+
} from "./index-bzd2ef7t.js";
|
|
25
28
|
import {
|
|
26
29
|
productionRelease
|
|
27
|
-
} from "./index-
|
|
30
|
+
} from "./index-hdbwtdv2.js";
|
|
28
31
|
import {
|
|
29
32
|
resolveImport
|
|
30
|
-
} from "./index-
|
|
33
|
+
} from "./index-d1jsmhhk.js";
|
|
31
34
|
import {
|
|
32
35
|
extraPageExtensions,
|
|
33
36
|
getCssExtensions
|
|
@@ -464,7 +467,6 @@ function interopDefault(mod) {
|
|
|
464
467
|
return mod.default;
|
|
465
468
|
return mod;
|
|
466
469
|
}
|
|
467
|
-
|
|
468
470
|
// src/css/build.ts
|
|
469
471
|
var worker;
|
|
470
472
|
var workerFailed = false;
|
|
@@ -525,9 +527,13 @@ async function stopCssWorker() {
|
|
|
525
527
|
if (active)
|
|
526
528
|
await Promise.resolve(active.terminate());
|
|
527
529
|
}
|
|
530
|
+
function scanOutDir(config, dev) {
|
|
531
|
+
return dev ? config.outPath : config.outRootPath;
|
|
532
|
+
}
|
|
528
533
|
async function runPostcssOffThread(config, cssFile, options, from) {
|
|
529
|
-
const { root, outPath: outDir } = config;
|
|
530
534
|
const dev = options.dev ?? false;
|
|
535
|
+
const { root } = config;
|
|
536
|
+
const outDir = scanOutDir(config, dev);
|
|
531
537
|
const sent = send((id) => ({ kind: "process", id, root, dev, outDir, cssFile, from }));
|
|
532
538
|
if (sent)
|
|
533
539
|
return sent;
|
|
@@ -539,7 +545,7 @@ function warmCssWorker(config, options = {}) {
|
|
|
539
545
|
id,
|
|
540
546
|
root: config.root,
|
|
541
547
|
dev: options.dev ?? false,
|
|
542
|
-
outDir: config.
|
|
548
|
+
outDir: scanOutDir(config, options.dev ?? false)
|
|
543
549
|
}))?.catch(() => {});
|
|
544
550
|
}
|
|
545
551
|
function globalCssSource(config) {
|
|
@@ -616,7 +622,7 @@ async function buildGlobalCss(config, options = {}) {
|
|
|
616
622
|
log.log("global css: no side-effect css imports in root layout, skipping");
|
|
617
623
|
return;
|
|
618
624
|
}
|
|
619
|
-
const outDir = options.dev ? path2.join(config.outPath, "
|
|
625
|
+
const outDir = options.dev ? path2.join(outCachePath(config.outPath), "assets") : path2.join(config.outPath, "static", "assets");
|
|
620
626
|
const outfile = path2.join(outDir, "global.css");
|
|
621
627
|
await ensureDir(outDir);
|
|
622
628
|
log.log(`global css: ${sources.length} source${sources.length === 1 ? "" : "s"} \u2014 ${sources.map((file) => path2.relative(config.root, file)).join(", ")}`);
|
|
@@ -793,7 +799,7 @@ function buildRouteStylesheets(config, routes, documentCss, options = {}) {
|
|
|
793
799
|
return publish;
|
|
794
800
|
}
|
|
795
801
|
async function buildNotFoundCss(config, options = {}) {
|
|
796
|
-
const { collectFileCss } = await import("./routes-
|
|
802
|
+
const { collectFileCss } = await import("./routes-ht868pdc.js");
|
|
797
803
|
const targets = [
|
|
798
804
|
{
|
|
799
805
|
id: "not-found",
|
|
@@ -833,7 +839,7 @@ async function bundleCssChunk(config, cssImports, assetName, label, options) {
|
|
|
833
839
|
}
|
|
834
840
|
async function writeCssChunk(config, cssImports, assetName, label, options) {
|
|
835
841
|
const log = createVerboseLogger(options.verbose ?? false, "css");
|
|
836
|
-
const outDir = options.dev ? path2.join(config.outPath, "
|
|
842
|
+
const outDir = options.dev ? path2.join(outCachePath(config.outPath), "assets") : path2.join(config.outPath, "static", "assets");
|
|
837
843
|
const outfile = path2.join(outDir, assetName);
|
|
838
844
|
await ensureDir(outDir);
|
|
839
845
|
log.log(`${label}: ${cssImports.length} import${cssImports.length === 1 ? "" : "s"}`);
|
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
} from "./index-2wfv4kvx.js";
|
|
5
5
|
import {
|
|
6
6
|
nextCompatEnabled
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-kdhxpwyq.js";
|
|
8
8
|
import {
|
|
9
9
|
findProxyFiles,
|
|
10
10
|
setProxyRewriteObserver
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-3ycf5ckv.js";
|
|
12
12
|
import {
|
|
13
13
|
getNextConfig
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-m63czgq5.js";
|
|
15
15
|
import {
|
|
16
16
|
readText,
|
|
17
17
|
toPosixPath
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-4da76t62.js";
|
|
19
19
|
import {
|
|
20
20
|
recordCanonicalUrl
|
|
21
21
|
} from "./index-en7n9f7m.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "./index-grta8ap3.js";
|
|
26
26
|
import {
|
|
27
27
|
moduleExportNames
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-x9c55pzy.js";
|
|
29
29
|
import {
|
|
30
30
|
setProxyExtensions,
|
|
31
31
|
setProxyResponseProtocol
|
|
@@ -4,10 +4,13 @@ import {
|
|
|
4
4
|
} from "./index-knp0s912.js";
|
|
5
5
|
import {
|
|
6
6
|
frameworkFingerprint
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-gcmj16xy.js";
|
|
8
8
|
import {
|
|
9
9
|
writeFileAtomic
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-4da76t62.js";
|
|
11
|
+
import {
|
|
12
|
+
outCachePath
|
|
13
|
+
} from "./index-bzd2ef7t.js";
|
|
11
14
|
|
|
12
15
|
// src/compat/next/font/cache.ts
|
|
13
16
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -16,7 +19,7 @@ import path from "path";
|
|
|
16
19
|
var INDEX_VERSION = 2;
|
|
17
20
|
var indexes = new Map;
|
|
18
21
|
function fontIndex(config) {
|
|
19
|
-
const file = path.join(config.outPath, "
|
|
22
|
+
const file = path.join(outCachePath(config.outPath), "fonts", "index.json");
|
|
20
23
|
const existing = indexes.get(file);
|
|
21
24
|
if (existing)
|
|
22
25
|
return existing;
|
|
@@ -5,42 +5,46 @@ import {
|
|
|
5
5
|
rewriteDynamicCallTargets,
|
|
6
6
|
rewriteLiteralDynamicCalls,
|
|
7
7
|
sourceHasDynamicImport
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-0r5eqfc7.js";
|
|
9
9
|
import {
|
|
10
10
|
applyServerHrefConfig,
|
|
11
11
|
isReleaseCompile,
|
|
12
12
|
serverBundleExtraConditions
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-0yjv5v47.js";
|
|
14
|
+
import {
|
|
15
|
+
hasModuleDirective
|
|
16
|
+
} from "./index-jbj7ehef.js";
|
|
14
17
|
import {
|
|
15
18
|
frameworkFingerprint
|
|
16
|
-
} from "./index-
|
|
19
|
+
} from "./index-gcmj16xy.js";
|
|
17
20
|
import {
|
|
18
21
|
build,
|
|
19
22
|
transform
|
|
20
23
|
} from "./index-cjgqs13g.js";
|
|
21
24
|
import {
|
|
22
25
|
writeFileAtomic
|
|
23
|
-
} from "./index-
|
|
26
|
+
} from "./index-4da76t62.js";
|
|
24
27
|
import {
|
|
25
28
|
traceEnabled
|
|
26
29
|
} from "./index-vz0km5qk.js";
|
|
27
|
-
import {
|
|
28
|
-
prebundledFile
|
|
29
|
-
} from "./index-y36a0ybw.js";
|
|
30
30
|
import {
|
|
31
31
|
frameworkRuntimeAliasEntries,
|
|
32
32
|
pathToFileHref,
|
|
33
33
|
pnextAliases
|
|
34
|
-
} from "./index-
|
|
34
|
+
} from "./index-71885zaq.js";
|
|
35
|
+
import {
|
|
36
|
+
outCachePath
|
|
37
|
+
} from "./index-bzd2ef7t.js";
|
|
35
38
|
import {
|
|
39
|
+
prebundledFile,
|
|
36
40
|
productionRelease
|
|
37
|
-
} from "./index-
|
|
41
|
+
} from "./index-hdbwtdv2.js";
|
|
38
42
|
import {
|
|
39
43
|
cachedExistsSync,
|
|
40
44
|
resolveExternalLoadTarget,
|
|
41
45
|
resolveImport,
|
|
42
46
|
workspacePackageRoots
|
|
43
|
-
} from "./index-
|
|
47
|
+
} from "./index-d1jsmhhk.js";
|
|
44
48
|
import {
|
|
45
49
|
applyBundledSourceTransforms,
|
|
46
50
|
applyServerSourcePreTransforms,
|
|
@@ -150,7 +154,7 @@ function devModuleCache(config, options) {
|
|
|
150
154
|
return created;
|
|
151
155
|
}
|
|
152
156
|
function cacheRoot(outPath) {
|
|
153
|
-
return path.join(outPath, "
|
|
157
|
+
return path.join(outCachePath(outPath), "server");
|
|
154
158
|
}
|
|
155
159
|
function createDevModuleCache(root, workspaceRoot, options) {
|
|
156
160
|
const indexFile = path.join(root, "graph.json");
|
|
@@ -669,7 +673,7 @@ function registerServerRuntime(config, sourceFiles = []) {
|
|
|
669
673
|
const roots = [
|
|
670
674
|
...rootPaths(config.root),
|
|
671
675
|
...rootPaths(config.appPath),
|
|
672
|
-
...isReleaseCompile() ? [] : rootPaths(path3.join(config.outPath, "
|
|
676
|
+
...isReleaseCompile() ? [] : rootPaths(path3.join(outCachePath(config.outPath), "server")),
|
|
673
677
|
...rootPaths(path3.join(__PNEXT_PACKAGE_ROOT__ + "/src/runtime", "..")),
|
|
674
678
|
...sourceRoots.flatMap(rootPaths)
|
|
675
679
|
];
|
|
@@ -840,7 +844,7 @@ function nodeModuleSourceLoadsAsIs(source) {
|
|
|
840
844
|
function nodeModuleRelativeImports(source) {
|
|
841
845
|
if (serverDefineOptions().define || source.includes("use cache"))
|
|
842
846
|
return;
|
|
843
|
-
if (
|
|
847
|
+
if (hasModuleDirective(source, "use client") || hasModuleDirective(source, "use server")) {
|
|
844
848
|
return;
|
|
845
849
|
}
|
|
846
850
|
try {
|
|
@@ -1060,7 +1064,7 @@ async function transformSourceUncached(file, fileStat) {
|
|
|
1060
1064
|
const runtime = runtimeConfigForFile(file);
|
|
1061
1065
|
let raw = await readFile3(file, "utf8");
|
|
1062
1066
|
if (/\.mdx?$/.test(file) && !file.includes(`${path3.sep}cache${path3.sep}server${path3.sep}`)) {
|
|
1063
|
-
const { compileMdx } = await import("./compile-
|
|
1067
|
+
const { compileMdx } = await import("./compile-040r79gj.js");
|
|
1064
1068
|
raw = (await compileMdx(raw, file, runtime?.root ?? path3.dirname(file))).code;
|
|
1065
1069
|
}
|
|
1066
1070
|
const source = await inlineModuleScopeRequires(rewriteServerSource(raw, file, {
|
|
@@ -1390,7 +1394,7 @@ async function staticImageModuleSource(config, file) {
|
|
|
1390
1394
|
const source = compat ?? coreStaticAssetModule(sourcePath, bytes, emit);
|
|
1391
1395
|
if (config) {
|
|
1392
1396
|
for (const asset of emitted) {
|
|
1393
|
-
const target = path3.join(config.outPath, "
|
|
1397
|
+
const target = path3.join(config.outPath, "static", ...asset.relative.split("/"));
|
|
1394
1398
|
await mkdir3(path3.dirname(target), { recursive: true });
|
|
1395
1399
|
if (!existsSync(target))
|
|
1396
1400
|
await Bun.write(target, asset.bytes);
|
|
@@ -83,22 +83,22 @@ function bootstrapCompatBoot(config) {
|
|
|
83
83
|
installFetchHostNormalization();
|
|
84
84
|
if (!compatEnabled(config))
|
|
85
85
|
return Promise.resolve();
|
|
86
|
-
bootRegistration ??= import("./boot-
|
|
86
|
+
bootRegistration ??= import("./boot-bhemypxz.js").then((module) => module.registerCompatBootExtensions(config));
|
|
87
87
|
return bootRegistration;
|
|
88
88
|
}
|
|
89
89
|
function bootstrapCompat(config, options = {}) {
|
|
90
90
|
installFetchHostNormalization();
|
|
91
91
|
if (!compatEnabled(config))
|
|
92
92
|
return Promise.resolve();
|
|
93
|
-
registration ??= bootstrapCompatBoot(config).then(() => import("./index-
|
|
93
|
+
registration ??= bootstrapCompatBoot(config).then(() => import("./index-dgr390q7.js")).then((module) => module.registerCompatExtensions(config, options));
|
|
94
94
|
return registration;
|
|
95
95
|
}
|
|
96
96
|
async function generateCompatRouteTypes(config, routes) {
|
|
97
97
|
if (!config.compat?.next)
|
|
98
98
|
return;
|
|
99
99
|
const [{ writeTsconfigDefaults }, { generateTypedRoutes }] = await Promise.all([
|
|
100
|
-
import("./tsconfig-defaults-
|
|
101
|
-
import("./generate-
|
|
100
|
+
import("./tsconfig-defaults-bcn34eqb.js"),
|
|
101
|
+
import("./generate-myw9hef7.js")
|
|
102
102
|
]);
|
|
103
103
|
await writeTsconfigDefaults(config);
|
|
104
104
|
await generateTypedRoutes(config, routes);
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./index-tgsfjmep.js";
|
|
6
6
|
import {
|
|
7
7
|
getImagesConfig
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-141vcwk6.js";
|
|
9
9
|
import {
|
|
10
10
|
cacheHandlerGet,
|
|
11
11
|
cacheHandlerSet,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./index-bcws5eh2.js";
|
|
14
14
|
import {
|
|
15
15
|
getNextConfig
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-m63czgq5.js";
|
|
17
17
|
import {
|
|
18
18
|
__require
|
|
19
19
|
} from "./index-rt9qq1va.js";
|
|
@@ -623,7 +623,7 @@ async function fetchUpstream(params, config, coreConfig, origin) {
|
|
|
623
623
|
return fetchExternalImage(params.href, config.dangerouslyAllowLocalIP, config.maximumResponseBody, config.maximumRedirects);
|
|
624
624
|
}
|
|
625
625
|
const publicFile = await readPublicFile([
|
|
626
|
-
path2.join(coreConfig.outPath, "
|
|
626
|
+
path2.join(coreConfig.outPath, "static"),
|
|
627
627
|
coreConfig.publicPath,
|
|
628
628
|
path2.join(coreConfig.root, "public")
|
|
629
629
|
], params.href);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
findGlobalError,
|
|
5
5
|
findLayouts,
|
|
6
6
|
serverActionsUnsupportedMessage
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-8ct7rqy3.js";
|
|
8
8
|
import {
|
|
9
9
|
devClientModuleHref,
|
|
10
10
|
devServerModuleHref,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
importModuleOnce,
|
|
14
14
|
registerServerRuntime,
|
|
15
15
|
serverBundleTargetForRuntime
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-0yjv5v47.js";
|
|
17
17
|
import {
|
|
18
18
|
assetHref,
|
|
19
19
|
emitFontCssStylesheet,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
routeCssAssetNames,
|
|
24
24
|
routeCssHref,
|
|
25
25
|
withAssetPrefix
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-d158y67j.js";
|
|
27
27
|
import {
|
|
28
28
|
getActionModuleExtensions,
|
|
29
29
|
getActiveMetadataExtensions,
|
|
@@ -72,23 +72,23 @@ import {
|
|
|
72
72
|
runInParamsScope,
|
|
73
73
|
serializeProps,
|
|
74
74
|
slotBoundarySymbol
|
|
75
|
-
} from "./index-
|
|
75
|
+
} from "./index-29pq0kax.js";
|
|
76
76
|
import {
|
|
77
77
|
matchSegments,
|
|
78
78
|
pathnameSegments,
|
|
79
79
|
slotDirectoriesIn
|
|
80
|
-
} from "./index-
|
|
80
|
+
} from "./index-cn86z041.js";
|
|
81
81
|
import {
|
|
82
82
|
pnextVersionRange,
|
|
83
83
|
readText,
|
|
84
84
|
toPosixPath
|
|
85
|
-
} from "./index-
|
|
85
|
+
} from "./index-4da76t62.js";
|
|
86
86
|
import {
|
|
87
87
|
traceEnabled
|
|
88
88
|
} from "./index-vz0km5qk.js";
|
|
89
89
|
import {
|
|
90
90
|
pathToFileHref
|
|
91
|
-
} from "./index-
|
|
91
|
+
} from "./index-71885zaq.js";
|
|
92
92
|
import {
|
|
93
93
|
markErrorLogged
|
|
94
94
|
} from "./index-jcsjq3d1.js";
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
servedAppFiles,
|
|
99
99
|
servedConventions,
|
|
100
100
|
servedRelease
|
|
101
|
-
} from "./index-
|
|
101
|
+
} from "./index-hdbwtdv2.js";
|
|
102
102
|
import {
|
|
103
103
|
clientReferenceId,
|
|
104
104
|
clientReferenceSymbol,
|
|
@@ -290,7 +290,7 @@ function staticMetadataLink(file) {
|
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
292
|
function staticMetadataOutputFile(outPath, file) {
|
|
293
|
-
return path.join(outPath, "
|
|
293
|
+
return path.join(outPath, "static", file.outputPath);
|
|
294
294
|
}
|
|
295
295
|
function metadataHasOwnImages(metadata, field) {
|
|
296
296
|
const value = metadata[field];
|
|
@@ -2181,7 +2181,7 @@ async function importClientModule(file, options) {
|
|
|
2181
2181
|
}
|
|
2182
2182
|
async function syntheticRouteCss(config, id, scan) {
|
|
2183
2183
|
if (!productionRelease(config))
|
|
2184
|
-
return scan(await import("./routes-
|
|
2184
|
+
return scan(await import("./routes-ht868pdc.js"));
|
|
2185
2185
|
const name = `${id}.css`;
|
|
2186
2186
|
return emittedAssetName(config, name) === name ? [] : [name];
|
|
2187
2187
|
}
|
|
@@ -3618,7 +3618,7 @@ function withDevReloadScript(html, request) {
|
|
|
3618
3618
|
return appendToDocumentBody(html, devReloadScript(documentNonce(request)));
|
|
3619
3619
|
}
|
|
3620
3620
|
function withGlobalErrorStylesheet(html, config) {
|
|
3621
|
-
const asset = `${config.outPath}/
|
|
3621
|
+
const asset = `${config.outPath}/static/assets/${emittedAssetName(config, "global-error.css")}`;
|
|
3622
3622
|
if (!existsSync2(asset))
|
|
3623
3623
|
return html;
|
|
3624
3624
|
const link = `<link rel="stylesheet" href="${assetHref(config, "global-error.css")}">`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
isCommonJsModuleSource
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-d1jsmhhk.js";
|
|
5
5
|
import {
|
|
6
6
|
loadNative
|
|
7
7
|
} from "./index-7wc9n8be.js";
|
|
@@ -151,6 +151,7 @@ var emptyRewriteFacts = {
|
|
|
151
151
|
edges: [],
|
|
152
152
|
imports: [],
|
|
153
153
|
importMetas: [],
|
|
154
|
+
computedImports: [],
|
|
154
155
|
unreliable: false
|
|
155
156
|
};
|
|
156
157
|
var memo = new Map;
|
|
@@ -341,11 +342,14 @@ function parseFacts(file, source, lang) {
|
|
|
341
342
|
}
|
|
342
343
|
imports.sort((a, b) => a.index - b.index);
|
|
343
344
|
const dynamicImports = [];
|
|
345
|
+
const computedImports = [];
|
|
344
346
|
for (const entry of result.module.dynamicImports) {
|
|
345
347
|
const raw = source.slice(entry.moduleRequest.start, entry.moduleRequest.end);
|
|
346
348
|
const specifier = literalSpecifier(raw);
|
|
347
|
-
if (specifier === undefined)
|
|
349
|
+
if (specifier === undefined) {
|
|
350
|
+
computedImports.push({ start: entry.start, end: entry.end });
|
|
348
351
|
continue;
|
|
352
|
+
}
|
|
349
353
|
dynamicImports.push({ specifier, index: entry.start });
|
|
350
354
|
const lead = raw.length - raw.trimStart().length;
|
|
351
355
|
edges.push({
|
|
@@ -380,6 +384,7 @@ function parseFacts(file, source, lang) {
|
|
|
380
384
|
edges,
|
|
381
385
|
imports: importStatements,
|
|
382
386
|
importMetas: result.module.importMetas.map((meta) => ({ start: meta.start, end: meta.end })),
|
|
387
|
+
computedImports,
|
|
383
388
|
unreliable: result.errors.length > 0
|
|
384
389
|
}
|
|
385
390
|
};
|
|
@@ -503,6 +508,139 @@ function child(node, key) {
|
|
|
503
508
|
const value = node?.[key];
|
|
504
509
|
return isNode(value) ? value : undefined;
|
|
505
510
|
}
|
|
511
|
+
var noMetaRefs = {
|
|
512
|
+
urls: [],
|
|
513
|
+
resolves: [],
|
|
514
|
+
readsLocation: false,
|
|
515
|
+
computedImports: [],
|
|
516
|
+
unreliable: false
|
|
517
|
+
};
|
|
518
|
+
var metaRefMemo = new Map;
|
|
519
|
+
var locationMembers = new Set(["url", "dirname", "filename", "resolve"]);
|
|
520
|
+
function importMetaRefs(file, source) {
|
|
521
|
+
if (stylesheetOrData.test(file))
|
|
522
|
+
return noMetaRefs;
|
|
523
|
+
if (!source.includes("import.meta") && !source.includes("import("))
|
|
524
|
+
return noMetaRefs;
|
|
525
|
+
const record = rewriteFacts(file, source);
|
|
526
|
+
if (record.importMetas.length === 0)
|
|
527
|
+
return { ...noMetaRefs, computedImports: record.computedImports, unreliable: record.unreliable };
|
|
528
|
+
const lang = langForFile2(file);
|
|
529
|
+
const key = `${lang}\x00${source.length}\x00${bun.hash(source).toString()}`;
|
|
530
|
+
const cached = metaRefMemo.get(key);
|
|
531
|
+
if (cached)
|
|
532
|
+
return cached;
|
|
533
|
+
const result = parseSync(file, source, { lang });
|
|
534
|
+
const refs = {
|
|
535
|
+
...noMetaRefs,
|
|
536
|
+
urls: [],
|
|
537
|
+
resolves: [],
|
|
538
|
+
computedImports: record.computedImports
|
|
539
|
+
};
|
|
540
|
+
refs.unreliable = result.errors.length > 0;
|
|
541
|
+
const isImportMeta = (node) => node?.type === "MetaProperty" && child(node, "meta")?.name === "import" && child(node, "property")?.name === "meta";
|
|
542
|
+
const memberName = (node) => node.computed ? stringValue(child(node, "property")) : child(node, "property")?.name;
|
|
543
|
+
const literal = (node) => {
|
|
544
|
+
if (!node)
|
|
545
|
+
return;
|
|
546
|
+
const value = stringValue(node) ?? (node.type === "TemplateLiteral" && node.expressions.length === 0 ? node.quasis[0]?.value?.cooked : undefined);
|
|
547
|
+
return value === undefined ? undefined : { specifier: value, start: node.start, end: node.end };
|
|
548
|
+
};
|
|
549
|
+
const visit = (value, parent) => {
|
|
550
|
+
if (Array.isArray(value)) {
|
|
551
|
+
for (const item of value)
|
|
552
|
+
visit(item, parent);
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
if (!isNode(value))
|
|
556
|
+
return;
|
|
557
|
+
if (isImportMeta(value)) {
|
|
558
|
+
const member = parent?.type === "MemberExpression" && parent.object === value;
|
|
559
|
+
if (!member || locationMembers.has(memberName(parent) ?? ""))
|
|
560
|
+
refs.readsLocation = true;
|
|
561
|
+
} else if (value.type === "NewExpression" && child(value, "callee")?.name === "URL") {
|
|
562
|
+
const [target, base] = value.arguments;
|
|
563
|
+
const span = literal(target);
|
|
564
|
+
if (span && base?.type === "MemberExpression" && isImportMeta(child(base, "object"))) {
|
|
565
|
+
if (memberName(base) === "url")
|
|
566
|
+
refs.urls.push(span);
|
|
567
|
+
}
|
|
568
|
+
} else if (value.type === "CallExpression") {
|
|
569
|
+
const callee = child(value, "callee");
|
|
570
|
+
if (callee?.type === "MemberExpression" && isImportMeta(child(callee, "object"))) {
|
|
571
|
+
const span = literal(value.arguments[0]);
|
|
572
|
+
if (span && memberName(callee) === "resolve")
|
|
573
|
+
refs.resolves.push(span);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
for (const key2 in value) {
|
|
577
|
+
if (key2 !== "start" && key2 !== "end" && key2 !== "type")
|
|
578
|
+
visit(value[key2], value);
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
visit(result.program, undefined);
|
|
582
|
+
metaRefMemo.set(key, refs);
|
|
583
|
+
return refs;
|
|
584
|
+
}
|
|
585
|
+
function hasModuleState(file, source) {
|
|
586
|
+
const result = parseSync(file, source, { lang: langForFile2(file) });
|
|
587
|
+
const pureEnds = new Set(result.comments.filter((comment) => /^\s*[#@]__PURE__\s*$/.test(comment.value)).map((comment) => comment.end));
|
|
588
|
+
const annotatedPure = (node) => {
|
|
589
|
+
for (let index = node.start - 1;index >= 0; index -= 1) {
|
|
590
|
+
if (pureEnds.has(index + 1))
|
|
591
|
+
return true;
|
|
592
|
+
if (!/\s/.test(source[index]))
|
|
593
|
+
return false;
|
|
594
|
+
}
|
|
595
|
+
return false;
|
|
596
|
+
};
|
|
597
|
+
const plainCallee = (node) => node?.type === "Identifier" || node?.type === "MemberExpression" && !node.computed && plainCallee(child(node, "object"));
|
|
598
|
+
const declarations = result.program.body.flatMap((statement) => {
|
|
599
|
+
const declaration = statement.type === "ExportNamedDeclaration" ? child(statement, "declaration") : statement;
|
|
600
|
+
return declaration?.type === "VariableDeclaration" ? declaration.declarations : [];
|
|
601
|
+
});
|
|
602
|
+
return declarations.some((declarator) => {
|
|
603
|
+
const init = unwrapExpression(child(declarator, "init"));
|
|
604
|
+
if (init?.type === "NewExpression")
|
|
605
|
+
return true;
|
|
606
|
+
if (init?.type !== "CallExpression")
|
|
607
|
+
return false;
|
|
608
|
+
const callee = child(init, "callee");
|
|
609
|
+
return plainCallee(callee) && callee?.name !== "require" && !annotatedPure(init);
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
function absolutePathLiterals(file, source) {
|
|
613
|
+
const result = parseSync(file, source, { lang: langForFile2(file) });
|
|
614
|
+
if (result.errors.length > 0)
|
|
615
|
+
return;
|
|
616
|
+
const found = [];
|
|
617
|
+
const visit = (value, parent) => {
|
|
618
|
+
if (Array.isArray(value)) {
|
|
619
|
+
for (const item of value)
|
|
620
|
+
visit(item, parent);
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
if (!isNode(value))
|
|
624
|
+
return;
|
|
625
|
+
const literal = stringValue(value);
|
|
626
|
+
if (literal !== undefined && (literal.startsWith("/") || literal.startsWith("file:///"))) {
|
|
627
|
+
const key = parent?.type === "Property" && parent.key === value && !parent.computed;
|
|
628
|
+
found.push({ value: literal, start: value.start, end: value.end, key });
|
|
629
|
+
}
|
|
630
|
+
for (const key in value) {
|
|
631
|
+
if (key !== "start" && key !== "end" && key !== "type")
|
|
632
|
+
visit(value[key], value);
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
visit(result.program, undefined);
|
|
636
|
+
return found;
|
|
637
|
+
}
|
|
638
|
+
function lineComments(file, source) {
|
|
639
|
+
const result = parseSync(file, source, { lang: langForFile2(file) });
|
|
640
|
+
if (result.errors.length > 0)
|
|
641
|
+
return;
|
|
642
|
+
return result.comments.filter((comment) => comment.type === "Line").map((comment) => ({ value: comment.value, start: comment.start, end: comment.end }));
|
|
643
|
+
}
|
|
506
644
|
function stripJsonImportAttributes(source, file, compiled) {
|
|
507
645
|
const result = parseSync(file, source, { lang: "js", sourceType: "module" });
|
|
508
646
|
if (result.errors.length > 0)
|
|
@@ -730,4 +868,4 @@ function langForFile2(file) {
|
|
|
730
868
|
return /\.[mc]?ts$/.test(file) ? "ts" : "tsx";
|
|
731
869
|
}
|
|
732
870
|
|
|
733
|
-
export { transformBailReason, transformServerModule, outputSpecifiers, spliceSource, scanFacts, importSpecifiers, moduleExportNames, moduleExportStars, dynamicCallFacts, rewriteFacts, moduleSpecifierEdges, rewriteSpecifierLiterals, scanFactsStats, stripJsonImportAttributes };
|
|
871
|
+
export { transformBailReason, transformServerModule, outputSpecifiers, spliceSource, scanFacts, importSpecifiers, moduleExportNames, moduleExportStars, dynamicCallFacts, rewriteFacts, moduleSpecifierEdges, rewriteSpecifierLiterals, scanFactsStats, importMetaRefs, hasModuleState, absolutePathLiterals, lineComments, stripJsonImportAttributes };
|