diff --git a/libs/core/src/assets.ts b/libs/core/src/assets.ts index 5579365..e0137ee 100644 --- a/libs/core/src/assets.ts +++ b/libs/core/src/assets.ts @@ -6,14 +6,16 @@ import { existsSync } from 'fs'; export function findNonSourceAffectedFiles( cwd: string, changedFilePath: string, - excludeFolderPaths: string[] + excludeFolderPaths: (string | RegExp)[] ): ChangedFiles[] { const fileName = basename(changedFilePath); const files = fastFindInFiles({ directory: cwd, needle: fileName, - excludeFolderPaths: excludeFolderPaths.map((path) => join(cwd, path)), + excludeFolderPaths: excludeFolderPaths.map((path) => + typeof path === 'string' ? join(cwd, path) : path + ), }); const relevantFiles = filterRelevantFiles(cwd, files, changedFilePath); diff --git a/libs/core/src/lock-files.ts b/libs/core/src/lock-files.ts index 343143d..59e3c0d 100644 --- a/libs/core/src/lock-files.ts +++ b/libs/core/src/lock-files.ts @@ -51,10 +51,12 @@ export function hasLockfileChanged(changedFiles: ChangedFiles[]): boolean { export function findAffectedFilesByLockfile( cwd: string, base: string, - excludePaths: string[] + excludePaths: (string | RegExp)[] ): ChangedFiles[] { const dependencies = findAffectedModules(cwd, base); - const excludeFolderPaths = excludePaths.map((path) => join(cwd, path)); + const excludeFolderPaths = excludePaths.map((path) => + typeof path === 'string' ? join(cwd, path) : path + ); // fastFindInFiles supports regex but fails with `@` in the regex const files = dependencies.flatMap((dep) => diff --git a/package.json b/package.json index c79cbff..cc976ec 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ }, "dependencies": { "chalk": "^5.2.0", - "fast-find-in-files": "^1.0.1", + "fast-find-in-files": "^1.0.5", "globby": "^13.1.4", "microdiff": "^1.3.2", "ts-morph": "^18.0.0",