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

Support private Hex packages #3655

Open
SnakeDoc opened this issue Sep 29, 2024 · 9 comments
Open

Support private Hex packages #3655

SnakeDoc opened this issue Sep 29, 2024 · 9 comments
Labels
help wanted Contributions encouraged priority:high

Comments

@SnakeDoc
Copy link
Contributor

It would be great if Gleam supported publishing and fetching private packages from Hex.pm - https://hex.pm/docs/private

@lpil
Copy link
Member

lpil commented Sep 30, 2024

We want this for sure.

Could you expand on your need for them? It'll help me prioritise this work.

@lpil lpil added help wanted Contributions encouraged priority:medium labels Sep 30, 2024
@SnakeDoc
Copy link
Contributor Author

Thanks for considering this!

The main need for private packages is to allow individuals and organizations to work with internal/proprietary code and libraries that they want to keep private. This feature would enable us to host libraries and code on Hex.pm without making them part of the public registry. This, of course, would enhance Gleam's appeal to business and enterprise.

Presently, it appears the only way to handle private packages is to use local packages, or self-host hex. Neither are very convenient for a variety or reasons.

I have not dug too deeply yet, but it appears we might be able to leverage the work @NthTensor previously did with local packages (and the beginning of git packages). We might be able to add organization to gleam.toml (and manifest.toml where appropriate):

Use the organization when publishing to hex:

# head of gleam.toml
name = "foo"
organization = "bar"

Use the organization when fetching from hex:

# deps from gleam.toml
[dependencies]
fooey = { version = ">= 1.0.0 and < 2.0.0", organization = "bar" }

Users would still be required to also set the appropriate environment variables for HEXPM_USER and HEXPM_PASS.

Thoughts? 🤔

@lpil
Copy link
Member

lpil commented Sep 30, 2024

That all sounds very reasonable!

Are you using Gleam in your business and is this a blocker for your work? Thank you.

@SnakeDoc
Copy link
Contributor Author

Yes, we're an early stage startup, so we're just one small data point, but yes, it is currently a bit of a blocker for us. We're exploring work arounds, such as leveraging local packages, but supporting private packages on Hex would be the most ideal option.

@lpil
Copy link
Member

lpil commented Sep 30, 2024

Great, thank you. Let's try and get this done soon @gleam-lang/compiler-team.

I'm going to be short on time until after CodeBEAM but hopefully we can get it in for the next release.

@giacomocavalieri
Copy link
Member

Hello! Same for me: I'm at Goto this week and at Code BEAM the next but I can try and tackle this in between the two, or after Berlin! :)

@lpil
Copy link
Member

lpil commented Sep 30, 2024

I've reached out to Eric to see if we can get a free account to implement this with. If not we'll have to buy some accounts for a month or two.

@SnakeDoc
Copy link
Contributor Author

You guys are awesome 💯

If Hex won't provide free accounts to develop with, please let me know and I'll see what we can do to help.

@lpil
Copy link
Member

lpil commented Sep 30, 2024

They're sorting it out for us :)

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

No branches or pull requests

3 participants