git ssb

16+

cel / patchfoo



Commit 9110e551179f40de7b323d7fd8cfcbd41bac8e8d

Make npm links more consistent

cel committed on 9/22/2017, 8:59:45 PM
Parent: 1e2dc6de6b0d0d59f61e42f99899fcfa2b0abcbe

Files changed

lib/render.jschanged
lib/serve.jschanged
lib/render.jsView
@@ -422,12 +422,12 @@
422422 var self = this
423423 var done = multicb({pluck: 1, spread: true})
424424 var base = '/npm/' + (opts.author ? u.escapeId(link.author) + '/' : '')
425425 var pathWithAuthor = opts.withAuthor ? '/npm/' +
426- u.escapeId(link.author) + '/' +
427- (opts.name ? opts.name + '/' +
428- (opts.version ? opts.version + '/' +
429- (opts.distTag ? opts.distTag + '/' : '') : '') : '') : ''
426 + u.escapeId(link.author) +
427 + (opts.name ? '/' + opts.name +
428 + (opts.version ? '/' + opts.version +
429 + (opts.distTag ? '/' + opts.distTag + '/' : '') : '') : '') : ''
430430 self.app.getAbout(link.author, done())
431431 self.app.getBlobState(link.link, done())
432432 done(function (err, about, blobState) {
433433 if (err) return cb(err)
@@ -440,13 +440,13 @@
440440 href: self.toUrl(base + name),
441441 title: 'package name'
442442 }, name), ' '),
443443 h('td', version ? [h('a', {
444- href: self.toUrl(base + name + '/' + version + '/'),
444 + href: self.toUrl(base + name + '/' + version),
445445 title: 'package version'
446446 }, version), ' '] : ''),
447447 h('td', distTag ? [h('a', {
448- href: self.toUrl(base + name + '//' + distTag + '/'),
448 + href: self.toUrl(base + name + '//' + distTag),
449449 title: 'dist-tag'
450450 }, distTag), ' '] : ''),
451451 h('td', {align: 'right'}, link.size != null ? [h('span', {
452452 title: 'tarball size'
lib/serve.jsView
@@ -1889,12 +1889,12 @@
18891889 (distTag ? distTag + ':' : '') : '') : '')
18901890
18911891 var render = self.app.render
18921892 var base = '/npm/' + (author ? u.escapeId(author) + '/' : '')
1893- var pathWithoutAuthor = '/npm/' +
1894- (name ? name + '/' +
1895- (version ? version + '/' +
1896- (distTag ? distTag + '/' : '') : '') : '')
1893 + var pathWithoutAuthor = '/npm' +
1894 + (name ? '/' + name +
1895 + (version ? '/' + version +
1896 + (distTag ? '/' + distTag : '') : '') : '')
18971897 return pull(
18981898 ph('section', {}, [
18991899 ph('h3', [ph('a', {href: render.toUrl('/npm/')}, 'npm'), ' : ',
19001900 author ? [
@@ -1907,9 +1907,9 @@
19071907 distTag ? [ph('a', {href: render.toUrl(base + name + '/' + version + '/' + distTag)}, distTag)] : ''
19081908 ]),
19091909 ph('table', [
19101910 ph('thead', ph('tr', [
1911- !author ? ph('td', 'publisher') : '',
1911 + ph('td', 'publisher'),
19121912 ph('td', 'package'),
19131913 ph('td', 'version'),
19141914 ph('td', 'tag'),
19151915 ph('td', 'size'),
@@ -1925,9 +1925,9 @@
19251925 return link.name.split(':')[3] === distTag
19261926 }),
19271927 paramap(function (link, cb) {
19281928 self.app.render.npmPackageMention(link, {
1929- withAuthor: !author,
1929 + withAuthor: true,
19301930 author: author,
19311931 name: name,
19321932 version: version,
19331933 distTag: distTag,

Built with git-ssb-web