/
antm.config.ts
128 lines (124 loc) · 2.9 KB
/
antm.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import { join } from 'path'
import { defineConfig, IDocMenuNavs } from '@antmjs/types'
const CWD = process.cwd()
// 在根目录创建".webhooks.js", 向Git管理者获取webhooks的token, 设置 module.exports = 'xxxxxxxxxxxxxxxxxxx'
export default defineConfig({
warning: {
monitorFiles: ['./packages/**/package.json', './packages/warning/*.js'],
webhooks: {
url: `https://oapi.dingtalk.com/robot/send?access_token=${require('./.webhooks.js')}`,
},
},
docs: {
title: 'antmjs',
src: join(CWD, './packages'),
globalStyles: [join(process.cwd(), './doc.less')],
logo: 'https://fastly.jsdelivr.net/npm/@vant/assets/logo.png',
route: {
level: 1,
exclude: [join(CWD, './packages/doc/**/*.md')],
type: 'history',
},
headerLinks: [
{
title: 'https://b.yzcdn.cn/vant/logo/github.svg',
url: 'https://github.com/AntmJS/antm/',
type: 'img',
},
{
title: '更多',
type: 'select',
options: [
{
title: 'antmjs Doc',
url: 'https://antmjs.github.io/antm/antm-doc/',
},
{
title: 'antmjs Vantui',
url: 'https://antmjs.github.io/vantui',
},
],
},
],
menu: getMenus(),
},
})
function getMenus(): IDocMenuNavs {
return [
{
name: '编译相关',
items: [
{
path: 'babel-preset',
title: 'babel-preset 转译js',
},
{
path: 'eslint',
title: 'eslint 代码规范',
},
{
path: 'stylelint',
title: 'stylelint 样式规范',
},
{
path: 'plugin-icestark',
title: 'plugin-icestark 微应用&Taro',
},
{
path: 'plugin-vantui',
title: 'plugin-vantui 适配组件库',
},
{
path: 'plugin-mini-fix',
title: 'plugin-mini-fix 异常处理&Taro',
},
{
path: 'plugin-global-fix',
title: 'plugin-global-fix 支付宝polyfill',
},
],
},
{
name: '运行时相关',
items: [
{
path: 'cache',
title: 'cache 缓存',
},
{
path: 'unite',
title: 'unite 简化hooks&Taro',
},
{
path: 'utils',
title: 'utils 通用工具',
},
{
path: 'trace',
title: 'trace 埋点&异常',
},
{
path: 'api',
title: 'api 接口&数据',
},
],
},
{
name: 'cli工具',
items: [
{
path: 'iconfont',
title: 'iconfont 图标样式',
},
{
path: 'warning',
title: 'warning 文件监控',
},
{
path: 'upload-tencent',
title: 'upload-tencent 腾讯云上传',
},
],
},
]
}