@farm.js/core 0.1.71 → 0.1.72
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/agent-mcp-handler-KE4J3W7S.cjs +1 -1
- package/dist/agent-mcp-handler-VIT4GOSR.mjs +1 -1
- package/dist/{agent-mcp.d-BzNw6JI8.d.ts → agent-mcp.d-BO3rZXEM.d.ts} +2 -2
- package/dist/{agent-mcp.d-CgFen3EH.d.mts → agent-mcp.d-Cwff7lcA.d.mts} +2 -2
- package/dist/agent-runtime.d.mts +3 -3
- package/dist/agent-runtime.d.ts +3 -3
- package/dist/{analyzer-VK3BAOFI.mjs → analyzer-5Q75LTIL.mjs} +2 -2
- package/dist/analyzer-UJG4MIZW.cjs +16 -0
- package/dist/api/node.d.mts +5 -5
- package/dist/api/node.d.ts +5 -5
- package/dist/api/route-manager.cjs +7 -6
- package/dist/api/route-manager.d.mts +7 -7
- package/dist/api/route-manager.d.ts +7 -7
- package/dist/api/route-manager.mjs +6 -5
- package/dist/api/runtime.d.mts +4 -4
- package/dist/api/runtime.d.ts +4 -4
- package/dist/api.cjs +8 -7
- package/dist/api.d.mts +8 -8
- package/dist/api.d.ts +8 -8
- package/dist/api.mjs +7 -6
- package/dist/{app-manifest.d-DY4JfJxi.d.ts → app-manifest.d-DwjGkYlP.d.ts} +1 -1
- package/dist/{app-manifest.d-DpDK_B1k.d.mts → app-manifest.d-USD_IbFd.d.mts} +1 -1
- package/dist/app-markdown.d.mts +4 -4
- package/dist/app-markdown.d.ts +4 -4
- package/dist/{app.d-BeK6bb1c.d.ts → app.d-DAmF2MAk.d.ts} +48 -6
- package/dist/{app.d-D-5UNrFd.d.mts → app.d-fW06_h8h.d.mts} +48 -6
- package/dist/{chunk-7A3URI2F.mjs → chunk-2EVESLP3.mjs} +8 -1
- package/dist/{chunk-X7LGLF33.mjs → chunk-3JN5M3T5.mjs} +259 -61
- package/dist/{chunk-KEB7AGS6.cjs → chunk-3WG7GJQL.cjs} +7 -2
- package/dist/{chunk-K66JILV3.cjs → chunk-5LOARKDP.cjs} +2 -2
- package/dist/{chunk-UISZLYKY.cjs → chunk-5R4Q5FN7.cjs} +2 -2
- package/dist/{chunk-3BQ7QHUH.cjs → chunk-5X6OHJEE.cjs} +15 -3
- package/dist/{chunk-GUU3IZSM.mjs → chunk-5XFKWHZD.mjs} +234 -47
- package/dist/{chunk-MITIAOUQ.mjs → chunk-645ENY7W.mjs} +2 -2
- package/dist/{chunk-RJUCNO7R.mjs → chunk-77VNYVVX.mjs} +1 -1
- package/dist/{chunk-PLXD2MJV.cjs → chunk-7QCJDYZQ.cjs} +2 -2
- package/dist/{chunk-V25GSH43.mjs → chunk-AUAMXI6N.mjs} +1 -1
- package/dist/{chunk-2IFT2CSA.cjs → chunk-BE7AQXJB.cjs} +346 -148
- package/dist/{chunk-7BUE2GM6.mjs → chunk-BSXKZPFE.mjs} +70 -19
- package/dist/{chunk-2MR4MABG.cjs → chunk-C5AM2XDN.cjs} +54 -4
- package/dist/{chunk-KWST2O22.cjs → chunk-CBLRSZQL.cjs} +488 -301
- package/dist/{chunk-BBPDJGCU.cjs → chunk-CYOTNHDF.cjs} +2 -2
- package/dist/{chunk-W2T6NDNP.mjs → chunk-DGNMXL2O.mjs} +1 -1
- package/dist/{chunk-QUFENL7Q.mjs → chunk-DS7JGFW5.mjs} +13 -1
- package/dist/{chunk-IGXS54GC.mjs → chunk-E2V7RRFL.mjs} +1 -1
- package/dist/{chunk-CSQPMV3Q.cjs → chunk-E3LE6EZH.cjs} +4 -4
- package/dist/{chunk-JVA4PIYN.cjs → chunk-ET6WW3FY.cjs} +338 -171
- package/dist/{chunk-VXB5CMNC.cjs → chunk-EXN4DTVF.cjs} +2 -2
- package/dist/{chunk-SXMWVP2L.cjs → chunk-FSSONJRV.cjs} +4 -4
- package/dist/{chunk-Y2SZVIVH.cjs → chunk-GPICBTDV.cjs} +8 -1
- package/dist/{chunk-7OHJWFLB.cjs → chunk-HLMUWKAP.cjs} +333 -282
- package/dist/{chunk-ZPUAOKHV.cjs → chunk-IWCYRDRQ.cjs} +3 -3
- package/dist/{chunk-2AM26UGI.cjs → chunk-NLBK37HI.cjs} +5 -4
- package/dist/{chunk-NA77GEIU.mjs → chunk-NV26EGMC.mjs} +51 -1
- package/dist/{chunk-DPYBVVL3.cjs → chunk-OSEQL34Q.cjs} +2 -2
- package/dist/{chunk-IYDJNCR7.mjs → chunk-OSMUE5ST.mjs} +7 -2
- package/dist/{chunk-UQUOSNRN.mjs → chunk-QUYAGU65.mjs} +214 -47
- package/dist/{chunk-DPIGYXSV.mjs → chunk-RFWWXEIF.mjs} +1 -1
- package/dist/{chunk-E77IA5IF.mjs → chunk-RLFGKJQ6.mjs} +1 -1
- package/dist/{chunk-3AUINHFG.mjs → chunk-TNYC3TYP.mjs} +3 -2
- package/dist/{chunk-4OD2LXF2.mjs → chunk-VAWDGGW3.mjs} +1 -1
- package/dist/{chunk-MU5V7XHL.mjs → chunk-VJSXPN3W.mjs} +3 -0
- package/dist/{chunk-DU4VHHPJ.mjs → chunk-VO55MMBX.mjs} +1 -1
- package/dist/{chunk-LDVJIBGN.mjs → chunk-VT25ERQK.mjs} +1 -1
- package/dist/{chunk-2CQC5CMD.mjs → chunk-WIJF3PBM.mjs} +1 -1
- package/dist/{chunk-FILXOEWD.cjs → chunk-YXIQYWOK.cjs} +2 -2
- package/dist/{chunk-THG2TVDH.mjs → chunk-YZLEOMMA.mjs} +3 -3
- package/dist/{chunk-MEJCP2LX.cjs → chunk-ZDZUFD67.cjs} +1 -1
- package/dist/{chunk-Q5HMVGR5.cjs → chunk-ZFEJ2SF2.cjs} +13 -13
- package/dist/{chunk-LNVGXUL3.cjs → chunk-ZMSVKVI3.cjs} +3 -0
- package/dist/{client-component.d-fYupugbZ.d.ts → client-component.d-9J7CkTWW.d.ts} +2 -2
- package/dist/{client-component.d-DwpH251K.d.mts → client-component.d-ciHeCxr-.d.mts} +2 -2
- package/dist/{client-plugins.d-BxqFfHpM.d.ts → client-plugins.d-CUOhfapO.d.ts} +4 -3
- package/dist/{client-plugins.d-k3bOT5gz.d.mts → client-plugins.d-JnRz5a1o.d.mts} +4 -3
- package/dist/client-plugins.d.mts +3 -3
- package/dist/client-plugins.d.ts +3 -3
- package/dist/client.cjs +1 -1
- package/dist/client.d.mts +8 -8
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +1 -1
- package/dist/config.d.mts +3 -3
- package/dist/config.d.ts +3 -3
- package/dist/desktop.d.mts +4 -4
- package/dist/desktop.d.ts +4 -4
- package/dist/{devtools-6MXPFPNJ.mjs → devtools-7JPQMSTQ.mjs} +3 -3
- package/dist/{devtools-O5625KCK.cjs → devtools-IZFUYWPG.cjs} +4 -4
- package/dist/docs.cjs +5 -5
- package/dist/docs.d.mts +4 -4
- package/dist/docs.d.ts +4 -4
- package/dist/docs.mjs +4 -4
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/{headers.d-DalIGbVO.d.ts → headers.d-CqpTL_fZ.d.ts} +2 -2
- package/dist/{headers.d-sNT7ZQiU.d.mts → headers.d-rbbTKGaN.d.mts} +2 -2
- package/dist/i18n/client.cjs +3 -2
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/client.mjs +2 -1
- package/dist/i18n/index.cjs +3 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.mjs +2 -1
- package/dist/i18n/server.cjs +6 -5
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/i18n/server.mjs +5 -4
- package/dist/index.cjs +22 -22
- package/dist/{index.d-BcA-secm.d.ts → index.d-CMKvzHLW.d.ts} +1 -1
- package/dist/{index.d-DDHHAv7j.d.mts → index.d-D_B2D9Il.d.mts} +1 -1
- package/dist/index.d.mts +23 -23
- package/dist/index.d.ts +23 -23
- package/dist/index.mjs +21 -21
- package/dist/integrations/orm.d.mts +3 -3
- package/dist/integrations/orm.d.ts +3 -3
- package/dist/integrations.d.mts +3 -3
- package/dist/integrations.d.ts +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +4 -4
- package/dist/internal/app-markdown-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.cjs +21 -21
- package/dist/internal/build-runtime.d.mts +5 -5
- package/dist/internal/build-runtime.d.ts +5 -5
- package/dist/internal/build-runtime.mjs +20 -20
- package/dist/internal/cli-runtime.cjs +6 -6
- package/dist/internal/cli-runtime.mjs +5 -5
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +2 -2
- package/dist/internal/client-runtime.d.mts +6 -6
- package/dist/internal/client-runtime.d.ts +6 -6
- package/dist/internal/client-runtime.mjs +3 -3
- package/dist/internal/compression-runtime.d.mts +3 -3
- package/dist/internal/compression-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.cjs +5 -5
- package/dist/internal/config-runtime.d.mts +6 -6
- package/dist/internal/config-runtime.d.ts +6 -6
- package/dist/internal/config-runtime.mjs +4 -4
- package/dist/internal/infra-analytics-runtime.cjs +7 -7
- package/dist/internal/infra-analytics-runtime.mjs +5 -5
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +13 -13
- package/dist/internal/production-runtime.d.mts +36 -24
- package/dist/internal/production-runtime.d.ts +36 -24
- package/dist/internal/production-runtime.mjs +12 -12
- package/dist/internal/vercel-edge-middleware.d.mts +2 -2
- package/dist/internal/vercel-edge-middleware.d.ts +2 -2
- package/dist/markdown.d.mts +3 -3
- package/dist/markdown.d.ts +3 -3
- package/dist/middleware.cjs +3 -3
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/middleware.mjs +2 -2
- package/dist/mobile.d.mts +3 -3
- package/dist/mobile.d.ts +3 -3
- package/dist/{mount.d-D3JOux2V.d.ts → mount.d-B0XMxDRh.d.ts} +1 -1
- package/dist/{mount.d-C1PONsEe.d.mts → mount.d-ImEO7q8a.d.mts} +1 -1
- package/dist/{navigation-delegate.d-CJQQHboA.d.mts → navigation-delegate.d-83Q7ksf7.d.mts} +1 -1
- package/dist/{navigation-delegate.d-CQQPbdkE.d.ts → navigation-delegate.d-RRx1CSlb.d.ts} +1 -1
- package/dist/navigation.d.mts +6 -6
- package/dist/navigation.d.ts +6 -6
- package/dist/plugin.cjs +15 -15
- package/dist/plugin.d.mts +6 -6
- package/dist/plugin.d.ts +6 -6
- package/dist/plugin.mjs +14 -14
- package/dist/{production-runtime.d-B0IeWWyO.d.mts → production-runtime.d-Bcu37SCo.d.mts} +1 -1
- package/dist/{production-runtime.d-q3aHIv5Y.d.ts → production-runtime.d-qPj3XRET.d.ts} +1 -1
- package/dist/{render-plan.d-DHuJMJRP.d.ts → render-plan.d-Ds2sXJ5m.d.ts} +1 -1
- package/dist/{render-plan.d-CiUj0rq5.d.mts → render-plan.d-wP8nTeRV.d.mts} +1 -1
- package/dist/renderer-client.cjs +3 -2
- package/dist/renderer-client.d.mts +6 -6
- package/dist/renderer-client.d.ts +6 -6
- package/dist/renderer-client.mjs +2 -1
- package/dist/{request.d-D-F7o7tb.d.mts → request.d-F3h7K37m.d.mts} +1 -1
- package/dist/{request.d-DRUbOmYD.d.ts → request.d-zpSn6pu_.d.ts} +1 -1
- package/dist/request.d.mts +4 -4
- package/dist/request.d.ts +4 -4
- package/dist/{resolver.d-9iKC79CU.d.mts → resolver.d-DJgzbdsp.d.mts} +1 -1
- package/dist/{resolver.d-CY6mEa_F.d.ts → resolver.d-yaHcGCCG.d.ts} +1 -1
- package/dist/{route-rendering.d-KwqM_mlK.d.ts → route-rendering.d-BL0_AdKj.d.ts} +1 -1
- package/dist/{route-rendering.d-6smgwT2t.d.mts → route-rendering.d-Mw0ZKG2e.d.mts} +1 -1
- package/dist/{router.d-B6sesMRD.d.ts → router.d-BwXigemZ.d.ts} +1 -1
- package/dist/{router.d-BYmDeDlp.d.mts → router.d-NGVsU11T.d.mts} +1 -1
- package/dist/{routes.d-D3aJw1H5.d.mts → routes.d-CCccJRrp.d.mts} +1 -1
- package/dist/{routes.d-K-Qg79AA.d.ts → routes.d-b7khoRoU.d.ts} +1 -1
- package/dist/routes.d.mts +3 -3
- package/dist/routes.d.ts +3 -3
- package/dist/{routing.d-DwSUVZbF.d.mts → routing.d-BhPgtN_S.d.ts} +2 -1
- package/dist/{routing.d-BxOZ2YWc.d.ts → routing.d-D67HQmnv.d.mts} +2 -1
- package/dist/{rsc-pipeline-P4PCWDO2.cjs → rsc-pipeline-BNXYMG4G.cjs} +5 -5
- package/dist/{rsc-pipeline-R2GOKIMU.mjs → rsc-pipeline-DHYZLWSF.mjs} +4 -4
- package/dist/{runtime-WA2Q4SLG.cjs → runtime-IWOT6ZVC.cjs} +6 -6
- package/dist/{runtime-DP5DYGW5.mjs → runtime-XPYKUNL3.mjs} +4 -4
- package/dist/{runtime.d-BFSJf-ww.d.mts → runtime.d-BA3MzhXz.d.mts} +1 -1
- package/dist/{runtime.d-nUz0HAL4.d.mts → runtime.d-CTAXWZby.d.mts} +2 -2
- package/dist/{runtime.d-CbdMI0Oy.d.ts → runtime.d-OBIZWpx1.d.ts} +1 -1
- package/dist/{runtime.d-B_uPfMjA.d.ts → runtime.d-PUA5qBnd.d.ts} +2 -2
- package/dist/server-plugins.d.mts +5 -5
- package/dist/server-plugins.d.ts +5 -5
- package/dist/server.cjs +33 -33
- package/dist/server.d.mts +14 -14
- package/dist/server.d.ts +14 -14
- package/dist/server.mjs +17 -17
- package/dist/{spa-router.d-D4EDwR20.d.mts → spa-router.d-BG2XzE5p.d.mts} +3 -3
- package/dist/{spa-router.d-mC1D5cTN.d.ts → spa-router.d-DrYT944-.d.ts} +3 -3
- package/dist/testing.cjs +6 -5
- package/dist/testing.d.mts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.mjs +6 -5
- package/dist/{types.d-wVRlLtBf.d.ts → types.d-euATAbE4.d.mts} +4 -0
- package/dist/{types.d-wVRlLtBf.d.mts → types.d-euATAbE4.d.ts} +4 -0
- package/dist/{utils.d-DxMzteqE.d.mts → utils.d-C1k9BJeD.d.mts} +1 -1
- package/dist/{utils.d-A2X3a6z_.d.ts → utils.d-DcF4wxey.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +15 -15
- package/dist/vite.d.mts +7 -7
- package/dist/vite.d.ts +7 -7
- package/dist/vite.mjs +14 -14
- package/package.json +1 -1
- package/dist/analyzer-LPIVRSTJ.cjs +0 -16
|
@@ -21,7 +21,7 @@ var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
|
|
|
21
21
|
var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkZDZUFD67cjs = require('./chunk-ZDZUFD67.cjs');
|
|
25
25
|
|
|
26
26
|
// src/environment-vite.ts
|
|
27
27
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
@@ -31,6 +31,117 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _parseAst = require('rolldown/parseAst');
|
|
34
|
+
|
|
35
|
+
// src/utils/source-snapshot.ts
|
|
36
|
+
|
|
37
|
+
var snapshot;
|
|
38
|
+
var volatile;
|
|
39
|
+
var trace;
|
|
40
|
+
function stampOf(file) {
|
|
41
|
+
try {
|
|
42
|
+
const stat = _fs2.default.statSync(file);
|
|
43
|
+
return `${stat.mtimeMs}:${stat.size}`;
|
|
44
|
+
} catch (e) {
|
|
45
|
+
return "missing";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
var FarmSourceSnapshotStore = class {
|
|
49
|
+
constructor() {
|
|
50
|
+
this.entries = /* @__PURE__ */ new Map();
|
|
51
|
+
this.stamps = /* @__PURE__ */ new Map();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Drops the entries that read a file changed on disk since the last plan, or one of `edited`
|
|
55
|
+
* (edits the watcher reported, which a coarse mtime can miss). Returns each such file with the
|
|
56
|
+
* source text the snapshot held for it, if any.
|
|
57
|
+
*/
|
|
58
|
+
refresh(edited = []) {
|
|
59
|
+
const changed = /* @__PURE__ */ new Map();
|
|
60
|
+
for (const file of edited) changed.set(file, void 0);
|
|
61
|
+
for (const [file, stamp] of this.stamps) {
|
|
62
|
+
if (stampOf(file) !== stamp) changed.set(file, void 0);
|
|
63
|
+
}
|
|
64
|
+
if (changed.size === 0) return changed;
|
|
65
|
+
const replaced = /* @__PURE__ */ new Set();
|
|
66
|
+
for (const [scope, entries] of this.entries) {
|
|
67
|
+
for (const [key, entry] of entries) {
|
|
68
|
+
if (!entry.files.some((file) => changed.has(file))) continue;
|
|
69
|
+
entries.delete(key);
|
|
70
|
+
if (scope !== "source" || typeof entry.value !== "string") continue;
|
|
71
|
+
replaced.add(entry.value);
|
|
72
|
+
if (changed.has(key)) changed.set(key, entry.value);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
for (const entries of this.entries.values()) {
|
|
76
|
+
for (const source of replaced) entries.delete(source);
|
|
77
|
+
}
|
|
78
|
+
for (const file of changed.keys()) this.stamps.delete(file);
|
|
79
|
+
return changed;
|
|
80
|
+
}
|
|
81
|
+
/** The source text the last plan read for `file`, if it read it. */
|
|
82
|
+
peekSource(file) {
|
|
83
|
+
const value = _optionalChain([this, 'access', _ => _.entries, 'access', _2 => _2.get, 'call', _3 => _3("source"), 'optionalAccess', _4 => _4.get, 'call', _5 => _5(file), 'optionalAccess', _6 => _6.value]);
|
|
84
|
+
return typeof value === "string" ? value : void 0;
|
|
85
|
+
}
|
|
86
|
+
/** Records the stamp of every file an entry read that has none yet. */
|
|
87
|
+
stamp() {
|
|
88
|
+
for (const entries of this.entries.values()) {
|
|
89
|
+
for (const entry of entries.values()) {
|
|
90
|
+
for (const file of entry.files) {
|
|
91
|
+
if (!this.stamps.has(file)) this.stamps.set(file, stampOf(file));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
clear() {
|
|
97
|
+
this.entries.clear();
|
|
98
|
+
this.stamps.clear();
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
function withFarmSourceSnapshot(operation, store) {
|
|
102
|
+
if (snapshot) return operation();
|
|
103
|
+
const entries = _nullishCoalesce(_optionalChain([store, 'optionalAccess', _7 => _7.entries]), () => ( /* @__PURE__ */ new Map()));
|
|
104
|
+
snapshot = entries;
|
|
105
|
+
volatile = [];
|
|
106
|
+
try {
|
|
107
|
+
return operation();
|
|
108
|
+
} finally {
|
|
109
|
+
for (const [scope, key] of volatile) _optionalChain([entries, 'access', _8 => _8.get, 'call', _9 => _9(scope), 'optionalAccess', _10 => _10.delete, 'call', _11 => _11(key)]);
|
|
110
|
+
snapshot = void 0;
|
|
111
|
+
volatile = void 0;
|
|
112
|
+
_optionalChain([store, 'optionalAccess', _12 => _12.stamp, 'call', _13 => _13()]);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function memoizeInFarmSourceSnapshot(scope, key, compute, lasting) {
|
|
116
|
+
if (!snapshot) return compute();
|
|
117
|
+
let entries = snapshot.get(scope);
|
|
118
|
+
if (!entries) snapshot.set(scope, entries = /* @__PURE__ */ new Map());
|
|
119
|
+
const memoized = entries.get(key);
|
|
120
|
+
if (memoized) {
|
|
121
|
+
if (trace) for (const file of memoized.files) trace.add(file);
|
|
122
|
+
return memoized.value;
|
|
123
|
+
}
|
|
124
|
+
const { result, files } = traceFarmSourceReads(compute);
|
|
125
|
+
entries.set(key, { value: result, files });
|
|
126
|
+
if (lasting && !lasting(result)) _optionalChain([volatile, 'optionalAccess', _14 => _14.push, 'call', _15 => _15([scope, key])]);
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
function noteFarmSourceRead(file) {
|
|
130
|
+
_optionalChain([trace, 'optionalAccess', _16 => _16.add, 'call', _17 => _17(file)]);
|
|
131
|
+
}
|
|
132
|
+
function traceFarmSourceReads(operation) {
|
|
133
|
+
const outer = trace;
|
|
134
|
+
const files = /* @__PURE__ */ new Set();
|
|
135
|
+
trace = files;
|
|
136
|
+
try {
|
|
137
|
+
return { result: operation(), files: [...files] };
|
|
138
|
+
} finally {
|
|
139
|
+
trace = outer;
|
|
140
|
+
if (outer) for (const file of files) outer.add(file);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// src/islands-react-server-exports.ts
|
|
34
145
|
var REACT_PACKAGES = /* @__PURE__ */ new Set([
|
|
35
146
|
"react",
|
|
36
147
|
"react-dom",
|
|
@@ -122,7 +233,7 @@ function resolveFarmReactServerExport(importer, specifier) {
|
|
|
122
233
|
const file = _path2.default.resolve(directory, server);
|
|
123
234
|
if (_fs2.default.existsSync(file)) resolved = file;
|
|
124
235
|
}
|
|
125
|
-
} catch (
|
|
236
|
+
} catch (e2) {
|
|
126
237
|
resolved = null;
|
|
127
238
|
}
|
|
128
239
|
cache.set(key, resolved);
|
|
@@ -133,9 +244,10 @@ function readModule(file) {
|
|
|
133
244
|
let stat;
|
|
134
245
|
try {
|
|
135
246
|
stat = _fs2.default.statSync(file);
|
|
136
|
-
} catch (
|
|
247
|
+
} catch (e3) {
|
|
137
248
|
return null;
|
|
138
249
|
}
|
|
250
|
+
noteFarmSourceRead(file);
|
|
139
251
|
const cached = parsedModules.get(file);
|
|
140
252
|
if (cached && cached.size === stat.size && cached.mtimeMs === stat.mtimeMs) return cached.program;
|
|
141
253
|
let program = null;
|
|
@@ -144,7 +256,7 @@ function readModule(file) {
|
|
|
144
256
|
const extension = _path2.default.extname(file).slice(1);
|
|
145
257
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
|
|
146
258
|
program = _parseAst.parseAst.call(void 0, code, { lang });
|
|
147
|
-
} catch (
|
|
259
|
+
} catch (e4) {
|
|
148
260
|
program = null;
|
|
149
261
|
}
|
|
150
262
|
parsedModules.set(file, { size: stat.size, mtimeMs: stat.mtimeMs, program });
|
|
@@ -170,7 +282,7 @@ function resolveRelative(from, specifier) {
|
|
|
170
282
|
return null;
|
|
171
283
|
}
|
|
172
284
|
function exportedName(node) {
|
|
173
|
-
return _optionalChain([node, 'optionalAccess',
|
|
285
|
+
return _optionalChain([node, 'optionalAccess', _18 => _18.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _19 => _19.value]);
|
|
174
286
|
}
|
|
175
287
|
function resolveFarmPackageDefaultEntry(importer, specifier, conditions = ["browser", ...DEFAULT_CONDITIONS]) {
|
|
176
288
|
const parsed = packageNameOf(specifier);
|
|
@@ -184,7 +296,7 @@ function resolveFarmPackageDefaultEntry(importer, specifier, conditions = ["brow
|
|
|
184
296
|
_path2.default.join(directory, "package.json"),
|
|
185
297
|
`./${String(target).replace(/^\.\//, "")}`
|
|
186
298
|
);
|
|
187
|
-
} catch (
|
|
299
|
+
} catch (e5) {
|
|
188
300
|
return null;
|
|
189
301
|
}
|
|
190
302
|
}
|
|
@@ -207,7 +319,7 @@ function traceExport(file, name, depth) {
|
|
|
207
319
|
};
|
|
208
320
|
const imports = /* @__PURE__ */ new Map();
|
|
209
321
|
for (const node of _nullishCoalesce(program.body, () => ( []))) {
|
|
210
|
-
if (node.type !== "ImportDeclaration" || typeof _optionalChain([node, 'access',
|
|
322
|
+
if (node.type !== "ImportDeclaration" || typeof _optionalChain([node, 'access', _20 => _20.source, 'optionalAccess', _21 => _21.value]) !== "string") continue;
|
|
211
323
|
for (const specifier of _nullishCoalesce(node.specifiers, () => ( []))) {
|
|
212
324
|
if (specifier.type === "ImportNamespaceSpecifier") continue;
|
|
213
325
|
const imported = specifier.type === "ImportDefaultSpecifier" ? "default" : _nullishCoalesce(exportedName(specifier.imported), () => ( specifier.local.name));
|
|
@@ -235,13 +347,13 @@ function traceExport(file, name, depth) {
|
|
|
235
347
|
}
|
|
236
348
|
}
|
|
237
349
|
const declared = [
|
|
238
|
-
..._optionalChain([node, 'access',
|
|
239
|
-
...(_nullishCoalesce(_optionalChain([node, 'access',
|
|
350
|
+
..._optionalChain([node, 'access', _22 => _22.declaration, 'optionalAccess', _23 => _23.id]) ? [node.declaration.id.name] : [],
|
|
351
|
+
...(_nullishCoalesce(_optionalChain([node, 'access', _24 => _24.declaration, 'optionalAccess', _25 => _25.declarations]), () => ( []))).map((declarator) => _optionalChain([declarator, 'access', _26 => _26.id, 'optionalAccess', _27 => _27.name]))
|
|
240
352
|
];
|
|
241
353
|
if (declared.includes(name)) return here(client ? "client" : "server");
|
|
242
354
|
} else if (node.type === "ExportDefaultDeclaration" && name === "default") {
|
|
243
355
|
return own(
|
|
244
|
-
() => _optionalChain([node, 'access',
|
|
356
|
+
() => _optionalChain([node, 'access', _28 => _28.declaration, 'optionalAccess', _29 => _29.type]) === "Identifier" ? local(node.declaration.name) : here("server")
|
|
245
357
|
);
|
|
246
358
|
}
|
|
247
359
|
}
|
|
@@ -252,21 +364,27 @@ function traceExport(file, name, depth) {
|
|
|
252
364
|
return void 0;
|
|
253
365
|
}
|
|
254
366
|
function traceFarmExport(file, name) {
|
|
255
|
-
return _optionalChain([traceExport, 'call',
|
|
367
|
+
return _optionalChain([traceExport, 'call', _30 => _30(file, name, 0), 'optionalAccess', _31 => _31.kind]);
|
|
256
368
|
}
|
|
257
369
|
function isFarmClientExport(file, name) {
|
|
258
370
|
return traceFarmExport(file, name) === "client";
|
|
259
371
|
}
|
|
260
372
|
function isFarmPackageClientExport(importer, specifier, name) {
|
|
261
|
-
|
|
262
|
-
|
|
373
|
+
return memoizeInFarmSourceSnapshot(
|
|
374
|
+
"package-client-export",
|
|
375
|
+
`${_path2.default.dirname(importer)}\0${specifier}\0${name}`,
|
|
376
|
+
() => {
|
|
377
|
+
const entry = resolveFarmPackageDefaultEntry(importer, specifier);
|
|
378
|
+
return !entry || traceFarmExport(entry, name) !== "server";
|
|
379
|
+
}
|
|
380
|
+
);
|
|
263
381
|
}
|
|
264
382
|
function parseCode(code, file) {
|
|
265
383
|
const extension = _path2.default.extname(file).slice(1);
|
|
266
384
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
|
|
267
385
|
try {
|
|
268
386
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
269
|
-
} catch (
|
|
387
|
+
} catch (e6) {
|
|
270
388
|
return null;
|
|
271
389
|
}
|
|
272
390
|
}
|
|
@@ -281,8 +399,8 @@ function namespaceMembers(program, local) {
|
|
|
281
399
|
}
|
|
282
400
|
const current = node;
|
|
283
401
|
if (typeof current.type !== "string") return;
|
|
284
|
-
if ((current.type === "Identifier" || current.type === "JSXIdentifier") && current.name === local && _optionalChain([parent, 'optionalAccess',
|
|
285
|
-
const property = (_optionalChain([parent, 'optionalAccess',
|
|
402
|
+
if ((current.type === "Identifier" || current.type === "JSXIdentifier") && current.name === local && _optionalChain([parent, 'optionalAccess', _32 => _32.type]) !== "ImportNamespaceSpecifier") {
|
|
403
|
+
const property = (_optionalChain([parent, 'optionalAccess', _33 => _33.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _34 => _34.type]) === "JSXMemberExpression") && parent.object === current && !parent.computed ? _optionalChain([parent, 'access', _35 => _35.property, 'optionalAccess', _36 => _36.name]) : void 0;
|
|
286
404
|
if (property) members.add(property);
|
|
287
405
|
else opaque = true;
|
|
288
406
|
return;
|
|
@@ -299,7 +417,7 @@ function findPackageImports(program, accept) {
|
|
|
299
417
|
const found = [];
|
|
300
418
|
for (const node of _nullishCoalesce(program.body, () => ( []))) {
|
|
301
419
|
if (node.type !== "ImportDeclaration" || node.importKind === "type") continue;
|
|
302
|
-
const specifier = _optionalChain([node, 'access',
|
|
420
|
+
const specifier = _optionalChain([node, 'access', _37 => _37.source, 'optionalAccess', _38 => _38.value]);
|
|
303
421
|
if (typeof specifier !== "string" || !accept(specifier)) continue;
|
|
304
422
|
const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
|
|
305
423
|
(entry2) => entry2.importKind !== "type"
|
|
@@ -338,7 +456,7 @@ function findFarmReactServerClientNames(code, file, specifier) {
|
|
|
338
456
|
const wanted = [
|
|
339
457
|
...entry.defaultLocal ? ["default"] : [],
|
|
340
458
|
...entry.named.map((binding) => binding.imported),
|
|
341
|
-
..._nullishCoalesce(_optionalChain([entry, 'access',
|
|
459
|
+
..._nullishCoalesce(_optionalChain([entry, 'access', _39 => _39.namespace, 'optionalAccess', _40 => _40.members]), () => ( []))
|
|
342
460
|
];
|
|
343
461
|
for (const name of wanted) if (isFarmClientExport(target, name)) names.add(name);
|
|
344
462
|
}
|
|
@@ -346,7 +464,7 @@ function findFarmReactServerClientNames(code, file, specifier) {
|
|
|
346
464
|
}
|
|
347
465
|
function clientModuleSource(node) {
|
|
348
466
|
if (node.importKind === "type" || node.exportKind === "type") return null;
|
|
349
|
-
const source = (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access',
|
|
467
|
+
const source = (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _41 => _41.source, 'optionalAccess', _42 => _42.value]);
|
|
350
468
|
return typeof source === "string" && source.startsWith(".") ? source : null;
|
|
351
469
|
}
|
|
352
470
|
function isClientModuleFile(file) {
|
|
@@ -366,8 +484,8 @@ function findFarmReactServerClientModules(code, file, specifier) {
|
|
|
366
484
|
const module = readModule(current);
|
|
367
485
|
if (!module || isClientModule(module)) return;
|
|
368
486
|
for (const node of _nullishCoalesce(module.body, () => ( []))) {
|
|
369
|
-
const source = _nullishCoalesce(clientModuleSource(node), () => ( (node.type === "ExportAllDeclaration" && typeof _optionalChain([node, 'access',
|
|
370
|
-
if (!_optionalChain([source, 'optionalAccess',
|
|
487
|
+
const source = _nullishCoalesce(clientModuleSource(node), () => ( (node.type === "ExportAllDeclaration" && typeof _optionalChain([node, 'access', _43 => _43.source, 'optionalAccess', _44 => _44.value]) === "string" ? node.source.value : null)));
|
|
488
|
+
if (!_optionalChain([source, 'optionalAccess', _45 => _45.startsWith, 'call', _46 => _46(".")])) continue;
|
|
371
489
|
const child = resolveRelative(current, source);
|
|
372
490
|
if (!child) continue;
|
|
373
491
|
if (isClientModuleFile(child)) {
|
|
@@ -379,11 +497,11 @@ function findFarmReactServerClientModules(code, file, specifier) {
|
|
|
379
497
|
const wanted = [
|
|
380
498
|
...entry.defaultLocal ? ["default"] : [],
|
|
381
499
|
...entry.named.map((binding) => binding.imported),
|
|
382
|
-
..._nullishCoalesce(_optionalChain([entry, 'access',
|
|
500
|
+
..._nullishCoalesce(_optionalChain([entry, 'access', _47 => _47.namespace, 'optionalAccess', _48 => _48.members]), () => ( []))
|
|
383
501
|
];
|
|
384
502
|
for (const name of wanted) {
|
|
385
503
|
const traced = traceExport(target, name, 0);
|
|
386
|
-
if (_optionalChain([traced, 'optionalAccess',
|
|
504
|
+
if (_optionalChain([traced, 'optionalAccess', _49 => _49.kind]) === "server") walk2(traced.file, 0);
|
|
387
505
|
}
|
|
388
506
|
}
|
|
389
507
|
return [...found].sort();
|
|
@@ -423,7 +541,7 @@ function rewriteFarmReactServerImports(options) {
|
|
|
423
541
|
let next = 0;
|
|
424
542
|
for (const entry of [...imports].sort((left, right) => right.start - left.start)) {
|
|
425
543
|
const target = targets.get(entry.specifier);
|
|
426
|
-
_optionalChain([options, 'access',
|
|
544
|
+
_optionalChain([options, 'access', _50 => _50.onServerFile, 'optionalCall', _51 => _51(target)]);
|
|
427
545
|
const server = JSON.stringify(target);
|
|
428
546
|
const lines = [];
|
|
429
547
|
const bind = (name, local) => {
|
|
@@ -460,7 +578,7 @@ function staticImportSources(program) {
|
|
|
460
578
|
continue;
|
|
461
579
|
}
|
|
462
580
|
if (node.importKind === "type" || node.exportKind === "type") continue;
|
|
463
|
-
if (typeof _optionalChain([node, 'access',
|
|
581
|
+
if (typeof _optionalChain([node, 'access', _52 => _52.source, 'optionalAccess', _53 => _53.value]) === "string") sources.push(node.source.value);
|
|
464
582
|
}
|
|
465
583
|
return sources;
|
|
466
584
|
}
|
|
@@ -507,7 +625,7 @@ function farmRelativeImportFiles(code, file) {
|
|
|
507
625
|
if (!program) return [];
|
|
508
626
|
const files = [];
|
|
509
627
|
for (const node of _nullishCoalesce(program.body, () => ( []))) {
|
|
510
|
-
const source = (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access',
|
|
628
|
+
const source = (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) && _optionalChain([node, 'access', _54 => _54.source, 'optionalAccess', _55 => _55.value]);
|
|
511
629
|
if (typeof source !== "string" || !source.startsWith(".")) continue;
|
|
512
630
|
const resolved = resolveRelative(file, source);
|
|
513
631
|
if (resolved) files.push(resolved);
|
|
@@ -525,7 +643,7 @@ function farmReactServerBuildReachesClientModules(importer, specifier, serverImp
|
|
|
525
643
|
if (!program) return false;
|
|
526
644
|
if (depth > 0 && isClientModule(program)) return true;
|
|
527
645
|
for (const node of _nullishCoalesce(program.body, () => ( []))) {
|
|
528
|
-
const source = (node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source || node.type === "ImportDeclaration") && _optionalChain([node, 'access',
|
|
646
|
+
const source = (node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source || node.type === "ImportDeclaration") && _optionalChain([node, 'access', _56 => _56.source, 'optionalAccess', _57 => _57.value]);
|
|
529
647
|
if (typeof source !== "string" || !source.startsWith(".")) continue;
|
|
530
648
|
const child = resolveRelative(file, source);
|
|
531
649
|
if (child && reaches(child, depth + 1)) return true;
|
|
@@ -549,7 +667,7 @@ function scanPackage(directory) {
|
|
|
549
667
|
let entries;
|
|
550
668
|
try {
|
|
551
669
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
552
|
-
} catch (
|
|
670
|
+
} catch (e7) {
|
|
553
671
|
continue;
|
|
554
672
|
}
|
|
555
673
|
for (const entry of entries) {
|
|
@@ -560,7 +678,7 @@ function scanPackage(directory) {
|
|
|
560
678
|
let code;
|
|
561
679
|
try {
|
|
562
680
|
code = _fs2.default.readFileSync(file, "utf8");
|
|
563
|
-
} catch (
|
|
681
|
+
} catch (e8) {
|
|
564
682
|
continue;
|
|
565
683
|
}
|
|
566
684
|
for (const match of code.matchAll(IMPORT_SPECIFIER)) scan.imports.add(match[1]);
|
|
@@ -583,7 +701,7 @@ function findFarmServerBundledPackage(importer, specifier) {
|
|
|
583
701
|
if (manifest.exports === void 0 && manifest.type !== "module" && typeof manifest.module === "string" && typeof manifest.main === "string" && _path2.default.resolve(directory, manifest.main) !== _path2.default.resolve(directory, manifest.module)) {
|
|
584
702
|
return { name: parsed.name, prebundle: isSelfContainedPackage(manifest, importer) };
|
|
585
703
|
}
|
|
586
|
-
} catch (
|
|
704
|
+
} catch (e9) {
|
|
587
705
|
return null;
|
|
588
706
|
}
|
|
589
707
|
return scanPackage(directory).stylesheets ? { name: parsed.name, prebundle: false } : null;
|
|
@@ -591,7 +709,7 @@ function findFarmServerBundledPackage(importer, specifier) {
|
|
|
591
709
|
function isSelfContainedPackage(manifest, importer) {
|
|
592
710
|
if (Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))).length > 0) return false;
|
|
593
711
|
return Object.keys(_nullishCoalesce(manifest.peerDependencies, () => ( {}))).every(
|
|
594
|
-
(peer) => _optionalChain([manifest, 'access',
|
|
712
|
+
(peer) => _optionalChain([manifest, 'access', _58 => _58.peerDependenciesMeta, 'optionalAccess', _59 => _59[peer], 'optionalAccess', _60 => _60.optional]) === true || findPackageDirectory(importer, peer) !== null
|
|
595
713
|
);
|
|
596
714
|
}
|
|
597
715
|
function findFarmPackageManifest(importer, specifier) {
|
|
@@ -603,11 +721,11 @@ function findFarmPackageManifest(importer, specifier) {
|
|
|
603
721
|
try {
|
|
604
722
|
const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(directory, "package.json"), "utf8"));
|
|
605
723
|
names = new Set(Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))));
|
|
606
|
-
} catch (
|
|
724
|
+
} catch (e10) {
|
|
607
725
|
return null;
|
|
608
726
|
}
|
|
609
727
|
const dependencies = [...scanPackage(directory).imports].filter((imported) => {
|
|
610
|
-
const name = _optionalChain([packageNameOf, 'call',
|
|
728
|
+
const name = _optionalChain([packageNameOf, 'call', _61 => _61(imported), 'optionalAccess', _62 => _62.name]);
|
|
611
729
|
return name !== void 0 && names.has(name);
|
|
612
730
|
});
|
|
613
731
|
return { name: parsed.name, dependencies: dependencies.sort() };
|
|
@@ -640,9 +758,9 @@ function listFarmModuleExports(entry) {
|
|
|
640
758
|
const name = exportedName(specifier.exported);
|
|
641
759
|
if (name) names.add(name);
|
|
642
760
|
}
|
|
643
|
-
if (_optionalChain([node, 'access',
|
|
644
|
-
for (const declarator of _nullishCoalesce(_optionalChain([node, 'access',
|
|
645
|
-
if (_optionalChain([declarator, 'access',
|
|
761
|
+
if (_optionalChain([node, 'access', _63 => _63.declaration, 'optionalAccess', _64 => _64.id, 'optionalAccess', _65 => _65.name])) names.add(node.declaration.id.name);
|
|
762
|
+
for (const declarator of _nullishCoalesce(_optionalChain([node, 'access', _66 => _66.declaration, 'optionalAccess', _67 => _67.declarations]), () => ( []))) {
|
|
763
|
+
if (_optionalChain([declarator, 'access', _68 => _68.id, 'optionalAccess', _69 => _69.type]) === "Identifier") names.add(declarator.id.name);
|
|
646
764
|
}
|
|
647
765
|
} else if (node.type === "ExportDefaultDeclaration") {
|
|
648
766
|
esm = true;
|
|
@@ -734,7 +852,7 @@ function resolveProgrammaticClientRoutes(options) {
|
|
|
734
852
|
const definedIn = /* @__PURE__ */ new Map();
|
|
735
853
|
for (const route of definitions) {
|
|
736
854
|
const source = _chunkE7QOEV5Zcjs.getProgrammaticRouteDefinitionSource.call(void 0, route);
|
|
737
|
-
const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess',
|
|
855
|
+
const callers = (_nullishCoalesce(_optionalChain([source, 'optionalAccess', _70 => _70.stacks]), () => ( []))).map((stack) => findRouteCallers(stack, modulesByFile));
|
|
738
856
|
for (const caller of callers.flat()) caller.routeSource = true;
|
|
739
857
|
definedIn.set(route, callers.flat());
|
|
740
858
|
if (!source || source.raw || (_nullishCoalesce(callers[0], () => ( []))).length === 0) untraced = true;
|
|
@@ -831,7 +949,7 @@ function resolveProgrammaticClientRoutes(options) {
|
|
|
831
949
|
return { routes, routeSourceFiles };
|
|
832
950
|
}
|
|
833
951
|
function createEvaluatedRouteGraph(server) {
|
|
834
|
-
const evaluated = _optionalChain([server, 'access',
|
|
952
|
+
const evaluated = _optionalChain([server, 'access', _71 => _71.environments, 'optionalAccess', _72 => _72.ssr, 'optionalAccess', _73 => _73.runner, 'optionalAccess', _74 => _74.evaluatedModules]);
|
|
835
953
|
if (!evaluated) return void 0;
|
|
836
954
|
const toGraphModule = (node) => ({
|
|
837
955
|
id: node.id,
|
|
@@ -955,7 +1073,7 @@ function isNodeBuiltinId(id) {
|
|
|
955
1073
|
return bare.startsWith("node:") || NODE_BUILTINS.has(bare);
|
|
956
1074
|
}
|
|
957
1075
|
function isProgrammaticRouteActionProxy(code) {
|
|
958
|
-
return Boolean(_optionalChain([code, 'optionalAccess',
|
|
1076
|
+
return Boolean(_optionalChain([code, 'optionalAccess', _75 => _75.includes, 'call', _76 => _76("__farmRouteActionTarget: true")]));
|
|
959
1077
|
}
|
|
960
1078
|
function collectGraph(graph, routesFile) {
|
|
961
1079
|
const modules = /* @__PURE__ */ new Map();
|
|
@@ -1049,7 +1167,7 @@ function holdsRouteDefinition(value, definitions) {
|
|
|
1049
1167
|
if (descriptor && "value" in descriptor) next(descriptor.value);
|
|
1050
1168
|
}
|
|
1051
1169
|
}
|
|
1052
|
-
} catch (
|
|
1170
|
+
} catch (e11) {
|
|
1053
1171
|
}
|
|
1054
1172
|
}
|
|
1055
1173
|
return false;
|
|
@@ -1142,7 +1260,7 @@ function readJsonString(text) {
|
|
|
1142
1260
|
try {
|
|
1143
1261
|
const value = JSON.parse(text);
|
|
1144
1262
|
return typeof value === "string" ? value : void 0;
|
|
1145
|
-
} catch (
|
|
1263
|
+
} catch (e12) {
|
|
1146
1264
|
return void 0;
|
|
1147
1265
|
}
|
|
1148
1266
|
}
|
|
@@ -1150,7 +1268,7 @@ function readJsonArray(text) {
|
|
|
1150
1268
|
try {
|
|
1151
1269
|
const value = JSON.parse(text);
|
|
1152
1270
|
return Array.isArray(value) ? value : void 0;
|
|
1153
|
-
} catch (
|
|
1271
|
+
} catch (e13) {
|
|
1154
1272
|
return void 0;
|
|
1155
1273
|
}
|
|
1156
1274
|
}
|
|
@@ -1160,13 +1278,13 @@ function readExports(namespace) {
|
|
|
1160
1278
|
let keys;
|
|
1161
1279
|
try {
|
|
1162
1280
|
keys = Object.keys(namespace);
|
|
1163
|
-
} catch (
|
|
1281
|
+
} catch (e14) {
|
|
1164
1282
|
return [];
|
|
1165
1283
|
}
|
|
1166
1284
|
for (const key of keys) {
|
|
1167
1285
|
try {
|
|
1168
1286
|
entries.push([key, namespace[key]]);
|
|
1169
|
-
} catch (
|
|
1287
|
+
} catch (e15) {
|
|
1170
1288
|
}
|
|
1171
1289
|
}
|
|
1172
1290
|
return entries;
|
|
@@ -1199,7 +1317,7 @@ function toModuleFile(file) {
|
|
|
1199
1317
|
if (file.startsWith("file://")) {
|
|
1200
1318
|
try {
|
|
1201
1319
|
return toPosixPath(_url.fileURLToPath.call(void 0, file));
|
|
1202
|
-
} catch (
|
|
1320
|
+
} catch (e16) {
|
|
1203
1321
|
return toPosixPath(file);
|
|
1204
1322
|
}
|
|
1205
1323
|
}
|
|
@@ -1218,15 +1336,18 @@ var _crypto = require('crypto');
|
|
|
1218
1336
|
|
|
1219
1337
|
var IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
|
1220
1338
|
var moduleName = (node) => {
|
|
1221
|
-
const name = _optionalChain([node, 'optionalAccess',
|
|
1339
|
+
const name = _optionalChain([node, 'optionalAccess', _77 => _77.type]) === "Identifier" ? node.name : _optionalChain([node, 'optionalAccess', _78 => _78.value]);
|
|
1222
1340
|
return typeof name === "string" ? name : null;
|
|
1223
1341
|
};
|
|
1224
1342
|
function parse(code, file) {
|
|
1225
1343
|
const extension = _path2.default.extname(file).slice(1);
|
|
1226
1344
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
|
|
1345
|
+
return memoizeInFarmSourceSnapshot(`ast:${lang}`, code, () => parseAs(code, lang));
|
|
1346
|
+
}
|
|
1347
|
+
function parseAs(code, lang) {
|
|
1227
1348
|
try {
|
|
1228
1349
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
1229
|
-
} catch (
|
|
1350
|
+
} catch (e17) {
|
|
1230
1351
|
return null;
|
|
1231
1352
|
}
|
|
1232
1353
|
}
|
|
@@ -1251,8 +1372,8 @@ function namespaceMembers2(program, local, declaration) {
|
|
|
1251
1372
|
if (opaque || node === declaration) return;
|
|
1252
1373
|
const name = node.type === "Identifier" || node.type === "JSXIdentifier" ? node.name : null;
|
|
1253
1374
|
if (name !== local) return;
|
|
1254
|
-
if (_optionalChain([parent, 'optionalAccess',
|
|
1255
|
-
const member = (_optionalChain([parent, 'optionalAccess',
|
|
1375
|
+
if (_optionalChain([parent, 'optionalAccess', _79 => _79.type]) === "ImportNamespaceSpecifier") return;
|
|
1376
|
+
const member = (_optionalChain([parent, 'optionalAccess', _80 => _80.type]) === "MemberExpression" || _optionalChain([parent, 'optionalAccess', _81 => _81.type]) === "JSXMemberExpression") && parent.object === node ? parent.property : null;
|
|
1256
1377
|
const property = member && !parent.computed && (member.type === "Identifier" || member.type === "JSXIdentifier") ? member.name : null;
|
|
1257
1378
|
if (property) members.add(property);
|
|
1258
1379
|
else opaque = true;
|
|
@@ -1268,7 +1389,7 @@ function findFarmPackageClientImports(code, file, isClientPackage) {
|
|
|
1268
1389
|
const reexport = node.type === "ExportNamedDeclaration" && node.source != null;
|
|
1269
1390
|
if (node.type !== "ImportDeclaration" && !reexport) continue;
|
|
1270
1391
|
if (node.importKind === "type" || node.exportKind === "type") continue;
|
|
1271
|
-
const specifier = _optionalChain([node, 'access',
|
|
1392
|
+
const specifier = _optionalChain([node, 'access', _82 => _82.source, 'optionalAccess', _83 => _83.value]);
|
|
1272
1393
|
if (typeof specifier !== "string" || specifier.startsWith(".") || specifier.startsWith("/"))
|
|
1273
1394
|
continue;
|
|
1274
1395
|
const specifiers = (_nullishCoalesce(node.specifiers, () => ( []))).filter(
|
|
@@ -1325,7 +1446,7 @@ function farmPackageClientImportExports(entry) {
|
|
|
1325
1446
|
return [
|
|
1326
1447
|
...entry.defaultLocal ? ["default"] : [],
|
|
1327
1448
|
...entry.named.map((binding) => binding.imported),
|
|
1328
|
-
..._nullishCoalesce(_optionalChain([entry, 'access',
|
|
1449
|
+
..._nullishCoalesce(_optionalChain([entry, 'access', _84 => _84.namespace, 'optionalAccess', _85 => _85.members]), () => ( []))
|
|
1329
1450
|
];
|
|
1330
1451
|
}
|
|
1331
1452
|
var FARM_CLIENT_REFERENCE_PRAGMA = "// @farm-client-reference";
|
|
@@ -1366,7 +1487,7 @@ function packageLookup(directory, packageName) {
|
|
|
1366
1487
|
const candidate = _path2.default.join(current, "node_modules", packageName);
|
|
1367
1488
|
try {
|
|
1368
1489
|
return { from: current, real: _fs2.default.realpathSync(candidate) };
|
|
1369
|
-
} catch (
|
|
1490
|
+
} catch (e18) {
|
|
1370
1491
|
}
|
|
1371
1492
|
}
|
|
1372
1493
|
if (_path2.default.dirname(current) === current) return null;
|
|
@@ -1377,10 +1498,10 @@ function referenceResolveFrom(root, specifier, importer) {
|
|
|
1377
1498
|
const own = packageLookup(_path2.default.dirname(importer), packageName);
|
|
1378
1499
|
if (!own) return null;
|
|
1379
1500
|
const app = packageLookup(_path2.default.join(root, ".farm", "client-references"), packageName);
|
|
1380
|
-
if (_optionalChain([app, 'optionalAccess',
|
|
1501
|
+
if (_optionalChain([app, 'optionalAccess', _86 => _86.real]) === own.real) return null;
|
|
1381
1502
|
try {
|
|
1382
1503
|
return _fs2.default.realpathSync(own.from);
|
|
1383
|
-
} catch (
|
|
1504
|
+
} catch (e19) {
|
|
1384
1505
|
return own.from;
|
|
1385
1506
|
}
|
|
1386
1507
|
}
|
|
@@ -1406,7 +1527,7 @@ function ensureFarmPackageClientReference(root, specifier, exportName, importer)
|
|
|
1406
1527
|
let current = null;
|
|
1407
1528
|
try {
|
|
1408
1529
|
current = _fs2.default.readFileSync(file, "utf8");
|
|
1409
|
-
} catch (
|
|
1530
|
+
} catch (e20) {
|
|
1410
1531
|
}
|
|
1411
1532
|
if (current !== source) {
|
|
1412
1533
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
@@ -1418,7 +1539,7 @@ function writeIfChanged(file, source) {
|
|
|
1418
1539
|
let current = null;
|
|
1419
1540
|
try {
|
|
1420
1541
|
current = _fs2.default.readFileSync(file, "utf8");
|
|
1421
|
-
} catch (
|
|
1542
|
+
} catch (e21) {
|
|
1422
1543
|
}
|
|
1423
1544
|
if (current !== source) {
|
|
1424
1545
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
@@ -1430,7 +1551,7 @@ function owningPackage(file) {
|
|
|
1430
1551
|
try {
|
|
1431
1552
|
const manifest = JSON.parse(_fs2.default.readFileSync(_path2.default.join(current, "package.json"), "utf8"));
|
|
1432
1553
|
if (typeof manifest.name === "string") return { directory: current, name: manifest.name };
|
|
1433
|
-
} catch (
|
|
1554
|
+
} catch (e22) {
|
|
1434
1555
|
}
|
|
1435
1556
|
if (_path2.default.dirname(current) === current) return null;
|
|
1436
1557
|
}
|
|
@@ -1501,7 +1622,7 @@ function rewriteFarmPackageClientImports(options) {
|
|
|
1501
1622
|
lines.push(`import { ${member} as ${local} } from ${reference(entry.specifier, member)};`);
|
|
1502
1623
|
fields.push(`${member}: ${local}`);
|
|
1503
1624
|
}
|
|
1504
|
-
if (_optionalChain([entry, 'access',
|
|
1625
|
+
if (_optionalChain([entry, 'access', _87 => _87.namespace, 'access', _88 => _88.values, 'optionalAccess', _89 => _89.length])) {
|
|
1505
1626
|
const local = `__farm_package_values_${next++}__`;
|
|
1506
1627
|
lines.push(`import * as ${local} from ${JSON.stringify(entry.specifier)};`);
|
|
1507
1628
|
for (const value of entry.namespace.values) fields.push(`${value}: ${local}.${value}`);
|
|
@@ -1560,7 +1681,7 @@ function stampPackagePath(target, kind) {
|
|
|
1560
1681
|
const stat = _fs2.default.statSync(target, { throwIfNoEntry: false });
|
|
1561
1682
|
if (!stat || (kind === "file" ? !stat.isFile() : !stat.isDirectory())) return void 0;
|
|
1562
1683
|
return [target, stat.size, stat.mtimeMs, stat.ctimeMs];
|
|
1563
|
-
} catch (
|
|
1684
|
+
} catch (e23) {
|
|
1564
1685
|
return void 0;
|
|
1565
1686
|
}
|
|
1566
1687
|
}
|
|
@@ -1596,7 +1717,7 @@ var PackageClientBoundaryCache = class {
|
|
|
1596
1717
|
else this.dirty = true;
|
|
1597
1718
|
}
|
|
1598
1719
|
}
|
|
1599
|
-
return _optionalChain([entries, 'optionalAccess',
|
|
1720
|
+
return _optionalChain([entries, 'optionalAccess', _90 => _90.find, 'call', _91 => _91(
|
|
1600
1721
|
(entry) => entry.stops.every((file) => visited.has(file)) && !entry.files.some((file) => visited.has(file))
|
|
1601
1722
|
)]);
|
|
1602
1723
|
}
|
|
@@ -1615,7 +1736,7 @@ var PackageClientBoundaryCache = class {
|
|
|
1615
1736
|
await _fs2.default.promises.mkdir(_path2.default.dirname(file), { recursive: true });
|
|
1616
1737
|
await _fs2.default.promises.writeFile(temporary, contents);
|
|
1617
1738
|
await _fs2.default.promises.rename(temporary, file);
|
|
1618
|
-
} catch (
|
|
1739
|
+
} catch (e24) {
|
|
1619
1740
|
await _fs2.default.promises.rm(temporary, { force: true }).catch(() => {
|
|
1620
1741
|
});
|
|
1621
1742
|
}
|
|
@@ -1630,10 +1751,10 @@ var PackageClientBoundaryCache = class {
|
|
|
1630
1751
|
_fs2.default.mkdirSync(_path2.default.dirname(file), { recursive: true });
|
|
1631
1752
|
_fs2.default.writeFileSync(temporary, contents);
|
|
1632
1753
|
_fs2.default.renameSync(temporary, file);
|
|
1633
|
-
} catch (
|
|
1754
|
+
} catch (e25) {
|
|
1634
1755
|
try {
|
|
1635
1756
|
_fs2.default.rmSync(temporary, { force: true });
|
|
1636
|
-
} catch (
|
|
1757
|
+
} catch (e26) {
|
|
1637
1758
|
}
|
|
1638
1759
|
}
|
|
1639
1760
|
}
|
|
@@ -1667,7 +1788,7 @@ var PackageClientBoundaryCache = class {
|
|
|
1667
1788
|
}
|
|
1668
1789
|
const contents = JSON.stringify({
|
|
1669
1790
|
schema: SCHEMA_VERSION,
|
|
1670
|
-
farm:
|
|
1791
|
+
farm: _chunkZDZUFD67cjs.FARM_VERSION,
|
|
1671
1792
|
paths,
|
|
1672
1793
|
entries
|
|
1673
1794
|
});
|
|
@@ -1704,10 +1825,10 @@ function readStoredCache(file) {
|
|
|
1704
1825
|
let value;
|
|
1705
1826
|
try {
|
|
1706
1827
|
value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
|
|
1707
|
-
} catch (
|
|
1828
|
+
} catch (e27) {
|
|
1708
1829
|
return null;
|
|
1709
1830
|
}
|
|
1710
|
-
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !==
|
|
1831
|
+
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkZDZUFD67cjs.FARM_VERSION) {
|
|
1711
1832
|
return null;
|
|
1712
1833
|
}
|
|
1713
1834
|
const { paths, entries } = value;
|
|
@@ -1718,7 +1839,7 @@ function readStoredCache(file) {
|
|
|
1718
1839
|
const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
|
|
1719
1840
|
if (usable.length > 0) valid[key] = usable;
|
|
1720
1841
|
}
|
|
1721
|
-
return { schema: SCHEMA_VERSION, farm:
|
|
1842
|
+
return { schema: SCHEMA_VERSION, farm: _chunkZDZUFD67cjs.FARM_VERSION, paths, entries: valid };
|
|
1722
1843
|
}
|
|
1723
1844
|
function isRecord(value) {
|
|
1724
1845
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -1757,7 +1878,7 @@ async function withPackageClientBoundaryCache(operation) {
|
|
|
1757
1878
|
}
|
|
1758
1879
|
}
|
|
1759
1880
|
function usePackageClientBoundaryCacheFile(file) {
|
|
1760
|
-
_optionalChain([getPackageClientBoundaryCache, 'call',
|
|
1881
|
+
_optionalChain([getPackageClientBoundaryCache, 'call', _92 => _92(), 'optionalAccess', _93 => _93.load, 'call', _94 => _94(file)]);
|
|
1761
1882
|
}
|
|
1762
1883
|
function resolvePackageClientBoundaryCacheFile(root, distDir) {
|
|
1763
1884
|
return _path2.default.resolve(root, distDir, "cache", "client-boundaries.json");
|
|
@@ -1768,17 +1889,47 @@ function runWithPackageClientBoundaryCacheFile(file, operation) {
|
|
|
1768
1889
|
cache2.load(file);
|
|
1769
1890
|
const result = getStorage().run(cache2, operation);
|
|
1770
1891
|
cache2.persistSync();
|
|
1892
|
+
latestDevCache = { file, cache: cache2 };
|
|
1771
1893
|
return result;
|
|
1772
1894
|
}
|
|
1895
|
+
var latestDevCache;
|
|
1896
|
+
function runWithLatestPackageClientBoundaryCache(file, operation) {
|
|
1897
|
+
if (getPackageClientBoundaryCache()) return operation();
|
|
1898
|
+
if (_optionalChain([latestDevCache, 'optionalAccess', _95 => _95.file]) !== file) {
|
|
1899
|
+
const cache2 = new PackageClientBoundaryCache();
|
|
1900
|
+
cache2.load(file);
|
|
1901
|
+
latestDevCache = { file, cache: cache2 };
|
|
1902
|
+
}
|
|
1903
|
+
return getStorage().run(latestDevCache.cache, operation);
|
|
1904
|
+
}
|
|
1905
|
+
function dropLatestPackageClientBoundaryCache() {
|
|
1906
|
+
latestDevCache = void 0;
|
|
1907
|
+
}
|
|
1773
1908
|
|
|
1774
1909
|
// src/utils/client-component.ts
|
|
1775
1910
|
function readIfExists(filePath) {
|
|
1911
|
+
if (filePath.replace(/\\/g, "/").includes(FARM_CLIENT_REFERENCE_DIRECTORY)) {
|
|
1912
|
+
return readSourceFile(filePath);
|
|
1913
|
+
}
|
|
1914
|
+
return memoizeInFarmSourceSnapshot(
|
|
1915
|
+
"source",
|
|
1916
|
+
filePath,
|
|
1917
|
+
() => readSourceFile(filePath),
|
|
1918
|
+
(content) => content !== null
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1921
|
+
function readSourceFile(filePath) {
|
|
1922
|
+
const content = readSourceFileContents(filePath);
|
|
1923
|
+
if (content !== null) noteFarmSourceRead(filePath);
|
|
1924
|
+
return content;
|
|
1925
|
+
}
|
|
1926
|
+
function readSourceFileContents(filePath) {
|
|
1776
1927
|
try {
|
|
1777
1928
|
if (!filePath || !_fs2.default.existsSync(filePath)) {
|
|
1778
1929
|
return null;
|
|
1779
1930
|
}
|
|
1780
1931
|
return _fs2.default.readFileSync(filePath, "utf-8");
|
|
1781
|
-
} catch (
|
|
1932
|
+
} catch (e28) {
|
|
1782
1933
|
return null;
|
|
1783
1934
|
}
|
|
1784
1935
|
}
|
|
@@ -1791,7 +1942,7 @@ function resolveModuleSourcePath(modulePath, root) {
|
|
|
1791
1942
|
if (modulePath.startsWith("file://")) {
|
|
1792
1943
|
try {
|
|
1793
1944
|
candidates.add(_url.fileURLToPath.call(void 0, modulePath));
|
|
1794
|
-
} catch (
|
|
1945
|
+
} catch (e29) {
|
|
1795
1946
|
}
|
|
1796
1947
|
}
|
|
1797
1948
|
if (modulePath.startsWith("/@fs/")) {
|
|
@@ -1804,7 +1955,7 @@ function resolveModuleSourcePath(modulePath, root) {
|
|
|
1804
1955
|
candidates.add(_path2.default.join(root, normalized));
|
|
1805
1956
|
candidates.add(_path2.default.resolve(root, normalized));
|
|
1806
1957
|
}
|
|
1807
|
-
if (_optionalChain([withoutQuery, 'optionalAccess',
|
|
1958
|
+
if (_optionalChain([withoutQuery, 'optionalAccess', _96 => _96.startsWith, 'call', _97 => _97("/src/")])) {
|
|
1808
1959
|
const normalized = withoutQuery.replace(/^\/+/, "");
|
|
1809
1960
|
candidates.add(_path2.default.join(process.cwd(), normalized));
|
|
1810
1961
|
candidates.add(_path2.default.resolve(process.cwd(), normalized));
|
|
@@ -1883,7 +2034,7 @@ function hasHydrateExport(content) {
|
|
|
1883
2034
|
for (const match of content.matchAll(/\bexport\s*\{([^}]*)\}/g)) {
|
|
1884
2035
|
for (const specifier of match[1].split(",")) {
|
|
1885
2036
|
const parts = specifier.trim().split(/\s+as\s+/);
|
|
1886
|
-
const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess',
|
|
2037
|
+
const exportedName2 = _optionalChain([(_nullishCoalesce(parts[1], () => ( parts[0]))), 'optionalAccess', _98 => _98.trim, 'call', _99 => _99()]);
|
|
1887
2038
|
if (exportedName2 === "hydrate") {
|
|
1888
2039
|
return true;
|
|
1889
2040
|
}
|
|
@@ -1963,6 +2114,9 @@ function skipRegularExpression(content, startIndex) {
|
|
|
1963
2114
|
var tokenizedModules = /* @__PURE__ */ new Map();
|
|
1964
2115
|
var TOKENIZED_MODULE_CACHE_SIZE = 32;
|
|
1965
2116
|
function tokenizeModuleSource(content) {
|
|
2117
|
+
return memoizeInFarmSourceSnapshot("tokens", content, () => tokenizeRecentModuleSource(content));
|
|
2118
|
+
}
|
|
2119
|
+
function tokenizeRecentModuleSource(content) {
|
|
1966
2120
|
const cached = tokenizedModules.get(content);
|
|
1967
2121
|
if (cached) return cached;
|
|
1968
2122
|
const tokens = scanModuleSourceTokens(content);
|
|
@@ -2073,7 +2227,7 @@ function isIslandExportStart(tokens, index) {
|
|
|
2073
2227
|
const token = tokens[index];
|
|
2074
2228
|
const previous = tokens[index - 1];
|
|
2075
2229
|
const startsStatement = !previous || previous.value === ";" || previous.value === "{" || previous.value === "}" || token.line > previous.line;
|
|
2076
|
-
return startsStatement && token.value === "export" && _optionalChain([tokens, 'access',
|
|
2230
|
+
return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _100 => _100[index + 1], 'optionalAccess', _101 => _101.value]) === "const" && _optionalChain([tokens, 'access', _102 => _102[index + 2], 'optionalAccess', _103 => _103.value]) === "island";
|
|
2077
2231
|
}
|
|
2078
2232
|
function getIslandStrategyExport(content) {
|
|
2079
2233
|
if (!content) return null;
|
|
@@ -2081,15 +2235,15 @@ function getIslandStrategyExport(content) {
|
|
|
2081
2235
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2082
2236
|
if (!isIslandExportStart(tokens, index)) continue;
|
|
2083
2237
|
let valueIndex = index + 3;
|
|
2084
|
-
if (_optionalChain([tokens, 'access',
|
|
2238
|
+
if (_optionalChain([tokens, 'access', _104 => _104[valueIndex], 'optionalAccess', _105 => _105.value]) === ":") {
|
|
2085
2239
|
while (valueIndex < tokens.length && tokens[valueIndex].value !== "=") valueIndex++;
|
|
2086
2240
|
}
|
|
2087
|
-
if (_optionalChain([tokens, 'access',
|
|
2241
|
+
if (_optionalChain([tokens, 'access', _106 => _106[valueIndex], 'optionalAccess', _107 => _107.value]) !== "=") break;
|
|
2088
2242
|
valueIndex++;
|
|
2089
2243
|
const literal = tokens[valueIndex];
|
|
2090
2244
|
if (!literal || literal.kind !== "string" || !_chunk7KJJ4SBScjs.isFarmIslandStrategy.call(void 0, literal.value)) break;
|
|
2091
2245
|
let trailingIndex = valueIndex + 1;
|
|
2092
|
-
if (_optionalChain([tokens, 'access',
|
|
2246
|
+
if (_optionalChain([tokens, 'access', _108 => _108[trailingIndex], 'optionalAccess', _109 => _109.value]) === "as" && _optionalChain([tokens, 'access', _110 => _110[trailingIndex + 1], 'optionalAccess', _111 => _111.value]) === "const") {
|
|
2093
2247
|
trailingIndex += 2;
|
|
2094
2248
|
}
|
|
2095
2249
|
const trailing = tokens[trailingIndex];
|
|
@@ -2115,13 +2269,13 @@ function hasAsyncDefaultExport(content) {
|
|
|
2115
2269
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2116
2270
|
const token = tokens[index];
|
|
2117
2271
|
if (token.kind !== "identifier" || token.value !== "export") continue;
|
|
2118
|
-
if (_optionalChain([tokens, 'access',
|
|
2119
|
-
if (_optionalChain([tokens, 'access',
|
|
2272
|
+
if (_optionalChain([tokens, 'access', _112 => _112[index - 1], 'optionalAccess', _113 => _113.value]) === ".") continue;
|
|
2273
|
+
if (_optionalChain([tokens, 'access', _114 => _114[index + 1], 'optionalAccess', _115 => _115.value]) !== "default") continue;
|
|
2120
2274
|
const exported = tokens[index + 2];
|
|
2121
2275
|
if (exported.kind === "identifier" && exported.value === "async") {
|
|
2122
2276
|
return true;
|
|
2123
2277
|
}
|
|
2124
|
-
if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access',
|
|
2278
|
+
if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _116 => _116[index + 3], 'optionalAccess', _117 => _117.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
|
|
2125
2279
|
return true;
|
|
2126
2280
|
}
|
|
2127
2281
|
}
|
|
@@ -2129,10 +2283,10 @@ function hasAsyncDefaultExport(content) {
|
|
|
2129
2283
|
}
|
|
2130
2284
|
function isAsyncLocalDeclaration(tokens, name) {
|
|
2131
2285
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2132
|
-
if (tokens[index].value === "async" && _optionalChain([tokens, 'access',
|
|
2286
|
+
if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _118 => _118[index + 1], 'optionalAccess', _119 => _119.value]) === "function" && _optionalChain([tokens, 'access', _120 => _120[index + 2], 'optionalAccess', _121 => _121.value]) === name) {
|
|
2133
2287
|
return true;
|
|
2134
2288
|
}
|
|
2135
|
-
if (tokens[index].value === name && _optionalChain([tokens, 'access',
|
|
2289
|
+
if (tokens[index].value === name && _optionalChain([tokens, 'access', _122 => _122[index + 1], 'optionalAccess', _123 => _123.value]) === "=" && _optionalChain([tokens, 'access', _124 => _124[index + 2], 'optionalAccess', _125 => _125.value]) === "async") {
|
|
2136
2290
|
return true;
|
|
2137
2291
|
}
|
|
2138
2292
|
}
|
|
@@ -2333,7 +2487,7 @@ function planClientModuleHydration(modulePath, root, mode, options) {
|
|
|
2333
2487
|
return plan;
|
|
2334
2488
|
}
|
|
2335
2489
|
function usesFarmServerTree(plan) {
|
|
2336
|
-
return _optionalChain([plan, 'optionalAccess',
|
|
2490
|
+
return _optionalChain([plan, 'optionalAccess', _126 => _126.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0;
|
|
2337
2491
|
}
|
|
2338
2492
|
function getMarkdownPageHydrationPlan(componentsModulePath, root, mode = "off", options = {}) {
|
|
2339
2493
|
const plan = {
|
|
@@ -2447,6 +2601,23 @@ function isIsolatableClientBoundarySource(content) {
|
|
|
2447
2601
|
if (/\bexport\s*\*/.test(content)) return false;
|
|
2448
2602
|
return /\bexport\s+default\s+(?!(?:type|interface)\b)/.test(content) || /\bexport\s+(?:async\s+)?function\s+[A-Z][$\w]*/.test(content) || /\bexport\s+(?:const|let|var|class)\s+[A-Z][$\w]*/.test(content) || exportListNames(content).some((name) => name === "default" || /^[A-Z]/.test(name));
|
|
2449
2603
|
}
|
|
2604
|
+
function clientModulePlanSignature(content) {
|
|
2605
|
+
if (!content || !hasUseClientDirective(content)) return null;
|
|
2606
|
+
try {
|
|
2607
|
+
return JSON.stringify([
|
|
2608
|
+
getIslandStrategyExport(content),
|
|
2609
|
+
hasHydrateExport(content),
|
|
2610
|
+
isIsolatableClientBoundarySource(content),
|
|
2611
|
+
getImportSpecifiers(content).sort()
|
|
2612
|
+
]);
|
|
2613
|
+
} catch (e30) {
|
|
2614
|
+
return null;
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
function isFarmClientModulePlanUnchanged(file, previous) {
|
|
2618
|
+
const signature = clientModulePlanSignature(previous);
|
|
2619
|
+
return signature !== null && signature === clientModulePlanSignature(readSourceFileContents(file));
|
|
2620
|
+
}
|
|
2450
2621
|
function exportListNames(content) {
|
|
2451
2622
|
const names = [];
|
|
2452
2623
|
for (const match of content.matchAll(/\bexport\s*(type\s*)?\{([^}]*)\}/g)) {
|
|
@@ -2464,7 +2635,7 @@ function getStaticImportBindings(content) {
|
|
|
2464
2635
|
if (!content) return bindings;
|
|
2465
2636
|
const tokens = tokenizeModuleSource(content);
|
|
2466
2637
|
for (let index = 0; index < tokens.length; index++) {
|
|
2467
|
-
if (tokens[index].value !== "import" || _optionalChain([tokens, 'access',
|
|
2638
|
+
if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _127 => _127[index - 1], 'optionalAccess', _128 => _128.value]) === ".") continue;
|
|
2468
2639
|
const first = tokens[index + 1];
|
|
2469
2640
|
if (!first || first.value === "type" || first.value === "(" || first.kind === "string") {
|
|
2470
2641
|
continue;
|
|
@@ -2472,7 +2643,7 @@ function getStaticImportBindings(content) {
|
|
|
2472
2643
|
let fromIndex = -1;
|
|
2473
2644
|
for (let cursor = index + 1; cursor < tokens.length; cursor++) {
|
|
2474
2645
|
if (tokens[cursor].value === ";") break;
|
|
2475
|
-
if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access',
|
|
2646
|
+
if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _129 => _129[cursor + 1], 'optionalAccess', _130 => _130.kind]) === "string") {
|
|
2476
2647
|
fromIndex = cursor;
|
|
2477
2648
|
break;
|
|
2478
2649
|
}
|
|
@@ -2481,13 +2652,13 @@ function getStaticImportBindings(content) {
|
|
|
2481
2652
|
const specifier = tokens[fromIndex + 1].value;
|
|
2482
2653
|
const clause = tokens.slice(index + 1, fromIndex);
|
|
2483
2654
|
const localNames = [];
|
|
2484
|
-
if (_optionalChain([clause, 'access',
|
|
2655
|
+
if (_optionalChain([clause, 'access', _131 => _131[0], 'optionalAccess', _132 => _132.kind]) === "identifier" && clause[0].value !== "type") {
|
|
2485
2656
|
localNames.push(clause[0].value);
|
|
2486
2657
|
}
|
|
2487
2658
|
const namespaceAs = clause.findIndex(
|
|
2488
|
-
(token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access',
|
|
2659
|
+
(token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _133 => _133[clauseIndex + 1], 'optionalAccess', _134 => _134.value]) === "as"
|
|
2489
2660
|
);
|
|
2490
|
-
if (namespaceAs !== -1 && _optionalChain([clause, 'access',
|
|
2661
|
+
if (namespaceAs !== -1 && _optionalChain([clause, 'access', _135 => _135[namespaceAs + 2], 'optionalAccess', _136 => _136.kind]) === "identifier") {
|
|
2491
2662
|
localNames.push(clause[namespaceAs + 2].value);
|
|
2492
2663
|
}
|
|
2493
2664
|
const openingBrace = clause.findIndex((token) => token.value === "{");
|
|
@@ -2497,11 +2668,11 @@ function getStaticImportBindings(content) {
|
|
|
2497
2668
|
if (openingBrace !== -1 && closingBrace !== -1) {
|
|
2498
2669
|
let entryStart = openingBrace + 1;
|
|
2499
2670
|
for (let cursor = entryStart; cursor <= closingBrace; cursor++) {
|
|
2500
|
-
if (cursor !== closingBrace && _optionalChain([clause, 'access',
|
|
2671
|
+
if (cursor !== closingBrace && _optionalChain([clause, 'access', _137 => _137[cursor], 'optionalAccess', _138 => _138.value]) !== ",") continue;
|
|
2501
2672
|
const entry = clause.slice(entryStart, cursor).filter((token) => token.value !== "type");
|
|
2502
2673
|
const asIndex = entry.findIndex((token) => token.value === "as");
|
|
2503
2674
|
const local = asIndex === -1 ? entry[0] : entry[asIndex + 1];
|
|
2504
|
-
if (_optionalChain([local, 'optionalAccess',
|
|
2675
|
+
if (_optionalChain([local, 'optionalAccess', _139 => _139.kind]) === "identifier") localNames.push(local.value);
|
|
2505
2676
|
entryStart = cursor + 1;
|
|
2506
2677
|
}
|
|
2507
2678
|
}
|
|
@@ -2538,14 +2709,14 @@ function findParserSensitiveJsxContainer(content, localBindings) {
|
|
|
2538
2709
|
const open = [];
|
|
2539
2710
|
const isSelfClosing = (openingIndex) => {
|
|
2540
2711
|
for (let index = openingIndex; index < tokens.length; index++) {
|
|
2541
|
-
if (tokens[index].value === ">") return _optionalChain([tokens, 'access',
|
|
2712
|
+
if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _140 => _140[index - 1], 'optionalAccess', _141 => _141.value]) === "/";
|
|
2542
2713
|
}
|
|
2543
2714
|
return false;
|
|
2544
2715
|
};
|
|
2545
2716
|
for (let index = 0; index < tokens.length - 1; index++) {
|
|
2546
2717
|
if (tokens[index].value !== "<") continue;
|
|
2547
2718
|
if (tokens[index + 1].value === "/") {
|
|
2548
|
-
const closing = _optionalChain([tokens, 'access',
|
|
2719
|
+
const closing = _optionalChain([tokens, 'access', _142 => _142[index + 2], 'optionalAccess', _143 => _143.value]);
|
|
2549
2720
|
const at = closing ? open.lastIndexOf(closing) : -1;
|
|
2550
2721
|
if (at !== -1) open.length = at;
|
|
2551
2722
|
continue;
|
|
@@ -2588,7 +2759,7 @@ function findMatchingToken(tokens, openingIndex, opening, closing) {
|
|
|
2588
2759
|
}
|
|
2589
2760
|
function containsClientJsx(tokens, start, end, clientBindings) {
|
|
2590
2761
|
for (let index = start; index < end; index++) {
|
|
2591
|
-
if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access',
|
|
2762
|
+
if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _144 => _144[index + 1], 'optionalAccess', _145 => _145.value]))) return true;
|
|
2592
2763
|
}
|
|
2593
2764
|
return false;
|
|
2594
2765
|
}
|
|
@@ -2626,7 +2797,7 @@ function getClientRenderingHelpers(tokens, clientBindings) {
|
|
|
2626
2797
|
let helperName;
|
|
2627
2798
|
let bodyStart = -1;
|
|
2628
2799
|
let bodyEnd = -1;
|
|
2629
|
-
if (tokens[index].value === "function" && _optionalChain([tokens, 'access',
|
|
2800
|
+
if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _146 => _146[index + 1], 'optionalAccess', _147 => _147.kind]) === "identifier") {
|
|
2630
2801
|
helperName = tokens[index + 1].value;
|
|
2631
2802
|
const parametersStart = tokens.findIndex(
|
|
2632
2803
|
(token, tokenIndex) => tokenIndex > index + 1 && token.value === "("
|
|
@@ -2636,21 +2807,21 @@ function getClientRenderingHelpers(tokens, clientBindings) {
|
|
|
2636
2807
|
(token, tokenIndex) => tokenIndex > parametersEnd && token.value === "{"
|
|
2637
2808
|
);
|
|
2638
2809
|
if (bodyStart !== -1) bodyEnd = findMatchingToken(tokens, bodyStart, "{", "}");
|
|
2639
|
-
} else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access',
|
|
2810
|
+
} else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _148 => _148[index + 1], 'optionalAccess', _149 => _149.kind]) === "identifier") {
|
|
2640
2811
|
helperName = tokens[index + 1].value;
|
|
2641
2812
|
let assignmentIndex = -1;
|
|
2642
2813
|
let arrowIndex = -1;
|
|
2643
2814
|
for (let cursor = index + 2; cursor < tokens.length; cursor++) {
|
|
2644
2815
|
if (tokens[cursor].value === ";") break;
|
|
2645
2816
|
if (assignmentIndex === -1 && tokens[cursor].value === "=") assignmentIndex = cursor;
|
|
2646
|
-
if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access',
|
|
2817
|
+
if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _150 => _150[cursor + 1], 'optionalAccess', _151 => _151.value]) === ">") {
|
|
2647
2818
|
arrowIndex = cursor;
|
|
2648
2819
|
break;
|
|
2649
2820
|
}
|
|
2650
2821
|
}
|
|
2651
2822
|
if (arrowIndex !== -1) {
|
|
2652
2823
|
bodyStart = arrowIndex + 2;
|
|
2653
|
-
bodyEnd = _optionalChain([tokens, 'access',
|
|
2824
|
+
bodyEnd = _optionalChain([tokens, 'access', _152 => _152[bodyStart], 'optionalAccess', _153 => _153.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
|
|
2654
2825
|
} else if (assignmentIndex !== -1) {
|
|
2655
2826
|
bodyStart = assignmentIndex + 1;
|
|
2656
2827
|
bodyEnd = findStatementEnd(tokens, bodyStart);
|
|
@@ -2690,14 +2861,14 @@ function passesElementValuedProps(content, localBindings) {
|
|
|
2690
2861
|
else if (value === "}") braceDepth--;
|
|
2691
2862
|
else if (value === "<" && braceDepth > 0) return true;
|
|
2692
2863
|
else if (value === ">" && braceDepth === 0) {
|
|
2693
|
-
selfClosing = _optionalChain([tokens, 'access',
|
|
2864
|
+
selfClosing = _optionalChain([tokens, 'access', _154 => _154[cursor - 1], 'optionalAccess', _155 => _155.value]) === "/";
|
|
2694
2865
|
break;
|
|
2695
2866
|
}
|
|
2696
2867
|
}
|
|
2697
2868
|
if (selfClosing || cursor >= tokens.length) continue;
|
|
2698
2869
|
for (let child = cursor + 1; child < tokens.length; child++) {
|
|
2699
2870
|
if (tokens[child].value !== "<") continue;
|
|
2700
|
-
const closesBoundary = _optionalChain([tokens, 'access',
|
|
2871
|
+
const closesBoundary = _optionalChain([tokens, 'access', _156 => _156[child + 1], 'optionalAccess', _157 => _157.value]) === "/" && _optionalChain([tokens, 'access', _158 => _158[child + 2], 'optionalAccess', _159 => _159.value]) === name;
|
|
2701
2872
|
if (!closesBoundary) return true;
|
|
2702
2873
|
break;
|
|
2703
2874
|
}
|
|
@@ -2719,7 +2890,7 @@ function rendersOnlyLeafElements(content, localBindings) {
|
|
|
2719
2890
|
else if (value === "<" && braceDepth > 0) return false;
|
|
2720
2891
|
else if (value === ">" && braceDepth === 0) break;
|
|
2721
2892
|
}
|
|
2722
|
-
if (cursor >= tokens.length || _optionalChain([tokens, 'access',
|
|
2893
|
+
if (cursor >= tokens.length || _optionalChain([tokens, 'access', _160 => _160[cursor - 1], 'optionalAccess', _161 => _161.value]) !== "/") return false;
|
|
2723
2894
|
}
|
|
2724
2895
|
return true;
|
|
2725
2896
|
}
|
|
@@ -2731,9 +2902,9 @@ function hasDynamicJsxCardinality(content, localBindings) {
|
|
|
2731
2902
|
const containsDynamicRenderer = (start, end) => containsClientJsx(tokens, start, end, clientBindings) || tokens.slice(start, end).some((token) => renderingHelpers.has(token.value));
|
|
2732
2903
|
for (let index = 0; index < tokens.length; index++) {
|
|
2733
2904
|
let callStart = -1;
|
|
2734
|
-
if (tokens[index].value === "." && (_optionalChain([tokens, 'access',
|
|
2905
|
+
if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _162 => _162[index + 1], 'optionalAccess', _163 => _163.value]) === "map" || _optionalChain([tokens, 'access', _164 => _164[index + 1], 'optionalAccess', _165 => _165.value]) === "flatMap") && _optionalChain([tokens, 'access', _166 => _166[index + 2], 'optionalAccess', _167 => _167.value]) === "(") {
|
|
2735
2906
|
callStart = index + 2;
|
|
2736
|
-
} else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access',
|
|
2907
|
+
} else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _168 => _168[index + 1], 'optionalAccess', _169 => _169.value]) === "." && _optionalChain([tokens, 'access', _170 => _170[index + 2], 'optionalAccess', _171 => _171.value]) === "from" && _optionalChain([tokens, 'access', _172 => _172[index + 3], 'optionalAccess', _173 => _173.value]) === "(") {
|
|
2737
2908
|
callStart = index + 3;
|
|
2738
2909
|
}
|
|
2739
2910
|
if (callStart !== -1) {
|
|
@@ -2742,10 +2913,10 @@ function hasDynamicJsxCardinality(content, localBindings) {
|
|
|
2742
2913
|
index = callEnd;
|
|
2743
2914
|
continue;
|
|
2744
2915
|
}
|
|
2745
|
-
if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access',
|
|
2916
|
+
if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _174 => _174[index + 1], 'optionalAccess', _175 => _175.value]) === "(") {
|
|
2746
2917
|
const conditionEnd = findMatchingToken(tokens, index + 1, "(", ")");
|
|
2747
2918
|
const bodyStart = conditionEnd + 1;
|
|
2748
|
-
const bodyEnd = _optionalChain([tokens, 'access',
|
|
2919
|
+
const bodyEnd = _optionalChain([tokens, 'access', _176 => _176[bodyStart], 'optionalAccess', _177 => _177.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
|
|
2749
2920
|
if (containsDynamicRenderer(bodyStart, bodyEnd === -1 ? tokens.length : bodyEnd)) return true;
|
|
2750
2921
|
}
|
|
2751
2922
|
}
|
|
@@ -2951,7 +3122,7 @@ function farmWorkspaceServerEntry(entry) {
|
|
|
2951
3122
|
function realpathOrSelf(file) {
|
|
2952
3123
|
try {
|
|
2953
3124
|
return _fs2.default.realpathSync(file);
|
|
2954
|
-
} catch (
|
|
3125
|
+
} catch (e31) {
|
|
2955
3126
|
return file;
|
|
2956
3127
|
}
|
|
2957
3128
|
}
|
|
@@ -2968,17 +3139,20 @@ function inspectPackageClientBoundary(resolvedPath, root, visited) {
|
|
|
2968
3139
|
const key = `${_nullishCoalesce(root, () => ( ""))}\0${resolvedPath}`;
|
|
2969
3140
|
const cached = cache2.find(key, visited);
|
|
2970
3141
|
if (cached) {
|
|
2971
|
-
for (const file of cached.files)
|
|
3142
|
+
for (const file of cached.files) {
|
|
3143
|
+
visited.add(file);
|
|
3144
|
+
noteFarmSourceRead(file);
|
|
3145
|
+
}
|
|
2972
3146
|
return { ...cached.result };
|
|
2973
3147
|
}
|
|
2974
|
-
const
|
|
2975
|
-
const result = traversePackageClientBoundary(resolvedPath, root, visited,
|
|
2976
|
-
cache2.add(key,
|
|
3148
|
+
const trace2 = new PackageInspectionTrace();
|
|
3149
|
+
const result = traversePackageClientBoundary(resolvedPath, root, visited, trace2);
|
|
3150
|
+
cache2.add(key, trace2.toEntry(result));
|
|
2977
3151
|
return result;
|
|
2978
3152
|
}
|
|
2979
|
-
function traversePackageClientBoundary(resolvedPath, root, visited,
|
|
3153
|
+
function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
|
|
2980
3154
|
if (!resolvedPath || visited.has(resolvedPath)) {
|
|
2981
|
-
if (resolvedPath) _optionalChain([
|
|
3155
|
+
if (resolvedPath) _optionalChain([trace2, 'optionalAccess', _178 => _178.stop, 'call', _179 => _179(resolvedPath)]);
|
|
2982
3156
|
return {
|
|
2983
3157
|
isClientComponent: false,
|
|
2984
3158
|
shouldHydrate: false,
|
|
@@ -2986,7 +3160,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace) {
|
|
|
2986
3160
|
};
|
|
2987
3161
|
}
|
|
2988
3162
|
visited.add(resolvedPath);
|
|
2989
|
-
_optionalChain([
|
|
3163
|
+
_optionalChain([trace2, 'optionalAccess', _180 => _180.visit, 'call', _181 => _181(resolvedPath)]);
|
|
2990
3164
|
const content = readIfExists(resolvedPath);
|
|
2991
3165
|
const parsed = parseClientModuleMetadata(content, false);
|
|
2992
3166
|
let importsClientBoundary = false;
|
|
@@ -3005,7 +3179,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace) {
|
|
|
3005
3179
|
specifier,
|
|
3006
3180
|
root
|
|
3007
3181
|
);
|
|
3008
|
-
const importedMetadata = traversePackageClientBoundary(importedPath, root, visited,
|
|
3182
|
+
const importedMetadata = traversePackageClientBoundary(importedPath, root, visited, trace2);
|
|
3009
3183
|
if (!importedMetadata.shouldHydrate) continue;
|
|
3010
3184
|
importsClientBoundary = true;
|
|
3011
3185
|
if (importedIslandStrategy === null) {
|
|
@@ -3021,8 +3195,16 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace) {
|
|
|
3021
3195
|
islandStrategy: shouldHydrate ? _nullishCoalesce(_nullishCoalesce(parsed.islandStrategy, () => ( importedIslandStrategy)), () => ( "load")) : null
|
|
3022
3196
|
};
|
|
3023
3197
|
}
|
|
3024
|
-
function getImportSpecifiers(content,
|
|
3198
|
+
function getImportSpecifiers(content, options = {}) {
|
|
3025
3199
|
if (!content) return [];
|
|
3200
|
+
const specifiers = memoizeInFarmSourceSnapshot(
|
|
3201
|
+
`specifiers:${options.reexportsOnly === true}:${options.dynamic === true}`,
|
|
3202
|
+
content,
|
|
3203
|
+
() => scanImportSpecifiers(content, options)
|
|
3204
|
+
);
|
|
3205
|
+
return [...specifiers];
|
|
3206
|
+
}
|
|
3207
|
+
function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false }) {
|
|
3026
3208
|
const tokens = tokenizeModuleSource(content);
|
|
3027
3209
|
const matches = /* @__PURE__ */ new Set();
|
|
3028
3210
|
let braceDepth = 0;
|
|
@@ -3036,7 +3218,7 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
|
|
|
3036
3218
|
braceDepth = Math.max(0, braceDepth - 1);
|
|
3037
3219
|
continue;
|
|
3038
3220
|
}
|
|
3039
|
-
if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access',
|
|
3221
|
+
if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _182 => _182[index - 1], 'optionalAccess', _183 => _183.value]) !== "." && _optionalChain([tokens, 'access', _184 => _184[index + 1], 'optionalAccess', _185 => _185.value]) === "(" && _optionalChain([tokens, 'access', _186 => _186[index + 2], 'optionalAccess', _187 => _187.kind]) === "string") {
|
|
3040
3222
|
matches.add(tokens[index + 2].value);
|
|
3041
3223
|
continue;
|
|
3042
3224
|
}
|
|
@@ -3046,7 +3228,7 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
|
|
|
3046
3228
|
}
|
|
3047
3229
|
if (reexportsOnly && keyword.value !== "export") continue;
|
|
3048
3230
|
const previous = tokens[index - 1];
|
|
3049
|
-
if (_optionalChain([previous, 'optionalAccess',
|
|
3231
|
+
if (_optionalChain([previous, 'optionalAccess', _188 => _188.value]) === ".") continue;
|
|
3050
3232
|
const first = tokens[index + 1];
|
|
3051
3233
|
if (!first || first.value === "type" || first.value === "(" || first.value === ".") {
|
|
3052
3234
|
continue;
|
|
@@ -3062,7 +3244,7 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
|
|
|
3062
3244
|
for (let cursor = index + 1; cursor < tokens.length; cursor++) {
|
|
3063
3245
|
const token = tokens[cursor];
|
|
3064
3246
|
if (token.value === ";") break;
|
|
3065
|
-
if (token.value === "from" && _optionalChain([tokens, 'access',
|
|
3247
|
+
if (token.value === "from" && _optionalChain([tokens, 'access', _189 => _189[cursor + 1], 'optionalAccess', _190 => _190.kind]) === "string") {
|
|
3066
3248
|
fromIndex = cursor;
|
|
3067
3249
|
break;
|
|
3068
3250
|
}
|
|
@@ -3080,14 +3262,14 @@ function getImportSpecifiers(content, { reexportsOnly = false, dynamic = false }
|
|
|
3080
3262
|
return Array.from(matches);
|
|
3081
3263
|
}
|
|
3082
3264
|
function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
|
|
3083
|
-
if (_optionalChain([tokens, 'access',
|
|
3265
|
+
if (_optionalChain([tokens, 'access', _191 => _191[startIndex], 'optionalAccess', _192 => _192.value]) !== "{") return false;
|
|
3084
3266
|
const closingBraceIndex = tokens.findIndex(
|
|
3085
3267
|
(token, index) => index > startIndex && index < endIndex && token.value === "}"
|
|
3086
3268
|
);
|
|
3087
3269
|
if (closingBraceIndex === -1) return false;
|
|
3088
3270
|
let entryStartsAt = startIndex + 1;
|
|
3089
3271
|
for (let index = entryStartsAt; index <= closingBraceIndex; index++) {
|
|
3090
|
-
if (index !== closingBraceIndex && _optionalChain([tokens, 'access',
|
|
3272
|
+
if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _193 => _193[index], 'optionalAccess', _194 => _194.value]) !== ",") continue;
|
|
3091
3273
|
const entry = tokens.slice(entryStartsAt, index);
|
|
3092
3274
|
if (entry.length > 0 && entry[0].value !== "type") return false;
|
|
3093
3275
|
entryStartsAt = index + 1;
|
|
@@ -3095,6 +3277,16 @@ function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
|
|
|
3095
3277
|
return true;
|
|
3096
3278
|
}
|
|
3097
3279
|
function resolveImportedModule(importerPath, specifier, root) {
|
|
3280
|
+
const resolved = memoizeInFarmSourceSnapshot(
|
|
3281
|
+
"resolution",
|
|
3282
|
+
`${_nullishCoalesce(root, () => ( ""))}\0${importerPath}\0${specifier}`,
|
|
3283
|
+
() => resolveImportedModuleUncached(importerPath, specifier, root),
|
|
3284
|
+
// A file added later may resolve an import that does not resolve now.
|
|
3285
|
+
(result) => result.path !== null
|
|
3286
|
+
);
|
|
3287
|
+
return { ...resolved };
|
|
3288
|
+
}
|
|
3289
|
+
function resolveImportedModuleUncached(importerPath, specifier, root) {
|
|
3098
3290
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
3099
3291
|
return { path: resolveImportedModuleSourcePath(importerPath, specifier, root), local: true };
|
|
3100
3292
|
}
|
|
@@ -3151,14 +3343,14 @@ function getProjectImportAliases(projectRoot) {
|
|
|
3151
3343
|
const stamp = PROJECT_ALIAS_FILES.map((file) => {
|
|
3152
3344
|
try {
|
|
3153
3345
|
return String(_fs2.default.statSync(_path2.default.join(projectRoot, file)).mtimeMs);
|
|
3154
|
-
} catch (
|
|
3346
|
+
} catch (e32) {
|
|
3155
3347
|
return "-";
|
|
3156
3348
|
}
|
|
3157
3349
|
}).join(":");
|
|
3158
3350
|
const sourceDir = _chunkRE5E2G5Scjs.getFarmProjectSourceDir.call(void 0, projectRoot);
|
|
3159
3351
|
const cacheStamp = `${stamp}:${sourceDir}`;
|
|
3160
3352
|
const cached = projectImportAliasCache.get(projectRoot);
|
|
3161
|
-
if (_optionalChain([cached, 'optionalAccess',
|
|
3353
|
+
if (_optionalChain([cached, 'optionalAccess', _195 => _195.stamp]) === cacheStamp) return cached.aliases;
|
|
3162
3354
|
const aliases = [
|
|
3163
3355
|
...readTsconfigPathAliases(projectRoot),
|
|
3164
3356
|
...readPackageImportAliases(projectRoot)
|
|
@@ -3179,7 +3371,7 @@ function readTsconfigPathAliases(projectRoot) {
|
|
|
3179
3371
|
const configPath = _path2.default.join(projectRoot, name);
|
|
3180
3372
|
if (!_fs2.default.existsSync(configPath)) continue;
|
|
3181
3373
|
const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
|
|
3182
|
-
if (!_optionalChain([resolved, 'optionalAccess',
|
|
3374
|
+
if (!_optionalChain([resolved, 'optionalAccess', _196 => _196.paths])) return [];
|
|
3183
3375
|
const base = _nullishCoalesce(resolved.baseUrl, () => ( resolved.pathsDirectory));
|
|
3184
3376
|
return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
|
|
3185
3377
|
if (!Array.isArray(targets)) return [];
|
|
@@ -3214,18 +3406,18 @@ function readTsconfigPaths(configPath, visited) {
|
|
|
3214
3406
|
inherited = _nullishCoalesce(readTsconfigPaths(parentPath, visited), () => ( inherited));
|
|
3215
3407
|
}
|
|
3216
3408
|
const options = _nullishCoalesce(config.compilerOptions, () => ( {}));
|
|
3217
|
-
const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess',
|
|
3409
|
+
const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _197 => _197.baseUrl]);
|
|
3218
3410
|
if (options.paths && typeof options.paths === "object") {
|
|
3219
3411
|
return { paths: options.paths, pathsDirectory: directory, baseUrl };
|
|
3220
3412
|
}
|
|
3221
3413
|
return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
|
|
3222
3414
|
}
|
|
3223
3415
|
function readPackageImportAliases(projectRoot) {
|
|
3224
|
-
const imports = _optionalChain([readPackageJson, 'call',
|
|
3416
|
+
const imports = _optionalChain([readPackageJson, 'call', _198 => _198(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _199 => _199.imports]);
|
|
3225
3417
|
if (!imports || typeof imports !== "object") return [];
|
|
3226
3418
|
return Object.entries(imports).flatMap(([pattern, value]) => {
|
|
3227
3419
|
const target = resolveConditionalExportTarget(value);
|
|
3228
|
-
if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess',
|
|
3420
|
+
if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _200 => _200.startsWith, 'call', _201 => _201("./")])) return [];
|
|
3229
3421
|
const wildcardIndex = pattern.indexOf("*");
|
|
3230
3422
|
return [
|
|
3231
3423
|
{
|
|
@@ -3241,7 +3433,7 @@ function readJsonWithComments(filePath) {
|
|
|
3241
3433
|
let source;
|
|
3242
3434
|
try {
|
|
3243
3435
|
source = _fs2.default.readFileSync(filePath, "utf8");
|
|
3244
|
-
} catch (
|
|
3436
|
+
} catch (e33) {
|
|
3245
3437
|
return null;
|
|
3246
3438
|
}
|
|
3247
3439
|
let output = "";
|
|
@@ -3269,7 +3461,7 @@ function readJsonWithComments(filePath) {
|
|
|
3269
3461
|
}
|
|
3270
3462
|
try {
|
|
3271
3463
|
return JSON.parse(output.replace(/,(\s*[}\]])/g, "$1"));
|
|
3272
|
-
} catch (
|
|
3464
|
+
} catch (e34) {
|
|
3273
3465
|
return null;
|
|
3274
3466
|
}
|
|
3275
3467
|
}
|
|
@@ -3291,15 +3483,15 @@ function resolvePackageModuleSourcePath(importerPath, specifier, root) {
|
|
|
3291
3483
|
const packageJsonPath = _path2.default.join(packageDirectory, "package.json");
|
|
3292
3484
|
const packageJson = readPackageJson(packageJsonPath);
|
|
3293
3485
|
const exportKey = packageSubpath ? `./${packageSubpath}` : ".";
|
|
3294
|
-
const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess',
|
|
3486
|
+
const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _202 => _202.exports]), exportKey);
|
|
3295
3487
|
const candidates = /* @__PURE__ */ new Set();
|
|
3296
|
-
if (_optionalChain([exportTarget, 'optionalAccess',
|
|
3488
|
+
if (_optionalChain([exportTarget, 'optionalAccess', _203 => _203.startsWith, 'call', _204 => _204("./")])) {
|
|
3297
3489
|
candidates.add(_path2.default.resolve(packageDirectory, exportTarget));
|
|
3298
3490
|
}
|
|
3299
3491
|
if (packageSubpath) {
|
|
3300
3492
|
candidates.add(_path2.default.join(packageDirectory, packageSubpath));
|
|
3301
3493
|
} else {
|
|
3302
|
-
for (const entry of [_optionalChain([packageJson, 'optionalAccess',
|
|
3494
|
+
for (const entry of [_optionalChain([packageJson, 'optionalAccess', _205 => _205.browser]), _optionalChain([packageJson, 'optionalAccess', _206 => _206.module]), _optionalChain([packageJson, 'optionalAccess', _207 => _207.main])]) {
|
|
3303
3495
|
if (typeof entry === "string") candidates.add(_path2.default.resolve(packageDirectory, entry));
|
|
3304
3496
|
}
|
|
3305
3497
|
candidates.add(_path2.default.join(packageDirectory, "index"));
|
|
@@ -3335,7 +3527,7 @@ function findPackageDirectory2(importerPath, packageName, root) {
|
|
|
3335
3527
|
function readPackageJson(packageJsonPath) {
|
|
3336
3528
|
try {
|
|
3337
3529
|
return JSON.parse(_fs2.default.readFileSync(packageJsonPath, "utf8"));
|
|
3338
|
-
} catch (
|
|
3530
|
+
} catch (e35) {
|
|
3339
3531
|
return null;
|
|
3340
3532
|
}
|
|
3341
3533
|
}
|
|
@@ -3364,7 +3556,7 @@ function resolvePackageExport(exportsField, exportKey) {
|
|
|
3364
3556
|
if (!exportKey.startsWith(prefix) || !exportKey.endsWith(suffix)) continue;
|
|
3365
3557
|
const wildcard = exportKey.slice(prefix.length, exportKey.length - suffix.length);
|
|
3366
3558
|
const target = resolveConditionalExportTarget(value);
|
|
3367
|
-
return _nullishCoalesce(_optionalChain([target, 'optionalAccess',
|
|
3559
|
+
return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _208 => _208.replace, 'call', _209 => _209("*", wildcard)]), () => ( null));
|
|
3368
3560
|
}
|
|
3369
3561
|
return null;
|
|
3370
3562
|
}
|
|
@@ -3397,7 +3589,7 @@ function resolveSourceCandidate(candidates) {
|
|
|
3397
3589
|
for (const sourcePath of paths) {
|
|
3398
3590
|
try {
|
|
3399
3591
|
if (_fs2.default.statSync(sourcePath).isFile()) return sourcePath;
|
|
3400
|
-
} catch (
|
|
3592
|
+
} catch (e36) {
|
|
3401
3593
|
}
|
|
3402
3594
|
}
|
|
3403
3595
|
}
|
|
@@ -3440,7 +3632,7 @@ function scanFarmPackageImports(directory, root) {
|
|
|
3440
3632
|
let entries;
|
|
3441
3633
|
try {
|
|
3442
3634
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
3443
|
-
} catch (
|
|
3635
|
+
} catch (e37) {
|
|
3444
3636
|
return;
|
|
3445
3637
|
}
|
|
3446
3638
|
for (const entry of entries) {
|
|
@@ -3473,7 +3665,7 @@ function collectFarmServerBundledPackageInfo(directory) {
|
|
|
3473
3665
|
let entries;
|
|
3474
3666
|
try {
|
|
3475
3667
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
3476
|
-
} catch (
|
|
3668
|
+
} catch (e38) {
|
|
3477
3669
|
return;
|
|
3478
3670
|
}
|
|
3479
3671
|
for (const entry of entries) {
|
|
@@ -3512,7 +3704,7 @@ function getFarmClientReachableModules(directory, root) {
|
|
|
3512
3704
|
let entries;
|
|
3513
3705
|
try {
|
|
3514
3706
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
3515
|
-
} catch (
|
|
3707
|
+
} catch (e39) {
|
|
3516
3708
|
return;
|
|
3517
3709
|
}
|
|
3518
3710
|
for (const entry of entries) {
|
|
@@ -3615,13 +3807,13 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
3615
3807
|
let projectRoot = process.cwd();
|
|
3616
3808
|
let sources;
|
|
3617
3809
|
const routeSourceFiles = () => {
|
|
3618
|
-
const clientRoutes = _optionalChain([farmApi, 'optionalAccess',
|
|
3619
|
-
if (_optionalChain([sources, 'optionalAccess',
|
|
3810
|
+
const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _210 => _210.getProgrammaticClientRoutes, 'call', _211 => _211()]);
|
|
3811
|
+
if (_optionalChain([sources, 'optionalAccess', _212 => _212.for]) !== clientRoutes || !sources) {
|
|
3620
3812
|
sources = {
|
|
3621
3813
|
for: clientRoutes,
|
|
3622
3814
|
files: /* @__PURE__ */ new Set([
|
|
3623
3815
|
...routesFiles,
|
|
3624
|
-
...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess',
|
|
3816
|
+
...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _213 => _213.routeSourceFiles]), () => ( []))].map(resolvedFile)
|
|
3625
3817
|
])
|
|
3626
3818
|
};
|
|
3627
3819
|
}
|
|
@@ -3634,7 +3826,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
3634
3826
|
configResolved(config) {
|
|
3635
3827
|
isBuild = config.command === "build";
|
|
3636
3828
|
projectRoot = config.root;
|
|
3637
|
-
farmApi = _optionalChain([config, 'access',
|
|
3829
|
+
farmApi = _optionalChain([config, 'access', _214 => _214.plugins, 'access', _215 => _215.find, 'call', _216 => _216((plugin) => plugin.name === "farm"), 'optionalAccess', _217 => _217.api]);
|
|
3638
3830
|
sources = void 0;
|
|
3639
3831
|
routesFiles = new Set(
|
|
3640
3832
|
_chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
|
|
@@ -3647,14 +3839,14 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
3647
3839
|
transform(code, id, transformOptions) {
|
|
3648
3840
|
const environment = resolveBuildEnvironment(
|
|
3649
3841
|
this,
|
|
3650
|
-
_optionalChain([transformOptions, 'optionalAccess',
|
|
3842
|
+
_optionalChain([transformOptions, 'optionalAccess', _218 => _218.ssr])
|
|
3651
3843
|
);
|
|
3652
3844
|
const parse2 = (source) => this.parse(source);
|
|
3653
3845
|
const result = transformEnvironmentFunctions({ code, id, environment, parse: parse2 });
|
|
3654
3846
|
if (environment === "client" && !isBuild && !_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
|
|
3655
3847
|
this.error(routeSourceError(moduleFile(id)));
|
|
3656
3848
|
}
|
|
3657
|
-
if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access',
|
|
3849
|
+
if (environment === "server" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _219 => _219.experimental, 'optionalAccess', _220 => _220.serverComponents])) === "islands" && isApplicationScript(id)) {
|
|
3658
3850
|
const file = id.split("?", 1)[0];
|
|
3659
3851
|
const root = _fs.realpathSync.call(void 0, _nullishCoalesce(options.root, () => ( projectRoot)));
|
|
3660
3852
|
const clientCode = getFarmClientReachableModules(root, root).has(_path2.default.resolve(file)) || _fs.existsSync.call(void 0, file) && hasUseClientDirective(_fs.readFileSync.call(void 0, file, "utf8"));
|
|
@@ -3675,7 +3867,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
3675
3867
|
for (const id of this.getModuleIds()) {
|
|
3676
3868
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
3677
3869
|
const chain = findClientNodeBuiltinChain(id, (moduleId) => {
|
|
3678
|
-
return _optionalChain([this, 'access',
|
|
3870
|
+
return _optionalChain([this, 'access', _221 => _221.getModuleInfo, 'call', _222 => _222(moduleId), 'optionalAccess', _223 => _223.importedIds]);
|
|
3679
3871
|
});
|
|
3680
3872
|
if (chain) {
|
|
3681
3873
|
this.error(
|
|
@@ -3686,8 +3878,8 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
3686
3878
|
}
|
|
3687
3879
|
if (!forbidden.has(moduleFile(id))) continue;
|
|
3688
3880
|
const info = this.getModuleInfo(id);
|
|
3689
|
-
if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess',
|
|
3690
|
-
this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess',
|
|
3881
|
+
if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _224 => _224.code]))) continue;
|
|
3882
|
+
this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _225 => _225.importers, 'access', _226 => _226.map, 'call', _227 => _227(moduleFile)])));
|
|
3691
3883
|
}
|
|
3692
3884
|
}
|
|
3693
3885
|
};
|
|
@@ -3701,13 +3893,13 @@ function moduleFile(id) {
|
|
|
3701
3893
|
function resolvedFile(filePath) {
|
|
3702
3894
|
try {
|
|
3703
3895
|
return moduleFile(_fs.realpathSync.call(void 0, filePath));
|
|
3704
|
-
} catch (
|
|
3896
|
+
} catch (e40) {
|
|
3705
3897
|
return moduleFile(filePath);
|
|
3706
3898
|
}
|
|
3707
3899
|
}
|
|
3708
3900
|
function resolveBuildEnvironment(context, ssr) {
|
|
3709
|
-
if (_optionalChain([context, 'access',
|
|
3710
|
-
if (_optionalChain([context, 'access',
|
|
3901
|
+
if (_optionalChain([context, 'access', _228 => _228.environment, 'optionalAccess', _229 => _229.name]) === "client") return "client";
|
|
3902
|
+
if (_optionalChain([context, 'access', _230 => _230.environment, 'optionalAccess', _231 => _231.name]) === "rsc" || _optionalChain([context, 'access', _232 => _232.environment, 'optionalAccess', _233 => _233.name]) === "ssr") {
|
|
3711
3903
|
return "server";
|
|
3712
3904
|
}
|
|
3713
3905
|
return ssr ? "server" : "client";
|
|
@@ -4011,4 +4203,10 @@ function transformError(id, message) {
|
|
|
4011
4203
|
|
|
4012
4204
|
|
|
4013
4205
|
|
|
4014
|
-
|
|
4206
|
+
|
|
4207
|
+
|
|
4208
|
+
|
|
4209
|
+
|
|
4210
|
+
|
|
4211
|
+
|
|
4212
|
+
exports.FARM_BROWSER_BUILTIN_PREFIX = FARM_BROWSER_BUILTIN_PREFIX; exports.resolveFarmBrowserBuiltin = resolveFarmBrowserBuiltin; exports.loadFarmBrowserBuiltin = loadFarmBrowserBuiltin; exports.farmBrowserBuiltinsOptimizerPlugin = farmBrowserBuiltinsOptimizerPlugin; exports.programmaticClientRouteKey = programmaticClientRouteKey; exports.resolveProgrammaticClientRoutes = resolveProgrammaticClientRoutes; exports.createEvaluatedRouteGraph = createEvaluatedRouteGraph; exports.mergeProgrammaticClientRoutes = mergeProgrammaticClientRoutes; exports.generateProgrammaticClientRouteModule = generateProgrammaticClientRouteModule; exports.FarmSourceSnapshotStore = FarmSourceSnapshotStore; exports.withFarmSourceSnapshot = withFarmSourceSnapshot; exports.traceFarmSourceReads = traceFarmSourceReads; exports.rewriteFarmReactServerClientModuleImports = rewriteFarmReactServerClientModuleImports; exports.rewriteFarmReactServerImports = rewriteFarmReactServerImports; exports.invalidateFarmClientOnlyScan = invalidateFarmClientOnlyScan; exports.farmRelativeImportFiles = farmRelativeImportFiles; exports.FARM_CLIENT_REFERENCE_PRAGMA = FARM_CLIENT_REFERENCE_PRAGMA; exports.FARM_CLIENT_REFERENCE_DIRECTORY = FARM_CLIENT_REFERENCE_DIRECTORY; exports.FARM_RESOLVE_FROM_PREFIX = FARM_RESOLVE_FROM_PREFIX; exports.parseFarmResolveFrom = parseFarmResolveFrom; exports.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.ensureFarmInternalClientReference = ensureFarmInternalClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolvePackageClientBoundaryCacheFile = resolvePackageClientBoundaryCacheFile; exports.runWithPackageClientBoundaryCacheFile = runWithPackageClientBoundaryCacheFile; exports.runWithLatestPackageClientBoundaryCache = runWithLatestPackageClientBoundaryCache; exports.dropLatestPackageClientBoundaryCache = dropLatestPackageClientBoundaryCache; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; exports.collectFarmRenderedClientModules = collectFarmRenderedClientModules; exports.collectFarmServerStylesheets = collectFarmServerStylesheets; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.usesFarmServerTree = usesFarmServerTree; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.isIsolatableClientBoundarySource = isIsolatableClientBoundarySource; exports.isFarmClientModulePlanUnchanged = isFarmClientModulePlanUnchanged; exports.resolveImportedModule = resolveImportedModule; exports.isFarmPackageClientBoundary = isFarmPackageClientBoundary; exports.collectFarmClientPackageImports = collectFarmClientPackageImports; exports.collectFarmServerBundledPackageInfo = collectFarmServerBundledPackageInfo; exports.invalidateFarmClientReachableModules = invalidateFarmClientReachableModules; exports.getFarmClientReachableModules = getFarmClientReachableModules; exports.resolveFarmClientOptimizeDeps = resolveFarmClientOptimizeDeps; exports.transformEnvironmentFunctions = transformEnvironmentFunctions; exports.farmEnvironmentFunctionsPlugin = farmEnvironmentFunctionsPlugin;
|