A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: update dependencies + node-modules polyfill tweaks + remove multiformats

+35 -32
+5
_config.ts
··· 1 1 import type { RequestHandler } from "lume/core/server.ts"; 2 + 3 + import { builtinModules } from "node:module"; 2 4 import { dotenvRun } from "@dotenv-run/esbuild"; 3 5 import lume from "lume/mod.ts"; 4 6 ··· 43 45 external: ["./file-tree.json"], 44 46 platform: "browser", 45 47 plugins: [ 48 + // @ts-ignore 46 49 dotenvRun({ 47 50 files: [".env"], 48 51 }), ··· 99 102 }, 100 103 }, 101 104 nodeModulesPolyfillPlugin({ 105 + fallback: "empty", 102 106 globals: { 103 107 process: true, 104 108 Buffer: true, 105 109 }, 110 + modules: builtinModules.filter((a) => !["crypto", "fs"].includes(a)), 106 111 }), 107 112 wasmLoader(), 108 113 ],
+19 -19
deno.jsonc
··· 4 4 "vendor": true, 5 5 "imports": { 6 6 "98.css": "npm:98.css@^0.1.21", 7 - "@atcute/cbor": "npm:@atcute/cbor@^2.3.0", 8 - "@atcute/tid": "npm:@atcute/tid@^1.0.0", 7 + "@atcute/cbor": "npm:@atcute/cbor@^2.3.2", 8 + "@atcute/cid": "npm:@atcute/cid@^2.4.1", 9 + "@atcute/tid": "npm:@atcute/tid@^1.1.2", 9 10 "@atcute/client": "npm:@atcute/client@^4.2.1", 10 11 "@atcute/identity-resolver": "npm:@atcute/identity-resolver@^1.2.2", 11 - "@atcute/lexicons": "npm:@atcute/lexicons@^1.2.7", 12 + "@atcute/lexicons": "npm:@atcute/lexicons@^1.2.9", 12 13 "@atcute/oauth-browser-client": "npm:@atcute/oauth-browser-client@^3.0.0", 13 - "@automerge/automerge": "npm:@automerge/automerge@^3.2.3", 14 - "@awesome.me/webawesome": "npm:@awesome.me/webawesome@^3.2.1", 14 + "@atcute/uint8array": "npm:@atcute/uint8array@^1.1.1", 15 + "@automerge/automerge": "npm:@automerge/automerge@^3.2.4", 16 + "@awesome.me/webawesome": "npm:@awesome.me/webawesome@^3.3.1", 15 17 "@bradenmacdonald/s3-lite-client": "jsr:@bradenmacdonald/s3-lite-client@^0.9.5", 16 18 "@cloudradio/icy-parser": "jsr:@cloudradio/icy-parser@^1.0.2", 17 19 "@char/cbor": "jsr:@char/cbor@^0.1.4", 18 - "@codemirror/autocomplete": "npm:@codemirror/autocomplete@^6.20.0", 20 + "@codemirror/autocomplete": "npm:@codemirror/autocomplete@^6.20.1", 19 21 "@codemirror/lang-css": "npm:@codemirror/lang-css@^6.3.1", 20 22 "@codemirror/lang-html": "npm:@codemirror/lang-html@^6.4.11", 21 - "@codemirror/lang-javascript": "npm:@codemirror/lang-javascript@^6.2.4", 23 + "@codemirror/lang-javascript": "npm:@codemirror/lang-javascript@^6.2.5", 22 24 "@fcrozatier/htmlcrunch": "jsr:@fcrozatier/htmlcrunch@^1.5.1", 23 25 "@fry69/deep-diff": "jsr:@fry69/deep-diff@^0.1.10", 24 26 "@js-temporal/polyfill": "npm:@js-temporal/polyfill@^0.5.1", ··· 37 39 "fast-uri": "npm:fast-uri@^3.1.0", 38 40 "idb-keyval": "npm:idb-keyval@^6.2.2", 39 41 "iso-base": "npm:iso-base@^4.3.0", 40 - "lit-html": "npm:lit-html@^3.3.1", 41 - "marked": "npm:marked@^17.0.3", 42 - "multiformats": "npm:multiformats@^13.4.2", 42 + "lit-html": "npm:lit-html@^3.3.2", 43 + "marked": "npm:marked@^17.0.4", 43 44 "query-string": "npm:query-string@^9.3.1", 44 45 "subsonic-api": "npm:subsonic-api@^3.2.0", 45 46 "throttle-debounce": "npm:throttle-debounce@^5.0.2", ··· 48 49 49 50 // music-metadata 50 51 "@tokenizer/http": "npm:@tokenizer/http@^0.9.2", 51 - "@tokenizer/range": "npm:@tokenizer/range@^0.13.0", 52 - "music-metadata": "npm:music-metadata@^11.10.6", 52 + "@tokenizer/range": "npm:@tokenizer/range@^0.13.1", 53 + "music-metadata": "npm:music-metadata@^11.12.2", 53 54 54 55 // Build 55 56 "@atcute/lex-cli": "npm:@atcute/lex-cli@^2.5.3", 56 57 "@dotenv-run/esbuild": "npm:@dotenv-run/esbuild@^1.5.1", 57 - "@std/fs": "jsr:@std/fs@^1.0.19", 58 - "@std/path": "jsr:@std/path@^1.1.2", 58 + "@std/fs": "jsr:@std/fs@^1.0.23", 59 + "@std/path": "jsr:@std/path@^1.1.4", 59 60 "@types/wicg-file-system-access": "npm:@types/wicg-file-system-access@^2023.10.7", 60 61 "esbuild-plugins-node-modules-polyfill": "npm:esbuild-plugins-node-modules-polyfill@^1.8.1", 61 62 "esbuild-plugin-wasm": "npm:esbuild-plugin-wasm@^1.1.0", 62 - "lume/": "https://cdn.jsdelivr.net/gh/lumeland/lume@3.1.4/", 63 + "lume/": "https://cdn.jsdelivr.net/gh/lumeland/lume@3.2.2/", 63 64 "lume/jsx-runtime": "https://cdn.jsdelivr.net/gh/oscarotero/ssx@0.1.14/jsx-runtime.ts", 64 65 65 66 // Tests 66 - "@astral/astral": "jsr:@astral/astral", 67 - "@std/expect": "jsr:@std/expect", 68 - "@std/testing/bdd": "jsr:@std/testing/bdd", 67 + "@astral/astral": "jsr:@astral/astral@0.5.5", 68 + "@std/expect": "jsr:@std/expect@1.0.18", 69 + "@std/testing/bdd": "jsr:@std/testing@1.0.17/bdd", 69 70 70 71 // Paths 71 72 "~/": "./src/", 72 73 73 - "@testing/": "./src/testing/", 74 74 "@tests/": "./tests/", 75 75 }, 76 76 "exports": {
+11 -13
src/common/cid.js
··· 1 - import { equals } from "iso-base/utils"; 2 - import { CID } from "multiformats/cid"; 3 - import { sha256 } from "multiformats/hashes/sha2"; 1 + import * as CID from "@atcute/cid"; 2 + import { equals, toSha256 } from "@atcute/uint8array"; 4 3 5 4 /** 6 - * @param {number} code 7 - * @param {Uint8Array} data 5 + * @param {0x55 | 0x71} code 6 + * @param {Uint8Array<any>} data 8 7 */ 9 8 export async function create(code, data) { 10 - const hash = await sha256.digest(data); 11 - const cid = CID.create(1, code, hash); 12 - 13 - return cid.toString(); 9 + const cid = await CID.create(code, data); 10 + return CID.toString(cid); 14 11 } 15 12 16 13 /** 17 - * @param {Uint8Array} data 14 + * @param {Uint8Array<any>} data 18 15 * @param {string} expected 19 16 */ 20 17 export async function verify(data, expected) { 21 - const expectedCid = CID.parse(expected); 22 - const hash = await sha256.digest(data); 23 - return equals(expectedCid.multihash.bytes, hash.bytes); 18 + const expectedCid = CID.fromString(expected); 19 + const digest = await toSha256(data); 20 + 21 + return equals(digest, expectedCid.digest.contents); 24 22 }