Skip to content

Commit

Permalink
remove support for Node.js 10 (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp authored Nov 8, 2020
1 parent 3cc3f9c commit 52bc8e3
Show file tree
Hide file tree
Showing 41 changed files with 891 additions and 641 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ dist: focal
language: node_js

node_js:
- "10"
- "12"
- "14"
- "15"

cache:
yarn: true
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
"private": true,
"devDependencies": {
"@ava/babel": "^1.0.1",
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/plugin-transform-react-jsx": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.11.5",
"@babel/preset-env": "^7.11.5",
"@babel/runtime": "^7.11.2",
"ava": "^3.12.1",
"@babel/core": "^7.12.3",
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
"@babel/plugin-transform-react-jsx": "^7.12.5",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/runtime": "^7.12.5",
"ava": "^3.13.0",
"babel-plugin-jsx-pragmatic": "^1.0.2",
"babel-plugin-transform-async-to-promises": "^0.8.15",
"babelify": "^10.0.0",
"babylon": "^6.18.0",
"browser-pack-flat": "^3.4.2",
"browserify": "^16.5.2",
"browserify": "^17.0.0",
"bundlesize": "^0.18.0",
"common-shakeify": "^0.6.2",
"eslint": "^7.9.0",
"eslint-config-prettier": "^6.11.0",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-unicorn": "^21.0.0",
"eslint-plugin-unicorn": "^23.0.0",
"exorcist": "^1.0.1",
"jsdom": "^16.4.0",
"lerna": "^3.22.1",
"node-fetch": "^2.6.1",
"prettier": "^2.1.2",
"sinon": "^9.0.3",
"uglify-js": "^3.10.4"
"sinon": "^9.2.1",
"uglify-js": "^3.11.5"
},
"scripts": {
"bootstrap": "lerna bootstrap",
Expand All @@ -39,7 +39,7 @@
"ncu": "ncu && for dir in packages/*; do (cd \"$dir\" && ncu); done"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"workspaces": [
Expand Down
4 changes: 2 additions & 2 deletions packages/base64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"base64"
],
"dependencies": {
"base-64": "^0.1.0"
"base-64": "^1.0.0"
},
"react-native": "index.js",
"browser": "browser.js",
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@xmpp/xml": "^0.11.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"browser": "./browser.js",
"react-native": "./react-native.js",
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/component-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@xmpp/xml": "^0.11.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
8 changes: 3 additions & 5 deletions packages/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ function component(options) {
entity.on("open", async (el) => {
try {
const { id } = el.attrs;
if (typeof password === "function") {
await password((creds) => entity.authenticate(id, creds));
} else {
await entity.authenticate(id, password);
}
await (typeof password === "function"
? password((creds) => entity.authenticate(id, creds))
: entity.authenticate(id, password));
} catch (err) {
entity.emit("error", err);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@xmpp/reconnect": "^0.11.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/connection-tcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@xmpp/xml": "^0.11.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
8 changes: 3 additions & 5 deletions packages/connection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,9 @@ class Connection extends EventEmitter {
const { port } = parseHost(host);

let service;
if (port) {
service = `${protocol || "xmpp:"}//${host}`;
} else {
service = (protocol ? `${protocol}//` : "") + host;
}
service = port
? `${protocol || "xmpp:"}//${host}`
: (protocol ? `${protocol}//` : "") + host;

try {
await promise(this, "disconnect");
Expand Down
2 changes: 1 addition & 1 deletion packages/connection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@xmpp/xml": "^0.11.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"debug"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/error/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"error"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"EventEmitter"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"id"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/iq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"callee"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"dependencies": {
Expand Down
6 changes: 1 addition & 5 deletions packages/jid/lib/JID.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@ class JID {
unescape = unescape || false;
let local = null;

if (unescape) {
local = escaping.unescape(this._local);
} else {
local = this._local;
}
local = unescape ? escaping.unescape(this._local) : this._local;

return local;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"JID"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"koa-compose": "^4.1.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/reconnect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@xmpp/events": "^0.11.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/resolve/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"node-fetch": "^2.6.1"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
8 changes: 3 additions & 5 deletions packages/resource-binding/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ async function bind(entity, iqCaller, resource) {

function route({ iqCaller }, resource) {
return async ({ entity }, next) => {
if (typeof resource === "function") {
await resource((resource) => bind(entity, iqCaller, resource));
} else {
await bind(entity, iqCaller, resource);
}
await (typeof resource === "function"
? resource((resource) => bind(entity, iqCaller, resource))
: bind(entity, iqCaller, resource));

next();
};
Expand Down
2 changes: 1 addition & 1 deletion packages/resource-binding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@xmpp/xml": "^0.11.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sasl-anonymous/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"sasl-anonymous": "^0.1.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sasl-plain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"sasl-plain": "^0.1.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sasl-scram-sha-1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"sasl-scram-sha-1": "^1.2.1"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sasl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"saslmechanisms": "^0.1.1"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/session-establishment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@xmpp/xml": "^0.11.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/starttls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@xmpp/xml": "^0.11.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/stream-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"features"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/stream-management/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@xmpp/xml": "^0.11.0"
},
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"tcp"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/time/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"date"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"tls"
],
"engines": {
"node": ">= 10.0.0",
"node": ">= 12.4.0",
"yarn": ">= 1.0.0"
},
"publishConfig": {
Expand Down
Loading

0 comments on commit 52bc8e3

Please sign in to comment.