Skip to content

Commit 54dba94

Browse files
authored
chore: Merge v3 into main (#128)
2 parents d533bd1 + a1dca43 commit 54dba94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3190
-1930
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ members of the project's leadership.
6969
## Attribution
7070

7171
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
72-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
7373

7474
[homepage]: https://www.contributor-covenant.org
7575

7676
For answers to common questions about this code of conduct, see
77-
https://www.contributor-covenant.org/faq
77+
<https://www.contributor-covenant.org/faq>

.npmrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
shamefully-hoist=true
2-
strict-peer-dependencies=false
3-
package-manager-strict=false

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"recommendations": [
33
"Vue.volar",
44
"antfu.unocss",
5-
"simonhe.common-intellisense",
5+
"antfu.goto-alias",
66
"lokalise.i18n-ally",
77
"antfu.iconify"
88
]

.vscode/settings.json

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
{
2-
// Enable the ESlint flat config support
3-
"eslint.useFlatConfig": true,
4-
52
// Disable the default formatter, use eslint instead
63
"prettier.enable": false,
74
"editor.formatOnSave": false,
85

96
// Auto fix
107
"editor.codeActionsOnSave": {
11-
"source.fixAll": "explicit",
8+
"source.fixAll.eslint": "explicit",
129
"source.organizeImports": "never"
1310
},
1411

1512
// Silent the stylistic rules in you IDE, but still auto fix them
1613
"eslint.rules.customizations": [
17-
{ "rule": "style/*", "severity": "off" },
18-
{ "rule": "*-indent", "severity": "off" },
19-
{ "rule": "*-spacing", "severity": "off" },
20-
{ "rule": "*-spaces", "severity": "off" },
21-
{ "rule": "*-order", "severity": "off" },
22-
{ "rule": "*-dangle", "severity": "off" },
23-
{ "rule": "*-newline", "severity": "off" },
24-
{ "rule": "*quotes", "severity": "off" },
25-
{ "rule": "*semi", "severity": "off" }
14+
{ "rule": "style/*", "severity": "off", "fixable": true },
15+
{ "rule": "format/*", "severity": "off", "fixable": true },
16+
{ "rule": "*-indent", "severity": "off", "fixable": true },
17+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
18+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
19+
{ "rule": "*-order", "severity": "off", "fixable": true },
20+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
21+
{ "rule": "*-newline", "severity": "off", "fixable": true },
22+
{ "rule": "*quotes", "severity": "off", "fixable": true },
23+
{ "rule": "*semi", "severity": "off", "fixable": true }
2624
],
2725

2826
// Enable eslint for all supported languages
@@ -42,19 +40,14 @@
4240
"gql",
4341
"graphql",
4442
"astro",
43+
"svelte",
4544
"css",
4645
"less",
4746
"scss",
4847
"pcss",
4948
"postcss"
5049
],
5150

52-
// Specify the UI library you need to prompt
53-
"common-intellisense.showSlots": false,
54-
"common-intellisense.ui": [
55-
"vant4"
56-
],
57-
5851
// Configuration of i18n i18n-ally
5952
"i18n-ally.enabledParsers": ["json"],
6053
"i18n-ally.displayLanguage": "zh-CN",

build/vite/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import legacy from '@vitejs/plugin-legacy'
55
import vue from '@vitejs/plugin-vue'
66
import UnoCSS from 'unocss/vite'
77
import AutoImport from 'unplugin-auto-import/vite'
8-
import { VantResolver } from 'unplugin-vue-components/resolvers'
8+
import { VantResolver } from '@vant/auto-import-resolver'
99
import Components from 'unplugin-vue-components/vite'
1010
import { VueRouterAutoImports } from 'unplugin-vue-router'
1111
import VueRouter from 'unplugin-vue-router/vite'
@@ -22,7 +22,7 @@ export function createVitePlugins() {
2222
VueRouter({
2323
extensions: ['.vue'],
2424
routesFolder: 'src/pages',
25-
dts: 'src/typed-router.d.ts',
25+
dts: 'src/types/typed-router.d.ts',
2626
}),
2727

2828
vue(),
@@ -38,7 +38,7 @@ export function createVitePlugins() {
3838
extensions: ['vue'],
3939
resolvers: [VantResolver()],
4040
include: [/\.vue$/, /\.vue\?vue/],
41-
dts: 'src/components.d.ts',
41+
dts: 'src/types/components.d.ts',
4242
}),
4343

4444
// https://github.com/antfu/unplugin-auto-import
@@ -60,10 +60,11 @@ export function createVitePlugins() {
6060
},
6161
unheadVueComposablesImports,
6262
],
63-
dts: 'src/auto-imports.d.ts',
63+
dts: 'src/types/auto-imports.d.ts',
6464
dirs: [
6565
'src/composables',
6666
],
67+
resolvers: [VantResolver()],
6768
}),
6869

6970
// https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n

build/vite/optimize.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
const include = [
22
'axios',
3-
'store',
43
'echarts',
54
'lodash-es',
65
'resize-detector',
7-
'store/plugins/expire',
86
'vant/es/cell-group/style/index',
97
'vant/es/popup/style/index',
108
'vant/es/picker/style/index',
@@ -15,6 +13,10 @@ const include = [
1513
'vant/es/empty/style/index',
1614
'vant/es/icon/style/index',
1715
'vant/es/stepper/style/index',
16+
'vant/es/image/style/index',
17+
'vant/es/form/style/index',
18+
'vant/es/field/style/index',
19+
'vant/es/notify/style/index',
1820
]
1921

2022
const exclude = [

eslint.config.js

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
import antfu from '@antfu/eslint-config'
22

3-
export default antfu({
4-
// enable UnoCSS support
5-
// https://unocss.dev/integrations/vscode
6-
unocss: true,
3+
export default antfu(
4+
{
5+
vue: true,
6+
typescript: true,
77

8-
formatters: {
9-
css: true,
10-
},
8+
// enable UnoCSS support
9+
// https://unocss.dev/integrations/vscode
10+
unocss: true,
11+
12+
formatters: {
13+
css: true,
14+
},
1115

12-
ignores: [
13-
'.github/**',
14-
'scripts/**',
15-
],
16-
})
16+
},
17+
{
18+
rules: {
19+
'perfectionist/sort-imports': 'off',
20+
'perfectionist/sort-exports': 'off',
21+
'perfectionist/sort-named-exports': 'off',
22+
},
23+
},
24+
{
25+
ignores: [
26+
'.github/**',
27+
'scripts/**',
28+
],
29+
},
30+
)

mock/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import prose from './modules/prose.mock'
2+
import user from './modules/user.mock'
23

34
export default {
45
...prose,
6+
...user,
57
}

mock/modules/user.mock.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import { defineMock } from 'vite-plugin-mock-dev-server'
2+
import { builder } from '../util'
3+
4+
export default defineMock([
5+
{
6+
url: '/api/auth/login',
7+
delay: 500,
8+
body: () => {
9+
return {
10+
code: 0,
11+
data: {
12+
token: 'admin',
13+
},
14+
msg: 'success',
15+
}
16+
},
17+
},
18+
{
19+
url: '/api/user/me',
20+
delay: 100,
21+
body: () => {
22+
return {
23+
code: 0,
24+
data: {
25+
uid: 1,
26+
name: 'admin',
27+
avatar: 'https://iconfont.alicdn.com/p/user/eZQFvSX6g8f1/f0d9fd95-a5f0-474d-98b0-d51e8450f2cf.png',
28+
},
29+
msg: 'success',
30+
}
31+
},
32+
},
33+
{
34+
url: '/api/user/logout',
35+
delay: 500,
36+
body: () => {
37+
return {
38+
code: 0,
39+
msg: 'success',
40+
}
41+
},
42+
},
43+
{
44+
url: '/api/user/email-code',
45+
delay: 1000,
46+
body: () => {
47+
const code = '123456'
48+
return builder(code)
49+
},
50+
},
51+
{
52+
url: '/api/user/reset-password',
53+
delay: 1000,
54+
body: () => {
55+
const res = true
56+
return builder(res)
57+
},
58+
},
59+
{
60+
url: '/api/user/register',
61+
delay: 1000,
62+
body: () => {
63+
const res = true
64+
return builder(res)
65+
},
66+
},
67+
])

package.json

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vue3-vant-mobile",
33
"type": "module",
44
"version": "2.3.11",
5-
"packageManager": "pnpm@9.7.0",
5+
"packageManager": "pnpm@9.10.0",
66
"description": "Vue + Vite H5 Starter Template",
77
"license": "MIT",
88
"scripts": {
@@ -17,61 +17,60 @@
1717
"prepare": "husky"
1818
},
1919
"dependencies": {
20-
"@unhead/vue": "^1.9.16",
20+
"@unhead/vue": "^1.11.6",
2121
"@vant/touch-emulator": "^1.4.0",
2222
"@vant/use": "^1.6.0",
23-
"@vueuse/core": "^11.0.0",
24-
"axios": "^1.7.4",
23+
"@vueuse/core": "^11.1.0",
24+
"axios": "^1.7.7",
2525
"echarts": "^5.5.1",
2626
"lodash-es": "^4.17.21",
2727
"nprogress": "^0.2.0",
2828
"pinia": "^2.2.2",
29-
"pinia-plugin-persistedstate": "^3.2.1",
29+
"pinia-plugin-persistedstate": "^4.0.2",
3030
"resize-detector": "^0.3.0",
31-
"store": "^2.0.12",
32-
"vant": "^4.9.4",
31+
"vant": "^4.9.6",
3332
"vconsole": "^3.15.1",
34-
"vue": "^3.4.38",
35-
"vue-i18n": "^9.13.1",
36-
"vue-router": "^4.4.3"
33+
"vue": "^3.5.6",
34+
"vue-i18n": "^10.0.1",
35+
"vue-router": "^4.4.5"
3736
},
3837
"devDependencies": {
39-
"@antfu/eslint-config": "2.26.0",
40-
"@iconify-json/carbon": "^1.1.37",
41-
"@intlify/unplugin-vue-i18n": "^4.0.0",
38+
"@antfu/eslint-config": "3.6.2",
39+
"@iconify-json/carbon": "^1.2.1",
40+
"@intlify/unplugin-vue-i18n": "^5.0.0",
4241
"@types/lodash-es": "^4.17.12",
43-
"@types/node": "^22.4.0",
42+
"@types/node": "^22.5.5",
4443
"@types/nprogress": "^0.2.3",
45-
"@types/store": "^2.0.5",
46-
"@unocss/eslint-plugin": "0.62.2",
47-
"@unocss/preset-rem-to-px": "0.62.2",
44+
"@unocss/eslint-plugin": "0.62.4",
45+
"@unocss/preset-rem-to-px": "0.62.4",
46+
"@vant/auto-import-resolver": "^1.2.1",
4847
"@vitejs/plugin-legacy": "^5.4.2",
49-
"@vitejs/plugin-vue": "^5.1.2",
48+
"@vitejs/plugin-vue": "^5.1.4",
5049
"autoprefixer": "^10.4.20",
51-
"bumpp": "^9.5.1",
50+
"bumpp": "^9.5.2",
5251
"consola": "^3.2.3",
5352
"cross-env": "^7.0.3",
54-
"eslint": "^9.9.0",
53+
"eslint": "^9.10.0",
5554
"eslint-plugin-format": "^0.1.2",
56-
"husky": "^9.1.4",
55+
"husky": "^9.1.6",
5756
"less": "^4.2.0",
5857
"mockjs": "^1.1.0",
59-
"postcss-mobile-forever": "^4.1.5",
60-
"rollup": "^4.21.0",
61-
"terser": "^5.31.6",
62-
"typescript": "^5.5.4",
63-
"unocss": "0.62.2",
64-
"unplugin-auto-import": "^0.18.2",
58+
"postcss-mobile-forever": "^4.1.6",
59+
"rollup": "^4.22.0",
60+
"terser": "^5.33.0",
61+
"typescript": "^5.6.2",
62+
"unocss": "0.62.4",
63+
"unplugin-auto-import": "^0.18.3",
6564
"unplugin-vue-components": "^0.27.4",
66-
"unplugin-vue-router": "^0.10.7",
67-
"vite": "^5.4.1",
68-
"vite-plugin-mock-dev-server": "^1.7.1",
69-
"vite-plugin-pwa": "^0.20.1",
65+
"unplugin-vue-router": "^0.10.8",
66+
"vite": "^5.4.6",
67+
"vite-plugin-mock-dev-server": "^1.7.2",
68+
"vite-plugin-pwa": "^0.20.5",
7069
"vite-plugin-sitemap": "^0.7.1",
7170
"vite-plugin-vconsole": "^2.1.1",
72-
"vite-plugin-vue-devtools": "^7.3.8",
73-
"vitest": "^2.0.5",
74-
"vue-tsc": "^2.0.29"
71+
"vite-plugin-vue-devtools": "^7.4.5",
72+
"vitest": "^2.1.1",
73+
"vue-tsc": "^2.1.6"
7574
},
7675
"pnpm": {
7776
"peerDependencyRules": {

0 commit comments

Comments
 (0)