Skip to content

Commit c515fe7

Browse files
committed
chore: switch to tinyglobby
1 parent 71541d9 commit c515fe7

File tree

9 files changed

+26
-26
lines changed

9 files changed

+26
-26
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"etag": "^1.8.1",
7777
"exsolve": "^1.0.4",
7878
"fs-extra": "^11.3.0",
79-
"globby": "^14.1.0",
8079
"gzip-size": "^7.0.0",
8180
"h3": "^1.15.1",
8281
"hookable": "^5.5.3",
@@ -106,6 +105,7 @@
106105
"serve-static": "^1.16.2",
107106
"source-map": "^0.7.4",
108107
"std-env": "^3.8.1",
108+
"tinyglobby": "^0.2.12",
109109
"ufo": "^1.5.4",
110110
"ultrahtml": "^1.5.3",
111111
"uncrypto": "^0.1.3",

pnpm-lock.yaml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/build/assets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { existsSync, promises as fsp } from "node:fs";
2-
import { globby } from "globby";
2+
import { glob } from "tinyglobby";
33
import { isDirectory, prettyPath } from "../utils/fs";
44
import type { Nitro } from "nitro/types";
55
import { join, relative, resolve } from "pathe";
@@ -40,7 +40,7 @@ export async function copyPublicAssets(nitro: Nitro) {
4040
const dstDir = join(nitro.options.output.publicDir, asset.baseURL!);
4141
if (await isDirectory(srcDir)) {
4242
const includePatterns = getIncludePatterns(nitro, srcDir);
43-
const publicAssets = await globby(includePatterns, {
43+
const publicAssets = await glob(includePatterns, {
4444
cwd: srcDir,
4545
absolute: false,
4646
dot: true,

src/build/plugins/public-assets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { promises as fsp } from "node:fs";
22
import createEtag from "etag";
3-
import { globby } from "globby";
3+
import { glob } from "tinyglobby";
44
import mime from "mime";
55
import type { Nitro } from "nitro/types";
66
import type { PublicAsset } from "nitro/types";
@@ -26,7 +26,7 @@ export function publicAssets(nitro: Nitro): Plugin {
2626
// #nitro-internal-virtual/public-assets-data
2727
"#nitro-internal-virtual/public-assets-data": async () => {
2828
const assets: Record<string, PublicAsset> = {};
29-
const files = await globby("**", {
29+
const files = await glob("**", {
3030
cwd: nitro.options.output.publicDir,
3131
absolute: false,
3232
dot: true,

src/build/plugins/server-assets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { promises as fsp } from "node:fs";
22
import createEtag from "etag";
3-
import { globby } from "globby";
3+
import { glob } from "tinyglobby";
44
import mime from "mime";
55
import type { Nitro } from "nitro/types";
66
import { resolve } from "pathe";
@@ -33,7 +33,7 @@ export function serverAssets(nitro: Nitro): Plugin {
3333
// Scan all assets
3434
const assets: Record<string, ResolvedAsset> = {};
3535
for (const asset of nitro.options.serverAssets) {
36-
const files = await globby(asset.pattern || "**/*", {
36+
const files = await glob(asset.pattern || "**/*", {
3737
cwd: asset.dir,
3838
absolute: false,
3939
ignore: asset.ignore,

src/presets/cloudflare/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { writeFile } from "../_utils/fs";
88
import { parseTOML, parseJSONC } from "confbox";
99
import { readGitConfig, readPackageJSON, findNearestFile } from "pkg-types";
1010
import { defu } from "defu";
11-
import { globby } from "globby";
11+
import { glob } from "tinyglobby";
1212
import { join, resolve } from "pathe";
1313
import {
1414
joinURL,
@@ -69,7 +69,7 @@ export async function writeCFRoutes(nitro: Nitro) {
6969
);
7070

7171
// Unprefixed assets
72-
const publicAssetFiles = await globby("**", {
72+
const publicAssetFiles = await glob("**", {
7373
cwd: nitro.options.output.dir,
7474
absolute: false,
7575
dot: true,

src/scan.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { globby } from "globby";
1+
import { glob } from "tinyglobby";
22
import type { Nitro } from "nitro/types";
33
import { join, relative } from "pathe";
44
import { withBase, withLeadingSlash, withoutTrailingSlash } from "ufo";
@@ -156,7 +156,7 @@ async function scanDir(
156156
dir: string,
157157
name: string
158158
): Promise<FileInfo[]> {
159-
const fileNames = await globby(join(name, GLOB_SCAN_PATTERN), {
159+
const fileNames = await glob(join(name, GLOB_SCAN_PATTERN), {
160160
cwd: dir,
161161
dot: true,
162162
ignore: nitro.options.ignore,

src/utils/compress.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { existsSync } from "node:fs";
22
import fsp from "node:fs/promises";
33
import zlib from "node:zlib";
4-
import { globby } from "globby";
4+
import { glob } from "tinyglobby";
55
import mime from "mime";
66
import type { Nitro } from "nitro/types";
77
import { resolve } from "pathe";
88

99
export async function compressPublicAssets(nitro: Nitro) {
10-
const publicFiles = await globby("**", {
10+
const publicFiles = await glob("**", {
1111
cwd: nitro.options.output.publicDir,
1212
absolute: false,
1313
dot: true,

src/utils/fs-tree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { promises as fsp } from "node:fs";
22
import { colors } from "consola/utils";
3-
import { globby } from "globby";
3+
import { glob } from "tinyglobby";
44
import { gzipSize } from "gzip-size";
55
import { dirname, relative, resolve } from "pathe";
66
import prettyBytes from "pretty-bytes";
@@ -15,7 +15,7 @@ export async function generateFSTree(
1515
return;
1616
}
1717

18-
const files = await globby("**/*.*", { cwd: dir, ignore: ["*.map"] });
18+
const files = await glob("**/*.*", { cwd: dir, ignore: ["*.map"] });
1919

2020
const items: { file: string; path: string; size: number; gzip: number }[] =
2121
[];

0 commit comments

Comments
 (0)