From a341e1adc54122e8006167db790aac6c7fa03724 Mon Sep 17 00:00:00 2001 From: buttercat1791 Date: Tue, 27 Aug 2024 00:14:55 -0500 Subject: Update NDK and ensure feed and article read works --- package.json | 4 +- pnpm-lock.yaml | 82 +++++++++++++++++++++++++---------------- src/lib/Article.svelte | 17 ++++++--- src/lib/components/Login.svelte | 21 ++++++++--- src/lib/consts.ts | 2 +- src/lib/ndk.ts | 10 +++-- src/routes/+page.svelte | 66 ++++++++++++++++++++------------- 7 files changed, 128 insertions(+), 74 deletions(-) diff --git a/package.json b/package.json index d3b92a9..c75da1d 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "format": "prettier --plugin-search-dir . --write ." }, "dependencies": { - "@nostr-dev-kit/ndk": "^2.3.3", - "@nostr-dev-kit/ndk-cache-dexie": "^2.2.4", + "@nostr-dev-kit/ndk": "^2.10.0", + "@nostr-dev-kit/ndk-cache-dexie": "^2.5.1", "@popperjs/core": "^2.11.8", "@sveltejs/vite-plugin-svelte": "^3.0.1", "@tailwindcss/forms": "^0.5.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6597df2..1f05af9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,11 +9,11 @@ importers: .: dependencies: '@nostr-dev-kit/ndk': - specifier: ^2.3.3 - version: 2.3.3(typescript@5.3.3) + specifier: ^2.10.0 + version: 2.10.0(typescript@5.3.3) '@nostr-dev-kit/ndk-cache-dexie': - specifier: ^2.2.4 - version: 2.2.4(typescript@5.3.3) + specifier: ^2.5.1 + version: 2.5.1(typescript@5.3.3) '@popperjs/core': specifier: ^2.11.8 version: 2.11.8 @@ -327,12 +327,18 @@ packages: '@noble/ciphers@0.2.0': resolution: {integrity: sha512-6YBxJDAapHSdd3bLDv6x2wRPwq4QFMUaB3HvljNBUTThDd12eSm7/3F+2lnfzx2jvM+S6Nsy0jEt9QbPqSwqRw==} + '@noble/ciphers@0.5.3': + resolution: {integrity: sha512-B0+6IIHiqEs3BPMT0hcRmHvEj2QHOLu+uwt+tqDDeVd0oyVzh7BPrDcPjRnV1PV/5LaknXJJQvOuRGR0zQJz+w==} + '@noble/curves@1.1.0': resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==} '@noble/curves@1.2.0': resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + '@noble/curves@1.5.0': + resolution: {integrity: sha512-J5EKamIHnKPyClwVrzmaf5wSdQXgdHcPZIZLu3bwnbeCx8/7NPK5q2ZBWF+5FvYGByjiQQsJYX6jfgB2wDPn3A==} + '@noble/hashes@1.3.1': resolution: {integrity: sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==} engines: {node: '>= 16'} @@ -345,6 +351,10 @@ packages: resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} engines: {node: '>= 16'} + '@noble/hashes@1.4.0': + resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} + engines: {node: '>= 16'} + '@noble/secp256k1@2.0.0': resolution: {integrity: sha512-rUGBd95e2a45rlmFTqQJYEFA4/gdIARFfuTuTqLglz0PZ6AKyzyXsEZZq7UZn8hZsvaBgpCzKKBJizT2cJERXw==} @@ -360,11 +370,12 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@nostr-dev-kit/ndk-cache-dexie@2.2.4': - resolution: {integrity: sha512-HPdA+YnGrbNuXuqvGf1KpRoDo2avaqvJLlRE1iH8W8Yp45T8efJV9/UmT/OU7YgIoeL6k0y5F1zOCLu4P3pJSg==} + '@nostr-dev-kit/ndk-cache-dexie@2.5.1': + resolution: {integrity: sha512-tUwEy68bd9GL5JVuZIjcpdwuDEBnaXen3WJ64/GRDtbyE1RB01Y6hHC7IQC9bcQ6SC7XBGyPd+2nuTyR7+Mffg==} - '@nostr-dev-kit/ndk@2.3.3': - resolution: {integrity: sha512-R2r6U1Xt4B7yygQFgTEexNqhuQQrbJ0Kxh4GvcCgNgSjMI+cPJQPWg4g4noWGRnaWf4epqLNCblfo5UfMuijTw==} + '@nostr-dev-kit/ndk@2.10.0': + resolution: {integrity: sha512-TqCAAo6ylORraAXrzRkCGFN2xTMiFbdER8Y8CtUT0HwOpFG/Wn+PBNeDeDmqkl/6LaPdeyXmVwCWj2KcUjIwYA==} + engines: {node: '>=16'} '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} @@ -753,9 +764,8 @@ packages: devalue@4.3.2: resolution: {integrity: sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==} - dexie@3.2.4: - resolution: {integrity: sha512-VKoTQRSv7+RnffpOJ3Dh6ozknBqzWw/F3iqMdsZg958R0AS8AnY9x9d1lbwENr0gzeGJHXKcGhAMRaqys6SxqA==} - engines: {node: '>=6.0'} + dexie@4.0.8: + resolution: {integrity: sha512-1G6cJevS17KMDK847V3OHvK2zei899GwpDiqfEXHP1ASvme6eWJmAp9AU4s1son2TeGkWmC0g3y8ezOBPnalgQ==} didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -1329,16 +1339,16 @@ packages: resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} engines: {node: '>=0.10.0'} - nostr-tools@1.17.0: - resolution: {integrity: sha512-LZmR8GEWKZeElbFV5Xte75dOeE9EFUW/QLI1Ncn3JKn0kFddDKEfBbFN8Mu4TMs+L4HR/WTPha2l+PPuRnJcMw==} + nostr-tools@2.1.4: + resolution: {integrity: sha512-MX4gU1gJYP2PKdlLwveHhZIJi/k0qp+ZKwGB7gMFkUodJs4V1OX18Cteb+vxFngtD0B5LlCzLn+ml6tzwlKXFA==} peerDependencies: typescript: '>=5.0.0' peerDependenciesMeta: typescript: optional: true - nostr-tools@2.1.4: - resolution: {integrity: sha512-MX4gU1gJYP2PKdlLwveHhZIJi/k0qp+ZKwGB7gMFkUodJs4V1OX18Cteb+vxFngtD0B5LlCzLn+ml6tzwlKXFA==} + nostr-tools@2.7.2: + resolution: {integrity: sha512-Bq3Ug0SZFtgtL1+0wCnAe8AJtI7yx/00/a2nUug9SkhfOwlKS92Tef12iCK9FdwXw+oFZWMtRnSwcLayQso+xA==} peerDependencies: typescript: '>=5.0.0' peerDependenciesMeta: @@ -2131,6 +2141,8 @@ snapshots: '@noble/ciphers@0.2.0': {} + '@noble/ciphers@0.5.3': {} + '@noble/curves@1.1.0': dependencies: '@noble/hashes': 1.3.1 @@ -2139,12 +2151,18 @@ snapshots: dependencies: '@noble/hashes': 1.3.2 + '@noble/curves@1.5.0': + dependencies: + '@noble/hashes': 1.4.0 + '@noble/hashes@1.3.1': {} '@noble/hashes@1.3.2': {} '@noble/hashes@1.3.3': {} + '@noble/hashes@1.4.0': {} + '@noble/secp256k1@2.0.0': {} '@nodelib/fs.scandir@2.1.5': @@ -2159,26 +2177,27 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@nostr-dev-kit/ndk-cache-dexie@2.2.4(typescript@5.3.3)': + '@nostr-dev-kit/ndk-cache-dexie@2.5.1(typescript@5.3.3)': dependencies: - '@nostr-dev-kit/ndk': 2.3.3(typescript@5.3.3) + '@nostr-dev-kit/ndk': 2.10.0(typescript@5.3.3) debug: 4.3.4 - dexie: 3.2.4 - nostr-tools: 1.17.0(typescript@5.3.3) + dexie: 4.0.8 + nostr-tools: 2.7.2(typescript@5.3.3) typescript-lru-cache: 2.0.0 transitivePeerDependencies: - supports-color - typescript - '@nostr-dev-kit/ndk@2.3.3(typescript@5.3.3)': + '@nostr-dev-kit/ndk@2.10.0(typescript@5.3.3)': dependencies: - '@noble/hashes': 1.3.3 + '@noble/curves': 1.5.0 + '@noble/hashes': 1.4.0 '@noble/secp256k1': 2.0.0 '@scure/base': 1.1.5 debug: 4.3.4 light-bolt11-decoder: 3.0.0 node-fetch: 3.3.2 - nostr-tools: 1.17.0(typescript@5.3.3) + nostr-tools: 2.7.2(typescript@5.3.3) tseep: 1.2.1 typescript-lru-cache: 2.0.0 utf8-buffer: 1.0.0 @@ -2240,13 +2259,13 @@ snapshots: '@scure/bip32@1.3.1': dependencies: '@noble/curves': 1.1.0 - '@noble/hashes': 1.3.1 - '@scure/base': 1.1.1 + '@noble/hashes': 1.3.3 + '@scure/base': 1.1.5 '@scure/bip39@1.2.1': dependencies: - '@noble/hashes': 1.3.1 - '@scure/base': 1.1.1 + '@noble/hashes': 1.3.3 + '@scure/base': 1.1.5 '@sveltejs/adapter-auto@3.1.1(@sveltejs/kit@2.4.3(@sveltejs/vite-plugin-svelte@3.0.1(svelte@4.2.9)(vite@5.0.12))(svelte@4.2.9)(vite@5.0.12))': dependencies: @@ -2565,7 +2584,7 @@ snapshots: devalue@4.3.2: {} - dexie@3.2.4: {} + dexie@4.0.8: {} didyoumean@1.2.2: {} @@ -3168,20 +3187,21 @@ snapshots: normalize-range@0.1.2: {} - nostr-tools@1.17.0(typescript@5.3.3): + nostr-tools@2.1.4(typescript@5.3.3): dependencies: '@noble/ciphers': 0.2.0 - '@noble/curves': 1.1.0 + '@noble/curves': 1.2.0 '@noble/hashes': 1.3.1 '@scure/base': 1.1.1 '@scure/bip32': 1.3.1 '@scure/bip39': 1.2.1 optionalDependencies: + nostr-wasm: 0.1.0 typescript: 5.3.3 - nostr-tools@2.1.4(typescript@5.3.3): + nostr-tools@2.7.2(typescript@5.3.3): dependencies: - '@noble/ciphers': 0.2.0 + '@noble/ciphers': 0.5.3 '@noble/curves': 1.2.0 '@noble/hashes': 1.3.1 '@scure/base': 1.1.1 diff --git a/src/lib/Article.svelte b/src/lib/Article.svelte index 96213e6..caa28ed 100644 --- a/src/lib/Article.svelte +++ b/src/lib/Article.svelte @@ -18,11 +18,18 @@ } const eventIds = index!.getMatchingTags('e').map((value) => value[1]); - const events = await $ndk.fetchEvents({ - // @ts-ignore - kinds: zettelKinds, - ids: eventIds, - }); + const events = await $ndk.fetchEvents( + { + // @ts-ignore + kinds: zettelKinds, + ids: eventIds, + }, + { + groupable: false, + skipVerification: false, + skipValidation: false + } + ); console.debug(`Fetched ${events.size} events from ${eventIds.length} references.`); return events; diff --git a/src/lib/components/Login.svelte b/src/lib/components/Login.svelte index c5df8a9..6ce939e 100644 --- a/src/lib/components/Login.svelte +++ b/src/lib/components/Login.svelte @@ -1,9 +1,18 @@ -- cgit