@multiplatform.one/core 7.7.4 → 7.8.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 +32 -6
- package/types/app/CreateApp.d.ts +15 -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.8.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/
|
|
51
|
-
"@multiplatform.one/
|
|
52
|
-
"@multiplatform.one/
|
|
53
|
-
"@multiplatform.one/
|
|
54
|
-
"@multiplatform.one/theme": "7.
|
|
50
|
+
"@multiplatform.one/platform": "7.8.0",
|
|
51
|
+
"@multiplatform.one/store": "7.8.0",
|
|
52
|
+
"@multiplatform.one/i18n": "7.8.0",
|
|
53
|
+
"@multiplatform.one/logger": "7.8.0",
|
|
54
|
+
"@multiplatform.one/theme": "7.8.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/
|
|
72
|
-
"@multiplatform.one/
|
|
71
|
+
"@multiplatform.one/web3": "7.8.0",
|
|
72
|
+
"@multiplatform.one/frappe": "7.8.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.8.0",
|
|
89
|
+
"@multiplatform.one/frappe-ui": "^7.8.0",
|
|
90
|
+
"@multiplatform.one/web3": "^7.8.0",
|
|
91
|
+
"@multiplatform.one/keycloak": "^7.8.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
|
/**
|
|
@@ -125,11 +129,21 @@ export interface FrappeConfig {
|
|
|
125
129
|
* Omit in production behind a reverse proxy.
|
|
126
130
|
*/
|
|
127
131
|
socketPort?: number;
|
|
132
|
+
/** False keeps HTTP collection reads without Socket.IO realtime. */
|
|
133
|
+
realtime?: boolean;
|
|
128
134
|
auth?: {
|
|
129
135
|
useToken?: boolean;
|
|
130
136
|
token?: string | (() => string | Promise<string>);
|
|
131
137
|
type?: string;
|
|
132
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;
|
|
133
147
|
}
|
|
134
148
|
|
|
135
149
|
export interface Web3AppConfig {
|
|
@@ -334,14 +348,20 @@ export function createApp(appConfig: CreateAppConfig) {
|
|
|
334
348
|
const cfg: FrappeConfig = appConfig.frappe === true ? {} : appConfig.frappe;
|
|
335
349
|
|
|
336
350
|
function FrappeProviderWrapper({ children }: PropsWithChildren) {
|
|
337
|
-
|
|
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");
|
|
338
354
|
if (!enabled) return children;
|
|
339
355
|
|
|
340
356
|
// LAN dev: a loopback-configured bench follows the page origin's host
|
|
341
357
|
// (the Socket.IO URL derives from baseURL too, so realtime follows).
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
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;
|
|
345
365
|
const socketPort =
|
|
346
366
|
cfg.socketPort ?? (Number(config.get("FRAPPE_SOCKETIO_PORT")) || undefined);
|
|
347
367
|
|
|
@@ -369,7 +389,13 @@ export function createApp(appConfig: CreateAppConfig) {
|
|
|
369
389
|
: undefined);
|
|
370
390
|
|
|
371
391
|
return (
|
|
372
|
-
<FrappeProvider
|
|
392
|
+
<FrappeProvider
|
|
393
|
+
baseURL={baseURL}
|
|
394
|
+
realtime={cfg.realtime}
|
|
395
|
+
socketPort={socketPort}
|
|
396
|
+
auth={auth}
|
|
397
|
+
fixtures={cfg.fixtures}
|
|
398
|
+
>
|
|
373
399
|
{children}
|
|
374
400
|
</FrappeProvider>
|
|
375
401
|
);
|
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
|
/**
|
|
@@ -86,11 +90,21 @@ export interface FrappeConfig {
|
|
|
86
90
|
* Omit in production behind a reverse proxy.
|
|
87
91
|
*/
|
|
88
92
|
socketPort?: number;
|
|
93
|
+
/** False keeps HTTP collection reads without Socket.IO realtime. */
|
|
94
|
+
realtime?: boolean;
|
|
89
95
|
auth?: {
|
|
90
96
|
useToken?: boolean;
|
|
91
97
|
token?: string | (() => string | Promise<string>);
|
|
92
98
|
type?: string;
|
|
93
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;
|
|
94
108
|
}
|
|
95
109
|
export interface Web3AppConfig {
|
|
96
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,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