Skip to content

Write pnpm 11 patch metadata in native format - #211

Merged
0x80 merged 8 commits into
mainfrom
0x80/207-write-patcheddependencies-in-the-format
Aug 29, 2026
Merged

Write pnpm 11 patch metadata in native format#211
0x80 merged 8 commits into
mainfrom
0x80/207-write-patcheddependencies-in-the-format

Conversation

@0x80

@0x80 0x80 commented Aug 29, 2026

Copy link
Copy Markdown
Owner

pnpm 11 and later now write bare patched-dependency hashes to pnpm-lock.yaml and copied relative patch paths to pnpm-workspace.yaml. pnpm 9 and 10 retain their object lockfile entries and manifest paths.

The patch metadata is decided in one version-aware helper, so lockfile, manifest, and workspace writers agree. The isolate also removes stale target-manifest metadata from pnpm 11+ output, verifies copied patch files and native lockfile references, and reports an unreadable pnpm lockfile separately from a missing patch hash.

Captured pnpm 10 and pnpm 12 patched-workspace fixtures keep the native output shapes under test. Manual pnpm 10 and pnpm 12 isolated installs both completed with --frozen-lockfile.

Decisions:

  • Centralized the pnpm patch-format boundary because all three writers share it. The added helper and coverage stayed within this migration, then went through the full local review flow.
  • Remove target-local legacy metadata for pnpm 11+ because the native patch path belongs in workspace YAML and copied patches come from workspace configuration.
  • Keep the pnpm 9/10 missing-hash fallback out of this frozen format change. It predates the migration and is tracked in Fail clearly when pnpm 9/10 patch hashes are missing #212.

Follow-ups: #212
Closes #207

Scope: packages (isolate-package), docs
Visibility: user-facing
Implementer: codex:gpt-5.6-terra:xhigh

Copilot AI balanced review requested due to automatic review settings August 29, 2026 09:18

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.

🟡 Changes recommended

Legacy manifest metadata can survive pnpm 11 isolation, and required real-version install coverage is absent.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates patch metadata generation to use native pnpm 11+ lockfile and workspace formats.

Changes:

  • Centralizes version-specific patch metadata generation.
  • Writes hashes to pnpm 11+ lockfiles and paths to workspace YAML.
  • Adds validation, integration coverage, and documentation.
File summaries
File Description
src/lib/patches/pnpm-patched-dependencies.ts Defines version-specific metadata formats.
src/lib/patches/pnpm-patched-dependencies.test.ts Tests format selection.
src/lib/patches/copy-patches.ts Validates hashes before copying.
src/lib/patches/copy-patches.test.ts Tests missing-hash rejection.
src/lib/patches/write-isolate-pnpm-workspace.ts Writes pnpm 11+ patch paths.
src/lib/patches/write-isolate-pnpm-workspace.test.ts Covers workspace generation and errors.
src/lib/lockfile/helpers/generate-pnpm-lockfile.ts Emits version-appropriate lockfile entries.
src/lib/lockfile/helpers/generate-pnpm-lockfile.test.ts Tests hash output and validation.
src/lib/lockfile/helpers/generate-pnpm-lockfile.integration.test.ts Verifies serialized lockfile formats.
src/isolate.ts Integrates patch metadata writers.
src/isolate.integration.test.ts Tests isolation output across versions.
docs/patched-dependencies.md Documents pnpm patch formats.
Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/isolate.ts
Comment thread src/isolate.integration.test.ts
Copilot AI review requested due to automatic review settings August 29, 2026 09:35

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.

🟢 Approval recommended

The version-specific output is consistently applied and covered across generation, copying, and isolation flows.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings August 29, 2026 09:51

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.

🟢 Approval recommended

The version boundary, validation, writers, documentation, and regression coverage are consistent and complete.

Review details

Files not reviewed (2)

  • src/lib/lockfile/helpers/fixtures/pnpm-patched-dependencies-10/workspace/pnpm-lock.yaml: Generated file
  • src/lib/lockfile/helpers/fixtures/pnpm-patched-dependencies-12/workspace/pnpm-lock.yaml: Generated file
  • Files reviewed: 20/22 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings August 29, 2026 10:10

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.

🟢 Approval recommended

The version boundary, metadata placement, validation, compatibility behavior, and regression coverage are consistent and complete.

Review details

Files not reviewed (2)

  • src/lib/lockfile/helpers/fixtures/pnpm-patched-dependencies-10/workspace/pnpm-lock.yaml: Generated file
  • src/lib/lockfile/helpers/fixtures/pnpm-patched-dependencies-12/workspace/pnpm-lock.yaml: Generated file
  • Files reviewed: 20/22 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings August 29, 2026 10:18

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.

🟢 Approval recommended

The version boundary, failure handling, metadata cleanup, and output formats are consistently implemented and comprehensively tested.

Review details

Files not reviewed (2)

  • src/lib/lockfile/helpers/fixtures/pnpm-patched-dependencies-10/workspace/pnpm-lock.yaml: Generated file
  • src/lib/lockfile/helpers/fixtures/pnpm-patched-dependencies-12/workspace/pnpm-lock.yaml: Generated file
  • Files reviewed: 20/22 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@0x80
0x80 merged commit b1a1552 into main Aug 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write patchedDependencies in the format pnpm 11 and up expect

2 participants