sbuilder-mcp 0.101.4 → 0.102.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.
- package/CHANGELOG.md +13 -0
- package/CHANGELOG.vi.md +13 -0
- package/dist/catalog/deadkeys.generated.js +3 -3
- package/dist/catalog/elements.generated.js +5 -0
- package/dist/catalog/shapes.generated.js +1 -1
- package/dist/catalog/source.generated.js +2 -2
- package/dist/catalog/translations.generated.js +2 -1
- package/dist/domains/site/filtervalues.js +2 -0
- package/dist/domains/site/findings.js +3 -0
- package/dist/domains/site/review.js +40 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,19 @@ All notable changes to this project are documented in this file.
|
|
|
6
6
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
7
7
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
+
## [0.102.1] - 2026-10-30
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- `sb_review` no longer reports `tag_filters_share_key` for tag filters that carry the same values, such as a desktop sidebar and its mobile accordion copy sharing one key on purpose.
|
|
13
|
+
|
|
14
|
+
## [0.102.0] - 2026-10-30
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- `sb_review` reports a `tag_filters_share_key` finding when two or more tag filters that target the same list write the same `f.tag` URL key, and suggests giving each its own `filterGroupKey` with `filterMatch` set to `any`.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- The generated catalog is regenerated against web_builder v1.0.194.
|
|
21
|
+
|
|
9
22
|
## [0.101.4] - 2026-10-30
|
|
10
23
|
|
|
11
24
|
### Added
|
package/CHANGELOG.vi.md
CHANGED
|
@@ -6,6 +6,19 @@ Mọi thay đổi đáng chú ý của dự án được ghi lại trong file n
|
|
|
6
6
|
Định dạng dựa trên [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
7
7
|
và dự án tuân theo [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
+
## [0.102.1] - 2026-10-30
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- `sb_review` không còn báo `tag_filters_share_key` cho các bộ lọc thẻ có cùng giá trị, chẳng hạn sidebar desktop và bản accordion mobile dùng chung một khóa có chủ đích.
|
|
13
|
+
|
|
14
|
+
## [0.102.0] - 2026-10-30
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- `sb_review` báo finding `tag_filters_share_key` khi hai bộ lọc thẻ trở lên cùng nhắm một danh sách và dùng chung khóa URL `f.tag`, đồng thời gợi ý đặt `filterGroupKey` riêng cho từng bộ lọc cùng `filterMatch` là `any`.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- Catalog sinh tự động được sinh lại theo web_builder v1.0.194.
|
|
21
|
+
|
|
9
22
|
## [0.101.4] - 2026-10-30
|
|
10
23
|
|
|
11
24
|
### Added
|
|
@@ -2180,6 +2180,7 @@ export const ELEMENTS = {
|
|
|
2180
2180
|
"filterExcluded": [],
|
|
2181
2181
|
"filterColors": {},
|
|
2182
2182
|
"filterMatch": "any",
|
|
2183
|
+
"filterGroupKey": "",
|
|
2183
2184
|
"filterArity": "",
|
|
2184
2185
|
"filterBehavior": "filter",
|
|
2185
2186
|
"filterTargets": [],
|
|
@@ -2394,6 +2395,7 @@ export const ELEMENTS = {
|
|
|
2394
2395
|
"filterExcluded": [],
|
|
2395
2396
|
"filterColors": {},
|
|
2396
2397
|
"filterMatch": "any",
|
|
2398
|
+
"filterGroupKey": "",
|
|
2397
2399
|
"filterArity": "",
|
|
2398
2400
|
"filterBehavior": "filter",
|
|
2399
2401
|
"filterTargets": [],
|
|
@@ -2609,6 +2611,7 @@ export const ELEMENTS = {
|
|
|
2609
2611
|
"filterExcluded": [],
|
|
2610
2612
|
"filterColors": {},
|
|
2611
2613
|
"filterMatch": "any",
|
|
2614
|
+
"filterGroupKey": "",
|
|
2612
2615
|
"filterArity": "",
|
|
2613
2616
|
"filterBehavior": "filter",
|
|
2614
2617
|
"filterTargets": [],
|
|
@@ -2823,6 +2826,7 @@ export const ELEMENTS = {
|
|
|
2823
2826
|
"filterExcluded": [],
|
|
2824
2827
|
"filterColors": {},
|
|
2825
2828
|
"filterMatch": "any",
|
|
2829
|
+
"filterGroupKey": "",
|
|
2826
2830
|
"filterArity": "",
|
|
2827
2831
|
"filterBehavior": "filter",
|
|
2828
2832
|
"filterTargets": [],
|
|
@@ -36248,6 +36252,7 @@ export const ELEMENTS = {
|
|
|
36248
36252
|
"filterSource": "sort",
|
|
36249
36253
|
"filterValues": [],
|
|
36250
36254
|
"filterTargets": [],
|
|
36255
|
+
"filterGroupKey": "",
|
|
36251
36256
|
"placeholder": "",
|
|
36252
36257
|
"filterBehavior": "filter"
|
|
36253
36258
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// GENERATED by scripts/gen-catalog.ts — do not edit by hand.
|
|
2
2
|
// The platform commit every other generated file here describes.
|
|
3
3
|
export const PLATFORM_SOURCE = {
|
|
4
|
-
"commit": "
|
|
5
|
-
"committedAt": "2026-10-
|
|
4
|
+
"commit": "933548d70fed2991e00069b2b3b705870edb8175",
|
|
5
|
+
"committedAt": "2026-10-30T10:19:43+07:00",
|
|
6
6
|
"dirty": false
|
|
7
7
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
export const TRANSLATION_SOURCE = {
|
|
4
4
|
"elements": 68,
|
|
5
5
|
"pairs": 190,
|
|
6
|
-
"neverKeys":
|
|
6
|
+
"neverKeys": 184,
|
|
7
7
|
"entityTypes": 12
|
|
8
8
|
};
|
|
9
9
|
/** Every entity type a translation record can name, including "node". */
|
|
@@ -421,6 +421,7 @@ export const NEVER_TRANSLATED = [
|
|
|
421
421
|
"filterBehavior",
|
|
422
422
|
"filterColors",
|
|
423
423
|
"filterExcluded",
|
|
424
|
+
"filterGroupKey",
|
|
424
425
|
"filterHierarchy",
|
|
425
426
|
"filterMatch",
|
|
426
427
|
"filterMaxDepth",
|
|
@@ -20,6 +20,8 @@ import { siteToken } from '../../tools/credentialpick.js';
|
|
|
20
20
|
* blog/course sources are not covered.
|
|
21
21
|
*/
|
|
22
22
|
export const FILTER_VALUE_TYPES = new Set(['filter-checkbox', 'filter-radio', 'filter-tag', 'filter-color', 'select']);
|
|
23
|
+
/** web_builder's tag filter group grammar (schema sources.ts TAG_GROUP_RE): `f.tag.<group>=`. */
|
|
24
|
+
export const TAG_GROUP = /^[a-z0-9][a-z0-9_-]{0,31}$/;
|
|
23
25
|
/** The keys whose change re-derives the rows on sb_set. */
|
|
24
26
|
export const RESOURCE_KEYS = ['filterSource', 'filterAxis', 'filterRanges'];
|
|
25
27
|
const CATALOG = new Set(['category', 'brand', 'tag', 'attribute']);
|
|
@@ -153,6 +153,9 @@ export const FIX = {
|
|
|
153
153
|
'sort gets the six orders, a catalogue source reads the facets, a price filter needs filterRanges. A sort aimed ' +
|
|
154
154
|
'at a record list takes filterValues [{ "value": "fld_…_asc" | "fld_…_desc", "label": "…", "enabled": true }]; ' +
|
|
155
155
|
'anything else, write specials.filterValues [{ "value": …, "label": …, "enabled": true }] yourself.',
|
|
156
|
+
tag_filters_share_key: 'Give each tag filter its own group: sb_set id "<id>", namespace specials, keys { "filterGroupKey": "cpu" } ' +
|
|
157
|
+
'(a slug, ^[a-z0-9][a-z0-9_-]{0,31}$ — one per filter: "cpu", "vga", "ram"), and set "filterMatch": "any" so values ' +
|
|
158
|
+
'OR inside the group. Groups AND with each other, so CPU X + VGA Y narrows to machines holding both.',
|
|
156
159
|
record_relation_unset: 'Link it to its parent row: sb_set id "<id>", namespace config, keys { "recordRelationField": "fld_…" } — ' +
|
|
157
160
|
'the ID of a "reference" field in THIS list\'s collection that targets the enclosing list\'s collection ' +
|
|
158
161
|
'(GET /api/sites/{siteId}/collections/{id}/fields, refCollectionId).',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
-
import { FILTER_VALUE_TYPES, sourceOf } from './filtervalues.js';
|
|
2
|
+
import { FILTER_VALUE_TYPES, TAG_GROUP, sourceOf } from './filtervalues.js';
|
|
3
3
|
import { childrenOf, childrenWithSatellites, isOverlay, isSharedSection, pageChildren, subtreeIds, appBlockRoot, SPEC_GLOBAL_REF, SPEC_APP_BLOCK_REF } from '../../core/tree.js';
|
|
4
4
|
import { STUCK_STATE, stickyBlockedBy, stuckHostOf, isPinnedNode } from './sticky.js';
|
|
5
5
|
import { bandOf, isGlobal } from './traps.js';
|
|
@@ -468,6 +468,45 @@ opts = {}) {
|
|
|
468
468
|
// shape and is legitimately a list of links; a two-button pair is a call to
|
|
469
469
|
// action, not a menu. The check that fires on those is one an author learns to
|
|
470
470
|
// ignore, which costs more than the one it catches.
|
|
471
|
+
// TAG FILTERS SHARING ONE URL KEY (TTG, 2026-10-30): CPU, VGA and RAM tag filters all
|
|
472
|
+
// wrote `f.tag=`, under ONE match mode — OR returned machines with either part, AND
|
|
473
|
+
// emptied the shelf on two CPUs. Since web_builder's tag filter groups each filter owns
|
|
474
|
+
// `f.tag.<filterGroupKey>`: values OR within it, groups AND. Event filters write no URL.
|
|
475
|
+
{
|
|
476
|
+
// A MIRROR — the same values on another breakpoint's copy (desktop sidebar, mobile
|
|
477
|
+
// accordion) — shares the key on purpose; only DIFFERENT value sets are two facets.
|
|
478
|
+
const byKey = new Map();
|
|
479
|
+
for (const id of walkOrder) {
|
|
480
|
+
const n = d.nodes[id];
|
|
481
|
+
const sp = (n.specials ?? {});
|
|
482
|
+
if (!FILTER_VALUE_TYPES.has(n.data.type) || sourceOf(n.data.type, sp) !== 'tag' || sp.filterBehavior === 'event')
|
|
483
|
+
continue;
|
|
484
|
+
const g = typeof sp.filterGroupKey === 'string' && TAG_GROUP.test(sp.filterGroupKey) ? sp.filterGroupKey : '';
|
|
485
|
+
const targets = [
|
|
486
|
+
...(typeof sp.filterTarget === 'string' && sp.filterTarget ? [sp.filterTarget] : []),
|
|
487
|
+
...(Array.isArray(sp.filterTargets) ? sp.filterTargets.filter((t) => typeof t === 'string' && t !== '') : []),
|
|
488
|
+
];
|
|
489
|
+
const key = g ? `tag.${g}` : 'tag';
|
|
490
|
+
const rows = Array.isArray(sp.filterValues) ? sp.filterValues : [];
|
|
491
|
+
const values = rows.map((r) => String(r?.value ?? '').toLowerCase()).sort().join('\n');
|
|
492
|
+
byKey.set(key, [...(byKey.get(key) ?? []), { id, type: n.data.type, targets, values }]);
|
|
493
|
+
}
|
|
494
|
+
for (const [key, list] of byKey) {
|
|
495
|
+
const overlaps = (a, b) => a.length === 0 || b.length === 0 || a.some((t) => b.includes(t));
|
|
496
|
+
for (let i = 1; i < list.length; i++) {
|
|
497
|
+
if (!list.slice(0, i).some((p) => p.values !== list[i].values && overlaps(p.targets, list[i].targets)))
|
|
498
|
+
continue;
|
|
499
|
+
out.push({
|
|
500
|
+
code: 'tag_filters_share_key',
|
|
501
|
+
nodeId: list[i].id,
|
|
502
|
+
type: list[i].type,
|
|
503
|
+
problem: `${list.length} tag filters on this page write the same URL key f.${key}, so their values combine under ONE ` +
|
|
504
|
+
'match mode: OR returns products carrying a value from either filter, AND empties the shelf when a shopper ticks two values of one.',
|
|
505
|
+
fix: fill('tag_filters_share_key', { id: list[i].id }),
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
471
510
|
for (const [containerId, childIds] of [...Object.keys(d.nodes)].map((id) => [id, childrenOf(d, id)])) {
|
|
472
511
|
if (band.get(containerId) !== 'header')
|
|
473
512
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sbuilder-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.102.1",
|
|
4
4
|
"description": "MCP server that designs and operates a Store Builder site — pages, data, theme and publish — through the platform's own API and live-edit protocol.",
|
|
5
5
|
"mcpName": "io.github.vuluu2k/sbuilder-mcp",
|
|
6
6
|
"type": "module",
|