@knapsack/source-conflicts-adapter 4.101.5--canary.8125.f230cff.0 → 4.101.5
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/dist/mdx/selectSections.d.ts +13 -5
- package/dist/mdx/selectSections.d.ts.map +1 -1
- package/dist/mdx/selectSections.js +101 -14
- package/dist/mdx/selectSections.js.map +1 -1
- package/dist/mdx/selectSections.vitest.d.ts +16 -0
- package/dist/mdx/selectSections.vitest.d.ts.map +1 -0
- package/dist/mdx/selectSections.vitest.js +284 -0
- package/dist/mdx/selectSections.vitest.js.map +1 -0
- package/package.json +6 -6
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Section selection over distro entity MDX.
|
|
3
3
|
*
|
|
4
|
-
* Sections are markdown-AST node groups delimited by
|
|
5
|
-
*
|
|
6
|
-
* `{#
|
|
7
|
-
*
|
|
4
|
+
* Sections are markdown-AST node groups delimited by headings, keyed by the
|
|
5
|
+
* heading's `{#anchor}` convention (`{#.props}` → `props`, `{#tab.overview}`
|
|
6
|
+
* → `tabs`, `{#template.tabsbar.props}` → `props` qualified by `tabsbar`).
|
|
7
|
+
* Selection, ordering, and the omitted-sections enumeration are tree
|
|
8
|
+
* operations; the body is re-serialized through remark.
|
|
9
|
+
*
|
|
10
|
+
* NOTE: this is a fourth site hand-parsing the informal anchor grammar
|
|
11
|
+
* emitted by the ingest adapters. The grammar has no single source of truth;
|
|
12
|
+
* until it gains one at the emission point, a change to anchor shape has to
|
|
13
|
+
* be mirrored here and at the three other parse sites.
|
|
8
14
|
*/
|
|
9
15
|
/**
|
|
10
16
|
* Serve an entity MDX document with only the requested sections, props
|
|
11
|
-
* first. `include` names sections by key;
|
|
17
|
+
* first. `include` names sections by key; every section carrying that key is
|
|
18
|
+
* served, so a multi-template component returns each template's props rather
|
|
19
|
+
* than the first match only. Absent `include` means `['props']`;
|
|
12
20
|
* `['all']` serves everything. Omitted section keys are enumerated at the
|
|
13
21
|
* end so a caller can request them. A body the parser cannot handle is
|
|
14
22
|
* served verbatim — fallback, never an error.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectSections.d.ts","sourceRoot":"","sources":["../../src/mdx/selectSections.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"selectSections.d.ts","sourceRoot":"","sources":["../../src/mdx/selectSections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAiLH;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,OAAO,GACR,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GAAG,MAAM,CAwCT"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Section selection over distro entity MDX.
|
|
3
3
|
*
|
|
4
|
-
* Sections are markdown-AST node groups delimited by
|
|
5
|
-
*
|
|
6
|
-
* `{#
|
|
7
|
-
*
|
|
4
|
+
* Sections are markdown-AST node groups delimited by headings, keyed by the
|
|
5
|
+
* heading's `{#anchor}` convention (`{#.props}` → `props`, `{#tab.overview}`
|
|
6
|
+
* → `tabs`, `{#template.tabsbar.props}` → `props` qualified by `tabsbar`).
|
|
7
|
+
* Selection, ordering, and the omitted-sections enumeration are tree
|
|
8
|
+
* operations; the body is re-serialized through remark.
|
|
9
|
+
*
|
|
10
|
+
* NOTE: this is a fourth site hand-parsing the informal anchor grammar
|
|
11
|
+
* emitted by the ingest adapters. The grammar has no single source of truth;
|
|
12
|
+
* until it gains one at the emission point, a change to anchor shape has to
|
|
13
|
+
* be mirrored here and at the three other parse sites.
|
|
8
14
|
*/
|
|
9
15
|
import { unified } from 'unified';
|
|
10
16
|
import remarkParse from 'remark-parse';
|
|
@@ -41,29 +47,108 @@ function headingAnchor(node) {
|
|
|
41
47
|
return undefined;
|
|
42
48
|
return text.slice(open + 2, -1);
|
|
43
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Anchors whose leading segment is emitted in one form but addressed in
|
|
52
|
+
* another. `include` speaks the plural.
|
|
53
|
+
*/
|
|
54
|
+
const ANCHOR_ALIASES = {
|
|
55
|
+
tab: 'tabs', // emitted singular, addressed plural
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Namespaces that *contain* a vocabulary rather than being one. `template` is
|
|
59
|
+
* the only such namespace: `{#template.<slug>.props}` is a props section that
|
|
60
|
+
* happens to be scoped to a template, so its vocabulary word sits after the
|
|
61
|
+
* slug. Every other anchor is keyed by its leading segment, so a child anchor
|
|
62
|
+
* such as `{#props.variant}` stays part of `props` instead of becoming a
|
|
63
|
+
* `variant` key no caller could guess.
|
|
64
|
+
*/
|
|
65
|
+
const CONTAINER_NAMESPACES = new Set(['template']);
|
|
66
|
+
/**
|
|
67
|
+
* Split an anchor into its vocabulary word and qualifier.
|
|
68
|
+
*
|
|
69
|
+
* `.props` → props · `template.tabsbar.props` → props/tabsbar ·
|
|
70
|
+
* `template.tabsbar` → template/tabsbar · `snippets.tabsbar.default` →
|
|
71
|
+
* snippets/tabsbar.default · `tab.overview` → tabs/overview ·
|
|
72
|
+
* `props.variant` → props/variant.
|
|
73
|
+
*/
|
|
74
|
+
function parseAnchor(anchor) {
|
|
75
|
+
const segments = anchor.split('.').filter(Boolean);
|
|
76
|
+
if (segments.length === 0)
|
|
77
|
+
return undefined;
|
|
78
|
+
const [head, ...rest] = segments;
|
|
79
|
+
const normalize = (segment) => ANCHOR_ALIASES[segment] ?? segment;
|
|
80
|
+
if (CONTAINER_NAMESPACES.has(head)) {
|
|
81
|
+
const [slug, ...tail] = rest;
|
|
82
|
+
// `template.<slug>` alone is the template's own body (heading + import).
|
|
83
|
+
return {
|
|
84
|
+
key: tail.length ? normalize(tail[0]) : head,
|
|
85
|
+
qualifier: slug ?? '',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return { key: normalize(head), qualifier: rest.join('.') };
|
|
89
|
+
}
|
|
44
90
|
/** Normalize an anchor (or heading text) to a section key. */
|
|
45
91
|
function sectionKey(node) {
|
|
46
92
|
const anchor = headingAnchor(node);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return head === 'tab' ? 'tabs' : head;
|
|
51
|
-
}
|
|
93
|
+
const parsed = anchor ? parseAnchor(anchor) : undefined;
|
|
94
|
+
if (parsed)
|
|
95
|
+
return parsed;
|
|
52
96
|
const text = node.children
|
|
53
97
|
.filter((c) => c.type === 'text')
|
|
54
98
|
.map((c) => c.value)
|
|
55
99
|
.join(' ');
|
|
56
|
-
return kebabCase(text) || 'untitled';
|
|
100
|
+
return { key: kebabCase(text) || 'untitled', qualifier: '' };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Does this heading start a section of its own?
|
|
104
|
+
*
|
|
105
|
+
* Depth ≤ 2 always does. Depth 3 does only when its anchor is *qualified* and
|
|
106
|
+
* resolves to a different vocabulary word than the section it sits in. That is
|
|
107
|
+
* a general rule, not a props special case: any qualified depth-3 anchor that
|
|
108
|
+
* changes vocabulary opens a section, so a multi-template `### <demo>
|
|
109
|
+
* {#snippets.<slug>.<demo>}` sitting inside `## <Template> {#template.<slug>}`
|
|
110
|
+
* splits out as `snippets` too, and slots would behave the same way.
|
|
111
|
+
*
|
|
112
|
+
* The motivating case is the multi-template `### Props
|
|
113
|
+
* {#template.<slug>.props}` shape, which would otherwise fold invisibly into
|
|
114
|
+
* the enclosing template body — but the condition is deliberately written as
|
|
115
|
+
* the general rule, because keying by vocabulary is what makes a section
|
|
116
|
+
* requestable at all.
|
|
117
|
+
*
|
|
118
|
+
* Everything else at depth 3 stays with its parent, where a caller expects to
|
|
119
|
+
* find it. Three ways that happens:
|
|
120
|
+
*
|
|
121
|
+
* - no anchor at all (a prose subhead)
|
|
122
|
+
* - an unqualified anchor (`{#accessibility-notes}`)
|
|
123
|
+
* - a qualified anchor resolving to the key it already sits under
|
|
124
|
+
* (`### <demo> {#snippets.default}` inside `## Snippets {#snippets}`, or
|
|
125
|
+
* `### variant {#props.variant}` inside `## Props {#.props}`)
|
|
126
|
+
*
|
|
127
|
+
* That last case is the subtle one: the anchor *is* qualified, so the test that
|
|
128
|
+
* matters is the key comparison, not the segment count.
|
|
129
|
+
*/
|
|
130
|
+
function opensSection(node, currentKey) {
|
|
131
|
+
if (node.depth <= 2)
|
|
132
|
+
return true;
|
|
133
|
+
if (node.depth > 3)
|
|
134
|
+
return false;
|
|
135
|
+
const anchor = headingAnchor(node);
|
|
136
|
+
if (!anchor)
|
|
137
|
+
return false;
|
|
138
|
+
const parsed = parseAnchor(anchor);
|
|
139
|
+
if (!parsed || !parsed.qualifier)
|
|
140
|
+
return false;
|
|
141
|
+
return parsed.key !== currentKey;
|
|
57
142
|
}
|
|
58
|
-
/** Group a body tree into anchored sections
|
|
143
|
+
/** Group a body tree into anchored sections. */
|
|
59
144
|
function sectionize(root) {
|
|
60
145
|
const sections = [];
|
|
61
146
|
let current = null;
|
|
62
147
|
for (const node of root.children) {
|
|
63
|
-
if (node.type === 'heading' && node
|
|
148
|
+
if (node.type === 'heading' && opensSection(node, current?.key)) {
|
|
64
149
|
if (current)
|
|
65
150
|
sections.push(current);
|
|
66
|
-
current = { key: sectionKey(node), nodes: [node] };
|
|
151
|
+
current = { key: sectionKey(node).key, nodes: [node] };
|
|
67
152
|
}
|
|
68
153
|
else if (current) {
|
|
69
154
|
current.nodes.push(node);
|
|
@@ -89,7 +174,9 @@ function omittedStub(keys) {
|
|
|
89
174
|
}
|
|
90
175
|
/**
|
|
91
176
|
* Serve an entity MDX document with only the requested sections, props
|
|
92
|
-
* first. `include` names sections by key;
|
|
177
|
+
* first. `include` names sections by key; every section carrying that key is
|
|
178
|
+
* served, so a multi-template component returns each template's props rather
|
|
179
|
+
* than the first match only. Absent `include` means `['props']`;
|
|
93
180
|
* `['all']` serves everything. Omitted section keys are enumerated at the
|
|
94
181
|
* end so a caller can request them. A body the parser cannot handle is
|
|
95
182
|
* served verbatim — fallback, never an error.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectSections.js","sourceRoot":"","sources":["../../src/mdx/selectSections.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"selectSections.js","sourceRoot":"","sources":["../../src/mdx/selectSections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,6EAA6E;AAC7E,wEAAwE;AACxE,6EAA6E;AAC7E,oCAAoC;AACpC,MAAM,SAAS,GAAG,OAAO,EAAE;KACxB,GAAG,CAAC,WAAW,CAAC;KAChB,GAAG,CAAC,SAAS,CAAC;KACd,GAAG,CAAC,eAAe,EAAE;IACpB,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,KAAK;IACrB,IAAI,EAAE,GAAG;IACT,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,GAAG;CACZ,CAAC,CAAC;AAEL,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAO/C,6EAA6E;AAC7E,SAAS,aAAa,CAAC,IAAa;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,SAAS,CAAC;IACpD,MAAM,IAAI,GAAI,IAAa,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAC5C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,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AAE,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,IAAI,OAAO,CAAC,MAAM;QAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IAExD,MAAM,GAAG,GAAS,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD,OAAO,GAAG,cAAc,GAAG,OAAO,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section selection over distro entity MDX.
|
|
3
|
+
*
|
|
4
|
+
* The cases that matter here are the two shapes the knapsack adapter emits
|
|
5
|
+
* for props (see extract-components.ts):
|
|
6
|
+
*
|
|
7
|
+
* - single-template: `## Props {#.props}` at depth 2
|
|
8
|
+
* - multi-template: `### Props {#template.<slug>.props}` at depth 3, one
|
|
9
|
+
* per template, nested under `## <Title> {#template.<slug>}`
|
|
10
|
+
*
|
|
11
|
+
* A multi-template component must serve *every* template's props for
|
|
12
|
+
* `include: ['props']` — serving only the first match looks correct and
|
|
13
|
+
* silently drops contracts.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=selectSections.vitest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectSections.vitest.d.ts","sourceRoot":"","sources":["../../src/mdx/selectSections.vitest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section selection over distro entity MDX.
|
|
3
|
+
*
|
|
4
|
+
* The cases that matter here are the two shapes the knapsack adapter emits
|
|
5
|
+
* for props (see extract-components.ts):
|
|
6
|
+
*
|
|
7
|
+
* - single-template: `## Props {#.props}` at depth 2
|
|
8
|
+
* - multi-template: `### Props {#template.<slug>.props}` at depth 3, one
|
|
9
|
+
* per template, nested under `## <Title> {#template.<slug>}`
|
|
10
|
+
*
|
|
11
|
+
* A multi-template component must serve *every* template's props for
|
|
12
|
+
* `include: ['props']` — serving only the first match looks correct and
|
|
13
|
+
* silently drops contracts.
|
|
14
|
+
*/
|
|
15
|
+
import { describe, it, expect } from 'vitest';
|
|
16
|
+
import { selectSections } from './selectSections.js';
|
|
17
|
+
/**
|
|
18
|
+
* `selectSections` preserves frontmatter verbatim, so each fixture carries its
|
|
19
|
+
* own title rather than sharing one. A Chiclet fixture claiming `title: Tabs`
|
|
20
|
+
* only makes a failure harder to read.
|
|
21
|
+
*/
|
|
22
|
+
function frontmatter(title) {
|
|
23
|
+
return `---
|
|
24
|
+
entityKind: COMPONENT
|
|
25
|
+
title: ${title}
|
|
26
|
+
platform: react
|
|
27
|
+
---
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
const TABS_FRONTMATTER = frontmatter('Tabs');
|
|
31
|
+
const CHICLET_FRONTMATTER = frontmatter('Chiclet');
|
|
32
|
+
const WIDGET_FRONTMATTER = frontmatter('Widget');
|
|
33
|
+
/**
|
|
34
|
+
* Two templates, each with a prop name unique to that template.
|
|
35
|
+
*
|
|
36
|
+
* The heading/anchor shape below is not invented — it mirrors what the ingest
|
|
37
|
+
* pipeline actually emits into a distro build, verified by the protocol
|
|
38
|
+
* evidence harness at
|
|
39
|
+
* `apps/mcp/mcp-remote-server/tests/protocol-evidence/` (build-distro.sh drives
|
|
40
|
+
* real source input through parse -> transform -> mount -> detect -> build and
|
|
41
|
+
* prints the emitted headings). Emission for a 2-template component:
|
|
42
|
+
*
|
|
43
|
+
* ## <TemplateTitle> {#template.<slug>}
|
|
44
|
+
* ### <DemoTitle> {#snippets.<slug>.<demoslug>} <- depth 3
|
|
45
|
+
* ### Props {#template.<slug>.props} <- depth 3
|
|
46
|
+
*
|
|
47
|
+
* Keep this fixture in step with that harness: a unit test asserting on a
|
|
48
|
+
* shape the pipeline never emits is worse than no unit test.
|
|
49
|
+
*/
|
|
50
|
+
const MULTI_TEMPLATE_MDX = `${TABS_FRONTMATTER}
|
|
51
|
+
# Tabs {#description}
|
|
52
|
+
|
|
53
|
+
Long usage prose lives here.
|
|
54
|
+
|
|
55
|
+
## Status {#status}
|
|
56
|
+
|
|
57
|
+
| Status Set | Value |
|
|
58
|
+
|------------|-------|
|
|
59
|
+
| Design | Ready |
|
|
60
|
+
|
|
61
|
+
## TabsBar {#template.tabsbar}
|
|
62
|
+
|
|
63
|
+
\`import { TabsBar } from '@acme/tabs'\`
|
|
64
|
+
|
|
65
|
+
### Default {#snippets.tabsbar.default}
|
|
66
|
+
|
|
67
|
+
| Prop | Value |
|
|
68
|
+
|------|-------|
|
|
69
|
+
| tabsBarOrientation | \`"horizontal"\` |
|
|
70
|
+
|
|
71
|
+
### Props {#template.tabsbar.props}
|
|
72
|
+
|
|
73
|
+
| Prop | Type | Required |
|
|
74
|
+
|------|------|----------|
|
|
75
|
+
| tabsBarOrientation | string | No |
|
|
76
|
+
|
|
77
|
+
## TabsLink {#template.tabslink}
|
|
78
|
+
|
|
79
|
+
\`import { TabsLink } from '@acme/tabs'\`
|
|
80
|
+
|
|
81
|
+
### Default {#snippets.tabslink.default}
|
|
82
|
+
|
|
83
|
+
| Prop | Value |
|
|
84
|
+
|------|-------|
|
|
85
|
+
| tabsLinkHref | \`"/home"\` |
|
|
86
|
+
|
|
87
|
+
### Props {#template.tabslink.props}
|
|
88
|
+
|
|
89
|
+
| Prop | Type | Required |
|
|
90
|
+
|------|------|----------|
|
|
91
|
+
| tabsLinkHref | string | Yes |
|
|
92
|
+
`;
|
|
93
|
+
/**
|
|
94
|
+
* The depth-2 shape that serves the majority of React docs today — also
|
|
95
|
+
* verified against real distro emission (`## Props {#.props}`, with snippets
|
|
96
|
+
* under `## Snippets {#snippets}` / `### <demo> {#snippets.<demoslug>}`).
|
|
97
|
+
*/
|
|
98
|
+
const SINGLE_TEMPLATE_MDX = `${CHICLET_FRONTMATTER}
|
|
99
|
+
# Chiclet {#description}
|
|
100
|
+
|
|
101
|
+
A compact product option tile.
|
|
102
|
+
|
|
103
|
+
## Status {#status}
|
|
104
|
+
|
|
105
|
+
| Status Set | Value |
|
|
106
|
+
|------------|-------|
|
|
107
|
+
| Design | Ready |
|
|
108
|
+
|
|
109
|
+
## Snippets {#snippets}
|
|
110
|
+
|
|
111
|
+
### Default {#snippets.default}
|
|
112
|
+
|
|
113
|
+
| Prop | Value |
|
|
114
|
+
|------|-------|
|
|
115
|
+
| variant | \`"medium"\` |
|
|
116
|
+
|
|
117
|
+
## Props {#.props}
|
|
118
|
+
|
|
119
|
+
| Prop | Type | Required |
|
|
120
|
+
|------|------|----------|
|
|
121
|
+
| chicletVariant | string | No |
|
|
122
|
+
|
|
123
|
+
## Slots {#.slots}
|
|
124
|
+
|
|
125
|
+
| Slot | Title |
|
|
126
|
+
|------|-------|
|
|
127
|
+
| children | Children |
|
|
128
|
+
`;
|
|
129
|
+
describe('selectSections — multi-template (depth-3) props', () => {
|
|
130
|
+
it('serves props from EVERY template, not just the first match', () => {
|
|
131
|
+
const out = selectSections({
|
|
132
|
+
content: MULTI_TEMPLATE_MDX,
|
|
133
|
+
include: ['props'],
|
|
134
|
+
});
|
|
135
|
+
expect(out).toContain('tabsBarOrientation');
|
|
136
|
+
expect(out).toContain('tabsLinkHref');
|
|
137
|
+
// Both props tables, each still carrying its template-qualified anchor.
|
|
138
|
+
expect(out).toContain('{#template.tabsbar.props}');
|
|
139
|
+
expect(out).toContain('{#template.tabslink.props}');
|
|
140
|
+
});
|
|
141
|
+
it('serves props by default (no include) for a multi-template component', () => {
|
|
142
|
+
const out = selectSections({ content: MULTI_TEMPLATE_MDX });
|
|
143
|
+
expect(out).toContain('tabsBarOrientation');
|
|
144
|
+
expect(out).toContain('tabsLinkHref');
|
|
145
|
+
expect(out).not.toContain('Long usage prose');
|
|
146
|
+
});
|
|
147
|
+
it('enumerates props in the section vocabulary instead of hiding it', () => {
|
|
148
|
+
const out = selectSections({
|
|
149
|
+
content: MULTI_TEMPLATE_MDX,
|
|
150
|
+
include: ['status'],
|
|
151
|
+
});
|
|
152
|
+
expect(out).toMatch(/omitted sections/i);
|
|
153
|
+
const stub = /Omitted sections \(request via include\): (.+)\./.exec(out);
|
|
154
|
+
expect(stub).not.toBeNull();
|
|
155
|
+
const keys = stub[1].split(', ');
|
|
156
|
+
expect(keys).toContain('props');
|
|
157
|
+
expect(keys).toContain('template');
|
|
158
|
+
expect(keys).toContain('description');
|
|
159
|
+
});
|
|
160
|
+
it('keeps template body (import line) reachable under the template key', () => {
|
|
161
|
+
const out = selectSections({
|
|
162
|
+
content: MULTI_TEMPLATE_MDX,
|
|
163
|
+
include: ['template'],
|
|
164
|
+
});
|
|
165
|
+
expect(out).toContain("import { TabsBar } from '@acme/tabs'");
|
|
166
|
+
expect(out).toContain("import { TabsLink } from '@acme/tabs'");
|
|
167
|
+
// The nested props/snippets are their own sections now, not template body.
|
|
168
|
+
expect(out).not.toContain('tabsLinkHref');
|
|
169
|
+
});
|
|
170
|
+
it('groups multi-template snippets under the snippets key', () => {
|
|
171
|
+
const out = selectSections({
|
|
172
|
+
content: MULTI_TEMPLATE_MDX,
|
|
173
|
+
include: ['snippets'],
|
|
174
|
+
});
|
|
175
|
+
expect(out).toContain('{#snippets.tabsbar.default}');
|
|
176
|
+
});
|
|
177
|
+
it('include ["all"] serves everything with props first', () => {
|
|
178
|
+
const out = selectSections({
|
|
179
|
+
content: MULTI_TEMPLATE_MDX,
|
|
180
|
+
include: ['all'],
|
|
181
|
+
});
|
|
182
|
+
expect(out).toContain('Long usage prose');
|
|
183
|
+
expect(out).toContain('tabsBarOrientation');
|
|
184
|
+
expect(out).toContain('tabsLinkHref');
|
|
185
|
+
expect(out.indexOf('{#template.tabsbar.props}')).toBeLessThan(out.indexOf('# Tabs {#description}'));
|
|
186
|
+
expect(out).not.toMatch(/omitted sections/i);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
describe('selectSections — single-template (depth-2) regression', () => {
|
|
190
|
+
it('still selects depth-2 props by default', () => {
|
|
191
|
+
const out = selectSections({ content: SINGLE_TEMPLATE_MDX });
|
|
192
|
+
expect(out).toContain('chicletVariant');
|
|
193
|
+
expect(out).toContain('## Props {#.props}');
|
|
194
|
+
expect(out).not.toContain('A compact product option tile');
|
|
195
|
+
expect(out).not.toContain('## Slots');
|
|
196
|
+
});
|
|
197
|
+
it('keeps anchored depth-3 snippet children inside the snippets section', () => {
|
|
198
|
+
const out = selectSections({
|
|
199
|
+
content: SINGLE_TEMPLATE_MDX,
|
|
200
|
+
include: ['snippets'],
|
|
201
|
+
});
|
|
202
|
+
expect(out).toContain('## Snippets {#snippets}');
|
|
203
|
+
expect(out).toContain('### Default {#snippets.default}');
|
|
204
|
+
expect(out).toContain('variant');
|
|
205
|
+
});
|
|
206
|
+
it('keeps slots addressable', () => {
|
|
207
|
+
const out = selectSections({
|
|
208
|
+
content: SINGLE_TEMPLATE_MDX,
|
|
209
|
+
include: ['slots'],
|
|
210
|
+
});
|
|
211
|
+
expect(out).toContain('| children | Children |');
|
|
212
|
+
});
|
|
213
|
+
it('preserves frontmatter verbatim', () => {
|
|
214
|
+
const out = selectSections({ content: SINGLE_TEMPLATE_MDX });
|
|
215
|
+
expect(out.startsWith(CHICLET_FRONTMATTER)).toBe(true);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
describe('selectSections — anchor grammar edge cases', () => {
|
|
219
|
+
it('normalizes tab.* anchors to the tabs key', () => {
|
|
220
|
+
const content = `${TABS_FRONTMATTER}
|
|
221
|
+
# Tabs {#description}
|
|
222
|
+
|
|
223
|
+
## Overview {#tab.overview}
|
|
224
|
+
|
|
225
|
+
Overview prose.
|
|
226
|
+
|
|
227
|
+
## Figma {#tab.figma}
|
|
228
|
+
|
|
229
|
+
Figma prose.
|
|
230
|
+
`;
|
|
231
|
+
const out = selectSections({ content, include: ['tabs'] });
|
|
232
|
+
expect(out).toContain('Overview prose');
|
|
233
|
+
expect(out).toContain('Figma prose');
|
|
234
|
+
});
|
|
235
|
+
it('does not split at an unqualified depth-3 anchor', () => {
|
|
236
|
+
const content = `${WIDGET_FRONTMATTER}
|
|
237
|
+
# Widget {#description}
|
|
238
|
+
|
|
239
|
+
## Overview {#tab.overview}
|
|
240
|
+
|
|
241
|
+
### Accessibility {#accessibility-notes}
|
|
242
|
+
|
|
243
|
+
Nested prose.
|
|
244
|
+
`;
|
|
245
|
+
const out = selectSections({ content, include: ['tabs'] });
|
|
246
|
+
expect(out).toContain('Nested prose');
|
|
247
|
+
});
|
|
248
|
+
it('does not split at an unanchored depth-3 heading', () => {
|
|
249
|
+
const content = `${WIDGET_FRONTMATTER}
|
|
250
|
+
# Widget {#description}
|
|
251
|
+
|
|
252
|
+
## Overview {#tab.overview}
|
|
253
|
+
|
|
254
|
+
### Plain Subhead
|
|
255
|
+
|
|
256
|
+
Nested prose.
|
|
257
|
+
`;
|
|
258
|
+
const out = selectSections({ content, include: ['tabs'] });
|
|
259
|
+
expect(out).toContain('Nested prose');
|
|
260
|
+
});
|
|
261
|
+
it('keeps a qualified child anchor inside its parent vocabulary', () => {
|
|
262
|
+
// `{#props.variant}` is a child *of* props, not a `variant` vocabulary of
|
|
263
|
+
// its own — splitting here would strand the prop details behind a key no
|
|
264
|
+
// caller could guess, and leave `include: ['props']` serving a bare heading.
|
|
265
|
+
const content = `${WIDGET_FRONTMATTER}
|
|
266
|
+
# Widget {#description}
|
|
267
|
+
|
|
268
|
+
## Props {#.props}
|
|
269
|
+
|
|
270
|
+
| Prop | Type |
|
|
271
|
+
| ---- | ---- |
|
|
272
|
+
| variant | string |
|
|
273
|
+
|
|
274
|
+
### variant {#props.variant}
|
|
275
|
+
|
|
276
|
+
Controls the visual treatment.
|
|
277
|
+
`;
|
|
278
|
+
const out = selectSections({ content, include: ['props'] });
|
|
279
|
+
expect(out).toContain('Controls the visual treatment');
|
|
280
|
+
expect(out).toContain('| variant | string |');
|
|
281
|
+
expect(out).not.toMatch(/Omitted sections[^\n]*variant/);
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
//# sourceMappingURL=selectSections.vitest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectSections.vitest.js","sourceRoot":"","sources":["../../src/mdx/selectSections.vitest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;GAIG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO;;SAEA,KAAK;;;CAGb,CAAC;AACF,CAAC;AAED,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAC7C,MAAM,mBAAmB,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AACnD,MAAM,kBAAkB,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,kBAAkB,GAAG,GAAG,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C7C,CAAC;AAEF;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,GAAG,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BjD,CAAC;AAEF,QAAQ,CAAC,iDAAiD,EAAE,GAAG,EAAE;IAC/D,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACpE,MAAM,GAAG,GAAG,cAAc,CAAC;YACzB,OAAO,EAAE,kBAAkB;YAC3B,OAA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C;QACE,MAAM,GAAG,GAAG,cAAc,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC3D,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,0EAA0E;QAC1E,yEAAyE;QACzE,6EAA6E;QAC7E,MAAM,OAAO,GAAG,GAAG,kBAAkB;;;;;;;;;;;;CAYxC,CAAC;QACE,MAAM,GAAG,GAAG,cAAc,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5D,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;QACvD,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;QAC9C,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knapsack/source-conflicts-adapter",
|
|
3
3
|
"description": "Source conflicts ContextSrcAdapter — detect and compare entity conflicts across sources.",
|
|
4
|
-
"version": "4.101.5
|
|
4
|
+
"version": "4.101.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"author": "Knapsack (https://www.knapsack.cloud)",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@knapsack/adapter-core": "4.101.5
|
|
27
|
-
"@knapsack/utils": "4.101.5
|
|
26
|
+
"@knapsack/adapter-core": "4.101.5",
|
|
27
|
+
"@knapsack/utils": "4.101.5",
|
|
28
28
|
"diff": "^8.0.3",
|
|
29
29
|
"fast-json-stable-stringify": "^2.1.0",
|
|
30
30
|
"gray-matter": "^4.0.3",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"yaml": "^2.8.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@knapsack/eslint-config-starter": "4.101.5
|
|
44
|
-
"@knapsack/typescript-config-starter": "4.101.5
|
|
43
|
+
"@knapsack/eslint-config-starter": "4.101.5",
|
|
44
|
+
"@knapsack/typescript-config-starter": "4.101.5",
|
|
45
45
|
"@types/mdast": "^4.0.4",
|
|
46
46
|
"@types/node": "^24.13.2",
|
|
47
47
|
"eslint": "^9.20.0",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"directory": "libs/ingest-pipeline/adapters/source-conflicts",
|
|
58
58
|
"type": "git"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "0aa1dc9c6437508dccd40ffefff78037209c9160"
|
|
61
61
|
}
|