fimo 0.21.0-staging.4 → 0.21.0-staging.6
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/SKILL.md +1 -1
- package/assets/skills/fimo-cli/SKILL.md +1 -1
- package/assets/skills/fimo-cli/references/assets.md +25 -1
- package/assets/skills/fimo-cli/references/branches.md +4 -1
- package/assets/skills/fimo-cli/references/forms.md +1 -1
- package/assets/skills/fimo-cli/references/init.md +17 -5
- package/assets/skills/fimo-cli/references/integrations.md +24 -0
- package/assets/skills/fimo-cli/references/mcp.md +98 -57
- package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +3 -1
- package/assets/skills/fimo-cli/references/projects.md +2 -2
- package/assets/skills/fimo-code/assets/react-router-locales/navigation.tsx +1 -1
- package/assets/skills/fimo-code/references/assets.md +2 -2
- package/assets/skills/fimo-code/references/best-practices/next.md +1 -1
- package/assets/skills/fimo-code/references/forms.md +1 -1
- package/assets/skills/fimo-code/references/frameworks/astro.md +8 -2
- package/assets/skills/fimo-code/references/frameworks/compatibility.md +9 -9
- package/assets/skills/fimo-code/references/frameworks/hosting.md +17 -13
- package/assets/skills/fimo-code/references/frameworks/next/app-router.md +8 -9
- package/assets/skills/fimo-code/references/frameworks/next/locales.md +1 -1
- package/assets/skills/fimo-code/references/frameworks/next/pages-router.md +5 -5
- package/assets/skills/fimo-code/references/frameworks/next.md +41 -32
- package/assets/skills/fimo-code/references/frameworks/react-router.md +8 -6
- package/assets/skills/fimo-code/references/frameworks/sveltekit.md +19 -10
- package/assets/skills/fimo-code/references/frameworks/vite-react.md +7 -5
- package/assets/skills/fimo-code/references/labels.md +4 -4
- package/assets/skills/fimo-code/references/ui.md +4 -4
- package/assets/skills/fimo-migration/references/frameworks/nextjs.md +12 -15
- package/assets/skills/fimo-migration/references/media.md +4 -2
- package/assets/skills/fimo-migration/references/qa.md +10 -8
- package/assets/skills/fimo-migration/references/workers/content-planner.md +20 -10
- package/assets/skills/fimo-migration/references/workflow.md +8 -6
- package/assets/skills/fimo-migration/scripts/retrieval/strapi/public-content.mjs +243 -0
- package/assets/skills/fimo-migration/scripts/retrieval/strapi/source-schema.mjs +148 -0
- package/assets/skills/fimo-studio/SKILL.md +3 -1
- package/assets/skills/fimo-studio/references/command-palette.md +8 -3
- package/assets/skills/fimo-studio/references/connections.md +52 -0
- package/assets/skills/fimo-studio/references/webhooks.md +1 -1
- package/assets/starters/fimo-site/template/src/pages/Contact.tsx +1 -1
- package/assets/starters/fimo-site/template/src/pages/SiteContent.tsx +1 -1
- package/assets/starters/fimo-site/template/src/schemas/HomePage.ts +3 -3
- package/assets/starters/fimo-site/template/src/schemas/HomePage.types.ts +1 -1
- package/dist/build/astro/config.d.ts +13 -2
- package/dist/build/astro/config.js +9 -24
- package/dist/build/next/moved.d.ts +2 -0
- package/dist/build/next/moved.js +2 -0
- package/dist/build/react/router-moved.d.ts +2 -0
- package/dist/build/react/router-moved.js +2 -0
- package/dist/build/react/router-preset-moved.d.ts +2 -0
- package/dist/build/react/router-preset-moved.js +2 -0
- package/dist/build/react/router-routes-moved.d.ts +2 -0
- package/dist/build/react/router-routes-moved.js +2 -0
- package/dist/build/react/ui-moved.d.ts +2 -0
- package/dist/build/react/ui-moved.js +2 -0
- package/dist/build/react/vite-moved.d.ts +2 -0
- package/dist/build/react/vite-moved.js +2 -0
- package/dist/build/sveltekit/config.d.ts +5 -4
- package/dist/build/sveltekit/config.js +6 -15
- package/dist/build/sveltekit/moved.d.ts +13 -0
- package/dist/build/sveltekit/moved.js +3 -0
- package/dist/build/vite/data-id.d.ts +11 -0
- package/dist/build/vite/data-id.js +20 -0
- package/dist/build/vite/plugins/runtime-env.d.ts +1 -1
- package/dist/build/vite/plugins/runtime-env.js +6 -2
- package/dist/build/vite/runtime-env.d.ts +2 -0
- package/dist/build/vite/runtime-env.js +1 -0
- package/dist/cli/bundle.json +1 -1
- package/dist/cli/index.js +82 -86
- package/dist/runtime/content/client/internal.js +1 -1
- package/dist/runtime/content/index.d.ts +6 -1
- package/dist/runtime/content/index.js +6 -0
- package/dist/runtime/i18n/index.d.ts +2 -0
- package/dist/runtime/i18n/index.js +1 -0
- package/dist/runtime/labels/index.d.ts +3 -0
- package/dist/runtime/labels/index.js +2 -0
- package/dist/runtime/preview/index.d.ts +5 -0
- package/dist/runtime/preview/index.js +4 -0
- package/dist/runtime/primitives/lib/index.d.ts +2 -0
- package/dist/runtime/primitives/lib/index.js +2 -0
- package/dist/runtime/seo/index.d.ts +0 -8
- package/dist/runtime/seo/index.js +0 -8
- package/dist/runtime/shared/config.d.ts +6 -0
- package/dist/runtime/shared/config.js +4 -0
- package/dist/runtime/shared/local-runtime-env.d.ts +2 -2
- package/dist/runtime/shared/local-runtime-env.js +7 -5
- package/dist/runtime/templates.d.ts +21 -5
- package/dist/runtime/templates.js +61 -19
- package/dist/scripts/extract-translations.js +8 -3
- package/dist/scripts/index.d.ts +3 -0
- package/dist/scripts/index.js +2 -0
- package/dist/scripts/sync-forms.js +21 -9
- package/dist/scripts/sync-schemas.js +45 -21
- package/package.json +76 -82
- package/templates/astro/astro.config.mjs +1 -1
- package/templates/astro/package.json +2 -1
- package/templates/nextjs/AGENTS.md +1 -1
- package/templates/nextjs/next.config.ts +1 -1
- package/templates/nextjs/package.json +2 -1
- package/templates/nextjs/src/app/layout.tsx +1 -1
- package/templates/react-router/package.json +3 -1
- package/templates/react-router/react-router.config.ts +1 -1
- package/templates/react-router/src/pages/LocaleLayout.tsx +1 -1
- package/templates/react-router/src/pages/legal/LegalPage.tsx +1 -1
- package/templates/react-router/src/root.tsx +1 -1
- package/templates/react-router/vite.config.ts +1 -1
- package/templates/sveltekit/package.json +2 -1
- package/templates/sveltekit/src/error.html +51 -0
- package/templates/sveltekit/src/routes/+error.svelte +50 -0
- package/templates/sveltekit/src/routes/+layout.server.ts +1 -1
- package/templates/sveltekit/src/routes/+layout.svelte +1 -1
- package/templates/sveltekit/svelte.config.js +1 -1
- package/templates/sveltekit/vite.config.ts +1 -1
- package/templates/vite/.fimo/config.json +28 -0
- package/templates/vite/AGENTS.md +43 -0
- package/templates/vite/CLAUDE.md +5 -0
- package/templates/vite/_gitignore +13 -0
- package/templates/vite/index.html +12 -0
- package/templates/vite/package.json +32 -0
- package/templates/vite/pnpm-workspace.yaml +8 -0
- package/templates/vite/src/App.tsx +14 -0
- package/templates/vite/src/LocaleLayout.tsx +12 -0
- package/templates/vite/src/index.css +61 -0
- package/templates/vite/src/main.tsx +20 -0
- package/templates/vite/src/vite-env.d.ts +1 -0
- package/templates/vite/tsconfig.json +17 -0
- package/templates/vite/vite.config.ts +7 -0
- package/assets/sveltekit/components/Boolean.svelte +0 -19
- package/assets/sveltekit/components/Date.svelte +0 -33
- package/assets/sveltekit/components/DateTime.svelte +0 -35
- package/assets/sveltekit/components/FimoProvider.svelte +0 -35
- package/assets/sveltekit/components/Image.svelte +0 -80
- package/assets/sveltekit/components/Json.svelte +0 -18
- package/assets/sveltekit/components/Label.svelte +0 -16
- package/assets/sveltekit/components/Number.svelte +0 -21
- package/assets/sveltekit/components/RichText.svelte +0 -19
- package/assets/sveltekit/components/Text.svelte +0 -30
- package/assets/sveltekit/components/Video.svelte +0 -37
- package/assets/sveltekit/components/index.d.ts +0 -11
- package/assets/sveltekit/components/index.js +0 -11
- package/dist/build/next/config.d.ts +0 -17
- package/dist/build/next/config.js +0 -66
- package/dist/build/sveltekit/data-id.d.ts +0 -3
- package/dist/build/sveltekit/data-id.js +0 -171
- package/dist/build/sveltekit/files/edge.js +0 -68
- package/dist/build/sveltekit/files/serverless.js +0 -42
- package/dist/build/sveltekit/vite.d.ts +0 -12
- package/dist/build/sveltekit/vite.js +0 -14
- package/dist/build/vite/index.d.ts +0 -42
- package/dist/build/vite/index.js +0 -160
- package/dist/build/vite/plugins/content-sync.d.ts +0 -11
- package/dist/build/vite/plugins/content-sync.js +0 -41
- package/dist/build/vite/plugins/data-id.d.ts +0 -12
- package/dist/build/vite/plugins/data-id.js +0 -109
- package/dist/build/vite/plugins/fimo-config.d.ts +0 -12
- package/dist/build/vite/plugins/fimo-config.js +0 -68
- package/dist/build/vite/plugins/overlay.d.ts +0 -3
- package/dist/build/vite/plugins/overlay.js +0 -154
- package/dist/build/vite/plugins/robots.d.ts +0 -10
- package/dist/build/vite/plugins/robots.js +0 -56
- package/dist/build/vite/plugins/seo.d.ts +0 -3
- package/dist/build/vite/plugins/seo.js +0 -112
- package/dist/build/vite/plugins/server-config.d.ts +0 -3
- package/dist/build/vite/plugins/server-config.js +0 -36
- package/dist/build/vite/plugins/sitemap.d.ts +0 -3
- package/dist/build/vite/plugins/sitemap.js +0 -73
- package/dist/build/vite/plugins/translations.d.ts +0 -11
- package/dist/build/vite/plugins/translations.js +0 -601
- package/dist/runtime/app/FimoProviders.d.ts +0 -30
- package/dist/runtime/app/FimoProviders.js +0 -193
- package/dist/runtime/app/FimoScripts.d.ts +0 -13
- package/dist/runtime/app/FimoScripts.js +0 -45
- package/dist/runtime/app/index.d.ts +0 -8
- package/dist/runtime/app/index.js +0 -4
- package/dist/runtime/app/prefetch.d.ts +0 -9
- package/dist/runtime/app/prefetch.js +0 -39
- package/dist/runtime/content/DataSourcesProvider.d.ts +0 -4
- package/dist/runtime/content/DataSourcesProvider.js +0 -63
- package/dist/runtime/content/RefreshContentProvider.d.ts +0 -19
- package/dist/runtime/content/RefreshContentProvider.js +0 -71
- package/dist/runtime/content/client/createContentClient.d.ts +0 -7
- package/dist/runtime/content/client/createContentClient.js +0 -7
- package/dist/runtime/content/client/createSingletonClient.d.ts +0 -5
- package/dist/runtime/content/client/createSingletonClient.js +0 -6
- package/dist/runtime/content/client/react-content-client.d.ts +0 -10
- package/dist/runtime/content/client/react-content-client.js +0 -165
- package/dist/runtime/content/client/react-singleton-client.d.ts +0 -7
- package/dist/runtime/content/client/react-singleton-client.js +0 -38
- package/dist/runtime/content/client/types.d.ts +0 -42
- package/dist/runtime/content/client/types.js +0 -1
- package/dist/runtime/content/client/useQueryLocale.d.ts +0 -2
- package/dist/runtime/content/client/useQueryLocale.js +0 -5
- package/dist/runtime/content/client/vite-runtime.d.ts +0 -3
- package/dist/runtime/content/client/vite-runtime.js +0 -23
- package/dist/runtime/content/utils/retrieve-data-sources.d.ts +0 -29
- package/dist/runtime/content/utils/retrieve-data-sources.js +0 -107
- package/dist/runtime/core/AppErrorBoundary.d.ts +0 -10
- package/dist/runtime/core/AppErrorBoundary.js +0 -27
- package/dist/runtime/core/ViteLifecycles.d.ts +0 -5
- package/dist/runtime/core/ViteLifecycles.js +0 -35
- package/dist/runtime/i18n/FimoLocaleContext.d.ts +0 -9
- package/dist/runtime/i18n/FimoLocaleContext.js +0 -17
- package/dist/runtime/iframe/ConsoleErrorProvider.d.ts +0 -3
- package/dist/runtime/iframe/ConsoleErrorProvider.js +0 -103
- package/dist/runtime/iframe/ScreenshotProvider.d.ts +0 -3
- package/dist/runtime/iframe/ScreenshotProvider.js +0 -60
- package/dist/runtime/iframe/runtime/overlay-hmr.d.ts +0 -2
- package/dist/runtime/iframe/runtime/overlay-hmr.js +0 -27
- package/dist/runtime/iframe/runtime/overlay-runtime.d.ts +0 -2
- package/dist/runtime/iframe/runtime/overlay-runtime.js +0 -103
- package/dist/runtime/index.d.ts +0 -22
- package/dist/runtime/index.js +0 -23
- package/dist/runtime/next/client-runtime.d.ts +0 -3
- package/dist/runtime/next/client-runtime.js +0 -24
- package/dist/runtime/next/client.d.ts +0 -28
- package/dist/runtime/next/client.js +0 -25
- package/dist/runtime/next/facade.d.ts +0 -8
- package/dist/runtime/next/facade.js +0 -34
- package/dist/runtime/next/labels.d.ts +0 -7
- package/dist/runtime/next/labels.js +0 -9
- package/dist/runtime/next/preview.d.ts +0 -13
- package/dist/runtime/next/preview.js +0 -34
- package/dist/runtime/next/primitives/Text.d.ts +0 -10
- package/dist/runtime/next/primitives/Text.js +0 -18
- package/dist/runtime/next/primitives/server.d.ts +0 -11
- package/dist/runtime/next/primitives/server.js +0 -54
- package/dist/runtime/next/provider.d.ts +0 -13
- package/dist/runtime/next/provider.js +0 -54
- package/dist/runtime/next/server-runtime.d.ts +0 -3
- package/dist/runtime/next/server-runtime.js +0 -23
- package/dist/runtime/next/server.d.ts +0 -21
- package/dist/runtime/next/server.js +0 -16
- package/dist/runtime/primitives/index.d.ts +0 -16
- package/dist/runtime/primitives/index.js +0 -17
- package/dist/runtime/react/primitives/contracts.d.ts +0 -100
- package/dist/runtime/react/primitives/contracts.js +0 -1
- package/dist/runtime/react/primitives/editable/Boolean.d.ts +0 -5
- package/dist/runtime/react/primitives/editable/Boolean.js +0 -11
- package/dist/runtime/react/primitives/editable/Date.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/Date.js +0 -12
- package/dist/runtime/react/primitives/editable/DateTime.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/DateTime.js +0 -13
- package/dist/runtime/react/primitives/editable/Image.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/Image.js +0 -10
- package/dist/runtime/react/primitives/editable/Json.d.ts +0 -5
- package/dist/runtime/react/primitives/editable/Json.js +0 -11
- package/dist/runtime/react/primitives/editable/RichText.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/RichText.js +0 -11
- package/dist/runtime/react/primitives/editable/Text.d.ts +0 -20
- package/dist/runtime/react/primitives/editable/Text.js +0 -36
- package/dist/runtime/react/primitives/editable/Video.d.ts +0 -4
- package/dist/runtime/react/primitives/editable/Video.js +0 -10
- package/dist/runtime/react/primitives/renderers/DateRenderer.d.ts +0 -17
- package/dist/runtime/react/primitives/renderers/DateRenderer.js +0 -17
- package/dist/runtime/react/primitives/renderers/ImageRenderer.d.ts +0 -8
- package/dist/runtime/react/primitives/renderers/ImageRenderer.js +0 -31
- package/dist/runtime/react/primitives/renderers/RichTextRenderer.d.ts +0 -12
- package/dist/runtime/react/primitives/renderers/RichTextRenderer.js +0 -135
- package/dist/runtime/react/primitives/renderers/StaticImage.d.ts +0 -35
- package/dist/runtime/react/primitives/renderers/StaticImage.js +0 -58
- package/dist/runtime/react/primitives/renderers/VideoRenderer.d.ts +0 -8
- package/dist/runtime/react/primitives/renderers/VideoRenderer.js +0 -10
- package/dist/runtime/react/useFimoLiveValue.d.ts +0 -20
- package/dist/runtime/react/useFimoLiveValue.js +0 -43
- package/dist/runtime/react-router/active-routes.d.ts +0 -12
- package/dist/runtime/react-router/active-routes.js +0 -60
- package/dist/runtime/react-router/index.d.ts +0 -16
- package/dist/runtime/react-router/index.js +0 -20
- package/dist/runtime/react-router/legacy/routes.d.ts +0 -35
- package/dist/runtime/react-router/legacy/routes.js +0 -86
- package/dist/runtime/react-router/navigation-utils.d.ts +0 -8
- package/dist/runtime/react-router/navigation-utils.js +0 -36
- package/dist/runtime/react-router/navigation.d.ts +0 -12
- package/dist/runtime/react-router/navigation.js +0 -28
- package/dist/runtime/react-router/preset.d.ts +0 -30
- package/dist/runtime/react-router/preset.js +0 -33
- package/dist/runtime/routing/AppResetScrollOnNavigate.d.ts +0 -2
- package/dist/runtime/routing/AppResetScrollOnNavigate.js +0 -12
- package/dist/runtime/routing/AppRoutesProvider.d.ts +0 -25
- package/dist/runtime/routing/AppRoutesProvider.js +0 -112
- package/dist/runtime/seo/buildSeoForPath.d.ts +0 -74
- package/dist/runtime/seo/buildSeoForPath.js +0 -55
- package/dist/runtime/seo/htmlProps.d.ts +0 -13
- package/dist/runtime/seo/htmlProps.js +0 -15
- package/dist/runtime/sveltekit/content.d.ts +0 -25
- package/dist/runtime/sveltekit/content.js +0 -33
- package/dist/runtime/sveltekit/context-contract.d.ts +0 -5
- package/dist/runtime/sveltekit/context-contract.js +0 -2
- package/dist/runtime/sveltekit/context.d.ts +0 -8
- package/dist/runtime/sveltekit/context.js +0 -25
- package/dist/runtime/sveltekit/forms.d.ts +0 -15
- package/dist/runtime/sveltekit/forms.js +0 -15
- package/dist/runtime/sveltekit/index.d.ts +0 -9
- package/dist/runtime/sveltekit/index.js +0 -5
- package/dist/runtime/sveltekit/internal.d.ts +0 -6
- package/dist/runtime/sveltekit/internal.js +0 -12
- package/dist/runtime/sveltekit/labels.d.ts +0 -20
- package/dist/runtime/sveltekit/labels.js +0 -13
- package/dist/runtime/sveltekit/preview.d.ts +0 -27
- package/dist/runtime/sveltekit/preview.js +0 -69
- package/dist/runtime/sveltekit/runtime.d.ts +0 -9
- package/dist/runtime/sveltekit/runtime.js +0 -26
- package/dist/runtime/t/OptionalTracking.d.ts +0 -13
- package/dist/runtime/t/OptionalTracking.js +0 -28
- package/dist/runtime/t/Pageview.d.ts +0 -9
- package/dist/runtime/t/Pageview.js +0 -118
- package/dist/runtime/vite/Label.d.ts +0 -13
- package/dist/runtime/vite/Label.js +0 -16
- package/dist/runtime/vite/primitives/Images.d.ts +0 -4
- package/dist/runtime/vite/primitives/Images.js +0 -12
- package/dist/runtime/vite/translations.d.ts +0 -28
- package/dist/runtime/vite/translations.js +0 -103
|
@@ -4,11 +4,10 @@ Preserve the project's existing App Router structure. Fimo does not require a ro
|
|
|
4
4
|
|
|
5
5
|
## Root provider
|
|
6
6
|
|
|
7
|
-
Resolve the locale using the application's existing strategy, fetch labels on the server, and pass the snapshot
|
|
7
|
+
Render the Server Component `FimoProvider` from `fimo-next` once in the root layout. Resolve the locale using the application's existing strategy, fetch labels on the server, and pass the snapshot:
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
|
-
import { getLabels } from 'fimo
|
|
11
|
-
import { FimoProvider } from 'fimo/next/client';
|
|
10
|
+
import { FimoProvider, getLabels } from 'fimo-next';
|
|
12
11
|
|
|
13
12
|
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
|
14
13
|
const locale = 'en'; // replace with the app's own resolver
|
|
@@ -24,14 +23,14 @@ export default async function RootLayout({ children }: { children: React.ReactNo
|
|
|
24
23
|
}
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
Do not hardcode a locale when the app already resolves one from route params, a cookie, headers/domain, middleware, or an i18n library. Load `references/frameworks/next/locales.md` for those cases.
|
|
26
|
+
The provider resolves the Fimo connection on the server and passes only public connection data to the client tree; no page or component receives a runtime prop and no `<script>` for the preview needs adding. Do not hardcode a locale when the app already resolves one from route params, a cookie, headers/domain, middleware, or an i18n library. Load `references/frameworks/next/locales.md` for those cases.
|
|
28
27
|
|
|
29
28
|
## Static generation and ISR
|
|
30
29
|
|
|
31
30
|
Server Components may read generated clients directly. Omit `locale` to use the configured default or bind the application-resolved locale once with `createFimo`:
|
|
32
31
|
|
|
33
32
|
```tsx
|
|
34
|
-
import { createFimo, RichText, Text } from 'fimo
|
|
33
|
+
import { createFimo, RichText, Text } from 'fimo-next';
|
|
35
34
|
import { content } from '@/schemas';
|
|
36
35
|
|
|
37
36
|
export const revalidate = 60;
|
|
@@ -51,7 +50,7 @@ export default async function ArticlesPage() {
|
|
|
51
50
|
|
|
52
51
|
`createFimo({ content, locale })` is a typed locale-bound facade over the generated registry. It does not own routing and does not force SSG.
|
|
53
52
|
|
|
54
|
-
Static builds
|
|
53
|
+
Static builds read Fimo through the same server connection (linked project + branch locally, platform env when hosted). Do not switch a route to dynamic rendering merely to hide a missing connection; choose SSG, ISR, or request-time rendering from the application's intended behavior.
|
|
55
54
|
|
|
56
55
|
## Request-time rendering
|
|
57
56
|
|
|
@@ -59,7 +58,7 @@ Use normal Next request APIs and pass the resulting locale/query values to Fimo:
|
|
|
59
58
|
|
|
60
59
|
```tsx
|
|
61
60
|
import { headers } from 'next/headers';
|
|
62
|
-
import { createFimo, Text } from 'fimo
|
|
61
|
+
import { createFimo, Text } from 'fimo-next';
|
|
63
62
|
import { content } from '@/schemas';
|
|
64
63
|
|
|
65
64
|
export const dynamic = 'force-dynamic';
|
|
@@ -82,12 +81,12 @@ hydrate with the matching generated `.client` module. Do not pass a raw Fimo
|
|
|
82
81
|
value merely because its enumerable fields look JSON-safe. No conversion is
|
|
83
82
|
needed while the value stays inside server rendering.
|
|
84
83
|
|
|
85
|
-
Client Components use the generated `.client` module and `fimo
|
|
84
|
+
Client Components use the generated `.client` module and `fimo-next/client`:
|
|
86
85
|
|
|
87
86
|
```tsx
|
|
88
87
|
'use client';
|
|
89
88
|
|
|
90
|
-
import { Text, useLabels } from 'fimo
|
|
89
|
+
import { Text, useLabels } from 'fimo-next/client';
|
|
91
90
|
import * as Article from '@/schemas/Article.client';
|
|
92
91
|
|
|
93
92
|
export function FeaturedArticles() {
|
|
@@ -15,7 +15,7 @@ If omitted, both use the configured default locale. Avoid request-global locale
|
|
|
15
15
|
|
|
16
16
|
## Client context
|
|
17
17
|
|
|
18
|
-
Pass the same locale through `FimoProvider
|
|
18
|
+
Pass the same locale through the root `FimoProvider` (`fimo-next` in the App Router layout, `fimo-next/client` in `_app`). A matching label snapshot supplies it automatically:
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
21
|
const labels = await getLabels({ locale });
|
|
@@ -4,10 +4,10 @@ Preserve `pages/` or `src/pages/`. Pages Router sends props through JSON seriali
|
|
|
4
4
|
|
|
5
5
|
## Provider in `_app`
|
|
6
6
|
|
|
7
|
-
Pass each page's label snapshot to
|
|
7
|
+
Pages Router has no Server Component above `_app`, so `FimoProvider` from `fimo-next/client` is the root integration: it resolves the connection while the server renders `_app`, writes the public connection into the document for the browser, and loads the Studio preview script. Pass each page's label snapshot to it:
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
|
-
import { FimoProvider, type LabelsSnapshot } from 'fimo
|
|
10
|
+
import { FimoProvider, type LabelsSnapshot } from 'fimo-next/client';
|
|
11
11
|
import type { AppProps } from 'next/app';
|
|
12
12
|
|
|
13
13
|
type FimoPageProps = { fimoLabels: LabelsSnapshot };
|
|
@@ -26,7 +26,7 @@ If the application already has providers, compose Fimo with them; do not replace
|
|
|
26
26
|
## Static generation and ISR
|
|
27
27
|
|
|
28
28
|
```tsx
|
|
29
|
-
import { createFimo, getLabels } from 'fimo
|
|
29
|
+
import { createFimo, getLabels } from 'fimo-next';
|
|
30
30
|
import type { GetStaticProps, InferGetStaticPropsType } from 'next';
|
|
31
31
|
|
|
32
32
|
import { ArticleView } from '@/components/ArticleView';
|
|
@@ -61,7 +61,7 @@ export default function Page({ article: serialized }: InferGetStaticPropsType<ty
|
|
|
61
61
|
## Request-time rendering
|
|
62
62
|
|
|
63
63
|
```tsx
|
|
64
|
-
import { getLabels } from 'fimo
|
|
64
|
+
import { getLabels } from 'fimo-next';
|
|
65
65
|
import type { GetServerSideProps, InferGetServerSidePropsType } from 'next';
|
|
66
66
|
import * as Article from '@/schemas/Article';
|
|
67
67
|
import * as ArticleClient from '@/schemas/Article.client';
|
|
@@ -86,7 +86,7 @@ Use the locale/router values Pages Router already supplies. Do not introduce App
|
|
|
86
86
|
Interactive components import hooks and primitives from the client surfaces:
|
|
87
87
|
|
|
88
88
|
```tsx
|
|
89
|
-
import { Text, useLabels } from 'fimo
|
|
89
|
+
import { Text, useLabels } from 'fimo-next/client';
|
|
90
90
|
import * as Article from '@/schemas/Article.client';
|
|
91
91
|
|
|
92
92
|
export function SearchResults() {
|
|
@@ -21,14 +21,37 @@ hosted publish. Run `fimo validate`; load
|
|
|
21
21
|
`references/frameworks/hosting.md` for the shared profile contract and command
|
|
22
22
|
override rules.
|
|
23
23
|
|
|
24
|
+
## Connection
|
|
25
|
+
|
|
26
|
+
Render `FimoProvider` once at the application root and nothing else: App Router
|
|
27
|
+
imports it from `fimo-next` in the root layout; Pages Router imports it from
|
|
28
|
+
`fimo-next/client` in `pages/_app.tsx`. It resolves the connection on the
|
|
29
|
+
server — explicit platform env first, else the linked project
|
|
30
|
+
(`.fimo/project.json`) plus the active git branch — and passes only the public
|
|
31
|
+
connection to the browser, where generated `.client` hooks, `useLabels`, form
|
|
32
|
+
submission, and the Studio preview script use it. Never add, read, or document
|
|
33
|
+
`FIMO_CONTENT_API_URL` / `NEXT_PUBLIC_FIMO_API_URL` in application code; the
|
|
34
|
+
platform and the provider own them. `FIMO_CONTENT_API_URL` set by a developer is
|
|
35
|
+
a deliberate host override and wins over derivation.
|
|
36
|
+
|
|
37
|
+
### Edge routes
|
|
38
|
+
|
|
39
|
+
Fimo hosting injects the server connection for Edge routes. No application
|
|
40
|
+
configuration is needed. For a local or custom-hosted Edge route only, run
|
|
41
|
+
`fimo --json link` in the linked checkout and use its exact `tenant_api_url` as
|
|
42
|
+
`FIMO_CONTENT_API_URL` in the dev command or host configuration. Never construct
|
|
43
|
+
the URL, write it to a project env file, or add a `NEXT_PUBLIC_FIMO_*` variable.
|
|
44
|
+
Rerun the command after switching Git branches because each Fimo Branch has its
|
|
45
|
+
own tenant URL.
|
|
46
|
+
|
|
24
47
|
## Hosted preview config
|
|
25
48
|
|
|
26
|
-
Wrap the existing Next config once so
|
|
27
|
-
|
|
49
|
+
Wrap the existing Next config once so `next dev` accepts Fimo's hosted preview
|
|
50
|
+
origins without exposing the active preview provider to the application:
|
|
28
51
|
|
|
29
52
|
```ts
|
|
30
53
|
import type { NextConfig } from 'next';
|
|
31
|
-
import { withFimo } from 'fimo
|
|
54
|
+
import { withFimo } from 'fimo-next/config';
|
|
32
55
|
|
|
33
56
|
const nextConfig: NextConfig = {};
|
|
34
57
|
export default withFimo(nextConfig);
|
|
@@ -36,29 +59,15 @@ export default withFimo(nextConfig);
|
|
|
36
59
|
|
|
37
60
|
Preserve all existing config fields or config-function logic. Do not hardcode a
|
|
38
61
|
preview domain in `allowedDevOrigins`; Fimo supplies it to the development
|
|
39
|
-
sandbox. The wrapper
|
|
62
|
+
sandbox. The wrapper changes nothing outside `next dev` and is not the
|
|
63
|
+
application's Fimo connection.
|
|
40
64
|
|
|
41
65
|
## Client dependency
|
|
42
66
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## Runtime URL
|
|
49
|
-
|
|
50
|
-
Linked projects need the tenant content API in both Next runtimes:
|
|
51
|
-
|
|
52
|
-
```dotenv
|
|
53
|
-
FIMO_CONTENT_API_URL=https://<tenant-api>
|
|
54
|
-
NEXT_PUBLIC_FIMO_API_URL=https://<tenant-api>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Current `fimo init` and `fimo clone` write these alongside `VITE_API_URL` while
|
|
58
|
-
preserving user-owned values. `FIMO_API_URL` remains reserved for CLI/control API
|
|
59
|
-
overrides. Keep the
|
|
60
|
-
server variable private; only the public variable is compiled into Client
|
|
61
|
-
Components.
|
|
67
|
+
`fimo-next` requires `@tanstack/react-query` as a peer; add it with the project's
|
|
68
|
+
package manager when it is missing. Generated `.client` hooks and `useLabels`
|
|
69
|
+
run on the React Query client `FimoProvider` supplies (or an application-owned
|
|
70
|
+
one already in context).
|
|
62
71
|
|
|
63
72
|
## Generate the content surface
|
|
64
73
|
|
|
@@ -114,10 +123,10 @@ export function ContactForm() {
|
|
|
114
123
|
}
|
|
115
124
|
```
|
|
116
125
|
|
|
117
|
-
Server Components, route handlers, `getStaticProps`, and `getServerSideProps` import from `fimo
|
|
126
|
+
Server Components, route handlers, `getStaticProps`, and `getServerSideProps` import from `fimo-next` and generated server modules:
|
|
118
127
|
|
|
119
128
|
```ts
|
|
120
|
-
import { createFimo, getLabels, Text } from 'fimo
|
|
129
|
+
import { createFimo, getLabels, Text } from 'fimo-next';
|
|
121
130
|
import { content } from '@/schemas';
|
|
122
131
|
|
|
123
132
|
const fimo = createFimo({ content, locale });
|
|
@@ -127,12 +136,12 @@ const [articles, labels] = await Promise.all([
|
|
|
127
136
|
]);
|
|
128
137
|
```
|
|
129
138
|
|
|
130
|
-
Client Components import from `fimo
|
|
139
|
+
Client Components import from `fimo-next/client` and generated `.client` modules:
|
|
131
140
|
|
|
132
141
|
```tsx
|
|
133
142
|
'use client';
|
|
134
143
|
|
|
135
|
-
import { Text, useLabels } from 'fimo
|
|
144
|
+
import { Text, useLabels } from 'fimo-next/client';
|
|
136
145
|
import * as Article from '@/schemas/Article.client';
|
|
137
146
|
|
|
138
147
|
export function ArticleList() {
|
|
@@ -142,21 +151,21 @@ export function ArticleList() {
|
|
|
142
151
|
}
|
|
143
152
|
```
|
|
144
153
|
|
|
145
|
-
Do not import `fimo
|
|
154
|
+
Do not import `fimo-next/client` into server-only modules. Do not import React Query hooks from `<Uid>.ts`.
|
|
146
155
|
|
|
147
156
|
## Provider boundary
|
|
148
157
|
|
|
149
|
-
Client hooks need one `FimoProvider
|
|
158
|
+
Client hooks need the one root `FimoProvider`. The server may fetch a label
|
|
159
|
+
snapshot and pass it across that boundary:
|
|
150
160
|
|
|
151
161
|
```tsx
|
|
152
|
-
import { getLabels } from 'fimo
|
|
153
|
-
import { FimoProvider } from 'fimo/next/client';
|
|
162
|
+
import { FimoProvider, getLabels } from 'fimo-next';
|
|
154
163
|
|
|
155
164
|
const labels = await getLabels({ locale });
|
|
156
165
|
return <FimoProvider labels={labels.snapshot}>{children}</FimoProvider>;
|
|
157
166
|
```
|
|
158
167
|
|
|
159
|
-
Passing `locale` without `labels` is valid when only content hooks need context. Passing a matching snapshot supplies both locale and labels. Never teach the unreleased `FimoNextProvider` name; the public component is `FimoProvider`.
|
|
168
|
+
Passing `locale` without `labels` is valid when only content hooks need context. Passing a matching snapshot supplies both locale and labels. A nested `FimoProvider` only narrows labels/locale for its subtree. Never teach the unreleased `FimoNextProvider` name; the public component is `FimoProvider`.
|
|
160
169
|
|
|
161
170
|
## Rendering modes
|
|
162
171
|
|
|
@@ -9,16 +9,18 @@ its routes, rendering choices, providers, and SEO.
|
|
|
9
9
|
Install the peers the application uses:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
pnpm add fimo react react-dom react-router @tanstack/react-query
|
|
12
|
+
pnpm add fimo fimo-react fimo-react-router react react-dom react-router @tanstack/react-query
|
|
13
13
|
pnpm add -D @react-router/dev @react-router/node vite
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
`fimo-react-router` carries `fimo-vite`; do not install it separately.
|
|
17
|
+
|
|
16
18
|
Keep the project's React Router Vite plugin explicit:
|
|
17
19
|
|
|
18
20
|
```ts
|
|
19
21
|
import { reactRouter } from '@react-router/dev/vite';
|
|
20
22
|
import { defineConfig } from 'vite';
|
|
21
|
-
import { fimo } from 'fimo/vite';
|
|
23
|
+
import { fimo } from 'fimo-react-router/vite';
|
|
22
24
|
|
|
23
25
|
export default defineConfig({
|
|
24
26
|
plugins: [reactRouter(), fimo({ sitemap: true })],
|
|
@@ -31,7 +33,7 @@ For the supported client-rendered setup, connect React Router's native build to
|
|
|
31
33
|
|
|
32
34
|
```ts
|
|
33
35
|
import type { Config } from '@react-router/dev/config';
|
|
34
|
-
import { fimoPreset } from 'fimo
|
|
36
|
+
import { fimoPreset } from 'fimo-react-router/preset';
|
|
35
37
|
|
|
36
38
|
export default {
|
|
37
39
|
appDirectory: 'src',
|
|
@@ -48,7 +50,7 @@ Do not change an existing SSR project to `ssr: false` merely to add Fimo. The cu
|
|
|
48
50
|
|
|
49
51
|
```tsx
|
|
50
52
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
51
|
-
import { FimoProviders, FimoScripts } from 'fimo
|
|
53
|
+
import { FimoProviders, FimoScripts } from 'fimo-react-router';
|
|
52
54
|
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from 'react-router';
|
|
53
55
|
|
|
54
56
|
const queryClient = new QueryClient();
|
|
@@ -106,10 +108,10 @@ If an existing project imports `fimo/react-router/routes`, load `references/migr
|
|
|
106
108
|
|
|
107
109
|
## Content and labels
|
|
108
110
|
|
|
109
|
-
Render tracked values with `fimo
|
|
111
|
+
Render tracked values with `fimo-react`:
|
|
110
112
|
|
|
111
113
|
```tsx
|
|
112
|
-
import { Image, Label, RichText, Text } from 'fimo
|
|
114
|
+
import { Image, Label, RichText, Text } from 'fimo-react';
|
|
113
115
|
|
|
114
116
|
return <Label value="home.hero.title" as="h1" />;
|
|
115
117
|
```
|
|
@@ -10,13 +10,22 @@ The adapter targets SvelteKit 2 with Svelte 5. The acceptance baseline currently
|
|
|
10
10
|
uses SvelteKit `2.70.2`, Svelte `5.56.8`, and Vite `8.2.0`; do not assume that
|
|
11
11
|
SvelteKit 1 or Svelte 4 projects are compatible.
|
|
12
12
|
|
|
13
|
+
## Install both packages
|
|
14
|
+
|
|
15
|
+
Every SvelteKit surface lives in `fimo-sveltekit`, installed at the same version
|
|
16
|
+
as `fimo`:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install fimo fimo-sveltekit
|
|
20
|
+
```
|
|
21
|
+
|
|
13
22
|
## Connect the Vite plugin
|
|
14
23
|
|
|
15
24
|
Add Fimo's source-tagging plugin alongside SvelteKit's own plugin:
|
|
16
25
|
|
|
17
26
|
```ts
|
|
18
27
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
19
|
-
import { fimo } from 'fimo
|
|
28
|
+
import { fimo } from 'fimo-sveltekit/vite';
|
|
20
29
|
import { defineConfig } from 'vite';
|
|
21
30
|
|
|
22
31
|
export default defineConfig({ plugins: [fimo(), sveltekit()] });
|
|
@@ -27,11 +36,10 @@ elements back to source. It does not change production output or own routing.
|
|
|
27
36
|
|
|
28
37
|
## Hosted configuration
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
config seam:
|
|
39
|
+
Keep the hosting adapter behind Fimo's config seam:
|
|
32
40
|
|
|
33
41
|
```js
|
|
34
|
-
import { fimo } from 'fimo
|
|
42
|
+
import { fimo } from 'fimo-sveltekit/config';
|
|
35
43
|
|
|
36
44
|
export default {
|
|
37
45
|
kit: { adapter: fimo() },
|
|
@@ -49,7 +57,7 @@ SvelteKit's request-aware `fetch`:
|
|
|
49
57
|
|
|
50
58
|
```ts
|
|
51
59
|
// src/routes/articles/+page.server.ts
|
|
52
|
-
import { createFimo } from 'fimo
|
|
60
|
+
import { createFimo } from 'fimo-sveltekit';
|
|
53
61
|
import { content } from '../../../schemas';
|
|
54
62
|
|
|
55
63
|
export async function load(event) {
|
|
@@ -72,7 +80,7 @@ do not import a Fimo environment variable or hardcode a tenant URL:
|
|
|
72
80
|
|
|
73
81
|
```ts
|
|
74
82
|
// src/routes/+layout.server.ts
|
|
75
|
-
import { getLabels } from 'fimo
|
|
83
|
+
import { getLabels } from 'fimo-sveltekit';
|
|
76
84
|
|
|
77
85
|
import { resolveLocale } from '../locales';
|
|
78
86
|
|
|
@@ -86,7 +94,7 @@ export async function load(event) {
|
|
|
86
94
|
<!-- src/routes/+layout.svelte -->
|
|
87
95
|
<script lang="ts">
|
|
88
96
|
import { afterNavigate } from '$app/navigation';
|
|
89
|
-
import { FimoProvider } from 'fimo
|
|
97
|
+
import { FimoProvider } from 'fimo-sveltekit/components';
|
|
90
98
|
import type { LayoutData } from './$types';
|
|
91
99
|
import type { Snippet } from 'svelte';
|
|
92
100
|
|
|
@@ -104,7 +112,8 @@ export async function load(event) {
|
|
|
104
112
|
|
|
105
113
|
Generated values are serialized at a `load` boundary and hydrated in the
|
|
106
114
|
component that renders them. Use `Text`, `RichText`, `Image`, `Video`, `Date`,
|
|
107
|
-
`DateTime`, `Boolean`, `Json`, and `Number` from
|
|
115
|
+
`DateTime`, `Boolean`, `Json`, and `Number` from
|
|
116
|
+
`fimo-sveltekit/components`. `Number`
|
|
108
117
|
formats plain numeric values for display; numeric fields currently have no
|
|
109
118
|
source metadata, so it is not a Studio-editable primitive.
|
|
110
119
|
|
|
@@ -114,7 +123,7 @@ Use a `+page.server` action so SvelteKit owns the request and redirect. Pass its
|
|
|
114
123
|
event to `createFimoFormClient` and use the generated parser/helper:
|
|
115
124
|
|
|
116
125
|
```ts
|
|
117
|
-
import { createFimoFormClient } from 'fimo
|
|
126
|
+
import { createFimoFormClient } from 'fimo-sveltekit';
|
|
118
127
|
import { parseContactUsFormData, submitContactUs } from '$lib/forms/contact-us';
|
|
119
128
|
|
|
120
129
|
export const actions = {
|
|
@@ -134,7 +143,7 @@ component, read Fimo preview environment variables, or inject Fimo scripts.
|
|
|
134
143
|
## Boundaries
|
|
135
144
|
|
|
136
145
|
- SvelteKit owns routing, history, 404s, locale URLs, and SEO.
|
|
137
|
-
- `fimo
|
|
146
|
+
- `fimo-sveltekit/vite` owns dev source tagging only.
|
|
138
147
|
- `FimoProvider` owns labels and the optional Studio preview bridge.
|
|
139
148
|
- Do not add React, React Query, or a Vite SPA fallback to a SvelteKit project.
|
|
140
149
|
|
|
@@ -5,7 +5,7 @@ Use this reference for a Vite + React SPA without React Router framework mode. P
|
|
|
5
5
|
## Install and build
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
pnpm add fimo react react-dom react-router @tanstack/react-query
|
|
8
|
+
pnpm add fimo fimo-react fimo-react-router react react-dom react-router @tanstack/react-query
|
|
9
9
|
pnpm add -D vite @vitejs/plugin-react
|
|
10
10
|
```
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ Add Fimo's Vite plugins without replacing the application's existing plugins:
|
|
|
14
14
|
```ts
|
|
15
15
|
import react from '@vitejs/plugin-react';
|
|
16
16
|
import { defineConfig } from 'vite';
|
|
17
|
-
import { fimo } from 'fimo/vite';
|
|
17
|
+
import { fimo } from 'fimo-react-router/vite';
|
|
18
18
|
|
|
19
19
|
export default defineConfig({
|
|
20
20
|
plugins: [react(), ...fimo({ seo: true })],
|
|
@@ -23,13 +23,15 @@ export default defineConfig({
|
|
|
23
23
|
|
|
24
24
|
`fimo()` is synchronous and returns a `PluginOption[]`. `seo: true` updates the shared `index.html` at build time. Add `sitemap: true` or `robots: true` only when requested.
|
|
25
25
|
|
|
26
|
+
Import it from `fimo-react-router/vite` whenever the application renders through React Router, including a plain `BrowserRouter` SPA: it adds the React dependency pre-bundling those apps need. A Vite application with no React at all installs `fimo-vite` instead and imports `fimo` from there.
|
|
27
|
+
|
|
26
28
|
## Application root
|
|
27
29
|
|
|
28
30
|
`FimoProviders` needs a React Router context for Studio navigation and pageview tracking. Keep the application's existing router type:
|
|
29
31
|
|
|
30
32
|
```tsx
|
|
31
33
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
32
|
-
import { FimoProviders } from 'fimo
|
|
34
|
+
import { FimoProviders } from 'fimo-react-router';
|
|
33
35
|
import React from 'react';
|
|
34
36
|
import { createRoot } from 'react-dom/client';
|
|
35
37
|
import { BrowserRouter } from 'react-router';
|
|
@@ -55,10 +57,10 @@ An adopted SPA can omit the explicit `QueryClientProvider` when it does not need
|
|
|
55
57
|
|
|
56
58
|
## Content and labels
|
|
57
59
|
|
|
58
|
-
Use `fimo
|
|
60
|
+
Use `fimo-react` for tracked values:
|
|
59
61
|
|
|
60
62
|
```tsx
|
|
61
|
-
import { Label } from 'fimo
|
|
63
|
+
import { Label } from 'fimo-react';
|
|
62
64
|
|
|
63
65
|
export function App() {
|
|
64
66
|
return <Label value="home.hero.title" as="h1" />;
|
|
@@ -38,10 +38,10 @@ Missing keys render as an empty tracked value. Run `fimo validate`, then create
|
|
|
38
38
|
|
|
39
39
|
The label contract is shared; acquisition differs by runtime:
|
|
40
40
|
|
|
41
|
-
- Next server: `getLabels({ locale? })` from `fimo
|
|
42
|
-
- Next client: `useLabels()` from `fimo
|
|
43
|
-
- React Router/Vite client: `Label` and `useLabels()` from `fimo
|
|
44
|
-
- SvelteKit: pass the application's resolved locale to `getLabels({ apiUrl, event, locale })`, or omit it to let the API choose the project default. Wrap the root layout with `FimoProvider` from `fimo
|
|
41
|
+
- Next server: `getLabels({ locale? })` from `fimo-next`.
|
|
42
|
+
- Next client: `useLabels()` from `fimo-next/client`, under `FimoProvider`.
|
|
43
|
+
- React Router/Vite client: `Label` and `useLabels()` from `fimo-react`, under the existing framework integration.
|
|
44
|
+
- SvelteKit: pass the application's resolved locale to `getLabels({ apiUrl, event, locale })`, or omit it to let the API choose the project default. Wrap the root layout with `FimoProvider` from `fimo-sveltekit/components`; the snapshot supplies its locale. Descendants use `Label` from that entrypoint or `useLabels().t()` from `fimo-sveltekit`. Apply the same explicit-or-omitted rule to `createFimo({ content, event, locale? })` in content loads.
|
|
45
45
|
- Astro server page: `getLabels({ locale? })` from `fimo/astro`; no provider.
|
|
46
46
|
|
|
47
47
|
Load the matching framework reference before choosing a provider or server reader.
|
|
@@ -73,11 +73,11 @@ Never construct `FimoString`, `FimoRichText`, `FimoBoolean`, or `FimoMedia` manu
|
|
|
73
73
|
|
|
74
74
|
Choose the framework surface:
|
|
75
75
|
|
|
76
|
-
- Next Server Components and data functions → `fimo
|
|
77
|
-
- Next Client Components → `fimo
|
|
78
|
-
- React Router/Vite client → `fimo
|
|
76
|
+
- Next Server Components and data functions → `fimo-next`
|
|
77
|
+
- Next Client Components → `fimo-next/client`
|
|
78
|
+
- React Router/Vite client → `fimo-react`
|
|
79
79
|
- Astro pages → `fimo/astro/components`
|
|
80
|
-
- Svelte components → `fimo
|
|
80
|
+
- Svelte components → `fimo-sveltekit/components`
|
|
81
81
|
|
|
82
82
|
Load the framework reference before copying an example. Next server and client imports are deliberately separate so React Query/client code does not leak into server bundles. Astro uses native `.astro` components and does not require React.
|
|
83
83
|
|
|
@@ -86,21 +86,18 @@ behavior in place; when one cannot be preserved, record an explicit gap with
|
|
|
86
86
|
the affected routes instead of shipping pages that silently lost their share
|
|
87
87
|
metadata.
|
|
88
88
|
|
|
89
|
-
##
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
For `next build`/`next start`, set temporary values in the shell or an ignored
|
|
102
|
-
`.env.local`; never commit secret values. In either mode, exercise at least one
|
|
103
|
-
client-side data read after startup.
|
|
89
|
+
## Fimo connection
|
|
90
|
+
|
|
91
|
+
Follow the target project's `fimo-code` Next.js reference and render its
|
|
92
|
+
`FimoProvider` once at the application root. The provider uses an explicit
|
|
93
|
+
host connection when one exists; otherwise it resolves the linked project and
|
|
94
|
+
active git branch on the server and passes only the public connection to the
|
|
95
|
+
browser. `withFimo` handles hosted preview origins, not the application
|
|
96
|
+
connection.
|
|
97
|
+
|
|
98
|
+
Do not create or edit `.env` / `.env.local` for a linked project's Fimo
|
|
99
|
+
connection. Run the project's normal `next dev`, `next build`, and `next start`
|
|
100
|
+
commands, then exercise at least one server read and one client-side data read.
|
|
104
101
|
|
|
105
102
|
## Preview embedding and response headers
|
|
106
103
|
|
|
@@ -53,8 +53,10 @@ sources point to one uploaded asset.
|
|
|
53
53
|
|
|
54
54
|
## Upload And Replacement
|
|
55
55
|
|
|
56
|
-
Referenced media must be uploaded into the Fimo media library
|
|
57
|
-
`fimo assets upload
|
|
56
|
+
Referenced media must be uploaded into the Fimo media library. Use
|
|
57
|
+
`fimo assets bulk-upload --file <manifest.json>` for a batch and keep one
|
|
58
|
+
unique `sourceId` per media item; use `fimo assets upload` for a single file.
|
|
59
|
+
Never encode paths or names in whitespace-delimited shell input. Copying a file under `public/` so the deployed site can
|
|
58
60
|
serve it is **not** a completed import: it has no Fimo asset id/URL, editors
|
|
59
61
|
cannot manage it, and the QA gate treats a referenced-but-not-uploaded asset as
|
|
60
62
|
failing. Either upload it (and record the Fimo target), or mark it `unresolved`
|
|
@@ -86,11 +86,11 @@ items.
|
|
|
86
86
|
used a user export or narrowly scoped server-side credential. Missing access
|
|
87
87
|
is unresolved for that lane, and no content was guessed.
|
|
88
88
|
|
|
89
|
-
For linked Next.js targets,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
For linked Next.js targets, the root `FimoProvider` resolves an explicit host
|
|
90
|
+
connection first, otherwise `.fimo/project.json` plus the active git branch,
|
|
91
|
+
and passes only the public connection to the browser. `withFimo` handles
|
|
92
|
+
hosted preview origins, not this connection. Run the normal `next dev`,
|
|
93
|
+
`next build`, and `next start` commands without creating a Fimo env file.
|
|
94
94
|
|
|
95
95
|
## Hosting
|
|
96
96
|
|
|
@@ -104,9 +104,9 @@ Owned by the runtime lane; verified here read-only.
|
|
|
104
104
|
translation goes through `FIMO_PREVIEW_ALLOWED_ORIGINS`; `withFimo` alone
|
|
105
105
|
does not solve headers — it only extends `allowedDevOrigins` during
|
|
106
106
|
`next dev`.
|
|
107
|
-
- The runtime report covers local startup, preview embedding, build,
|
|
108
|
-
|
|
109
|
-
claim backed by evidence.
|
|
107
|
+
- The runtime report covers local startup, preview embedding, build, the
|
|
108
|
+
resolved Fimo connection, header translations, and integration env-key
|
|
109
|
+
names, with every claim backed by evidence.
|
|
110
110
|
- With a browser available, record `browserProof` (rendered route plus console
|
|
111
111
|
state) for startup and embedding. Without one, use deterministic HTTP
|
|
112
112
|
status/header/process/log checks and mark visual proof explicitly
|
|
@@ -149,6 +149,8 @@ one bounded, scriptable browser pass (Playwright, agent-browser, or
|
|
|
149
149
|
equivalent):
|
|
150
150
|
|
|
151
151
|
1. Start the app and wait for hydration, not just the HTTP response.
|
|
152
|
+
Do not use `networkidle` against dev/HMR servers; wait for expected visible
|
|
153
|
+
content and image readiness.
|
|
152
154
|
2. Open a representative set of pages: home, one collection listing, one
|
|
153
155
|
collection detail, one static page.
|
|
154
156
|
3. Exercise one representative interaction (open the nav menu, an accordion,
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
Own semantic discovery, schema authoring, payload preparation, and the text
|
|
4
4
|
handoff. Do not import entries or rewrite application consumers.
|
|
5
5
|
|
|
6
|
-
1.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
inline value, API, CMS, or a mix before designing schemas.
|
|
6
|
+
1. Trace active source clients, endpoint/query declarations, frontend types,
|
|
7
|
+
and every consumer before designing schemas. Then inspect their
|
|
8
|
+
content-bearing files, inline values, APIs, or CMS sources.
|
|
10
9
|
2. Classify each value as collection content, single content, an
|
|
11
10
|
editor-visible label, or application-owned code. Repetition is evidence,
|
|
12
11
|
not an automatic collection rule. Assistive text, identifiers, and values
|
|
@@ -62,11 +61,12 @@ data workers start:
|
|
|
62
61
|
queries, pagination, locales, publication states, relations, media, and
|
|
63
62
|
consuming call sites. Server rendering may hide requests from the browser,
|
|
64
63
|
so browser traffic is fallback evidence rather than the source of truth.
|
|
65
|
-
2.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
2. Prefer authoritative backend schemas when source exists. Otherwise probe
|
|
65
|
+
public OpenAPI metadata, then GraphQL introspection, then only the selected
|
|
66
|
+
REST endpoints. Ask for an owner-provided export or narrowly scoped
|
|
67
|
+
server-side token only when website-required records are not public. Never
|
|
68
|
+
recover, log, persist, or copy secret values. If required access is missing
|
|
69
|
+
or unreachable, stop before planning schemas or payloads.
|
|
70
70
|
3. Fetch every required page, locale, and referenced record. For a few bounded
|
|
71
71
|
endpoints, direct requests are enough. For repeated or paginated reads,
|
|
72
72
|
write a temporary source-specific read-only script under
|
|
@@ -75,7 +75,17 @@ data workers start:
|
|
|
75
75
|
normalize transport details only. Do not create a provider registry or a
|
|
76
76
|
universal CMS model.
|
|
77
77
|
5. Design Fimo schemas from both the retrieved values and the code that uses
|
|
78
|
-
them.
|
|
78
|
+
them. Keep uncertain fields optional unless authoritative evidence requires
|
|
79
|
+
them; sampled enum-like values are strings, and private or absent fields
|
|
80
|
+
remain unknown. Never invent replacement content when access is unavailable.
|
|
81
|
+
|
|
82
|
+
For Strapi, the source and public-instance accelerators under
|
|
83
|
+
`scripts/retrieval/strapi/` accept only explicit backend roots, content types,
|
|
84
|
+
and endpoints. The worker may adapt or replace them; they preserve evidence but
|
|
85
|
+
never select content or decide the target schema. Preserve source record order
|
|
86
|
+
by importing in that order; do not add a source-ID or sort field solely to
|
|
87
|
+
recreate creation order. Add an explicit sort field only when the source has
|
|
88
|
+
editorial ordering or another consumer requires stable order.
|
|
79
89
|
|
|
80
90
|
Once retrieval and consumer tracing are complete, push schemas, prepare
|
|
81
91
|
payloads, and let the coordinator fan out assets and one data batch per
|
|
@@ -49,12 +49,14 @@ them into migration artifacts. If the source API URL or access is missing or
|
|
|
49
49
|
unreachable, stop and ask the user for it; do not guess or continue with
|
|
50
50
|
replacement content.
|
|
51
51
|
|
|
52
|
-
For API-backed content, trace
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
For API-backed content, trace active clients, endpoints, frontend types, and
|
|
53
|
+
consumers first. Prefer backend source schemas; otherwise use public OpenAPI,
|
|
54
|
+
GraphQL introspection, then selected REST endpoints in that order. Request a
|
|
55
|
+
token or export only for website-required records that are not public. Retrieve
|
|
56
|
+
all required pages, locales, relations, and media during content planning.
|
|
57
|
+
Treat absent/private fields as unknown, keep uncertain fields optional, and do
|
|
58
|
+
not turn sampled values into enums. Bounded retrieval scripts are accelerators
|
|
59
|
+
the planner may adapt or replace, never schema decision makers.
|
|
58
60
|
|
|
59
61
|
For URL-only migrations, run `fimo migrate <url> [dir]` and inspect the
|
|
60
62
|
generated `.fimo/migrations/current/` files as source evidence. Do not copy
|