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

Prevent publishing packages with empty modules. #4093

Open
hayleigh-dot-dev opened this issue Dec 18, 2024 · 5 comments
Open

Prevent publishing packages with empty modules. #4093

hayleigh-dot-dev opened this issue Dec 18, 2024 · 5 comments
Assignees
Labels
good first issue Good for newcomers help wanted Contributions encouraged priority:medium

Comments

@hayleigh-dot-dev
Copy link
Member

Empty modules are "valid" Gleam in the sense they won't block compilation, but they are useless for a package to publish because they don't do anything! I can see two scenarios for why a package might have been published with empty modules:

  1. to stub out the package's API before it is complete.
  2. as a mistake

The first scenario is confusing for users and will waste folks' time as they work out what parts of the API actually exist. The second scenario is an unfortunate accident that the compiler could have prevented!

I propose Gleam refuses to publish any package if it contains empty modules, and emits warnings when building a project with empty modules.

@lpil
Copy link
Member

lpil commented Dec 19, 2024

Great idea! Thank you

@lpil lpil added help wanted Contributions encouraged good first issue Good for newcomers priority:medium labels Dec 19, 2024
@GiregL
Copy link

GiregL commented Dec 21, 2024

I'd like to work on this issue

@lpil
Copy link
Member

lpil commented Dec 21, 2024

Thank you @GiregL !!

@GiregL
Copy link

GiregL commented Dec 21, 2024

I'd like one indication tho
Since I don't wan't to publish tests or anything on Hex, what's the procedure to test the publish command without any side effect ?
I didn't found it in the docs

Thanks by advance !

@lpil
Copy link
Member

lpil commented Dec 21, 2024

There are integration tests you can see run in the GitHub CI workflow. Sorry I can't share them atm, I'm on my phone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Contributions encouraged priority:medium
Projects
None yet
Development

No branches or pull requests

3 participants