@bettercms-ai/convert 0.4.0 → 0.6.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/CHANGELOG.md +38 -4
- package/README.md +12 -0
- package/dist/cli.js +330 -50
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +45 -2
- package/dist/index.js +333 -50
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @bettercms-ai/convert
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5ad31fd: Astro SSR draft recipe now names `@astrojs/node` standalone, the auto-injected draft routes, and `loadPage` + `loadComponents`.
|
|
8
|
+
|
|
9
|
+
## 0.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- The conversion now decides the site's LIVE PREVIEW LANE, and says so in the receipt.
|
|
14
|
+
|
|
15
|
+
A converted site is static, so the visual editor can frame the real build but has nowhere to
|
|
16
|
+
put a DRAFT — it falls back to the platform's approximate renderer and stops looking like the
|
|
17
|
+
site. A Next page that already renders through `<BcmsBlocks>` gets the fix applied: the import
|
|
18
|
+
moves to `@bettercms-ai/next/draft-bridge` and the element becomes
|
|
19
|
+
`<BcmsDraftBridge slug={…} …/>`, which listens for the editor's push.
|
|
20
|
+
|
|
21
|
+
🔴 THE SLUG IS THE WHOLE RISK, so it is never guessed. It has to come from the component's own
|
|
22
|
+
scope (`slug`, `params`, `page`) or from a route literal the brief can name; anything else is
|
|
23
|
+
`CANVAS_BRIDGE_MANUAL` with the file and the line. A bridge wired to the wrong slug is a page
|
|
24
|
+
that silently never updates in the editor — worse than no bridge, because the editor's chip
|
|
25
|
+
then claims a live lane.
|
|
26
|
+
|
|
27
|
+
Astro is refused wholesale with `SSR_DRAFT_ROUTE` and the recipe in `hint`: bridging it needs
|
|
28
|
+
either `<BcmsLiveBlocks client:load>` from `@bettercms-ai/astro` or a server render, and
|
|
29
|
+
migrating somebody's site to SSR is a deploy-shaped decision, never a codemod's.
|
|
30
|
+
|
|
31
|
+
The receipt gains `canvas: { lane: "bridge" | "pending", files? }`. The two lane reasons ride
|
|
32
|
+
`paths.pending` — the one list every reader already looks at — but are OUTSIDE the arithmetic
|
|
33
|
+
(`declared === rewritten + alreadyDeclared + pending.length`): a lane row is a fact about the
|
|
34
|
+
site, not an unbound field, and counting it would make every hand-written site report one
|
|
35
|
+
phantom missing path forever.
|
|
36
|
+
|
|
3
37
|
## 0.4.0
|
|
4
38
|
|
|
5
39
|
The workspace lockfile records this version: a lock still naming 0.3.0 makes a frozen install
|
|
@@ -69,7 +103,7 @@ reject the checkout, which is what broke the migrator image on #616.
|
|
|
69
103
|
has; a `bcmsField` the file demonstrably builds from our helper is left alone and only its
|
|
70
104
|
bindings are wrapped; anything else is `SECTION_UNMIGRATABLE`.
|
|
71
105
|
|
|
72
|
-
🔴 A NAME IS NOT A PROVENANCE. Reusing anything
|
|
106
|
+
🔴 A NAME IS NOT A PROVENANCE. Reusing anything _called_ `bcmsFields` trusted an import from
|
|
73
107
|
any module at all — `import { bcmsFields } from "./their-utils"` is a different function with
|
|
74
108
|
the same name — and any coexisting `bcmsField` vouched for itself. The specifier must RESOLVE
|
|
75
109
|
to the helper module this package writes (through the project's own aliases), and `bcmsField`
|
|
@@ -175,7 +209,7 @@ reject the checkout, which is what broke the migrator image on #616.
|
|
|
175
209
|
catch, reached through the check itself. Two shapes are provable: a string literal and NOTHING
|
|
176
210
|
else, and a template literal whose every interpolation is an INDEX (`[${i}]`, what a repeater
|
|
177
211
|
writes, which cannot change the prefix). Everything else — `{computedPath}`, `{"a" + x}`,
|
|
178
|
-
``
|
|
212
|
+
``{`${prefix}.title`}`` — is opaque, and opaque is `PROP_MAP_INCONSISTENT`.
|
|
179
213
|
|
|
180
214
|
- `COPY_MODE_MISMATCH` ignores sections the SERVER already refused.
|
|
181
215
|
|
|
@@ -196,7 +230,7 @@ reject the checkout, which is what broke the migrator image on #616.
|
|
|
196
230
|
|
|
197
231
|
The in-place call site — `<Hero bind="hero" page={pageSnapshot("home")} />` — is written by
|
|
198
232
|
the codemod from the plan and carries no `blockId` and no `overrides`; it never consults the
|
|
199
|
-
CMS's blocks at all, which is exactly what makes the inline form componentisation
|
|
233
|
+
CMS's blocks at all, which is exactly what makes the inline form componentisation _without_
|
|
200
234
|
the page builder. Emitting it for a placement whose copy has MOVED rendered the page's field
|
|
201
235
|
group and declared the page lane for an address that no longer holds anything. The component
|
|
202
236
|
is still written; the page is left as its author wrote it.
|
|
@@ -266,7 +300,7 @@ reject the checkout, which is what broke the migrator image on #616.
|
|
|
266
300
|
the dashboard renders. The committed helper needed nothing: `bcmsRows` already passes a
|
|
267
301
|
nested array through untouched and `bcmsSection` hands a section its group whole.
|
|
268
302
|
|
|
269
|
-
The bindings are ``
|
|
303
|
+
The bindings are ``data-bcms-field={`cards[${i}].items[${j}].label`}`` and the shape is
|
|
270
304
|
`cards[*].items[*].label`; the loop now REPORTS the bindings it wrote, both loop variables
|
|
271
305
|
included, instead of the caller re-deriving a literal the file does not contain. ONE level
|
|
272
306
|
of nesting — what the plan mints and what the component prop validator accepts — so a leaf
|
package/README.md
CHANGED
|
@@ -71,6 +71,18 @@ A path counts as rewritten only when EVERY located occurrence of it was. A value
|
|
|
71
71
|
the home page and a shared header is two places a reader sees it, and converting one of them reads
|
|
72
72
|
as a finished job.
|
|
73
73
|
|
|
74
|
+
**It also decides the live-preview lane.** A Next page already rendering through `<BcmsBlocks>`
|
|
75
|
+
gets its import moved to `@bettercms-ai/next/draft-bridge` and its element rewritten to
|
|
76
|
+
`<BcmsDraftBridge slug={…} …/>`, so the visual editor can re-render your DRAFTS with your own
|
|
77
|
+
components instead of falling back to the platform's approximate renderer. The slug is never
|
|
78
|
+
guessed — it comes from the component's own scope (`slug`, `params`, `page`) or a route literal the
|
|
79
|
+
brief can name, and anything else is `CANVAS_BRIDGE_MANUAL` with the file and line, because a
|
|
80
|
+
bridge on the wrong slug is a page that silently never updates. Astro gets `SSR_DRAFT_ROUTE` and
|
|
81
|
+
the recipe: use `<BcmsLiveBlocks client:load>` from `@bettercms-ai/astro`, or render those routes
|
|
82
|
+
on a server. The verdict is `canvas: { lane, files? }` on the receipt; the two lane reasons ride
|
|
83
|
+
`paths.pending` but are outside the arithmetic above — they are facts about the site, not unbound
|
|
84
|
+
fields.
|
|
85
|
+
|
|
74
86
|
**A declaration this package did not write still counts.** An element that names the target —
|
|
75
87
|
`data-bcms-field`, `data-bcms-layout-field` or an address in `data-bcms-props` — but gets its copy
|
|
76
88
|
some other way (a literal somebody left there, the project's own data module) is DECLARED: the
|