@farm.js/core 0.1.0-beta.43 → 0.1.0-beta.44
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-runtime.d.mts +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/{app-DlrxySOB.d.ts → app-DyqYhh1o.d.ts} +3 -3
- package/dist/{app-8HI8Swuo.d.mts → app-WXv1CQZu.d.mts} +3 -3
- package/dist/app-markdown.d.mts +3 -2
- package/dist/app-markdown.d.ts +3 -2
- package/dist/{chunk-ALHE54BD.mjs → chunk-4MYKKWR4.mjs} +5 -5
- package/dist/{chunk-7U6Q7NLJ.mjs → chunk-BQWTEZSS.mjs} +2 -2
- package/dist/{chunk-MPY5IS76.mjs → chunk-FY34HLY7.mjs} +2 -2
- package/dist/{chunk-MPY5IS76.mjs.map → chunk-FY34HLY7.mjs.map} +1 -1
- package/dist/{chunk-LGOZMAQY.mjs → chunk-LIIZPHDO.mjs} +5 -5
- package/dist/{chunk-LFCB4XH7.mjs → chunk-MYNLKNAW.mjs} +3 -3
- package/dist/{chunk-LFCB4XH7.mjs.map → chunk-MYNLKNAW.mjs.map} +1 -1
- package/dist/{chunk-74YTBPTY.mjs → chunk-TUYEGV7H.mjs} +58 -51
- package/dist/chunk-TUYEGV7H.mjs.map +1 -0
- package/dist/{chunk-U5DLXOFP.mjs → chunk-X4MNGHCU.mjs} +2 -2
- package/dist/client/lifecycle.mjs +2 -2
- package/dist/{client-plugins-D-8aRxvd.d.mts → client-plugins-DmcF3JHA.d.mts} +6 -1
- package/dist/{client-plugins-BRactCe8.d.ts → client-plugins-Dql9bGKX.d.ts} +6 -1
- package/dist/client-plugins.cjs +1 -1
- package/dist/client-plugins.cjs.map +1 -1
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client-plugins.mjs +2 -2
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.mts +5 -4
- package/dist/client.d.ts +5 -4
- package/dist/client.mjs +2 -2
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/{devtools-7BTXCOMR.mjs → devtools-3MSKJ4TE.mjs} +3 -3
- package/dist/docs.cjs.map +1 -1
- package/dist/docs.mjs +3 -3
- package/dist/index.cjs +60 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.mjs +7 -7
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/internal/build-runtime.cjs +60 -53
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.d.mts +4 -3
- package/dist/internal/build-runtime.d.ts +4 -3
- package/dist/internal/build-runtime.mjs +6 -6
- package/dist/internal/client-runtime.cjs +1 -1
- package/dist/internal/client-runtime.cjs.map +1 -1
- package/dist/internal/client-runtime.mjs +2 -2
- package/dist/internal/config-runtime.cjs +57 -51
- package/dist/internal/config-runtime.cjs.map +1 -1
- package/dist/internal/config-runtime.d.mts +3 -2
- package/dist/internal/config-runtime.d.ts +3 -2
- package/dist/internal/config-runtime.mjs +2 -2
- package/dist/internal/production-runtime.d.mts +6 -5
- package/dist/internal/production-runtime.d.ts +6 -5
- package/dist/{layers-VWVDTPUZ.mjs → layers-3ZHU4XTZ.mjs} +4 -2
- package/dist/{metadata-route-uuPEsBr_.d.ts → metadata-route-CW-GF0VH.d.ts} +1 -1
- package/dist/{metadata-route-S7IBCaqP.d.mts → metadata-route-Ca36AbOC.d.mts} +1 -1
- package/dist/middleware.d.mts +4 -3
- package/dist/middleware.d.ts +4 -3
- package/dist/plugin.cjs +1 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.mts +2 -1
- package/dist/plugin.d.ts +2 -1
- package/dist/plugin.mjs +3 -3
- package/dist/{production-runtime-FLWrk1jo.d.mts → production-runtime-DrDv5Hi7.d.mts} +1 -1
- package/dist/{production-runtime-IykJPKRq.d.ts → production-runtime-GmvKFKZ8.d.ts} +1 -1
- package/dist/{render-plan-BMoKOFRz.d.ts → render-plan-C8_69TW3.d.ts} +1 -1
- package/dist/{render-plan-CX71vuj8.d.mts → render-plan-CgTOoLZt.d.mts} +1 -1
- package/dist/renderer-client.d.mts +4 -3
- package/dist/renderer-client.d.ts +4 -3
- package/dist/{request-CAMDBxAg.d.mts → request-CgBjM2bH.d.mts} +1 -1
- package/dist/{request-BnGpxWVL.d.ts → request-Dfjl5DZU.d.ts} +1 -1
- package/dist/request.d.mts +3 -2
- package/dist/request.d.ts +3 -2
- package/dist/routes.d.mts +2 -1
- package/dist/routes.d.ts +2 -1
- package/dist/server-plugins.d.mts +3 -2
- package/dist/server-plugins.d.ts +3 -2
- package/dist/server.cjs +62 -53
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.mts +8 -7
- package/dist/server.d.ts +8 -7
- package/dist/server.mjs +6 -4
- package/dist/server.mjs.map +1 -1
- package/dist/{spa-router-BmBW0Uxs.d.mts → spa-router-BD7iUG-C.d.mts} +1 -1
- package/dist/{spa-router-DjGIPGr0.d.ts → spa-router-swFKTqwR.d.ts} +1 -1
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/{utils-DA9em9mF.d.mts → utils-CjZRiq-l.d.mts} +1 -1
- package/dist/{utils-BKFacUoB.d.ts → utils-_LOF-V9f.d.ts} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +59 -52
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.mts +2 -1
- package/dist/vite.d.ts +2 -1
- package/dist/vite.mjs +3 -3
- package/package.json +1 -1
- package/dist/chunk-74YTBPTY.mjs.map +0 -1
- /package/dist/{chunk-ALHE54BD.mjs.map → chunk-4MYKKWR4.mjs.map} +0 -0
- /package/dist/{chunk-7U6Q7NLJ.mjs.map → chunk-BQWTEZSS.mjs.map} +0 -0
- /package/dist/{chunk-LGOZMAQY.mjs.map → chunk-LIIZPHDO.mjs.map} +0 -0
- /package/dist/{chunk-U5DLXOFP.mjs.map → chunk-X4MNGHCU.mjs.map} +0 -0
- /package/dist/{devtools-7BTXCOMR.mjs.map → devtools-3MSKJ4TE.mjs.map} +0 -0
- /package/dist/{layers-VWVDTPUZ.mjs.map → layers-3ZHU4XTZ.mjs.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClientPluginManager,
|
|
3
3
|
installChunkErrorRecovery
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-BQWTEZSS.mjs";
|
|
5
5
|
import {
|
|
6
6
|
searchParamsToObject
|
|
7
7
|
} from "../chunk-4DCGM2BW.mjs";
|
|
8
8
|
import "../chunk-FXG2PS27.mjs";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-FY34HLY7.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__name
|
|
12
12
|
} from "../chunk-CGILA3WO.mjs";
|
|
@@ -3450,11 +3450,65 @@ async function resolveFarmLayers(projectConfig, options) {
|
|
|
3450
3450
|
};
|
|
3451
3451
|
}
|
|
3452
3452
|
__name(resolveFarmLayers, "resolveFarmLayers");
|
|
3453
|
+
var WINDOWS_ABSOLUTE_PATH_RE = /^(?:[A-Za-z]:[\\/]|\\\\)/;
|
|
3454
|
+
function createFarmConfigResolutionPlugin(options) {
|
|
3455
|
+
const configEntryChecks = /* @__PURE__ */ new Map();
|
|
3456
|
+
return {
|
|
3457
|
+
name: "farm-config-package-resolution",
|
|
3458
|
+
setup(pluginBuild) {
|
|
3459
|
+
pluginBuild.onResolve({ filter: /^@farm\.js\/core$/ }, async (args) => {
|
|
3460
|
+
if (args.pluginData?.farmConfigExternal || args.kind !== "import-statement" || !args.importer) {
|
|
3461
|
+
return;
|
|
3462
|
+
}
|
|
3463
|
+
let configEntryCheck = configEntryChecks.get(args.importer);
|
|
3464
|
+
if (!configEntryCheck) {
|
|
3465
|
+
configEntryCheck = onlyImportsFarmConfigHelpers(args.importer, options.transform);
|
|
3466
|
+
configEntryChecks.set(args.importer, configEntryCheck);
|
|
3467
|
+
}
|
|
3468
|
+
if (!await configEntryCheck) return;
|
|
3469
|
+
const resolved = await pluginBuild.resolve(FARM_CONFIG_ENTRY, {
|
|
3470
|
+
importer: args.importer,
|
|
3471
|
+
kind: args.kind,
|
|
3472
|
+
namespace: args.namespace,
|
|
3473
|
+
resolveDir: args.resolveDir,
|
|
3474
|
+
pluginData: { farmConfigExternal: true }
|
|
3475
|
+
});
|
|
3476
|
+
if (resolved.errors.length > 0 || !resolved.path) return;
|
|
3477
|
+
return {
|
|
3478
|
+
path: resolved.path,
|
|
3479
|
+
external: true,
|
|
3480
|
+
warnings: resolved.warnings
|
|
3481
|
+
};
|
|
3482
|
+
});
|
|
3483
|
+
pluginBuild.onResolve({ filter: /^[^./]/ }, async (args) => {
|
|
3484
|
+
if (args.kind === "entry-point" || import_node_path.default.isAbsolute(args.path) || WINDOWS_ABSOLUTE_PATH_RE.test(args.path)) {
|
|
3485
|
+
return;
|
|
3486
|
+
}
|
|
3487
|
+
if (args.pluginData?.farmConfigExternal) return;
|
|
3488
|
+
const resolved = await pluginBuild.resolve(args.path, {
|
|
3489
|
+
importer: args.importer,
|
|
3490
|
+
kind: args.kind,
|
|
3491
|
+
namespace: args.namespace,
|
|
3492
|
+
resolveDir: args.resolveDir,
|
|
3493
|
+
pluginData: { farmConfigExternal: true }
|
|
3494
|
+
});
|
|
3495
|
+
if (resolved.errors.length > 0 || !resolved.path) {
|
|
3496
|
+
return { path: args.path, external: true };
|
|
3497
|
+
}
|
|
3498
|
+
return {
|
|
3499
|
+
path: resolved.path,
|
|
3500
|
+
external: true,
|
|
3501
|
+
warnings: resolved.warnings
|
|
3502
|
+
};
|
|
3503
|
+
});
|
|
3504
|
+
}
|
|
3505
|
+
};
|
|
3506
|
+
}
|
|
3507
|
+
__name(createFarmConfigResolutionPlugin, "createFarmConfigResolutionPlugin");
|
|
3453
3508
|
async function loadFarmConfigFile(configPath, options) {
|
|
3454
3509
|
const { build, transform } = await import("esbuild");
|
|
3455
3510
|
const cacheRoot = import_node_path.default.resolve(options.cacheRoot || options.root);
|
|
3456
3511
|
const configCacheDir = import_node_path.default.join(cacheRoot, ".farm", ".config-loader");
|
|
3457
|
-
const configEntryChecks = /* @__PURE__ */ new Map();
|
|
3458
3512
|
await (0, import_promises.mkdir)(configCacheDir, { recursive: true });
|
|
3459
3513
|
const modulePath = import_node_path.default.join(
|
|
3460
3514
|
configCacheDir,
|
|
@@ -3468,55 +3522,7 @@ async function loadFarmConfigFile(configPath, options) {
|
|
|
3468
3522
|
format: "esm",
|
|
3469
3523
|
platform: "node",
|
|
3470
3524
|
target: `node${process.versions.node.split(".")[0]}`,
|
|
3471
|
-
plugins: [
|
|
3472
|
-
{
|
|
3473
|
-
name: "farm-config-package-resolution",
|
|
3474
|
-
setup(pluginBuild) {
|
|
3475
|
-
pluginBuild.onResolve({ filter: /^@farm.js\/core$/ }, async (args) => {
|
|
3476
|
-
if (args.pluginData?.farmConfigExternal || args.kind !== "import-statement" || !args.importer) {
|
|
3477
|
-
return;
|
|
3478
|
-
}
|
|
3479
|
-
let configEntryCheck = configEntryChecks.get(args.importer);
|
|
3480
|
-
if (!configEntryCheck) {
|
|
3481
|
-
configEntryCheck = onlyImportsFarmConfigHelpers(args.importer, transform);
|
|
3482
|
-
configEntryChecks.set(args.importer, configEntryCheck);
|
|
3483
|
-
}
|
|
3484
|
-
if (!await configEntryCheck) return;
|
|
3485
|
-
const resolved = await pluginBuild.resolve(FARM_CONFIG_ENTRY, {
|
|
3486
|
-
importer: args.importer,
|
|
3487
|
-
kind: args.kind,
|
|
3488
|
-
namespace: args.namespace,
|
|
3489
|
-
resolveDir: args.resolveDir,
|
|
3490
|
-
pluginData: { farmConfigExternal: true }
|
|
3491
|
-
});
|
|
3492
|
-
if (resolved.errors.length > 0 || !resolved.path) return;
|
|
3493
|
-
return {
|
|
3494
|
-
path: resolved.path,
|
|
3495
|
-
external: true,
|
|
3496
|
-
warnings: resolved.warnings
|
|
3497
|
-
};
|
|
3498
|
-
});
|
|
3499
|
-
pluginBuild.onResolve({ filter: /^[^./]/ }, async (args) => {
|
|
3500
|
-
if (args.pluginData?.farmConfigExternal) return;
|
|
3501
|
-
const resolved = await pluginBuild.resolve(args.path, {
|
|
3502
|
-
importer: args.importer,
|
|
3503
|
-
kind: args.kind,
|
|
3504
|
-
namespace: args.namespace,
|
|
3505
|
-
resolveDir: args.resolveDir,
|
|
3506
|
-
pluginData: { farmConfigExternal: true }
|
|
3507
|
-
});
|
|
3508
|
-
if (resolved.errors.length > 0 || !resolved.path) {
|
|
3509
|
-
return { path: args.path, external: true };
|
|
3510
|
-
}
|
|
3511
|
-
return {
|
|
3512
|
-
path: resolved.path,
|
|
3513
|
-
external: true,
|
|
3514
|
-
warnings: resolved.warnings
|
|
3515
|
-
};
|
|
3516
|
-
});
|
|
3517
|
-
}
|
|
3518
|
-
}
|
|
3519
|
-
],
|
|
3525
|
+
plugins: [createFarmConfigResolutionPlugin({ transform })],
|
|
3520
3526
|
jsx: "automatic",
|
|
3521
3527
|
logLevel: "silent",
|
|
3522
3528
|
sourcemap: "inline"
|
|
@@ -4887,7 +4893,7 @@ async function loadConfig(rootDir, configPath, mode = process.env.NODE_ENV === "
|
|
|
4887
4893
|
].filter(Boolean);
|
|
4888
4894
|
for (const relativePath of searchPaths) {
|
|
4889
4895
|
try {
|
|
4890
|
-
const absolutePath =
|
|
4896
|
+
const absolutePath = import_path.default.isAbsolute(relativePath) ? relativePath : import_path.default.join(root, relativePath);
|
|
4891
4897
|
const normalizedPath = import_path.default.resolve(absolutePath);
|
|
4892
4898
|
if (!existsSync2(normalizedPath)) {
|
|
4893
4899
|
continue;
|