[MediaWiki-commits] [Gerrit] mediawiki...mathoid[master]: Update to service-template-node v0.5.3
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/390989 ) Change subject: Update to service-template-node v0.5.3 .. Update to service-template-node v0.5.3 Bug: T151396 Change-Id: Ia35b7bd3d5d030e6f3fc4e0ac629636cda37c3a8 --- A .eslintrc.yml M .jshintrc M .travis.yml M app.js M lib/api-util.js A lib/swagger-ui.js M lib/util.js M package.json D routes/empty.js.template M routes/info.js M routes/mathoid.js M routes/root.js M server.js M test/features/app/app.js M test/features/app/spec.js M test/features/info/info.js M test/index.js M test/utils/server.js 18 files changed, 574 insertions(+), 486 deletions(-) Approvals: Mobrovac: Looks good to me, approved jenkins-bot: Verified diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 000..2cd5d61 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,6 @@ +extends: 'eslint-config-node-services' +rules: + indent: +- error +- 4 +- SwitchCase: 1 diff --git a/.jshintrc b/.jshintrc index 9d3785f..afaeeec 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,12 +1,29 @@ { +"predef": [ +"ve", +"setImmediate", +"QUnit", +"Map", +"Set" +], "bitwise": true, +"laxbreak": true, +"curly": true, "eqeqeq": true, -"freeze": true, -"latedef": "nofunc", -"futurehostile": true, +"immed": true, +"latedef": true, +"newcap": true, "noarg": true, +"noempty": true, "nonew": true, +"regexp": false, "undef": true, +"strict": true, +"trailing": true, +"smarttabs": true, +"multistr": true, "node": true, -"esversion": 6 +"nomen": false, +"loopfunc": true, +"esnext": true } diff --git a/.travis.yml b/.travis.yml index 21bdcdf..c5971ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ node_js: - "4" - "6" + - "8" - "node" script: npm run-script coverage && (npm run-script coveralls || exit 0) diff --git a/app.js b/app.js index 1bfcc89..7027a6d 100644 --- a/app.js +++ b/app.js @@ -6,19 +6,19 @@ 'use strict'; -require('core-js/shim'); +const http = require('http'); +const BBPromise = require('bluebird'); +const express = require('express'); +const compression = require('compression'); +const bodyParser = require('body-parser'); +const fs = BBPromise.promisifyAll(require('fs')); +const sUtil = require('./lib/util'); +const apiUtil = require('./lib/api-util'); +const packageInfo = require('./package.json'); +const yaml = require('js-yaml'); +const addShutdown = require('http-shutdown'); -var http = require('http'); -var BBPromise = require('bluebird'); -var express = require('express'); -var compression = require('compression'); -var bodyParser = require('body-parser'); -var fs = BBPromise.promisifyAll(require('fs')); -var sUtil = require('./lib/util'); -var apiUtil = require('./lib/api-util'); -var packageInfo = require('./package.json'); -var yaml = require('js-yaml'); -var mjAPI = require("mathoid-mathjax-node/lib/mj-single.js"); +const mjAPI = require("mathoid-mathjax-node/lib/mj-single.js"); /** @@ -29,7 +29,7 @@ function initApp(options) { // the main application object -var app = express(); +const app = express(); // get the options and make them available in the app app.logger = options.logger;// the logging device @@ -38,22 +38,22 @@ app.info = packageInfo; // this app's package info // ensure some sane defaults -if(!app.conf.port) { app.conf.port = 10042; } -if(!app.conf.interface) { app.conf.interface = '0.0.0.0'; } -if(app.conf.compression_level === undefined) { app.conf.compression_level = 3; } -if(app.conf.cors === undefined) { app.conf.cors = '*'; } -if(app.conf.csp === undefined) { -app.conf.csp = -"default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'"; +if (!app.conf.port) { app.conf.port = 10042; } +if (!app.conf.interface) { app.conf.interface = '0.0.0.0'; } +if (app.conf.compression_level === undefined) { app.conf.compression_level = 3; } +if (app.conf.cors === undefined) { app.conf.cors = '*'; } +if (app.conf.csp === undefined) { +// eslint-disable-next-line max-len +app.conf.csp = "default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'"; } // set outgoing proxy -if(app.conf.proxy) { +if (app.conf.proxy) { process.env.HTTP_PROXY = app.conf.proxy; // if there is a list of domains which should // not be proxied, set it -if(app.conf.no_proxy_list) { -if(Array.isArray(app.conf.no_proxy_list)) { +if (app.conf.no_proxy_list) { +if (Array.isArray(app.conf.no_proxy_list)) { process.env.NO_PROXY = app.conf.no_proxy_list.join(','); }
[MediaWiki-commits] [Gerrit] mediawiki...mathoid[master]: Update to service-template-node v0.5.3
Mobrovac has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/390989 ) Change subject: Update to service-template-node v0.5.3 .. Update to service-template-node v0.5.3 Bug: T151396 Change-Id: Ia35b7bd3d5d030e6f3fc4e0ac629636cda37c3a8 --- A .eslintrc.yml M .jshintrc M .travis.yml M app.js M lib/api-util.js A lib/swagger-ui.js M lib/util.js M package.json D routes/empty.js.template M routes/info.js M routes/mathoid.js M routes/root.js M server.js M test/features/app/app.js M test/features/app/spec.js M test/features/info/info.js M test/index.js M test/utils/server.js 18 files changed, 573 insertions(+), 486 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid refs/changes/89/390989/1 diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 000..2cd5d61 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,6 @@ +extends: 'eslint-config-node-services' +rules: + indent: +- error +- 4 +- SwitchCase: 1 diff --git a/.jshintrc b/.jshintrc index 9d3785f..afaeeec 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,12 +1,29 @@ { +"predef": [ +"ve", +"setImmediate", +"QUnit", +"Map", +"Set" +], "bitwise": true, +"laxbreak": true, +"curly": true, "eqeqeq": true, -"freeze": true, -"latedef": "nofunc", -"futurehostile": true, +"immed": true, +"latedef": true, +"newcap": true, "noarg": true, +"noempty": true, "nonew": true, +"regexp": false, "undef": true, +"strict": true, +"trailing": true, +"smarttabs": true, +"multistr": true, "node": true, -"esversion": 6 +"nomen": false, +"loopfunc": true, +"esnext": true } diff --git a/.travis.yml b/.travis.yml index 21bdcdf..c5971ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ node_js: - "4" - "6" + - "8" - "node" script: npm run-script coverage && (npm run-script coveralls || exit 0) diff --git a/app.js b/app.js index 1bfcc89..7027a6d 100644 --- a/app.js +++ b/app.js @@ -6,19 +6,19 @@ 'use strict'; -require('core-js/shim'); +const http = require('http'); +const BBPromise = require('bluebird'); +const express = require('express'); +const compression = require('compression'); +const bodyParser = require('body-parser'); +const fs = BBPromise.promisifyAll(require('fs')); +const sUtil = require('./lib/util'); +const apiUtil = require('./lib/api-util'); +const packageInfo = require('./package.json'); +const yaml = require('js-yaml'); +const addShutdown = require('http-shutdown'); -var http = require('http'); -var BBPromise = require('bluebird'); -var express = require('express'); -var compression = require('compression'); -var bodyParser = require('body-parser'); -var fs = BBPromise.promisifyAll(require('fs')); -var sUtil = require('./lib/util'); -var apiUtil = require('./lib/api-util'); -var packageInfo = require('./package.json'); -var yaml = require('js-yaml'); -var mjAPI = require("mathoid-mathjax-node/lib/mj-single.js"); +const mjAPI = require("mathoid-mathjax-node/lib/mj-single.js"); /** @@ -29,7 +29,7 @@ function initApp(options) { // the main application object -var app = express(); +const app = express(); // get the options and make them available in the app app.logger = options.logger;// the logging device @@ -38,22 +38,22 @@ app.info = packageInfo; // this app's package info // ensure some sane defaults -if(!app.conf.port) { app.conf.port = 10042; } -if(!app.conf.interface) { app.conf.interface = '0.0.0.0'; } -if(app.conf.compression_level === undefined) { app.conf.compression_level = 3; } -if(app.conf.cors === undefined) { app.conf.cors = '*'; } -if(app.conf.csp === undefined) { -app.conf.csp = -"default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'"; +if (!app.conf.port) { app.conf.port = 10042; } +if (!app.conf.interface) { app.conf.interface = '0.0.0.0'; } +if (app.conf.compression_level === undefined) { app.conf.compression_level = 3; } +if (app.conf.cors === undefined) { app.conf.cors = '*'; } +if (app.conf.csp === undefined) { +// eslint-disable-next-line max-len +app.conf.csp = "default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'"; } // set outgoing proxy -if(app.conf.proxy) { +if (app.conf.proxy) { process.env.HTTP_PROXY = app.conf.proxy; // if there is a list of domains which should // not be proxied, set it -if(app.conf.no_proxy_list) { -if(Array.isArray(app.conf.no_proxy_list)) { +if (app.conf.no_proxy_list) { +if (Array.isArray(app.conf.no_proxy_list)) { process.env.NO_PROXY = app.conf.no_proxy_list.join(',');