fimo 0.14.0 → 0.15.0-staging.2
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 -0
- package/assets/astro/components/Boolean.astro +14 -0
- package/assets/astro/components/Date.astro +23 -0
- package/assets/astro/components/Image.astro +79 -0
- package/assets/astro/components/Json.astro +14 -0
- package/assets/astro/components/RichText.astro +17 -0
- package/assets/astro/components/StaticImage.astro +66 -0
- package/assets/astro/components/Text.astro +23 -0
- package/assets/astro/components/Video.astro +47 -0
- package/assets/astro/components/index.d.ts +8 -0
- package/assets/astro/components/index.js +8 -0
- package/assets/content-templates/shared/server.eta +56 -0
- package/assets/content-templates/sveltekit/content.eta +86 -0
- package/assets/skills/fimo/SKILL.md +13 -4
- package/assets/skills/fimo-cli/SKILL.md +28 -28
- package/assets/skills/fimo-cli/references/account.md +0 -2
- package/assets/skills/fimo-cli/references/agent-setup.md +7 -9
- package/assets/skills/fimo-cli/references/agents.md +0 -2
- package/assets/skills/fimo-cli/references/analytics.md +0 -2
- package/assets/skills/fimo-cli/references/assets.md +2 -4
- package/assets/skills/fimo-cli/references/branches.md +14 -15
- package/assets/skills/fimo-cli/references/content.md +9 -11
- package/assets/skills/fimo-cli/references/credits.md +0 -2
- package/assets/skills/fimo-cli/references/deploy.md +6 -7
- package/assets/skills/fimo-cli/references/describe.md +1 -3
- package/assets/skills/fimo-cli/references/domains.md +0 -2
- package/assets/skills/fimo-cli/references/forms.md +5 -7
- package/assets/skills/fimo-cli/references/history.md +0 -2
- package/assets/skills/fimo-cli/references/init.md +34 -26
- package/assets/skills/fimo-cli/references/integrations/firecrawl.md +0 -2
- package/assets/skills/fimo-cli/references/integrations.md +0 -2
- package/assets/skills/fimo-cli/references/invite.md +0 -2
- package/assets/skills/fimo-cli/references/labels.md +5 -7
- package/assets/skills/fimo-cli/references/locales.md +2 -4
- package/assets/skills/fimo-cli/references/mcp.md +2 -4
- package/assets/skills/fimo-cli/references/media.md +0 -2
- package/assets/skills/fimo-cli/references/preview.md +0 -2
- package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +1 -3
- package/assets/skills/fimo-cli/references/projects.md +1 -3
- package/assets/skills/fimo-cli/references/schedules.md +0 -2
- package/assets/skills/fimo-cli/references/support.md +0 -2
- package/assets/skills/fimo-cli/references/webhooks.md +0 -2
- package/assets/skills/fimo-code/SKILL.md +11 -3
- package/assets/skills/fimo-code/references/assets.md +2 -2
- package/assets/skills/fimo-code/references/content/clients.md +5 -1
- package/assets/skills/fimo-code/references/content.md +3 -1
- package/assets/skills/fimo-code/references/frameworks/astro.md +127 -0
- package/assets/skills/fimo-code/references/frameworks/compatibility.md +19 -0
- package/assets/skills/fimo-code/references/frameworks/hosting.md +15 -3
- package/assets/skills/fimo-code/references/frameworks/react-router.md +37 -209
- package/assets/skills/fimo-code/references/frameworks/sveltekit.md +110 -0
- package/assets/skills/fimo-code/references/frameworks/vite-react.md +35 -166
- package/assets/skills/fimo-code/references/labels.md +16 -6
- package/assets/skills/fimo-code/references/locales.md +3 -1
- package/assets/skills/fimo-code/references/ui.md +19 -15
- package/assets/skills/fimo-migration/SKILL.md +99 -146
- package/assets/skills/fimo-migration/references/frameworks/nextjs.md +26 -0
- package/assets/skills/fimo-migration/references/inventory/coordinator.md +40 -0
- package/assets/skills/fimo-migration/references/inventory/locales/next-intl.md +39 -0
- package/assets/skills/fimo-migration/references/inventory/locales.md +41 -0
- package/assets/skills/fimo-migration/references/workflow.md +3 -2
- package/assets/skills/fimo-migration/scripts/inventory/locales/next-intl.mjs +459 -0
- package/assets/skills/fimo-studio/SKILL.md +1 -1
- package/assets/skills/fimo-studio/references/project-creation.md +10 -18
- package/assets/starters/fimo-site/template/.fimo/agents/content-guide/capabilities.yaml +0 -1
- package/assets/starters/fimo-site/template/.fimo/agents/site-review/capabilities.yaml +0 -1
- package/assets/sveltekit/components/Boolean.svelte +19 -0
- package/assets/sveltekit/components/Date.svelte +33 -0
- package/assets/sveltekit/components/FimoProvider.svelte +35 -0
- package/assets/sveltekit/components/Image.svelte +80 -0
- package/assets/sveltekit/components/Json.svelte +18 -0
- package/assets/sveltekit/components/Label.svelte +16 -0
- package/assets/sveltekit/components/Number.svelte +21 -0
- package/assets/sveltekit/components/RichText.svelte +19 -0
- package/assets/sveltekit/components/Text.svelte +30 -0
- package/assets/sveltekit/components/Video.svelte +37 -0
- package/assets/sveltekit/components/index.d.ts +10 -0
- package/assets/sveltekit/components/index.js +10 -0
- package/dist/build/astro/config.d.ts +4 -0
- package/dist/build/astro/config.js +64 -0
- package/dist/build/next/config.js +16 -0
- package/dist/build/sveltekit/config.d.ts +6 -0
- package/dist/build/sveltekit/config.js +8 -0
- package/dist/build/sveltekit/data-id.d.ts +3 -0
- package/dist/build/sveltekit/data-id.js +171 -0
- package/dist/build/sveltekit/vite.d.ts +13 -0
- package/dist/build/sveltekit/vite.js +15 -0
- package/dist/build/vite/index.js +2 -0
- package/dist/build/vite/plugins/data-id.d.ts +9 -0
- package/dist/build/vite/plugins/data-id.js +6 -1
- package/dist/build/vite/plugins/runtime-env.d.ts +21 -0
- package/dist/build/vite/plugins/runtime-env.js +68 -0
- package/dist/cli/bundle.json +1 -1
- package/dist/cli/index.js +108 -101
- package/dist/runtime/app/FimoProviders.d.ts +1 -1
- package/dist/runtime/app/FimoProviders.js +11 -5
- package/dist/runtime/astro/internal.d.ts +6 -0
- package/dist/runtime/astro/internal.js +16 -0
- package/dist/runtime/astro/preview.d.ts +14 -0
- package/dist/runtime/astro/preview.js +103 -0
- package/dist/runtime/astro/render-rich-text.d.ts +2 -0
- package/dist/runtime/astro/render-rich-text.js +1 -0
- package/dist/runtime/astro/server-runtime.d.ts +3 -0
- package/dist/runtime/astro/server-runtime.js +20 -0
- package/dist/runtime/astro/server.d.ts +15 -0
- package/dist/runtime/astro/server.js +14 -0
- package/dist/runtime/content/client/collection-core.d.ts +2 -17
- package/dist/runtime/content/client/collection-core.js +15 -8
- package/dist/runtime/content/client/core-types.d.ts +96 -0
- package/dist/runtime/content/client/core-types.js +1 -0
- package/dist/runtime/content/client/internal.d.ts +4 -4
- package/dist/runtime/content/client/internal.js +4 -3
- package/dist/runtime/content/client/runtime.d.ts +1 -1
- package/dist/runtime/content/client/server-content-client.d.ts +3 -3
- package/dist/runtime/content/client/server-content-client.js +2 -29
- package/dist/runtime/content/client/singleton-core.d.ts +2 -9
- package/dist/runtime/content/client/singleton-core.js +9 -4
- package/dist/runtime/content/client/types.d.ts +5 -115
- package/dist/runtime/content/index.d.ts +3 -3
- package/dist/runtime/labels/fetch.js +5 -3
- package/dist/runtime/next/client.d.ts +2 -1
- package/dist/runtime/next/facade.d.ts +1 -1
- package/dist/runtime/next/provider.js +1 -1
- package/dist/runtime/next/server-runtime.js +1 -1
- package/dist/runtime/next/server.d.ts +5 -4
- package/dist/runtime/paths/get-fimo-paths.js +8 -3
- package/dist/runtime/preview/bridge.d.ts +8 -0
- package/dist/runtime/preview/bridge.js +20 -0
- package/dist/runtime/preview/location.d.ts +23 -0
- package/dist/runtime/preview/location.js +93 -0
- package/dist/runtime/preview/routes.d.ts +10 -0
- package/dist/runtime/preview/routes.js +29 -0
- package/dist/runtime/primitives/index.d.ts +4 -1
- package/dist/runtime/primitives/index.js +1 -0
- package/dist/runtime/primitives/lib/image-optimization.d.ts +27 -2
- package/dist/runtime/primitives/lib/image-optimization.js +40 -0
- package/dist/runtime/primitives/lib/index.d.ts +1 -1
- package/dist/runtime/primitives/lib/primitives.d.ts +0 -54
- package/dist/runtime/primitives/lib/primitives.js +6 -0
- package/dist/runtime/primitives/lib/render-rich-text.d.ts +3 -0
- package/dist/runtime/primitives/lib/render-rich-text.js +112 -0
- package/dist/runtime/react/primitives/contracts.d.ts +40 -2
- package/dist/runtime/react/primitives/renderers/ImageRenderer.js +15 -34
- package/dist/runtime/react/primitives/renderers/RichTextRenderer.d.ts +2 -1
- package/dist/runtime/react/primitives/renderers/StaticImage.js +13 -30
- package/dist/runtime/routing/AppRoutesProvider.js +20 -8
- package/dist/runtime/shared/env-identity.d.ts +43 -0
- package/dist/runtime/shared/env-identity.js +88 -0
- package/dist/runtime/shared/local-runtime-env.d.ts +65 -0
- package/dist/runtime/shared/local-runtime-env.js +169 -0
- package/dist/runtime/{react-router → shared}/preview-location.d.ts +7 -13
- package/dist/runtime/{react-router → shared}/preview-location.js +26 -27
- package/dist/runtime/sveltekit/content.d.ts +25 -0
- package/dist/runtime/sveltekit/content.js +33 -0
- package/dist/runtime/sveltekit/context-contract.d.ts +5 -0
- package/dist/runtime/sveltekit/context-contract.js +2 -0
- package/dist/runtime/sveltekit/context.d.ts +8 -0
- package/dist/runtime/sveltekit/context.js +25 -0
- package/dist/runtime/sveltekit/index.d.ts +7 -0
- package/dist/runtime/sveltekit/index.js +4 -0
- package/dist/runtime/sveltekit/internal.d.ts +6 -0
- package/dist/runtime/sveltekit/internal.js +12 -0
- package/dist/runtime/sveltekit/labels.d.ts +16 -0
- package/dist/runtime/sveltekit/labels.js +13 -0
- package/dist/runtime/sveltekit/preview.d.ts +19 -0
- package/dist/runtime/sveltekit/preview.js +77 -0
- package/dist/runtime/sveltekit/runtime.d.ts +8 -0
- package/dist/runtime/sveltekit/runtime.js +17 -0
- package/dist/runtime/templates.d.ts +1 -1
- package/dist/runtime/templates.js +1 -1
- package/dist/runtime/vite/Label.d.ts +13 -0
- package/dist/runtime/vite/Label.js +16 -0
- package/dist/scripts/extract-translations.js +103 -43
- package/dist/scripts/sync-forms.js +1 -1
- package/dist/scripts/sync-schemas.js +83 -16
- package/package.json +57 -2
- package/release.json +2 -2
- package/templates/nextjs/AGENTS.md +10 -5
- package/templates/nextjs/_gitignore +1 -0
- package/templates/react-router/AGENTS.md +4 -3
- package/templates/react-router/package.json +1 -1
- package/templates/sveltekit/.fimo/config.json +15 -0
- package/templates/sveltekit/AGENTS.md +36 -0
- package/templates/sveltekit/CLAUDE.md +5 -0
- package/templates/sveltekit/_gitignore +16 -0
- package/templates/sveltekit/package.json +28 -0
- package/templates/sveltekit/pnpm-workspace.yaml +4 -0
- package/templates/sveltekit/src/app.html +11 -0
- package/templates/sveltekit/src/routes/+layout.server.ts +8 -0
- package/templates/sveltekit/src/routes/+layout.svelte +12 -0
- package/templates/sveltekit/src/routes/+page.svelte +48 -0
- package/templates/sveltekit/svelte.config.js +5 -0
- package/templates/sveltekit/tsconfig.json +14 -0
- package/templates/sveltekit/vite.config.ts +5 -0
- /package/assets/content-templates/{form-template.eta → forms/react.eta} +0 -0
- /package/assets/content-templates/{next-client-template.eta → next/client.eta} +0 -0
- /package/assets/content-templates/{next-server-template.eta → next/server.eta} +0 -0
- /package/assets/content-templates/{hooks-template.eta → react/client.eta} +0 -0
- /package/assets/content-templates/{types-template.eta → shared/types.eta} +0 -0
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Project Variables And Secrets
|
|
2
2
|
|
|
3
|
-
> **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
|
|
4
|
-
|
|
5
3
|
Use project variables for values that are safe to expose to the browser. Use project secrets for hidden values such as API keys, tokens, webhooks, and service credentials.
|
|
6
4
|
|
|
7
5
|
There is no private-variable mode. If leaking the value would be a problem, use `fimo secrets`.
|
|
@@ -49,7 +47,7 @@ variables.
|
|
|
49
47
|
|
|
50
48
|
## Local Env Files
|
|
51
49
|
|
|
52
|
-
`fimo init`
|
|
50
|
+
`fimo init` and `fimo clone` write `.env` with the framework-specific tenant content API URLs needed for local development. These are Fimo-managed connection values, not project variables; users should not discover or set them manually.
|
|
53
51
|
|
|
54
52
|
`fimo vars add`, `fimo vars update`, and `fimo vars pull` write public project variables to a managed block in `.env.local`.
|
|
55
53
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Managing projects
|
|
2
2
|
|
|
3
|
-
> **Run via `npx fimo@latest <command>`** — always the latest CLI, no install needed.
|
|
4
|
-
|
|
5
3
|
Commands for listing projects across an org, cloning a remote project locally, and managing the lifecycle of a single project (delete, publish, unpublish, rename). Most lifecycle commands operate on the **current project** (read from `.fimo/project.json`, or the legacy `.fimo.settings.json`, in the cwd) by default; for `delete`, `publish`, and `unpublish` you can pass an explicit `[projectId]` to target another. (`rename` only edits the linked local project; see below.)
|
|
6
4
|
|
|
7
5
|
## The `fimo projects` namespace
|
|
@@ -29,7 +27,7 @@ fimo projects rename <name> [projectId] [-C <dir>] # set seo.siteName in the l
|
|
|
29
27
|
fimo clone [projectId] [dir] [--env <name>] # same as `fimo projects clone`
|
|
30
28
|
```
|
|
31
29
|
|
|
32
|
-
Use the top-level shortcut for the common "get this project onto my machine" workflow. After clone succeeds, `cd` into the printed directory, `Read` the project's `AGENTS.md`, and load the code skill with `
|
|
30
|
+
Use the top-level shortcut for the common "get this project onto my machine" workflow. After clone succeeds, `cd` into the printed directory, `Read` the project's `AGENTS.md`, and load the code skill with `fimo skills get fimo-code` before generating code.
|
|
33
31
|
|
|
34
32
|
## Top-level shortcuts (current project)
|
|
35
33
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Scheduled Commands
|
|
2
2
|
|
|
3
|
-
> **Run via `npx fimo@latest <command>`** - always the latest CLI, no install needed.
|
|
4
|
-
|
|
5
3
|
`fimo schedules` manages recurring commands for one project environment. It uses the current checkout environment by default, or the environment passed with `--env <name>`.
|
|
6
4
|
|
|
7
5
|
The command starts in that environment's sandbox. Commands can still target another environment explicitly, for example with `fimo schemas list --env preview`.
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Reporting a problem to Fimo
|
|
2
2
|
|
|
3
|
-
> **Run via `npx fimo@latest <command>`** - always the latest CLI, no install needed.
|
|
4
|
-
|
|
5
3
|
`fimo support report` sends a project-scoped problem to Fimo support. It automatically includes the project, current environment, and CLI version so support can start investigating without asking the user to repeat that context.
|
|
6
4
|
|
|
7
5
|
## When to prepare it
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# Outbound webhooks
|
|
2
2
|
|
|
3
|
-
> **Run via `npx fimo@latest <command>`** so the event catalog and delivery commands match the platform.
|
|
4
|
-
|
|
5
3
|
> **Beta:** Test each destination and inspect its delivery history before depending on it in production.
|
|
6
4
|
|
|
7
5
|
Use `fimo webhooks` to send project events to external HTTPS endpoints. The CLI and Studio edit the same project-wide configurations and delivery history. The CLI has no provider presets: inspect the destination's API documentation, then pass its URL, headers, and JSON body explicitly.
|
|
@@ -4,7 +4,7 @@ description: >-
|
|
|
4
4
|
Write schema-first application code with the installed `fimo` package.
|
|
5
5
|
Load when declaring content schemas or forms, using generated content
|
|
6
6
|
clients, rendering Fimo primitives, reading labels, or integrating Fimo
|
|
7
|
-
with Next.js, React Router, Vite, or another application framework. CLI
|
|
7
|
+
with Next.js, React Router, Vite, SvelteKit, or another application framework. CLI
|
|
8
8
|
commands and operational workflows live in the `fimo-cli` skill.
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -30,7 +30,14 @@ Framework routing:
|
|
|
30
30
|
- `nextjs` or an `app/`, `src/app/`, `pages/`, or `src/pages/` tree → `references/frameworks/next.md`, then the matching App Router or Pages Router reference.
|
|
31
31
|
- React Router framework mode (`react-router.config.ts`, `src/routes.ts`) → `references/frameworks/react-router.md`.
|
|
32
32
|
- Vite + React without framework mode → `references/frameworks/vite-react.md`.
|
|
33
|
-
- Astro
|
|
33
|
+
- Astro (`astro.config.*`, `src/pages/**/*.astro`) → `references/frameworks/astro.md`.
|
|
34
|
+
- SvelteKit → `references/frameworks/sveltekit.md`.
|
|
35
|
+
- Nuxt, Remix, Vue, or another hosting-only setup → `references/frameworks/hosting.md`. Do not invent an SDK adapter that the installed package does not export.
|
|
36
|
+
|
|
37
|
+
When a project's framework version is uncertain, load
|
|
38
|
+
`references/frameworks/compatibility.md`. Use the project's installed version
|
|
39
|
+
and the documented adapter range; do not assume that a framework profile means
|
|
40
|
+
every historical version is supported.
|
|
34
41
|
|
|
35
42
|
## Durable content contract
|
|
36
43
|
|
|
@@ -50,8 +57,9 @@ Each reference defines one package contract. Fetch it when the task reaches that
|
|
|
50
57
|
- Tracked rendering: `Text`, `RichText`, `Image`, `FimoString`, `FimoMedia` → `references/ui.md`
|
|
51
58
|
- Forms: JSON spec, generated Zod schema, `submit*` helpers → `references/forms.md`
|
|
52
59
|
- Media values, `<Image>`, `<StaticImage>` → `references/assets.md`
|
|
53
|
-
- Static editable copy: `t()`,
|
|
60
|
+
- Static editable copy: `Label`, `t()`, providers, and server label readers → `references/labels.md`
|
|
54
61
|
- Locale ownership and framework handoff → `references/locales.md`
|
|
62
|
+
- Astro connector and output/adapter contract → `references/frameworks/astro.md`
|
|
55
63
|
- Framework detection, production routing, and hosting adapters → `references/frameworks/hosting.md`
|
|
56
64
|
- Major visual work → `references/design.md`
|
|
57
65
|
|
|
@@ -22,9 +22,9 @@ Asset values returned from `fimo assets upload` or Fimo media tasks, and stored
|
|
|
22
22
|
|
|
23
23
|
Generated content reads wrap this stored value in `FimoMedia`, which exposes `url`, `alt`, `name`, `mime`, and optional `width`/`height`. It does not expose `source`; Fimo tracks that internally. Pass the whole entry value to `<Image>` / `<Video>`.
|
|
24
24
|
|
|
25
|
-
## Rendering in
|
|
25
|
+
## Rendering in application code
|
|
26
26
|
|
|
27
|
-
Import the primitives from the active framework adapter: `fimo/next` on the Next server, `fimo/next/client` in Next Client Components,
|
|
27
|
+
Import the primitives from the active framework adapter: `fimo/next` on the Next server, `fimo/next/client` in Next Client Components, `fimo/ui` in React Router/Vite, or `fimo/astro/components` in Astro pages.
|
|
28
28
|
|
|
29
29
|
| Asset source | Component | Pass via |
|
|
30
30
|
| --------------------------------------------------- | --------------------- | ------------------------- |
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Application code imports the public modules generated from `src/schemas/<Uid>.json`, not `.types.ts` directly.
|
|
4
4
|
|
|
5
|
-
The exact file split is framework-dependent. Load
|
|
5
|
+
The exact file split is framework-dependent. Load the matching reference under
|
|
6
|
+
`references/frameworks/` before choosing imports. This includes the Next.js,
|
|
7
|
+
Astro, React Router, Vite React, and SvelteKit references. Astro modules are
|
|
8
|
+
server-only promise clients; the hooks below exist only in client-capable
|
|
9
|
+
frameworks.
|
|
6
10
|
|
|
7
11
|
## Entry shape
|
|
8
12
|
|
|
@@ -7,8 +7,10 @@ Load only what the task needs:
|
|
|
7
7
|
- `references/content/schema.md` — schema JSON, field types, blocks, references, and safe transitions.
|
|
8
8
|
- `references/content/richtext.md` — Tiptap JSONContent, entry payloads, and slug rules.
|
|
9
9
|
- `references/content/clients.md` — generated collection/singleton clients, queries, projections, population, and locale behavior.
|
|
10
|
-
- `references/ui.md` — source-tracked values and their
|
|
10
|
+
- `references/ui.md` — source-tracked values and their framework renderers.
|
|
11
11
|
- `references/frameworks/next.md` — Next App/Pages Router module boundaries.
|
|
12
|
+
- `references/frameworks/astro.md` — Astro server clients and native components.
|
|
13
|
+
- `references/frameworks/sveltekit.md` — request-bound clients, load serialization, native components, and labels.
|
|
12
14
|
- `references/frameworks/react-router.md` — React Router framework-mode setup and imports.
|
|
13
15
|
- `references/frameworks/vite-react.md` — Vite + React setup and imports.
|
|
14
16
|
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Astro integration
|
|
2
|
+
|
|
3
|
+
Use this reference for an existing Astro application. The application keeps its route files, output mode, adapter, locale system, links, `<html lang/dir>`, and SEO. Fimo connects content, labels, native rendering, preview, and hosting.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
Declare the production framework in `.fimo/config.json`:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"runtime": { "framework": "astro" }
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
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
|
+
|
|
17
|
+
Add the integration beside the adapters and integrations the project already uses:
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import { defineConfig } from 'astro/config';
|
|
21
|
+
import { fimo } from 'fimo/astro/config';
|
|
22
|
+
|
|
23
|
+
export default defineConfig({
|
|
24
|
+
integrations: [fimo()],
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Compatibility: the Fimo peer range covers Astro 5–7. Static output is supported
|
|
29
|
+
across that range. Fimo's automatic server adapter path is currently validated
|
|
30
|
+
with the Astro 7-compatible adapter; Astro 5/6 server apps should keep their
|
|
31
|
+
existing adapter until a matching server adapter is supported.
|
|
32
|
+
|
|
33
|
+
`fimo()` loads the platform script only in Fimo previews, reports location to Studio, and performs full-page navigation when Studio changes routes. With `output: 'server'` and no adapter, it also supplies Fimo's hosted server adapter; it never replaces an adapter the application already owns for another deployment target.
|
|
34
|
+
|
|
35
|
+
Server reads use `FIMO_CONTENT_API_URL`. `fimo init` and `fimo clone` provide it locally; hosted preview and production inject it (alias table: `references/frameworks/hosting.md`).
|
|
36
|
+
|
|
37
|
+
## Generated content
|
|
38
|
+
|
|
39
|
+
Declare content in `src/schemas/<Uid>.json` and apply each change with `fimo schemas push <Uid>` (workflow: `fimo-cli/references/content.md`). Astro receives one server-only `<Uid>.ts` public module plus `<Uid>.types.ts`. There are no `.client.ts` modules, React Query hooks, or browser content registry; reads run in frontmatter on the server.
|
|
40
|
+
|
|
41
|
+
## Read and render
|
|
42
|
+
|
|
43
|
+
Use generated schema modules for data, `fimo/astro` for `getLabels` and the `fimo` template tag, and `fimo/astro/components` for native components:
|
|
44
|
+
|
|
45
|
+
```astro
|
|
46
|
+
---
|
|
47
|
+
import { fimo, getLabels } from 'fimo/astro';
|
|
48
|
+
import { Image, RichText, Text } from 'fimo/astro/components';
|
|
49
|
+
|
|
50
|
+
import * as SiteSettings from '../schemas/SiteSettings';
|
|
51
|
+
import * as Story from '../schemas/Story';
|
|
52
|
+
|
|
53
|
+
const locale = Astro.currentLocale; // or the app's own resolution — see Locales
|
|
54
|
+
const [settings, stories, labels] = await Promise.all([
|
|
55
|
+
SiteSettings.get({ locale }),
|
|
56
|
+
Story.list({ locale, limit: 12 }),
|
|
57
|
+
getLabels({ locale }),
|
|
58
|
+
]);
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
<Text as="h1" value={settings.siteName} />
|
|
62
|
+
{
|
|
63
|
+
stories.items.map((story) => (
|
|
64
|
+
<article>
|
|
65
|
+
<Image value={story.cover} width={320} />
|
|
66
|
+
<Text as="h3" value={story.title} />
|
|
67
|
+
<RichText value={story.body} />
|
|
68
|
+
<a href={`/stories/${String(story.slug)}`}>
|
|
69
|
+
<Text as="span" value={fimo`${labels.t('story.readMore')}: ${story.title}`} />
|
|
70
|
+
</a>
|
|
71
|
+
</article>
|
|
72
|
+
))
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The native surface is `Text`, `RichText`, `Image`, `StaticImage`, `Video`, `Date`, `Boolean`, and `Json` (component table: `references/ui.md`). Pass tracked values whole so Studio can resolve their source; use `String(value)` only for attributes and URLs.
|
|
77
|
+
|
|
78
|
+
## Static and on-demand rendering
|
|
79
|
+
|
|
80
|
+
Keep the application's per-route rendering choice:
|
|
81
|
+
|
|
82
|
+
- Prerendered pages read content once at build; edited content appears after a rebuild/redeploy.
|
|
83
|
+
- On-demand pages (`export const prerender = false`, or `output: 'server'`) read on every request and always serve current content.
|
|
84
|
+
- A fully static app that needs on-demand routes and owns no adapter can set `output: 'server'`, mark still-static pages `export const prerender = true`, and let `fimo()` supply the server adapter.
|
|
85
|
+
|
|
86
|
+
Expand prerendered dynamic routes from generated reads:
|
|
87
|
+
|
|
88
|
+
```astro
|
|
89
|
+
---
|
|
90
|
+
import * as Story from '../../schemas/Story';
|
|
91
|
+
|
|
92
|
+
export async function getStaticPaths() {
|
|
93
|
+
const { items } = await Story.list({ limit: 100 });
|
|
94
|
+
return items.map((story) => ({ params: { slug: String(story.slug) } }));
|
|
95
|
+
}
|
|
96
|
+
---
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Locales
|
|
100
|
+
|
|
101
|
+
The application resolves the locale — route prefix, middleware, domain, `Astro.currentLocale`, cookie, or its i18n library — and passes it to content reads and `getLabels({ locale })`. When a server read omits `locale`, the Fimo API resolves the project default; do not hardcode a fallback locale in application code. Astro needs no Fimo locale provider. Ownership rules: `references/locales.md`.
|
|
102
|
+
|
|
103
|
+
## Studio route catalog
|
|
104
|
+
|
|
105
|
+
`.fimo/config.json#routes` is an optional catalog of pages for Studio navigation, not router configuration. Never replace or infer Astro's route files, redirects, middleware, or 404 behavior from it. Keep paths canonical and unlocalized, and describe dynamic segments with `params` so Studio can list entries:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"routes": {
|
|
110
|
+
"home": { "label": "Home", "path": "/" },
|
|
111
|
+
"story": {
|
|
112
|
+
"label": "Story",
|
|
113
|
+
"path": "/stories/:slug",
|
|
114
|
+
"params": { "slug": { "schema": "Story", "queryField": "slug", "displayField": "title" } }
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Client islands
|
|
121
|
+
|
|
122
|
+
Generated content reads remain server-only. Preserve existing islands and do not add React or a client SDK to work around this boundary.
|
|
123
|
+
|
|
124
|
+
## Recovery
|
|
125
|
+
|
|
126
|
+
- `fimo schemas push` reports that the project-local `fimo` package lacks the `fimo/astro` export → upgrade the project's `fimo` dependency, then re-run validation with the project-installed CLI.
|
|
127
|
+
- The site renders in preview but Studio cannot list or open pages → `fimo()` is missing from `astro.config.*`, or a route catalog `path` does not match the page's URL.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Framework compatibility
|
|
2
|
+
|
|
3
|
+
`runtime.framework` selects Fimo's integration profile. The package's optional
|
|
4
|
+
peer ranges and the executable acceptance fixtures define compatibility; the
|
|
5
|
+
profile does not promise support for every version of the framework.
|
|
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/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/ui` |
|
|
11
|
+
| `vite` | React `^18.2.0 \|\| ^19.0.0`, Vite `^7.0.0 \|\| ^8.0.0` | `fimo/ui`, `fimo/vite` |
|
|
12
|
+
| `astro` | Astro `^5.0.0 \|\| ^6.0.0 \|\| ^7.0.0` | `fimo/astro`, `fimo/astro/components` |
|
|
13
|
+
| `sveltekit` | SvelteKit `^2.0.0`, Svelte `^5.0.0`, Vite `^7.0.0 \|\| ^8.0.0` | `fimo/sveltekit`, `fimo/sveltekit/components`, `fimo/sveltekit/config`, `fimo/sveltekit/vite` |
|
|
14
|
+
| `nuxtjs`, `remix`, `vue` | Hosting detection only; no Fimo content/runtime adapter yet | `fimo` hosting profile only |
|
|
15
|
+
|
|
16
|
+
The exact versions used by acceptance fixtures are test baselines, not values
|
|
17
|
+
to copy into an application. If a project falls outside a documented range,
|
|
18
|
+
report that boundary before changing framework code; do not silently downgrade
|
|
19
|
+
or replace the application's framework.
|
|
@@ -28,9 +28,18 @@ Hosted preview and production inject the tenant API through these aliases:
|
|
|
28
28
|
| Astro, Remix, SvelteKit | `FIMO_CONTENT_API_URL` | `PUBLIC_FIMO_API_URL` |
|
|
29
29
|
| React Router, Vite, Vue | `FIMO_CONTENT_API_URL` | `VITE_API_URL` |
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
Locally, the app derives its env from the **git branch**: `fimo/vite`,
|
|
32
|
+
`withFimo`, the Astro integration and the SvelteKit plugin compute the tenant
|
|
33
|
+
API URL from `.fimo/project.json`
|
|
34
|
+
(`projectId` + `tenantApiBaseUrl`, recorded once at `init`/`clone`/`link`) and
|
|
35
|
+
expose the Vite, Next and public (`PUBLIC_*`) aliases plus `FIMO_ENV` /
|
|
36
|
+
`NEXT_PUBLIC_FIMO_ENV` at startup. No env file is written on a switch, so a plain `git checkout` is a
|
|
37
|
+
complete env switch. Never hardcode a tenant URL in application source. One
|
|
38
|
+
rule, per variable: a value the user set explicitly (`.env`, shell, their own
|
|
39
|
+
`define`) is left alone, and Fimo fills the variables they did not set.
|
|
40
|
+
|
|
41
|
+
For a framework whose alias is not in that list yet, preserve or add its normal
|
|
42
|
+
local environment alias by hand.
|
|
34
43
|
|
|
35
44
|
## React Router framework mode
|
|
36
45
|
|
|
@@ -75,6 +84,9 @@ Next.js and the other supported native frameworks own their build and routing
|
|
|
75
84
|
output. Do not add a catch-all rewrite; the framework's hosting preset handles
|
|
76
85
|
routes, server functions, static output, and 404 responses.
|
|
77
86
|
|
|
87
|
+
Astro has a dedicated connector — load `references/frameworks/astro.md` before
|
|
88
|
+
editing an Astro config.
|
|
89
|
+
|
|
78
90
|
`.fimo/config.json#routes` is the Studio page catalog, not deployment routing.
|
|
79
91
|
Never generate hosting rewrites from it. If a project already has a
|
|
80
92
|
provider-specific deployment file, preserve it; that file remains authoritative.
|
|
@@ -1,72 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React Router framework mode
|
|
2
2
|
|
|
3
|
-
This
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
This is the canonical Fimo + React Router framework-mode setup used by
|
|
4
|
+
`fimo init`. You can also apply it to an existing React Router project: preserve
|
|
5
|
+
its routes, rendering choices, providers, and SEO.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Install and build
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- A Fimo project created via `fimo init` (gives you `projectId`,
|
|
11
|
-
`organizationId`, and an `apiUrl`).
|
|
9
|
+
Install the peers the application uses:
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```
|
|
11
|
+
```bash
|
|
16
12
|
pnpm add fimo react react-dom react-router @tanstack/react-query
|
|
17
|
-
pnpm add -D @react-router/dev @react-router/node
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## File: `package.json`
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
{
|
|
24
|
-
"name": "__PROJECT_SLUG__",
|
|
25
|
-
"version": "0.0.0",
|
|
26
|
-
"private": true,
|
|
27
|
-
"type": "module",
|
|
28
|
-
"scripts": {
|
|
29
|
-
"dev": "react-router dev --port 5173",
|
|
30
|
-
"build": "react-router build && fimo export-static",
|
|
31
|
-
"preview": "vite preview --host 0.0.0.0 --port 4173",
|
|
32
|
-
"typecheck": "tsc --noEmit"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
13
|
+
pnpm add -D @react-router/dev @react-router/node vite
|
|
35
14
|
```
|
|
36
15
|
|
|
37
|
-
|
|
16
|
+
Keep the project's React Router Vite plugin explicit:
|
|
38
17
|
|
|
39
18
|
```ts
|
|
40
19
|
import { reactRouter } from '@react-router/dev/vite';
|
|
41
|
-
import { resolve } from 'path';
|
|
42
20
|
import { defineConfig } from 'vite';
|
|
43
|
-
|
|
44
21
|
import { fimo } from 'fimo/vite';
|
|
45
22
|
|
|
46
23
|
export default defineConfig({
|
|
47
24
|
plugins: [reactRouter(), fimo({ sitemap: true })],
|
|
48
|
-
resolve: {
|
|
49
|
-
alias: {
|
|
50
|
-
'@': resolve(__dirname, './src/'),
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
25
|
});
|
|
54
26
|
```
|
|
55
27
|
|
|
56
|
-
|
|
28
|
+
`fimo()` is synchronous and returns a Vite `PluginOption[]`. Do not enable `seo: true`; React Router route `meta` exports own SEO.
|
|
57
29
|
|
|
58
|
-
-
|
|
59
|
-
user's vite.config owns the framework plugin. This is the library-mode shape.
|
|
60
|
-
- `fimo()` is synchronous; it returns a `PluginOption[]` you drop straight into
|
|
61
|
-
`plugins`. Don't `await` it or spread it.
|
|
62
|
-
- Do **not** add `fimo({ seo: true })` here. RR handles SEO via the `meta`
|
|
63
|
-
export (see `src/root.tsx`); the build-time SEO plugin would conflict.
|
|
64
|
-
- `sitemap` is opt-in and off by default; pass `fimo({ sitemap: true })` to emit
|
|
65
|
-
`sitemap.xml` (the canonical template does this). Omitting the option leaves
|
|
66
|
-
it off.
|
|
67
|
-
- `fimo({ robots: true })` opt-in to emit `robots.txt`.
|
|
68
|
-
|
|
69
|
-
## File: `react-router.config.ts`
|
|
30
|
+
For the supported client-rendered setup, connect React Router's native build to Fimo hosting:
|
|
70
31
|
|
|
71
32
|
```ts
|
|
72
33
|
import type { Config } from '@react-router/dev/config';
|
|
@@ -76,59 +37,26 @@ export default {
|
|
|
76
37
|
appDirectory: 'src',
|
|
77
38
|
ssr: false,
|
|
78
39
|
presets: [fimoPreset()],
|
|
79
|
-
// Static-site generation is opt-in. By default this template builds as an
|
|
80
|
-
// SPA (single index.html shell, client-side routing). To prerender routes at
|
|
81
|
-
// build time — required for crawler-visible per-route SEO — add this line:
|
|
82
|
-
//
|
|
83
|
-
// import { getFimoPaths } from 'fimo/paths';
|
|
84
|
-
// prerender: async () => (await getFimoPaths()).map((p) => p.path),
|
|
85
|
-
//
|
|
86
|
-
// `getFimoPaths()` expands dynamic routes (e.g. `/blog/:slug`) by fetching
|
|
87
|
-
// schema entries from the content API. See `references/frameworks/react-router.md`
|
|
88
|
-
// in the fimo skill for the full setup pattern.
|
|
89
|
-
buildDirectory: 'dist',
|
|
90
40
|
} satisfies Config;
|
|
91
41
|
```
|
|
92
42
|
|
|
93
|
-
|
|
94
|
-
exposing a provider package. See `references/frameworks/hosting.md`; do not
|
|
95
|
-
apply this SPA preset to an existing SSR project.
|
|
96
|
-
|
|
97
|
-
**SSG is opt-in now.** Default = SPA (one HTML shell). Add `prerender`
|
|
98
|
-
yourself if you want crawler-visible per-route HTML. The previous
|
|
99
|
-
"prerender everything by default" behavior was a website-builder opinion
|
|
100
|
-
that doesn't fit infrastructure mode — your call which routes to prerender,
|
|
101
|
-
when to render them, and how.
|
|
43
|
+
Do not change an existing SSR project to `ssr: false` merely to add Fimo. The current adapter does not provide React Router SSR support. Prerendering is application-owned and opt-in.
|
|
102
44
|
|
|
103
|
-
##
|
|
45
|
+
## Application root
|
|
104
46
|
|
|
105
|
-
|
|
106
|
-
app can configure query defaults such as `staleTime`. Adopted SPAs can omit it:
|
|
107
|
-
`FimoProviders` reuses an ancestor client when present and supplies a stable
|
|
108
|
-
fallback otherwise.
|
|
47
|
+
`FimoProviders` reuses an ancestor React Query client or supplies a stable fallback. Keep an explicit ancestor when the application owns query defaults or shares the cache:
|
|
109
48
|
|
|
110
49
|
```tsx
|
|
111
50
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
112
|
-
import { FimoProviders, FimoScripts
|
|
113
|
-
import type { MetaFunction } from 'react-router';
|
|
51
|
+
import { FimoProviders, FimoScripts } from 'fimo/react-router';
|
|
114
52
|
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from 'react-router';
|
|
115
53
|
|
|
116
|
-
const queryClient = new QueryClient(
|
|
117
|
-
defaultOptions: { queries: { staleTime: Infinity } },
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
export async function loader(args: { request: Request }) {
|
|
121
|
-
return loadFimoMetaData(args);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export const meta: MetaFunction = (args) => buildFimoMeta(args);
|
|
54
|
+
const queryClient = new QueryClient();
|
|
125
55
|
|
|
126
56
|
export function Layout({ children }: { children: React.ReactNode }) {
|
|
127
57
|
return (
|
|
128
|
-
<html
|
|
58
|
+
<html>
|
|
129
59
|
<head>
|
|
130
|
-
<meta charSet="utf-8" />
|
|
131
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
132
60
|
<Meta />
|
|
133
61
|
<Links />
|
|
134
62
|
<FimoScripts />
|
|
@@ -153,7 +81,11 @@ export default function AppRoot() {
|
|
|
153
81
|
}
|
|
154
82
|
```
|
|
155
83
|
|
|
156
|
-
|
|
84
|
+
Keep the application's existing `Layout` details. Add only the Fimo provider and script connector required by the task.
|
|
85
|
+
|
|
86
|
+
## Routes and locales
|
|
87
|
+
|
|
88
|
+
`fimoRoutes()` is an optional helper for Fimo's path-prefix locale convention:
|
|
157
89
|
|
|
158
90
|
```ts
|
|
159
91
|
import type { RouteConfig } from '@react-router/dev/routes';
|
|
@@ -161,142 +93,38 @@ import { index } from '@react-router/dev/routes';
|
|
|
161
93
|
import { fimoRoutes } from 'fimo/react-router/routes';
|
|
162
94
|
|
|
163
95
|
const routes = [index('./pages/Index.tsx', { id: 'home' })] satisfies RouteConfig;
|
|
164
|
-
|
|
165
96
|
export default fimoRoutes(routes) satisfies RouteConfig;
|
|
166
97
|
```
|
|
167
98
|
|
|
168
|
-
|
|
169
|
-
`Privacy.tsx`).
|
|
99
|
+
Custom locale routers can skip it and pass their resolved locale to `<FimoProviders locale={locale}>`. Use `FimoLink` only when the application adopts Fimo's locale-aware link behavior; otherwise preserve its links. Copyable path-prefix locale examples live in `assets/react-router-locales/`.
|
|
170
100
|
|
|
171
|
-
|
|
101
|
+
## Content and labels
|
|
172
102
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Use `FimoLink` for internal links that should preserve the current locale or deliberately switch it:
|
|
103
|
+
Render tracked values with `fimo/ui`:
|
|
176
104
|
|
|
177
105
|
```tsx
|
|
178
|
-
import {
|
|
106
|
+
import { Image, Label, RichText, Text } from 'fimo/ui';
|
|
179
107
|
|
|
180
|
-
<
|
|
181
|
-
<FimoLink to="/pricing" locale="es">Spanish pricing</FimoLink>
|
|
108
|
+
return <Label value="home.hero.title" as="h1" />;
|
|
182
109
|
```
|
|
183
110
|
|
|
184
|
-
|
|
111
|
+
Use `useLabels().t()` for attributes, metadata, or composed strings. `references/labels.md` owns the complete contract.
|
|
185
112
|
|
|
186
|
-
|
|
187
|
-
import { useLocale } from 'fimo/ui';
|
|
113
|
+
## Project profile
|
|
188
114
|
|
|
189
|
-
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
`FimoLink` localizes absolute internal paths using `.fimo/config.json#i18n.routing`; relative, hash, query-only, and external URLs remain unchanged. Copyable route and navigation examples live in `assets/react-router-locales/`.
|
|
193
|
-
|
|
194
|
-
## File: `src/pages/Index.tsx`
|
|
195
|
-
|
|
196
|
-
```tsx
|
|
197
|
-
import { Text, useLabels } from 'fimo/ui';
|
|
198
|
-
|
|
199
|
-
export default function HomePage() {
|
|
200
|
-
const { t } = useLabels();
|
|
201
|
-
|
|
202
|
-
return (
|
|
203
|
-
<main>
|
|
204
|
-
<Text value={t('home.hero.title')} as="h1" />
|
|
205
|
-
</main>
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
## File: `.fimo/config.json`
|
|
211
|
-
|
|
212
|
-
```json
|
|
213
|
-
{
|
|
214
|
-
"runtime": { "framework": "react-router" },
|
|
215
|
-
"version": "4",
|
|
216
|
-
"seo": {
|
|
217
|
-
"title": "__PROJECT_SLUG__",
|
|
218
|
-
"siteName": "__PROJECT_SLUG__"
|
|
219
|
-
},
|
|
220
|
-
"routes": {
|
|
221
|
-
"home": {
|
|
222
|
-
"label": "Home",
|
|
223
|
-
"path": "/"
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
## File: `.fimo/project.json`
|
|
230
|
-
|
|
231
|
-
```json
|
|
232
|
-
{
|
|
233
|
-
"projectId": "__PROJECT_ID__",
|
|
234
|
-
"organizationId": "__ORG_ID__",
|
|
235
|
-
"apiUrl": "__API_URL__"
|
|
236
|
-
}
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
Replace the `__PROJECT_ID__` / `__ORG_ID__` / `__API_URL__` sentinels with the
|
|
240
|
-
values from `fimo init`'s output (or `fimo projects info`).
|
|
241
|
-
|
|
242
|
-
## File: `tsconfig.json`
|
|
115
|
+
Declare the runtime in `.fimo/config.json`:
|
|
243
116
|
|
|
244
117
|
```json
|
|
245
118
|
{
|
|
246
|
-
"
|
|
247
|
-
"target": "ES2022",
|
|
248
|
-
"lib": ["DOM", "DOM.Iterable", "ES2022"],
|
|
249
|
-
"module": "ESNext",
|
|
250
|
-
"moduleResolution": "Bundler",
|
|
251
|
-
"jsx": "react-jsx",
|
|
252
|
-
"strict": true,
|
|
253
|
-
"esModuleInterop": true,
|
|
254
|
-
"skipLibCheck": true,
|
|
255
|
-
"resolveJsonModule": true,
|
|
256
|
-
"isolatedModules": true,
|
|
257
|
-
"types": ["@react-router/node", "vite/client"],
|
|
258
|
-
"paths": { "@/*": ["./src/*"] }
|
|
259
|
-
},
|
|
260
|
-
"include": ["src", "*.config.ts"]
|
|
119
|
+
"runtime": { "framework": "react-router" }
|
|
261
120
|
}
|
|
262
121
|
```
|
|
263
122
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
```css
|
|
267
|
-
@import 'tailwindcss';
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
(Optional — only if using Tailwind. Tailwind is not required for Fimo to
|
|
271
|
-
function; it just ships with the canonical template.)
|
|
272
|
-
|
|
273
|
-
## Verify and iterate
|
|
274
|
-
|
|
275
|
-
Run the app with the project's package-manager `dev` script (`pnpm dev` /
|
|
276
|
-
`npm run dev` / `yarn dev` / `bun dev` — match the lockfile). It serves the site
|
|
277
|
-
on localhost with live reload — this is your iteration loop: edit, see the change,
|
|
278
|
-
repeat with the developer.
|
|
279
|
-
|
|
280
|
-
`fimo deploy` is on-demand, not part of this loop: run it only when the developer
|
|
281
|
-
wants a hosted preview, a shareable link, or to go live — and only on their signal.
|
|
282
|
-
The dashboard's preview iframe shows the **deployed** app, so it only reflects
|
|
283
|
-
changes after a `fimo deploy` (the local dev server is localhost-only).
|
|
284
|
-
|
|
285
|
-
## What you don't add
|
|
286
|
-
|
|
287
|
-
- **No `fimo({ seo: true })`** — React Router's `meta` export covers SEO via
|
|
288
|
-
`loadFimoMetaData` + `buildFimoMeta`. The build-time SEO plugin is for
|
|
289
|
-
framework-less Vite + React setups (`references/frameworks/vite-react.md`).
|
|
290
|
-
- **No `<FimoSeo />` component** — not part of the RR setup.
|
|
291
|
-
- **No manual `<script src="overlay-runtime.js">`** — `<FimoScripts />`
|
|
292
|
-
handles preview-script + overlay loading.
|
|
123
|
+
The optional `routes` object is Studio's semantic page catalog. Keep it aligned with application routes when the project uses Studio navigation, but do not treat it as the production router.
|
|
293
124
|
|
|
294
|
-
##
|
|
125
|
+
## Boundaries
|
|
295
126
|
|
|
296
|
-
-
|
|
297
|
-
|
|
298
|
-
-
|
|
299
|
-
|
|
300
|
-
`.fimo/config.json#seo.url`.
|
|
301
|
-
- Override SEO per route with React Router's `meta` export and the existing `loadFimoMetaData` / `buildFimoMeta` integration in `src/root.tsx`.
|
|
302
|
-
- Look up rendering exports in `references/ui.md` and generated content APIs in `references/content/clients.md`.
|
|
127
|
+
- Route modules and `meta` exports own routing and SEO.
|
|
128
|
+
- `FimoScripts` owns preview-script loading; do not add the overlay script manually.
|
|
129
|
+
- Use `fimo deploy` only when the developer requests a hosted preview or publication.
|
|
130
|
+
- Load `references/ui.md` for rendering and `references/locales.md` for locale ownership.
|