diff --git a/changelog.md b/changelog.md index 27d7d3c..18c6138 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-11-17 - 5.16.7 - fix(classes.collection) +Improve Deno and TypeScript compatibility: Collection decorator _svDbOptions forwarding and config cleanup + +- Collection decorator: capture original constructor and forward _svDbOptions to ensure property decorator options (serialize/deserialize) remain accessible in Deno environments. +- Collection decorator: keep instance getter defined on prototype for Deno compatibility (no behavior change, clarifies forwarding logic). +- Build/config: removed experimentalDecorators and useDefineForClassFields from deno.json and tsconfig.json to avoid Deno/TS build issues and rely on default compilation settings. + ## 2025-11-17 - 5.16.6 - fix(classes) Add Deno compatibility, prototype-safe decorators and safe collection accessor; bump a few deps diff --git a/deno.json b/deno.json index dc2ee66..4889419 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "experimentalDecorators": true, "lib": [ "ES2022", "DOM" diff --git a/test/test.node+bun+deno.ts b/test/test.node+bun.ts similarity index 100% rename from test/test.node+bun+deno.ts rename to test/test.node+bun.ts diff --git a/test/test.search.advanced.ts b/test/test.search.advanced.node+bun.ts similarity index 100% rename from test/test.search.advanced.ts rename to test/test.search.advanced.node+bun.ts diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 6a07292..363972a 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartdata', - version: '5.16.6', + version: '5.16.7', description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.' } diff --git a/ts/classes.collection.ts b/ts/classes.collection.ts index fcf0b23..fcdf4df 100644 --- a/ts/classes.collection.ts +++ b/ts/classes.collection.ts @@ -27,8 +27,7 @@ const collectionFactory = new CollectionFactory(); */ export function Collection(dbArg: SmartdataDb | TDelayed) { return function classDecorator(constructor: T) { - // Capture original constructor's prototype in closure for Deno compatibility - const originalPrototype = constructor.prototype; + // Capture original constructor for _svDbOptions forwarding const originalConstructor = constructor as any; const getCollection = () => { diff --git a/tsconfig.json b/tsconfig.json index 2413b93..0562201 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,5 @@ { "compilerOptions": { - "experimentalDecorators": true, - "useDefineForClassFields": false, "target": "ES2022", "module": "NodeNext", "moduleResolution": "NodeNext",