Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
[0.1.27] - 2026-03-27
Added
TLocaleRegiontype — strict union ("us" | "br") for country business rules (replacesTLocaleRules)TLocaleDatatype — strict union ("us" | "br") for API/persistence formattingTFormatTargettype —"display" | "data"parameter forformatted(target?)methodLOCALE_INTL_DISPLAYandLOCALE_INTL_DATA— separate exhaustive Record maps from locale to BCP 47 Intl codes
Changed
- BREAKING:
localeRulesrenamed tolocaleRegion(TLocaleRules→TLocaleRegion) - BREAKING:
TypeField.configure()now acceptslocaleRegionandlocaleData(3 independent axes) formatted(target?: TFormatTarget)— accepts optional target parameter ("display"default,"data"for API/persistence)formatNumber()unified withtargetparameter — replaces separateformatDataNumber()method- Documentation: all
dataFormatted()references replaced withformatted("data") - Documentation: all
localeRulesreferences replaced withlocaleRegion
[0.1.26] - 2026-03-27
Added
TLocaleDisplaytype — strict union ("us" | "br") for formatting locale (controlsformatted(),formatNumber())TLocaleRulestype — strict union ("us" | "br") for validation locale (controls business rules invalidateRules())LOCALE_INTL: Record<TLocaleDisplay, string>— exhaustive map from locale to BCP 47 Intl codesTypeField.assertNeverLocale()— compile-time exhaustiveness guard for locale switchesTypeField.formatNumber()— locale-aware number formatting in base class (used by FMoney, FCurrency, FInt, FFloat)- Locale-aware
formatted()inFMoney,FCurrency,FFloat,FInt— respectslocaleDisplay - Contributing docs:
convencoes.md— naming conventions, coding standards, prohibitions - Contributing docs:
criando-type-fields.md— complete guide for creating new TypeFields - Contributing docs:
testes.md— test runner, patterns, controlled exceptions Intl.NumberFormatcache informatNumber()— ~50x faster than uncachedtoLocaleString
Changed
- BREAKING:
TypeField.locale: stringreplaced byTypeField.localeDisplay: TLocaleDisplayandTypeField.localeRules: TLocaleRules - BREAKING:
TypeField.configure({ locale })replaced byTypeField.configure({ localeDisplay, localeRules }) - BREAKING: Default locale changed from
"international"to"us" configure()now uses!== undefinedchecks instead of truthy checks (prevents silent swallowing of falsy values)- 5 locale-aware TypeFields (FBankCode, FBankBranch, FBankAccountNumber, FStateCode, FDocumentId) refactored to exhaustive switch on
TypeField.localeRuleswithassertNeverLocale()default FIntdescriptions translated from Portuguese to English- Contributing docs:
desenvolvimento.mdrewritten with updated prerequisites, all commands, Docker, Husky hooks - Contributing docs:
arquitetura.mdupdated with 50+ TypeFields, current tool names, Application/Infrastructure in diagram - Contributing docs: Portuguese accents fixed across all 5 existing files (~100+ corrections)
FFloat.formatted()now respectsdecimalPrecisionconfig (was truncating to 3 decimals)FDocumentIdgeneric alphanumeric validation moved before locale switch (consistent with other TypeFields)- README.md and README.pt-BR.md rewritten with 12 code examples, commercial sections (humans, AI, full-stack), and complete TypeField catalog
- Sidebar labels: Portuguese accents fixed, all categories default to collapsed
- Sidebar: added 3 new contributing pages (Convenções, Criando TypeFields, Testes)
Fixed
- Adding a new locale to
TLocaleDisplayorTLocaleRulesnow causes TypeScript compile errors at every location that needs locale-specific handling
[0.1.25] - 2026-03-27
Added
- Husky pre-commit hooks — shared across all contributors via
.husky/pre-commit - Pre-commit runs 5 checks: typecheck, tests, tyforge-lint, docs build (local), docs Docker build (production)
"prepare": "husky"in package.json — hooks install automatically onnpm installSchemaBuilder.maxDepth— configurable maximum schema nesting depth (default: 50, validated via getter/setter)- CPF/CNPJ check digit validation (mod 11 algorithm) in
FDocumentCpf,FDocumentCnpj,FDocumentCpfOrCnpj FCurrency.formCreate()andFCurrency.formAssign()— form input normalization for decimal currencyseguranca.md— documentation page for security TypeFields
Changed
- Replaced native
.git/hooks/pre-commitwith Husky (committed to git, shared across team) - Worker timeout now configurable via
IBatchCreateOptions.workerTimeout(default: 30s) - PIX key validation: stricter email (
user@domain.tld) and phone (+digits 10-15) format checks FPasswordcomplexity documented as ASCII-only per NIST SP 800-63BFTotpSecretbase32 regex fixed to reject scattered padding
Fixed
batch-parallel.ts: clearTimeout moved to finally block (prevents timer memory leak on rejection)batch-parallel.ts: worker results collected via indexed Map (prevents race condition)batch-parallel.ts: worker termination now properly awaited on errorTypeGuard.isEnumKey: type guard added before.toString()— rejects non-string/non-number input (prevents type coercion bypass)- User input removed from all ExceptionValidation error messages (prevents XSS when messages are rendered in HTML)
[0.1.24] - 2026-03-27
Changed
TypeField.applyMask()changed toprotected static— only accessible by subclasses viaformatted()- Document TypeFields now call
applyMaskvia own class name instead ofTypeField.applyMask() - Removed standalone
mask.util.ts— moved to base class - nginx.conf: removed duplicate security headers (handled by host reverse proxy)
- Dockerfile.dev: added
COPY . .for standalone builds - Dockerfile: added
rm -rf node_modulesafter build to reduce cache - Sidebar: added Changelog and new TypeField categories (Moeda, Documentos, Bancário, PIX, Segurança, Enums)
[0.1.23] - 2026-03-27
Added
applyMask()shared utility (mask.util.ts) for progressive document masking
Fixed
- Portuguese error messages translated to English in
FInt,FPageNumber,FPageSize formatted()return type aliases fixed inFInt,FBoolean,FPageNumber,FPageSizeapplyMaskdeduplicated — extracted from 3 document files to sharedmask.util.ts- Documentation: corrected Portuguese accents across all Docusaurus pages
[0.1.22] - 2026-03-27
Added
FMoneyTypeField — monetary values stored as integer cents (zero floating point)FCurrencyTypeField — decimal convenience layer extending FMoney (accepts 10.50, stores 1050)FIdentifierTypeField — UUID base class for all ID types- Money arithmetic:
add(),subtract()(integer-safe, inherited by FCurrency) - Money comparisons:
isZero(),isPositive(),isNegative(),isGreaterThan(),isLessThan(),isEqualTo() - Money factory:
FMoney.zero(),FMoney.fromDecimal(),toDecimal() - Banking TypeFields:
FBankCode,FBankBranch,FBankAccountNumber,FBankNsu,FBankE2eId,FEmvQrCodePayload - Identifier TypeFields:
FTransactionId,FDeviceId,FCorrelationId,FReconciliationId,FIdempotencyKey,FCertificateThumbprint(extend FIdentifier) - Document TypeFields:
FDocumentCpf,FDocumentCnpj,FDocumentCpfOrCnpj,FDocumentRg,FDocumentId,FDocumentType,FDocumentStateRegistration,FDocumentMunicipalRegistration - Security TypeFields:
FTotpCode,FTotpSecret - PIX TypeFields:
FPixKey,FPixKeyType(withOPixKeyType) - Enum TypeFields:
FPersonType,FGender,FMaritalStatus,FTransactionStatus - Other TypeFields:
FStateCode,FFloat,FBusinessName - TypeField locale system:
TypeField.configure({ locale: "br" })for locale-aware validation - Subpath exports in package.json:
tyforge/result,tyforge/type-fields,tyforge/exceptions,tyforge/schema,tyforge/tools - Dynamic
import()for batch-parallel — fixes Metro bundler crash on React Native
Fixed
- Metro/React Native:
node:worker_threadsno longer loaded at top level in any import chain batchCreate()withconcurrency > 1silently falls back to sequential on browser/React Native
[0.1.19] - 2026-03-27
Added
browserfield in package.json — transparent Node.js/browser module substitutionbatch-parallel.browser.tsstub for browser/React Native environmentsIParallelProcessorinterface,IBatchCreateResulttype,TAssignUnknowntypecreateParallelProcessor()factory function (replaces direct class export)Eprefix convention for pure TypeScriptconst enumdeclarations
Changed
- Batch parallel module refactored: dependency injection via
assignUnknownparameter eliminates circular dependency withschema-build.ts IBatchCreateError,IBatchCreateOptions,IBatchCreateResultmoved toschema-types.ts(single source of truth)- Internal naming:
FieldKind→EFieldKind,CompiledField→ICompiledField,CompiledValidator→ICompiledValidator batchCreate()withconcurrency > 1falls back to sequential in browser (no error)
Fixed
- Circular dependency between
schema-build.tsandbatch-parallel.ts - Portuguese comments translated to English in
type-field.base.tsandschema-types.ts - Redundant
String()wrapper inbatch-parallel.tsworker result reconstruction
[0.1.18] - 2026-03-26
Added
TypeField.configure()for optional validation level overrideToolObjectTransformwithflatten()andunflatten()methodsToolCliParser,ToolFileDiscovery,ToolGitgeneric toolsTypeGuard.extractBoolean(),extractArray(),extractNumber(),extractString(),isRecord(),isCallable()- Expose/redaction system:
toJSON(config, exposeLevel)with"public","private","redacted"levels - Lint CLI:
--init,--update,--uninstallinteractive setup - Lint:
RuleRegistry,DisableCommentParser,IReporter/TextReporter/JsonReporter - Lint: hook managers (Husky, Lefthook, native git hooks)
- Next.js refactoring guide (
docs/guia-refatoracao-nextjs.md) - Documentation for tools, application layer, infrastructure, config
Changed
- TypeField validation split into
validateType()(static) +validateRules()(instance) create<T>()andassign<T>()now accept generic type for unknown input- Removed
validateRaw()—create<unknown>()replaces it - Removed
normalize()andparseString()from hot path - Config decoupled from core lib —
TypeFielduses hardcoded defaults, no filesystem I/O on import - Lint module restructured with OOP (Rule base class, RuleRegistry, Strategy pattern for reporters)
SchemaBuilderreads validation levels fromTypeField.createLevel/TypeField.assignLevel
Fixed
- Nginx
port_in_redirect off— prevents:4200in production redirects - MDX parsing in type-guard.md — escaped comparison operators
- Prototype pollution guard in
ToolObjectTransform.unflatten() - JSON.parse wrapped in try-catch in all config loaders
- Sensitive TypeFields (FPassword, FBearer, FSignature, FPublicKeyPem) preserve whitespace
Removed
validateRaw()from all TypeFieldsnormalize()from TypeField baseparseString()from TypeField base- Node.js tools from main barrel export (moved to direct imports)
[0.1.10] - 2026-03-23
Added
- Lint module with 10 rules (no-any, no-cast, no-non-null, no-ts-ignore, no-export-default, no-to-json-lowercase, no-new-type-field, no-magic-http-status, no-declare, no-satisfies-without-prefix)
batchCreate()with optional worker thread parallelismtyforge.config.jsonglobal configurationcomposeSchema()for schema composition- 15 canonical examples (01-15)
- Comprehensive test suite (246 tests)
- Benchmark suite (TyForge vs Zod) with Docker support
Changed
- Package renamed from
@navegar-sistemas/tyforgetotyforge - DTOs split into
DtoReq(request) andDtoRes(response) IMapperwithtoDomainPaginated()methodIRepositoryBasewith bulk operations and pagination
[0.1.4] - 2026-03-20
Added
- DDD checklist with 60 artifacts
- Complete test coverage for all examples
- Canonical naming conventions (F, T, I, O, Dto, DtoReq, DtoRes, Event, Exception, Repository, Mapper)
Changed
- Schema builder hot path optimized
- Node.js engine bumped to >=24
[0.1.0] - 2026-03-18
Added
- TypeFields: FString, FEmail, FId, FInt, FBoolean, FJson, FDate (7 variants), FAppStatus, FHttpStatus, FBoolInt, FPageNumber, FPageSize, FBearer, FPassword, FApiKey, FPublicKeyPem, FSignature, FTraceId, FText, FDescription, FFullName, FIdReq
- SchemaBuilder with
compile(),create(),assign()methods - Result pattern:
ok(),err(),isSuccess(),isFailure(),map(),flatMap(),fold(),match(),all(),allSettled(),toPromise(),OK_TRUE,OK_FALSE - Domain models: Entity, ValueObject, Aggregate, DomainEvent, Dto
- Application: UseCase, IMapper, CQRS interfaces, Saga
- Infrastructure: IRepositoryBase, IRepositoryRead, Paginated, IUnitOfWork
- Exceptions: 18 types following RFC 7807
- Docusaurus documentation site