@vue.ts/complex-types 0.5.0 → 0.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # unplugin-vue-complex-types
1
+ # @vue.ts/complex-types
2
2
 
3
- [![NPM version](https://img.shields.io/npm/v/unplugin-vue-complex-types?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-vue-complex-types)
3
+ [![NPM version](https://img.shields.io/npm/v/@vue.ts/complex-types?color=a1b858&label=)](https://www.npmjs.com/package/@vue.ts/complex-types)
4
4
 
5
5
  Use [`@vue/language-core`](https://github.com/vuejs/language-tools/tree/master/packages/language-core) to support complex types for Vue Macros.
6
6
 
@@ -9,9 +9,9 @@ For example: fixes https://github.com/vuejs/core/issues/8286.
9
9
  ## 📦 Installation
10
10
 
11
11
  ```bash
12
- $ npm install -D unplugin-vue-complex-types
13
- $ yarn add -D unplugin-vue-complex-types
14
- $ pnpm add -D unplugin-vue-complex-types
12
+ $ npm install -D @vue.ts/complex-types
13
+ $ yarn add -D @vue.ts/complex-types
14
+ $ pnpm add -D @vue.ts/complex-types
15
15
  ```
16
16
 
17
17
  ## TODOs
@@ -25,7 +25,7 @@ $ pnpm add -D unplugin-vue-complex-types
25
25
 
26
26
  ```ts
27
27
  // vite.config.ts
28
- import VueComplexTypes from "unplugin-vue-complex-types/vite";
28
+ import VueComplexTypes from "@vue.ts/complex-types/vite";
29
29
 
30
30
  export default defineConfig({
31
31
  plugins: [
@@ -43,7 +43,7 @@ export default defineConfig({
43
43
 
44
44
  ```ts
45
45
  // rollup.config.js
46
- import VueComplexTypes from "unplugin-vue-complex-types/rollup";
46
+ import VueComplexTypes from "@vue.ts/complex-types/rollup";
47
47
 
48
48
  export default {
49
49
  plugins: [
@@ -65,7 +65,7 @@ export default {
65
65
  module.exports = {
66
66
  /* ... */
67
67
  plugins: [
68
- require("unplugin-vue-complex-types/webpack")({
68
+ require("@vue.ts/complex-types/webpack")({
69
69
  /* options */
70
70
  }),
71
71
  ],
@@ -82,7 +82,7 @@ module.exports = {
82
82
  module.exports = {
83
83
  /* ... */
84
84
  plugins: [
85
- require("unplugin-vue-complex-types/rspack")({
85
+ require("@vue.ts/complex-types/rspack")({
86
86
  /* options */
87
87
  }),
88
88
  ],
@@ -97,7 +97,7 @@ module.exports = {
97
97
  ```ts
98
98
  // nuxt.config.ts
99
99
  export default defineNuxtConfig({
100
- modules: ["unplugin-vue-complex-types/nuxt"],
100
+ modules: ["@vue.ts/complex-types/nuxt"],
101
101
  complexTypes: {
102
102
  /* options */
103
103
  },
@@ -114,7 +114,7 @@ export default defineNuxtConfig({
114
114
  module.exports = {
115
115
  configureWebpack: {
116
116
  plugins: [
117
- require("unplugin-vue-complex-types/webpack")({
117
+ require("@vue.ts/complex-types/webpack")({
118
118
  /* options */
119
119
  }),
120
120
  ],
@@ -132,7 +132,7 @@ module.exports = {
132
132
  module.exports = {
133
133
  vitePlugins: [
134
134
  [
135
- "unplugin-vue-complex-types/vite",
135
+ "@vue.ts/complex-types/vite",
136
136
  {
137
137
  /* options */
138
138
  },
@@ -143,12 +143,12 @@ module.exports = {
143
143
 
144
144
  ```ts
145
145
  // quasar.conf.js [Webpack]
146
- const VueComplexTypesPlugin = require("unplugin-vue-complex-types/webpack");
146
+ const VueComplexTypesPlugin = require("@vue.ts/complex-types/webpack");
147
147
 
148
148
  module.exports = {
149
149
  build: {
150
150
  chainWebpack(chain) {
151
- chain.plugin("unplugin-vue-complex-types").use(
151
+ chain.plugin("@vue.ts/complex-types").use(
152
152
  VueComplexTypesPlugin({
153
153
  /* options */
154
154
  }),
@@ -170,7 +170,7 @@ import { build } from "esbuild";
170
170
  build({
171
171
  /* ... */
172
172
  plugins: [
173
- require("unplugin-vue-complex-types/esbuild")({
173
+ require("@vue.ts/complex-types/esbuild")({
174
174
  /* options */
175
175
  }),
176
176
  ],
@@ -184,7 +184,7 @@ build({
184
184
 
185
185
  ```ts
186
186
  // astro.config.mjs
187
- import VueComplexTypes from "unplugin-vue-complex-types/astro";
187
+ import VueComplexTypes from "@vue.ts/complex-types/astro";
188
188
 
189
189
  export default defineConfig({
190
190
  integrations: [
package/dist/astro.cjs CHANGED
@@ -9,7 +9,7 @@ require('typescript');
9
9
  require('node:path');
10
10
 
11
11
  const astro = (options) => ({
12
- name: "unplugin-vue-complex-types",
12
+ name: "@vue.ts/complex-types",
13
13
  hooks: {
14
14
  "astro:config:setup": async (astro) => {
15
15
  var _a;
package/dist/astro.mjs CHANGED
@@ -7,7 +7,7 @@ import 'typescript';
7
7
  import 'node:path';
8
8
 
9
9
  const astro = (options) => ({
10
- name: "unplugin-vue-complex-types",
10
+ name: "@vue.ts/complex-types",
11
11
  hooks: {
12
12
  "astro:config:setup": async (astro) => {
13
13
  var _a;
package/dist/index.cjs CHANGED
@@ -42,7 +42,11 @@ class Printer {
42
42
  const parts = ["{"];
43
43
  for (const member of node.members) {
44
44
  if (ts__default.isPropertySignature(member)) {
45
- const stringBaseType = member.type ? this.checker.typeToString(this.getBaseType(member.type)) : "any";
45
+ const stringBaseType = member.type ? this.checker.typeToString(
46
+ this.getBaseType(member.type),
47
+ void 0,
48
+ ts__default.TypeFormatFlags.NoTruncation
49
+ ) : "any";
46
50
  parts.push(
47
51
  [
48
52
  member.name.getText(),
@@ -67,7 +71,9 @@ class Printer {
67
71
  for (const property of properties) {
68
72
  const valueType = this.checker.getTypeOfSymbol(property);
69
73
  const stringValueType = this.checker.typeToString(
70
- this.getBaseType(valueType)
74
+ this.getBaseType(valueType),
75
+ void 0,
76
+ ts__default.TypeFormatFlags.NoTruncation
71
77
  );
72
78
  parts.push(
73
79
  `${this.checker.symbolToString(
@@ -89,7 +95,7 @@ class Printer {
89
95
  return this.printByType(node);
90
96
  } else {
91
97
  console.error(
92
- `[unplugin-vue-complex-types] \`${ts__default.SyntaxKind[node.kind]}\` is not supported.`
98
+ `[@vue.ts/complex-types] \`${ts__default.SyntaxKind[node.kind]}\` is not supported.`
93
99
  );
94
100
  return node.getText();
95
101
  }
@@ -98,7 +104,11 @@ class Printer {
98
104
  return callSignatures.map((c) => {
99
105
  const parameters = c.getParameters();
100
106
  const event = parameters[0];
101
- return this.checker.typeToString(this.checker.getTypeOfSymbol(event));
107
+ return this.checker.typeToString(
108
+ this.checker.getTypeOfSymbol(event),
109
+ void 0,
110
+ ts__default.TypeFormatFlags.NoTruncation
111
+ );
102
112
  });
103
113
  }
104
114
  printEventsByMembers(members) {
@@ -111,7 +121,7 @@ class Printer {
111
121
  const members = type.getProperties();
112
122
  if (callSignatures.length > 0 && members.length > 0) {
113
123
  throw new Error(
114
- "[unplugin-vue-complex-types] You may not use old style `defineEmits` and `defineEmits` shorthand together."
124
+ "[@vue.ts/complex-types] You may not use old style `defineEmits` and `defineEmits` shorthand together."
115
125
  );
116
126
  }
117
127
  if (members.length > 0) {
@@ -145,7 +155,7 @@ const transformDefineEmits = (printer, s, id) => {
145
155
  }
146
156
  if (defineEmitsRuntimeArg) {
147
157
  throw new Error(
148
- "[unplugin-vue-complex-types] `defineEmits` cannot accept both runtime argument and type argument."
158
+ "[@vue.ts/complex-types] `defineEmits` cannot accept both runtime argument and type argument."
149
159
  );
150
160
  }
151
161
  const tokens = defineEmitsNode.getChildren(scriptSetupAst);
package/dist/index.mjs CHANGED
@@ -35,7 +35,11 @@ class Printer {
35
35
  const parts = ["{"];
36
36
  for (const member of node.members) {
37
37
  if (ts.isPropertySignature(member)) {
38
- const stringBaseType = member.type ? this.checker.typeToString(this.getBaseType(member.type)) : "any";
38
+ const stringBaseType = member.type ? this.checker.typeToString(
39
+ this.getBaseType(member.type),
40
+ void 0,
41
+ ts.TypeFormatFlags.NoTruncation
42
+ ) : "any";
39
43
  parts.push(
40
44
  [
41
45
  member.name.getText(),
@@ -60,7 +64,9 @@ class Printer {
60
64
  for (const property of properties) {
61
65
  const valueType = this.checker.getTypeOfSymbol(property);
62
66
  const stringValueType = this.checker.typeToString(
63
- this.getBaseType(valueType)
67
+ this.getBaseType(valueType),
68
+ void 0,
69
+ ts.TypeFormatFlags.NoTruncation
64
70
  );
65
71
  parts.push(
66
72
  `${this.checker.symbolToString(
@@ -82,7 +88,7 @@ class Printer {
82
88
  return this.printByType(node);
83
89
  } else {
84
90
  console.error(
85
- `[unplugin-vue-complex-types] \`${ts.SyntaxKind[node.kind]}\` is not supported.`
91
+ `[@vue.ts/complex-types] \`${ts.SyntaxKind[node.kind]}\` is not supported.`
86
92
  );
87
93
  return node.getText();
88
94
  }
@@ -91,7 +97,11 @@ class Printer {
91
97
  return callSignatures.map((c) => {
92
98
  const parameters = c.getParameters();
93
99
  const event = parameters[0];
94
- return this.checker.typeToString(this.checker.getTypeOfSymbol(event));
100
+ return this.checker.typeToString(
101
+ this.checker.getTypeOfSymbol(event),
102
+ void 0,
103
+ ts.TypeFormatFlags.NoTruncation
104
+ );
95
105
  });
96
106
  }
97
107
  printEventsByMembers(members) {
@@ -104,7 +114,7 @@ class Printer {
104
114
  const members = type.getProperties();
105
115
  if (callSignatures.length > 0 && members.length > 0) {
106
116
  throw new Error(
107
- "[unplugin-vue-complex-types] You may not use old style `defineEmits` and `defineEmits` shorthand together."
117
+ "[@vue.ts/complex-types] You may not use old style `defineEmits` and `defineEmits` shorthand together."
108
118
  );
109
119
  }
110
120
  if (members.length > 0) {
@@ -138,7 +148,7 @@ const transformDefineEmits = (printer, s, id) => {
138
148
  }
139
149
  if (defineEmitsRuntimeArg) {
140
150
  throw new Error(
141
- "[unplugin-vue-complex-types] `defineEmits` cannot accept both runtime argument and type argument."
151
+ "[@vue.ts/complex-types] `defineEmits` cannot accept both runtime argument and type argument."
142
152
  );
143
153
  }
144
154
  const tokens = defineEmitsNode.getChildren(scriptSetupAst);
package/dist/nuxt.cjs CHANGED
@@ -12,7 +12,7 @@ require('typescript');
12
12
  require('node:path');
13
13
 
14
14
  const name = "@vue.ts/complex-types";
15
- const version = "0.5.0";
15
+ const version = "0.6.0";
16
16
 
17
17
  const nuxt = kit.defineNuxtModule({
18
18
  meta: {
package/dist/nuxt.mjs CHANGED
@@ -10,7 +10,7 @@ import 'typescript';
10
10
  import 'node:path';
11
11
 
12
12
  const name = "@vue.ts/complex-types";
13
- const version = "0.5.0";
13
+ const version = "0.6.0";
14
14
 
15
15
  const nuxt = defineNuxtModule({
16
16
  meta: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue.ts/complex-types",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "author": "Ray <i@mk1.io> (@so1ve)",
5
5
  "description": "Resolve complex types in Vue SFCs.",
6
6
  "keywords": [
@@ -85,8 +85,8 @@
85
85
  "@nuxt/kit": "^3.8.1",
86
86
  "magic-string": "^0.30.5",
87
87
  "unplugin": "^1.5.0",
88
- "@vue.ts/common": "0.5.0",
89
- "@vue.ts/language": "0.5.0"
88
+ "@vue.ts/common": "0.6.0",
89
+ "@vue.ts/language": "0.6.0"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@nuxt/schema": "^3.8.1",