diff --git a/package.json b/package.json index 51abcf1..c2b7580 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "ttsc": "dist/tts.js" }, "scripts": { - "dev": "pnpm run bundle &>/dev/null && node dist/index.js", + "dev": "pnpm run bundle index.ts &>/dev/null && node dist/index.js", "check": "biome check --write && pnpm run tc", "clean": "rm -rf dist", "build": "pnpm run check && pnpm run bundle --minify index.ts && pnpm run bundle --minify tts.ts", @@ -24,7 +24,7 @@ "@clack/prompts": "^1.3.0", "@cliffy/table": "npm:@jsr/cliffy__table", "@mozilla/readability": "^0.6.0", - "@types/bun": "^1.3.14", + "@types/node": "^25.9.2", "ai": "^6.0.161", "ansi-styles": "^6.2.3", "chalk": "^5.6.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5644768..03d92d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,9 +23,9 @@ importers: '@mozilla/readability': specifier: ^0.6.0 version: 0.6.0 - '@types/bun': - specifier: ^1.3.14 - version: 1.3.14 + '@types/node': + specifier: ^25.9.2 + version: 25.9.2 ai: specifier: ^6.0.161 version: 6.0.191(zod@4.4.3) @@ -326,9 +326,6 @@ packages: '@tybys/wasm-util@0.10.2': resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} - '@types/bun@1.3.14': - resolution: {integrity: sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw==} - '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} @@ -338,6 +335,9 @@ packages: '@types/node@25.9.1': resolution: {integrity: sha512-xfrlY7UD5rMJk3ZVJP8BNzS28J36YJg+xp+LPXV1TdWxr8uMH5A860QNxYDGQe/ylDSgjxE52Q9VnO7p75tJxg==} + '@types/node@25.9.2': + resolution: {integrity: sha512-G05zqtJhcDLb8uslf5EjCxXg9G1KQxiV8OS0R26IC//Eoyitzqe8z37I7cqvnZlrlSfgocQRfSn/AHBZJJFyGw==} + '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} @@ -376,9 +376,6 @@ packages: resolution: {integrity: sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ==} engines: {node: '>=4.0'} - bun-types@1.3.14: - resolution: {integrity: sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ==} - ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} @@ -881,10 +878,6 @@ snapshots: tslib: 2.8.1 optional: true - '@types/bun@1.3.14': - dependencies: - bun-types: 1.3.14 - '@types/hast@3.0.4': dependencies: '@types/unist': 3.0.3 @@ -897,6 +890,10 @@ snapshots: dependencies: undici-types: 7.24.6 + '@types/node@25.9.2': + dependencies: + undici-types: 7.24.6 + '@types/unist@3.0.3': {} '@types/whatwg-mimetype@3.0.2': {} @@ -929,10 +926,6 @@ snapshots: dependencies: '@types/node': 25.9.1 - bun-types@1.3.14: - dependencies: - '@types/node': 25.9.1 - ccount@2.0.1: {} chalk@5.6.2: {} diff --git a/src/config/index.ts b/src/config/index.ts index 9e23618..f885994 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -67,8 +67,8 @@ export async function loadConfig( ): Promise { let config: AppConfig; try { - const text = await fs.readFile(configPath); - config = JSON.parse(text.toString("utf8")); + const text = await fs.readFile(configPath, "utf8"); + config = JSON.parse(text); } catch { if (configFlag) return null; console.error(`Config not found at ${configPath}`); diff --git a/src/conversation/index.ts b/src/conversation/index.ts index 6d408c2..96b1923 100644 --- a/src/conversation/index.ts +++ b/src/conversation/index.ts @@ -17,8 +17,8 @@ export class Conversation implements IConversation { async load() { try { - const text = await fs.readFile(convoPath); - const convo: IConversation = JSON.parse(text.toString("utf8")); + const text = await fs.readFile(convoPath, "utf8"); + const convo: IConversation = JSON.parse(text); this.model = convo.model; this.messages = convo.messages; } catch { diff --git a/testRender.ts b/testRender.ts deleted file mode 100644 index 4fecfd9..0000000 --- a/testRender.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { renderMarkdown } from "./src/render/markdown"; - -const text = await Bun.file("README.md").text(); - -const [columns] = process.stdout.getWindowSize(); -process.stdout.write(await renderMarkdown(text, columns)); diff --git a/tsconfig.json b/tsconfig.json index d5dde93..d593bb5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "noEmit": true, // For nodejs: "lib": ["esnext"], - "types": ["bun"], + "types": ["node"], // and npm install -D @types/node // Stricter Typechecking Options diff --git a/tts.ts b/tts.ts index c6be5bc..976da80 100644 --- a/tts.ts +++ b/tts.ts @@ -126,7 +126,7 @@ async function main() { const file = `${home}/.ttsc/${info.file}.wav`; if (wait) { - console.write("."); + process.stdout.write("."); } else { console.log(`\n${chalk.blue(file)}\n${text}\n`); await execa({