Closed Zaid-Ajaj closed 5 years ago
In general, I am in favour of having a tool that does only one job, the same goes for libraries, etc. So I think Femto should be focused only on checking the npm dependencies validity.
Also, paket is not always installed as a global tool. People can install it under .paket/paket.exe
or even at the root of their repo, etc.
It seems easy to break the paket installation check.
In general, I am in favour of having a tool that does only one job, the same goes for libraries, etc.
In general, I agree but existing tools make it complicated to install a package, depending on the project structure, there different ways to do the same thing with variables :
paket * yarn | paket * npm | nuget * yarn | nuget * npm
I want to abstract that away and lower the entry barrier when it comes to installing packages.
Also, paket is not always installed as a global tool. People can install it under .paket/paket.exe or even at the root of their repo, etc.
We can recursively search for a .paket/paket.exe file since paket.dependencies
file is always sibling to .paket
directory, if it is there, then we use it, otherwise we use the global paket
command after checking it exists using paket --version
, if it then does not exist, then we tell the user to install paket anyway they like (global tool vs. local in the repo)
My comment is usually the same :) This will likely be considerable work and force you to keep Femto in sync with the changes in other tools that don't know about Femto, so it will increase the maintenance burden... but if you're up for the challenge I won't stop you :wink:
It is here, see this tweet
Introduce
install
command that unifies package installation between nuget and paket, then executes--resolve
afterwards to install potentially required npm packages.Workflow of
femto install <package>
1 - Paket
Detect paket usage by checking the existence of
paket.references
file. if the file exists then check which dependency group should be used by parsing the first line of the ofpaket.references
and extracting the used group from it, if no dependency group is used, then useMain
as the default group.femto install <package>
will then compute and execute the paket command2 - Nuget
if no
paket.references
is found, thenfemto install <package>
will issue the commanddotnet add package <package>
and resolve required dependencies afterwardsPropagate the use of
--version
The command
femto install <package> --version <version>
propagates the--version <version>
parameter to both the paket and nuget install commandsProposal: install paket if it is not installed or tell the user to install it?
Detect whether paket is installed using
paket --version
and install it usingdotnet tool install paket -g
or just show an error message to the user telling him or her that they should install paket and giving them the required download link or download commands.@MangelMaxime @alfonsogarciacaro What do you guys think?