create-project-template-cli 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/README.md +5 -0
- package/index.js +133 -0
- package/package.json +33 -0
- package/template/react-shadcn/.husky/commit-msg +4 -0
- package/template/react-shadcn/.husky/pre-commit +1 -0
- package/template/react-shadcn/.stylelintignore +20 -0
- package/template/react-shadcn/.stylelintrc.cjs +258 -0
- package/template/react-shadcn/.vscode/extensions.json +7 -0
- package/template/react-shadcn/README.md +75 -0
- package/template/react-shadcn/commitlint.config.cjs +90 -0
- package/template/react-shadcn/components.json +22 -0
- package/template/react-shadcn/eslint.config.js +58 -0
- package/template/react-shadcn/index.html +13 -0
- package/template/react-shadcn/lint-staged.config.cjs +4 -0
- package/template/react-shadcn/package.json +62 -0
- package/template/react-shadcn/pnpm-lock.yaml +4514 -0
- package/template/react-shadcn/public/vite.svg +1 -0
- package/template/react-shadcn/src/App.css +23 -0
- package/template/react-shadcn/src/App.tsx +20 -0
- package/template/react-shadcn/src/assets/css/tailwindcss.css +120 -0
- package/template/react-shadcn/src/assets/react.svg +1 -0
- package/template/react-shadcn/src/components/ui/button.tsx +58 -0
- package/template/react-shadcn/src/components/ui/card.tsx +92 -0
- package/template/react-shadcn/src/components/ui/input.tsx +21 -0
- package/template/react-shadcn/src/components/ui/label.tsx +22 -0
- package/template/react-shadcn/src/components/ui/navigation-menu.tsx +168 -0
- package/template/react-shadcn/src/lib/utils.ts +6 -0
- package/template/react-shadcn/src/main.tsx +11 -0
- package/template/react-shadcn/src/router/index.tsx +71 -0
- package/template/react-shadcn/src/views/404/index.scss +133 -0
- package/template/react-shadcn/src/views/404/index.tsx +27 -0
- package/template/react-shadcn/src/views/Index/index.tsx +8 -0
- package/template/react-shadcn/src/views/index.tsx +59 -0
- package/template/react-shadcn/tsconfig.app.json +33 -0
- package/template/react-shadcn/tsconfig.json +13 -0
- package/template/react-shadcn/tsconfig.node.json +32 -0
- package/template/react-shadcn/vite.config.ts +36 -0
- package/template/vue-tailwindcss/.editorconfig +8 -0
- package/template/vue-tailwindcss/.eslintrc-auto-import.json +76 -0
- package/template/vue-tailwindcss/.gitattributes +1 -0
- package/template/vue-tailwindcss/.prettierrc.json +6 -0
- package/template/vue-tailwindcss/.vscode/extensions.json +9 -0
- package/template/vue-tailwindcss/README.md +2 -0
- package/template/vue-tailwindcss/env.d.ts +1 -0
- package/template/vue-tailwindcss/eslint.config.ts +90 -0
- package/template/vue-tailwindcss/index.html +13 -0
- package/template/vue-tailwindcss/package.json +53 -0
- package/template/vue-tailwindcss/pnpm-lock.yaml +5021 -0
- package/template/vue-tailwindcss/public/favicon.ico +0 -0
- package/template/vue-tailwindcss/src/App.vue +83 -0
- package/template/vue-tailwindcss/src/assets/base.css +86 -0
- package/template/vue-tailwindcss/src/assets/logo.svg +1 -0
- package/template/vue-tailwindcss/src/assets/main.css +10 -0
- package/template/vue-tailwindcss/src/auto-import.d.ts +71 -0
- package/template/vue-tailwindcss/src/axios/index.ts +107 -0
- package/template/vue-tailwindcss/src/components.d.ts +22 -0
- package/template/vue-tailwindcss/src/main.ts +14 -0
- package/template/vue-tailwindcss/src/router/index.ts +23 -0
- package/template/vue-tailwindcss/src/stores/counter.ts +12 -0
- package/template/vue-tailwindcss/src/views/AboutView.vue +15 -0
- package/template/vue-tailwindcss/src/views/HomeView.vue +7 -0
- package/template/vue-tailwindcss/src/vite-env.d.ts +6 -0
- package/template/vue-tailwindcss/tsconfig.app.json +14 -0
- package/template/vue-tailwindcss/tsconfig.json +14 -0
- package/template/vue-tailwindcss/tsconfig.node.json +34 -0
- package/template/vue-tailwindcss/tsconfig.vitest.json +11 -0
- package/template/vue-tailwindcss/vite.config.ts +33 -0
- package/template/vue-tailwindcss/vitest.config.ts +14 -0
- package/utils.js +73 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
.error-container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
max-width: 600px;
|
|
4
|
+
margin: auto;
|
|
5
|
+
margin-top: 20px;
|
|
6
|
+
padding: 60px 30px;
|
|
7
|
+
border-radius: 12px;
|
|
8
|
+
background: #fff;
|
|
9
|
+
box-shadow: 0 8px 32px rgb(0 0 0 / 8%);
|
|
10
|
+
text-align: center;
|
|
11
|
+
transition: transform 0.3s ease;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.error-container:hover {
|
|
15
|
+
transform: translateY(-5px);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.error-code {
|
|
19
|
+
position: relative;
|
|
20
|
+
margin-bottom: 20px;
|
|
21
|
+
color: #3498db;
|
|
22
|
+
font-weight: 700;
|
|
23
|
+
font-size: 8rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.error-code::after {
|
|
27
|
+
content: "";
|
|
28
|
+
position: absolute;
|
|
29
|
+
bottom: -10px;
|
|
30
|
+
left: 50%;
|
|
31
|
+
width: 80px;
|
|
32
|
+
height: 4px;
|
|
33
|
+
border-radius: 2px;
|
|
34
|
+
background: #3498db;
|
|
35
|
+
transform: translateX(-50%);
|
|
36
|
+
animation: line-pulse 2s infinite;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.error-title {
|
|
40
|
+
margin-bottom: 15px;
|
|
41
|
+
color: #2c3e50;
|
|
42
|
+
font-size: 1.8rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.error-desc {
|
|
46
|
+
margin-bottom: 30px;
|
|
47
|
+
color: #7f8c8d;
|
|
48
|
+
font-size: 1rem;
|
|
49
|
+
line-height: 1.6;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.btn-group {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-wrap: wrap;
|
|
55
|
+
gap: 15px;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.btn {
|
|
60
|
+
padding: 12px 24px;
|
|
61
|
+
border: none;
|
|
62
|
+
border-radius: 6px;
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
font-size: 1rem;
|
|
65
|
+
text-decoration: none;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
transition: all 0.3s ease;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.btn-back {
|
|
71
|
+
background-color: #3498db;
|
|
72
|
+
color: #fff;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.btn-back:hover {
|
|
76
|
+
background-color: #2980b9;
|
|
77
|
+
transform: translateY(-2px);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.btn-home {
|
|
81
|
+
border: 1px solid #3498db;
|
|
82
|
+
background-color: #fff;
|
|
83
|
+
color: #3498db;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.btn-home:hover {
|
|
87
|
+
background-color: #f0f7ff;
|
|
88
|
+
transform: translateY(-2px);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@keyframes line-pulse {
|
|
92
|
+
0% {
|
|
93
|
+
width: 80px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
50% {
|
|
97
|
+
width: 120px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
100% {
|
|
101
|
+
width: 80px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* 移动端适配 */
|
|
106
|
+
@media (width <= 768px) {
|
|
107
|
+
.error-code {
|
|
108
|
+
font-size: 6rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.error-title {
|
|
112
|
+
font-size: 1.5rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.error-container {
|
|
116
|
+
padding: 40px 20px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@media (width <= 480px) {
|
|
121
|
+
.error-code {
|
|
122
|
+
font-size: 4.5rem;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.btn-group {
|
|
126
|
+
flex-direction: column;
|
|
127
|
+
gap: 10px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.btn {
|
|
131
|
+
width: 100%;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import './index.scss';
|
|
2
|
+
import { useNavigate } from 'react-router-dom';
|
|
3
|
+
function NotFound() {
|
|
4
|
+
const navigate = useNavigate();
|
|
5
|
+
const change = () => {
|
|
6
|
+
|
|
7
|
+
};
|
|
8
|
+
// 跳转到首页
|
|
9
|
+
const indexUrl = () => {
|
|
10
|
+
navigate('/');
|
|
11
|
+
};
|
|
12
|
+
return (
|
|
13
|
+
<div className="error-container">
|
|
14
|
+
<div className="error-code">404</div>
|
|
15
|
+
<h1 className="error-title">页面好像迷路了</h1>
|
|
16
|
+
<p className="error-desc">
|
|
17
|
+
很抱歉,你访问的页面不存在、已被删除或暂时无法访问<br ></br>
|
|
18
|
+
可能是链接错误,也可能是页面已迁移到其他地址
|
|
19
|
+
</p>
|
|
20
|
+
<div className="btn-group">
|
|
21
|
+
<button className="btn btn-back" onClick={change}>返回上一页</button>
|
|
22
|
+
<button className="btn btn-home" onClick={indexUrl}>返回首页</button>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
export default NotFound;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Outlet } from 'react-router-dom';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import {
|
|
4
|
+
NavigationMenu,
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
NavigationMenuItem,
|
|
8
|
+
NavigationMenuLink,
|
|
9
|
+
NavigationMenuList,
|
|
10
|
+
navigationMenuTriggerStyle
|
|
11
|
+
|
|
12
|
+
} from "@/components/ui/navigation-menu";
|
|
13
|
+
import { useNavigate } from 'react-router-dom';
|
|
14
|
+
const navItems = [
|
|
15
|
+
{
|
|
16
|
+
label: '首页',
|
|
17
|
+
path: '/',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: '直播',
|
|
21
|
+
path: '/live',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: '设备',
|
|
25
|
+
path: '/device',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
function ROOT() {
|
|
30
|
+
const navigate = useNavigate();
|
|
31
|
+
const [currentPath, setCurrentPath] = useState('/');
|
|
32
|
+
const setCurrentPaths = (path: string) => {
|
|
33
|
+
setCurrentPath(path);
|
|
34
|
+
console.log(path);
|
|
35
|
+
// 跳转
|
|
36
|
+
// router.navigate(path);
|
|
37
|
+
navigate(path);
|
|
38
|
+
};
|
|
39
|
+
return (
|
|
40
|
+
<div>
|
|
41
|
+
<nav className='nav '>
|
|
42
|
+
<NavigationMenu>
|
|
43
|
+
<NavigationMenuList>
|
|
44
|
+
<NavigationMenuItem>
|
|
45
|
+
|
|
46
|
+
{navItems.map((item) => (
|
|
47
|
+
<NavigationMenuLink asChild key={item.path} >
|
|
48
|
+
<div className={`${navigationMenuTriggerStyle()} cursor-pointer py-6`} onClick={() => setCurrentPaths(item.path)}>{item.label}</div>
|
|
49
|
+
</NavigationMenuLink>
|
|
50
|
+
))}
|
|
51
|
+
</NavigationMenuItem>
|
|
52
|
+
</NavigationMenuList>
|
|
53
|
+
</NavigationMenu>
|
|
54
|
+
</nav>
|
|
55
|
+
<div className='content'><Outlet /></div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
export default ROOT;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"types": ["vite/client"],
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
|
|
11
|
+
/* Bundler mode */
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"moduleDetection": "force",
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
|
|
19
|
+
/* Linting */
|
|
20
|
+
"strict": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"erasableSyntaxOnly": false,
|
|
24
|
+
"noFallthroughCasesInSwitch": true,
|
|
25
|
+
"noUncheckedSideEffectImports": true,
|
|
26
|
+
"ignoreDeprecations": "6.0",
|
|
27
|
+
"baseUrl": ".",
|
|
28
|
+
"paths": {
|
|
29
|
+
"@/*": ["./src/*"]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"include": ["src"]
|
|
33
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"types": [],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
"jsx": "react-jsx", // 支持 React 17+ 的 JSX 转换,
|
|
18
|
+
/* Linting */
|
|
19
|
+
"strict": true,
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"erasableSyntaxOnly": false,
|
|
23
|
+
"noFallthroughCasesInSwitch": true,
|
|
24
|
+
"noUncheckedSideEffectImports": true,
|
|
25
|
+
"ignoreDeprecations": "6.0",
|
|
26
|
+
"baseUrl": ".",
|
|
27
|
+
"paths": {
|
|
28
|
+
"@/*": ["./src/*"]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"include": ["vite.config.ts"]
|
|
32
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import react from "@vitejs/plugin-react";
|
|
4
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
5
|
+
import { codeInspectorPlugin } from "code-inspector-plugin";
|
|
6
|
+
// https://vite.dev/config/
|
|
7
|
+
export default defineConfig(({ mode }) => {
|
|
8
|
+
return {
|
|
9
|
+
plugins: [
|
|
10
|
+
tailwindcss(),
|
|
11
|
+
react({
|
|
12
|
+
babel: {
|
|
13
|
+
plugins: [["babel-plugin-react-compiler"]],
|
|
14
|
+
},
|
|
15
|
+
}),
|
|
16
|
+
codeInspectorPlugin({
|
|
17
|
+
bundler: "vite",
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
20
|
+
resolve: {
|
|
21
|
+
alias: {
|
|
22
|
+
"@": path.resolve(__dirname, "./src"),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
build: {
|
|
26
|
+
minify: "terser",
|
|
27
|
+
terserOptions: {
|
|
28
|
+
compress: {
|
|
29
|
+
drop_console: mode !== "development",
|
|
30
|
+
drop_debugger: true,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
} as any,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
console.log("\x1b[36m%s\x1b[0m", "{^_^} 启动成功了哦!");
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"globals": {
|
|
3
|
+
"Component": true,
|
|
4
|
+
"ComponentPublicInstance": true,
|
|
5
|
+
"ComputedRef": true,
|
|
6
|
+
"DirectiveBinding": true,
|
|
7
|
+
"EffectScope": true,
|
|
8
|
+
"ExtractDefaultPropTypes": true,
|
|
9
|
+
"ExtractPropTypes": true,
|
|
10
|
+
"ExtractPublicPropTypes": true,
|
|
11
|
+
"InjectionKey": true,
|
|
12
|
+
"MaybeRef": true,
|
|
13
|
+
"MaybeRefOrGetter": true,
|
|
14
|
+
"PropType": true,
|
|
15
|
+
"Ref": true,
|
|
16
|
+
"Slot": true,
|
|
17
|
+
"Slots": true,
|
|
18
|
+
"VNode": true,
|
|
19
|
+
"WritableComputedRef": true,
|
|
20
|
+
"computed": true,
|
|
21
|
+
"createApp": true,
|
|
22
|
+
"customRef": true,
|
|
23
|
+
"defineAsyncComponent": true,
|
|
24
|
+
"defineComponent": true,
|
|
25
|
+
"effectScope": true,
|
|
26
|
+
"getCurrentInstance": true,
|
|
27
|
+
"getCurrentScope": true,
|
|
28
|
+
"h": true,
|
|
29
|
+
"inject": true,
|
|
30
|
+
"isProxy": true,
|
|
31
|
+
"isReactive": true,
|
|
32
|
+
"isReadonly": true,
|
|
33
|
+
"isRef": true,
|
|
34
|
+
"markRaw": true,
|
|
35
|
+
"nextTick": true,
|
|
36
|
+
"onActivated": true,
|
|
37
|
+
"onBeforeMount": true,
|
|
38
|
+
"onBeforeUnmount": true,
|
|
39
|
+
"onBeforeUpdate": true,
|
|
40
|
+
"onDeactivated": true,
|
|
41
|
+
"onErrorCaptured": true,
|
|
42
|
+
"onMounted": true,
|
|
43
|
+
"onRenderTracked": true,
|
|
44
|
+
"onRenderTriggered": true,
|
|
45
|
+
"onScopeDispose": true,
|
|
46
|
+
"onServerPrefetch": true,
|
|
47
|
+
"onUnmounted": true,
|
|
48
|
+
"onUpdated": true,
|
|
49
|
+
"onWatcherCleanup": true,
|
|
50
|
+
"provide": true,
|
|
51
|
+
"reactive": true,
|
|
52
|
+
"readonly": true,
|
|
53
|
+
"ref": true,
|
|
54
|
+
"resolveComponent": true,
|
|
55
|
+
"shallowReactive": true,
|
|
56
|
+
"shallowReadonly": true,
|
|
57
|
+
"shallowRef": true,
|
|
58
|
+
"toRaw": true,
|
|
59
|
+
"toRef": true,
|
|
60
|
+
"toRefs": true,
|
|
61
|
+
"toValue": true,
|
|
62
|
+
"triggerRef": true,
|
|
63
|
+
"unref": true,
|
|
64
|
+
"useAttrs": true,
|
|
65
|
+
"useCssModule": true,
|
|
66
|
+
"useCssVars": true,
|
|
67
|
+
"useId": true,
|
|
68
|
+
"useModel": true,
|
|
69
|
+
"useSlots": true,
|
|
70
|
+
"useTemplateRef": true,
|
|
71
|
+
"watch": true,
|
|
72
|
+
"watchEffect": true,
|
|
73
|
+
"watchPostEffect": true,
|
|
74
|
+
"watchSyncEffect": true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* text=auto eol=lf
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { globalIgnores } from 'eslint/config'
|
|
2
|
+
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
|
3
|
+
import pluginVue from 'eslint-plugin-vue'
|
|
4
|
+
import pluginVitest from '@vitest/eslint-plugin'
|
|
5
|
+
|
|
6
|
+
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
|
7
|
+
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
|
8
|
+
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
|
|
9
|
+
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
|
|
10
|
+
|
|
11
|
+
export default defineConfigWithVueTs(
|
|
12
|
+
{
|
|
13
|
+
name: 'app/files-to-lint',
|
|
14
|
+
files: ['**/*.{ts,mts,tsx,vue}'],
|
|
15
|
+
},
|
|
16
|
+
// 忽略src/assets/images文件和svg
|
|
17
|
+
|
|
18
|
+
globalIgnores([
|
|
19
|
+
'**/dist/**',
|
|
20
|
+
'**/dist-ssr/**',
|
|
21
|
+
'**/coverage/**',
|
|
22
|
+
'**/node_modules/**',
|
|
23
|
+
'**/.history/**',
|
|
24
|
+
'**/src/assets/images/**',
|
|
25
|
+
'**/src/assets/images/**/*.svg',
|
|
26
|
+
]),
|
|
27
|
+
|
|
28
|
+
pluginVue.configs['flat/essential'],
|
|
29
|
+
vueTsConfigs.recommended,
|
|
30
|
+
|
|
31
|
+
{
|
|
32
|
+
...pluginVitest.configs.recommended,
|
|
33
|
+
files: ['src/**/__tests__/*'],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
rules: {
|
|
37
|
+
// vue文件名不需要驼峰
|
|
38
|
+
'vue/filename-casing': 'off',
|
|
39
|
+
'vue/multi-word-component-names': 'off', // 关闭组件名称必须是多词的规则
|
|
40
|
+
// 不允许使用var
|
|
41
|
+
'no-var': 'error',
|
|
42
|
+
// 未使用的变量
|
|
43
|
+
'no-unused-vars': [
|
|
44
|
+
'error',
|
|
45
|
+
{
|
|
46
|
+
argsIgnorePattern: '^_', // 忽略以下划线开头的未使用变量
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
// 常量必须const
|
|
50
|
+
'prefer-const': 'error',
|
|
51
|
+
// 必须每一行末尾有分号
|
|
52
|
+
// semi: ['error', 'always'],
|
|
53
|
+
// 圈复杂度
|
|
54
|
+
complexity: ['error', 15],
|
|
55
|
+
// "no-undef": "off", //由于eslint无法识别.d.ts声明文件中定义的变量,暂时关闭
|
|
56
|
+
// 允许使用any
|
|
57
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
58
|
+
// 不允许在条件判断中用复制运算符
|
|
59
|
+
'no-cond-assign': 'error',
|
|
60
|
+
// 限制换行必须是LF
|
|
61
|
+
'linebreak-style': ['error', 'unix'],
|
|
62
|
+
// 标签属性按照顺序
|
|
63
|
+
'vue/attributes-order': [
|
|
64
|
+
'error',
|
|
65
|
+
{
|
|
66
|
+
order: [
|
|
67
|
+
'DEFINITION', // `is` 和 `v-is`
|
|
68
|
+
'LIST_RENDERING', // 列表渲染
|
|
69
|
+
'CONDITIONALS', // 条件渲染
|
|
70
|
+
'RENDER_MODIFIERS', // 渲染修饰符
|
|
71
|
+
'GLOBAL', // 全局属性
|
|
72
|
+
'UNIQUE', // 唯一属性
|
|
73
|
+
'TWO_WAY_BINDING', // 双向绑定
|
|
74
|
+
'OTHER_DIRECTIVES', // 其他指令
|
|
75
|
+
'OTHER_ATTR', // 其他属性
|
|
76
|
+
'EVENTS', // 事件
|
|
77
|
+
'CONTENT', // 内容
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
)
|
|
84
|
+
/**
|
|
85
|
+
* {
|
|
86
|
+
"rules": {
|
|
87
|
+
"no-cond-assign": "error"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<link rel="icon" href="/favicon.ico">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Vite App</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vue-tailwindcss",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "vite",
|
|
11
|
+
"build": "run-p type-check \"build-only {@}\" --",
|
|
12
|
+
"preview": "vite preview",
|
|
13
|
+
"test:unit": "vitest",
|
|
14
|
+
"build-only": "vite build",
|
|
15
|
+
"type-check": "vue-tsc --build",
|
|
16
|
+
"lint": "eslint --ignore-pattern dist/ --ignore-pattern .history --debug",
|
|
17
|
+
"eslint:fix": "eslint . --fix",
|
|
18
|
+
"format": "prettier --write src/"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"axios": "^1.12.2",
|
|
22
|
+
"lodash-es": "^4.17.21",
|
|
23
|
+
"pinia": "^3.0.3",
|
|
24
|
+
"vue": "^3.5.18",
|
|
25
|
+
"vue-router": "^4.5.1"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@tailwindcss/vite": "^4.1.13",
|
|
29
|
+
"@tsconfig/node22": "^22.0.2",
|
|
30
|
+
"@types/jsdom": "^21.1.7",
|
|
31
|
+
"@types/node": "^22.16.5",
|
|
32
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
33
|
+
"@vitest/eslint-plugin": "^1.3.4",
|
|
34
|
+
"@vue/eslint-config-prettier": "^10.2.0",
|
|
35
|
+
"@vue/eslint-config-typescript": "^14.6.0",
|
|
36
|
+
"@vue/test-utils": "^2.4.6",
|
|
37
|
+
"@vue/tsconfig": "^0.7.0",
|
|
38
|
+
"eslint": "^9.31.0",
|
|
39
|
+
"eslint-plugin-vue": "~10.3.0",
|
|
40
|
+
"jiti": "^2.4.2",
|
|
41
|
+
"jsdom": "^26.1.0",
|
|
42
|
+
"npm-run-all2": "^8.0.4",
|
|
43
|
+
"prettier": "3.6.2",
|
|
44
|
+
"sass": "^1.89.2",
|
|
45
|
+
"tailwindcss": "^4.1.13",
|
|
46
|
+
"typescript": "~5.8.0",
|
|
47
|
+
"unplugin-auto-import": "^19.3.0",
|
|
48
|
+
"vite": "^7.0.6",
|
|
49
|
+
"vite-plugin-vue-devtools": "^8.0.0",
|
|
50
|
+
"vitest": "^3.2.4",
|
|
51
|
+
"vue-tsc": "^3.0.4"
|
|
52
|
+
}
|
|
53
|
+
}
|