-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add CI check to ensure no devDependency is required in production #7796
Comments
Thanks for opening this issue!
|
@mtrezza, I completely forgot that an eslint rule exists for this use case ! Eslint will also helps to warn the developer directly in the IDE https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md |
Even better! I had a quick look but not sure how to set the rule options for our use case. |
for this eslint rule @mtrezza we need to exclude the
Then it should throw an error if we import a EDIT: It will not cover missing peer dep in production usage, but in our case @apollo was already imported directly, eslint will be able to prevent the issue first. Also peerdeps in common use cases are also required directly in the project (like react, apollo) and common utils when you work with a specific technology. So i'm convinced that the eslint rule in 99% of the time will catch a missing prod peer dep. |
That looks good; and according to the docs it seems to consider |
New Feature / Enhancement Checklist
Current Limitation
The CI currently installs all dependencies including
devDependendies
, which are required to run tests. Therefore, if a dependency is required for a production deployment, but has accidentally been added todevDependendies
instead ofdependendies
, the CI cannot not detect that and Parse Server may crash in a production deployment.Feature / Enhancement Description
Add CI check that ensures all dependencies that are required for a production deployment are added in under
dependendies
and none of thedevDependendies
is required.Maybe a tool like https://www.npmjs.com/package/dependency-check can make this easy to implement.
Example Use Case
See issue #7786
Alternatives / Workarounds
The text was updated successfully, but these errors were encountered: