Skip to content

Commit

Permalink
chore: Merge v3 into main (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
CharleeWa authored Sep 23, 2024
2 parents d533bd1 + a1dca43 commit 54dba94
Show file tree
Hide file tree
Showing 52 changed files with 3,190 additions and 1,930 deletions.
4 changes: 2 additions & 2 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ members of the project's leadership.
## Attribution

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

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

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
<https://www.contributor-covenant.org/faq>
2 changes: 0 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
shamefully-hoist=true
strict-peer-dependencies=false
package-manager-strict=false
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"recommendations": [
"Vue.volar",
"antfu.unocss",
"simonhe.common-intellisense",
"antfu.goto-alias",
"lokalise.i18n-ally",
"antfu.iconify"
]
Expand Down
31 changes: 12 additions & 19 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
{
// Enable the ESlint flat config support
"eslint.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
{ "rule": "style/*", "severity": "off", "fixable": true },
{ "rule": "format/*", "severity": "off", "fixable": true },
{ "rule": "*-indent", "severity": "off", "fixable": true },
{ "rule": "*-spacing", "severity": "off", "fixable": true },
{ "rule": "*-spaces", "severity": "off", "fixable": true },
{ "rule": "*-order", "severity": "off", "fixable": true },
{ "rule": "*-dangle", "severity": "off", "fixable": true },
{ "rule": "*-newline", "severity": "off", "fixable": true },
{ "rule": "*quotes", "severity": "off", "fixable": true },
{ "rule": "*semi", "severity": "off", "fixable": true }
],

// Enable eslint for all supported languages
Expand All @@ -42,19 +40,14 @@
"gql",
"graphql",
"astro",
"svelte",
"css",
"less",
"scss",
"pcss",
"postcss"
],

// Specify the UI library you need to prompt
"common-intellisense.showSlots": false,
"common-intellisense.ui": [
"vant4"
],

// Configuration of i18n i18n-ally
"i18n-ally.enabledParsers": ["json"],
"i18n-ally.displayLanguage": "zh-CN",
Expand Down
9 changes: 5 additions & 4 deletions build/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import legacy from '@vitejs/plugin-legacy'
import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import AutoImport from 'unplugin-auto-import/vite'
import { VantResolver } from 'unplugin-vue-components/resolvers'
import { VantResolver } from '@vant/auto-import-resolver'
import Components from 'unplugin-vue-components/vite'
import { VueRouterAutoImports } from 'unplugin-vue-router'
import VueRouter from 'unplugin-vue-router/vite'
Expand All @@ -22,7 +22,7 @@ export function createVitePlugins() {
VueRouter({
extensions: ['.vue'],
routesFolder: 'src/pages',
dts: 'src/typed-router.d.ts',
dts: 'src/types/typed-router.d.ts',
}),

vue(),
Expand All @@ -38,7 +38,7 @@ export function createVitePlugins() {
extensions: ['vue'],
resolvers: [VantResolver()],
include: [/\.vue$/, /\.vue\?vue/],
dts: 'src/components.d.ts',
dts: 'src/types/components.d.ts',
}),

// https://github.com/antfu/unplugin-auto-import
Expand All @@ -60,10 +60,11 @@ export function createVitePlugins() {
},
unheadVueComposablesImports,
],
dts: 'src/auto-imports.d.ts',
dts: 'src/types/auto-imports.d.ts',
dirs: [
'src/composables',
],
resolvers: [VantResolver()],
}),

// https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n
Expand Down
6 changes: 4 additions & 2 deletions build/vite/optimize.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
const include = [
'axios',
'store',
'echarts',
'lodash-es',
'resize-detector',
'store/plugins/expire',
'vant/es/cell-group/style/index',
'vant/es/popup/style/index',
'vant/es/picker/style/index',
Expand All @@ -15,6 +13,10 @@ const include = [
'vant/es/empty/style/index',
'vant/es/icon/style/index',
'vant/es/stepper/style/index',
'vant/es/image/style/index',
'vant/es/form/style/index',
'vant/es/field/style/index',
'vant/es/notify/style/index',
]

const exclude = [
Expand Down
38 changes: 26 additions & 12 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
import antfu from '@antfu/eslint-config'

export default antfu({
// enable UnoCSS support
// https://unocss.dev/integrations/vscode
unocss: true,
export default antfu(
{
vue: true,
typescript: true,

formatters: {
css: true,
},
// enable UnoCSS support
// https://unocss.dev/integrations/vscode
unocss: true,

formatters: {
css: true,
},

ignores: [
'.github/**',
'scripts/**',
],
})
},
{
rules: {
'perfectionist/sort-imports': 'off',
'perfectionist/sort-exports': 'off',
'perfectionist/sort-named-exports': 'off',
},
},
{
ignores: [
'.github/**',
'scripts/**',
],
},
)
2 changes: 2 additions & 0 deletions mock/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import prose from './modules/prose.mock'
import user from './modules/user.mock'

export default {
...prose,
...user,
}
67 changes: 67 additions & 0 deletions mock/modules/user.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { defineMock } from 'vite-plugin-mock-dev-server'
import { builder } from '../util'

export default defineMock([
{
url: '/api/auth/login',
delay: 500,
body: () => {
return {
code: 0,
data: {
token: 'admin',
},
msg: 'success',
}
},
},
{
url: '/api/user/me',
delay: 100,
body: () => {
return {
code: 0,
data: {
uid: 1,
name: 'admin',
avatar: 'https://iconfont.alicdn.com/p/user/eZQFvSX6g8f1/f0d9fd95-a5f0-474d-98b0-d51e8450f2cf.png',
},
msg: 'success',
}
},
},
{
url: '/api/user/logout',
delay: 500,
body: () => {
return {
code: 0,
msg: 'success',
}
},
},
{
url: '/api/user/email-code',
delay: 1000,
body: () => {
const code = '123456'
return builder(code)
},
},
{
url: '/api/user/reset-password',
delay: 1000,
body: () => {
const res = true
return builder(res)
},
},
{
url: '/api/user/register',
delay: 1000,
body: () => {
const res = true
return builder(res)
},
},
])
67 changes: 33 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vue3-vant-mobile",
"type": "module",
"version": "2.3.11",
"packageManager": "pnpm@9.7.0",
"packageManager": "pnpm@9.10.0",
"description": "Vue + Vite H5 Starter Template",
"license": "MIT",
"scripts": {
Expand All @@ -17,61 +17,60 @@
"prepare": "husky"
},
"dependencies": {
"@unhead/vue": "^1.9.16",
"@unhead/vue": "^1.11.6",
"@vant/touch-emulator": "^1.4.0",
"@vant/use": "^1.6.0",
"@vueuse/core": "^11.0.0",
"axios": "^1.7.4",
"@vueuse/core": "^11.1.0",
"axios": "^1.7.7",
"echarts": "^5.5.1",
"lodash-es": "^4.17.21",
"nprogress": "^0.2.0",
"pinia": "^2.2.2",
"pinia-plugin-persistedstate": "^3.2.1",
"pinia-plugin-persistedstate": "^4.0.2",
"resize-detector": "^0.3.0",
"store": "^2.0.12",
"vant": "^4.9.4",
"vant": "^4.9.6",
"vconsole": "^3.15.1",
"vue": "^3.4.38",
"vue-i18n": "^9.13.1",
"vue-router": "^4.4.3"
"vue": "^3.5.6",
"vue-i18n": "^10.0.1",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@antfu/eslint-config": "2.26.0",
"@iconify-json/carbon": "^1.1.37",
"@intlify/unplugin-vue-i18n": "^4.0.0",
"@antfu/eslint-config": "3.6.2",
"@iconify-json/carbon": "^1.2.1",
"@intlify/unplugin-vue-i18n": "^5.0.0",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.4.0",
"@types/node": "^22.5.5",
"@types/nprogress": "^0.2.3",
"@types/store": "^2.0.5",
"@unocss/eslint-plugin": "0.62.2",
"@unocss/preset-rem-to-px": "0.62.2",
"@unocss/eslint-plugin": "0.62.4",
"@unocss/preset-rem-to-px": "0.62.4",
"@vant/auto-import-resolver": "^1.2.1",
"@vitejs/plugin-legacy": "^5.4.2",
"@vitejs/plugin-vue": "^5.1.2",
"@vitejs/plugin-vue": "^5.1.4",
"autoprefixer": "^10.4.20",
"bumpp": "^9.5.1",
"bumpp": "^9.5.2",
"consola": "^3.2.3",
"cross-env": "^7.0.3",
"eslint": "^9.9.0",
"eslint": "^9.10.0",
"eslint-plugin-format": "^0.1.2",
"husky": "^9.1.4",
"husky": "^9.1.6",
"less": "^4.2.0",
"mockjs": "^1.1.0",
"postcss-mobile-forever": "^4.1.5",
"rollup": "^4.21.0",
"terser": "^5.31.6",
"typescript": "^5.5.4",
"unocss": "0.62.2",
"unplugin-auto-import": "^0.18.2",
"postcss-mobile-forever": "^4.1.6",
"rollup": "^4.22.0",
"terser": "^5.33.0",
"typescript": "^5.6.2",
"unocss": "0.62.4",
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-components": "^0.27.4",
"unplugin-vue-router": "^0.10.7",
"vite": "^5.4.1",
"vite-plugin-mock-dev-server": "^1.7.1",
"vite-plugin-pwa": "^0.20.1",
"unplugin-vue-router": "^0.10.8",
"vite": "^5.4.6",
"vite-plugin-mock-dev-server": "^1.7.2",
"vite-plugin-pwa": "^0.20.5",
"vite-plugin-sitemap": "^0.7.1",
"vite-plugin-vconsole": "^2.1.1",
"vite-plugin-vue-devtools": "^7.3.8",
"vitest": "^2.0.5",
"vue-tsc": "^2.0.29"
"vite-plugin-vue-devtools": "^7.4.5",
"vitest": "^2.1.1",
"vue-tsc": "^2.1.6"
},
"pnpm": {
"peerDependencyRules": {
Expand Down
Loading

0 comments on commit 54dba94

Please sign in to comment.