Paket.VisualStudio icon indicating copy to clipboard operation
Paket.VisualStudio copied to clipboard

Paket init

Open isaacabraham opened this issue 8 years ago • 14 comments

Currently, you can go to a solution with no NuGet packages and do a "Convert From", which seems to work and generate paket.dependencies etc.. It would be better to have an Init command (ideally available as a context item on the solution node in solution explorer). This should in a perfect world also create an empty paket.references file in every project in the solution.

isaacabraham avatar Nov 12 '15 00:11 isaacabraham

+1. I just also wanted to open exactly this issue. In the new Solution I don't want even start with NuGet. But for starting with Paket you need to open a console.

vilinski avatar Nov 12 '15 11:11 vilinski

I guess it's not implemented since I always projectscaffold new solutions. But yes this could be added. Any volunteers? On Nov 12, 2015 12:09, "Andreas Vilinski" [email protected] wrote:

+1. I just also wanted to open exactly this issue. In the new Solution I don't want even start with NuGet. But for starting with Paket you need to open a console.

— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket.VisualStudio/issues/85#issuecomment-156076244 .

forki avatar Nov 12 '15 11:11 forki

@vilinski you can use convey from nugget. It's not perfect but works.

@forki I can try. But not for another week or so.

isaacabraham avatar Nov 13 '15 22:11 isaacabraham

@isaacabraham yes, i use it all the time like here:

  • open folder in atom with ionide
  • paket convert from nuget
  • profit :)

vilinski avatar Feb 04 '16 12:02 vilinski

Once again I'm lagging behind here with my "I'll try to do this". Sorry.

isaacabraham avatar Feb 04 '16 12:02 isaacabraham

@isaacabraham I actually did implement the init function in the VS addin yesterday, but then after using it I realized that function is utterly useless. Like @vilinski said, you can simply use convert from nuget instead and it'll do a much better job. paket init only creates a paket.dependencies file, I don't think we need a UI command for that. Not only that, but I think there is a bug or at least inconsistencies when creating that paket.dependencies file because when you use paket init, it adds the nuget v2 source, but when you use convert from nuget it adds nuget v3 (with both exact same solutions that don't have anything special in them yet).

dcorriveau-omniscient avatar Feb 04 '16 13:02 dcorriveau-omniscient

What I would like to see though is something that adds a paket.references file to each project in the solution. Currently you look to manually do that. So this would be more than just paket init but something that sets up the solution (and projects) ready for paketing.

isaacabraham avatar Feb 04 '16 13:02 isaacabraham

@isaacabraham convert-from-nuget does add the solution level folder and link to paket.dependencies. image You don't need paket.references in your projects if you don't have... references yet. So after you've run convert-from-nuget you can use the UI to add packages and it'll create the paket.references for you and update the paket.dependencies

dcorriveau-omniscient avatar Feb 04 '16 13:02 dcorriveau-omniscient

I never use the Paket UI in VS - I find it too slow. I just go to the paket.dependencies file and manually add in the dependency I need, then do Paket install.

Maybe I should give it another go.

isaacabraham avatar Feb 04 '16 13:02 isaacabraham

I guess the point I'm making is that there are two different uses for the Paket tooling in VS - full UI integration, and lightweight command tooling (like Code and Atom) to quickly run commands like "paket install" or "add references file to this project" etc. etc. for a more "code-first" approach.

isaacabraham avatar Feb 04 '16 13:02 isaacabraham

Ok, but what are you looking for exactly (what are you missing from the convert-from-nuget command) ? You want it to create empty paket.references in each project of the solution ?

dcorriveau-omniscient avatar Feb 04 '16 13:02 dcorriveau-omniscient

Yes. Oh and maybe add paket.lock to the paket folder whilst we're at it - sometimes it's useful to look at.

isaacabraham avatar Feb 04 '16 13:02 isaacabraham

Ok then I will let you handle this and see with @forki if it's the direction you guys want to take. It seems to me like we're leaving the the paket world at that point since those things aren't actually required to setup a paket enabled solution, it seems more like a convenience in your case, which I would argue could be done with scripts. Empty paket.references aren't really required, but I understand in your case it's more convenient for you because it will save you the step to manually create them. Same for the lock file, which is only needed when you actually add references, and paket update will create that file for you anyway.

dcorriveau-omniscient avatar Feb 04 '16 14:02 dcorriveau-omniscient

I don't want to have the lock file in VS to modify it :-) Just to read it.

isaacabraham avatar Feb 04 '16 14:02 isaacabraham