fimo 0.11.0-staging.2 → 0.11.0-staging.4
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/assets/skills/fimo-cli/references/content.md +2 -0
- package/assets/skills/fimo-code/references/content.md +1 -0
- package/assets/skills/fimo-code/references/setup-plain-vite.md +8 -7
- package/assets/skills/fimo-code/references/setup-react-router.md +5 -0
- package/assets/skills/fimo-studio/references/ai-chat.md +8 -2
- package/assets/skills/fimo-studio/references/publish-and-deploy.md +2 -1
- package/dist/cli/bundle.json +1 -1
- package/dist/cli/index.js +11 -11
- package/dist/runtime/app/FimoProviders.js +18 -8
- package/package.json +3 -3
- package/templates/react-router/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { QueryClient, QueryClientContext, QueryClientProvider } from '@tanstack/react-query';
|
|
3
|
+
import { Suspense, useCallback, useContext, useEffect, useMemo, useRef } from 'react';
|
|
3
4
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
4
5
|
import { useLocation, useNavigate } from 'react-router';
|
|
5
6
|
// @ts-ignore - virtual module provided by fimoConfigPlugin in fimo/vite
|
|
@@ -13,7 +14,7 @@ import { getFimoTextDirection, resolveFimoLocale, toHtmlLang } from '../i18n/loc
|
|
|
13
14
|
import { ScreenshotProvider } from '../iframe/ScreenshotProvider.js';
|
|
14
15
|
import { OptionalTracking } from '../t/OptionalTracking.js';
|
|
15
16
|
const titleCase = (seg) => seg
|
|
16
|
-
.replace(/[_
|
|
17
|
+
.replace(/[_-]+/g, ' ')
|
|
17
18
|
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
18
19
|
.split(/\s+/)
|
|
19
20
|
.filter(Boolean)
|
|
@@ -80,6 +81,15 @@ function PreviewBridge() {
|
|
|
80
81
|
}, [navigate, sendRoutes, sendLocationChange]);
|
|
81
82
|
return null;
|
|
82
83
|
}
|
|
84
|
+
function EnsureQueryClient({ children }) {
|
|
85
|
+
const existingQueryClient = useContext(QueryClientContext);
|
|
86
|
+
const fallbackQueryClientRef = useRef(null);
|
|
87
|
+
if (existingQueryClient) {
|
|
88
|
+
return _jsx(_Fragment, { children: children });
|
|
89
|
+
}
|
|
90
|
+
const fallbackQueryClient = fallbackQueryClientRef.current ?? (fallbackQueryClientRef.current = new QueryClient());
|
|
91
|
+
return _jsx(QueryClientProvider, { client: fallbackQueryClient, children: children });
|
|
92
|
+
}
|
|
83
93
|
export function FimoProviders({ children, locale }) {
|
|
84
94
|
const location = useLocation();
|
|
85
95
|
const localeResolution = useMemo(() => resolveFimoLocale({ pathname: location.pathname }, fimoConfig), [location.pathname]);
|
|
@@ -92,9 +102,9 @@ export function FimoProviders({ children, locale }) {
|
|
|
92
102
|
document.documentElement.lang = toHtmlLang(activeLocale);
|
|
93
103
|
document.documentElement.dir = activeDir;
|
|
94
104
|
}, [activeDir, activeLocale]);
|
|
95
|
-
return (_jsx(ErrorBoundary, { FallbackComponent: AppErrorBoundary, onError: onError, children: _jsx(FimoLocaleProvider, { value: {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
105
|
+
return (_jsx(ErrorBoundary, { FallbackComponent: AppErrorBoundary, onError: onError, children: _jsx(EnsureQueryClient, { children: _jsx(FimoLocaleProvider, { value: {
|
|
106
|
+
...localeResolution,
|
|
107
|
+
locale: activeLocale,
|
|
108
|
+
dir: activeDir,
|
|
109
|
+
}, children: _jsx(DataSourcesProvider, { children: _jsx(ScreenshotProvider, { children: _jsx(ViteLifecycles, { children: _jsxs(RefreshContentProvider, { children: [_jsx(PreviewBridge, {}), _jsx(OptionalTracking, { routes: getDisplayRoutes() }), _jsx(Suspense, { children: children })] }) }) }) }) }) }) }));
|
|
100
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fimo",
|
|
3
|
-
"version": "0.11.0-staging.
|
|
3
|
+
"version": "0.11.0-staging.4",
|
|
4
4
|
"description": "Fimo CLI - create, deploy, and manage Fimo projects",
|
|
5
5
|
"bin": {
|
|
6
6
|
"fimo": "dist/cli/index.js"
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
101
|
"@tanstack/react-query": "^5.80.6",
|
|
102
|
-
"react": "^19.0.0",
|
|
103
|
-
"react-dom": "^19.0.0",
|
|
102
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
103
|
+
"react-dom": "^18.2.0 || ^19.0.0",
|
|
104
104
|
"react-router": "^7.0.0 || ^8.0.0",
|
|
105
105
|
"vite": "^7.0.0 || ^8.0.0"
|
|
106
106
|
},
|