fimo 2.6.0-staging.2 → 2.6.0-staging.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/skills/fimo-cli/references/content.md +2 -2
- package/assets/skills/fimo-code/references/ui.md +6 -1
- package/assets/skills/fimo-migration/SKILL.md +3 -4
- package/assets/skills/fimo-migration/references/media.md +98 -62
- package/assets/skills/fimo-migration/references/workers/content-execution.md +2 -1
- package/assets/skills/fimo-studio/references/publish-and-deploy.md +1 -0
- package/dist/cli/bundle.json +1 -1
- package/dist/cli/index.js +5 -5
- package/dist/runtime/primitives/lib/primitives.d.ts +20 -1
- package/dist/runtime/primitives/lib/primitives.js +24 -1
- package/package.json +8 -8
- package/templates/astro/package.json +2 -2
- package/templates/nextjs/package.json +3 -3
- package/templates/react-router/package.json +4 -4
- package/templates/sveltekit/package.json +2 -2
- package/templates/vite/package.json +4 -4
|
@@ -71,7 +71,7 @@ fimo entries create <TypeName> --body '<json>'
|
|
|
71
71
|
fimo entries create <TypeName> --locale es --document-id <documentId> --body '<json>'
|
|
72
72
|
fimo entries list <TypeName> [--limit N] [--cursor CURSOR] [--all-pages] [--search Q] [--where JSON] [--sort F] [--fields FIELDS] [--populate FIELDS]
|
|
73
73
|
fimo entries list <TypeName> --locale es
|
|
74
|
-
fimo entries get <TypeName> <id> [--locale es]
|
|
74
|
+
fimo entries get <TypeName> <id> [--locale es] [--populate FIELDS]
|
|
75
75
|
fimo entries update <TypeName> <id> [--locale es] --body '<json>'
|
|
76
76
|
fimo entries delete <TypeName> <id> [--locale es]
|
|
77
77
|
fimo entries query (--sql '<select>' | --file <path> | --stdin)
|
|
@@ -101,7 +101,7 @@ Use the canonical read query flags: `--search`, `--sort`, `--where`, `--limit`,
|
|
|
101
101
|
Reference filters take the target `id` string (`{"author":"750e..."}`). On a to-many field, `$eq` and `$contains` mean membership, `$in` means any listed target is present, `$ne` and `$nin` mean none are present, and `$null: true` means empty or missing. Reference fields cannot be sorted; use `--sort field` / `--sort -field` on scalar fields.
|
|
102
102
|
`--fields` is a comma-separated projection for list payloads. The API always keeps `id`, `entryId`, `documentId`, and `locale`; pass only the other fields your view needs, such as `slug,title,excerpt,coverImage`.
|
|
103
103
|
|
|
104
|
-
`--populate` is a comma-separated list of
|
|
104
|
+
`--populate` is a comma-separated list of top-level fields to embed, on `entries list`, `entries get`, and `singles get`. It accepts reference fields, media fields, and blocks fields that contain media; naming a blocks field populates every media value inside it. Nested paths such as `sections.image` are not supported, and other field types return 400. Run `fimo schemas get <TypeName> --json` to inspect field names and types. Without it, reference fields return `{ "id": "..." }` and media fields return the stored `{ "source", "id", "url", "alt" }`; with `--populate author,cover`, `author` returns the target entry for the requested locale and `cover` adds the asset's current `name`, `mime`, `width`, and `height`. Populate never selects which target fields come back. A populated target missing in the requested locale resolves to null unless you pass `localeFallbacks=true`, which falls back to the best available locale variant, marked by its `locale` field. Limits: 200 references per to-many write, 500 distinct populated documents per field per request (400 past either).
|
|
105
105
|
|
|
106
106
|
Polymorphic references declare `targets: ["Post", "Product"]` instead of `target` (never both) and their values carry both parts: `{ "contentType": "Post", "id": "..." }`. Populate returns mixed full entries, and generated hooks expose `$type` on each populated value to branch on. `--where` on polymorphic fields is not supported yet and fails with a clear error. Fixed and polymorphic references also work inside blocks with these same write shapes (`id`, `documentId`, or `slug` selectors), but nested fields cannot be populated or filtered.
|
|
107
107
|
|
|
@@ -53,7 +53,7 @@ Use `<StaticImage>` only when the image is deliberately not editor-managed.
|
|
|
53
53
|
`FimoString`, `FimoBoolean`, and the other tracked values are objects, not primitives: a plain string or boolean cannot carry the source field, locale, and edit-target metadata Fimo editing needs. That gives one two-sided rule:
|
|
54
54
|
|
|
55
55
|
- **MUST** pass the wrapper directly to Fimo rendering primitives (`Text`, `Boolean`, …). Unwrapping first removes the edit target.
|
|
56
|
-
- **MUST** normalize the wrapper before any JavaScript comparison, condition, attribute, or third-party API: `String(value)` for strings, `value.value`
|
|
56
|
+
- **MUST** normalize the wrapper before any JavaScript comparison, condition, attribute, or third-party API: `String(value)` for strings, `value.value` for booleans.
|
|
57
57
|
|
|
58
58
|
```ts
|
|
59
59
|
fimoValue === 'build'; // false — an object never strict-equals a primitive
|
|
@@ -63,6 +63,11 @@ if (fimoFlag) { … } // always runs — an object is truthy even whe
|
|
|
63
63
|
if (fimoFlag.value) { … } // correct
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
Nothing catches `if (fimoFlag)` for you: an object is unconditionally truthy in
|
|
67
|
+
JavaScript, and TypeScript reports no error. Read `.value` every time. A boolean
|
|
68
|
+
field without `required: true` generates `flag?: FimoBoolean`, so read
|
|
69
|
+
`flag?.value`.
|
|
70
|
+
|
|
66
71
|
Keep editable visible text in `<Text>`; normalized primitives are for logic and APIs only, never a substitute for rendering through the primitive.
|
|
67
72
|
|
|
68
73
|
Numeric fields stay plain JavaScript numbers, so they do not carry Studio source metadata. SvelteKit's `Number` component is an optional display/formatting helper; it is not source-editable. Other framework surfaces should render numeric fields normally until a shared tracked-number contract exists.
|
|
@@ -174,10 +174,9 @@ report the exact failed command and setup requirement.
|
|
|
174
174
|
reason. Better modeling never redesigns the site: preserve the source's
|
|
175
175
|
content shape and behavior, and record the source-to-Fimo mapping
|
|
176
176
|
(`references/content.md`).
|
|
177
|
-
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
command cannot carry it (`references/media.md`).
|
|
177
|
+
- Before writing media or wiring `<Image>`, load
|
|
178
|
+
`fimo skills get fimo-migration --ref media` for the stored value, explicit
|
|
179
|
+
`populate`, and responsive-image checks (`references/media.md`).
|
|
181
180
|
- Every write is create-or-update, so any step can be rerun without duplicating
|
|
182
181
|
a schema, entry, asset, single, or label.
|
|
183
182
|
- Every decision cites the source file (and line when it matters) that proves
|
|
@@ -18,7 +18,7 @@ Prefer local files from exports. Use remote URLs when no local file exists.
|
|
|
18
18
|
|
|
19
19
|
## Required Metadata
|
|
20
20
|
|
|
21
|
-
Record what is available:
|
|
21
|
+
Record what is available in the inventory and reports:
|
|
22
22
|
|
|
23
23
|
- source URL or source path
|
|
24
24
|
- filename
|
|
@@ -29,47 +29,50 @@ Record what is available:
|
|
|
29
29
|
- sha256 or another stable hash when possible
|
|
30
30
|
- source references and target references
|
|
31
31
|
|
|
32
|
+
These are migration records, not extra fields to copy into entry media values.
|
|
33
|
+
|
|
32
34
|
## Alt Text Belongs To The Media
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
Preserve each source occurrence's alt on its media value, including an explicit
|
|
37
|
+
empty alt. Do not add a separate schema field or use the filename as alt.
|
|
38
|
+
|
|
39
|
+
Neither `fimo assets upload` nor `fimo assets bulk-upload` currently accepts
|
|
40
|
+
alt metadata: keep the source alt on the value and note that upload limitation
|
|
41
|
+
in the migration report. Population preserves the entry's alt; it does not
|
|
42
|
+
synchronize it with asset alt metadata. If source alt is absent and you write
|
|
43
|
+
a meaningful fallback, identify it as generated in the report.
|
|
37
44
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- Never use the filename as alt text.
|
|
43
|
-
- When the source has no alt, a meaningful generated alt is an explicit
|
|
44
|
-
fallback only: mark it with the media item's `altSource`
|
|
45
|
-
(`references/manifest.md`) so an editor can see which alt text the source did
|
|
46
|
-
not provide.
|
|
45
|
+
Use the relevant worker report and `.fimo/migration/migration-report.md` for
|
|
46
|
+
provenance and dispositions. New migrations do not create a canonical
|
|
47
|
+
`manifest.json`; see `fimo skills get fimo-migration --ref manifest` for legacy
|
|
48
|
+
manifest handling.
|
|
47
49
|
|
|
48
50
|
## Dedupe
|
|
49
51
|
|
|
50
|
-
Deduplicate by hash when local bytes are available.
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
Deduplicate by hash when local bytes are available. Otherwise use canonicalized
|
|
53
|
+
URL plus filename. Keep every source occurrence and its alt even when several
|
|
54
|
+
occurrences reuse one uploaded asset.
|
|
53
55
|
|
|
54
56
|
## Upload And Replacement
|
|
55
57
|
|
|
56
58
|
Referenced media must be uploaded into the Fimo media library. Use
|
|
57
|
-
`fimo assets bulk-upload --file <manifest.json>` for a batch
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
reports
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
spaces,
|
|
59
|
+
`fimo assets bulk-upload --file <manifest.json>` for a batch or
|
|
60
|
+
`fimo assets upload "<file-path>"` for a single file. The bulk-upload input is a
|
|
61
|
+
JSON array with a unique `sourceId` and a `path` per item. Paths resolve from the
|
|
62
|
+
project working directory, not the manifest's directory. Never encode paths or
|
|
63
|
+
names in whitespace-delimited shell input. Load
|
|
64
|
+
`fimo skills get fimo-cli --ref assets` for upload options and result details.
|
|
65
|
+
This upload payload is separate from the migration's Markdown reports.
|
|
66
|
+
|
|
67
|
+
Copying a file under `public/` is not a completed import: editors cannot manage
|
|
68
|
+
it in Fimo and it has no Fimo asset ID/URL. Either upload it and record the Fimo
|
|
69
|
+
target in the worker and migration reports, or mark it `unresolved` with an
|
|
70
|
+
owner action. "Bundled locally, upload later" is not a terminal disposition.
|
|
71
|
+
|
|
72
|
+
If a supplied Fimo migration pack includes a media map, copy its recorded
|
|
73
|
+
`localPath` exactly. Do not reconstruct filenames from source URLs or undo
|
|
74
|
+
normalization of underscores, spaces, or encoded characters. Verify the recorded
|
|
75
|
+
path exists before upload.
|
|
73
76
|
|
|
74
77
|
Replace source references in this order:
|
|
75
78
|
|
|
@@ -78,34 +81,60 @@ Replace source references in this order:
|
|
|
78
81
|
3. page components
|
|
79
82
|
4. form definitions or confirmation content
|
|
80
83
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
the asset owns the uploaded bytes and their metadata
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
84
|
+
Write each imported media field as `{ source, url, alt }`. For an uploaded
|
|
85
|
+
asset, use `{ source: 'local', url, alt }` with the URL returned by Fimo. Do not
|
|
86
|
+
copy the asset's ID, name, MIME type, width, height, or other upload metadata
|
|
87
|
+
into the stored value. The write path resolves and persists the media-library
|
|
88
|
+
ID; the asset owns the uploaded bytes and their metadata. Inspect an asset
|
|
89
|
+
later with `fimo assets open <id> --download`.
|
|
90
|
+
|
|
91
|
+
### Populate and render
|
|
92
|
+
|
|
93
|
+
Use Fimo media primitives for schema media rather than hardcoded URLs. Load
|
|
94
|
+
`fimo skills get fimo-code --ref ui` and the detected framework reference for
|
|
95
|
+
component imports and usage.
|
|
96
|
+
|
|
97
|
+
Explicitly populate the media field before wiring it to `<Image>`. Without
|
|
98
|
+
`populate`, a read returns the stored reference `{ source, id, url, alt }`,
|
|
99
|
+
including its fallback URL, but does not look up current asset metadata. With
|
|
100
|
+
the field named in `populate`, it returns current asset facts from the library:
|
|
101
|
+
URL, name, MIME type, and intrinsic width and height when available.
|
|
102
|
+
|
|
103
|
+
For media inside blocks, name the top-level blocks field, for example
|
|
104
|
+
`--populate sections` or
|
|
105
|
+
`populate: ['sections'] as const`, not a nested image path. This populates all
|
|
106
|
+
media inside that field.
|
|
107
|
+
|
|
108
|
+
CLI examples:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
fimo entries list BlogPost --limit 1 --populate cover --json
|
|
112
|
+
fimo entries get BlogPost <entry-id> --populate cover --json
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Generated-client example:
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
const article = await BlogPost.getBySlug('hello', { populate: ['cover'] as const });
|
|
119
|
+
return article ? <Image value={article.cover} sizes="100vw" /> : null;
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Before completing the migration, verify that the populated raster has its
|
|
123
|
+
intrinsic `width` and `height`. Render the page at desktop and mobile widths,
|
|
124
|
+
then check the optimized responsive `srcset`. With optimization enabled on an
|
|
125
|
+
eligible Fimo URL, `sizes` set, and no custom `srcSet`, its generated width
|
|
126
|
+
candidates stop at the intrinsic width. Choose displayed size, crop, `sizes`,
|
|
127
|
+
and fit from the source layout; intrinsic dimensions are source facts, not
|
|
128
|
+
layout choices. Fix a missing `populate` request instead of copying metadata
|
|
129
|
+
into the entry or hardcoding intrinsic dimensions. If a populated read still
|
|
130
|
+
lacks dimensions, report the gap rather than inventing them.
|
|
99
131
|
|
|
100
132
|
## Failure Handling
|
|
101
133
|
|
|
102
|
-
If
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- list every page/entry that references it
|
|
107
|
-
- include a suggested action such as re-exporting the asset folder or providing
|
|
108
|
-
credentials
|
|
134
|
+
If an asset cannot be downloaded or uploaded, keep its source reference,
|
|
135
|
+
record `unresolved` or `unsupported` in the report, and list affected
|
|
136
|
+
pages/entries, the failure reason, and an owner action, such as re-exporting the
|
|
137
|
+
asset folder or providing credentials.
|
|
109
138
|
|
|
110
139
|
## Media obligations
|
|
111
140
|
|
|
@@ -115,8 +144,15 @@ terminal, the coordinator combines and deduplicates those findings into the
|
|
|
115
144
|
complete media-obligation list. This consolidated list is the media worker's
|
|
116
145
|
only input; do not make the content planner rescan the whole application.
|
|
117
146
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
147
|
+
Keep one migration mapping per source occurrence: source file or page, field
|
|
148
|
+
or rich-text node path, consuming route/entry, and target field or node plus
|
|
149
|
+
the uploaded asset ID/URL. Use the source location and field or node path for
|
|
150
|
+
stable identity. A shared URL or label is not a unique occurrence;
|
|
151
|
+
retain every mapping even when occurrences reuse one uploaded asset.
|
|
152
|
+
|
|
153
|
+
The media worker cannot report complete until every obligation has an uploaded
|
|
154
|
+
or duplicate Fimo mapping, or an explicit unresolved/unsupported disposition.
|
|
155
|
+
Reconcile the mappings against every discovery lane's findings, including
|
|
156
|
+
schema media fields and nested richtext/Tiptap image nodes. Run the broader
|
|
157
|
+
migration gate from `fimo skills get fimo-migration --ref qa` before claiming
|
|
158
|
+
the migration is complete.
|
|
@@ -22,7 +22,8 @@ do not poll indefinitely.
|
|
|
22
22
|
Start only after this batch's real records read back as non-empty. Own exactly
|
|
23
23
|
the consumer files assigned by the planner.
|
|
24
24
|
|
|
25
|
-
1. Load the active framework's `fimo-code` reference.
|
|
25
|
+
1. Load the active framework's `fimo-code` reference. Before changing a media
|
|
26
|
+
read or image component, load `fimo skills get fimo-migration --ref media`.
|
|
26
27
|
2. Establish the generated Fimo client/adapter needed by the batch.
|
|
27
28
|
3. Replace every planned `sourceFile`/`sourceKey` at its existing consumer in
|
|
28
29
|
place. Appending a disconnected duplicate section is not wiring.
|
|
@@ -31,6 +31,7 @@ The header **Publish** button itself only shows the label "Publish" (or a spinne
|
|
|
31
31
|
- **"Publishing"** — Publishing is in progress. A spinner and a **Publishing** status badge show while it builds, and the button is disabled.
|
|
32
32
|
- **"Published"** — Your site is live. A **Published** status badge appears, your live URL is listed under a **Published site** heading as a clickable link, and a **Last published** date and time is shown.
|
|
33
33
|
- **"Couldn't publish · N issues"** — Project validation found issues that must be fixed first. Choose **Fix with Fimo** to send the safe issue list to the project chat and ask Fimo to repair it.
|
|
34
|
+
- **"Latest update failed"** — The newest publication did not finish. The panel says what went wrong and, for a site that was published before, that the previous version remains the active release — so it can appear beside **Published**. It stays until a newer publication finishes. **View details** opens the reader's Inbox item about the failure, which offers **Open publishing** and **Contact support**. Studio never shows the build output; read it with `fimo publish logs <id>`, taking the id from `fimo publish list`. The person who published and the project's managers get that Inbox item, plus an email unless they turned off **Publication failures** in Account settings → Notifications.
|
|
34
35
|
|
|
35
36
|
## Key Concepts
|
|
36
37
|
|