feat(rust-provider): add cross-runtime Rust provider tests and docs; simplify bridge event handling and bump tstest

This commit is contained in:
2026-03-06 11:35:02 +00:00
parent 647cb5e92f
commit a90ae28321
8 changed files with 61 additions and 32 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartfs',
version: '1.4.0',
version: '1.5.0',
description: 'a cross platform extendable fs module'
}

View File

@@ -168,14 +168,8 @@ export class SmartFsProviderRust implements ISmartFsProvider {
}
this.initialized = true;
// Set up watch event forwarding
// The bridge emits events as 'management:<eventName>'
// Watch events come as 'management:watch:<id>'
const originalEmit = this.bridge.emit.bind(this.bridge);
this.bridge.on = ((event: string, handler: (...args: any[]) => void) => {
// Intercept watch events
return (this.bridge as any).__proto__.on.call(this.bridge, event, handler);
}) as any;
// The bridge already inherits .on() from EventEmitter.
// Watch events from Rust arrive as 'management:watch:<id>'.
}
}