@vue.ts/tsx-auto-props 0.5.0 → 1.0.0-beta.1
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/LICENSE +21 -21
- package/README.md +34 -15
- package/dist/astro.d.ts +8 -8
- package/dist/astro.js +14 -0
- package/dist/esbuild.d.ts +6 -6
- package/dist/esbuild.js +8 -0
- package/dist/farm.d.ts +7 -0
- package/dist/farm.js +8 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.js +3 -0
- package/dist/nuxt.d.ts +6 -6
- package/dist/nuxt.js +20 -0
- package/dist/rolldown.d.ts +7 -0
- package/dist/rolldown.js +8 -0
- package/dist/rollup.d.ts +6 -6
- package/dist/rollup.js +8 -0
- package/dist/rspack.d.ts +4 -4
- package/dist/rspack.js +8 -0
- package/dist/src-CWmlC_RH.js +96 -0
- package/dist/types-BsMRL-YJ.d.ts +15 -0
- package/dist/types.d.ts +2 -8
- package/dist/types.js +0 -0
- package/dist/vite-CO8uPslf.js +8 -0
- package/dist/vite.d.ts +6 -6
- package/dist/vite.js +4 -0
- package/dist/webpack-Bs4ZyN2r.js +8 -0
- package/dist/webpack.d.ts +6 -6
- package/dist/webpack.js +4 -0
- package/package.json +65 -54
- package/dist/astro.cjs +0 -22
- package/dist/astro.d.cts +0 -11
- package/dist/astro.d.mts +0 -11
- package/dist/astro.mjs +0 -20
- package/dist/esbuild.cjs +0 -13
- package/dist/esbuild.d.cts +0 -7
- package/dist/esbuild.d.mts +0 -7
- package/dist/esbuild.mjs +0 -11
- package/dist/index.cjs +0 -119
- package/dist/index.d.cts +0 -7
- package/dist/index.d.mts +0 -7
- package/dist/index.mjs +0 -112
- package/dist/nuxt.cjs +0 -35
- package/dist/nuxt.d.cts +0 -7
- package/dist/nuxt.d.mts +0 -7
- package/dist/nuxt.mjs +0 -33
- package/dist/rollup.cjs +0 -13
- package/dist/rollup.d.cts +0 -7
- package/dist/rollup.d.mts +0 -7
- package/dist/rollup.mjs +0 -11
- package/dist/rspack.cjs +0 -13
- package/dist/rspack.d.cts +0 -6
- package/dist/rspack.d.mts +0 -6
- package/dist/rspack.mjs +0 -11
- package/dist/types.cjs +0 -2
- package/dist/types.d.cts +0 -8
- package/dist/types.d.mts +0 -8
- package/dist/types.mjs +0 -1
- package/dist/vite.cjs +0 -13
- package/dist/vite.d.cts +0 -7
- package/dist/vite.d.mts +0 -7
- package/dist/vite.mjs +0 -11
- package/dist/webpack.cjs +0 -13
- package/dist/webpack.d.cts +0 -7
- package/dist/webpack.d.mts +0 -7
- package/dist/webpack.mjs +0 -11
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Ray <https://github.com/so1ve>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Ray <https://github.com/so1ve>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vue.ts/tsx-auto-props
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@vue.ts/tsx-auto-props)
|
|
4
4
|
|
|
5
5
|
## Why?
|
|
6
6
|
|
|
@@ -37,9 +37,9 @@ Object.defineProperty(Foo, "props", {
|
|
|
37
37
|
## 📦 Installation
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
$ npm install -D
|
|
41
|
-
$ yarn add -D
|
|
42
|
-
$ pnpm add -D
|
|
40
|
+
$ npm install -D @vue.ts/tsx-auto-props
|
|
41
|
+
$ yarn add -D @vue.ts/tsx-auto-props
|
|
42
|
+
$ pnpm add -D @vue.ts/tsx-auto-props
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
## 🚀 Usage
|
|
@@ -49,7 +49,7 @@ $ pnpm add -D unplugin-vue-tsx-auto-props
|
|
|
49
49
|
|
|
50
50
|
```ts
|
|
51
51
|
// vite.config.ts
|
|
52
|
-
import VueTsxAutoProps from "
|
|
52
|
+
import VueTsxAutoProps from "@vue.ts/tsx-auto-props/vite";
|
|
53
53
|
|
|
54
54
|
export default defineConfig({
|
|
55
55
|
plugins: [
|
|
@@ -62,12 +62,31 @@ export default defineConfig({
|
|
|
62
62
|
|
|
63
63
|
<br></details>
|
|
64
64
|
|
|
65
|
+
<details>
|
|
66
|
+
<summary>Rolldown</summary><br>
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
// rolldown.config.js
|
|
70
|
+
import VueTsxAutoProps from "@vue.ts/tsx-auto-props/rolldown";
|
|
71
|
+
|
|
72
|
+
export default {
|
|
73
|
+
plugins: [
|
|
74
|
+
VueTsxAutoProps({
|
|
75
|
+
/* options */
|
|
76
|
+
}),
|
|
77
|
+
// other plugins
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
<br></details>
|
|
83
|
+
|
|
65
84
|
<details>
|
|
66
85
|
<summary>Rollup</summary><br>
|
|
67
86
|
|
|
68
87
|
```ts
|
|
69
88
|
// rollup.config.js
|
|
70
|
-
import VueTsxAutoProps from "
|
|
89
|
+
import VueTsxAutoProps from "@vue.ts/tsx-auto-props/rollup";
|
|
71
90
|
|
|
72
91
|
export default {
|
|
73
92
|
plugins: [
|
|
@@ -89,7 +108,7 @@ export default {
|
|
|
89
108
|
module.exports = {
|
|
90
109
|
/* ... */
|
|
91
110
|
plugins: [
|
|
92
|
-
require("
|
|
111
|
+
require("@vue.ts/tsx-auto-props/webpack")({
|
|
93
112
|
/* options */
|
|
94
113
|
}),
|
|
95
114
|
],
|
|
@@ -104,7 +123,7 @@ module.exports = {
|
|
|
104
123
|
```ts
|
|
105
124
|
// nuxt.config.ts
|
|
106
125
|
export default defineNuxtConfig({
|
|
107
|
-
modules: ["
|
|
126
|
+
modules: ["@vue.ts/tsx-auto-props/nuxt"],
|
|
108
127
|
});
|
|
109
128
|
```
|
|
110
129
|
|
|
@@ -118,7 +137,7 @@ export default defineNuxtConfig({
|
|
|
118
137
|
module.exports = {
|
|
119
138
|
configureWebpack: {
|
|
120
139
|
plugins: [
|
|
121
|
-
require("
|
|
140
|
+
require("@vue.ts/tsx-auto-props/webpack")({
|
|
122
141
|
/* options */
|
|
123
142
|
}),
|
|
124
143
|
],
|
|
@@ -136,7 +155,7 @@ module.exports = {
|
|
|
136
155
|
module.exports = {
|
|
137
156
|
vitePlugins: [
|
|
138
157
|
[
|
|
139
|
-
"
|
|
158
|
+
"@vue.ts/tsx-auto-props/vite",
|
|
140
159
|
{
|
|
141
160
|
/* options */
|
|
142
161
|
},
|
|
@@ -147,12 +166,12 @@ module.exports = {
|
|
|
147
166
|
|
|
148
167
|
```ts
|
|
149
168
|
// quasar.conf.js [Webpack]
|
|
150
|
-
const VueTsxAutoPropsPlugin = require("
|
|
169
|
+
const VueTsxAutoPropsPlugin = require("@vue.ts/tsx-auto-props/webpack");
|
|
151
170
|
|
|
152
171
|
module.exports = {
|
|
153
172
|
build: {
|
|
154
173
|
chainWebpack(chain) {
|
|
155
|
-
chain.plugin("
|
|
174
|
+
chain.plugin("@vue.ts/tsx-auto-props").use(
|
|
156
175
|
VueTsxAutoPropsPlugin({
|
|
157
176
|
/* options */
|
|
158
177
|
}),
|
|
@@ -174,7 +193,7 @@ import { build } from "esbuild";
|
|
|
174
193
|
build({
|
|
175
194
|
/* ... */
|
|
176
195
|
plugins: [
|
|
177
|
-
require("
|
|
196
|
+
require("@vue.ts/tsx-auto-props/esbuild")({
|
|
178
197
|
/* options */
|
|
179
198
|
}),
|
|
180
199
|
],
|
|
@@ -188,7 +207,7 @@ build({
|
|
|
188
207
|
|
|
189
208
|
```ts
|
|
190
209
|
// astro.config.mjs
|
|
191
|
-
import VueTsxAutoProps from "
|
|
210
|
+
import VueTsxAutoProps from "@vue.ts/tsx-auto-props/astro";
|
|
192
211
|
|
|
193
212
|
export default defineConfig({
|
|
194
213
|
integrations: [
|
package/dist/astro.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Options } from
|
|
2
|
-
import '@vue.ts/common';
|
|
1
|
+
import { Options } from "./types-BsMRL-YJ.js";
|
|
3
2
|
|
|
3
|
+
//#region src/astro.d.ts
|
|
4
4
|
declare const _default: (options: Options) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
name: string;
|
|
6
|
+
hooks: {
|
|
7
|
+
"astro:config:setup": (astro: any) => Promise<void>;
|
|
8
|
+
};
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
export { _default as default };
|
|
10
|
+
//#endregion
|
|
11
|
+
export { _default as default };
|
package/dist/astro.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./src-CWmlC_RH.js";
|
|
2
|
+
import { vite_default } from "./vite-CO8uPslf.js";
|
|
3
|
+
|
|
4
|
+
//#region src/astro.ts
|
|
5
|
+
var astro_default = (options) => ({
|
|
6
|
+
name: "@vue.ts/tsx-auto-props",
|
|
7
|
+
hooks: { "astro:config:setup": async (astro) => {
|
|
8
|
+
astro.config.vite.plugins ??= [];
|
|
9
|
+
astro.config.vite.plugins.push(vite_default(options));
|
|
10
|
+
} }
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { astro_default as default };
|
package/dist/esbuild.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import '@vue.ts/common';
|
|
1
|
+
import { Options } from "./types-BsMRL-YJ.js";
|
|
2
|
+
import * as esbuild0 from "esbuild";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
//#region src/esbuild.d.ts
|
|
5
|
+
declare const _default: (options?: Options | undefined) => esbuild0.Plugin;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
package/dist/esbuild.js
ADDED
package/dist/farm.d.ts
ADDED
package/dist/farm.js
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { Options } from "./types-BsMRL-YJ.js";
|
|
2
|
+
import * as unplugin0 from "unplugin";
|
|
3
|
+
import { UnpluginFactory } from "unplugin";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
//#region src/index.d.ts
|
|
6
|
+
declare const unpluginFactory: UnpluginFactory<Options | undefined>;
|
|
7
|
+
declare const unplugin: unplugin0.UnpluginInstance<Options | undefined, boolean>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { unplugin as default, unplugin, unpluginFactory };
|
package/dist/index.js
ADDED
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import '@vue.ts/common';
|
|
1
|
+
import { Options } from "./types-BsMRL-YJ.js";
|
|
2
|
+
import * as _nuxt_schema0 from "@nuxt/schema";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
//#region src/nuxt.d.ts
|
|
5
|
+
declare const _default: _nuxt_schema0.NuxtModule<Options, Options, false>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
package/dist/nuxt.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./src-CWmlC_RH.js";
|
|
2
|
+
import { vite_default } from "./vite-CO8uPslf.js";
|
|
3
|
+
import { webpack_default } from "./webpack-Bs4ZyN2r.js";
|
|
4
|
+
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
|
5
|
+
|
|
6
|
+
//#region src/nuxt.ts
|
|
7
|
+
var nuxt_default = defineNuxtModule({
|
|
8
|
+
meta: {
|
|
9
|
+
name: "@vue.ts/tsx-auto-props",
|
|
10
|
+
configKey: "tsxAutoProps"
|
|
11
|
+
},
|
|
12
|
+
defaults: {},
|
|
13
|
+
setup(options, _nuxt) {
|
|
14
|
+
addVitePlugin(() => vite_default(options));
|
|
15
|
+
addWebpackPlugin(() => webpack_default(options));
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { nuxt_default as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Options } from "./types-BsMRL-YJ.js";
|
|
2
|
+
import * as rolldown0 from "rolldown";
|
|
3
|
+
|
|
4
|
+
//#region src/rolldown.d.ts
|
|
5
|
+
declare const _default: (options?: Options | undefined) => rolldown0.Plugin<any> | rolldown0.Plugin<any>[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
package/dist/rolldown.js
ADDED
package/dist/rollup.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import '@vue.ts/common';
|
|
1
|
+
import { Options } from "./types-BsMRL-YJ.js";
|
|
2
|
+
import * as rollup0 from "rollup";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
//#region src/rollup.d.ts
|
|
5
|
+
declare const _default: (options?: Options | undefined) => rollup0.Plugin<any> | rollup0.Plugin<any>[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
package/dist/rollup.js
ADDED
package/dist/rspack.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Options } from
|
|
2
|
-
import '@vue.ts/common';
|
|
1
|
+
import { Options } from "./types-BsMRL-YJ.js";
|
|
3
2
|
|
|
3
|
+
//#region src/rspack.d.ts
|
|
4
4
|
declare const _default: (options?: Options | undefined) => RspackPluginInstance;
|
|
5
|
-
|
|
6
|
-
export { _default as default };
|
|
5
|
+
//#endregion
|
|
6
|
+
export { _default as default };
|
package/dist/rspack.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { createUnplugin } from "unplugin";
|
|
2
|
+
import { createFilter, normalizePath } from "@vue.ts/common";
|
|
3
|
+
import { ensureLanguage, getLanguage } from "@vue.ts/language";
|
|
4
|
+
import MagicString from "magic-string";
|
|
5
|
+
import ts from "typescript";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
|
|
8
|
+
//#region src/core/utils.ts
|
|
9
|
+
const resolveOptions = (rawOptions) => ({
|
|
10
|
+
include: rawOptions.include ?? ["**/*.vue", "**/*.tsx"],
|
|
11
|
+
exclude: rawOptions.exclude ?? ["node_modules/**"],
|
|
12
|
+
tsconfigPath: rawOptions.tsconfigPath ?? join(process.cwd(), "tsconfig.json")
|
|
13
|
+
});
|
|
14
|
+
function getNodeAssignNode(node) {
|
|
15
|
+
let parent = null;
|
|
16
|
+
let variableList = null;
|
|
17
|
+
let variable = null;
|
|
18
|
+
while (node) {
|
|
19
|
+
if (parent) {
|
|
20
|
+
if (ts.isVariableDeclarationList(parent)) variableList = parent;
|
|
21
|
+
if (ts.isVariableDeclaration(parent)) variable = parent;
|
|
22
|
+
}
|
|
23
|
+
parent = node;
|
|
24
|
+
node = node.parent;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
variableList,
|
|
28
|
+
variable
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/core/transform.ts
|
|
34
|
+
const generateDefineProps = (name, props) => `\n;Object.defineProperty(${name}, "props", {
|
|
35
|
+
value: ${JSON.stringify(props)},
|
|
36
|
+
});`;
|
|
37
|
+
const DEFINE_COMPONENT = "defineComponent";
|
|
38
|
+
function transform(code, id) {
|
|
39
|
+
const s = new MagicString(code);
|
|
40
|
+
const normalizedFilepath = normalizePath(id);
|
|
41
|
+
const language = getLanguage();
|
|
42
|
+
const typeChecker = language.__internal__.typeChecker;
|
|
43
|
+
const ast = language.getVirtualFileOrTsAst(normalizedFilepath);
|
|
44
|
+
if (!ast) return;
|
|
45
|
+
language.traverseAst(ast, (node) => {
|
|
46
|
+
if (!ts.isCallExpression(node)) return;
|
|
47
|
+
const identifier = node.expression;
|
|
48
|
+
const symbol = typeChecker.getSymbolAtLocation(identifier);
|
|
49
|
+
if (symbol?.declarations?.some((d) => ts.isImportSpecifier(d) && (d.propertyName ?? d.name)?.text === DEFINE_COMPONENT)) {
|
|
50
|
+
const arg = node.arguments[0];
|
|
51
|
+
let setupFn;
|
|
52
|
+
if (ts.isObjectLiteralExpression(arg)) {
|
|
53
|
+
const props$1 = arg.properties.find((p) => ts.isPropertyAssignment(p) && ts.isIdentifier(p.name) && p.name.escapedText === "props");
|
|
54
|
+
const setup = arg.properties.find((p) => ts.isPropertyAssignment(p) && ts.isIdentifier(p.name) && p.name.escapedText === "setup");
|
|
55
|
+
if (!props$1 && setup && ts.isPropertyAssignment(setup)) {
|
|
56
|
+
const value = setup.initializer;
|
|
57
|
+
if (ts.isFunctionLike(value)) setupFn = value;
|
|
58
|
+
}
|
|
59
|
+
} else if (ts.isFunctionLike(arg)) setupFn = arg;
|
|
60
|
+
else throw new Error("[@vue.ts/tsx-auto-props] Invalid defineComponent argument");
|
|
61
|
+
const props = setupFn?.parameters[0];
|
|
62
|
+
if (props) {
|
|
63
|
+
const propsList = typeChecker.getTypeAtLocation(props).getProperties().map((p) => p.name);
|
|
64
|
+
const { variableList, variable } = getNodeAssignNode(node);
|
|
65
|
+
if (propsList.length > 0 && variableList && variable) s.appendRight(variableList.getEnd() + 1, generateDefineProps(variable.name.getText(ast), propsList));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return {
|
|
70
|
+
code: s.toString(),
|
|
71
|
+
map: s.generateMap({ hires: true })
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/index.ts
|
|
77
|
+
const unpluginFactory = (options = {}) => {
|
|
78
|
+
const resolvedOptions = resolveOptions(options);
|
|
79
|
+
const filter = createFilter(resolvedOptions.include, resolvedOptions.exclude);
|
|
80
|
+
return {
|
|
81
|
+
name: "@vue.ts/tsx-auto-props",
|
|
82
|
+
buildStart() {
|
|
83
|
+
const resolvedOptions$1 = resolveOptions(options);
|
|
84
|
+
ensureLanguage(resolvedOptions$1.tsconfigPath);
|
|
85
|
+
},
|
|
86
|
+
transform(code, id) {
|
|
87
|
+
if (!filter(id)) return;
|
|
88
|
+
return transform(code, id);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
const unplugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
|
|
93
|
+
var src_default = unplugin;
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
export { src_default, unplugin, unpluginFactory };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FilterPattern } from "@rollup/pluginutils";
|
|
2
|
+
|
|
3
|
+
//#region ../common/src/types.d.ts
|
|
4
|
+
interface BaseOptions {
|
|
5
|
+
include?: FilterPattern;
|
|
6
|
+
exclude?: FilterPattern;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/types.d.ts
|
|
10
|
+
interface Options extends BaseOptions {
|
|
11
|
+
tsconfigPath?: string;
|
|
12
|
+
}
|
|
13
|
+
type ResolvedOptions = Required<Options>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Options, ResolvedOptions };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
interface Options extends BaseOptions {
|
|
4
|
-
tsconfigPath?: string;
|
|
5
|
-
}
|
|
6
|
-
type ResolvedOptions = Required<Options>;
|
|
7
|
-
|
|
8
|
-
export type { Options, ResolvedOptions };
|
|
1
|
+
import { Options, ResolvedOptions } from "./types-BsMRL-YJ.js";
|
|
2
|
+
export { Options, ResolvedOptions };
|
package/dist/types.js
ADDED
|
File without changes
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import '@vue.ts/common';
|
|
1
|
+
import { Options } from "./types-BsMRL-YJ.js";
|
|
2
|
+
import * as vite0 from "vite";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
//#region src/vite.d.ts
|
|
5
|
+
declare const _default: (options?: Options | undefined) => vite0.Plugin<any> | vite0.Plugin<any>[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
package/dist/vite.js
ADDED
package/dist/webpack.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import '@vue.ts/common';
|
|
1
|
+
import { Options } from "./types-BsMRL-YJ.js";
|
|
2
|
+
import * as webpack0 from "webpack";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
//#region src/webpack.d.ts
|
|
5
|
+
declare const _default: (options?: Options | undefined) => webpack0.WebpackPluginInstance;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
package/dist/webpack.js
ADDED