ligershark / side-waffle

A collection of Item- and Project Templates for Visual Studio
Other
657 stars 205 forks source link

Sidewaffle Extension for Visual Studio Code? #324

Open codewithtyler opened 8 years ago

codewithtyler commented 8 years ago

I've noticed that Visual Studio Code doesn't really have a smooth way to create a new project let alone one from a template unless you want to install a third party tool like Node and Yeoman. Even if you do install Node and Yeoman you are still pretty limited to web templates like generator-aspnet or others made with Yeoman.

Now that Code gives you the ability to create your own extension I'd like to know what the community thinks about having a SideWaffle extension for Code. I've already thought about this some and just a couple ideas I had included using Yeoman to download setup the projects/item templates or creating our own scaffolding tool to handle this for us.

RehanSaeed commented 8 years ago

+1. It would be great to somehow leverage existing project and item templates created using SideWaffle to use with Visual Studio Code. I myself was thinking of using Yeoman when I had time but this might be a good alternative.

codewithtyler commented 8 years ago

Precisely, I was thinking the end goal should be to have a single repository of templates. When a new template is merged into the repository it gets added to both the Code and Visual Studio versions of SideWaffle.

sayedihashimi commented 8 years ago

I've heard feedback that Windows users of VS Code don't like having to install npm/yo to get started with projects so I think this is a good idea.

In order to be successful I think we'll need more than just SideWaffle templates. I believe the following types of projects are being worked on in VS Code (around asp.net / .net).

  1. ASP.NET 5 / dnx
  2. ASP.NET 4.5
  3. MSBuild based projects (i.e. csproj) class library/console/wpf/etc

For ASP.NET 5 we have generator-aspnet to create ASP.NET 5/dnx projects & items from the command line which uses npm & yeoman.

For ASP.NET 4.5 the only way to create projects/items is Visual Studio. I'm not aware of any significant project to create ASP.NET 4.5 projects/items from the command line.

For MSBuild based projects we started generator-csharp but it stalled. So there is no good story from the command line there either.

If we create a SideWaffle for VS Code to have a good story I think we will need.

  1. Create templates for MSBuild based projects. To start with: class library, portable class library, console app, wpf app (maybe, if we feel that the VS designer is not needed), others? We could do this specifically for the VS Code project or create some more generic command line tool and then invoke that.
  2. Templates from generator-aspnet to create project and item templates for ASP.NET 5/dnx projects
  3. Templates from SideWaffle which are relevant outside of Visual Studio. Some will not be, for example the VS Extensibility templates.

For #2 and #3 hopefully we can create some automated process that can suck templates from generator-aspnet and SideWaffle to produce the VS Code templates.

Thoughts?

cc @peterblazejewicz @chrisdias

peterblazejewicz commented 8 years ago

I think VSCode lacks (by design) scaffolding solutions, staying transparent to bigger IDEs' conventions. That is probably why people use Yeoman or other tools to scaffold content and then VSCode recongnizes a project from variety of configuration files: https://code.visualstudio.com/Docs/editor/codebasics#_files-folders-projects Once there is a common, portable scaffolding tool, it can be converted into VSCode scaffolding tool, like this one for Ember: https://github.com/felixrieseberg/vsc-ember-cli Such tool could be OmniSharp cli if moved forward I think: https://github.com/OmniSharp/omnisharp-scaffolding

sayedihashimi commented 8 years ago

@peterblazejewicz yes you're right. The VS Code team didn't implement templates because they are trying to keep it lightweight. With that said they have enabled extensibility and people have asked for this feature. We have similar experience for Atom where you can invoke generator-aspnet to create a new project. Since we are planning to build it as an extension, for people who prefer the command line/yo they can certainly use that. omnisharp-scaffolding will be limited to ASP.NET 5 scenarios as well.

Forgot to mention that in OmniSharp we already have https://github.com/OmniSharp/vsce-aspnet which is supposed to be the VS Code extension to invoke generator-aspnet. So we may not need to add ASP.NET 5 specific templates.

codewithtyler commented 8 years ago

In the Code documentation it says that the team has made it so that extension developers do not have access to the program's DOM elements. After reading this one of the questions that comes to mind is how would we want to allow for creating a new project? @sayedihashimi said earlier that there are a lot of people who don't want to have to install Node/Yeoman. It's not very clear about the UI guidelines, I mean can we create our own "Add New Project" or "Add New Item" GUI outside Visual Studio then call that,

peterblazejewicz commented 8 years ago

@RandomlyKnighted There is no extensibility for UI model. Instead people extends/hook into Commands model to provide scaffolding. That Ember projects extends VSCode by adding sets of Commands and uses mix of ember-cli tool and custom code to scaffold Ember projects. This one hooks just single command to inject Yeoman scaffolding features. So the underlying tool can be crucial to extension success.

codewithtyler commented 8 years ago

Alright so I guess the question going forward is would we want to hook into Yeoman and use that for our underlying scaffolding tool or do we want to create our own specific to our needs?

codewithtyler commented 8 years ago

@peterblazejewicz @sayedihashimi what are you thoughts on this? Should we hook into Yeoman or create our own?

sayedihashimi commented 8 years ago

I have thoughts on this, but I can't type much due to an arm problem. Hopefully I can reply back here in a few days.

peterblazejewicz commented 8 years ago

@RandomlyKnighted I'd start small:

sayedihashimi commented 8 years ago

@peterblazejewicz @sayedihashimi what are you thoughts on this? Should we hook into Yeoman or create our own?

Sorry for the delay here.

Since SideWaffle covers many different areas and has Visual Studio specific content I think there may be some percentage of users who may be interested in a yo sidewaffle experience. I haven't heard much request for that specifically though so I don't think the desire is that great.

What I think is more desirable than yo in particular is to have a command line version of SideWaffle. That way you can automate scenarios and also use that from the command line for those who are interested in it. If we had a command line tool that could be bin deployed we could use that same component to plug templates into Visual Studio/yo/VSCode/etc.

I think we could take this opportunity to create a command line version of SideWaffle that's completely self contained in a bin deployable executable that is cross platform. The reason why I'm not doubling down on yo at this time is because I've heard mixed feedback of having to install components like npm/yo/etc. For the web devs they are mostly OK with it, but for other project types it may be too much. Also if we had a self contained xplat executable we could easily create plug it into yo and vs.

After having created SideWaffle I have some ideas of how we can simplify it even more. We could use this opportunity to make some of those improvements. The current implementation of SideWaffle is a bit nasty because it's heavily MSBuild based.

I'm thinking to create a prototype of what I mean in the form of a PowerShell script. If we do decide to actually create it I think we should use dnx/dotnet. I'm inclined to do it in PS first just so that I can convey my ideas clearly and get a sense for if people are interested in this.

For naming of the prototype I'm not sure if I should go with sidewaffle-ps or pecan-waffle. Thoughts on that?

codewithtyler commented 8 years ago

I love the idea of a CLI version of SideWaffle. Count me in on helping to build it!

My vote is for pecan-waffle.

stuartleeks commented 8 years ago

Posh-waffle? ;-)