Skip to content

Commit aa33d88

Browse files
authored
Merge pull request #39 from neogeek/feature/removed-globby
Removed globby package.
2 parents 84f0f33 + 5799e2d commit aa33d88

File tree

3 files changed

+29
-341
lines changed

3 files changed

+29
-341
lines changed

bin/index.ts

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import 'tsx/esm';
44

5-
import { globby } from 'globby';
5+
import { glob } from 'node:fs/promises';
66

77
import chalk from 'chalk';
88

@@ -47,42 +47,34 @@ const [ignoreFile = '.onlyignore'] = [args.flags['--ignore'], args.flags['-i']]
4747
.filter(flag => typeof flag === 'string')
4848
.map(String);
4949

50-
const filesToBuild = await globby(
51-
[
52-
'**/*.mjs',
53-
'**/*.jsx',
54-
'**/*.ts',
55-
'**/*.tsx',
56-
'!_*/**/*',
57-
'!node_modules/',
58-
`!${buildDir}`
59-
].filter(Boolean),
60-
{
61-
gitignore: false,
62-
ignoreFiles: [ignoreFile],
63-
cwd: args.inputs[0]
64-
}
65-
);
66-
67-
const filesToCopy = await globby(
68-
[
69-
'**/*',
70-
'!**/*.mjs',
71-
'!**/*.jsx',
72-
'!**/*.ts',
73-
'!**/*.tsx',
74-
'!_*/**/*',
75-
'!package.json',
76-
'!package-lock.json',
77-
'!node_modules/',
78-
`!${buildDir}`
79-
],
80-
{
81-
gitignore: false,
82-
ignoreFiles: [ignoreFile],
83-
cwd: args.inputs[0]
84-
}
85-
);
50+
const filesToBuild = (
51+
await Array.fromAsync(
52+
glob(['**/*.mjs', '**/*.jsx', '**/*.ts', '**/*.tsx'].filter(Boolean), {
53+
exclude: ['node_modules/', '_*/**/*', buildDir, ignoreFile],
54+
cwd: args.inputs[0]
55+
})
56+
)
57+
).filter(path => path.includes('.'));
58+
59+
const filesToCopy = (
60+
await Array.fromAsync(
61+
glob(['**/*'], {
62+
exclude: [
63+
'**/*.mjs',
64+
'**/*.jsx',
65+
'**/*.ts',
66+
'**/*.tsx',
67+
'_*/**/*',
68+
'package.json',
69+
'package-lock.json',
70+
'node_modules/',
71+
buildDir,
72+
ignoreFile
73+
],
74+
cwd: args.inputs[0]
75+
})
76+
)
77+
).filter(path => path.includes('.'));
8678

8779
const filesToWrite = await buildFiles(filesToBuild);
8880

0 commit comments

Comments
 (0)