@inquirer/core 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +12 -12
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/lib/Paginator.js +1 -1
- package/dist/cjs/lib/prefix.js +1 -1
- package/dist/cjs/lib/screen-manager.js +2 -2
- package/package.json +7 -8
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -62,22 +62,22 @@ const answer = await confirm({ message: 'Do you want to continue?' });
|
|
|
62
62
|
|
|
63
63
|
See more examples:
|
|
64
64
|
|
|
65
|
-
- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/confirm/src/index.
|
|
66
|
-
- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/input/src/index.
|
|
67
|
-
- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/password/src/index.
|
|
68
|
-
- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/editor/src/index.
|
|
69
|
-
- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/select/src/index.
|
|
70
|
-
- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/checkbox/src/index.
|
|
71
|
-
- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/rawlist/src/index.
|
|
72
|
-
- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/expand/src/index.
|
|
65
|
+
- [Confirm Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/confirm/src/index.mts)
|
|
66
|
+
- [Input Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/input/src/index.mts)
|
|
67
|
+
- [Password Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/password/src/index.mts)
|
|
68
|
+
- [Editor Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/editor/src/index.mts)
|
|
69
|
+
- [Select Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/select/src/index.mts)
|
|
70
|
+
- [Checkbox Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/checkbox/src/index.mts)
|
|
71
|
+
- [Rawlist Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/rawlist/src/index.mts)
|
|
72
|
+
- [Expand Prompt](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/expand/src/index.mts)
|
|
73
73
|
|
|
74
74
|
## API
|
|
75
75
|
|
|
76
|
-
### `createPrompt(
|
|
76
|
+
### `createPrompt(viewFn)`
|
|
77
77
|
|
|
78
|
-
The `createPrompt` function returns an asynchronous function that returns a promise
|
|
78
|
+
The `createPrompt` function returns an asynchronous function that returns a promise resolving to the valid answer a user submit. This prompt function takes the prompt configuration as its first argument (this is defined by each prompt), and the context options as a second argument.
|
|
79
79
|
|
|
80
|
-
The context options are:
|
|
80
|
+
The prompt configuration is unique to each prompt. The context options are:
|
|
81
81
|
|
|
82
82
|
| Property | Type | Required | Description |
|
|
83
83
|
| ----------------- | ----------------------- | -------- | ------------------------------------------------------------ |
|
|
@@ -135,5 +135,5 @@ export default createPrompt((config, done) => {
|
|
|
135
135
|
|
|
136
136
|
# License
|
|
137
137
|
|
|
138
|
-
Copyright (c)
|
|
138
|
+
Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>
|
|
139
139
|
Licensed under the MIT license.
|
package/dist/cjs/index.js
CHANGED
|
@@ -29,12 +29,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.createPrompt = exports.useRef = exports.useKeypress = exports.useEffect = exports.useState = exports.usePrefix = void 0;
|
|
30
30
|
const node_readline_1 = __importDefault(require("node:readline"));
|
|
31
31
|
const mute_stream_1 = __importDefault(require("mute-stream"));
|
|
32
|
-
const screen_manager_mjs_1 = __importDefault(require("./lib/screen-manager.
|
|
33
|
-
const options_mjs_1 = require("./lib/options.
|
|
34
|
-
var prefix_mjs_1 = require("./lib/prefix.
|
|
32
|
+
const screen_manager_mjs_1 = __importDefault(require("./lib/screen-manager.js"));
|
|
33
|
+
const options_mjs_1 = require("./lib/options.js");
|
|
34
|
+
var prefix_mjs_1 = require("./lib/prefix.js");
|
|
35
35
|
Object.defineProperty(exports, "usePrefix", { enumerable: true, get: function () { return prefix_mjs_1.usePrefix; } });
|
|
36
|
-
__exportStar(require("./lib/key.
|
|
37
|
-
__exportStar(require("./lib/Paginator.
|
|
36
|
+
__exportStar(require("./lib/key.js"), exports);
|
|
37
|
+
__exportStar(require("./lib/Paginator.js"), exports);
|
|
38
38
|
const hooks = [];
|
|
39
39
|
const hooksCleanup = [];
|
|
40
40
|
const hooksEffect = [];
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Paginator = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const cli_width_1 = __importDefault(require("cli-width"));
|
|
9
|
-
const utils_mjs_1 = require("./utils.
|
|
9
|
+
const utils_mjs_1 = require("./utils.js");
|
|
10
10
|
/**
|
|
11
11
|
* The paginator keeps track of a pointer index in a list and returns
|
|
12
12
|
* a subset of the choices if the list is too long.
|
package/dist/cjs/lib/prefix.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.usePrefix = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const cli_spinners_1 = __importDefault(require("cli-spinners"));
|
|
9
|
-
const index_mjs_1 = require("../index.
|
|
9
|
+
const index_mjs_1 = require("../index.js");
|
|
10
10
|
const spinner = cli_spinners_1.default.dots;
|
|
11
11
|
function usePrefix(isLoading = false) {
|
|
12
12
|
const [tick, setTick] = (0, index_mjs_1.useState)(0);
|
|
@@ -30,8 +30,8 @@ const cli_width_1 = __importDefault(require("cli-width"));
|
|
|
30
30
|
const strip_ansi_1 = __importDefault(require("strip-ansi"));
|
|
31
31
|
const string_width_1 = __importDefault(require("string-width"));
|
|
32
32
|
const ansi_escapes_1 = __importDefault(require("ansi-escapes"));
|
|
33
|
-
const util = __importStar(require("./readline.
|
|
34
|
-
const utils_mjs_1 = require("./utils.
|
|
33
|
+
const util = __importStar(require("./readline.js"));
|
|
34
|
+
const utils_mjs_1 = require("./utils.js");
|
|
35
35
|
const height = (content) => content.split('\n').length;
|
|
36
36
|
const lastLine = (content) => { var _a; return (_a = content.split('\n').pop()) !== null && _a !== void 0 ? _a : ''; };
|
|
37
37
|
class ScreenManager {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=14.18.0"
|
|
6
6
|
},
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"license": "MIT",
|
|
58
58
|
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/core/README.md",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@inquirer/type": "^0.1
|
|
61
|
-
"ansi-escapes": "^6.
|
|
60
|
+
"@inquirer/type": "^1.0.1",
|
|
61
|
+
"ansi-escapes": "^6.2.0",
|
|
62
62
|
"chalk": "^5.2.0",
|
|
63
|
-
"cli-spinners": "^2.
|
|
63
|
+
"cli-spinners": "^2.8.0",
|
|
64
64
|
"cli-width": "^4.0.0",
|
|
65
65
|
"lodash": "^4.17.21",
|
|
66
66
|
"mute-stream": "^1.0.0",
|
|
@@ -70,15 +70,14 @@
|
|
|
70
70
|
"wrap-ansi": "^8.1.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@inquirer/testing": "^0.1
|
|
74
|
-
"@jest/globals": "^29.5.0"
|
|
73
|
+
"@inquirer/testing": "^1.0.1"
|
|
75
74
|
},
|
|
76
75
|
"scripts": {
|
|
77
76
|
"tsc": "yarn run clean && yarn run tsc:esm && yarn run tsc:cjs",
|
|
78
77
|
"clean": "rm -rf dist",
|
|
79
78
|
"tsc:esm": "tsc -p ./tsconfig.esm.json",
|
|
80
79
|
"tsc:cjs": "tsc -p ./tsconfig.cjs.json && yarn run fix-ext",
|
|
81
|
-
"fix-ext": "ts-node ../../tools/rename-ext.
|
|
80
|
+
"fix-ext": "ts-node ../../tools/rename-ext.mts"
|
|
82
81
|
},
|
|
83
82
|
"publishConfig": {
|
|
84
83
|
"access": "public"
|
|
@@ -95,5 +94,5 @@
|
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
96
|
},
|
|
98
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "5b8563d850962ce48daba46e7e95e7285d581a56"
|
|
99
98
|
}
|