Skip to content

feat(ddd): add DeepImmutable type and simplify Immutable#49

Merged
pourdaavar merged 4 commits intomainfrom
feat/ddd-deep-immutable
Feb 19, 2026
Merged

feat(ddd): add DeepImmutable type and simplify Immutable#49
pourdaavar merged 4 commits intomainfrom
feat/ddd-deep-immutable

Conversation

@pourdaavar
Copy link
Contributor

Summary

  • Add DeepImmutable<T> type and related tests for deep readonly typing in the DDD package.
  • Simplify the existing Immutable type to use DeepImmutable internally.

Context

Improves type safety for immutable domain structures in @rineex/ddd.

Checklist

  • Feature (DeepImmutable + Immutable simplification)
  • Unit tests (deep-immutable tests)
  • Manual testing if needed

Note: Delete this branch after merge.

Made with Cursor

Introduce a new DeepImmutable type that recursively marks types as immutable, preserving class instances and converting collections to their readonly counterparts. Additionally, add tests to validate the behavior of DeepImmutable across various data structures, ensuring type safety and correctness.
Replace the previous implementation of the Immutable type with the newly introduced DeepImmutable type for improved clarity and maintainability. This change enhances type safety while preserving the functionality of marking types as immutable.
@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2026

🦋 Changeset detected

Latest commit: de635b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@rineex/ddd Patch
@rineex/auth-core Patch
@rineex/authentication-method-otp Patch
@rineex/authentication-method-passwordless Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pourdaavar pourdaavar self-assigned this Feb 19, 2026
Introduce a new "Type Tests" job in the CI workflow that runs `pnpm run test:types`. Added a corresponding script and turbo task for type testing, enhancing the testing capabilities of the project.
Update the "test:types" task in turbo.json to depend on the "build" task, ensuring that type tests are run after the build process, improving the reliability of type checking in the CI workflow.
@pourdaavar pourdaavar merged commit 904b55d into main Feb 19, 2026
5 checks passed
@pourdaavar pourdaavar mentioned this pull request Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant