code-auditor-mcp 3.4.10 → 3.4.12
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/.claude-plugin/marketplace.json +10 -3
- package/CHANGELOG.md +141 -1
- package/dist/analyzers/documentationAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/documentationAnalyzer.js +11 -59
- package/dist/analyzers/documentationAnalyzer.js.map +1 -1
- package/dist/analyzers/invariantsAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/invariantsAnalyzer.js +10 -3
- package/dist/analyzers/invariantsAnalyzer.js.map +1 -1
- package/dist/analyzers/provenance.d.ts +10 -0
- package/dist/analyzers/provenance.d.ts.map +1 -1
- package/dist/analyzers/provenance.js +41 -11
- package/dist/analyzers/provenance.js.map +1 -1
- package/dist/analyzers/ruleRegistry.d.ts +8 -0
- package/dist/analyzers/ruleRegistry.d.ts.map +1 -1
- package/dist/analyzers/ruleRegistry.js +28 -5
- package/dist/analyzers/ruleRegistry.js.map +1 -1
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.js +9 -7
- package/dist/analyzers/universal/UniversalConventionsAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.d.ts +85 -0
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.js +422 -2
- package/dist/analyzers/universal/UniversalDataAccessAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalSchemaAnalyzer.d.ts +2 -0
- package/dist/analyzers/universal/UniversalSchemaAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalSchemaAnalyzer.js +3 -0
- package/dist/analyzers/universal/UniversalSchemaAnalyzer.js.map +1 -1
- package/dist/analyzers/universal/UniversalStylesAnalyzer.d.ts.map +1 -1
- package/dist/analyzers/universal/UniversalStylesAnalyzer.js +9 -1
- package/dist/analyzers/universal/UniversalStylesAnalyzer.js.map +1 -1
- package/dist/auditRunner.d.ts.map +1 -1
- package/dist/auditRunner.js +30 -30
- package/dist/auditRunner.js.map +1 -1
- package/dist/cli.js +33 -0
- package/dist/cli.js.map +1 -1
- package/dist/conventions/conventionMiner.d.ts +5 -4
- package/dist/conventions/conventionMiner.d.ts.map +1 -1
- package/dist/conventions/conventionMiner.js +37 -17
- package/dist/conventions/conventionMiner.js.map +1 -1
- package/dist/grammars/tree-sitter-scss.wasm +0 -0
- package/dist/invariants/ruleEngine.d.ts +23 -0
- package/dist/invariants/ruleEngine.d.ts.map +1 -1
- package/dist/invariants/ruleEngine.js +11 -115
- package/dist/invariants/ruleEngine.js.map +1 -1
- package/dist/languages/tree-sitter/TreeSitterCssAdapter.d.ts +5 -5
- package/dist/languages/tree-sitter/TreeSitterCssAdapter.d.ts.map +1 -1
- package/dist/languages/tree-sitter/TreeSitterCssAdapter.js +11 -9
- package/dist/languages/tree-sitter/TreeSitterCssAdapter.js.map +1 -1
- package/dist/languages/tree-sitter/parser.d.ts.map +1 -1
- package/dist/languages/tree-sitter/parser.js +2 -0
- package/dist/languages/tree-sitter/parser.js.map +1 -1
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.d.ts +13 -0
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.d.ts.map +1 -1
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.js +242 -24
- package/dist/languages/typescript/TreeSitterTypeScriptAdapter.js.map +1 -1
- package/dist/mcp-tools/whitelistTools.d.ts +1 -1
- package/dist/mcp-tools-shared.d.ts.map +1 -1
- package/dist/mcp-tools-shared.js +1 -0
- package/dist/mcp-tools-shared.js.map +1 -1
- package/dist/mcpAuditJobs.d.ts.map +1 -1
- package/dist/mcpAuditJobs.js +1 -0
- package/dist/mcpAuditJobs.js.map +1 -1
- package/dist/pipeline.d.ts +22 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +157 -14
- package/dist/pipeline.js.map +1 -1
- package/dist/pipelineAdapters.d.ts +10 -0
- package/dist/pipelineAdapters.d.ts.map +1 -1
- package/dist/pipelineAdapters.js +277 -48
- package/dist/pipelineAdapters.js.map +1 -1
- package/dist/styles/cssAstExtractor.d.ts +61 -0
- package/dist/styles/cssAstExtractor.d.ts.map +1 -0
- package/dist/styles/cssAstExtractor.js +617 -0
- package/dist/styles/cssAstExtractor.js.map +1 -0
- package/dist/styles/styleExtractor.d.ts +2 -2
- package/dist/styles/styleExtractor.d.ts.map +1 -1
- package/dist/styles/styleExtractor.js +69 -16
- package/dist/styles/styleExtractor.js.map +1 -1
- package/dist/styles/styleIndexer.d.ts.map +1 -1
- package/dist/styles/styleIndexer.js +4 -0
- package/dist/styles/styleIndexer.js.map +1 -1
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +3 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS/SCSS AST Extractor — Spec 26 Phase 2.
|
|
3
|
+
*
|
|
4
|
+
* Replaces regex-based CSS/SCSS parsing (styleExtractor.ts) with
|
|
5
|
+
* AST-based extraction using tree-sitter-css and tree-sitter-scss parsed structures.
|
|
6
|
+
*
|
|
7
|
+
* Three pure functions mirror the output of the regex extractors:
|
|
8
|
+
* 1. extractDeclarationsFromCSSAst — NormalizedDeclaration[]
|
|
9
|
+
* 2. extractTokensFromCSSAst — StyleToken[]
|
|
10
|
+
* 3. extractClassUsageFromCSSAst — StyleClassUsage[]
|
|
11
|
+
*
|
|
12
|
+
* SCSS files are handled via tree-sitter-scss grammar which extends the CSS
|
|
13
|
+
* grammar. SCSS-specific node types (nesting_selector, _concatenated_identifier,
|
|
14
|
+
* variable, mixin_statement, include_statement) are present in the AST and
|
|
15
|
+
* filtered appropriately by each extraction function.
|
|
16
|
+
*/
|
|
17
|
+
import { normalizeValue, expandShorthand } from './normalizer.js';
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Helpers
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
/**
|
|
22
|
+
* Extract a CSS custom property reference from a value like `var(--token)`.
|
|
23
|
+
* Token-level classification (not structure discovery) — the regex reads a
|
|
24
|
+
* known token name from a single value string.
|
|
25
|
+
*/
|
|
26
|
+
function extractTokenRef(rawValue) {
|
|
27
|
+
const match = rawValue.match(/var\(\s*(--[a-zA-Z0-9_-]+)/);
|
|
28
|
+
return match ? match[1] : null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the text content of a selectors node, stripping block comments.
|
|
32
|
+
* Bug 5 fix: CSS comments are not treated as class names (tree-sitter types
|
|
33
|
+
* comment nodes explicitly, so we filter by type).
|
|
34
|
+
*/
|
|
35
|
+
function getSelectorText(selectorsNode, sourceCode) {
|
|
36
|
+
const raw = sourceCode.slice(selectorsNode.range[0], selectorsNode.range[1]);
|
|
37
|
+
// Strip block comments — token-level text munging on AST-discovered content
|
|
38
|
+
return raw.replace(/\/\*[\s\S]*?\*\//g, '').trim();
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* CSS at-rule node types in tree-sitter-css.
|
|
42
|
+
*
|
|
43
|
+
* tree-sitter-css uses distinct named types for some at-rules (media_statement,
|
|
44
|
+
* supports_statement, keyframes_statement) and generic `at_rule` for everything
|
|
45
|
+
* else (@layer, @import, @apply, etc.).
|
|
46
|
+
*/
|
|
47
|
+
const AT_RULE_TYPES = new Set([
|
|
48
|
+
'at_rule',
|
|
49
|
+
'media_statement',
|
|
50
|
+
'supports_statement',
|
|
51
|
+
'keyframes_statement',
|
|
52
|
+
]);
|
|
53
|
+
/**
|
|
54
|
+
* Walk ancestor chain for at-rule nodes and build variant context string.
|
|
55
|
+
*/
|
|
56
|
+
function getVariantContext(node, adapter, sourceCode) {
|
|
57
|
+
const atRules = [];
|
|
58
|
+
let current = adapter.getParent(node);
|
|
59
|
+
while (current) {
|
|
60
|
+
if (AT_RULE_TYPES.has(current.type)) {
|
|
61
|
+
const text = sourceCode.slice(current.range[0], current.range[1]);
|
|
62
|
+
const braceIdx = text.indexOf('{');
|
|
63
|
+
const atRuleText = braceIdx !== -1 ? text.slice(0, braceIdx).trim() : text.trim();
|
|
64
|
+
atRules.unshift(atRuleText);
|
|
65
|
+
}
|
|
66
|
+
current = adapter.getParent(current);
|
|
67
|
+
}
|
|
68
|
+
return atRules.length > 0 ? atRules.join(', ') : null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Extract @apply directives inside a rule_set block.
|
|
72
|
+
*
|
|
73
|
+
* @apply is a Tailwind extension, not standard CSS. tree-sitter-css may emit
|
|
74
|
+
* either ERROR nodes (when the grammar can't make sense of the token),
|
|
75
|
+
* postcss_statement nodes (when the grammar recognizes it as a PostCSS-style
|
|
76
|
+
* at-rule inside a rule set), or at_rule nodes (when parsed structurally as an
|
|
77
|
+
* at-rule with @apply keyword). All three paths produce the same
|
|
78
|
+
* NormalizedDeclaration shape.
|
|
79
|
+
*
|
|
80
|
+
* Bug 2: @apply in rule sets — both `@layer`-wrapped and bare. The old regex
|
|
81
|
+
* parser handled @apply in block text; AST requires explicit child-traversal.
|
|
82
|
+
*/
|
|
83
|
+
function extractApplyDirectives(blockNode, sourceCode, selector, variantContext, filePath, declarations) {
|
|
84
|
+
for (const child of blockNode.children ?? []) {
|
|
85
|
+
let applyText = null;
|
|
86
|
+
let line;
|
|
87
|
+
if (child.type === 'ERROR') {
|
|
88
|
+
// Legacy path: @apply unrecognised by grammar → ERROR node.
|
|
89
|
+
const errText = sourceCode.slice(child.range[0], child.range[1]).trim();
|
|
90
|
+
const match = errText.match(/^@apply\s+(.+)$/);
|
|
91
|
+
applyText = match ? match[1].trim() : null;
|
|
92
|
+
line = child.location.start.line;
|
|
93
|
+
}
|
|
94
|
+
else if (child.type === 'postcss_statement') {
|
|
95
|
+
// Modern path: tree-sitter-css recognises @apply as a PostCSS statement.
|
|
96
|
+
// The full text is "@apply <utilities>;". Strip the keyword and semicolon.
|
|
97
|
+
const fullText = sourceCode.slice(child.range[0], child.range[1]).trim();
|
|
98
|
+
applyText = fullText.replace(/^@apply\s+/, '').replace(/;?\s*$/, '');
|
|
99
|
+
line = child.location.start.line;
|
|
100
|
+
}
|
|
101
|
+
else if (child.type === 'at_rule') {
|
|
102
|
+
// tree-sitter-css v0.x: @apply parsed as at_rule with at_keyword child.
|
|
103
|
+
const atKeyword = child.children?.find(c => c.type === 'at_keyword');
|
|
104
|
+
if (!atKeyword)
|
|
105
|
+
continue;
|
|
106
|
+
const kwText = sourceCode
|
|
107
|
+
.slice(atKeyword.range[0], atKeyword.range[1])
|
|
108
|
+
.trim();
|
|
109
|
+
if (kwText !== '@apply')
|
|
110
|
+
continue;
|
|
111
|
+
// The keyword_query child holds the utility names.
|
|
112
|
+
const queryChild = child.children?.find(c => c.type === 'keyword_query');
|
|
113
|
+
applyText = queryChild
|
|
114
|
+
? sourceCode.slice(queryChild.range[0], queryChild.range[1]).trim()
|
|
115
|
+
: null;
|
|
116
|
+
line = child.location.start.line;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (applyText && applyText.length > 0 && !applyText.includes('{')) {
|
|
122
|
+
declarations.push({
|
|
123
|
+
property: 'apply',
|
|
124
|
+
rawValue: applyText,
|
|
125
|
+
normalizedValue: { type: 'literal', value: applyText },
|
|
126
|
+
mechanism: 'css',
|
|
127
|
+
filePath,
|
|
128
|
+
line,
|
|
129
|
+
context: selector,
|
|
130
|
+
variantContext,
|
|
131
|
+
tokenRef: null,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// ---------------------------------------------------------------------------
|
|
137
|
+
// Tree-Sitter CSS Node Helpers
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
/**
|
|
140
|
+
* tree-sitter-css does NOT use field names (childForFieldName). Children are
|
|
141
|
+
* discovered by type via namedChild iteration on the raw TreeSitterNode.
|
|
142
|
+
* This grammar is distinct from the tree-sitter-typescript one.
|
|
143
|
+
*/
|
|
144
|
+
/**
|
|
145
|
+
* Find the first named child of a TreeSitterNode with the given type.
|
|
146
|
+
*/
|
|
147
|
+
function findNamedChild(node, type) {
|
|
148
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
149
|
+
const child = node.namedChild(i);
|
|
150
|
+
if (child?.type === type)
|
|
151
|
+
return child;
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Get property and raw value from a declaration's raw TreeSitterNode.
|
|
157
|
+
* tree-sitter-css uses `property_name` for the property and various typed
|
|
158
|
+
* children for the value (color_value, integer_value, plain_value,
|
|
159
|
+
* call_expression, etc.). We extract the property from the property_name
|
|
160
|
+
* child and the raw value from the full declaration text after the colon.
|
|
161
|
+
*/
|
|
162
|
+
function getPropertyAndValue(declRaw) {
|
|
163
|
+
const propNode = findNamedChild(declRaw, 'property_name');
|
|
164
|
+
if (!propNode)
|
|
165
|
+
return null;
|
|
166
|
+
const property = propNode.text.trim();
|
|
167
|
+
if (!property)
|
|
168
|
+
return null;
|
|
169
|
+
// Extract raw value from the full declaration text after the property + colon
|
|
170
|
+
const fullText = declRaw.text;
|
|
171
|
+
// Find the colon that separates property from value.
|
|
172
|
+
// Use indexOf on the full text — the property_name child's text tells us
|
|
173
|
+
// where the property ends, but the colon might be outside the child span
|
|
174
|
+
// (tree-sitter may or may not include it in property_name).
|
|
175
|
+
// Safe approach: scan from after the property_name child's end offset.
|
|
176
|
+
const propEndInDecl = propNode.endIndex - declRaw.startIndex;
|
|
177
|
+
const afterProp = fullText.slice(propEndInDecl);
|
|
178
|
+
const colonIdx = afterProp.indexOf(':');
|
|
179
|
+
const rawValue = colonIdx !== -1 ? afterProp.slice(colonIdx + 1).replace(/;\s*$/, '').trim() : '';
|
|
180
|
+
return { property, rawValue };
|
|
181
|
+
}
|
|
182
|
+
// ---------------------------------------------------------------------------
|
|
183
|
+
// AST Extraction Helpers
|
|
184
|
+
// ---------------------------------------------------------------------------
|
|
185
|
+
/**
|
|
186
|
+
* Create a synthetic AST from a subtree node for use with findNodes.
|
|
187
|
+
* findNodes needs an AST object, but we find nodes within subtrees.
|
|
188
|
+
*/
|
|
189
|
+
function subtreeAST(ast, root) {
|
|
190
|
+
return { root, language: ast.language, filePath: ast.filePath, errors: [] };
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Wrap a TreeSitterNode as an ASTNode for use with adapter methods that
|
|
194
|
+
* expect ASTNode input.
|
|
195
|
+
*/
|
|
196
|
+
function wrapAsASTNode(raw) {
|
|
197
|
+
return {
|
|
198
|
+
type: raw.type,
|
|
199
|
+
range: [raw.startIndex, raw.endIndex],
|
|
200
|
+
location: {
|
|
201
|
+
start: {
|
|
202
|
+
line: raw.startPosition.row + 1,
|
|
203
|
+
column: raw.startPosition.column + 1,
|
|
204
|
+
},
|
|
205
|
+
end: {
|
|
206
|
+
line: raw.endPosition.row + 1,
|
|
207
|
+
column: raw.endPosition.column + 1,
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
children: raw.namedChildren.map((c) => wrapAsASTNode(c)),
|
|
211
|
+
raw,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
// ---------------------------------------------------------------------------
|
|
215
|
+
// SCSS & Nesting Resolution
|
|
216
|
+
// ---------------------------------------------------------------------------
|
|
217
|
+
/**
|
|
218
|
+
* Unresolved nesting count — accumulated during extraction so callers can
|
|
219
|
+
* report how many `&`-involved selectors could not be resolved.
|
|
220
|
+
*/
|
|
221
|
+
export let unresolvedNestingCount = 0;
|
|
222
|
+
/** Reset the global unresolved-nesting counter. Call before extraction. */
|
|
223
|
+
export function resetUnresolvedNestingCount() {
|
|
224
|
+
unresolvedNestingCount = 0;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Walk up from a class_selector to find the nearest *outer* rule_set
|
|
228
|
+
* (skipping past the rule_set that directly contains this class_selector),
|
|
229
|
+
* then resolve its class name (handling nested & recursively).
|
|
230
|
+
*
|
|
231
|
+
* Uses raw TreeSitterNode.parent to walk up the parse tree, which works
|
|
232
|
+
* for both adapter-discovered nodes and wrapAsASTNode-created synthetic nodes.
|
|
233
|
+
*
|
|
234
|
+
* Returns null when the class_selector has no resolvable parent (e.g. it is at
|
|
235
|
+
* the top level, or the parent is another &-pattern that itself cannot resolve).
|
|
236
|
+
*/
|
|
237
|
+
function getParentClassName(classSelectorNode) {
|
|
238
|
+
let raw = classSelectorNode.raw;
|
|
239
|
+
// Step 1: walk up to find the containing (inner) rule_set
|
|
240
|
+
while (raw && raw.type !== 'rule_set') {
|
|
241
|
+
raw = raw.parent;
|
|
242
|
+
}
|
|
243
|
+
if (!raw || raw.type !== 'rule_set')
|
|
244
|
+
return null;
|
|
245
|
+
// Step 2: walk up FROM the inner rule_set to find the OUTER rule_set
|
|
246
|
+
raw = raw.parent; // block of outer rule_set, or stylesheet
|
|
247
|
+
while (raw && raw.type !== 'rule_set') {
|
|
248
|
+
raw = raw.parent;
|
|
249
|
+
}
|
|
250
|
+
if (!raw || raw.type !== 'rule_set')
|
|
251
|
+
return null;
|
|
252
|
+
// Step 3: find selectors → class_selector of outer rule_set
|
|
253
|
+
const selectorsRaw = findNamedChild(raw, 'selectors');
|
|
254
|
+
if (!selectorsRaw)
|
|
255
|
+
return null;
|
|
256
|
+
const parentCSRaw = findNamedChild(selectorsRaw, 'class_selector');
|
|
257
|
+
if (!parentCSRaw)
|
|
258
|
+
return null;
|
|
259
|
+
// Check if parent class_selector also has nesting (multi-level BEM)
|
|
260
|
+
const hasParentNesting = parentCSRaw.namedChildren.some((c) => c.type === 'nesting_selector');
|
|
261
|
+
if (hasParentNesting) {
|
|
262
|
+
const parentAST = wrapAsASTNode(parentCSRaw);
|
|
263
|
+
const resolved = resolveNestingSelector(parentAST);
|
|
264
|
+
if (resolved !== null && resolved.resolvable) {
|
|
265
|
+
return resolved.className;
|
|
266
|
+
}
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
// Plain class_selector: grab the class_name text
|
|
270
|
+
const parentCN = findNamedChild(parentCSRaw, 'class_name');
|
|
271
|
+
return parentCN ? parentCN.text : null;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Resolve a class_selector node that contains a nesting_selector (&).
|
|
275
|
+
*
|
|
276
|
+
* Returns:
|
|
277
|
+
* - { className: 'form-group-header', resolvable: true } for &-suffix / &__element / &--modifier
|
|
278
|
+
* - { className: 'selected', resolvable: false } for &.modifier (chained class)
|
|
279
|
+
* - { className: 'child', resolvable: false } for & .descendant
|
|
280
|
+
* - null when no nesting_selector is present
|
|
281
|
+
*
|
|
282
|
+
* BEM conventions handled (no-separator concatenation):
|
|
283
|
+
* - &-suffix → parent + -suffix (block modifier)
|
|
284
|
+
* - &__element → parent + __element (BEM element)
|
|
285
|
+
* - &--modifier → parent + --modifier (BEM modifier)
|
|
286
|
+
*
|
|
287
|
+
* Patterns dropped as unresolvable:
|
|
288
|
+
* - &.modifier — chained class, can't register as standalone defined class
|
|
289
|
+
* - & .descendant — descendant combinator
|
|
290
|
+
*/
|
|
291
|
+
function resolveNestingSelector(classSelectorNode) {
|
|
292
|
+
const children = classSelectorNode.children ?? [];
|
|
293
|
+
const hasNesting = children.some(c => c.type === 'nesting_selector');
|
|
294
|
+
if (!hasNesting)
|
|
295
|
+
return null;
|
|
296
|
+
// Find siblings of nesting_selector
|
|
297
|
+
const classNames = children.filter(c => c.type === 'class_name');
|
|
298
|
+
const nestedClassSelectors = children.filter(c => c.type === 'class_selector');
|
|
299
|
+
// Case 1: &-suffix or &__element or &--modifier or &.modifier
|
|
300
|
+
for (const cn of classNames) {
|
|
301
|
+
const raw = cn.raw.text;
|
|
302
|
+
// BEM no-separator concatenation: &-suffix, &__element, &--modifier
|
|
303
|
+
if (raw.startsWith('-') || raw.startsWith('_')) {
|
|
304
|
+
const parentName = getParentClassName(classSelectorNode);
|
|
305
|
+
if (parentName) {
|
|
306
|
+
return { className: parentName + raw, resolvable: true };
|
|
307
|
+
}
|
|
308
|
+
// Parent not resolvable — drop and count
|
|
309
|
+
unresolvedNestingCount++;
|
|
310
|
+
return { className: raw, resolvable: false };
|
|
311
|
+
}
|
|
312
|
+
// &.modifier — chained class, not a standalone definition
|
|
313
|
+
// The class name alone (e.g. "selected") is a valid class but we can't
|
|
314
|
+
// register it as defined just because `.parent.selected` exists.
|
|
315
|
+
if (raw.length > 0) {
|
|
316
|
+
unresolvedNestingCount++;
|
|
317
|
+
return { className: raw, resolvable: false };
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
// Case 2: & .descendant — descendant combinator
|
|
321
|
+
for (const nestedCS of nestedClassSelectors) {
|
|
322
|
+
const innerCN = nestedCS.children?.find(c => c.type === 'class_name');
|
|
323
|
+
if (innerCN) {
|
|
324
|
+
const raw = innerCN.raw.text;
|
|
325
|
+
unresolvedNestingCount++;
|
|
326
|
+
return { className: raw, resolvable: false };
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
// Unknown nesting pattern — drop and count
|
|
330
|
+
unresolvedNestingCount++;
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Resolve `&` nesting in selector context text.
|
|
335
|
+
*
|
|
336
|
+
* When a rule_set's selectors contain nesting_selector patterns (SCSS),
|
|
337
|
+
* replace raw &-suffix text with the resolved parent class concatenation.
|
|
338
|
+
* This ensures declaration context strings are meaningful.
|
|
339
|
+
*
|
|
340
|
+
* e.g. "&-header" inside ".form-group" → "form-group-header"
|
|
341
|
+
* "&.selected" inside ".btn" stays "&.selected" (unresolvable chained class)
|
|
342
|
+
*/
|
|
343
|
+
function resolveSelectorContext(selectorsNode, rawText) {
|
|
344
|
+
const classSelectors = selectorsNode.children?.filter(c => c.type === 'class_selector') ?? [];
|
|
345
|
+
const hasNesting = classSelectors.some(cs => (cs.children ?? []).some(cc => cc.type === 'nesting_selector'));
|
|
346
|
+
if (!hasNesting)
|
|
347
|
+
return rawText;
|
|
348
|
+
let resolvedText = rawText;
|
|
349
|
+
for (const cs of classSelectors) {
|
|
350
|
+
const resolved = resolveNestingSelector(cs);
|
|
351
|
+
if (resolved !== null && resolved.resolvable) {
|
|
352
|
+
const csRaw = cs.raw.text;
|
|
353
|
+
resolvedText = resolvedText.replace(csRaw, '.' + resolved.className);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return resolvedText;
|
|
357
|
+
}
|
|
358
|
+
// ---------------------------------------------------------------------------
|
|
359
|
+
// Public API
|
|
360
|
+
// ---------------------------------------------------------------------------
|
|
361
|
+
/**
|
|
362
|
+
* Extract normalized CSS declarations from a parsed CSS AST.
|
|
363
|
+
*
|
|
364
|
+
* Replaces the regex-based extractFromCSS() + extractRuleSets() + the
|
|
365
|
+
* declaration-extraction part of extractDeclarationsFromBlock() for .css files.
|
|
366
|
+
*
|
|
367
|
+
* Parser bugs eliminated by AST-based approach:
|
|
368
|
+
* Bug 1: Whitespace before @-rules — @-rules are at_rule nodes, always correct
|
|
369
|
+
* Bug 3: Nested @-rule closing brace — tree-sitter handles brace matching
|
|
370
|
+
* Bug 4: findSelectorStart walking past boundaries — no backward scanning needed
|
|
371
|
+
* Bug 5: CSS comments as class names — comment nodes are typed, filtered out
|
|
372
|
+
*/
|
|
373
|
+
export function extractDeclarationsFromCSSAst(ast, adapter, filePath, sourceCode) {
|
|
374
|
+
const declarations = [];
|
|
375
|
+
// Find all rule_sets
|
|
376
|
+
const ruleSets = adapter.findNodes(ast, { type: 'rule_set' });
|
|
377
|
+
for (const ruleSet of ruleSets) {
|
|
378
|
+
const rawNode = ruleSet.raw;
|
|
379
|
+
// tree-sitter-css: rule_set has named children 'selectors' and 'block'
|
|
380
|
+
const selectorsRaw = findNamedChild(rawNode, 'selectors');
|
|
381
|
+
if (!selectorsRaw)
|
|
382
|
+
continue;
|
|
383
|
+
const selectorsAst = wrapAsASTNode(selectorsRaw);
|
|
384
|
+
let selector = getSelectorText(selectorsAst, sourceCode);
|
|
385
|
+
if (!selector)
|
|
386
|
+
continue;
|
|
387
|
+
// SCSS: resolve & nesting in selector context (Bug 2 fix)
|
|
388
|
+
selector = resolveSelectorContext(selectorsAst, selector);
|
|
389
|
+
// Get variant context from at_rule ancestors
|
|
390
|
+
const variantContext = getVariantContext(ruleSet, adapter, sourceCode);
|
|
391
|
+
// Find declarations inside this rule_set
|
|
392
|
+
const subAST = subtreeAST(ast, ruleSet);
|
|
393
|
+
const declNodes = adapter.findNodes(subAST, { type: 'declaration' });
|
|
394
|
+
for (const decl of declNodes) {
|
|
395
|
+
// Skip declarations from nested rule_sets (SCSS nesting):
|
|
396
|
+
// findNodes recurses into descendant rule_sets, so outer .card
|
|
397
|
+
// would see declarations from inner &-header — producing wrong context.
|
|
398
|
+
let declAncestor = adapter.getParent(decl);
|
|
399
|
+
while (declAncestor && declAncestor.type !== 'rule_set') {
|
|
400
|
+
declAncestor = adapter.getParent(declAncestor);
|
|
401
|
+
}
|
|
402
|
+
if (declAncestor && declAncestor.raw.id !== rawNode.id)
|
|
403
|
+
continue;
|
|
404
|
+
const raw = decl.raw;
|
|
405
|
+
const pv = getPropertyAndValue(raw);
|
|
406
|
+
if (!pv)
|
|
407
|
+
continue;
|
|
408
|
+
const { property, rawValue } = pv;
|
|
409
|
+
if (!property || !rawValue)
|
|
410
|
+
continue;
|
|
411
|
+
const normalizedValue = normalizeValue(rawValue, property);
|
|
412
|
+
const expanded = expandShorthand(property, rawValue, normalizedValue);
|
|
413
|
+
const line = decl.location.start.line;
|
|
414
|
+
// Extract token ref from var() values or custom property names
|
|
415
|
+
const tokenRef = property.startsWith('--')
|
|
416
|
+
? property
|
|
417
|
+
: (rawValue.trim().startsWith('var(') ? extractTokenRef(rawValue) : null);
|
|
418
|
+
for (const exp of expanded) {
|
|
419
|
+
declarations.push({
|
|
420
|
+
property: exp.property,
|
|
421
|
+
rawValue: exp.rawValue,
|
|
422
|
+
normalizedValue: exp.normalizedValue,
|
|
423
|
+
mechanism: 'css',
|
|
424
|
+
filePath,
|
|
425
|
+
line,
|
|
426
|
+
context: selector,
|
|
427
|
+
variantContext,
|
|
428
|
+
tokenRef,
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
// Handle @apply directives (Tailwind extension)
|
|
433
|
+
const blockRaw = findNamedChild(rawNode, 'block');
|
|
434
|
+
if (blockRaw) {
|
|
435
|
+
const blockAst = wrapAsASTNode(blockRaw);
|
|
436
|
+
extractApplyDirectives(blockAst, sourceCode, selector, variantContext, filePath, declarations);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
// Handle @keyframes blocks — tree-sitter-css uses keyframes_statement with
|
|
440
|
+
// keyframe_block_list children, not rule_set.
|
|
441
|
+
const keyframeStmts = adapter.findNodes(ast, { type: 'keyframes_statement' });
|
|
442
|
+
for (const kf of keyframeStmts) {
|
|
443
|
+
const kfRaw = kf.raw;
|
|
444
|
+
const kfName = findNamedChild(kfRaw, 'keyframes_name')?.text ?? 'unknown';
|
|
445
|
+
const kfSubAST = subtreeAST(ast, kf);
|
|
446
|
+
const kfDeclNodes = adapter.findNodes(kfSubAST, { type: 'declaration' });
|
|
447
|
+
for (const decl of kfDeclNodes) {
|
|
448
|
+
// Find which keyframe_block this declaration belongs to
|
|
449
|
+
let parent = adapter.getParent(decl);
|
|
450
|
+
let kfSelector = '(unknown)';
|
|
451
|
+
while (parent && parent.type !== 'keyframes_statement') {
|
|
452
|
+
if (parent.type === 'keyframe_block') {
|
|
453
|
+
const selChild = parent.raw.namedChildren.find((c) => c.type === 'from' || c.type === 'to' || c.type === 'integer_value');
|
|
454
|
+
kfSelector = selChild?.text ?? '(unknown)';
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
parent = adapter.getParent(parent);
|
|
458
|
+
}
|
|
459
|
+
const raw = decl.raw;
|
|
460
|
+
const pv = getPropertyAndValue(raw);
|
|
461
|
+
if (!pv)
|
|
462
|
+
continue;
|
|
463
|
+
const { property, rawValue } = pv;
|
|
464
|
+
if (!property || !rawValue)
|
|
465
|
+
continue;
|
|
466
|
+
const normalizedValue = normalizeValue(rawValue, property);
|
|
467
|
+
const expanded = expandShorthand(property, rawValue, normalizedValue);
|
|
468
|
+
const line = decl.location.start.line;
|
|
469
|
+
const tokenRef = property.startsWith('--')
|
|
470
|
+
? property
|
|
471
|
+
: (rawValue.trim().startsWith('var(') ? extractTokenRef(rawValue) : null);
|
|
472
|
+
for (const exp of expanded) {
|
|
473
|
+
declarations.push({
|
|
474
|
+
property: exp.property,
|
|
475
|
+
rawValue: exp.rawValue,
|
|
476
|
+
normalizedValue: exp.normalizedValue,
|
|
477
|
+
mechanism: 'css',
|
|
478
|
+
filePath,
|
|
479
|
+
line,
|
|
480
|
+
context: kfSelector,
|
|
481
|
+
variantContext: `@keyframes ${kfName}`,
|
|
482
|
+
tokenRef,
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
// Handle top-level declarations (not inside a rule_set or keyframe block — valid CSS)
|
|
488
|
+
const allDecls = adapter.findNodes(ast, { type: 'declaration' });
|
|
489
|
+
for (const decl of allDecls) {
|
|
490
|
+
// Skip declarations that are inside a rule_set or keyframe block (already processed above)
|
|
491
|
+
const parent = adapter.getParent(decl);
|
|
492
|
+
let ancestor = parent;
|
|
493
|
+
let inKeyframe = false;
|
|
494
|
+
while (ancestor) {
|
|
495
|
+
if (ancestor.type === 'keyframe_block') {
|
|
496
|
+
inKeyframe = true;
|
|
497
|
+
break;
|
|
498
|
+
}
|
|
499
|
+
ancestor = adapter.getParent(ancestor);
|
|
500
|
+
}
|
|
501
|
+
if (parent?.type === 'rule_set' || parent?.type === 'block' || inKeyframe)
|
|
502
|
+
continue;
|
|
503
|
+
const raw = decl.raw;
|
|
504
|
+
const pv = getPropertyAndValue(raw);
|
|
505
|
+
if (!pv)
|
|
506
|
+
continue;
|
|
507
|
+
const { property, rawValue } = pv;
|
|
508
|
+
if (!property || !rawValue)
|
|
509
|
+
continue;
|
|
510
|
+
const normalizedValue = normalizeValue(rawValue, property);
|
|
511
|
+
const expanded = expandShorthand(property, rawValue, normalizedValue);
|
|
512
|
+
const line = decl.location.start.line;
|
|
513
|
+
for (const exp of expanded) {
|
|
514
|
+
declarations.push({
|
|
515
|
+
property: exp.property,
|
|
516
|
+
rawValue: exp.rawValue,
|
|
517
|
+
normalizedValue: exp.normalizedValue,
|
|
518
|
+
mechanism: 'css',
|
|
519
|
+
filePath,
|
|
520
|
+
line,
|
|
521
|
+
context: '(top-level)',
|
|
522
|
+
variantContext: null,
|
|
523
|
+
tokenRef: property.startsWith('--')
|
|
524
|
+
? property
|
|
525
|
+
: (rawValue.trim().startsWith('var(') ? extractTokenRef(rawValue) : null),
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return declarations;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Extract CSS custom property tokens from a parsed CSS AST.
|
|
533
|
+
*
|
|
534
|
+
* Replaces the regex-based extractTokens() for .css files.
|
|
535
|
+
* Finds declarations where the property starts with -- and extracts
|
|
536
|
+
* the token name and value.
|
|
537
|
+
*/
|
|
538
|
+
export function extractTokensFromCSSAst(ast, adapter, filePath) {
|
|
539
|
+
const tokens = [];
|
|
540
|
+
const allDecls = adapter.findNodes(ast, { type: 'declaration' });
|
|
541
|
+
for (const decl of allDecls) {
|
|
542
|
+
const raw = decl.raw;
|
|
543
|
+
const pv = getPropertyAndValue(raw);
|
|
544
|
+
if (!pv)
|
|
545
|
+
continue;
|
|
546
|
+
const { property, rawValue } = pv;
|
|
547
|
+
if (!property.startsWith('--'))
|
|
548
|
+
continue;
|
|
549
|
+
const name = property.trim();
|
|
550
|
+
const value = rawValue.trim();
|
|
551
|
+
if (name && value) {
|
|
552
|
+
tokens.push({
|
|
553
|
+
name,
|
|
554
|
+
value,
|
|
555
|
+
filePath,
|
|
556
|
+
mechanism: 'css-custom-property',
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return tokens;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Extract CSS class usage from a parsed CSS AST.
|
|
564
|
+
*
|
|
565
|
+
* Replaces the regex-based class name extraction from selectors for .css files.
|
|
566
|
+
* Finds class_name nodes anywhere in the AST — each represents one CSS class
|
|
567
|
+
* definition. comment nodes are typed and naturally excluded (Bug 5 fix).
|
|
568
|
+
*
|
|
569
|
+
* For SCSS: resolves &-suffix / &__element / &--modifier (BEM no-separator
|
|
570
|
+
* concatenation) by walking up to the parent rule_set's class_selector.
|
|
571
|
+
* &.modifier (chained class) and & .descendant patterns are tracked as
|
|
572
|
+
* unresolvable rather than registered as standalone classes — registering
|
|
573
|
+
* them would produce false negatives in the undefined-class detector.
|
|
574
|
+
*/
|
|
575
|
+
export function extractClassUsageFromCSSAst(ast, adapter, filePath) {
|
|
576
|
+
const usage = [];
|
|
577
|
+
// class_name nodes represent CSS class selectors like .my-class
|
|
578
|
+
// They can appear inside selectors, pseudo-class arguments, etc.
|
|
579
|
+
const classNodes = adapter.findNodes(ast, { type: 'class_name' });
|
|
580
|
+
for (const node of classNodes) {
|
|
581
|
+
// Only extract class_name nodes that are children of class_selector.
|
|
582
|
+
// pseudo_class_selector (:hover, :focus, :nth-child) and
|
|
583
|
+
// pseudo_element_selector (::before, ::after) also contain class_name
|
|
584
|
+
// children — those are pseudo-classes, not CSS class definitions.
|
|
585
|
+
const parent = adapter.getParent(node);
|
|
586
|
+
if (!parent || parent.type !== 'class_selector')
|
|
587
|
+
continue;
|
|
588
|
+
const raw = node.raw;
|
|
589
|
+
const rawName = raw.text;
|
|
590
|
+
if (!rawName)
|
|
591
|
+
continue;
|
|
592
|
+
// SCSS nesting resolution: check if parent class_selector has a nesting_selector
|
|
593
|
+
const resolved = resolveNestingSelector(parent);
|
|
594
|
+
if (resolved !== null) {
|
|
595
|
+
// &-pattern: register the resolved or dropped class name
|
|
596
|
+
usage.push({
|
|
597
|
+
className: resolved.className,
|
|
598
|
+
filePath,
|
|
599
|
+
line: node.location.start.line,
|
|
600
|
+
mechanism: 'class',
|
|
601
|
+
unresolvable: !resolved.resolvable,
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
// Plain class_selector (no &), or at-rule top-level
|
|
606
|
+
usage.push({
|
|
607
|
+
className: rawName,
|
|
608
|
+
filePath,
|
|
609
|
+
line: node.location.start.line,
|
|
610
|
+
mechanism: 'class',
|
|
611
|
+
unresolvable: false,
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
return usage;
|
|
616
|
+
}
|
|
617
|
+
//# sourceMappingURL=cssAstExtractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssAstExtractor.js","sourceRoot":"","sources":["../../src/styles/cssAstExtractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlE,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;GAIG;AACH,SAAS,eAAe,CAAC,QAAgB;IACvC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAC3D,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,aAAsB,EAAE,UAAkB;IACjE,MAAM,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,4EAA4E;IAC5E,OAAO,GAAG,CAAC,O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,MAAM,GAAG,GAAG,IAAI,CAAC,GAAqB,CAAC;QACvC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,OAAO;YAAE,SAAS;QAEvB,iFAAiF;QACjF,MAAM,QAAQ,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAEhD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,yDAAyD;YACzD,KAAK,CAAC,IAAI,CAAC;gBACT,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,QAAQ;gBACR,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI;gBAC9B,SAAS,EAAE,OAAO;gBAClB,YAAY,EAAE,CAAC,QAAQ,CAAC,UAAU;aACnC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,oDAAoD;YACpD,KAAK,CAAC,IAAI,CAAC;gBACT,SAAS,EAAE,OAAO;gBAClB,QAAQ;gBACR,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI;gBAC9B,SAAS,EAAE,OAAO;gBAClB,YAAY,EAAE,KAAK;aACpB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Style declaration extractor — Spec 10.
|
|
3
3
|
*
|
|
4
|
-
* Extracts normalized declarations from
|
|
5
|
-
* 1.
|
|
4
|
+
* Extracts normalized declarations from style mechanisms:
|
|
5
|
+
* 1. SCSS files — regex-based rule set extraction (CSS handled by cssAstExtractor.ts)
|
|
6
6
|
* 2. Tailwind — className/class attributes in JSX/HTML
|
|
7
7
|
* 3. Inline styles — style={{...}} object expressions
|
|
8
8
|
* 4. CSS-in-JS — styled-components / emotion tagged templates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styleExtractor.d.ts","sourceRoot":"","sources":["../../src/styles/styleExt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