**chore(release): bump version to 0.10.0 and refactor project structure**
- Updated version to `0.10.0` in `README.md`, `cli-package/package.json`, and `src/utils/version.ts`. - Removed `CHANGELOG.md` from the root and `cli-package`, as GitHub auto-generates release notes. - Refactored `brainy-wrapper.js` to simplify utility methods (`isFloat32Array` and `isTypedArray`) by moving them to instance-level definitions. - Standardized Node.js version requirement to `>= 24.3.0` across documentation and configuration files. - Improved `textEncoding.ts` by introducing a unified `Platform` class for cross-environment compatibility (Node.js and browser). - Restructured scripts: - Replaced outdated commands (e.g., `test-cli` -> `test:cli` and `test-all` -> `test:all`) for consistency. - Removed changelog updates from `scripts/create-github-release.js` as part of simplification. - Enhanced `patch-textencoder.js` to also patch `worker.js` for both `TextEncoder` and `TextDecoder`. This release improves compatibility with Node.js 24, simplifies the deployment/changelog process, and refines text encoding and worker functionalities.
This commit is contained in:
parent
0653d479ef
commit
04a33b9ae8
18 changed files with 183 additions and 292 deletions
|
|
@ -1,24 +0,0 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [0.9.37] - 2025-07-04
|
||||
|
||||
**Full Changelog**: https://github.com/soulcraft-research/brainy/compare/v0.9.36...v0.9.37
|
||||
|
||||
## [0.9.36] - 2025-07-04
|
||||
|
||||
**Full Changelog**: https://github.com/soulcraft-research/brainy/commits/v0.9.36
|
||||
|
||||
## [0.9.34] - 2024-07-01
|
||||
|
||||
This is the initial changelog entry. Future releases will automatically update this file with release notes from GitHub.
|
||||
|
||||
### Added
|
||||
- Auto-generation of release notes for GitHub releases
|
||||
- Auto-updating of CHANGELOG.md files for both main and CLI packages
|
||||
- Display of release notes on npmjs.com through the CHANGELOG.md files
|
||||
|
||||
### Changed
|
||||
- Modified deployment scripts to ensure GitHub releases are created with auto-generated notes
|
||||
- Updated package.json files to include CHANGELOG.md in published packages
|
||||
|
|
@ -47,12 +47,7 @@ brainy generate-random-graph --noun-count 20 --verb-count 30 --clear
|
|||
|
||||
## Requirements
|
||||
|
||||
- Node.js >= 23.0.0
|
||||
|
||||
## Changelog
|
||||
|
||||
### 0.9.25
|
||||
- Completely removed unnecessary compatibility patches for Node.js v24 as they are no longer needed with current TensorFlow.js versions
|
||||
- Node.js >= 24.3.0
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
|||
|
|
@ -18,22 +18,27 @@ if (
|
|||
// Define a PlatformNode class that uses the global TextEncoder/TextDecoder directly
|
||||
class PlatformNode {
|
||||
constructor() {
|
||||
// Create a util object with only the necessary methods
|
||||
this.util = {
|
||||
isFloat32Array: (arr) =>
|
||||
!!(
|
||||
arr instanceof Float32Array ||
|
||||
(arr &&
|
||||
Object.prototype.toString.call(arr) === '[object Float32Array]')
|
||||
),
|
||||
isTypedArray: (arr) =>
|
||||
!!(ArrayBuffer.isView(arr) && !(arr instanceof DataView))
|
||||
}
|
||||
// Create a util object (empty but kept for compatibility)
|
||||
this.util = {}
|
||||
|
||||
// Initialize TextEncoder/TextDecoder instances directly from global
|
||||
this.textEncoder = new TextEncoder()
|
||||
this.textDecoder = new TextDecoder()
|
||||
}
|
||||
|
||||
// Define isFloat32Array directly on the instance
|
||||
isFloat32Array(arr) {
|
||||
return !!(
|
||||
arr instanceof Float32Array ||
|
||||
(arr &&
|
||||
Object.prototype.toString.call(arr) === '[object Float32Array]')
|
||||
)
|
||||
}
|
||||
|
||||
// Define isTypedArray directly on the instance
|
||||
isTypedArray(arr) {
|
||||
return !!(ArrayBuffer.isView(arr) && !(arr instanceof DataView))
|
||||
}
|
||||
}
|
||||
|
||||
// Assign the PlatformNode class to the global object
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@soulcraft/brainy-cli",
|
||||
"version": "0.9.37",
|
||||
"version": "0.10.0",
|
||||
"description": "Command-line interface for the Brainy vector graph database",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
|
@ -9,7 +9,6 @@
|
|||
"files": [
|
||||
"cli-wrapper.js",
|
||||
"README.md",
|
||||
"CHANGELOG.md",
|
||||
"dist/cli.js",
|
||||
"dist/cli.js.map"
|
||||
],
|
||||
|
|
@ -41,7 +40,7 @@
|
|||
"url": "git+https://github.com/soulcraft-research/brainy.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@soulcraft/brainy": "0.9.37",
|
||||
"@soulcraft/brainy": "0.10.0",
|
||||
"commander": "^14.0.0",
|
||||
"omelette": "^0.4.17"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -28,15 +28,6 @@ export function applyTensorFlowPatch(): void {
|
|||
constructor() {
|
||||
// Create a util object with necessary methods and constructors
|
||||
this.util = {
|
||||
isFloat32Array: (arr: any) =>
|
||||
!!(
|
||||
arr instanceof Float32Array ||
|
||||
(arr &&
|
||||
Object.prototype.toString.call(arr) ===
|
||||
'[object Float32Array]')
|
||||
),
|
||||
isTypedArray: (arr: any) =>
|
||||
!!(ArrayBuffer.isView(arr) && !(arr instanceof DataView)),
|
||||
// Use native TextEncoder and TextDecoder
|
||||
TextEncoder: TextEncoder,
|
||||
TextDecoder: TextDecoder
|
||||
|
|
@ -46,6 +37,21 @@ export function applyTensorFlowPatch(): void {
|
|||
this.textEncoder = new this.util.TextEncoder()
|
||||
this.textDecoder = new this.util.TextDecoder()
|
||||
}
|
||||
|
||||
// Define isFloat32Array directly on the instance
|
||||
isFloat32Array(arr: any) {
|
||||
return !!(
|
||||
arr instanceof Float32Array ||
|
||||
(arr &&
|
||||
Object.prototype.toString.call(arr) ===
|
||||
'[object Float32Array]')
|
||||
)
|
||||
}
|
||||
|
||||
// Define isTypedArray directly on the instance
|
||||
isTypedArray(arr: any) {
|
||||
return !!(ArrayBuffer.isView(arr) && !(arr instanceof DataView))
|
||||
}
|
||||
}
|
||||
|
||||
// Assign the PlatformNode class to the global object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue