@eventra_dev/cli-plugin-vue 1.1.0 → 1.1.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-vue-sfc.d.ts","sourceRoot":"","sources":["../src/parse-vue-sfc.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB;IACnC,0GAA0G;IAC1G,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,6GAA6G;AAC7G,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,QAAQ,CAAC,cAAc,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACzD;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,SAAS,eAAe,EAAE,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;
|
|
1
|
+
{"version":3,"file":"parse-vue-sfc.d.ts","sourceRoot":"","sources":["../src/parse-vue-sfc.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB;IACnC,0GAA0G;IAC1G,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,6GAA6G;AAC7G,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,QAAQ,CAAC,cAAc,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACzD;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,SAAS,eAAe,EAAE,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAyFD,iHAAiH;AACjH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,CAkD1E;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzD;AAID;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAgC9D"}
|
package/dist/parse-vue-sfc.js
CHANGED
|
@@ -35,7 +35,7 @@ function collectEventBindings(root, out, handlers) {
|
|
|
35
35
|
function visitElementProps(props) {
|
|
36
36
|
for (const prop of props) {
|
|
37
37
|
if (prop.type === compiler_core_1.NodeTypes.ATTRIBUTE && prop.name === "event") {
|
|
38
|
-
const value = prop.value?.content
|
|
38
|
+
const value = prop.value?.content.trim();
|
|
39
39
|
if (value) {
|
|
40
40
|
out.push({ kind: "literal", value });
|
|
41
41
|
}
|
|
@@ -57,12 +57,12 @@ function collectEventBindings(root, out, handlers) {
|
|
|
57
57
|
continue;
|
|
58
58
|
// `:[expr]="..."` / `@[expr]="..."`: the argument is an expression of its own
|
|
59
59
|
if (prop.arg?.type === compiler_core_1.NodeTypes.SIMPLE_EXPRESSION && !prop.arg.isStatic) {
|
|
60
|
-
handlers.push({ handler: false, code: prop.arg.content
|
|
60
|
+
handlers.push({ handler: false, code: prop.arg.content });
|
|
61
61
|
}
|
|
62
62
|
if (prop.exp?.type !== compiler_core_1.NodeTypes.SIMPLE_EXPRESSION)
|
|
63
63
|
continue;
|
|
64
64
|
if (prop.name === "for") {
|
|
65
|
-
const source = V_FOR_SOURCE.exec(prop.exp.content)?.[1]
|
|
65
|
+
const source = V_FOR_SOURCE.exec(prop.exp.content)?.[1].trim();
|
|
66
66
|
if (source) {
|
|
67
67
|
handlers.push({ handler: false, code: source });
|
|
68
68
|
}
|
|
@@ -84,10 +84,8 @@ function collectEventBindings(root, out, handlers) {
|
|
|
84
84
|
}
|
|
85
85
|
// `{{ expr }}`
|
|
86
86
|
if (node.type === compiler_core_1.NodeTypes.INTERPOLATION && node.content.type === compiler_core_1.NodeTypes.SIMPLE_EXPRESSION) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
handlers.push({ handler: false, code });
|
|
90
|
-
}
|
|
87
|
+
// Vue already trims the expression; an empty `{{ }}` is dropped with the other empty expressions at the end of parseVueSfc
|
|
88
|
+
handlers.push({ handler: false, code: node.content.content });
|
|
91
89
|
}
|
|
92
90
|
}
|
|
93
91
|
visitChildren(root.children);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eventra_dev/cli-plugin-vue",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Eventra CLI plugin — extract track() calls from Vue SFC (.vue) files",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"test": "vitest run",
|
|
36
36
|
"test:watch": "vitest",
|
|
37
37
|
"test:coverage": "vitest run --coverage",
|
|
38
|
-
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
38
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
39
|
+
"test:mutation": "stryker run"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
42
|
"@vue/compiler-core": "^3.5.40",
|
|
@@ -43,6 +44,8 @@
|
|
|
43
44
|
"@vue/compiler-sfc": "^3.5.40"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
47
|
+
"@stryker-mutator/core": "9.6.1",
|
|
48
|
+
"@stryker-mutator/vitest-runner": "9.6.1",
|
|
46
49
|
"@types/node": "^20.0.0",
|
|
47
50
|
"@vitest/coverage-v8": "^4.1.7",
|
|
48
51
|
"typescript": "^5.3.0",
|