fix: dlx should work with minimumeReleaseAge set (#10038)

close #10037
This commit is contained in:
Zoltan Kochan
2025-10-02 16:22:14 +02:00
committed by GitHub
parent 2e07c4f6ff
commit fddd85bf56
2 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/plugin-commands-script-runners": patch
"pnpm": patch
---
`pnpm dlx` should not fail when `minimumReleaseAge` is set [#10037](https://github.com/pnpm/pnpm/issues/10037).

View File

@@ -90,6 +90,7 @@ export async function handler (
authConfig: opts.rawConfig,
})
const resolvedPkgAliases: string[] = []
const publishedBy = opts.minimumReleaseAge ? new Date(Date.now() - opts.minimumReleaseAge * 60 * 1000) : undefined
const resolvedPkgs = await Promise.all(pkgs.map(async (pkg) => {
const { alias, bareSpecifier } = parseWantedDependency(pkg) || {}
if (alias == null) return pkg
@@ -98,6 +99,7 @@ export async function handler (
lockfileDir: opts.lockfileDir ?? opts.dir,
preferredVersions: {},
projectDir: opts.dir,
publishedBy,
})
return resolved.id
}))