@pithyjs/vite-plugin 0.2.0-beta.1 → 0.2.0-beta.11
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/aotCodegen/generateBindings.d.ts +5 -3
- package/dist/aotCodegen/generateBindings.d.ts.map +1 -1
- package/dist/aotCodegen/generateBindings.js +16 -8
- package/dist/aotCodegen/generateBindings.js.map +1 -1
- package/dist/aotCodegen/generateDomFactory.d.ts +2 -1
- package/dist/aotCodegen/generateDomFactory.d.ts.map +1 -1
- package/dist/aotCodegen/generateDomFactory.js +111 -32
- package/dist/aotCodegen/generateDomFactory.js.map +1 -1
- package/dist/aotCodegen/index.d.ts +2 -2
- package/dist/aotCodegen/index.js +1 -1
- package/dist/aotCodegen/index.js.map +1 -1
- package/dist/aotCodegen/serializeNode.d.ts +1 -1
- package/dist/aotCodegen/serializeNode.d.ts.map +1 -1
- package/dist/aotCodegen/serializeNode.js +2 -3
- package/dist/aotCodegen/serializeNode.js.map +1 -1
- package/dist/aotCodegen/structuralCodegen.d.ts +2 -2
- package/dist/aotCodegen/structuralCodegen.d.ts.map +1 -1
- package/dist/aotCodegen/structuralCodegen.js +2 -2
- package/dist/aotCodegen/structuralCodegen.js.map +1 -1
- package/dist/aotCodegen/utils.js.map +1 -1
- package/dist/babelPlugin/babelPlugin.d.ts +1 -1
- package/dist/babelPlugin/babelPlugin.d.ts.map +1 -1
- package/dist/babelPlugin/babelPlugin.js +140 -7
- package/dist/babelPlugin/babelPlugin.js.map +1 -1
- package/dist/babelPlugin/extractUsedIdentifiers.d.ts +13 -3
- package/dist/babelPlugin/extractUsedIdentifiers.d.ts.map +1 -1
- package/dist/babelPlugin/extractUsedIdentifiers.js +80 -44
- package/dist/babelPlugin/extractUsedIdentifiers.js.map +1 -1
- package/dist/buildPlugin/plugin.js.map +1 -1
- package/dist/designSystemPlugin/channelVars.js.map +1 -1
- package/dist/designSystemPlugin/collector.d.ts +1 -1
- package/dist/designSystemPlugin/collector.js +1 -1
- package/dist/designSystemPlugin/collector.js.map +1 -1
- package/dist/designSystemPlugin/cssTokens.d.ts +1 -1
- package/dist/designSystemPlugin/cssTokens.js +1 -1
- package/dist/designSystemPlugin/cssTokens.js.map +1 -1
- package/dist/designSystemPlugin/enumerate.d.ts.map +1 -1
- package/dist/designSystemPlugin/enumerate.js +13 -13
- package/dist/designSystemPlugin/enumerate.js.map +1 -1
- package/dist/designSystemPlugin/extractor.d.ts +1 -1
- package/dist/designSystemPlugin/extractor.js.map +1 -1
- package/dist/designSystemPlugin/generator.d.ts +1 -1
- package/dist/designSystemPlugin/generator.js +3 -3
- package/dist/designSystemPlugin/generator.js.map +1 -1
- package/dist/designSystemPlugin/index.d.ts +2 -2
- package/dist/designSystemPlugin/index.js +1 -1
- package/dist/designSystemPlugin/index.js.map +1 -1
- package/dist/designSystemPlugin/patterns/a11y.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/a11y.js.map +1 -1
- package/dist/designSystemPlugin/patterns/borders.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/borders.js +1 -1
- package/dist/designSystemPlugin/patterns/borders.js.map +1 -1
- package/dist/designSystemPlugin/patterns/colors.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/colors.js +2 -2
- package/dist/designSystemPlugin/patterns/colors.js.map +1 -1
- package/dist/designSystemPlugin/patterns/iconography.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/iconography.js +1 -1
- package/dist/designSystemPlugin/patterns/iconography.js.map +1 -1
- package/dist/designSystemPlugin/patterns/index.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/index.js +11 -11
- package/dist/designSystemPlugin/patterns/index.js.map +1 -1
- package/dist/designSystemPlugin/patterns/layout.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/layout.js +1 -1
- package/dist/designSystemPlugin/patterns/layout.js.map +1 -1
- package/dist/designSystemPlugin/patterns/motion.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/motion.js +1 -1
- package/dist/designSystemPlugin/patterns/motion.js.map +1 -1
- package/dist/designSystemPlugin/patterns/radius.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/radius.js +1 -1
- package/dist/designSystemPlugin/patterns/radius.js.map +1 -1
- package/dist/designSystemPlugin/patterns/shadows.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/shadows.d.ts.map +1 -1
- package/dist/designSystemPlugin/patterns/shadows.js +1 -1
- package/dist/designSystemPlugin/patterns/shadows.js.map +1 -1
- package/dist/designSystemPlugin/patterns/smartContainer.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/smartContainer.js +1 -1
- package/dist/designSystemPlugin/patterns/smartContainer.js.map +1 -1
- package/dist/designSystemPlugin/patterns/spacing.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/spacing.js +1 -1
- package/dist/designSystemPlugin/patterns/spacing.js.map +1 -1
- package/dist/designSystemPlugin/patterns/typography.d.ts +1 -1
- package/dist/designSystemPlugin/patterns/typography.js +1 -1
- package/dist/designSystemPlugin/patterns/typography.js.map +1 -1
- package/dist/designSystemPlugin/plugin.d.ts +11 -1
- package/dist/designSystemPlugin/plugin.d.ts.map +1 -1
- package/dist/designSystemPlugin/plugin.js +421 -55
- package/dist/designSystemPlugin/plugin.js.map +1 -1
- package/dist/designSystemPlugin/types.d.ts +8 -2
- package/dist/designSystemPlugin/types.d.ts.map +1 -1
- package/dist/designSystemPlugin/types.js.map +1 -1
- package/dist/htmlTransform/htmlTransform.d.ts +1 -1
- package/dist/htmlTransform/htmlTransform.d.ts.map +1 -1
- package/dist/htmlTransform/htmlTransform.js +5 -2
- package/dist/htmlTransform/htmlTransform.js.map +1 -1
- package/dist/iconsPlugin/index.d.ts +2 -2
- package/dist/iconsPlugin/index.js +1 -1
- package/dist/iconsPlugin/index.js.map +1 -1
- package/dist/iconsPlugin/optimize.js.map +1 -1
- package/dist/iconsPlugin/plugin.d.ts +1 -1
- package/dist/iconsPlugin/plugin.js +2 -2
- package/dist/iconsPlugin/plugin.js.map +1 -1
- package/dist/iconsPlugin/types.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/pithyPlugin/plugin.d.ts.map +1 -1
- package/dist/pithyPlugin/plugin.js +1 -8
- package/dist/pithyPlugin/plugin.js.map +1 -1
- package/dist/routerPlugin/manifest.js.map +1 -1
- package/dist/routerPlugin/plugin.js +2 -2
- package/dist/routerPlugin/plugin.js.map +1 -1
- package/dist/routerPlugin/scanner.js.map +1 -1
- package/dist/ssrPlugin/plugin.d.ts.map +1 -1
- package/dist/ssrPlugin/plugin.js +26 -21
- package/dist/ssrPlugin/plugin.js.map +1 -1
- package/package.json +15 -9
|
@@ -16,15 +16,19 @@
|
|
|
16
16
|
import { parse } from '@babel/parser';
|
|
17
17
|
import * as t from '@babel/types';
|
|
18
18
|
import * as traverse from '@babel/traverse';
|
|
19
|
-
import { isValidJsIdentifier } from '
|
|
20
|
-
/** @codexApi {"parent":"pithy.babel.identifier-extractor","name":"extractUsedIdentifiers","stability":"stable","signature":"(root: PithyNode, componentScopes?: ComponentScopesMap) => Set<string>"} */
|
|
21
|
-
export function extractUsedIdentifiers(root, componentScopes) {
|
|
19
|
+
import { isValidJsIdentifier } from '@pithyjs/shared';
|
|
20
|
+
/** @codexApi {"parent":"pithy.babel.identifier-extractor","name":"extractUsedIdentifiers","stability":"stable","signature":"(root: PithyNode, componentScopes?: ComponentScopesMap, onComponentAttr?: (report: ComponentAttrReport) => void) => Set<string>"} */
|
|
21
|
+
export function extractUsedIdentifiers(root, componentScopes, onComponentAttr) {
|
|
22
22
|
const vars = new Set();
|
|
23
23
|
// Track loop-local variables so we can exclude them
|
|
24
24
|
const scopedLoopVars = new Set();
|
|
25
|
-
const extractFromExpr = (expr) => {
|
|
25
|
+
const extractFromExpr = (expr, quiet = false) => {
|
|
26
|
+
const names = [];
|
|
26
27
|
if (!expr || expr.trim() === '')
|
|
27
|
-
return;
|
|
28
|
+
return { names, parsed: true, expression: null };
|
|
29
|
+
let expression = null;
|
|
30
|
+
let jsError;
|
|
31
|
+
const parseError = (err) => (err instanceof Error ? err.message : String(err)).replace(/ \(\d+:\d+\)$/, '');
|
|
28
32
|
try {
|
|
29
33
|
// Parse with the grammar that will actually RUN this string.
|
|
30
34
|
// `compileExpression()` hands the expression to `new Function`, which uses
|
|
@@ -44,7 +48,8 @@ export function extractUsedIdentifiers(root, componentScopes) {
|
|
|
44
48
|
try {
|
|
45
49
|
ast = parse(`(${expr})`, { sourceType: 'module' });
|
|
46
50
|
}
|
|
47
|
-
catch {
|
|
51
|
+
catch (err) {
|
|
52
|
+
jsError = err;
|
|
48
53
|
ast = parse(`(${expr})`, {
|
|
49
54
|
sourceType: 'module',
|
|
50
55
|
plugins: ['typescript'],
|
|
@@ -52,6 +57,9 @@ export function extractUsedIdentifiers(root, componentScopes) {
|
|
|
52
57
|
}
|
|
53
58
|
const interop = traverse.default;
|
|
54
59
|
const realTraverse = typeof interop === 'function' ? interop : interop.default;
|
|
60
|
+
const [statement] = ast.program.body;
|
|
61
|
+
if (t.isExpressionStatement(statement))
|
|
62
|
+
expression = statement.expression;
|
|
55
63
|
realTraverse(ast, {
|
|
56
64
|
Identifier(path) {
|
|
57
65
|
// Cast to t.Node to avoid version mismatch between @babel/types
|
|
@@ -68,7 +76,9 @@ export function extractUsedIdentifiers(root, componentScopes) {
|
|
|
68
76
|
t.isOptionalMemberExpression(parent)) &&
|
|
69
77
|
parent.property === path.node &&
|
|
70
78
|
!parent.computed;
|
|
71
|
-
const isObjectKey = t.isObjectProperty(parent)
|
|
79
|
+
const isObjectKey = (t.isObjectProperty(parent) || t.isObjectMethod(parent)) &&
|
|
80
|
+
parent.key === path.node &&
|
|
81
|
+
!parent.computed;
|
|
72
82
|
// TypeScript syntax in a template expression is NOT supported — the
|
|
73
83
|
// expression string is handed to `new Function` verbatim, so
|
|
74
84
|
// `(value as Item).done` is a SyntaxError there and falls back
|
|
@@ -101,13 +111,25 @@ export function extractUsedIdentifiers(root, componentScopes) {
|
|
|
101
111
|
!isTypePosition &&
|
|
102
112
|
!scopedLoopVars.has(name)) {
|
|
103
113
|
vars.add(name);
|
|
114
|
+
names.push(name);
|
|
104
115
|
}
|
|
105
116
|
},
|
|
106
117
|
});
|
|
107
118
|
}
|
|
108
119
|
catch (err) {
|
|
109
|
-
|
|
120
|
+
if (!quiet) {
|
|
121
|
+
console.warn('[pithy] Failed to parse expression:', expr, err);
|
|
122
|
+
}
|
|
123
|
+
return { names, parsed: false, expression: null, error: parseError(err) };
|
|
110
124
|
}
|
|
125
|
+
if (jsError !== undefined)
|
|
126
|
+
return {
|
|
127
|
+
names,
|
|
128
|
+
parsed: false,
|
|
129
|
+
expression: null,
|
|
130
|
+
error: parseError(jsError),
|
|
131
|
+
};
|
|
132
|
+
return { names, parsed: true, expression };
|
|
111
133
|
};
|
|
112
134
|
/**
|
|
113
135
|
* Push names into scopedLoopVars, returning only the ones that were
|
|
@@ -129,30 +151,14 @@ export function extractUsedIdentifiers(root, componentScopes) {
|
|
|
129
151
|
}
|
|
130
152
|
};
|
|
131
153
|
const walk = (node) => {
|
|
132
|
-
// ── 1. Extract the
|
|
133
|
-
// These run in the *parent's* scope — the node hasn't introduced its
|
|
134
|
-
// own variables yet.
|
|
154
|
+
// ── 1. Extract the expressions that run in the *parent's* scope ──
|
|
135
155
|
if (node.type === 'text') {
|
|
136
156
|
for (const i of node.interpolations ?? []) {
|
|
137
157
|
extractFromExpr(i.expression);
|
|
138
158
|
}
|
|
139
159
|
}
|
|
140
|
-
|
|
141
|
-
if (
|
|
142
|
-
for (const [attrName, attrValue] of Object.entries(node.attrs)) {
|
|
143
|
-
if (attrName.startsWith('data-') || attrName.startsWith('class'))
|
|
144
|
-
continue;
|
|
145
|
-
extractFromExpr(attrValue);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (node.directives) {
|
|
149
|
-
const d = node.directives;
|
|
150
|
-
if (d.bound)
|
|
151
|
-
Object.values(d.bound).forEach(extractFromExpr);
|
|
152
|
-
if (d.classMap)
|
|
153
|
-
Object.values(d.classMap).forEach(extractFromExpr);
|
|
154
|
-
if (d.classes)
|
|
155
|
-
extractFromExpr(d.classes);
|
|
160
|
+
const d = node.directives;
|
|
161
|
+
if (d) {
|
|
156
162
|
if (d.if)
|
|
157
163
|
extractFromExpr(d.if);
|
|
158
164
|
if (d.elseIf)
|
|
@@ -161,10 +167,49 @@ export function extractUsedIdentifiers(root, componentScopes) {
|
|
|
161
167
|
extractFromExpr(d.switch);
|
|
162
168
|
if (d.case)
|
|
163
169
|
extractFromExpr(d.case);
|
|
164
|
-
if (d.for)
|
|
165
|
-
// collectionExpr is evaluated in the parent scope
|
|
170
|
+
if (d.for)
|
|
166
171
|
extractFromExpr(d.for.collectionExpr);
|
|
172
|
+
}
|
|
173
|
+
const loopNames = [];
|
|
174
|
+
if (d?.for) {
|
|
175
|
+
const { itemVar, indexVar } = d.for;
|
|
176
|
+
if (itemVar)
|
|
177
|
+
loopNames.push(itemVar);
|
|
178
|
+
if (indexVar)
|
|
179
|
+
loopNames.push(indexVar);
|
|
180
|
+
loopNames.push('count', 'first', 'last', 'even', 'odd');
|
|
181
|
+
}
|
|
182
|
+
const addedLoop = pushScoped(loopNames);
|
|
183
|
+
if (node.type === 'element' && node.isComponent && node.attrs) {
|
|
184
|
+
for (const [attrName, attrValue] of Object.entries(node.attrs)) {
|
|
185
|
+
if (attrName.startsWith('data-') ||
|
|
186
|
+
attrName.startsWith('class') ||
|
|
187
|
+
attrName.startsWith('@') ||
|
|
188
|
+
attrName.startsWith('['))
|
|
189
|
+
continue;
|
|
190
|
+
const { names, parsed, expression, error } = extractFromExpr(attrValue, onComponentAttr !== undefined);
|
|
191
|
+
if (attrName === 'style' || attrName === 'slot')
|
|
192
|
+
continue;
|
|
193
|
+
onComponentAttr?.({
|
|
194
|
+
tag: node.originalTagName ?? node.tagName ?? '',
|
|
195
|
+
attr: node.originalAttrs?.[attrName] ?? attrName,
|
|
196
|
+
value: attrValue,
|
|
197
|
+
names,
|
|
198
|
+
parsed,
|
|
199
|
+
expression,
|
|
200
|
+
error,
|
|
201
|
+
});
|
|
167
202
|
}
|
|
203
|
+
}
|
|
204
|
+
if (d) {
|
|
205
|
+
if (d.bound)
|
|
206
|
+
Object.values(d.bound).forEach(v => extractFromExpr(v));
|
|
207
|
+
if (d.classMap)
|
|
208
|
+
Object.values(d.classMap).forEach(v => extractFromExpr(v));
|
|
209
|
+
if (d.styleMap)
|
|
210
|
+
Object.values(d.styleMap).forEach(v => extractFromExpr(v));
|
|
211
|
+
if (d.classes)
|
|
212
|
+
extractFromExpr(d.classes);
|
|
168
213
|
if (d.ref)
|
|
169
214
|
extractFromExpr(d.ref);
|
|
170
215
|
if (d.bind)
|
|
@@ -172,7 +217,7 @@ export function extractUsedIdentifiers(root, componentScopes) {
|
|
|
172
217
|
if (d.error)
|
|
173
218
|
extractFromExpr(d.error);
|
|
174
219
|
if (d.events)
|
|
175
|
-
Object.values(d.events).forEach(extractFromExpr);
|
|
220
|
+
Object.values(d.events).forEach(v => extractFromExpr(v));
|
|
176
221
|
// @defer directive related expressions
|
|
177
222
|
if (d.load)
|
|
178
223
|
extractFromExpr(d.load);
|
|
@@ -180,21 +225,15 @@ export function extractUsedIdentifiers(root, componentScopes) {
|
|
|
180
225
|
extractFromExpr(d.when);
|
|
181
226
|
if (d.placeholder)
|
|
182
227
|
extractFromExpr(d.placeholder);
|
|
228
|
+
// trackBy uses the loop variable (e.g. item.id) so it runs in child scope
|
|
229
|
+
if (d.for?.trackBy)
|
|
230
|
+
extractFromExpr(d.for.trackBy);
|
|
183
231
|
}
|
|
184
232
|
// ── 2. Collect child-scope variables ──
|
|
185
233
|
// These are injected *into children* by this node. They must not
|
|
186
234
|
// affect the node's own expressions (handled above) and must be
|
|
187
235
|
// popped when leaving the subtree.
|
|
188
236
|
const childScopeNames = [];
|
|
189
|
-
// @for loop vars + helpers — apply to trackBy and children
|
|
190
|
-
if (node.directives?.for) {
|
|
191
|
-
const { itemVar, indexVar } = node.directives.for;
|
|
192
|
-
if (itemVar)
|
|
193
|
-
childScopeNames.push(itemVar);
|
|
194
|
-
if (indexVar)
|
|
195
|
-
childScopeNames.push(indexVar);
|
|
196
|
-
childScopeNames.push('count', 'first', 'last', 'even', 'odd');
|
|
197
|
-
}
|
|
198
237
|
// componentScopes config (e.g. ui-kit <For>, <Show>, etc.)
|
|
199
238
|
if (componentScopes &&
|
|
200
239
|
node.type === 'element' &&
|
|
@@ -233,15 +272,12 @@ export function extractUsedIdentifiers(root, componentScopes) {
|
|
|
233
272
|
}
|
|
234
273
|
}
|
|
235
274
|
}
|
|
236
|
-
// ── 3. Push child scope,
|
|
275
|
+
// ── 3. Push child scope, walk children, pop ──
|
|
237
276
|
const added = pushScoped(childScopeNames);
|
|
238
|
-
// trackBy uses the loop variable (e.g. item.id) so it runs in child scope
|
|
239
|
-
if (node.directives?.for?.trackBy) {
|
|
240
|
-
extractFromExpr(node.directives.for.trackBy);
|
|
241
|
-
}
|
|
242
277
|
if (node.children)
|
|
243
278
|
node.children.forEach(walk);
|
|
244
279
|
popScoped(added);
|
|
280
|
+
popScoped(addedLoop);
|
|
245
281
|
};
|
|
246
282
|
walk(root);
|
|
247
283
|
return vars;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractUsedIdentifiers.js","sourceRoot":"","sources":["../../src/babelPlugin/extractUsedIdentifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAWjF,wMAAwM;AACxM,MAAM,UAAU,sBAAsB,CACpC,IAAe,EACf,eAAoC;IAEpC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE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AAClC,SAAS,wBAAwB,CAC/B,IAAwB;IAExB,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC3C,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACzB,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.babel.identifier-extractor\",\n \"title\": \"Babel Identifier Extractor\",\n \"category\": \"plugin\",\n \"description\": \"Extracts used identifiers from parsed template ASTs for tree-shaking and scope analysis.\",\n \"since\": \"0.0.1\",\n \"stability\": \"stable\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"extractUsedIdentifiers.test.ts\" },\n \"integration\": { \"required\": false, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport { parse } from '@babel/parser';\nimport * as t from '@babel/types';\nimport * as traverse from '@babel/traverse';\nimport { PithyNode } from '@pithyjs/compiler';\nimport { NodePath } from '@babel/traverse';\nimport { isValidJsIdentifier } from '@pithyjs/shared';\n\n/** Richer config: default scope vars + optional attribute-based aliases */\nexport type ComponentScopeConfig = {\n vars: string[];\n aliases?: Record<string, string>; // attribute name → default var name it replaces\n};\n\n/** Map of component names to the variables they inject into children's scope */\nexport type ComponentScopesMap = Record<string, ComponentScopeConfig>;\n\nexport type ComponentAttrReport = {\n tag: string;\n attr: string;\n value: string;\n names: string[];\n parsed: boolean;\n expression: t.Expression | null;\n error?: string;\n};\n\n/** @codexApi {\"parent\":\"pithy.babel.identifier-extractor\",\"name\":\"extractUsedIdentifiers\",\"stability\":\"stable\",\"signature\":\"(root: PithyNode, componentScopes?: ComponentScopesMap, onComponentAttr?: (report: ComponentAttrReport) => void) => Set<string>\"} */\nexport function extractUsedIdentifiers(\n root: PithyNode,\n componentScopes?: ComponentScopesMap,\n onComponentAttr?: (report: ComponentAttrReport) => void\n): Set<string> {\n const vars = new Set<string>();\n\n // Track loop-local variables so we can exclude them\n const scopedLoopVars = new Set<string>();\n\n const extractFromExpr = (\n expr: string,\n quiet = false\n ): {\n names: string[];\n parsed: boolean;\n expression: t.Expression | null;\n error?: string;\n } => {\n const names: string[] = [];\n if (!expr || expr.trim() === '')\n return { names, parsed: true, expression: null };\n let expression: t.Expression | null = null;\n let jsError: unknown;\n const parseError = (err: unknown) =>\n (err instanceof Error ? err.message : String(err)).replace(\n / \\(\\d+:\\d+\\)$/,\n ''\n );\n\n try {\n // Parse with the grammar that will actually RUN this string.\n // `compileExpression()` hands the expression to `new Function`, which uses\n // plain JavaScript — and the two grammars disagree about real code:\n // `foo<Bar>(x)` is a call with type arguments to TypeScript, but to\n // JavaScript it is `foo < Bar > (x)`, three comparisons in which `Bar` is\n // a genuine value dependency. Parsing TS-first classified `Bar` as a type\n // and dropped it from the context, so a valid template resolved an\n // unrelated global or threw.\n //\n // TypeScript is the fallback, not the default. It is only reached for\n // expressions JavaScript cannot parse at all — `x as Foo`,\n // `a satisfies Baz` — which therefore can never execute either, so the\n // type-position guard below only ever fires on syntax that was already\n // doomed. There it still matters: see the guard's own comment.\n let ast;\n try {\n ast = parse(`(${expr})`, { sourceType: 'module' });\n } catch (err) {\n jsError = err;\n ast = parse(`(${expr})`, {\n sourceType: 'module',\n plugins: ['typescript'],\n });\n }\n\n type TraverseFn = typeof traverse.default;\n const interop = (traverse as { default: unknown }).default as\n | TraverseFn\n | { default: TraverseFn };\n const realTraverse =\n typeof interop === 'function' ? interop : interop.default;\n\n const [statement] = ast.program.body;\n if (t.isExpressionStatement(statement)) expression = statement.expression;\n\n realTraverse(ast, {\n Identifier(path: NodePath<t.Identifier>) {\n // Cast to t.Node to avoid version mismatch between @babel/types\n // and @types/babel__traverse bundled type copies.\n const parent = path.parent as t.Node;\n\n // `a?.b` parses as an OptionalMemberExpression, a distinct node type\n // from MemberExpression. Checking only the latter let every optional\n // access leak its property name as a free identifier: `a?.b?.c`\n // collected `a`, `b` and `c`. The generated scope then referenced a\n // bare `b`, which a browser silently resolves against `window` — so\n // `actions?.length` read `window.length`, i.e. 0 — while a server DOM\n // throws `ReferenceError` and the component's subtree is dropped.\n const isProp =\n (t.isMemberExpression(parent) ||\n t.isOptionalMemberExpression(parent)) &&\n parent.property === path.node &&\n !parent.computed;\n\n const isObjectKey =\n (t.isObjectProperty(parent) || t.isObjectMethod(parent)) &&\n parent.key === path.node &&\n !parent.computed;\n\n // TypeScript syntax in a template expression is NOT supported — the\n // expression string is handed to `new Function` verbatim, so\n // `(value as Item).done` is a SyntaxError there and falls back\n // whatever this does. The guard is about the blast radius, not about\n // making it work.\n //\n // A collected name becomes a shorthand property in the emitted\n // context object (`babelPlugin.ts`, `{ Item }`). A type is erased at\n // emit, so that reference has no binding and the **whole module**\n // fails to load with `ReferenceError: Item is not defined` — every\n // component in it gone, not just the one bad expression. Worse when\n // the name collides with a global: `{ Event }` loads silently and\n // binds the DOM constructor.\n //\n // So this downgrades \"module dies\" to \"one expression falls back\".\n //\n // Only reachable through the TypeScript fallback above, which is why\n // `foo<Bar>(x)` is NOT affected: JavaScript parses it, so it never\n // reaches that fallback and `Bar` is collected as the value it is.\n //\n // Supporting TS in templates would mean transpiling before emitting\n // descriptors. That is a feature, and deliberately not attempted here.\n const isTypePosition =\n path.findParent(\n (p: NodePath) =>\n t.isTSType(p.node) ||\n t.isTSTypeAnnotation(p.node) ||\n t.isTSTypeParameterInstantiation(p.node)\n ) !== null;\n\n const name = path.node.name;\n\n // Exclude loop-scoped vars\n if (\n !isProp &&\n !isObjectKey &&\n !isTypePosition &&\n !scopedLoopVars.has(name)\n ) {\n vars.add(name);\n names.push(name);\n }\n },\n });\n } catch (err) {\n if (!quiet) {\n console.warn('[pithy] Failed to parse expression:', expr, err);\n }\n return { names, parsed: false, expression: null, error: parseError(err) };\n }\n if (jsError !== undefined)\n return {\n names,\n parsed: false,\n expression: null,\n error: parseError(jsError),\n };\n return { names, parsed: true, expression };\n };\n\n /**\n * Push names into scopedLoopVars, returning only the ones that were\n * genuinely new (so the caller can pop exactly those later).\n */\n const pushScoped = (names: string[]): string[] => {\n const added: string[] = [];\n for (const name of names) {\n if (!scopedLoopVars.has(name)) {\n added.push(name);\n }\n scopedLoopVars.add(name);\n }\n return added;\n };\n\n const popScoped = (added: string[]) => {\n for (const name of added) {\n scopedLoopVars.delete(name);\n }\n };\n\n const walk = (node: PithyNode) => {\n // ── 1. Extract the expressions that run in the *parent's* scope ──\n\n if (node.type === 'text') {\n for (const i of node.interpolations ?? []) {\n extractFromExpr(i.expression);\n }\n }\n\n const d = node.directives;\n\n if (d) {\n if (d.if) extractFromExpr(d.if);\n if (d.elseIf) extractFromExpr(d.elseIf);\n if (d.switch) extractFromExpr(d.switch);\n if (d.case) extractFromExpr(d.case);\n if (d.for) extractFromExpr(d.for.collectionExpr);\n }\n\n const loopNames: string[] = [];\n if (d?.for) {\n const { itemVar, indexVar } = d.for;\n if (itemVar) loopNames.push(itemVar);\n if (indexVar) loopNames.push(indexVar);\n loopNames.push('count', 'first', 'last', 'even', 'odd');\n }\n const addedLoop = pushScoped(loopNames);\n\n if (node.type === 'element' && node.isComponent && node.attrs) {\n for (const [attrName, attrValue] of Object.entries(node.attrs)) {\n if (\n attrName.startsWith('data-') ||\n attrName.startsWith('class') ||\n attrName.startsWith('@') ||\n attrName.startsWith('[')\n )\n continue;\n const { names, parsed, expression, error } = extractFromExpr(\n attrValue,\n onComponentAttr !== undefined\n );\n if (attrName === 'style' || attrName === 'slot') continue;\n onComponentAttr?.({\n tag: node.originalTagName ?? node.tagName ?? '',\n attr: node.originalAttrs?.[attrName] ?? attrName,\n value: attrValue,\n names,\n parsed,\n expression,\n error,\n });\n }\n }\n\n if (d) {\n if (d.bound) Object.values(d.bound).forEach(v => extractFromExpr(v));\n if (d.classMap)\n Object.values(d.classMap).forEach(v => extractFromExpr(v));\n if (d.styleMap)\n Object.values(d.styleMap).forEach(v => extractFromExpr(v));\n if (d.classes) extractFromExpr(d.classes);\n if (d.ref) extractFromExpr(d.ref);\n if (d.bind) extractFromExpr(d.bind);\n if (d.error) extractFromExpr(d.error);\n if (d.events) Object.values(d.events).forEach(v => extractFromExpr(v));\n\n // @defer directive related expressions\n if (d.load) extractFromExpr(d.load);\n if (d.when) extractFromExpr(d.when);\n if (d.placeholder) extractFromExpr(d.placeholder);\n\n // trackBy uses the loop variable (e.g. item.id) so it runs in child scope\n if (d.for?.trackBy) extractFromExpr(d.for.trackBy);\n }\n\n // ── 2. Collect child-scope variables ──\n // These are injected *into children* by this node. They must not\n // affect the node's own expressions (handled above) and must be\n // popped when leaving the subtree.\n\n const childScopeNames: string[] = [];\n\n // componentScopes config (e.g. ui-kit <For>, <Show>, etc.)\n if (\n componentScopes &&\n node.type === 'element' &&\n node.isComponent &&\n node.originalTagName\n ) {\n const config = componentScopes[node.originalTagName];\n if (config) {\n const resolved = [...config.vars];\n\n if (config.aliases && node.attrs) {\n // Build a reverse map: originalName → lowercaseName\n // node.attrs keys are lowercased by parse5; originalAttrs maps low → original\n const originalToLower = new Map<string, string>();\n if (node.originalAttrs) {\n for (const [lower, original] of Object.entries(\n node.originalAttrs\n )) {\n originalToLower.set(original, lower);\n }\n }\n // Also map identity for already-lowercase alias names\n for (const key of Object.keys(node.attrs)) {\n if (!originalToLower.has(key)) originalToLower.set(key, key);\n }\n\n for (const [attr, defaultVar] of Object.entries(config.aliases)) {\n const lowerKey = originalToLower.get(attr) ?? attr.toLowerCase();\n const attrVal = node.attrs[lowerKey];\n const aliasName = extractIdentifierLiteral(attrVal);\n if (aliasName) {\n const idx = resolved.indexOf(defaultVar);\n if (idx !== -1) resolved[idx] = aliasName;\n }\n }\n }\n\n for (const v of resolved) {\n childScopeNames.push(v);\n }\n }\n }\n\n // ── 3. Push child scope, walk children, pop ──\n\n const added = pushScoped(childScopeNames);\n\n if (node.children) node.children.forEach(walk);\n\n popScoped(added);\n popScoped(addedLoop);\n };\n\n walk(root);\n return vars;\n}\n\n/** Extract a valid JS identifier from a quoted string literal (e.g. `'fruit'` → `fruit`).\n * Returns undefined for empty strings, non-identifiers (e.g. `'123'`), reserved words,\n * or non-literal expressions. */\nfunction extractIdentifierLiteral(\n expr: string | undefined\n): string | undefined {\n if (!expr) return undefined;\n const trimmed = expr.trim();\n const m = trimmed.match(/^(['\"])(.*?)\\1$/);\n if (!m) return undefined;\n return isValidJsIdentifier(m[2]) ? m[2] : undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/buildPlugin/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AA6CF,MAAM,eAAe,GAAgC;IACnD,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,OAAO;IACxB,gBAAgB,EAAE,QAAQ;IAC1B,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oJAAoJ;AACpJ;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAS,cAAc,CACrB,EAAU,EACV,aAGQ,EACR,OAAoB,IAAI,GAAG,EAAE;IAE7B,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEb,MAAM,IAAI,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAExB,qEAAqE;IACrE,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC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AQ,CAAC,gBAAgB,CAAC,EAC7B,CAAC;wCACD,OAAO,mBAAmB,CAAC;oCAC7B,CAAC;oCACD,IACE,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;wCAC/B,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAChC,CAAC;wCACD,OAAO,sBAAsB,CAAC;oCAChC,CAAC;oCACD,IACE,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;wCAC9B,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAC/B,CAAC;wCACD,OAAO,qBAAqB,CAAC;oCAC/B,CAAC;oCACD,IACE,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;wCACrC,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EACtC,CAAC;wCACD,OAAO,qBAAqB,CAAC;oCAC/B,CAAC;oCAED,2DAA2D;oCAC3D,0DAA0D;oCAC1D,2DAA2D;oCAC3D,uCAAuC;oCACvC,IAAI,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;wCAChC,OAAO,cAAc,CAAC,EAAE,EAAE,aAAa,CAAC;4CACtC,CAAC,CAAC,SAAS;4CACX,CAAC,CAAC,QAAQ,CAAC;oCACf,CAAC;oCAED,OAAO,SAAS,CAAC;gCACnB,CAAC;gCACH,CAAC,CAAC,SAAS;yBACd;qBACF;oBACD,SAAS,EAAE,MAAM,CAAC,SAAS;oBAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;iBACtB;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.vite.build-plugin\",\n \"title\": \"PithyJS Build Optimization Plugin\",\n \"category\": \"plugin\",\n \"description\": \"Build optimization plugin providing chunk naming strategies, vendor splitting, and route-based code splitting.\",\n \"since\": \"0.0.1\",\n \"stability\": \"stable\",\n \"testing\": {\n \"unit\": { \"required\": false, \"covered\": false },\n \"integration\": { \"required\": true, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport type { Plugin, UserConfig } from 'vite';\n\n/**\n * Build plugin options\n */\ninterface PithyBuildOptions {\n /**\n * Enable vendor chunk splitting for framework packages\n * @default true\n */\n vendorChunks?: boolean;\n\n /**\n * Prefix for lazy-loaded component chunks\n * @default \"lazy-\"\n */\n lazyChunkPrefix?: string;\n\n /**\n * Prefix for route chunks\n * @default \"route-\"\n */\n routeChunkPrefix?: string;\n\n /**\n * Routes directory name (used for route chunk detection)\n * @default \"routes\"\n */\n routesDir?: string;\n\n /**\n * Enable source maps\n * @default true in development, false in production\n */\n sourcemap?: boolean;\n\n /**\n * Build target\n * @default \"esnext\"\n */\n target?: string;\n}\n\nconst DEFAULT_OPTIONS: Required<PithyBuildOptions> = {\n vendorChunks: true,\n lazyChunkPrefix: 'lazy-',\n routeChunkPrefix: 'route-',\n routesDir: 'routes',\n sourcemap: true,\n target: 'esnext',\n};\n\n/**\n * Vite plugin for PithyJS build optimizations.\n *\n * Provides:\n * - Chunk naming strategy for lazy-loaded components\n * - Route-based chunk naming\n * - Framework vendor chunk splitting\n * - Optimized asset naming\n *\n * @param options - Build configuration options\n * @returns Vite plugin\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { pithyBuild } from '@pithyjs/vite-plugin';\n *\n * export default defineConfig({\n * plugins: [\n * pithyBuild(),\n * ],\n * });\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.vite.build-plugin\",\"name\":\"pithyBuild\",\"stability\":\"stable\",\"signature\":\"(options?: PithyBuildOptions) => Plugin\"} */\n/**\n * Whether every path from an entry to `id` crosses at least one `import()`.\n *\n * This is the question the `vendor` catch-all has to ask. A module reached only\n * through a dynamic import is code the app deliberately deferred; naming a\n * chunk for it merges it into a chunk the entry preloads and the deferral is\n * undone. Shiki is the case that exposed this — its WASM engine and ~300\n * grammars — but `parse5` is the same shape, and so is every future lazy\n * dependency. Hence a general rule rather than a list of names.\n *\n * STATIC IMPORTERS ALONE ARE NOT ENOUGH, which is the subtle half: a lazy\n * package's own closure has static importers — `hast-util-to-html` is\n * statically imported by `@shikijs/core`, which is itself only dynamically\n * imported. Asking \"does it have a static importer?\" keeps the closure in\n * `vendor` and leaves the bug in place. The walk has to continue upward until\n * it reaches an entry or a dynamic boundary.\n *\n * A module with no importers at all is an entry, so not deferred. A module\n * shared with eagerly-reachable code returns false and stays in `vendor`,\n * which is what stops it being duplicated into every chunk that wants it.\n */\nfunction isDeferredOnly(\n id: string,\n getModuleInfo: (id: string) => {\n importers: readonly string[];\n dynamicImporters: readonly string[];\n } | null,\n seen: Set<string> = new Set()\n): boolean {\n if (seen.has(id)) return true;\n seen.add(id);\n\n const info = getModuleInfo(id);\n if (!info) return false;\n\n // No static importer, but something `import()`s it: a deferred root.\n if (info.importers.length === 0) return info.dynamicImporters.length > 0;\n\n return info.importers.every(importer =>\n isDeferredOnly(importer, getModuleInfo, seen)\n );\n}\n\nexport function pithyBuild(options: PithyBuildOptions = {}): Plugin {\n const config: Required<PithyBuildOptions> = {\n ...DEFAULT_OPTIONS,\n ...options,\n };\n\n return {\n name: 'pithy:build',\n // Apply only during build\n apply: 'build',\n\n config(): UserConfig {\n return {\n build: {\n rollupOptions: {\n output: {\n // Chunk naming strategy\n chunkFileNames: chunkInfo => {\n const routesPattern = `/${config.routesDir}/`;\n\n // Route chunks get route-based names\n if (chunkInfo.facadeModuleId?.includes(routesPattern)) {\n const routePath =\n chunkInfo.facadeModuleId\n .split(routesPattern)[1]\n ?.replace(/\\+page\\.(ts|js|pithy)$/, '')\n .replace(/\\//g, '-')\n .replace(/-$/, '')\n // Sanitize dynamic route segments: [id] -> _id_, [...slug] -> _slug_\n .replace(/\\[\\.\\.\\.([^\\]]+)\\]/g, '_$1_')\n .replace(/\\[([^\\]]+)\\]/g, '_$1_') || 'index';\n return `assets/${config.routeChunkPrefix}${routePath}-[hash].js`;\n }\n\n // Vendor chunks keep their names\n if (chunkInfo.name?.startsWith('vendor')) {\n return `assets/[name]-[hash].js`;\n }\n\n // Dynamic entry chunks (from dynamic imports) are lazy-loaded components\n // Detect by: isDynamicEntry=true AND not a route AND not a vendor\n if (chunkInfo.isDynamicEntry && chunkInfo.facadeModuleId) {\n const moduleId = chunkInfo.facadeModuleId;\n const isVendor =\n moduleId.includes('node_modules') ||\n moduleId.includes('@pithyjs/') ||\n moduleId.includes('packages/core/') ||\n moduleId.includes('packages/signals/') ||\n moduleId.includes('packages/router/') ||\n moduleId.includes('packages/design-system/');\n\n if (!isVendor) {\n // This is a lazy-loaded component chunk\n return `assets/${config.lazyChunkPrefix}[name]-[hash].js`;\n }\n }\n\n // Default chunk naming\n return 'assets/[name]-[hash].js';\n },\n\n // Entry chunks\n entryFileNames: 'assets/[name]-[hash].js',\n\n // Assets like CSS\n assetFileNames: 'assets/[name]-[hash].[ext]',\n\n // Manual chunk splitting for better caching\n manualChunks: config.vendorChunks\n ? (id, { getModuleInfo }) => {\n // Core framework chunks - cached long-term\n // These patterns work both for local development (packages/)\n // and npm installs (node_modules/@pithyjs/)\n if (\n id.includes('@pithyjs/core') ||\n id.includes('packages/core/')\n ) {\n return 'vendor-pithy-core';\n }\n if (\n id.includes('@pithyjs/signals') ||\n id.includes('packages/signals/')\n ) {\n return 'vendor-pithy-signals';\n }\n if (\n id.includes('@pithyjs/router') ||\n id.includes('packages/router/')\n ) {\n return 'vendor-pithy-router';\n }\n if (\n id.includes('@pithyjs/design-system') ||\n id.includes('packages/design-system/')\n ) {\n return 'vendor-pithy-design';\n }\n\n // Node modules vendor chunk — EXCEPT anything the app only\n // reaches through `import()`. `vendor` is imported by the\n // entry and preloaded by the HTML, so naming a chunk for a\n // deferred module undoes the deferral.\n if (id.includes('node_modules')) {\n return isDeferredOnly(id, getModuleInfo)\n ? undefined\n : 'vendor';\n }\n\n return undefined;\n }\n : undefined,\n },\n },\n sourcemap: config.sourcemap,\n target: config.target,\n },\n };\n },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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AM,EAAE,IAAI;QACZ,MAAM,EACJ,GAAG,IAAI,CAAC,IAAI,sBAAsB,KAAK,CAAC,IAAI,CAAC,YAAY,UAAU;YACnE,YAAY;QACd,IAAI;KACL,CAAC;AACJ,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.vite-plugin-design-system.channel-vars\",\n \"title\": \"Colour Channel Variable Usage Gate\",\n \"category\": \"plugin\",\n \"description\": \"Scans stylesheets for var(--color-*-rgb|-l|-c|-h) so the static palette emits only the channel variables something can read.\",\n \"since\": \"0.1.0\",\n \"stability\": \"experimental\",\n \"risk\": \"high\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"design-system-channel-vars.test.ts\" },\n \"integration\": { \"required\": true, \"covered\": true, \"file\": \"design-system-channel-vars.test.ts\" },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport fg from 'fast-glob';\nimport { readFileSync, readdirSync, statSync } from 'fs';\nimport { dirname, extname, isAbsolute, join, resolve } from 'path';\nimport {\n CHANNEL_SUFFIXES,\n type ChannelSuffix,\n} from '@pithyjs/design-system/palette';\n\nconst CHANNEL_SUFFIX_COUNT = CHANNEL_SUFFIXES.length;\n\n/**\n * The suffix alternation, BUILT from `CHANNEL_SUFFIXES` rather than retyped.\n * Hard-coding it meant adding a suffix silently created a variable no regex\n * could detect — and pushed `CHANNEL_SUFFIX_COUNT` past what the wildcards can\n * ever hold, so the all-suffixes escape below could never fire again.\n * Longest-first so `rgb` is not shadowed by a prefix of itself.\n */\nconst SUFFIX_ALT = [...CHANNEL_SUFFIXES]\n .sort((a, b) => b.length - a.length)\n .join('|');\n\n/**\n * `var(--color-<anything>-<channel>)` as written in a stylesheet.\n *\n * Deliberately not anchored to a token list: state variants, future tokens and\n * a custom prefix all have to match, and a name that matches nothing real only\n * pins open a variable that was going to ship anyway.\n *\n * `var` is spelled case-insensitively by hand rather than with the `i` flag,\n * which would also loosen the suffix alternation — custom property NAMES are\n * case-sensitive, and `--color-x-RGB` is a property nothing here ever emits.\n */\nconst CHANNEL_REF_RE = new RegExp(\n String.raw`[Vv][Aa][Rr]\\(\\s*(--[A-Za-z0-9_-]*-(?:${SUFFIX_ALT}))\\b`,\n 'g'\n);\n\n/**\n * A `var()` whose custom property name is BUILT — SCSS `#{}` or JS `${}` — and\n * still ends in a channel suffix, e.g. `rgb(var(--color-#{$token}-rgb))` in\n * `@pithyjs/design-system`'s generated `u-*` utilities.\n *\n * Which tokens such a loop covers is unknowable from the text, so a hit pins\n * open every variable with that suffix.\n *\n * KNOWN BLIND SPOTS, all of which leave the gate active rather than degrading\n * it — use `channelVarSafelist`, and see BACKLOG #83 for why deciding at purge\n * time removes the whole class:\n * - the whole name held in a variable: `$p: --color-primary-rgb;` then\n * `var(#{$p})`. This is established house style in the design system's own\n * mixins, so it is the likeliest of these to appear;\n * - assembly other than `+`: `[a, b].join('')`, `a.concat(b)`;\n * - an interpolation containing `}` before the suffix, e.g. a helper called\n * with an inline object literal — `{0,500}` stops at the first `}`;\n * - a name whose SUFFIX is itself interpolated.\n *\n * A name ending in the interpolation (`var(--color-#{$scheme})`) is not matched\n * because it is a base-token reference — but note that is only true when the\n * interpolation does not itself carry the suffix.\n */\n// `{0,500}` rather than `*`: unbounded, it rescanned to EOF from\n// every `var(--X${` with no closing brace, which is quadratic in file size\n// (20KB 16ms, 40KB 61ms, 80KB 248ms, 160KB 971ms). Reachable because package\n// roots are deliberately scanned without the build-output ignores, so a\n// dependency's minified dist is read whole. Bounding is what removes the\n// quadratic term; newlines must stay IN the class, or a Prettier-wrapped\n// interpolation stops matching and unpins its whole family.\n//\n// The TRAILING fragment needed the same treatment and did not get it: it\n// excluded whitespace, so a second interpolation containing a space — a SCSS\n// map lookup, a ternary, anything Prettier wrapped — matched nothing. This is\n// load-bearing: all 142 surviving channel declarations rest on this regex\n// matching `_color-utilities.scss`.\nconst DYNAMIC_CHANNEL_REF_RE = new RegExp(\n String.raw`[Vv][Aa][Rr]\\(\\s*(?:--)?[A-Za-z0-9_-]*(?:#\\{[^}]{0,500}\\}|\\$\\{[^}]{0,500}\\})[^;]{0,200}?-(${SUFFIX_ALT})\\b`,\n 'g'\n);\n\n/**\n * A channel name assembled by string concatenation rather than interpolation\n * — `'var(--color-' + token + '-rgb)'`. The opening fragment ends mid-name, so\n * neither regex above can see it; this one keys on the dangling prefix.\n */\n// Anchored to `--color`, and it must SEE a channel suffix as the LAST segment\n// of the trailing fragment. Three things were wrong before:\n// - anchoring alone pinned every suffix for a base-token concat\n// (`'var(--color-' + scheme + ')'`), tripping the all-suffixes escape and\n// switching the gate off build-wide;\n// - the trailing fragment must CLOSE the var() call: without the `)`,\n// `'var(--color-' + t + ')' + 'chip-l'` matched on an unrelated adjacent\n// string and switched the gate off build-wide;\n// - `['\"`]-(?:rgb|l|c|h)\\b` required the suffix immediately after the quote,\n// so `'-hover-rgb)'` and `'-focus-l)'` — real state-variant channel\n// variables — were missed, while `'-l-delta)'` matched on `\\b` and was a\n// false positive;\n// - `[^;\\n]` forbade newlines, so the shape stopped matching the moment\n// Prettier wrapped it — the identical bug fixed for the sibling detector,\n// never applied here.\n// A concat whose SUFFIX is itself dynamic still matches nothing; that is what\n// `channelVarSafelist` is for, as is a palette built with a custom `prefix`.\nconst CONCAT_CHANNEL_REF_RE = new RegExp(\n String.raw`[Vv][Aa][Rr]\\(\\s*['\"\\`]?--color[A-Za-z0-9_-]*-['\"\\`]\\s*\\+[^;]{0,200}['\"\\`][A-Za-z0-9_-]*?-(?:${SUFFIX_ALT})\\)`,\n 'g'\n);\n\n/**\n * File types that can carry a `var()` in a PithyJS app.\n *\n * This repo has none of `tsx`/`jsx`/`vue`/`svelte`/`astro`/`sass`/`less`, but\n * the plugin is PUBLISHED and its default `include` advertises `src/**\\/*.tsx`\n * — so `tsx` stays. A file this list omits is never opened, which drops the\n * variables it reads with `degraded: false`: the one direction that is a bug.\n * The rest are left out because nothing advertises them.\n */\nconst SCAN_EXTENSIONS = [\n 'css',\n 'scss',\n 'ts',\n 'tsx',\n 'mts',\n 'cts',\n 'js',\n 'jsx',\n 'mjs',\n 'cjs',\n 'pithy',\n 'html',\n // `iconsPlugin/optimize.ts` deliberately preserves `<style>` in SVGs.\n 'svg',\n // The sibling `packages/ssr/src/build/collect-css.ts` matches both and\n // inlines them into every exported page, so a reference in one reaches a\n // static page while this scan could not see it.\n 'sass',\n 'less',\n];\n\n/** Extensions as a lookup, for the dev watcher's per-file relevance check. */\nconst SCAN_EXTENSION_SET = new Set(SCAN_EXTENSIONS.map(e => `.${e}`));\n\n/**\n * Never scanned, in any root. Unambiguous test markers only: a file named\n * `*.test.*` ships no CSS anywhere, whereas a DIRECTORY called `tests` may be a\n * route (`src/routes/tests/+page.scss`), which is why it is not listed here.\n */\nconst ALWAYS_IGNORED = [\n '**/node_modules/**',\n '**/.git/**',\n '**/coverage/**',\n '**/__tests__/**',\n '**/*.test.*',\n '**/*.spec.*',\n];\n\n/**\n * Additionally ignored in a DEPENDENCY root: a library's nested `tests`\n * directories are certainly tests, and they quote channel names as fixtures.\n */\nconst PACKAGE_IGNORED = [...ALWAYS_IGNORED, '**/tests/**'];\n\n/**\n * Additionally ignored under the Vite root — an app's own build output, and its\n * the build output directories below. `tests` is deliberately NOT here: a\n * directory called `tests` may be a route, and this repo has one.\n *\n * All anchored to the root: unanchored, `**\\/build/**` would skip\n * `src/routes/build/+page.scss` on a site that has a `/build` page.\n *\n * NOT applied to package roots: a published `@pithyjs/ui-kit` ships its\n * component SCSS inside `dist`, and skipping it there would drop a variable\n * that really is read, which is the one direction this module must never fail.\n */\nconst BUILD_OUTPUT_IGNORED = [\n 'dist/**',\n 'out/**',\n 'build/**',\n '.vite/**',\n '.output/**',\n];\n\n/**\n * Channel variables composed at runtime from a string, which no scan can see.\n *\n * `ShadowManager.resolveTintColor()` reads `--color-${color}-rgb` through\n * `getComputedStyle` for the three brand tints, so a brand-tinted shadow in an\n * app that never calls `initTheme()` would otherwise read an undefined token.\n */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"DEFAULT_CHANNEL_VAR_SAFELIST\",\"stability\":\"experimental\",\"signature\":\"readonly string[]\"} */\nexport const DEFAULT_CHANNEL_VAR_SAFELIST: readonly string[] = [\n '--color-primary-rgb',\n '--color-secondary-rgb',\n '--color-tertiary-rgb',\n];\n\n/**\n * Index of the unescaped quote closing the one at `start`.\n *\n * A template literal legitimately spans lines, and this repo writes CSS that\n * way (`colors/generate-utilities.ts`). Stopping at the newline left the scan\n * INSIDE the literal, where a `/*` in prose pairs with a later `*\\/` and eats\n * the live references between — the same loss as an unhandled line comment.\n * `'`/`\"` still stop at the newline so an apostrophe in prose cannot open a\n * span that swallows the rest of the file.\n */\nfunction closingQuote(text: string, start: number): number {\n const q = text[start];\n const multiline = q === '`';\n for (let i = start + 1; i < text.length; i++) {\n const c = text[i];\n if (c === '\\\\') i++;\n else if (c === '\\n' && !multiline) return -1;\n else if (c === q) return i;\n }\n return -1;\n}\n\n/**\n * Remove comments before scanning, so a documented example does not read as\n * usage — `_colors.scss` shows `var(--color-primary-l)` in a docblock.\n *\n * Quoted spans are stepped over, so `content: \"/*\"` cannot pair with a later\n * close and swallow the live references between them. A quote with no partner\n * on its own line is ordinary text, so prose (\"don't\") never opens a span, and\n * an unterminated `/*` leaves the rest of the file intact.\n *\n * A comment opener must sit where a comment can START — after input start,\n * whitespace, or one of `;{}` `,` (and `(` for `/*`). Keying on which single\n * character precedes it was tried twice and failed twice: requiring whitespace\n * let `;//` and `}//` through, and excluding only `:`/`(` let the `/` in a\n * base64 blob, an unquoted `href=//cdn/x` and `\\/\\/` inside a regex literal\n * open one. A positive position test rejects all of those, because `src/*.scss`,\n * `AA//BB` and `[^/*]` have an identifier character in front.\n *\n * Every ambiguity here resolves toward NOT stripping: an unstripped docblock\n * over-keeps a variable, a mis-stripped span drops a live one.\n */\n/**\n * End of a `url(` span, honouring quotes and nesting.\n *\n * `indexOf(')')` closed on a `)` INSIDE the quoted URL — `url(\"x),/*y\")` — so\n * the scanner resumed inside URL text, where a `/*` then opened a real block\n * comment. Reachable in an unencoded inline SVG data URI, or any path with\n * parentheses. Seventh position of this class, in the span added to close it.\n */\nfunction closingUrlParen(text: string, from: number): number {\n let depth = 1;\n let quote = '';\n for (let i = from; i < text.length; i++) {\n const c = text[i];\n if (c === '\\\\') {\n i++;\n continue;\n }\n if (quote) {\n if (c === quote) quote = '';\n continue;\n }\n if (c === '\"' || c === \"'\") quote = c;\n else if (c === '(') depth++;\n else if (c === ')' && --depth === 0) return i;\n }\n return -1;\n}\n\n/**\n * End of the regex literal opening at `at`, or -1.\n *\n * Only needed so a literal's contents cannot open a comment or a string: the\n * span is emitted VERBATIM, so any `var()` inside it is still scanned and\n * mistaking a division for a regex can never lose a reference. Without this,\n * the backtick in this module's own `/[\"'`]|.../` character class read as a\n * template-literal opener and misaligned the rest of the file.\n */\nfunction closingSlash(text: string, at: number): number {\n let inClass = false;\n for (let i = at + 1; i < text.length; i++) {\n const c = text[i];\n if (c === '\\\\') {\n i++;\n continue;\n }\n if (c === '\\n') return -1;\n if (inClass) {\n if (c === ']') inClass = false;\n } else if (c === '[') inClass = true;\n else if (c === '/') return i;\n }\n return -1;\n}\n\n/** Whether a `/` at `at` can start a regex literal rather than divide. */\nfunction opensRegex(text: string, at: number): boolean {\n let i = at - 1;\n for (; i >= 0 && /\\s/.test(text[i]); i--);\n if (i < 0) return true;\n if ('(,=:[!&|?{;+*%<>~^'.includes(text[i])) return true;\n // A KEYWORD position too. `return /[ /*]/.test(c)` was read as division, so\n // the `/*` inside the character class opened a real block comment — the\n // eighth position of this class, inside the code added to close the first six.\n const word = /[A-Za-z$_]+$/.exec(text.slice(Math.max(0, i - 11), i + 1));\n return word !== null && KEYWORDS_BEFORE_REGEX.has(word[0]);\n}\n\n/** Keywords a regex literal may follow; after an operand, `/` divides. */\nconst KEYWORDS_BEFORE_REGEX = new Set([\n 'return',\n 'typeof',\n 'case',\n 'in',\n 'of',\n 'new',\n 'delete',\n 'void',\n 'instanceof',\n 'do',\n 'else',\n 'yield',\n 'await',\n 'throw',\n]);\n\n/**\n * Which comment syntaxes a file's language actually has.\n *\n * `stripComments` had no idea what it was reading, so it applied JS/CSS rules\n * to text where `//` and `/*` are ordinary characters. Two live losses came\n * from exactly that: `:root{--cdn: //cdn.example.com}` in a minified `.css`\n * (plain CSS has NO line comment, and package roots are deliberately scanned\n * without the build-output ignores, so a dependency's minified dist is this\n * shape), and `/*` written as prose in `.html`.\n *\n * Erring toward NOT stripping is the safe direction — an unstripped docblock\n * over-keeps a variable, a mis-stripped span drops a live one — so an unknown\n * extension gets both, matching the previous behaviour, and `.html`/`.svg` get\n * neither. A `<style>` block inside them keeps its comments, which can only\n * over-keep.\n */\nfunction commentSyntax(ext: string): { line: boolean; block: boolean } {\n switch (ext.replace(/^\\./, '').toLowerCase()) {\n case 'css':\n return { line: false, block: true };\n // `.pithy` sits with them: it is `<template>` + `<script>` + plain-CSS\n // `<style>`, so prose `/*` in the template paired with the real `*/` in the\n // style block and ate the rule between — the `.css` bug this function\n // exists to fix, in the project's own format. `<script>` genuinely has\n // `//`, so disabling both over-keeps its commented-out examples; that is\n // the safe direction, and per-block handling is not worth it for 7 files.\n case 'html':\n case 'svg':\n case 'pithy':\n return { line: false, block: false };\n default:\n return { line: true, block: true };\n }\n}\n\n/**\n * Whether a comment opener at `at` is in a position a comment can start.\n *\n * `block` allows `(` as well, for `foo(/* x *\\/ y)`. `//` must not, or\n * `url(//cdn/x)` reads as a comment.\n */\nfunction opensComment(text: string, at: number, block: boolean): boolean {\n if (at === 0) return true;\n const prev = text[at - 1];\n if (/\\s/.test(prev)) return true;\n if (prev === ';' || prev === '{' || prev === '}' || prev === ',') return true;\n return block && prev === '(';\n}\n\nfunction stripComments(text: string, ext = ''): string {\n const syntax = commentSyntax(ext);\n let noCloser = false;\n const interesting = /[Uu][Rr][Ll]\\(|[\"'`]|\\/\\*|\\/\\/|\\//g;\n let out = '';\n let i = 0;\n\n for (let m = interesting.exec(text); m; m = interesting.exec(text)) {\n const at = m.index;\n out += text.slice(i, at);\n\n if (m[0].length === 4) {\n // `url(...)` is OPAQUE, like a quote or a regex literal: emitted\n // verbatim, so its contents cannot open anything. A base64 payload\n // beginning `//` (a standard BMP/ICO prefix) sat right after the `,`\n // that `opensComment` accepts, and on a minified one-line file the\n // \"comment\" then ran to EOF. This also subsumes `url(//cdn/x)` and\n // `url(img/*.png)`. Refs inside are still found, since the text stays.\n const close = closingUrlParen(text, at + 4);\n if (close === -1) {\n out += m[0];\n i = at + 4;\n } else {\n out += text.slice(at, close + 1);\n i = close + 1;\n }\n } else if (m[0] === '//') {\n if (!syntax.line || !opensComment(text, at, false)) {\n // Emit the REST OF THE LINE verbatim, not just the two characters.\n // Re-feeding the retained text let a space-preceded `/*` inside it\n // open a real block comment running to the next `*/` — the loss kept\n // coming back through the retained text while four rounds replaced the\n // predicate. Opaque spans are what the quote and regex branches do.\n const nl = text.indexOf('\\n', at);\n const stop = nl === -1 ? text.length : nl;\n out += text.slice(at, stop);\n i = stop;\n } else {\n const nl = text.indexOf('\\n', at);\n out += ' ';\n i = nl === -1 ? text.length : nl;\n }\n } else if (m[0] === '/*') {\n // Language and position FIRST: `.html`/`.svg` have no block comment, and\n // the `indexOf` below is a scan to EOF whose result they then discard.\n if (!syntax.block || noCloser || !opensComment(text, at, true)) {\n out += m[0];\n i = at + 2;\n interesting.lastIndex = i;\n continue;\n }\n const end = text.indexOf('*/', at + 2);\n if (end === -1) {\n // No `*/` after here means none after any LATER `/*` either, so stop\n // searching. Without this latch every `/*` in a file with no closer\n // rescanned to EOF — quadratic, 1.9 s on 70 KB of `/* `.\n noCloser = true;\n out += m[0];\n i = at + 2;\n interesting.lastIndex = i;\n continue;\n }\n out += ' ';\n i = end + 2;\n } else if (m[0] === '/') {\n const end = opensRegex(text, at) ? closingSlash(text, at) : -1;\n if (end === -1) {\n out += m[0];\n i = at + 1;\n } else {\n out += text.slice(at, end + 1);\n i = end + 1;\n }\n } else {\n const end = closingQuote(text, at);\n if (end === -1) {\n out += m[0];\n i = at + 1;\n } else {\n out += text.slice(at, end + 1);\n i = end + 1;\n }\n }\n interesting.lastIndex = i;\n }\n\n return out + text.slice(i);\n}\n\n/**\n * Every channel variable `text` reads.\n *\n * @param text - Stylesheet or source text.\n * @returns The fully-qualified custom property names referenced by `var()`.\n *\n * @example\n * ```typescript\n * collectChannelVarRefs('.m{background:rgb(var(--color-overlay-rgb) / 0.55)}');\n * // Set { '--color-overlay-rgb' }\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"collectChannelVarRefs\",\"stability\":\"experimental\",\"signature\":\"(text: string) => Set<string>\"} */\nexport function collectChannelVarRefs(text: string, ext = ''): Set<string> {\n const refs = new Set<string>();\n for (const match of stripComments(text, ext).matchAll(CHANNEL_REF_RE)) {\n refs.add(match[1]);\n }\n return refs;\n}\n\n/**\n * Channel suffixes `text` reads through a name it BUILDS rather than writes.\n *\n * @param text - Stylesheet or source text.\n * @returns The suffixes whose whole family must be kept; see\n * {@link DYNAMIC_CHANNEL_REF_RE} for what does and does not count.\n *\n * @example\n * ```typescript\n * collectDynamicChannelSuffixes('a{b:rgb(var(--color-#{$token}-rgb))}');\n * // Set { 'rgb' }\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"collectDynamicChannelSuffixes\",\"stability\":\"experimental\",\"signature\":\"(text: string) => Set<ChannelSuffix>\"} */\nexport function collectDynamicChannelSuffixes(\n text: string,\n ext = ''\n): Set<ChannelSuffix> {\n const suffixes = new Set<ChannelSuffix>();\n const source = stripComments(text, ext);\n for (const match of source.matchAll(DYNAMIC_CHANNEL_REF_RE)) {\n suffixes.add(match[1] as ChannelSuffix);\n }\n // A concatenated name hides its suffix in a later fragment, so which family\n // it reads is unknowable. Keep all of them.\n if (CONCAT_CHANNEL_REF_RE.test(source)) {\n CONCAT_CHANNEL_REF_RE.lastIndex = 0;\n for (const suffix of CHANNEL_SUFFIXES) suffixes.add(suffix);\n }\n return suffixes;\n}\n\n/** Whether a changed file could contain a channel reference — dev watcher. */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"isChannelScanCandidate\",\"stability\":\"experimental\",\"signature\":\"(filePath: string) => boolean\"} */\nexport function isChannelScanCandidate(filePath: string): boolean {\n // Lower-cased to match the glob's `caseSensitiveMatch: false`: a `.SCSS`\n // the scan reads but the watcher ignores goes stale on every edit.\n if (!SCAN_EXTENSION_SET.has(extname(filePath).toLowerCase())) return false;\n // A file the scan always ignores cannot change the result, so rescanning on\n // it is pure cost — and saving a test file is the common case.\n const unix = filePath.replace(/\\\\/g, '/');\n return (\n // ONLY what every root ignores. Adding the build-output names here was\n // wrong in the other direction: the scan's `BUILD_OUTPUT_IGNORED` is\n // anchored to the Vite root and is deliberately NOT applied to package\n // roots, so `src/routes/build/+page.scss` and a package's `dist/*.scss`\n // are both scanned — and this check was refusing to rescan them, leaving\n // the dev sheet stale for the session. An extra rescan costs time; a\n // missed one is wrong output, so this errs toward rescanning. (The SSG\n // export's own `.html` writes still trip it — cost only, since\n // `sameChannelScan` discards the result.)\n !/(^|\\/)(node_modules|\\.git|coverage|__tests__)\\//.test(unix) &&\n !/\\.(test|spec)\\.[^/]+$/.test(unix)\n );\n}\n\n/** Outcome of a filesystem scan. `degraded` means: keep every channel variable. */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"ChannelVarScan\",\"stability\":\"experimental\",\"signature\":\"interface ChannelVarScan\"} */\nexport interface ChannelVarScan {\n refs: Set<string>;\n /** Suffixes read through a built name — every variable with one is kept. */\n wildcardSuffixes: Set<ChannelSuffix>;\n degraded: boolean;\n reason?: string;\n filesScanned: number;\n}\n\n/**\n * `false` only for \"not there\". An EACCES or ELOOP means \"cannot tell\", and\n * collapsing that to `false` routed a real install to `absent` — the one\n * classification that keeps the gate ACTIVE. Those throw instead, so the\n * caller degrades.\n */\nfunction statKind(p: string): 'dir' | 'file' | 'other' | 'missing' {\n try {\n const st = statSync(p);\n return st.isDirectory() ? 'dir' : st.isFile() ? 'file' : 'other';\n } catch (err) {\n const code = (err as NodeJS.ErrnoException)?.code;\n if (code === 'ENOENT' || code === 'ENOTDIR') return 'missing';\n throw err;\n }\n}\n\nfunction isDir(p: string): boolean {\n return statKind(p) === 'dir';\n}\n\nfunction isFile(p: string): boolean {\n return statKind(p) === 'file';\n}\n\n/**\n * Where a framework package's source tree is — or why it could not be found.\n *\n * `absent` and `unresolvable` are deliberately different answers. A package\n * nobody installed cannot contribute CSS to the output, so skipping it is\n * certain. A package that may be installed but cannot be located — a partial\n * install, or a layout with no `node_modules` at all, such as Yarn PnP — may\n * have its SCSS in the bundle regardless, and that is uncertainty.\n */\ntype PackageDirLookup =\n | { kind: 'dir'; dir: string }\n | { kind: 'absent' }\n | { kind: 'unresolvable'; reason: string };\n\n/**\n * Locate a framework package's source tree so its component SCSS can be read.\n *\n * A Vite alias first (the monorepo case, pointing at `src`), then\n * {@link probePackage}. Not found resolves to `absent` only when nothing\n * declares the package; otherwise it degrades — see the body.\n */\nfunction resolvePackageDir(\n name: string,\n aliases: unknown,\n from: string\n): PackageDirLookup {\n const aliased = aliasReplacement(name, aliases);\n if (aliased) {\n if (isDir(aliased)) return { kind: 'dir', dir: aliased };\n // An alias may point at an entry FILE (`.../src/index.ts`). A path that is\n // neither is returned as-is so the scan degrades rather than silently\n // scanning its parent.\n return { kind: 'dir', dir: isFile(aliased) ? dirname(aliased) : aliased };\n }\n\n const probe = probePackage(name, from);\n if (probe.dir) return { kind: 'dir', dir: probe.dir };\n\n // `absent` means CERTAINLY not installed, and only that answer keeps the\n // gate on. Everything else degrades, which keeps every channel variable:\n // - a directory with no manifest — something IS installed, unreadable;\n // - no `node_modules` anywhere (Yarn PnP) — nothing can be ruled out;\n // - declared but not found — pnpm's isolated store, a partial install.\n // Guessing `absent` in any of those leaves the gate active and blind to the\n // package that reads these variables.\n if (probe.dirWithoutManifest) {\n return {\n kind: 'unresolvable',\n reason: `${probe.dirWithoutManifest} has no package.json`,\n };\n }\n if (!probe.sawNodeModules) {\n return {\n kind: 'unresolvable',\n reason: `no node_modules tree above ${from}`,\n };\n }\n return isDeclaredDependency(name, from)\n ? {\n kind: 'unresolvable',\n reason: `${name} is declared but was not found on disk from ${from}`,\n }\n : { kind: 'absent' };\n}\n\n/**\n * `pkg@1.2.3_peer@4.5.6` → `['pkg', [1,2,3]]`.\n *\n * The peer suffix is cut FIRST. Reading the version from the last `@` picked\n * the PEER's version instead — replayed against this repo's store, 23 of 109\n * names resolved to a non-newest copy, worst case prettier 2.8.8 over 3.5.3\n * via `_@changesets+apply-release-plan@7.1.1`.\n */\nfunction parseStoreEntry(entry: string): { pkg: string; version: number[] } {\n const base = entry.split('_')[0];\n const at = base.lastIndexOf('@');\n const pkg = at > 0 ? base.slice(0, at) : base;\n const raw = at > 0 ? base.slice(at + 1) : '';\n return {\n pkg,\n version: raw.split(/[.\\-+]/).map(n => (/^\\d+$/.test(n) ? Number(n) : -1)),\n };\n}\n\n/**\n * Orders `.pnpm` entries so the probe reads the newest copy OF THE PACKAGE it\n * is looking for. An entry can host `name` nested under a different package,\n * so entries whose own package IS `name` sort first — otherwise the comparator\n * would be ranking unrelated versions.\n */\nfunction compareStoreEntries(name: string, a: string, b: string): number {\n const want = name.replace(/\\//g, '+');\n const pa = parseStoreEntry(a);\n const pb = parseStoreEntry(b);\n const exact = (p: { pkg: string }) => (p.pkg === want ? 0 : 1);\n const byExact = exact(pa) - exact(pb);\n if (byExact !== 0) return byExact;\n for (let i = 0; i < Math.max(pa.version.length, pb.version.length); i++) {\n const d = (pb.version[i] ?? -1) - (pa.version[i] ?? -1);\n if (d !== 0) return d;\n }\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\ninterface PackageProbe {\n dir: string | null;\n dirWithoutManifest: string | null;\n sawNodeModules: boolean;\n}\n\n/**\n * Walk up looking for the package, recording what was seen on the way.\n *\n * Probes `node_modules/<name>` and pnpm's isolated store, where a transitive\n * dependency lives only at `node_modules/.pnpm/<pkg>@<ver>/node_modules/<name>`\n * with no top-level link.\n *\n * NOT `require.resolve`: `@pithyjs/ui-kit` and `@pithyjs/design-system`\n * declare `exports` with an `import` condition and no `require` one, so a CJS\n * resolver rejects both with `ERR_PACKAGE_PATH_NOT_EXPORTED` — the entry and\n * the `package.json` subpath alike. The directory is right there either way.\n */\nfunction probePackage(name: string, from: string): PackageProbe {\n const out: PackageProbe = {\n dir: null,\n dirWithoutManifest: null,\n sawNodeModules: false,\n };\n let dir = from;\n for (;;) {\n const modules = join(dir, 'node_modules');\n if (isDir(modules)) out.sawNodeModules = true;\n\n const direct = join(modules, name);\n if (isFile(join(direct, 'package.json'))) {\n out.dir = direct;\n return out;\n }\n\n // npm nests a conflicting version under its dependent, so the package can\n // live at `node_modules/<dep>/node_modules/<name>`. Missing it classified\n // a real install as `absent` — the one answer that keeps the gate on.\n for (const host of ['@pithyjs/ui-kit', '@pithyjs/design-system']) {\n if (host === name) continue;\n const nested = join(modules, host, 'node_modules', name);\n if (isFile(join(nested, 'package.json'))) {\n out.dir = nested;\n return out;\n }\n }\n if (out.dirWithoutManifest === null && isDir(direct)) {\n out.dirWithoutManifest = direct;\n }\n\n const store = join(modules, '.pnpm');\n if (isDir(store)) {\n let entries: string[] = [];\n try {\n // Sorted by VERSION, descending. The store holds one name at several\n // versions (and under other packages' entries), and `readdirSync`\n // order is filesystem dependent, so taking whichever came first made\n // the palette differ between machines on one lockfile. A plain\n // lexicographic sort then preferred `@1.0.0` over `@2.0.0` and `@12`\n // over `@22`; this is still a guess, but the newest copy is the one a\n // bundler is likeliest to have resolved.\n entries = readdirSync(store).sort((x, y) =>\n compareStoreEntries(name, x, y)\n );\n } catch {\n entries = [];\n }\n for (const entry of entries) {\n const candidate = join(store, entry, 'node_modules', name);\n if (isFile(join(candidate, 'package.json'))) {\n out.dir = candidate;\n return out;\n }\n }\n }\n\n const up = dirname(dir);\n if (up === dir) return out;\n dir = up;\n }\n}\n\n/** Whether any `package.json` above `from` lists `name` in a dependency field. */\nfunction isDeclaredDependency(name: string, from: string): boolean {\n const FIELDS = [\n 'dependencies',\n 'devDependencies',\n 'peerDependencies',\n 'optionalDependencies',\n ] as const;\n let dir = from;\n for (;;) {\n const manifest = join(dir, 'package.json');\n if (isFile(manifest)) {\n try {\n const json = JSON.parse(readFileSync(manifest, 'utf8')) as Record<\n string,\n Record<string, string> | undefined\n >;\n // A non-object dependency field cannot prove absence. `in` on an\n // array or null answers false, which routed a declared package to\n // `absent` — strictly worse than an UNPARSEABLE manifest, which\n // already fails open below.\n for (const f of FIELDS) {\n const field = json[f];\n if (field === undefined || field === null) continue;\n if (typeof field !== 'object' || Array.isArray(field)) return true;\n if (name in field) return true;\n }\n } catch {\n // An unreadable manifest cannot prove absence.\n return true;\n }\n }\n const up = dirname(dir);\n if (up === dir) return false;\n dir = up;\n }\n}\n\nfunction aliasReplacement(name: string, aliases: unknown): string | null {\n if (!Array.isArray(aliases)) return null;\n for (const entry of aliases as Array<{\n find?: string | RegExp;\n replacement?: string;\n }>) {\n if (typeof entry.replacement !== 'string') continue;\n\n if (typeof entry.find === 'string') {\n // Vite's own rule: equal, or a prefix ending at a `/` SEGMENT boundary\n // (`importee === pattern || importee.startsWith(pattern + '/')`).\n // Omitting the boundary let `{find:'@'}` — a very common config — build\n // `<src>pithyjs/ui-kit` out of `@pithyjs/ui-kit`.\n if (entry.find === name) return entry.replacement;\n if (name.startsWith(`${entry.find}/`)) {\n return entry.replacement + name.slice(entry.find.length);\n }\n\n // A SUBPATH alias (`@pithyjs/ui-kit/styles`) names a directory inside\n // the package, so peel the subpath off to get the package root. If the\n // replacement does not end with that subpath — every app here maps\n // `/styles` to `.../styles/index.scss` — the root cannot be derived, so\n // give up on this entry rather than return the subpath. Returning it\n // narrowed the scan to one directory, and which of the two happened\n // depended on the ORDER of keys in the alias object.\n if (entry.find.startsWith(`${name}/`)) {\n const sub = entry.find.slice(name.length);\n if (entry.replacement.endsWith(sub)) {\n return entry.replacement.slice(0, -sub.length);\n }\n continue;\n }\n } else if (entry.find instanceof RegExp) {\n // A LOCAL CLONE. The alias object belongs to Vite, which calls\n // `pattern.test(importee)` on it for every later import — and `test` and\n // `[Symbol.replace]` both advance `lastIndex` on a /y or /g pattern.\n // Resetting before the call was not enough: leaving it advanced AFTER\n // made the user's alias stop resolving for the rest of the build, a\n // module-resolution failure caused by a CSS plugin. Never mutate it.\n const find = new RegExp(entry.find.source, entry.find.flags);\n if (find.test(name)) {\n find.lastIndex = 0;\n // STRING replacement: `$1` is the documented Vite API, and\n // `{find: /^@pithyjs\\/(.*)$/, replacement: 'packages/$1/src'}` is the\n // canonical monorepo alias.\n return name.replace(find, entry.replacement);\n }\n }\n }\n return null;\n}\n\n/** One directory to scan, with the ignore set its kind warrants. */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"ChannelScanRoot\",\"stability\":\"experimental\",\"signature\":\"interface ChannelScanRoot\"} */\nexport interface ChannelScanRoot {\n dir: string;\n ignore: string[];\n}\n\n/** Everything one build can be scanned over, and what could not be located. */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"ChannelScanPlan\",\"stability\":\"experimental\",\"signature\":\"interface ChannelScanPlan\"} */\nexport interface ChannelScanPlan {\n roots: ChannelScanRoot[];\n /** Packages the bundler may still see — each one degrades the scan. */\n unresolvable: string[];\n}\n\n/** Scan roots for one build: the Vite root, the framework packages, extras. */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"resolveChannelScanRoots\",\"stability\":\"experimental\",\"signature\":\"(viteRoot: string, aliases: unknown, extraRoots?: string[]) => ChannelScanPlan\"} */\nexport function resolveChannelScanRoots(\n viteRoot: string,\n aliases: unknown,\n extraRoots: string[] = []\n): ChannelScanPlan {\n // Validate rather than throw from deep inside. A string passed where an\n // array belongs used to surface as `scan threw: TypeError: …map is not a\n // function` — a config mistake reported as an internal failure, which then\n // turned the feature off. Named here, it degrades with a usable message.\n if (!Array.isArray(extraRoots)) {\n return {\n roots: [],\n unresolvable: [\n `channelVarScanRoots must be an array of paths, received ${typeof extraRoots}`,\n ],\n };\n }\n for (const entry of extraRoots) {\n if (typeof entry !== 'string' || entry === '') {\n return {\n roots: [],\n unresolvable: [\n `channelVarScanRoots entries must be non-empty strings, received ${JSON.stringify(entry)}`,\n ],\n };\n }\n }\n const roots: ChannelScanRoot[] = [\n { dir: viteRoot, ignore: [...ALWAYS_IGNORED, ...BUILD_OUTPUT_IGNORED] },\n // Resolved against the Vite root, like `include`/`exclude` — a relative\n // entry used to be evaluated against `process.cwd()`, so a monorepo-root\n // config could scan a same-named directory in the wrong tree and still\n // report `degraded: false`.\n //\n // Only the UNIVERSAL ignores. Not the dependency set, which excludes\n // `**/tests/**` while a directory called `tests` may be a route (this repo\n // has `apps/basic-app/src/routes/tests/`); and not the ROOT set, which\n // skips `dist/**`, where a published library's CSS exists\n // nowhere else — a root someone names explicitly is one they want read.\n // The dependency set is also wrong here, because it excludes\n // `**/tests/**` and a directory called `tests` may be a route.\n ...extraRoots.map(dir => ({\n dir: isAbsolute(dir) ? dir : join(viteRoot, dir),\n ignore: [...ALWAYS_IGNORED],\n })),\n ];\n const unresolvable: string[] = [];\n\n // UI Kit ships the component SCSS that consumes these variables, and the\n // design system ships the mixins; neither lives under the Vite root.\n for (const pkg of ['@pithyjs/ui-kit', '@pithyjs/design-system']) {\n const found = resolvePackageDir(pkg, aliases, viteRoot);\n if (found.kind === 'dir')\n roots.push({ dir: found.dir, ignore: PACKAGE_IGNORED });\n else if (found.kind === 'unresolvable') unresolvable.push(found.reason);\n }\n\n // Dedupe on the RESOLVED path, and keep the WIDEST ignore set for a path\n // reached twice. Exact string identity meant `channelVarScanRoots: ['.']`\n // collapsed into the Vite root and silently inherited its build-output\n // ignores — so `dist/**` went unread — while `'./'`, the same intent, stayed\n // separate and read it. An explicitly named root is one someone wants read,\n // so the narrower set must not win.\n const byPath = new Map<string, ChannelScanRoot>();\n for (const root of roots) {\n const key = resolve(root.dir);\n const prev = byPath.get(key);\n if (prev === undefined) {\n byPath.set(key, { ...root, dir: key });\n continue;\n }\n // INTERSECTION, not the shorter array. The two ignore sets are not nested:\n // `PACKAGE_IGNORED` has fewer entries than the root set but ADDS\n // `**/tests/**`, so picking it by length hid `src/routes/tests/` — the\n // exact file the root set exists to keep. Only a pattern both sets ignore\n // is safe to ignore here.\n const both = new Set(prev.ignore);\n byPath.set(key, {\n ...root,\n dir: key,\n ignore: root.ignore.filter(p => both.has(p)),\n });\n }\n return { roots: [...byPath.values()], unresolvable };\n}\n\n/**\n * Read every scannable file under `plan.roots` and union the channel variables\n * they reference.\n *\n * **Fails OPEN, and this is the module's one invariant.** A root that is\n * missing, a root a glob matched no file in, a package that will not resolve, a\n * glob that throws, a file that cannot be read — each sets `degraded`, and a\n * degraded scan makes the caller emit every channel variable. A variable\n * dropped by mistake renders a JavaScript-disabled page wrong; a variable kept\n * by mistake costs bytes. Only one of those is a bug.\n *\n * @example\n * ```typescript\n * const scan = scanChannelVarRefs(resolveChannelScanRoots(config.root, alias));\n * if (scan.degraded) console.warn(scan.reason);\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"scanChannelVarRefs\",\"stability\":\"experimental\",\"signature\":\"(plan: ChannelScanPlan) => ChannelVarScan\"} */\nexport function scanChannelVarRefs(plan: ChannelScanPlan): ChannelVarScan {\n const refs = new Set<string>();\n const wildcardSuffixes = new Set<ChannelSuffix>();\n let filesScanned = 0;\n let readFailure: string | undefined;\n\n const fail = (reason: string): ChannelVarScan => ({\n refs,\n wildcardSuffixes,\n degraded: true,\n reason,\n filesScanned,\n });\n\n if (plan.unresolvable.length > 0) {\n return fail(`unresolvable package: ${plan.unresolvable.join('; ')}`);\n }\n\n for (const { dir: root, ignore } of plan.roots) {\n // `statKind` rethrows EACCES/ELOOP so the caller can degrade — but this,\n // the first caller, was not catching, so the module threw where its own\n // invariant says it fails open. An unreadable directory is the common\n // CI/Docker shape; only an unreadable FILE was covered.\n let readable: boolean;\n try {\n readable = isDir(root);\n } catch (err) {\n return fail(`unreadable root ${root}: ${String(err)}`);\n }\n if (!readable) return fail(`unreadable root: ${root}`);\n\n let files: string[];\n try {\n // Every option here widens rather than narrows, because a file this\n // scan does not read is a variable it drops. `dot` reaches generated\n // `.generated/` trees; `caseSensitiveMatch: false` reaches `D.SCSS` on\n // the case-insensitive filesystems Vite resolves it on; symlinks are\n // followed because a linked source tree is source.\n files = fg.sync(`**/*.{${SCAN_EXTENSIONS.join(',')}}`, {\n cwd: root,\n absolute: true,\n ignore,\n followSymbolicLinks: true,\n // Bounded. `followSymbolicLinks` with no cap turns one upward link\n // into exponential path growth and a cycle into a non-terminating\n // walk — which hangs `buildStart` and the dev rescan, with no throw\n // and so no degradation signal. No real source tree is 24 deep.\n deep: 24,\n // NOT suppressed. Swallowing a per-entry EACCES/ELOOP returns a\n // PARTIAL list with no error, so every reference in the unreadable\n // subtree is dropped while `degraded` stays false — a root-owned\n // directory in a CI or Docker build ships an incomplete palette and\n // says nothing. Surfacing the throw degrades instead, which keeps\n // every variable.\n suppressErrors: false,\n dot: true,\n caseSensitiveMatch: false,\n });\n } catch (err) {\n return fail(`glob failed in ${root}: ${String(err)}`);\n }\n\n // An empty match is uncertainty, not evidence of absence: a mis-anchored\n // ignore or a tree laid out unexpectedly looks exactly like this.\n if (files.length === 0) return fail(`no scannable files under ${root}`);\n\n for (const file of files) {\n let content: string;\n try {\n content = readFileSync(file, 'utf-8');\n } catch (err) {\n // Keep reading rather than abort on the first failure, so one\n // unreadable file does not decide the whole scan. A file present at\n // glob time and gone at read time is routine — an atomic editor save,\n // an export cleaning its out dir, a dangling symlink.\n //\n // This does NOT remove the dev flap: `fail()` below still degrades the\n // whole scan, so a transient failure still swings the sheet between\n // gated and ungated between rescans. What it removes is losing the\n // refs already collected. Deciding at purge time (BACKLOG #83) is what\n // actually ends the flap.\n readFailure ??= `unreadable file ${file}: ${String(err)}`;\n continue;\n }\n filesScanned++;\n const ext = extname(file);\n for (const ref of collectChannelVarRefs(content, ext)) refs.add(ref);\n for (const s of collectDynamicChannelSuffixes(content, ext)) {\n wildcardSuffixes.add(s);\n }\n }\n }\n\n if (readFailure !== undefined) return fail(readFailure);\n return { refs, wildcardSuffixes, degraded: false, filesScanned };\n}\n\n/** Inputs to {@link createChannelVarGate}. */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"ChannelVarGateInput\",\"stability\":\"experimental\",\"signature\":\"interface ChannelVarGateInput\"} */\nexport interface ChannelVarGateInput {\n /** `false` disables gating entirely — the `gateChannelVars` escape hatch. */\n enabled: boolean;\n /** Filesystem scan result; `null` means no scan ran, which keeps everything. */\n scan: ChannelVarScan | null;\n /**\n * Names read by text the plugin holds rather than reads — the generated\n * utility CSS. Defence-in-depth, and empty today: the plugin's own\n * `generator.ts` emits no channel reference at all. The design system's other\n * utility generator (`colors/generate-utilities.ts`) emits exactly this form,\n * so a future route through it is caught rather than silently unstyled.\n */\n extraRefs?: Iterable<string>;\n /** Additional names to keep, on top of {@link DEFAULT_CHANNEL_VAR_SAFELIST}. */\n safelist?: Array<string | RegExp>;\n}\n\n/** A gate ready to hand to `themeToCss`, plus why it decided what it did. */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"ChannelVarGate\",\"stability\":\"experimental\",\"signature\":\"interface ChannelVarGate\"} */\nexport interface ChannelVarGate {\n /**\n * The scan failed, as opposed to the gate being switched off or correctly\n * deciding to keep everything. Only this warrants a build-time warning.\n */\n degraded?: boolean;\n keep: (varName: string, suffix: ChannelSuffix) => boolean;\n /** `false` when every channel variable ships — disabled, or failed open. */\n active: boolean;\n reason: string;\n /** Names the gate will let through, when active. */\n kept: Set<string>;\n}\n\n/**\n * Build the emission gate from everything known about this build.\n *\n * @example\n * ```typescript\n * const gate = createChannelVarGate({ enabled: true, scan, extraRefs: utilityRefs });\n * const css = themeToCss(theme, { defaultMode, keepChannelVar: gate.keep });\n * ```\n */\n/** A description of any value that cannot itself throw. */\nfunction describe(v: unknown): string {\n try {\n return typeof v === 'object' && v !== null\n ? Object.prototype.toString.call(v)\n : String(v);\n } catch {\n return typeof v;\n }\n}\n\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system.channel-vars\",\"name\":\"createChannelVarGate\",\"stability\":\"experimental\",\"signature\":\"(input: ChannelVarGateInput) => ChannelVarGate\"} */\nexport function createChannelVarGate(\n input: ChannelVarGateInput\n): ChannelVarGate {\n const keepAll = (reason: string, degraded = false): ChannelVarGate => ({\n keep: () => true,\n active: false,\n // `active: false` conflates three things: switched off, DEGRADED, and\n // correctly decided to keep everything. Only the middle one is a problem\n // worth warning about, so it is flagged separately.\n degraded,\n reason,\n kept: new Set(),\n });\n\n if (!input.enabled) return keepAll('disabled via gateChannelVars: false');\n if (!input.scan) return keepAll('no source scan ran');\n if (input.scan.degraded)\n return keepAll(input.scan.reason ?? 'scan degraded', true);\n\n const kept = new Set<string>([\n ...DEFAULT_CHANNEL_VAR_SAFELIST,\n ...input.scan.refs,\n ...(input.extraRefs ?? []),\n ]);\n // Validate, then CLONE. `keep()` runs ~800 times per sheet and\n // `patterns.some` short-circuits, so testing the caller's own objects left\n // them at arbitrary `lastIndex` offsets — an app factoring one array into\n // both `safelist` and `channelVarSafelist` got silent cross-contamination.\n // Same rule as the two alias resolvers: never mutate what the caller owns.\n const safelist = input.safelist ?? [];\n if (!Array.isArray(safelist)) {\n return keepAll(\n `channelVarSafelist must be an array, received ${typeof safelist}`,\n true\n );\n }\n const patterns: RegExp[] = [];\n for (const entry of safelist) {\n if (typeof entry === 'string') {\n kept.add(entry);\n } else if (entry instanceof RegExp) {\n // Clone WITHOUT `g`/`y`. The clone alone protects the caller's object;\n // dropping the stateful flags is what makes `test()` correct here, since\n // `lastIndex` on a global pattern makes consecutive matches skip every\n // other name. Neither flag means anything for a boolean membership test.\n patterns.push(new RegExp(entry.source, entry.flags.replace(/[gy]/g, '')));\n } else {\n // A config mistake must not surface as a TypeError from inside `load()`,\n // which has no try/catch. Uncertainty ships everything.\n // `String(...)`, not `JSON.stringify`: the latter throws on a BigInt and\n // on a circular object, from inside the guard whose own purpose is that a\n // config mistake must not surface as an internal failure.\n return keepAll(\n `channelVarSafelist entries must be strings or RegExps, received ${describe(entry)}`,\n true\n );\n }\n }\n\n const wildcards = input.scan.wildcardSuffixes;\n if (wildcards.size === CHANNEL_SUFFIX_COUNT) {\n // `degraded: true` so this is AUDIBLE. `active: false` alone silenced both\n // signals — the warning keys on `degraded`, the banner on `active` — so a\n // single concat anywhere switched the feature off with no output at all.\n // It is not a failure, but it is a surprise worth one line.\n return keepAll(`every suffix read through a built name`, true);\n }\n\n const wildcardNote = wildcards.size\n ? `, all -${[...wildcards].join('/-')} (built names)`\n : '';\n\n return {\n keep: (varName: string, suffix: ChannelSuffix) =>\n wildcards.has(suffix) ||\n kept.has(varName) ||\n patterns.some(re => re.test(varName)),\n active: true,\n reason:\n `${kept.size} name(s) kept from ${input.scan.filesScanned} file(s)` +\n wildcardNote,\n kept,\n };\n}\n"]}
|