-
Notifications
You must be signed in to change notification settings - Fork 0
/
README-en.md
120 lines (83 loc) · 3.6 KB
/
README-en.md
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
# raal
![](https://travis-ci.com/sewerganger/raal.svg?branch=master)
![](https://img.shields.io/github/languages/top/sewerganger/raal)
![](https://img.shields.io/github/package-json/v/sewerganger/raal/master)
![](https://img.shields.io/github/license/sewerganger/raal)
[![codecov](https://codecov.io/gh/sewerganger/raal/branch/master/graph/badge.svg)](https://codecov.io/gh/sewerganger/raal)
<img src="https://raw.githubusercontent.com/sewerganger/raal/master/doc/logo.jpg" width="100px"/>
This is a scaffold for react UI component library development. It has the functions of document website development and UI component development.
[中文](https://github.com/sewerganger/raal/blob/master/README.md)
## ❤ recommend using vscode
## 1.Installation
`npm i raal -g`
## 2. Usage
### Global commands
```shell
Usage: cli [options]
Options:
- v, --version output the version number
- a, --author <name> add Author
- l, --license <name> add License
- h, --help output usage information
```
### Commands in Templates
- npm start
- _Open Document Development Environment to Provide Development Environment for Component Development and Document Website Development_
- npm run lib
- _Use Babel to compile component libraries into release/lib folder and generate d.ts. The main field points to release/lib/exports.js_
- npm run es
- _tsc is compiled directly into the release/es folder and the d.ts module field is generated to point to release/es/exports.js_
- npm run dist
- _webpack package to release/dist folder_
- npm run app
- _webpack packaged document website_
- **npm run release**
- _running lib, es, dist, app_
- npm run dts:es
- _Write d.ts to releases_
- npm run dts:lib
- _Write d.ts to release Lib_
- npm run dts
- _writes d.ts to release_
- npm run scss
- _compiles scss_
- npm run test
- _test unit, using `jest + enzyme`, and you have to build a folder under your project or run an error report, `Snapshot` is opened by default_
- npm run cz:init
- _init [commitizen](https://www.npmjs.com/package/commitizen), it will format your `commit message`, **using `git cz` instead `git commit -m`**, and after you commit it will running eslint automatically by [husky](https://www.npmjs.com/package/husky) and [lint-staged](https://www.npmjs.com/package/lint-staged)_
- npm run eslint
- _auto fix tsx, ts, js, jsx, but some problems can't be fixed [eslint](https://cn.eslint.org/docs/user-guide/command-line-interface)_
- npm run changelog
- _generate `CHANGELOG.md` [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog)_
### Examples
raal app (cannot contain react)
npm install installation dependency
## 3. Attention
1. Preload processors use scss
2. CI uses Travis
3. Coverage using codecov
4. The test unit opens snaptshot by default with jest + enzyme
5. Change some default settings in `.script/config.json`
## 4. History
----
### v0.02-alpha1
1. 去除scss:watch 字段
2. 添加 `babel-plugin-transform-rename-import` 在生产环境 import 的.scss 转化为.css
3. 更改.babelrc 为 .babelrc.js
----
### v0.01-alpha6
1. add husky, lint-staged, changelog, commitizen
2. remove prettier because of conflict
3. update .eslintrc
----
### v0.01-alpha4
1. remove tslint, using eslint
2. add `.vscode` and set `"prettier.eslintIntegration": false` because prettier error, details [#672](https://github.com/prettier/prettier-vscode/issues/672)
----
## 5. Development status
- [x] library packaging
- [x] Document Web Packing
- [x] Test Unit
- [ ] Custom Use Library
## 6. Other
If you want to use it only for app development, I copy a lot of create-react-app code.