Skip to content
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

Investigate moving common dependencies to root to make updates easier #9106

Open
garethbowen opened this issue May 10, 2024 · 1 comment
Open
Assignees
Labels
Type: Technical issue Improve something that users won't notice

Comments

@garethbowen
Copy link
Member

Describe the issue

Updating dependencies is necessary for patching vulnerabilities quickly, but...

  • Updating dependencies manually is a big effort because it means navigating to a dozen directories (root, api, sentinel, webapp, admin, and all shared-libs) and doing an npm install. It's inevitable that we get inconsistencies with some dependencies being updated and some not.
  • Automatic updating through dependabot isn't working well because it does one directory at a time so you get a dozen PRs every time lodash updates.
  • Node services are packaged very crudely by just including all shared libs rather than just those that are needed for that service. This is not a big deal because if the code doesn't run then it shouldn't be exploitable, and it doesn't contribute much to image size.
  • Finally this continues to get worse as we add more and more shared libs

Describe the improvement you'd like

The way monorepos should work is all common dependencies (and maybe all dependencies) are defined at the root level. This works fine for bundled apps (admin and webapp) because the bundler pulls in only needed code. But we don't have a good solution for node services. This should be solvable by npm pack with bundledDependencies.

Describe alternatives you've considered

  • Bundling service code (eg: TS) but that adds another step to the dev build that I'd rather avoid.
@garethbowen garethbowen added the Type: Technical issue Improve something that users won't notice label May 10, 2024
@garethbowen garethbowen self-assigned this May 10, 2024
@garethbowen
Copy link
Member Author

Also check out the npm-pack-all-zip package..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Technical issue Improve something that users won't notice
Projects
None yet
Development

No branches or pull requests

1 participant