@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/middleware.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
memoryRateLimitStorage,
|
|
8
8
|
middleware,
|
|
9
9
|
unwrapMiddleware
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ECLWCE4H.mjs";
|
|
11
11
|
import {
|
|
12
12
|
applyProductionMiddlewareHeaders,
|
|
13
13
|
createProductionMiddlewareRunner
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
MiddlewareManager,
|
|
17
17
|
createContext
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TIESOJ7Z.mjs";
|
|
19
19
|
import {
|
|
20
20
|
_runWithMiddlewareContext,
|
|
21
21
|
_runWithMiddlewareData,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
getMiddlewareValue
|
|
25
25
|
} from "./chunk-P7QDS5AT.mjs";
|
|
26
26
|
import "./chunk-GIELMNBG.mjs";
|
|
27
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-U5SPS2HR.mjs";
|
|
28
28
|
import "./chunk-QGOHVJ6J.mjs";
|
|
29
29
|
import "./chunk-RHIFZZUI.mjs";
|
|
30
30
|
import "./chunk-LM2YNO4U.mjs";
|
package/dist/plugin.cjs
CHANGED
|
@@ -12766,6 +12766,14 @@ function resolveAppPath(root, ...paths) {
|
|
|
12766
12766
|
return import_path.default.resolve(root, ...paths);
|
|
12767
12767
|
}
|
|
12768
12768
|
__name(resolveAppPath, "resolveAppPath");
|
|
12769
|
+
function toRootRelativeUrlPath(absolutePath, projectRoot) {
|
|
12770
|
+
if (absolutePath === projectRoot) return "";
|
|
12771
|
+
if (absolutePath.startsWith(`${projectRoot}/`) || absolutePath.startsWith(`${projectRoot}\\`)) {
|
|
12772
|
+
return absolutePath.slice(projectRoot.length).replace(/\\/g, "/");
|
|
12773
|
+
}
|
|
12774
|
+
return void 0;
|
|
12775
|
+
}
|
|
12776
|
+
__name(toRootRelativeUrlPath, "toRootRelativeUrlPath");
|
|
12769
12777
|
function toViteModuleId(filePath, root) {
|
|
12770
12778
|
if (!import_path.default.isAbsolute(filePath)) return filePath;
|
|
12771
12779
|
const relativePath2 = import_path.default.relative(root, filePath);
|
|
@@ -14915,9 +14923,8 @@ var _RouteManager = class _RouteManager {
|
|
|
14915
14923
|
return this.clientManifestCache.manifest;
|
|
14916
14924
|
}
|
|
14917
14925
|
const toUrlPath = /* @__PURE__ */ __name((absolutePath) => {
|
|
14918
|
-
|
|
14919
|
-
|
|
14920
|
-
}
|
|
14926
|
+
const rootRelative = toRootRelativeUrlPath(absolutePath, normalizedProjectRoot);
|
|
14927
|
+
if (rootRelative !== void 0) return rootRelative;
|
|
14921
14928
|
if (import_path5.default.isAbsolute(absolutePath)) {
|
|
14922
14929
|
const normalized = absolutePath.replace(/\\/g, "/");
|
|
14923
14930
|
return normalized.startsWith("/") ? `/@fs${normalized}` : `/@fs/${normalized}`;
|
|
@@ -18963,7 +18970,7 @@ _setFarmThemeServerSnapshotResolver(() => {
|
|
|
18963
18970
|
});
|
|
18964
18971
|
|
|
18965
18972
|
// package.json
|
|
18966
|
-
var version = "0.1.0-beta.
|
|
18973
|
+
var version = "0.1.0-beta.46";
|
|
18967
18974
|
|
|
18968
18975
|
// src/version.ts
|
|
18969
18976
|
var FARM_VERSION = version;
|
|
@@ -19907,7 +19914,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
19907
19914
|
);
|
|
19908
19915
|
const clientLayouts = layouts.map((layout2, index) => ({
|
|
19909
19916
|
pattern: layout2.pattern,
|
|
19910
|
-
modulePath: layout2.modulePath
|
|
19917
|
+
modulePath: toRootRelativeUrlPath(layout2.modulePath, this.config.root) ?? layout2.modulePath,
|
|
19911
19918
|
shouldHydrate: layoutHydrationMetadata[index]?.shouldHydrate === true,
|
|
19912
19919
|
islandStrategy: layoutHydrationMetadata[index]?.islandStrategy ?? null
|
|
19913
19920
|
}));
|
|
@@ -20483,7 +20490,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
20483
20490
|
const routeSlots = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
20484
20491
|
(slot) => ({
|
|
20485
20492
|
...slot,
|
|
20486
|
-
modulePath: typeof slot.modulePath === "string"
|
|
20493
|
+
modulePath: typeof slot.modulePath === "string" ? toRootRelativeUrlPath(slot.modulePath, this.config.root) ?? slot.modulePath : slot.modulePath
|
|
20487
20494
|
})
|
|
20488
20495
|
);
|
|
20489
20496
|
const deferredProps = prepareDeferredData({
|
|
@@ -20491,7 +20498,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
20491
20498
|
slots: routeSlots
|
|
20492
20499
|
});
|
|
20493
20500
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
20494
|
-
const relativePath2 = pagePath ? pagePath
|
|
20501
|
+
const relativePath2 = pagePath ? toRootRelativeUrlPath(pagePath, this.config.root) ?? pagePath : "/src/app/page.tsx";
|
|
20495
20502
|
const deploymentId = this.getDeploymentId();
|
|
20496
20503
|
const bootstrapScript = `<script>
|
|
20497
20504
|
window.__FARM_PROPS__ = ${serializeInlineValue2(deferredProps.data.page)};
|
|
@@ -20587,7 +20594,7 @@ ${getFarmI18nClientSnapshot() ? `window.__FARM_I18N__ = ${serializeInlineValue2(
|
|
|
20587
20594
|
let didError = false;
|
|
20588
20595
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
20589
20596
|
const isClientComponent = req.__FARM_IS_CLIENT_COMPONENT__ === true;
|
|
20590
|
-
const relativePath2 = pagePath ? pagePath
|
|
20597
|
+
const relativePath2 = pagePath ? toRootRelativeUrlPath(pagePath, this.config.root) ?? pagePath : "/src/app/page.tsx";
|
|
20591
20598
|
const manifest = options.routeManifest ?? this.routeManager.generateClientManifest(this.config.root);
|
|
20592
20599
|
const clientManifest = {
|
|
20593
20600
|
clientEntry: "/@farm/client.js",
|
|
@@ -20635,7 +20642,7 @@ ${getFarmI18nClientSnapshot() ? `window.__FARM_I18N__ = ${serializeInlineValue2(
|
|
|
20635
20642
|
const routeSlotPayload = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
20636
20643
|
(slot) => ({
|
|
20637
20644
|
...slot,
|
|
20638
|
-
modulePath: typeof slot.modulePath === "string"
|
|
20645
|
+
modulePath: typeof slot.modulePath === "string" ? toRootRelativeUrlPath(slot.modulePath, this.config.root) ?? slot.modulePath : slot.modulePath
|
|
20639
20646
|
})
|
|
20640
20647
|
);
|
|
20641
20648
|
const deferredProps = prepareDeferredData({
|