JustinGrote / JustinGrote/Mortar

RFC: Template Definition

Open
#2 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
14
Forks
1
PR merge metrics
No merged PRs in 30d

Description

This is to gather feedback as to how templates are stored/discovered.

## Storage
Templates use the same engine as .NET templates, so their internal structure will follow the same patterns.

Templates will be stored within PowerShell Modules as folders. It is recommended to store them in a folder called "Templates" however this is not mandatory as their paths are defined in the PrivateData.
Arbitrary folders not in PowerShell modules can also be added, but can't be "discovered"

## Discovery Mechanism
Modules will advertise that they have a Mortar Template available with the `MortarTemplate` tag, this allows for quick search via both `get-module -listavailable` (local search) and remote search (`find-module -tag 'MortarTemplate'`). A command `Find-MortarTemplateModule` will be made available to simplify this discovery process. The results can be piped into Install-MortarTemplate to install the templates.

The module `PrivateData` must contain a `MortarTemplate` array that specifies paths relative to the module root for the root folder of the template(s) associated with the module. Each root template folder MUST have a `.template.config/template.json` defined or it is considered an invalid configuration. `Install-MortarTemplate` will inspect the module privatedata and install all templates in the module, optionally filtered by a `-Name` parameter.

Initially the templates will "install" to the global cache used by the .NET templating engine, ideally we adjust this so it uses the modules in-place where they exist in their module folders.

Templates defined in a module will share the version of the module. **FUTURE: Adding a version tag to the template.json will allow you to override the overarching module version**

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the proposed PowerShell module storage and PrivateData requirements, then compare them with the .NET template structure referenced in the issue. Trace the intended discovery flow through the MortarTemplate tag, Find-MortarTemplateModule, and Install-MortarTemplate. Done means the storage, discovery, installation, and versioning design has been agreed.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.