@inquirer/core 8.2.4 → 9.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/README.md +4 -4
- package/dist/cjs/lib/Separator.js +2 -2
- package/dist/cjs/lib/theme.js +10 -10
- package/dist/cjs/types/index.d.ts +0 -1
- package/dist/cjs/types/lib/hook-engine.d.ts +1 -1
- package/dist/cjs/types/lib/screen-manager.d.ts +1 -1
- package/dist/cjs/types/lib/use-effect.d.ts +1 -1
- package/dist/cjs/types/lib/use-keypress.d.ts +1 -1
- package/dist/esm/lib/Separator.mjs +2 -2
- package/dist/esm/lib/theme.mjs +10 -10
- package/dist/esm/types/index.d.mts +0 -1
- package/dist/esm/types/lib/hook-engine.d.mts +1 -1
- package/dist/esm/types/lib/screen-manager.d.mts +1 -1
- package/dist/esm/types/lib/use-effect.d.mts +1 -1
- package/dist/esm/types/lib/use-keypress.d.mts +1 -1
- package/package.json +6 -6
- package/dist/cjs/lib/read-line.type.js +0 -2
- package/dist/cjs/types/lib/read-line.type.d.ts +0 -7
- package/dist/esm/lib/read-line.type.mjs +0 -1
- package/dist/esm/types/lib/read-line.type.d.mts +0 -7
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ yarn add @inquirer/core
|
|
|
15
15
|
# Usage
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
-
import
|
|
18
|
+
import colors from 'yoctocolors';
|
|
19
19
|
import {
|
|
20
20
|
createPrompt,
|
|
21
21
|
useState,
|
|
@@ -44,12 +44,12 @@ const confirm = createPrompt<boolean, { message: string; default?: boolean }>(
|
|
|
44
44
|
let formattedValue = value;
|
|
45
45
|
let defaultValue = '';
|
|
46
46
|
if (status === 'done') {
|
|
47
|
-
formattedValue =
|
|
47
|
+
formattedValue = colors.cyan(value);
|
|
48
48
|
} else {
|
|
49
|
-
defaultValue =
|
|
49
|
+
defaultValue = colors.dim(config.default === false ? ' (y/N)' : ' (Y/n)');
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const message =
|
|
52
|
+
const message = colors.bold(config.message);
|
|
53
53
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
54
54
|
},
|
|
55
55
|
);
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Separator = void 0;
|
|
7
|
-
const
|
|
7
|
+
const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs"));
|
|
8
8
|
const figures_1 = __importDefault(require("@inquirer/figures"));
|
|
9
9
|
/**
|
|
10
10
|
* Separator object
|
|
@@ -16,7 +16,7 @@ class Separator {
|
|
|
16
16
|
enumerable: true,
|
|
17
17
|
configurable: true,
|
|
18
18
|
writable: true,
|
|
19
|
-
value:
|
|
19
|
+
value: yoctocolors_cjs_1.default.dim(Array.from({ length: 15 }).join(figures_1.default.line))
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(this, "type", {
|
|
22
22
|
enumerable: true,
|
package/dist/cjs/lib/theme.js
CHANGED
|
@@ -4,21 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.defaultTheme = void 0;
|
|
7
|
-
const
|
|
7
|
+
const yoctocolors_cjs_1 = __importDefault(require("yoctocolors-cjs"));
|
|
8
8
|
const cli_spinners_1 = __importDefault(require("cli-spinners"));
|
|
9
9
|
exports.defaultTheme = {
|
|
10
|
-
prefix:
|
|
10
|
+
prefix: yoctocolors_cjs_1.default.green('?'),
|
|
11
11
|
spinner: {
|
|
12
12
|
interval: cli_spinners_1.default.dots.interval,
|
|
13
|
-
frames: cli_spinners_1.default.dots.frames.map((frame) =>
|
|
13
|
+
frames: cli_spinners_1.default.dots.frames.map((frame) => yoctocolors_cjs_1.default.yellow(frame)),
|
|
14
14
|
},
|
|
15
15
|
style: {
|
|
16
|
-
answer:
|
|
17
|
-
message:
|
|
18
|
-
error: (text) =>
|
|
19
|
-
defaultAnswer: (text) =>
|
|
20
|
-
help:
|
|
21
|
-
highlight:
|
|
22
|
-
key: (text) =>
|
|
16
|
+
answer: yoctocolors_cjs_1.default.cyan,
|
|
17
|
+
message: yoctocolors_cjs_1.default.bold,
|
|
18
|
+
error: (text) => yoctocolors_cjs_1.default.red(`> ${text}`),
|
|
19
|
+
defaultAnswer: (text) => yoctocolors_cjs_1.default.dim(`(${text})`),
|
|
20
|
+
help: yoctocolors_cjs_1.default.dim,
|
|
21
|
+
highlight: yoctocolors_cjs_1.default.cyan,
|
|
22
|
+
key: (text) => yoctocolors_cjs_1.default.cyan(yoctocolors_cjs_1.default.bold(`<${text}>`)),
|
|
23
23
|
},
|
|
24
24
|
};
|
|
@@ -11,4 +11,3 @@ export type { Theme } from './lib/theme.js';
|
|
|
11
11
|
export { usePagination } from './lib/pagination/use-pagination.js';
|
|
12
12
|
export { createPrompt } from './lib/create-prompt.js';
|
|
13
13
|
export { Separator } from './lib/Separator.js';
|
|
14
|
-
export { type InquirerReadline } from './lib/read-line.type.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InquirerReadline } from '
|
|
1
|
+
import type { InquirerReadline } from '@inquirer/type';
|
|
2
2
|
export declare function useEffect(cb: (rl: InquirerReadline) => void | (() => void), depArray: ReadonlyArray<unknown>): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type InquirerReadline } from '
|
|
1
|
+
import { type InquirerReadline } from '@inquirer/type';
|
|
2
2
|
import { type KeypressEvent } from './key.js';
|
|
3
3
|
export declare function useKeypress(userHandler: (event: KeypressEvent, rl: InquirerReadline) => void): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import colors from 'yoctocolors-cjs';
|
|
2
2
|
import figures from '@inquirer/figures';
|
|
3
3
|
/**
|
|
4
4
|
* Separator object
|
|
5
5
|
* Used to space/separate choices group
|
|
6
6
|
*/
|
|
7
7
|
export class Separator {
|
|
8
|
-
separator =
|
|
8
|
+
separator = colors.dim(Array.from({ length: 15 }).join(figures.line));
|
|
9
9
|
type = 'separator';
|
|
10
10
|
constructor(separator) {
|
|
11
11
|
if (separator) {
|
package/dist/esm/lib/theme.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import colors from 'yoctocolors-cjs';
|
|
2
2
|
import spinners from 'cli-spinners';
|
|
3
3
|
export const defaultTheme = {
|
|
4
|
-
prefix:
|
|
4
|
+
prefix: colors.green('?'),
|
|
5
5
|
spinner: {
|
|
6
6
|
interval: spinners.dots.interval,
|
|
7
|
-
frames: spinners.dots.frames.map((frame) =>
|
|
7
|
+
frames: spinners.dots.frames.map((frame) => colors.yellow(frame)),
|
|
8
8
|
},
|
|
9
9
|
style: {
|
|
10
|
-
answer:
|
|
11
|
-
message:
|
|
12
|
-
error: (text) =>
|
|
13
|
-
defaultAnswer: (text) =>
|
|
14
|
-
help:
|
|
15
|
-
highlight:
|
|
16
|
-
key: (text) =>
|
|
10
|
+
answer: colors.cyan,
|
|
11
|
+
message: colors.bold,
|
|
12
|
+
error: (text) => colors.red(`> ${text}`),
|
|
13
|
+
defaultAnswer: (text) => colors.dim(`(${text})`),
|
|
14
|
+
help: colors.dim,
|
|
15
|
+
highlight: colors.cyan,
|
|
16
|
+
key: (text) => colors.cyan(colors.bold(`<${text}>`)),
|
|
17
17
|
},
|
|
18
18
|
};
|
|
@@ -11,4 +11,3 @@ export type { Theme } from './lib/theme.mjs';
|
|
|
11
11
|
export { usePagination } from './lib/pagination/use-pagination.mjs';
|
|
12
12
|
export { createPrompt } from './lib/create-prompt.mjs';
|
|
13
13
|
export { Separator } from './lib/Separator.mjs';
|
|
14
|
-
export { type InquirerReadline } from './lib/read-line.type.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InquirerReadline } from '
|
|
1
|
+
import type { InquirerReadline } from '@inquirer/type';
|
|
2
2
|
export declare function useEffect(cb: (rl: InquirerReadline) => void | (() => void), depArray: ReadonlyArray<unknown>): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type InquirerReadline } from '
|
|
1
|
+
import { type InquirerReadline } from '@inquirer/type';
|
|
2
2
|
import { type KeypressEvent } from './key.mjs';
|
|
3
3
|
export declare function useKeypress(userHandler: (event: KeypressEvent, rl: InquirerReadline) => void): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=18"
|
|
6
6
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/core/README.md",
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@inquirer/figures": "^1.0.3",
|
|
61
|
-
"@inquirer/type": "^1.
|
|
61
|
+
"@inquirer/type": "^1.4.0",
|
|
62
62
|
"@types/mute-stream": "^0.0.4",
|
|
63
63
|
"@types/node": "^20.14.9",
|
|
64
64
|
"@types/wrap-ansi": "^3.0.0",
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
"cli-spinners": "^2.9.2",
|
|
67
67
|
"cli-width": "^4.1.0",
|
|
68
68
|
"mute-stream": "^1.0.0",
|
|
69
|
-
"picocolors": "^1.0.1",
|
|
70
69
|
"signal-exit": "^4.1.0",
|
|
71
70
|
"strip-ansi": "^6.0.1",
|
|
72
|
-
"wrap-ansi": "^6.2.0"
|
|
71
|
+
"wrap-ansi": "^6.2.0",
|
|
72
|
+
"yoctocolors-cjs": "^2.1.1"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@inquirer/testing": "^2.1.
|
|
75
|
+
"@inquirer/testing": "^2.1.24"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"tsc": "yarn run tsc:esm && yarn run tsc:cjs",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
"sideEffects": false,
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "fc27d575bceb96466cb8da8524c26d4eb2a77df0"
|
|
101
101
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|