@bettercms-ai/convert 0.22.0 → 0.24.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 +12 -0
- package/README.md +39 -0
- package/dist/cli.js +502 -10
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +96 -2
- package/dist/index.js +455 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @bettercms-ai/convert
|
|
2
2
|
|
|
3
|
+
## 0.24.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 86c0c9f: Helper v12: on a server BetterCMS hosts, each content snapshot resolves at request time to its published counterpart in the file the platform rewrites on every publish (`BCMS_CONTENT_FILE`), so a server-rendered page shows a publish in seconds without a rebuild. Builds, dev servers, browsers and edge runtimes are unchanged. New export `helperUpgrades()` lists the current helper per path with the digests of every older one it may replace.
|
|
8
|
+
|
|
9
|
+
## 0.23.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 6c75c11: `bettercms-convert --upgrade-sections --root .` gives a site converted before helper v10 the section style marker, so the visual editor shows section spacing and style handles on its pages. Every element that carries `data-bcms-block` and no `data-bcms-style` gets the marker together with the style it promises. A component that `--componentize` wrote gets `data-bcms-style="" style={bcmsSectionStyle[Text](blockStyle)}` and the `blockStyle` prop, and its registry and `src/lib/bcms-sections.ts` are patched to pass each placement's `block.style`. The result is byte-identical to what a fresh extraction writes today. `data-bcms-block={block.id}` becomes `{...sectionRootAttrs(block)}` when the SDK range guarantees that export (`@bettercms-ai/astro` 0.19, `@bettercms-ai/next` 0.18), and otherwise gets the marker and `block.style` through the helper. The helper is upgraded to the current version, or added with its layout stub. Roots with their own `style` or a spread, roots that receive only a block id, and literal, conditional or unresolvable blocks are left alone. Each one is listed in the receipt with its reason (`OWN_STYLE`, `SPREAD`, `BLOCK_ID_ONLY`, `BLOCK_LITERAL`, `BLOCK_UNRESOLVABLE`, …). A second run writes nothing, and no class, className or existing style token changes. `--dry-run`, `--receipt`, `--strict` and `--overwrite-helper` work as in the other modes.
|
|
14
|
+
|
|
3
15
|
## 0.22.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -601,6 +601,45 @@ the now-unused `bcms`/snapshot imports P2 added, and a page whose registered cal
|
|
|
601
601
|
`<Sections>` keeps the imports of the components it used to call. They are harmless at build time
|
|
602
602
|
and removing them would mean editing statements no section asked about.
|
|
603
603
|
|
|
604
|
+
### Section spacing handles on a site converted before helper v10 (`--upgrade-sections`)
|
|
605
|
+
|
|
606
|
+
The visual editor shows a page's section spacing and style handles only when EVERY root the build
|
|
607
|
+
stamps with `data-bcms-block` also carries `data-bcms-style` — the site's promise that the root's
|
|
608
|
+
inline style is `blockStyleToCss(block.style)`. Conversions before 0.21 (helper v6–v9, componentize
|
|
609
|
+
v2 sections, hand-written roots) stamp the block and not the marker, so those pages never get
|
|
610
|
+
handles. `get_next_steps` says so (`upgrade-section-roots`) when the release finds such roots.
|
|
611
|
+
|
|
612
|
+
```bash
|
|
613
|
+
npx @bettercms-ai/convert@latest --upgrade-sections --root . --dry-run # read the plan
|
|
614
|
+
npx @bettercms-ai/convert@latest --upgrade-sections --root . # then push and release
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
Each root with `data-bcms-block` and no `data-bcms-style` gets the marker together with the style:
|
|
618
|
+
|
|
619
|
+
- a component `--componentize` wrote (`data-bcms-block={blockId}`): `data-bcms-style=""
|
|
620
|
+
style={bcmsSectionStyle[Text](blockStyle)}`, the `blockStyle` prop, and the registry and
|
|
621
|
+
`src/lib/bcms-sections.ts` patched to pass `block.style` down — byte-identical to what a fresh
|
|
622
|
+
extraction writes today;
|
|
623
|
+
- `data-bcms-block={block.id}` where the SDK has `sectionRootAttrs` (`@bettercms-ai/astro` >= 0.19,
|
|
624
|
+
`@bettercms-ai/next` >= 0.18, read off the LOWEST version the range admits):
|
|
625
|
+
`{...sectionRootAttrs(block)}`;
|
|
626
|
+
- the same root on an older SDK: `data-bcms-style="" style={bcmsSectionStyle[Text](block.style)}`
|
|
627
|
+
through the helper, which is upgraded (or added, with its `bcms-content/layout.json` stub).
|
|
628
|
+
|
|
629
|
+
Left alone, and listed as `skipped` with a reason: `OWN_STYLE` (the root sets its own `style`),
|
|
630
|
+
`SPREAD` (a `{...rest}` that may carry one), `BLOCK_ID_ONLY` (only an id reaches the root —
|
|
631
|
+
`data-bcms-block={Astro.props.bcmsBlock}`; pass the block or its style down), `BLOCK_LITERAL`,
|
|
632
|
+
`BLOCK_UNRESOLVABLE` (a conditional or a call), `NOT_AN_ELEMENT`, `NAME_TAKEN`,
|
|
633
|
+
`REGISTRY_UNRECOGNISED`, `DIALECT_UNSUPPORTED` (html, vue, svelte), `PARSE_ERROR`. A helper this
|
|
634
|
+
package did not write is `HELPER_CONFLICT` (exit 1) only when a root needs it; `--overwrite-helper`
|
|
635
|
+
replaces it.
|
|
636
|
+
|
|
637
|
+
The receipt (`--receipt <file>`) is `{ helpers, registry, roots: { upgraded, alreadyMarked,
|
|
638
|
+
skipped } }`, each root as `{ file, line, tag, block, form | reason + message }`. No class,
|
|
639
|
+
className or existing style token changes (`--verify-styles` stays clean), and a second run writes
|
|
640
|
+
nothing and counts every root it marked as `alreadyMarked`. `--strict` exits 2 while any root is
|
|
641
|
+
skipped.
|
|
642
|
+
|
|
604
643
|
## Forms
|
|
605
644
|
|
|
606
645
|
The third mode, and the shortest. The release-time derive lane reads every `<form>` in the built
|