4lessandrodev/type-ddd
68.9
Adequate · 21 September 2026
3.3k
lines of production code
TypeScript
primary language
3
measurements over time
What this system is
This system is a TypeScript monorepo providing a collection of immutable value objects and utilities for common data validation and manipulation. It offers specialized packages for handling Brazilian identifiers (CPF, CNPJ, phone, zip code), along with standard value objects for email, password, username, date, and money. Each package enforces strict validation rules and returns results via a consistent Result pattern, ensuring type safety and graceful error handling across the domain layer.
Features
Add Brazilian phone number validation and formatting
The \@type-ddd/phone\ package introduces support for validating and formatting Brazilian phone numbers. It provides \HomePhone\ and \MobilePhone\ value objects that validate against Brazilian area codes and regex patterns. The main \Phone\ class offers static methods like \create\, \init\, \isMobile\, and \isHome\ to handle both mobile and landline numbers, including automatic stripping of special characters and formatting with masks.
packages/phone · high confidence
Added project configuration and documentation files
Added standard project files including .gitignore, .prettierignore, .prettierrc, CHANGELOG.md, CODE\_OF\_CONDUCT.md, CONTRIBUTING.md, LICENSE, Makefile, SECURITY.md, check-dev-deps.sh, global-setup.ts, jest.config.ts, lerna.json, tsconfig.json, update-peer-dependency.sh, and README.md. These files establish the repository's coding standards, build and test configurations, documentation, and licensing.
(repo-wide) · high confidence
Added scripts for local NPM registry authentication
Two new shell scripts have been added to the project to facilitate local development with a private NPM registry. The 'login.sh' script uses 'expect' to automate the interactive 'npm login' process for the local registry at localhost:4873. The 'make-user.sh' script automates the creation of an 'admin' user via a PUT request to the registry's user endpoint, extracts the resulting authentication token, and writes the necessary configuration to '.npmrc' for seamless package installation.
scripts · high confidence
Introduce @type-ddd/date package for date and time operations
The @type-ddd/date package is introduced, providing a Dates class for handling date and time operations in TypeScript. Users can now import the package to manipulate dates, calculate differences, format dates, and check validity. The package depends on the rich-domain library and includes comprehensive tests for date creation, addition, subtraction, and formatting.
packages/date · high confidence
Introduce @type-ddd/logger package with environment-aware logging
A new \@type-ddd/logger\ package has been added to the monorepo, providing a centralized logging utility built on \pino\. The logger supports \info\, \error\, and \warn\ log levels and includes a \checkEnv\ mechanism that allows runtime control of logging behavior based on the \NODE\_ENV\ and \TYPES\_DDD\_LOGS\ environment variables. This enables users to easily integrate structured logging into their applications while maintaining control over log verbosity in different environments.
packages/logger · high confidence
Introduce @type-ddd/password package for password management
The \@type-ddd/password\ package is introduced, providing a \Password\ value object for handling password validation, encryption, and comparison. It exposes static methods \create\, \init\, \random\, and \isValid\ to manage password states, alongside instance methods \encrypt\ and \compare\ to handle bcrypt-based hashing and verification. The package also includes a utility for generating random passwords of specified lengths.
packages/password · high confidence
Introduce @type-ddd/username package for DDD-style name handling
A new \@type-ddd/username\ package is added, providing a \UserName\ value object for Domain-Driven Design contexts. The package includes validation logic for name length (2-82 characters) and utility methods for capitalization, case conversion, and extracting name parts (first, middle, last). The \create\ method returns a \Result\ containing the \UserName\ instance or \null\ on failure, aligning with the \rich-domain\ library's Result pattern.
packages/username · high confidence
Introduce @type-ddd/zip-code package for Brazilian zip code validation
A new \@type-ddd/zip-code\ package is added, providing a \ZipCode\ value object for validating and formatting Brazilian postal codes. The API exposes \ZipCode.create()\ which returns a \Result\ that may be null (or fail) for invalid inputs, \ZipCode.init()\ which throws on invalid input, and static helpers like \isValid\, \addMask\, and \toPattern\ to handle formatting and validation logic.
packages/zip-code · high confidence
Introduced Money value object with safe integer validation and arithmetic operations
Added the @type-ddd/money package, providing a Money value object for handling monetary values in Domain-Driven Design contexts. The implementation includes static factory methods (create, init, zero, ten, etc.) that return a Result instance, where the create method now returns null (or a fail state) for invalid inputs like out-of-range integers, addressing issue \#194. The package exposes methods for sum, subtract, multiply, divide, and percentage calculations, along with currency formatting via the Intl API. Tests cover validation boundaries (MIN/MAX\_SAFE\_INTEGER) and arithmetic operations.
packages/money · high confidence
Release @type-ddd/cpf for Brazilian CPF validation
The @type-ddd/cpf package is now available, providing TypeScript type definitions and validation logic for Brazilian CPF numbers. It includes a \create\ method that returns a \Result\<CPF \| null\>\ to handle invalid inputs gracefully, alongside utility methods for formatting, masking, and comparing CPF values.
packages/cpf · high confidence
Release @type-ddd/email package with email validation and domain blocking
The @type-ddd/email package is now available, providing an Email value object for validating email addresses and extracting their nickname and domain parts. The package includes a validator utility that enforces length limits, character restrictions, and domain structure rules. Users can also configure blocked or allowed domains via static properties on the Email class. The public API includes isValid, init, and create methods, with the create method returning a Result\<Email \| null\> to handle validation failures gracefully.
packages/email · high confidence
Removals
Removed shared domain infrastructure classes
Deleted the shared domain layer files including AggregateRoot, Entity, BaseDomainEntity, Identifier, Result, UniqueEntityID, ValueObject, and the DomainEvents dispatcher. These classes provided core abstractions for entity identity, value objects, result handling, and domain event dispatching. The removal eliminates the shared infrastructure for domain events and entity management from the codebase.
Shared · high confidence
Behavioural changes
1 commit (0 fixes) modifying .nx
A change to existing behaviour in .nx — 1 commit, 1 file.
.nx · low confidence · unverified
Automated code quality checks on commit and push
Git hooks have been configured to automatically enforce code quality standards. On each commit, the system now runs TypeScript type checking and lint-staged to ensure code consistency. Additionally, the pre-push hook has been set up to run the full test suite before allowing pushes, ensuring that tests pass before code is shared.
.husky · high confidence
CNPJ validation now returns null for invalid values
The \CNPJ.create\ method in the \@type-ddd/cnpj\ package now returns a \Result\ containing \null\ when the provided CNPJ is invalid, rather than throwing an error. This change aligns with the \rich-domain\ library's updated behavior where the \create\ method returns a possibly null value in the Result instance. Users should update their code to handle the \null\ case in the Result value.
packages/cnpj · high confidence
Update changelog and fix type creation behavior
The changelog for the type-ddd package has been updated to reflect recent changes. A behavioral change was made to the type creation method, which now returns null instead of throwing an error, addressing issue \#194. Additionally, the money export was fixed, and a module not found error was resolved, as documented in the changelog.
packages/type-ddd · medium confidence
Test coverage
Added test coverage for CPF value object and validation utilities; Added tests for CNPJ value object and validation utilities; Added tests for email validation and value object; Added tests for password value object and utility functions; Added tests for the UserName value object; Added tests for the logger package; Added unit tests for phone number validation and formatting.
Dependencies
Initial release of the type-ddd monorepo and utility packages
The repository is initialized with a root package.json for the 'type-ddd' project, establishing a monorepo structure with workspaces for various utility packages. This includes individual packages for CPF, CNPJ, date, email, logger, money, password, patterns, phone, username, and zip-code, each configured with their own dependencies (such as 'rich-domain' and 'pino') and build scripts. The root package also defines development dependencies including TypeScript, Jest, Lerna, and Prettier, alongside a yarn.lock file to manage the full dependency tree.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 61 → 69 (+7.7)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 73 (-26.6)
- Architecture 69 → 100 (+30.8)
- Maturity 74 → 74 (+0.0)
- Readiness 47 → 72 (+24.2)
- Security 68 → 62 (-5.6)
Resolved (40)
- Coverage not included — suite not readable by the collector
- Critical CVE: [GHSA redacted] (yarn.lock)
- Critical CVE: [GHSA redacted] (yarn.lock)
- Critical CVE: [GHSA redacted] (yarn.lock)
- Critical CVE: [GHSA redacted] (yarn.lock)
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- …and 20 more
New (54)
- Critical CVE: [GHSA redacted] (yarn.lock)
- Critical CVE: [GHSA redacted] (yarn.lock)
- Critical CVE: [GHSA redacted] (yarn.lock)
- Critical CVE: [GHSA redacted] (yarn.lock)
- Documentation: no architecture or design documentation (README.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: written for insiders (README.md)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- High CVE: [GHSA redacted] (yarn.lock)
- …and 34 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
4lessandrodev/type-ddd 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 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 996145549e60bc7a7e6d6d744fd8bde9f65f08d5 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b84573e22831.