NPM packages don't include the "peerDependenciesMeta" map from package.json #33110
Labels
issue/needs-feedback
For bugs, we need more details. For features, the feature must be described in more detail
topic/packages
type/bug
Description
NPM packages may specify peer dependencies. These are typically used to indicate "another package which this package is compatible with". Now, I don't know the full story of how we got here, but for some reason package managers by default install all peer dependencies of a package you're installing as a dependency in your project, which often means installing packages you don't need. The way to make it clear to a package's consumer that a peer dependency shouldn't be installed by default is to use a separate
peerDependenciesMeta
mapping in the package'spackage.json
file. But the Gitea API doesn't include that mapping in responses to package metadata requests, causing peer dependencies of packages installed from Gitea to always be installed.I'm filing this as a bug, but it may easily be also seen as an enhancement of compatibility with NPM. Not sure which is more correct.
In any case, I'm not Go developer, but it looks to me like it may be a one-line fix by inserting a single line in this file somewhat like this:
Gitea Version
latest
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
binary download, but irrelevant
Database
None
The text was updated successfully, but these errors were encountered: