2025-11-17 12:51:45 +00:00
|
|
|
# Project Memory - Smartdata
|
|
|
|
|
|
2026-03-24 19:51:52 +00:00
|
|
|
## TC39 Decorator Pattern
|
2026-03-24 19:44:49 +00:00
|
|
|
|
2025-11-17 12:51:45 +00:00
|
|
|
- **Field decorators**: Write to `context.metadata`
|
2026-03-24 19:51:52 +00:00
|
|
|
- **Class decorators**: Read from `context.metadata` (same shared object)
|
|
|
|
|
- `Symbol.metadata` on constructors is read-only (managed by runtime)
|
|
|
|
|
- Field decorators run before class decorators (guaranteed order)
|
|
|
|
|
- `declare` keyword for instance properties accessed via prototype getters (avoids ES2022 shadowing)
|
2026-03-24 19:44:49 +00:00
|
|
|
|
2026-03-24 19:51:52 +00:00
|
|
|
### Runtime Compatibility
|
2025-12-01 11:48:28 +00:00
|
|
|
|
2026-03-24 19:51:52 +00:00
|
|
|
- ✅ Node.js v20+ / v25+: Full TC39 support
|
|
|
|
|
- ✅ Deno v2.x: Full TC39 support
|
|
|
|
|
- ❌ Bun: No TC39 support (uses legacy decorators only)
|
2026-03-24 19:44:49 +00:00
|
|
|
|
2026-03-24 19:51:52 +00:00
|
|
|
## Build Configuration (v7.1.0+)
|
2026-03-24 19:44:49 +00:00
|
|
|
|
2026-03-24 19:51:52 +00:00
|
|
|
- **Build tool**: `@git.zone/tsbuild` v4 with `tsbuild tsfolders`
|
|
|
|
|
- **tsconfig.json**: Includes `"types": ["node"]` since tsbuild v4 defaults to DOM+ESNext lib only
|
|
|
|
|
- **Strict mode**: tsbuild v4 enables strict checks; properties use `!` definite assignment or `declare`
|
|
|
|
|
- **Test imports**: Use `@git.zone/tstest/tapbundle` (NOT `@push.rocks/tapbundle`)
|
|
|
|
|
- **Config file**: `.smartconfig.json` (renamed from `npmextra.json`)
|
2025-12-01 11:48:28 +00:00
|
|
|
|
2026-03-24 19:51:52 +00:00
|
|
|
## Dependencies (v7.1.0+)
|
2026-03-24 19:44:49 +00:00
|
|
|
|
2026-03-24 19:51:52 +00:00
|
|
|
- `@push.rocks/taskbuffer` v8: distributedCoordination API at `taskbuffer.distributedCoordination.*`
|
|
|
|
|
- `@push.rocks/smartmongo` v5: API compatible (`createAndStart`, `getMongoDescriptor`, `stop`, `stopAndDumpToDir`)
|
|
|
|
|
- `mongodb` v7.1: ChangeStream requires `Document` constraint, use `any` for generic watcher
|