almin/ddd-base
53.8
Adequate · 9 November 2026
616
lines of production code
TypeScript
primary language
7
measurements over time
What this system is
This system is a TypeScript-based domain modeling framework that provides foundational utilities for managing state and data persistence. It features a Repository pattern with event-driven updates for saving and deleting entities, alongside a Converter for serializing domain objects to and from JSON. Additionally, it includes a Copyable mixin for creating modified copies of objects without mutation, all supported by comprehensive test coverage.
Features
Added Copyable mixin for object copying and mapping
A new \Copyable\ mixin has been added to \src/mixin/Copyable.ts\. This mixin provides two methods for creating modified copies of an object: \copy\, which accepts a partial object of new values, and \mapCopy\, which accepts a map of transformation functions to apply to existing properties. This allows users to generate new instances with updated or transformed state without mutating the original.
src/mixin · high confidence
Introduce Converter for JSON serialization and deserialization
A new \Converter\ class and \createConverter\ factory function are added to handle the conversion between Entity/ValueObject instances and JSON formats. The \Converter\ supports nested conversions and provides methods like \toJSON\, \propsToJSON\, \JSONToProps\, and \fromJSON\. This allows users to easily serialize and deserialize domain objects to and from JSON structures.
src · high confidence
Introduce Repository pattern with event-driven updates
A new Repository abstraction is introduced, providing both a base \Repository\ interface and two concrete implementations: \NonNullableRepository\ (which always returns an initial entity) and \NullableRepository\ (which may return undefined). The implementation includes a \RepositoryCore\ that manages entity storage and exposes an \events\ property, allowing consumers to subscribe to \save\ and \delete\ changes via the \onChange\ method.
src/repository · high confidence
Test coverage
Added test coverage for core domain and utility components
Added comprehensive test suites for the domain model and utility components, including Entity, ValueObject, RepositoryCore, NonNullableRepository, Serializer, Converter, and Copyable mixin. The new tests verify entity equality, value object comparison, repository save/find/delete/clear operations, serialization round-trips, and the copy/mapping behavior of the Copyable mixin.
test · high confidence
Dependencies
Updated project dependencies and build configuration
The project's development dependencies have been updated to newer versions, including @types/node, @types/mocha, cross-env, husky, lerna, lint-staged, mocha, prettier, rimraf, ts-node, and typescript. Additionally, the package.json has been updated to specify the TypeScript type definitions file, changed the main entry point, added a clean script using rimraf, and reconfigured husky hooks directly in the package.json.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 53 → 54 (+1.3)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 93 → 93 (+0.0)
- Architecture 69 → 69 (+0.0)
- Maturity 48 → 51 (+2.8)
- Readiness 51 → 51 (-0.6)
- Security 80 → 100 (+20.0)
- Domain Modelling 48 → 48 (+0.0)
Resolved (8)
- Duplicate intent between Converter and Serializer. Both provide a toJSON method that converts an entity/domain object to JSON. The distinction between 'Converter' and 'Serializer' is not clear from the signatures alone, and having two separate types with the same primary operation (toJSON) and inverse operation (fromJSON/JSONToProps) suggests a lack of clear separation of concerns or redundant abstraction.
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- Inconsistent parameter naming for the same logical operation across repository variants. RepositoryCore uses entityIdentifier, while Repository, NonNullableRepository, and NullableRepository use entityId. This forces consumers to remember different argument names for identical functionality depending on which repository interface they are using.
- Inconsistent return type for delete. RepositoryCore.delete and the specialized repositories return void (explicitly or implicitly), but RepositoryCore.deleteById exists while RepositoryCore.delete takes an entity. More importantly, RepositoryCore.delete has no return type annotation in the signature provided, while others explicitly say : void. This is a minor documentation inconsistency, but the bigger issue is the duplication of delete across all repository variants with identical signatures.
- Medium CVE: [GHSA redacted] (yarn.lock)
- Redundant method signatures across repository variants. getAll() is present in all four repository types with identical signatures. Since NonNullableRepository and NullableRepository appear to be specialized variants of Repository (which itself is likely related to RepositoryCore), having getAll duplicated in every class without distinct behavior or return type differences creates unnecessary API surface duplication. If these are meant to be distinct interfaces, the naming convention implies a hierarchy that isn't reflected in the method set (e.g., RepositoryCore has getLastSaved but others don't, yet getAll is everywhere).
New (5)
- Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (registry.npmjs.org unreachable)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- Pass-through layer (src/repository/NullableRepository.ts)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
almin/ddd-base was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 9 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 960738a4530226379918dced104245726eb81e9e — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-bb0cb800cd0f.