Skip to content

Commit b5d8f0e

Browse files
feat: replace globby with tinyglobby and remove get-stdin in favor of builtin stream.consumers.text (#489)
1 parent 5f9f92a commit b5d8f0e

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import fs from 'fs-extra'
44
import path from 'path'
55

66
import prettyHrtime from 'pretty-hrtime'
7-
import stdin from 'get-stdin'
7+
import { text } from 'stream/consumers'
88
import read from 'read-cache'
99
import pc from 'picocolors'
10-
import { globby } from 'globby'
10+
import { glob } from 'tinyglobby'
1111
import slash from 'slash'
1212
import chokidar from 'chokidar'
1313

@@ -86,7 +86,7 @@ buildCliConfig()
8686
}
8787

8888
if (input && input.length) {
89-
return globby(
89+
return glob(
9090
input.map((i) => slash(String(i))),
9191
{ dot: argv.includeDotfiles },
9292
)
@@ -188,7 +188,7 @@ function files(files) {
188188
return Promise.all(
189189
files.map((file) => {
190190
if (file === 'stdin') {
191-
return stdin().then((content) => {
191+
return text(process.stdin).then((content) => {
192192
if (!content) return error('Input Error: Did not receive any STDIN')
193193
return css(content, 'stdin')
194194
})

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
"chokidar": "^3.3.0",
2222
"dependency-graph": "^1.0.0",
2323
"fs-extra": "^11.0.0",
24-
"get-stdin": "^9.0.0",
25-
"globby": "^14.0.0",
2624
"picocolors": "^1.0.0",
2725
"postcss-load-config": "^5.0.0",
2826
"postcss-reporter": "^7.0.0",
2927
"pretty-hrtime": "^1.0.3",
3028
"read-cache": "^1.0.0",
3129
"slash": "^5.0.0",
30+
"tinyglobby": "^0.2.12",
3231
"yargs": "^17.0.0"
3332
},
3433
"devDependencies": {

test/helpers/env.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import fs from 'fs-extra'
22
import path from 'path'
3-
import { globby } from 'globby'
3+
import { glob } from 'tinyglobby'
44

55
import tmp from './tmp.js'
66

77
export default function (config, fixtures = '**/*', extension = 'cjs') {
88
const dir = tmp()
99

1010
return Promise.all([
11-
globby(fixtures, { cwd: 'test/fixtures' }).then((list) => {
11+
glob(fixtures, { cwd: 'test/fixtures' }).then((list) => {
1212
return list.map((item) => {
1313
return fs.copy(path.join('test/fixtures', item), path.join(dir, item))
1414
})

0 commit comments

Comments
 (0)