vite-userscript-plugin 1.9.2 → 1.11.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 +23 -3
- package/dist/index.d.ts +20 -4
- package/dist/index.js +294 -4
- package/dist/ws.js +14 -1
- package/package.json +30 -31
- package/types/greasemonkey.d.ts +275 -213
- package/types/tampermonkey.d.ts +593 -120
- package/types/violentmonkey.d.ts +85 -10
- package/dist/index.cjs +0 -5
- package/dist/index.d.cts +0 -171
package/README.md
CHANGED
|
@@ -6,9 +6,17 @@
|
|
|
6
6
|
|
|
7
7
|
> ⚡️ A plugin for developing and building a Tampermonkey userscript based on [Vite](https://vitejs.dev).
|
|
8
8
|
|
|
9
|
+
## Table of contents
|
|
10
|
+
|
|
11
|
+
- [Features](#features)
|
|
12
|
+
- [Install](#install)
|
|
13
|
+
- [Setup config](#setup-config)
|
|
14
|
+
- [Using style modules](#using-style-modules)
|
|
15
|
+
- [Plugin configuration](#plugin-configuration)
|
|
16
|
+
|
|
9
17
|
## Features
|
|
10
18
|
|
|
11
|
-
- 🔥
|
|
19
|
+
- 🔥 Reloading page after changing any files.
|
|
12
20
|
- 🔧 Configure Tampermonkey's Userscript header.
|
|
13
21
|
- 💨 Import all [`grant`](https://www.tampermonkey.net/documentation.php#_grant)'s to the header by default in development mode.
|
|
14
22
|
- 📝 Automatic addition of used [`grant`](https://www.tampermonkey.net/documentation.php#_grant)'s in the code when building for production.
|
|
@@ -28,7 +36,7 @@ yarn add vite-userscript-plugin -D
|
|
|
28
36
|
pnpm add vite-userscript-plugin -D
|
|
29
37
|
```
|
|
30
38
|
|
|
31
|
-
### Setup
|
|
39
|
+
### Setup config
|
|
32
40
|
|
|
33
41
|
```js
|
|
34
42
|
import { defineConfig } from 'vite'
|
|
@@ -83,7 +91,19 @@ export default defineConfig((config) => {
|
|
|
83
91
|
}
|
|
84
92
|
```
|
|
85
93
|
|
|
86
|
-
|
|
94
|
+
### Using style modules
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
import style from './style.css?raw'
|
|
98
|
+
|
|
99
|
+
// inject style element
|
|
100
|
+
const styleElement = GM_addStyle(style)
|
|
101
|
+
|
|
102
|
+
// remove style element
|
|
103
|
+
styleElement.remove()
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Plugin configuration
|
|
87
107
|
|
|
88
108
|
```ts
|
|
89
109
|
interface ServerConfig {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PluginOption } from 'vite';
|
|
1
|
+
import { EsbuildTransformOptions, PluginOption } from 'vite';
|
|
2
2
|
|
|
3
3
|
declare const GM: readonly ["setValue", "getValue", "deleteValue", "listValues", "setClipboard", "addStyle", "addElement", "addValueChangeListener", "removeValueChangeListener", "registerMenuCommand", "unregisterMenuCommand", "download", "getTab", "getTabs", "saveTab", "openInTab", "notification", "getResourceURL", "getResourceText", "xmlhttpRequest", "log", "info"];
|
|
4
4
|
declare const GMwindow: readonly ["unsafeWindow", "window.onurlchange", "window.focus", "window.close"];
|
|
5
5
|
|
|
6
6
|
type RunAt = 'document-start' | 'document-body' | 'document-end' | 'document-idle' | 'context-menu';
|
|
7
7
|
type GMLiterals<T extends string> = [`GM_${T}` | `GM.${T}`];
|
|
8
|
-
type GMWindow = typeof GMwindow[number];
|
|
9
|
-
type Grants = GMWindow | GMLiterals<typeof GM[number]>[number];
|
|
8
|
+
type GMWindow = (typeof GMwindow)[number];
|
|
9
|
+
type Grants = GMWindow | GMLiterals<(typeof GM)[number]>[number];
|
|
10
10
|
type HeaderConfig = {
|
|
11
11
|
[property: string]: any;
|
|
12
12
|
/**
|
|
@@ -154,6 +154,10 @@ interface UserscriptPluginConfig {
|
|
|
154
154
|
* Path of userscript entry.
|
|
155
155
|
*/
|
|
156
156
|
entry: string;
|
|
157
|
+
/**
|
|
158
|
+
* Userscript file name.
|
|
159
|
+
*/
|
|
160
|
+
fileName?: string;
|
|
157
161
|
/**
|
|
158
162
|
* Userscript header config.
|
|
159
163
|
*
|
|
@@ -164,8 +168,20 @@ interface UserscriptPluginConfig {
|
|
|
164
168
|
* Server config.
|
|
165
169
|
*/
|
|
166
170
|
server?: ServerConfig;
|
|
171
|
+
/**
|
|
172
|
+
* Override default esbuild transform options.
|
|
173
|
+
*
|
|
174
|
+
* @default
|
|
175
|
+
* ```json
|
|
176
|
+
* {
|
|
177
|
+
* "minify": true,
|
|
178
|
+
* "legalComments": "none"
|
|
179
|
+
* }
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
esbuildTransformOptions?: Omit<EsbuildTransformOptions, 'format' | 'target' | 'loader' | 'sourcemap'>;
|
|
167
183
|
}
|
|
168
184
|
|
|
169
185
|
declare function UserscriptPlugin(config: UserscriptPluginConfig): PluginOption;
|
|
170
186
|
|
|
171
|
-
export { UserscriptPluginConfig, UserscriptPlugin as default };
|
|
187
|
+
export { type UserscriptPluginConfig, UserscriptPlugin as default };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,295 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { createServer } from "node:http";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import getPort from "get-port";
|
|
6
|
+
import openLink from "open";
|
|
7
|
+
import colors from "picocolors";
|
|
8
|
+
import serveHandler from "serve-handler";
|
|
9
|
+
import { createLogger } from "vite";
|
|
10
|
+
import { server } from "websocket";
|
|
4
11
|
|
|
5
|
-
|
|
12
|
+
// src/banner.ts
|
|
13
|
+
var Banner = class {
|
|
14
|
+
constructor(config) {
|
|
15
|
+
this.config = config;
|
|
16
|
+
this.addHomepageMeta();
|
|
17
|
+
this.maxKeyLength = Math.max(...Object.keys(this.config).map((key) => key.length)) + 1;
|
|
18
|
+
}
|
|
19
|
+
header = [];
|
|
20
|
+
maxKeyLength;
|
|
21
|
+
addHomepageMeta() {
|
|
22
|
+
const homePage = this.config.homepage ?? this.config.homepageURL;
|
|
23
|
+
if (homePage) {
|
|
24
|
+
this.config.updateURL = new URL(
|
|
25
|
+
`${this.config.name}.meta.js`,
|
|
26
|
+
homePage
|
|
27
|
+
).href;
|
|
28
|
+
this.config.downloadURL = new URL(
|
|
29
|
+
`${this.config.name}.user.js`,
|
|
30
|
+
homePage
|
|
31
|
+
).href;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
addSpaces(str) {
|
|
35
|
+
return " ".repeat(this.maxKeyLength - str.length);
|
|
36
|
+
}
|
|
37
|
+
addMetadata(key, value) {
|
|
38
|
+
value = Array.isArray(value) ? value.join(" ") : value === true ? "" : value;
|
|
39
|
+
this.header.push(`// @${key}${this.addSpaces(key)}${value}`);
|
|
40
|
+
}
|
|
41
|
+
generate() {
|
|
42
|
+
for (const [key, value] of Object.entries(this.config)) {
|
|
43
|
+
if (Array.isArray(value)) {
|
|
44
|
+
value.forEach((value2) => this.addMetadata(key, value2));
|
|
45
|
+
} else {
|
|
46
|
+
if (value === void 0) continue;
|
|
47
|
+
this.addMetadata(key, value);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return [
|
|
51
|
+
"// ==UserScript==",
|
|
52
|
+
...this.header,
|
|
53
|
+
"// ==/UserScript=="
|
|
54
|
+
].join("\n");
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// src/constants.ts
|
|
59
|
+
import { dirname } from "node:path";
|
|
60
|
+
import { fileURLToPath } from "node:url";
|
|
61
|
+
var pluginDir = dirname(fileURLToPath(import.meta.url));
|
|
62
|
+
var pluginName = "vite-userscript-plugin";
|
|
63
|
+
var regexpScripts = new RegExp(/\.(t|j)sx?$/);
|
|
64
|
+
var GM = [
|
|
65
|
+
"setValue",
|
|
66
|
+
"getValue",
|
|
67
|
+
"deleteValue",
|
|
68
|
+
"listValues",
|
|
69
|
+
"setClipboard",
|
|
70
|
+
"addStyle",
|
|
71
|
+
"addElement",
|
|
72
|
+
"addValueChangeListener",
|
|
73
|
+
"removeValueChangeListener",
|
|
74
|
+
"registerMenuCommand",
|
|
75
|
+
"unregisterMenuCommand",
|
|
76
|
+
"download",
|
|
77
|
+
"getTab",
|
|
78
|
+
"getTabs",
|
|
79
|
+
"saveTab",
|
|
80
|
+
"openInTab",
|
|
81
|
+
"notification",
|
|
82
|
+
"getResourceURL",
|
|
83
|
+
"getResourceText",
|
|
84
|
+
"xmlhttpRequest",
|
|
85
|
+
"log",
|
|
86
|
+
"info"
|
|
87
|
+
];
|
|
88
|
+
var GMwindow = [
|
|
89
|
+
"unsafeWindow",
|
|
90
|
+
"window.onurlchange",
|
|
91
|
+
"window.focus",
|
|
92
|
+
"window.close"
|
|
93
|
+
];
|
|
94
|
+
var grants = GM.map((grant) => [
|
|
95
|
+
`GM_${grant}`,
|
|
96
|
+
`GM.${grant}`
|
|
97
|
+
]).flat();
|
|
98
|
+
grants.push(...GMwindow);
|
|
99
|
+
|
|
100
|
+
// src/helpers.ts
|
|
101
|
+
import { transformWithEsbuild } from "vite";
|
|
102
|
+
function removeDuplicates(arr) {
|
|
103
|
+
return [...new Set(Array.isArray(arr) ? arr : arr ? [arr] : [])];
|
|
104
|
+
}
|
|
105
|
+
async function transform({ minify, file, name, loader }, transformOptions) {
|
|
106
|
+
const { code } = await transformWithEsbuild(file, name, {
|
|
107
|
+
minify,
|
|
108
|
+
loader,
|
|
109
|
+
sourcemap: false,
|
|
110
|
+
legalComments: "none",
|
|
111
|
+
...transformOptions
|
|
112
|
+
});
|
|
113
|
+
return code;
|
|
114
|
+
}
|
|
115
|
+
function defineGrants(code) {
|
|
116
|
+
const definedGrants = [];
|
|
117
|
+
for (const grant of grants) {
|
|
118
|
+
if (code.indexOf(grant) !== -1) {
|
|
119
|
+
definedGrants.push(grant);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return definedGrants;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/index.ts
|
|
126
|
+
function UserscriptPlugin(config) {
|
|
127
|
+
try {
|
|
128
|
+
let pluginConfig;
|
|
129
|
+
let isBuildWatch;
|
|
130
|
+
let socketConnection = null;
|
|
131
|
+
const fileName = config.fileName ?? config.header.name;
|
|
132
|
+
const logger = createLogger("info", {
|
|
133
|
+
prefix: `[${pluginName}]`,
|
|
134
|
+
allowClearScreen: true
|
|
135
|
+
});
|
|
136
|
+
const httpServer = createServer((req, res) => {
|
|
137
|
+
return serveHandler(req, res, {
|
|
138
|
+
public: pluginConfig.build.outDir
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
const WebSocketServer = server;
|
|
142
|
+
const ws = new WebSocketServer({ httpServer });
|
|
143
|
+
ws.on("request", (request) => {
|
|
144
|
+
socketConnection = request.accept(null, request.origin);
|
|
145
|
+
});
|
|
146
|
+
return {
|
|
147
|
+
name: pluginName,
|
|
148
|
+
apply: "build",
|
|
149
|
+
config() {
|
|
150
|
+
return {
|
|
151
|
+
build: {
|
|
152
|
+
target: "esnext",
|
|
153
|
+
minify: false,
|
|
154
|
+
lib: {
|
|
155
|
+
name: fileName,
|
|
156
|
+
entry: config.entry,
|
|
157
|
+
formats: ["iife"],
|
|
158
|
+
fileName: () => `${fileName}.js`
|
|
159
|
+
},
|
|
160
|
+
rollupOptions: {
|
|
161
|
+
output: {
|
|
162
|
+
extend: true
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
async configResolved(userConfig) {
|
|
169
|
+
pluginConfig = userConfig;
|
|
170
|
+
isBuildWatch = userConfig.build.watch ?? false;
|
|
171
|
+
config.entry = resolve(userConfig.root, config.entry);
|
|
172
|
+
Array.from([
|
|
173
|
+
"match",
|
|
174
|
+
"require",
|
|
175
|
+
"include",
|
|
176
|
+
"exclude",
|
|
177
|
+
"resource",
|
|
178
|
+
"connect"
|
|
179
|
+
]).forEach((key) => {
|
|
180
|
+
const value = config.header[key];
|
|
181
|
+
config.header[key] = removeDuplicates(value);
|
|
182
|
+
});
|
|
183
|
+
config.server = {
|
|
184
|
+
port: await getPort(),
|
|
185
|
+
open: false,
|
|
186
|
+
...config.server
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
async writeBundle(output, bundle) {
|
|
190
|
+
const { open, port } = config.server;
|
|
191
|
+
const sanitizedFilename = output.sanitizeFileName(fileName);
|
|
192
|
+
const userFilename = `${sanitizedFilename}.user.js`;
|
|
193
|
+
const proxyFilename = `${sanitizedFilename}.proxy.user.js`;
|
|
194
|
+
const metaFilename = `${sanitizedFilename}.meta.js`;
|
|
195
|
+
for (const [fileName2] of Object.entries(bundle)) {
|
|
196
|
+
if (regexpScripts.test(fileName2)) {
|
|
197
|
+
const rootDir = pluginConfig.root;
|
|
198
|
+
const outDir = pluginConfig.build.outDir;
|
|
199
|
+
const outPath = resolve(rootDir, outDir, fileName2);
|
|
200
|
+
const userFilePath = resolve(rootDir, outDir, userFilename);
|
|
201
|
+
const proxyFilePath = resolve(rootDir, outDir, proxyFilename);
|
|
202
|
+
const metaFilePath = resolve(rootDir, outDir, metaFilename);
|
|
203
|
+
const wsPath = resolve(pluginDir, `ws-${sanitizedFilename}.js`);
|
|
204
|
+
try {
|
|
205
|
+
let source = readFileSync(outPath, "utf8");
|
|
206
|
+
source = await transform(
|
|
207
|
+
{
|
|
208
|
+
minify: !isBuildWatch,
|
|
209
|
+
file: source,
|
|
210
|
+
name: fileName2,
|
|
211
|
+
loader: "js"
|
|
212
|
+
},
|
|
213
|
+
config.esbuildTransformOptions
|
|
214
|
+
);
|
|
215
|
+
config.header.grant = removeDuplicates(
|
|
216
|
+
isBuildWatch ? grants : [...defineGrants(source), ...config.header.grant ?? []]
|
|
217
|
+
);
|
|
218
|
+
if (isBuildWatch) {
|
|
219
|
+
const wsFile = readFileSync(resolve(pluginDir, "ws.js"), "utf8");
|
|
220
|
+
const wsScript = await transform(
|
|
221
|
+
{
|
|
222
|
+
minify: !isBuildWatch,
|
|
223
|
+
file: wsFile.replace("__WS__", `ws://localhost:${port}`),
|
|
224
|
+
name: wsPath,
|
|
225
|
+
loader: "js"
|
|
226
|
+
},
|
|
227
|
+
config.esbuildTransformOptions
|
|
228
|
+
);
|
|
229
|
+
writeFileSync(wsPath, wsScript);
|
|
230
|
+
writeFileSync(
|
|
231
|
+
proxyFilePath,
|
|
232
|
+
new Banner({
|
|
233
|
+
...config.header,
|
|
234
|
+
require: [
|
|
235
|
+
...config.header.require ?? [],
|
|
236
|
+
"file://" + wsPath,
|
|
237
|
+
"file://" + outPath
|
|
238
|
+
]
|
|
239
|
+
}).generate()
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
const banner = new Banner(config.header).generate();
|
|
243
|
+
writeFileSync(outPath, source);
|
|
244
|
+
writeFileSync(metaFilePath, banner);
|
|
245
|
+
writeFileSync(userFilePath, `${banner}
|
|
246
|
+
|
|
247
|
+
${source}`);
|
|
248
|
+
} catch (err) {
|
|
249
|
+
console.log(err);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (isBuildWatch && !httpServer.listening) {
|
|
254
|
+
const link = `http://localhost:${port}`;
|
|
255
|
+
httpServer.listen(port, () => {
|
|
256
|
+
logger.clearScreen("info");
|
|
257
|
+
logger.info(
|
|
258
|
+
colors.bold(
|
|
259
|
+
`${colors.cyan(">>> [vite-userscript-plugin]")} ${colors.gray(
|
|
260
|
+
link
|
|
261
|
+
)}`
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
});
|
|
265
|
+
if (open) {
|
|
266
|
+
await openLink(`${link}/${proxyFilename}`);
|
|
267
|
+
}
|
|
268
|
+
} else if (!isBuildWatch) {
|
|
269
|
+
httpServer.close();
|
|
270
|
+
process.exit(0);
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
buildEnd() {
|
|
274
|
+
if (isBuildWatch) {
|
|
275
|
+
logger.clearScreen("info");
|
|
276
|
+
if (socketConnection) {
|
|
277
|
+
socketConnection.sendUTF(
|
|
278
|
+
JSON.stringify({
|
|
279
|
+
message: "reload"
|
|
280
|
+
})
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
} catch (err) {
|
|
287
|
+
console.error(err);
|
|
288
|
+
return {
|
|
289
|
+
name: pluginName
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
export {
|
|
294
|
+
UserscriptPlugin as default
|
|
295
|
+
};
|
package/dist/ws.js
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
// src/ws.ts
|
|
2
|
+
function connection() {
|
|
3
|
+
const ws = new WebSocket("__WS__");
|
|
4
|
+
ws.addEventListener("close", () => {
|
|
5
|
+
setTimeout(connection, 1e3);
|
|
6
|
+
});
|
|
7
|
+
ws.addEventListener("error", () => {
|
|
8
|
+
ws.close();
|
|
9
|
+
});
|
|
10
|
+
ws.addEventListener("message", () => {
|
|
11
|
+
location.reload();
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
connection();
|
package/package.json
CHANGED
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-userscript-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
|
-
"main": "./dist/index.cjs",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
6
|
"exports": {
|
|
9
|
-
"
|
|
10
|
-
"import": "./dist/index.js"
|
|
7
|
+
".": "./dist/index.js"
|
|
11
8
|
},
|
|
12
9
|
"files": [
|
|
13
10
|
"dist",
|
|
14
11
|
"types"
|
|
15
12
|
],
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"build": "tsup",
|
|
19
|
-
"test": "vitest",
|
|
20
|
-
"test:ui": "vitest --ui --watch",
|
|
21
|
-
"dev:examples": "turbo run dev --filter='./examples/*'",
|
|
22
|
-
"build:examples": "turbo run build --filter='./examples/*'",
|
|
23
|
-
"format": "prettier --write --ignore-unknown **",
|
|
24
|
-
"prepublishOnly": "pnpm build"
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20"
|
|
25
15
|
},
|
|
26
16
|
"repository": {
|
|
27
17
|
"type": "git",
|
|
@@ -45,27 +35,36 @@
|
|
|
45
35
|
"url": "https://github.com/crashmax-dev/vite-userscript-plugin/issues"
|
|
46
36
|
},
|
|
47
37
|
"dependencies": {
|
|
48
|
-
"get-port": "7.
|
|
49
|
-
"open": "
|
|
50
|
-
"picocolors": "1.
|
|
38
|
+
"get-port": "7.1.0",
|
|
39
|
+
"open": "10.1.0",
|
|
40
|
+
"picocolors": "1.1.0",
|
|
51
41
|
"serve-handler": "6.1.5",
|
|
52
|
-
"websocket": "1.0.
|
|
42
|
+
"websocket": "1.0.35"
|
|
53
43
|
},
|
|
54
44
|
"devDependencies": {
|
|
55
|
-
"@crashmax/prettier-config": "
|
|
56
|
-
"@crashmax/tsconfig": "2.0
|
|
57
|
-
"@types/node": "
|
|
58
|
-
"@types/serve-handler": "6.1.
|
|
59
|
-
"@types/websocket": "1.0.
|
|
60
|
-
"@vitest/ui": "0.
|
|
61
|
-
"tsup": "
|
|
62
|
-
"turbo": "1.
|
|
63
|
-
"typescript": "5.
|
|
64
|
-
"vite": "
|
|
65
|
-
"vite-plugin-dts": "
|
|
66
|
-
"vitest": "0.
|
|
45
|
+
"@crashmax/prettier-config": "5.0.2",
|
|
46
|
+
"@crashmax/tsconfig": "2.1.0",
|
|
47
|
+
"@types/node": "22.5.4",
|
|
48
|
+
"@types/serve-handler": "6.1.4",
|
|
49
|
+
"@types/websocket": "1.0.10",
|
|
50
|
+
"@vitest/ui": "2.0.5",
|
|
51
|
+
"tsup": "8.2.4",
|
|
52
|
+
"turbo": "2.1.1",
|
|
53
|
+
"typescript": "5.5.4",
|
|
54
|
+
"vite": "5.4.3",
|
|
55
|
+
"vite-plugin-dts": "4.1.1",
|
|
56
|
+
"vitest": "2.0.5"
|
|
67
57
|
},
|
|
68
58
|
"peerDependencies": {
|
|
69
59
|
"vite": ">=3.0.0"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"dev": "tsup --watch",
|
|
63
|
+
"build": "tsup",
|
|
64
|
+
"test": "vitest",
|
|
65
|
+
"test:ui": "vitest --ui --watch",
|
|
66
|
+
"dev:examples": "turbo run dev --filter=./examples/*",
|
|
67
|
+
"build:examples": "turbo run build --filter=./examples/*",
|
|
68
|
+
"format": "prettier --write --ignore-unknown **"
|
|
70
69
|
}
|
|
71
|
-
}
|
|
70
|
+
}
|