Skip to content

Commit

Permalink
Remove get-sdtin dependency (#2557)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
AdeAttwood and renovate-bot authored Apr 24, 2021
1 parent ecc277b commit 597cb59
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 0 additions & 1 deletion @commitlint/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@commitlint/load": "^12.1.1",
"@commitlint/read": "^12.1.1",
"@commitlint/types": "^12.1.1",
"get-stdin": "8.0.0",
"lodash": "^4.17.19",
"resolve-from": "5.0.0",
"resolve-global": "1.0.0",
Expand Down
17 changes: 16 additions & 1 deletion @commitlint/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import load from '@commitlint/load';
import lint from '@commitlint/lint';
import read from '@commitlint/read';
import isFunction from 'lodash/isFunction';
import stdin from 'get-stdin';
import resolveFrom from 'resolve-from';
import resolveGlobal from 'resolve-global';
import yargs from 'yargs';
Expand Down Expand Up @@ -126,6 +125,22 @@ main({edit: false, ...cli.argv}).catch((err) => {
}, 0);
});

async function stdin() {
let result = '';

if (process.stdin.isTTY) {
return result;
}

process.stdin.setEncoding('utf8');

for await (const chunk of process.stdin) {
result += chunk;
}

return result;
}

async function main(options: CliFlags) {
const raw = options._;
const flags = normalizeFlags(options);
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4991,11 +4991,6 @@ get-port@^5.0.0, get-port@^5.1.1:
resolved "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193"
integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==

[email protected]:
version "8.0.0"
resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53"
integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==

get-stdin@^4.0.1:
version "4.0.1"
resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
Expand Down

0 comments on commit 597cb59

Please sign in to comment.