Skip to content

Commit 7d74c03

Browse files
committed
init(custom): 更新项目
1 parent 9f52ece commit 7d74c03

24 files changed

+3275
-1228
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 生产环境
2+
# 请求地址
3+
VITE_APP_API_BASEURL = '/'

.env.development

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# 开发环境
2+
3+
# 请求地址
4+
VITE_APP_API_BASEURL = 'https://192.168.211.9'

.eslintrc-auto-import.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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+
"acceptHMRUpdate": true,
16+
"computed": true,
17+
"createApp": true,
18+
"createPinia": true,
19+
"customRef": true,
20+
"defineAsyncComponent": true,
21+
"defineComponent": true,
22+
"defineStore": true,
23+
"effectScope": true,
24+
"getActivePinia": true,
25+
"getCurrentInstance": true,
26+
"getCurrentScope": true,
27+
"h": true,
28+
"inject": true,
29+
"isProxy": true,
30+
"isReactive": true,
31+
"isReadonly": true,
32+
"isRef": true,
33+
"mapActions": true,
34+
"mapGetters": true,
35+
"mapState": true,
36+
"mapStores": true,
37+
"mapWritableState": true,
38+
"markRaw": true,
39+
"nextTick": true,
40+
"onActivated": true,
41+
"onAddToFavorites": true,
42+
"onBackPress": true,
43+
"onBeforeMount": true,
44+
"onBeforeUnmount": true,
45+
"onBeforeUpdate": true,
46+
"onDeactivated": true,
47+
"onError": true,
48+
"onErrorCaptured": true,
49+
"onHide": true,
50+
"onLaunch": true,
51+
"onLoad": true,
52+
"onMounted": true,
53+
"onNavigationBarButtonTap": true,
54+
"onNavigationBarSearchInputChanged": true,
55+
"onNavigationBarSearchInputClicked": true,
56+
"onNavigationBarSearchInputConfirmed": true,
57+
"onNavigationBarSearchInputFocusChanged": true,
58+
"onPageNotFound": true,
59+
"onPageScroll": true,
60+
"onPullDownRefresh": true,
61+
"onReachBottom": true,
62+
"onReady": true,
63+
"onRenderTracked": true,
64+
"onRenderTriggered": true,
65+
"onResize": true,
66+
"onScopeDispose": true,
67+
"onServerPrefetch": true,
68+
"onShareAppMessage": true,
69+
"onShareTimeline": true,
70+
"onShow": true,
71+
"onTabItemTap": true,
72+
"onThemeChange": true,
73+
"onUnhandledRejection": true,
74+
"onUnload": true,
75+
"onUnmounted": true,
76+
"onUpdated": true,
77+
"provide": true,
78+
"reactive": true,
79+
"readonly": true,
80+
"ref": true,
81+
"resolveComponent": true,
82+
"setActivePinia": true,
83+
"setMapStoreSuffix": true,
84+
"shallowReactive": true,
85+
"shallowReadonly": true,
86+
"shallowRef": true,
87+
"storeToRefs": true,
88+
"toRaw": true,
89+
"toRef": true,
90+
"toRefs": true,
91+
"toValue": true,
92+
"triggerRef": true,
93+
"unref": true,
94+
"useAttrs": true,
95+
"useCssModule": true,
96+
"useCssVars": true,
97+
"useRequest": true,
98+
"useSlots": true,
99+
"watch": true,
100+
"watchEffect": true,
101+
"watchPostEffect": true,
102+
"watchSyncEffect": true
103+
}
104+
}

.eslintrc.cjs

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,41 @@ module.exports = {
22
env: {
33
browser: true,
44
es2021: true,
5-
node: true,
5+
node: true
66
},
77
extends: [
88
'eslint:recommended',
99
'plugin:vue/vue3-essential',
1010
// eslint-plugin-import 插件, @see https://www.npmjs.com/package/eslint-plugin-import
1111
'plugin:import/recommended',
12-
// eslint-config-airbnb-base 插件, tips: 本插件也可以替换成 eslint-config-standard
13-
'airbnb-base',
12+
// eslint-config-airbnb-base 插件 已经改用 eslint-config-standard 插件
13+
'standard',
1414
// 1. 接入 prettier 的规则
1515
'prettier',
1616
'plugin:prettier/recommended',
17-
'vue-global-api',
17+
'./.eslintrc-auto-import.json'
1818
],
1919
overrides: [
2020
{
2121
env: {
22-
node: true,
22+
node: true
2323
},
2424
files: ['.eslintrc.{js}'],
2525
parserOptions: {
26-
sourceType: 'script',
27-
},
28-
},
26+
sourceType: 'script'
27+
}
28+
}
2929
],
3030
parserOptions: {
31-
ecmaVersion: 'latest',
3231
parser: '@babel/eslint-parser',
33-
sourceType: 'module',
32+
requireConfigFile: false,
33+
ecmaVersion: 'latest',
34+
sourceType: 'module'
3435
},
3536
plugins: [
36-
'@babel/eslint-parser',
3737
'vue',
3838
// 2. 加入 prettier 的 eslint 插件
39-
'prettier',
40-
// eslint-import-resolver-typescript 插件,@see https://www.npmjs.com/package/eslint-import-resolver-typescript
41-
'import',
39+
'prettier'
4240
],
4341
rules: {
4442
// 3. 注意要加上这一句,开启 prettier 自动修复的功能
@@ -49,9 +47,10 @@ module.exports = {
4947
'import/extensions': [
5048
'error',
5149
'ignorePackages',
52-
{ js: 'never', jsx: 'never', ts: 'never', tsx: 'never' },
50+
{ js: 'never', jsx: 'never', ts: 'never', tsx: 'never' }
5351
],
5452
// 只允许1个默认导出,关闭,否则不能随意export xxx
53+
// 只允许1个默认导出,关闭,否则不能随意export xxx
5554
'import/prefer-default-export': ['off'],
5655
'no-console': ['off'],
5756
// 'no-unused-vars': ['off'],
@@ -61,16 +60,22 @@ module.exports = {
6160
'no-plusplus': 'off',
6261
'no-shadow': 'off',
6362
'vue/multi-word-component-names': 'off',
64-
'@typescript-eslint/no-explicit-any': 'off',
63+
'no-underscore-dangle': 'off',
64+
'no-use-before-define': 'off',
65+
'no-undef': 'off',
66+
'no-unused-vars': 'off',
67+
'no-param-reassign': 'off',
68+
'no-redeclare': 'off',
69+
'import/named': 'off'
6570
},
6671
// eslint-import-resolver-typescript 插件,@see https://www.npmjs.com/package/eslint-import-resolver-typescript
6772
settings: {
6873
'import/parsers': {
69-
'@typescript-eslint/parser': ['.ts', '.tsx'],
74+
'@babel/eslint-parser': ['.js', '.jsx']
7075
},
7176
'import/resolver': {
72-
typescript: {},
73-
},
77+
node: {}
78+
}
7479
},
7580
globals: {
7681
uni: true,
@@ -80,6 +85,6 @@ module.exports = {
8085
getCurrentPages: true,
8186
UniHelper: true,
8287
Page: true,
83-
App: true,
84-
},
85-
}
88+
App: true
89+
}
90+
}

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

2 Bytes
Binary file not shown.

.husky/pre-commit

6 Bytes
Binary file not shown.

auto-imports.d.ts

Lines changed: 0 additions & 90 deletions
This file was deleted.

package.json

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "uni-preset-vue",
3+
"type": "commonjs",
34
"version": "0.0.0",
45
"scripts": {
56
"dev:app": "uni -p app",
@@ -38,8 +39,9 @@
3839
"build:quickapp-webview": "uni build -p quickapp-webview",
3940
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
4041
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
41-
"prepare": "husky init",
42-
"cz": "git-cz"
42+
"prepare": "husky",
43+
"cz": "git-cz",
44+
"preinstall": "npx only-allow pnpm"
4345
},
4446
"dependencies": {
4547
"@dcloudio/uni-app": "3.0.0-3090920231225001",
@@ -56,18 +58,27 @@
5658
"@dcloudio/uni-mp-weixin": "3.0.0-3090920231225001",
5759
"@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001",
5860
"@dcloudio/uni-quickapp-webview": "3.0.0-3090920231225001",
59-
"vue": "^3.2.45",
61+
"@uni-helper/axios-adapter": "^1.5.2",
62+
"@uni-helper/unocss-preset-uni": "^0.2.8",
63+
"axios": "^1.6.8",
64+
"pinia": "^2.0.32",
65+
"pinia-plugin-persistedstate": "^3.2.1",
66+
"uni-preset-vue": "link:",
67+
"vue": "^3.2.47",
6068
"vue-i18n": "^9.1.9"
6169
},
6270
"devDependencies": {
63-
"@babel/eslint-parser": "^7.24.1",
71+
"@babel/core": "^7.24.7",
72+
"@babel/eslint-parser": "^7.24.7",
6473
"@commitlint/cli": "^19.3.0",
6574
"@commitlint/config-conventional": "^19.2.2",
6675
"@dcloudio/types": "^3.3.2",
6776
"@dcloudio/uni-automator": "3.0.0-3090920231225001",
6877
"@dcloudio/uni-cli-shared": "3.0.0-3090920231225001",
6978
"@dcloudio/uni-stacktracey": "3.0.0-3090920231225001",
7079
"@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001",
80+
"@unocss/preset-legacy-compat": "^0.59.4",
81+
"@unocss/preset-uno": "^0.59.4",
7182
"@vue/runtime-core": "^3.2.45",
7283
"commitizen": "^4.3.0",
7384
"commitlint": "^19.3.0",
@@ -78,25 +89,24 @@
7889
"eslint-plugin-import": "^2.29.1",
7990
"eslint-plugin-prettier": "^5.1.3",
8091
"eslint-plugin-vue": "^9.23.0",
81-
"husky": "^9.0.11",
92+
"husky": "^6.0.0",
8293
"lint-staged": "^15.2.2",
94+
"mockjs": "^1.1.0",
95+
"standard": "^17.1.0",
8396
"stylelint": "^16.3.1",
8497
"stylelint-config-prettier": "^9.0.5",
8598
"stylelint-config-standard-scss": "^13.1.0",
8699
"stylelint-scss": "^6.2.1",
100+
"unocss": "^0.58.9",
101+
"unocss-applet": "^0.7.8",
87102
"unplugin-auto-import": "^0.17.5",
88-
"vite": "4.0.3",
103+
"vite": "4.3.5",
89104
"vue-global-api": "^0.4.1"
90105
},
91106
"lint-staged": {
92-
"**/*.{html,vue,ts,cjs,json,md}": [
93-
"prettier --write"
94-
],
95-
"**/*.{vue,js,ts,jsx,tsx}": [
107+
"src/**/*.{js,jsx,ts,tsx}": [
108+
"prettier --write",
96109
"eslint --fix"
97-
],
98-
"**/*.{vue,css,scss,html}": [
99-
"stylelint --fix"
100110
]
101111
},
102112
"config": {

0 commit comments

Comments
 (0)