diff --git a/.changeset/modern-gifts-end.md b/.changeset/modern-gifts-end.md new file mode 100644 index 0000000000..f2f814872f --- /dev/null +++ b/.changeset/modern-gifts-end.md @@ -0,0 +1,5 @@ +--- +"@pnpm/filter-workspace-packages": minor +--- + +New optional option added to `readProjects()`: engineStrict. diff --git a/packages/filter-workspace-packages/src/getChangedPackages.ts b/packages/filter-workspace-packages/src/getChangedPackages.ts index df0d501a42..ac282234f7 100644 --- a/packages/filter-workspace-packages/src/getChangedPackages.ts +++ b/packages/filter-workspace-packages/src/getChangedPackages.ts @@ -67,7 +67,7 @@ async function getChangedDirsSinceCommit (commit: string, workingDir: string, te const patterns = changedFilesIgnorePattern.filter( (pattern) => pattern.length ) - const changedFiles = patterns.length + const changedFiles = (patterns.length > 0) ? micromatch.not(allChangedFiles, patterns, { dot: true, }) diff --git a/packages/filter-workspace-packages/src/index.ts b/packages/filter-workspace-packages/src/index.ts index f196278d3b..a14d83257e 100644 --- a/packages/filter-workspace-packages/src/index.ts +++ b/packages/filter-workspace-packages/src/index.ts @@ -33,11 +33,12 @@ export async function readProjects ( workspaceDir: string, pkgSelectors: PackageSelector[], opts?: { + engineStrict?: boolean linkWorkspacePackages?: boolean changedFilesIgnorePattern?: string[] } ) { - const allProjects = await findWorkspacePackages(workspaceDir, {}) + const allProjects = await findWorkspacePackages(workspaceDir, { engineStrict: opts?.engineStrict }) const { selectedProjectsGraph } = await filterPkgsBySelectorObjects( allProjects, pkgSelectors,