diff --git a/package-lock.json b/package-lock.json index 35eb9ac3..ecfd5426 100644 --- a/package-lock.json +++ b/package-lock.json @@ -153,18 +153,6 @@ "sisteransi": "^1.0.5" } }, - "node_modules/@clack/prompts/node_modules/is-unicode-supported": { - "version": "1.3.0", - "extraneous": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@discordjs/builders": { "version": "1.9.0", "license": "Apache-2.0", @@ -8979,7 +8967,6 @@ "dotenv": "^16.4.5", "fallout-utility": "^2.9.1", "globby": "^14.0.2", - "micromatch": "^4.0.8", "prompts": "^2.4.2", "prtyprnt": "^1.1.0", "semver": "^7.6.3" diff --git a/packages/reciple/package.json b/packages/reciple/package.json index 31633d77..8c33c905 100644 --- a/packages/reciple/package.json +++ b/packages/reciple/package.json @@ -48,7 +48,6 @@ "dotenv": "^16.4.5", "fallout-utility": "^2.9.1", "globby": "^14.0.2", - "micromatch": "^4.0.8", "prompts": "^2.4.2", "prtyprnt": "^1.1.0", "semver": "^7.6.3" diff --git a/packages/reciple/src/classes/ModuleLoader.ts b/packages/reciple/src/classes/ModuleLoader.ts index 422a21af..69a72fa7 100644 --- a/packages/reciple/src/classes/ModuleLoader.ts +++ b/packages/reciple/src/classes/ModuleLoader.ts @@ -1,6 +1,5 @@ import { type Awaitable, kleur } from 'fallout-utility'; import type { RecipleConfig } from '../types/structures.js'; -import micromatch from 'micromatch'; import path from 'node:path'; import { existsAsync } from '@reciple/utils'; import { lstat, mkdir, readdir } from 'node:fs/promises'; @@ -37,13 +36,10 @@ export class ModuleLoader { let dirs = await globby(folder, { cwd: process.cwd(), onlyDirectories: true, - absolute: true + absolute: true, + ignore: options.config.exclude }); - if (options.config?.exclude?.length) { - dirs = dirs.filter(f => !micromatch.isMatch(path.basename(f), options.config.exclude!)); - } - paths.push(...await ModuleLoader.getModulePaths({ ...options, config: { @@ -61,9 +57,7 @@ export class ModuleLoader { const files = (await readdir(folderPath)) .map(file => path .join(folderPath, file)) - .filter(f => !options.config?.exclude?.length || !micromatch.isMatch(path.basename(f), options.config.exclude) - ) - .filter(file => (options.filter ? options.filter(file) : ModuleLoader.defaultModulePathsFilter(file))); + .filter(file => (options.filter ? options.filter(file) : ModuleLoader.defaultModulePathsFilter(file))); await Promise.all(files.map(async f => { if (options.config.filter) {