Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

RFC: Embrace NET CLI templates #3

Closed

Conversation

nils-a
Copy link
Member

@nils-a nils-a commented May 2, 2021

No description provided.

@gep13
Copy link
Member

gep13 commented May 3, 2021

@nils-a what about VSCode? Does a .NET CLI template "appear" in here as well? We currently have a command in the VSCode extension to setup/add Cake related items to a workspace. Should we consider replacing that with this as well?

@nils-a
Copy link
Member Author

nils-a commented May 3, 2021

@gep13 :

what about VSCode? Does a .NET CLI template "appear" in here as well?

No, VSCode does not have the notion of project or item templates.

Should we consider replacing that with this as well?

Yes, definitively. As you said, we're currently using commands to simulate item templates. We could simply modify those commands internally, so that .NET CLI templates are used instead of the current flow. (The current flow being: There is a template for build.cake, the rest is downloaded on-the-fly.) We should probably consider installing/updating the templates package, as needed - the same way we do for the Cake runner.

I added Cake for VS Code to the motivations section, as this is one more template we're maintaining currently. I also added changing the inner workings of the commands in Cake for VS Code to the design section. (Not the auto-installation, though. I feel that's purely for consistency with the other workflows in Cake for VS Code.)

@nils-a nils-a requested a review from gep13 May 3, 2021 12:11
esp. https://youtrack.jetbrains.com/issue/RIDER-24197 - the
suggestion to implement .NET CLI item templates in rider.
@nils-a
Copy link
Member Author

nils-a commented May 11, 2021

I did some tests.

CLI currently looks like this:

❯ dotnet new -u
...
  Cake.Templates
    Details:
      NuGetPackageId: Cake.Templates
      Version: 0.1.0
      Author: Patrik Svensson, Mattias Karlsson, Gary Ewan Park, Alistair Chapman, Martin Björkström, Dave Glick, Pascal Berger, Jérémie Desautels, Enrico Campidoglio, C. Augusto Proiete, Nils Andresen, and contributors
    Templates:
      Cake Addin testproject (cakeaddintest) C#
      Cake Addin (cakeaddin) C#
      Cake Bootstrapper (cakebootstrap) PS
      Cake Bootstrapper (cakebootstrap) sh
      Cake Build file (cakebuild)
      Cake Frosting Build Project (cakefrosting) C#
      Cake Module (cakemodule) C#
    Uninstall Command:
      dotnet new -u Cake.Templates

❯ dotnet new cake --list
These templates matched your input: 'cake'.

Templates                    Short Name     Language  Tags
---------------------------  -------------  --------  ---------------------------------
Cake Frosting Build Project  cakefrosting   [C#]      Cake/Frosting/Windows/Linux/macOs
Cake Addin testproject       cakeaddintest  [C#]      Cake/Windows/Linux/macOs
Cake Addin                   cakeaddin      [C#]      Cake/Windows/Linux/macOs
Cake Bootstrapper            cakebootstrap  PS,sh     Cake/Windows/Linux/macOs
Cake Module                  cakemodule     [C#]      Cake/Windows/Linux/macOs
Cake Build file              cakebuild                Cake/Windows/Linux/macOs

Some of these have options, e.g. the two "test" projects from cake-vs are integrated in cakeaddintest via an option --empty.

In VS that looks like:
image

with all options available, the same as in CLI:
image

Rider sadly is not so perfect:
While it is possible to add icons to CLI templates and also rename the template. They will currently be listed under the category Other and will not have options available

image

I have not looked in VS Code, but since that's all custom code anyway I expect no surprises there.

@nils-a
Copy link
Member Author

nils-a commented May 16, 2021

Update: Adding a .NET component to the rider plugin (i.e. a ReSharper part) it is possible to get at least some parameters working. (And in fact this seems to be the "way" to provide solution templates in Rider.)

image

One downside is, that the templates (i.e. the content of the nupkg) needs to be included in the plugin.

@pascalberger
Copy link
Member

pascalberger commented Aug 11, 2021

I recently played with the idea of providing a template for Cake.Issue.Recipe. For Frosting, this would bascially be the Frosting template with Cake.Frosting.Issues.Recipe added and configured.

Do we also aim to integrate these community extensions into a single template? This could be for recipe script, but also for often used scenarios (e.g. a template for building a VS solution). I don't think .NET CLI templates are advanced enough to be capable to handle these through parameters or inheritance though

@nils-a
Copy link
Member Author

nils-a commented Aug 12, 2021

@pascalberger up to now, I've only thought about harmonizing the templates that we currently ship to keep the need for maintaining multiple template forms and versions to a minimum.

@gep13
Copy link
Member

gep13 commented May 6, 2022

The RFC process is no longer being followed for Cake. As such, I am going to go this pull request.

@gep13 gep13 closed this May 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants