Add support for npm bundleDependencies (#30751)

pull/30750/head^2
Micash 7 months ago committed by GitHub
parent d11133b836
commit ad4e902d5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      modules/packages/npm/creator.go
  2. 1
      modules/packages/npm/metadata.go
  3. 1
      options/locale/locale_en-US.ini
  4. 1
      routers/api/packages/npm/api.go
  5. 9
      templates/package/content/npm.tmpl

@ -78,6 +78,7 @@ type PackageMetadataVersion struct {
Repository Repository `json:"repository,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Dependencies map[string]string `json:"dependencies,omitempty"`
BundleDependencies []string `json:"bundleDependencies,omitempty"`
DevDependencies map[string]string `json:"devDependencies,omitempty"`
PeerDependencies map[string]string `json:"peerDependencies,omitempty"`
Bin map[string]string `json:"bin,omitempty"`
@ -218,6 +219,7 @@ func ParsePackage(r io.Reader) (*Package, error) {
ProjectURL: meta.Homepage,
Keywords: meta.Keywords,
Dependencies: meta.Dependencies,
BundleDependencies: meta.BundleDependencies,
DevelopmentDependencies: meta.DevDependencies,
PeerDependencies: meta.PeerDependencies,
OptionalDependencies: meta.OptionalDependencies,

@ -16,6 +16,7 @@ type Metadata struct {
ProjectURL string `json:"project_url,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Dependencies map[string]string `json:"dependencies,omitempty"`
BundleDependencies []string `json:"bundleDependencies,omitempty"`
DevelopmentDependencies map[string]string `json:"development_dependencies,omitempty"`
PeerDependencies map[string]string `json:"peer_dependencies,omitempty"`
OptionalDependencies map[string]string `json:"optional_dependencies,omitempty"`

@ -3495,6 +3495,7 @@ npm.install = To install the package using npm, run the following command:
npm.install2 = or add it to the package.json file:
npm.dependencies = Dependencies
npm.dependencies.development = Development Dependencies
npm.dependencies.bundle = Bundled Dependencies
npm.dependencies.peer = Peer Dependencies
npm.dependencies.optional = Optional Dependencies
npm.details.tag = Tag

@ -64,6 +64,7 @@ func createPackageMetadataVersion(registryURL string, pd *packages_model.Package
Homepage: metadata.ProjectURL,
License: metadata.License,
Dependencies: metadata.Dependencies,
BundleDependencies: metadata.BundleDependencies,
DevDependencies: metadata.DevelopmentDependencies,
PeerDependencies: metadata.PeerDependencies,
OptionalDependencies: metadata.OptionalDependencies,

@ -45,6 +45,15 @@
</div>
{{end}}
{{if .PackageDescriptor.Metadata.BundleDependencies}}
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.npm.dependencies.bundle"}}</h4>
<div class="ui attached segment">
{{range .PackageDescriptor.Metadata.BundleDependencies}}
{{.}}
{{end}}
</div>
{{end}}
{{if .PackageDescriptor.Metadata.Keywords}}
<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4>
<div class="ui attached segment">

Loading…
Cancel
Save