@bettercms-ai/mcp 0.68.0 → 0.68.1

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.
@@ -196,6 +196,20 @@ A code-built site ships only what its templates draw, whatever the page's `block
196
196
  the page: the anchor carries `data-bcms-button="<key>"` and `get_binding_report` lists no
197
197
  unmatched path for it. The button field is added by that build and starts from the pair's
198
198
  label and link.
199
+ - **Read a published value where the app renders the page** (the fix a publish that fails with
200
+ "Published, but this page's code doesn't read this field yet: `<key>`" names). On a route the
201
+ site's app renders, a stamp (`data-bcms-field`, a `bcmsBindings` entry) only says where a field
202
+ IS; the page shows a publish only when its code READS the value. In code, on a branch:
203
+ 1. Read through the helper the conversion wrote (`bcms`, `bcmsRows`, `bcmsImage`, `bcmsLayout`
204
+ from `src/bcms-content.ts`) or the SDK's `readPublishedContent` / `publishedEntry`. Never read
205
+ a row of `bcms-content.json` by hand, and never bundle the file (`import`, `import.meta.glob`).
206
+ 2. An image the page imports and passes on (`src={heroImage}` beside
207
+ `bcmsBindings={{ image: "<key>" }}`): pass `src={bcmsImage(<page snapshot>, "<key>", heroImage)}`.
208
+ The import stays the fallback; a published image is served from the copy BetterCMS places
209
+ beside the app. `npx @bettercms-ai/convert` makes this edit for every such call site.
210
+ 3. Keep the hard-coded copy as the fallback argument, so a build with no content renders as today.
211
+ 4. Open a pull request. After it is merged and the site rebuilt, publish the field again: the
212
+ toast reads "Live".
199
213
 
200
214
  ## 6. Preview source
201
215
 
@@ -127,6 +127,13 @@ generated reader. A build that fetches the snapshot and never reads it still ren
127
127
  hard-coded copy, so every edit saves, publishes and changes nothing on the page. Grep the source
128
128
  for a reader before calling a site wired.
129
129
 
130
+ Read it through one of those, the converted-site helper (`bcms`, `bcmsRows`, `bcmsImage`) or
131
+ `publishedEntry(slug)`. Never hand-write a parser of the file: each row holds its field values
132
+ under `data` (`row.data.title`), so code that reads `row.title` gets `undefined` and renders its
133
+ fallback on every publish. An editable image is `bcmsImage(page, path, importedImage)`: the bare
134
+ import with only a stamp never shows a published image on a route the app renders. An old
135
+ `src/utils/bcms.ts` with `pageEntry()` is that parser: replace its reads with `publishedEntry`.
136
+
130
137
  Build with the repo's own `build` script (`pnpm build`, `bun run build`), never the framework CLI
131
138
  directly: a repo's script often adds a type check or a post-process step the CLI skips.
132
139
 
@@ -82,6 +82,9 @@ Rules:
82
82
  a live fetch would turn pages into dynamic routes, and a static export silently leaves them out
83
83
  of `out/`.
84
84
  - A preview build that must read live sets `BETTERCMS_PREVIEW=1`.
85
+ - On a BetterCMS build the platform's own `bcms-content.json` is already in the project root.
86
+ `bettercms-snapshot` keeps it and `getContent` reads it: one file feeds `getContent`, `readPages`,
87
+ `readForms` and `readComponents`.
85
88
  - Draft mode and the revalidation route need a server; a static export has neither. Content
86
89
  changes reach a static site only by rebuilding it.
87
90
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bettercms-ai/mcp",
3
- "version": "0.68.0",
3
+ "version": "0.68.1",
4
4
  "type": "module",
5
5
  "description": "BetterCMS MCP server — schema, content, forms + components authoring tools over the Management API, authed via OAuth device-code.",
6
6
  "bin": {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@bettercms-ai/device-auth": "^0.2.0",
35
- "@bettercms-ai/sdk": "^1.26.2",
35
+ "@bettercms-ai/sdk": "^1.26.3",
36
36
  "@modelcontextprotocol/sdk": "^1.30.0",
37
37
  "zod": "^4.3.6"
38
38
  },