aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Carlos <joecarlhr@gmail.com>2022-09-03 00:00:18 +0200
committerGitHub <noreply@github.com>2022-09-02 23:00:18 +0100
commitb8818a1c685870d774e956f0d6980784225225c3 (patch)
tree1523f73db643450585ca83def01a2f9df8b22e3e
parent2dbed4bd9759cbcc4acbe0864e81c7bf3f48b3de (diff)
downloadgitea-b8818a1c685870d774e956f0d6980784225225c3.tar.gz
gitea-b8818a1c685870d774e956f0d6980784225225c3.zip
fix: PackageMetadataVersion deps (#21017)
Set DevDependencies, PeerDependencies & OptionalDependencies in npm package metadatas Fix #21013
-rw-r--r--routers/api/packages/npm/api.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/routers/api/packages/npm/api.go b/routers/api/packages/npm/api.go
index 4b6b803971..763c595152 100644
--- a/routers/api/packages/npm/api.go
+++ b/routers/api/packages/npm/api.go
@@ -55,15 +55,18 @@ func createPackageMetadataVersion(registryURL string, pd *packages_model.Package
metadata := pd.Metadata.(*npm_module.Metadata)
return &npm_module.PackageMetadataVersion{
- ID: fmt.Sprintf("%s@%s", pd.Package.Name, pd.Version.Version),
- Name: pd.Package.Name,
- Version: pd.Version.Version,
- Description: metadata.Description,
- Author: npm_module.User{Name: metadata.Author},
- Homepage: metadata.ProjectURL,
- License: metadata.License,
- Dependencies: metadata.Dependencies,
- Readme: metadata.Readme,
+ ID: fmt.Sprintf("%s@%s", pd.Package.Name, pd.Version.Version),
+ Name: pd.Package.Name,
+ Version: pd.Version.Version,
+ Description: metadata.Description,
+ Author: npm_module.User{Name: metadata.Author},
+ Homepage: metadata.ProjectURL,
+ License: metadata.License,
+ Dependencies: metadata.Dependencies,
+ DevDependencies: metadata.DevelopmentDependencies,
+ PeerDependencies: metadata.PeerDependencies,
+ OptionalDependencies: metadata.OptionalDependencies,
+ Readme: metadata.Readme,
Dist: npm_module.PackageDistribution{
Shasum: pd.Files[0].Blob.HashSHA1,
Integrity: "sha512-" + base64.StdEncoding.EncodeToString(hashBytes),