**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
|
|
@ -99,9 +99,10 @@
|
|||
})
|
||||
|
||||
async function runWorkerTest(resultDiv) {
|
||||
// Define a compute-intensive function
|
||||
// Define a compute-intensive function using a function expression
|
||||
// This is more compatible with how the worker evaluates the function string
|
||||
const computeIntensiveFunction = `
|
||||
function(data) {
|
||||
function computeTask(data) {
|
||||
console.log('Worker/Fallback: Starting computation...');
|
||||
|
||||
// Simulate a compute-intensive task
|
||||
|
|
@ -114,13 +115,20 @@
|
|||
const duration = Date.now() - start;
|
||||
console.log('Worker/Fallback: Computation completed in ' + duration + 'ms');
|
||||
|
||||
const globalObj = typeof self !== 'undefined' ? self :
|
||||
typeof window !== 'undefined' ? window :
|
||||
{};
|
||||
|
||||
return {
|
||||
result,
|
||||
duration,
|
||||
iterations: data.iterations,
|
||||
webWorkersAvailable: typeof window.Worker !== 'undefined'
|
||||
webWorkersAvailable: typeof globalObj.Worker !== 'undefined'
|
||||
};
|
||||
}
|
||||
|
||||
// Return the function itself
|
||||
computeTask;
|
||||
`
|
||||
|
||||
// Execute the function
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue