diff --git a/packages/outdated/src/outdated.ts b/packages/outdated/src/outdated.ts index 4dafb339dad..0484824c989 100644 --- a/packages/outdated/src/outdated.ts +++ b/packages/outdated/src/outdated.ts @@ -34,6 +34,7 @@ export default async function outdated ( compatible?: boolean currentLockfile: Lockfile | null getLatestManifest: GetLatestManifestFunction + ignoreDependencies?: Set include?: IncludedDependencies lockfileDir: string manifest: ProjectManifest @@ -74,7 +75,7 @@ export default async function outdated ( return } - if ((opts.manifest.pnpm?.updateConfig?.ignoreDependencies ?? []).includes(alias)) { + if (opts.ignoreDependencies?.has(alias)) { return } diff --git a/packages/outdated/src/outdatedDepsOfProjects.ts b/packages/outdated/src/outdatedDepsOfProjects.ts index dccf6fc2402..29fa065e370 100644 --- a/packages/outdated/src/outdatedDepsOfProjects.ts +++ b/packages/outdated/src/outdatedDepsOfProjects.ts @@ -18,6 +18,7 @@ export default async function outdatedDepsOfProjects ( args: string[], opts: Omit & { compatible?: boolean + ignoreDependencies?: Set include: IncludedDependencies } & Partial> ): Promise { diff --git a/packages/plugin-commands-outdated/src/outdated.ts b/packages/plugin-commands-outdated/src/outdated.ts index fc326fb725f..952f2d14d0b 100644 --- a/packages/plugin-commands-outdated/src/outdated.ts +++ b/packages/plugin-commands-outdated/src/outdated.ts @@ -167,15 +167,17 @@ export async function handler ( const pkgs = Object.values(opts.selectedProjectsGraph).map((wsPkg) => wsPkg.package) return outdatedRecursive(pkgs, params, { ...opts, include }) } + const manifest = await readProjectManifestOnly(opts.dir, opts) const packages = [ { dir: opts.dir, - manifest: await readProjectManifestOnly(opts.dir, opts), + manifest, }, ] const [outdatedPackages] = await outdatedDepsOfProjects(packages, params, { ...opts, fullMetadata: opts.long, + ignoreDependencies: new Set(manifest?.pnpm?.updateConfig?.ignoreDependencies ?? []), include, retry: { factor: opts.fetchRetryFactor, diff --git a/packages/plugin-commands-outdated/src/recursive.ts b/packages/plugin-commands-outdated/src/recursive.ts index 7eb9d86f5f6..a8e66bae78d 100644 --- a/packages/plugin-commands-outdated/src/recursive.ts +++ b/packages/plugin-commands-outdated/src/recursive.ts @@ -50,9 +50,11 @@ export default async ( opts: OutdatedCommandOptions & { include: IncludedDependencies } ) => { const outdatedMap = {} as Record + const rootManifest = pkgs.find(({ dir }) => dir === opts.lockfileDir ?? opts.dir) const outdatedPackagesByProject = await outdatedDepsOfProjects(pkgs, params, { ...opts, fullMetadata: opts.long, + ignoreDependencies: new Set(rootManifest?.manifest?.pnpm?.updateConfig?.ignoreDependencies ?? []), retry: { factor: opts.fetchRetryFactor, maxTimeout: opts.fetchRetryMaxtimeout,