enhance: use native glob (#16965)

* enhance: use native glob

* remove tiny-glob

* remove fast-glob

* refactor

* fix: use async glob if possible

---------

Co-authored-by: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
This commit is contained in:
syuilo
2025-12-11 23:08:26 +09:00
committed by GitHub
parent 2cffd9f0fb
commit 8e6fffee68
18 changed files with 44 additions and 118 deletions

View File

@@ -3,11 +3,10 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { createWriteStream } from 'node:fs';
import { createWriteStream, promises as fsp } from 'node:fs';
import { mkdir } from 'node:fs/promises';
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import glob from 'fast-glob';
import walk from 'ignore-walk';
import { Pack } from 'tar/pack';
import meta from '../package.json' with { type: "json" };
@@ -25,7 +24,7 @@ export default async function build() {
const pack = new Pack({ cwd, gzip: true });
const patterns = await walk({ path: cwd, ignoreFiles: ['.gitignore'] });
for await (const entry of glob.stream(patterns, { cwd, ignore, dot: true })) {
for await (const entry of fsp.glob(patterns, { cwd, ignore, dot: true })) {
pack.add(entry);
}