Skip to content

Commit 82f6c2c

Browse files
committed
chore: replace globby with tinyglobby and update module ignore patterns
1 parent 42dba00 commit 82f6c2c

6 files changed

Lines changed: 10 additions & 49 deletions

File tree

bun.lock

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

example/reciple.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ export const config = {
7070
returnOnFailure: false
7171
},
7272
modules: {
73-
directories: ["./modules/**"],
74-
ignore: ["_*"],
73+
directories: ["./modules/**", "./modules"],
74+
ignore: ["_*", ".*", "+*"],
7575
filter: undefined
7676
},
7777
logger: await useLogger().clone({

packages/reciple/assets/config/reciple.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const config = {
6969
},
7070
modules: {
7171
directories: ["./modules/**", "./modules"],
72-
ignore: ["_*"],
72+
ignore: ["_*", ".*", "+*"],
7373
filter: undefined
7474
}
7575
};
@@ -87,5 +87,5 @@ export const build = {
8787
* @type {import('reciple').ShardingConfig}
8888
*/
8989
export const sharding = {
90-
mode: 'process',
90+
mode: 'process',
9191
};

packages/reciple/assets/config/reciple.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const config: Config = {
7979
},
8080
modules: {
8181
directories: ["./modules/**", "./modules"],
82-
ignore: ["_*"],
82+
ignore: ["_*", ".*", "+*"],
8383
filter: undefined
8484
}
8585
};

packages/reciple/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
"@sapphire/snowflake": "^3.5.5",
4545
"commander": "^14.0.3",
4646
"github-slugger": "^2.0.0",
47-
"globby": "^16.1.1",
4847
"jiti": "^2.6.1",
4948
"micromatch": "^4.0.8",
5049
"nypm": "^0.6.5",
5150
"pkg-types": "^2.3.0",
51+
"tinyglobby": "^0.2.15",
5252
"ts-mixer": "^6.0.4",
5353
"tsdown": "catalog:"
5454
},

packages/reciple/src/classes/client/ModuleLoader.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { type Awaitable } from 'discord.js';
22
import path from 'node:path';
33
import { mkdir, readdir, stat } from 'node:fs/promises';
44
import micromatch from 'micromatch';
5-
import { globby, isDynamicPattern } from 'globby';
5+
import { glob, isDynamicPattern } from 'tinyglobby';
66
import { CommandType, RecipleError, type Client } from '@reciple/core';
77
import type { AnyModule, AnyModuleData } from '../../helpers/types.js';
88
import { recursiveDefaults } from '@reciple/utils';
@@ -70,12 +70,11 @@ export class ModuleLoader extends EventEmitter<ModuleLoader.Events> {
7070
let directories: string[] = [];
7171

7272
for (const directory of config?.directories ?? []) {
73-
if (isDynamicPattern(directory, { cwd })) {
74-
const matches = await globby(directory, {
73+
if (isDynamicPattern(directory)) {
74+
const matches = await glob(directory, {
7575
cwd,
7676
ignore: config?.ignore,
7777
onlyDirectories: true,
78-
baseNameMatch: true,
7978
absolute: true
8079
});
8180

@@ -184,8 +183,6 @@ export class ModuleLoader extends EventEmitter<ModuleLoader.Events> {
184183
}
185184

186185
export namespace ModuleLoader {
187-
let globby: typeof import('globby')|null = null;
188-
189186
export const fileTypes = [
190187
'js',
191188
'mjs',
@@ -214,10 +211,4 @@ export namespace ModuleLoader {
214211
outDir: string;
215212
cwd?: string;
216213
}
217-
218-
export async function getGlobby(): Promise<typeof import('globby')> {
219-
if (globby) return globby;
220-
221-
return globby = await import('globby');
222-
}
223214
}

0 commit comments

Comments
 (0)