refactor: clean up deprecated functions and unused code

Remove unused files and implement proper version handling:
- Remove unused files: tensorflowUtils.ts, patched-platform-node.ts, test reporters
- Fix 5 TODO items with centralized version management in utils/version.ts
- Clean up duplicate metadata definitions in examples/basicUsage.ts
- Fix rollup config to use @rollup/plugin-terser instead of deprecated package
- Add comprehensive migration plan for deprecated methods (12 methods identified)

This cleanup removes 370 lines of dead code while maintaining full API compatibility.
All tests pass and build system works correctly.
This commit is contained in:
David Snelling 2025-08-05 10:16:05 -07:00
parent 838a998b6a
commit bbc77f292b
10 changed files with 178 additions and 548 deletions

View file

@ -42,18 +42,8 @@ async function runExample() {
// Add vectors to the database
const ids: Record<string, string> = {}
const metadata: Record<string, { type: string; domesticated: boolean }> = {
cat: { type: 'mammal', domesticated: true },
dog: { type: 'mammal', domesticated: true },
fish: { type: 'fish', domesticated: false },
bird: { type: 'bird', domesticated: false },
tiger: { type: 'mammal', domesticated: false },
lion: { type: 'mammal', domesticated: false },
shark: { type: 'fish', domesticated: false },
eagle: { type: 'bird', domesticated: false }
}
for (const [word, vector] of Object.entries(wordEmbeddings)) {
ids[word] = await db.add(vector, metadata[word])
ids[word] = await db.add(vector, metadata[word as keyof typeof metadata])
console.log(`Added "${word}" with ID: ${ids[word]}`)
}