From 409833055d119b3442f1e5c06bfd3a8beb34d075 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 23 Jan 2025 12:35:37 +0100 Subject: [PATCH 1/2] Add eslint no-console rule --- README.md | 2 +- eslint.config.js | 1 + packages/client/example.js | 3 ++- packages/component/example.js | 3 ++- packages/resolve/example.js | 2 ++ server/ctl.js | 1 + test/bundlesize.js | 3 +-- 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c5d2e95d..cf6c489e 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Do you need help with working with xmpp.js? Please reach out to our community by ## Built with xmpp.js - [WorkAdventure](https://workadventu.re/) -- [Simplo](https://simplo.app/?lang=en) +- [Mustang](https://www.mustang.im/) - [Crypho](https://www.crypho.com/) - [MeshCentral](https://meshcentral.com/) - [openHAB](https://www.openhab.org/) diff --git a/eslint.config.js b/eslint.config.js index ef276398..73afd1ea 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -54,6 +54,7 @@ export default [ "prefer-arrow-callback": ["error", { allowNamedFunctions: true }], "no-redeclare": ["error", { builtinGlobals: false }], "no-unused-vars": ["error", { argsIgnorePattern: "^_" }], + "no-console": ["error"], // node // https://github.com/eslint-community/eslint-plugin-n/ diff --git a/packages/client/example.js b/packages/client/example.js index dc3359b1..e95416c7 100644 --- a/packages/client/example.js +++ b/packages/client/example.js @@ -1,5 +1,6 @@ +/* eslint-disable no-console, n/no-extraneous-import*/ + import { client, xml } from "@xmpp/client"; -// eslint-disable-next-line n/no-extraneous-import import debug from "@xmpp/debug"; // Insecure! diff --git a/packages/component/example.js b/packages/component/example.js index ce5847b5..93bbe3e2 100644 --- a/packages/component/example.js +++ b/packages/component/example.js @@ -1,5 +1,6 @@ +/* eslint-disable no-console, n/no-extraneous-import*/ + import { component, xml } from "@xmpp/component"; -// eslint-disable-next-line n/no-extraneous-import import debug from "@xmpp/debug"; const xmpp = component({ diff --git a/packages/resolve/example.js b/packages/resolve/example.js index 21d2d30c..8bb822a7 100644 --- a/packages/resolve/example.js +++ b/packages/resolve/example.js @@ -1,3 +1,5 @@ +/* eslint-disable no-console */ + import { resolve } from "@xmpp/resolve"; const result = await resolve("jabberfr.org"); diff --git a/server/ctl.js b/server/ctl.js index 447c1c38..6dc735b0 100755 --- a/server/ctl.js +++ b/server/ctl.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +/* eslint-disable no-console */ import server from "./index.js"; diff --git a/test/bundlesize.js b/test/bundlesize.js index 39b952e2..709555fa 100644 --- a/test/bundlesize.js +++ b/test/bundlesize.js @@ -1,5 +1,4 @@ -/* eslint-disable unicorn/no-process-exit */ -/* eslint-disable n/no-process-exit */ +/* eslint-disable no-console, unicorn/no-process-exit, n/no-process-exit */ import zlib from "node:zlib"; import { readFile } from "node:fs/promises"; From dba0d4a2d3a5d5ca4c0cd300fdba7b2411f2ec82 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 23 Jan 2025 12:56:28 +0100 Subject: [PATCH 2/2] Add protocols to README Closes https://github.com/xmppjs/xmpp.js/issues/531 --- README.md | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++ protocols.md | 79 -------------------------------------- 2 files changed, 104 insertions(+), 79 deletions(-) delete mode 100644 protocols.md diff --git a/README.md b/README.md index cf6c489e..198aeca1 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,110 @@ Do you need help with working with xmpp.js? Please reach out to our community by Feel free to send a PR to add your project or organization to this list. +## Protocols + +[RFC 6120](https://tools.ietf.org/html/rfc6120) - Extensible Messaging and Presence Protocol (XMPP): Core + +See [`@xmpp/client-core`](packages/client-core) and [`@xmpp/component-core`](packages/component-core) + +Included in [`@xmpp/client`](packages/client) and [`@xmpp/component`](packages/component) + +--- + +[RFC 7590](https://tools.ietf.org/html/rfc7590) - Use of Transport Layer Security (TLS) in the Extensible Messaging and Presence Protocol (XMPP) + +See [`@xmpp/tls`](packages/tls) + +Included in [`@xmpp/client`](packages/client) + +--- + + + + + +[RFC 7622](https://tools.ietf.org/html/rfc7622) - Extensible Messaging and Presence Protocol (XMPP): Address Format + +See [`@xmpp/jid`](packages/jid) + +Included in [`@xmpp/client`](packages/client) and [`@xmpp/component`](packages/component) + +--- + +[RFC 7395](https://tools.ietf.org/html/rfc7395) - An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket + +See [`@xmpp/websocket`](packages/websocket) + +Included in [`@xmpp/client`](packages/client) + +--- + +[draft-cridland-xmpp-session-01](https://tools.ietf.org/html/draft-cridland-xmpp-session-01) Here Lies Extensible Messaging and Presence Protocol (XMPP) Session Establishment + +See [`@xmpp/session-establishment`](packages/session-establishment) + +--- + +[XEP-0368](https://xmpp.org/extensions/xep-0368.html): SRV records for XMPP over TLS + +See [`@xmpp/resolve`](packages/resolve) + +Included in [`@xmpp/client`](packages/client) + +--- + +[XEP-0156](https://xmpp.org/extensions/xep-0156.html): Discovering Alternative XMPP Connection Methods + +See [`@xmpp/resolve`](packages/resolve) + +Included in [`@xmpp/client`](packages/client) + +--- + +[XEP-0114](https://xmpp.org/extensions/xep-0114.html): Jabber Component Protocol + +See [`@xmpp/component-core`](packages/component-core) + +Included in [`@xmpp/component`](packages/component) + +--- + +[XEP-0082](https://xmpp.org/extensions/xep-0082.html): XMPP Date and Time Profiles + +See [`@xmpp/time`](packages/time) + +--- + +[XEP-0198](https://xmpp.org/extensions/xep-0198.html): Stream Management + +See [`@xmpp/stream-management`](packages/stream-management) + +Included in [`@xmpp/client`](packages/client) + +--- + +[XEP-0388](https://xmpp.org/extensions/xep-0388.html): Extensible SASL Profile + +See [`@xmpp/sasl2`](packages/sasl2) + +Included in [`@xmpp/client`](packages/client) + +--- + +[XEP-0386](https://xmpp.org/extensions/xep-0386.html): Bind 2 + +See [`@xmpp/client-core`](./packages/client-core/src/bind2/) + +Included in [`@xmpp/client`](packages/client) + +--- + +[XEP-0484](https://xmpp.org/extensions/xep-0484.html): Fast Authentication Streamlining Tokens + +See [`@xmpp/client-core`](./packages/client-core/src/fast/) + +Included in [`@xmpp/client`](packages/client) + ## credits xmpp.js is a rewrite of [node-xmpp](https://github.com/xmppjs/xmpp.js/tree/node-xmpp) and learned a lot from it. diff --git a/protocols.md b/protocols.md deleted file mode 100644 index dc982d14..00000000 --- a/protocols.md +++ /dev/null @@ -1,79 +0,0 @@ -# Protocols - -[RFC 6120](https://tools.ietf.org/html/rfc6120) - Extensible Messaging and Presence Protocol (XMPP): Core - -See [`@xmpp/client-core`](packages/client-core) and [`@xmpp/component-core`](packages/component-core) - -Included in [`@xmpp/client`](packages/client) and [`@xmpp/component`](packages/component) - ---- - -[RFC 7590](https://tools.ietf.org/html/rfc7590) - Use of Transport Layer Security (TLS) in the Extensible Messaging and Presence Protocol (XMPP) - -See [`@xmpp/tls`](packages/tls) - -Included in [`@xmpp/client`](packages/client) - ---- - - - - - -[RFC 7622](https://tools.ietf.org/html/rfc7622) - Extensible Messaging and Presence Protocol (XMPP): Address Format - -See [`@xmpp/jid`](packages/jid) - -Included in [`@xmpp/client`](packages/client) and [`@xmpp/component`](packages/component) - ---- - -[RFC 7395](https://tools.ietf.org/html/rfc7395) - An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket - -See [`@xmpp/websocket`](packages/websocket) - -Included in [`@xmpp/client`](packages/client) - ---- - -[draft-cridland-xmpp-session-01](https://tools.ietf.org/html/draft-cridland-xmpp-session-01) Here Lies Extensible Messaging and Presence Protocol (XMPP) Session Establishment - -See [`@xmpp/session-establishment`](packages/session-establishment) - -Included in [`@xmpp/client`](packages/client) - ---- - -[XEP-0368](https://xmpp.org/extensions/xep-0368.html): SRV records for XMPP over TLS - -See [`@xmpp/resolve`](packages/resolve) - -Included in [`@xmpp/client`](packages/client) - ---- - -[XEP-0156](https://xmpp.org/extensions/xep-0156.html): Discovering Alternative XMPP Connection Methods - -See [`@xmpp/resolve`](packages/resolve) - -Included in [`@xmpp/client`](packages/client) - ---- - -[XEP-0114](https://xmpp.org/extensions/xep-0114.html): Jabber Component Protocol - -See [`@xmpp/component-core`](packages/component-core) - -Included in [`@xmpp/component`](packages/component) - ---- - -[XEP-0082](https://xmpp.org/extensions/xep-0082.html): XMPP Date and Time Profiles - -See [`@xmpp/time`](packages/time) - ---- - -[XEP-0198](https://xmpp.org/extensions/xep-0198.html): Stream Management - -See [`@xmpp/stream-management`](packages/stream-management)