Skip to content

Commit 597cb59

Browse files
Remove get-sdtin dependency (#2557)
* fix: update dependency get-stdin to v9 * fix: remove dependency get-stdin The get-stdin package has now gone to ESM and can not be used by common js package. This removes the dependency and implements the package. Co-authored-by: Renovate Bot <[email protected]>
1 parent ecc277b commit 597cb59

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

@commitlint/cli/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"@commitlint/load": "^12.1.1",
4949
"@commitlint/read": "^12.1.1",
5050
"@commitlint/types": "^12.1.1",
51-
"get-stdin": "8.0.0",
5251
"lodash": "^4.17.19",
5352
"resolve-from": "5.0.0",
5453
"resolve-global": "1.0.0",

@commitlint/cli/src/cli.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import load from '@commitlint/load';
22
import lint from '@commitlint/lint';
33
import read from '@commitlint/read';
44
import isFunction from 'lodash/isFunction';
5-
import stdin from 'get-stdin';
65
import resolveFrom from 'resolve-from';
76
import resolveGlobal from 'resolve-global';
87
import yargs from 'yargs';
@@ -126,6 +125,22 @@ main({edit: false, ...cli.argv}).catch((err) => {
126125
}, 0);
127126
});
128127

128+
async function stdin() {
129+
let result = '';
130+
131+
if (process.stdin.isTTY) {
132+
return result;
133+
}
134+
135+
process.stdin.setEncoding('utf8');
136+
137+
for await (const chunk of process.stdin) {
138+
result += chunk;
139+
}
140+
141+
return result;
142+
}
143+
129144
async function main(options: CliFlags) {
130145
const raw = options._;
131146
const flags = normalizeFlags(options);

yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -4991,11 +4991,6 @@ get-port@^5.0.0, get-port@^5.1.1:
49914991
resolved "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193"
49924992
integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==
49934993

4994-
4995-
version "8.0.0"
4996-
resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53"
4997-
integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==
4998-
49994994
get-stdin@^4.0.1:
50004995
version "4.0.1"
50014996
resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"

0 commit comments

Comments
 (0)