use new electron-releases with snake_case props

This commit is contained in:
Zeke Sikelianos 2017-12-20 11:41:17 -08:00 коммит произвёл Zeke Sikelianos
Родитель bdf3e6babd
Коммит 8ec78cd7f7
5 изменённых файлов: 60 добавлений и 178 удалений

Просмотреть файл

@ -1,6 +1,6 @@
const i18n = require('lib/i18n')
const releases = require('electron-releases')
const {dependencyVersions} = releases.find(release => release.version === i18n.electronLatestStableVersion)
const {deps} = releases.find(release => release.version === i18n.electronLatestStableVersion)
const {getLanguageNativeName} = require('locale-code')
// Supply all route handlers with a baseline `req.context` object
@ -24,7 +24,7 @@ module.exports = function contextBuilder (req, res, next) {
electronLatestStableVersion: i18n.electronLatestStableVersion,
electronLatestStableTag: i18n.electronLatestStableTag,
releases: releases,
dependencyVersions: dependencyVersions,
deps: deps,
currentLocale: req.language,
currentLocaleNativeName: getLanguageNativeName(req.language),
locales: i18n.locales,

216
package-lock.json сгенерированный
Просмотреть файл

@ -1869,6 +1869,16 @@
"integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==",
"dev": true
},
"clean-deep": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/clean-deep/-/clean-deep-3.0.2.tgz",
"integrity": "sha512-sLUtFxYtHc3jM9pmwyYXOLln0nnQ1OhFrefQ7nqUlva1crHDbi4gVO+nnMSm5jztFXIRDMt+kMNh0mOscbARow==",
"requires": {
"lodash.isempty": "4.4.0",
"lodash.isplainobject": "4.0.6",
"lodash.transform": "4.6.0"
}
},
"cli-boxes": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz",
@ -2789,15 +2799,25 @@
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"electron-api-historian": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/electron-api-historian/-/electron-api-historian-1.1.0.tgz",
"integrity": "sha512-9VuCE2+GjTOhFnnm1tNLXQcLzfnksm/BH2dP/bZQvIjBp0HwWObOZvmAi605ZX/hgII6Jx8ewUvjzI4/yGl6Ag=="
},
"electron-apps": {
"version": "1.1985.0",
"resolved": "https://registry.npmjs.org/electron-apps/-/electron-apps-1.1985.0.tgz",
"integrity": "sha512-VA96jaW93gfobbYeXzcwuG9cDM3BhgOBtIZqYVAMNAnvN9AidRnSZ/Yv1dDNy8KOp9Cvnj3LDtSrzOQJ2bgBSQ=="
"version": "1.1991.0",
"resolved": "https://registry.npmjs.org/electron-apps/-/electron-apps-1.1991.0.tgz",
"integrity": "sha512-r+88nSoB3KNe7Qg007IIqZ+BCvxzAj3MqBmLhAdeCjlsYz2lbEydPYzCECuFMpgYJtMU9AIentRjOJgS97X3Ug=="
},
"electron-i18n": {
"version": "0.28.1",
"resolved": "https://registry.npmjs.org/electron-i18n/-/electron-i18n-0.28.1.tgz",
"integrity": "sha512-YMPRsVEJZMEblEKaz1yfxnyfXm67JP8xQwl9CVEx4iovzcE29pY5CK11IEnyOXYnrfuRyO6fRmBeHB6J/bzyvg=="
"version": "0.31.0",
"resolved": "https://registry.npmjs.org/electron-i18n/-/electron-i18n-0.31.0.tgz",
"integrity": "sha512-tVB4UaDXYoiSAnuEF0cxWmnWrzADVrL3hbDuYMJ+p+oAQKY6s3CTP25Ghxq0HW4CFufyRquy/s7MqO8aFfc4Tw=="
},
"electron-releases": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/electron-releases/-/electron-releases-2.1.0.tgz",
"integrity": "sha512-cyKFD1bTE/UgULXfaueIN1k5EPFzs+FRc/rvCY5tIynefAPqopQEgjr0EzY+U3Dqrk/G4m9tXSPuZ77v6dL/Rw=="
},
"electron-to-chromium": {
"version": "1.3.26",
@ -5907,12 +5927,6 @@
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
"integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg="
},
"json-parse-better-errors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz",
"integrity": "sha512-xyQpxeWWMKyJps9CuGJYeng6ssI5bpqS9ltQpdVQ90t4ql6NdnxFKh95JcRt2cun/DjMVNrdjniLPuMA69xmCw==",
"dev": true
},
"json-schema": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
@ -6272,11 +6286,21 @@
"integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=",
"dev": true
},
"lodash.isempty": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz",
"integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4="
},
"lodash.isfinite": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz",
"integrity": "sha1-+4m2WpqAKBgz8LdHizpRBPiY67M="
},
"lodash.isplainobject": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
"integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
},
"lodash.keys": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz",
@ -6309,6 +6333,11 @@
"integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=",
"dev": true
},
"lodash.transform": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.transform/-/lodash.transform-4.6.0.tgz",
"integrity": "sha1-EjBkIvYzJK7YSD0/ODMrX2cFR6A="
},
"longest": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
@ -6479,12 +6508,6 @@
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"memorystream": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
"integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=",
"dev": true
},
"meow": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
@ -7011,144 +7034,6 @@
}
}
},
"npm-run-all": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.2.tgz",
"integrity": "sha512-Z2aRlajMK4SQ8u19ZA75NZZu7wupfCNQWdYosIi8S6FgBdGf/8Y6Hgyjdc8zU2cYmIRVCx1nM80tJPkdEd+UYg==",
"dev": true,
"requires": {
"ansi-styles": "3.2.0",
"chalk": "2.3.0",
"cross-spawn": "5.1.0",
"memorystream": "0.3.1",
"minimatch": "3.0.4",
"ps-tree": "1.1.0",
"read-pkg": "3.0.0",
"shell-quote": "1.6.1",
"string.prototype.padend": "3.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
"integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
"dev": true,
"requires": {
"color-convert": "1.9.1"
}
},
"chalk": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
"integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
"dev": true,
"requires": {
"ansi-styles": "3.2.0",
"escape-string-regexp": "1.0.5",
"supports-color": "4.5.0"
}
},
"cross-spawn": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
"dev": true,
"requires": {
"lru-cache": "4.1.1",
"shebang-command": "1.2.0",
"which": "1.3.0"
}
},
"has-flag": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
"integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
"dev": true
},
"load-json-file": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
"integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
"dev": true,
"requires": {
"graceful-fs": "4.1.11",
"parse-json": "4.0.0",
"pify": "3.0.0",
"strip-bom": "3.0.0"
}
},
"lru-cache": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz",
"integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==",
"dev": true,
"requires": {
"pseudomap": "1.0.2",
"yallist": "2.1.2"
}
},
"parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
"dev": true,
"requires": {
"error-ex": "1.3.1",
"json-parse-better-errors": "1.0.1"
}
},
"path-type": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
"integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
"dev": true,
"requires": {
"pify": "3.0.0"
}
},
"pify": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
"dev": true
},
"read-pkg": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
"integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
"dev": true,
"requires": {
"load-json-file": "4.0.0",
"normalize-package-data": "2.4.0",
"path-type": "3.0.0"
}
},
"strip-bom": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
"integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
"dev": true
},
"supports-color": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz",
"integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=",
"dev": true,
"requires": {
"has-flag": "2.0.0"
}
},
"which": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz",
"integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==",
"dev": true,
"requires": {
"isexe": "2.0.0"
}
}
}
},
"npm-run-path": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
@ -7518,6 +7403,14 @@
"error-ex": "1.3.1"
}
},
"parse-link-header": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parse-link-header/-/parse-link-header-1.0.1.tgz",
"integrity": "sha1-vt/g0hGK64S+deewJUGeyKYRQKc=",
"requires": {
"xtend": "4.0.1"
}
},
"parsejson": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz",
@ -9464,17 +9357,6 @@
"strip-ansi": "3.0.1"
}
},
"string.prototype.padend": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz",
"integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=",
"dev": true,
"requires": {
"define-properties": "1.1.2",
"es-abstract": "1.8.0",
"function-bind": "1.1.0"
}
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",

Просмотреть файл

@ -33,10 +33,10 @@
"cross-env": "^5.1.1",
"description": "0.0.2",
"dotenv": "^4.0.0",
"electron-api-historian": "1.1.0",
"electron-apps": "1.1992.0",
"electron-i18n": "0.32.0",
"electron-api-historian": "^1.1.0",
"electron-releases": "^1.13.0",
"electron-releases": "2.1.0",
"electron-userland-reports": "1.6.0",
"express": "^4.16.2",
"express-hbs": "^1.0.4",

Просмотреть файл

@ -212,11 +212,11 @@ describe('electronjs.org', () => {
releases.every(release => release.version && release.version.length).should.eq(true)
// includes version data for v8, node, chromium, etc
releases.filter(release => release.dependencyVersions).length.should.be.above(135)
releases.filter(release => release.deps).length.should.be.above(135)
})
test('/releases.json (lite version)', async () => {
const res = await supertest(app).get('/releases.json?pick=tag_name,published_at, dependencyVersions.node')
const res = await supertest(app).get('/releases.json?pick=tag_name,published_at, deps.node')
const releases = res.body
releases.should.be.an('array')
releases.length.should.be.above(270)
@ -226,7 +226,7 @@ describe('electronjs.org', () => {
release.should.deep.equal({
tag_name: 'v1.8.1',
published_at: '2017-09-29T00:24:31Z',
dependencyVersions: {node: '8.2.1'}
deps: {node: '8.2.1'}
})
})
})

Просмотреть файл

@ -10,10 +10,10 @@
<div class="subtron py-4 text-center">
<div class="container">
<div id="electron-versions" class="electron-versions">
<span class="electron-versions-main">Electron: <strong>{{{dependencyVersions.version}}}</strong></span>
<span>Node: <strong>{{{dependencyVersions.node}}}</strong></span>
<span>Chromium: <strong>{{{dependencyVersions.chrome}}}</strong></span>
<span>V8: <strong>{{{dependencyVersions.v8}}}</strong></span>
<span class="electron-versions-main">Electron: <strong>{{{deps.version}}}</strong></span>
<span>Node: <strong>{{{deps.node}}}</strong></span>
<span>Chromium: <strong>{{{deps.chrome}}}</strong></span>
<span>V8: <strong>{{{deps.v8}}}</strong></span>
</div>
</div>
</div>