@se-studio/contentful-cms 3.1.3 → 3.1.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/CHANGELOG.md
CHANGED
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
- `cms_edit ["asset", "search", "--filename-match", "<partial-name>"]`
|
|
24
24
|
- `cms_edit ["list", "--type", "media", "--asset-filename-match", "<partial>"]`
|
|
25
25
|
3. If match found — link by asset ID or filename in `set` / `create from-json` (`featuredImageAssetFilename`, `visualAssetFilename`, etc.)
|
|
26
|
-
4.
|
|
26
|
+
4. For **`visuals`** (Media entry array): prefer an **existing Media entry** — `cms_edit ["list", "--type", "media", "--asset-id", "<assetId>"]` — then `set @root visuals <mediaEntryId> --links`. Do **not** `create media` or use `asset upload --with-media` when a wrapper already exists.
|
|
27
|
+
5. `create media` only when no Media entry wraps that asset (RTF embeds, or first article in a new composite batch — then **reuse that media ID** on sibling entries)
|
|
27
28
|
|
|
28
29
|
## Upload only when no match
|
|
29
30
|
|
|
@@ -43,12 +44,15 @@ Rules:
|
|
|
43
44
|
- Upload alone does **not** attach the asset — follow with **link + save** (below)
|
|
44
45
|
- Use `--if-exists-by-filename` (with `--file-name`) to avoid duplicate assets when re-running
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
After staged upload, create a Media wrapper **only when none exists** for that asset:
|
|
47
48
|
|
|
48
49
|
```
|
|
49
|
-
cms_edit ["
|
|
50
|
+
cms_edit ["list", "--type", "media", "--asset-id", "<newPortraitAssetId>"]
|
|
51
|
+
cms_edit ["create", "media", "--asset-id", "<newPortraitAssetId>", "--name", "…"]
|
|
50
52
|
```
|
|
51
53
|
|
|
54
|
+
Avoid `asset upload --with-media` when multiple entries will share the same image (e.g. news composites) — it creates duplicate Media entries. Upload the asset only, then one shared `create media`, then link the media ID on each entry.
|
|
55
|
+
|
|
52
56
|
**Last resort `--url`** only when the file is already on public HTTPS and staged upload is impractical:
|
|
53
57
|
|
|
54
58
|
```
|