diff --git a/.changeset/curly-dryers-cheese.md b/.changeset/curly-dryers-cheese.md new file mode 100644 index 0000000000..6ce34b669f --- /dev/null +++ b/.changeset/curly-dryers-cheese.md @@ -0,0 +1,5 @@ +--- +"@pnpm/plugin-commands-script-runners": minor +--- + +Add timeout & retry options to `pnpm dlx` / `pnpx` diff --git a/exec/plugin-commands-script-runners/src/dlx.ts b/exec/plugin-commands-script-runners/src/dlx.ts index 461bb877ae..680ae3bf5e 100644 --- a/exec/plugin-commands-script-runners/src/dlx.ts +++ b/exec/plugin-commands-script-runners/src/dlx.ts @@ -102,6 +102,13 @@ export async function handler ( authConfig: opts.rawConfig, fullMetadata, filterMetadata: fullMetadata, + retry: { + factor: opts.fetchRetryFactor, + maxTimeout: opts.fetchRetryMaxtimeout, + minTimeout: opts.fetchRetryMintimeout, + retries: opts.fetchRetries, + }, + timeout: opts.fetchTimeout, }) const resolvedPkgAliases: string[] = [] const publishedBy = opts.minimumReleaseAge ? new Date(Date.now() - opts.minimumReleaseAge * 60 * 1000) : undefined