@vue-jsx-vapor/macros 2.3.1 → 2.3.2
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/volar.cjs +4 -4
- package/dist/volar.js +4 -4
- package/package.json +5 -5
package/dist/volar.cjs
CHANGED
|
@@ -8,11 +8,11 @@ const __vue_language_core_lib_codegen_style_classProperty_js = require_chunk.__t
|
|
|
8
8
|
const __vue_language_core_lib_utils_parseCssClassNames_js = require_chunk.__toESM(require("@vue/language-core/lib/utils/parseCssClassNames.js"));
|
|
9
9
|
|
|
10
10
|
//#region src/volar/define-component.ts
|
|
11
|
-
function transformDefineComponent(node, options) {
|
|
12
|
-
const { codes, source, ast } = options;
|
|
11
|
+
function transformDefineComponent(node, parent, options) {
|
|
12
|
+
const { codes, source, ast, ts } = options;
|
|
13
13
|
(0, ts_macro.replaceRange)(codes, node.arguments[0].end, node.end - 1);
|
|
14
14
|
const componentOptions = node.arguments[1];
|
|
15
|
-
(0, ts_macro.replaceRange)(codes, node.getStart(ast), node.expression.end + 1, "(", [
|
|
15
|
+
(0, ts_macro.replaceRange)(codes, node.getStart(ast), node.expression.end + 1, ts.isExpressionStatement(parent) ? ";" : "", "(", [
|
|
16
16
|
node.expression.getText(ast),
|
|
17
17
|
source,
|
|
18
18
|
node.getStart(ast),
|
|
@@ -175,7 +175,7 @@ function getRootMap(options) {
|
|
|
175
175
|
if (!rootMap.has(root)) rootMap.set(root, {});
|
|
176
176
|
if (!rootMap.get(root).defineComponent) {
|
|
177
177
|
rootMap.get(root).defineComponent = true;
|
|
178
|
-
transformDefineComponent(parents[2], options);
|
|
178
|
+
transformDefineComponent(parents[2], parents[3], options);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
const macro = getMacro(node, ts, options);
|
package/dist/volar.js
CHANGED
|
@@ -5,11 +5,11 @@ import { generateClassProperty } from "@vue/language-core/lib/codegen/style/clas
|
|
|
5
5
|
import { parseCssClassNames } from "@vue/language-core/lib/utils/parseCssClassNames.js";
|
|
6
6
|
|
|
7
7
|
//#region src/volar/define-component.ts
|
|
8
|
-
function transformDefineComponent(node, options) {
|
|
9
|
-
const { codes, source, ast } = options;
|
|
8
|
+
function transformDefineComponent(node, parent, options) {
|
|
9
|
+
const { codes, source, ast, ts } = options;
|
|
10
10
|
replaceRange(codes, node.arguments[0].end, node.end - 1);
|
|
11
11
|
const componentOptions = node.arguments[1];
|
|
12
|
-
replaceRange(codes, node.getStart(ast), node.expression.end + 1, "(", [
|
|
12
|
+
replaceRange(codes, node.getStart(ast), node.expression.end + 1, ts.isExpressionStatement(parent) ? ";" : "", "(", [
|
|
13
13
|
node.expression.getText(ast),
|
|
14
14
|
source,
|
|
15
15
|
node.getStart(ast),
|
|
@@ -172,7 +172,7 @@ function getRootMap(options) {
|
|
|
172
172
|
if (!rootMap.has(root)) rootMap.set(root, {});
|
|
173
173
|
if (!rootMap.get(root).defineComponent) {
|
|
174
174
|
rootMap.get(root).defineComponent = true;
|
|
175
|
-
transformDefineComponent(parents[2], options);
|
|
175
|
+
transformDefineComponent(parents[2], parents[3], options);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
const macro = getMacro(node, ts, options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-jsx-vapor/macros",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "Macros for Vue JSX Vapor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -167,8 +167,8 @@
|
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
"dependencies": {
|
|
170
|
-
"@vue-macros/common": "^3.0.0-beta.
|
|
171
|
-
"@vue/compiler-sfc": "https://pkg.pr.new/@vue/compiler-sfc@
|
|
170
|
+
"@vue-macros/common": "^3.0.0-beta.10",
|
|
171
|
+
"@vue/compiler-sfc": "https://pkg.pr.new/@vue/compiler-sfc@42f38ca",
|
|
172
172
|
"@vue/language-core": "^2.2.8",
|
|
173
173
|
"hash-sum": "^2.0.0",
|
|
174
174
|
"ts-macro": "^0.1.25",
|
|
@@ -179,8 +179,8 @@
|
|
|
179
179
|
"@nuxt/kit": "^3.16.0",
|
|
180
180
|
"@nuxt/schema": "^3.16.0",
|
|
181
181
|
"@types/hash-sum": "^1.0.2",
|
|
182
|
-
"@vue-macros/test-utils": "^3.0.0-beta.
|
|
183
|
-
"vue": "https://pkg.pr.new/vue@
|
|
182
|
+
"@vue-macros/test-utils": "^3.0.0-beta.10",
|
|
183
|
+
"vue": "https://pkg.pr.new/vue@42f38ca"
|
|
184
184
|
},
|
|
185
185
|
"scripts": {
|
|
186
186
|
"build": "tsdown",
|