**chore: remove outdated changelog and summary documents**
- Deleted `CHANGES.md`, `CHANGES_SUMMARY.md`, `CONCURRENCY_ANALYSIS.md`, `CONCURRENCY_IMPLEMENTATION_SUMMARY.md`, and related developer documentation files. - Removed redundant or legacy content no longer aligned with the current codebase and workflows. - Updated repository to reflect streamlined documentation approach, reducing clutter and improving maintainability. **Purpose**: Simplify and declutter repository by removing obsolete documentation files, ensuring it remains focused and relevant.
This commit is contained in:
parent
0932e15274
commit
d015d1a94d
30 changed files with 343 additions and 3 deletions
76
CHANGELOG.md
Normal file
76
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
## [0.26.0] - 2025-07-30
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Organized documentation structure with docs/ directory
|
||||||
|
- Proper CHANGELOG.md for release management
|
||||||
|
- Statistics optimizations implemented across all storage adapters
|
||||||
|
- In-memory caching of statistics data
|
||||||
|
- Batched updates with adaptive flush timing
|
||||||
|
- Time-based partitioning for statistics files
|
||||||
|
- Error handling and retry mechanisms for statistics operations
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Moved technical documentation to docs/technical/
|
||||||
|
- Moved development documentation to docs/development/
|
||||||
|
- Moved guides to docs/guides/
|
||||||
|
- Archived temporary documentation files
|
||||||
|
- Refactored BaseStorageAdapter to include shared optimizations
|
||||||
|
- Updated FileSystemStorage, MemoryStorage, and OPFSStorage with new statistics handling
|
||||||
|
- Improved performance through reduced storage operations
|
||||||
|
- Enhanced scalability with time-based partitioning
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed FileSystemStorage constructor path operations issue where path module was used before being fully loaded
|
||||||
|
- Deferred path operations to init() method when path module is guaranteed to be available
|
||||||
|
- Resolved "Cannot read properties of undefined (reading 'join')" error
|
||||||
|
|
||||||
|
### Technical Details
|
||||||
|
- Added `scheduleBatchUpdate()` and `flushStatistics()` methods to BaseStorageAdapter
|
||||||
|
- Updated core statistics methods: `saveStatistics()`, `getStatistics()`, `incrementStatistic()`, `decrementStatistic()`, and `updateHnswIndexSize()`
|
||||||
|
- Maintained backward compatibility with legacy statistics files
|
||||||
|
- Added fallback mechanisms for multiple storage locations
|
||||||
|
|
||||||
|
## [Previous Versions]
|
||||||
|
|
||||||
|
For detailed implementation notes and technical summaries of previous versions, see:
|
||||||
|
- `docs/technical/` - Technical documentation and analysis
|
||||||
|
- `archive/` - Archived change logs and summaries
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## How to Update This Changelog
|
||||||
|
|
||||||
|
When making changes to the project:
|
||||||
|
|
||||||
|
1. Add new entries under `[Unreleased]` section
|
||||||
|
2. Use the following categories:
|
||||||
|
- `Added` for new features
|
||||||
|
- `Changed` for changes in existing functionality
|
||||||
|
- `Deprecated` for soon-to-be removed features
|
||||||
|
- `Removed` for now removed features
|
||||||
|
- `Fixed` for any bug fixes
|
||||||
|
- `Security` for vulnerability fixes
|
||||||
|
|
||||||
|
3. When releasing a new version:
|
||||||
|
- Move unreleased changes to a new version section
|
||||||
|
- Update the version number and date
|
||||||
|
- Create a new empty `[Unreleased]` section
|
||||||
|
|
||||||
|
4. Link to GitHub releases: `[0.26.0] - 2025-07-28` format
|
||||||
|
5. Keep entries concise but informative for users
|
||||||
|
6. Include technical details in a separate subsection if needed
|
||||||
124
docs/DOCUMENTATION_ORGANIZATION.md
Normal file
124
docs/DOCUMENTATION_ORGANIZATION.md
Normal file
|
|
@ -0,0 +1,124 @@
|
||||||
|
# Documentation Organization
|
||||||
|
|
||||||
|
This document explains the new documentation structure and workflow for managing markdown files in the Brainy project.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
The documentation has been reorganized from 29 scattered markdown files at the root level to a clean, organized structure with only essential files at the root and categorized documentation in the `docs/` directory.
|
||||||
|
|
||||||
|
## New Structure
|
||||||
|
|
||||||
|
### Root Level Files (GitHub/NPM Standards)
|
||||||
|
- `README.md` - Main project documentation
|
||||||
|
- `CONTRIBUTING.md` - Contribution guidelines
|
||||||
|
- `CODE_OF_CONDUCT.md` - Community standards
|
||||||
|
- `CHANGELOG.md` - Version history and release notes
|
||||||
|
|
||||||
|
### Documentation Directory Structure
|
||||||
|
```
|
||||||
|
docs/
|
||||||
|
├── technical/ # Technical documentation and analysis
|
||||||
|
│ ├── concurrency-analysis.md
|
||||||
|
│ ├── storage-concurrency-analysis.md
|
||||||
|
│ ├── threading.md
|
||||||
|
│ ├── statistics.md
|
||||||
|
│ ├── testing.md
|
||||||
|
│ ├── vitest-improvements.md
|
||||||
|
│ ├── realtime-updates.md
|
||||||
|
│ ├── metadata-handling.md
|
||||||
|
│ ├── vector-dimension-standardization.md
|
||||||
|
│ ├── use-model-loading-explanation.md
|
||||||
|
│ ├── dimension-mismatch-summary.md
|
||||||
|
│ ├── storage-testing.md
|
||||||
|
│ ├── technical-guides.md
|
||||||
|
│ └── concurrency-implementation-summary.md
|
||||||
|
├── development/ # Development and contributor documentation
|
||||||
|
│ ├── developers.md
|
||||||
|
│ ├── documentation-standards.md
|
||||||
|
│ ├── markdown-conventions.md
|
||||||
|
│ ├── expected-test-messages.md
|
||||||
|
│ └── pretty-test-reporter.md
|
||||||
|
└── guides/ # User guides and migration documentation
|
||||||
|
└── production-migration-guide.md
|
||||||
|
```
|
||||||
|
|
||||||
|
### Archive Directory
|
||||||
|
```
|
||||||
|
archive/ # Archived and temporary files
|
||||||
|
├── changes.md # Old detailed changelog
|
||||||
|
├── changes-summary.md # Old changelog summary
|
||||||
|
├── demo.md # Demo documentation
|
||||||
|
├── fix-documentation.md # Temporary fix notes
|
||||||
|
└── test-issue-summary.md # Test issue summary
|
||||||
|
```
|
||||||
|
|
||||||
|
## CHANGELOG.md Management
|
||||||
|
|
||||||
|
### Automated Workflow
|
||||||
|
|
||||||
|
The project now uses automated changelog management:
|
||||||
|
|
||||||
|
1. **Adding Changes**: Add entries to the `[Unreleased]` section in `CHANGELOG.md`
|
||||||
|
2. **Version Bumping**: Use npm scripts that automatically update the changelog:
|
||||||
|
- `npm run version:patch` - Patch version bump + changelog update
|
||||||
|
- `npm run version:minor` - Minor version bump + changelog update
|
||||||
|
- `npm run version:major` - Major version bump + changelog update
|
||||||
|
|
||||||
|
3. **Manual Updates**: Use `npm run changelog:update` to manually update the changelog
|
||||||
|
|
||||||
|
### Changelog Format
|
||||||
|
|
||||||
|
The changelog follows the [Keep a Changelog](https://keepachangelog.com/) standard:
|
||||||
|
|
||||||
|
- **Added** - New features
|
||||||
|
- **Changed** - Changes in existing functionality
|
||||||
|
- **Deprecated** - Soon-to-be removed features
|
||||||
|
- **Removed** - Now removed features
|
||||||
|
- **Fixed** - Bug fixes
|
||||||
|
- **Security** - Vulnerability fixes
|
||||||
|
|
||||||
|
### GitHub Integration
|
||||||
|
|
||||||
|
The CHANGELOG.md is automatically used for:
|
||||||
|
- GitHub releases (via `scripts/create-github-release.js`)
|
||||||
|
- NPM package release notes
|
||||||
|
- Version history tracking
|
||||||
|
|
||||||
|
## Benefits of New Structure
|
||||||
|
|
||||||
|
1. **Clean Root Directory**: Reduced from 29 to 4 essential markdown files
|
||||||
|
2. **Better Organization**: Logical categorization of documentation
|
||||||
|
3. **GitHub Compliance**: Follows GitHub and NPM best practices
|
||||||
|
4. **Automated Maintenance**: Changelog updates are automated
|
||||||
|
5. **Easy Navigation**: Clear directory structure for different doc types
|
||||||
|
6. **Historical Preservation**: Old documentation archived, not lost
|
||||||
|
|
||||||
|
## Workflow for Contributors
|
||||||
|
|
||||||
|
### Adding Documentation
|
||||||
|
1. **Technical docs** → `docs/technical/`
|
||||||
|
2. **Development docs** → `docs/development/`
|
||||||
|
3. **User guides** → `docs/guides/`
|
||||||
|
4. **Temporary files** → `archive/` (if needed)
|
||||||
|
|
||||||
|
### Making Changes
|
||||||
|
1. Add changes to `[Unreleased]` section in `CHANGELOG.md`
|
||||||
|
2. Use appropriate category (Added, Changed, Fixed, etc.)
|
||||||
|
3. When ready to release, use `npm run version:patch/minor/major`
|
||||||
|
4. The changelog will be automatically updated with version and date
|
||||||
|
|
||||||
|
### Release Process
|
||||||
|
1. Ensure `[Unreleased]` section has all changes
|
||||||
|
2. Run `npm run version:patch/minor/major`
|
||||||
|
3. Run `npm run deploy` to publish and create GitHub release
|
||||||
|
4. GitHub release will use CHANGELOG.md content
|
||||||
|
|
||||||
|
## Migration Notes
|
||||||
|
|
||||||
|
- All technical documentation moved to `docs/technical/`
|
||||||
|
- Development documentation moved to `docs/development/`
|
||||||
|
- Old changelog files archived in `archive/`
|
||||||
|
- Links in existing documentation may need updates
|
||||||
|
- New automation ensures changelog stays current
|
||||||
|
|
||||||
|
This reorganization provides a sustainable, scalable approach to documentation management that follows industry best practices and integrates seamlessly with GitHub and NPM workflows.
|
||||||
|
|
@ -55,9 +55,11 @@
|
||||||
"start": "node dist/unified.js",
|
"start": "node dist/unified.js",
|
||||||
"demo": "npm run build && npm run build:browser && npx http-server -o /demo/index.html",
|
"demo": "npm run build && npm run build:browser && npx http-server -o /demo/index.html",
|
||||||
"version": "echo 'Version updated in package.json'",
|
"version": "echo 'Version updated in package.json'",
|
||||||
"version:patch": "npm version patch",
|
"version:patch": "npm version patch && node scripts/update-changelog.js",
|
||||||
"version:minor": "npm version minor",
|
"version:minor": "npm version minor && node scripts/update-changelog.js",
|
||||||
"version:major": "npm version major",
|
"version:major": "npm version major && node scripts/update-changelog.js",
|
||||||
|
"changelog:update": "node scripts/update-changelog.js",
|
||||||
|
"changelog:check": "echo 'Please ensure CHANGELOG.md [Unreleased] section has your changes before releasing'",
|
||||||
"lint": "eslint --ext .ts,.js src/",
|
"lint": "eslint --ext .ts,.js src/",
|
||||||
"lint:fix": "eslint --ext .ts,.js src/ --fix",
|
"lint:fix": "eslint --ext .ts,.js src/ --fix",
|
||||||
"format": "prettier --write \"src/**/*.{ts,js}\"",
|
"format": "prettier --write \"src/**/*.{ts,js}\"",
|
||||||
|
|
|
||||||
138
scripts/update-changelog.js
Normal file
138
scripts/update-changelog.js
Normal file
|
|
@ -0,0 +1,138 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/* eslint-env node */
|
||||||
|
/* eslint no-console: "off" */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update Changelog Script
|
||||||
|
*
|
||||||
|
* This script helps maintain the CHANGELOG.md file by:
|
||||||
|
* 1. Moving unreleased changes to a new version section
|
||||||
|
* 2. Adding the current date
|
||||||
|
* 3. Creating a new empty unreleased section
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* - npm run changelog:update - Interactive mode to update changelog
|
||||||
|
* - node scripts/update-changelog.js <version> - Direct version update
|
||||||
|
*/
|
||||||
|
|
||||||
|
import fs from 'fs'
|
||||||
|
import path from 'path'
|
||||||
|
import { fileURLToPath } from 'url'
|
||||||
|
|
||||||
|
// Get the directory of the current module
|
||||||
|
const __filename = fileURLToPath(import.meta.url)
|
||||||
|
const __dirname = path.dirname(__filename)
|
||||||
|
|
||||||
|
// Path to the root directory and CHANGELOG.md
|
||||||
|
const rootDir = path.join(__dirname, '..')
|
||||||
|
const changelogPath = path.join(rootDir, 'CHANGELOG.md')
|
||||||
|
|
||||||
|
// Get version from command line argument or package.json
|
||||||
|
function getVersion() {
|
||||||
|
const args = process.argv.slice(2)
|
||||||
|
if (args.length > 0) {
|
||||||
|
return args[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read from package.json
|
||||||
|
const packageJsonPath = path.join(rootDir, 'package.json')
|
||||||
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
|
||||||
|
return packageJson.version
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get current date in YYYY-MM-DD format
|
||||||
|
function getCurrentDate() {
|
||||||
|
return new Date().toISOString().split('T')[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the changelog
|
||||||
|
function updateChangelog(version) {
|
||||||
|
if (!fs.existsSync(changelogPath)) {
|
||||||
|
console.error('CHANGELOG.md not found!')
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
const changelog = fs.readFileSync(changelogPath, 'utf8')
|
||||||
|
const lines = changelog.split('\n')
|
||||||
|
|
||||||
|
// Find the unreleased section
|
||||||
|
const unreleasedIndex = lines.findIndex(line => line.includes('## [Unreleased]'))
|
||||||
|
if (unreleasedIndex === -1) {
|
||||||
|
console.error('Could not find [Unreleased] section in CHANGELOG.md')
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find the next version section or end of unreleased content
|
||||||
|
let nextSectionIndex = lines.findIndex((line, index) =>
|
||||||
|
index > unreleasedIndex && line.startsWith('## [') && !line.includes('[Unreleased]')
|
||||||
|
)
|
||||||
|
|
||||||
|
if (nextSectionIndex === -1) {
|
||||||
|
nextSectionIndex = lines.length
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract unreleased content
|
||||||
|
const unreleasedContent = lines.slice(unreleasedIndex + 1, nextSectionIndex)
|
||||||
|
|
||||||
|
// Check if there's actual content in unreleased section
|
||||||
|
const hasContent = unreleasedContent.some(line =>
|
||||||
|
line.trim() && !line.startsWith('#') && line.includes('-')
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!hasContent) {
|
||||||
|
console.log('No unreleased changes found. Please add changes to the [Unreleased] section first.')
|
||||||
|
console.log('Example:')
|
||||||
|
console.log('## [Unreleased]')
|
||||||
|
console.log('')
|
||||||
|
console.log('### Added')
|
||||||
|
console.log('- New feature description')
|
||||||
|
console.log('')
|
||||||
|
console.log('### Fixed')
|
||||||
|
console.log('- Bug fix description')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create new version section
|
||||||
|
const currentDate = getCurrentDate()
|
||||||
|
const newVersionSection = [
|
||||||
|
`## [${version}] - ${currentDate}`,
|
||||||
|
...unreleasedContent
|
||||||
|
]
|
||||||
|
|
||||||
|
// Create new unreleased section
|
||||||
|
const newUnreleasedSection = [
|
||||||
|
'## [Unreleased]',
|
||||||
|
'',
|
||||||
|
'### Added',
|
||||||
|
'',
|
||||||
|
'### Changed',
|
||||||
|
'',
|
||||||
|
'### Fixed',
|
||||||
|
'',
|
||||||
|
]
|
||||||
|
|
||||||
|
// Reconstruct the changelog
|
||||||
|
const newLines = [
|
||||||
|
...lines.slice(0, unreleasedIndex),
|
||||||
|
...newUnreleasedSection,
|
||||||
|
...newVersionSection,
|
||||||
|
...lines.slice(nextSectionIndex)
|
||||||
|
]
|
||||||
|
|
||||||
|
// Write the updated changelog
|
||||||
|
fs.writeFileSync(changelogPath, newLines.join('\n'))
|
||||||
|
console.log(`✅ CHANGELOG.md updated for version ${version}`)
|
||||||
|
console.log(`📅 Release date: ${currentDate}`)
|
||||||
|
console.log('🔄 New [Unreleased] section created')
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main execution
|
||||||
|
try {
|
||||||
|
const version = getVersion()
|
||||||
|
console.log(`Updating CHANGELOG.md for version ${version}...`)
|
||||||
|
updateChangelog(version)
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error updating changelog:', error.message)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue