@inquirer/core 10.0.1 → 10.1.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.
|
@@ -6,8 +6,9 @@ import type { Prettify } from '@inquirer/type';
|
|
|
6
6
|
* - `'idle'`: The prompt is loaded and currently waiting for the user to
|
|
7
7
|
* submit an answer.
|
|
8
8
|
* - `'done'`: The user has submitted an answer and the prompt is finished.
|
|
9
|
+
* - `string`: Any other string: The prompt is in a custom state.
|
|
9
10
|
*/
|
|
10
|
-
export type Status = 'loading' | 'idle' | 'done';
|
|
11
|
+
export type Status = 'loading' | 'idle' | 'done' | (string & {});
|
|
11
12
|
type DefaultTheme = {
|
|
12
13
|
/**
|
|
13
14
|
* Prefix to prepend to the message. If a function is provided, it will be
|
|
@@ -35,5 +35,5 @@ function usePrefix({ status = 'idle', theme, }) {
|
|
|
35
35
|
}
|
|
36
36
|
// There's a delay before we show the loader. So we want to ignore `loading` here, and pass idle instead.
|
|
37
37
|
const iconName = status === 'loading' ? 'idle' : status;
|
|
38
|
-
return typeof prefix === 'string' ? prefix : prefix[iconName];
|
|
38
|
+
return typeof prefix === 'string' ? prefix : (prefix[iconName] ?? prefix['idle']);
|
|
39
39
|
}
|
package/dist/esm/lib/theme.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ import type { Prettify } from '@inquirer/type';
|
|
|
6
6
|
* - `'idle'`: The prompt is loaded and currently waiting for the user to
|
|
7
7
|
* submit an answer.
|
|
8
8
|
* - `'done'`: The user has submitted an answer and the prompt is finished.
|
|
9
|
+
* - `string`: Any other string: The prompt is in a custom state.
|
|
9
10
|
*/
|
|
10
|
-
export type Status = 'loading' | 'idle' | 'done';
|
|
11
|
+
export type Status = 'loading' | 'idle' | 'done' | (string & {});
|
|
11
12
|
type DefaultTheme = {
|
|
12
13
|
/**
|
|
13
14
|
* Prefix to prepend to the message. If a function is provided, it will be
|
|
@@ -32,5 +32,5 @@ export function usePrefix({ status = 'idle', theme, }) {
|
|
|
32
32
|
}
|
|
33
33
|
// There's a delay before we show the loader. So we want to ignore `loading` here, and pass idle instead.
|
|
34
34
|
const iconName = status === 'loading' ? 'idle' : status;
|
|
35
|
-
return typeof prefix === 'string' ? prefix : prefix[iconName];
|
|
35
|
+
return typeof prefix === 'string' ? prefix : (prefix[iconName] ?? prefix['idle']);
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/core",
|
|
3
|
-
"version": "10.0
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "Core Inquirer prompt API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"answer",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"tsc": "tshy"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@inquirer/figures": "^1.0.
|
|
78
|
-
"@inquirer/type": "^3.0.
|
|
77
|
+
"@inquirer/figures": "^1.0.8",
|
|
78
|
+
"@inquirer/type": "^3.0.1",
|
|
79
79
|
"ansi-escapes": "^4.3.2",
|
|
80
80
|
"cli-width": "^4.1.0",
|
|
81
81
|
"mute-stream": "^2.0.0",
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
"yoctocolors-cjs": "^2.1.2"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@arethetypeswrong/cli": "^0.
|
|
89
|
-
"@inquirer/testing": "^2.1.
|
|
88
|
+
"@arethetypeswrong/cli": "^0.17.0",
|
|
89
|
+
"@inquirer/testing": "^2.1.37",
|
|
90
90
|
"@repo/tsconfig": "workspace:*",
|
|
91
91
|
"@types/mute-stream": "^0.0.4",
|
|
92
|
-
"@types/node": "^22.
|
|
92
|
+
"@types/node": "^22.9.0",
|
|
93
93
|
"@types/wrap-ansi": "^3.0.0",
|
|
94
94
|
"tshy": "^3.0.2"
|
|
95
95
|
},
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
".": "./src/index.ts"
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "84e49bdb552e1cb4f035d644190913f367a66e74"
|
|
112
112
|
}
|