@bettercms-ai/mcp 0.66.4 → 0.67.0
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/dist/index.js +59 -30
- package/dist/index.js.map +1 -1
- package/dist/skills/bettercms/references/bindings.md +10 -5
- package/dist/skills/bettercms/references/components.md +8 -3
- package/dist/skills/bettercms/references/getting-started.md +2 -1
- package/dist/skills/bettercms/references/localization.md +5 -3
- package/package.json +1 -1
|
@@ -60,13 +60,16 @@ value over everything else inside it, so:
|
|
|
60
60
|
and bind that. An `<li>` that renders nothing but the value is itself the leaf.
|
|
61
61
|
- **A link or button label beside an icon.** In `<a href="…"><svg/> Sign up</a>`, put the label
|
|
62
62
|
in its own `<span>` with the field, and the `href` on the anchor through `data-bcms-props`
|
|
63
|
-
(`cta.href|url|href`). A binding on the anchor's text deletes the icon.
|
|
63
|
+
(`cta.href|url|href`). A binding on the anchor's text deletes the icon. A call to action is a
|
|
64
|
+
`button` field rendered with `BcmsButton` ([components.md](components.md)).
|
|
64
65
|
- **SVG text is never bound; the icon is.** No field is derived from the text inside an `<svg>`,
|
|
65
66
|
and no binding there is measured. Each inline icon IS an editable `image` field (`config.media:
|
|
66
67
|
"icon"`, an svg value): an editor swaps it. Never remove one to tidy a form; group it.
|
|
67
|
-
- **Icon-only links in the nav and footer** take their field name from
|
|
68
|
-
`aria-label`,
|
|
69
|
-
|
|
68
|
+
- **Icon-only links in the nav and footer** take their field name from what a screen reader
|
|
69
|
+
reads: the anchor's `aria-label`, its `sr-only` text, a `title`, the SVG `<title>` or an `alt`
|
|
70
|
+
(never `<style>` or `<script>` text). Give each one an `aria-label` or `sr-only` label, or every
|
|
71
|
+
social link is named `link` and an editor cannot tell them apart. A row of them is a "Links" or
|
|
72
|
+
"Social links" list; each row keeps its own name in its values.
|
|
70
73
|
|
|
71
74
|
### The site's design is not yours to change
|
|
72
75
|
|
|
@@ -131,7 +134,9 @@ helpers rather than by hand.
|
|
|
131
134
|
keep inside a bound element. A value with no element never reaches the page, and one that
|
|
132
135
|
would corrupt its element is refused and named.
|
|
133
136
|
- Read the report, not the screen. Clean = `coverage.pending` empty and the mode you expect. Each
|
|
134
|
-
`unmatched` reason names a fix in the source. A
|
|
137
|
+
`unmatched` reason names a fix in the source. A Global Layout Section is reported only on the
|
|
138
|
+
routes that render it (`layoutRoutes` lists each route's Sections): a docs page on its own layout
|
|
139
|
+
is not missing the nav, so never add one there. A `fallback` flag means the build carried no
|
|
135
140
|
`bcms-brief` meta and was measured against the latest pin. Only a release creates the report;
|
|
136
141
|
a content apply later updates its Layout rows.
|
|
137
142
|
|
|
@@ -168,9 +168,14 @@ A code-built site ships only what its templates draw, whatever the page's `block
|
|
|
168
168
|
`upgrade-section-roots`. The fix is the codemod's `--upgrade-sections` mode, latest version, at
|
|
169
169
|
the repo root (`--dry-run` first); give each root it reports as skipped (`OWN_STYLE`, `SPREAD`,
|
|
170
170
|
`BLOCK_ID_ONLY`, …) its block style by hand, confirm with `--verify-styles`, push and release.
|
|
171
|
-
- **A `button` field renders with `BcmsButton`** (`path`, `value`): one `<a>`
|
|
172
|
-
`data-variant` and `data-size`, so the site's CSS decides what each look looks like and
|
|
173
|
-
|
|
171
|
+
- **A `button` field renders with `BcmsButton`** (`path`, `value`): one `<a data-bcms-button>`
|
|
172
|
+
carrying `data-variant` and `data-size`, so the site's CSS decides what each look looks like and
|
|
173
|
+
every look control (style, size, arrow, icon, new tab) applies on the canvas and on publish.
|
|
174
|
+
Without the SDK, write that same anchor: `data-bcms-button="<path>"`, the label in its own
|
|
175
|
+
`<span data-bcms-field="<path>.label">`, the href through `data-bcms-props`. The arrow is the
|
|
176
|
+
`svg.bcms-btn-arrow` it draws; never leave a hand-written arrow `<svg>` beside it, or turning
|
|
177
|
+
the arrow off leaves one behind. A CTA whose look is hard-coded tells the editor "Style lives
|
|
178
|
+
in the site's code".
|
|
174
179
|
|
|
175
180
|
## 6. Preview source
|
|
176
181
|
|
|
@@ -68,7 +68,8 @@ and `get_componentize_plan` proposes nothing more.
|
|
|
68
68
|
0. A build brings in only SEO and meta, media, the brand and the models `bcms-content.json`
|
|
69
69
|
declares. Pages, collections, forms, bindings and components come from `editor_setup`: run it
|
|
70
70
|
and poll `editor_setup { check: true }` until `ready` before anything below. Run it again
|
|
71
|
-
whenever `get_deploy_status` reports `editorSetup` `stale
|
|
71
|
+
whenever `get_deploy_status` reports `editorSetup` `stale`: a re-run retires the auto fields its
|
|
72
|
+
new derive supersedes and keeps any a person edited, so never delete those by hand. It also fills missing meta from the
|
|
72
73
|
page copy, merges identical components and switches to declared bindings when the build proves
|
|
73
74
|
them; the receipt stays yours (it is the codemod's account of your repo).
|
|
74
75
|
1. Explore the repo (the "Read when" column of SKILL.md's reference table names the signals) and
|
|
@@ -20,7 +20,9 @@ Two things are called a "language" here, and they are separate:
|
|
|
20
20
|
|
|
21
21
|
| Piece | How it works |
|
|
22
22
|
|---|---|
|
|
23
|
-
| The project's locales | `localeConfig.locales
|
|
23
|
+
| The project's locales | `localeConfig.locales`: the owner's list (project settings) plus every page language an import finds. A `locale` outside it is refused with 400; an empty list means a single-language project. Tags are stored canonical (`zh-CN` → `zh-cn`) |
|
|
24
|
+
| A page's language | `list_pages` / `get_page` return `language` (its `locale`, else the `<html lang>` its import declared; null = the default) and `path`. Set it with `create_page` / `update_page` `locale` |
|
|
25
|
+
| Address a page | By id or `path` (`/de/construction/safety`). A slug repeats across language folders, so a bare slug works only when one page has it; otherwise the tool refuses with each match's id, path and language. Never guess one |
|
|
24
26
|
| Translate an entry with AI | `translate_entry` { entryId, targetLocale, slug?, fields? } creates the translation as a DRAFT with `locale` and `translationOf` set (AI credits: 402/403 when out or not on the plan). Text and longtext are translated; rich text and documents are copied for you to translate; `meta` lists which. `409 locale_conflict`: that translation exists, so edit it instead |
|
|
25
27
|
| Create one by hand | `create_content_entry` or `create_page` with `locale` and `translationOf` = the source's id, never another translation's. One row per locale per source (a second is `409 locale_conflict`); `update_content_entry` / `update_page` change either, null clears |
|
|
26
28
|
| Find them | `list_content_entries` `where: { locale: 'fr' }`; default-language rows have a null `locale`, so they match `{ locale: { ne: 'fr' } }`, never `eq` |
|
|
@@ -35,8 +37,8 @@ Import derives deeper locale routes (`/fr/about`) as pages in a URL folder (`fr`
|
|
|
35
37
|
the language its `<html lang>` declares, and the Content sidebar files them under Pages › <language>.
|
|
36
38
|
A locale prefix is never a collection, but a collection's localized posts (`/fr/blog/post-1`, its
|
|
37
39
|
`<html lang>` agreeing) are entries of that collection with `locale` set, `translationOf` the post
|
|
38
|
-
their hreflang alternate (else their slug) names, slug `<slug>-<locale
|
|
39
|
-
each language found. An edit to `/about` never reaches `/fr/about`; edit each page or entry.
|
|
40
|
+
their hreflang alternate (else their slug) names, slug `<slug>-<locale>`, served at
|
|
41
|
+
`/<locale>/<collection>/<slug>`; the project's locales gain each language found. An edit to `/about` never reaches `/fr/about`; edit each page or entry.
|
|
40
42
|
|
|
41
43
|
## 2. Never model
|
|
42
44
|
|
package/package.json
CHANGED