@farm.js/core 0.1.0-beta.45 → 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-FLGRRGVU.mjs → chunk-LGCIIMFR.mjs} +2 -2
- package/dist/{chunk-FLGRRGVU.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-6NCLVPI7.mjs → chunk-TQJMU5BP.mjs} +13 -13
- 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-IWPBMZGE.mjs → chunk-V7VDW7IY.mjs} +4 -4
- package/dist/{chunk-QLCUQD3U.mjs → chunk-W2O6SKJU.mjs} +2 -2
- 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/index.cjs +18 -9
- 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 +11 -9
- package/dist/index.mjs.map +1 -1
- package/dist/internal/build-runtime.cjs +16 -9
- 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 +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.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 +1 -1
- 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 +5 -5
- package/dist/server.cjs +18 -9
- 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 +7 -5
- 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 +16 -9
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +5 -5
- package/package.json +1 -1
- package/dist/chunk-6NCLVPI7.mjs.map +0 -1
- package/dist/chunk-KEPCW6EI.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-MU2QKVYL.mjs.map → chunk-MP2SDRRB.mjs.map} +0 -0
- /package/dist/{chunk-VHYARVB7.mjs.map → chunk-TIESOJ7Z.mjs.map} +0 -0
- /package/dist/{chunk-IWPBMZGE.mjs.map → chunk-V7VDW7IY.mjs.map} +0 -0
- /package/dist/{chunk-QLCUQD3U.mjs.map → chunk-W2O6SKJU.mjs.map} +0 -0
package/dist/client.mjs
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
createClientPluginManager,
|
|
63
63
|
installChunkErrorRecovery,
|
|
64
64
|
isChunkLoadError
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-W2O6SKJU.mjs";
|
|
66
66
|
import "./chunk-GQVQESLY.mjs";
|
|
67
67
|
import {
|
|
68
68
|
api,
|
|
@@ -80,7 +80,7 @@ import "./chunk-RBRLLZL5.mjs";
|
|
|
80
80
|
import "./chunk-WZ5QFROO.mjs";
|
|
81
81
|
import "./chunk-7ZMKVETU.mjs";
|
|
82
82
|
import "./chunk-FXG2PS27.mjs";
|
|
83
|
-
import "./chunk-
|
|
83
|
+
import "./chunk-LGCIIMFR.mjs";
|
|
84
84
|
import "./chunk-CGILA3WO.mjs";
|
|
85
85
|
export {
|
|
86
86
|
APIClientError,
|
package/dist/index.cjs
CHANGED
|
@@ -256,6 +256,13 @@ function matchRoute(url, segments) {
|
|
|
256
256
|
function resolveAppPath(root, ...paths) {
|
|
257
257
|
return import_path.default.resolve(root, ...paths);
|
|
258
258
|
}
|
|
259
|
+
function toRootRelativeUrlPath(absolutePath, projectRoot) {
|
|
260
|
+
if (absolutePath === projectRoot) return "";
|
|
261
|
+
if (absolutePath.startsWith(`${projectRoot}/`) || absolutePath.startsWith(`${projectRoot}\\`)) {
|
|
262
|
+
return absolutePath.slice(projectRoot.length).replace(/\\/g, "/");
|
|
263
|
+
}
|
|
264
|
+
return void 0;
|
|
265
|
+
}
|
|
259
266
|
function toViteModuleId(filePath, root) {
|
|
260
267
|
if (!import_path.default.isAbsolute(filePath)) return filePath;
|
|
261
268
|
const relativePath2 = import_path.default.relative(root, filePath);
|
|
@@ -304,6 +311,7 @@ var init_utils = __esm({
|
|
|
304
311
|
__name(segmentsToPattern, "segmentsToPattern");
|
|
305
312
|
__name(matchRoute, "matchRoute");
|
|
306
313
|
__name(resolveAppPath, "resolveAppPath");
|
|
314
|
+
__name(toRootRelativeUrlPath, "toRootRelativeUrlPath");
|
|
307
315
|
__name(toViteModuleId, "toViteModuleId");
|
|
308
316
|
__name(fileExists, "fileExists");
|
|
309
317
|
__name(globFiles, "globFiles");
|
|
@@ -10544,9 +10552,8 @@ var init_route_manager = __esm({
|
|
|
10544
10552
|
return this.clientManifestCache.manifest;
|
|
10545
10553
|
}
|
|
10546
10554
|
const toUrlPath = /* @__PURE__ */ __name((absolutePath) => {
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
}
|
|
10555
|
+
const rootRelative = toRootRelativeUrlPath(absolutePath, normalizedProjectRoot);
|
|
10556
|
+
if (rootRelative !== void 0) return rootRelative;
|
|
10550
10557
|
if (import_path5.default.isAbsolute(absolutePath)) {
|
|
10551
10558
|
const normalized = absolutePath.replace(/\\/g, "/");
|
|
10552
10559
|
return normalized.startsWith("/") ? `/@fs${normalized}` : `/@fs/${normalized}`;
|
|
@@ -15188,7 +15195,7 @@ var init_server3 = __esm({
|
|
|
15188
15195
|
var version;
|
|
15189
15196
|
var init_package = __esm({
|
|
15190
15197
|
"package.json"() {
|
|
15191
|
-
version = "0.1.0-beta.
|
|
15198
|
+
version = "0.1.0-beta.46";
|
|
15192
15199
|
}
|
|
15193
15200
|
});
|
|
15194
15201
|
|
|
@@ -16236,7 +16243,7 @@ var init_renderer2 = __esm({
|
|
|
16236
16243
|
);
|
|
16237
16244
|
const clientLayouts = layouts.map((layout2, index) => ({
|
|
16238
16245
|
pattern: layout2.pattern,
|
|
16239
|
-
modulePath: layout2.modulePath
|
|
16246
|
+
modulePath: toRootRelativeUrlPath(layout2.modulePath, this.config.root) ?? layout2.modulePath,
|
|
16240
16247
|
shouldHydrate: layoutHydrationMetadata[index]?.shouldHydrate === true,
|
|
16241
16248
|
islandStrategy: layoutHydrationMetadata[index]?.islandStrategy ?? null
|
|
16242
16249
|
}));
|
|
@@ -16812,7 +16819,7 @@ var init_renderer2 = __esm({
|
|
|
16812
16819
|
const routeSlots = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
16813
16820
|
(slot) => ({
|
|
16814
16821
|
...slot,
|
|
16815
|
-
modulePath: typeof slot.modulePath === "string"
|
|
16822
|
+
modulePath: typeof slot.modulePath === "string" ? toRootRelativeUrlPath(slot.modulePath, this.config.root) ?? slot.modulePath : slot.modulePath
|
|
16816
16823
|
})
|
|
16817
16824
|
);
|
|
16818
16825
|
const deferredProps = prepareDeferredData({
|
|
@@ -16820,7 +16827,7 @@ var init_renderer2 = __esm({
|
|
|
16820
16827
|
slots: routeSlots
|
|
16821
16828
|
});
|
|
16822
16829
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
16823
|
-
const relativePath2 = pagePath ? pagePath
|
|
16830
|
+
const relativePath2 = pagePath ? toRootRelativeUrlPath(pagePath, this.config.root) ?? pagePath : "/src/app/page.tsx";
|
|
16824
16831
|
const deploymentId = this.getDeploymentId();
|
|
16825
16832
|
const bootstrapScript = `<script>
|
|
16826
16833
|
window.__FARM_PROPS__ = ${serializeInlineValue2(deferredProps.data.page)};
|
|
@@ -16916,7 +16923,7 @@ ${getFarmI18nClientSnapshot() ? `window.__FARM_I18N__ = ${serializeInlineValue2(
|
|
|
16916
16923
|
let didError = false;
|
|
16917
16924
|
const pagePath = req.__FARM_PAGE_PATH__;
|
|
16918
16925
|
const isClientComponent = req.__FARM_IS_CLIENT_COMPONENT__ === true;
|
|
16919
|
-
const relativePath2 = pagePath ? pagePath
|
|
16926
|
+
const relativePath2 = pagePath ? toRootRelativeUrlPath(pagePath, this.config.root) ?? pagePath : "/src/app/page.tsx";
|
|
16920
16927
|
const manifest = options.routeManifest ?? this.routeManager.generateClientManifest(this.config.root);
|
|
16921
16928
|
const clientManifest = {
|
|
16922
16929
|
clientEntry: "/@farm/client.js",
|
|
@@ -16964,7 +16971,7 @@ ${getFarmI18nClientSnapshot() ? `window.__FARM_I18N__ = ${serializeInlineValue2(
|
|
|
16964
16971
|
const routeSlotPayload = (req.__FARM_ROUTE_SLOTS__ || []).map(
|
|
16965
16972
|
(slot) => ({
|
|
16966
16973
|
...slot,
|
|
16967
|
-
modulePath: typeof slot.modulePath === "string"
|
|
16974
|
+
modulePath: typeof slot.modulePath === "string" ? toRootRelativeUrlPath(slot.modulePath, this.config.root) ?? slot.modulePath : slot.modulePath
|
|
16968
16975
|
})
|
|
16969
16976
|
);
|
|
16970
16977
|
const deferredProps = prepareDeferredData({
|
|
@@ -34212,6 +34219,7 @@ __export(src_exports, {
|
|
|
34212
34219
|
storageCacheAdapter: () => storageCacheAdapter,
|
|
34213
34220
|
titleFromMarkdown: () => titleFromMarkdown,
|
|
34214
34221
|
toFormData: () => toFormData,
|
|
34222
|
+
toRootRelativeUrlPath: () => toRootRelativeUrlPath,
|
|
34215
34223
|
toViteModuleId: () => toViteModuleId,
|
|
34216
34224
|
toggleTheme: () => toggleTheme,
|
|
34217
34225
|
unstable_cache: () => unstable_cache,
|
|
@@ -50297,6 +50305,7 @@ __name(decodeCookiePart, "decodeCookiePart");
|
|
|
50297
50305
|
storageCacheAdapter,
|
|
50298
50306
|
titleFromMarkdown,
|
|
50299
50307
|
toFormData,
|
|
50308
|
+
toRootRelativeUrlPath,
|
|
50300
50309
|
toViteModuleId,
|
|
50301
50310
|
toggleTheme,
|
|
50302
50311
|
unstable_cache,
|