wanzhuang-cli 1.0.5 → 1.0.7
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 +0 -10
- package/dist/commands/create.js +50 -37
- package/dist/utils/template.js +6 -0
- package/package.json +8 -3
- package/templates/react/src/App.css +42 -0
- package/templates/react/src/App.jsx +35 -0
- package/templates/react/src/assets/react.svg +1 -0
- package/templates/react/src/index.css +68 -0
- package/templates/react/src/main.jsx +10 -0
- package/templates/uniapp/.commitlintrc.cjs +106 -0
- package/templates/uniapp/.editorconfig +13 -0
- package/templates/uniapp/.eslintignore +1 -0
- package/templates/uniapp/.eslintrc-auto-import.json +101 -0
- package/templates/uniapp/.eslintrc.cjs +97 -0
- package/templates/uniapp/.prettierignore +9 -0
- package/templates/uniapp/.prettierrc.cjs +19 -0
- package/templates/uniapp/.stylelintignore +1 -0
- package/templates/uniapp/.stylelintrc.cjs +58 -0
- package/templates/uniapp/.vscode/extensions.json +17 -0
- package/templates/uniapp/.vscode/settings.json +65 -0
- package/templates/uniapp/.vscode/vue3.code-snippets +56 -0
- package/templates/uniapp/LICENSE +21 -0
- package/templates/uniapp/README.md +78 -0
- package/templates/uniapp/env/.env +15 -0
- package/templates/uniapp/env/.env.development +6 -0
- package/templates/uniapp/env/.env.production +6 -0
- package/templates/uniapp/env/.env.test +4 -0
- package/templates/uniapp/favicon.ico +0 -0
- package/templates/uniapp/index.html +13 -7
- package/templates/uniapp/manifest.config.ts +134 -0
- package/templates/uniapp/package.json +119 -31
- package/templates/uniapp/pages.config.ts +43 -0
- package/templates/uniapp/scripts/postupgrade.js +36 -0
- package/templates/uniapp/src/App.vue +58 -0
- package/templates/uniapp/src/components/.gitkeep +0 -0
- package/templates/uniapp/src/env.d.ts +31 -0
- package/templates/uniapp/src/hooks/.gitkeep +0 -0
- package/templates/uniapp/src/hooks/useRequest.ts +44 -0
- package/templates/uniapp/src/hooks/useUpload.ts +67 -0
- package/templates/uniapp/src/interceptors/index.ts +3 -0
- package/templates/uniapp/src/interceptors/prototype.ts +13 -0
- package/templates/uniapp/src/interceptors/request.ts +67 -0
- package/templates/uniapp/src/interceptors/route.ts +53 -0
- package/templates/uniapp/src/layouts/default.vue +17 -0
- package/templates/uniapp/src/layouts/demo.vue +17 -0
- package/templates/uniapp/src/main.ts +17 -0
- package/templates/uniapp/src/manifest.json +117 -0
- package/templates/uniapp/src/pages/about/about.vue +30 -0
- package/templates/uniapp/src/pages/about/components/request.vue +21 -0
- package/templates/uniapp/src/pages/index/index.vue +53 -0
- package/templates/uniapp/src/pages-sub/demo/index.vue +20 -0
- package/templates/uniapp/src/pages.json +58 -0
- package/templates/uniapp/src/service/index/foo.ts +15 -0
- package/templates/uniapp/src/static/app/icons/1024x1024.png +0 -0
- package/templates/uniapp/src/static/app/icons/120x120.png +0 -0
- package/templates/uniapp/src/static/app/icons/144x144.png +0 -0
- package/templates/uniapp/src/static/app/icons/152x152.png +0 -0
- package/templates/uniapp/src/static/app/icons/167x167.png +0 -0
- package/templates/uniapp/src/static/app/icons/180x180.png +0 -0
- package/templates/uniapp/src/static/app/icons/192x192.png +0 -0
- package/templates/uniapp/src/static/app/icons/20x20.png +0 -0
- package/templates/uniapp/src/static/app/icons/29x29.png +0 -0
- package/templates/uniapp/src/static/app/icons/40x40.png +0 -0
- package/templates/uniapp/src/static/app/icons/58x58.png +0 -0
- package/templates/uniapp/src/static/app/icons/60x60.png +0 -0
- package/templates/uniapp/src/static/app/icons/72x72.png +0 -0
- package/templates/uniapp/src/static/app/icons/76x76.png +0 -0
- package/templates/uniapp/src/static/app/icons/80x80.png +0 -0
- package/templates/uniapp/src/static/app/icons/87x87.png +0 -0
- package/templates/uniapp/src/static/app/icons/96x96.png +0 -0
- package/templates/uniapp/src/static/images/.gitkeep +0 -0
- package/templates/uniapp/src/static/logo.svg +33 -0
- package/templates/uniapp/src/static/tabbar/example.png +0 -0
- package/templates/uniapp/src/static/tabbar/exampleHL.png +0 -0
- package/templates/uniapp/src/static/tabbar/home.png +0 -0
- package/templates/uniapp/src/static/tabbar/homeHL.png +0 -0
- package/templates/uniapp/src/static/tabbar/personal.png +0 -0
- package/templates/uniapp/src/static/tabbar/personalHL.png +0 -0
- package/templates/uniapp/src/store/index.ts +17 -0
- package/templates/uniapp/src/store/user.ts +35 -0
- package/templates/uniapp/src/style/iconfont.css +28 -0
- package/templates/uniapp/src/style/index.scss +18 -0
- package/templates/uniapp/src/types/auto-import.d.ts +187 -0
- package/templates/uniapp/src/types/global.d.ts +16 -0
- package/templates/uniapp/src/types/shims-uni.d.ts +8 -0
- package/templates/uniapp/src/types/uni-pages.d.ts +23 -0
- package/templates/uniapp/src/typings.ts +29 -0
- package/templates/uniapp/src/uni.scss +77 -0
- package/templates/uniapp/src/uni_modules/.gitkeep +0 -0
- package/templates/uniapp/src/utils/http.ts +80 -0
- package/templates/uniapp/src/utils/index.ts +113 -0
- package/templates/uniapp/src/utils/platform.ts +17 -0
- package/templates/uniapp/tsconfig.json +34 -0
- package/templates/uniapp/uno.config.ts +89 -0
- package/templates/uniapp/vite.config.ts +158 -0
- package/templates/vue/src/App.vue +30 -0
- package/templates/vue/src/assets/vue.svg +1 -0
- package/templates/vue/src/components/HelloWorld.vue +43 -0
- package/templates/vue/src/main.js +5 -0
- package/templates/vue/src/style.css +79 -0
- package/templates/uniapp/shims-uni.d.ts +0 -10
- package/templates/uniapp/vite.config.js +0 -8
package/README.md
CHANGED
|
@@ -80,21 +80,11 @@ wz update
|
|
|
80
80
|
|
|
81
81
|
### UniApp 模板
|
|
82
82
|
|
|
83
|
-
跨平台开发框架,支持编译到多端:
|
|
84
|
-
|
|
85
83
|
| 技术栈 | 版本 |
|
|
86
84
|
| ------ | ------- |
|
|
87
85
|
| Vue | ^3.4.21 |
|
|
88
86
|
| Vite | 5.2.8 |
|
|
89
87
|
|
|
90
|
-
支持平台:
|
|
91
|
-
|
|
92
|
-
| 平台 | 命令 |
|
|
93
|
-
| ------------ | -------------------- |
|
|
94
|
-
| H5 | `pnpm dev:h5` |
|
|
95
|
-
| 微信小程序 | `pnpm dev:mp-weixin` |
|
|
96
|
-
| 支付宝小程序 | `pnpm dev:mp-alipay` |
|
|
97
|
-
|
|
98
88
|
## 命令一览
|
|
99
89
|
|
|
100
90
|
| 命令 | 说明 | 选项 |
|
package/dist/commands/create.js
CHANGED
|
@@ -102,32 +102,42 @@ async function createProject(projectName, options) {
|
|
|
102
102
|
]);
|
|
103
103
|
template = answer.template;
|
|
104
104
|
}
|
|
105
|
-
// 4.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
105
|
+
// 4. 交互多选功能(uniapp 模板已内置所有功能,跳过选择)
|
|
106
|
+
let features = [];
|
|
107
|
+
if (template === 'uniapp') {
|
|
108
|
+
// unibest 模板已内置 TypeScript、Prettier、ESLint、UnoCSS
|
|
109
|
+
features = ['typescript', 'prettier', 'eslint', 'unocss'];
|
|
110
|
+
console.log(chalk_1.default.cyan('unibest 模板已内置:'), 'TypeScript, Prettier, ESLint, UnoCSS');
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const answer = await inquirer_1.default.prompt([
|
|
114
|
+
{
|
|
115
|
+
name: 'features',
|
|
116
|
+
type: 'checkbox',
|
|
117
|
+
message: '请选择要包含的功能:',
|
|
118
|
+
choices: [
|
|
119
|
+
{ name: 'TypeScript', value: 'typescript' },
|
|
120
|
+
{ name: 'Prettier', value: 'prettier' },
|
|
121
|
+
{ name: 'ESLint', value: 'eslint' },
|
|
122
|
+
{ name: 'UnoCSS', value: 'unocss' },
|
|
123
|
+
{ name: 'Tailwind CSS', value: 'tailwindcss' },
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
]);
|
|
127
|
+
features = answer.features;
|
|
128
|
+
console.log(chalk_1.default.cyan('已选择功能:'), features);
|
|
129
|
+
}
|
|
121
130
|
// 5. 复制模板到目标目录
|
|
122
131
|
await (0, template_1.copyTemplate)(template, targetDir);
|
|
123
|
-
// 6. 类型/文件自动转换(React: jsx->tsx,Vue
|
|
132
|
+
// 6. 类型/文件自动转换(React: jsx->tsx,Vue: js->ts + vue lang="ts")
|
|
133
|
+
// unibest 模板已经是 TypeScript 项目,跳过转换
|
|
124
134
|
const srcDir = (0, path_1.join)(targetDir, 'src');
|
|
125
|
-
if (features.includes('typescript')) {
|
|
135
|
+
if (features.includes('typescript') && template !== 'uniapp') {
|
|
126
136
|
if (template === 'react' && (0, fs_1.existsSync)(srcDir)) {
|
|
127
137
|
(0, fileOps_1.convertExtRecursive)(srcDir, '.jsx', '.tsx');
|
|
128
138
|
(0, fileOps_1.replaceImportExtRecursive)(srcDir, '.jsx', '.tsx');
|
|
129
139
|
}
|
|
130
|
-
if (
|
|
140
|
+
if (template === 'vue' && (0, fs_1.existsSync)(srcDir)) {
|
|
131
141
|
(0, fileOps_1.convertExtRecursive)(srcDir, '.js', '.ts');
|
|
132
142
|
(0, fileOps_1.replaceImportExtRecursive)(srcDir, '.js', '.ts');
|
|
133
143
|
(0, fileOps_1.addLangTsToAllVue)(srcDir);
|
|
@@ -136,18 +146,22 @@ async function createProject(projectName, options) {
|
|
|
136
146
|
(0, fileOps_1.convertViteConfigToTs)(targetDir);
|
|
137
147
|
(0, configGen_1.genTsConfig)(targetDir, template);
|
|
138
148
|
}
|
|
139
|
-
// 7.
|
|
140
|
-
if (
|
|
141
|
-
(
|
|
142
|
-
|
|
143
|
-
(
|
|
144
|
-
|
|
145
|
-
(
|
|
146
|
-
|
|
147
|
-
(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
// 7. 配置文件自动生成(unibest 模板已内置配置,跳过生成)
|
|
150
|
+
if (template !== 'uniapp') {
|
|
151
|
+
if (features.includes('eslint'))
|
|
152
|
+
(0, configGen_1.genEslintConfig)(targetDir, template, features);
|
|
153
|
+
if (features.includes('prettier'))
|
|
154
|
+
(0, configGen_1.genPrettierConfig)(targetDir);
|
|
155
|
+
if (features.includes('unocss'))
|
|
156
|
+
(0, configGen_1.genUnoConfig)(targetDir);
|
|
157
|
+
if (features.includes('tailwindcss'))
|
|
158
|
+
(0, configGen_1.genTailwindConfig)(targetDir);
|
|
159
|
+
}
|
|
160
|
+
// 8. 安装开发依赖(unibest 模板已有完整依赖,跳过)
|
|
161
|
+
if (template !== 'uniapp') {
|
|
162
|
+
const devDeps = (0, deps_1.getDevDeps)(template, features);
|
|
163
|
+
(0, deps_1.installDevDeps)(targetDir, devDeps);
|
|
164
|
+
}
|
|
151
165
|
// 9. 进度提示与最终依赖安装
|
|
152
166
|
const spinner = (0, ora_1.default)('正在创建项目...').start();
|
|
153
167
|
try {
|
|
@@ -161,12 +175,11 @@ async function createProject(projectName, options) {
|
|
|
161
175
|
if (template === 'uniapp') {
|
|
162
176
|
console.log('\n开始使用:');
|
|
163
177
|
console.log(` cd ${projectName}`);
|
|
164
|
-
console.log(' #
|
|
165
|
-
console.log(' #
|
|
166
|
-
console.log(' pnpm
|
|
167
|
-
console.log(' pnpm
|
|
168
|
-
console.log(' pnpm build:mp-weixin
|
|
169
|
-
console.log(' pnpm dev:mp-weixin # 运行微信小程序');
|
|
178
|
+
console.log(' pnpm dev # 运行 H5');
|
|
179
|
+
console.log(' pnpm dev:mp-weixin # 运行微信小程序');
|
|
180
|
+
console.log(' pnpm dev:mp-alipay # 运行支付宝小程序');
|
|
181
|
+
console.log(' pnpm build:h5 # 打包 H5');
|
|
182
|
+
console.log(' pnpm build:mp-weixin # 打包微信小程序');
|
|
170
183
|
}
|
|
171
184
|
else {
|
|
172
185
|
console.log('\n开始使用:');
|
package/dist/utils/template.js
CHANGED
|
@@ -26,6 +26,12 @@ async function updatePackageJson(targetDir, projectName) {
|
|
|
26
26
|
packageJson.name = projectName;
|
|
27
27
|
packageJson.version = '1.0.0';
|
|
28
28
|
packageJson.description = `${projectName} - 基于万桩UI组件库的项目`;
|
|
29
|
+
// 移除 unibest 模板的特定字段
|
|
30
|
+
delete packageJson.author;
|
|
31
|
+
delete packageJson.repository;
|
|
32
|
+
delete packageJson['repository-gitee'];
|
|
33
|
+
delete packageJson.bugs;
|
|
34
|
+
delete packageJson.homepage;
|
|
29
35
|
// 将更新后的内容写入文件
|
|
30
36
|
(0, fs_1.writeFileSync)(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
31
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wanzhuang-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "万桩项目脚手架工具",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"build": "rimraf dist && tsc",
|
|
12
12
|
"test": "vitest",
|
|
13
13
|
"lint": "eslint src --ext .ts",
|
|
14
|
-
"prepare": "npm run build"
|
|
14
|
+
"prepare": "npm run build",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
15
16
|
},
|
|
16
17
|
"keywords": [
|
|
17
18
|
"cli",
|
|
@@ -40,5 +41,9 @@
|
|
|
40
41
|
},
|
|
41
42
|
"engines": {
|
|
42
43
|
"node": ">=14.0.0"
|
|
43
|
-
}
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"templates"
|
|
48
|
+
]
|
|
44
49
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#root {
|
|
2
|
+
max-width: 1280px;
|
|
3
|
+
margin: 0 auto;
|
|
4
|
+
padding: 2rem;
|
|
5
|
+
text-align: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.logo {
|
|
9
|
+
height: 6em;
|
|
10
|
+
padding: 1.5em;
|
|
11
|
+
will-change: filter;
|
|
12
|
+
transition: filter 300ms;
|
|
13
|
+
}
|
|
14
|
+
.logo:hover {
|
|
15
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
16
|
+
}
|
|
17
|
+
.logo.react:hover {
|
|
18
|
+
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes logo-spin {
|
|
22
|
+
from {
|
|
23
|
+
transform: rotate(0deg);
|
|
24
|
+
}
|
|
25
|
+
to {
|
|
26
|
+
transform: rotate(360deg);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
31
|
+
a:nth-of-type(2) .logo {
|
|
32
|
+
animation: logo-spin infinite 20s linear;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.card {
|
|
37
|
+
padding: 2em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.read-the-docs {
|
|
41
|
+
color: #888;
|
|
42
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import reactLogo from './assets/react.svg'
|
|
3
|
+
import viteLogo from '/vite.svg'
|
|
4
|
+
import './App.css'
|
|
5
|
+
|
|
6
|
+
function App() {
|
|
7
|
+
const [count, setCount] = useState(0)
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<div>
|
|
12
|
+
<a href="https://vite.dev" target="_blank">
|
|
13
|
+
<img src={viteLogo} className="logo" alt="Vite logo" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://react.dev" target="_blank">
|
|
16
|
+
<img src={reactLogo} className="logo react" alt="React logo" />
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
<h1>Vite + React</h1>
|
|
20
|
+
<div className="card">
|
|
21
|
+
<button onClick={() => setCount((count) => count + 1)}>
|
|
22
|
+
count is {count}
|
|
23
|
+
</button>
|
|
24
|
+
<p>
|
|
25
|
+
Edit <code>src/App.jsx</code> and save to test HMR
|
|
26
|
+
</p>
|
|
27
|
+
</div>
|
|
28
|
+
<p className="read-the-docs">
|
|
29
|
+
Click on the Vite and React logos to learn more
|
|
30
|
+
</p>
|
|
31
|
+
</>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default App
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
3
|
+
line-height: 1.5;
|
|
4
|
+
font-weight: 400;
|
|
5
|
+
|
|
6
|
+
color-scheme: light dark;
|
|
7
|
+
color: rgba(255, 255, 255, 0.87);
|
|
8
|
+
background-color: #242424;
|
|
9
|
+
|
|
10
|
+
font-synthesis: none;
|
|
11
|
+
text-rendering: optimizeLegibility;
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
-moz-osx-font-smoothing: grayscale;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
a {
|
|
17
|
+
font-weight: 500;
|
|
18
|
+
color: #646cff;
|
|
19
|
+
text-decoration: inherit;
|
|
20
|
+
}
|
|
21
|
+
a:hover {
|
|
22
|
+
color: #535bf2;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
body {
|
|
26
|
+
margin: 0;
|
|
27
|
+
display: flex;
|
|
28
|
+
place-items: center;
|
|
29
|
+
min-width: 320px;
|
|
30
|
+
min-height: 100vh;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
h1 {
|
|
34
|
+
font-size: 3.2em;
|
|
35
|
+
line-height: 1.1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
button {
|
|
39
|
+
border-radius: 8px;
|
|
40
|
+
border: 1px solid transparent;
|
|
41
|
+
padding: 0.6em 1.2em;
|
|
42
|
+
font-size: 1em;
|
|
43
|
+
font-weight: 500;
|
|
44
|
+
font-family: inherit;
|
|
45
|
+
background-color: #1a1a1a;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
transition: border-color 0.25s;
|
|
48
|
+
}
|
|
49
|
+
button:hover {
|
|
50
|
+
border-color: #646cff;
|
|
51
|
+
}
|
|
52
|
+
button:focus,
|
|
53
|
+
button:focus-visible {
|
|
54
|
+
outline: 4px auto -webkit-focus-ring-color;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@media (prefers-color-scheme: light) {
|
|
58
|
+
:root {
|
|
59
|
+
color: #213547;
|
|
60
|
+
background-color: #ffffff;
|
|
61
|
+
}
|
|
62
|
+
a:hover {
|
|
63
|
+
color: #747bff;
|
|
64
|
+
}
|
|
65
|
+
button {
|
|
66
|
+
background-color: #f9f9f9;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const path = require('path')
|
|
3
|
+
const { execSync } = require('child_process')
|
|
4
|
+
|
|
5
|
+
const scopes = fs
|
|
6
|
+
.readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
|
|
7
|
+
.filter((dirent) => dirent.isDirectory())
|
|
8
|
+
.map((dirent) => dirent.name.replace(/s$/, ''))
|
|
9
|
+
|
|
10
|
+
// precomputed scope
|
|
11
|
+
const scopeComplete = execSync('git status --porcelain || true')
|
|
12
|
+
.toString()
|
|
13
|
+
.trim()
|
|
14
|
+
.split('\n')
|
|
15
|
+
.find((r) => ~r.indexOf('M src'))
|
|
16
|
+
?.replace(/(\/)/g, '%%')
|
|
17
|
+
?.match(/src%%((\w|-)*)/)?.[1]
|
|
18
|
+
?.replace(/s$/, '')
|
|
19
|
+
|
|
20
|
+
module.exports = {
|
|
21
|
+
ignores: [(commit) => commit.includes('init')],
|
|
22
|
+
extends: ['@commitlint/config-conventional'],
|
|
23
|
+
rules: {
|
|
24
|
+
'body-leading-blank': [2, 'always'],
|
|
25
|
+
'footer-leading-blank': [1, 'always'],
|
|
26
|
+
'header-max-length': [2, 'always', 108],
|
|
27
|
+
'subject-empty': [2, 'never'],
|
|
28
|
+
'type-empty': [2, 'never'],
|
|
29
|
+
'subject-case': [0],
|
|
30
|
+
'type-enum': [
|
|
31
|
+
2,
|
|
32
|
+
'always',
|
|
33
|
+
[
|
|
34
|
+
'feat',
|
|
35
|
+
'fix',
|
|
36
|
+
'perf',
|
|
37
|
+
'style',
|
|
38
|
+
'docs',
|
|
39
|
+
'test',
|
|
40
|
+
'refactor',
|
|
41
|
+
'build',
|
|
42
|
+
'ci',
|
|
43
|
+
'chore',
|
|
44
|
+
'revert',
|
|
45
|
+
'wip',
|
|
46
|
+
'workflow',
|
|
47
|
+
'types',
|
|
48
|
+
'release',
|
|
49
|
+
],
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
prompt: {
|
|
53
|
+
/** @use `pnpm commit :f` */
|
|
54
|
+
alias: {
|
|
55
|
+
f: 'docs: fix typos',
|
|
56
|
+
r: 'docs: update README',
|
|
57
|
+
s: 'style: update code format',
|
|
58
|
+
b: 'build: bump dependencies',
|
|
59
|
+
c: 'chore: update config',
|
|
60
|
+
},
|
|
61
|
+
customScopesAlign: !scopeComplete ? 'top' : 'bottom',
|
|
62
|
+
defaultScope: scopeComplete,
|
|
63
|
+
scopes: [...scopes, 'mock'],
|
|
64
|
+
allowEmptyIssuePrefixs: false,
|
|
65
|
+
allowCustomIssuePrefixs: false,
|
|
66
|
+
|
|
67
|
+
// English
|
|
68
|
+
typesAppend: [
|
|
69
|
+
{ value: 'wip', name: 'wip: work in process' },
|
|
70
|
+
{ value: 'workflow', name: 'workflow: workflow improvements' },
|
|
71
|
+
{ value: 'types', name: 'types: type definition file changes' },
|
|
72
|
+
],
|
|
73
|
+
|
|
74
|
+
// 中英文对照版
|
|
75
|
+
// messages: {
|
|
76
|
+
// type: '选择你要提交的类型 :',
|
|
77
|
+
// scope: '选择一个提交范围 (可选):',
|
|
78
|
+
// customScope: '请输入自定义的提交范围 :',
|
|
79
|
+
// subject: '填写简短精炼的变更描述 :\n',
|
|
80
|
+
// body: '填写更加详细的变更描述 (可选)。使用 "|" 换行 :\n',
|
|
81
|
+
// breaking: '列举非兼容性重大的变更 (可选)。使用 "|" 换行 :\n',
|
|
82
|
+
// footerPrefixsSelect: '选择关联issue前缀 (可选):',
|
|
83
|
+
// customFooterPrefixs: '输入自定义issue前缀 :',
|
|
84
|
+
// footer: '列举关联issue (可选) 例如: #31, #I3244 :\n',
|
|
85
|
+
// confirmCommit: '是否提交或修改commit ?',
|
|
86
|
+
// },
|
|
87
|
+
// types: [
|
|
88
|
+
// { value: 'feat', name: 'feat: 新增功能' },
|
|
89
|
+
// { value: 'fix', name: 'fix: 修复缺陷' },
|
|
90
|
+
// { value: 'docs', name: 'docs: 文档变更' },
|
|
91
|
+
// { value: 'style', name: 'style: 代码格式' },
|
|
92
|
+
// { value: 'refactor', name: 'refactor: 代码重构' },
|
|
93
|
+
// { value: 'perf', name: 'perf: 性能优化' },
|
|
94
|
+
// { value: 'test', name: 'test: 添加疏漏测试或已有测试改动' },
|
|
95
|
+
// { value: 'build', name: 'build: 构建流程、外部依赖变更 (如升级 npm 包、修改打包配置等)' },
|
|
96
|
+
// { value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
|
|
97
|
+
// { value: 'revert', name: 'revert: 回滚 commit' },
|
|
98
|
+
// { value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改 (不影响源文件、测试用例)' },
|
|
99
|
+
// { value: 'wip', name: 'wip: 正在开发中' },
|
|
100
|
+
// { value: 'workflow', name: 'workflow: 工作流程改进' },
|
|
101
|
+
// { value: 'types', name: 'types: 类型定义文件修改' },
|
|
102
|
+
// ],
|
|
103
|
+
// emptyScopesAlias: 'empty: 不填写',
|
|
104
|
+
// customScopesAlias: 'custom: 自定义',
|
|
105
|
+
},
|
|
106
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*] # 表示所有文件适用
|
|
4
|
+
charset = utf-8 # 设置文件字符集为 utf-8
|
|
5
|
+
indent_style = space # 缩进风格(tab | space)
|
|
6
|
+
indent_size = 2 # 缩进大小
|
|
7
|
+
end_of_line = lf # 控制换行类型(lf | cr | crlf)
|
|
8
|
+
trim_trailing_whitespace = true # 去除行首的任意空白字符
|
|
9
|
+
insert_final_newline = true # 始终在文件末尾插入一个新行
|
|
10
|
+
|
|
11
|
+
[*.md] # 表示仅 md 文件适用以下规则
|
|
12
|
+
max_line_length = off # 关闭最大行长度限制
|
|
13
|
+
trim_trailing_whitespace = false # 关闭末尾空格修剪
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
src/uni_modules/
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"globals": {
|
|
3
|
+
"Component": true,
|
|
4
|
+
"ComponentPublicInstance": true,
|
|
5
|
+
"ComputedRef": true,
|
|
6
|
+
"EffectScope": true,
|
|
7
|
+
"ExtractDefaultPropTypes": true,
|
|
8
|
+
"ExtractPropTypes": true,
|
|
9
|
+
"ExtractPublicPropTypes": true,
|
|
10
|
+
"InjectionKey": true,
|
|
11
|
+
"PropType": true,
|
|
12
|
+
"Ref": true,
|
|
13
|
+
"VNode": true,
|
|
14
|
+
"WritableComputedRef": true,
|
|
15
|
+
"computed": true,
|
|
16
|
+
"createApp": true,
|
|
17
|
+
"customRef": true,
|
|
18
|
+
"defineAsyncComponent": true,
|
|
19
|
+
"defineComponent": true,
|
|
20
|
+
"effectScope": true,
|
|
21
|
+
"getCurrentInstance": true,
|
|
22
|
+
"getCurrentScope": true,
|
|
23
|
+
"h": true,
|
|
24
|
+
"inject": true,
|
|
25
|
+
"isProxy": true,
|
|
26
|
+
"isReactive": true,
|
|
27
|
+
"isReadonly": true,
|
|
28
|
+
"isRef": true,
|
|
29
|
+
"markRaw": true,
|
|
30
|
+
"nextTick": true,
|
|
31
|
+
"onActivated": true,
|
|
32
|
+
"onAddToFavorites": true,
|
|
33
|
+
"onBackPress": true,
|
|
34
|
+
"onBeforeMount": true,
|
|
35
|
+
"onBeforeUnmount": true,
|
|
36
|
+
"onBeforeUpdate": true,
|
|
37
|
+
"onDeactivated": true,
|
|
38
|
+
"onError": true,
|
|
39
|
+
"onErrorCaptured": true,
|
|
40
|
+
"onHide": true,
|
|
41
|
+
"onLaunch": true,
|
|
42
|
+
"onLoad": true,
|
|
43
|
+
"onMounted": true,
|
|
44
|
+
"onNavigationBarButtonTap": true,
|
|
45
|
+
"onNavigationBarSearchInputChanged": true,
|
|
46
|
+
"onNavigationBarSearchInputClicked": true,
|
|
47
|
+
"onNavigationBarSearchInputConfirmed": true,
|
|
48
|
+
"onNavigationBarSearchInputFocusChanged": true,
|
|
49
|
+
"onPageNotFound": true,
|
|
50
|
+
"onPageScroll": true,
|
|
51
|
+
"onPullDownRefresh": true,
|
|
52
|
+
"onReachBottom": true,
|
|
53
|
+
"onReady": true,
|
|
54
|
+
"onRenderTracked": true,
|
|
55
|
+
"onRenderTriggered": true,
|
|
56
|
+
"onResize": true,
|
|
57
|
+
"onScopeDispose": true,
|
|
58
|
+
"onServerPrefetch": true,
|
|
59
|
+
"onShareAppMessage": true,
|
|
60
|
+
"onShareTimeline": true,
|
|
61
|
+
"onShow": true,
|
|
62
|
+
"onTabItemTap": true,
|
|
63
|
+
"onThemeChange": true,
|
|
64
|
+
"onUnhandledRejection": true,
|
|
65
|
+
"onUnload": true,
|
|
66
|
+
"onUnmounted": true,
|
|
67
|
+
"onUpdated": true,
|
|
68
|
+
"provide": true,
|
|
69
|
+
"reactive": true,
|
|
70
|
+
"readonly": true,
|
|
71
|
+
"ref": true,
|
|
72
|
+
"resolveComponent": true,
|
|
73
|
+
"shallowReactive": true,
|
|
74
|
+
"shallowReadonly": true,
|
|
75
|
+
"shallowRef": true,
|
|
76
|
+
"toRaw": true,
|
|
77
|
+
"toRef": true,
|
|
78
|
+
"toRefs": true,
|
|
79
|
+
"toValue": true,
|
|
80
|
+
"triggerRef": true,
|
|
81
|
+
"unref": true,
|
|
82
|
+
"useAttrs": true,
|
|
83
|
+
"useCssModule": true,
|
|
84
|
+
"useCssVars": true,
|
|
85
|
+
"useRequest": true,
|
|
86
|
+
"useSlots": true,
|
|
87
|
+
"useUpload": true,
|
|
88
|
+
"useUpload2": true,
|
|
89
|
+
"watch": true,
|
|
90
|
+
"watchEffect": true,
|
|
91
|
+
"watchPostEffect": true,
|
|
92
|
+
"watchSyncEffect": true,
|
|
93
|
+
"DirectiveBinding": true,
|
|
94
|
+
"MaybeRef": true,
|
|
95
|
+
"MaybeRefOrGetter": true,
|
|
96
|
+
"onWatcherCleanup": true,
|
|
97
|
+
"useId": true,
|
|
98
|
+
"useModel": true,
|
|
99
|
+
"useTemplateRef": true
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
env: {
|
|
3
|
+
browser: true,
|
|
4
|
+
es2021: true,
|
|
5
|
+
node: true,
|
|
6
|
+
},
|
|
7
|
+
extends: [
|
|
8
|
+
'eslint:recommended',
|
|
9
|
+
'plugin:@typescript-eslint/recommended',
|
|
10
|
+
'plugin:vue/vue3-essential',
|
|
11
|
+
// eslint-plugin-import 插件, @see https://www.npmjs.com/package/eslint-plugin-import
|
|
12
|
+
'plugin:import/recommended',
|
|
13
|
+
// eslint-config-airbnb-base 插件 已经改用 eslint-config-standard 插件
|
|
14
|
+
'standard',
|
|
15
|
+
// 1. 接入 prettier 的规则
|
|
16
|
+
'prettier',
|
|
17
|
+
'plugin:prettier/recommended',
|
|
18
|
+
'./.eslintrc-auto-import.json',
|
|
19
|
+
],
|
|
20
|
+
overrides: [
|
|
21
|
+
{
|
|
22
|
+
env: {
|
|
23
|
+
node: true,
|
|
24
|
+
},
|
|
25
|
+
files: ['.eslintrc.{js,cjs}'],
|
|
26
|
+
parserOptions: {
|
|
27
|
+
sourceType: 'script',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
parserOptions: {
|
|
32
|
+
ecmaVersion: 'latest',
|
|
33
|
+
parser: '@typescript-eslint/parser',
|
|
34
|
+
sourceType: 'module',
|
|
35
|
+
},
|
|
36
|
+
plugins: [
|
|
37
|
+
'@typescript-eslint',
|
|
38
|
+
'vue',
|
|
39
|
+
// 2. 加入 prettier 的 eslint 插件
|
|
40
|
+
'prettier',
|
|
41
|
+
// eslint-import-resolver-typescript 插件,@see https://www.npmjs.com/package/eslint-import-resolver-typescript
|
|
42
|
+
'import',
|
|
43
|
+
],
|
|
44
|
+
rules: {
|
|
45
|
+
// 3. 注意要加上这一句,开启 prettier 自动修复的功能
|
|
46
|
+
'prettier/prettier': 'error',
|
|
47
|
+
// turn on errors for missing imports
|
|
48
|
+
'import/no-unresolved': 'off',
|
|
49
|
+
// 对后缀的检测,否则 import 一个ts文件也会报错,需要手动添加'.ts', 增加了下面的配置后就不用了
|
|
50
|
+
'import/extensions': [
|
|
51
|
+
'error',
|
|
52
|
+
'ignorePackages',
|
|
53
|
+
{ js: 'never', jsx: 'never', ts: 'never', tsx: 'never' },
|
|
54
|
+
],
|
|
55
|
+
// 只允许1个默认导出,关闭,否则不能随意export xxx
|
|
56
|
+
'import/prefer-default-export': ['off'],
|
|
57
|
+
'no-console': ['off'],
|
|
58
|
+
// 'no-unused-vars': ['off'],
|
|
59
|
+
// '@typescript-eslint/no-unused-vars': ['off'],
|
|
60
|
+
// 解决vite.config.ts报错问题
|
|
61
|
+
'import/no-extraneous-dependencies': 'off',
|
|
62
|
+
'no-plusplus': 'off',
|
|
63
|
+
'no-shadow': 'off',
|
|
64
|
+
'vue/multi-word-component-names': 'off',
|
|
65
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
66
|
+
'no-underscore-dangle': 'off',
|
|
67
|
+
'no-use-before-define': 'off',
|
|
68
|
+
'no-undef': 'off',
|
|
69
|
+
'no-unused-vars': 'off',
|
|
70
|
+
'no-param-reassign': 'off',
|
|
71
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
72
|
+
// 避免 `eslint` 对于 `typescript` 函数重载的误报
|
|
73
|
+
'no-redeclare': 'off',
|
|
74
|
+
'@typescript-eslint/no-redeclare': 'error',
|
|
75
|
+
},
|
|
76
|
+
// eslint-import-resolver-typescript 插件,@see https://www.npmjs.com/package/eslint-import-resolver-typescript
|
|
77
|
+
settings: {
|
|
78
|
+
'import/parsers': {
|
|
79
|
+
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
80
|
+
},
|
|
81
|
+
'import/resolver': {
|
|
82
|
+
typescript: {},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
globals: {
|
|
86
|
+
$t: true,
|
|
87
|
+
uni: true,
|
|
88
|
+
UniApp: true,
|
|
89
|
+
wx: true,
|
|
90
|
+
WechatMiniprogram: true,
|
|
91
|
+
getCurrentPages: true,
|
|
92
|
+
UniHelper: true,
|
|
93
|
+
Page: true,
|
|
94
|
+
App: true,
|
|
95
|
+
NodeJS: true,
|
|
96
|
+
},
|
|
97
|
+
}
|