Compare commits

..

2 Commits

Author SHA1 Message Date
d254f58a05 v5.16.7
Some checks failed
Default (tags) / security (push) Successful in 47s
Default (tags) / test (push) Failing after 49s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-11-17 08:05:28 +00:00
c5e7b6f982 fix(classes.collection): Improve Deno and TypeScript compatibility: Collection decorator _svDbOptions forwarding and config cleanup 2025-11-17 08:05:28 +00:00
8 changed files with 11 additions and 8 deletions

View File

@@ -1,5 +1,12 @@
# Changelog # 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) ## 2025-11-17 - 5.16.6 - fix(classes)
Add Deno compatibility, prototype-safe decorators and safe collection accessor; bump a few deps Add Deno compatibility, prototype-safe decorators and safe collection accessor; bump a few deps

View File

@@ -1,11 +1,10 @@
{ {
"compilerOptions": { "compilerOptions": {
"experimentalDecorators": true,
"lib": [ "lib": [
"ES2022", "ES2022",
"DOM" "DOM"
] ]
}, },
"nodeModulesDir": "auto", "nodeModulesDir": "auto",
"version": "5.16.6" "version": "5.16.7"
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@push.rocks/smartdata", "name": "@push.rocks/smartdata",
"version": "5.16.6", "version": "5.16.7",
"private": false, "private": false,
"description": "An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.", "description": "An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartdata', 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.' description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.'
} }

View File

@@ -27,8 +27,7 @@ const collectionFactory = new CollectionFactory();
*/ */
export function Collection(dbArg: SmartdataDb | TDelayed<SmartdataDb>) { export function Collection(dbArg: SmartdataDb | TDelayed<SmartdataDb>) {
return function classDecorator<T extends { new (...args: any[]): {} }>(constructor: T) { return function classDecorator<T extends { new (...args: any[]): {} }>(constructor: T) {
// Capture original constructor's prototype in closure for Deno compatibility // Capture original constructor for _svDbOptions forwarding
const originalPrototype = constructor.prototype;
const originalConstructor = constructor as any; const originalConstructor = constructor as any;
const getCollection = () => { const getCollection = () => {

View File

@@ -1,7 +1,5 @@
{ {
"compilerOptions": { "compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022", "target": "ES2022",
"module": "NodeNext", "module": "NodeNext",
"moduleResolution": "NodeNext", "moduleResolution": "NodeNext",