@farm.js/core 0.1.0-beta.43 → 0.1.0-beta.45
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-LGOZMAQY.mjs → chunk-6NCLVPI7.mjs} +5 -5
- package/dist/{chunk-LFCB4XH7.mjs → chunk-EHUGMAWL.mjs} +3 -3
- package/dist/{chunk-LFCB4XH7.mjs.map → chunk-EHUGMAWL.mjs.map} +1 -1
- package/dist/{chunk-MPY5IS76.mjs → chunk-FLGRRGVU.mjs} +2 -2
- package/dist/{chunk-MPY5IS76.mjs.map → chunk-FLGRRGVU.mjs.map} +1 -1
- package/dist/{chunk-ALHE54BD.mjs → chunk-IWPBMZGE.mjs} +5 -5
- package/dist/{chunk-7U6Q7NLJ.mjs → chunk-QLCUQD3U.mjs} +2 -2
- package/dist/{chunk-U5DLXOFP.mjs → chunk-XR7M5VXU.mjs} +2 -2
- package/dist/{chunk-74YTBPTY.mjs → chunk-YKAUAZA4.mjs} +62 -51
- package/dist/chunk-YKAUAZA4.mjs.map +1 -0
- 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-BUFIHBX3.mjs} +3 -3
- package/dist/docs.cjs.map +1 -1
- package/dist/docs.mjs +3 -3
- package/dist/index.cjs +64 -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 +64 -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 +61 -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-KJI5XUAP.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 +66 -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 +63 -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-LGOZMAQY.mjs.map → chunk-6NCLVPI7.mjs.map} +0 -0
- /package/dist/{chunk-ALHE54BD.mjs.map → chunk-IWPBMZGE.mjs.map} +0 -0
- /package/dist/{chunk-7U6Q7NLJ.mjs.map → chunk-QLCUQD3U.mjs.map} +0 -0
- /package/dist/{chunk-U5DLXOFP.mjs.map → chunk-XR7M5VXU.mjs.map} +0 -0
- /package/dist/{devtools-7BTXCOMR.mjs.map → devtools-BUFIHBX3.mjs.map} +0 -0
- /package/dist/{layers-VWVDTPUZ.mjs.map → layers-KJI5XUAP.mjs.map} +0 -0
package/dist/docs.mjs
CHANGED
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
isFarmDocsRequest,
|
|
12
12
|
loadFarmDocsPage,
|
|
13
13
|
resolveFarmDocsContentDir
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XR7M5VXU.mjs";
|
|
15
15
|
import "./chunk-V7RBCSDJ.mjs";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-EHUGMAWL.mjs";
|
|
17
17
|
import "./chunk-UVCIEUJC.mjs";
|
|
18
18
|
import "./chunk-RQ633A5I.mjs";
|
|
19
19
|
import "./chunk-USLFXFFH.mjs";
|
|
@@ -21,7 +21,7 @@ import "./chunk-E257KFBU.mjs";
|
|
|
21
21
|
import "./chunk-7MABZJIM.mjs";
|
|
22
22
|
import "./chunk-H3A35IQ2.mjs";
|
|
23
23
|
import "./chunk-BNTDKO7T.mjs";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-YKAUAZA4.mjs";
|
|
25
25
|
import "./chunk-7ZVN3YZI.mjs";
|
|
26
26
|
import "./chunk-GY2STC2S.mjs";
|
|
27
27
|
import "./chunk-A5VG2BDG.mjs";
|
package/dist/index.cjs
CHANGED
|
@@ -6274,6 +6274,7 @@ var init_image_config = __esm({
|
|
|
6274
6274
|
// src/layers.ts
|
|
6275
6275
|
var layers_exports = {};
|
|
6276
6276
|
__export(layers_exports, {
|
|
6277
|
+
createFarmConfigResolutionPlugin: () => createFarmConfigResolutionPlugin,
|
|
6277
6278
|
getFarmAppDirectories: () => getFarmAppDirectories,
|
|
6278
6279
|
getFarmLayerAliases: () => getFarmLayerAliases,
|
|
6279
6280
|
getFarmSourceRoots: () => getFarmSourceRoots,
|
|
@@ -6375,11 +6376,66 @@ function getFarmLayerAliases(layers) {
|
|
|
6375
6376
|
(layers ?? []).map((layer) => [`#layers/${layer.name}`, import_node_path2.default.join(layer.root, layer.srcDir)])
|
|
6376
6377
|
);
|
|
6377
6378
|
}
|
|
6379
|
+
function toExternalSpecifier(resolvedPath) {
|
|
6380
|
+
return import_node_path2.default.isAbsolute(resolvedPath) ? (0, import_node_url2.pathToFileURL)(resolvedPath).href : resolvedPath;
|
|
6381
|
+
}
|
|
6382
|
+
function createFarmConfigResolutionPlugin(options) {
|
|
6383
|
+
const configEntryChecks = /* @__PURE__ */ new Map();
|
|
6384
|
+
return {
|
|
6385
|
+
name: "farm-config-package-resolution",
|
|
6386
|
+
setup(pluginBuild) {
|
|
6387
|
+
pluginBuild.onResolve({ filter: /^@farm\.js\/core$/ }, async (args) => {
|
|
6388
|
+
if (args.pluginData?.farmConfigExternal || args.kind !== "import-statement" || !args.importer) {
|
|
6389
|
+
return;
|
|
6390
|
+
}
|
|
6391
|
+
let configEntryCheck = configEntryChecks.get(args.importer);
|
|
6392
|
+
if (!configEntryCheck) {
|
|
6393
|
+
configEntryCheck = onlyImportsFarmConfigHelpers(args.importer, options.transform);
|
|
6394
|
+
configEntryChecks.set(args.importer, configEntryCheck);
|
|
6395
|
+
}
|
|
6396
|
+
if (!await configEntryCheck) return;
|
|
6397
|
+
const resolved = await pluginBuild.resolve(FARM_CONFIG_ENTRY, {
|
|
6398
|
+
importer: args.importer,
|
|
6399
|
+
kind: args.kind,
|
|
6400
|
+
namespace: args.namespace,
|
|
6401
|
+
resolveDir: args.resolveDir,
|
|
6402
|
+
pluginData: { farmConfigExternal: true }
|
|
6403
|
+
});
|
|
6404
|
+
if (resolved.errors.length > 0 || !resolved.path) return;
|
|
6405
|
+
return {
|
|
6406
|
+
path: toExternalSpecifier(resolved.path),
|
|
6407
|
+
external: true,
|
|
6408
|
+
warnings: resolved.warnings
|
|
6409
|
+
};
|
|
6410
|
+
});
|
|
6411
|
+
pluginBuild.onResolve({ filter: /^[^./]/ }, async (args) => {
|
|
6412
|
+
if (args.kind === "entry-point" || import_node_path2.default.isAbsolute(args.path) || WINDOWS_ABSOLUTE_PATH_RE.test(args.path)) {
|
|
6413
|
+
return;
|
|
6414
|
+
}
|
|
6415
|
+
if (args.pluginData?.farmConfigExternal) return;
|
|
6416
|
+
const resolved = await pluginBuild.resolve(args.path, {
|
|
6417
|
+
importer: args.importer,
|
|
6418
|
+
kind: args.kind,
|
|
6419
|
+
namespace: args.namespace,
|
|
6420
|
+
resolveDir: args.resolveDir,
|
|
6421
|
+
pluginData: { farmConfigExternal: true }
|
|
6422
|
+
});
|
|
6423
|
+
if (resolved.errors.length > 0 || !resolved.path) {
|
|
6424
|
+
return { path: args.path, external: true };
|
|
6425
|
+
}
|
|
6426
|
+
return {
|
|
6427
|
+
path: toExternalSpecifier(resolved.path),
|
|
6428
|
+
external: true,
|
|
6429
|
+
warnings: resolved.warnings
|
|
6430
|
+
};
|
|
6431
|
+
});
|
|
6432
|
+
}
|
|
6433
|
+
};
|
|
6434
|
+
}
|
|
6378
6435
|
async function loadFarmConfigFile(configPath, options) {
|
|
6379
6436
|
const { build: build3, transform } = await import("esbuild");
|
|
6380
6437
|
const cacheRoot = import_node_path2.default.resolve(options.cacheRoot || options.root);
|
|
6381
6438
|
const configCacheDir = import_node_path2.default.join(cacheRoot, ".farm", ".config-loader");
|
|
6382
|
-
const configEntryChecks = /* @__PURE__ */ new Map();
|
|
6383
6439
|
await (0, import_promises.mkdir)(configCacheDir, { recursive: true });
|
|
6384
6440
|
const modulePath = import_node_path2.default.join(
|
|
6385
6441
|
configCacheDir,
|
|
@@ -6393,55 +6449,7 @@ async function loadFarmConfigFile(configPath, options) {
|
|
|
6393
6449
|
format: "esm",
|
|
6394
6450
|
platform: "node",
|
|
6395
6451
|
target: `node${process.versions.node.split(".")[0]}`,
|
|
6396
|
-
plugins: [
|
|
6397
|
-
{
|
|
6398
|
-
name: "farm-config-package-resolution",
|
|
6399
|
-
setup(pluginBuild) {
|
|
6400
|
-
pluginBuild.onResolve({ filter: /^@farm.js\/core$/ }, async (args) => {
|
|
6401
|
-
if (args.pluginData?.farmConfigExternal || args.kind !== "import-statement" || !args.importer) {
|
|
6402
|
-
return;
|
|
6403
|
-
}
|
|
6404
|
-
let configEntryCheck = configEntryChecks.get(args.importer);
|
|
6405
|
-
if (!configEntryCheck) {
|
|
6406
|
-
configEntryCheck = onlyImportsFarmConfigHelpers(args.importer, transform);
|
|
6407
|
-
configEntryChecks.set(args.importer, configEntryCheck);
|
|
6408
|
-
}
|
|
6409
|
-
if (!await configEntryCheck) return;
|
|
6410
|
-
const resolved = await pluginBuild.resolve(FARM_CONFIG_ENTRY, {
|
|
6411
|
-
importer: args.importer,
|
|
6412
|
-
kind: args.kind,
|
|
6413
|
-
namespace: args.namespace,
|
|
6414
|
-
resolveDir: args.resolveDir,
|
|
6415
|
-
pluginData: { farmConfigExternal: true }
|
|
6416
|
-
});
|
|
6417
|
-
if (resolved.errors.length > 0 || !resolved.path) return;
|
|
6418
|
-
return {
|
|
6419
|
-
path: resolved.path,
|
|
6420
|
-
external: true,
|
|
6421
|
-
warnings: resolved.warnings
|
|
6422
|
-
};
|
|
6423
|
-
});
|
|
6424
|
-
pluginBuild.onResolve({ filter: /^[^./]/ }, async (args) => {
|
|
6425
|
-
if (args.pluginData?.farmConfigExternal) return;
|
|
6426
|
-
const resolved = await pluginBuild.resolve(args.path, {
|
|
6427
|
-
importer: args.importer,
|
|
6428
|
-
kind: args.kind,
|
|
6429
|
-
namespace: args.namespace,
|
|
6430
|
-
resolveDir: args.resolveDir,
|
|
6431
|
-
pluginData: { farmConfigExternal: true }
|
|
6432
|
-
});
|
|
6433
|
-
if (resolved.errors.length > 0 || !resolved.path) {
|
|
6434
|
-
return { path: args.path, external: true };
|
|
6435
|
-
}
|
|
6436
|
-
return {
|
|
6437
|
-
path: resolved.path,
|
|
6438
|
-
external: true,
|
|
6439
|
-
warnings: resolved.warnings
|
|
6440
|
-
};
|
|
6441
|
-
});
|
|
6442
|
-
}
|
|
6443
|
-
}
|
|
6444
|
-
],
|
|
6452
|
+
plugins: [createFarmConfigResolutionPlugin({ transform })],
|
|
6445
6453
|
jsx: "automatic",
|
|
6446
6454
|
logLevel: "silent",
|
|
6447
6455
|
sourcemap: "inline"
|
|
@@ -6654,7 +6662,7 @@ function isPathLayerSource(source) {
|
|
|
6654
6662
|
function normalizeRealPath(value) {
|
|
6655
6663
|
return import_node_path2.default.resolve((0, import_node_fs.realpathSync)(value));
|
|
6656
6664
|
}
|
|
6657
|
-
var import_node_fs, import_promises, import_node_module2, import_node_path2, import_node_url2, FARM_CORE_PACKAGE, FARM_CONFIG_ENTRY, FARM_CORE_REFERENCE_RE, FARM_CONFIG_HELPER_IMPORT_RE, FARM_CONFIG_HELPER_SPECIFIER_RE, CONFIG_FILENAMES, LAYER_LOCAL_CONFIG_KEYS;
|
|
6665
|
+
var import_node_fs, import_promises, import_node_module2, import_node_path2, import_node_url2, FARM_CORE_PACKAGE, FARM_CONFIG_ENTRY, FARM_CORE_REFERENCE_RE, FARM_CONFIG_HELPER_IMPORT_RE, FARM_CONFIG_HELPER_SPECIFIER_RE, CONFIG_FILENAMES, LAYER_LOCAL_CONFIG_KEYS, WINDOWS_ABSOLUTE_PATH_RE;
|
|
6658
6666
|
var init_layers = __esm({
|
|
6659
6667
|
"src/layers.ts"() {
|
|
6660
6668
|
"use strict";
|
|
@@ -6701,6 +6709,9 @@ var init_layers = __esm({
|
|
|
6701
6709
|
__name(getFarmSourceRoots, "getFarmSourceRoots");
|
|
6702
6710
|
__name(getFarmAppDirectories, "getFarmAppDirectories");
|
|
6703
6711
|
__name(getFarmLayerAliases, "getFarmLayerAliases");
|
|
6712
|
+
WINDOWS_ABSOLUTE_PATH_RE = /^(?:[A-Za-z]:[\\/]|\\\\)/;
|
|
6713
|
+
__name(toExternalSpecifier, "toExternalSpecifier");
|
|
6714
|
+
__name(createFarmConfigResolutionPlugin, "createFarmConfigResolutionPlugin");
|
|
6704
6715
|
__name(loadFarmConfigFile, "loadFarmConfigFile");
|
|
6705
6716
|
__name(onlyImportsFarmConfigHelpers, "onlyImportsFarmConfigHelpers");
|
|
6706
6717
|
__name(getEsbuildLoader, "getEsbuildLoader");
|
|
@@ -15177,7 +15188,7 @@ var init_server3 = __esm({
|
|
|
15177
15188
|
var version;
|
|
15178
15189
|
var init_package = __esm({
|
|
15179
15190
|
"package.json"() {
|
|
15180
|
-
version = "0.1.0-beta.
|
|
15191
|
+
version = "0.1.0-beta.45";
|
|
15181
15192
|
}
|
|
15182
15193
|
});
|
|
15183
15194
|
|
|
@@ -25044,7 +25055,7 @@ async function loadConfig(rootDir, configPath, mode = process.env.NODE_ENV === "
|
|
|
25044
25055
|
].filter(Boolean);
|
|
25045
25056
|
for (const relativePath2 of searchPaths) {
|
|
25046
25057
|
try {
|
|
25047
|
-
const absolutePath =
|
|
25058
|
+
const absolutePath = import_path9.default.isAbsolute(relativePath2) ? relativePath2 : import_path9.default.join(root, relativePath2);
|
|
25048
25059
|
const normalizedPath = import_path9.default.resolve(absolutePath);
|
|
25049
25060
|
if (!existsSync20(normalizedPath)) {
|
|
25050
25061
|
continue;
|