From e5c8030960a3cab32fe32ca3c958e37cf2455ca9 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 1 May 2024 16:29:21 -0500 Subject: [PATCH] Move more deps to aliases --- deno.json | 4 ++++ deno.lock | 33 +++++++++++++++++++++++++++++++++ src/deps.ts | 4 ---- src/filter.ts | 2 +- src/storages/reqmeister.ts | 2 +- src/uploaders/s3.ts | 2 +- src/utils/SimpleLRU.ts | 2 +- src/utils/rsa.ts | 4 +++- 8 files changed, 44 insertions(+), 9 deletions(-) diff --git a/deno.json b/deno.json index 9bcdba98..b59d2eaa 100644 --- a/deno.json +++ b/deno.json @@ -15,6 +15,7 @@ "exclude": ["./public"], "imports": { "@/": "./src/", + "@bradenmacdonald/s3-lite-client": "jsr:@bradenmacdonald/s3-lite-client@^0.7.4", "@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.15.0", "@sentry/deno": "https://deno.land/x/sentry@7.112.2/index.mjs", "@soapbox/kysely-deno-sqlite": "jsr:@soapbox/kysely-deno-sqlite@^2.0.2", @@ -27,15 +28,18 @@ "@std/media-types": "jsr:@std/media-types@^0.224.0", "@std/streams": "jsr:@std/streams@^0.223.0", "comlink": "npm:comlink@^4.4.1", + "fast-stable-stringify": "npm:fast-stable-stringify@^1.0.0", "hono": "https://deno.land/x/hono@v3.10.1/mod.ts", "hono/middleware": "https://deno.land/x/hono@v3.10.1/middleware.ts", "iso-639-1": "npm:iso-639-1@2.1.15", "kysely": "npm:kysely@^0.27.3", "kysely_deno_postgres": "https://deno.land/x/kysely_deno_postgres@v0.4.0/mod.ts", + "lru-cache": "npm:lru-cache@^10.2.2", "nostr-relaypool": "npm:nostr-relaypool2@0.6.34", "nostr-tools": "npm:nostr-tools@^2.5.1", "nostr-wasm": "npm:nostr-wasm@^0.1.0", "tldts": "npm:tldts@^6.0.14", + "tseep": "npm:tseep@^1.2.1", "type-fest": "npm:type-fest@^4.3.0", "uuid62": "npm:uuid62@^1.0.2", "zod": "npm:zod@^3.23.4", diff --git a/deno.lock b/deno.lock index e948e583..bb494f5c 100644 --- a/deno.lock +++ b/deno.lock @@ -2,13 +2,17 @@ "version": "3", "packages": { "specifiers": { + "jsr:@bradenmacdonald/s3-lite-client@^0.7.4": "jsr:@bradenmacdonald/s3-lite-client@0.7.4", "jsr:@nostrify/nostrify@^0.15.0": "jsr:@nostrify/nostrify@0.15.0", "jsr:@soapbox/kysely-deno-sqlite@^2.0.2": "jsr:@soapbox/kysely-deno-sqlite@2.0.2", "jsr:@soapbox/stickynotes@^0.4.0": "jsr:@soapbox/stickynotes@0.4.0", + "jsr:@std/assert@^0.218.2": "jsr:@std/assert@0.218.2", "jsr:@std/assert@^0.224.0": "jsr:@std/assert@0.224.0", + "jsr:@std/bytes@^0.218.2": "jsr:@std/bytes@0.218.2", "jsr:@std/crypto@^0.224.0": "jsr:@std/crypto@0.224.0", "jsr:@std/dotenv@^0.224.0": "jsr:@std/dotenv@0.224.0", "jsr:@std/encoding@^0.224.0": "jsr:@std/encoding@0.224.0", + "jsr:@std/io@^0.218": "jsr:@std/io@0.218.2", "jsr:@std/media-types@^0.224.0": "jsr:@std/media-types@0.224.0", "npm:@isaacs/ttlcache@^1.4.1": "npm:@isaacs/ttlcache@1.4.1", "npm:@noble/hashes@^1.4.0": "npm:@noble/hashes@1.4.0", @@ -32,6 +36,7 @@ "npm:linkify-string@^4.1.1": "npm:linkify-string@4.1.3_linkifyjs@4.1.3", "npm:linkifyjs@^4.1.1": "npm:linkifyjs@4.1.3", "npm:lru-cache@^10.2.0": "npm:lru-cache@10.2.0", + "npm:lru-cache@^10.2.2": "npm:lru-cache@10.2.2", "npm:mime@^3.0.0": "npm:mime@3.0.0", "npm:node-forge@^1.3.1": "npm:node-forge@1.3.1", "npm:nostr-relaypool2@0.6.34": "npm:nostr-relaypool2@0.6.34", @@ -42,6 +47,7 @@ "npm:sanitize-html@^2.11.0": "npm:sanitize-html@2.13.0", "npm:tldts@^6.0.14": "npm:tldts@6.1.18", "npm:tseep@^1.1.3": "npm:tseep@1.2.1", + "npm:tseep@^1.2.1": "npm:tseep@1.2.1", "npm:type-fest@^4.3.0": "npm:type-fest@4.15.0", "npm:unfurl.js@^6.4.0": "npm:unfurl.js@6.4.0", "npm:uuid62@^1.0.2": "npm:uuid62@1.0.2", @@ -50,6 +56,12 @@ "npm:zod@^3.23.4": "npm:zod@3.23.4" }, "jsr": { + "@bradenmacdonald/s3-lite-client@0.7.4": { + "integrity": "602666ef40d09621d35aa3ea8813e0bfd58b3558e3f0a1d20404b0e61aa0b37e", + "dependencies": [ + "jsr:@std/io@^0.218" + ] + }, "@nostrify/nostrify@0.15.0": { "integrity": "51c2fe9ac7264d22567cd1919a5bf5101a5207f651e65bc00b3de43f9038dfc8", "dependencies": [ @@ -73,9 +85,15 @@ "@soapbox/stickynotes@0.4.0": { "integrity": "60bfe61ab3d7e04bf708273b1e2d391a59534bdf29e54160e98d7afd328ca1ec" }, + "@std/assert@0.218.2": { + "integrity": "7f0a5a1a8cf86607cd6c2c030584096e1ffad27fc9271429a8cb48cfbdee5eaf" + }, "@std/assert@0.224.0": { "integrity": "8643233ec7aec38a940a8264a6e3eed9bfa44e7a71cc6b3c8874213ff401967f" }, + "@std/bytes@0.218.2": { + "integrity": "91fe54b232dcca73856b79a817247f4a651dbb60d51baafafb6408c137241670" + }, "@std/crypto@0.224.0": { "integrity": "154ef3ff08ef535562ef1a718718c5b2c5fc3808f0f9100daad69e829bfcdf2d", "dependencies": [ @@ -89,6 +107,13 @@ "@std/encoding@0.224.0": { "integrity": "efb6dca97d3e9c31392bd5c8cfd9f9fc9decf5a1f4d1f78af7900a493bcf89b5" }, + "@std/io@0.218.2": { + "integrity": "c64fbfa087b7c9d4d386c5672f291f607d88cb7d44fc299c20c713e345f2785f", + "dependencies": [ + "jsr:@std/assert@^0.218.2", + "jsr:@std/bytes@^0.218.2" + ] + }, "@std/media-types@0.224.0": { "integrity": "5ac87989393f8cb1c81bee02aef6f5d4c8289b416deabc04f9ad25dff292d0b0" } @@ -686,6 +711,10 @@ "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", "dependencies": {} }, + "lru-cache@10.2.2": { + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "dependencies": {} + }, "lru-cache@6.0.0": { "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dependencies": { @@ -1502,6 +1531,7 @@ }, "workspace": { "dependencies": [ + "jsr:@bradenmacdonald/s3-lite-client@^0.7.4", "jsr:@nostrify/nostrify@^0.15.0", "jsr:@soapbox/kysely-deno-sqlite@^2.0.2", "jsr:@soapbox/stickynotes@^0.4.0", @@ -1513,12 +1543,15 @@ "jsr:@std/media-types@^0.224.0", "jsr:@std/streams@^0.223.0", "npm:comlink@^4.4.1", + "npm:fast-stable-stringify@^1.0.0", "npm:iso-639-1@2.1.15", "npm:kysely@^0.27.3", + "npm:lru-cache@^10.2.2", "npm:nostr-relaypool2@0.6.34", "npm:nostr-tools@^2.5.1", "npm:nostr-wasm@^0.1.0", "npm:tldts@^6.0.14", + "npm:tseep@^1.2.1", "npm:type-fest@^4.3.0", "npm:uuid62@^1.0.2", "npm:zod@^3.23.4" diff --git a/src/deps.ts b/src/deps.ts index d643515b..ae268f53 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -21,13 +21,9 @@ export { } from 'https://gitlab.com/soapbox-pub/fedisign/-/raw/v0.2.1/mod.ts'; export { generateSeededRsa } from 'https://gitlab.com/soapbox-pub/seeded-rsa/-/raw/v1.0.0/mod.ts'; export * as secp from 'npm:@noble/secp256k1@^2.0.0'; -export { LRUCache } from 'npm:lru-cache@^10.2.0'; export { DB as Sqlite, SqliteError, } from 'https://raw.githubusercontent.com/alexgleason/deno-sqlite/325f66d8c395e7f6f5ee78ebfa42a0eeea4a942b/mod.ts'; export { Database as DenoSqlite3 } from 'https://deno.land/x/sqlite3@0.9.1/mod.ts'; export * as cron from 'https://deno.land/x/deno_cron@v1.0.0/cron.ts'; -export { S3Client } from 'https://deno.land/x/s3_lite_client@0.6.1/mod.ts'; -export { default as IpfsHash } from 'npm:ipfs-only-hash@^4.0.0'; -export { default as stringifyStable } from 'npm:fast-stable-stringify@^1.0.0'; diff --git a/src/filter.ts b/src/filter.ts index 9e99c4a7..3bb18a63 100644 --- a/src/filter.ts +++ b/src/filter.ts @@ -1,7 +1,7 @@ import { NostrEvent, NostrFilter } from '@nostrify/nostrify'; +import { stringifyStable } from 'fast-stable-stringify'; import { z } from 'zod'; -import { stringifyStable } from '@/deps.ts'; import { isReplaceableKind } from '@/kinds.ts'; import { nostrIdSchema } from '@/schemas/nostr.ts'; diff --git a/src/storages/reqmeister.ts b/src/storages/reqmeister.ts index a385ec9b..eede2007 100644 --- a/src/storages/reqmeister.ts +++ b/src/storages/reqmeister.ts @@ -1,7 +1,7 @@ import { NostrEvent, NostrFilter, NStore } from '@nostrify/nostrify'; import Debug from '@soapbox/stickynotes/debug'; +import { EventEmitter } from 'tseep'; -import { EventEmitter } from '@/deps.ts'; import { eventToMicroFilter, getFilterId, isMicrofilter, type MicroFilter } from '@/filter.ts'; import { Time } from '@/utils/time.ts'; import { abortError } from '@/utils/abort.ts'; diff --git a/src/uploaders/s3.ts b/src/uploaders/s3.ts index 29f3043f..267d8172 100644 --- a/src/uploaders/s3.ts +++ b/src/uploaders/s3.ts @@ -1,11 +1,11 @@ import { join } from 'node:path'; +import { S3Client } from '@bradenmacdonald/s3-lite-client'; import { crypto } from '@std/crypto'; import { encodeHex } from '@std/encoding/hex'; import { extensionsByType } from '@std/media-types'; import { Conf } from '@/config.ts'; -import { S3Client } from '@/deps.ts'; import type { Uploader } from './types.ts'; diff --git a/src/utils/SimpleLRU.ts b/src/utils/SimpleLRU.ts index 26f51fc6..f1bf6512 100644 --- a/src/utils/SimpleLRU.ts +++ b/src/utils/SimpleLRU.ts @@ -1,6 +1,6 @@ // deno-lint-ignore-file ban-types -import { LRUCache } from '@/deps.ts'; +import { LRUCache } from 'lru-cache'; type FetchFn = (key: K, opts: O) => Promise; diff --git a/src/utils/rsa.ts b/src/utils/rsa.ts index 9155a729..0d3a5882 100644 --- a/src/utils/rsa.ts +++ b/src/utils/rsa.ts @@ -1,5 +1,7 @@ +import { LRUCache } from 'lru-cache'; + import { Conf } from '@/config.ts'; -import { generateSeededRsa, LRUCache, publicKeyToPem, secp } from '@/deps.ts'; +import { generateSeededRsa, publicKeyToPem, secp } from '@/deps.ts'; const opts = { bits: 2048,