diff --git a/eslint.config.mjs b/eslint.config.mjs index c277c75a3..af07456e7 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -26,7 +26,7 @@ export default [ jsx: true, }, }, - sourceType: "commonjs", + sourceType: "module", }, rules: { @@ -78,14 +78,19 @@ export default [ "unicorn/prefer-event-target": 0, "unicorn/prefer-top-level-await": 0, "unicorn/prefer-node-protocol": 0, + "unicorn/prefer-export-from": "off", }, }, - { - files: ["packages/client/**/*.js"], - languageOptions: { - sourceType: "module", - }, - }, + // { + // files: [ + // "packages/client/**/*.js", + // "packages/events/**/*.js", + // "packages/base64/**/*.js", + // ], + // languageOptions: { + // sourceType: "module", + // }, + // }, { files: ["**/*.spec.js", "**/*.test.js", "**/test.js", "**/test/**.js"], plugins: { jest: pluginJest }, diff --git a/package-lock.json b/package-lock.json index 9b6fae37e..45894b3eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "uglify-js": "^3.19.3" }, "engines": { - "node": ">= 14", + "node": ">= 14.13.1", "npm": ">= 7" } }, @@ -3651,7 +3651,7 @@ "dev": true, "license": "MIT", "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/@octokit/core": { @@ -3668,7 +3668,7 @@ "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/@octokit/endpoint": { @@ -3681,7 +3681,7 @@ "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/@octokit/graphql": { @@ -3694,7 +3694,7 @@ "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/@octokit/openapi-types": { @@ -3716,7 +3716,7 @@ "@octokit/types": "^9.2.3" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "peerDependencies": { "@octokit/core": ">=4" @@ -3738,7 +3738,7 @@ "@octokit/types": "^10.0.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "peerDependencies": { "@octokit/core": ">=3" @@ -3765,7 +3765,7 @@ "universal-user-agent": "^6.0.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/@octokit/request-error": { @@ -3778,7 +3778,7 @@ "once": "^1.4.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/@octokit/rest": { @@ -3792,7 +3792,7 @@ "@octokit/plugin-rest-endpoint-methods": "^7.1.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/@octokit/tsconfig": { @@ -4443,7 +4443,7 @@ "dev": true, "license": "MIT", "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/aggregate-error": { @@ -8809,7 +8809,7 @@ "debug": "^4.3.4" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/https-browserify": { @@ -8826,7 +8826,7 @@ "debug": "4" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/human-signals": { @@ -14692,7 +14692,7 @@ "socks": "^2.8.3" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/sort-keys": { @@ -16118,7 +16118,7 @@ "yaml": "bin.mjs" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "node_modules/yargs": { @@ -16165,7 +16165,7 @@ "base-64": "^1.0.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/client": { @@ -16197,7 +16197,7 @@ "babel-plugin-jsx-pragmatic": "^1.0.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/client-core": { @@ -16210,7 +16210,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/component": { @@ -16224,7 +16224,7 @@ "@xmpp/reconnect": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/component-core": { @@ -16237,7 +16237,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/connection": { @@ -16251,7 +16251,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/connection-tcp": { @@ -16263,7 +16263,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/debug": { @@ -16275,7 +16275,7 @@ "ltx": "^3.1.1" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/error": { @@ -16283,7 +16283,7 @@ "version": "0.13.2", "license": "ISC", "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/events": { @@ -16294,7 +16294,7 @@ "events": "^3.3.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/id": { @@ -16302,7 +16302,7 @@ "version": "0.13.2", "license": "ISC", "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/iq": { @@ -16319,7 +16319,7 @@ "@xmpp/middleware": "^0.13.1" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/jid": { @@ -16327,7 +16327,7 @@ "version": "0.13.2", "license": "ISC", "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/middleware": { @@ -16341,7 +16341,7 @@ "koa-compose": "^4.1.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/reconnect": { @@ -16352,7 +16352,7 @@ "@xmpp/events": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/resolve": { @@ -16365,7 +16365,7 @@ "node-fetch": "^2.6.12" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/resource-binding": { @@ -16376,7 +16376,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/sasl": { @@ -16390,7 +16390,7 @@ "saslmechanisms": "^0.1.1" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/sasl-anonymous": { @@ -16401,7 +16401,7 @@ "sasl-anonymous": "^0.1.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/sasl-plain": { @@ -16412,7 +16412,7 @@ "sasl-plain": "^0.1.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/sasl-scram-sha-1": { @@ -16423,7 +16423,7 @@ "sasl-scram-sha-1": "^1.3.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/session-establishment": { @@ -16434,7 +16434,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/starttls": { @@ -16447,7 +16447,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/stream-features": { @@ -16455,7 +16455,7 @@ "version": "0.13.2", "license": "ISC", "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/stream-management": { @@ -16466,7 +16466,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/tcp": { @@ -16477,7 +16477,7 @@ "@xmpp/connection-tcp": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/test": { @@ -16494,7 +16494,7 @@ "ltx": "^3.1.1" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/time": { @@ -16502,7 +16502,7 @@ "version": "0.13.2", "license": "ISC", "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/tls": { @@ -16514,7 +16514,7 @@ "@xmpp/connection-tcp": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/uri": { @@ -16526,7 +16526,7 @@ "iri": "^1.3.1" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/websocket": { @@ -16539,7 +16539,7 @@ "ws": "^8.18.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/xml": { @@ -16550,7 +16550,7 @@ "ltx": "^3.1.1" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } }, "packages/xmpp.js": { @@ -16591,7 +16591,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" } } } diff --git a/package.json b/package.json index 27c5a31b9..4e2a5a6b6 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "preversion": "make bundle" }, "engines": { - "node": ">= 14", + "node": ">= 14.13.1", "npm": ">= 7" }, "workspaces": [ diff --git a/packages/base64/browser.js b/packages/base64/browser.js index 608ea935d..94930d26f 100644 --- a/packages/base64/browser.js +++ b/packages/base64/browser.js @@ -1,10 +1,9 @@ /* eslint-disable n/no-unsupported-features/node-builtins */ -"use strict"; -module.exports.encode = function encode(string) { +export function encode(string) { return globalThis.btoa(string); -}; +} -module.exports.decode = function decode(string) { +export function decode(string) { return globalThis.atob(string); -}; +} diff --git a/packages/base64/index.js b/packages/base64/index.js index 5f4e26819..790645809 100644 --- a/packages/base64/index.js +++ b/packages/base64/index.js @@ -1,6 +1,3 @@ -"use strict"; +import { encode, decode } from "base-64"; -const { encode, decode } = require("base-64"); - -module.exports.encode = encode; -module.exports.decode = decode; +export { encode, decode }; diff --git a/packages/base64/package.json b/packages/base64/package.json index 228094b60..bde248d5d 100644 --- a/packages/base64/package.json +++ b/packages/base64/package.json @@ -6,7 +6,7 @@ "bugs": "http://github.com/xmppjs/xmpp.js/issues", "version": "0.13.2", "license": "ISC", - "type": "commonjs", + "type": "module", "keywords": [ "XMPP", "base64" @@ -17,7 +17,7 @@ "react-native": "index.js", "browser": "browser.js", "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/client-core/index.js b/packages/client-core/index.js index 645b65f59..487b86b80 100644 --- a/packages/client-core/index.js +++ b/packages/client-core/index.js @@ -1,9 +1,5 @@ -"use strict"; +import Client from "./lib/Client.js"; +import xml from "@xmpp/xml"; +import jid from "@xmpp/jid"; -const Client = require("./lib/Client"); -const xml = require("@xmpp/xml"); -const jid = require("@xmpp/jid"); - -module.exports.Client = Client; -module.exports.xml = xml; -module.exports.jid = jid; +export { Client, xml, jid }; diff --git a/packages/client-core/lib/Client.js b/packages/client-core/lib/Client.js index dc56ca506..11c86c6db 100644 --- a/packages/client-core/lib/Client.js +++ b/packages/client-core/lib/Client.js @@ -1,6 +1,4 @@ -"use strict"; - -const Connection = require("@xmpp/connection"); +import Connection from "@xmpp/connection"; class Client extends Connection { constructor(options) { @@ -63,4 +61,4 @@ class Client extends Connection { Client.prototype.NS = "jabber:client"; -module.exports = Client; +export default Client; diff --git a/packages/client-core/package.json b/packages/client-core/package.json index 203a496a9..1fb799849 100644 --- a/packages/client-core/package.json +++ b/packages/client-core/package.json @@ -5,14 +5,14 @@ "bugs": "http://github.com/xmppjs/xmpp.js/issues", "version": "0.13.2", "license": "ISC", - "type": "commonjs", + "type": "module", "dependencies": { "@xmpp/connection": "^0.13.2", "@xmpp/jid": "^0.13.2", "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/client-core/test/Client.js b/packages/client-core/test/Client.js index b15f0057a..728da9e02 100644 --- a/packages/client-core/test/Client.js +++ b/packages/client-core/test/Client.js @@ -1,6 +1,4 @@ -"use strict"; - -const Client = require("../lib/Client"); +import Client from "../lib/Client.js"; test("_findTransport", () => { class Transport { diff --git a/packages/client/README.md b/packages/client/README.md index 04d729fd2..f0d62f0d6 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -13,7 +13,7 @@ It supports Node.js, browsers and React Native. See [below](#transports) for dif ## Setup ```js -const { client, xml, jid } = require("@xmpp/client"); +import { client, xml, jid } from "@xmpp/client"; ``` or @@ -34,8 +34,8 @@ const { client, xml, jid } = window.XMPP; ## Example ```js -const { client, xml } = require("@xmpp/client"); -const debug = require("@xmpp/debug"); +import { client, xml } from "@xmpp/client"; +import debug from "@xmpp/debug"; const xmpp = client({ service: "ws://localhost:5280/xmpp-websocket", @@ -260,9 +260,9 @@ XMPP supports multiple transports, this table list `@xmpp/client` supported and | transport | protocols | Node.js | Browser | React Native | | :------------------------------: | :--------: | :-----: | :-----: | :----------: | -| [WebSocket](/packages/websocket) | `ws(s)://` | ✔ | ✔ | ✔ | -| [TCP](/packages/tcp) | `xmpp://` | ✔ | ✗ | ✗ | -| [TLS](/packages/tls) | `xmpps://` | ✔ | ✗ | ✗ | +| [WebSocket](/packages/websocket) | `ws(s)://` | ✔ | ✔ | ✔ | +| [TCP](/packages/tcp) | `xmpp://` | ✔ | ✗ | ✗ | +| [TLS](/packages/tls) | `xmpps://` | ✔ | ✗ | ✗ | ## Authentication @@ -271,9 +271,9 @@ PLAIN should only be used over secure WebSocket (`wss://)`, direct TLS (`xmpps:` | SASL | Node.js | Browser | React Native | | :---------------------------------------: | :-----: | :-----: | :----------: | -| [ANONYMOUS](/packages/sasl-anonymous) | ✔ | ✔ | ✔ | -| [PLAIN](/packages/sasl-plain) | ✔ | ✔ | ✔ | -| [SCRAM-SHA-1](/packages/sasl-scram-sha-1) | ✔ | ☐ | ✗ | +| [ANONYMOUS](/packages/sasl-anonymous) | ✔ | ✔ | ✔ | +| [PLAIN](/packages/sasl-plain) | ✔ | ✔ | ✔ | +| [SCRAM-SHA-1](/packages/sasl-scram-sha-1) | ✔ | ☐ | ✗ | - ☐ : Optional - ✗ : Unavailable diff --git a/packages/client/browser.js b/packages/client/browser.js index e4c7f84b9..3812fb455 100644 --- a/packages/client/browser.js +++ b/packages/client/browser.js @@ -9,13 +9,11 @@ import _iqCaller from "@xmpp/iq/caller.js"; import _iqCallee from "@xmpp/iq/callee.js"; import _resolve from "@xmpp/resolve"; -// Stream features - order matters and define priority import _sasl from "@xmpp/sasl"; import _resourceBinding from "@xmpp/resource-binding"; import _sessionEstablishment from "@xmpp/session-establishment"; import _streamManagement from "@xmpp/stream-management"; -// SASL mechanisms - order matters and define priority import plain from "@xmpp/sasl-plain"; import anonymous from "@xmpp/sasl-anonymous"; @@ -74,5 +72,4 @@ function client(options = {}) { }); } -// eslint-disable-next-line unicorn/prefer-export-from export { xml, jid, client }; diff --git a/packages/client/index.js b/packages/client/index.js index cd342425c..e944db401 100644 --- a/packages/client/index.js +++ b/packages/client/index.js @@ -11,14 +11,12 @@ import _iqCaller from "@xmpp/iq/caller.js"; import _iqCallee from "@xmpp/iq/callee.js"; import _resolve from "@xmpp/resolve"; -// Stream features - order matters and define priority import _starttls from "@xmpp/starttls/client.js"; import _sasl from "@xmpp/sasl"; import _resourceBinding from "@xmpp/resource-binding"; import _sessionEstablishment from "@xmpp/session-establishment"; import _streamManagement from "@xmpp/stream-management"; -// SASL mechanisms - order matters and define priority import scramsha1 from "@xmpp/sasl-scram-sha-1"; import plain from "@xmpp/sasl-plain"; import anonymous from "@xmpp/sasl-anonymous"; @@ -86,5 +84,4 @@ function client(options = {}) { }); } -// eslint-disable-next-line unicorn/prefer-export-from export { xml, jid, client }; diff --git a/packages/client/package.json b/packages/client/package.json index 3539c03fc..69f1f6177 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -33,7 +33,7 @@ "browser": "./browser.js", "react-native": "./react-native.js", "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/client/react-native.js b/packages/client/react-native.js index e4c7f84b9..3812fb455 100644 --- a/packages/client/react-native.js +++ b/packages/client/react-native.js @@ -9,13 +9,11 @@ import _iqCaller from "@xmpp/iq/caller.js"; import _iqCallee from "@xmpp/iq/callee.js"; import _resolve from "@xmpp/resolve"; -// Stream features - order matters and define priority import _sasl from "@xmpp/sasl"; import _resourceBinding from "@xmpp/resource-binding"; import _sessionEstablishment from "@xmpp/session-establishment"; import _streamManagement from "@xmpp/stream-management"; -// SASL mechanisms - order matters and define priority import plain from "@xmpp/sasl-plain"; import anonymous from "@xmpp/sasl-anonymous"; @@ -74,5 +72,4 @@ function client(options = {}) { }); } -// eslint-disable-next-line unicorn/prefer-export-from export { xml, jid, client }; diff --git a/packages/component-core/index.js b/packages/component-core/index.js index 49a433148..d95b7722a 100644 --- a/packages/component-core/index.js +++ b/packages/component-core/index.js @@ -1,9 +1,5 @@ -"use strict"; +import Component from "./lib/Component.js"; +import xml from "@xmpp/xml"; +import jid from "@xmpp/jid"; -const Component = require("./lib/Component"); -const xml = require("@xmpp/xml"); -const jid = require("@xmpp/jid"); - -module.exports.Component = Component; -module.exports.xml = xml; -module.exports.jid = jid; +export { Component, xml, jid }; diff --git a/packages/component-core/lib/Component.js b/packages/component-core/lib/Component.js index c129fee0c..6f3cd284d 100644 --- a/packages/component-core/lib/Component.js +++ b/packages/component-core/lib/Component.js @@ -1,8 +1,6 @@ -"use strict"; - -const Connection = require("@xmpp/connection-tcp"); -const { createHash } = require("crypto"); -const xml = require("@xmpp/xml"); +import Connection from "@xmpp/connection-tcp"; +import { createHash } from "crypto"; +import xml from "@xmpp/xml"; /* * References @@ -46,4 +44,4 @@ class Component extends Connection { Component.NS = NS; Component.prototype.NS = NS; -module.exports = Component; +export default Component; diff --git a/packages/component-core/package.json b/packages/component-core/package.json index b2105b20b..47d2079a0 100644 --- a/packages/component-core/package.json +++ b/packages/component-core/package.json @@ -18,7 +18,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/component-core/test/send.js b/packages/component-core/test/send.js index f36866de2..8bdb7fa8d 100644 --- a/packages/component-core/test/send.js +++ b/packages/component-core/test/send.js @@ -1,6 +1,4 @@ -"use strict"; - -const { Component, xml } = require(".."); +import { Component, xml } from "../index.js"; test("from attribute", () => { const entity = new Component(); diff --git a/packages/component/README.md b/packages/component/README.md index 654bb27ce..5c18dd33b 100644 --- a/packages/component/README.md +++ b/packages/component/README.md @@ -15,8 +15,8 @@ See [XEP-0114: Jabber Component Protocol](https://xmpp.org/extensions/xep-0114.h ## Example ```js -const { component, xml, jid } = require("@xmpp/component"); -const debug = require("@xmpp/debug"); +import { component, xml, jid } from "@xmpp/component"; +import debug from "@xmpp/debug"; const xmpp = component({ service: "xmpp://localhost:5347", diff --git a/packages/component/example.js b/packages/component/example.js index 96b98082e..d29293c7f 100644 --- a/packages/component/example.js +++ b/packages/component/example.js @@ -1,9 +1,6 @@ -/* eslint-disable n/no-extraneous-require */ - -"use strict"; - -const { component, xml } = require("@xmpp/component"); -const debug = require("@xmpp/debug"); +import { component, xml } from "@xmpp/component"; +// eslint-disable-next-line n/no-extraneous-import +import debug from "@xmpp/debug"; const xmpp = component({ service: "xmpp://localhost:5347", diff --git a/packages/component/index.js b/packages/component/index.js index 51528423d..b69d62cde 100644 --- a/packages/component/index.js +++ b/packages/component/index.js @@ -1,11 +1,9 @@ -"use strict"; +import { Component, xml, jid } from "@xmpp/component-core"; -const { Component, xml, jid } = require("@xmpp/component-core"); - -const _reconnect = require("@xmpp/reconnect"); -const _middleware = require("@xmpp/middleware"); -const _iqCaller = require("@xmpp/iq/caller"); -const _iqCallee = require("@xmpp/iq/callee"); +import _reconnect from "@xmpp/reconnect"; +import _middleware from "@xmpp/middleware"; +import _iqCaller from "@xmpp/iq/caller.js"; +import _iqCallee from "@xmpp/iq/callee.js"; function component(options) { const { password, service, domain } = options; @@ -37,6 +35,4 @@ function component(options) { }); } -module.exports.xml = xml; -module.exports.jid = jid; -module.exports.component = component; +export default { xml, jid, component }; diff --git a/packages/component/package.json b/packages/component/package.json index a1e63f475..77f90f9fc 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -6,7 +6,7 @@ "bugs": "http://github.com/xmppjs/xmpp.js/issues", "version": "0.13.2", "license": "ISC", - "type": "commonjs", + "type": "module", "keywords": [ "XMPP", "component" @@ -18,7 +18,7 @@ "@xmpp/reconnect": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/connection-tcp/index.js b/packages/connection-tcp/index.js index c4aa753c9..398a0188c 100644 --- a/packages/connection-tcp/index.js +++ b/packages/connection-tcp/index.js @@ -1,9 +1,7 @@ -"use strict"; - -const { Socket } = require("net"); -const Connection = require("@xmpp/connection"); -const { Parser } = require("@xmpp/xml"); -const { parseURI } = require("@xmpp/connection/lib/util"); +import { Socket } from "net"; +import Connection from "@xmpp/connection"; +import { Parser } from "@xmpp/xml"; +import { parseURI } from "@xmpp/connection/lib/util.js"; const NS_STREAM = "http://etherx.jabber.org/streams"; @@ -57,4 +55,4 @@ ConnectionTCP.prototype.NS = NS_STREAM; ConnectionTCP.prototype.Socket = Socket; ConnectionTCP.prototype.Parser = Parser; -module.exports = ConnectionTCP; +export default ConnectionTCP; diff --git a/packages/connection-tcp/package.json b/packages/connection-tcp/package.json index 11881687b..8e6c9b0a6 100644 --- a/packages/connection-tcp/package.json +++ b/packages/connection-tcp/package.json @@ -6,7 +6,7 @@ "bugs": "http://github.com/xmppjs/xmpp.js/issues", "version": "0.13.2", "license": "ISC", - "type": "commonjs", + "type": "module", "keywords": [ "XMPP", "connection", @@ -17,7 +17,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/connection-tcp/test/Connection.js b/packages/connection-tcp/test/Connection.js index ecc0679a9..6491ee072 100644 --- a/packages/connection-tcp/test/Connection.js +++ b/packages/connection-tcp/test/Connection.js @@ -1,9 +1,8 @@ -"use strict"; +import { Connection as _Connection } from "@xmpp/connection"; +import Connection from "../index.js"; -const _Connection = require("../../../packages/connection"); -const Connection = require(".."); -const net = require("net"); -const xml = require("@xmpp/xml"); +import net from "net"; +import xml from "@xmpp/xml"; const NS_STREAM = "http://etherx.jabber.org/streams"; @@ -26,7 +25,7 @@ test("header()", () => { const conn = new Connection(); conn.NS = "foobar"; expect(conn.header(conn.headerElement())).toBe( - `` + ``, ); }); @@ -46,7 +45,9 @@ test("socketParameters()", () => { host: "foo", }); - expect(Connection.prototype.socketParameters("xmpps://foo:1234")).toEqual(undefined); + expect(Connection.prototype.socketParameters("xmpps://foo:1234")).toEqual( + undefined, + ); }); test("sendMany", async () => { diff --git a/packages/connection/index.js b/packages/connection/index.js index 1773ee656..5ab1a7146 100644 --- a/packages/connection/index.js +++ b/packages/connection/index.js @@ -1,10 +1,8 @@ -"use strict"; - -const { EventEmitter, promise } = require("@xmpp/events"); -const jid = require("@xmpp/jid"); -const xml = require("@xmpp/xml"); -const StreamError = require("./lib/StreamError"); -const { parseHost, parseService } = require("./lib/util"); +import { EventEmitter, promise } from "@xmpp/events"; +import jid from "@xmpp/jid"; +import xml from "@xmpp/xml"; +import StreamError from "./lib/StreamError.js"; +import { parseHost, parseService } from "./lib/util.js"; const NS_STREAM = "urn:ietf:params:xml:ns:xmpp-streams"; const NS_JABBER_STREAM = "http://etherx.jabber.org/streams"; @@ -375,9 +373,9 @@ class Connection extends EventEmitter { socketParameters() {} } -// Overrirde +// Override Connection.prototype.NS = ""; Connection.prototype.Socket = null; Connection.prototype.Parser = null; -module.exports = Connection; +export default Connection; diff --git a/packages/connection/lib/StreamError.js b/packages/connection/lib/StreamError.js index 8a07ee4f0..b591c3770 100644 --- a/packages/connection/lib/StreamError.js +++ b/packages/connection/lib/StreamError.js @@ -1,6 +1,4 @@ -"use strict"; - -const XMPPError = require("@xmpp/error"); +import XMPPError from "@xmpp/error"; // https://xmpp.org/rfcs/rfc6120.html#streams-error @@ -11,4 +9,4 @@ class StreamError extends XMPPError { } } -module.exports = StreamError; +export default StreamError; diff --git a/packages/connection/lib/util.js b/packages/connection/lib/util.js index 212375728..47a791861 100644 --- a/packages/connection/lib/util.js +++ b/packages/connection/lib/util.js @@ -1,5 +1,3 @@ -"use strict"; - function parseURI(URI) { let { port, hostname, protocol } = new URL(URI); // https://github.com/nodejs/node/issues/12410#issuecomment-294138912 @@ -19,4 +17,4 @@ function parseService(service) { return service.includes("://") ? parseURI(service) : parseHost(service); } -Object.assign(module.exports, { parseURI, parseHost, parseService }); +export { parseURI, parseHost, parseService }; diff --git a/packages/connection/package.json b/packages/connection/package.json index cf42e6b0a..31732cdfe 100644 --- a/packages/connection/package.json +++ b/packages/connection/package.json @@ -6,7 +6,7 @@ "bugs": "http://github.com/xmppjs/xmpp.js/issues", "version": "0.13.2", "license": "ISC", - "type": "commonjs", + "type": "module", "keywords": [ "XMPP", "connection" @@ -18,7 +18,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/connection/test/close.js b/packages/connection/test/close.js index a9734974a..34441a757 100644 --- a/packages/connection/test/close.js +++ b/packages/connection/test/close.js @@ -1,13 +1,6 @@ -"use strict"; - -const Connection = require(".."); -const { - EventEmitter, - promise, - timeout, - TimeoutError, -} = require("@xmpp/events"); -const xml = require("@xmpp/xml"); +import Connection from "../index.js"; +import { EventEmitter, promise, timeout, TimeoutError } from "@xmpp/events"; +import xml from "@xmpp/xml"; test("resets properties on socket close event", () => { const conn = new Connection(); diff --git a/packages/connection/test/connect.js b/packages/connection/test/connect.js index 5eff449d7..76db2f538 100644 --- a/packages/connection/test/connect.js +++ b/packages/connection/test/connect.js @@ -1,7 +1,5 @@ -"use strict"; - -const Connection = require(".."); -const { EventEmitter, promise } = require("@xmpp/events"); +import Connection from "../index.js"; +import { EventEmitter, promise } from "@xmpp/events"; function socket(fn) { return class Socket extends EventEmitter { diff --git a/packages/connection/test/disconnect.js b/packages/connection/test/disconnect.js index 0052af292..d51885bd1 100644 --- a/packages/connection/test/disconnect.js +++ b/packages/connection/test/disconnect.js @@ -1,7 +1,5 @@ -"use strict"; - -const Connection = require(".."); -const { EventEmitter } = require("@xmpp/events"); +import Connection from "../index.js"; +import { EventEmitter } from "@xmpp/events"; test("rejects with TimeoutError if socket doesn't close", (done) => { expect.assertions(2); diff --git a/packages/connection/test/end.js b/packages/connection/test/end.js index 972bdf654..1feececae 100644 --- a/packages/connection/test/end.js +++ b/packages/connection/test/end.js @@ -1,6 +1,4 @@ -"use strict"; - -const Connection = require(".."); +import Connection from "../index.js"; test("#_end", async () => { const conn = new Connection(); diff --git a/packages/connection/test/error.js b/packages/connection/test/error.js index 4359c2711..8aafee03e 100644 --- a/packages/connection/test/error.js +++ b/packages/connection/test/error.js @@ -1,7 +1,5 @@ -"use strict"; - -const Connection = require(".."); -const { EventEmitter } = require("@xmpp/events"); +import Connection from "../index.js"; +import { EventEmitter } from "@xmpp/events"; test("emit error on socket error", () => { const conn = new Connection(); diff --git a/packages/connection/test/onData.js b/packages/connection/test/onData.js index d73c4c518..58a1f9ef5 100644 --- a/packages/connection/test/onData.js +++ b/packages/connection/test/onData.js @@ -1,6 +1,4 @@ -"use strict"; - -const Connection = require(".."); +import Connection from "../index.js"; test("#_onData", () => { expect.assertions(2); diff --git a/packages/connection/test/onElement.js b/packages/connection/test/onElement.js index 46bcdfa55..c6e558a3e 100644 --- a/packages/connection/test/onElement.js +++ b/packages/connection/test/onElement.js @@ -1,9 +1,7 @@ -"use strict"; +import Connection from "../index.js"; +import xml from "@xmpp/xml"; -const Connection = require(".."); -const xml = require("@xmpp/xml"); - -test("#_onElement", done => { +test("#_onElement", (done) => { expect.assertions(2); const foo = ; const conn = new Connection(); @@ -17,7 +15,7 @@ test("#_onElement", done => { conn._onElement(foo); }); -test("#_onElement stream:error", done => { +test("#_onElement stream:error", (done) => { expect.assertions(7); // prettier-ignore diff --git a/packages/connection/test/parserError.js b/packages/connection/test/parserError.js index 2e9520983..ec851b777 100644 --- a/packages/connection/test/parserError.js +++ b/packages/connection/test/parserError.js @@ -1,7 +1,5 @@ -"use strict"; - -const Connection = require(".."); -const { EventEmitter } = require("@xmpp/events"); +import Connection from "../index.js"; +import { EventEmitter } from "@xmpp/events"; test("calls _detachParser, sends a bad-format stream error and emit an error", async () => { expect.assertions(4); diff --git a/packages/connection/test/send.js b/packages/connection/test/send.js index 3bb106b4f..8eaacd1eb 100644 --- a/packages/connection/test/send.js +++ b/packages/connection/test/send.js @@ -1,7 +1,5 @@ -"use strict"; - -const xml = require("@xmpp/xml"); -const Connection = require(".."); +import Connection from "../index.js"; +import xml from "@xmpp/xml"; test("send", () => { expect.assertions(3); diff --git a/packages/connection/test/socketClose.js b/packages/connection/test/socketClose.js index 72f45d42c..3ff56c1a9 100644 --- a/packages/connection/test/socketClose.js +++ b/packages/connection/test/socketClose.js @@ -1,7 +1,5 @@ -"use strict"; - -const Connection = require(".."); -const { EventEmitter } = require("@xmpp/events"); +import Connection from "../index.js"; +import { EventEmitter } from "@xmpp/events"; test("calls _reset and _status", () => { expect.assertions(3); diff --git a/packages/connection/test/start.js b/packages/connection/test/start.js index 173934fe0..5744871d3 100644 --- a/packages/connection/test/start.js +++ b/packages/connection/test/start.js @@ -1,6 +1,4 @@ -"use strict"; - -const Connection = require(".."); +import Connection from "../index.js"; test("rejects if connection is not offline", () => { const conn = new Connection(); diff --git a/packages/connection/test/stop.js b/packages/connection/test/stop.js index e4990b968..5057068bc 100644 --- a/packages/connection/test/stop.js +++ b/packages/connection/test/stop.js @@ -1,6 +1,4 @@ -"use strict"; - -const Connection = require(".."); +import Connection from "../index.js"; test("resolves if socket property is undefined", async () => { const conn = new Connection(); diff --git a/packages/connection/test/streamError.js b/packages/connection/test/streamError.js index b88c0b4eb..79d8967a4 100644 --- a/packages/connection/test/streamError.js +++ b/packages/connection/test/streamError.js @@ -1,7 +1,5 @@ -"use strict"; - -const Connection = require(".."); -const xml = require("@xmpp/xml"); +import Connection from "../index.js"; +import xml from "@xmpp/xml"; test("#_streamError", async () => { const conn = new Connection(); diff --git a/packages/connection/test/test.js b/packages/connection/test/test.js index 35f9fac3d..2e9c9744f 100644 --- a/packages/connection/test/test.js +++ b/packages/connection/test/test.js @@ -1,8 +1,6 @@ -"use strict"; - -const Connection = require(".."); -const { EventEmitter } = require("@xmpp/events"); -const xml = require("@xmpp/xml"); +import Connection from "../index.js"; +import { EventEmitter } from "@xmpp/events"; +import xml from "@xmpp/xml"; test("new Connection()", () => { const conn = new Connection(); diff --git a/packages/debug/README.md b/packages/debug/README.md index 5184717b5..a4070b685 100644 --- a/packages/debug/README.md +++ b/packages/debug/README.md @@ -11,13 +11,14 @@ Sensitive information (authentication) is replaced with ` { console.debug(`IN\n${format(data)}`); @@ -53,6 +51,4 @@ module.exports = function debug(entity, force) { console.debug("status", status, value ? value.toString() : ""); }); } -}; - -module.exports.hideSensitive = hideSensitive; +} diff --git a/packages/debug/package.json b/packages/debug/package.json index ac4006974..af50a9781 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -6,13 +6,13 @@ "bugs": "http://github.com/xmppjs/xmpp.js/issues", "version": "0.13.2", "license": "ISC", - "type": "commonjs", + "type": "module", "keywords": [ "XMPP", "debug" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "dependencies": { "@xmpp/xml": "^0.13.2", diff --git a/packages/debug/test.js b/packages/debug/test.js index 342fc312c..454532059 100644 --- a/packages/debug/test.js +++ b/packages/debug/test.js @@ -1,33 +1,51 @@ -"use strict"; - -const { hideSensitive } = require("."); +import { hideSensitive } from "./index.js"; test("SASL", () => { - expect(hideSensitive(foo)).toEqual( - - ); + expect( + hideSensitive(foo), + ).toEqual( + + + , + ); - expect(hideSensitive( - foo, - )).toEqual( - - ); + expect( + hideSensitive( + foo, + ), + ).toEqual( + + + , + ); - expect(hideSensitive( - foo, - )).toEqual( - - ); + expect( + hideSensitive( + foo, + ), + ).toEqual( + + + , + ); - expect(hideSensitive( - foo, - )).toEqual( - - ); + expect( + hideSensitive( + foo, + ), + ).toEqual( + + + , + ); }); test("component handshake", () => { - expect(hideSensitive(foo)).toEqual( - - ); + expect( + hideSensitive(foo), + ).toEqual( + + + , + ); }); diff --git a/packages/error/README.md b/packages/error/README.md index 697b22c94..55cedbcee 100644 --- a/packages/error/README.md +++ b/packages/error/README.md @@ -9,7 +9,7 @@ XMPP error abstraction for JavaScript. ## Usage ```js -const XMPPError = require("@xmpp/error"); +import XMPPError from "@xmpp/error"; const error = new XMPPError("service-unavailable", "optional text", element); error instanceof Error; // true diff --git a/packages/error/index.js b/packages/error/index.js index e5a7144dc..0d131c466 100644 --- a/packages/error/index.js +++ b/packages/error/index.js @@ -1,5 +1,3 @@ -"use strict"; - // https://xmpp.org/rfcs/rfc6120.html#rfc.section.4.9.2 class XMPPError extends Error { diff --git a/packages/error/package.json b/packages/error/package.json index fa22d787c..156305cc8 100644 --- a/packages/error/package.json +++ b/packages/error/package.json @@ -6,13 +6,13 @@ "bugs": "http://github.com/xmppjs/xmpp.js/issues", "version": "0.13.2", "license": "ISC", - "type": "commonjs", + "type": "module", "keywords": [ "xmpp", "error" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/error/test.js b/packages/error/test.js index 2aa0cb9ac..da3b38673 100644 --- a/packages/error/test.js +++ b/packages/error/test.js @@ -1,8 +1,6 @@ -"use strict"; - -const XMPPError = require("."); -// eslint-disable-next-line n/no-extraneous-require -const parse = require("@xmpp/xml/lib/parse.js"); +import XMPPError from "./index.js"; +// eslint-disable-next-line n/no-extraneous-import +import parse from "@xmpp/xml/lib/parse.js"; test("fromElement", () => { const application_element = ( @@ -47,5 +45,7 @@ test("fromElement - whitespaces", () => { expect(error.name).toBe("XMPPError"); expect(error.condition).toBe("some-condition"); expect(error.text).toBe("\n foo\n "); - expect(error.application.toString()).toBe(``); + expect(error.application.toString()).toBe( + ``, + ); }); diff --git a/packages/events/index.js b/packages/events/index.js index ee6644532..a2571313d 100644 --- a/packages/events/index.js +++ b/packages/events/index.js @@ -1,15 +1,9 @@ -"use strict"; +import EventEmitter from "events"; -const timeout = require("./lib/timeout"); -const delay = require("./lib/delay"); -const TimeoutError = require("./lib/TimeoutError"); -const promise = require("./lib/promise"); -const EventEmitter = require("events"); -const Deferred = require("./lib/Deferred"); +import timeout from "./lib/timeout.js"; +import delay from "./lib/delay.js"; +import TimeoutError from "./lib/TimeoutError.js"; +import promise from "./lib/promise.js"; +import Deferred from "./lib/Deferred.js"; -exports.EventEmitter = EventEmitter; -exports.timeout = timeout; -exports.delay = delay; -exports.TimeoutError = TimeoutError; -exports.promise = promise; -exports.Deferred = Deferred; +export { EventEmitter, timeout, delay, TimeoutError, promise, Deferred }; diff --git a/packages/events/lib/Deferred.js b/packages/events/lib/Deferred.js index 7c388ec64..1b5631e3b 100644 --- a/packages/events/lib/Deferred.js +++ b/packages/events/lib/Deferred.js @@ -1,8 +1,6 @@ -"use strict"; - -module.exports = function Deferred() { +export default function Deferred() { this.promise = new Promise((resolve, reject) => { this.resolve = resolve; this.reject = reject; }); -}; +} diff --git a/packages/events/lib/TimeoutError.js b/packages/events/lib/TimeoutError.js index 46008e3ba..e6880d4f3 100644 --- a/packages/events/lib/TimeoutError.js +++ b/packages/events/lib/TimeoutError.js @@ -1,8 +1,6 @@ -"use strict"; - -module.exports = class TimeoutError extends Error { +export default class TimeoutError extends Error { constructor(message) { super(message); this.name = "TimeoutError"; } -}; +} diff --git a/packages/events/lib/delay.js b/packages/events/lib/delay.js index 0ef64d1d3..8d2c87984 100644 --- a/packages/events/lib/delay.js +++ b/packages/events/lib/delay.js @@ -1,10 +1,8 @@ -"use strict"; - -module.exports = function delay(ms) { +export default function delay(ms) { let timeout; const promise = new Promise((resolve) => { timeout = setTimeout(resolve, ms); }); promise.timeout = timeout; return promise; -}; +} diff --git a/packages/events/lib/promise.js b/packages/events/lib/promise.js index 3659f4dca..69fb61b45 100644 --- a/packages/events/lib/promise.js +++ b/packages/events/lib/promise.js @@ -1,8 +1,6 @@ -"use strict"; +import TimeoutError from "./TimeoutError.js"; -const TimeoutError = require("./TimeoutError"); - -module.exports = function promise(EE, event, rejectEvent = "error", timeout) { +export default function promise(EE, event, rejectEvent = "error", timeout) { return new Promise((resolve, reject) => { let timeoutId; @@ -34,4 +32,4 @@ module.exports = function promise(EE, event, rejectEvent = "error", timeout) { }, timeout); } }); -}; +} diff --git a/packages/events/lib/timeout.js b/packages/events/lib/timeout.js index 76d63fe0d..e316369d3 100644 --- a/packages/events/lib/timeout.js +++ b/packages/events/lib/timeout.js @@ -1,9 +1,7 @@ -"use strict"; +import TimeoutError from "./TimeoutError.js"; +import delay from "./delay.js"; -const TimeoutError = require("./TimeoutError"); -const delay = require("./delay"); - -module.exports = function timeout(promise, ms) { +export default function timeout(promise, ms) { const promiseDelay = delay(ms); function cancelDelay() { @@ -16,4 +14,4 @@ module.exports = function timeout(promise, ms) { throw new TimeoutError(); }), ]); -}; +} diff --git a/packages/events/package.json b/packages/events/package.json index 1685c1556..d2c7ecd06 100644 --- a/packages/events/package.json +++ b/packages/events/package.json @@ -6,7 +6,7 @@ "bugs": "http://github.com/xmppjs/xmpp.js/issues", "version": "0.13.2", "license": "ISC", - "type": "commonjs", + "type": "module", "keywords": [ "event", "events", @@ -14,7 +14,7 @@ "EventEmitter" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/events/test/promise.test.js b/packages/events/test/promise.test.js index 50fe712f9..9568d5c3c 100644 --- a/packages/events/test/promise.test.js +++ b/packages/events/test/promise.test.js @@ -1,7 +1,5 @@ -"use strict"; - -const { promise } = require(".."); -const EventEmitter = require("events"); +import promise from "../lib/promise.js"; +import EventEmitter from "node:events"; class Socket extends EventEmitter { constructor(fn) { @@ -34,21 +32,24 @@ test('resolves if "event" is emitted', async () => { expect(socket.listenerCount("connect")).toBe(0); }); -test('rejects if "errorEvent" is emitted', () => { +test('rejects if "errorEvent" is emitted', async () => { const error = new Error("foobar"); // eslint-disable-next-line func-names const socket = new Socket(function () { this.emit("error", error); }); + socket.connect(); + expect(socket.listenerCount("error")).toBe(0); expect(socket.listenerCount("connect")).toBe(0); - socket.connect(); + const p = promise(socket, "connect", "error"); + expect(socket.listenerCount("error")).toBe(1); expect(socket.listenerCount("connect")).toBe(1); - return p.catch((err) => { - expect(err).toBe(error); - expect(socket.listenerCount("error")).toBe(0); - expect(socket.listenerCount("connect")).toBe(0); - }); + + await expect(p).rejects.toBe(error); + + expect(socket.listenerCount("error")).toBe(0); + expect(socket.listenerCount("connect")).toBe(0); }); diff --git a/packages/id/README.md b/packages/id/README.md index 4ce5cb0fb..941e23434 100644 --- a/packages/id/README.md +++ b/packages/id/README.md @@ -9,7 +9,7 @@ XMPP id generator for JavaScript. ## Usage ```js -const id = require("@xmpp/id"); +import id from "@xmpp/id"; console.log(id()); // ymg806tinn ``` diff --git a/packages/id/index.js b/packages/id/index.js index 361e9a40a..19dcb08d5 100644 --- a/packages/id/index.js +++ b/packages/id/index.js @@ -1,10 +1,8 @@ -"use strict"; - -module.exports = function id() { +export default function id() { let i; while (!i) { i = Math.random().toString(36).slice(2, 12); } return i; -}; +} diff --git a/packages/id/package.json b/packages/id/package.json index 6516eb637..9484842d6 100644 --- a/packages/id/package.json +++ b/packages/id/package.json @@ -6,13 +6,13 @@ "bugs": "http://github.com/xmppjs/xmpp.js/issues", "version": "0.13.2", "license": "ISC", - "type": "commonjs", + "type": "module", "keywords": [ "XMPP", "id" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/id/test.js b/packages/id/test.js index de4cfe1e1..8bd67b4d7 100644 --- a/packages/id/test.js +++ b/packages/id/test.js @@ -1,6 +1,4 @@ -"use strict"; - -const xid = require("."); +import xid from "./index.js"; test("returns a non empty string", () => { expect(typeof xid()).toBe("string"); @@ -9,7 +7,7 @@ test("returns a non empty string", () => { test("duplicates", () => { const id = xid(); - for (let i = 0; i < 100000; i++) { + for (let i = 0; i < 10000; i++) { expect(id).not.toBe(xid()); } }); diff --git a/packages/iq/package.json b/packages/iq/package.json index 36cec3bf8..6862e326c 100644 --- a/packages/iq/package.json +++ b/packages/iq/package.json @@ -14,7 +14,7 @@ "callee" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "dependencies": { "@xmpp/events": "^0.13.2", diff --git a/packages/jid/package.json b/packages/jid/package.json index 933aa79e6..4f8edf7b2 100644 --- a/packages/jid/package.json +++ b/packages/jid/package.json @@ -12,7 +12,7 @@ "JID" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/middleware/package.json b/packages/middleware/package.json index cb8d4c508..48e7e04b4 100644 --- a/packages/middleware/package.json +++ b/packages/middleware/package.json @@ -18,7 +18,7 @@ "koa-compose": "^4.1.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/reconnect/package.json b/packages/reconnect/package.json index 0a11b8274..d55b0bb9d 100644 --- a/packages/reconnect/package.json +++ b/packages/reconnect/package.json @@ -15,7 +15,7 @@ "@xmpp/events": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/resolve/package.json b/packages/resolve/package.json index a65ad6ca2..86a227259 100644 --- a/packages/resolve/package.json +++ b/packages/resolve/package.json @@ -27,7 +27,7 @@ "node-fetch": "^2.6.12" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/resource-binding/package.json b/packages/resource-binding/package.json index 3f9080fb1..b7e21217e 100644 --- a/packages/resource-binding/package.json +++ b/packages/resource-binding/package.json @@ -16,7 +16,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/sasl-anonymous/package.json b/packages/sasl-anonymous/package.json index ca786f89f..53e689b66 100644 --- a/packages/sasl-anonymous/package.json +++ b/packages/sasl-anonymous/package.json @@ -16,7 +16,7 @@ "sasl-anonymous": "^0.1.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/sasl-plain/package.json b/packages/sasl-plain/package.json index b8ac7f6d1..ad67d5e45 100644 --- a/packages/sasl-plain/package.json +++ b/packages/sasl-plain/package.json @@ -16,7 +16,7 @@ "sasl-plain": "^0.1.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/sasl-scram-sha-1/package.json b/packages/sasl-scram-sha-1/package.json index c7debced6..6a3467bb3 100644 --- a/packages/sasl-scram-sha-1/package.json +++ b/packages/sasl-scram-sha-1/package.json @@ -16,7 +16,7 @@ "sasl-scram-sha-1": "^1.3.0" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/sasl/package.json b/packages/sasl/package.json index 9632031f4..82fd70ef6 100644 --- a/packages/sasl/package.json +++ b/packages/sasl/package.json @@ -18,7 +18,7 @@ "saslmechanisms": "^0.1.1" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/session-establishment/package.json b/packages/session-establishment/package.json index f7af8fd87..de0d68cfc 100644 --- a/packages/session-establishment/package.json +++ b/packages/session-establishment/package.json @@ -16,7 +16,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/starttls/package.json b/packages/starttls/package.json index 31c829447..e37560249 100644 --- a/packages/starttls/package.json +++ b/packages/starttls/package.json @@ -17,7 +17,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/stream-features/package.json b/packages/stream-features/package.json index 715a562ef..52d60ec58 100644 --- a/packages/stream-features/package.json +++ b/packages/stream-features/package.json @@ -13,7 +13,7 @@ "features" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/stream-management/package.json b/packages/stream-management/package.json index 6d8f985bc..c7264e7c9 100644 --- a/packages/stream-management/package.json +++ b/packages/stream-management/package.json @@ -16,7 +16,7 @@ "@xmpp/xml": "^0.13.2" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/tcp/package.json b/packages/tcp/package.json index 7ec589774..cdc19352a 100644 --- a/packages/tcp/package.json +++ b/packages/tcp/package.json @@ -15,7 +15,7 @@ "tcp" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/test/package.json b/packages/test/package.json index de0128b37..ad90a2647 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -12,7 +12,7 @@ "test" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "dependencies": { "@xmpp/client": "^0.13.2", diff --git a/packages/time/package.json b/packages/time/package.json index 7bb410496..c2516a1c9 100644 --- a/packages/time/package.json +++ b/packages/time/package.json @@ -13,7 +13,7 @@ "date" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/tls/package.json b/packages/tls/package.json index 662d88198..453b96a09 100644 --- a/packages/tls/package.json +++ b/packages/tls/package.json @@ -16,7 +16,7 @@ "tls" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/uri/package.json b/packages/uri/package.json index 41d9cbe41..7dcba91fe 100644 --- a/packages/uri/package.json +++ b/packages/uri/package.json @@ -16,7 +16,7 @@ "iri": "^1.3.1" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/websocket/package.json b/packages/websocket/package.json index 33240f065..8e2e2823c 100644 --- a/packages/websocket/package.json +++ b/packages/websocket/package.json @@ -20,7 +20,7 @@ "websocket" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/xml/package.json b/packages/xml/package.json index 8559c552a..a0cd107d9 100644 --- a/packages/xml/package.json +++ b/packages/xml/package.json @@ -18,7 +18,7 @@ "ltx": "^3.1.1" }, "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "publishConfig": { "access": "public" diff --git a/packages/xmpp.js/package.json b/packages/xmpp.js/package.json index cc0733ca2..336fa83a7 100644 --- a/packages/xmpp.js/package.json +++ b/packages/xmpp.js/package.json @@ -14,7 +14,7 @@ "component" ], "engines": { - "node": ">= 14" + "node": ">= 14.13.1" }, "dependencies": { "@xmpp/base64": "^0.13.2",