inquirerer 4.8.0 → 4.8.1
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/commander.js +12 -2
- package/esm/commander.js +12 -2
- package/package.json +2 -2
package/commander.js
CHANGED
|
@@ -8,11 +8,21 @@ const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
|
8
8
|
const minimist_1 = __importDefault(require("minimist"));
|
|
9
9
|
const prompt_1 = require("./prompt");
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
|
+
// NOTE: `input` and `output` are lazy getters rather than plain properties.
|
|
12
|
+
// `process.stdin` / `process.stdout` are Node getters that lazy-construct
|
|
13
|
+
// streams on first access. When fd 0 is a pipe (e.g. a Jest worker or any
|
|
14
|
+
// spawned child), constructing stdin registers a libuv PIPEWRAP handle
|
|
15
|
+
// that the runtime must close before the process can exit. Evaluating
|
|
16
|
+
// these defaults eagerly as object properties meant that merely
|
|
17
|
+
// `require('inquirerer')` — even via a transitive dep that never
|
|
18
|
+
// constructs `CLI` — would open stdin and produce a spurious open-handle
|
|
19
|
+
// warning under `jest --detectOpenHandles`. Deferring the access to
|
|
20
|
+
// read-time keeps the module side-effect free.
|
|
11
21
|
exports.defaultCLIOptions = {
|
|
12
22
|
version: `inquirerer@${(0, utils_1.getVersion)()}`,
|
|
13
23
|
noTty: false,
|
|
14
|
-
input
|
|
15
|
-
output
|
|
24
|
+
get input() { return process.stdin; },
|
|
25
|
+
get output() { return process.stdout; },
|
|
16
26
|
minimistOpts: {
|
|
17
27
|
alias: {
|
|
18
28
|
v: 'version'
|
package/esm/commander.js
CHANGED
|
@@ -2,11 +2,21 @@ import deepmerge from 'deepmerge';
|
|
|
2
2
|
import minimist from 'minimist';
|
|
3
3
|
import { Inquirerer } from './prompt';
|
|
4
4
|
import { getVersion } from './utils';
|
|
5
|
+
// NOTE: `input` and `output` are lazy getters rather than plain properties.
|
|
6
|
+
// `process.stdin` / `process.stdout` are Node getters that lazy-construct
|
|
7
|
+
// streams on first access. When fd 0 is a pipe (e.g. a Jest worker or any
|
|
8
|
+
// spawned child), constructing stdin registers a libuv PIPEWRAP handle
|
|
9
|
+
// that the runtime must close before the process can exit. Evaluating
|
|
10
|
+
// these defaults eagerly as object properties meant that merely
|
|
11
|
+
// `require('inquirerer')` — even via a transitive dep that never
|
|
12
|
+
// constructs `CLI` — would open stdin and produce a spurious open-handle
|
|
13
|
+
// warning under `jest --detectOpenHandles`. Deferring the access to
|
|
14
|
+
// read-time keeps the module side-effect free.
|
|
5
15
|
export const defaultCLIOptions = {
|
|
6
16
|
version: `inquirerer@${getVersion()}`,
|
|
7
17
|
noTty: false,
|
|
8
|
-
input
|
|
9
|
-
output
|
|
18
|
+
get input() { return process.stdin; },
|
|
19
|
+
get output() { return process.stdout; },
|
|
10
20
|
minimistOpts: {
|
|
11
21
|
alias: {
|
|
12
22
|
v: 'version'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inquirerer",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.1",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "TypeScript-first library for building beautiful CLI interfaces with interactive prompts",
|
|
6
6
|
"main": "index.js",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"makage": "0.1.10",
|
|
47
47
|
"string-width": "4.2.3"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "ea7144ba7becb4bcabfc5044214eafe25b24b876"
|
|
50
50
|
}
|