@wocart/theme 2.0.0 → 2.1.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 +11 -0
- package/dist/manifest-diff.js +32 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to `@wocart/theme` are recorded here. The package follows
|
|
|
5
5
|
major version, and an export is marked `@deprecated` for at least one minor
|
|
6
6
|
release before a major removes it.
|
|
7
7
|
|
|
8
|
+
## 2.1.0 — 2026-10-21
|
|
9
|
+
|
|
10
|
+
The release check now sees where a section may be placed.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `diffThemeManifests` treats a component that is no longer insertable, or that
|
|
15
|
+
is limited to a narrower list of surfaces, as a breaking change. Widening a
|
|
16
|
+
component's surfaces, or making it insertable again, is additive. Before, a
|
|
17
|
+
theme could narrow where a section sits without the release check noticing.
|
|
18
|
+
|
|
8
19
|
## 2.0.0 — 2026-10-20
|
|
9
20
|
|
|
10
21
|
Blocks: components place other components inside them, some fixed by the
|
package/dist/manifest-diff.js
CHANGED
|
@@ -82,6 +82,7 @@ export function diffThemeManifests(previous, next) {
|
|
|
82
82
|
}
|
|
83
83
|
function compareComponents(previous, next, path, breaking, additive) {
|
|
84
84
|
compareFields(previous.fields, next.fields, `${path}.fields`, breaking, additive);
|
|
85
|
+
compareCapabilities(previous.capabilities, next.capabilities, `${path}.capabilities`, breaking, additive);
|
|
85
86
|
const nextSlots = new Map(next.slots.map((slot) => [slot.name, slot]));
|
|
86
87
|
for (const slot of previous.slots) {
|
|
87
88
|
const after = nextSlots.get(slot.name);
|
|
@@ -108,6 +109,37 @@ function compareComponents(previous, next, path, breaking, additive) {
|
|
|
108
109
|
additive(`${path}.fixed.${block.name}`, `fixed block "${block.name}" was added`);
|
|
109
110
|
}
|
|
110
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Where an editor may place a component. A narrowed rule is breaking: a section
|
|
114
|
+
* saved on a surface it no longer covers may stop rendering there, once a theme
|
|
115
|
+
* renders each surface from the components it covers, and it cannot be placed
|
|
116
|
+
* again. Widening only adds.
|
|
117
|
+
*/
|
|
118
|
+
function compareCapabilities(previous, next, path, breaking, additive) {
|
|
119
|
+
const wasInsertable = previous?.insertable !== false;
|
|
120
|
+
const isInsertable = next?.insertable !== false;
|
|
121
|
+
if (wasInsertable && !isInsertable)
|
|
122
|
+
breaking(`${path}.insertable`, "no longer insertable: an editor cannot place it again");
|
|
123
|
+
else if (!wasInsertable && isInsertable)
|
|
124
|
+
additive(`${path}.insertable`, "insertable again");
|
|
125
|
+
const before = previous?.surfaces;
|
|
126
|
+
const after = next?.surfaces;
|
|
127
|
+
if (after === undefined) {
|
|
128
|
+
if (before !== undefined)
|
|
129
|
+
additive(`${path}.surfaces`, "now on any surface");
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (before === undefined) {
|
|
133
|
+
breaking(`${path}.surfaces`, `now only on ${after.join(", ")}`);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const removed = before.filter((surface) => !after.includes(surface));
|
|
137
|
+
if (removed.length > 0)
|
|
138
|
+
breaking(`${path}.surfaces`, `no longer on ${removed.join(", ")}`);
|
|
139
|
+
const added = after.filter((surface) => !before.includes(surface));
|
|
140
|
+
if (added.length > 0)
|
|
141
|
+
additive(`${path}.surfaces`, `now also on ${added.join(", ")}`);
|
|
142
|
+
}
|
|
111
143
|
/** A list's cap and required types: a lower cap hides saved instances; a new requirement only adds. */
|
|
112
144
|
function compareCaps(previous, next, path, what, breaking, additive) {
|
|
113
145
|
if (next.max !== undefined && (previous.max === undefined || next.max < previous.max)) {
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED