Skip to content

Commit 3f22628

Browse files
authored
Merge pull request #28 from MicroAppJS/develop
Merge Develop
2 parents 51518bd + e8f282a commit 3f22628

Some content is hidden

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

65 files changed

+4558
-4436
lines changed

.circleci/config.yml

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

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @zyao89

.github/workflows/coveralls.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Coveralls
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- develop
7+
jobs:
8+
install-and-coveralls:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@master
14+
15+
- name: Cache node modules
16+
uses: actions/cache@v1
17+
with:
18+
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
19+
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
20+
restore-keys: |
21+
${{ runner.os }}-build-${{ env.cache-name }}-
22+
${{ runner.os }}-build-
23+
${{ runner.os }}-
24+
25+
- name: install
26+
run: yarn --network-timeout 600000
27+
28+
- name: yarn add coveralls
29+
run: |
30+
yarn add -D coveralls
31+
yarn run test --coverage && cat ./coverage/lcov.info
32+
33+
- name: Coveralls
34+
uses: coverallsapp/github-action@master
35+
with:
36+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,6 @@ dist
8787
*.sln
8888
*.sw*
8989

90+
91+
# 特殊备注
92+
micros.json

CHANGELOG.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
## [0.4.1](https://github.com/MicroAppJS/cli/compare/v0.4.0...v0.4.1) (2021-08-04)
2+
3+
4+
### Features
5+
6+
* update deps ([577df0a](https://github.com/MicroAppJS/cli/commit/577df0ae16a415092d34e6b22c4b5b6a5f24afe5))
7+
* 增加适配多服务入口配置逻辑 ([a11d481](https://github.com/MicroAppJS/cli/commit/a11d48155aa933ecfee6d6fab424e1da34e074ff))
8+
9+
# [0.4.0](https://github.com/MicroAppJS/cli/compare/v0.3.17...v0.4.0) (2020-06-10)
10+
11+
12+
### Bug Fixes
13+
14+
* 修复 ([347e2ff](https://github.com/MicroAppJS/cli/commit/347e2ff007ccbf22d919a0aad382af1846e1d40d))
15+
16+
17+
### Features
18+
19+
* add `micro-app-serve` bin ([019262d](https://github.com/MicroAppJS/cli/commit/019262d0da998318a8a0b53d9e6af981a70f9020))
20+
21+
## [0.3.17](https://github.com/MicroAppJS/cli/compare/v0.3.16...v0.3.17) (2020-04-21)
22+
23+
## [0.3.16](https://github.com/MicroAppJS/cli/compare/v0.3.15...v0.3.16) (2020-04-18)
24+
25+
## [0.3.15](https://github.com/MicroAppJS/cli/compare/v0.3.14...v0.3.15) (2020-03-31)
26+
27+
## [0.3.14](https://github.com/MicroAppJS/cli/compare/v0.3.13...v0.3.14) (2020-03-31)
28+
29+
## [0.3.13](https://github.com/MicroAppJS/cli/compare/v0.3.12...v0.3.13) (2020-03-31)
30+
31+
## [0.3.12](https://github.com/MicroAppJS/cli/compare/v0.3.11...v0.3.12) (2020-03-31)
32+
33+
## [0.3.11](https://github.com/MicroAppJS/cli/compare/v0.3.10...v0.3.11) (2020-03-30)
34+
35+
## [0.3.10](https://github.com/MicroAppJS/cli/compare/v0.3.9...v0.3.10) (2020-03-25)
36+
37+
## [0.3.9](https://github.com/MicroAppJS/cli/compare/v0.3.8...v0.3.9) (2020-03-23)
38+
39+
## [0.3.8](https://github.com/MicroAppJS/cli/compare/v0.3.7...v0.3.8) (2020-03-23)
40+
41+
## [0.3.7](https://github.com/MicroAppJS/cli/compare/v0.3.6...v0.3.7) (2020-03-18)
42+
43+
## [0.3.6](https://github.com/MicroAppJS/cli/compare/v0.1.0...v0.3.6) (2020-03-16)
44+
45+
46+
### Bug Fixes
47+
48+
* some bugs ([75d1eea](https://github.com/MicroAppJS/cli/commit/75d1eea5bd7e9dd8290b1fc8f94fd7e8052cacff))
49+
* 修复 bootstrap, 增肌 release 配置 ([92d323e](https://github.com/MicroAppJS/cli/commit/92d323e12212519838f300d27a9198f21c5ec6f5))
50+
51+
52+
### Features
53+
54+
* add build cmd and enhance bootstrap ([677c3c3](https://github.com/MicroAppJS/cli/commit/677c3c32817ee8d293ad2a1cb7e1f378b9bb2e67))
55+
* remove type, add target ([1723ba0](https://github.com/MicroAppJS/cli/commit/1723ba0645ea92b9f2816fa0c446eb623d282ec2))
56+
57+
## [0.3.5](https://github.com/MicroAppJS/cli/compare/v0.1.0...v0.3.5) (2020-03-12)
58+
59+
60+
### Bug Fixes
61+
62+
* some bugs ([75d1eea](https://github.com/MicroAppJS/cli/commit/75d1eea5bd7e9dd8290b1fc8f94fd7e8052cacff))
63+
* 修复 bootstrap, 增肌 release 配置 ([92d323e](https://github.com/MicroAppJS/cli/commit/92d323e12212519838f300d27a9198f21c5ec6f5))
64+
65+
66+
### Features
67+
68+
* add build cmd and enhance bootstrap ([677c3c3](https://github.com/MicroAppJS/cli/commit/677c3c32817ee8d293ad2a1cb7e1f378b9bb2e67))
69+
* remove type, add target ([1723ba0](https://github.com/MicroAppJS/cli/commit/1723ba0645ea92b9f2816fa0c446eb623d282ec2))
70+
71+
## [0.3.4](https://github.com/MicroAppJS/cli/compare/v0.1.0...v0.3.4) (2020-03-11)
72+
73+
74+
### Bug Fixes
75+
76+
* some bugs ([75d1eea](https://github.com/MicroAppJS/cli/commit/75d1eea5bd7e9dd8290b1fc8f94fd7e8052cacff))
77+
* 修复 bootstrap, 增肌 release 配置 ([92d323e](https://github.com/MicroAppJS/cli/commit/92d323e12212519838f300d27a9198f21c5ec6f5))
78+
79+
80+
### Features
81+
82+
* add build cmd and enhance bootstrap ([677c3c3](https://github.com/MicroAppJS/cli/commit/677c3c32817ee8d293ad2a1cb7e1f378b9bb2e67))
83+
* remove type, add target ([1723ba0](https://github.com/MicroAppJS/cli/commit/1723ba0645ea92b9f2816fa0c446eb623d282ec2))
84+
85+
## [0.3.3](https://github.com/MicroAppJS/cli/compare/v0.1.0...v0.3.3) (2020-03-10)
86+
87+
88+
### Bug Fixes
89+
90+
* 修复 bootstrap, 增肌 release 配置 ([92d323e](https://github.com/MicroAppJS/cli/commit/92d323e12212519838f300d27a9198f21c5ec6f5))
91+
92+
93+
### Features
94+
95+
* add build cmd and enhance bootstrap ([677c3c3](https://github.com/MicroAppJS/cli/commit/677c3c32817ee8d293ad2a1cb7e1f378b9bb2e67))
96+
* remove type, add target ([1723ba0](https://github.com/MicroAppJS/cli/commit/1723ba0645ea92b9f2816fa0c446eb623d282ec2))
97+
98+
## [0.3.2](https://github.com/MicroAppJS/cli/compare/v0.1.0...v0.3.2) (2020-03-07)
99+
100+
101+
### Bug Fixes
102+
103+
* 修复 bootstrap, 增肌 release 配置 ([92d323e](https://github.com/MicroAppJS/cli/commit/92d323e12212519838f300d27a9198f21c5ec6f5))
104+
105+
106+
### Features
107+
108+
* add build cmd and enhance bootstrap ([677c3c3](https://github.com/MicroAppJS/cli/commit/677c3c32817ee8d293ad2a1cb7e1f378b9bb2e67))
109+
110+
## [0.3.1](https://github.com/MicroAppJS/cli/compare/v0.1.0...v0.3.1) (2020-02-09)
111+
112+
113+
### Bug Fixes
114+
115+
* 修复 bootstrap, 增肌 release 配置 ([92d323e](https://github.com/MicroAppJS/cli/commit/92d323e12212519838f300d27a9198f21c5ec6f5))
116+
117+
118+
### Features
119+
120+
* add build cmd and enhance bootstrap ([677c3c3](https://github.com/MicroAppJS/cli/commit/677c3c32817ee8d293ad2a1cb7e1f378b9bb2e67))
121+
122+
123+
124+
## 0.0.57 (2019-08-19)
125+

README.md

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Pluggable micro application framework.
44

55
基于webpack多入口的多仓库业务模块开发的插件应用框架脚手架.
66

7+
[![Github Actions Coveralls][Github-Actions-Coveralls]][Github-Actions-Coveralls-url]
78
[![Coverage Status][Coverage-img]][Coverage-url]
8-
[![CircleCI][CircleCI-img]][CircleCI-url]
99
[![NPM Version][npm-img]][npm-url]
1010
[![NPM Download][download-img]][download-url]
1111

12-
[Coverage-img]: https://coveralls.io/repos/github/MicrosApp/MicroApp-CLI/badge.svg?branch=master
13-
[Coverage-url]: https://coveralls.io/github/MicrosApp/MicroApp-CLI?branch=master
14-
[CircleCI-img]: https://circleci.com/gh/MicrosApp/MicroApp-CLI/tree/master.svg?style=svg
15-
[CircleCI-url]: https://circleci.com/gh/MicrosApp/MicroApp-CLI/tree/master
12+
[Github-Actions-Coveralls]: https://github.com/MicroAppJS/cli/workflows/Coveralls/badge.svg
13+
[Github-Actions-Coveralls-url]: https://github.com/MicroAppJS/cli
14+
[Coverage-img]: https://coveralls.io/repos/github/MicroAppJS/cli/badge.svg?branch=master
15+
[Coverage-url]: https://coveralls.io/github/MicroAppJS/cli?branch=master
1616
[npm-img]: https://img.shields.io/npm/v/@micro-app/cli.svg?style=flat-square
1717
[npm-url]: https://npmjs.org/package/@micro-app/cli
1818
[download-img]: https://img.shields.io/npm/dm/@micro-app/cli.svg?style=flat-square
@@ -59,12 +59,6 @@ module.exports = {
5959
},
6060
],
6161

62-
// dlls: [
63-
// {
64-
// context: __dirname,
65-
// },
66-
// ],
67-
6862
alias: { // 别名配置
6963
api: '',
7064
config: {
@@ -84,11 +78,9 @@ module.exports = {
8478

8579
// 服务配置
8680
server: {
81+
hooks: '',
8782
entry: '', // 服务端入口
8883
port: 8088, // 服务端口号
89-
options: {
90-
// 服务端回调参数
91-
},
9284
},
9385

9486
plugins: [ // 自定义插件
@@ -103,7 +95,7 @@ module.exports = {
10395
};
10496
```
10597

106-
### `package.json` 中加载其他模块, 例如:
98+
### `package.json` 中加载其他模块, 例如
10799

108100
```json
109101
"dependencies": {
@@ -175,15 +167,6 @@ module.exports = function(api, opts) {
175167
api.onPluginInitDone(item => {
176168
console.log('onPluginInitDone', item);
177169
});
178-
api.beforeMergeWebpackConfig(item => {
179-
console.log('beforeMergeWebpackConfig', item);
180-
});
181-
api.afterMergeWebpackConfig(item => {
182-
console.log('afterMergeWebpackConfig', item);
183-
});
184-
// api.onChainWebpcakConfig(webpackChainConfig => {
185-
// console.log('onChainWebpcakConfig', webpackChainConfig);
186-
// });
187170
};
188171
```
189172

@@ -209,10 +192,6 @@ npx micro-app show methods
209192
* modifyCommand ( System Build-in )
210193
* onRunCommand ( System Build-in )
211194
* modifyCommandHelp ( System Build-in )
212-
* beforeMergeWebpackConfig ( 合并 webpack 配置之前事件 )
213-
* afterMergeWebpackConfig ( 合并 webpack 配置之后事件 )
214-
* modifyChainWebpcakConfig ( 合并之后提供 webpack-chain 进行再次修改事件 )
215-
* onChainWebpcakConfig ( 修改之后提供 webpack-chain 进行查看事件 )
216195
* modifyWebpackConfig ( 合并之后提供 webpack config 进行再次修改事件 )
217196
* onServerInit ( 服务初始化时事件 )
218197
* onServerInitWillDone ( 服务初始化即将完成事件 )

bin/base.js

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,3 @@
11
'use strict';
22

3-
const checker = require('../src/utils/checker');
4-
if (!checker.checkNode()) {
5-
process.exit(1);
6-
}
7-
checker.checkUpgrade();
8-
9-
const yParser = require('yargs-parser');
10-
const cmd = process.argv[2];
11-
const argv = yParser(process.argv.slice(3));
12-
13-
// 全局环境模式 production, development
14-
process.env.NODE_ENV = argv.mode || process.env.NODE_ENV || 'development';
15-
16-
const { Service, logger } = require('@micro-app/core');
17-
18-
// 全局指令
19-
if (argv.openSoftLink) {
20-
process.env.MICRO_APP_OPEN_SOFT_LINK = argv.openSoftLink || false; // 开启软链接
21-
if (process.env.MICRO_APP_OPEN_SOFT_LINK === 'true') {
22-
logger.info(`开启软链接; --open-soft-link = ${process.env.MICRO_APP_OPEN_SOFT_LINK}`);
23-
}
24-
}
25-
if (argv.openDisabledEntry) {
26-
process.env.MICRO_APP_OPEN_DISABLED_ENTRY = argv.openDisabledEntry || false; // 开启禁用指定模块入口, 优化开发速度
27-
if (process.env.MICRO_APP_OPEN_DISABLED_ENTRY === 'true') {
28-
logger.info(`开启禁用指定模块入口; --open-disabled-entry = ${process.env.MICRO_APP_OPEN_DISABLED_ENTRY}`);
29-
}
30-
}
31-
32-
const service = new Service();
33-
34-
// 注册插件
35-
require('../plugins/register')(service);
36-
37-
module.exports = { cmd, argv, service };
3+
module.exports = require('../');

bin/micro-app-build

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
5+
6+
const { yParser } = require('@micro-app/shared-utils');
7+
const argv = yParser(process.argv.slice(2));
8+
const { service } = require('./base');
9+
10+
service.run('build', argv);

bin/micro-app-dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
55

6-
const yParser = require('yargs-parser');
6+
const { yParser } = require('@micro-app/shared-utils');
77
const argv = yParser(process.argv.slice(2));
88
const { service } = require('./base');
99

bin/micro-app-serve

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
5+
6+
const { yParser } = require('@micro-app/shared-utils');
7+
const argv = yParser(process.argv.slice(2));
8+
const { service } = require('./base');
9+
10+
service.run('serve', argv);

0 commit comments

Comments
 (0)