toolshed icon indicating copy to clipboard operation
toolshed copied to clipboard

Move Nerves-specific tools into a separate project

Open fhunleth opened this issue 3 years ago • 5 comments

Toolshed has grown to where it is useful to not only Nerves users. The dependency on nerves_runtime makes this project harder to build even though it's optional. Some people may decide against using toolshed just because of the word Nerves and the implication that this is for embedded systems.

The obvious thing to do would be to split the project into toolshed and toolshed_nerves/nerves_toolshed. The problem is that a LOT of Nerves users depend on toolshed and an update would require them to change that dependency. Perhaps we bump the version to indicate a breaking change and write a note, but I'm not sure whether there's a better option.

fhunleth avatar Mar 01 '21 13:03 fhunleth

How about let users specify options to use Toolshed like use Toolshed, :nerves for nerves specific use?

https://github.com/phoenixframework/phoenix/blob/v1.6.10/installer/templates/phx_single/lib/app_name_web.ex#L107-L109

mnishiguchi avatar Jun 30 '22 12:06 mnishiguchi

In talking to people, I feel like the word "Nerves" anywhere is somewhat toxic for including this in non-Nerves projects. It's probably best to just separate out the Nerves-specific utilities into their own project and force Nerves users to update their iex.exs files. Fwiw, the word "Phoenix" has been similarly toxic to some Nerves users when using libraries even if the library had only a superficial association with Phoenix.

fhunleth avatar Jun 30 '22 14:06 fhunleth

Maybe exit/0 is Nerves specific as well since people use regular IEx for non-Nerves use cases? https://github.com/elixir-toolshed/toolshed/blob/main/lib/toolshed/misc.ex#L63-L65

mnishiguchi avatar Jul 01 '22 23:07 mnishiguchi

Yes, I agree, exit/0 is Nerves-specific.

fhunleth avatar Jul 02 '22 00:07 fhunleth

I guess next step is to determine what functions to keep as generic core Toolshed as opposed to the Nerves-specific.

Which functions will surely stay in the core? I think all the rest could go to Toolshed.Nerves, which will be extracted into a separate package in the near future, maybe as NervesToolshed.

├── toolshed
│   ├── autocomplete.ex
│   ├── cat.ex
│   ├── date.ex
│   ├── grep.ex
│   ├── history.ex
│   ├── hostname.ex
│   ├── http.ex
│   ├── ifconfig.ex
│   ├── log.ex
│   ├── lsof.ex
│   ├── lsusb.ex
│   ├── misc.ex           # save_value/2, save_term!/2
│   ├── multicast.ex      # multicast_addresses/0
│   ├── nerves.ex
│   ├── nslookup.ex
│   ├── ping.ex
│   ├── top
│   │   ├── processes.ex
│   │   ├── report.ex
│   │   └── server.ex
│   ├── top.ex
│   ├── tping.ex
│   ├── tree.ex
│   ├── uptime.ex
│   ├── utils.ex
│   └── weather.ex
└── toolshed.ex

mnishiguchi avatar Jul 02 '22 18:07 mnishiguchi

I'm having second thoughts about this change after the past several months of thinking about how to upgrade and communicate the change to everyone using Toolshed with Nerves. I think that #168 will help with communicating how Nerves isn't pulled into non-Nerves use cases.

fhunleth avatar Jan 13 '23 21:01 fhunleth