Skip to content

Commit 5110c56

Browse files
committed
update3.0
1 parent 224ff35 commit 5110c56

File tree

285 files changed

+11659
-9604
lines changed

Some content is hidden

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

285 files changed

+11659
-9604
lines changed

.browserslistrc

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

.editorconfig

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

.env.development

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 开发环境
2+
3+
VITE_APP_TITLE = Apidoc
4+
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
5+
VITE_APP_DEBUG_TOOL = vconsole

.env.production

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 生产环境
2+
NODE_ENV = production
3+
4+
# 页面标题
5+
VITE_APP_TITLE = Apidoc
6+
7+
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
8+
VITE_APP_DEBUG_TOOL = vconsole
9+
10+
# 是否在打包时生成 sourcemap
11+
VITE_BUILD_SOURCEMAP = false
12+
13+
# 是否在打包时删除 console 代码
14+
VITE_BUILD_DROP_CONSOLE = false
15+
16+
# 是否在打包时开启压缩,支持 gzip 和 brotli
17+
VITE_BUILD_COMPRESS = gzip,brotli

.eslintignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
*.sh
3+
node_modules
4+
*.md
5+
*.woff
6+
*.ttf
7+
.vscode
8+
.idea
9+
dist
10+
/public
11+
/docs
12+
.local
13+
/bin
14+
Dockerfile

.eslintrc.js

Lines changed: 66 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,76 @@
11
module.exports = {
22
root: true,
33
env: {
4+
browser: true,
45
node: true,
6+
es6: true,
57
},
6-
extends: [
7-
"plugin:vue/vue3-essential",
8-
"eslint:recommended",
9-
"@vue/typescript/recommended",
10-
"@vue/prettier",
11-
"@vue/prettier/@typescript-eslint",
12-
],
8+
parser: 'vue-eslint-parser',
139
parserOptions: {
10+
parser: '@typescript-eslint/parser',
1411
ecmaVersion: 2020,
15-
parser: "@typescript-eslint/parser",
12+
sourceType: 'module',
13+
jsxPragma: 'React',
14+
ecmaFeatures: {
15+
jsx: true,
16+
},
1617
},
18+
extends: [
19+
'plugin:vue/vue3-recommended',
20+
'plugin:@typescript-eslint/recommended',
21+
'plugin:prettier/recommended',
22+
],
1723
rules: {
18-
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
19-
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
20-
"no-unused-vars": "off",
21-
"@typescript-eslint/no-unused-vars": "off",
22-
"@typescript-eslint/no-explicit-any": "off",
23-
"prefer-const": "off",
24+
'vue/script-setup-uses-vars': 'error',
25+
'@typescript-eslint/ban-ts-ignore': 'off',
26+
'@typescript-eslint/explicit-function-return-type': 'off',
27+
'@typescript-eslint/no-explicit-any': 'off',
28+
'@typescript-eslint/no-var-requires': 'off',
29+
'@typescript-eslint/no-empty-function': 'off',
30+
'vue/custom-event-name-casing': 'off',
31+
'no-use-before-define': 'off',
32+
'@typescript-eslint/no-use-before-define': 'off',
33+
'@typescript-eslint/ban-ts-comment': 'off',
34+
'@typescript-eslint/ban-types': 'off',
35+
'@typescript-eslint/no-non-null-assertion': 'off',
36+
'@typescript-eslint/explicit-module-boundary-types': 'off',
37+
'@typescript-eslint/no-unused-vars': [
38+
'error',
39+
{
40+
argsIgnorePattern: '^_',
41+
varsIgnorePattern: '^_',
42+
},
43+
],
44+
'no-unused-vars': [
45+
'error',
46+
{
47+
argsIgnorePattern: '^_',
48+
varsIgnorePattern: '^_',
49+
},
50+
],
51+
'space-before-function-paren': 'off',
52+
53+
'vue/attributes-order': 'off',
54+
'vue/one-component-per-file': 'off',
55+
'vue/html-closing-bracket-newline': 'off',
56+
'vue/max-attributes-per-line': 'off',
57+
'vue/multiline-html-element-content-newline': 'off',
58+
'vue/singleline-html-element-content-newline': 'off',
59+
'vue/attribute-hyphenation': 'off',
60+
'vue/require-default-prop': 'off',
61+
'vue/require-explicit-emits': 'off',
62+
'vue/html-self-closing': [
63+
'error',
64+
{
65+
html: {
66+
void: 'always',
67+
normal: 'never',
68+
component: 'always',
69+
},
70+
svg: 'always',
71+
math: 'always',
72+
},
73+
],
74+
'vue/multi-word-component-names': 'off',
2475
},
25-
};
76+
}

.gitignore

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
1-
*.zip
2-
dist
31
node_modules
4-
/apidoc
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
apidoc
6+
apidoc-ui.*
7+
*.zip
58

9+
.local
10+
.history
611
# local env files
712
.env.local
813
.env.*.local
14+
.eslintcache
15+
916

1017
# Log files
1118
npm-debug.log*
1219
yarn-debug.log*
1320
yarn-error.log*
21+
pnpm-debug.log*
22+
pnpm-lock.yaml*
1423

1524
# Editor directories and files
1625
.idea
17-
.vscode
26+
# .vscode
1827
*.suo
1928
*.ntvs*
2029
*.njsproj
2130
*.sln
2231
*.sw?
23-
*.lock
32+
./packages
33+
./history

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/dist/*
2+
.local
3+
.output.js
4+
/node_modules/**
5+
6+
**/*.svg
7+
**/*.sh
8+
9+
/public/*

.prettierrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
tabWidth: 2,
3+
jsxSingleQuote: true,
4+
jsxBracketSameLine: true,
5+
printWidth: 100,
6+
singleQuote: true,
7+
semi: false,
8+
overrides: [
9+
{
10+
files: '*.json',
11+
options: {
12+
printWidth: 200,
13+
},
14+
},
15+
],
16+
arrowParens: 'always',
17+
endOfLine: 'auto',
18+
vueIndentScriptAndStyle: true,
19+
trailingComma: 'all',
20+
proseWrap: 'never',
21+
htmlWhitespaceSensitivity: 'strict',
22+
}

.stylelintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/dist/*
2+
/public/*
3+
public/*

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"i18n-ally.localesPaths": [
3+
"src/locales"
4+
],
5+
"vetur.validation.template": false,
6+
"vetur.validation.script": false,
7+
"vetur.validation.style": false,
8+
}

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
2-
<h1 align="center">
3-
<a href="#" target="_blank">ThinkPHP ApiDoc UI</a>
4-
</h1>
5-
6-
<div align="center">
7-
8-
ApiDoc UI 基于vue3.0+ts实现的 根据ThinkPHP 注释自动生成API接口文档 的前端项目
9-
10-
</div>
11-
12-
13-
## apidoc 安装
14-
15-
请参考文档 [安装](https://hg-code.gitee.io/thinkphp-apidoc/guide/install/)
16-
17-
## 链接
18-
<a href="https://github.com/HGthecode/thinkphp-apidoc" target="_blank">ThinkPHP ApiDoc</a>
19-
1+
2+
<h1 align="center">
3+
<a href="#" target="_blank">ApiDoc UI</a>
4+
</h1>
5+
6+
<div align="center">
7+
8+
ApiDoc UI 是基于vue3+ts实现的,根据PHP注释自动生成API接口文档的前端项目
9+
10+
</div>
11+
12+
13+
## apidoc 安装
14+
15+
请参考文档 [安装](https://hg-code.gitee.io/apidoc-php)
16+
17+
## 链接
18+
<a href="https://github.com/HGthecode/apidoc-php" target="_blank">ApiDoc-php</a>
19+

babel.config.js

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

config/constant.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @name Config
3+
* @description 项目配置
4+
*/
5+
6+
// 应用名
7+
export const APP_TITLE = 'Apidoc'
8+
9+
// 本地服务端口
10+
export const VITE_PORT = 6969
11+
12+
// 包依赖分析
13+
export const ANALYSIS = true
14+
15+
// 代码压缩
16+
export const COMPRESSION = true
17+
18+
// 打包时删除 console
19+
export const VITE_DROP_CONSOLE = true

config/vite/plugins/autoImport.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @name AutoImportDeps
3+
* @description 按需加载,自动引入
4+
*/
5+
import AutoImport from 'unplugin-auto-import/vite'
6+
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
7+
8+
export const AutoImportDeps = () => {
9+
return AutoImport({
10+
dts: 'types/auto-imports.d.ts',
11+
imports: [
12+
'vue',
13+
'pinia',
14+
'vue-router',
15+
{
16+
'@vueuse/core': [],
17+
},
18+
],
19+
resolvers: [AntDesignVueResolver({ importStyle: 'less' })],
20+
})
21+
}

config/vite/plugins/component.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @name AutoRegistryComponents
3+
* @description 按需加载,自动引入组件
4+
*/
5+
import Components from 'unplugin-vue-components/vite'
6+
import { AntDesignVueResolver, VueUseComponentsResolver } from 'unplugin-vue-components/resolvers'
7+
export const AutoRegistryComponents = () => {
8+
return Components({
9+
// dirs: ['src/components'],
10+
extensions: ['vue', 'md'],
11+
deep: true,
12+
dts: 'types/components.d.ts',
13+
directoryAsNamespace: false,
14+
globalNamespaces: [],
15+
directives: true,
16+
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
17+
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
18+
resolvers: [AntDesignVueResolver(), VueUseComponentsResolver()],
19+
})
20+
}

config/vite/plugins/compress.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @name ConfigCompressPlugin
3+
* @description 开启.gz压缩
4+
*/
5+
import viteCompression from 'vite-plugin-compression'
6+
import { COMPRESSION } from '../../constant'
7+
8+
export const ConfigCompressPlugin = () => {
9+
if (COMPRESSION) {
10+
return viteCompression({
11+
ext: '.gz',
12+
verbose: true,
13+
deleteOriginFile: false,
14+
})
15+
}
16+
return []
17+
}

0 commit comments

Comments
 (0)