mix deps.add

81 views
Skip to first unread message

Mike Binns

unread,
Aug 31, 2020, 4:26:24 PM8/31/20
to elixir-lang-core
Starting a conversation per this pull request:


The PR does the following:
--------------------------

Add the mix deps.add task. Supports options such as:

mix deps.add foo --version 1.2.3
mix deps.add foo (pulls latest version from hex)
mix deps.add foo --no-runtime
mix deps.add foo --only test --only dev
mix deps.add foo --path ../foo

---------------------------

José's reply:

----------------------------

I personally worried about going the string matching route. There are just too many things that can go wrong. For example, someone can even define all deps inline such as [{:foo, :bar}, {:baz, :bat}]. And this makes me skeptical about adding such solution to core. Ideally we would do something that hooks into the code formatter engine but even that has other complexities.

----------------------------

I definitely agree that the string parsing method is less than ideal, however I think it could be strengthened to deal with the most common formatter-legal possibilities, and we could validate mix.exs is formatted before running. For example the inline example given was a simple additional case for parsing (already pushed a fix), and we fail gracefully if a deps function isn't able to be identified.  Either way, the current string parsing or some other parsing method, I would love to see this feature make it across the finish line sometime soon.

-Mike Binns

GH: TheFirstAvenger

Alessio 'Blaster' Biancalana

unread,
Aug 31, 2020, 4:40:56 PM8/31/20
to elixir-l...@googlegroups.com
I started implementing a package two years ago and never got it working. One word: THANKS

Alessio

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/4540228d-1c7d-4065-b30a-c7f5a70f1b02n%40googlegroups.com.

Kurtis Rainbolt-Greene

unread,
Aug 31, 2020, 6:05:14 PM8/31/20
to elixir-lang-core
I'm a huge fan of this addition, it's probably a huge factor in why npm got so heavily adopted over early competitors as it eased new entries into the world. One advantage however that npm had is that their dep/lock format is in JSON. It makes things a lot easier for them and they get autosorting/autoformatting for free.

Bundler added a similar tool in the last 5 years, so the Ruby Together team can vouch for it's value and any issues that might be encountered by adding it.
Reply all
Reply to author
Forward
0 new messages