diff --git a/.eslintignore b/.eslintignore index a5a8c50e8..dad5cc2ca 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,14 +1,5 @@ -*.sh -node_modules -lib -*.md -*.woff -*.ttf .vscode .idea -/dist/ -/public -/docs .vscode .local !.env-config.ts diff --git a/.eslintrc.js b/.eslintrc.js index 9b8ea61d0..d6e0077a4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,44 +1,18 @@ module.exports = { - env: { - browser: true, - es2021: true - }, - globals: { - PROJECT_BUILD_TIME: 'readonly', - AMap: 'readonly', - BMap: 'readonly', - TMap: 'readonly' - }, - parser: 'vue-eslint-parser', - parserOptions: { - ecmaVersion: 12, - parser: '@typescript-eslint/parser', - sourceType: 'module' + extends: ['@soybeanjs'], + settings: { + 'import/resolver': { + alias: { + map: [ + ['~', '.'], + ['@', './src'] + ], + extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', 'mts', '.d.ts'] + } + } }, - plugins: ['vue', '@typescript-eslint'], - extends: [ - 'airbnb-base', - 'eslint:recommended', - 'plugin:vue/vue3-recommended', - 'plugin:prettier/recommended', - '@vue/eslint-config-typescript/recommended', - '@vue/eslint-config-prettier', - '@vue/typescript/recommended' - ], rules: { - 'import/extensions': [ - 'warn', - 'ignorePackages', - { - js: 'never', - jsx: 'never', - mjs: 'never', - ts: 'never', - tsx: 'never', - mts: 'never' - } - ], - 'import/no-extraneous-dependencies': ['error', { devDependencies: true, peerDependencies: true }], + 'import/no-unresolved': ['error', { ignore: ['uno.css', '~icons/*', 'virtual:svg-icons-register'] }], 'import/order': [ 'error', { @@ -55,11 +29,6 @@ module.exports = { group: 'external', position: 'before' }, - { - pattern: 'vuex', - group: 'external', - position: 'before' - }, { pattern: 'pinia', group: 'external', @@ -151,76 +120,8 @@ module.exports = { position: 'before' } ], - pathGroupsExcludedImportTypes: ['vue', 'vue-router', 'vuex', 'pinia', 'naive-ui'] - } - ], - 'import/no-unresolved': ['error', { ignore: ['uno.css', '~icons/*', 'virtual:svg-icons-register'] }], - 'import/prefer-default-export': 'off', - 'max-classes-per-file': 'off', - 'no-param-reassign': [ - 'error', - { - props: true, - ignorePropertyModificationsFor: ['state', 'acc', 'e'] + pathGroupsExcludedImportTypes: ['vue', 'vue-router', 'pinia', 'naive-ui'] } - ], - 'no-shadow': 'off', - 'no-unused-vars': 'off', - 'no-use-before-define': 'off', - 'vue/multi-word-component-names': [ - 'error', - { - ignores: ['index'] - } - ], - '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', disallowTypeAnnotations: false }], - '@typescript-eslint/no-empty-interface': [ - 'error', - { - allowSingleExtends: true - } - ], - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-shadow': 'error', - '@typescript-eslint/no-unused-vars': [ - 'error', - { vars: 'all', args: 'all', ignoreRestSiblings: false, varsIgnorePattern: '^_', argsIgnorePattern: '^_' } - ], - '@typescript-eslint/no-use-before-define': ['error', { classes: true, functions: false, typedefs: false }] - }, - settings: { - 'import/resolver': { - alias: { - map: [ - ['~', '.'], - ['@', './src'] - ], - extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', 'mts', '.d.ts'] - }, - node: { - extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', 'mts', '.d.ts'] - } - } - }, - overrides: [ - { - files: ['*.vue'], - rules: { - 'no-undef': 'off' - } - }, - { - files: ['*.html'], - rules: { - 'vue/comment-directive': 'off' - } - }, - { - files: ['*.json'], - rules: { - 'no-unused-expressions': 'off' - } - } - ] + ] + } }; diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 96f9dcfeb..6604834a8 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,26 +1,25 @@ { - "recommendations": [ - "afzalsayed96.icones", - "antfu.iconify", - "antfu.unocss", - "christian-kohler.path-intellisense", - "dbaeumer.vscode-eslint", - "eamodio.gitlens", - "editorconfig.editorconfig", - "esbenp.prettier-vscode", - "formulahendry.auto-complete-tag", - "formulahendry.auto-close-tag", - "formulahendry.auto-rename-tag", - "kisstkondoros.vscode-gutter-preview", - "lokalise.i18n-ally", - "mhutchie.git-graph", - "mikestead.dotenv", - "naumovs.color-highlight", - "pkief.material-icon-theme", - "steoates.autoimport", - "vue.volar", - "vue.vscode-typescript-vue-plugin", - "whtouche.vscode-js-console-utils", - "zhuangtongfa.material-theme" - ] + "recommendations": [ + "afzalsayed96.icones", + "antfu.iconify", + "antfu.unocss", + "christian-kohler.path-intellisense", + "dbaeumer.vscode-eslint", + "eamodio.gitlens", + "editorconfig.editorconfig", + "esbenp.prettier-vscode", + "formulahendry.auto-complete-tag", + "formulahendry.auto-close-tag", + "formulahendry.auto-rename-tag", + "kisstkondoros.vscode-gutter-preview", + "lokalise.i18n-ally", + "mhutchie.git-graph", + "mikestead.dotenv", + "naumovs.color-highlight", + "pkief.material-icon-theme", + "steoates.autoimport", + "vue.volar", + "whtouche.vscode-js-console-utils", + "zhuangtongfa.material-theme" + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 4be6d4163..942f06aeb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,75 +1,88 @@ { - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - }, - "editor.fontLigatures": true, - "editor.formatOnSave": false, - "editor.guides.bracketPairs": "active", - "editor.quickSuggestions": { - "strings": true - }, - "editor.tabSize": 2, - "eslint.alwaysShowStatus": true, - "eslint.validate": ["javascript", "javascriptreact", "vue", "typescript", "typescriptreact", "html", "json", "jsonc"], - "files.associations": { - "*.env.*": "dotenv" - }, - "files.eol": "\n", - "git.enableSmartCommit": true, - "gutterpreview.paths": { - "@": "/src", - "~@": "/src" - }, - "material-icon-theme.activeIconPack": "angular", - "material-icon-theme.files.associations": {}, - "material-icon-theme.folders.associations": { - "enum": "typescript", - "enums": "typescript", - "store": "context", - "stores": "context", - "composable": "hook", - "composables": "hook", - "directive": "tools", - "directives": "tools", - "business": "core", - "request": "api", - "adapter": "middleware" - }, - "path-intellisense.mappings": { - "@": "${workspaceFolder}/src", - "~@": "${workspaceFolder}/src", - }, - "terminal.integrated.cursorStyle": "line", - "terminal.integrated.fontSize": 14, - "terminal.integrated.fontWeight": 500, - "terminal.integrated.tabs.enabled": true, - "workbench.iconTheme": "material-icon-theme", - "workbench.colorTheme": "One Dark Pro", - "[html]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[jsonc]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[javascriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[markdown]": { - "editor.defaultFormatter": "yzhang.markdown-all-in-one" - }, - "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[vue]": { - "editor.defaultFormatter": "Vue.volar" - } + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + }, + "editor.fontLigatures": true, + "editor.formatOnSave": false, + "editor.guides.bracketPairs": "active", + "editor.quickSuggestions": { + "strings": true + }, + "editor.tabSize": 2, + "eslint.alwaysShowStatus": true, + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "html", + "json", + "jsonc", + "json5", + "yaml", + "yml", + "markdown" + ], + "files.associations": { + "*.env.*": "dotenv" + }, + "files.eol": "\n", + "git.enableSmartCommit": true, + "gutterpreview.paths": { + "@": "/src", + "~@": "/src" + }, + "material-icon-theme.activeIconPack": "angular", + "material-icon-theme.files.associations": {}, + "material-icon-theme.folders.associations": { + "enum": "typescript", + "enums": "typescript", + "store": "context", + "stores": "context", + "composable": "hook", + "composables": "hook", + "directive": "tools", + "directives": "tools", + "business": "core", + "request": "api", + "adapter": "middleware" + }, + "path-intellisense.mappings": { + "@": "${workspaceFolder}/src", + "~@": "${workspaceFolder}/src" + }, + "terminal.integrated.cursorStyle": "line", + "terminal.integrated.fontSize": 14, + "terminal.integrated.fontWeight": 500, + "terminal.integrated.tabs.enabled": true, + "workbench.iconTheme": "material-icon-theme", + "workbench.colorTheme": "One Dark Pro", + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[markdown]": { + "editor.defaultFormatter": "yzhang.markdown-all-in-one" + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[vue]": { + "editor.defaultFormatter": "Vue.volar" + } } diff --git a/README.md b/README.md index de0df42bd..628dd1cbf 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,16 @@ ## 简介 -[Soybean Admin](https://github.com/honghuangdc/soybean-admin) 是一个基于 Vue3、Vite3、TypeScript、NaiveUI、Pinia和UnoCSS 的清新优雅的中后台模版,它使用了最新的前端技术栈,内置丰富的主题配置,有着极高的代码规范,基于mock实现的动态权限路由,开箱即用的中后台前端解决方案,也可用于学习参考。 +[Soybean Admin](https://github.com/honghuangdc/soybean-admin) 是一个基于 Vue3、Vite3、TypeScript、NaiveUI、Pinia 和 UnoCSS 的清新优雅的中后台模版,它使用了最新的前端技术栈,内置丰富的主题配置,有着极高的代码规范,基于 mock 实现的动态权限路由,开箱即用的中后台前端解决方案,也可用于学习参考。 ## 特性 -- **最新技术栈**:使用 Vue3/Vite3 等前端前沿技术开发, 使用高效率的npm包管理器pnpm +- **最新技术栈**:使用 Vue3/Vite3 等前端前沿技术开发, 使用高效率的 npm 包管理器 pnpm - **TypeScript**:应用程序级 JavaScript 的语言 -- **主题**:丰富可配置的主题、暗黑模式,基于原子css框架 - UnoCSS的动态主题颜色 +- **主题**:丰富可配置的主题、暗黑模式,基于原子 css 框架 - UnoCSS 的动态主题颜色 - **代码规范**:丰富的规范插件及极高的代码规范 -- **权限路由**:简易的路由配置、基于mock的动态路由能快速实现后端动态路由 -- **请求函数**:基于axios的完善的请求函数封装,提供Promise和hooks两种请求函数,加入请求结果数据转换的适配器 +- **权限路由**:简易的路由配置、基于 mock 的动态路由能快速实现后端动态路由 +- **请求函数**:基于 axios 的完善的请求函数封装,提供 Promise 和 hooks 两种请求函数,加入请求结果数据转换的适配器 ## 预览 @@ -29,18 +29,16 @@ ## 代码仓库 - [github](https://github.com/honghuangdc/soybean-admin) - - [gitee](https://gitee.com/honghuangdc/soybean-admin) ## 更新日志 + [CHANGELOG](./CHANGELOG.md) ## 后端服务 - [soybean-admin-java(开发中)](https://github.com/honghuangdc/soybean-admin-java) - - [soybean-admin-go(开发中)](https://github.com/honghuangdc/soybean-admin-go) - - [soybean-admin-nestjs(开发中)](https://github.com/honghuangdc/soybean-admin-nestjs) ## 项目示例图 @@ -67,38 +65,32 @@ ![](https://s2.loli.net/2022/06/07/rRSG6mEZpujOACT.png) - - - - ## 开发计划 -- [x] 引入ECharts替换AntV G2Plot +- [x] 引入 ECharts 替换 AntV G2Plot - [x] 图表示例:ECharts、AntV G2 -- [x] 多页签:支持query、hash等参数,同一页面支持多个Tab +- [x] 多页签:支持 query、hash 等参数,同一页面支持多个 Tab - [x] 缓存主题配置 -- [ ] v0.9.7表单、表格示例(ing...) -- [ ] v0.9.8可修改的KeepAlive的页面缓存和全局Tab组件store重构 -- [ ] v0.9.9全局Iframe组件 -- [ ] v1.0示例页面完善 -- [ ] v1.0版本文档 -- [ ] 精简版(新分支thin) -- [ ] element-plus版本 -- [ ] i18n国际化 -- [ ] 其他UI版本 -- [ ] soybean-admin cli工具(选择不同UI) -- [ ] soybean-admin 后台服务java版: [soybean-admin-java](https://github.com/honghuangdc/soybean-admin-java) -- [ ] soybean-admin 后台服务go版: [soybean-admin-go](https://github.com/honghuangdc/soybean-admin-go) -- [ ] soybean-admin 后台服务nodejs版: [soybean-admin-nestjs](https://github.com/honghuangdc/soybean-admin-nestjs) +- [ ] v0.9.7 表单、表格示例(ing...) +- [ ] v0.9.8 可修改的 KeepAlive 的页面缓存和全局 Tab 组件 store 重构 +- [ ] v0.9.9 全局 Iframe 组件 +- [ ] v1.0 示例页面完善 +- [ ] v1.0 版本文档 +- [ ] 精简版(新分支 thin) +- [ ] element-plus 版本 +- [ ] i18n 国际化 +- [ ] 其他 UI 版本 +- [ ] soybean-admin cli 工具(选择不同 UI) +- [ ] soybean-admin 后台服务 java 版: [soybean-admin-java](https://github.com/honghuangdc/soybean-admin-java) +- [ ] soybean-admin 后台服务 go 版: [soybean-admin-go](https://github.com/honghuangdc/soybean-admin-go) +- [ ] soybean-admin 后台服务 nodejs 版: [soybean-admin-nestjs](https://github.com/honghuangdc/soybean-admin-nestjs) - [ ] 前端可视化创建路由页面 ## 安装使用 - 环境配置 - **本地环境需要安装 pnpm 7.x 、Node.js 14.18+ 和 Git** - - 克隆代码 ```bash @@ -129,9 +121,9 @@ pnpm build ## Git 贡献提交规范 -项目已经内置angular提交规范,通过git cz 代替git commit 命令即可。 +项目已经内置 angular 提交规范,通过 git cz 代替 git commit 命令即可。 -git cz命令需要全局安装 commitizen +git cz 命令需要全局安装 commitizen ```bash pnpm i -g commitizen @@ -144,8 +136,8 @@ pnpm i -g commitizen 支持现代浏览器, 不支持 IE | [](http://godban.github.io/browsers-support-badges/)IE | [](http://godban.github.io/browsers-support-badges/)Edge | [](http://godban.github.io/browsers-support-badges/)Firefox | [](http://godban.github.io/browsers-support-badges/)Chrome | [](http://godban.github.io/browsers-support-badges/)Safari | -| :-: | :-: | :-: | :-: | :-: | -| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions | +| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions | ## 开源作者 @@ -153,22 +145,22 @@ pnpm i -g commitizen ## 交流 -`Soybean Admin` 是完全开源免费的项目,在帮助开发者更方便地进行中大型管理系统开发,同时也提供微信和QQ交流群,使用问题欢迎在群内提问。 +`Soybean Admin` 是完全开源免费的项目,在帮助开发者更方便地进行中大型管理系统开发,同时也提供微信和 QQ 交流群,使用问题欢迎在群内提问。 - 微信交流群(添加本人微信拉进群),欢迎来技术交流,业务咨询。 -