@inquirer/password 3.0.1 → 4.0.0
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/dist/{cjs → commonjs}/index.js +3 -12
- package/dist/commonjs/package.json +3 -0
- package/dist/esm/package.json +3 -0
- package/package.json +48 -35
- package/dist/esm/types/index.d.mts +0 -10
- /package/dist/{cjs/types → commonjs}/index.d.ts +0 -0
- /package/dist/{types → esm}/index.d.ts +0 -0
- /package/dist/esm/{index.mjs → index.js} +0 -0
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -21,7 +12,7 @@ exports.default = (0, core_1.createPrompt)((config, done) => {
|
|
|
21
12
|
const [errorMsg, setError] = (0, core_1.useState)();
|
|
22
13
|
const [value, setValue] = (0, core_1.useState)('');
|
|
23
14
|
const prefix = (0, core_1.usePrefix)({ status, theme });
|
|
24
|
-
(0, core_1.useKeypress)((key, rl) =>
|
|
15
|
+
(0, core_1.useKeypress)(async (key, rl) => {
|
|
25
16
|
// Ignore keypress while our prompt is doing other processing.
|
|
26
17
|
if (status !== 'idle') {
|
|
27
18
|
return;
|
|
@@ -29,7 +20,7 @@ exports.default = (0, core_1.createPrompt)((config, done) => {
|
|
|
29
20
|
if ((0, core_1.isEnterKey)(key)) {
|
|
30
21
|
const answer = value;
|
|
31
22
|
setStatus('loading');
|
|
32
|
-
const isValid =
|
|
23
|
+
const isValid = await validate(answer);
|
|
33
24
|
if (isValid === true) {
|
|
34
25
|
setValue(answer);
|
|
35
26
|
setStatus('done');
|
|
@@ -47,7 +38,7 @@ exports.default = (0, core_1.createPrompt)((config, done) => {
|
|
|
47
38
|
setValue(rl.line);
|
|
48
39
|
setError(undefined);
|
|
49
40
|
}
|
|
50
|
-
})
|
|
41
|
+
});
|
|
51
42
|
const message = theme.style.message(config.message, status);
|
|
52
43
|
let formattedValue = '';
|
|
53
44
|
let helpTip;
|
package/package.json
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/password",
|
|
3
|
-
"version": "
|
|
4
|
-
"engines": {
|
|
5
|
-
"node": ">=18"
|
|
6
|
-
},
|
|
3
|
+
"version": "4.0.0",
|
|
7
4
|
"description": "Inquirer password prompt",
|
|
8
|
-
"main": "./dist/cjs/index.js",
|
|
9
|
-
"typings": "./dist/cjs/types/index.d.ts",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist/**/*"
|
|
12
|
-
],
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "https://github.com/SBoudrias/Inquirer.js.git"
|
|
16
|
-
},
|
|
17
5
|
"keywords": [
|
|
18
6
|
"answer",
|
|
19
7
|
"answers",
|
|
@@ -53,38 +41,63 @@
|
|
|
53
41
|
"yo",
|
|
54
42
|
"zsh"
|
|
55
43
|
],
|
|
56
|
-
"author": "Simon Boudrias <admin@simonboudrias.com>",
|
|
57
|
-
"license": "MIT",
|
|
58
44
|
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/password/README.md",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/SBoudrias/Inquirer.js.git"
|
|
48
|
+
},
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"author": "Simon Boudrias <admin@simonboudrias.com>",
|
|
51
|
+
"sideEffects": false,
|
|
52
|
+
"type": "module",
|
|
53
|
+
"exports": {
|
|
54
|
+
"./package.json": "./package.json",
|
|
55
|
+
".": {
|
|
56
|
+
"import": {
|
|
57
|
+
"types": "./dist/esm/index.d.ts",
|
|
58
|
+
"default": "./dist/esm/index.js"
|
|
59
|
+
},
|
|
60
|
+
"require": {
|
|
61
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
62
|
+
"default": "./dist/commonjs/index.js"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"main": "./dist/commonjs/index.js",
|
|
67
|
+
"module": "./dist/esm/index.js",
|
|
68
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
69
|
+
"files": [
|
|
70
|
+
"dist"
|
|
71
|
+
],
|
|
72
|
+
"scripts": {
|
|
73
|
+
"attw": "attw --pack",
|
|
74
|
+
"tsc": "tshy"
|
|
75
|
+
},
|
|
59
76
|
"dependencies": {
|
|
60
|
-
"@inquirer/core": "^
|
|
61
|
-
"@inquirer/type": "^
|
|
77
|
+
"@inquirer/core": "^10.0.0",
|
|
78
|
+
"@inquirer/type": "^3.0.0",
|
|
62
79
|
"ansi-escapes": "^4.3.2"
|
|
63
80
|
},
|
|
64
81
|
"devDependencies": {
|
|
65
|
-
"@
|
|
82
|
+
"@arethetypeswrong/cli": "^0.16.4",
|
|
83
|
+
"@inquirer/testing": "^2.1.35",
|
|
84
|
+
"@repo/tsconfig": "workspace:*",
|
|
85
|
+
"tshy": "^3.0.2"
|
|
66
86
|
},
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"tsc:esm": "rm -rf dist/esm && tsc -p ./tsconfig.json",
|
|
70
|
-
"tsc:cjs": "rm -rf dist/cjs && tsc -p ./tsconfig.cjs.json && node ../../tools/fix-ext.mjs",
|
|
71
|
-
"attw": "attw --pack"
|
|
87
|
+
"engines": {
|
|
88
|
+
"node": ">=18"
|
|
72
89
|
},
|
|
73
90
|
"publishConfig": {
|
|
74
91
|
"access": "public"
|
|
75
92
|
},
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
"types": "./dist/cjs/types/index.d.ts",
|
|
84
|
-
"default": "./dist/cjs/index.js"
|
|
85
|
-
}
|
|
93
|
+
"tshy": {
|
|
94
|
+
"exclude": [
|
|
95
|
+
"src/**/*.test.ts"
|
|
96
|
+
],
|
|
97
|
+
"exports": {
|
|
98
|
+
"./package.json": "./package.json",
|
|
99
|
+
".": "./src/index.ts"
|
|
86
100
|
}
|
|
87
101
|
},
|
|
88
|
-
"
|
|
89
|
-
"gitHead": "9e29035c2efc78f44aed3c7732aee46ab1d64ca2"
|
|
102
|
+
"gitHead": "483189975eb5ea7d214c265a5ce108544c2bf1a5"
|
|
90
103
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type Theme } from '@inquirer/core';
|
|
2
|
-
import type { PartialDeep } from '@inquirer/type';
|
|
3
|
-
type PasswordConfig = {
|
|
4
|
-
message: string;
|
|
5
|
-
mask?: boolean | string;
|
|
6
|
-
validate?: (value: string) => boolean | string | Promise<string | boolean>;
|
|
7
|
-
theme?: PartialDeep<Theme>;
|
|
8
|
-
};
|
|
9
|
-
declare const _default: import("@inquirer/type").Prompt<string, PasswordConfig>;
|
|
10
|
-
export default _default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|