Skip to content

Commit 9f9b42c

Browse files
committed
first init
1 parent 04561be commit 9f9b42c

Some content is hidden

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

76 files changed

+5548
-4
lines changed

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab

.eslintrc.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* 自定义eslint tslint配置
3+
*/
4+
const base = require('./eslint-rules/base');
5+
const react = require('./eslint-rules/react');
6+
const ts = require('./eslint-rules/ts');
7+
8+
module.exports = {
9+
extends: [
10+
'alloy',
11+
'alloy/react',
12+
'alloy/typescript'
13+
],
14+
env: {
15+
// 你的环境变量(包含多个预定义的全局变量)
16+
//
17+
browser: true,
18+
// node: true,
19+
// mocha: true,
20+
// jest: true,
21+
// jquery: true
22+
},
23+
globals: {
24+
// 你的全局变量(设置为 false 表示它不允许被重新赋值)
25+
//
26+
// myGlobal: false
27+
},
28+
rules: {
29+
...base,
30+
...react,
31+
...ts,
32+
// 在 Promise 中使用 asnyc
33+
'no-async-promise-executor': 0,
34+
'default-case-last': 'off',
35+
'no-useless-backreference': 'off',
36+
},
37+
};

.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/npm-debug.log*
6+
/yarn-error.log
7+
/yarn.lock
8+
package-lock.json
9+
10+
# production
11+
**/dist
12+
13+
# misc
14+
.DS_Store
15+
.idea
16+
.vscode
17+
.svn
18+
.npmrc
19+
.yarnrc
20+
21+
# umi
22+
.umi
23+
.umi-production
24+
25+
# 一些临时文件
26+
**/.tmp
27+
**/.umi
28+
29+
# Electron 构建文件
30+
release
31+
src/main/bundle.js
32+
src/main/bundle.js.map

.gitlab-ci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include:
2+
- project: "arch-foundation/cicd"
3+
ref: electron
4+
file: "/templates/Electron.gitlab-ci.yml"

.prettierignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/*.md
2+
**/*.svg
3+
**/*.ejs
4+
**/*.html
5+
package.json
6+
.umi
7+
.umi-production

.prettierrc.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/* const fabric = require('@umijs/fabric');
2+
module.exports = {
3+
...fabric.prettier,
4+
};
5+
*/
6+
7+
// .prettierrc.js
8+
module.exports = {
9+
// 一行最多 100 字符
10+
printWidth: 100,
11+
// 使用 2 个空格缩进
12+
tabWidth: 2,
13+
// 不使用缩进符,而使用空格
14+
useTabs: false,
15+
// 行尾需要有分号
16+
semi: false,
17+
// 使用单引号
18+
singleQuote: true,
19+
// 对象的 key 仅在必要时用引号
20+
quoteProps: 'as-needed',
21+
// jsx 使用单引号
22+
jsxSingleQuote: true,
23+
// 末尾不需要逗号
24+
trailingComma: 'none',
25+
// 大括号内的首尾需要空格
26+
bracketSpacing: true,
27+
// jsx 标签的反尖括号需要换行
28+
jsxBracketSameLine: false,
29+
// 箭头函数,只有一个参数的时候,也需要括号
30+
// arrowParens: 'always',
31+
// 每个文件格式化的范围是文件的全部内容
32+
rangeStart: 0,
33+
rangeEnd: Infinity,
34+
// 不需要写文件开头的 @prettier
35+
requirePragma: false,
36+
// 不需要自动在文件开头插入 @prettier
37+
insertPragma: false,
38+
// 使用默认的折行标准
39+
proseWrap: 'preserve',
40+
// 根据显示样式决定 html 要不要折行
41+
htmlWhitespaceSensitivity: 'css',
42+
// 换行符使用 lf
43+
endOfLine: 'lf'
44+
}

README.md

+120-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
`electron 8.2` + `umi 3.1` + `typescript react 16.12` + `redux` + `antDesign 4.0` + `eslint tslint react-tslint`脚手架, 下载即用,已经为你做好了基座设施
44

5-
客户端集成:
5+
#### 客户端集成:
66
1. 自动更新(electron-builder)
77
2. 托盘菜单
88
3. app启动loading加载条
@@ -13,7 +13,7 @@
1313
TODOLIST: 1. app崩溃信息采集
1414
2. app消息通知,快捷键等
1515

16-
web端:
16+
#### web端:
1717
1. 基于[umi](https://umijs.org/zh-CN)脚手架,基础配置已集成,开发者关注业务代码编写即可
1818
2. 本地存储redux(redux-saga)
1919
3. antDesign >= 4.0
@@ -35,12 +35,128 @@ npm run pack
3535

3636

3737
### 目录树
38-
```tree
38+
```
39+
|-- project
40+
|-- .editorconfig
41+
|-- .eslintrc.js
42+
|-- .gitignore
43+
|-- .gitlab-ci.yml
44+
|-- .prettierignore
45+
|-- .prettierrc.js
46+
|-- directoryList.md
47+
|-- package-lock.json
48+
|-- package.json
49+
|-- README.md
50+
|-- tsconfig.json
51+
|-- typings.d.ts
52+
|-- eslint-rules 自定义eslint配置
53+
| |-- base.js
54+
| |-- react.js
55+
| |-- ts.js
56+
|-- src
57+
|-- main 主进程
58+
| |-- app-update.yml 生产环境自动更新配置
59+
| |-- bundle.js 自动生成
60+
| |-- bundle.js.map
61+
| |-- dev-app-update.yml 开发环境自动更新配置
62+
| |-- index.js 入口
63+
| |-- loading.html
64+
| |-- preload.js
65+
| |-- README.md
66+
| |-- config 编译配置
67+
| | |-- config.js
68+
| | |-- webpack.config.js
69+
| |-- controls 控制集
70+
| | |-- AppAutoUpdater.js
71+
| | |-- AppMainWindow.js
72+
| | |-- AppTray.js
73+
| | |-- electron-helper.js
74+
| |-- print 打印
75+
| | |-- print.html
76+
| | |-- print.js
77+
| |-- public 附件
78+
| | |-- icon.ico
79+
| | |-- icon.png
80+
| | |-- tray.png
81+
| |-- script 编译脚本
82+
| |-- build.js
83+
|-- render 渲染进程
84+
|-- .env
85+
|-- .umirc.ts
86+
|-- app.ts
87+
|-- global.less
88+
|-- README.md
89+
|-- .umi umi自动生成配置和插件等
90+
| |-- umi.ts
91+
| |-- core
92+
| |-- plugin-dva
93+
| |-- plugin-initial-state
94+
| |-- plugin-model
95+
| |-- plugin-request
96+
|-- api 接口集合
97+
| |-- api.list.ts
98+
|-- assets 附件
99+
| |-- image
100+
| | |-- yay.jpg
101+
| |-- style
102+
| |-- bootstrap-part.less
103+
| |-- common.less
104+
|-- common 通用
105+
| |-- enum.ts
106+
| |-- global.ts
107+
|-- components 组件
108+
| |-- readme.md
109+
| |-- AutoUpdate
110+
| | |-- index.tsx
111+
| | |-- style.less
112+
| |-- FormCps
113+
| | |-- index.tsx
114+
| | |-- readme.md
115+
| |-- TableCps
116+
| |-- index.tsx
117+
| |-- readme.md
118+
|-- config 配置
119+
| |-- iconfont.ts
120+
| |-- menus.tsx
121+
|-- dist 本地打包生成文件
122+
|-- layouts 布局
123+
| |-- index.less
124+
| |-- index.tsx
125+
| |-- header
126+
| | |-- index.less
127+
| | |-- index.tsx
128+
| |-- loading
129+
| | |-- index.less
130+
| | |-- index.tsx
131+
| |-- menu
132+
| |-- index.less
133+
| |-- index.tsx
134+
|-- mock
135+
| |-- foo.ts
136+
|-- models redux
137+
| |-- xxStore.ts
138+
|-- pages
139+
| |-- home.normal.less
140+
| |-- index.tsx
141+
| |-- Foo 示例
142+
| | |-- index.tsx
143+
| | |-- components
144+
| | | |-- TableList.tsx
145+
| | |-- models
146+
| | | |-- foo.ts
147+
| | |-- services
148+
| | |-- foo.ts
149+
| |-- Home 业务
150+
| |-- Edge
151+
| | |-- index.tsx
152+
| |-- Settings
153+
| |-- index.tsx
154+
|-- utils 工具集
39155
40156
```
41157

42158
### eslint
43-
默认开启alloy配置
159+
默认开启[alloy](https://github.com/AlloyTeam/eslint-config-alloy)配置
44160
`eslint-config-alloy`
45161

46162

0 commit comments

Comments
 (0)