This came to mind while developing our internal SDK. If you look at a monorepo like dotnet/runtime, when one needs to add a new solution, there are steps that go beyond dotnet new. These include creating Directory.Build.props files, adding repo-level properties, creating standard directories like src, test, benchmarks, etc. This could be streamlined with a new command that can at least create the files and directory structures.
Syntax
please scaffold <TemplatePath> <TargetPath> [--<VariableName> <VariableValue>]*
Behavior
- Take the directory at
TemplatePath and copy it to TargetPath
- Recursively replace the supplied variables with their values using some lightweight templating engine like Handlebars.Net
Notes
Not sure how to accomplish the 'add repo-level properties' part, eg. when scaffolding a new library called EpicLibrary, I want to add an EpicLibraryVersion property to some repo-level .props file. We could add a mechanism similar to Regedit's .reg files, however this is probably out of scope for a first version.
This came to mind while developing our internal SDK. If you look at a monorepo like dotnet/runtime, when one needs to add a new solution, there are steps that go beyond
dotnet new. These include creatingDirectory.Build.propsfiles, adding repo-level properties, creating standard directories likesrc,test,benchmarks, etc. This could be streamlined with a new command that can at least create the files and directory structures.Syntax
Behavior
TemplatePathand copy it toTargetPathNotes
Not sure how to accomplish the 'add repo-level properties' part, eg. when scaffolding a new library called
EpicLibrary, I want to add anEpicLibraryVersionproperty to some repo-level.propsfile. We could add a mechanism similar to Regedit's.regfiles, however this is probably out of scope for a first version.