Skip to content

Commit 8d41519

Browse files
committed
feat: add pageSize for prompt config
1 parent dfa5540 commit 8d41519

File tree

5 files changed

+1535
-1157
lines changed

5 files changed

+1535
-1157
lines changed

microapp/config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
const config = {};
4+
5+
config.plugins = [
6+
'@micro-app/plugin-deploy', // test
7+
];
8+
9+
module.exports = config;

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
"lint": "eslint .",
99
"lint:fix": "npm run lint -- --fix",
1010
"test": "jest",
11-
"release": "release-it -c release-it.js",
11+
"release": "micro-app release",
1212
"release:alpha": "npm run release -- --preRelease=alpha",
13-
"release:next": "npm run release -- --preRelease=next"
13+
"release:next": "npm run release -- --preRelease=next",
14+
"release:minor": "npm run release minor",
15+
"release:patch": "npm run release patch"
1416
},
1517
"homepage": "https://github.com/MicroAppJS/shared-utils",
1618
"repository": {
@@ -44,15 +46,13 @@
4446
]
4547
},
4648
"devDependencies": {
47-
"@release-it/conventional-changelog": "^1.1.0",
48-
"@types/jest": "^24.0.25",
49-
"babel-eslint": "^10.0.3",
50-
"eslint": "^5.16.0",
51-
"eslint-config-2o3t": "^1.1.17",
49+
"@micro-app/cli": "^0.3.6",
50+
"@micro-app/plugin-deploy": "^0.0.6",
51+
"@types/jest": "^24.9.1",
52+
"eslint-config-2o3t": "^2.0.1",
5253
"husky": "^3.1.0",
5354
"jest": "^24.9.0",
5455
"lint-staged": "^9.5.0",
55-
"release-it": "^12.4.3",
5656
"webpack-merge": "^4.2.2"
5757
},
5858
"dependencies": {
@@ -70,14 +70,14 @@
7070
"globby": "^10.0.2",
7171
"hash-sum": "^2.0.0",
7272
"import-fresh": "^3.2.1",
73-
"inquirer": "^7.0.4",
73+
"inquirer": "^7.1.0",
7474
"is-glob": "^4.0.1",
7575
"lodash": "^4.17.15",
7676
"lru-cache": "^5.1.1",
7777
"multimatch": "^4.0.0",
7878
"npm-package-arg": "^6.1.1",
7979
"npmlog": "^4.1.2",
80-
"open": "^7.0.0",
80+
"open": "^7.0.3",
8181
"ora": "^3.4.0",
8282
"parse-json": "^5.0.0",
8383
"semver": "^6.3.0",
@@ -87,8 +87,8 @@
8787
"stream-to-string": "^1.2.0",
8888
"stringify-object": "^3.3.0",
8989
"try-require": "^1.2.1",
90-
"yaml": "^1.7.2",
91-
"yargs-parser": "^16.1.0",
90+
"yaml": "^1.8.2",
91+
"yargs-parser": "^18.1.1",
9292
"yargs-unparser": "^1.5.0"
9393
},
9494
"engines": {

release-it.js

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

src/prompt/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function confirm(message) {
3737
});
3838
}
3939

40-
function select(message, { choices, filter, validate } = {}) {
40+
function select(message, { choices = [], filter, validate, pageSize = choices.length } = {}) {
4141
if (!choices || choices.length <= 0) {
4242
logger.throw('prompt', 'select choices is empty!');
4343
}
@@ -51,7 +51,7 @@ function select(message, { choices, filter, validate } = {}) {
5151
name: 'prompt',
5252
message,
5353
choices,
54-
pageSize: choices.length,
54+
pageSize,
5555
filter,
5656
validate,
5757
}),
@@ -63,7 +63,7 @@ function select(message, { choices, filter, validate } = {}) {
6363
});
6464
}
6565

66-
function check(message, { choices, filter, validate } = {}) {
66+
function check(message, { choices = [], filter, validate, pageSize = choices.length } = {}) {
6767
if (!choices || choices.length <= 0) {
6868
logger.throw('prompt', 'select choices is empty!');
6969
}
@@ -77,7 +77,7 @@ function check(message, { choices, filter, validate } = {}) {
7777
name: 'check',
7878
message,
7979
choices,
80-
pageSize: choices.length,
80+
pageSize,
8181
filter,
8282
validate,
8383
}),

0 commit comments

Comments
 (0)