react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Pluggable CLI templates, add coreapp-cpp project template

Open asklar opened this issue 1 year ago • 0 comments

Description

Today when creating a project from the CLI, we have a bit of a combinatorial matrix of possible options:

  • C# vs. C++
  • nuget vs. source
  • winui3 vs. system xaml
  • app vs. lib

It becomes hard to maintain to have to consider all 2^{N-1} combinations. The solution I am proposing is that in addition to the options we have today (which we keep in the init CLI for back-compat), we add a new --template parameter. This is a string, that just gets passed down to the RNW CLI package, so each version of the RNW package can support a different set of templates.

This enables defining a template manifest template.json that can override the old options, as well as set any nuget packages, and provide its own set of project files and sources. This decouples us from the {shared, cpp, cs} x {lib, app} model, which we will also need for winappsdk (since the project files are very different from uwp's).

Type of Change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update
Microsoft Reviewers: Open in CodeFlow

asklar avatar Aug 01 '22 05:08 asklar