Update dependencies
This commit is contained in:
@@ -89,14 +89,14 @@ Whether you read those or not, I'm more than happy to help you 1-on-1 with codin
|
|||||||
|
|
||||||
# Dependency justification
|
# Dependency justification
|
||||||
|
|
||||||
Total transitive production dependencies: 144
|
Total transitive production dependencies: 112
|
||||||
|
|
||||||
### <font size="+2">🦕</font>
|
### <font size="+2">🦕</font>
|
||||||
|
|
||||||
* (35) better-sqlite3: SQLite is the best database, and this is the best library for it.
|
|
||||||
* (29) sharp: Image resizing and compositing. OOYE needs this for the emoji sprite sheets. It has libvips prebuilts for each platform.
|
* (29) sharp: Image resizing and compositing. OOYE needs this for the emoji sprite sheets. It has libvips prebuilts for each platform.
|
||||||
* (26) @cloudrac3r/pug: Language for dynamic web pages. This is my fork. (I released code that hadn't made it to npm, and removed the heavy pug-filters feature.)
|
* (26) @cloudrac3r/pug: Language for dynamic web pages. This is my fork. (I released code that hadn't made it to npm, and removed the heavy pug-filters feature.)
|
||||||
* (9) h3: Web server. OOYE needs this for the web UI, appservice listener, authmedia proxy, and more.
|
* (9) h3: Web server. OOYE needs this for the web UI, appservice listener, authmedia proxy, and more.
|
||||||
|
* (1) better-sqlite3: SQLite is the best database, and this is the best library for it.
|
||||||
|
|
||||||
### <font size="-1">🪱</font>
|
### <font size="-1">🪱</font>
|
||||||
|
|
||||||
@@ -120,6 +120,7 @@ Total transitive production dependencies: 144
|
|||||||
* (0) entities: Looks fine. No dependencies.
|
* (0) entities: Looks fine. No dependencies.
|
||||||
* (0) get-relative-path: Looks fine. No dependencies.
|
* (0) get-relative-path: Looks fine. No dependencies.
|
||||||
* (1) heatsync: Module hot-reloader that I trust.
|
* (1) heatsync: Module hot-reloader that I trust.
|
||||||
|
* (0) htmx.org: Declarative partial page reloads that do just enough. I'm not totally happy with this one, but not sure what I'd do instead.
|
||||||
* (0) lru-cache: For holding unused nonce in memory and letting them be overwritten later if never used.
|
* (0) lru-cache: For holding unused nonce in memory and letting them be overwritten later if never used.
|
||||||
* (1) mime-types: List of mime type mappings. Needed to serve static files.
|
* (1) mime-types: List of mime type mappings. Needed to serve static files.
|
||||||
* (0) prettier-bytes: It does what I want and has no dependencies.
|
* (0) prettier-bytes: It does what I want and has no dependencies.
|
||||||
@@ -128,3 +129,18 @@ Total transitive production dependencies: 144
|
|||||||
* (0) uqr: QR code SVG generator. Used on the website to scan in an invite link.
|
* (0) uqr: QR code SVG generator. Used on the website to scan in an invite link.
|
||||||
* (0) xxhash-wasm: Used where cryptographically secure hashing is not required.
|
* (0) xxhash-wasm: Used where cryptographically secure hashing is not required.
|
||||||
* (0) zod: Input validation for the web server. It's popular and easy to use.
|
* (0) zod: Input validation for the web server. It's popular and easy to use.
|
||||||
|
|
||||||
|
### Outdated versions
|
||||||
|
|
||||||
|
* @chriscdn/promise-semaphore
|
||||||
|
* Highest usable version is 3.1.3 because the author **dropped CJS** in 4.0.0.
|
||||||
|
* @stackoverflow/stacks
|
||||||
|
* Highest usable version is 2.9.0 (and 6.9.0 for stacks-icons) because the company **ruined their design** in 3.0.0.
|
||||||
|
* cross-env
|
||||||
|
* Highest usable version is 7.0.3 because the author **dropped CJS** in 10.0.0.
|
||||||
|
* entities
|
||||||
|
* Using version 5.0.0. The author messed things up in 6.0.0, started using LLMs in 7.0.0, and **dropped CJS** in 8.0.0.
|
||||||
|
* h3
|
||||||
|
* Using major version 1. Version 2 has been stuck as **release candidates for months**, and all the code comments are Claude.
|
||||||
|
* htmx.org
|
||||||
|
* Using major version 2. Version 4 exists, and **I'd be okay updating to it**, but the author changed a lot and the entire site would need to be re-tested.
|
||||||
|
|||||||
Generated
+263
-492
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -31,7 +31,7 @@
|
|||||||
"@stackoverflow/stacks": "^2.5.4",
|
"@stackoverflow/stacks": "^2.5.4",
|
||||||
"@stackoverflow/stacks-icons": "^6.0.2",
|
"@stackoverflow/stacks-icons": "^6.0.2",
|
||||||
"ansi-colors": "^4.1.3",
|
"ansi-colors": "^4.1.3",
|
||||||
"better-sqlite3": "^12.2.0",
|
"better-sqlite3": "^13.0.3",
|
||||||
"chunk-text": "^2.0.1",
|
"chunk-text": "^2.0.1",
|
||||||
"cloudstorm": "^0.19.0",
|
"cloudstorm": "^0.19.0",
|
||||||
"denque": "^2.1.0",
|
"denque": "^2.1.0",
|
||||||
@@ -41,10 +41,10 @@
|
|||||||
"entities": "^5.0.0",
|
"entities": "^5.0.0",
|
||||||
"get-relative-path": "^1.0.2",
|
"get-relative-path": "^1.0.2",
|
||||||
"h3": "^1.15.10",
|
"h3": "^1.15.10",
|
||||||
"heatsync": "^2.7.2",
|
"heatsync": "^3.3.0",
|
||||||
"htmx.org": "^2.0.4",
|
"htmx.org": "^2.0.4",
|
||||||
"lru-cache": "^11.0.2",
|
"lru-cache": "^11.0.2",
|
||||||
"mime-types": "^2.1.35",
|
"mime-types": "^3.0.2",
|
||||||
"prettier-bytes": "^1.0.4",
|
"prettier-bytes": "^1.0.4",
|
||||||
"sharp": "^0.35.3",
|
"sharp": "^0.35.3",
|
||||||
"snowtransfer": "^0.19.0",
|
"snowtransfer": "^0.19.0",
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@cloudrac3r/tap-dot": "^2.0.3",
|
"@cloudrac3r/tap-dot": "^2.0.3",
|
||||||
"@types/node": "^22.17.1",
|
"@types/node": "^22.17.1",
|
||||||
"c8": "^11.0.0",
|
"c8": "^12.0.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"supertape": "^13.2.0"
|
"supertape": "^13.2.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
const {createServer} = require("http")
|
|
||||||
const EventEmitter = require("events")
|
|
||||||
const {createApp, createRouter, toNodeListener} = require("h3")
|
|
||||||
const sqlite = require("better-sqlite3")
|
const sqlite = require("better-sqlite3")
|
||||||
const migrate = require("../src/db/migrate")
|
const migrate = require("../src/db/migrate")
|
||||||
const HeatSync = require("heatsync")
|
const HeatSync = require("heatsync")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
const assert = require("assert")
|
const assert = require("assert").strict
|
||||||
const {reg} = require("../../matrix/read-registration")
|
const {reg} = require("../../matrix/read-registration")
|
||||||
const Ty = require("../../types")
|
const Ty = require("../../types")
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
const assert = require("assert")
|
const assert = require("assert").strict
|
||||||
|
|
||||||
const {reg} = require("../../matrix/read-registration")
|
const {reg} = require("../../matrix/read-registration")
|
||||||
const userRegex = reg.namespaces.users.map(u => new RegExp(u.regex))
|
const userRegex = reg.namespaces.users.map(u => new RegExp(u.regex))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
const assert = require("assert")
|
const assert = require("assert").strict
|
||||||
const stream = require("stream")
|
const stream = require("stream")
|
||||||
const {PNG} = require("@cloudrac3r/pngjs")
|
const {PNG} = require("@cloudrac3r/pngjs")
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
const assert = require("assert")
|
const assert = require("assert").strict
|
||||||
const {reg} = require("../../matrix/read-registration")
|
const {reg} = require("../../matrix/read-registration")
|
||||||
const Ty = require("../../types")
|
const Ty = require("../../types")
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ function userToSimName(user) {
|
|||||||
|
|
||||||
// 1. Is sim user already registered?
|
// 1. Is sim user already registered?
|
||||||
const existing = select("sim", "user_id", {user_id: user.id}).pluck().get()
|
const existing = select("sim", "user_id", {user_id: user.id}).pluck().get()
|
||||||
assert.equal(existing, null, "Shouldn't try to create a new name for an existing sim")
|
assert.equal(existing, undefined, "Shouldn't try to create a new name for an existing sim")
|
||||||
|
|
||||||
// 2. Register based on username (could be new or old format)
|
// 2. Register based on username (could be new or old format)
|
||||||
// (Unless it's a special user, in which case copy their provided mappings.)
|
// (Unless it's a special user, in which case copy their provided mappings.)
|
||||||
@@ -113,7 +113,7 @@ function webhookAuthorToSimName(author) {
|
|||||||
// 1. Is sim user already registered?
|
// 1. Is sim user already registered?
|
||||||
const fakeUserID = webhookAuthorToFakeUserID(author)
|
const fakeUserID = webhookAuthorToFakeUserID(author)
|
||||||
const existing = select("sim", "user_id", {user_id: fakeUserID}).pluck().get()
|
const existing = select("sim", "user_id", {user_id: fakeUserID}).pluck().get()
|
||||||
assert.equal(existing, null, "Shouldn't try to create a new name for an existing sim")
|
assert.equal(existing, undefined, "Shouldn't try to create a new name for an existing sim")
|
||||||
|
|
||||||
// 2. Register based on username (could be new or old format)
|
// 2. Register based on username (could be new or old format)
|
||||||
const downcased = "webhook_" + downcaseUsername(author)
|
const downcased = "webhook_" + downcaseUsername(author)
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ async function onPacket(client, message, listen) {
|
|||||||
const firstReady = guildReadyStatus.allReady()
|
const firstReady = guildReadyStatus.allReady()
|
||||||
const lastGuildReady = guildReadyStatus.makeReady(message.d.id)
|
const lastGuildReady = guildReadyStatus.makeReady(message.d.id)
|
||||||
|
|
||||||
|
if (lastGuildReady) {
|
||||||
|
console.log(`ok, ${client.guilds.size} available.`)
|
||||||
|
}
|
||||||
|
|
||||||
const arr = []
|
const arr = []
|
||||||
client.guildChannelMap.set(message.d.id, arr)
|
client.guildChannelMap.set(message.d.id, arr)
|
||||||
for (const channel of message.d.channels || []) {
|
for (const channel of message.d.channels || []) {
|
||||||
@@ -93,7 +97,7 @@ async function onPacket(client, message, listen) {
|
|||||||
try {
|
try {
|
||||||
// Wait for guilds to be connected and homeserver to be online. If this is the last guild, a different code path is used to trigger the homeserver check.
|
// Wait for guilds to be connected and homeserver to be online. If this is the last guild, a different code path is used to trigger the homeserver check.
|
||||||
if (lastGuildReady) {
|
if (lastGuildReady) {
|
||||||
process.stdout.write(`ok, ${client.guilds.size} available.\nConnecting to homeserver... `)
|
process.stdout.write(`Connecting to homeserver... `)
|
||||||
// await guildReadyStatus.waitForAllReady() - no need, we already checked this is the last guild
|
// await guildReadyStatus.waitForAllReady() - no need, we already checked this is the last guild
|
||||||
await homeserverStatus.homeserverStatus.waitForOnline(true)
|
await homeserverStatus.homeserverStatus.waitForOnline(true)
|
||||||
console.log("ok.\nReplaying past events. Welcome to Out Of Your Element.")
|
console.log("ok.\nReplaying past events. Welcome to Out Of Your Element.")
|
||||||
|
|||||||
@@ -620,7 +620,7 @@ async function eventToMessage(event, guild, channel, di) {
|
|||||||
let filename = event.content.filename || event.content.body
|
let filename = event.content.filename || event.content.body
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
const extension = mimeTypes.extension(event.content.info?.mimetype)
|
const extension = mimeTypes.extension(event.content.info?.mimetype)
|
||||||
if (!extension) throw new Error("Filename and mimetype missing. Please report this bug to your client.")
|
assert(extension, "Filename and mimetype missing. Please report this bug to your client.")
|
||||||
filename = `file.${extension}`
|
filename = `file.${extension}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4816,6 +4816,39 @@ test("event2message: image attachments can have a formatted caption", async t =>
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("event2message: attachments have a generated filename if it was missing", async t => {
|
||||||
|
t.deepEqual(
|
||||||
|
await eventToMessage({
|
||||||
|
type: "m.room.message",
|
||||||
|
sender: "@cadence:cadence.moe",
|
||||||
|
content: {
|
||||||
|
body: "",
|
||||||
|
filename: "",
|
||||||
|
info: {
|
||||||
|
mimetype: "image/png",
|
||||||
|
size: 50832
|
||||||
|
},
|
||||||
|
msgtype: "m.image",
|
||||||
|
url: "mxc://agiadn.org/3SvzETkab3XBDM6HCMJxpOryIDxMO31j"
|
||||||
|
},
|
||||||
|
event_id: "$CXQy3Wmg1A-gL_xAesC1HQcQTEXwICLdSwwUx55FBTI",
|
||||||
|
room_id: "!BnKuBPCvyfOkhcUjEu:cadence.moe"
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
ensureJoined: [],
|
||||||
|
messagesToDelete: [],
|
||||||
|
messagesToEdit: [],
|
||||||
|
messagesToSend: [{
|
||||||
|
username: "cadence [they]",
|
||||||
|
content: "",
|
||||||
|
avatar_url: "https://bridge.example.org/download/matrix/cadence.moe/azCAhThKTojXSZJRoWwZmhvU?preset=avatar",
|
||||||
|
attachments: [{id: "0", filename: "file.png"}],
|
||||||
|
pendingFiles: [{name: "file.png", mxc: "mxc://agiadn.org/3SvzETkab3XBDM6HCMJxpOryIDxMO31j"}]
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
test("event2message: encrypted image attachments work", async t => {
|
test("event2message: encrypted image attachments work", async t => {
|
||||||
t.deepEqual(
|
t.deepEqual(
|
||||||
await eventToMessage({
|
await eventToMessage({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
const assert = require("assert")
|
const assert = require("assert").strict
|
||||||
const Denque = require("denque")
|
const Denque = require("denque")
|
||||||
const StateMachine = require("snowtransfer").StateMachine
|
const StateMachine = require("snowtransfer").StateMachine
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const {addbot} = require("../addbot")
|
|||||||
const passthrough = require("./passthrough")
|
const passthrough = require("./passthrough")
|
||||||
const {discord, sync, db, select, from, as} = passthrough
|
const {discord, sync, db, select, from, as} = passthrough
|
||||||
|
|
||||||
|
const reg = require("./matrix/read-registration")
|
||||||
const data = sync.require("../test/data")
|
const data = sync.require("../test/data")
|
||||||
const createSpace = sync.require("./d2m/actions/create-space")
|
const createSpace = sync.require("./d2m/actions/create-space")
|
||||||
const createRoom = sync.require("./d2m/actions/create-room")
|
const createRoom = sync.require("./d2m/actions/create-room")
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
const assert = require("assert")
|
const assert = require("assert").strict
|
||||||
const fs = require("fs")
|
const fs = require("fs")
|
||||||
const {join} = require("path")
|
const {join} = require("path")
|
||||||
const h3 = require("h3")
|
const h3 = require("h3")
|
||||||
|
|||||||
Reference in New Issue
Block a user