git ssb

3+

cel / ssb-npm-registry



Commit 87875a4f00604b64bb80b480a5764b44885eef80

Include license field

- in package mention when publishing
- when serving package info
cel committed on 8/31/2018, 2:31:58 AM
Parent: 52dae1b7fc584ab4f59c8886a1bfe5285db3dfb5

Files changed

index.jschanged
index.jsView
@@ -830,8 +830,9 @@
830830 function resolveVersion(version, cb) {
831831 self.populatePackageJson(obj.versions[version], function (err, pkg) {
832832 if (err) return cb(err)
833833 if (pkg) obj.versions[version] = pkg
834 + if (pkg && pkg.license && !obj.license) obj.license = pkg.license
834835 cb()
835836 })
836837 }
837838 function resolveAll() {
@@ -955,8 +956,9 @@
955956 if (pkg.version && pkg.version !== version)
956957 return self.respondError(400, 'Mismatched package version: ' + [pkg.version, version])
957958 linksByVersion[version] = link
958959 link.version = version
960 + link.license = pkg.license
959961 link.dependencies = pkg.dependencies || {}
960962 link.bundledDependencies = pkg.bundledDependencies || pkg.bundleDependencies
961963 }
962964
@@ -980,8 +982,9 @@
980982 name: 'npm:' + name + ':' + link.version + (link.tag ? ':' + link.tag : ''),
981983 link: link.link,
982984 size: link.size,
983985 shasum: link.shasum,
986 + license: link.license,
984987 dependencies: link.dependencies,
985988 bundledDependencies: link.bundledDependencies,
986989 })
987990 }
@@ -1032,8 +1035,9 @@
10321035 pkg.dist.shasum = pkg._shasum
10331036 pkg.author = pkg.author || obj.author
10341037 pkg.version = pkg.version || obj.version
10351038 pkg.name = pkg.name || obj.name
1039 + pkg.license = pkg.license || obj.license
10361040 cb(null, pkg)
10371041 })
10381042 }
10391043 })

Built with git-ssb-web