-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(shared): Eliminate circular dependencies #6743
base: next
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for novu-stg-vite-dashboard-poc failed. Why did it fail? →
|
@@ -1,4 +1,4 @@ | |||
import { PreferencesResponseDto, StepResponseDto, WorkflowCommonsFields } from './workflow-commons-fields'; | |||
import { PreferencesResponseDto, StepResponseDto, WorkflowCommonsFields } from './workflow-response.dto'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tatarco I think we made the exact parallel change in two PRs. Let's chat tomorrow to see how can we merge, the workflow-response.dto
or workflow-response-dto
.
packages/framework/package.json
Outdated
@@ -26,11 +26,12 @@ | |||
"format:fix": "prettier --write --ignore-path .gitignore .", | |||
"build": "tsup && pnpm check:circulars", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove the addition invocation of check:circulars
in build
now that we have postbuild
"build": "tsup && pnpm check:circulars", | |
"build": "tsup", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹💅🚀 awesome!
528ac3a
to
c205d5a
Compare
@novu/client
@novu/framework
@novu/headless
@novu/js
@novu/nest
@novu/nextjs
@novu/node
@novu/notification-center
novu
@novu/providers
@novu/react
@novu/react-native
@novu/shared
@novu/stateless
commit: |
The rule is: Entities depend on DTOs and Types. DTOs depend on Types Based on that all circular type dependencies under /types are resolved.
That is, make the check much stricter.
c205d5a
to
dd3b321
Compare
What changed? Why was the change needed?
Cause, why not ❓
@novu/shared doesn't have strict conventions regarding its folder structure. As a result, types import entities, dtos import types or entities, and so on. This resulted in a very large number of TS circular imports, causing unexpected issues and TS headaches.
This PR addresses that with the help of madge. 🙌
Consider it, as a first step towards a more structured, treeshakable
@novu/shared
, that contains meaningful share utility functions and types.