fimo 0.10.0-experimental.1 → 0.10.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.
@@ -187,7 +187,7 @@ Entry bodies use reference objects with target `id` values:
187
187
  fimo entries create BlogPost --body '{"data":{"slug":"hello","title":"Hello","author":{"id":"750e8400-e29b-41d4-a716-446655440000"},"contributors":[]}}'
188
188
  ```
189
189
 
190
- Do not add `localized` or field-level `i18n` to reference fields. The reference value belongs to the entry variant containing it.
190
+ `localized` is not a supported spelling anywhere. A reference field may carry `"i18n": false` to point every locale of the document at the same target — see Localized and shared content below.
191
191
 
192
192
  ## Localized and shared content
193
193
 
@@ -195,7 +195,42 @@ Schemas are localized by default. Omit `--locale` to use the project default. Pa
195
195
 
196
196
  When creating a localized variant of an existing entry, pass the source entry's `documentId` with `--document-id`. Keep projects single-locale unless the user asks for multilingual or localized output; when multiple locales are configured, create and update every locale explicitly.
197
197
 
198
- For content shared across locales, define `"i18n": { "enabled": false }` at the schema root and create each entry once. Do not pass `--document-id` to manufacture locale variants. Raw API and CLI responses omit `locale`; generated collection models add the effective active/default locale without creating per-locale variants. No other `i18n` options and no field-level localization settings are supported.
198
+ For content shared across locales, define `"i18n": { "enabled": false }` at the schema root and create each entry once. Do not pass `--document-id` to manufacture locale variants. Raw API and CLI responses omit `locale`; generated collection models add the effective active/default locale without creating per-locale variants. No other schema-root `i18n` options are supported.
199
+
200
+ ### Shared fields inside a localized type
201
+
202
+ A localized type can still hold fields that are the same in every language. Mark the field `"i18n": false`. Use it for anything that is not translated — a price, a SKU, a product photo, a reference to the same target everywhere. Without it those values are re-entered per locale and drift apart.
203
+
204
+ ```json
205
+ {
206
+ "uid": "Product",
207
+ "name": "Products",
208
+ "fields": {
209
+ "title": { "type": "string" },
210
+ "description": { "type": "richtext" },
211
+ "sku": { "type": "string", "i18n": false, "unique": true },
212
+ "price": { "type": "number", "i18n": false },
213
+ "photo": { "type": "media", "i18n": false },
214
+ "brand": { "type": "reference", "target": "Brand", "i18n": false }
215
+ }
216
+ }
217
+ ```
218
+
219
+ Writing a shared field through any locale updates every locale of that document:
220
+
221
+ ```bash
222
+ fimo entries update Product <id> --locale es --body '{"data":{"title":"Silla","price":120}}'
223
+ ```
224
+
225
+ That sets the Spanish title and moves the price to `120` for every language. An update that does not mention a shared field leaves it untouched, so partial writes are safe.
226
+
227
+ Rules:
228
+
229
+ - `i18n` belongs on top-level scalar and reference fields only. Fields inside `blocks` follow the locale of the entry containing them and are rejected.
230
+ - On a non-localized type the flag is inert — there is one row already.
231
+ - `"i18n": true` is the default and never needs writing.
232
+
233
+ Turning an existing field shared is destructive when the languages currently hold different values. The push collapses each document to its default-locale value and discards the others; there is no prompt and no undo. Most documents already agree, so most collapses change nothing — but tell the user what will happen before adding `"i18n": false` to a field that already holds content, and check whether the languages differ if you are unsure.
199
234
 
200
235
  Use `"isSingleton": true` for a type with exactly one logical document. Generated singleton clients expose `get`/`update` and their React Query hooks, not collection create/remove APIs.
201
236
 
@@ -81,3 +81,5 @@ Labels and content are separate translated surfaces:
81
81
  - content: schema entries, managed with `fimo entries`
82
82
 
83
83
  Omit `--locale` for default-locale writes. Pass `--locale <locale>` for each non-default localized entry you need to create or update. Shared schemas (`i18n.enabled: false`) have one locale-free entry instead.
84
+
85
+ Inside a localized schema, a single field can still be shared across every language with `"i18n": false` — use it for values that are not translated, such as a price or a SKU, so they are written once instead of per locale. See `content.md` § Shared fields inside a localized type.
@@ -27,7 +27,21 @@ This file covers the **package surface**: the JSON shape you write, the generate
27
27
 
28
28
  **Required**: `uid` (PascalCase, matches filename), `name`, `fields`.
29
29
 
30
- `i18n` is an optional type-level policy. Omit it or use `{ "enabled": true }` for localized content. Use `{ "enabled": false }` for one shared entry that appears in every locale, such as an Author, Category, or Settings type. No other `i18n` keys and no field-level localization settings are supported.
30
+ `i18n` is an optional type-level policy. Omit it or use `{ "enabled": true }` for localized content. Use `{ "enabled": false }` for one shared entry that appears in every locale, such as an Author, Category, or Settings type. No other schema-root `i18n` keys are supported.
31
+
32
+ Inside a localized type, an individual top-level scalar or reference field may carry `"i18n": false`. That field then holds one value for the whole document: writing it through any locale updates all of them. Use it for values that are not translated, such as a price, a SKU, a product photo, or a reference that should point at the same target everywhere. Fields inside `blocks` follow the locale of the entry containing them and reject the flag.
33
+
34
+ ```json
35
+ {
36
+ "uid": "Product",
37
+ "name": "Products",
38
+ "fields": {
39
+ "title": { "type": "string" },
40
+ "sku": { "type": "string", "i18n": false },
41
+ "price": { "type": "number", "i18n": false }
42
+ }
43
+ }
44
+ ```
31
45
 
32
46
  ### Reserved field names — do NOT declare these in `fields`
33
47
 
@@ -181,7 +195,7 @@ Rules:
181
195
  - Self-references are allowed, e.g. a `Category` schema can have `parent: { "type": "reference", "target": "Category" }`.
182
196
  - Entry values use the target's stable `id`, never the variant `entryId`: `{ "id": "..." }`.
183
197
  - Do not include `contentType` for normal fixed-target references; the schema's `target` already defines it.
184
- - Do not add `localized` or field-level `i18n` to a reference. The reference value belongs to the entry variant that stores it.
198
+ - `localized` is not a supported spelling. A reference may carry `"i18n": false` so every locale of the document points at the same target; without it the reference belongs to the entry variant that stores it.
185
199
  - Use `null` for an empty to-one reference and `[]` for an empty to-many reference.
186
200
  - The API validates that referenced target documents exist and rejects duplicate values in to-many reference arrays.
187
201
 
@@ -340,7 +354,7 @@ For shared content, set `i18n: { "enabled": false }` on the schema and create ea
340
354
  - ignore locale on owner reads and writes;
341
355
  - still use the active/requested locale when a populated reference targets a localized schema.
342
356
 
343
- Do not duplicate shared entries across locales or add field-level localization settings.
357
+ Do not duplicate shared entries across locales. This section is about a whole type being shared; a single shared field inside a localized type is the separate `"i18n": false` field flag described above.
344
358
 
345
359
  A populated reference whose target has no variant in the requested locale resolves to null. Reads accept an opt-in `localeFallbacks: true` that resolves those to the best available variant instead (project default first), marked by its `locale` field — never implement fallbacks by hand; public reads stay strict unless the option is passed.
346
360
 
@@ -64,6 +64,8 @@ Your edits save automatically as you change each field (the save is debounced),
64
64
 
65
65
  If a field is invalid, the editor keeps the change unsaved and pins a status bar below the header. Choose **Review issues** to jump to the first invalid field, then **Next issue** to move through the remaining fields. Collapsed blocks open automatically. Once every issue is fixed, the editor confirms that all fields are valid and resumes saving.
66
66
 
67
+ A field labelled with a padlocked globe is shared across languages: it holds one value for the whole entry, so editing it in any language changes it in all of them. Fields without that marker are per language and only affect the language you are editing. Hover the icon for the same explanation in context.
68
+
67
69
  ## Editing Text
68
70
 
69
71
  - Short text such as titles, names, and slugs uses one compact line.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "bundled": true,
3
3
  "bundler": "esbuild",
4
- "bundledAt": "2026-07-26T16:18:23.038Z",
4
+ "bundledAt": "2026-07-27T11:17:03.341Z",
5
5
  "cliVersion": "0.9.0",
6
6
  "external": [
7
7
  "oxc-parser",