@vue-jsx-vapor/macros 2.4.4 → 2.4.5
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/api.cjs +1 -1
- package/dist/api.js +1 -1
- package/dist/astro.cjs +3 -3
- package/dist/astro.js +3 -3
- package/dist/{core-DNI6OWXg.js → core-nX7eV6I_.js} +7 -1
- package/dist/{core-BQThMqcW.cjs → core-za6QuwBF.cjs} +7 -1
- package/dist/esbuild.cjs +3 -3
- package/dist/esbuild.d.cts +2 -2
- package/dist/esbuild.js +3 -3
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/nuxt.cjs +5 -5
- package/dist/nuxt.d.cts +2 -2
- package/dist/nuxt.js +5 -5
- package/dist/{raw-1tKjLen5.cjs → raw-DLAy-nZE.cjs} +1 -1
- package/dist/{raw-D9bTtojC.js → raw-OYk8VYwV.js} +1 -1
- package/dist/raw.cjs +2 -2
- package/dist/raw.js +2 -2
- package/dist/rolldown.cjs +3 -3
- package/dist/rolldown.d.cts +2 -2
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.d.cts +2 -2
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +3 -3
- package/dist/rspack.js +3 -3
- package/dist/{src-Cf1P9kTp.js → src-Bc6ldwCv.js} +1 -1
- package/dist/{src-CoejG7EN.cjs → src-C45gb0ZW.cjs} +1 -1
- package/dist/{vite-Bxyo1gXJ.cjs → vite-C6jXYZ4p.cjs} +1 -1
- package/dist/{vite-DElZQ-WP.js → vite-_MbNdwPy.js} +1 -1
- package/dist/vite.cjs +4 -4
- package/dist/vite.d.cts +2 -2
- package/dist/vite.js +4 -4
- package/dist/volar.cjs +7 -4
- package/dist/volar.js +7 -4
- package/dist/{webpack-C9K1h8eA.js → webpack-DBT5SSOU.js} +1 -1
- package/dist/{webpack-9NZmGyue.cjs → webpack-DltfMpKH.cjs} +1 -1
- package/dist/webpack.cjs +4 -4
- package/dist/webpack.d.cts +2 -2
- package/dist/webpack.js +4 -4
- package/package.json +5 -5
package/dist/api.cjs
CHANGED
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { getMacroExpression, isFunctionalNode, restructure, transformJsxMacros } from "./core-
|
|
1
|
+
import { getMacroExpression, isFunctionalNode, restructure, transformJsxMacros } from "./core-nX7eV6I_.js";
|
|
2
2
|
|
|
3
3
|
export { getMacroExpression, isFunctionalNode, restructure, transformJsxMacros };
|
package/dist/astro.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-za6QuwBF.cjs');
|
|
3
|
+
require('./raw-DLAy-nZE.cjs');
|
|
4
4
|
require('./options-BejTnOdM.cjs');
|
|
5
|
-
const require_src = require('./src-
|
|
5
|
+
const require_src = require('./src-C45gb0ZW.cjs');
|
|
6
6
|
|
|
7
7
|
//#region src/astro.ts
|
|
8
8
|
var astro_default = (options) => ({
|
package/dist/astro.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-nX7eV6I_.js";
|
|
2
|
+
import "./raw-OYk8VYwV.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-Bc6ldwCv.js";
|
|
5
5
|
|
|
6
6
|
//#region src/astro.ts
|
|
7
7
|
var astro_default = (options) => ({
|
|
@@ -187,7 +187,13 @@ function transformDefineComponent(root, propsName, macros, s, autoReturnFunction
|
|
|
187
187
|
continue;
|
|
188
188
|
}
|
|
189
189
|
const defaultValue = getDefaultValue(prop.value.right);
|
|
190
|
-
|
|
190
|
+
let isRequired = false;
|
|
191
|
+
walkAST(prop.value.right, { enter(node) {
|
|
192
|
+
if (node.type === "TSNonNullExpression") {
|
|
193
|
+
isRequired = true;
|
|
194
|
+
this.skip();
|
|
195
|
+
}
|
|
196
|
+
} });
|
|
191
197
|
const propOptions = [];
|
|
192
198
|
if (isRequired) propOptions.push("required: true");
|
|
193
199
|
if (defaultValue) {
|
|
@@ -188,7 +188,13 @@ function transformDefineComponent(root, propsName, macros, s, autoReturnFunction
|
|
|
188
188
|
continue;
|
|
189
189
|
}
|
|
190
190
|
const defaultValue = getDefaultValue(prop.value.right);
|
|
191
|
-
|
|
191
|
+
let isRequired = false;
|
|
192
|
+
(0, __vue_macros_common.walkAST)(prop.value.right, { enter(node) {
|
|
193
|
+
if (node.type === "TSNonNullExpression") {
|
|
194
|
+
isRequired = true;
|
|
195
|
+
this.skip();
|
|
196
|
+
}
|
|
197
|
+
} });
|
|
192
198
|
const propOptions = [];
|
|
193
199
|
if (isRequired) propOptions.push("required: true");
|
|
194
200
|
if (defaultValue) {
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-za6QuwBF.cjs');
|
|
3
|
+
require('./raw-DLAy-nZE.cjs');
|
|
4
4
|
require('./options-BejTnOdM.cjs');
|
|
5
|
-
const require_src = require('./src-
|
|
5
|
+
const require_src = require('./src-C45gb0ZW.cjs');
|
|
6
6
|
|
|
7
7
|
//#region src/esbuild.ts
|
|
8
8
|
var esbuild_default = require_src.src_default.esbuild;
|
package/dist/esbuild.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-Egmm6BVJ.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as esbuild9 from "esbuild";
|
|
3
3
|
|
|
4
4
|
//#region src/esbuild.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => esbuild9.Plugin;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/esbuild.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-nX7eV6I_.js";
|
|
2
|
+
import "./raw-OYk8VYwV.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-Bc6ldwCv.js";
|
|
5
5
|
|
|
6
6
|
//#region src/esbuild.ts
|
|
7
7
|
var esbuild_default = src_default.esbuild;
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-za6QuwBF.cjs');
|
|
3
|
+
require('./raw-DLAy-nZE.cjs');
|
|
4
4
|
const require_options = require('./options-BejTnOdM.cjs');
|
|
5
|
-
const require_src = require('./src-
|
|
5
|
+
const require_src = require('./src-C45gb0ZW.cjs');
|
|
6
6
|
|
|
7
7
|
exports.default = require_src.src_default;
|
|
8
8
|
exports.resolveOptions = require_options.resolveOptions;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-nX7eV6I_.js";
|
|
2
|
+
import "./raw-OYk8VYwV.js";
|
|
3
3
|
import { resolveOptions } from "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-Bc6ldwCv.js";
|
|
5
5
|
|
|
6
6
|
export { src_default as default, resolveOptions };
|
package/dist/nuxt.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
3
|
-
require('./core-
|
|
4
|
-
require('./raw-
|
|
3
|
+
require('./core-za6QuwBF.cjs');
|
|
4
|
+
require('./raw-DLAy-nZE.cjs');
|
|
5
5
|
require('./options-BejTnOdM.cjs');
|
|
6
|
-
require('./src-
|
|
7
|
-
const require_vite = require('./vite-
|
|
8
|
-
const require_webpack = require('./webpack-
|
|
6
|
+
require('./src-C45gb0ZW.cjs');
|
|
7
|
+
const require_vite = require('./vite-C6jXYZ4p.cjs');
|
|
8
|
+
const require_webpack = require('./webpack-DltfMpKH.cjs');
|
|
9
9
|
const __nuxt_kit = require_chunk.__toESM(require("@nuxt/kit"));
|
|
10
10
|
require("@nuxt/schema");
|
|
11
11
|
|
package/dist/nuxt.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Options } from "./options-Egmm6BVJ.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _nuxt_schema0 from "@nuxt/schema";
|
|
3
3
|
|
|
4
4
|
//#region src/nuxt.d.ts
|
|
5
5
|
interface ModuleOptions extends Options {}
|
|
6
|
-
declare const _default:
|
|
6
|
+
declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ModuleOptions, _default as default };
|
package/dist/nuxt.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-nX7eV6I_.js";
|
|
2
|
+
import "./raw-OYk8VYwV.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import "./src-
|
|
5
|
-
import { vite_default } from "./vite-
|
|
6
|
-
import { webpack_default } from "./webpack-
|
|
4
|
+
import "./src-Bc6ldwCv.js";
|
|
5
|
+
import { vite_default } from "./vite-_MbNdwPy.js";
|
|
6
|
+
import { webpack_default } from "./webpack-DBT5SSOU.js";
|
|
7
7
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
|
8
8
|
import "@nuxt/schema";
|
|
9
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_core = require('./core-
|
|
2
|
+
const require_core = require('./core-za6QuwBF.cjs');
|
|
3
3
|
const require_options = require('./options-BejTnOdM.cjs');
|
|
4
4
|
const __vue_macros_common = require_chunk.__toESM(require("@vue-macros/common"));
|
|
5
5
|
const __vue_compiler_sfc = require_chunk.__toESM(require("@vue/compiler-sfc"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { helperPrefix, transformJsxMacros, useModelHelperId, use_model_default, withDefaultsHelperId, with_defaults_default } from "./core-
|
|
1
|
+
import { helperPrefix, transformJsxMacros, useModelHelperId, use_model_default, withDefaultsHelperId, with_defaults_default } from "./core-nX7eV6I_.js";
|
|
2
2
|
import { resolveOptions } from "./options-BWRkHmm5.js";
|
|
3
3
|
import { createFilter, normalizePath } from "@vue-macros/common";
|
|
4
4
|
import { compileStyleAsync } from "@vue/compiler-sfc";
|
package/dist/raw.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
const require_raw = require('./raw-
|
|
2
|
+
require('./core-za6QuwBF.cjs');
|
|
3
|
+
const require_raw = require('./raw-DLAy-nZE.cjs');
|
|
4
4
|
require('./options-BejTnOdM.cjs');
|
|
5
5
|
|
|
6
6
|
exports.default = require_raw.raw_default;
|
package/dist/raw.js
CHANGED
package/dist/rolldown.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-za6QuwBF.cjs');
|
|
3
|
+
require('./raw-DLAy-nZE.cjs');
|
|
4
4
|
require('./options-BejTnOdM.cjs');
|
|
5
|
-
const require_src = require('./src-
|
|
5
|
+
const require_src = require('./src-C45gb0ZW.cjs');
|
|
6
6
|
|
|
7
7
|
//#region src/rolldown.ts
|
|
8
8
|
var rolldown_default = require_src.src_default.rolldown;
|
package/dist/rolldown.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-Egmm6BVJ.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as unplugin13 from "unplugin";
|
|
3
3
|
|
|
4
4
|
//#region src/rolldown.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => unplugin13.RolldownPlugin<any> | unplugin13.RolldownPlugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/rolldown.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-nX7eV6I_.js";
|
|
2
|
+
import "./raw-OYk8VYwV.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-Bc6ldwCv.js";
|
|
5
5
|
|
|
6
6
|
//#region src/rolldown.ts
|
|
7
7
|
var rolldown_default = src_default.rolldown;
|
package/dist/rollup.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-za6QuwBF.cjs');
|
|
3
|
+
require('./raw-DLAy-nZE.cjs');
|
|
4
4
|
require('./options-BejTnOdM.cjs');
|
|
5
|
-
const require_src = require('./src-
|
|
5
|
+
const require_src = require('./src-C45gb0ZW.cjs');
|
|
6
6
|
|
|
7
7
|
//#region src/rollup.ts
|
|
8
8
|
var rollup_default = require_src.src_default.rollup;
|
package/dist/rollup.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-Egmm6BVJ.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as rollup2 from "rollup";
|
|
3
3
|
|
|
4
4
|
//#region src/rollup.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => rollup2.Plugin<any> | rollup2.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-nX7eV6I_.js";
|
|
2
|
+
import "./raw-OYk8VYwV.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-Bc6ldwCv.js";
|
|
5
5
|
|
|
6
6
|
//#region src/rollup.ts
|
|
7
7
|
var rollup_default = src_default.rollup;
|
package/dist/rspack.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-za6QuwBF.cjs');
|
|
3
|
+
require('./raw-DLAy-nZE.cjs');
|
|
4
4
|
require('./options-BejTnOdM.cjs');
|
|
5
|
-
const require_src = require('./src-
|
|
5
|
+
const require_src = require('./src-C45gb0ZW.cjs');
|
|
6
6
|
|
|
7
7
|
//#region src/rspack.ts
|
|
8
8
|
var rspack_default = require_src.src_default.rspack;
|
package/dist/rspack.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-nX7eV6I_.js";
|
|
2
|
+
import "./raw-OYk8VYwV.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import { src_default } from "./src-
|
|
4
|
+
import { src_default } from "./src-Bc6ldwCv.js";
|
|
5
5
|
|
|
6
6
|
//#region src/rspack.ts
|
|
7
7
|
var rspack_default = src_default.rspack;
|
package/dist/vite.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-za6QuwBF.cjs');
|
|
3
|
+
require('./raw-DLAy-nZE.cjs');
|
|
4
4
|
require('./options-BejTnOdM.cjs');
|
|
5
|
-
require('./src-
|
|
6
|
-
const require_vite = require('./vite-
|
|
5
|
+
require('./src-C45gb0ZW.cjs');
|
|
6
|
+
const require_vite = require('./vite-C6jXYZ4p.cjs');
|
|
7
7
|
|
|
8
8
|
exports.default = require_vite.vite_default;
|
package/dist/vite.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-Egmm6BVJ.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vite6 from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/vite.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => vite6.Plugin<any> | vite6.Plugin<any>[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/vite.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-nX7eV6I_.js";
|
|
2
|
+
import "./raw-OYk8VYwV.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import "./src-
|
|
5
|
-
import { vite_default } from "./vite-
|
|
4
|
+
import "./src-Bc6ldwCv.js";
|
|
5
|
+
import { vite_default } from "./vite-_MbNdwPy.js";
|
|
6
6
|
|
|
7
7
|
export { vite_default as default };
|
package/dist/volar.cjs
CHANGED
|
@@ -6,17 +6,15 @@ const ts_macro = require_chunk.__toESM(require("ts-macro"));
|
|
|
6
6
|
|
|
7
7
|
//#region src/volar/define-component.ts
|
|
8
8
|
function transformDefineComponent(node, parent, options) {
|
|
9
|
-
const { codes,
|
|
9
|
+
const { codes, ast, ts } = options;
|
|
10
10
|
(0, ts_macro.replaceRange)(codes, node.arguments[0].end, node.end - 1);
|
|
11
11
|
const componentOptions = node.arguments[1];
|
|
12
12
|
(0, ts_macro.replaceRange)(codes, node.getStart(ast), node.expression.end + 1, ts.isExpressionStatement(parent) ? ";" : "", "(", [
|
|
13
13
|
node.expression.getText(ast),
|
|
14
|
-
source,
|
|
15
14
|
node.getStart(ast),
|
|
16
15
|
ts_macro.allCodeFeatures
|
|
17
16
|
], "(() => ({}) as any, ", componentOptions ? [
|
|
18
17
|
componentOptions.getText(ast),
|
|
19
|
-
source,
|
|
20
18
|
componentOptions.getStart(ast),
|
|
21
19
|
ts_macro.allCodeFeatures
|
|
22
20
|
] : "", "), ");
|
|
@@ -99,7 +97,12 @@ function transformJsxMacros(rootMap, options) {
|
|
|
99
97
|
if (ts.isReturnStatement(node) && node.expression) {
|
|
100
98
|
const props = [...macros.defineModel ?? []];
|
|
101
99
|
const elements = root.parameters[0] && !root.parameters[0].type && ts.isObjectBindingPattern(root.parameters[0].name) ? root.parameters[0].name.elements : [];
|
|
102
|
-
for (const element of elements) if (ts.isIdentifier(element.name))
|
|
100
|
+
for (const element of elements) if (ts.isIdentifier(element.name)) {
|
|
101
|
+
const isRequired = ts.forEachChild(element, function isNonNullExpression(node$1) {
|
|
102
|
+
return ts.isNonNullExpression(node$1) || !!ts.forEachChild(node$1, isNonNullExpression);
|
|
103
|
+
});
|
|
104
|
+
props.push(`${element.name.escapedText}${isRequired ? ":" : "?:"} typeof ${element.name.escapedText}`);
|
|
105
|
+
}
|
|
103
106
|
const shouldWrapByCall = (ts.isArrowFunction(node.expression) || ts.isFunctionExpression(node.expression)) && macros.defineComponent;
|
|
104
107
|
(0, ts_macro.replaceRange)(codes, node.getStart(ast), node.expression.getStart(ast), `const ${__vue_macros_common.HELPER_PREFIX}render = `, shouldWrapByCall ? "(" : "");
|
|
105
108
|
(0, ts_macro.replaceRange)(codes, node.expression.end, node.expression.end, shouldWrapByCall ? ")()" : "", `
|
package/dist/volar.js
CHANGED
|
@@ -4,17 +4,15 @@ import { allCodeFeatures, createPlugin, replaceRange } from "ts-macro";
|
|
|
4
4
|
|
|
5
5
|
//#region src/volar/define-component.ts
|
|
6
6
|
function transformDefineComponent(node, parent, options) {
|
|
7
|
-
const { codes,
|
|
7
|
+
const { codes, ast, ts } = options;
|
|
8
8
|
replaceRange(codes, node.arguments[0].end, node.end - 1);
|
|
9
9
|
const componentOptions = node.arguments[1];
|
|
10
10
|
replaceRange(codes, node.getStart(ast), node.expression.end + 1, ts.isExpressionStatement(parent) ? ";" : "", "(", [
|
|
11
11
|
node.expression.getText(ast),
|
|
12
|
-
source,
|
|
13
12
|
node.getStart(ast),
|
|
14
13
|
allCodeFeatures
|
|
15
14
|
], "(() => ({}) as any, ", componentOptions ? [
|
|
16
15
|
componentOptions.getText(ast),
|
|
17
|
-
source,
|
|
18
16
|
componentOptions.getStart(ast),
|
|
19
17
|
allCodeFeatures
|
|
20
18
|
] : "", "), ");
|
|
@@ -97,7 +95,12 @@ function transformJsxMacros(rootMap, options) {
|
|
|
97
95
|
if (ts.isReturnStatement(node) && node.expression) {
|
|
98
96
|
const props = [...macros.defineModel ?? []];
|
|
99
97
|
const elements = root.parameters[0] && !root.parameters[0].type && ts.isObjectBindingPattern(root.parameters[0].name) ? root.parameters[0].name.elements : [];
|
|
100
|
-
for (const element of elements) if (ts.isIdentifier(element.name))
|
|
98
|
+
for (const element of elements) if (ts.isIdentifier(element.name)) {
|
|
99
|
+
const isRequired = ts.forEachChild(element, function isNonNullExpression(node$1) {
|
|
100
|
+
return ts.isNonNullExpression(node$1) || !!ts.forEachChild(node$1, isNonNullExpression);
|
|
101
|
+
});
|
|
102
|
+
props.push(`${element.name.escapedText}${isRequired ? ":" : "?:"} typeof ${element.name.escapedText}`);
|
|
103
|
+
}
|
|
101
104
|
const shouldWrapByCall = (ts.isArrowFunction(node.expression) || ts.isFunctionExpression(node.expression)) && macros.defineComponent;
|
|
102
105
|
replaceRange(codes, node.getStart(ast), node.expression.getStart(ast), `const ${HELPER_PREFIX}render = `, shouldWrapByCall ? "(" : "");
|
|
103
106
|
replaceRange(codes, node.expression.end, node.expression.end, shouldWrapByCall ? ")()" : "", `
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
require('./core-
|
|
3
|
-
require('./raw-
|
|
2
|
+
require('./core-za6QuwBF.cjs');
|
|
3
|
+
require('./raw-DLAy-nZE.cjs');
|
|
4
4
|
require('./options-BejTnOdM.cjs');
|
|
5
|
-
require('./src-
|
|
6
|
-
const require_webpack = require('./webpack-
|
|
5
|
+
require('./src-C45gb0ZW.cjs');
|
|
6
|
+
const require_webpack = require('./webpack-DltfMpKH.cjs');
|
|
7
7
|
|
|
8
8
|
exports.default = require_webpack.webpack_default;
|
package/dist/webpack.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Options } from "./options-Egmm6BVJ.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as webpack11 from "webpack";
|
|
3
3
|
|
|
4
4
|
//#region src/webpack.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => webpack11.WebpackPluginInstance;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
package/dist/webpack.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./core-
|
|
2
|
-
import "./raw-
|
|
1
|
+
import "./core-nX7eV6I_.js";
|
|
2
|
+
import "./raw-OYk8VYwV.js";
|
|
3
3
|
import "./options-BWRkHmm5.js";
|
|
4
|
-
import "./src-
|
|
5
|
-
import { webpack_default } from "./webpack-
|
|
4
|
+
import "./src-Bc6ldwCv.js";
|
|
5
|
+
import { webpack_default } from "./webpack-DBT5SSOU.js";
|
|
6
6
|
|
|
7
7
|
export { webpack_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-jsx-vapor/macros",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.5",
|
|
4
4
|
"description": "Macros for Vue JSX Vapor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -126,13 +126,13 @@
|
|
|
126
126
|
"@vue-macros/common": "^3.0.0-beta.14",
|
|
127
127
|
"@vue/compiler-sfc": "https://pkg.pr.new/@vue/compiler-sfc@280bc48",
|
|
128
128
|
"hash-sum": "^2.0.0",
|
|
129
|
-
"ts-macro": "^0.1.
|
|
129
|
+
"ts-macro": "^0.1.33",
|
|
130
130
|
"unplugin": "^2.3.5"
|
|
131
131
|
},
|
|
132
132
|
"devDependencies": {
|
|
133
|
-
"@babel/types": "^7.27.
|
|
134
|
-
"@nuxt/kit": "^3.17.
|
|
135
|
-
"@nuxt/schema": "^3.17.
|
|
133
|
+
"@babel/types": "^7.27.4",
|
|
134
|
+
"@nuxt/kit": "^3.17.5",
|
|
135
|
+
"@nuxt/schema": "^3.17.5",
|
|
136
136
|
"@types/hash-sum": "^1.0.2",
|
|
137
137
|
"@vue-macros/test-utils": "^3.0.0-beta.14",
|
|
138
138
|
"vue": "https://pkg.pr.new/vue@280bc48"
|