Skip to content

fix: dlx catalogs not found#11308

Merged
zkochan merged 4 commits into
pnpm:mainfrom
Netail:fix/dlx-catalog-not-found
May 5, 2026
Merged

fix: dlx catalogs not found#11308
zkochan merged 4 commits into
pnpm:mainfrom
Netail:fix/dlx-catalog-not-found

Conversation

@Netail

@Netail Netail commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

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)

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.

@Netail Netail force-pushed the fix/dlx-catalog-not-found branch from 368f60e to 53193b6 Compare April 19, 2026 22:56
@Netail Netail marked this pull request as ready for review April 19, 2026 23:02
@Netail Netail requested a review from zkochan as a code owner April 19, 2026 23:02
Copilot AI review requested due to automatic review settings April 19, 2026 23:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 dlx local-config inheritance to include catalogs and fetch/retry settings.
  • Add pnpm dlx tests 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.

Comment thread pnpm/test/dlx.ts
Comment thread pnpm/test/dlx.ts
Comment thread pnpm/test/dlx.ts Outdated
Comment on lines +87 to +97
const CATALOGS_CFG_KEYS = [
'catalogs',
] satisfies Array<keyof Config>

const FETCH_CFG_KEYS = [
'fetchRetryFactor',
'fetchRetryMaxtimeout',
'fetchRetryMintimeout',
'fetchRetries',
'fetchTimeout',
] satisfies Array<keyof Config>

Copilot AI Apr 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread pnpm/test/dlx.ts Outdated
@Netail Netail force-pushed the fix/dlx-catalog-not-found branch from 53193b6 to c1345f7 Compare April 19, 2026 23:20
Copilot AI review requested due to automatic review settings April 28, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • pickDlxConfig now inherits catalogs and 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.

Comment thread pnpm/test/dlx.ts
@Netail

Netail commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

@zkochan should be ready for review :)

Comment thread config/reader/src/localConfig.ts
Copilot AI review requested due to automatic review settings May 5, 2026 09:11
@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9ef9c653-106d-49fe-8675-afd3eca6a459

📥 Commits

Reviewing files that changed from the base of the PR and between 37c9245 and d945d5f.

📒 Files selected for processing (2)
  • config/reader/src/localConfig.ts
  • pnpm/test/dlx.ts
✅ Files skipped from review due to trivial changes (1)
  • config/reader/src/localConfig.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm/test/dlx.ts

📝 Walkthrough

Walkthrough

Extends DLX config inheritance to include workspace catalogs and fetch-related keys so pnpm dlx resolves catalog: specs from pnpm-workspace.yaml; adds tests and a changeset documenting the fix for #10594. (50 words)

Changes

Catalog Config Inheritance for DLX

Layer / File(s) Summary
Data Shape / Whitelist
config/reader/src/localConfig.ts
Adds CATALOGS_CFG_KEYS (catalogs) and FETCH_CFG_KEYS (fetch retry/timeout keys) as whitelists of Config keys.
Type Guards
config/reader/src/localConfig.ts
Adds isCatalogsCfgKey and isFetchCfgKey type-guard helpers for the new whitelists.
Core Inheritance Logic
config/reader/src/localConfig.ts
Expands the predicate in pickDlxConfig so inheritDlxConfig copies catalogs and fetch-related keys (in addition to existing auth/registry and security/trust keys) from workspace local config into the DLX config.
Behavioral Tests
pnpm/test/dlx.ts
Adds describe('catalogs inherited from pnpm-workspace.yaml') with four execPnpmSync tests validating shx@catalog: resolution for default and named catalogs, including expected failure stderr messages. Also adjusts workspace patchedDependencies test to ensure dlx ignores non-existent patches.
Release Note
.changeset/twenty-donuts-cut.md
Updates changeset: marks @pnpm/config.reader and pnpm as patch releases and documents the fix for #10594.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through configs, followed each track,
Found hidden catalogs and brought them back.
DLX now listens, no entries gone stray,
I nibbled the bug and chased it away. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix: dlx catalogs not found' directly addresses the main issue being fixed—enabling dlx to read catalogs from workspace config.
Linked Issues check ✅ Passed The changes fully address #10594 by adding catalog inheritance to dlx config, implementing catalog resolution tests, and enabling workspace catalogs to be read during dlx execution.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing catalog resolution in dlx and adding relevant test coverage; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .changeset/twenty-donuts-cut.md Outdated
Copilot AI review requested due to automatic review settings May 5, 2026 10:10
Netail and others added 3 commits May 5, 2026 12:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@zkochan zkochan force-pushed the fix/dlx-catalog-not-found branch from 6ec65a6 to 37c9245 Compare May 5, 2026 10:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +87 to +97
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.
@zkochan zkochan enabled auto-merge (squash) May 5, 2026 10:26
@zkochan zkochan merged commit b14496a into pnpm:main May 5, 2026
9 checks passed
@Netail Netail deleted the fix/dlx-catalog-not-found branch May 5, 2026 11:55
zkochan added a commit that referenced this pull request May 5, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_SPEC dlx catalog

3 participants