@vue-jsx-vapor/macros 2.6.2 → 2.6.4

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,7 +1,7 @@
1
1
  import { Options } from "./options-Egmm6BVJ.cjs";
2
- import * as esbuild1 from "esbuild";
2
+ import * as esbuild6 from "esbuild";
3
3
 
4
4
  //#region src/esbuild.d.ts
5
- declare const _default: (options?: Options | undefined) => esbuild1.Plugin;
5
+ declare const _default: (options?: Options | undefined) => esbuild6.Plugin;
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/nuxt.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Options } from "./options-Egmm6BVJ.cjs";
2
- import * as _nuxt_schema8 from "@nuxt/schema";
2
+ import * as _nuxt_schema3 from "@nuxt/schema";
3
3
 
4
4
  //#region src/nuxt.d.ts
5
5
  interface ModuleOptions extends Options {}
6
- declare const _default: _nuxt_schema8.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
+ declare const _default: _nuxt_schema3.NuxtModule<ModuleOptions, ModuleOptions, false>;
7
7
  //#endregion
8
8
  export { ModuleOptions, _default as default };
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./options-Egmm6BVJ.cjs";
2
- import * as unplugin13 from "unplugin";
2
+ import * as unplugin11 from "unplugin";
3
3
 
4
4
  //#region src/rolldown.d.ts
5
- declare const _default: (options?: Options | undefined) => unplugin13.RolldownPlugin<any> | unplugin13.RolldownPlugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => unplugin11.RolldownPlugin<any> | unplugin11.RolldownPlugin<any>[];
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/rollup.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./options-Egmm6BVJ.cjs";
2
- import * as rollup3 from "rollup";
2
+ import * as rollup1 from "rollup";
3
3
 
4
4
  //#region src/rollup.d.ts
5
- declare const _default: (options?: Options | undefined) => rollup3.Plugin<any> | rollup3.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => rollup1.Plugin<any> | rollup1.Plugin<any>[];
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/vite.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./options-Egmm6BVJ.cjs";
2
- import * as vite6 from "vite";
2
+ import * as vite8 from "vite";
3
3
 
4
4
  //#region src/vite.d.ts
5
- declare const _default: (options?: Options | undefined) => vite6.Plugin<any> | vite6.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => vite8.Plugin<any> | vite8.Plugin<any>[];
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/volar.cjs CHANGED
@@ -14,31 +14,23 @@ function transformDefineComponent(node, parent, options) {
14
14
  const __setup = `);
15
15
  const result = (ts.isArrowFunction(comp) || ts.isFunctionExpression(comp)) && comp.typeParameters?.length ? ["\nreturn __setup"] : [
16
16
  `
17
- type __Props = Parameters<typeof __setup>[0]
18
- type __Slots = Parameters<typeof __setup>[1] extends { slots?: infer Slots } | undefined ? Slots : {}
19
- type __Exposed = Parameters<typeof __setup>[1] extends { expose?: (exposed: infer Exposed) => any } | undefined ? Exposed : {}`,
17
+ type __Setup = typeof __setup
18
+ type __Props = Parameters<__Setup>[0]
19
+ type __Slots = Parameters<__Setup>[1] extends { slots?: infer Slots } | undefined ? Slots : {}
20
+ type __Exposed = Parameters<__Setup>[1] extends { expose?: (exposed: infer Exposed) => any } | undefined ? Exposed : {}`,
20
21
  "\n const __component = ",
22
+ isVapor ? `// @ts-ignore\n(defineVaporComponent,await import('vue-jsx-vapor')).` : "",
21
23
  [node.expression.getText(ast), node.expression.getStart(ast)],
22
- `({`,
23
- isVapor ? "" : `...{} as {
24
- setup: () => __Exposed,
25
- slots: import('vue').SlotsType<__Slots>
24
+ `({\n`,
25
+ `...{} as {
26
+ setup: (props: __Props) => __Exposed,
27
+ render: () => ReturnType<__Setup>
28
+ slots: ${isVapor ? "__Slots" : `import('vue').SlotsType<__Slots>`}
26
29
  },`,
27
30
  ...compOptions ? ["...", [compOptions.getText(ast), compOptions.getStart(ast)]] : [],
28
31
  `})
29
- type __Instance = (typeof __component extends new (...args: any) => any ? InstanceType<typeof __component> : typeof __component) & {${isVapor ? "\n/** @deprecated This is only a type when used in Vapor Instances. */" : ""}
30
- $props: __Props
31
- }
32
- return {} as {
33
- __isFragment?: never
34
- __isTeleport?: never
35
- __isSuspense?: never
36
- new (props: __Props): __Instance,
37
- setup: (props: __Props, ctx?: {
38
- attrs?: Record<string, any>
39
- slots?: __Slots,
40
- expose?: (exposed: keyof __Exposed extends never ? __Instance : __Exposed) => any
41
- }) => {},
32
+ return {} as Omit<typeof __component, 'constructor'> & {
33
+ new (props?: __Props): InstanceType<typeof __component> & {${isVapor ? "\n/** @deprecated This is only a type when used in Vapor Instances. */\n$props: __Props" : ""}},
42
34
  }`
43
35
  ];
44
36
  codes.replaceRange(node.end, node.end, ...result, `\n})()`);
@@ -136,16 +128,16 @@ function transformJsxMacros(rootMap, options) {
136
128
  }
137
129
  codes.replaceRange(node.getStart(ast), node.expression.getStart(ast), "const ", [
138
130
  `__render`,
139
- node.getStart(ast),
131
+ node.getStart(ast) - 1,
140
132
  { verification: true }
141
- ], macros.defineComponent ? macros.defineComponent?.expression.getText(ast) === "defineVaporComponent" ? ": import(\"vue-jsx-vapor\").NodeChild" : ": () => import(\"vue\").VNodeChild" : "", ` = `);
133
+ ], macros.defineComponent ? macros.defineComponent?.expression.getText(ast) === "defineVaporComponent" ? "" : ": () => JSX.Element" : "", " = ");
142
134
  codes.replaceRange(node.expression.end, node.expression.end, `
143
135
  return {} as {
144
136
  props: {${props.join(", ")}},
145
- context: {
146
- slots?: ${macros.defineSlots ?? "{}"},
147
- expose?: (exposed: import('vue').ShallowUnwrapRef<${macros.defineExpose ?? "{}"}>) => void,
148
- attrs?: Record<string, any>
137
+ context: ${root.parameters[1]?.type ? root.parameters[1].type.getText(ast) : "{}"} & {
138
+ slots: ${macros.defineSlots ?? "{}"},
139
+ expose: (exposed: ${macros.defineExpose ?? "{}"}) => void,
140
+ attrs: Record<string, any>
149
141
  },
150
142
  render: typeof __render
151
143
  }`);
package/dist/volar.js CHANGED
@@ -12,31 +12,23 @@ function transformDefineComponent(node, parent, options) {
12
12
  const __setup = `);
13
13
  const result = (ts.isArrowFunction(comp) || ts.isFunctionExpression(comp)) && comp.typeParameters?.length ? ["\nreturn __setup"] : [
14
14
  `
15
- type __Props = Parameters<typeof __setup>[0]
16
- type __Slots = Parameters<typeof __setup>[1] extends { slots?: infer Slots } | undefined ? Slots : {}
17
- type __Exposed = Parameters<typeof __setup>[1] extends { expose?: (exposed: infer Exposed) => any } | undefined ? Exposed : {}`,
15
+ type __Setup = typeof __setup
16
+ type __Props = Parameters<__Setup>[0]
17
+ type __Slots = Parameters<__Setup>[1] extends { slots?: infer Slots } | undefined ? Slots : {}
18
+ type __Exposed = Parameters<__Setup>[1] extends { expose?: (exposed: infer Exposed) => any } | undefined ? Exposed : {}`,
18
19
  "\n const __component = ",
20
+ isVapor ? `// @ts-ignore\n(defineVaporComponent,await import('vue-jsx-vapor')).` : "",
19
21
  [node.expression.getText(ast), node.expression.getStart(ast)],
20
- `({`,
21
- isVapor ? "" : `...{} as {
22
- setup: () => __Exposed,
23
- slots: import('vue').SlotsType<__Slots>
22
+ `({\n`,
23
+ `...{} as {
24
+ setup: (props: __Props) => __Exposed,
25
+ render: () => ReturnType<__Setup>
26
+ slots: ${isVapor ? "__Slots" : `import('vue').SlotsType<__Slots>`}
24
27
  },`,
25
28
  ...compOptions ? ["...", [compOptions.getText(ast), compOptions.getStart(ast)]] : [],
26
29
  `})
27
- type __Instance = (typeof __component extends new (...args: any) => any ? InstanceType<typeof __component> : typeof __component) & {${isVapor ? "\n/** @deprecated This is only a type when used in Vapor Instances. */" : ""}
28
- $props: __Props
29
- }
30
- return {} as {
31
- __isFragment?: never
32
- __isTeleport?: never
33
- __isSuspense?: never
34
- new (props: __Props): __Instance,
35
- setup: (props: __Props, ctx?: {
36
- attrs?: Record<string, any>
37
- slots?: __Slots,
38
- expose?: (exposed: keyof __Exposed extends never ? __Instance : __Exposed) => any
39
- }) => {},
30
+ return {} as Omit<typeof __component, 'constructor'> & {
31
+ new (props?: __Props): InstanceType<typeof __component> & {${isVapor ? "\n/** @deprecated This is only a type when used in Vapor Instances. */\n$props: __Props" : ""}},
40
32
  }`
41
33
  ];
42
34
  codes.replaceRange(node.end, node.end, ...result, `\n})()`);
@@ -134,16 +126,16 @@ function transformJsxMacros(rootMap, options) {
134
126
  }
135
127
  codes.replaceRange(node.getStart(ast), node.expression.getStart(ast), "const ", [
136
128
  `__render`,
137
- node.getStart(ast),
129
+ node.getStart(ast) - 1,
138
130
  { verification: true }
139
- ], macros.defineComponent ? macros.defineComponent?.expression.getText(ast) === "defineVaporComponent" ? ": import(\"vue-jsx-vapor\").NodeChild" : ": () => import(\"vue\").VNodeChild" : "", ` = `);
131
+ ], macros.defineComponent ? macros.defineComponent?.expression.getText(ast) === "defineVaporComponent" ? "" : ": () => JSX.Element" : "", " = ");
140
132
  codes.replaceRange(node.expression.end, node.expression.end, `
141
133
  return {} as {
142
134
  props: {${props.join(", ")}},
143
- context: {
144
- slots?: ${macros.defineSlots ?? "{}"},
145
- expose?: (exposed: import('vue').ShallowUnwrapRef<${macros.defineExpose ?? "{}"}>) => void,
146
- attrs?: Record<string, any>
135
+ context: ${root.parameters[1]?.type ? root.parameters[1].type.getText(ast) : "{}"} & {
136
+ slots: ${macros.defineSlots ?? "{}"},
137
+ expose: (exposed: ${macros.defineExpose ?? "{}"}) => void,
138
+ attrs: Record<string, any>
147
139
  },
148
140
  render: typeof __render
149
141
  }`);
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./options-Egmm6BVJ.cjs";
2
- import * as webpack10 from "webpack";
2
+ import * as webpack14 from "webpack";
3
3
 
4
4
  //#region src/webpack.d.ts
5
- declare const _default: (options?: Options | undefined) => webpack10.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.6.2",
3
+ "version": "2.6.4",
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.20",
134
+ "@vue-macros/common": "^3.0.0-beta.23",
135
135
  "@vue/compiler-sfc": "3.6.0-alpha.2",
136
136
  "hash-sum": "^2.0.0",
137
- "ts-macro": "^0.3.2",
138
- "unplugin": "^2.3.5"
137
+ "ts-macro": "^0.3.4",
138
+ "unplugin": "^2.3.10"
139
139
  },
140
140
  "devDependencies": {
141
- "@babel/types": "^7.28.0",
142
- "@nuxt/kit": "^3.18.1",
143
- "@nuxt/schema": "^3.18.1",
141
+ "@babel/types": "^7.28.4",
142
+ "@nuxt/kit": "^3.19.1",
143
+ "@nuxt/schema": "^3.19.1",
144
144
  "@types/hash-sum": "^1.0.2",
145
- "@vue-macros/test-utils": "^3.0.0-beta.20",
145
+ "@vue-macros/test-utils": "^3.0.0-beta.23",
146
146
  "vue": "3.6.0-alpha.2"
147
147
  },
148
148
  "scripts": {