Releases: 4lessandrodev/rich-domain
v1.23.3
What's Changed
- Feat/init adapter type by @4lessandrodev in #159
- chore(deps-dev): bump @types/node from 20.12.12 to 20.14.0 by @dependabot in #160
- chore(deps-dev): bump @types/node from 20.14.0 to 20.14.2 by @dependabot in #161
- chore(deps-dev): bump typescript from 5.4.5 to 5.5.3 by @dependabot in #166
- chore(deps-dev): bump @types/node from 20.14.2 to 20.14.9 by @dependabot in #165
- chore(deps-dev): bump @types/node from 20.14.9 to 20.14.10 by @dependabot in #168
- fix(utils): fix circular ref json.stringify by @GaetanCottrez in #170
New Contributors
- @GaetanCottrez made their first contribution in #170
Full Changelog: v1.23.2...v1.23.3
v1.23.2
What's Changed
- Value Object Enhancements and Bug Fixes by @4lessandrodev in #153
- Value Object Enhancements and Bug Fixes by @4lessandrodev in #154
- chore(deps-dev): bump @types/node from 20.12.7 to 20.12.10 by @dependabot in #155
- chore(deps-dev): bump @types/node from 20.12.10 to 20.12.11 by @dependabot in #157
- chore(deps-dev): bump rimraf from 5.0.5 to 5.0.7 by @dependabot in #156
- chore(deps-dev): bump @types/node from 20.12.11 to 20.12.12 by @dependabot in #158
Full Changelog: v1.23.1...v1.23.2
v1.23.1
What's Changed
- Develop by @4lessandrodev in #147
- Fix/change to obj implementation by @4lessandrodev in #149
- [1.23.0] - 2024-04-28 by @4lessandrodev in #150
- test: added tools test by @4lessandrodev in #151
- Fix: Improved return typings in the
get
method of the value object. - Fix: Bug fix #152 when cloning an instance of a value object.
- Fix: Ensure that properties of an entity or aggregate will always be an object.
- Fix: Improved validations performed in the
isEqual
method of the value object.
Full Changelog: v1.23.0...v1.23.1
v1.23.0
Full Changelog: v1.22.1...v1.23.0
Changes
- Removed the
set
method from value object instances. - Changed the way the
toObject
method works. Path shortcutting of property access has been removed when props have only one attribute. - Implemented some improvements in how value objects handle primitive values.
Migrate from v1.22.1 to v1.23.0
- Break Change
If you are using the toObject
method in production to create a model from Aggregate, Entity, or Value Object domain instances, it is important to note that the property access path is no longer shortened.
Now the model object follows exactly the contract defined in props
.
For example:
If an object is defined in props
, even if props contains only one property, if it is an object, the toObject
method will generate a model according to props
.
Before v1.22.1
type Props = { value: number };
class Price extends ValueObject<Props>{};
const price = new Price({ value: 200 });
console.log(price.toObject());
// > 200
After v1.23.0
type Props = { value: number };
class Price extends ValueObject<Props>{};
const price = new Price({ value: 200 });
console.log(price.toObject());
// > { value: 200 }
If you want to maintain the return with primitive value without it being an object, use props
of primitive type.
class Price extends ValueObject<number>{};
const price = new Price(200);
console.log(price.toObject());
// > 200
Another alternative is to use an adapter.
class Adapter implements IAdapter<Domain, Model> {
adapt(domain: Domain): Result<Model> {
//...
}
}
price.toObject(new Adapter());
v1.22.1
What's Changed
- chore(deps-dev): bump typescript from 5.4.4 to 5.4.5 by @dependabot in #144
- chore(deps-dev): bump @types/node from 20.12.5 to 20.12.7 by @dependabot in #143
- #145 Feat: AutoMapperSerializer - add types for to object method by @hikinine in #146
Full Changelog: v1.22.0...v1.22.1
v1.22.0
What's Changed
- Feat/134/testing event emitter by @4lessandrodev in #138
- Added Context Communication #134 by @4lessandrodev in #139
- Update CHANGELOG.md by @4lessandrodev in #140
- Develop by @4lessandrodev in #141
- Develop by @4lessandrodev in #142
Full Changelog: v1.21.0...v1.22.0
v1.21.0
What's Changed
- test: fix tests by @4lessandrodev in #129
- Create SECURITY.md by @4lessandrodev in #130
- chore(deps-dev): bump @types/node from 20.11.30 to 20.12.2 by @dependabot in #131
- fix(shared): exporting TsEvents by @mmmoli in #133
- chore(deps-dev): bump typescript from 5.4.3 to 5.4.4 by @dependabot in #137
- chore(deps-dev): bump @types/node from 20.12.2 to 20.12.5 by @dependabot in #136
New Contributors
Full Changelog: v1.20.3...v1.21.0
v1.20.3
What's Changed
- feat: improve native uuid generation by @4lessandrodev in #128
Full Changelog: v1.20.2...v1.20.3
v1.20.2
What's Changed
- chore(deps-dev): bump @types/node from 20.11.28 to 20.11.29 by @dependabot in #125
- fix: ensure bind event handler context by @4lessandrodev in #127
Full Changelog: 1.20.0...v1.20.2
v1.20.0
What's Changed
- feat: added support to nodejs v21 by @4lessandrodev in #119
- 120 change the way to dispatch domain event by @4lessandrodev in #121
- ci: set version by @4lessandrodev in #122
- Feat/domain event handler by @4lessandrodev in #123
- feat: change the way to add and dispatch domain events by @4lessandrodev in #124
Full Changelog: v1.19.2...1.20.0