fimo 2.15.0-staging.2 → 2.15.0-staging.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/skills/fimo-cli/references/deploy.md +1 -1
- package/assets/skills/fimo-code/references/forms.md +11 -5
- package/assets/skills/fimo-code/references/frameworks/next.md +4 -0
- package/assets/skills/fimo-code/references/labels.md +2 -2
- package/assets/skills/fimo-code/references/ui.md +8 -0
- package/assets/skills/fimo-studio/references/ai-chat.md +2 -0
- package/dist/cli/bundle.json +1 -1
- package/dist/cli/index.js +8 -8
- package/package.json +8 -8
- package/templates/astro/package.json +3 -3
- package/templates/nextjs/package.json +4 -4
- package/templates/react-router/package.json +5 -5
- package/templates/sveltekit/package.json +3 -3
- package/templates/vite/package.json +5 -5
|
@@ -46,6 +46,6 @@ Run the same install locally, commit the policy and the lockfile, then deploy ag
|
|
|
46
46
|
## Hosting facts
|
|
47
47
|
|
|
48
48
|
- Fimo hosts the site. Preview runs `runtime.commands`, else the package script, else the framework default. Production builds from `.fimo/config.json#runtime.framework` with the same build and install overrides. An existing app keeps its router and hosting setup: do not replace the router, and do not derive rewrites from `.fimo/config.json#routes`. Framework setup (React Router `fimoPreset()`, plain Vite SPA catch-all): fimo-code `frameworks/hosting`; Astro: `frameworks/astro`. Redirects, headers, and URL shape: `--ref hosting`.
|
|
49
|
-
- **Markdown for AI agents:**
|
|
49
|
+
- **Markdown for AI agents:** a published site answers `/page.md` and `Accept: text/markdown` with the page converted to Markdown on its custom domains and a `<name>.fimo.site` address; `<name>.apps.fimo.site` addresses serve HTML only. Fimo converts the HTML the site serves, so a page whose text needs client JavaScript gets none: prerender or server-render it. Fimo makes these; to hand-write a page's Markdown, put the file at its `.md` address (`public/pricing.md` for `/pricing`), and never add a route that converts pages or fetches the site's own public URL. `/llms.txt` is the site's own file in `public/`.
|
|
50
50
|
- **Warm-up:** the first deploy of a project provisions the sandbox, so it is slower than later deploys. When the user already asked for a hosted preview or a publish later in the session, you can start that deploy early in the background. The new-site first preview is already the warm-up.
|
|
51
51
|
- After the first deploy, change the site URL with `--ref domains`: a free `*.fimo.site` rename, a domain the user owns (Starter or higher), or a new domain bought through Fimo.
|
|
@@ -62,6 +62,8 @@ export function submitContactUs(
|
|
|
62
62
|
|
|
63
63
|
The schema, parser, submitter, and form id are re-exported by `src/forms/index.ts`.
|
|
64
64
|
|
|
65
|
+
`parseXFormData` validates with the schema and throws a `ZodError` on invalid input. Catch it to show field errors; do not pass its result to `safeParse`.
|
|
66
|
+
|
|
65
67
|
The `submitX` helper uses the framework adapter's shared Fimo transport and handles presigned file uploads automatically. Never hand-roll the Fimo API fetch or validation.
|
|
66
68
|
|
|
67
69
|
## Common code pattern
|
|
@@ -70,8 +72,9 @@ Always import the generated module. Keep the native form and pending/error state
|
|
|
70
72
|
|
|
71
73
|
```tsx
|
|
72
74
|
import { useState } from 'react';
|
|
75
|
+
import { z } from 'zod';
|
|
73
76
|
|
|
74
|
-
import {
|
|
77
|
+
import { parseContactUsFormData, submitContactUs } from '@/forms/contact-us';
|
|
75
78
|
import type { ContactUsData } from '@/forms/contact-us';
|
|
76
79
|
|
|
77
80
|
export function ContactForm() {
|
|
@@ -83,16 +86,19 @@ export function ContactForm() {
|
|
|
83
86
|
setErrors({});
|
|
84
87
|
setLoading(true);
|
|
85
88
|
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
let data: ContactUsData;
|
|
90
|
+
try {
|
|
91
|
+
data = parseContactUsFormData(new FormData(e.currentTarget));
|
|
92
|
+
} catch (error) {
|
|
93
|
+
if (!(error instanceof z.ZodError)) throw error;
|
|
88
94
|
const fieldErrors: Record<string, string> = {};
|
|
89
|
-
for (const issue of
|
|
95
|
+
for (const issue of error.issues) fieldErrors[issue.path[0] as string] = issue.message;
|
|
90
96
|
setErrors(fieldErrors);
|
|
91
97
|
setLoading(false);
|
|
92
98
|
return;
|
|
93
99
|
}
|
|
94
100
|
|
|
95
|
-
const result = await submitContactUs(
|
|
101
|
+
const result = await submitContactUs(data);
|
|
96
102
|
setLoading(false);
|
|
97
103
|
if (!result.success && result.errors) setErrors(result.errors);
|
|
98
104
|
};
|
|
@@ -132,8 +132,12 @@ const [articles, labels] = await Promise.all([
|
|
|
132
132
|
fimo.articles.list({ sort: '-publishedAt', limit: 12 }),
|
|
133
133
|
getLabels({ locale }),
|
|
134
134
|
]);
|
|
135
|
+
|
|
136
|
+
return <Text value={labels.t('articles.title')} as="h1" />;
|
|
135
137
|
```
|
|
136
138
|
|
|
139
|
+
`getLabels()` returns `{ locale, snapshot, t }`: `t` for this Server Component, `snapshot` for `FimoProvider` (see Provider boundary). Neither entry exports `Label`; render labels with `Text`.
|
|
140
|
+
|
|
137
141
|
Client Components import from `fimo-next/client` and generated `.client` modules:
|
|
138
142
|
|
|
139
143
|
```tsx
|
|
@@ -38,8 +38,8 @@ 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-next`.
|
|
42
|
-
- Next client: `useLabels()` from `fimo-next/client`, under `FimoProvider`.
|
|
41
|
+
- Next server: `getLabels({ locale? })` from `fimo-next` returns `{ locale, snapshot, t }`. Render with `<Text value={labels.t('key')} />` and pass `labels.snapshot` to the root `FimoProvider`.
|
|
42
|
+
- Next client: `useLabels()` from `fimo-next/client`, under `FimoProvider`. `fimo-next` exports no `Label`; render `<Text value={t('key')} />`.
|
|
43
43
|
- React Router/Vite client: `Label` and `useLabels()` from `fimo-react`, under the existing framework integration.
|
|
44
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.
|
|
@@ -25,6 +25,14 @@ Use Fimo components for source-tracked schema and label values so Studio can ide
|
|
|
25
25
|
<DateTime value={article.lastReviewedAt} />
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
`Date` and `DateTime` accept `className` and an optional render function as children to format the displayed text; the `<time datetime>` attribute and the edit target stay intact:
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
<Date value={event.startsOn}>
|
|
32
|
+
{(date) => date.toLocaleDateString(locale, { weekday: 'long', day: 'numeric', month: 'long' })}
|
|
33
|
+
</Date>
|
|
34
|
+
```
|
|
35
|
+
|
|
28
36
|
Pass the tracked value directly. Do not replace `<Text>` with `<h1>{article.title}</h1>`, unwrap media into raw `<img>`, or hand-roll richtext rendering.
|
|
29
37
|
|
|
30
38
|
Blocks do not change this rule. Every visible nested scalar is source-tracked too, including fields inside repeated and nested blocks:
|
|
@@ -60,3 +60,5 @@ Hover over a message. Your messages have **Copy** and **Edit** (change and resen
|
|
|
60
60
|
## Credits
|
|
61
61
|
|
|
62
62
|
Chat uses AI credits. For people who can view billing, the coin icon near the send button shows the balance; select it for **Monthly credits**, **Purchased credits**, **Earned credits** (referrals and promotions) and, when present, **Daily free credits**. A warning shows when credits run low. To continue, upgrade the plan or buy credits on the billing page (`billing-and-credits`).
|
|
63
|
+
|
|
64
|
+
Building on the site (new pages, sections, design and code changes) uses the most credits. After chat builds on a site, above all early in a project, it says that the person's own coding agent can do this work on their subscription with no Fimo credits, once per chat, under a card whose **Open in** menu lists **On your computer** Claude Code, Codex and Cursor; **In the browser** Claude and ChatGPT, through the Fimo connector; and **Copy prompt**. Each opens with a prompt for this site and any work still to do. A reply that stops because the credits ran out ends with the card and the request it could not finish, and asking chat about credits or spending less shows it again. Only members with Full Access see the card.
|