chvanikoff

chvanikoff

Mix deps.add functionality

Never thought I’ll ever compare Node and Elixir, but here I go…
Why don’t we have something similar to npm i(nstall) --save dependency@version with Mix? All the Node-world libraries have step 1 of the installation guide “run npm i --save this_lib@1.2.3” while all the Elixir-world libraries have step 1 "open mix.exs and add a dependency to the list of your dependencies like {this_lib, "~> 1.2.3"}. It can be better in terms of versions micro-management, name-collisions etc., but isn’t it all the same for npm? I think it would be really nice to have something like mix deps.add the_lib and I’m really not getting why don’t we have it so far.

Most Liked

jeramyRR

jeramyRR

Honestly, I think because really the time it takes to add it to mix.exs and to run mix deps.get is trivial. As developers laziness can be a good thing, but sometimes doing two steps instead of one isn’t that big of a deal. You could implement this on your own via a bash script using sed, but is it worth your time to automate this one step?

wmnnd

wmnnd

It’s a bit more complicated with mix.exs because unlike node’s package.json it’s not a structured file format (i. e. XML or JSON) which makes parsing and modifying it much harder.
Not only that, but It doesn’t even necessarily follow the same patterns for each project. While it is common to have a private deps/0 function as part of a MyApp.Mixfile module, one could decide to go about things in a completely different way.

chvanikoff

chvanikoff

Sure truth, but I think if we had a mix deps.add for the very basic Elixir app with a single deps/0 function in mix.exs, that would be great.

Where Next?

Popular in Discussions Top

jswny
I would like to better understand what the advantages/disadvantages of umbrella applications are compared to structuring your app as as s...
New
arcanemachine
https://nitter.net/josevalim/status/1744395345872683471 https://twitter.com/josevalim/status/1744395345872683471
New
Donovan
Hello everyone, I’m so glad to have discovered this awesome community. Thanks for creating it! This is my second post, and apologies for...
New
AstonJ
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them? Feel free to be as concise or in-depth as you li...
New
lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 14049 124
New
crabonature
I’m still quite new to Elixir. As I understand we got in Elixir “multi guards” as convention to simplify one large guard with or’s?: de...
New
Qqwy
I would like to spark a discussion about the static access operator: .. For whom does not know: it is used in Elixir to access fields of...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
scouten
I’m looking for a host for the server part of a small (personal) side project that I’m working on. It’s currently written in Node.js and ...
New
pdgonzalez872
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42158 114
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New

We're in Beta

About us Mission Statement