vite-plugin-ai-diagnostic 1.0.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/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/index.d.mts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +50890 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +50877 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Your Name
|
|
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
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# vite-plugin-ai-diagnostic
|
|
2
|
+
|
|
3
|
+
AI-powered diagnostic plugin for Vite. Automatically detect and fix build errors.
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- 🔍 **Auto Detect** - Automatically detect build errors
|
|
8
|
+
- 🤖 **AI Fix** - Use OpenAI to suggest fixes
|
|
9
|
+
- 🔄 **Auto Retry** - Automatically retry with fixes
|
|
10
|
+
- 📊 **Reports** - Generate diagnostic reports
|
|
11
|
+
- 🎯 **Smart Analysis** - Understand error context
|
|
12
|
+
|
|
13
|
+
## 📦 Installation
|
|
14
|
+
|
|
15
|
+
::: code-group
|
|
16
|
+
|
|
17
|
+
```bash [npm]
|
|
18
|
+
npm install -D vite-plugin-ai-diagnostic
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```bash [yarn]
|
|
22
|
+
yarn add -D vite-plugin-ai-diagnostic
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```bash [pnpm]
|
|
26
|
+
pnpm add -D vite-plugin-ai-diagnostic
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
:::
|
|
30
|
+
|
|
31
|
+
## 🚀 Quick Start
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// vite.config.ts
|
|
35
|
+
import { defineConfig } from "vite";
|
|
36
|
+
import { vitePluginAIDiagnostic } from "vite-plugin-ai-diagnostic";
|
|
37
|
+
|
|
38
|
+
export default defineConfig({
|
|
39
|
+
plugins: [
|
|
40
|
+
vitePluginAIDiagnostic({
|
|
41
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
42
|
+
autoFix: true,
|
|
43
|
+
maxRetries: 3,
|
|
44
|
+
output: {
|
|
45
|
+
console: true,
|
|
46
|
+
html: true,
|
|
47
|
+
markdown: true,
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 📚 Documentation
|
|
55
|
+
|
|
56
|
+
Full documentation: https://mo520.github.io/vite-plugin-ai/plugins/ai-diagnostic
|
|
57
|
+
|
|
58
|
+
## 📄 License
|
|
59
|
+
|
|
60
|
+
MIT
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AI 诊断插件入口
|
|
5
|
+
*
|
|
6
|
+
* 功能:
|
|
7
|
+
* - 自动诊断构建错误
|
|
8
|
+
* - 提供修复建议
|
|
9
|
+
* - 自动修复代码
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
interface AIPluginOptions {
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
apiUrl?: string;
|
|
15
|
+
autoFix?: boolean;
|
|
16
|
+
model?: string;
|
|
17
|
+
maxRetries?: number;
|
|
18
|
+
output?: {
|
|
19
|
+
console?: boolean;
|
|
20
|
+
html?: boolean;
|
|
21
|
+
markdown?: boolean;
|
|
22
|
+
json?: boolean;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
declare function vitePluginAIDiagnostic(options?: AIPluginOptions): Plugin;
|
|
26
|
+
|
|
27
|
+
export { type AIPluginOptions, vitePluginAIDiagnostic };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AI 诊断插件入口
|
|
5
|
+
*
|
|
6
|
+
* 功能:
|
|
7
|
+
* - 自动诊断构建错误
|
|
8
|
+
* - 提供修复建议
|
|
9
|
+
* - 自动修复代码
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
interface AIPluginOptions {
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
apiUrl?: string;
|
|
15
|
+
autoFix?: boolean;
|
|
16
|
+
model?: string;
|
|
17
|
+
maxRetries?: number;
|
|
18
|
+
output?: {
|
|
19
|
+
console?: boolean;
|
|
20
|
+
html?: boolean;
|
|
21
|
+
markdown?: boolean;
|
|
22
|
+
json?: boolean;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
declare function vitePluginAIDiagnostic(options?: AIPluginOptions): Plugin;
|
|
26
|
+
|
|
27
|
+
export { type AIPluginOptions, vitePluginAIDiagnostic };
|