fix(build): update build and test tooling configuration, migrate project config to .smartconfig.json, and align TypeScript typings

This commit is contained in:
2026-03-24 19:44:49 +00:00
parent 27c1500db5
commit 03431535d7
29 changed files with 2210 additions and 1669 deletions

View File

@@ -13,7 +13,7 @@ export class SmartdataDbWatcher<T = any> extends EventEmitter {
public readyDeferred = plugins.smartpromise.defer();
// INSTANCE
private changeStream: plugins.mongodb.ChangeStream<T>;
private changeStream: plugins.mongodb.ChangeStream<any>;
private rawSubject: plugins.smartrx.rxjs.Subject<T>;
/** Emits change documents (or arrays of documents if buffered) */
public changeSubject: any;
@@ -23,7 +23,7 @@ export class SmartdataDbWatcher<T = any> extends EventEmitter {
* @param opts.bufferTimeMs optional milliseconds to buffer events via RxJS
*/
constructor(
changeStreamArg: plugins.mongodb.ChangeStream<T>,
changeStreamArg: plugins.mongodb.ChangeStream<any>,
smartdataDbDocArg: typeof SmartDataDbDoc,
opts?: { bufferTimeMs?: number },
) {
@@ -37,14 +37,14 @@ export class SmartdataDbWatcher<T = any> extends EventEmitter {
}
this.changeStream = changeStreamArg;
this.changeStream.on('change', async (item: any) => {
let docInstance: T = null;
let docInstance: T | null = null;
if (item.fullDocument) {
docInstance = smartdataDbDocArg.createInstanceFromMongoDbNativeDoc(
item.fullDocument
) as any as T;
}
// Notify subscribers
this.rawSubject.next(docInstance);
this.rawSubject.next(docInstance as T);
this.emit('change', docInstance);
});
// Signal readiness after one tick