diff --git a/.prettierrc.json b/.prettierrc.json index cd64a92..ac73760 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,5 +1,5 @@ { - "trailingComma": "none", + "trailingComma": "all", "tabWidth": 2, "singleQuote": true, "proseWrap": "always" diff --git a/_common/brew.js b/_common/brew.js index c0f7fd0..5ae22d6 100644 --- a/_common/brew.js +++ b/_common/brew.js @@ -14,7 +14,7 @@ function getAllReleases(request, formula) { return request({ url: 'https://formulae.brew.sh/api/formula/' + formula + '.json', fail: true, // https://git.coolaj86.com/coolaj86/request.js/issues/2 - json: true + json: true, }) .then(failOnBadStatus) .then(function (resp) { @@ -26,16 +26,16 @@ function getAllReleases(request, formula) { return [ { version: ver, - download: dl.replace(/{{ v }}/g, ver) - } + download: dl.replace(/{{ v }}/g, ver), + }, ].concat( resp.body.versioned_formulae.map(function (f) { var ver = f.replace(/.*@/, ''); return { version: ver, - download: dl + download: dl, }; - }) + }), ); }) .catch(function (err) { diff --git a/_common/gitea.js b/_common/gitea.js index d6fe537..be4c247 100644 --- a/_common/gitea.js +++ b/_common/gitea.js @@ -16,7 +16,7 @@ function getAllReleases(request, owner, repo, baseurl) { return Promise.reject('missing baseurl'); } return ghRelease(request, owner, repo, baseurl + '/api/v1').then(function ( - all + all, ) { return all; }); @@ -29,11 +29,11 @@ if (module === require.main) { require('@root/request'), 'coolaj86', 'go-pathman', - 'https://git.coolaj86.com' + 'https://git.coolaj86.com', ).then( //getAllReleases(require('@root/request'), 'root', 'serviceman', 'https://git.rootprojects.org').then( function (all) { console.info(JSON.stringify(all, null, 2)); - } + }, ); } diff --git a/_common/github-source.js b/_common/github-source.js index 93382d1..6f32627 100644 --- a/_common/github-source.js +++ b/_common/github-source.js @@ -17,7 +17,7 @@ async function getAllReleases( repo, oses, arches, - baseurl = 'https://api.github.com' + baseurl = 'https://api.github.com', ) { if (!owner) { return Promise.reject('missing owner for repo'); @@ -28,14 +28,14 @@ async function getAllReleases( let req = { url: `${baseurl}/repos/${owner}/${repo}/releases`, - json: true + json: true, }; // TODO I really don't like global config, find a way to do better if (process.env.GITHUB_USERNAME) { req.auth = { user: process.env.GITHUB_USERNAME, - pass: process.env.GITHUB_TOKEN + pass: process.env.GITHUB_TOKEN, }; } @@ -44,7 +44,7 @@ async function getAllReleases( let all = { releases: [], // TODO make this ':baseurl' + ':releasename' - download: '' + download: '', }; for (let release of gHubResp) { @@ -66,7 +66,7 @@ async function getAllReleases( followAllRedirects: true, followOriginalHttpMethod: true, url: url, - stream: true + stream: true, }); // Workaround for bug where method changes to GET resp.destroy(); @@ -74,7 +74,7 @@ async function getAllReleases( // content-disposition: attachment; filename=BeyondCodeBootcamp-DuckDNS.sh-v1.0.1-0-ga2f4bde.zip let name = resp.headers['content-disposition'].replace( /.*filename=([^;]+)(;|$)/, - '$1' + '$1', ); all.releases.push({ name: name, @@ -85,7 +85,7 @@ async function getAllReleases( os: '', // will be guessed by download filename arch: '', // will be guessed by download filename ext: '', // will be normalized - download: resp.request.uri.href + download: resp.request.uri.href, }); } } @@ -108,7 +108,7 @@ function combinate(all, oses, arches) { for (let os of oses) { let combo = { arch: arch, - os: os + os: os, }; let rel = Object.assign({}, release, combo); combos.push(rel); @@ -126,7 +126,7 @@ if (module === require.main) { getAllReleases( require('@root/request'), 'BeyondCodeBootcamp', - 'DuckDNS.sh' + 'DuckDNS.sh', ).then(function (all) { console.info(JSON.stringify(all, null, 2)); }); diff --git a/_common/github.js b/_common/github.js index aa98074..a3858a3 100644 --- a/_common/github.js +++ b/_common/github.js @@ -15,7 +15,7 @@ function getAllReleases( request, owner, repo, - baseurl = 'https://api.github.com' + baseurl = 'https://api.github.com', ) { if (!owner) { return Promise.reject('missing owner for repo'); @@ -26,13 +26,13 @@ function getAllReleases( var req = { url: `${baseurl}/repos/${owner}/${repo}/releases`, - json: true + json: true, }; // TODO I really don't like global config, find a way to do better if (process.env.GITHUB_USERNAME) { req.auth = { user: process.env.GITHUB_USERNAME, - pass: process.env.GITHUB_TOKEN + pass: process.env.GITHUB_TOKEN, }; } @@ -41,7 +41,7 @@ function getAllReleases( const all = { releases: [], // todo make this ':baseurl' + ':releasename' - download: '' + download: '', }; gHubResp.forEach((release) => { @@ -56,7 +56,7 @@ function getAllReleases( os: '', // will be guessed by download filename arch: '', // will be guessed by download filename ext: '', // will be normalized - download: asset['browser_download_url'] + download: asset['browser_download_url'], }); }); }); @@ -71,6 +71,6 @@ if (module === require.main) { getAllReleases(require('@root/request'), 'BurntSushi', 'ripgrep').then( function (all) { console.info(JSON.stringify(all, null, 2)); - } + }, ); } diff --git a/_npm/lib/exec.js b/_npm/lib/exec.js index 7b70ce4..d5cd21e 100644 --- a/_npm/lib/exec.js +++ b/_npm/lib/exec.js @@ -9,7 +9,7 @@ function spawner(args) { return new Promise(function (resolve, reject) { var bin = args.shift(); var runner = spawn(bin, args, { - windowsHide: true + windowsHide: true, }); runner.stdout.on('data', function (chunk) { console.info(chunk.toString('utf8')); diff --git a/_webi/frontmarker.js b/_webi/frontmarker.js index e9b3591..bd03049 100644 --- a/_webi/frontmarker.js +++ b/_webi/frontmarker.js @@ -57,7 +57,7 @@ function parseYamlish(txt) { var m = line.match(keyValRe); if (!m) { throw new Error( - 'invalid key format for: ' + JSON.stringify(line) + ' ' + i + 'invalid key format for: ' + JSON.stringify(line) + ' ' + i, ); } if ('|' === m[2]) { @@ -79,6 +79,6 @@ module.exports.parse = parseYamlish; if (require.main === module) { console.info( - parseYamlish(fs.readFileSync(__dirname + '/../node/README.md', 'utf8')) + parseYamlish(fs.readFileSync(__dirname + '/../node/README.md', 'utf8')), ); } diff --git a/_webi/normalize.js b/_webi/normalize.js index fe614bd..81945d6 100644 --- a/_webi/normalize.js +++ b/_webi/normalize.js @@ -7,13 +7,13 @@ var osMap = { freebsd: /(\b|_)(freebsd)/i, windows: /(\b|_)(win|microsoft|msft)/i, sunos: /(\b|_)(sun)/i, - aix: /(\b|_)(aix)/i + aix: /(\b|_)(aix)/i, }; var maps = { oses: {}, arches: {}, - formats: {} + formats: {}, }; Object.keys(osMap).forEach(function (name) { @@ -39,7 +39,7 @@ var arches = [ 'x86', 'ppc64le', 'ppc64', - 's390x' + 's390x', ]; // Used for detecting system arch from package download url, for example: // @@ -59,7 +59,7 @@ var archMap = { x86: /(\b|_|amd|(dar)?win(dows)?|mac(os)?|linux|osx|x)(86|32)([_\-]?bit)(\b|_)/i, ppc64le: /(\b|_)(ppc64le)/i, ppc64: /(\b|_)(ppc64)(\b|_)/i, - s390x: /(\b|_)(s390x)/i + s390x: /(\b|_)(s390x)/i, }; arches.forEach(function (name) { maps.arches[name] = true; @@ -69,7 +69,7 @@ function normalize(all) { var supported = { oses: {}, arches: {}, - formats: {} + formats: {}, }; all.releases.forEach(function (rel) { diff --git a/_webi/packages.js b/_webi/packages.js index d7c9b68..80f0bda 100644 --- a/_webi/packages.js +++ b/_webi/packages.js @@ -70,7 +70,7 @@ pkgs.create = function (Pkgs, basepath) { console.error("failed to read '" + node + "/install.ps1'"); console.error(e); } - }) + }), ]).then(function (items) { var meta = items[0] || items[1]; if (!meta) { diff --git a/_webi/releases.js b/_webi/releases.js index 52a0cae..21c1a0f 100644 --- a/_webi/releases.js +++ b/_webi/releases.js @@ -27,7 +27,7 @@ function padScript(txt) { Releases.renderBash = function ( pkgdir, rel, - { baseurl, pkg, tag, ver, os = '', arch = '', formats } + { baseurl, pkg, tag, ver, os = '', arch = '', formats }, ) { if (!Array.isArray(formats)) { formats = []; @@ -47,7 +47,7 @@ Releases.renderBash = function ( build: vers .join('.') .replace(/[^+\-]*/, '') - .replace(/^-/, '') + .replace(/^-/, ''), }; var pkgFile = rel.filename || rel.name; return fs.promises @@ -81,7 +81,7 @@ Releases.renderBash = function ( '&formats=' + formats.join(',') + '&pretty=true' + - "'" + "'", ) .replace( /^\s*#?WEBI_CSV=.*/m, @@ -97,15 +97,15 @@ Releases.renderBash = function ( '-', rel.download, rel.name, - rel.comment || '' + rel.comment || '', ] .join(',') .replace(/'/g, '') + - "'" + "'", ) .replace( /^\s*#?WEBI_VERSION=.*/m, - 'WEBI_VERSION=' + JSON.stringify(rel.version) + 'WEBI_VERSION=' + JSON.stringify(rel.version), ) .replace(/^\s*#?WEBI_MAJOR=.*/m, 'WEBI_MAJOR=' + v.major) .replace(/^\s*#?WEBI_MINOR=.*/m, 'WEBI_MINOR=' + v.minor) @@ -115,33 +115,33 @@ Releases.renderBash = function ( .replace(/^\s*#?WEBI_CHANNEL=.*/m, 'WEBI_CHANNEL=' + rel.channel) .replace( /^\s*#?WEBI_EXT=.*/m, - 'WEBI_EXT=' + rel.ext.replace(/tar.*/, 'tar') + 'WEBI_EXT=' + rel.ext.replace(/tar.*/, 'tar'), ) .replace( /^\s*#?WEBI_FORMATS=.*/m, - "WEBI_FORMATS='" + formats.join(',') + "'" + "WEBI_FORMATS='" + formats.join(',') + "'", ) .replace( /^\s*#?WEBI_PKG_URL=.*/m, - "WEBI_PKG_URL='" + rel.download + "'" + "WEBI_PKG_URL='" + rel.download + "'", ) .replace( /^\s*#?WEBI_PKG_FILE=.*/m, - "WEBI_PKG_FILE='" + pkgFile + "'" + "WEBI_PKG_FILE='" + pkgFile + "'", ) // PKG details .replace(/^\s*#?PKG_NAME=.*/m, "PKG_NAME='" + pkg + "'") .replace( /^\s*#?PKG_OSES=.*/m, - "PKG_OSES='" + ((rel && rel.oses) || []).join(',') + "'" + "PKG_OSES='" + ((rel && rel.oses) || []).join(',') + "'", ) .replace( /^\s*#?PKG_ARCHES=.*/m, - "PKG_ARCHES='" + ((rel && rel.arches) || []).join(',') + "'" + "PKG_ARCHES='" + ((rel && rel.arches) || []).join(',') + "'", ) .replace( /^\s*#?PKG_FORMATS=.*/m, - "PKG_FORMATS='" + ((rel && rel.formats) || []).join(',') + "'" + "PKG_FORMATS='" + ((rel && rel.formats) || []).join(',') + "'", ) // $', $0, ... $9, $`, $&, and $_ all have special meaning // (see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp) @@ -156,7 +156,7 @@ Releases.renderBash = function ( Releases.renderBatch = function ( pkgdir, rel, - { baseurl, pkg, tag, ver, os, arch, formats } + { baseurl, pkg, tag, ver, os, arch, formats }, ) { if (!Array.isArray(formats)) { formats = []; @@ -186,7 +186,7 @@ Releases.renderBatch = function ( return tplTxt .replace( /^(REM )?WEBI_PKG=.*/im, - "WEBI_PKG='" + pkg + '@' + ver + "'" + "WEBI_PKG='" + pkg + '@' + ver + "'", ) .replace(reInstallTpl, '\n' + installTxt); }); @@ -196,7 +196,7 @@ Releases.renderBatch = function ( Releases.renderPowerShell = function ( pkgdir, rel, - { baseurl, pkg, tag, ver, os, arch, formats } + { baseurl, pkg, tag, ver, os, arch, formats }, ) { if (!Array.isArray(formats)) { formats = []; @@ -227,27 +227,27 @@ Releases.renderPowerShell = function ( return tplTxt .replace( /^(#)?\$Env:WEBI_HOST\s*=.*/im, - "$Env:WEBI_HOST = '" + baseurl + "'" + "$Env:WEBI_HOST = '" + baseurl + "'", ) .replace( /^(#)?\$Env:WEBI_PKG\s*=.*/im, - "$Env:WEBI_PKG = '" + pkgver + "'" + "$Env:WEBI_PKG = '" + pkgver + "'", ) .replace( /^(#)?\$Env:PKG_NAME\s*=.*/im, - "$Env:PKG_NAME = '" + pkg + "'" + "$Env:PKG_NAME = '" + pkg + "'", ) .replace( /^(#)?\$Env:WEBI_VERSION\s*=.*/im, - "$Env:WEBI_VERSION = '" + rel.version + "'" + "$Env:WEBI_VERSION = '" + rel.version + "'", ) .replace( /^(#)?\$Env:WEBI_PKG_URL\s*=.*/im, - "$Env:WEBI_PKG_URL = '" + rel.download + "'" + "$Env:WEBI_PKG_URL = '" + rel.download + "'", ) .replace( /^(#)?\$Env:WEBI_PKG_FILE\s*=.*/im, - "$Env:WEBI_PKG_FILE = '" + rel.name + "'" + "$Env:WEBI_PKG_FILE = '" + rel.name + "'", ) .replace(reInstallTpl, '\n' + installTxt); }); diff --git a/_webi/serve-installer.js b/_webi/serve-installer.js index 7a0176e..7057687 100644 --- a/_webi/serve-installer.js +++ b/_webi/serve-installer.js @@ -17,7 +17,7 @@ module.exports = async function serveInstaller( pkg, tag, ext, - formats + formats, ) { // TODO put some of this in a middleware? or common function? @@ -61,7 +61,7 @@ module.exports = async function serveInstaller( lts, channel, formats, - limit: 1 + limit: 1, }).then(function (rels) { var rel = rels.releases[0]; var pkgdir = path.join(installersDir, pkg); @@ -75,7 +75,7 @@ module.exports = async function serveInstaller( lts, channel, formats, - limit: 1 + limit: 1, }; rel.oses = rels.oses; rel.arches = rels.arches; diff --git a/_webi/test.js b/_webi/test.js index b4a2d25..0278496 100755 --- a/_webi/test.js +++ b/_webi/test.js @@ -5,7 +5,7 @@ // var usage = [ 'Usage: node _webi/test.js --debug ', - 'Example: node _webi/test.js --debug ./node/' + 'Example: node _webi/test.js --debug ./node/', ].join('\n'); var count = 3; @@ -104,7 +104,7 @@ Releases.get(path.join(process.cwd(), pkgdir)).then(function (all) { ver: '', os: osrel, arch, - formats: formats + formats: formats, }).catch(function () {}), Releases.renderPowerShell(pkgdir, rel, { baseurl: 'https://webinstall.dev', @@ -113,8 +113,8 @@ Releases.get(path.join(process.cwd(), pkgdir)).then(function (all) { ver: '', os: osrel, arch, - formats: formats - }).catch(function () {}) + formats: formats, + }).catch(function () {}), ]).then(function (scripts) { var bashTxt = scripts[0]; var ps1Txt = scripts[1]; @@ -125,7 +125,7 @@ Releases.get(path.join(process.cwd(), pkgdir)).then(function (all) { bashTxt = (bashTxt || 'echo ERROR').replace(/#set -x/g, 'set -x'); ps1Txt = (ps1Txt || 'echo ERROR').replace( /REM REM todo debug/g, - 'REM todo debug' + 'REM todo debug', ); } console.info('Do the scripts actually work?'); diff --git a/_webi/transform-releases.js b/_webi/transform-releases.js index 8bae054..bd0679e 100644 --- a/_webi/transform-releases.js +++ b/_webi/transform-releases.js @@ -83,7 +83,7 @@ async function getCachedReleases(pkg) { console.error( 'Error fetching releases for "%s": %s', pkg, - e.toString() + e.toString(), ); cache[pkg].all = { download: '', releases: [] }; }) @@ -99,7 +99,7 @@ async function getCachedReleases(pkg) { cache[pkg] = { updatedAt: 0, all: null, - promise: Promise.resolve() + promise: Promise.resolve(), }; } @@ -121,7 +121,7 @@ async function getCachedReleases(pkg) { async function filterReleases( all, - { ver, os, arch, lts, channel, formats, limit } + { ver, os, arch, lts, channel, formats, limit }, ) { // When multiple formats are downloadable (i.e. .zip and .pkg) // sort the most compatible format first @@ -163,7 +163,7 @@ module.exports = function getReleases({ lts, channel, formats, - limit + limit, }) { if (!_count) { _count = 0; @@ -176,14 +176,14 @@ module.exports = function getReleases({ lts, channel, formats, - limit + limit, }) .catch(function (err) { if ('MODULE_NOT_FOUND' === err.code) { return null; } console.error( - 'TODO: lib/release.js: check type of error, such as MODULE_NOT_FOUND' + 'TODO: lib/release.js: check type of error, such as MODULE_NOT_FOUND', ); console.error(err); }) @@ -199,7 +199,7 @@ module.exports = function getReleases({ lts, channel, formats, - limit + limit, }); } // Raspberry Pi 3+ on Raspbian x86 (not Ubuntu arm64) @@ -213,7 +213,7 @@ module.exports = function getReleases({ lts, channel, formats, - limit + limit, }); } // Raspberry Pi 3+ on Ubuntu arm64 (via Bionic?) @@ -228,7 +228,7 @@ module.exports = function getReleases({ lts, channel, formats, - limit + limit, }); } // Raspberry Pi 3+ on Ubuntu arm64 (via Bionic?) @@ -242,7 +242,7 @@ module.exports = function getReleases({ lts, channel, formats, - limit + limit, }); } releases = [ @@ -260,15 +260,15 @@ module.exports = function getReleases({ comment: 'No matches found. Could be bad or missing version info' + ',' + - "Check query parameters. Should be something like '/api/releases/{package}@{version}.tab?os={macos|linux|windows|-}&arch={amd64|x86|aarch64|arm64|armv7l|-}&limit=100'" - } + "Check query parameters. Should be something like '/api/releases/{package}@{version}.tab?os={macos|linux|windows|-}&arch={amd64|x86|aarch64|arm64|armv7l|-}&limit=100'", + }, ]; } return { oses: all.oses, arches: all.arches, formats: all.formats, - releases: releases + releases: releases, }; }); }); @@ -284,7 +284,7 @@ if (require.main === module) { lts: true, channel: 'stable', formats: ['tar', 'exe', 'zip', 'xz', 'dmg', 'pkg'], - limit: 10 + limit: 10, }) .then(function (all) { console.info(JSON.stringify(all)); diff --git a/_webi/ua-detect.js b/_webi/ua-detect.js index 99addd2..4b0cda5 100644 --- a/_webi/ua-detect.js +++ b/_webi/ua-detect.js @@ -20,7 +20,7 @@ function getRequest(req) { windows: 'curl.exe -fsSA "MS $Env:PROCESSOR_ARCHITECTURE" ' + url, ua: ua, os: uaDetect.os(ua), - arch: uaDetect.arch(ua) + arch: uaDetect.arch(ua), }; } diff --git a/chromedriver/releases.js b/chromedriver/releases.js index 05eb382..c3588bd 100644 --- a/chromedriver/releases.js +++ b/chromedriver/releases.js @@ -6,20 +6,20 @@ var matchers = { metaGeneration: /.*MetaGeneration>(.*)<\/MetaGeneration.*/, lastModified: /.*LastModified>(.*)<\/LastModified.*/, etag: /.*ETag>(.*)<\/ETag.*/, - size: /.*Size>(.*)<\/Size.*/ + size: /.*Size>(.*)<\/Size.*/, }; var baseUrl = 'https://chromedriver.storage.googleapis.com'; module.exports = function (request) { var all = { download: '', - releases: [] + releases: [], }; // XML return request({ url: 'https://chromedriver.storage.googleapis.com/', - json: false + json: false, }) .then(function (resp) { var body = resp.body; @@ -32,7 +32,7 @@ module.exports = function (request) { key: group.replace(matchers.key, '$1'), //generation: group.replace(matchers.generation, '$1'), //metaGeneration: group.replace(matchers.metaGeneration, '$1'), - lastModified: group.replace(matchers.lastModified, '$1') + lastModified: group.replace(matchers.lastModified, '$1'), //etag: group.replace(matchers.etag, '$1'), //size: group.replace(matchers.size, '$1') }; @@ -66,7 +66,7 @@ module.exports = function (request) { os: osname, arch: arch, hash: '-', // not sure about including etag as hash yet - download: asset.key + download: asset.key, }); }); }) diff --git a/duckdns.sh/releases.js b/duckdns.sh/releases.js index 9327bcc..a31371f 100644 --- a/duckdns.sh/releases.js +++ b/duckdns.sh/releases.js @@ -12,7 +12,7 @@ module.exports = function (request) { 'armv7l', 'ppc64le', 's390x', - 'x86' + 'x86', ]; let oses = ['freebsd', 'linux', 'macos', 'posix']; return githubSource(request, owner, repo, oses, arches).then(function (all) { diff --git a/fish/README.md b/fish/README.md index 0b7faca..b7e72a8 100644 --- a/fish/README.md +++ b/fish/README.md @@ -175,8 +175,8 @@ Hyper is configured with JavaScript. module.exports = { config: { // ... - shell: process.env.HOME + '/.local/bin/fish' - } + shell: process.env.HOME + '/.local/bin/fish', + }, }; ``` diff --git a/flutter/releases.js b/flutter/releases.js index 3a64938..5623a7b 100644 --- a/flutter/releases.js +++ b/flutter/releases.js @@ -5,7 +5,7 @@ var map = {}; module.exports = function (request) { var all = { download: '', - releases: [] + releases: [], }; return Promise.all( ['macos', 'linux', 'windows'].map(function (osname) { @@ -14,7 +14,7 @@ module.exports = function (request) { 'https://storage.googleapis.com/flutter_infra/releases/releases_' + osname + '.json', - json: true + json: true, }).then(function (resp) { var body = resp.body; all.download = body.base_url + '/{{ download }}'; @@ -31,11 +31,11 @@ module.exports = function (request) { os: osname, arch: 'amd64', hash: '-', // not sure about including hash / sha256 yet - download: asset.archive + download: asset.archive, }); }); }); - }) + }), ).then(function () { all.releases.sort(function (a, b) { if ('stable' === a.channel && a.channel !== b.channel) { diff --git a/golang/releases.js b/golang/releases.js index 2e8a078..e49eb88 100644 --- a/golang/releases.js +++ b/golang/releases.js @@ -1,10 +1,10 @@ 'use strict'; var osMap = { - darwin: 'macos' + darwin: 'macos', }; var archMap = { - 386: 'x86' + 386: 'x86', }; function getAllReleases(request) { @@ -28,12 +28,12 @@ function getAllReleases(request) { */ return request({ url: 'https://golang.org/dl/?mode=json&include=all', - json: true + json: true, }).then((resp) => { var goReleases = resp.body; var all = { releases: [], - download: 'https://dl.google.com/go/{{ download }}' + download: 'https://dl.google.com/go/{{ download }}', }; goReleases.forEach((release) => { @@ -58,7 +58,7 @@ function getAllReleases(request) { arch: arch, ext: '', // let normalize run the split/test/join hash: '-', // not ready to standardize this yet - download: filename + download: filename, }); }); }); diff --git a/gpg/releases.js b/gpg/releases.js index 7ab8f5f..ea32861 100644 --- a/gpg/releases.js +++ b/gpg/releases.js @@ -5,14 +5,14 @@ let ltsRe = /GnuPG-(2\.2\.[\d\.]+)/; function createRssMatcher() { return new RegExp( '(https://sourceforge\\.net/projects/gpgosx/files/GnuPG-([\\d\\.]+)\\.dmg/download)', - 'g' + 'g', ); } function createUrlMatcher() { return new RegExp( 'https://sourceforge\\.net/projects/gpgosx/files/(GnuPG-([\\d\\.]+)\\.dmg)/download', - '' + '', ); } @@ -20,7 +20,7 @@ async function getRawReleases(request) { let matcher = createRssMatcher(); let resp = await request({ - url: 'https://sourceforge.net/projects/gpgosx/rss?path=/' + url: 'https://sourceforge.net/projects/gpgosx/rss?path=/', }); let links = []; for (;;) { @@ -64,13 +64,13 @@ function transformReleases(links) { os: 'macos', arch: 'amd64', ext: 'dmg', - download: link + download: link, }; }) .filter(Boolean); return { - releases: releases + releases: releases, }; } diff --git a/iterm2/releases.js b/iterm2/releases.js index 40d8381..39775bc 100644 --- a/iterm2/releases.js +++ b/iterm2/releases.js @@ -2,7 +2,7 @@ function getRawReleases(request) { return request({ url: 'https://iterm2.com/downloads.html' }).then(function ( - resp + resp, ) { var links = resp.body .split(/[<>]+/g) @@ -40,10 +40,10 @@ function transformReleases(links) { os: 'macos', arch: 'amd64', ext: '', // let normalize run the split/test/join - download: link + download: link, }; }) - .filter(Boolean) + .filter(Boolean), }; } diff --git a/jshint/README.md b/jshint/README.md index ef35d6d..75c8f52 100644 --- a/jshint/README.md +++ b/jshint/README.md @@ -111,7 +111,7 @@ Engineering_ (as opposed to just _Code Monkey_-ing around): strict: true, maxdepth: 4, maxstatements: 100, - maxcomplexity: 20 + maxcomplexity: 20, } ``` @@ -147,8 +147,8 @@ certain file patterns and directories. esversion: 11, overrides: { './browser/*.js': { - esversion: 7 - } - } + esversion: 7, + }, + }, } ``` diff --git a/macos/releases.js b/macos/releases.js index c0201a6..69448c4 100644 --- a/macos/releases.js +++ b/macos/releases.js @@ -6,7 +6,7 @@ var oses = [ version: '10.12.6', date: '2018-09-26', channel: 'beta', - url: 'https://support.apple.com/en-us/HT208202' + url: 'https://support.apple.com/en-us/HT208202', }, { name: 'OS X El Capitan', @@ -14,15 +14,15 @@ var oses = [ date: '2018-07-09', lts: true, channel: 'stable', - url: 'https://support.apple.com/en-us/HT206886' + url: 'https://support.apple.com/en-us/HT206886', }, { name: 'OS X Yosemite', version: '10.10.5', date: '2017-07-19', channel: 'beta', - url: 'https://support.apple.com/en-us/HT210717' - } + url: 'https://support.apple.com/en-us/HT210717', + }, ]; var headers = { @@ -37,7 +37,7 @@ var headers = { 'Sec-Fetch-Site': 'none', 'Sec-Fetch-Mode': 'navigate', 'Sec-Fetch-User': '?1', - 'Accept-Language': 'en-US,en;q=0.9,sq;q=0.8' + 'Accept-Language': 'en-US,en;q=0.9,sq;q=0.8', }; module.exports = function (request) { @@ -48,7 +48,7 @@ module.exports = function (request) { return request({ method: 'GET', url: os.url, - headers: headers + headers: headers, }).then(function (resp) { var m = resp.body.match(/(http[^>]+Install[^>]+.dmg)/); var download = m && m[1]; @@ -62,11 +62,11 @@ module.exports = function (request) { arch: 'amd64', ext: 'dmg', hash: '-', - download: download + download: download, }); }); }); - }) + }), ).then(function () { all.releases.sort(function (a, b) { if ('10.11.6' === a.version) { diff --git a/mariadb/releases.js b/mariadb/releases.js index 4c0c446..32d3d06 100644 --- a/mariadb/releases.js +++ b/mariadb/releases.js @@ -41,8 +41,8 @@ module.exports = function (request) { download: 'http://archive.mariadb.org/mariadb-{{ v }}/bintar-linux-x86_64/mariadb-{{ v }}-linux-x86_64.tar.gz'.replace( /{{ v }}/g, - ver.version - ) + ver.version, + ), }); all.releases.push({ version: ver.version, @@ -54,8 +54,8 @@ module.exports = function (request) { download: 'http://archive.mariadb.org/mariadb-{{ v }}/bintar-linux-x86/mariadb-{{ v }}-linux-x86.tar.gz'.replace( /{{ v }}/g, - ver.version - ) + ver.version, + ), }); // windows @@ -69,8 +69,8 @@ module.exports = function (request) { download: 'http://archive.mariadb.org/mariadb-{{ v }}/winx64-packages/mariadb-{{ v }}-winx64.zip'.replace( /{{ v }}/g, - ver.version - ) + ver.version, + ), }); all.releases.push({ version: ver.version, @@ -82,8 +82,8 @@ module.exports = function (request) { download: 'http://archive.mariadb.org/mariadb-{{ v }}/win32-packages/mariadb-{{ v }}-win32.zip'.replace( /{{ v }}/g, - ver.version - ) + ver.version, + ), }); // Note: versions are sorted most-recent first. @@ -95,7 +95,7 @@ module.exports = function (request) { // 10.3 => ^10.2(\b|\.) var reBrewVer = new RegExp( '^' + brew.version.replace(/\./, '\\.') + '(\\b|\\.)', - 'g' + 'g', ); if (!ver.version.match(reBrewVer)) { return; @@ -107,7 +107,7 @@ module.exports = function (request) { date: ver.date, os: 'macos', arch: 'amd64', - download: brew.download.replace(/{{ v }}/g, ver.version) + download: brew.download.replace(/{{ v }}/g, ver.version), }); brews.splice(i, 1); // remove return true; @@ -120,7 +120,7 @@ module.exports = function (request) { function mariaReleases() { return request({ url: 'https://downloads.mariadb.org/mariadb/+releases/', - fail: true // https://git.coolaj86.com/coolaj86/request.js/issues/2 + fail: true, // https://git.coolaj86.com/coolaj86/request.js/issues/2 }) .then(failOnBadStatus) .then(function (resp) { @@ -159,7 +159,7 @@ module.exports = function (request) { return { version: m[1], channel: mapChannel(m[3].toLowerCase()), - date: m[2] + date: m[2], }; }) .filter(Boolean); @@ -203,8 +203,8 @@ if (module === require.main) { }) .slice(0, 2), null, - 2 - ) + 2, + ), ); }); } diff --git a/node/releases.js b/node/releases.js index 04c6a54..8e77646 100644 --- a/node/releases.js +++ b/node/releases.js @@ -23,18 +23,18 @@ var map = { msi: 'msi', '7z': '7z', zip: 'zip', - tar: 'tar.gz' + tar: 'tar.gz', }; function getAllReleases(request) { return request({ url: 'https://nodejs.org/dist/index.json', - json: true + json: true, }).then(function (resp) { var rels = resp.body; var all = { releases: [], - download: '' // node's download URLs are unpredictable + download: '', // node's download URLs are unpredictable }; // https://blog.risingstack.com/update-nodejs-8-end-of-life-no-support/ @@ -84,7 +84,7 @@ function getAllReleases(request) { // See https://nodejs.org/dist/v14.0.0/ // usually like https://nodejs.org/dist/v14.0.0/node-{version}-{plat}-{arch}.{ext} download: - 'https://nodejs.org/dist/' + rel.version + '/node-' + rel.version + 'https://nodejs.org/dist/' + rel.version + '/node-' + rel.version, }; all.releases.push(r); diff --git a/postgres/releases.js b/postgres/releases.js index 2b035c6..1ebf8c6 100644 --- a/postgres/releases.js +++ b/postgres/releases.js @@ -17,7 +17,7 @@ module.exports = async function () { os: 'linux', arch: 'amd64', ext: 'tar', - download: '' + download: '', }, { name: 'postgresql-10.12-1-linux-binaries.tar.gz', @@ -28,7 +28,7 @@ module.exports = async function () { os: 'linux', arch: 'x86', ext: 'tar', - download: '' + download: '', }, { name: 'postgresql-10.12-1-osx-binaries.zip', @@ -39,7 +39,7 @@ module.exports = async function () { os: 'macos', arch: 'amd64', ext: 'zip', - download: '' + download: '', }, { name: 'postgresql-10.13-1-osx-binaries.zip', @@ -50,7 +50,7 @@ module.exports = async function () { os: 'macos', arch: 'amd64', ext: 'zip', - download: '' + download: '', }, { name: 'postgresql-11.8-1-osx-binaries.zip', @@ -61,7 +61,7 @@ module.exports = async function () { os: 'macos', arch: 'amd64', ext: 'zip', - download: '' + download: '', }, { name: 'postgresql-12.3-1-osx-binaries.zip', @@ -72,8 +72,8 @@ module.exports = async function () { os: 'macos', arch: 'amd64', ext: 'zip', - download: '' - } + download: '', + }, ].map(function (rel) { rel.download = 'https://get.enterprisedb.com/postgresql/' + @@ -81,7 +81,7 @@ module.exports = async function () { '?ls=Crossover&type=Crossover'; return rel; }), - download: '' + download: '', }; }; diff --git a/webi/releases.js b/webi/releases.js index f6deae5..004c829 100644 --- a/webi/releases.js +++ b/webi/releases.js @@ -12,7 +12,7 @@ module.exports = async function () { os: 'linux', arch: 'amd64', ext: 'tar', - download: '' + download: '', }, { name: 'webi.tar', @@ -23,7 +23,7 @@ module.exports = async function () { os: 'macos', arch: 'amd64', ext: 'tar', - download: '' + download: '', }, { name: 'webi.tar', @@ -34,10 +34,10 @@ module.exports = async function () { os: 'windows', arch: 'amd64', ext: 'tar', - download: '' - } + download: '', + }, ], formats: [], - downloads: '' + downloads: '', }; }; diff --git a/zig/releases.js b/zig/releases.js index a97ba38..d8da013 100644 --- a/zig/releases.js +++ b/zig/releases.js @@ -3,7 +3,7 @@ module.exports = function (request) { return request({ url: 'https://ziglang.org/download/index.json', - json: true + json: true, }).then(function (resp) { let versions = resp.body; let releases = []; @@ -30,7 +30,7 @@ module.exports = function (request) { let os = parts[1]; if (parts.length > 2) { console.warn( - `unexpected platform name with multiple '-': ${platform}` + `unexpected platform name with multiple '-': ${platform}`, ); return; } @@ -45,7 +45,7 @@ module.exports = function (request) { //arch: arch, download: pkg.tarball, hash: pkg.shasum, - size: pkg.size + size: pkg.size, // TODO docs + release notes? //docs: 'https://ziglang.org/documentation/0.9.1/', //stdDocs: 'https://ziglang.org/documentation/0.9.1/std/', @@ -66,7 +66,7 @@ module.exports = function (request) { }); return { - releases: releases + releases: releases, }; }); };