@kernlang/vue 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/LICENSE +661 -0
- package/dist/codegen-vue.d.ts +12 -0
- package/dist/codegen-vue.js +347 -0
- package/dist/codegen-vue.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/transpiler-nuxt.d.ts +13 -0
- package/dist/transpiler-nuxt.js +469 -0
- package/dist/transpiler-nuxt.js.map +1 -0
- package/dist/transpiler-vue.d.ts +9 -0
- package/dist/transpiler-vue.js +450 -0
- package/dist/transpiler-vue.js.map +1 -0
- package/package.json +22 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue 3 SFC Transpiler — generates <script setup> + <template> + <style scoped>
|
|
3
|
+
*
|
|
4
|
+
* Maps the same KERN IR nodes to Vue Single File Components instead of React TSX.
|
|
5
|
+
* Core language nodes (type, interface, fn, machine, etc.) already produce pure TS
|
|
6
|
+
* via @kernlang/core — this transpiler only handles UI nodes.
|
|
7
|
+
*/
|
|
8
|
+
import { expandStyles, countTokens, serializeIR } from '@kernlang/core';
|
|
9
|
+
// ── Node → HTML Element Mapping ──────────────────────────────────────────
|
|
10
|
+
const NODE_TO_ELEMENT = {
|
|
11
|
+
screen: 'div',
|
|
12
|
+
row: 'div',
|
|
13
|
+
col: 'div',
|
|
14
|
+
card: 'div',
|
|
15
|
+
scroll: 'div',
|
|
16
|
+
text: 'p',
|
|
17
|
+
image: 'img',
|
|
18
|
+
button: 'button',
|
|
19
|
+
input: 'input',
|
|
20
|
+
modal: 'dialog',
|
|
21
|
+
list: 'ul',
|
|
22
|
+
item: 'li',
|
|
23
|
+
tabs: 'div',
|
|
24
|
+
tab: 'button',
|
|
25
|
+
header: 'header',
|
|
26
|
+
divider: 'hr',
|
|
27
|
+
progress: 'progress',
|
|
28
|
+
section: 'section',
|
|
29
|
+
form: 'form',
|
|
30
|
+
grid: 'div',
|
|
31
|
+
};
|
|
32
|
+
// ── Semantic elements for text variants ──────────────────────────────────
|
|
33
|
+
function textElement(variant) {
|
|
34
|
+
if (!variant)
|
|
35
|
+
return 'p';
|
|
36
|
+
if (variant === 'h1')
|
|
37
|
+
return 'h1';
|
|
38
|
+
if (variant === 'h2')
|
|
39
|
+
return 'h2';
|
|
40
|
+
if (variant === 'h3')
|
|
41
|
+
return 'h3';
|
|
42
|
+
if (variant === 'h4')
|
|
43
|
+
return 'h4';
|
|
44
|
+
if (variant === 'h5')
|
|
45
|
+
return 'h5';
|
|
46
|
+
if (variant === 'h6')
|
|
47
|
+
return 'h6';
|
|
48
|
+
if (variant === 'caption' || variant === 'small')
|
|
49
|
+
return 'small';
|
|
50
|
+
if (variant === 'code')
|
|
51
|
+
return 'code';
|
|
52
|
+
return 'p';
|
|
53
|
+
}
|
|
54
|
+
// ── Style helpers ────────────────────────────────────────────────────────
|
|
55
|
+
function cssPropertyName(camel) {
|
|
56
|
+
return camel.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
57
|
+
}
|
|
58
|
+
function cssValue(key, value) {
|
|
59
|
+
if (typeof value === 'number') {
|
|
60
|
+
const unitless = ['flex', 'fontWeight', 'opacity', 'zIndex', 'lineHeight'];
|
|
61
|
+
if (unitless.some(u => key.toLowerCase().includes(u.toLowerCase())))
|
|
62
|
+
return String(value);
|
|
63
|
+
return `${value}px`;
|
|
64
|
+
}
|
|
65
|
+
return String(value);
|
|
66
|
+
}
|
|
67
|
+
// ── Props/style accessors ────────────────────────────────────────────────
|
|
68
|
+
function getProps(node) {
|
|
69
|
+
return node.props || {};
|
|
70
|
+
}
|
|
71
|
+
function getStyles(node) {
|
|
72
|
+
return getProps(node).styles || {};
|
|
73
|
+
}
|
|
74
|
+
function getPseudoStyles(node) {
|
|
75
|
+
return getProps(node).pseudoStyles || {};
|
|
76
|
+
}
|
|
77
|
+
function getThemeRefs(node) {
|
|
78
|
+
return getProps(node).themeRefs || [];
|
|
79
|
+
}
|
|
80
|
+
function createBuilder(config) {
|
|
81
|
+
return {
|
|
82
|
+
templateLines: [],
|
|
83
|
+
scriptImports: new Set(),
|
|
84
|
+
vueImports: new Set(),
|
|
85
|
+
stateDecls: [],
|
|
86
|
+
logicBlocks: [],
|
|
87
|
+
cssRules: new Map(),
|
|
88
|
+
sourceMap: [],
|
|
89
|
+
classIdx: 0,
|
|
90
|
+
themes: {},
|
|
91
|
+
config,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
// ── Theme Collection ─────────────────────────────────────────────────────
|
|
95
|
+
function collectThemes(node, ctx) {
|
|
96
|
+
if (node.type === 'theme' && node.props) {
|
|
97
|
+
const props = node.props;
|
|
98
|
+
if (props.styles) {
|
|
99
|
+
const keys = Object.keys(props).filter(k => k !== 'styles' && k !== 'pseudoStyles' && k !== 'themeRefs');
|
|
100
|
+
const name = keys[0] || `theme_${ctx.classIdx++}`;
|
|
101
|
+
ctx.themes[name] = props.styles;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (node.children)
|
|
105
|
+
node.children.forEach(c => collectThemes(c, ctx));
|
|
106
|
+
}
|
|
107
|
+
// ── CSS Class Generation ─────────────────────────────────────────────────
|
|
108
|
+
function addClass(ctx, nodeType, styles) {
|
|
109
|
+
if (Object.keys(styles).length === 0)
|
|
110
|
+
return '';
|
|
111
|
+
const className = `${nodeType}-${ctx.classIdx++}`;
|
|
112
|
+
ctx.cssRules.set(className, styles);
|
|
113
|
+
return className;
|
|
114
|
+
}
|
|
115
|
+
function mergeNodeStyles(node, ctx) {
|
|
116
|
+
let merged = {};
|
|
117
|
+
const themeRefs = getThemeRefs(node);
|
|
118
|
+
for (const ref of themeRefs) {
|
|
119
|
+
if (ctx.themes[ref]) {
|
|
120
|
+
merged = { ...merged, ...expandStyles(ctx.themes[ref]) };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
const styles = getStyles(node);
|
|
124
|
+
if (Object.keys(styles).length > 0) {
|
|
125
|
+
merged = { ...merged, ...expandStyles(styles) };
|
|
126
|
+
}
|
|
127
|
+
return merged;
|
|
128
|
+
}
|
|
129
|
+
function addLayoutDefaults(nodeType, styles) {
|
|
130
|
+
const s = { ...styles };
|
|
131
|
+
if (nodeType === 'screen') {
|
|
132
|
+
if (!s.display)
|
|
133
|
+
s.display = 'flex';
|
|
134
|
+
if (!s.flexDirection)
|
|
135
|
+
s.flexDirection = 'column';
|
|
136
|
+
if (!s.minHeight)
|
|
137
|
+
s.minHeight = '100vh';
|
|
138
|
+
}
|
|
139
|
+
if (nodeType === 'row') {
|
|
140
|
+
if (!s.display)
|
|
141
|
+
s.display = 'flex';
|
|
142
|
+
if (!s.flexDirection)
|
|
143
|
+
s.flexDirection = 'row';
|
|
144
|
+
}
|
|
145
|
+
if (nodeType === 'col') {
|
|
146
|
+
if (!s.display)
|
|
147
|
+
s.display = 'flex';
|
|
148
|
+
if (!s.flexDirection)
|
|
149
|
+
s.flexDirection = 'column';
|
|
150
|
+
}
|
|
151
|
+
if (nodeType === 'card') {
|
|
152
|
+
if (!s.boxShadow)
|
|
153
|
+
s.boxShadow = '0 2px 8px rgba(0,0,0,0.1)';
|
|
154
|
+
}
|
|
155
|
+
if (nodeType === 'grid') {
|
|
156
|
+
if (!s.display)
|
|
157
|
+
s.display = 'grid';
|
|
158
|
+
}
|
|
159
|
+
if (nodeType === 'scroll') {
|
|
160
|
+
if (!s.overflow)
|
|
161
|
+
s.overflow = 'auto';
|
|
162
|
+
}
|
|
163
|
+
return s;
|
|
164
|
+
}
|
|
165
|
+
// ── Template Rendering ───────────────────────────────────────────────────
|
|
166
|
+
function renderNode(node, ctx, indent) {
|
|
167
|
+
const props = getProps(node);
|
|
168
|
+
const irLine = node.loc?.line || 0;
|
|
169
|
+
ctx.sourceMap.push({ irLine, irCol: node.loc?.col || 1, outLine: ctx.templateLines.length + 1, outCol: 1 });
|
|
170
|
+
switch (node.type) {
|
|
171
|
+
case 'state':
|
|
172
|
+
ctx.vueImports.add('ref');
|
|
173
|
+
ctx.stateDecls.push({ name: props.name, initial: props.initial });
|
|
174
|
+
return;
|
|
175
|
+
case 'logic':
|
|
176
|
+
ctx.logicBlocks.push(props.code);
|
|
177
|
+
return;
|
|
178
|
+
case 'theme':
|
|
179
|
+
return;
|
|
180
|
+
case 'handler':
|
|
181
|
+
return;
|
|
182
|
+
default:
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
// Determine element
|
|
186
|
+
let el;
|
|
187
|
+
if (node.type === 'text') {
|
|
188
|
+
el = textElement(props.variant);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
el = NODE_TO_ELEMENT[node.type] || 'div';
|
|
192
|
+
}
|
|
193
|
+
// Styles → scoped CSS class
|
|
194
|
+
let styles = mergeNodeStyles(node, ctx);
|
|
195
|
+
styles = addLayoutDefaults(node.type, styles);
|
|
196
|
+
const className = addClass(ctx, node.type, styles);
|
|
197
|
+
// Build attributes
|
|
198
|
+
const attrs = [];
|
|
199
|
+
if (className)
|
|
200
|
+
attrs.push(`class="${className}"`);
|
|
201
|
+
// Node-specific attributes
|
|
202
|
+
if (node.type === 'image' && props.src) {
|
|
203
|
+
attrs.push(`:src="'/${props.src}.png'"`);
|
|
204
|
+
attrs.push(`alt="${props.src}"`);
|
|
205
|
+
}
|
|
206
|
+
if (node.type === 'button' && props.to) {
|
|
207
|
+
attrs.push(`@click="$router.push('/${props.to}')"`);
|
|
208
|
+
}
|
|
209
|
+
if (node.type === 'button' && props.action) {
|
|
210
|
+
attrs.push(`@click="${props.action}"`);
|
|
211
|
+
}
|
|
212
|
+
if (node.type === 'input') {
|
|
213
|
+
if (props.bind) {
|
|
214
|
+
attrs.push(`v-model="${props.bind}"`);
|
|
215
|
+
}
|
|
216
|
+
if (props.placeholder) {
|
|
217
|
+
attrs.push(`placeholder="${props.placeholder}"`);
|
|
218
|
+
}
|
|
219
|
+
if (props.type) {
|
|
220
|
+
attrs.push(`type="${props.type}"`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (node.type === 'modal') {
|
|
224
|
+
attrs.push(':open="true"');
|
|
225
|
+
}
|
|
226
|
+
if (node.type === 'list' && props.items) {
|
|
227
|
+
// Dynamic list with v-for
|
|
228
|
+
const itemVar = props.itemVar || 'item';
|
|
229
|
+
attrs.push(`v-for="${itemVar} in ${props.items}" :key="${itemVar}.id || ${itemVar}"`);
|
|
230
|
+
}
|
|
231
|
+
if (node.type === 'progress') {
|
|
232
|
+
if (props.current)
|
|
233
|
+
attrs.push(`:value="${props.current}"`);
|
|
234
|
+
if (props.target)
|
|
235
|
+
attrs.push(`:max="${props.target}"`);
|
|
236
|
+
}
|
|
237
|
+
if (node.type === 'tabs') {
|
|
238
|
+
ctx.vueImports.add('ref');
|
|
239
|
+
}
|
|
240
|
+
// Generic props passthrough
|
|
241
|
+
for (const [k, v] of Object.entries(props)) {
|
|
242
|
+
if (['styles', 'pseudoStyles', 'themeRefs', 'value', 'text', 'src', 'name',
|
|
243
|
+
'variant', 'to', 'action', 'bind', 'placeholder', 'type', 'items',
|
|
244
|
+
'itemVar', 'current', 'target', 'unit', 'color', 'label', 'icon',
|
|
245
|
+
'title', 'active', 'initial', 'code'].includes(k))
|
|
246
|
+
continue;
|
|
247
|
+
attrs.push(`${k}="${v}"`);
|
|
248
|
+
}
|
|
249
|
+
const attrStr = attrs.length > 0 ? ' ' + attrs.join(' ') : '';
|
|
250
|
+
// Children or self-closing
|
|
251
|
+
const hasContent = (node.children && node.children.some(c => c.type !== 'state' && c.type !== 'logic' && c.type !== 'theme' && c.type !== 'handler')) ||
|
|
252
|
+
(node.type === 'text' && props.value) ||
|
|
253
|
+
(node.type === 'button' && props.text) ||
|
|
254
|
+
(node.type === 'progress' && props.label) ||
|
|
255
|
+
(node.type === 'section' && props.title);
|
|
256
|
+
const selfClosing = ['image', 'divider', 'input'].includes(node.type) && !hasContent;
|
|
257
|
+
if (selfClosing) {
|
|
258
|
+
ctx.templateLines.push(`${indent}<${el}${attrStr} />`);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
ctx.templateLines.push(`${indent}<${el}${attrStr}>`);
|
|
262
|
+
// Inner content
|
|
263
|
+
if (node.type === 'text' && props.value) {
|
|
264
|
+
const val = props.value;
|
|
265
|
+
if (typeof val === 'string' && val.startsWith('{{') && val.endsWith('}}')) {
|
|
266
|
+
// Expression binding
|
|
267
|
+
ctx.templateLines.push(`${indent} {{ ${val.slice(2, -2).trim()} }}`);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
ctx.templateLines.push(`${indent} ${val}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (node.type === 'button' && props.text) {
|
|
274
|
+
ctx.templateLines.push(`${indent} ${props.text}`);
|
|
275
|
+
}
|
|
276
|
+
if (node.type === 'section' && props.title) {
|
|
277
|
+
ctx.templateLines.push(`${indent} <h2>${props.title}</h2>`);
|
|
278
|
+
}
|
|
279
|
+
if (node.type === 'progress' && props.label) {
|
|
280
|
+
const current = props.current || 0;
|
|
281
|
+
const target = props.target || 100;
|
|
282
|
+
const unit = props.unit || '';
|
|
283
|
+
ctx.templateLines.push(`${indent} ${props.label}: ${current}/${target} ${unit}`);
|
|
284
|
+
}
|
|
285
|
+
// Tabs handling — render tab buttons + v-if content panels
|
|
286
|
+
if (node.type === 'tabs') {
|
|
287
|
+
const tabs = (node.children || []).filter(c => c.type === 'tab');
|
|
288
|
+
if (tabs.length === 0) {
|
|
289
|
+
ctx.templateLines.push(`${indent}</${el}>`);
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const tabVarName = `activeTab_${ctx.classIdx}`;
|
|
293
|
+
const firstTabName = getProps(tabs[0]).name || '0';
|
|
294
|
+
ctx.stateDecls.push({ name: tabVarName, initial: `'${firstTabName}'` });
|
|
295
|
+
// Tab buttons
|
|
296
|
+
ctx.templateLines.push(`${indent} <div class="tab-buttons">`);
|
|
297
|
+
for (const tab of tabs) {
|
|
298
|
+
const tp = getProps(tab);
|
|
299
|
+
const tabName = tp.name || tp.label || 'tab';
|
|
300
|
+
const label = tp.label || tp.name || 'Tab';
|
|
301
|
+
ctx.templateLines.push(`${indent} <button @click="${tabVarName} = '${tabName}'" :class="{ active: ${tabVarName} === '${tabName}' }">${label}</button>`);
|
|
302
|
+
}
|
|
303
|
+
ctx.templateLines.push(`${indent} </div>`);
|
|
304
|
+
// Tab content panels
|
|
305
|
+
for (const tab of tabs) {
|
|
306
|
+
const tp = getProps(tab);
|
|
307
|
+
const tabName = tp.name || tp.label || 'tab';
|
|
308
|
+
ctx.templateLines.push(`${indent} <div v-if="${tabVarName} === '${tabName}'">`);
|
|
309
|
+
if (tab.children) {
|
|
310
|
+
for (const child of tab.children) {
|
|
311
|
+
renderNode(child, ctx, indent + ' ');
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
ctx.templateLines.push(`${indent} </div>`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
else if (node.children) {
|
|
318
|
+
for (const child of node.children) {
|
|
319
|
+
renderNode(child, ctx, indent + ' ');
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
ctx.templateLines.push(`${indent}</${el}>`);
|
|
323
|
+
}
|
|
324
|
+
// ── CSS Rule Generation ──────────────────────────────────────────────────
|
|
325
|
+
function generateScopedCSS(ctx) {
|
|
326
|
+
if (ctx.cssRules.size === 0)
|
|
327
|
+
return '';
|
|
328
|
+
const lines = [];
|
|
329
|
+
for (const [className, styles] of ctx.cssRules) {
|
|
330
|
+
lines.push(`.${className} {`);
|
|
331
|
+
for (const [key, value] of Object.entries(styles)) {
|
|
332
|
+
lines.push(` ${cssPropertyName(key)}: ${cssValue(key, value)};`);
|
|
333
|
+
}
|
|
334
|
+
lines.push('}');
|
|
335
|
+
lines.push('');
|
|
336
|
+
}
|
|
337
|
+
return lines.join('\n');
|
|
338
|
+
}
|
|
339
|
+
// ── Script Setup Generation ──────────────────────────────────────────────
|
|
340
|
+
function generateScriptSetup(ctx, root) {
|
|
341
|
+
const lines = [];
|
|
342
|
+
const props = getProps(root);
|
|
343
|
+
// Vue imports
|
|
344
|
+
if (ctx.vueImports.size > 0) {
|
|
345
|
+
lines.push(`import { ${[...ctx.vueImports].sort().join(', ')} } from 'vue';`);
|
|
346
|
+
lines.push('');
|
|
347
|
+
}
|
|
348
|
+
// Script-level imports
|
|
349
|
+
for (const imp of ctx.scriptImports) {
|
|
350
|
+
lines.push(imp);
|
|
351
|
+
}
|
|
352
|
+
if (ctx.scriptImports.size > 0)
|
|
353
|
+
lines.push('');
|
|
354
|
+
// Component props via defineProps
|
|
355
|
+
const propNodes = (root.children || []).filter(c => c.type === 'prop');
|
|
356
|
+
if (propNodes.length > 0) {
|
|
357
|
+
lines.push('const props = defineProps<{');
|
|
358
|
+
for (const pn of propNodes) {
|
|
359
|
+
const pp = getProps(pn);
|
|
360
|
+
const opt = pp.optional === 'true' || pp.optional === true ? '?' : '';
|
|
361
|
+
lines.push(` ${pp.name}${opt}: ${pp.type};`);
|
|
362
|
+
}
|
|
363
|
+
lines.push('}>()');
|
|
364
|
+
lines.push('');
|
|
365
|
+
}
|
|
366
|
+
// Emits
|
|
367
|
+
const emitNodes = (root.children || []).filter(c => c.type === 'emit');
|
|
368
|
+
if (emitNodes.length > 0) {
|
|
369
|
+
const emitNames = emitNodes.map(e => `'${getProps(e).name}'`).join(' | ');
|
|
370
|
+
lines.push(`const emit = defineEmits<{`);
|
|
371
|
+
for (const e of emitNodes) {
|
|
372
|
+
const ep = getProps(e);
|
|
373
|
+
const payload = ep.type || 'void';
|
|
374
|
+
lines.push(` (e: '${ep.name}', payload: ${payload}): void;`);
|
|
375
|
+
}
|
|
376
|
+
lines.push(`}>()`);
|
|
377
|
+
lines.push('');
|
|
378
|
+
}
|
|
379
|
+
// State → ref()
|
|
380
|
+
for (const s of ctx.stateDecls) {
|
|
381
|
+
const initial = s.initial;
|
|
382
|
+
// Detect type from initial value
|
|
383
|
+
if (initial === undefined || initial === 'undefined') {
|
|
384
|
+
lines.push(`const ${s.name} = ref();`);
|
|
385
|
+
}
|
|
386
|
+
else if (initial === 'true' || initial === 'false') {
|
|
387
|
+
lines.push(`const ${s.name} = ref(${initial});`);
|
|
388
|
+
}
|
|
389
|
+
else if (!isNaN(Number(initial))) {
|
|
390
|
+
lines.push(`const ${s.name} = ref(${initial});`);
|
|
391
|
+
}
|
|
392
|
+
else if (initial.startsWith("'") || initial.startsWith('"') || initial.startsWith('[') || initial.startsWith('{')) {
|
|
393
|
+
lines.push(`const ${s.name} = ref(${initial});`);
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
lines.push(`const ${s.name} = ref('${initial}');`);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
if (ctx.stateDecls.length > 0)
|
|
400
|
+
lines.push('');
|
|
401
|
+
// Logic blocks
|
|
402
|
+
for (const block of ctx.logicBlocks) {
|
|
403
|
+
lines.push(block);
|
|
404
|
+
lines.push('');
|
|
405
|
+
}
|
|
406
|
+
return lines.join('\n');
|
|
407
|
+
}
|
|
408
|
+
// ── Main Transpiler ──────────────────────────────────────────────────────
|
|
409
|
+
export function transpileVue(root, config) {
|
|
410
|
+
const ctx = createBuilder(config);
|
|
411
|
+
const sourceMap = [];
|
|
412
|
+
// Collect themes
|
|
413
|
+
collectThemes(root, ctx);
|
|
414
|
+
// Render template
|
|
415
|
+
renderNode(root, ctx, ' ');
|
|
416
|
+
// Build script setup
|
|
417
|
+
const scriptSetup = generateScriptSetup(ctx, root);
|
|
418
|
+
// Build scoped CSS
|
|
419
|
+
const scopedCSS = generateScopedCSS(ctx);
|
|
420
|
+
// Assemble SFC
|
|
421
|
+
const sfc = [];
|
|
422
|
+
sfc.push('<script setup lang="ts">');
|
|
423
|
+
if (scriptSetup.trim()) {
|
|
424
|
+
sfc.push(scriptSetup.trimEnd());
|
|
425
|
+
}
|
|
426
|
+
sfc.push('</script>');
|
|
427
|
+
sfc.push('');
|
|
428
|
+
sfc.push('<template>');
|
|
429
|
+
sfc.push(...ctx.templateLines);
|
|
430
|
+
sfc.push('</template>');
|
|
431
|
+
if (scopedCSS.trim()) {
|
|
432
|
+
sfc.push('');
|
|
433
|
+
sfc.push('<style scoped>');
|
|
434
|
+
sfc.push(scopedCSS.trimEnd());
|
|
435
|
+
sfc.push('</style>');
|
|
436
|
+
}
|
|
437
|
+
const code = sfc.join('\n') + '\n';
|
|
438
|
+
const irText = serializeIR(root);
|
|
439
|
+
const irTokenCount = countTokens(irText);
|
|
440
|
+
const tsTokenCount = countTokens(code);
|
|
441
|
+
const tokenReduction = tsTokenCount > 0 ? Math.round((1 - irTokenCount / tsTokenCount) * 100) : 0;
|
|
442
|
+
return {
|
|
443
|
+
code,
|
|
444
|
+
sourceMap: ctx.sourceMap,
|
|
445
|
+
irTokenCount,
|
|
446
|
+
tsTokenCount,
|
|
447
|
+
tokenReduction,
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
//# sourceMappingURL=transpiler-vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transpiler-vue.js","sourceRoot":"","sources":["../src/transpiler-vue.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExE,4EAA4E;AAE5E,MAAM,eAAe,GAA2B;IAC9C,MAAM,EAAE,KAAK;IACb,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,QAAQ;IACb,MAAM,EAAE,QAAQ;IAChB,O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
|
|
1
|
+
{
|
|
2
|
+
"name": "@kernlang/vue",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Kern Vue/Nuxt transpilers — Vue 3 SFC + Nuxt 3 output",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"license": "AGPL-3.0",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@kernlang/core": "2.0.0"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -b",
|
|
20
|
+
"test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js --forceExit --config jest.config.js"
|
|
21
|
+
}
|
|
22
|
+
}
|