@farm.js/core 0.1.0-beta.42 → 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-DKOIDET6.mjs → chunk-4MYKKWR4.mjs} +5 -5
- package/dist/{chunk-PSS353YX.mjs → chunk-BQWTEZSS.mjs} +2 -2
- package/dist/{chunk-HTRNPFDG.mjs → chunk-FY34HLY7.mjs} +2 -2
- package/dist/{chunk-HTRNPFDG.mjs.map → chunk-FY34HLY7.mjs.map} +1 -1
- package/dist/{chunk-47AWCMVP.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 +3 -3
- package/dist/chunk-74YTBPTY.mjs.map +0 -1
- /package/dist/{chunk-DKOIDET6.mjs.map → chunk-4MYKKWR4.mjs.map} +0 -0
- /package/dist/{chunk-PSS353YX.mjs.map → chunk-BQWTEZSS.mjs.map} +0 -0
- /package/dist/{chunk-47AWCMVP.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
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-X4MNGHCU.mjs";
|
|
15
15
|
import "./chunk-V7RBCSDJ.mjs";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-MYNLKNAW.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-TUYEGV7H.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,63 @@ 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 createFarmConfigResolutionPlugin(options) {
|
|
6380
|
+
const configEntryChecks = /* @__PURE__ */ new Map();
|
|
6381
|
+
return {
|
|
6382
|
+
name: "farm-config-package-resolution",
|
|
6383
|
+
setup(pluginBuild) {
|
|
6384
|
+
pluginBuild.onResolve({ filter: /^@farm\.js\/core$/ }, async (args) => {
|
|
6385
|
+
if (args.pluginData?.farmConfigExternal || args.kind !== "import-statement" || !args.importer) {
|
|
6386
|
+
return;
|
|
6387
|
+
}
|
|
6388
|
+
let configEntryCheck = configEntryChecks.get(args.importer);
|
|
6389
|
+
if (!configEntryCheck) {
|
|
6390
|
+
configEntryCheck = onlyImportsFarmConfigHelpers(args.importer, options.transform);
|
|
6391
|
+
configEntryChecks.set(args.importer, configEntryCheck);
|
|
6392
|
+
}
|
|
6393
|
+
if (!await configEntryCheck) return;
|
|
6394
|
+
const resolved = await pluginBuild.resolve(FARM_CONFIG_ENTRY, {
|
|
6395
|
+
importer: args.importer,
|
|
6396
|
+
kind: args.kind,
|
|
6397
|
+
namespace: args.namespace,
|
|
6398
|
+
resolveDir: args.resolveDir,
|
|
6399
|
+
pluginData: { farmConfigExternal: true }
|
|
6400
|
+
});
|
|
6401
|
+
if (resolved.errors.length > 0 || !resolved.path) return;
|
|
6402
|
+
return {
|
|
6403
|
+
path: resolved.path,
|
|
6404
|
+
external: true,
|
|
6405
|
+
warnings: resolved.warnings
|
|
6406
|
+
};
|
|
6407
|
+
});
|
|
6408
|
+
pluginBuild.onResolve({ filter: /^[^./]/ }, async (args) => {
|
|
6409
|
+
if (args.kind === "entry-point" || import_node_path2.default.isAbsolute(args.path) || WINDOWS_ABSOLUTE_PATH_RE.test(args.path)) {
|
|
6410
|
+
return;
|
|
6411
|
+
}
|
|
6412
|
+
if (args.pluginData?.farmConfigExternal) return;
|
|
6413
|
+
const resolved = await pluginBuild.resolve(args.path, {
|
|
6414
|
+
importer: args.importer,
|
|
6415
|
+
kind: args.kind,
|
|
6416
|
+
namespace: args.namespace,
|
|
6417
|
+
resolveDir: args.resolveDir,
|
|
6418
|
+
pluginData: { farmConfigExternal: true }
|
|
6419
|
+
});
|
|
6420
|
+
if (resolved.errors.length > 0 || !resolved.path) {
|
|
6421
|
+
return { path: args.path, external: true };
|
|
6422
|
+
}
|
|
6423
|
+
return {
|
|
6424
|
+
path: resolved.path,
|
|
6425
|
+
external: true,
|
|
6426
|
+
warnings: resolved.warnings
|
|
6427
|
+
};
|
|
6428
|
+
});
|
|
6429
|
+
}
|
|
6430
|
+
};
|
|
6431
|
+
}
|
|
6378
6432
|
async function loadFarmConfigFile(configPath, options) {
|
|
6379
6433
|
const { build: build3, transform } = await import("esbuild");
|
|
6380
6434
|
const cacheRoot = import_node_path2.default.resolve(options.cacheRoot || options.root);
|
|
6381
6435
|
const configCacheDir = import_node_path2.default.join(cacheRoot, ".farm", ".config-loader");
|
|
6382
|
-
const configEntryChecks = /* @__PURE__ */ new Map();
|
|
6383
6436
|
await (0, import_promises.mkdir)(configCacheDir, { recursive: true });
|
|
6384
6437
|
const modulePath = import_node_path2.default.join(
|
|
6385
6438
|
configCacheDir,
|
|
@@ -6393,55 +6446,7 @@ async function loadFarmConfigFile(configPath, options) {
|
|
|
6393
6446
|
format: "esm",
|
|
6394
6447
|
platform: "node",
|
|
6395
6448
|
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
|
-
],
|
|
6449
|
+
plugins: [createFarmConfigResolutionPlugin({ transform })],
|
|
6445
6450
|
jsx: "automatic",
|
|
6446
6451
|
logLevel: "silent",
|
|
6447
6452
|
sourcemap: "inline"
|
|
@@ -6654,7 +6659,7 @@ function isPathLayerSource(source) {
|
|
|
6654
6659
|
function normalizeRealPath(value) {
|
|
6655
6660
|
return import_node_path2.default.resolve((0, import_node_fs.realpathSync)(value));
|
|
6656
6661
|
}
|
|
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;
|
|
6662
|
+
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
6663
|
var init_layers = __esm({
|
|
6659
6664
|
"src/layers.ts"() {
|
|
6660
6665
|
"use strict";
|
|
@@ -6701,6 +6706,8 @@ var init_layers = __esm({
|
|
|
6701
6706
|
__name(getFarmSourceRoots, "getFarmSourceRoots");
|
|
6702
6707
|
__name(getFarmAppDirectories, "getFarmAppDirectories");
|
|
6703
6708
|
__name(getFarmLayerAliases, "getFarmLayerAliases");
|
|
6709
|
+
WINDOWS_ABSOLUTE_PATH_RE = /^(?:[A-Za-z]:[\\/]|\\\\)/;
|
|
6710
|
+
__name(createFarmConfigResolutionPlugin, "createFarmConfigResolutionPlugin");
|
|
6704
6711
|
__name(loadFarmConfigFile, "loadFarmConfigFile");
|
|
6705
6712
|
__name(onlyImportsFarmConfigHelpers, "onlyImportsFarmConfigHelpers");
|
|
6706
6713
|
__name(getEsbuildLoader, "getEsbuildLoader");
|
|
@@ -15177,7 +15184,7 @@ var init_server3 = __esm({
|
|
|
15177
15184
|
var version;
|
|
15178
15185
|
var init_package = __esm({
|
|
15179
15186
|
"package.json"() {
|
|
15180
|
-
version = "0.1.0-beta.
|
|
15187
|
+
version = "0.1.0-beta.44";
|
|
15181
15188
|
}
|
|
15182
15189
|
});
|
|
15183
15190
|
|
|
@@ -25044,7 +25051,7 @@ async function loadConfig(rootDir, configPath, mode = process.env.NODE_ENV === "
|
|
|
25044
25051
|
].filter(Boolean);
|
|
25045
25052
|
for (const relativePath2 of searchPaths) {
|
|
25046
25053
|
try {
|
|
25047
|
-
const absolutePath =
|
|
25054
|
+
const absolutePath = import_path9.default.isAbsolute(relativePath2) ? relativePath2 : import_path9.default.join(root, relativePath2);
|
|
25048
25055
|
const normalizedPath = import_path9.default.resolve(absolutePath);
|
|
25049
25056
|
if (!existsSync20(normalizedPath)) {
|
|
25050
25057
|
continue;
|