fix: dlx catalogs not found#11308
Conversation
368f60e to
53193b6
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes pnpm dlx / pnpx failing to resolve catalog: protocol dependencies by ensuring catalog configuration from pnpm-workspace.yaml is available during dlx execution, and adds regression tests plus a changeset.
Changes:
- Extend
dlxlocal-config inheritance to includecatalogsand fetch/retry settings. - Add
pnpm dlxtests covering default and named catalog resolution (success and failure cases). - Add a changeset entry for the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
config/reader/src/localConfig.ts |
Allows dlx to inherit catalogs (and fetch retry/timeout settings) from local config sources. |
pnpm/test/dlx.ts |
Adds regression tests verifying dlx resolves catalog: from workspace catalogs (default + named). |
.changeset/twenty-donuts-cut.md |
Declares release notes / version bumps for the fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const CATALOGS_CFG_KEYS = [ | ||
| 'catalogs', | ||
| ] satisfies Array<keyof Config> | ||
|
|
||
| const FETCH_CFG_KEYS = [ | ||
| 'fetchRetryFactor', | ||
| 'fetchRetryMaxtimeout', | ||
| 'fetchRetryMintimeout', | ||
| 'fetchRetries', | ||
| 'fetchTimeout', | ||
| ] satisfies Array<keyof Config> |
There was a problem hiding this comment.
The file-level dlx inheritance comment/rationale above now omits two newly allowed categories: catalogs and fetch/retry configuration. Please update the documentation block to reflect that dlx intentionally inherits these keys (and why they’re safe to inherit) so the allowlist and the comment don’t drift.
53193b6 to
c1345f7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
config/reader/src/localConfig.ts:158
pickDlxConfignow inheritscatalogsand fetch retry/timeout settings, but the surrounding documentation/commentary still describes dlx as inheriting only auth + security/trust policy settings (and the rules table implies all workspace settings are excluded). Please update the docs in this module to reflect the expanded set of settings that dlx intentionally inherits, so future changes don’t accidentally remove/restrict these keys again.
function pickDlxConfig (localCfg: Partial<Config>): Partial<Config> {
const result: Record<string, unknown> = {}
for (const key in localCfg) {
if (isAuthCfgKey(key as keyof Config) || isSecurityPolicyCfgKey(key as keyof Config) || isCatalogsCfgKey(key as keyof Config) || isFetchCfgKey(key as keyof Config)) {
result[key] = localCfg[key as keyof Config]
}
}
return result as Partial<Config>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@zkochan should be ready for review :) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughExtends DLX config inheritance to include workspace ChangesCatalog Config Inheritance for DLX
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
6ec65a6 to
37c9245
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const CATALOGS_CFG_KEYS = [ | ||
| 'catalogs', | ||
| ] satisfies Array<keyof Config> | ||
|
|
||
| const FETCH_CFG_KEYS = [ | ||
| 'fetchRetryFactor', | ||
| 'fetchRetryMaxtimeout', | ||
| 'fetchRetryMintimeout', | ||
| 'fetchRetries', | ||
| 'fetchTimeout', | ||
| ] satisfies Array<keyof Config> |
Updates the inheritance doc block and `inheritDlxConfig` comment to reflect catalogs and fetch retry/timeout categories. Renames the "dlx ignores configuration" test to specify what it actually checks (patchedDependencies), since catalogs are now intentionally inherited.
Fixes #10594, catalogs not being read from the workspace when using the `catalog:` protocol with the `pnpm dlx` / `pnpx` command, resulting in a catalog entry not found error. Added e2e tests to check if the workspace config is actually loaded. Also added that pnpm dlx reads the retry options from the workspace (Could potentially put that in a separate PR) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed catalog resolution when using the `catalog:` protocol with `pnpm dlx` / `pnpx` so catalogs are correctly read from the workspace. * **New Features** * `dlx` now inherits workspace catalog and fetch retry/timeout settings so CLI runs respect those local configs. * **Tests** * Added tests validating catalog inheritance and failure cases for `dlx` catalog resolution. * **Chores** * Updated changeset metadata to mark related packages for patch releases. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Zoltan Kochan <z@kochan.io> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixes #10594, catalogs not being read from the workspace when using the
catalog:protocol with thepnpm dlx/pnpxcommand, resulting in a catalog entry not found error.Added e2e tests to check if the workspace config is actually loaded. Also added that pnpm dlx reads the retry options from the workspace (Could potentially put that in a separate PR)
Summary by CodeRabbit
Bug Fixes
catalog:protocol withpnpm dlx/pnpxso catalogs are correctly read from the workspace.New Features
dlxnow inherits workspace catalog and fetch retry/timeout settings so CLI runs respect those local configs.Tests
dlxcatalog resolution.Chores