Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/287259
Change subject: Update npm dependencies; switch to `babybird` Promise implementation. ...................................................................... Update npm dependencies; switch to `babybird` Promise implementation. Change-Id: Ied0210a1f2cee28dacbdc4a61185a36d0a8e9fb3 --- M .jscsrc M bin/mw-ocg-latexer M lib/db.js M lib/index.js M lib/p.js A lib/promise.js M package.json M test/samples.js 8 files changed, 18 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer refs/changes/59/287259/1 diff --git a/.jscsrc b/.jscsrc index 4621905..01196e4 100644 --- a/.jscsrc +++ b/.jscsrc @@ -12,6 +12,7 @@ "try", "catch" ], + "requireEarlyReturn": false, "validateIndentation": "\t", "maximumLineLength": null, "disallowMultipleVarDecl": null, diff --git a/bin/mw-ocg-latexer b/bin/mw-ocg-latexer index e0ea6a6..1cb3bca 100755 --- a/bin/mw-ocg-latexer +++ b/bin/mw-ocg-latexer @@ -1,6 +1,6 @@ #!/usr/bin/env node require('core-js/shim'); -var Promise = require('prfun'); +var Promise = require('../lib/promise.js'); if (/v0\.[0-7]\./.test(process.version)) { console.error('Node version', process.version, 'is not supported.'); diff --git a/lib/db.js b/lib/db.js index a2570c0..11f27de 100644 --- a/lib/db.js +++ b/lib/db.js @@ -1,7 +1,7 @@ // Helpers to create/read key/value mappings in sqlite db. 'use strict'; require('core-js/shim'); -var Promise = require('prfun'); +var Promise = require('./promise.js'); var sqlite3 = require('sqlite3'); diff --git a/lib/index.js b/lib/index.js index 83ef366..5eacdb8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -2,7 +2,7 @@ // --------------------------------------------------------------------- 'use strict'; require('core-js/shim'); -var Promise = require('prfun'); +var Promise = require('./promise.js'); var json = require('../package.json'); @@ -1371,7 +1371,7 @@ // // This code is largely asynchronous. It chains promises together // to manage the concurrency without callback hell. It uses the -// ES6 Promise api, from the npm `core-js` and `prfun` packages. +// ES6 Promise api, from the npm `babybird` and `prfun` packages. // The `prfun` package has a nice implementation of guards, which is // an easy way to limit the maximum parallelism of a task to ensure // we don't spam the host with hundreds of tasks at once. diff --git a/lib/p.js b/lib/p.js index 17f0841..ee4e703 100644 --- a/lib/p.js +++ b/lib/p.js @@ -1,7 +1,7 @@ // Helpers for promises. 'use strict'; require('core-js/shim'); -var Promise = require('prfun'); +var Promise = require('./promise.js'); var spawn = require('child_process').spawn; diff --git a/lib/promise.js b/lib/promise.js new file mode 100644 index 0000000..2733cf7 --- /dev/null +++ b/lib/promise.js @@ -0,0 +1 @@ +module.exports = require('prfun/wrap')(require('babybird')); diff --git a/package.json b/package.json index 8943364..f7d53db 100644 --- a/package.json +++ b/package.json @@ -27,22 +27,23 @@ "node": ">=0.8" }, "dependencies": { - "commander": "~2.8.1", - "core-js": "~0.9.18", - "domino": "~1.0.19", + "babybird": "~0.0.1", + "commander": "~2.9.0", + "core-js": "~2.3.0", + "domino": "~1.0.24", "gammalatex": "~0.0.8", "icu-bidi": "~0.1.5", - "prfun": "~2.1.1", + "prfun": "~2.1.4", "readable-stream": "~1.0.33", "sqlite3": "~3.1.0", "texvcjs": "~0.3.0", - "tmp": "~0.0.27" + "tmp": "~0.0.28" }, "devDependencies": { - "jscs": "~2.5.0", - "jshint": "~2.8.0", - "mocha": "~2.3.3", - "npm-travis": "~1.0.0" + "jscs": "~2.11.0", + "jshint": "~2.9.2", + "mocha": "~2.4.5", + "npm-travis": "~1.0.2" }, "bin": { "mw-ocg-latexer": "./bin/mw-ocg-latexer" diff --git a/test/samples.js b/test/samples.js index f08d61b..085f077 100644 --- a/test/samples.js +++ b/test/samples.js @@ -1,7 +1,7 @@ /* global describe, it */ 'use strict'; require('core-js/shim'); -var Promise = require('prfun'); +var Promise = require('../lib/promise.js'); var assert = require('assert'); var fs = require('fs'); -- To view, visit https://gerrit.wikimedia.org/r/287259 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied0210a1f2cee28dacbdc4a61185a36d0a8e9fb3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer Gerrit-Branch: master Gerrit-Owner: Cscott <canan...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits