Skip to content

Commit

Permalink
Add Dev, Peer and Optional dependencies to npm PackageMetadataVersion (
Browse files Browse the repository at this point in the history
…go-gitea#21017) (go-gitea#21044)

Backport go-gitea#21017

Set DevDependencies, PeerDependencies & OptionalDependencies in npm package metadatas

Fix go-gitea#21013
  • Loading branch information
joecarl authored Sep 3, 2022
1 parent 3973ce3 commit bd1412c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions routers/api/packages/npm/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit bd1412c

Please sign in to comment.