You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Gleam packages website maintains a copy of all the packages with the gleam build tool, which it gets by traversing the Hex API from newest to oldest until it finds new releases with that tool.
Would you be open to adding a filtering option for the build tools used? This would save both Hex and the Gleam packages site some work of sending the non-Gleam releases JSON over the network.
If you're open to this and have a particular design in mind I'm sure someone in the Gleam world could contribute an implementation.
Instead of %{gleam: "true"} you can do anything today, say %{language: "gleam"}. You could even store whether given package has, say, JS target, totally up to you. (It could be %{gleam_targets: ["erlang", "javascript"]} and then to find packages that have both, search query would be: extra:gleam_targets,[erlang] extra:gleam_targets,[javascript]
If this would to work out of the box, do you have any preferences how it should look like?
We could make build_tools:gleam, build_tools:gleam,mix etc work.
If it were to be out of the box we're not sure whether we should segment based on build tool or language, in Gleam's case it's kind of one and the same of course, so curious if you have any feedback about that point.
I'd like it to work for all the package releases that have already been published, so I think searching by the build tool would be best, as the extra field is not yet populated.
I don't have any particular preferences for the query syntax, what you've presented there looks great to me.
If it were to be out of the box we're not sure whether we should segment based on build tool or language, in Gleam's case it's kind of one and the same of course, so curious if you have any feedback about that point.
I didn't know there was a field for language! How are the languages of a package determined?
The Gleam build tool can compile 3 languages and with plugins Mix and Rebar can compile any number of languages, so maybe it's easier to go by build tool.
Yes, let's roll with filtering per build_tool, I suppose we can always add filtering per language down the road if there would be good use cases for that. WDYT @ericmj?
Activity
wojtekmach commentedon Apr 8, 2025
Hey @lpil, apologies for delay. Yes, this sounds good.
In fact we can do that today already with a little bit of extra work from your end (that we're OK to lessen, explained next).
Since #351 we can attach arbitrary "extra" metadata to packages. So we can have this:
(Note
"true"currently needs to be a string, an atomtruewon't do.)And then we can search on the website/API using this filter
extra:gleam,true.Instead of
%{gleam: "true"}you can do anything today, say%{language: "gleam"}. You could even store whether given package has, say, JS target, totally up to you. (It could be%{gleam_targets: ["erlang", "javascript"]}and then to find packages that have both, search query would be:extra:gleam_targets,[erlang] extra:gleam_targets,[javascript]If this would to work out of the box, do you have any preferences how it should look like?
We could make
build_tools:gleam,build_tools:gleam,mixetc work.In terms of implementation, this should do it:
If it were to be out of the box we're not sure whether we should segment based on build tool or language, in Gleam's case it's kind of one and the same of course, so curious if you have any feedback about that point.
lpil commentedon Apr 9, 2025
Brilliant, thank you!
I'd like it to work for all the package releases that have already been published, so I think searching by the build tool would be best, as the
extrafield is not yet populated.I don't have any particular preferences for the query syntax, what you've presented there looks great to me.
I didn't know there was a field for language! How are the languages of a package determined?
wojtekmach commentedon Apr 9, 2025
Sorry for confusion, that's the thing, there isn't a field for the language at the moment.
lpil commentedon Apr 9, 2025
Oh right!
The Gleam build tool can compile 3 languages and with plugins Mix and Rebar can compile any number of languages, so maybe it's easier to go by build tool.
wojtekmach commentedon Apr 10, 2025
Yes, let's roll with filtering per
build_tool, I suppose we can always add filtering per language down the road if there would be good use cases for that. WDYT @ericmj?In terms of implementation, one needs to add a
like
hexpm/lib/hexpm/repository/package.ex
Line 262 in 41f9b4f
lpil commentedon Apr 21, 2025
Excellent, sounds great! I'll see if anyone on the Gleam side would be able to make a PR for this.
Basic implementation of package search by build_tool
PragTob commentedon May 6, 2025
I took a stab at this in #1304 :)
Basic implementation of package search by build_tool
Build tool search (hexpm#1324)