kern-lang 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +14 -25
- package/dist/index.js +15 -28
- package/dist/index.js.map +1 -1
- package/package.json +17 -36
- package/README.md +0 -304
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -244
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts +0 -46
- package/dist/config.js +0 -54
- package/dist/config.js.map +0 -1
- package/dist/context-export.d.ts +0 -11
- package/dist/context-export.js +0 -121
- package/dist/context-export.js.map +0 -1
- package/dist/decompiler.d.ts +0 -2
- package/dist/decompiler.js +0 -44
- package/dist/decompiler.js.map +0 -1
- package/dist/draft-protocol.d.ts +0 -27
- package/dist/draft-protocol.js +0 -135
- package/dist/draft-protocol.js.map +0 -1
- package/dist/errors.d.ts +0 -12
- package/dist/errors.js +0 -40
- package/dist/errors.js.map +0 -1
- package/dist/metrics.d.ts +0 -30
- package/dist/metrics.js +0 -182
- package/dist/metrics.js.map +0 -1
- package/dist/parser.d.ts +0 -4
- package/dist/parser.js +0 -361
- package/dist/parser.js.map +0 -1
- package/dist/spec.d.ts +0 -17
- package/dist/spec.js +0 -86
- package/dist/spec.js.map +0 -1
- package/dist/styles-react.d.ts +0 -3
- package/dist/styles-react.js +0 -20
- package/dist/styles-react.js.map +0 -1
- package/dist/styles-tailwind.d.ts +0 -8
- package/dist/styles-tailwind.js +0 -197
- package/dist/styles-tailwind.js.map +0 -1
- package/dist/transpiler-cli.d.ts +0 -3
- package/dist/transpiler-cli.js +0 -279
- package/dist/transpiler-cli.js.map +0 -1
- package/dist/transpiler-express.d.ts +0 -3
- package/dist/transpiler-express.js +0 -612
- package/dist/transpiler-express.js.map +0 -1
- package/dist/transpiler-nextjs.d.ts +0 -21
- package/dist/transpiler-nextjs.js +0 -400
- package/dist/transpiler-nextjs.js.map +0 -1
- package/dist/transpiler-tailwind.d.ts +0 -3
- package/dist/transpiler-tailwind.js +0 -594
- package/dist/transpiler-tailwind.js.map +0 -1
- package/dist/transpiler-terminal.d.ts +0 -3
- package/dist/transpiler-terminal.js +0 -522
- package/dist/transpiler-terminal.js.map +0 -1
- package/dist/transpiler-web.d.ts +0 -3
- package/dist/transpiler-web.js +0 -218
- package/dist/transpiler-web.js.map +0 -1
- package/dist/transpiler.d.ts +0 -3
- package/dist/transpiler.js +0 -218
- package/dist/transpiler.js.map +0 -1
- package/dist/types.d.ts +0 -76
- package/dist/types.js +0 -11
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -5
- package/dist/utils.js +0 -36
- package/dist/utils.js.map +0 -1
- package/kern.config.ts +0 -61
package/dist/draft-protocol.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kern Draft Protocol
|
|
3
|
-
*
|
|
4
|
-
* Structured communication format for competing AI engines.
|
|
5
|
-
* Engines respond in Kern draft format instead of verbose natural language —
|
|
6
|
-
* 70% fewer tokens, no fluff, structured and rankable.
|
|
7
|
-
*
|
|
8
|
-
* "Engines speak Kern."
|
|
9
|
-
*/
|
|
10
|
-
// ── Prompt builders ──────────────────────────────────────────────────────
|
|
11
|
-
export function buildKernDraftPrompt(opts) {
|
|
12
|
-
const modeInstructions = {
|
|
13
|
-
'brainstorm': 'You are proposing an approach to a technical question. Be creative but specific.',
|
|
14
|
-
'forge-plan': 'You are planning an implementation that will be scored against competing implementations. Be precise about files and steps.',
|
|
15
|
-
'tribunal-position': 'You are taking a position in a technical tribunal. State your case clearly with evidence.',
|
|
16
|
-
};
|
|
17
|
-
const lines = [];
|
|
18
|
-
lines.push(modeInstructions[opts.mode]);
|
|
19
|
-
lines.push('');
|
|
20
|
-
if (opts.context) {
|
|
21
|
-
lines.push('## Project Context');
|
|
22
|
-
lines.push(opts.context);
|
|
23
|
-
lines.push('');
|
|
24
|
-
}
|
|
25
|
-
lines.push('## Question');
|
|
26
|
-
lines.push(opts.question);
|
|
27
|
-
lines.push('');
|
|
28
|
-
lines.push('## Response Format');
|
|
29
|
-
lines.push('');
|
|
30
|
-
lines.push('Respond ONLY with a Kern draft block. No markdown, no explanation outside the block.');
|
|
31
|
-
lines.push('');
|
|
32
|
-
lines.push('```');
|
|
33
|
-
lines.push('draft {');
|
|
34
|
-
lines.push(' approach: "your one-line thesis"');
|
|
35
|
-
lines.push(' reasoning: "why this approach works — 1-3 sentences max"');
|
|
36
|
-
lines.push(' tradeoffs: "risk1", "risk2", "risk3"');
|
|
37
|
-
lines.push(' confidence: 0-100');
|
|
38
|
-
lines.push(' keyFiles: "src/file1.ts", "src/file2.ts"');
|
|
39
|
-
lines.push(' steps {');
|
|
40
|
-
lines.push(' 1: "first step"');
|
|
41
|
-
lines.push(' 2: "second step"');
|
|
42
|
-
lines.push(' 3: "third step"');
|
|
43
|
-
lines.push(' }');
|
|
44
|
-
lines.push('}');
|
|
45
|
-
lines.push('```');
|
|
46
|
-
lines.push('');
|
|
47
|
-
lines.push('Rules:');
|
|
48
|
-
lines.push('- approach: single sentence, what you would do');
|
|
49
|
-
lines.push('- reasoning: why, max 3 sentences');
|
|
50
|
-
lines.push('- tradeoffs: comma-separated quoted strings, risks or downsides');
|
|
51
|
-
lines.push('- confidence: integer 0-100, how sure you are');
|
|
52
|
-
lines.push('- keyFiles: comma-separated quoted paths, files you would touch');
|
|
53
|
-
lines.push('- steps: numbered, 3-7 concrete steps');
|
|
54
|
-
lines.push('- No text outside the draft block');
|
|
55
|
-
return lines.join('\n');
|
|
56
|
-
}
|
|
57
|
-
export function buildKernRankPrompt(drafts) {
|
|
58
|
-
const lines = [];
|
|
59
|
-
lines.push('Rank these drafts by: specificity (concrete vs vague), feasibility (can it actually work), and fit to project context.');
|
|
60
|
-
lines.push('');
|
|
61
|
-
for (const { engineId, draft } of drafts) {
|
|
62
|
-
lines.push(`## ${engineId}`);
|
|
63
|
-
lines.push(`Approach: ${draft.approach}`);
|
|
64
|
-
lines.push(`Reasoning: ${draft.reasoning}`);
|
|
65
|
-
lines.push(`Confidence: ${draft.confidence}`);
|
|
66
|
-
lines.push(`Steps: ${draft.steps.length}`);
|
|
67
|
-
lines.push(`Tradeoffs: ${draft.tradeoffs.join(', ')}`);
|
|
68
|
-
lines.push('');
|
|
69
|
-
}
|
|
70
|
-
lines.push('Respond with ONLY the engine IDs in ranked order (best first), comma-separated:');
|
|
71
|
-
lines.push('Example: engine2, engine1, engine3');
|
|
72
|
-
return lines.join('\n');
|
|
73
|
-
}
|
|
74
|
-
// ── Parser ───────────────────────────────────────────────────────────────
|
|
75
|
-
export function parseKernDraft(output) {
|
|
76
|
-
// Strip markdown fences if present
|
|
77
|
-
let text = output;
|
|
78
|
-
const fenceMatch = text.match(/```[\w]*\n?([\s\S]*?)```/);
|
|
79
|
-
if (fenceMatch) {
|
|
80
|
-
text = fenceMatch[1];
|
|
81
|
-
}
|
|
82
|
-
// Find the draft { ... } block
|
|
83
|
-
const draftMatch = text.match(/draft\s*\{([\s\S]*)\}/);
|
|
84
|
-
if (!draftMatch)
|
|
85
|
-
return null;
|
|
86
|
-
const body = draftMatch[1];
|
|
87
|
-
const draft = {
|
|
88
|
-
approach: '',
|
|
89
|
-
reasoning: '',
|
|
90
|
-
tradeoffs: [],
|
|
91
|
-
confidence: 0,
|
|
92
|
-
keyFiles: [],
|
|
93
|
-
steps: [],
|
|
94
|
-
};
|
|
95
|
-
// Parse simple key: "value" fields
|
|
96
|
-
draft.approach = parseStringField(body, 'approach') || '';
|
|
97
|
-
draft.reasoning = parseStringField(body, 'reasoning') || '';
|
|
98
|
-
draft.confidence = parseNumberField(body, 'confidence') || 0;
|
|
99
|
-
// Parse comma-separated quoted lists
|
|
100
|
-
draft.tradeoffs = parseQuotedList(body, 'tradeoffs');
|
|
101
|
-
draft.keyFiles = parseQuotedList(body, 'keyFiles');
|
|
102
|
-
// Parse steps { 1: "...", 2: "...", ... } block
|
|
103
|
-
const stepsMatch = body.match(/steps\s*\{([\s\S]*?)\}/);
|
|
104
|
-
if (stepsMatch) {
|
|
105
|
-
const stepsBody = stepsMatch[1];
|
|
106
|
-
const stepEntries = [...stepsBody.matchAll(/\d+\s*:\s*"([^"]*?)"/g)];
|
|
107
|
-
draft.steps = stepEntries.map(m => m[1]);
|
|
108
|
-
}
|
|
109
|
-
// Validate: must have at least an approach
|
|
110
|
-
if (!draft.approach)
|
|
111
|
-
return null;
|
|
112
|
-
return draft;
|
|
113
|
-
}
|
|
114
|
-
// ── Internal helpers ─────────────────────────────────────────────────────
|
|
115
|
-
function parseStringField(body, key) {
|
|
116
|
-
// Match key: "value" but not inside a steps block
|
|
117
|
-
const regex = new RegExp(`^\\s*${key}\\s*:\\s*"([^"]*)"`, 'm');
|
|
118
|
-
const match = body.match(regex);
|
|
119
|
-
return match ? match[1] : null;
|
|
120
|
-
}
|
|
121
|
-
function parseNumberField(body, key) {
|
|
122
|
-
const regex = new RegExp(`^\\s*${key}\\s*:\\s*(\\d+)`, 'm');
|
|
123
|
-
const match = body.match(regex);
|
|
124
|
-
return match ? Number(match[1]) : null;
|
|
125
|
-
}
|
|
126
|
-
function parseQuotedList(body, key) {
|
|
127
|
-
// Match key: "val1", "val2", "val3"
|
|
128
|
-
const regex = new RegExp(`^\\s*${key}\\s*:\\s*(.+)`, 'm');
|
|
129
|
-
const match = body.match(regex);
|
|
130
|
-
if (!match)
|
|
131
|
-
return [];
|
|
132
|
-
const values = [...match[1].matchAll(/"([^"]*?)"/g)];
|
|
133
|
-
return values.map(m => m[1]);
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=draft-protocol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"draft-protocol.js","sourceRoot":"","sources":["../src/draft-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,4EAA4E;AAE5E,MAAM,UAAU,oBAAoB,CAAC,IAIpC;IACC,MAAM,gBAAgB,GAA2B;QAC/C,YAAY,EAAE,kFAAkF;QAChG,YAAY,EAAE,6H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,GAAG,iBAAiB,EAAE,GAAG,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACzC,CAAC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,GAAW;IAChD,oCAAoC;IACpC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,QAAQ,GAAG,eAAe,EAAE,GAAG,CAAC,CAAC;IAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/errors.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kern Error Types
|
|
3
|
-
*/
|
|
4
|
-
export declare class KernError extends Error {
|
|
5
|
-
line: number;
|
|
6
|
-
col: number;
|
|
7
|
-
source: string;
|
|
8
|
-
constructor(message: string, line: number, col: number, source: string);
|
|
9
|
-
}
|
|
10
|
-
export declare class KernParseError extends KernError {
|
|
11
|
-
constructor(message: string, line: number, col: number, source: string);
|
|
12
|
-
}
|
package/dist/errors.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kern Error Types
|
|
3
|
-
*/
|
|
4
|
-
export class KernError extends Error {
|
|
5
|
-
line;
|
|
6
|
-
col;
|
|
7
|
-
source;
|
|
8
|
-
constructor(message, line, col, source) {
|
|
9
|
-
const frame = codeFrame(source, line, col);
|
|
10
|
-
super(`${message}\n\n${frame}`);
|
|
11
|
-
this.name = 'KernError';
|
|
12
|
-
this.line = line;
|
|
13
|
-
this.col = col;
|
|
14
|
-
this.source = source;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export class KernParseError extends KernError {
|
|
18
|
-
constructor(message, line, col, source) {
|
|
19
|
-
super(`Parse error: ${message}`, line, col, source);
|
|
20
|
-
this.name = 'KernParseError';
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function codeFrame(source, line, col) {
|
|
24
|
-
const lines = source.split('\n');
|
|
25
|
-
const start = Math.max(0, line - 3);
|
|
26
|
-
const end = Math.min(lines.length, line + 2);
|
|
27
|
-
const result = [];
|
|
28
|
-
const gutterWidth = String(end).length;
|
|
29
|
-
for (let i = start; i < end; i++) {
|
|
30
|
-
const lineNum = String(i + 1).padStart(gutterWidth);
|
|
31
|
-
const marker = i + 1 === line ? '>' : ' ';
|
|
32
|
-
result.push(`${marker} ${lineNum} | ${lines[i]}`);
|
|
33
|
-
if (i + 1 === line) {
|
|
34
|
-
const pointer = ' '.repeat(gutterWidth + 4 + Math.max(0, col - 1)) + '^';
|
|
35
|
-
result.push(pointer);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return result.join('\n');
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,IAAI,CAAS;IACb,GAAG,CAAS;IACZ,MAAM,CAAS;IAEf,YAAY,OAAe,EAAE,IAAY,EAAE,GAAW,EAAE,MAAc;QACpE,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAC3C,KAAK,CAAC,GA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O,MAAM,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;YACnB,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;YACzE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
package/dist/metrics.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { IRNode, TranspileResult } from './types.js';
|
|
2
|
-
export interface StyleMetrics {
|
|
3
|
-
totalStyleDecls: number;
|
|
4
|
-
mappedStyleDecls: number;
|
|
5
|
-
escapedStyleDecls: number;
|
|
6
|
-
escapeRatio: number;
|
|
7
|
-
escapedKeys: string[];
|
|
8
|
-
}
|
|
9
|
-
export interface NodeTypeMetrics {
|
|
10
|
-
type: string;
|
|
11
|
-
count: number;
|
|
12
|
-
styleDecls: number;
|
|
13
|
-
}
|
|
14
|
-
export interface LanguageMetrics {
|
|
15
|
-
nodeCount: number;
|
|
16
|
-
unknownNodeCount: number;
|
|
17
|
-
nodeTypes: NodeTypeMetrics[];
|
|
18
|
-
styleMetrics: StyleMetrics;
|
|
19
|
-
shorthandCoverage: number;
|
|
20
|
-
themeRefCount: number;
|
|
21
|
-
pseudoStyleCount: number;
|
|
22
|
-
tokenEfficiency: {
|
|
23
|
-
irTokenCount: number;
|
|
24
|
-
tsTokenCount: number;
|
|
25
|
-
tokenReduction: number;
|
|
26
|
-
} | null;
|
|
27
|
-
}
|
|
28
|
-
export declare function isEscapedStyleKey(rawKey: string): boolean;
|
|
29
|
-
export declare function collectLanguageMetrics(root: IRNode, result?: TranspileResult): LanguageMetrics;
|
|
30
|
-
export declare function mergeMetrics(metrics: LanguageMetrics[]): LanguageMetrics;
|
package/dist/metrics.js
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { STYLE_SHORTHANDS } from './spec.js';
|
|
2
|
-
// ── Mapped CSS properties (mirrors the switch cases in stylesToTailwind) ─
|
|
3
|
-
const MAPPED_CSS_PROPERTIES = new Set([
|
|
4
|
-
'padding', 'paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight',
|
|
5
|
-
'margin', 'marginTop', 'marginBottom', 'marginLeft', 'marginRight',
|
|
6
|
-
'backgroundColor', 'color', 'fontSize', 'fontWeight', 'borderRadius',
|
|
7
|
-
'width', 'height', 'justifyContent', 'alignItems', 'flexDirection',
|
|
8
|
-
'flex', 'gap', 'borderColor', 'borderWidth', 'overflow',
|
|
9
|
-
'textAlign', 'elevation', 'opacity', 'position', 'display', 'zIndex',
|
|
10
|
-
]);
|
|
11
|
-
// ── Handled node types (mirrors renderNode switch in transpiler-tailwind) ─
|
|
12
|
-
const HANDLED_NODE_TYPES = new Set([
|
|
13
|
-
'state', 'logic', 'screen', 'section', 'card', 'row', 'col', 'text',
|
|
14
|
-
'divider', 'button', 'slider', 'toggle', 'grid', 'conditional',
|
|
15
|
-
'component', 'icon', 'image', 'list', 'item', 'tabs', 'tab',
|
|
16
|
-
'progress', 'input', 'theme',
|
|
17
|
-
// CLI
|
|
18
|
-
'cli', 'command', 'arg', 'flag', 'import',
|
|
19
|
-
// Streaming/process
|
|
20
|
-
'stream', 'spawn', 'timer', 'on', 'env',
|
|
21
|
-
// Terminal
|
|
22
|
-
'separator', 'table', 'scoreboard', 'metric',
|
|
23
|
-
'spinner', 'progress', 'box', 'gradient',
|
|
24
|
-
'repl', 'guard', 'parallel', 'dispatch', 'then', 'each',
|
|
25
|
-
]);
|
|
26
|
-
// ── Escape detection ─────────────────────────────────────────────────────
|
|
27
|
-
export function isEscapedStyleKey(rawKey) {
|
|
28
|
-
const expanded = STYLE_SHORTHANDS[rawKey] || rawKey;
|
|
29
|
-
return !MAPPED_CSS_PROPERTIES.has(expanded);
|
|
30
|
-
}
|
|
31
|
-
function walkNode(node, acc) {
|
|
32
|
-
acc.nodeCount++;
|
|
33
|
-
if (!HANDLED_NODE_TYPES.has(node.type)) {
|
|
34
|
-
acc.unknownNodeCount++;
|
|
35
|
-
}
|
|
36
|
-
const props = node.props || {};
|
|
37
|
-
const styles = props.styles || {};
|
|
38
|
-
const styleCount = Object.keys(styles).length;
|
|
39
|
-
// Count node types
|
|
40
|
-
const entry = acc.nodeTypeCounts.get(node.type);
|
|
41
|
-
if (entry) {
|
|
42
|
-
entry.count++;
|
|
43
|
-
entry.styleDecls += styleCount;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
acc.nodeTypeCounts.set(node.type, { count: 1, styleDecls: styleCount });
|
|
47
|
-
}
|
|
48
|
-
// Classify style declarations
|
|
49
|
-
for (const rawKey of Object.keys(styles)) {
|
|
50
|
-
acc.totalStyleDecls++;
|
|
51
|
-
acc.totalRawKeys++;
|
|
52
|
-
if (rawKey in STYLE_SHORTHANDS) {
|
|
53
|
-
acc.shorthandHits++;
|
|
54
|
-
}
|
|
55
|
-
const expanded = STYLE_SHORTHANDS[rawKey] || rawKey;
|
|
56
|
-
if (MAPPED_CSS_PROPERTIES.has(expanded)) {
|
|
57
|
-
acc.mappedStyleDecls++;
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
acc.escapedStyleDecls++;
|
|
61
|
-
acc.escapedKeys.add(expanded);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
// Count theme refs
|
|
65
|
-
const themeRefs = props.themeRefs || [];
|
|
66
|
-
acc.themeRefCount += themeRefs.length;
|
|
67
|
-
// Count pseudo-style declarations
|
|
68
|
-
const pseudoStyles = props.pseudoStyles || {};
|
|
69
|
-
for (const stateStyles of Object.values(pseudoStyles)) {
|
|
70
|
-
acc.pseudoStyleCount += Object.keys(stateStyles).length;
|
|
71
|
-
}
|
|
72
|
-
// Recurse children
|
|
73
|
-
if (node.children) {
|
|
74
|
-
for (const child of node.children) {
|
|
75
|
-
walkNode(child, acc);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
// ── Main export ──────────────────────────────────────────────────────────
|
|
80
|
-
export function collectLanguageMetrics(root, result) {
|
|
81
|
-
const acc = {
|
|
82
|
-
nodeCount: 0,
|
|
83
|
-
unknownNodeCount: 0,
|
|
84
|
-
nodeTypeCounts: new Map(),
|
|
85
|
-
totalStyleDecls: 0,
|
|
86
|
-
mappedStyleDecls: 0,
|
|
87
|
-
escapedStyleDecls: 0,
|
|
88
|
-
escapedKeys: new Set(),
|
|
89
|
-
shorthandHits: 0,
|
|
90
|
-
totalRawKeys: 0,
|
|
91
|
-
themeRefCount: 0,
|
|
92
|
-
pseudoStyleCount: 0,
|
|
93
|
-
};
|
|
94
|
-
walkNode(root, acc);
|
|
95
|
-
const nodeTypes = [...acc.nodeTypeCounts.entries()]
|
|
96
|
-
.map(([type, data]) => ({ type, count: data.count, styleDecls: data.styleDecls }))
|
|
97
|
-
.sort((a, b) => b.count - a.count);
|
|
98
|
-
return {
|
|
99
|
-
nodeCount: acc.nodeCount,
|
|
100
|
-
unknownNodeCount: acc.unknownNodeCount,
|
|
101
|
-
nodeTypes,
|
|
102
|
-
styleMetrics: {
|
|
103
|
-
totalStyleDecls: acc.totalStyleDecls,
|
|
104
|
-
mappedStyleDecls: acc.mappedStyleDecls,
|
|
105
|
-
escapedStyleDecls: acc.escapedStyleDecls,
|
|
106
|
-
escapeRatio: acc.totalStyleDecls > 0 ? acc.escapedStyleDecls / acc.totalStyleDecls : 0,
|
|
107
|
-
escapedKeys: [...acc.escapedKeys].sort(),
|
|
108
|
-
},
|
|
109
|
-
shorthandCoverage: acc.totalRawKeys > 0 ? acc.shorthandHits / acc.totalRawKeys : 0,
|
|
110
|
-
themeRefCount: acc.themeRefCount,
|
|
111
|
-
pseudoStyleCount: acc.pseudoStyleCount,
|
|
112
|
-
tokenEfficiency: result ? {
|
|
113
|
-
irTokenCount: result.irTokenCount,
|
|
114
|
-
tsTokenCount: result.tsTokenCount,
|
|
115
|
-
tokenReduction: result.tokenReduction,
|
|
116
|
-
} : null,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
// ── Merge utility (for aggregating across multiple files) ────────────────
|
|
120
|
-
export function mergeMetrics(metrics) {
|
|
121
|
-
if (metrics.length === 0) {
|
|
122
|
-
return collectLanguageMetrics({ type: 'empty' });
|
|
123
|
-
}
|
|
124
|
-
if (metrics.length === 1)
|
|
125
|
-
return metrics[0];
|
|
126
|
-
let nodeCount = 0;
|
|
127
|
-
let unknownNodeCount = 0;
|
|
128
|
-
let totalStyleDecls = 0;
|
|
129
|
-
let mappedStyleDecls = 0;
|
|
130
|
-
let escapedStyleDecls = 0;
|
|
131
|
-
const escapedKeys = new Set();
|
|
132
|
-
let shorthandHitsSum = 0;
|
|
133
|
-
let totalRawKeysSum = 0;
|
|
134
|
-
let themeRefCount = 0;
|
|
135
|
-
let pseudoStyleCount = 0;
|
|
136
|
-
const nodeTypeMerge = new Map();
|
|
137
|
-
for (const m of metrics) {
|
|
138
|
-
nodeCount += m.nodeCount;
|
|
139
|
-
unknownNodeCount += m.unknownNodeCount;
|
|
140
|
-
totalStyleDecls += m.styleMetrics.totalStyleDecls;
|
|
141
|
-
mappedStyleDecls += m.styleMetrics.mappedStyleDecls;
|
|
142
|
-
escapedStyleDecls += m.styleMetrics.escapedStyleDecls;
|
|
143
|
-
for (const k of m.styleMetrics.escapedKeys)
|
|
144
|
-
escapedKeys.add(k);
|
|
145
|
-
themeRefCount += m.themeRefCount;
|
|
146
|
-
pseudoStyleCount += m.pseudoStyleCount;
|
|
147
|
-
// Approximate shorthand coverage from stored ratio
|
|
148
|
-
const rawKeys = m.styleMetrics.totalStyleDecls;
|
|
149
|
-
shorthandHitsSum += Math.round(m.shorthandCoverage * rawKeys);
|
|
150
|
-
totalRawKeysSum += rawKeys;
|
|
151
|
-
for (const nt of m.nodeTypes) {
|
|
152
|
-
const existing = nodeTypeMerge.get(nt.type);
|
|
153
|
-
if (existing) {
|
|
154
|
-
existing.count += nt.count;
|
|
155
|
-
existing.styleDecls += nt.styleDecls;
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
nodeTypeMerge.set(nt.type, { count: nt.count, styleDecls: nt.styleDecls });
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
const nodeTypes = [...nodeTypeMerge.entries()]
|
|
163
|
-
.map(([type, data]) => ({ type, count: data.count, styleDecls: data.styleDecls }))
|
|
164
|
-
.sort((a, b) => b.count - a.count);
|
|
165
|
-
return {
|
|
166
|
-
nodeCount,
|
|
167
|
-
unknownNodeCount,
|
|
168
|
-
nodeTypes,
|
|
169
|
-
styleMetrics: {
|
|
170
|
-
totalStyleDecls,
|
|
171
|
-
mappedStyleDecls,
|
|
172
|
-
escapedStyleDecls,
|
|
173
|
-
escapeRatio: totalStyleDecls > 0 ? escapedStyleDecls / totalStyleDecls : 0,
|
|
174
|
-
escapedKeys: [...escapedKeys].sort(),
|
|
175
|
-
},
|
|
176
|
-
shorthandCoverage: totalRawKeysSum > 0 ? shorthandHitsSum / totalRawKeysSum : 0,
|
|
177
|
-
themeRefCount,
|
|
178
|
-
pseudoStyleCount,
|
|
179
|
-
tokenEfficiency: null,
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
//# sourceMappingURL=metrics.js.map
|
package/dist/metrics.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,4EAA4E;AAE5E,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc;IACvE,QAAQ,EAAE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