Skip to content

Refuse to publish packages that import dev dependencies #4567

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

gideongrinberg
Copy link

This PR fixes #3143 by throwing an error when gleam publish is invoked and a dev dependency is imported in the code.

The check is implemented in do_build_hex_tarball. Another approach would be to implement the check in the analysis phase, but, as far as I can tell, there's no way to detect if the compilation has been invoked by gleam publish or something else.

I manually tested this and it works as expected, but I can add tests as well.

@gideongrinberg
Copy link
Author

@gideongrinberg
Copy link
Author

@inoas are there additional changes you think I should make?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler should refuse to publish a package that uses a dev-dependency in its source
2 participants