From e9fd0287cf417ce8b107767ad27cae6b9f18beef Mon Sep 17 00:00:00 2001 From: Ewan Croft Date: Mon, 10 Aug 2026 06:09:37 +0100 Subject: [PATCH] fix: resolve test/typecheck failures across workspace - svelte-standard-site: fix convertSidenotes emitting triple newlines by removing surrounding \\n from replacement string (divs are already surrounded by blank lines) - noise/noise-avatar: add explicit target/lib/module to tsconfig - bismuth: declare __BISMUTH_VERSION__ global for tsc --noEmit - tid: remove dead test script referencing nonexistent dist - tangled-sync: fix null type errors and Record cast for tsc --- packages/bismuth/src/global.d.ts | 5 +++++ packages/noise-avatar/tsconfig.json | 3 +++ packages/noise/tsconfig.json | 2 ++ .../svelte-standard-site/src/lib/utils/content.ts | 2 +- packages/tangled-sync/src/index.ts | 13 ++++++++----- packages/tid/package.json | 3 +-- 6 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 packages/bismuth/src/global.d.ts diff --git a/packages/bismuth/src/global.d.ts b/packages/bismuth/src/global.d.ts new file mode 100644 index 0000000..2677ef7 --- /dev/null +++ b/packages/bismuth/src/global.d.ts @@ -0,0 +1,5 @@ +/** + * Compile-time constant injected by tsup's `define` at build time. + * Declared here so `tsc --noEmit` can type-check sources that reference it. + */ +declare const __BISMUTH_VERSION__: string; diff --git a/packages/noise-avatar/tsconfig.json b/packages/noise-avatar/tsconfig.json index 0218015..a035c15 100644 --- a/packages/noise-avatar/tsconfig.json +++ b/packages/noise-avatar/tsconfig.json @@ -1,6 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "lib": ["ES2022", "DOM"], "rootDir": "src", "outDir": "dist", "declaration": true, diff --git a/packages/noise/tsconfig.json b/packages/noise/tsconfig.json index 216f774..4b15d96 100644 --- a/packages/noise/tsconfig.json +++ b/packages/noise/tsconfig.json @@ -1,6 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { + "target": "ES2022", + "lib": ["ES2022", "DOM"], "rootDir": "src", "outDir": "dist", "declaration": true, diff --git a/packages/svelte-standard-site/src/lib/utils/content.ts b/packages/svelte-standard-site/src/lib/utils/content.ts index 2b33487..2c158d4 100644 --- a/packages/svelte-standard-site/src/lib/utils/content.ts +++ b/packages/svelte-standard-site/src/lib/utils/content.ts @@ -64,7 +64,7 @@ export function convertSidenotes(markdown: string): string { const cleanLabel = label.trim(); // Convert to blockquote with label - return `\n> **${cleanLabel}:** ${cleanContent}\n`; + return `> **${cleanLabel}:** ${cleanContent}`; }); } diff --git a/packages/tangled-sync/src/index.ts b/packages/tangled-sync/src/index.ts index 707bcfb..efa713f 100644 --- a/packages/tangled-sync/src/index.ts +++ b/packages/tangled-sync/src/index.ts @@ -113,7 +113,7 @@ function generateTid(): string { } // Tangled repo schema typing (matches sh.tangled.repo lexicon) -interface TangledRepoRecord { +type TangledRepoRecord = { $type: "sh.tangled.repo"; name: string; // required knot: string; // required @@ -154,10 +154,13 @@ async function ensureTangledRecord( for (const record of res.data.records) { const value = record.value as TangledRepoRecord; if (value.name === repoName && record.rkey) { - tid = record.rkey; - recordCache[repoName] = tid; - console.log(`[FOUND] Existing record for ${repoName} (TID: ${tid})`); - return { tid, existed: true }; + const existingTid = record.rkey as string; + tid = existingTid; + recordCache[repoName] = existingTid; + console.log( + `[FOUND] Existing record for ${repoName} (TID: ${existingTid})`, + ); + return { tid: existingTid, existed: true }; } } diff --git a/packages/tid/package.json b/packages/tid/package.json index 603b54c..1f4cc38 100644 --- a/packages/tid/package.json +++ b/packages/tid/package.json @@ -44,8 +44,7 @@ "build": "tsup src/index.ts --format esm,cjs --dts --clean", "dev": "tsup src/index.ts --format esm,cjs --dts --watch", "prepare": "pnpm run build", - "type-check": "tsc --noEmit", - "test": "node --test dist/index.test.js" + "type-check": "tsc --noEmit" }, "devDependencies": { "tsup": "^8.5.1", -- 2.51.2