From c8e33bc7c726d4e6ed218f0c893460b4bc541be9 Mon Sep 17 00:00:00 2001 From: Itay Perach Date: Thu, 5 Sep 2024 16:36:39 +0300 Subject: [PATCH] feat(core): add ignoredPaths to arguments and support regex --- libs/core/src/true-affected.ts | 3 +-- libs/core/src/types.ts | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/core/src/true-affected.ts b/libs/core/src/true-affected.ts index 316dc2c..1d86576 100644 --- a/libs/core/src/true-affected.ts +++ b/libs/core/src/true-affected.ts @@ -35,6 +35,7 @@ export const trueAffected = async ({ include = [DEFAULT_INCLUDE_TEST_FILES], logger = DEFAULT_LOGGER, compilerOptions = {}, + ignoredPaths = [/node_modules/, './build', './dist', './.git'], __experimentalLockfileCheck = false, }: TrueAffected) => { logger.debug('Getting affected projects'); @@ -98,8 +99,6 @@ export const trueAffected = async ({ ({ filePath }) => project.getSourceFile(resolve(cwd, filePath)) != null ); - const ignoredPaths = ['./node_modules', './build', './dist', './.git']; - const nonSourceChangedFiles = changedFiles .filter( ({ filePath }) => diff --git a/libs/core/src/types.ts b/libs/core/src/types.ts index 9bf8944..b3f5a5c 100644 --- a/libs/core/src/types.ts +++ b/libs/core/src/types.ts @@ -19,7 +19,8 @@ export interface TrueAffected extends TrueAffectedLogging { projects: TrueAffectedProject[]; include?: (string | RegExp)[]; compilerOptions?: CompilerOptions; - + ignoredPaths?: (string | RegExp)[]; + // **experimental** - this is an experimental feature and may be removed or changed at any time __experimentalLockfileCheck?: boolean; }