diff --git a/deno.json b/deno.json index b59d2ea..0199621 100644 --- a/deno.json +++ b/deno.json @@ -16,6 +16,7 @@ "imports": { "@/": "./src/", "@bradenmacdonald/s3-lite-client": "jsr:@bradenmacdonald/s3-lite-client@^0.7.4", + "@isaacs/ttlcache": "npm:@isaacs/ttlcache@^1.4.1", "@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", @@ -34,6 +35,9 @@ "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", + "linkify-plugin-hashtag": "npm:linkify-plugin-hashtag@^4.1.1", + "linkify-string": "npm:linkify-string@^4.1.1", + "linkifyjs": "npm:linkifyjs@^4.1.1", "lru-cache": "npm:lru-cache@^10.2.2", "nostr-relaypool": "npm:nostr-relaypool2@0.6.34", "nostr-tools": "npm:nostr-tools@^2.5.1", @@ -41,6 +45,7 @@ "tldts": "npm:tldts@^6.0.14", "tseep": "npm:tseep@^1.2.1", "type-fest": "npm:type-fest@^4.3.0", + "unfurl": "npm:unfurl.js@^6.4.0", "uuid62": "npm:uuid62@^1.0.2", "zod": "npm:zod@^3.23.4", "~/fixtures/": "./fixtures/" diff --git a/deno.lock b/deno.lock index bb494f5..9cf2645 100644 --- a/deno.lock +++ b/deno.lock @@ -1542,10 +1542,14 @@ "jsr:@std/json@^0.223.0", "jsr:@std/media-types@^0.224.0", "jsr:@std/streams@^0.223.0", + "npm:@isaacs/ttlcache@^1.4.1", "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:linkify-plugin-hashtag@^4.1.1", + "npm:linkify-string@^4.1.1", + "npm:linkifyjs@^4.1.1", "npm:lru-cache@^10.2.2", "npm:nostr-relaypool2@0.6.34", "npm:nostr-tools@^2.5.1", @@ -1553,6 +1557,7 @@ "npm:tldts@^6.0.14", "npm:tseep@^1.2.1", "npm:type-fest@^4.3.0", + "npm:unfurl.js@^6.4.0", "npm:uuid62@^1.0.2", "npm:zod@^3.23.4" ] diff --git a/src/deps.ts b/src/deps.ts index ae268f5..2eb367f 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -2,16 +2,10 @@ import 'https://gitlab.com/soapbox-pub/deno-safe-fetch/-/raw/v1.0.0/load.ts'; export { parseFormData } from 'npm:formdata-helper@^0.3.0'; // @deno-types="npm:@types/lodash@4.14.194" export { default as lodash } from 'https://esm.sh/lodash@4.17.21'; -export { default as linkify } from 'npm:linkifyjs@^4.1.1'; -export { default as linkifyStr } from 'npm:linkify-string@^4.1.1'; -import 'npm:linkify-plugin-hashtag@^4.1.1'; // @deno-types="npm:@types/mime@3.0.0" export { default as mime } from 'npm:mime@^3.0.0'; -export { unfurl } from 'npm:unfurl.js@^6.4.0'; -export { default as TTLCache } from 'npm:@isaacs/ttlcache@^1.4.1'; // @deno-types="npm:@types/sanitize-html@2.9.0" export { default as sanitizeHtml } from 'npm:sanitize-html@^2.11.0'; -export { createPentagon } from 'https://deno.land/x/pentagon@v0.1.4/mod.ts'; export { type ParsedSignature, pemToPublicKey, diff --git a/src/note.ts b/src/note.ts index fe03d7f..5603c53 100644 --- a/src/note.ts +++ b/src/note.ts @@ -1,7 +1,10 @@ +import 'linkify-plugin-hashtag'; +import linkifyStr from 'linkify-string'; +import linkify from 'linkifyjs'; import { nip19, nip21 } from 'nostr-tools'; import { Conf } from '@/config.ts'; -import { linkify, linkifyStr, mime } from '@/deps.ts'; +import { mime } from '@/deps.ts'; import { type DittoAttachment } from '@/views/mastodon/attachments.ts'; linkify.registerCustomProtocol('nostr', true); diff --git a/src/utils/unfurl.ts b/src/utils/unfurl.ts index bde5561..22c69b1 100644 --- a/src/utils/unfurl.ts +++ b/src/utils/unfurl.ts @@ -1,6 +1,8 @@ +import TTLCache from '@isaacs/ttlcache'; import Debug from '@soapbox/stickynotes/debug'; +import { unfurl } from 'unfurl'; -import { sanitizeHtml, TTLCache, unfurl } from '@/deps.ts'; +import { sanitizeHtml } from '@/deps.ts'; import { Time } from '@/utils/time.ts'; import { fetchWorker } from '@/workers/fetch.ts';