@vue-jsx-vapor/macros 2.5.3 → 2.6.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/dist/esbuild.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./options-K4yleEdU.js";
2
- import * as esbuild14 from "esbuild";
2
+ import * as esbuild1 from "esbuild";
3
3
 
4
4
  //#region src/esbuild.d.ts
5
- declare const _default: (options?: Options | undefined) => esbuild14.Plugin;
5
+ declare const _default: (options?: Options | undefined) => esbuild1.Plugin;
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/nuxt.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Options } from "./options-K4yleEdU.js";
2
- import * as _nuxt_schema7 from "@nuxt/schema";
2
+ import * as _nuxt_schema2 from "@nuxt/schema";
3
3
 
4
4
  //#region src/nuxt.d.ts
5
5
  interface ModuleOptions extends Options {}
6
- declare const _default: _nuxt_schema7.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
+ declare const _default: _nuxt_schema2.NuxtModule<ModuleOptions, ModuleOptions, false>;
7
7
  //#endregion
8
8
  export { ModuleOptions, _default as default };
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./options-K4yleEdU.js";
2
- import * as unplugin1 from "unplugin";
2
+ import * as unplugin4 from "unplugin";
3
3
 
4
4
  //#region src/rolldown.d.ts
5
- declare const _default: (options?: Options | undefined) => unplugin1.RolldownPlugin<any> | unplugin1.RolldownPlugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => unplugin4.RolldownPlugin<any> | unplugin4.RolldownPlugin<any>[];
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/rollup.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./options-K4yleEdU.js";
2
- import * as rollup4 from "rollup";
2
+ import * as rollup7 from "rollup";
3
3
 
4
4
  //#region src/rollup.d.ts
5
- declare const _default: (options?: Options | undefined) => rollup4.Plugin<any> | rollup4.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => rollup7.Plugin<any> | rollup7.Plugin<any>[];
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/vite.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./options-K4yleEdU.js";
2
- import * as vite9 from "vite";
2
+ import * as vite11 from "vite";
3
3
 
4
4
  //#region src/vite.d.ts
5
- declare const _default: (options?: Options | undefined) => vite9.Plugin<any> | vite9.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => vite11.Plugin<any> | vite11.Plugin<any>[];
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/volar.cjs CHANGED
@@ -7,9 +7,23 @@ const ts_macro = require_chunk.__toESM(require("ts-macro"));
7
7
  //#region src/volar/define-component.ts
8
8
  function transformDefineComponent(node, parent, options) {
9
9
  const { codes, ast, ts } = options;
10
- codes.replaceRange(node.arguments[0].end, node.end - 1);
11
- const componentOptions = node.arguments[1];
12
- codes.replaceRange(node.getStart(ast), node.expression.end + 1, ts.isExpressionStatement(parent) ? ";" : "", "(", [node.expression.getText(ast), node.getStart(ast)], "(() => ({}) as any,", componentOptions ? [componentOptions.getText(ast), componentOptions.getStart(ast)] : "", "), ");
10
+ const [comp, compOptions] = node.arguments;
11
+ codes.replaceRange(comp.end, node.end - 1);
12
+ codes.replaceRange(node.getStart(ast), node.expression.end, ts.isExpressionStatement(parent) ? ";" : "", `(() => {
13
+ const __setup = `);
14
+ const result = (ts.isArrowFunction(comp) || ts.isFunctionExpression(comp)) && comp.typeParameters?.length ? ["__setup"] : [
15
+ [node.expression.getText(ast), node.expression.getStart(ast)],
16
+ `({
17
+ __typeProps: {} as Parameters<typeof __setup>[0],
18
+ ...{} as Parameters<typeof __setup>[1] extends { slots?: infer S, expose?: infer E } | undefined ? {
19
+ setup: E extends (exposed: infer Exposed) => any ? () => Exposed : never,
20
+ slots: S extends Record<string, any> ? import('vue').SlotsType<S> : never
21
+ } : {},`,
22
+ ...compOptions ? ["\n ...", [compOptions.getText(ast), compOptions.getStart(ast)]] : [],
23
+ `
24
+ })`
25
+ ];
26
+ codes.replaceRange(node.end, node.end, "\n return ", ...result, `\n})()`);
13
27
  }
14
28
 
15
29
  //#endregion
@@ -84,9 +98,9 @@ function transformJsxMacros(rootMap, options) {
84
98
  if (!root?.body || Object.keys(macros).length === 1 && macros.defineStyle) continue;
85
99
  const asyncModifier = root.modifiers?.find((modifier) => modifier.kind === ts.SyntaxKind.AsyncKeyword);
86
100
  if (asyncModifier && macros.defineComponent) codes.replaceRange(asyncModifier.pos, asyncModifier.end);
87
- const result = `({}) as __VLS_PickNotAny<typeof ${__vue_macros_common.HELPER_PREFIX}ctx.render, {}> & { __ctx: typeof ${__vue_macros_common.HELPER_PREFIX}ctx }`;
101
+ const result = `__ctx.render`;
88
102
  const propsType = root.parameters[0]?.type ? root.parameters[0].type.getText(ast) : "{}";
89
- codes.replaceRange(root.parameters.pos, root.parameters.pos, ts.isArrowFunction(root) && root.parameters.pos === root.pos ? "(" : "", `${__vue_macros_common.HELPER_PREFIX}props: typeof ${__vue_macros_common.HELPER_PREFIX}ctx.props & ${propsType}, `, `${__vue_macros_common.HELPER_PREFIX}placeholder?: {}, `, `${__vue_macros_common.HELPER_PREFIX}ctx = {} as Awaited<ReturnType<typeof ${__vue_macros_common.HELPER_PREFIX}setup>>, `, `${__vue_macros_common.HELPER_PREFIX}setup = (${asyncModifier ? "async" : ""}(`);
103
+ codes.replaceRange(root.parameters.pos, root.parameters.pos, ts.isArrowFunction(root) && root.parameters.pos === root.pos ? "(" : "", `__props: typeof __ctx.props & ${propsType}, `, `__context?: typeof __ctx.context, `, `__ctx = {} as Awaited<ReturnType<typeof __fn>>, `, `__fn = (${asyncModifier ? "async" : ""}(`);
90
104
  if (ts.isArrowFunction(root)) codes.replaceRange(root.end, root.end, `))${root.pos === root.parameters.pos ? ")" : ""} => `, result);
91
105
  else {
92
106
  codes.replaceRange(root.body.getStart(ast), root.body.getStart(ast), "=>");
@@ -103,13 +117,16 @@ function transformJsxMacros(rootMap, options) {
103
117
  props.push(`${element.name.escapedText}${isRequired ? ":" : "?:"} typeof ${element.name.escapedText}`);
104
118
  }
105
119
  const shouldWrapByCall = (ts.isArrowFunction(node.expression) || ts.isFunctionExpression(node.expression)) && macros.defineComponent;
106
- codes.replaceRange(node.getStart(ast), node.expression.getStart(ast), `const ${__vue_macros_common.HELPER_PREFIX}render = `, shouldWrapByCall ? "(" : "");
120
+ codes.replaceRange(node.getStart(ast), node.expression.getStart(ast), `const __render = `, shouldWrapByCall ? "(" : "");
107
121
  codes.replaceRange(node.expression.end, node.expression.end, shouldWrapByCall ? ")()" : "", `
108
- return {
109
- props: {} as {${props.join(", ")}},
110
- slots: {} as ${macros.defineSlots ?? "{}"},
111
- expose: (exposed: import('vue').ShallowUnwrapRef<${macros.defineExpose ?? "{}"}>) => {},
112
- render: ${__vue_macros_common.HELPER_PREFIX}render,
122
+ return {} as {
123
+ props: {${props.join(", ")}},
124
+ context: {
125
+ slots?: ${macros.defineSlots ?? "{}"},
126
+ expose?: (exposed: import('vue').ShallowUnwrapRef<${macros.defineExpose ?? "{}"}>) => void,
127
+ attrs?: Record<string, any>
128
+ },
129
+ render: typeof __render
113
130
  }`);
114
131
  }
115
132
  });
@@ -121,8 +138,8 @@ return {
121
138
  function getGlobalTypes(rootMap, options) {
122
139
  let defineStyle = "";
123
140
  if (options.defineSlots.alias) {
124
- defineStyle = options.defineStyle.alias.map((alias) => `declare const ${alias}: { <T>(...args: ${__vue_macros_common.HELPER_PREFIX}StyleArgs): T; scss: <T>(...args: ${__vue_macros_common.HELPER_PREFIX}StyleArgs)=> T; sass: <T>(...args: ${__vue_macros_common.HELPER_PREFIX}StyleArgs)=> T; stylus: <T>(...args: ${__vue_macros_common.HELPER_PREFIX}StyleArgs)=> T; less: <T>(...args: ${__vue_macros_common.HELPER_PREFIX}StyleArgs)=> T; postcss: <T>(...args: ${__vue_macros_common.HELPER_PREFIX}StyleArgs)=> T };`).join("\n");
125
- defineStyle += `\ntype ${__vue_macros_common.HELPER_PREFIX}StyleArgs = [style: string, options?: { scoped?: boolean }];`;
141
+ defineStyle = options.defineStyle.alias.map((alias) => `declare const ${alias}: { <T>(...args: __StyleArgs): T; scss: <T>(...args: __StyleArgs)=> T; sass: <T>(...args: __StyleArgs)=> T; stylus: <T>(...args: __StyleArgs)=> T; less: <T>(...args: __StyleArgs)=> T; postcss: <T>(...args: __StyleArgs)=> T };`).join("\n");
142
+ defineStyle += `\ntype __StyleArgs = [style: string, options?: { scoped?: boolean }];`;
126
143
  }
127
144
  if (!rootMap.size) return `\n${defineStyle}`;
128
145
  const defineSlots = options.defineSlots.alias.flatMap((alias) => [`declare function ${alias}<T extends Record<string, any>>(): Partial<T>;`, `declare function ${alias}<T extends Record<string, any>>(slots: T): T;`]).join("\n");
@@ -135,8 +152,6 @@ ${VueMacros ? `declare const { ${VueMacros} }: typeof import('vue');` : ""}
135
152
  ${defineSlots}
136
153
  ${defineExpose}
137
154
  ${defineStyle}
138
- // @ts-ignore
139
- type __VLS_IsAny<T> = 0 extends 1 & T ? true : false; type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
140
155
  `;
141
156
  }
142
157
 
@@ -214,18 +229,18 @@ function getRootMap(options) {
214
229
  }
215
230
  if (!hasRequired && isRequired) codes.replaceRange(modelOptions.end - 1, modelOptions.end - 1, `${!modelOptions.properties.hasTrailingComma && modelOptions.properties.length ? "," : ""} required: true`);
216
231
  } else if (isRequired) codes.replaceRange(expression.arguments.end, expression.arguments.end, `${!expression.arguments.hasTrailingComma && expression.arguments.length ? "," : ""} { required: true }`);
217
- const id = toValidAssetId(modelName, `${__vue_macros_common.HELPER_PREFIX}model`);
232
+ const id = toValidAssetId(modelName, `__model`);
218
233
  const typeString = `import('vue').UnwrapRef<typeof ${id}>`;
219
234
  const defineModel = rootMap.get(root).defineModel ??= [];
220
235
  defineModel.push(`${modelName.includes("-") ? `'${modelName}'` : modelName}${isRequired ? ":" : "?:"} ${typeString}`, `'onUpdate:${modelName}'?: ($event: ${typeString}) => any`);
221
236
  if (expression.typeArguments?.[1]) defineModel.push(`${modelName}Modifiers?: Partial<Record<${(0, ts_macro.getText)(expression.typeArguments[1], ast, ts)}, boolean>>`);
222
- if (ts.isVariableStatement(node)) codes.replaceRange(initializer.getStart(ast), initializer.getStart(ast), `// @ts-ignore\n${id};\nlet ${id} = `);
237
+ codes.replaceRange(initializer.getStart(ast), initializer.getStart(ast), `// @ts-ignore\n${id};\nlet ${id} = `);
223
238
  } else if (options.defineSlots.alias.includes(macroName)) {
224
- codes.replaceRange(expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${__vue_macros_common.HELPER_PREFIX}slots;\nconst ${__vue_macros_common.HELPER_PREFIX}slots = `);
225
- rootMap.get(root).defineSlots = `Partial<typeof ${__vue_macros_common.HELPER_PREFIX}slots>`;
239
+ codes.replaceRange(expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n__slots;\nconst __slots = `);
240
+ rootMap.get(root).defineSlots = `Partial<typeof __slots>`;
226
241
  } else if (options.defineExpose.alias.includes(macroName)) {
227
- codes.replaceRange(expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${__vue_macros_common.HELPER_PREFIX}exposed;\nconst ${__vue_macros_common.HELPER_PREFIX}exposed = `);
228
- rootMap.get(root).defineExpose = `typeof ${__vue_macros_common.HELPER_PREFIX}exposed`;
242
+ codes.replaceRange(expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n__exposed;\nconst __exposed = `);
243
+ rootMap.get(root).defineExpose = `typeof __exposed`;
229
244
  }
230
245
  }
231
246
  }
package/dist/volar.js CHANGED
@@ -1,13 +1,27 @@
1
1
  import { resolveOptions } from "./options-BWRkHmm5.js";
2
- import { HELPER_PREFIX, REGEX_VUE_SFC, createFilter } from "@vue-macros/common";
2
+ import { REGEX_VUE_SFC, createFilter } from "@vue-macros/common";
3
3
  import { allCodeFeatures, createPlugin, getText } from "ts-macro";
4
4
 
5
5
  //#region src/volar/define-component.ts
6
6
  function transformDefineComponent(node, parent, options) {
7
7
  const { codes, ast, ts } = options;
8
- codes.replaceRange(node.arguments[0].end, node.end - 1);
9
- const componentOptions = node.arguments[1];
10
- codes.replaceRange(node.getStart(ast), node.expression.end + 1, ts.isExpressionStatement(parent) ? ";" : "", "(", [node.expression.getText(ast), node.getStart(ast)], "(() => ({}) as any,", componentOptions ? [componentOptions.getText(ast), componentOptions.getStart(ast)] : "", "), ");
8
+ const [comp, compOptions] = node.arguments;
9
+ codes.replaceRange(comp.end, node.end - 1);
10
+ codes.replaceRange(node.getStart(ast), node.expression.end, ts.isExpressionStatement(parent) ? ";" : "", `(() => {
11
+ const __setup = `);
12
+ const result = (ts.isArrowFunction(comp) || ts.isFunctionExpression(comp)) && comp.typeParameters?.length ? ["__setup"] : [
13
+ [node.expression.getText(ast), node.expression.getStart(ast)],
14
+ `({
15
+ __typeProps: {} as Parameters<typeof __setup>[0],
16
+ ...{} as Parameters<typeof __setup>[1] extends { slots?: infer S, expose?: infer E } | undefined ? {
17
+ setup: E extends (exposed: infer Exposed) => any ? () => Exposed : never,
18
+ slots: S extends Record<string, any> ? import('vue').SlotsType<S> : never
19
+ } : {},`,
20
+ ...compOptions ? ["\n ...", [compOptions.getText(ast), compOptions.getStart(ast)]] : [],
21
+ `
22
+ })`
23
+ ];
24
+ codes.replaceRange(node.end, node.end, "\n return ", ...result, `\n})()`);
11
25
  }
12
26
 
13
27
  //#endregion
@@ -82,9 +96,9 @@ function transformJsxMacros(rootMap, options) {
82
96
  if (!root?.body || Object.keys(macros).length === 1 && macros.defineStyle) continue;
83
97
  const asyncModifier = root.modifiers?.find((modifier) => modifier.kind === ts.SyntaxKind.AsyncKeyword);
84
98
  if (asyncModifier && macros.defineComponent) codes.replaceRange(asyncModifier.pos, asyncModifier.end);
85
- const result = `({}) as __VLS_PickNotAny<typeof ${HELPER_PREFIX}ctx.render, {}> & { __ctx: typeof ${HELPER_PREFIX}ctx }`;
99
+ const result = `__ctx.render`;
86
100
  const propsType = root.parameters[0]?.type ? root.parameters[0].type.getText(ast) : "{}";
87
- codes.replaceRange(root.parameters.pos, root.parameters.pos, ts.isArrowFunction(root) && root.parameters.pos === root.pos ? "(" : "", `${HELPER_PREFIX}props: typeof ${HELPER_PREFIX}ctx.props & ${propsType}, `, `${HELPER_PREFIX}placeholder?: {}, `, `${HELPER_PREFIX}ctx = {} as Awaited<ReturnType<typeof ${HELPER_PREFIX}setup>>, `, `${HELPER_PREFIX}setup = (${asyncModifier ? "async" : ""}(`);
101
+ codes.replaceRange(root.parameters.pos, root.parameters.pos, ts.isArrowFunction(root) && root.parameters.pos === root.pos ? "(" : "", `__props: typeof __ctx.props & ${propsType}, `, `__context?: typeof __ctx.context, `, `__ctx = {} as Awaited<ReturnType<typeof __fn>>, `, `__fn = (${asyncModifier ? "async" : ""}(`);
88
102
  if (ts.isArrowFunction(root)) codes.replaceRange(root.end, root.end, `))${root.pos === root.parameters.pos ? ")" : ""} => `, result);
89
103
  else {
90
104
  codes.replaceRange(root.body.getStart(ast), root.body.getStart(ast), "=>");
@@ -101,13 +115,16 @@ function transformJsxMacros(rootMap, options) {
101
115
  props.push(`${element.name.escapedText}${isRequired ? ":" : "?:"} typeof ${element.name.escapedText}`);
102
116
  }
103
117
  const shouldWrapByCall = (ts.isArrowFunction(node.expression) || ts.isFunctionExpression(node.expression)) && macros.defineComponent;
104
- codes.replaceRange(node.getStart(ast), node.expression.getStart(ast), `const ${HELPER_PREFIX}render = `, shouldWrapByCall ? "(" : "");
118
+ codes.replaceRange(node.getStart(ast), node.expression.getStart(ast), `const __render = `, shouldWrapByCall ? "(" : "");
105
119
  codes.replaceRange(node.expression.end, node.expression.end, shouldWrapByCall ? ")()" : "", `
106
- return {
107
- props: {} as {${props.join(", ")}},
108
- slots: {} as ${macros.defineSlots ?? "{}"},
109
- expose: (exposed: import('vue').ShallowUnwrapRef<${macros.defineExpose ?? "{}"}>) => {},
110
- render: ${HELPER_PREFIX}render,
120
+ return {} as {
121
+ props: {${props.join(", ")}},
122
+ context: {
123
+ slots?: ${macros.defineSlots ?? "{}"},
124
+ expose?: (exposed: import('vue').ShallowUnwrapRef<${macros.defineExpose ?? "{}"}>) => void,
125
+ attrs?: Record<string, any>
126
+ },
127
+ render: typeof __render
111
128
  }`);
112
129
  }
113
130
  });
@@ -119,8 +136,8 @@ return {
119
136
  function getGlobalTypes(rootMap, options) {
120
137
  let defineStyle = "";
121
138
  if (options.defineSlots.alias) {
122
- defineStyle = options.defineStyle.alias.map((alias) => `declare const ${alias}: { <T>(...args: ${HELPER_PREFIX}StyleArgs): T; scss: <T>(...args: ${HELPER_PREFIX}StyleArgs)=> T; sass: <T>(...args: ${HELPER_PREFIX}StyleArgs)=> T; stylus: <T>(...args: ${HELPER_PREFIX}StyleArgs)=> T; less: <T>(...args: ${HELPER_PREFIX}StyleArgs)=> T; postcss: <T>(...args: ${HELPER_PREFIX}StyleArgs)=> T };`).join("\n");
123
- defineStyle += `\ntype ${HELPER_PREFIX}StyleArgs = [style: string, options?: { scoped?: boolean }];`;
139
+ defineStyle = options.defineStyle.alias.map((alias) => `declare const ${alias}: { <T>(...args: __StyleArgs): T; scss: <T>(...args: __StyleArgs)=> T; sass: <T>(...args: __StyleArgs)=> T; stylus: <T>(...args: __StyleArgs)=> T; less: <T>(...args: __StyleArgs)=> T; postcss: <T>(...args: __StyleArgs)=> T };`).join("\n");
140
+ defineStyle += `\ntype __StyleArgs = [style: string, options?: { scoped?: boolean }];`;
124
141
  }
125
142
  if (!rootMap.size) return `\n${defineStyle}`;
126
143
  const defineSlots = options.defineSlots.alias.flatMap((alias) => [`declare function ${alias}<T extends Record<string, any>>(): Partial<T>;`, `declare function ${alias}<T extends Record<string, any>>(slots: T): T;`]).join("\n");
@@ -133,8 +150,6 @@ ${VueMacros ? `declare const { ${VueMacros} }: typeof import('vue');` : ""}
133
150
  ${defineSlots}
134
151
  ${defineExpose}
135
152
  ${defineStyle}
136
- // @ts-ignore
137
- type __VLS_IsAny<T> = 0 extends 1 & T ? true : false; type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
138
153
  `;
139
154
  }
140
155
 
@@ -212,18 +227,18 @@ function getRootMap(options) {
212
227
  }
213
228
  if (!hasRequired && isRequired) codes.replaceRange(modelOptions.end - 1, modelOptions.end - 1, `${!modelOptions.properties.hasTrailingComma && modelOptions.properties.length ? "," : ""} required: true`);
214
229
  } else if (isRequired) codes.replaceRange(expression.arguments.end, expression.arguments.end, `${!expression.arguments.hasTrailingComma && expression.arguments.length ? "," : ""} { required: true }`);
215
- const id = toValidAssetId(modelName, `${HELPER_PREFIX}model`);
230
+ const id = toValidAssetId(modelName, `__model`);
216
231
  const typeString = `import('vue').UnwrapRef<typeof ${id}>`;
217
232
  const defineModel = rootMap.get(root).defineModel ??= [];
218
233
  defineModel.push(`${modelName.includes("-") ? `'${modelName}'` : modelName}${isRequired ? ":" : "?:"} ${typeString}`, `'onUpdate:${modelName}'?: ($event: ${typeString}) => any`);
219
234
  if (expression.typeArguments?.[1]) defineModel.push(`${modelName}Modifiers?: Partial<Record<${getText(expression.typeArguments[1], ast, ts)}, boolean>>`);
220
- if (ts.isVariableStatement(node)) codes.replaceRange(initializer.getStart(ast), initializer.getStart(ast), `// @ts-ignore\n${id};\nlet ${id} = `);
235
+ codes.replaceRange(initializer.getStart(ast), initializer.getStart(ast), `// @ts-ignore\n${id};\nlet ${id} = `);
221
236
  } else if (options.defineSlots.alias.includes(macroName)) {
222
- codes.replaceRange(expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${HELPER_PREFIX}slots;\nconst ${HELPER_PREFIX}slots = `);
223
- rootMap.get(root).defineSlots = `Partial<typeof ${HELPER_PREFIX}slots>`;
237
+ codes.replaceRange(expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n__slots;\nconst __slots = `);
238
+ rootMap.get(root).defineSlots = `Partial<typeof __slots>`;
224
239
  } else if (options.defineExpose.alias.includes(macroName)) {
225
- codes.replaceRange(expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n${HELPER_PREFIX}exposed;\nconst ${HELPER_PREFIX}exposed = `);
226
- rootMap.get(root).defineExpose = `typeof ${HELPER_PREFIX}exposed`;
240
+ codes.replaceRange(expression.getStart(ast), expression.getStart(ast), `// @ts-ignore\n__exposed;\nconst __exposed = `);
241
+ rootMap.get(root).defineExpose = `typeof __exposed`;
227
242
  }
228
243
  }
229
244
  }
package/dist/webpack.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./options-K4yleEdU.js";
2
- import * as webpack12 from "webpack";
2
+ import * as webpack14 from "webpack";
3
3
 
4
4
  //#region src/webpack.d.ts
5
- declare const _default: (options?: Options | undefined) => webpack12.WebpackPluginInstance;
5
+ declare const _default: (options?: Options | undefined) => webpack14.WebpackPluginInstance;
6
6
  //#endregion
7
7
  export { _default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-jsx-vapor/macros",
3
- "version": "2.5.3",
3
+ "version": "2.6.0",
4
4
  "description": "Macros for Vue JSX Vapor",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -131,18 +131,18 @@
131
131
  }
132
132
  },
133
133
  "dependencies": {
134
- "@vue-macros/common": "^3.0.0-beta.17",
134
+ "@vue-macros/common": "^3.0.0-beta.19",
135
135
  "@vue/compiler-sfc": "3.6.0-alpha.2",
136
136
  "hash-sum": "^2.0.0",
137
- "ts-macro": "^0.2.7",
137
+ "ts-macro": "^0.3.1",
138
138
  "unplugin": "^2.3.5"
139
139
  },
140
140
  "devDependencies": {
141
141
  "@babel/types": "^7.28.0",
142
- "@nuxt/kit": "^3.17.6",
143
- "@nuxt/schema": "^3.17.6",
142
+ "@nuxt/kit": "^3.18.0",
143
+ "@nuxt/schema": "^3.18.0",
144
144
  "@types/hash-sum": "^1.0.2",
145
- "@vue-macros/test-utils": "^3.0.0-beta.17",
145
+ "@vue-macros/test-utils": "^3.0.0-beta.19",
146
146
  "vue": "3.6.0-alpha.2"
147
147
  },
148
148
  "scripts": {