fimo 0.20.0 → 0.21.0-experimental.1
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/README.md +1 -1
- package/assets/agent-templates/_default/GOAL.md +10 -0
- package/assets/agent-templates/_default/capabilities.yaml +10 -0
- package/assets/content-templates/shared/types.eta +1 -1
- package/assets/skills/fimo-cli/SKILL.md +2 -1
- package/assets/skills/fimo-cli/references/agents.md +136 -36
- package/assets/skills/fimo-cli/references/branches.md +8 -5
- package/assets/skills/fimo-cli/references/deploy.md +11 -2
- package/assets/skills/fimo-cli/references/domains.md +12 -0
- package/assets/skills/fimo-cli/references/forms.md +1 -1
- package/assets/skills/fimo-cli/references/init.md +9 -2
- package/assets/skills/fimo-cli/references/locales.md +1 -1
- package/assets/skills/fimo-cli/references/mcp.md +1 -1
- package/assets/skills/fimo-cli/references/media.md +18 -1
- package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +3 -1
- package/assets/skills/fimo-cli/references/projects.md +7 -7
- 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/content/schema.md +23 -0
- 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 +5 -5
- 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 +10 -7
- package/assets/skills/fimo-code/references/frameworks/sveltekit.md +22 -15
- 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/locales.md +2 -2
- package/assets/skills/fimo-code/references/ui.md +4 -4
- package/assets/skills/fimo-migration/SKILL.md +51 -30
- package/assets/skills/fimo-migration/references/frameworks/nextjs.md +12 -15
- package/assets/skills/fimo-migration/references/media.md +12 -8
- package/assets/skills/fimo-migration/references/qa.md +12 -11
- package/assets/skills/fimo-migration/references/workers/content-planner.md +33 -4
- package/assets/skills/fimo-migration/references/workers/validator.md +10 -0
- package/assets/skills/fimo-migration/references/workers.md +19 -10
- package/assets/skills/fimo-migration/references/workflow.md +29 -11
- package/assets/skills/fimo-studio/references/ai-chat.md +1 -1
- package/assets/skills/fimo-studio/references/billing-and-credits.md +18 -1
- package/assets/skills/fimo-studio/references/cms.md +2 -0
- package/assets/skills/fimo-studio/references/preview-and-responsive.md +1 -0
- 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 +115 -110
- 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/preview/script.d.ts +3 -0
- package/dist/runtime/preview/script.js +14 -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 +20 -4
- package/dist/runtime/templates.js +60 -18
- 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 +129 -21
- package/dist/scripts/validate-schemas.js +63 -2
- package/package.json +72 -71
- package/release.json +2 -2
- package/templates/astro/AGENTS.md +1 -1
- package/templates/astro/astro.config.mjs +1 -1
- package/templates/astro/package.json +4 -2
- package/templates/astro/pnpm-workspace.yaml +6 -2
- package/templates/nextjs/.fimo/config.json +1 -2
- package/templates/nextjs/AGENTS.md +6 -16
- package/templates/nextjs/next.config.ts +4 -2
- package/templates/nextjs/package.json +4 -2
- package/templates/nextjs/pnpm-workspace.yaml +6 -2
- package/templates/nextjs/src/app/layout.tsx +16 -0
- package/templates/nextjs/src/locales.ts +3 -6
- package/templates/react-router/AGENTS.md +1 -1
- package/templates/react-router/package.json +5 -2
- package/templates/react-router/pnpm-workspace.yaml +6 -6
- package/templates/react-router/react-router.config.ts +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/src/vite-env.d.ts +0 -1
- package/templates/react-router/vite.config.ts +1 -1
- package/templates/sveltekit/AGENTS.md +1 -1
- package/templates/sveltekit/package.json +4 -2
- package/templates/sveltekit/pnpm-workspace.yaml +6 -2
- 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/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 -186
- package/dist/runtime/app/FimoScripts.d.ts +0 -14
- package/dist/runtime/app/FimoScripts.js +0 -48
- 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 -18
- package/dist/runtime/next/provider.js +0 -39
- 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 -94
- 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 -28
- package/dist/runtime/sveltekit/preview.js +0 -82
- 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
- package/templates/nextjs/src/app/(default)/layout.tsx +0 -10
- package/templates/nextjs/src/app/[locale]/layout.tsx +0 -22
- package/templates/nextjs/src/app/[locale]/page.tsx +0 -1
- package/templates/nextjs/src/components/Document.tsx +0 -26
- package/templates/nextjs/src/components/FimoPreviewBridge.tsx +0 -13
- /package/templates/nextjs/src/app/{(default)/page.tsx → page.tsx} +0 -0
|
@@ -14,17 +14,23 @@ Declare the production framework in `.fimo/config.json`:
|
|
|
14
14
|
|
|
15
15
|
Astro owns its static or server output, routes, and 404 behavior. Do not add a catch-all hosting rewrite, a hosting-provider adapter, a preview URL, or a script tag for Fimo.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Install `fimo-astro` at the same version as `fimo` and add the integration
|
|
18
|
+
beside the adapters and integrations the project already uses:
|
|
18
19
|
|
|
19
20
|
```js
|
|
20
21
|
import { defineConfig } from 'astro/config';
|
|
21
|
-
import { fimo } from 'fimo
|
|
22
|
+
import { fimo } from 'fimo-astro/config';
|
|
22
23
|
|
|
23
24
|
export default defineConfig({
|
|
24
25
|
integrations: [fimo()],
|
|
25
26
|
});
|
|
26
27
|
```
|
|
27
28
|
|
|
29
|
+
`fimo-astro/config` supplies Fimo hosting for `output: 'server'`. A static
|
|
30
|
+
Astro site that hosts elsewhere can import `fimo` from `fimo/astro/config`
|
|
31
|
+
instead for the preview connector and branch env alone; the runtime
|
|
32
|
+
(`fimo/astro`, `fimo/astro/components`) always comes from `fimo`.
|
|
33
|
+
|
|
28
34
|
Compatibility: the Fimo peer range covers Astro 5–7. Static output is supported
|
|
29
35
|
across that range. Fimo's automatic server adapter path is currently validated
|
|
30
36
|
with the Astro 7-compatible adapter; Astro 5/6 server apps should keep their
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
peer ranges and the executable acceptance fixtures define compatibility; the
|
|
5
5
|
profile does not promise support for every version of the framework.
|
|
6
6
|
|
|
7
|
-
| Profile | Application dependency specifier | Fimo surface
|
|
8
|
-
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
-
| `nextjs` | Next 16 is the current acceptance baseline; Fimo's React peer is `^18.2.0 \|\| ^19.0.0` and Next imposes its own React range | `fimo
|
|
10
|
-
| `react-router` | React `^18.2.0 \|\| ^19.0.0`, React Router `^7.0.0 \|\| ^8.0.0`, Vite `^7.0.0 \|\| ^8.0.0` | `fimo/react-router`, `fimo/
|
|
11
|
-
| `vite` |
|
|
12
|
-
| `astro` | Astro `^5.0.0 \|\| ^6.0.0 \|\| ^7.0.0`
|
|
13
|
-
| `sveltekit` | SvelteKit `^2.0.0`, Svelte `^5.0.0`, Vite `^7.0.0 \|\| ^8.0.0` | `fimo
|
|
14
|
-
| `nuxtjs`, `remix`, `vue` | Hosting detection only; no Fimo content/runtime adapter yet | `fimo` hosting profile only
|
|
15
|
-
| _(unset)_ | Anything else: a static generator, plain HTML, a custom build script. Declare `runtime.commands.build` and `runtime.outputDirectory` instead | Static output only; no adapter
|
|
7
|
+
| Profile | Application dependency specifier | Fimo surface |
|
|
8
|
+
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| `nextjs` | Next 16 is the current acceptance baseline; Fimo's React peer is `^18.2.0 \|\| ^19.0.0` and Next imposes its own React range | `fimo-next`, `fimo-next/client` |
|
|
10
|
+
| `react-router` | React `^18.2.0 \|\| ^19.0.0`, React Router `^7.0.0 \|\| ^8.0.0`, Vite `^7.0.0 \|\| ^8.0.0` | `fimo-react-router`, `fimo-react-router/routes`, `fimo-react-router/preset`, `fimo-react-router/vite`, `fimo-react` |
|
|
11
|
+
| `vite` | Vite `^7.0.0 \|\| ^8.0.0`; React `^18.2.0 \|\| ^19.0.0` only when the app uses React | `fimo-react`, `fimo-react-router/vite` (React SPA) or `fimo-vite` (no React) |
|
|
12
|
+
| `astro` | Astro `^5.0.0 \|\| ^6.0.0 \|\| ^7.0.0`; Fimo hosting (`fimo-astro`) needs Astro `^7.0.0` | `fimo/astro`, `fimo/astro/components`, `fimo-astro/config` |
|
|
13
|
+
| `sveltekit` | SvelteKit `^2.0.0`, Svelte `^5.0.0`, Vite `^7.0.0 \|\| ^8.0.0` | `fimo-sveltekit`, `fimo-sveltekit/components`, `fimo-sveltekit/vite`, `fimo-sveltekit/config` |
|
|
14
|
+
| `nuxtjs`, `remix`, `vue` | Hosting detection only; no Fimo content/runtime adapter yet | `fimo` hosting profile only |
|
|
15
|
+
| _(unset)_ | Anything else: a static generator, plain HTML, a custom build script. Declare `runtime.commands.build` and `runtime.outputDirectory` instead | Static output only; no adapter |
|
|
16
16
|
|
|
17
17
|
`runtime.framework` must match a dependency in `package.json`; a profile the
|
|
18
18
|
code does not use fails the production build. Shape and rules: `hosting.md`
|
|
@@ -39,27 +39,31 @@ Hosted preview and production inject the tenant API through these aliases:
|
|
|
39
39
|
|
|
40
40
|
| Application | Server | Public/build |
|
|
41
41
|
| ----------------------- | ---------------------- | -------------------------- |
|
|
42
|
-
| Next.js | `FIMO_CONTENT_API_URL` |
|
|
42
|
+
| Next.js | `FIMO_CONTENT_API_URL` | Provider-owned |
|
|
43
43
|
| Nuxt | `FIMO_CONTENT_API_URL` | `NUXT_PUBLIC_FIMO_API_URL` |
|
|
44
44
|
| Astro, Remix, SvelteKit | `FIMO_CONTENT_API_URL` | `PUBLIC_FIMO_API_URL` |
|
|
45
45
|
| React Router, Vite, Vue | `FIMO_CONTENT_API_URL` | `VITE_API_URL` |
|
|
46
46
|
|
|
47
|
-
Locally, the app derives its env from the **git branch**: `fimo
|
|
48
|
-
`
|
|
49
|
-
API URL from `.fimo/project.json`
|
|
47
|
+
Locally, the app derives its env from the **git branch**: `fimo-vite` (or
|
|
48
|
+
`fimo-react-router/vite` for React Router projects), the Astro integration and
|
|
49
|
+
the SvelteKit plugin compute the tenant API URL from `.fimo/project.json`
|
|
50
50
|
(`projectId` + `tenantApiBaseUrl`, recorded once at `init`/`clone`/`link`) and
|
|
51
|
-
expose the Vite
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
expose the Vite and public (`PUBLIC_*`) aliases plus `FIMO_ENV` at startup,
|
|
52
|
+
during both dev and production builds. Next.js needs no browser alias: the root
|
|
53
|
+
`FimoProvider` and the `fimo-next` server runtime resolve the same connection
|
|
54
|
+
at render time and pass only the public part to the browser. No env file is
|
|
55
|
+
written on a switch, so a plain `git checkout` is a complete env switch. Never
|
|
56
|
+
hardcode a tenant URL in application source. One rule, per variable: a
|
|
57
|
+
non-empty value the user set explicitly (`.env`, shell, their own `define`) is
|
|
58
|
+
left alone, and Fimo fills the variables they did not set.
|
|
59
59
|
|
|
60
60
|
For a framework whose alias is not in that list yet, preserve or add its normal
|
|
61
61
|
local environment alias by hand.
|
|
62
62
|
|
|
63
|
+
`NEXT_PUBLIC_FIMO_*` remains a compatibility override for existing Next.js
|
|
64
|
+
projects. Do not add it to new code, env files, setup instructions, or migration
|
|
65
|
+
plans.
|
|
66
|
+
|
|
63
67
|
## React Router framework mode
|
|
64
68
|
|
|
65
69
|
For the supported client-rendered setup, keep `ssr: false` and add Fimo's
|
|
@@ -67,7 +71,7 @@ hosting preset. It hides the active hosting provider from application code:
|
|
|
67
71
|
|
|
68
72
|
```ts
|
|
69
73
|
import type { Config } from '@react-router/dev/config';
|
|
70
|
-
import { fimoPreset } from 'fimo
|
|
74
|
+
import { fimoPreset } from 'fimo-react-router/preset';
|
|
71
75
|
|
|
72
76
|
export default {
|
|
73
77
|
ssr: false,
|
|
@@ -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 });
|
|
@@ -35,13 +35,13 @@ When labels are not needed at that boundary, use `<FimoProvider locale={locale}>
|
|
|
35
35
|
|
|
36
36
|
## New-project boundary
|
|
37
37
|
|
|
38
|
-
Choose the primary locale from the user's request before building pages. Put the first explicitly requested locale in `.fimo/config.json#i18n.defaultLocale` and keep all requested locales in `i18n.locales`. That
|
|
38
|
+
Choose the primary locale from the user's request before building pages. Put the first explicitly requested locale in `.fimo/config.json#i18n.defaultLocale` and keep all requested locales in `i18n.locales`. That is content and provider configuration: `src/locales.ts` reads the file, so the default locale passed to `FimoProvider` and the `<html lang>` follow it. It does not create locale URLs. If the user gives no locale signal, keep `en` and state that choice. Never add `NEXT_PUBLIC_FIMO_DEFAULT_LOCALE` or `FIMO_DEFAULT_LOCALE`; the runtime ignores them by design.
|
|
39
39
|
|
|
40
|
-
The starter
|
|
40
|
+
The starter is default-only: one ordinary root layout renders `<html lang={defaultLocale}>` and `FimoProvider`, `/` is the homepage, and unknown paths get Next's native 404. Implement a locale routing strategy only when the product asks for one — prefixed `[locale]` segments, middleware, cookies, domains, or an i18n library are all Next decisions — then resolve the locale in that strategy and pass it into Fimo server reads and `FimoProvider`. Do not install a top-level `[locale]` route or an optional catch-all speculatively: it captures `/favicon.ico` and every unknown top-level path, and Fimo never requires it.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
When the app implements a localized URL shape, describe it in `.fimo/config.json#routes` for Studio. For `/:locale/pricing`, `params.locale.optional: true` means omit the configured default locale: with `i18n.defaultLocale: "en"`, `/pricing` is English and `/fr/pricing` is French. With `optional: false`, both `/en/pricing` and `/fr/pricing` are prefixed. The default locale value chooses the fallback locale; `optional` independently controls URL prefixes. A route without `:locale` remains application-owned. The config route catalog describes URL shapes for Studio; Next's `app` directory remains authoritative.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
`FimoProvider` owns the optional Studio preview runtime, including Next navigation and script loading. Application code only passes its resolved locale to the provider. Do not add a preview bridge component, read Fimo preview environment variables, or inject Fimo scripts.
|
|
45
45
|
|
|
46
46
|
With `next-i18next`, keep its routing and translation provider for the strings it owns. Pass the same resolved locale to Fimo; do not replace the library or duplicate its route structure.
|
|
47
47
|
|
|
@@ -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
|
```
|
|
@@ -133,6 +135,7 @@ For new projects, apply `references/locales.md`, keep the starter's `:locale?` r
|
|
|
133
135
|
## Boundaries
|
|
134
136
|
|
|
135
137
|
- Route modules and `meta` exports own routing and SEO.
|
|
136
|
-
- `
|
|
138
|
+
- `FimoProviders` owns the optional Studio preview runtime. Do not read Fimo preview environment variables or inject its script in application code.
|
|
139
|
+
- `FimoScripts` owns document-only JSON-LD and the development error overlay.
|
|
137
140
|
- Use `fimo deploy` only when the developer requests a hosted preview or publication.
|
|
138
141
|
- Load `references/ui.md` for rendering and `references/locales.md` for locale ownership.
|
|
@@ -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 = {
|
|
@@ -127,16 +136,14 @@ export const actions = {
|
|
|
127
136
|
|
|
128
137
|
## Live preview
|
|
129
138
|
|
|
130
|
-
`FimoProvider` owns the Studio
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
refreshes data with `invalidateAll()`. Without that environment value it does
|
|
134
|
-
nothing. Do not add a second preview component.
|
|
139
|
+
`FimoProvider` owns the optional Studio preview runtime, including script
|
|
140
|
+
loading, SvelteKit navigation, and content refresh. Do not add a second preview
|
|
141
|
+
component, read Fimo preview environment variables, or inject Fimo scripts.
|
|
135
142
|
|
|
136
143
|
## Boundaries
|
|
137
144
|
|
|
138
145
|
- SvelteKit owns routing, history, 404s, locale URLs, and SEO.
|
|
139
|
-
- `fimo
|
|
146
|
+
- `fimo-sveltekit/vite` owns dev source tagging only.
|
|
140
147
|
- `FimoProvider` owns labels and the optional Studio preview bridge.
|
|
141
148
|
- Do not add React, React Query, or a Vite SPA fallback to a SvelteKit project.
|
|
142
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.
|
|
@@ -13,7 +13,7 @@ The application owns locale resolution and routing. Fimo consumes the resolved l
|
|
|
13
13
|
}
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
For new projects, derive the primary locale from the request; when several are explicit, the first one named is the default. Update `i18n.defaultLocale`, `i18n.locales`, the framework-native route boundary
|
|
16
|
+
For new projects, derive the primary locale from the request; when several are explicit, the first one named is the default. Update `i18n.defaultLocale`, `i18n.locales`, the document language default, and any framework-native locale route boundary or matcher the application implements. If the user gives no locale signal, retain the starter default and state that choice.
|
|
17
17
|
|
|
18
18
|
Keep one locale unless the product asks for multilingual output. Keep it locale-ready without forcing `/en`, a language switcher, global path-prefix routing, or localized schemas. Locale tags should be structurally valid, such as `en`, `pt-BR`, or `zh-Hans`.
|
|
19
19
|
|
|
@@ -45,4 +45,4 @@ For an already linked project, enable each locale in Fimo before writing non-def
|
|
|
45
45
|
|
|
46
46
|
Do not replace an existing locale system merely to add Fimo. Do not duplicate localized routes in the Studio catalog. Every framework resolves its active locale and passes it to Fimo through that framework's provider or server-read seam.
|
|
47
47
|
|
|
48
|
-
Astro
|
|
48
|
+
Neither Astro nor Next has an optional single-segment filesystem folder; an optional locale boundary in those frameworks is paired native filesystem route trees, one unprefixed for the default locale and one prefixed for the others. The Astro starter ships that pair; the Next starter is default-only, so a Next application adds a `[locale]` tree (or another strategy) only when the product asks for prefixed URLs.
|