Skip to content

Commit 99a3d5c

Browse files
authored
Merge pull request #18 from MicroAppJS/develop
:feat: 增加 parseConfig 方法
2 parents 4b8f73a + 022002a commit 99a3d5c

Some content is hidden

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

60 files changed

+1545
-668
lines changed
File renamed without changes.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Pluggable micro application framework.
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-Core/badge.svg?branch=master
13-
[Coverage-url]: https://coveralls.io/github/MicrosApp/MicroApp-Core?branch=master
14-
[CircleCI-img]: https://circleci.com/gh/MicrosApp/MicroApp-Core/tree/master.svg?style=svg
15-
[CircleCI-url]: https://circleci.com/gh/MicrosApp/MicroApp-Core/tree/master
12+
[Coverage-img]: https://coveralls.io/repos/github/MicroAppJS/MicroApp-Core/badge.svg?branch=master
13+
[Coverage-url]: https://coveralls.io/github/MicroAppJS/MicroApp-Core?branch=master
14+
[CircleCI-img]: https://circleci.com/gh/MicroAppJS/MicroApp-Core/tree/master.svg?style=svg
15+
[CircleCI-url]: https://circleci.com/gh/MicroAppJS/MicroApp-Core/tree/master
1616
[npm-img]: https://img.shields.io/npm/v/@micro-app/core.svg?style=flat-square
1717
[npm-url]: https://npmjs.org/package/@micro-app/core
1818
[download-img]: https://img.shields.io/npm/dm/@micro-app/core.svg?style=flat-square

libs/Config/index.js

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

libs/Service/base/BaseService.js

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

micro-app.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ module.exports = {
4545

4646
strict: true,
4747

48-
micros: [ 'test', 'abab' ], // 被注册的容器
48+
micros: [ 'test', 'abab', '@micro/shared-utils',
49+
'git+ssh://[email protected]:22222/ops-fullstack/micro/micro-gportal.git#e718f77fce613a3044c451264e75e9e64b2941f7'
50+
], // 被注册的容器
4951

5052
// 服务配置
5153
server: {

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
{
22
"name": "@micro-app/core",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
4+
"private": true,
45
"description": "[Core] Pluggable micro application framework.",
56
"main": "src/index.js",
67
"scripts": {
78
"lint": "eslint .",
89
"lint:fix": "npm run lint -- --fix",
910
"test": "jest"
1011
},
11-
"homepage": "https://github.com/MicrosApp/MicroApp-Core",
12+
"homepage": "https://github.com/MicroAppJS/MicroApp-Core",
1213
"repository": {
1314
"type": "git",
14-
"url": "git+https://github.com/MicrosApp/MicroApp-Core.git"
15+
"url": "git+https://github.com/MicroAppJS/MicroApp-Core.git"
1516
},
1617
"bugs": {
17-
"url": "https://github.com/MicrosApp/MicroApp-Core/issues"
18+
"url": "https://github.com/MicroAppJS/MicroApp-Core/issues"
1819
},
1920
"files": [
20-
"libs",
2121
"src",
22-
"plugins",
2322
"micro-app.config.js"
2423
],
2524
"keywords": [
@@ -52,11 +51,14 @@
5251
"yargs-parser": "^13.1.1"
5352
},
5453
"dependencies": {
55-
"@micro-app/shared-utils": "^0.0.3",
54+
"@micro-app/shared-utils": "file:../MicroApp-Shared-Utils",
5655
"ajv": "^6.10.2",
5756
"ajv-keywords": "^3.4.1",
5857
"dotenv": "^8.2.0"
5958
},
59+
"peerDependencies": {
60+
"@micro-app/shared-utils": ">=0.1.0"
61+
},
6062
"engines": {
6163
"node": ">=8"
6264
}

libs/Config/index.test.js renamed to src/core/Config/Config.test.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* global expect */
44

55
const MicroAppConfig = require('./index');
6-
const loadFile = require('../../src/utils/loadFile');
6+
const loadFile = require('../../utils/loadFile');
77

88
describe('MicroAppConfig', () => {
99

@@ -43,8 +43,8 @@ describe('MicroAppConfig', () => {
4343
expect(config.toJSON(true)).not.toBeUndefined();
4444
expect(config.toJSON(true)).not.toBeNull();
4545

46-
expect(config.toConfig(true)).not.toBeUndefined();
47-
expect(config.toConfig(true)).not.toBeNull();
46+
expect(config).not.toBeUndefined();
47+
expect(config).not.toBeNull();
4848

4949
// 已迁移
5050
expect(config.webpack).toBeUndefined();
@@ -77,8 +77,8 @@ describe('MicroAppConfig', () => {
7777
expect(config.toJSON(true)).not.toBeUndefined();
7878
expect(config.toJSON(true)).not.toBeNull();
7979

80-
expect(config.toConfig(true)).not.toBeUndefined();
81-
expect(config.toConfig(true)).not.toBeNull();
80+
expect(config).not.toBeUndefined();
81+
expect(config).not.toBeNull();
8282

8383
// 已迁移
8484
expect(config.webpack).toBeUndefined();
@@ -91,4 +91,24 @@ describe('MicroAppConfig', () => {
9191
expect(config.server).toBeUndefined();
9292
expect(config.toServerConfig).toBeUndefined();
9393
});
94+
95+
it('manifest', () => {
96+
const defaultConfig = loadFile(process.cwd(), 'micro-app.config.js');
97+
const config = new MicroAppConfig(Object.assign({}, defaultConfig, {
98+
99+
}));
100+
101+
expect(config.manifest).not.toBeUndefined();
102+
expect(config.manifest).not.toBeNull();
103+
});
104+
105+
it('licensePath', () => {
106+
const defaultConfig = loadFile(process.cwd(), 'micro-app.config.js');
107+
const config = new MicroAppConfig(Object.assign({}, defaultConfig, {
108+
109+
}));
110+
111+
expect(config.licensePath).not.toBeUndefined();
112+
expect(config.licensePath).not.toBeNull();
113+
});
94114
});

0 commit comments

Comments
 (0)