@codegraft/vue 0.1.0-beta.0 → 0.1.0-beta.10
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/README.md +20 -2
- package/dist/vue-splitter.d.ts +10 -3
- package/dist/vue-splitter.d.ts.map +1 -1
- package/dist/vue-splitter.js +137 -7
- package/dist/vue-splitter.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,9 +5,27 @@ zones so a Codegraft codemod applies per section:
|
|
|
5
5
|
|
|
6
6
|
| Section | Grammar |
|
|
7
7
|
|---|---|
|
|
8
|
-
| `<template>` | `
|
|
8
|
+
| `<template>` | `vue` (+ one `typescript` zone per embedded expression) |
|
|
9
9
|
| `<script>` / `<script setup>` | `typescript` / `tsx` / `javascript` (by `lang`) |
|
|
10
|
-
| `<style>` | `css` |
|
|
10
|
+
| `<style>` | `css` (+ one `typescript` zone per `v-bind()` argument) |
|
|
11
|
+
|
|
12
|
+
The `<template>` is parsed with the **vue** grammar (not `html`), so a codemod matches its structure
|
|
13
|
+
directly — `interpolation`, `directive_attribute` (`directive_name` / `directive_value` /
|
|
14
|
+
`attribute_value`), component `tag_name`. The grammar's node types are generated into Codegraft's
|
|
15
|
+
typed unions, so `find('directive_attribute')` autocompletes and type-checks like any other.
|
|
16
|
+
|
|
17
|
+
Every JS expression embedded in the template — interpolation bodies, directive values, and dynamic
|
|
18
|
+
arguments (`:[expr]`) — additionally becomes its own `typescript` zone, so the same codemod sees real
|
|
19
|
+
`identifier` / `member_expression` / … nodes inside the template (use-detection, `$$` collapse,
|
|
20
|
+
migrations) rather than opaque text. `v-for` contributes only its iterable (the alias is a
|
|
21
|
+
template-local) and `v-slot` patterns are skipped (locals, not references). These zones overlap the
|
|
22
|
+
structural `vue` zone — structure edits land on the vue nodes, expression edits on the `typescript`
|
|
23
|
+
ones; a value that is a bare object literal (`:class="{ a: x }"`) parses in statement position as a
|
|
24
|
+
block, so identifiers inside it still surface but structural edits targeting the object won't match.
|
|
25
|
+
|
|
26
|
+
A `<style>` likewise yields a `typescript` zone per `v-bind()` argument (`color: v-bind(themeColor)`),
|
|
27
|
+
covering both the bare and quoted (`v-bind('a + "b"')`) forms — so a binding referenced only from CSS
|
|
28
|
+
is seen as used too.
|
|
11
29
|
|
|
12
30
|
```ts
|
|
13
31
|
import { vueSplitter } from '@codegraft/vue'
|
package/dist/vue-splitter.d.ts
CHANGED
|
@@ -2,9 +2,16 @@ import type { ZoneSplitter } from '@codegraft/core';
|
|
|
2
2
|
/**
|
|
3
3
|
* Splits a Vue SFC into its sections by walking the `tree-sitter-vue` CST (never by
|
|
4
4
|
* regex, so `</script>`-like text inside the template can't confuse it). `<template>`
|
|
5
|
-
* becomes
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* becomes a `vue` zone (its own grammar, so `interpolation`/`directive_attribute` nodes
|
|
6
|
+
* stay structural), `<script>`/`<script setup>` a `typescript`/`tsx`/`javascript` zone
|
|
7
|
+
* (by `lang`), and `<style>` a `css` zone — each carrying the exact document offset of
|
|
8
|
+
* its content.
|
|
9
|
+
*
|
|
10
|
+
* The template additionally yields one `typescript` zone per embedded expression —
|
|
11
|
+
* interpolation bodies, directive values, dynamic directive arguments — and `<style>` one per
|
|
12
|
+
* `v-bind()` argument, so a codemod sees real JS nodes inside both (see
|
|
13
|
+
* {@link templateExpressionZones} / {@link styleBindZones}). These overlap the structural `vue` /
|
|
14
|
+
* `css` zone: structure edits land on those nodes, expression edits on the `typescript` ones.
|
|
8
15
|
*/
|
|
9
16
|
export declare const vueSplitter: ZoneSplitter;
|
|
10
17
|
//# sourceMappingURL=vue-splitter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-splitter.d.ts","sourceRoot":"","sources":["../src/vue-splitter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAU9D
|
|
1
|
+
{"version":3,"file":"vue-splitter.d.ts","sourceRoot":"","sources":["../src/vue-splitter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAU9D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW,EAAE,YAuBzB,CAAA"}
|
package/dist/vue-splitter.js
CHANGED
|
@@ -3,19 +3,30 @@ import { Parser, assert } from '@codegraft/core/internal';
|
|
|
3
3
|
// The vue grammar wasm is vendored in this package (tree-sitter-vue ships no prebuilt
|
|
4
4
|
// wasm), so @codegraft/vue owns its grammar with no tree-sitter-vue dependency.
|
|
5
5
|
const VUE_WASM = fileURLToPath(new URL('../wasm/tree-sitter-vue.wasm', import.meta.url));
|
|
6
|
-
const VUE_GRAMMAR = 'vue'; //
|
|
6
|
+
const VUE_GRAMMAR = 'vue'; // the tree-sitter-vue grammar; also the GrammarId of the `<template>` zone
|
|
7
7
|
/**
|
|
8
8
|
* Splits a Vue SFC into its sections by walking the `tree-sitter-vue` CST (never by
|
|
9
9
|
* regex, so `</script>`-like text inside the template can't confuse it). `<template>`
|
|
10
|
-
* becomes
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* becomes a `vue` zone (its own grammar, so `interpolation`/`directive_attribute` nodes
|
|
11
|
+
* stay structural), `<script>`/`<script setup>` a `typescript`/`tsx`/`javascript` zone
|
|
12
|
+
* (by `lang`), and `<style>` a `css` zone — each carrying the exact document offset of
|
|
13
|
+
* its content.
|
|
14
|
+
*
|
|
15
|
+
* The template additionally yields one `typescript` zone per embedded expression —
|
|
16
|
+
* interpolation bodies, directive values, dynamic directive arguments — and `<style>` one per
|
|
17
|
+
* `v-bind()` argument, so a codemod sees real JS nodes inside both (see
|
|
18
|
+
* {@link templateExpressionZones} / {@link styleBindZones}). These overlap the structural `vue` /
|
|
19
|
+
* `css` zone: structure edits land on those nodes, expression edits on the `typescript` ones.
|
|
13
20
|
*/
|
|
14
21
|
export const vueSplitter = {
|
|
15
22
|
id: 'vue',
|
|
16
|
-
|
|
23
|
+
// `vue` is the splitter's own shell grammar (loaded by `init()` below) and doubles as the
|
|
24
|
+
// `<template>` zone grammar; the transformer registers it before this list is preloaded.
|
|
25
|
+
grammars: ['vue', 'typescript', 'tsx', 'javascript', 'css'],
|
|
17
26
|
async init() {
|
|
18
27
|
await Parser.loadGrammar(VUE_GRAMMAR, VUE_WASM);
|
|
28
|
+
// `split()` also parses `<style>` content with the css grammar to extract `v-bind()` expressions.
|
|
29
|
+
await Parser.loadGrammar('css');
|
|
19
30
|
},
|
|
20
31
|
split(source) {
|
|
21
32
|
const root = Parser.parse(source, VUE_GRAMMAR).rootNode;
|
|
@@ -24,6 +35,10 @@ export const vueSplitter = {
|
|
|
24
35
|
const zone = sectionZone(section, source);
|
|
25
36
|
if (zone)
|
|
26
37
|
zones.push(zone);
|
|
38
|
+
if (section.type === 'template_element')
|
|
39
|
+
zones.push(...templateExpressionZones(section, source));
|
|
40
|
+
else if (section.type === 'style_element')
|
|
41
|
+
zones.push(...styleBindZones(section));
|
|
27
42
|
}
|
|
28
43
|
return zones;
|
|
29
44
|
},
|
|
@@ -34,9 +49,10 @@ function sectionZone(section, source) {
|
|
|
34
49
|
const startTag = childByType(section, 'start_tag');
|
|
35
50
|
const endTag = childByType(section, 'end_tag');
|
|
36
51
|
assert(startTag && endTag, 'a <template> element must have start and end tags');
|
|
37
|
-
// content lives between the tags
|
|
52
|
+
// content lives between the tags; re-parsed with the vue grammar (not html) so template
|
|
53
|
+
// expressions stay structural — `interpolation`, `directive_attribute`, component `tag_name`.
|
|
38
54
|
return {
|
|
39
|
-
language: '
|
|
55
|
+
language: 'vue',
|
|
40
56
|
source: source.slice(startTag.endIndex, endTag.startIndex),
|
|
41
57
|
startOffset: startTag.endIndex,
|
|
42
58
|
};
|
|
@@ -58,6 +74,120 @@ function sectionZone(section, source) {
|
|
|
58
74
|
return null;
|
|
59
75
|
}
|
|
60
76
|
}
|
|
77
|
+
/** Depth-first walk over named children; `visit` returns `false` to stop descending into a node. */
|
|
78
|
+
function walk(node, visit) {
|
|
79
|
+
if (visit(node))
|
|
80
|
+
for (const child of namedChildren(node))
|
|
81
|
+
walk(child, visit);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Every JS expression embedded in the template — interpolation bodies, directive values, and dynamic
|
|
85
|
+
* directive arguments (`:[expr]`) — as its own zone, so a codemod sees real `identifier` /
|
|
86
|
+
* `member_expression` / … nodes (use-detection, `$$` collapse, migrations) instead of opaque text.
|
|
87
|
+
* Offsets are document-absolute (this walk runs over the whole-SFC parse), so edits map straight back.
|
|
88
|
+
*
|
|
89
|
+
* Values are parsed as **TypeScript**: a superset for expressions, it accepts template `as` casts and
|
|
90
|
+
* avoids the JSX ambiguity a `tsx` parse would give `a < b`. The classifier is deliberately small —
|
|
91
|
+
* `v-for` (keep only the iterable; its alias introduces template-locals) and `v-slot` (a binding
|
|
92
|
+
* pattern, no references) are the sole special cases; every other value is emitted whole. A value that
|
|
93
|
+
* is a bare object literal (`:class="{ a: x }"`) parses in statement position as a block, not an
|
|
94
|
+
* object — identifiers inside still surface, but structural edits targeting the object won't match.
|
|
95
|
+
*/
|
|
96
|
+
function templateExpressionZones(template, source) {
|
|
97
|
+
const zones = [];
|
|
98
|
+
walk(template, (node) => {
|
|
99
|
+
if (node.type === 'interpolation') {
|
|
100
|
+
const body = childByType(node, 'raw_text');
|
|
101
|
+
if (body)
|
|
102
|
+
pushExpr(zones, body.text, body.startIndex);
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (node.type === 'directive_attribute') {
|
|
106
|
+
collectDirective(node, source, zones);
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
});
|
|
111
|
+
return zones;
|
|
112
|
+
}
|
|
113
|
+
// `(item, i) in items` / `item of items` → capture the alias and the iterable separately; the lazy
|
|
114
|
+
// first group stops at the first ` in `/` of `, matching Vue's own `forAliasRE`.
|
|
115
|
+
const FOR_ALIAS_RE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
|
|
116
|
+
function collectDirective(attr, source, zones) {
|
|
117
|
+
// `:[expr]` — the dynamic argument is itself a reference expression, regardless of the value.
|
|
118
|
+
const dynamic = firstDescendant(attr, 'dynamic_directive_inner_value');
|
|
119
|
+
if (dynamic)
|
|
120
|
+
pushExpr(zones, dynamic.text, dynamic.startIndex);
|
|
121
|
+
const value = firstDescendant(attr, 'attribute_value');
|
|
122
|
+
if (!value)
|
|
123
|
+
return; // valueless directive (`v-else`, `v-pre`, `#default`, …)
|
|
124
|
+
const kind = directiveKind(attr, source);
|
|
125
|
+
if (kind === 'slot')
|
|
126
|
+
return; // `v-slot`/`#` value is a binding pattern — locals, not references
|
|
127
|
+
if (kind === 'for') {
|
|
128
|
+
const m = FOR_ALIAS_RE.exec(value.text); // keep only the iterable; the alias is a template-local
|
|
129
|
+
if (m)
|
|
130
|
+
pushExpr(zones, m[2], value.startIndex + (value.text.length - m[2].length));
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
pushExpr(zones, value.text, value.startIndex);
|
|
134
|
+
}
|
|
135
|
+
/** `v-for` and `v-slot` need special value handling; every other directive's value is a plain
|
|
136
|
+
* expression. The vue CST collapses `:`/`@`/`#` shorthands to a bare `directive_value`, so the slot
|
|
137
|
+
* shorthand is recovered from the `#` sigil immediately preceding the argument. */
|
|
138
|
+
function directiveKind(attr, source) {
|
|
139
|
+
const name = childByType(attr, 'directive_name');
|
|
140
|
+
if (name) {
|
|
141
|
+
if (name.text === 'v-for')
|
|
142
|
+
return 'for';
|
|
143
|
+
if (name.text === 'v-slot')
|
|
144
|
+
return 'slot';
|
|
145
|
+
return 'expr';
|
|
146
|
+
}
|
|
147
|
+
const arg = childByType(attr, 'directive_value');
|
|
148
|
+
if (arg && source[arg.startIndex - 1] === '#')
|
|
149
|
+
return 'slot';
|
|
150
|
+
return 'expr';
|
|
151
|
+
}
|
|
152
|
+
function pushExpr(zones, source, startOffset) {
|
|
153
|
+
if (source.trim() === '')
|
|
154
|
+
return; // empty `{{ }}` / `:x=""` — nothing to parse
|
|
155
|
+
zones.push({ language: 'typescript', source, startOffset });
|
|
156
|
+
}
|
|
157
|
+
/** Depth-first search for the first descendant of `type` (the value/argument nodes sit a level or
|
|
158
|
+
* two below `directive_attribute`, under `quoted_attribute_value` / `dynamic_directive_value`). */
|
|
159
|
+
function firstDescendant(node, type) {
|
|
160
|
+
for (const child of namedChildren(node)) {
|
|
161
|
+
if (child.type === type)
|
|
162
|
+
return child;
|
|
163
|
+
const nested = firstDescendant(child, type);
|
|
164
|
+
if (nested)
|
|
165
|
+
return nested;
|
|
166
|
+
}
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Vue's `<style>` can reference a script binding through the special `v-bind()` css function
|
|
171
|
+
* (`color: v-bind(themeColor)`). Parse the style with the css grammar and emit each `v-bind()`
|
|
172
|
+
* argument — a bare `plain_value` (`themeColor`, `theme.color`) or a quoted `string_content` (a JS
|
|
173
|
+
* expression) — as a `typescript` zone, so it reads as a real reference like a template expression.
|
|
174
|
+
* Gated on a cheap substring so a style without `v-bind` skips the parse entirely.
|
|
175
|
+
*/
|
|
176
|
+
function styleBindZones(section) {
|
|
177
|
+
const body = childByType(section, 'raw_text');
|
|
178
|
+
if (!body || !body.text.includes('v-bind('))
|
|
179
|
+
return [];
|
|
180
|
+
const zones = [];
|
|
181
|
+
walk(Parser.parse(body.text, 'css').rootNode, (node) => {
|
|
182
|
+
if (node.type !== 'call_expression' || childByType(node, 'function_name')?.text !== 'v-bind')
|
|
183
|
+
return true;
|
|
184
|
+
const arg = firstDescendant(node, 'plain_value') ?? firstDescendant(node, 'string_content');
|
|
185
|
+
if (arg)
|
|
186
|
+
pushExpr(zones, arg.text, body.startIndex + arg.startIndex); // body offset is document-absolute
|
|
187
|
+
return false;
|
|
188
|
+
});
|
|
189
|
+
return zones;
|
|
190
|
+
}
|
|
61
191
|
function scriptLanguage(startTag) {
|
|
62
192
|
const lang = /\blang\s*=\s*["']([^"']+)["']/.exec(startTag)?.[1];
|
|
63
193
|
if (lang === 'ts')
|
package/dist/vue-splitter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-splitter.js","sourceRoot":"","sources":["../src/vue-splitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAa,MAAM,0BAA0B,CAAA;AAEpE,sFAAsF;AACtF,gFAAgF;AAChF,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,8BAA8B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AACxF,MAAM,WAAW,GAAG,KAAK,CAAA,CAAC,
|
|
1
|
+
{"version":3,"file":"vue-splitter.js","sourceRoot":"","sources":["../src/vue-splitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAa,MAAM,0BAA0B,CAAA;AAEpE,sFAAsF;AACtF,gFAAgF;AAChF,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,8BAA8B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AACxF,MAAM,WAAW,GAAG,KAAK,CAAA,CAAC,2EAA2E;AAIrG;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,EAAE,EAAE,KAAK;IACT,0FAA0F;IAC1F,yFAAyF;IACzF,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,CAAC;IAE3D,KAAK,CAAC,IAAI;QACR,MAAM,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;QAC/C,kGAAkG;QAClG,MAAM,M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C,CAAC;AAED,SAAS,aAAa,CAAC,IAAU;IAC/B,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAa,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAA;AAChE,CAAC;AAED,SAAS,WAAW,CAAC,IAAU,EAAE,IAAY;IAC3C,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,CAAA;AACjE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codegraft/vue",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.10",
|
|
4
4
|
"description": "Vue SFC support for Codegraft: vueSplitter splits a .vue file into <template>/<script>/<style> zones.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"node": ">=22.13"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@codegraft/core": "0.1.0-beta.
|
|
29
|
+
"@codegraft/core": "0.1.0-beta.10"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"tree-sitter-css": "^0.25.0",
|