diff --git a/.cz-config.js b/.cz-config.js index 067f965..18150c7 100644 --- a/.cz-config.js +++ b/.cz-config.js @@ -1,8 +1,8 @@ module.exports = { types: [ - {value: 'feat', name: 'feat: 新增功能'}, - {value: 'fix', name: 'fix: 修复bug'}, - {value: 'docs', name: 'docs: 文档变更'}, + { value: 'feat', name: 'feat: 新增功能' }, + { value: 'fix', name: 'fix: 修复bug' }, + { value: 'docs', name: 'docs: 文档变更' }, { value: 'style', name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)', @@ -11,21 +11,21 @@ module.exports = { value: 'refactor', name: 'refactor: 代码重构(不包括 bug 修复、功能新增)', }, - {value: 'perf', name: 'perf: 性能优化'}, - {value: 'test', name: 'test: 添加、修改测试用例'}, + { value: 'perf', name: 'perf: 性能优化' }, + { value: 'test', name: 'test: 添加、修改测试用例' }, { value: 'build', name: 'build: 构建流程、外部依赖变更(如升级 npm 包、修改 脚手架 配置等)', }, - {value: 'ci', name: 'ci: 修改 CI 配置、脚本'}, + { value: 'ci', name: 'ci: 修改 CI 配置、脚本' }, { value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)', }, - {value: 'revert', name: 'revert: 回滚 commit'}, - {value: 'wip', name: 'wip: 开发中'}, - {value: 'mod', name: 'mod: 不确定分类的修改'}, - {value: 'release', name: 'release: 发布'}, + { value: 'revert', name: 'revert: 回滚 commit' }, + { value: 'wip', name: 'wip: 开发中' }, + { value: 'mod', name: 'mod: 不确定分类的修改' }, + { value: 'release', name: 'release: 发布' }, ], scopes: [ ['custom', '自定义'], diff --git a/.prettierrc.json b/.prettierrc.json index fe440a6..70410d1 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,7 +1,8 @@ { "arrowParens": "avoid", "bracketSameLine": true, - "bracketSpacing": false, + "bracketSpacing": true, "singleQuote": true, - "trailingComma": "all" + "trailingComma": "all", + "endOfLine": "lf" } diff --git a/config/index.ts b/config/index.ts index d4843be..5a399a0 100644 --- a/config/index.ts +++ b/config/index.ts @@ -1,10 +1,10 @@ import Components from 'unplugin-vue-components/webpack'; import NutUIResolver from '@nutui/nutui-taro/dist/resolver'; -import {UnifiedWebpackPluginV5} from 'weapp-tailwindcss/webpack'; -import {join} from 'node:path'; -import {argv} from 'yargs'; +import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack'; +import { join } from 'node:path'; +import { argv } from 'yargs'; -const {robot = 1, desc} = argv; +const { robot = 1, desc } = argv; const CIPluginOptFn = async () => { /** @@ -25,7 +25,7 @@ const CIPluginOptFn = async () => { const config = { projectName: 'taroApp', date: '2023-8-13', - designWidth(input: {file: string}) { + designWidth(input: { file: string }) { if (input?.file?.replace(/\\+/g, '/').indexOf('@nutui') > -1) { return 375; } @@ -48,10 +48,10 @@ const config = { framework: 'vue3', compiler: { type: 'webpack5', - prebundle: {enable: false}, + prebundle: { enable: false }, }, cache: { - enable: false, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache + enable: true, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache }, sass: { data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`, @@ -75,7 +75,7 @@ const config = { }); chain.plugin('unplugin-vue-components').use( Components({ - resolvers: [NutUIResolver({taro: true})], + resolvers: [NutUIResolver({ taro: true })], }), ); }, @@ -110,7 +110,7 @@ const config = { webpackChain(chain) { chain.plugin('unplugin-vue-components').use( Components({ - resolvers: [NutUIResolver({taro: true})], + resolvers: [NutUIResolver({ taro: true })], }), ); }, diff --git a/package.json b/package.json index c92aa86..51521dd 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,8 @@ "lint:fix": "eslint --fix --ext .ts,.vue .", "lint:staged": "lint-staged", "prepare": "husky install", - "preview": "vite preview", "cz": "cz", - "lf": "npx prettier --write --end-of-line lf .", + "lf": "npx prettier --write", "postinstall": "weapp-tw patch", "build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'", "build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test" @@ -112,6 +111,7 @@ "miniprogram-ci": "^2.0.10", "postcss": "8.4.29", "postcss-rem-to-responsive-pixel": "^6.0.2", + "prettier": "^3.5.3", "style-loader": "1.3.0", "stylelint": "9.3.0", "tailwindcss": "^3.4.17", @@ -122,6 +122,5 @@ "weapp-tailwindcss": "^3.7.0", "webpack": "^5.97.1", "yargs": "^17.7.2" - }, - "packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0" + } } diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..a586cd8 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,11 @@ +onlyBuiltDependencies: + - '@parcel/watcher' + - '@swc/core' + - '@tarojs/binding' + - core-js + - core-js-pure + - esbuild + - protobufjs + - swiper + - vue-demi + - weapp-tailwindcss diff --git a/src/app.ts b/src/app.ts index ed366b6..b41722e 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,4 +1,4 @@ -import {createApp} from 'vue'; +import { createApp } from 'vue'; import Taro from '@tarojs/taro'; import './app.scss'; diff --git a/src/components/Auth.vue b/src/components/Auth.vue index dd12ac6..758dd78 100644 --- a/src/components/Auth.vue +++ b/src/components/Auth.vue @@ -16,7 +16,7 @@ diff --git a/src/pages/users/distribution/userlist/index.vue b/src/pages/users/distribution/userlist/index.vue index 04d1cc0..8daf3cd 100644 --- a/src/pages/users/distribution/userlist/index.vue +++ b/src/pages/users/distribution/userlist/index.vue @@ -27,9 +27,9 @@ diff --git a/src/pages/users/login/index.vue b/src/pages/users/login/index.vue index 148ff7d..3577eec 100644 --- a/src/pages/users/login/index.vue +++ b/src/pages/users/login/index.vue @@ -1,8 +1,8 @@