-
Notifications
You must be signed in to change notification settings - Fork 833
chore(preview-server): cleanup dependencies, move most to devDependencies
#2473
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
base: canary
Are you sure you want to change the base?
Conversation
|
@hillac is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
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.
1 issue found across 2 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/preview-server/package.json">
<violation number="1" location="packages/preview-server/package.json:19">
json5 appears unused in preview-server; carrying it as a runtime dependency increases install size and supply-chain risk. Consider removing or moving to devDependencies if only needed for tooling.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
devDependencies
8128be7
to
19de23f
Compare
As previously discussed in #2371 many of the deps for preview-server aren't actually needed at runtime because they are bundled by next. This leads to hundreds of unnecessary packages being installed for end users of the preview-server. I've moved all the unneeded deps to devDeps.
I built, packed, and installed it in another project and everything runs fine. I double checked with a loader and require tracer that all imported packages are installed.
In light of constant npm supply chain attacks, I think this is important.
I also think sharp and spamc could be removed. I can't see where sharp is being used, and next seems to get it's own version as a transitive dep anyway. spamc seems strange, it's not imported anywhere in the code (only reference to it is in an error message in send-to-spamd.ts), deleting it from node modules at runtime seems to have no impact on functionality of the preview server. It's a really old and obscure package. I haven't removed these two yet as I'm not certain.
Summary by cubic
Moved non-runtime packages in preview-server to devDependencies to shrink install size for consumers and lower supply-chain risk. No behavior change; build and runtime imports verified.