templating icon indicating copy to clipboard operation
templating copied to clipboard

[Epic] Components

Open bekir-ozturk opened this issue 3 years ago • 3 comments

Audience: authors (advanced)

Background

Allow custom extensibility scenarios for the templates.

The template engine already considers extensibility by using components. Component is a class implementing IIdentifiedComponent interface. Template engine is managing components in ComponentManager class. At the moment the only way to install additional components is from code (adding components via ITemplateEngineHost or adding components via IEngineEnvironmentSettings.ComponentManager. To allow extensibility scenario:

  • the way of adding and managing additional assemblies with components should be implemented. The initial (currently disabled) implementation is available in Scanner.ScanForComponents method. Detected components are not saved to settings.
  • installing additional assemblies should be surfaced via command available in dotnet new.

Already defined components suitable for extensibility for template authoring:

Missing parts:

  • acquisition/distribution workflow for components assemblies/packages
  • managing the component assemblies versions (different templates may require the same component of different version)
  • documentation

Justification

  • give advanced authors more customization beyond standard features of template engine

Related issues:

  • [x] Components issues #2727
  • [ ] Move IPostActionProcessor component to Abstractions https://github.com/dotnet/templating/issues/3225
  • [x] https://github.com/dotnet/templating/issues/2723

bekir-ozturk avatar Mar 17 '21 12:03 bekir-ozturk

We would like to fetch a json file from a web service based on the parameter that is provided with dotnet new.

Ready thorugh the issues, this could be a way of doing it. Is there any progress on this? As we would need a customer PostAction as i believe?

PascalSenn avatar Apr 24 '22 22:04 PascalSenn

Can we get an example of doing post actions, implementing IPostActionProcessor. Still seems like its not possible

pksorensen avatar Jul 07 '22 13:07 pksorensen

Unfortunately we still don't have a timeframe for this feature, hence implementing custom post actions is not possible. Having more feedback on why the feature is important for you may help to prioritize it for the further releases.

vlada-shubina avatar Aug 15 '22 16:08 vlada-shubina