@solazah/solazah-cli 0.2.10
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/CHANGELOG.md +169 -0
- package/commands/account/login.d.ts +3 -0
- package/commands/account/login.d.ts.map +1 -0
- package/commands/account/logout.d.ts +3 -0
- package/commands/account/logout.d.ts.map +1 -0
- package/commands/account/shared.d.ts +9 -0
- package/commands/account/shared.d.ts.map +1 -0
- package/commands/account/userinfo.d.ts +3 -0
- package/commands/account/userinfo.d.ts.map +1 -0
- package/commands/plugin/create.d.ts +9 -0
- package/commands/plugin/create.d.ts.map +1 -0
- package/commands/plugin/package.d.ts +6 -0
- package/commands/plugin/package.d.ts.map +1 -0
- package/commands/plugin/publish.d.ts +7 -0
- package/commands/plugin/publish.d.ts.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +955 -0
- package/index.js.map +1 -0
- package/package.json +14 -0
- package/templates/react/.prettierrc +6 -0
- package/templates/react/.versionrc +17 -0
- package/templates/react/CHANGELOG.md +2 -0
- package/templates/react/README.md +224 -0
- package/templates/react/components.json +22 -0
- package/templates/react/eslint.config.js +21 -0
- package/templates/react/manifest.json +14 -0
- package/templates/react/package.config.js +86 -0
- package/templates/react/package.json +66 -0
- package/templates/react/src/preload/preload.mjs +0 -0
- package/templates/react/src/renderer/components/ui/card.tsx +76 -0
- package/templates/react/src/renderer/components/ui/sonner.tsx +35 -0
- package/templates/react/src/renderer/index.css +164 -0
- package/templates/react/src/renderer/index.html +12 -0
- package/templates/react/src/renderer/lib/utils.ts +6 -0
- package/templates/react/src/renderer/main.tsx +56 -0
- package/templates/react/src/renderer/pages/Home.tsx +154 -0
- package/templates/react/src/renderer/vite-env.d.ts +1 -0
- package/templates/react/template.json +15 -0
- package/templates/react/tsconfig.app.json +25 -0
- package/templates/react/tsconfig.json +19 -0
- package/templates/react/tsconfig.node.json +25 -0
- package/templates/react/vite.config.ts +25 -0
- package/utils/auth-storage.d.ts +27 -0
- package/utils/auth-storage.d.ts.map +1 -0
- package/utils/file.d.ts +41 -0
- package/utils/file.d.ts.map +1 -0
- package/utils/oauth-device.d.ts +98 -0
- package/utils/oauth-device.d.ts.map +1 -0
- package/utils/open-browser.d.ts +5 -0
- package/utils/open-browser.d.ts.map +1 -0
- package/utils/validate.d.ts +21 -0
- package/utils/validate.d.ts.map +1 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{PLUGIN_NAME}}",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "index.html",
|
|
6
|
+
"author": "{{PLUGIN_AUTHOR}}",
|
|
7
|
+
"description": "{{PLUGIN_DESCRIPTION}}",
|
|
8
|
+
"keywords": ["solazah", "plugin"],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "vite --port {{DEV_PORT}}",
|
|
11
|
+
"build": "vite build --config vite.config.ts",
|
|
12
|
+
"lint": "eslint .",
|
|
13
|
+
"preview": "vite preview",
|
|
14
|
+
"version": "standard-version",
|
|
15
|
+
"package": "npm run build && node package.config.js",
|
|
16
|
+
"publish": "npm publish ./release",
|
|
17
|
+
"package:publish": "npm run package && npm run publish"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@hookform/resolvers": "^5.2.2",
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
22
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
23
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
24
|
+
"@radix-ui/react-label": "^2.1.7",
|
|
25
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
26
|
+
"@tailwindcss/vite": "^4.1.14",
|
|
27
|
+
"ahooks": "^3.9.6",
|
|
28
|
+
"class-variance-authority": "^0.7.1",
|
|
29
|
+
"clsx": "^2.1.1",
|
|
30
|
+
"lucide-react": "^0.544.0",
|
|
31
|
+
"react": "^19.0.0",
|
|
32
|
+
"react-dom": "^19.0.0",
|
|
33
|
+
"react-hook-form": "^7.64.0",
|
|
34
|
+
"react-router-dom": "^6.28.0",
|
|
35
|
+
"sonner": "^2.0.7",
|
|
36
|
+
"tailwind-merge": "^3.3.1",
|
|
37
|
+
"tailwindcss": "^4.1.14",
|
|
38
|
+
"tw-animate-css": "^1.4.0",
|
|
39
|
+
"valtio": "^2.2.0",
|
|
40
|
+
"zod": "^4.1.12"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@commitlint/cli": "^19.8.1",
|
|
44
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
45
|
+
"@eslint/js": "^9.9.0",
|
|
46
|
+
"@types/node": "^24.6.2",
|
|
47
|
+
"@types/react": "^18.3.3",
|
|
48
|
+
"@types/react-dom": "^18.3.0",
|
|
49
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
50
|
+
"eslint": "^9.9.0",
|
|
51
|
+
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
52
|
+
"eslint-plugin-react-refresh": "^0.4.9",
|
|
53
|
+
"globals": "^15.9.0",
|
|
54
|
+
"husky": "^9.1.7",
|
|
55
|
+
"standard-version": "^9.5.0",
|
|
56
|
+
"typescript": "^5.5.3",
|
|
57
|
+
"typescript-eslint": "^8.0.1",
|
|
58
|
+
"vite": "^5.4.1",
|
|
59
|
+
"vite-plugin-svgr": "^4.3.0"
|
|
60
|
+
},
|
|
61
|
+
"commitlint": {
|
|
62
|
+
"extends": [
|
|
63
|
+
"@commitlint/config-conventional"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/renderer/lib/utils"
|
|
4
|
+
|
|
5
|
+
const Card = React.forwardRef<
|
|
6
|
+
HTMLDivElement,
|
|
7
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
8
|
+
>(({ className, ...props }, ref) => (
|
|
9
|
+
<div
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={cn(
|
|
12
|
+
"rounded-xl border bg-card text-card-foreground shadow",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
))
|
|
18
|
+
Card.displayName = "Card"
|
|
19
|
+
|
|
20
|
+
const CardHeader = React.forwardRef<
|
|
21
|
+
HTMLDivElement,
|
|
22
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
23
|
+
>(({ className, ...props }, ref) => (
|
|
24
|
+
<div
|
|
25
|
+
ref={ref}
|
|
26
|
+
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
))
|
|
30
|
+
CardHeader.displayName = "CardHeader"
|
|
31
|
+
|
|
32
|
+
const CardTitle = React.forwardRef<
|
|
33
|
+
HTMLDivElement,
|
|
34
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
35
|
+
>(({ className, ...props }, ref) => (
|
|
36
|
+
<div
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn("font-semibold leading-none tracking-tight", className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
))
|
|
42
|
+
CardTitle.displayName = "CardTitle"
|
|
43
|
+
|
|
44
|
+
const CardDescription = React.forwardRef<
|
|
45
|
+
HTMLDivElement,
|
|
46
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
47
|
+
>(({ className, ...props }, ref) => (
|
|
48
|
+
<div
|
|
49
|
+
ref={ref}
|
|
50
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
))
|
|
54
|
+
CardDescription.displayName = "CardDescription"
|
|
55
|
+
|
|
56
|
+
const CardContent = React.forwardRef<
|
|
57
|
+
HTMLDivElement,
|
|
58
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
59
|
+
>(({ className, ...props }, ref) => (
|
|
60
|
+
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
61
|
+
))
|
|
62
|
+
CardContent.displayName = "CardContent"
|
|
63
|
+
|
|
64
|
+
const CardFooter = React.forwardRef<
|
|
65
|
+
HTMLDivElement,
|
|
66
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
67
|
+
>(({ className, ...props }, ref) => (
|
|
68
|
+
<div
|
|
69
|
+
ref={ref}
|
|
70
|
+
className={cn("flex items-center p-6 pt-0", className)}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
))
|
|
74
|
+
CardFooter.displayName = "CardFooter"
|
|
75
|
+
|
|
76
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CircleCheckIcon,
|
|
3
|
+
InfoIcon,
|
|
4
|
+
Loader2Icon,
|
|
5
|
+
OctagonXIcon,
|
|
6
|
+
TriangleAlertIcon,
|
|
7
|
+
} from "lucide-react"
|
|
8
|
+
import { Toaster as Sonner, type ToasterProps } from "sonner"
|
|
9
|
+
|
|
10
|
+
const Toaster = ({ ...props }: ToasterProps) => {
|
|
11
|
+
return (
|
|
12
|
+
<Sonner
|
|
13
|
+
theme="system"
|
|
14
|
+
className="toaster group"
|
|
15
|
+
icons={{
|
|
16
|
+
success: <CircleCheckIcon className="size-4" />,
|
|
17
|
+
info: <InfoIcon className="size-4" />,
|
|
18
|
+
warning: <TriangleAlertIcon className="size-4" />,
|
|
19
|
+
error: <OctagonXIcon className="size-4" />,
|
|
20
|
+
loading: <Loader2Icon className="size-4 animate-spin" />,
|
|
21
|
+
}}
|
|
22
|
+
style={
|
|
23
|
+
{
|
|
24
|
+
"--normal-bg": "var(--popover)",
|
|
25
|
+
"--normal-text": "var(--popover-foreground)",
|
|
26
|
+
"--normal-border": "var(--border)",
|
|
27
|
+
"--border-radius": "var(--radius)",
|
|
28
|
+
} as React.CSSProperties
|
|
29
|
+
}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { Toaster }
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
@import "tw-animate-css";
|
|
3
|
+
|
|
4
|
+
@custom-variant dark (&:is(.dark *));
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
div[role="menuitem"],
|
|
8
|
+
div[role="menu"],
|
|
9
|
+
div[role="option"],
|
|
10
|
+
button {
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
::-webkit-scrollbar {
|
|
15
|
+
width: 5px;
|
|
16
|
+
height: 5px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
::-webkit-scrollbar-track {
|
|
20
|
+
background-color: transparent;
|
|
21
|
+
border-radius: .75rem;
|
|
22
|
+
width: 5px;
|
|
23
|
+
height: 5px;
|
|
24
|
+
transition-duration: .4s
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
::-webkit-scrollbar-thumb {
|
|
28
|
+
background-color: rgba(204, 204, 204, 0.575);
|
|
29
|
+
border-radius: .75rem;
|
|
30
|
+
width: 5px;
|
|
31
|
+
height: 5px;
|
|
32
|
+
transition-duration: .4s
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
::-webkit-scrollbar-thumb:hover {
|
|
36
|
+
background-color: rgba(128, 128, 128, 0.8)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
::-webkit-scrollbar-thumb:active {
|
|
40
|
+
background-color: rgba(68, 68, 68, 0.23)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@theme inline {
|
|
44
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
45
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
46
|
+
--radius-lg: var(--radius);
|
|
47
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
48
|
+
--color-background: var(--background);
|
|
49
|
+
--color-foreground: var(--foreground);
|
|
50
|
+
--color-card: var(--card);
|
|
51
|
+
--color-card-foreground: var(--card-foreground);
|
|
52
|
+
--color-popover: var(--popover);
|
|
53
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
54
|
+
--color-primary: var(--primary);
|
|
55
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
56
|
+
--color-secondary: var(--secondary);
|
|
57
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
58
|
+
--color-muted: var(--muted);
|
|
59
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
60
|
+
--color-accent: var(--accent);
|
|
61
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
62
|
+
--color-destructive: var(--destructive);
|
|
63
|
+
--color-border: var(--border);
|
|
64
|
+
--color-input: var(--input);
|
|
65
|
+
--color-ring: var(--ring);
|
|
66
|
+
--color-chart-1: var(--chart-1);
|
|
67
|
+
--color-chart-2: var(--chart-2);
|
|
68
|
+
--color-chart-3: var(--chart-3);
|
|
69
|
+
--color-chart-4: var(--chart-4);
|
|
70
|
+
--color-chart-5: var(--chart-5);
|
|
71
|
+
--color-sidebar: var(--sidebar);
|
|
72
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
73
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
74
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
75
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
76
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
77
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
78
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:root {
|
|
82
|
+
--radius: 0.625rem;
|
|
83
|
+
--background: oklch(1 0 0);
|
|
84
|
+
--foreground: oklch(0.145 0 0);
|
|
85
|
+
--card: oklch(1 0 0);
|
|
86
|
+
--card-foreground: oklch(0.145 0 0);
|
|
87
|
+
--popover: oklch(1 0 0);
|
|
88
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
89
|
+
--primary: oklch(0.205 0 0);
|
|
90
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
91
|
+
--secondary: oklch(0.97 0 0);
|
|
92
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
93
|
+
--muted: oklch(0.97 0 0);
|
|
94
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
95
|
+
--accent: oklch(0.97 0 0);
|
|
96
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
97
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
98
|
+
--border: oklch(0.922 0 0);
|
|
99
|
+
--input: oklch(0.922 0 0);
|
|
100
|
+
--ring: oklch(0.708 0 0);
|
|
101
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
102
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
103
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
104
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
105
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
106
|
+
--sidebar: oklch(0.985 0 0);
|
|
107
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
108
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
109
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
110
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
111
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
112
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
113
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.dark {
|
|
117
|
+
--background: oklch(0.145 0 0);
|
|
118
|
+
--foreground: oklch(0.985 0 0);
|
|
119
|
+
--card: oklch(0.205 0 0);
|
|
120
|
+
--card-foreground: oklch(0.985 0 0);
|
|
121
|
+
--popover: oklch(0.205 0 0);
|
|
122
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
123
|
+
--primary: oklch(0.922 0 0);
|
|
124
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
125
|
+
--secondary: oklch(0.269 0 0);
|
|
126
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
127
|
+
--muted: oklch(0.269 0 0);
|
|
128
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
129
|
+
--accent: oklch(0.269 0 0);
|
|
130
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
131
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
132
|
+
--border: oklch(1 0 0 / 10%);
|
|
133
|
+
--input: oklch(1 0 0 / 15%);
|
|
134
|
+
--ring: oklch(0.556 0 0);
|
|
135
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
136
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
137
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
138
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
139
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
140
|
+
--sidebar: oklch(0.205 0 0);
|
|
141
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
142
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
143
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
144
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
145
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
146
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
147
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@layer base {
|
|
151
|
+
* {
|
|
152
|
+
@apply border-border outline-ring/50;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
body {
|
|
156
|
+
@apply bg-background text-foreground;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.titlebar {
|
|
161
|
+
-webkit-app-region: drag;
|
|
162
|
+
-webkit-user-select: none;
|
|
163
|
+
user-select: none;
|
|
164
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>{{PLUGIN_DISPLAY_NAME}}</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="./main.tsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {createRoot} from 'react-dom/client'
|
|
2
|
+
import './index.css'
|
|
3
|
+
import {HashRouter, Route, Routes} from "react-router-dom";
|
|
4
|
+
import {Toaster} from "@/renderer/components/ui/sonner.tsx";
|
|
5
|
+
import Home from "@/renderer/pages/Home.tsx";
|
|
6
|
+
|
|
7
|
+
console.log("[{{PLUGIN_NAME}}] plugin loaded!");
|
|
8
|
+
|
|
9
|
+
// 插件准备就绪时触发
|
|
10
|
+
window.ipcRenderer?.on("plugin.onReady", async (event, args) => {
|
|
11
|
+
console.log("[{{PLUGIN_NAME}}] onReady!", args);
|
|
12
|
+
|
|
13
|
+
// 在这里初始化你的插件
|
|
14
|
+
// 例如:加载配置、注册命令等
|
|
15
|
+
|
|
16
|
+
// 示例:注册命令
|
|
17
|
+
// await window.ipcRenderer.invoke("plugin.setCommands", [
|
|
18
|
+
// {
|
|
19
|
+
// name: "示例命令",
|
|
20
|
+
// alias: ["example"],
|
|
21
|
+
// silence: false,
|
|
22
|
+
// shortcut: "",
|
|
23
|
+
// }
|
|
24
|
+
// ]);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// 用户执行命令时触发
|
|
28
|
+
window.ipcRenderer?.on("plugin.onEnter", async (event, name, args) => {
|
|
29
|
+
console.log("[{{PLUGIN_NAME}}] onEnter!", name, args);
|
|
30
|
+
|
|
31
|
+
// 如果是主命令,显示插件界面
|
|
32
|
+
if (name === "{{PLUGIN_DISPLAY_NAME}}") {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 处理其他命令
|
|
37
|
+
// 例如:执行特定操作
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const App = () => {
|
|
41
|
+
return (
|
|
42
|
+
<HashRouter>
|
|
43
|
+
<div className="{{PLUGIN_CLASS_NAME}}">
|
|
44
|
+
<Toaster/>
|
|
45
|
+
<main className="w-full h-screen">
|
|
46
|
+
<div className="titlebar h-10"></div>
|
|
47
|
+
<Routes>
|
|
48
|
+
<Route path="/" element={<Home />} />
|
|
49
|
+
</Routes>
|
|
50
|
+
</main>
|
|
51
|
+
</div>
|
|
52
|
+
</HashRouter>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
createRoot(document.getElementById('root')!).render(<App/>);
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/renderer/components/ui/card";
|
|
2
|
+
|
|
3
|
+
export default function Home() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="container mx-auto p-8 max-w-4xl">
|
|
6
|
+
<div className="space-y-6">
|
|
7
|
+
{/* Header */}
|
|
8
|
+
<div className="space-y-2">
|
|
9
|
+
<h1 className="text-4xl font-bold tracking-tight">
|
|
10
|
+
{{PLUGIN_DISPLAY_NAME}}
|
|
11
|
+
</h1>
|
|
12
|
+
<p className="text-lg text-muted-foreground">
|
|
13
|
+
{{PLUGIN_DESCRIPTION}}
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
{/* Quick Start Card */}
|
|
18
|
+
<Card>
|
|
19
|
+
<CardHeader>
|
|
20
|
+
<CardTitle>🚀 Quick Start</CardTitle>
|
|
21
|
+
<CardDescription>
|
|
22
|
+
Get started with your plugin development
|
|
23
|
+
</CardDescription>
|
|
24
|
+
</CardHeader>
|
|
25
|
+
<CardContent className="space-y-4">
|
|
26
|
+
<div>
|
|
27
|
+
<h3 className="font-semibold mb-2">1. Customize Your Plugin</h3>
|
|
28
|
+
<ul className="list-disc list-inside space-y-1 text-sm text-muted-foreground">
|
|
29
|
+
<li>Edit <code className="px-1 py-0.5 bg-muted rounded">src/renderer.js</code> for plugin logic</li>
|
|
30
|
+
<li>Modify <code className="px-1 py-0.5 bg-muted rounded">src/pages/Home.tsx</code> for UI</li>
|
|
31
|
+
<li>Update <code className="px-1 py-0.5 bg-muted rounded">manifest.json</code> for plugin settings</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div>
|
|
36
|
+
<h3 className="font-semibold mb-2">2. Add UI Components</h3>
|
|
37
|
+
<p className="text-sm text-muted-foreground mb-2">
|
|
38
|
+
This plugin uses shadcn/ui components. Add more with:
|
|
39
|
+
</p>
|
|
40
|
+
<code className="block px-3 py-2 bg-muted rounded text-sm">
|
|
41
|
+
npx shadcn@latest add button input dialog
|
|
42
|
+
</code>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div>
|
|
46
|
+
<h3 className="font-semibold mb-2">3. Implement Features</h3>
|
|
47
|
+
<ul className="list-disc list-inside space-y-1 text-sm text-muted-foreground">
|
|
48
|
+
<li>Register commands in <code className="px-1 py-0.5 bg-muted rounded">plugin.onReady</code></li>
|
|
49
|
+
<li>Handle commands in <code className="px-1 py-0.5 bg-muted rounded">plugin.onEnter</code></li>
|
|
50
|
+
<li>Use Valtio for state management</li>
|
|
51
|
+
<li>Use React Hook Form + Zod for forms</li>
|
|
52
|
+
</ul>
|
|
53
|
+
</div>
|
|
54
|
+
</CardContent>
|
|
55
|
+
</Card>
|
|
56
|
+
|
|
57
|
+
{/* Documentation Card */}
|
|
58
|
+
<Card>
|
|
59
|
+
<CardHeader>
|
|
60
|
+
<CardTitle>📚 Documentation</CardTitle>
|
|
61
|
+
<CardDescription>
|
|
62
|
+
Learn more about plugin development
|
|
63
|
+
</CardDescription>
|
|
64
|
+
</CardHeader>
|
|
65
|
+
<CardContent>
|
|
66
|
+
<div className="grid gap-3">
|
|
67
|
+
<div className="flex items-start gap-3">
|
|
68
|
+
<div className="w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0">
|
|
69
|
+
<span className="text-sm">📖</span>
|
|
70
|
+
</div>
|
|
71
|
+
<div>
|
|
72
|
+
<div className="font-medium">README.md</div>
|
|
73
|
+
<div className="text-sm text-muted-foreground">
|
|
74
|
+
Project overview and quick reference
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<div className="flex items-start gap-3">
|
|
80
|
+
<div className="w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0">
|
|
81
|
+
<span className="text-sm">📘</span>
|
|
82
|
+
</div>
|
|
83
|
+
<div>
|
|
84
|
+
<div className="font-medium">GUIDE.md</div>
|
|
85
|
+
<div className="text-sm text-muted-foreground">
|
|
86
|
+
Detailed development guide with examples
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div className="flex items-start gap-3">
|
|
92
|
+
<div className="w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0">
|
|
93
|
+
<span className="text-sm">🤖</span>
|
|
94
|
+
</div>
|
|
95
|
+
<div>
|
|
96
|
+
<div className="font-medium">CLAUDE.md</div>
|
|
97
|
+
<div className="text-sm text-muted-foreground">
|
|
98
|
+
AI-assisted development tips
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</CardContent>
|
|
104
|
+
</Card>
|
|
105
|
+
|
|
106
|
+
{/* Tech Stack Card */}
|
|
107
|
+
<Card>
|
|
108
|
+
<CardHeader>
|
|
109
|
+
<CardTitle>🛠️ Tech Stack</CardTitle>
|
|
110
|
+
<CardDescription>
|
|
111
|
+
This plugin is built with modern technologies
|
|
112
|
+
</CardDescription>
|
|
113
|
+
</CardHeader>
|
|
114
|
+
<CardContent>
|
|
115
|
+
<div className="grid grid-cols-2 md:grid-cols-3 gap-3 text-sm">
|
|
116
|
+
<div className="p-3 rounded-lg bg-muted">
|
|
117
|
+
<div className="font-semibold">React 19</div>
|
|
118
|
+
<div className="text-xs text-muted-foreground">UI Framework</div>
|
|
119
|
+
</div>
|
|
120
|
+
<div className="p-3 rounded-lg bg-muted">
|
|
121
|
+
<div className="font-semibold">TypeScript</div>
|
|
122
|
+
<div className="text-xs text-muted-foreground">Type Safety</div>
|
|
123
|
+
</div>
|
|
124
|
+
<div className="p-3 rounded-lg bg-muted">
|
|
125
|
+
<div className="font-semibold">Vite 5</div>
|
|
126
|
+
<div className="text-xs text-muted-foreground">Build Tool</div>
|
|
127
|
+
</div>
|
|
128
|
+
<div className="p-3 rounded-lg bg-muted">
|
|
129
|
+
<div className="font-semibold">Tailwind CSS</div>
|
|
130
|
+
<div className="text-xs text-muted-foreground">Styling</div>
|
|
131
|
+
</div>
|
|
132
|
+
<div className="p-3 rounded-lg bg-muted">
|
|
133
|
+
<div className="font-semibold">shadcn/ui</div>
|
|
134
|
+
<div className="text-xs text-muted-foreground">Components</div>
|
|
135
|
+
</div>
|
|
136
|
+
<div className="p-3 rounded-lg bg-muted">
|
|
137
|
+
<div className="font-semibold">Valtio</div>
|
|
138
|
+
<div className="text-xs text-muted-foreground">State</div>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</CardContent>
|
|
142
|
+
</Card>
|
|
143
|
+
|
|
144
|
+
{/* Footer */}
|
|
145
|
+
<div className="text-center text-sm text-muted-foreground pt-4">
|
|
146
|
+
<p>Happy coding! 🎉</p>
|
|
147
|
+
<p className="mt-1">
|
|
148
|
+
Created with <span className="text-red-500">♥</span> using Solazah CLI
|
|
149
|
+
</p>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react",
|
|
3
|
+
"displayName": "React",
|
|
4
|
+
"description": "React 19 + TypeScript + Vite + Tailwind CSS",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"features": [
|
|
7
|
+
"React 19 with TypeScript",
|
|
8
|
+
"Vite 5 build system",
|
|
9
|
+
"Tailwind CSS 4",
|
|
10
|
+
"shadcn/ui components",
|
|
11
|
+
"Valtio state management",
|
|
12
|
+
"React Router",
|
|
13
|
+
"React Hook Form + Zod"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"noUncheckedSideEffectImports": true
|
|
23
|
+
},
|
|
24
|
+
"include": ["src"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": [
|
|
5
|
+
"ES2023"
|
|
6
|
+
],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
/* Linting */
|
|
16
|
+
"strict": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": true,
|
|
19
|
+
"noFallthroughCasesInSwitch": true,
|
|
20
|
+
"noUncheckedSideEffectImports": true
|
|
21
|
+
},
|
|
22
|
+
"include": [
|
|
23
|
+
"vite.config.ts"
|
|
24
|
+
]
|
|
25
|
+
}
|