Conversation
Some registries (e.g. Gitea) reject a string `repository` field with a
500 Internal Server Error, since they decode it into an object-typed
struct. npm normalizes a string repository into { type, url } before
publishing; pnpm did not, so `pnpm publish` failed where npm succeeded.
Close #12099
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.test.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (2)📚 Learning: 2026-05-26T21:01:06.666ZApplied to files:
📚 Learning: 2026-05-14T09:04:00.133ZApplied to files:
🔇 Additional comments (6)
📝 WalkthroughWalkthroughThis PR fixes a publish failure on Codeberg and similar registries by normalizing the ChangesRepository Normalization in Publish Manifests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review Summary by QodoNormalize string repository field to object form for registry compatibility
WalkthroughsDescription• Normalize string repository field to object form before publishing • Prevents 500 errors on registries like Gitea/Codeberg that expect object format • Matches npm's normalize-package-data behavior for compatibility • Adds comprehensive unit tests for the new transform function Diagramflowchart LR
A["String repository<br/>e.g. URL"] -->|transformRepository| B["Object repository<br/>{type: git, url}"]
C["Object repository<br/>unchanged"] -->|transformRepository| C
D["Missing repository<br/>unchanged"] -->|transformRepository| D
B --> E["Compatible with<br/>Gitea/Codeberg"]
File Changes1. releasing/exportable-manifest/src/transform/index.ts
|
There was a problem hiding this comment.
Pull request overview
This PR fixes pnpm publish compatibility with registries (notably Gitea/Codeberg) that expect package.json’s repository field to be an object in published metadata, by normalizing a string repository into { type: 'git', url } during exportable-manifest generation (matching npm’s publish behavior).
Changes:
- Add
transformRepositoryto convert a stringrepositoryinto{ type: 'git', url }in the exportable-manifest transform pipeline. - Add unit tests covering absent / string / object
repositorycases. - Update
cspell.jsonto allow “Codeberg”, and add a changeset for patch releases.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| releasing/exportable-manifest/test/transformRepository.test.ts | Adds unit tests for repository normalization behavior. |
| releasing/exportable-manifest/src/transform/repository.ts | Implements transformRepository to normalize string repository into object form. |
| releasing/exportable-manifest/src/transform/index.ts | Wires transformRepository into the exportable-manifest transform pipeline. |
| cspell.json | Adds “Codeberg” to the spelling dictionary. |
| .changeset/publish-normalize-repository.md | Declares patch releases for the affected packages and documents the fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Problem
pnpm publishfails with a500 Internal Server Errorwhen publishing to registries such as Gitea/Codeberg, whilenpm publishof the same package succeeds. Reported in #12099.Root cause
These registries decode the published package metadata into a typed struct where
repositoryis an object ({ type, url, directory }) — see Gitea'screator.go. Whenrepositoryarrives as a string (e.g."https://codeberg.org/tao-cumplido/binary-tools"), JSON decoding into that struct fails and the server returns a 500.npm avoids this because
normalize-package-datarewrites a stringrepositoryinto{ type: 'git', url }before publishing. pnpm's exportable manifest did not apply that normalization, so it sent the bare string and tripped the registry. This is also why the documented workaroundpnpm pack && npm publish *.tgzworks — npm normalizes the manifest it reads from the tarball.Fix
Add a
transformRepositorystep to the exportable-manifest pipeline that converts a stringrepositoryinto{ type: 'git', url }, matching npm. Object-formrepositoryvalues are left untouched.Test
Added unit tests for the new transform (absent / string / object cases).
Close #12099
Written by an agent (Claude Code, claude-opus-4-8).
Summary by CodeRabbit
typeandurlproperties.