@farm.js/core 0.1.0-beta.44 → 0.1.0-beta.46
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/api/route-manager.cjs.map +1 -1
- package/dist/api/route-manager.mjs +2 -2
- package/dist/api.cjs.map +1 -1
- package/dist/api.mjs +3 -3
- package/dist/{chunk-EPBXX44K.mjs → chunk-3UUEBVR3.mjs} +3 -3
- package/dist/{chunk-IRYMQRYJ.mjs → chunk-ECLWCE4H.mjs} +2 -2
- package/dist/{chunk-MYNLKNAW.mjs → chunk-EHUGMAWL.mjs} +2 -2
- package/dist/{chunk-FY34HLY7.mjs → chunk-LGCIIMFR.mjs} +2 -2
- package/dist/{chunk-FY34HLY7.mjs.map → chunk-LGCIIMFR.mjs.map} +1 -1
- package/dist/{chunk-MU2QKVYL.mjs → chunk-MP2SDRRB.mjs} +2 -2
- package/dist/{chunk-VHYARVB7.mjs → chunk-TIESOJ7Z.mjs} +2 -2
- package/dist/{chunk-LIIZPHDO.mjs → chunk-TQJMU5BP.mjs} +16 -16
- package/dist/chunk-TQJMU5BP.mjs.map +1 -0
- package/dist/{chunk-KEPCW6EI.mjs → chunk-U5SPS2HR.mjs} +10 -1
- package/dist/chunk-U5SPS2HR.mjs.map +1 -0
- package/dist/{chunk-4MYKKWR4.mjs → chunk-V7VDW7IY.mjs} +7 -7
- package/dist/{chunk-BQWTEZSS.mjs → chunk-W2O6SKJU.mjs} +2 -2
- package/dist/{chunk-X4MNGHCU.mjs → chunk-XR7M5VXU.mjs} +2 -2
- package/dist/{chunk-TUYEGV7H.mjs → chunk-YKAUAZA4.mjs} +7 -3
- package/dist/chunk-YKAUAZA4.mjs.map +1 -0
- package/dist/client/lifecycle.mjs +2 -2
- package/dist/client-plugins.cjs +1 -1
- package/dist/client-plugins.cjs.map +1 -1
- package/dist/client-plugins.mjs +2 -2
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +2 -2
- package/dist/{devtools-3MSKJ4TE.mjs → devtools-BUFIHBX3.mjs} +3 -3
- package/dist/docs.cjs.map +1 -1
- package/dist/docs.mjs +3 -3
- package/dist/index.cjs +24 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +14 -12
- package/dist/index.mjs.map +1 -1
- package/dist/internal/build-runtime.cjs +22 -11
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.d.mts +1 -1
- package/dist/internal/build-runtime.d.ts +1 -1
- package/dist/internal/build-runtime.mjs +9 -9
- 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 +6 -2
- package/dist/internal/config-runtime.cjs.map +1 -1
- package/dist/internal/config-runtime.d.mts +1 -1
- package/dist/internal/config-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/{layers-3ZHU4XTZ.mjs → layers-KJI5XUAP.mjs} +2 -2
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.mjs +3 -3
- package/dist/plugin.cjs +16 -9
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.mjs +6 -6
- package/dist/server.cjs +24 -11
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.mjs +9 -7
- package/dist/server.mjs.map +1 -1
- package/dist/testing.mjs +2 -2
- package/dist/{utils-CjZRiq-l.d.mts → utils-9OPxcT1T.d.mts} +9 -1
- package/dist/{utils-_LOF-V9f.d.ts → utils-CIIoLfn9.d.ts} +9 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +22 -11
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +6 -6
- package/package.json +1 -1
- package/dist/chunk-KEPCW6EI.mjs.map +0 -1
- package/dist/chunk-LIIZPHDO.mjs.map +0 -1
- package/dist/chunk-TUYEGV7H.mjs.map +0 -1
- /package/dist/{chunk-EPBXX44K.mjs.map → chunk-3UUEBVR3.mjs.map} +0 -0
- /package/dist/{chunk-IRYMQRYJ.mjs.map → chunk-ECLWCE4H.mjs.map} +0 -0
- /package/dist/{chunk-MYNLKNAW.mjs.map → chunk-EHUGMAWL.mjs.map} +0 -0
- /package/dist/{chunk-MU2QKVYL.mjs.map → chunk-MP2SDRRB.mjs.map} +0 -0
- /package/dist/{chunk-VHYARVB7.mjs.map → chunk-TIESOJ7Z.mjs.map} +0 -0
- /package/dist/{chunk-4MYKKWR4.mjs.map → chunk-V7VDW7IY.mjs.map} +0 -0
- /package/dist/{chunk-BQWTEZSS.mjs.map → chunk-W2O6SKJU.mjs.map} +0 -0
- /package/dist/{chunk-X4MNGHCU.mjs.map → chunk-XR7M5VXU.mjs.map} +0 -0
- /package/dist/{devtools-3MSKJ4TE.mjs.map → devtools-BUFIHBX3.mjs.map} +0 -0
- /package/dist/{layers-3ZHU4XTZ.mjs.map → layers-KJI5XUAP.mjs.map} +0 -0
package/dist/plugin.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import "./chunk-RQ633A5I.mjs";
|
|
7
7
|
import {
|
|
8
8
|
farmPlugin
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TQJMU5BP.mjs";
|
|
10
10
|
import "./chunk-XJTDE4L4.mjs";
|
|
11
11
|
import "./chunk-CAUVJN4X.mjs";
|
|
12
12
|
import "./chunk-AMZZCRQ7.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-JHCNZLFT.mjs";
|
|
@@ -36,15 +36,15 @@ import "./chunk-H53KVQUU.mjs";
|
|
|
36
36
|
import "./chunk-QKVUNGAH.mjs";
|
|
37
37
|
import "./chunk-HFQ2I2EA.mjs";
|
|
38
38
|
import "./chunk-T4QJQK76.mjs";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-TIESOJ7Z.mjs";
|
|
40
40
|
import "./chunk-P7QDS5AT.mjs";
|
|
41
41
|
import "./chunk-E6EPN5BT.mjs";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-MP2SDRRB.mjs";
|
|
43
43
|
import "./chunk-XJ65E7MB.mjs";
|
|
44
44
|
import "./chunk-FQYDHKKU.mjs";
|
|
45
45
|
import "./chunk-SXWF4QRU.mjs";
|
|
46
46
|
import "./chunk-GIELMNBG.mjs";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-U5SPS2HR.mjs";
|
|
48
48
|
import "./chunk-QGOHVJ6J.mjs";
|
|
49
49
|
import "./chunk-5B33VWGX.mjs";
|
|
50
50
|
import "./chunk-YTMDIHQN.mjs";
|
|
@@ -63,7 +63,7 @@ import "./chunk-RBRLLZL5.mjs";
|
|
|
63
63
|
import "./chunk-WZ5QFROO.mjs";
|
|
64
64
|
import "./chunk-7ZMKVETU.mjs";
|
|
65
65
|
import "./chunk-FXG2PS27.mjs";
|
|
66
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-LGCIIMFR.mjs";
|
|
67
67
|
import "./chunk-CGILA3WO.mjs";
|
|
68
68
|
export {
|
|
69
69
|
FarmRuntimeShutdownError,
|
package/dist/server.cjs
CHANGED
|
@@ -3283,6 +3283,9 @@ function getFarmLayerAliases(layers) {
|
|
|
3283
3283
|
(layers ?? []).map((layer) => [`#layers/${layer.name}`, import_node_path.default.join(layer.root, layer.srcDir)])
|
|
3284
3284
|
);
|
|
3285
3285
|
}
|
|
3286
|
+
function toExternalSpecifier(resolvedPath) {
|
|
3287
|
+
return import_node_path.default.isAbsolute(resolvedPath) ? (0, import_node_url.pathToFileURL)(resolvedPath).href : resolvedPath;
|
|
3288
|
+
}
|
|
3286
3289
|
function createFarmConfigResolutionPlugin(options) {
|
|
3287
3290
|
const configEntryChecks = /* @__PURE__ */ new Map();
|
|
3288
3291
|
return {
|
|
@@ -3307,7 +3310,7 @@ function createFarmConfigResolutionPlugin(options) {
|
|
|
3307
3310
|
});
|
|
3308
3311
|
if (resolved.errors.length > 0 || !resolved.path) return;
|
|
3309
3312
|
return {
|
|
3310
|
-
path: resolved.path,
|
|
3313
|
+
path: toExternalSpecifier(resolved.path),
|
|
3311
3314
|
external: true,
|
|
3312
3315
|
warnings: resolved.warnings
|
|
3313
3316
|
};
|
|
@@ -3328,7 +3331,7 @@ function createFarmConfigResolutionPlugin(options) {
|
|
|
3328
3331
|
return { path: args.path, external: true };
|
|
3329
3332
|
}
|
|
3330
3333
|
return {
|
|
3331
|
-
path: resolved.path,
|
|
3334
|
+
path: toExternalSpecifier(resolved.path),
|
|
3332
3335
|
external: true,
|
|
3333
3336
|
warnings: resolved.warnings
|
|
3334
3337
|
};
|
|
@@ -3614,6 +3617,7 @@ var init_layers = __esm({
|
|
|
3614
3617
|
__name(getFarmAppDirectories, "getFarmAppDirectories");
|
|
3615
3618
|
__name(getFarmLayerAliases, "getFarmLayerAliases");
|
|
3616
3619
|
WINDOWS_ABSOLUTE_PATH_RE = /^(?:[A-Za-z]:[\\/]|\\\\)/;
|
|
3620
|
+
__name(toExternalSpecifier, "toExternalSpecifier");
|
|
3617
3621
|
__name(createFarmConfigResolutionPlugin, "createFarmConfigResolutionPlugin");
|
|
3618
3622
|
__name(loadFarmConfigFile, "loadFarmConfigFile");
|
|
3619
3623
|
__name(onlyImportsFarmConfigHelpers, "onlyImportsFarmConfigHelpers");
|
|
@@ -14824,6 +14828,7 @@ __export(server_exports2, {
|
|
|
14824
14828
|
sqliteStorage: () => sqliteStorage,
|
|
14825
14829
|
startDevServer: () => startDevServer,
|
|
14826
14830
|
storageCacheAdapter: () => storageCacheAdapter,
|
|
14831
|
+
toRootRelativeUrlPath: () => toRootRelativeUrlPath,
|
|
14827
14832
|
toViteModuleId: () => toViteModuleId,
|
|
14828
14833
|
unstable_cache: () => unstable_cache,
|
|
14829
14834
|
updateTag: () => updateTag,
|
|
@@ -14953,6 +14958,14 @@ function resolveAppPath(root, ...paths) {
|
|
|
14953
14958
|
return import_path.default.resolve(root, ...paths);
|
|
14954
14959
|
}
|
|
14955
14960
|
__name(resolveAppPath, "resolveAppPath");
|
|
14961
|
+
function toRootRelativeUrlPath(absolutePath, projectRoot) {
|
|
14962
|
+
if (absolutePath === projectRoot) return "";
|
|
14963
|
+
if (absolutePath.startsWith(`${projectRoot}/`) || absolutePath.startsWith(`${projectRoot}\\`)) {
|
|
14964
|
+
return absolutePath.slice(projectRoot.length).replace(/\\/g, "/");
|
|
14965
|
+
}
|
|
14966
|
+
return void 0;
|
|
14967
|
+
}
|
|
14968
|
+
__name(toRootRelativeUrlPath, "toRootRelativeUrlPath");
|
|
14956
14969
|
function toViteModuleId(filePath, root) {
|
|
14957
14970
|
if (!import_path.default.isAbsolute(filePath)) return filePath;
|
|
14958
14971
|
const relativePath2 = import_path.default.relative(root, filePath);
|
|
@@ -17119,9 +17132,8 @@ var _RouteManager = class _RouteManager {
|
|
|
17119
17132
|
return this.clientManifestCache.manifest;
|
|
17120
17133
|
}
|
|
17121
17134
|
const toUrlPath = /* @__PURE__ */ __name((absolutePath) => {
|
|
17122
|
-
|
|
17123
|
-
|
|
17124
|
-
}
|
|
17135
|
+
const rootRelative = toRootRelativeUrlPath(absolutePath, normalizedProjectRoot);
|
|
17136
|
+
if (rootRelative !== void 0) return rootRelative;
|
|
17125
17137
|
if (import_path5.default.isAbsolute(absolutePath)) {
|
|
17126
17138
|
const normalized = absolutePath.replace(/\\/g, "/");
|
|
17127
17139
|
return normalized.startsWith("/") ? `/@fs${normalized}` : `/@fs/${normalized}`;
|
|
@@ -21171,7 +21183,7 @@ _setFarmThemeServerSnapshotResolver(() => {
|
|
|
21171
21183
|
});
|
|
21172
21184
|
|
|
21173
21185
|
// package.json
|
|
21174
|
-
var version = "0.1.0-beta.
|
|
21186
|
+
var version = "0.1.0-beta.46";
|
|
21175
21187
|
|
|
21176
21188
|
// src/version.ts
|
|
21177
21189
|
var FARM_VERSION = version;
|
|
@@ -22115,7 +22127,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
22115
22127
|
);
|
|
22116
22128
|
const clientLayouts = layouts.map((layout2, index) => ({
|
|
22117
22129
|
pattern: layout2.pattern,
|
|
22118
|
-
modulePath: layout2.modulePath
|
|
22130
|
+
modulePath: toRootRelativeUrlPath(layout2.modulePath, this.config.root) ?? layout2.modulePath,
|
|
22119
22131
|
shouldHydrate: layoutHydrationMetadata[index]?.shouldHydrate === true,
|
|
22120
22132
|
islandStrategy: layoutHydrationMetadata[index]?.islandStrategy ?? null
|
|
22121
22133
|
}));
|
|
@@ -22691,7 +22703,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
22691
22703
|
const routeSlots = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
22692
22704
|
(slot) => ({
|
|
22693
22705
|
...slot,
|
|
22694
|
-
modulePath: typeof slot.modulePath === "string"
|
|
22706
|
+
modulePath: typeof slot.modulePath === "string" ? toRootRelativeUrlPath(slot.modulePath, this.config.root) ?? slot.modulePath : slot.modulePath
|
|
22695
22707
|
})
|
|
22696
22708
|
);
|
|
22697
22709
|
const deferredProps = prepareDeferredData({
|
|
@@ -22699,7 +22711,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
22699
22711
|
slots: routeSlots
|
|
22700
22712
|
});
|
|
22701
22713
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
22702
|
-
const relativePath2 = pagePath ? pagePath
|
|
22714
|
+
const relativePath2 = pagePath ? toRootRelativeUrlPath(pagePath, this.config.root) ?? pagePath : "/src/app/page.tsx";
|
|
22703
22715
|
const deploymentId = this.getDeploymentId();
|
|
22704
22716
|
const bootstrapScript = `<script>
|
|
22705
22717
|
window.__FARM_PROPS__ = ${serializeInlineValue2(deferredProps.data.page)};
|
|
@@ -22795,7 +22807,7 @@ ${getFarmI18nClientSnapshot() ? `window.__FARM_I18N__ = ${serializeInlineValue2(
|
|
|
22795
22807
|
let didError = false;
|
|
22796
22808
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
22797
22809
|
const isClientComponent = req.__FARM_IS_CLIENT_COMPONENT__ === true;
|
|
22798
|
-
const relativePath2 = pagePath ? pagePath
|
|
22810
|
+
const relativePath2 = pagePath ? toRootRelativeUrlPath(pagePath, this.config.root) ?? pagePath : "/src/app/page.tsx";
|
|
22799
22811
|
const manifest = options.routeManifest ?? this.routeManager.generateClientManifest(this.config.root);
|
|
22800
22812
|
const clientManifest = {
|
|
22801
22813
|
clientEntry: "/@farm/client.js",
|
|
@@ -22843,7 +22855,7 @@ ${getFarmI18nClientSnapshot() ? `window.__FARM_I18N__ = ${serializeInlineValue2(
|
|
|
22843
22855
|
const routeSlotPayload = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
22844
22856
|
(slot) => ({
|
|
22845
22857
|
...slot,
|
|
22846
|
-
modulePath: typeof slot.modulePath === "string"
|
|
22858
|
+
modulePath: typeof slot.modulePath === "string" ? toRootRelativeUrlPath(slot.modulePath, this.config.root) ?? slot.modulePath : slot.modulePath
|
|
22847
22859
|
})
|
|
22848
22860
|
);
|
|
22849
22861
|
const deferredProps = prepareDeferredData({
|
|
@@ -32368,6 +32380,7 @@ __name(assertFunction, "assertFunction");
|
|
|
32368
32380
|
sqliteStorage,
|
|
32369
32381
|
startDevServer,
|
|
32370
32382
|
storageCacheAdapter,
|
|
32383
|
+
toRootRelativeUrlPath,
|
|
32371
32384
|
toViteModuleId,
|
|
32372
32385
|
unstable_cache,
|
|
32373
32386
|
updateTag,
|