Skip to content

Commit 0bea4b9

Browse files
committed
chore: init project
0 parents  commit 0bea4b9

Some content is hidden

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

52 files changed

+2255
-0
lines changed

.editorconfig

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

.eslintignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
node_modules
2+
dist
3+
build
4+
coverage
5+
expected
6+
website
7+
gh-pages
8+
vendors
9+
packages/build-scripts/test
10+
packages/template-plugin/tests
11+
packages/build-scripts/bin
12+
packages/build-scripts/lib
13+
packages/build-plugin-store/lib
14+
packages/build-plugin-ice-router/lib
15+
packages/build-plugin-ice-stark-child/lib
16+
packages/build-plugin-env-config/lib
17+
packages/build-plugin-webpack5/lib
18+
packages/build-plugin-rml/lib
19+
packages/build-plugin-stark-module/lib
20+
packages/build-plugin-stark-module/test
21+
packages/template-component-demo/lib
22+
packages/template-component-demo/es
23+
examples

.eslintrc.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const { eslint, tslint, deepmerge } = require('@ice/spec');
2+
3+
const commonRules = {
4+
'global-require': 0,
5+
'import/no-dynamic-require': 0,
6+
'no-restricted-syntax': ['error', "BinaryExpression[operator='of']"],
7+
};
8+
9+
const jsRules = deepmerge(eslint, {
10+
rules: {
11+
...commonRules,
12+
},
13+
});
14+
15+
const tsRules = deepmerge(tslint, {
16+
rules: {
17+
...commonRules,
18+
'@typescript-eslint/explicit-function-return-type': ['warn', {
19+
allowTypedFunctionExpressions: true,
20+
}],
21+
},
22+
});
23+
24+
delete tsRules.root;
25+
26+
module.exports = {
27+
...jsRules,
28+
overrides: [
29+
{
30+
...tsRules,
31+
files: ['**/*.ts', '**/*.tsx'],
32+
},
33+
],
34+
};

.gitignore

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
node_modules
2+
.DS_Store
3+
lerna-debug.log
4+
npm-debug.log
5+
mochawesome-report
6+
.happypack
7+
package-lock.json
8+
yarn.lock
9+
yarn-error.log
10+
tempDir
11+
coverage/
12+
13+
.eslintcache
14+
databases
15+
build
16+
.vscode/
17+
.tmp/
18+
19+
npmrc
20+
21+
*~
22+
*.swp
23+
.DS_Store
24+
npm-debug.log
25+
lerna-debug.log
26+
npm-debug.log*
27+
# lib/
28+
packages/build-scripts/lib
29+
packages/build-plugin-store/lib
30+
packages/build-plugin-ice-router/lib
31+
packages/build-plugin-ice-stark-child/lib
32+
packages/build-plugin-env-config/lib
33+
packages/build-plugin-webpack5/lib
34+
packages/build-plugin-rml/lib
35+
packages/build-plugin-stark-module/lib
36+
dist/
37+
.idea/
38+
examples/react-component/lib
39+
examples/react-component/es
40+
packages/template-component-demo/lib
41+
packages/template-component-demo/es
42+

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/test/**/*.ts
2+
**/test/**/*.js
3+
**/template/**/*.template
4+
**/template/**/*.tpl

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true
6+
}

.travis.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sudo: required
2+
language: node_js
3+
node_js:
4+
- '8'
5+
script:
6+
- npm run lint
7+
cache:
8+
directories:
9+
- node_modules

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT LICENSE
2+
3+
Copyright (c) 2018-present Alibaba Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
12+
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# build-scripts
2+
3+
[![NPM version](https://img.shields.io/npm/v/@alib/build-scripts.svg?style=flat)](https://npmjs.org/package/@alib/build-scripts)
4+
[![NPM downloads](https://img.shields.io/npm/dm/@alib/build-scripts.svg?style=flat)](https://npmjs.org/package/@alib/build-scripts)
5+
6+
> build-scripts 基于 webpack 提供高可配置的工程构建工具,依赖强大的插件系统和生态支持不同类型的项目开发
7+
> build-scripts 目前已支持 React 和 Rax 的项目和组件构建
8+
9+
## 特性
10+
11+
- 完善灵活的插件能力,帮助扩展不同工程构建的场景
12+
- 丰富的插件生态,提供 React 和 Rax 体系下开箱即用的工程能力
13+
- 提供多构建任务机制,支持同时构建多份产物
14+
- 基于 webpack-chain 提供灵活的自定义 webpack 配置能力
15+
- 支持基于 Jest 的测试能力
16+
17+
## 场景支持
18+
19+
build-scripts 目前支持以下五种场景,每个场景在能力和体验上都努力做到极致:
20+
21+
- [React 项目开发](https://ice.work/docs/guide/basic/build)
22+
- [React 组件开发](https://ice.work/docs/materials/guide/component)
23+
- [Rax 项目开发](https://rax.js.org/docs/guide/getting-start)
24+
- [Rax 组件开发](https://rax.js.org/docs/guide/build-plugin-rax-component)
25+
- API 类 npm 包开发
26+
27+
## 工程生态
28+
29+
| Project | Version | Docs | Description |
30+
|----------------|-----------------------------------------|--------------|-----------|
31+
| [icejs] | [![icejs-status]][icejs-package] | [docs][icejs-docs] |A universal framework based on react|
32+
| [rax-scripts] | [![rax-scripts-status]][rax-scripts-package] | [docs][rax-scripts-docs] |Rax official engineering tools use @alib/build-scripts|
33+
34+
[icejs]: https://github.com/alibaba/ice
35+
[rax-scripts]: https://github.com/raxjs/rax-scripts
36+
37+
[icejs-status]: https://img.shields.io/npm/v/ice.js.svg
38+
[rax-scripts-status]: https://img.shields.io/npm/v/build-plugin-rax-app.svg
39+
40+
[icejs-package]: https://npmjs.com/package/ice.js
41+
[rax-scripts-package]: https://npmjs.com/package/build-plugin-rax-app
42+
43+
[icejs-docs]: https://ice.work/docs/guide/intro
44+
[rax-scripts-docs]: https://rax.js.org/
45+
46+
## License
47+
48+
[MIT](LICENSE)

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

lerna.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"version": "independent",
3+
"npmClient": "yarn",
4+
"useWorkspaces": true,
5+
"packages": [
6+
"packages/*"
7+
],
8+
"command": {
9+
}
10+
}

package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"private": true,
3+
"workspaces": [
4+
"packages/*"
5+
],
6+
"scripts": {
7+
"clean": "rm -rf node_modules ./packages/*/node_modules",
8+
"setup": "npm run clean && yarn install --registry=https://registry.npm.taobao.org && lerna bootstrap --registry=https://registry.npm.taobao.org",
9+
"lint": "eslint --cache --quiet --ext .js,.ts ./",
10+
"lint-fix": "eslint --cache --ext .js,.ts ./ --fix",
11+
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'"
12+
},
13+
"husky": {
14+
"hooks": {
15+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
16+
"pre-commit": "npm run lint"
17+
}
18+
},
19+
"devDependencies": {
20+
"@commitlint/cli": "^7.5.2",
21+
"@commitlint/config-conventional": "^7.5.0",
22+
"@ice/spec": "^0.1.4",
23+
"eslint": "^6.0.1",
24+
"husky": "^1.3.1",
25+
"lerna": "^3.16.4",
26+
"prettier": "^1.19.1",
27+
"typescript": "^3.7.4"
28+
}
29+
}

packages/build-scripts/CHANGELOG.md

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Changelog
2+
3+
## 0.1.26
4+
5+
- [feat] support merge modeConfig with userConfig
6+
7+
## 0.1.25
8+
9+
- [fix] error state when DISABLE_STATS
10+
11+
## 0.1.24
12+
13+
- [fix] throw error when webpack compile stats with errors
14+
- [fix] check plugins after concat with built-in plugins
15+
16+
## 0.1.23
17+
18+
- [feat] support custom webpack
19+
20+
## 0.1.22
21+
22+
- [feat] support process.env.DISABLE_STATS to control webpack stats output
23+
24+
## 0.1.21
25+
26+
- [feat] optimize webpack log information
27+
- [fix] ts declaration of command API
28+
29+
## 0.1.20
30+
31+
- [feat] support inspect in start
32+
33+
## 0.1.19
34+
35+
- [feat] support JSON5
36+
- [fix] log server url after compiler is done
37+
38+
## 0.1.18
39+
40+
- [feat] support log public ip by set process.env.PUBLIC_IP
41+
42+
## 0.1.17
43+
44+
- [fix] log ip url for terminal
45+
46+
## 0.1.16
47+
48+
- [fix] strip dashed cli option for command test
49+
50+
## 0.1.15
51+
52+
- [feat] support getBuiltInPlugins to setup built-in plugins
53+
54+
## 0.1.14
55+
56+
- [feat] support cli option --disable-ask to disable inquire before server start
57+
58+
## 0.1.13
59+
60+
- [feat] new plugin API: getAllPlugin
61+
- [feat] support options to config default plugins
62+
- [fix] --port is not effective when config devServer.port
63+
64+
## 0.1.12
65+
66+
- [fix] remove fusion-collect from build-script
67+
68+
## 0.1.11
69+
70+
- [feat] support process.env.DISABLE_COLLECT to disable pv collect
71+
- [fix] modify return type of applyMethod
72+
73+
## 0.1.10
74+
75+
- [fix] plugin options support json values
76+
77+
## 0.1.9
78+
79+
- [feat] collect data of command execution
80+
81+
## 0.1.8
82+
83+
- [fix] parse process.argv to get cli options
84+
85+
## 0.1.7
86+
87+
- [feat] support API onGetJestConfig to modify jest config
88+
89+
## 0.1.6
90+
91+
- [refactor] command register for debug
92+
- [fix] compatible with empty webpack config
93+
- [fix] type of plugin options
94+
95+
## 0.1.5
96+
97+
- [feat] refactor with typescript
98+
- [feat] new plugin API registerMethod, applyMethod and modifyUserConfig
99+
100+
## 0.1.4
101+
102+
- [fix] add process.env.RESTART_DEV for mark restart dev process
103+
104+
## 0.1.3
105+
106+
- [fix] timing of register modify webpack config functions.
107+
- [fix] change timing of the 'after.start.compile' hook.

packages/build-scripts/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# build-scripts
2+
3+
Command line tools based on `webpack` and `jest` for developing front-end projects.

0 commit comments

Comments
 (0)