Files
smartdata/readme.hints.md

30 lines
1.3 KiB
Markdown
Raw Permalink Normal View History

# Project Memory - Smartdata
## TC39 Decorator Pattern
- **Field decorators**: Write to `context.metadata`
- **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)
### Runtime Compatibility
- ✅ Node.js v20+ / v25+: Full TC39 support
- ✅ Deno v2.x: Full TC39 support
- ❌ Bun: No TC39 support (uses legacy decorators only)
## Build Configuration (v7.1.0+)
- **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`)
## Dependencies (v7.1.0+)
- `@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