@farm.js/core 0.1.64 → 0.1.65
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/analyzer-GHWK46LX.cjs +16 -0
- package/dist/{analyzer-Q3QXC6PD.mjs → analyzer-PE33SK5W.mjs} +2 -2
- package/dist/{chunk-O4FWNLQK.mjs → chunk-2L54YV25.mjs} +10 -8
- package/dist/{chunk-S25BQIFW.cjs → chunk-32RPJAAS.cjs} +2 -2
- package/dist/{chunk-FAP7CX7C.cjs → chunk-3KJPIO5D.cjs} +526 -3018
- package/dist/{chunk-OYF23QLG.mjs → chunk-6X5NKNBE.mjs} +36 -32
- package/dist/{chunk-LQDLEWPO.mjs → chunk-72JSHQQQ.mjs} +1 -1
- package/dist/{chunk-WNYRYI4D.mjs → chunk-7GYCZRTH.mjs} +379 -2871
- package/dist/chunk-7QVRWGBL.cjs +3704 -0
- package/dist/{chunk-O2XFIPNL.cjs → chunk-A3G5IY2W.cjs} +1 -1
- package/dist/{chunk-NXFA7G3Y.cjs → chunk-C7DCMGC4.cjs} +4 -4
- package/dist/chunk-CJNAUEVC.mjs +34 -0
- package/dist/{chunk-O7IEMY55.cjs → chunk-CZF4XIRZ.cjs} +3 -3
- package/dist/{chunk-SLYDIHLW.mjs → chunk-E2TSYUHV.mjs} +2 -2
- package/dist/{chunk-VVTJTMGQ.cjs → chunk-GL7N5UHF.cjs} +4 -4
- package/dist/{chunk-6NHSGVVA.mjs → chunk-GRBJ7VKH.mjs} +1 -1
- package/dist/{chunk-UR25Z5Z6.mjs → chunk-HCGWDRZO.mjs} +1 -1
- package/dist/{chunk-FH45OB37.mjs → chunk-HKNYNSOK.mjs} +1 -1
- package/dist/{chunk-DUSHDZQL.cjs → chunk-IMK32ERL.cjs} +15 -13
- package/dist/{chunk-XVWSDSUM.mjs → chunk-IP2KHSGF.mjs} +4 -2
- package/dist/{chunk-MG356ROI.cjs → chunk-OSFIUSYK.cjs} +3 -3
- package/dist/{chunk-SNFTMSHX.mjs → chunk-Q75QPLBA.mjs} +1 -1
- package/dist/{chunk-WFNAOWH4.mjs → chunk-QHRCR44V.mjs} +2 -2
- package/dist/{chunk-JCPSA4X5.cjs → chunk-T4M52BA5.cjs} +116 -112
- package/dist/{chunk-PAKCHVUS.mjs → chunk-TPA2PV5J.mjs} +3 -35
- package/dist/{chunk-N3Z3PLHC.cjs → chunk-TRIDJQ6A.cjs} +6 -6
- package/dist/{chunk-3EBHJET2.cjs → chunk-TZOGZKI7.cjs} +380 -269
- package/dist/{chunk-BPNOYILC.cjs → chunk-UVV3I5QA.cjs} +3 -35
- package/dist/{chunk-RAH5MT53.mjs → chunk-VHHLKIDZ.mjs} +153 -42
- package/dist/{chunk-S7ZW72JH.cjs → chunk-WNXVWXG3.cjs} +2 -2
- package/dist/{chunk-XZLZ6YPP.cjs → chunk-YD4J37RN.cjs} +90 -33
- package/dist/{chunk-NNLFW3P4.mjs → chunk-YUW7F6SK.mjs} +1 -1
- package/dist/chunk-ZAUOOGER.mjs +3704 -0
- package/dist/chunk-ZIHWAN55.cjs +34 -0
- package/dist/{chunk-EL4364S2.cjs → chunk-ZQQK4U66.cjs} +4 -2
- package/dist/{chunk-6NNYPY5W.mjs → chunk-ZX2JHEWW.mjs} +59 -2
- package/dist/{devtools-MX3FE733.mjs → devtools-PUVZB3F2.mjs} +4 -3
- package/dist/{devtools-WET5NAKO.cjs → devtools-SGYOG36E.cjs} +5 -4
- package/dist/docs.cjs +6 -5
- package/dist/docs.mjs +5 -4
- package/dist/environment/vite.cjs +9 -2
- package/dist/environment/vite.d.mts +3 -0
- package/dist/environment/vite.d.ts +3 -0
- package/dist/environment/vite.mjs +8 -1
- package/dist/index.cjs +20 -19
- package/dist/index.mjs +19 -18
- package/dist/internal/build-runtime.cjs +18 -17
- package/dist/internal/build-runtime.mjs +17 -16
- package/dist/internal/cli-runtime.cjs +6 -5
- package/dist/internal/cli-runtime.mjs +5 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/config-runtime.cjs +6 -5
- package/dist/internal/config-runtime.mjs +5 -4
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- 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 +5 -5
- package/dist/internal/production-runtime.d.mts +7 -0
- package/dist/internal/production-runtime.d.ts +7 -0
- package/dist/internal/production-runtime.mjs +4 -4
- package/dist/{native-tree-WOX3JMBG.cjs → native-tree-HE2FLS72.cjs} +2 -2
- package/dist/{native-tree-BPEE2LAL.mjs → native-tree-YF2DSPKM.mjs} +1 -1
- package/dist/plugin.cjs +11 -10
- package/dist/plugin.mjs +10 -9
- package/dist/{rsc-pipeline-3LNVP2OO.mjs → rsc-pipeline-T3PWURLJ.mjs} +6 -5
- package/dist/{rsc-pipeline-G5WELVW3.cjs → rsc-pipeline-V4ANLRAA.cjs} +7 -6
- package/dist/{runtime-DMEULPE7.cjs → runtime-5AROV2C3.cjs} +12 -11
- package/dist/{runtime-HQJ2LLQL.mjs → runtime-LRIQ3XH7.mjs} +9 -8
- package/dist/server.cjs +36 -35
- package/dist/server.mjs +19 -18
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +14 -12
- package/dist/vite.mjs +13 -11
- package/package.json +1 -1
- package/dist/analyzer-ODLF2Z6O.cjs +0 -16
- package/dist/chunk-NK2VWS7P.cjs +0 -954
- package/dist/chunk-ZQ5BDNKW.mjs +0 -954
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
// src/server-components-mode.ts
|
|
2
|
-
function resolveFarmServerComponentsMode(value) {
|
|
3
|
-
if (value === void 0 || value === null || value === false) return void 0;
|
|
4
|
-
if (value === true) return "rsc";
|
|
5
|
-
const mode = typeof value === "object" ? value.mode : void 0;
|
|
6
|
-
if (mode === "rsc" || mode === "islands") return mode;
|
|
7
|
-
throw new TypeError(
|
|
8
|
-
'experimental.serverComponents must be true, false, { mode: "rsc" } or { mode: "islands" }.'
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
function isExplicitFarmServerComponentsMode(value) {
|
|
12
|
-
return typeof value === "object" && value !== null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
1
|
// src/dev-indicators.ts
|
|
16
2
|
function resolveFarmDevIndicatorsConfig(config, mode = "development") {
|
|
17
3
|
return {
|
|
@@ -312,23 +298,9 @@ if (import.meta.hot) {
|
|
|
312
298
|
`;
|
|
313
299
|
}
|
|
314
300
|
|
|
315
|
-
// src/utils/source-dir.ts
|
|
316
|
-
import path from "path";
|
|
317
|
-
var FARM_PROJECT_SOURCE_DIRS = /* @__PURE__ */ Symbol.for("farm.projectSourceDirs");
|
|
318
|
-
function getProjectSourceDirs() {
|
|
319
|
-
const globalState = globalThis;
|
|
320
|
-
return globalState[FARM_PROJECT_SOURCE_DIRS] ?? (globalState[FARM_PROJECT_SOURCE_DIRS] = /* @__PURE__ */ new Map());
|
|
321
|
-
}
|
|
322
|
-
function setFarmProjectSourceDir(root, srcDir) {
|
|
323
|
-
getProjectSourceDirs().set(path.resolve(root), srcDir);
|
|
324
|
-
}
|
|
325
|
-
function getFarmProjectSourceDir(root) {
|
|
326
|
-
return getProjectSourceDirs().get(path.resolve(root)) ?? "src";
|
|
327
|
-
}
|
|
328
|
-
|
|
329
301
|
// src/auth-config.ts
|
|
330
302
|
import { createRequire } from "module";
|
|
331
|
-
import
|
|
303
|
+
import path from "path";
|
|
332
304
|
import { pathToFileURL } from "url";
|
|
333
305
|
function resolveFarmAuthConfig(input) {
|
|
334
306
|
const config = input === true ? {} : input && typeof input === "object" ? input : {};
|
|
@@ -358,10 +330,10 @@ function resolveFarmAuthConfig(input) {
|
|
|
358
330
|
}
|
|
359
331
|
async function resolveFarmAuthIntegration(config, options) {
|
|
360
332
|
if (!config.enabled) return void 0;
|
|
361
|
-
const root =
|
|
333
|
+
const root = path.resolve(options.root);
|
|
362
334
|
let modulePath;
|
|
363
335
|
try {
|
|
364
|
-
const resolveFromApp = createRequire(
|
|
336
|
+
const resolveFromApp = createRequire(path.join(root, "package.json"));
|
|
365
337
|
modulePath = resolveFromApp.resolve("@farm.js/auth/internal");
|
|
366
338
|
} catch {
|
|
367
339
|
throw new Error(
|
|
@@ -439,10 +411,6 @@ function validateFarmAuthConfig(config) {
|
|
|
439
411
|
}
|
|
440
412
|
|
|
441
413
|
export {
|
|
442
|
-
resolveFarmServerComponentsMode,
|
|
443
|
-
isExplicitFarmServerComponentsMode,
|
|
444
|
-
setFarmProjectSourceDir,
|
|
445
|
-
getFarmProjectSourceDir,
|
|
446
414
|
resolveFarmDevIndicatorsConfig,
|
|
447
415
|
generateFarmDevIndicatorsClientRuntime,
|
|
448
416
|
resolveFarmAuthConfig,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkGL7N5UHFcjs = require('./chunk-GL7N5UHF.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkXVSBALOYcjs = require('./chunk-XVSBALOY.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkIMK32ERLcjs = require('./chunk-IMK32ERL.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -54,7 +54,7 @@ function pickImportTarget(entry) {
|
|
|
54
54
|
return void 0;
|
|
55
55
|
}
|
|
56
56
|
async function importFromApp(root, packageName, subpath = ".") {
|
|
57
|
-
const packageDir =
|
|
57
|
+
const packageDir = _chunkGL7N5UHFcjs.findFarmAppPackageDir.call(void 0, root, packageName);
|
|
58
58
|
if (!packageDir) return void 0;
|
|
59
59
|
const manifest = JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(packageDir, "package.json"), "utf8"));
|
|
60
60
|
const exportsMap = manifest.exports;
|
|
@@ -81,9 +81,9 @@ async function createFarmRscViteConfig(userConfig, options) {
|
|
|
81
81
|
importFromApp(root, "@vitejs/plugin-rsc"),
|
|
82
82
|
importFromApp(root, "@vitejs/plugin-react")
|
|
83
83
|
]);
|
|
84
|
-
if (!pluginRsc || !viteRsc || !
|
|
84
|
+
if (!pluginRsc || !viteRsc || !_chunkGL7N5UHFcjs.findFarmAppPackageDir.call(void 0, root, "react-server-dom-webpack")) {
|
|
85
85
|
throw new Error(
|
|
86
|
-
`[Farm.js] experimental.serverComponents runs on @farm.js/plugin and the official @vitejs/plugin-rsc. Install them: ${
|
|
86
|
+
`[Farm.js] experimental.serverComponents runs on @farm.js/plugin and the official @vitejs/plugin-rsc. Install them: ${_chunkGL7N5UHFcjs.FARM_RSC_INSTALL_HINT}`
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
const { plugins: vitePlugins = [], ...viteOptions } = _nullishCoalesce(userConfig.vite, () => ( {}));
|
|
@@ -114,7 +114,7 @@ async function createFarmRscViteConfig(userConfig, options) {
|
|
|
114
114
|
server: { environmentName: "rsc" },
|
|
115
115
|
config: {
|
|
116
116
|
preset: options.preset,
|
|
117
|
-
outputDir: options.outputDir &&
|
|
117
|
+
outputDir: options.outputDir && _chunkIMK32ERLcjs.resolveDeployOutputPath.call(void 0, root, options.outputDir)
|
|
118
118
|
}
|
|
119
119
|
})
|
|
120
120
|
]
|