**feat(core): enhance logging, storage options, and testing coverage**
- **Core Improvements**: - Refactored logging functions into a unified `logger` method for consistent output across the library. - Enabled the `forceMemoryStorage` option in `BrainyData` initialization for improved storage flexibility in tests and specific use cases. - **TensorFlow.js and Environment Updates**: - Clarified the dependency structure in `README.md` to emphasize bundled dependencies and remove legacy peer dependency instructions. - Simplified and reformatted environment detection logic for better maintainability and readability. - **Testing Enhancements**: - Added `tests/package-size-limit.test.ts` to monitor and validate npm package size against defined thresholds. - Updated `tests/environment.node.test.ts` and core tests to leverage `forceMemoryStorage` for better test setup standardization. - Improved test isolation with expanded `globalThis` utility definitions and cleanup logic. - **Documentation**: - Added detailed best practices for debugging and organizing tests in `DEVELOPERS.md`. - Removed outdated installation hints from `package.json` and streamlined scripts by including `test:size` for package size validation. **Purpose**: These changes unify core logging mechanisms, expand configurability of storage options, and improve testing reliability and coverage. Documentation and clarity are enhanced to align with updated functionality and best practices.
This commit is contained in:
parent
7878f200fc
commit
e12ecf8d72
8 changed files with 238 additions and 39 deletions
|
|
@ -54,7 +54,10 @@ describe('Brainy in Node.js Environment', () => {
|
|||
}
|
||||
const db = new brainy.BrainyData({
|
||||
dimensions: 3,
|
||||
metric: 'euclidean'
|
||||
metric: 'euclidean',
|
||||
storage: {
|
||||
forceMemoryStorage: true
|
||||
}
|
||||
})
|
||||
|
||||
await db.init()
|
||||
|
|
@ -83,7 +86,10 @@ describe('Brainy in Node.js Environment', () => {
|
|||
}
|
||||
const db = new brainy.BrainyData({
|
||||
embeddingFunction: brainy.createEmbeddingFunction(),
|
||||
metric: 'cosine'
|
||||
metric: 'cosine',
|
||||
storage: {
|
||||
forceMemoryStorage: true
|
||||
}
|
||||
})
|
||||
|
||||
await db.init()
|
||||
|
|
@ -109,7 +115,10 @@ describe('Brainy in Node.js Environment', () => {
|
|||
}
|
||||
const db = new brainy.BrainyData({
|
||||
dimensions: 2,
|
||||
metric: 'euclidean'
|
||||
metric: 'euclidean',
|
||||
storage: {
|
||||
forceMemoryStorage: true
|
||||
}
|
||||
})
|
||||
|
||||
await db.init()
|
||||
|
|
@ -155,7 +164,10 @@ describe('Brainy in Node.js Environment', () => {
|
|||
}
|
||||
const db = new brainy.BrainyData({
|
||||
dimensions: 2,
|
||||
metric: 'euclidean'
|
||||
metric: 'euclidean',
|
||||
storage: {
|
||||
forceMemoryStorage: true
|
||||
}
|
||||
})
|
||||
|
||||
await db.init()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue