Skip to content

Commit 244c10b

Browse files
committed
⬆️ 升级依赖
1 parent e84dada commit 244c10b

File tree

6 files changed

+383
-88
lines changed

6 files changed

+383
-88
lines changed

bin/micro-app-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ process.env.NODE_ENV = 'development';
2121

2222
global.extraArgs = program.args;
2323

24-
microApp.koaAdapter.devServer(program, url => {
24+
microApp.koaAdapter.devHot(program, url => {
2525
// success
2626
if (program.openBrowser) {
2727
opn(url);

bin/micro-app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ program
1515
.version(require('../package').version, '-v, --version')
1616
.option('init', 'Init a config file')
1717
.option('-l, --list', 'Show micros list')
18-
.option('-s, --show <name>', 'Show alias & shared list')
18+
.option('-s, --show', 'Show alias & shared list')
1919
.option('-u, --update', 'Update moicros')
2020
.option('-d, --deploy', 'Deploy current commit to container')
2121
.parse(process.argv);
@@ -47,7 +47,7 @@ if (program.list) {
4747
}
4848

4949
if (program.show) {
50-
const name = program.show;
50+
const name = program.args[0] || '*';
5151
require('../libs/show')(name);
5252
}
5353

libs/show.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ module.exports = name => {
2020
const aliasKey = aliasName[0] !== '@' ? `@${aliasName}` : aliasName;
2121
Object.keys(microConfig.alias).forEach(key => {
2222
if (microConfig.alias[key]) {
23-
logger.logo(` * ${chalk.yellow(`${aliasKey}/${key}`)}`);
23+
const currAlias = microConfig.config.alias || {};
24+
const desc = currAlias[key] && currAlias[key].description || false;
25+
const textStrs = [ ` * ${chalk.yellow(`${aliasKey}/${key}`)}` ];
26+
if (desc && typeof desc === 'string') {
27+
textStrs.push(`(${chalk.gray()})`);
28+
}
29+
logger.logo(textStrs.join(' '));
2430
}
2531
});
2632
}
@@ -32,7 +38,13 @@ module.exports = name => {
3238
const aliasKey = aliasName[0] !== '@' ? `@${aliasName}` : aliasName;
3339
Object.keys(microAppConfig.alias).forEach(key => {
3440
if (microAppConfig.alias[key]) {
35-
logger.logo(` * ${chalk.yellow(`${aliasKey}/${key}`)}`);
41+
const currAlias = microAppConfig.config.alias || {};
42+
const desc = currAlias[key] && currAlias[key].description || false;
43+
const textStrs = [ ` * ${chalk.yellow(`${aliasKey}/${key}`)}` ];
44+
if (desc && typeof desc === 'string') {
45+
textStrs.push(`(${chalk.gray()})`);
46+
}
47+
logger.logo(textStrs.join(' '));
3648
}
3749
});
3850
}
@@ -50,7 +62,13 @@ module.exports = name => {
5062
const aliasKey = aliasName[0] !== '@' ? `@${aliasName}` : aliasName;
5163
Object.keys(microConfig.shared).forEach(key => {
5264
if (microConfig.shared[key]) {
53-
logger.logo(` * ${chalk.yellow(`${aliasKey}/${key}`)}`);
65+
const currAlias = microConfig.config.alias || {};
66+
const desc = currAlias[key] && currAlias[key].description || false;
67+
const textStrs = [ ` * ${chalk.yellow(`${aliasKey}/${key}`)}` ];
68+
if (desc && typeof desc === 'string') {
69+
textStrs.push(`(${chalk.gray()})`);
70+
}
71+
logger.logo(textStrs.join(' '));
5472
}
5573
});
5674
}
@@ -62,7 +80,13 @@ module.exports = name => {
6280
const aliasKey = aliasName[0] !== '@' ? `@${aliasName}` : aliasName;
6381
Object.keys(microAppConfig.shared).forEach(key => {
6482
if (microAppConfig.shared[key]) {
65-
logger.logo(` * ${chalk.yellow(`${aliasKey}/${key}`)}`);
83+
const currAlias = microAppConfig.config.alias || {};
84+
const desc = currAlias[key] && currAlias[key].description || false;
85+
const textStrs = [ ` * ${chalk.yellow(`${aliasKey}/${key}`)}` ];
86+
if (desc && typeof desc === 'string') {
87+
textStrs.push(`(${chalk.gray()})`);
88+
}
89+
logger.logo(textStrs.join(' '));
6690
}
6791
});
6892
}

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@micro-app/cli",
3-
"version": "0.0.32",
3+
"version": "0.0.50",
44
"description": "micro app cli",
55
"bin": {
66
"micro-app": "./bin/micro-app.js",
@@ -27,15 +27,15 @@
2727
},
2828
"license": "ISC",
2929
"devDependencies": {
30-
"babel-eslint": "^10.0.1",
31-
"eslint": "^5.15.0",
32-
"eslint-config-2o3t": "^1.1.4"
30+
"babel-eslint": "^10.0.2",
31+
"eslint": "^5.16.0",
32+
"eslint-config-2o3t": "^1.1.17"
3333
},
3434
"dependencies": {
35-
"@micro-app/core": "^0.0.32",
35+
"@micro-app/core": "^0.0.50",
3636
"chalk": "^2.4.2",
3737
"commander": "^2.19.0",
38-
"opn": "^5.4.0",
38+
"opn": "^5.5.0",
3939
"shelljs": "^0.8.3"
4040
}
4141
}

test/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
'use strict';
22

3-
const deploy = require('../libs/deploy');
4-
deploy();
3+
// const deploy = require('../libs/deploy');
4+
// deploy();
5+
6+
7+
const microApp = require('../bin/micro-app-dev');

0 commit comments

Comments
 (0)