@multiplatform.one/core 7.7.6 → 7.10.0
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/package.json +12 -12
- package/src/app/CreateApp.tsx +24 -5
- package/types/app/CreateApp.d.ts +13 -1
- package/types/app/CreateApp.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/core",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.10.0",
|
|
4
4
|
"description": "Core framework shell, provider composition, and layout factories for multiplatform.one",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"@tanstack/react-devtools": "^0.10.2",
|
|
48
48
|
"@tanstack/react-form-devtools": "0.2.22",
|
|
49
49
|
"react-cookie": "^8.1.2",
|
|
50
|
-
"@multiplatform.one/i18n": "7.
|
|
51
|
-
"@multiplatform.one/
|
|
52
|
-
"@multiplatform.one/
|
|
53
|
-
"@multiplatform.one/
|
|
54
|
-
"@multiplatform.one/
|
|
50
|
+
"@multiplatform.one/i18n": "7.10.0",
|
|
51
|
+
"@multiplatform.one/theme": "7.10.0",
|
|
52
|
+
"@multiplatform.one/store": "7.10.0",
|
|
53
|
+
"@multiplatform.one/platform": "7.10.0",
|
|
54
|
+
"@multiplatform.one/logger": "7.10.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@sentry/react": "^10.51.0",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"tamagui": "2.7.6",
|
|
69
69
|
"typescript": "~5.9.3",
|
|
70
70
|
"vitest": "^4.1.5",
|
|
71
|
-
"@multiplatform.one/frappe": "7.
|
|
72
|
-
"@multiplatform.one/web3": "7.
|
|
71
|
+
"@multiplatform.one/frappe": "7.10.0",
|
|
72
|
+
"@multiplatform.one/web3": "7.10.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@sentry/react": "^9.0.0",
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
"react-native-gesture-handler": ">=2.0.0",
|
|
86
86
|
"react-native-safe-area-context": ">=4.0.0",
|
|
87
87
|
"tamagui": "^2.0.0-rc",
|
|
88
|
-
"@multiplatform.one/frappe": "^7.
|
|
89
|
-
"@multiplatform.one/frappe-ui": "^7.
|
|
90
|
-
"@multiplatform.one/
|
|
91
|
-
"@multiplatform.one/
|
|
88
|
+
"@multiplatform.one/frappe": "^7.10.0",
|
|
89
|
+
"@multiplatform.one/frappe-ui": "^7.10.0",
|
|
90
|
+
"@multiplatform.one/web3": "^7.10.0",
|
|
91
|
+
"@multiplatform.one/keycloak": "^7.10.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependenciesMeta": {
|
|
94
94
|
"@multiplatform.one/web3": {
|
package/src/app/CreateApp.tsx
CHANGED
|
@@ -11,6 +11,7 @@ import { config, isWeb } from "@multiplatform.one/platform";
|
|
|
11
11
|
import type { ThemeConfig } from "@multiplatform.one/theme";
|
|
12
12
|
import { ThemeProvider } from "@multiplatform.one/theme";
|
|
13
13
|
import { FrappeProvider } from "@multiplatform.one/frappe-ui";
|
|
14
|
+
import type { FixtureProvider } from "@multiplatform.one/frappe";
|
|
14
15
|
import { createTanstackProvider } from "./TanstackProvider";
|
|
15
16
|
// Platform-split: native -> bridge-only web3 via the `/native` subpath (no connectkit
|
|
16
17
|
// in Hermes); web -> passthrough (web mounts the provider at screen scope). Importing a
|
|
@@ -117,7 +118,10 @@ export interface KeycloakConfig {
|
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
export interface FrappeConfig {
|
|
120
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Force-enable or disable. When omitted, `fixtures` enables the provider on
|
|
123
|
+
* its own; otherwise FRAPPE_ENABLED is read from env config.
|
|
124
|
+
*/
|
|
121
125
|
enabled?: boolean;
|
|
122
126
|
baseURL?: string;
|
|
123
127
|
/**
|
|
@@ -132,6 +136,14 @@ export interface FrappeConfig {
|
|
|
132
136
|
token?: string | (() => string | Promise<string>);
|
|
133
137
|
type?: string;
|
|
134
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* Fixture corpus every Frappe read and write is served from — the whole
|
|
141
|
+
* app runs with no bench and no network. Setting it enables the provider
|
|
142
|
+
* on its own and turns OFF the baseURL fallbacks: only an explicitly
|
|
143
|
+
* configured `baseURL` rides along, so a stray BASE_URL cannot send
|
|
144
|
+
* fixture-mode reads at the app's own origin.
|
|
145
|
+
*/
|
|
146
|
+
fixtures?: FixtureProvider;
|
|
135
147
|
}
|
|
136
148
|
|
|
137
149
|
export interface Web3AppConfig {
|
|
@@ -336,14 +348,20 @@ export function createApp(appConfig: CreateAppConfig) {
|
|
|
336
348
|
const cfg: FrappeConfig = appConfig.frappe === true ? {} : appConfig.frappe;
|
|
337
349
|
|
|
338
350
|
function FrappeProviderWrapper({ children }: PropsWithChildren) {
|
|
339
|
-
|
|
351
|
+
// A fixture corpus is an explicit opt-in, so it enables the provider
|
|
352
|
+
// without FRAPPE_ENABLED=1 in .env.
|
|
353
|
+
const enabled = cfg.enabled ?? (!!cfg.fixtures || config.get("FRAPPE_ENABLED") === "1");
|
|
340
354
|
if (!enabled) return children;
|
|
341
355
|
|
|
342
356
|
// LAN dev: a loopback-configured bench follows the page origin's host
|
|
343
357
|
// (the Socket.IO URL derives from baseURL too, so realtime follows).
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
358
|
+
// Fixture mode takes NO fallback: BASE_URL is the app's own origin and
|
|
359
|
+
// localhost:8000 is a bench that is not running, and dialling either
|
|
360
|
+
// would turn a fixtures-only app's misses into failed requests.
|
|
361
|
+
const configured = cfg.fixtures
|
|
362
|
+
? cfg.baseURL
|
|
363
|
+
: cfg.baseURL || config.get("BASE_URL") || "http://localhost:8000";
|
|
364
|
+
const baseURL = configured ? followPageOriginForLoopback(configured) : undefined;
|
|
347
365
|
const socketPort =
|
|
348
366
|
cfg.socketPort ?? (Number(config.get("FRAPPE_SOCKETIO_PORT")) || undefined);
|
|
349
367
|
|
|
@@ -376,6 +394,7 @@ export function createApp(appConfig: CreateAppConfig) {
|
|
|
376
394
|
realtime={cfg.realtime}
|
|
377
395
|
socketPort={socketPort}
|
|
378
396
|
auth={auth}
|
|
397
|
+
fixtures={cfg.fixtures}
|
|
379
398
|
>
|
|
380
399
|
{children}
|
|
381
400
|
</FrappeProvider>
|
package/types/app/CreateApp.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ComponentType, type PropsWithChildren } from "react";
|
|
2
2
|
import type { ThemeConfig } from "@multiplatform.one/theme";
|
|
3
|
+
import type { FixtureProvider } from "@multiplatform.one/frappe";
|
|
3
4
|
export type ProviderComponent = ComponentType<PropsWithChildren>;
|
|
4
5
|
/**
|
|
5
6
|
* Follow the page origin when a loopback-configured backend is opened from a
|
|
@@ -78,7 +79,10 @@ export interface KeycloakConfig {
|
|
|
78
79
|
expoScheme?: string;
|
|
79
80
|
}
|
|
80
81
|
export interface FrappeConfig {
|
|
81
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Force-enable or disable. When omitted, `fixtures` enables the provider on
|
|
84
|
+
* its own; otherwise FRAPPE_ENABLED is read from env config.
|
|
85
|
+
*/
|
|
82
86
|
enabled?: boolean;
|
|
83
87
|
baseURL?: string;
|
|
84
88
|
/**
|
|
@@ -93,6 +97,14 @@ export interface FrappeConfig {
|
|
|
93
97
|
token?: string | (() => string | Promise<string>);
|
|
94
98
|
type?: string;
|
|
95
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* Fixture corpus every Frappe read and write is served from — the whole
|
|
102
|
+
* app runs with no bench and no network. Setting it enables the provider
|
|
103
|
+
* on its own and turns OFF the baseURL fallbacks: only an explicitly
|
|
104
|
+
* configured `baseURL` rides along, so a stray BASE_URL cannot send
|
|
105
|
+
* fixture-mode reads at the app's own origin.
|
|
106
|
+
*/
|
|
107
|
+
fixtures?: FixtureProvider;
|
|
96
108
|
}
|
|
97
109
|
export interface Web3AppConfig {
|
|
98
110
|
/** Force-enable or disable. When omitted, reads WEB3_ENABLED from env config. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateApp.d.ts","sourceRoot":"","sources":["../../src/app/CreateApp.tsx"],"names":[],"mappings":"AAAA,OAAc,EAKZ,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAEvB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"CreateApp.d.ts","sourceRoot":"","sources":["../../src/app/CreateApp.tsx"],"names":[],"mappings":"AAAA,OAAc,EAKZ,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAEvB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAQjE,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC;AAIjE;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAWtE;AAMD,MAAM,WAAW,cAAc;IAC7B,gFAAgF;IAChF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wDAAwD;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM;QACpB,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;QACrC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;QACxB,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,KAAK,IAAI,CAA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