Skip to content

Commit

Permalink
following type changes
Browse files Browse the repository at this point in the history
  • Loading branch information
itayper committed Sep 24, 2024
1 parent c0d99b8 commit 9dba64e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions libs/core/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions libs/core/src/lock-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9dba64e

Please sign in to comment.