Merged
Conversation
Replace the hardcoded parameter, prompt, and validation logic with a manifest-driven system. Each template directory now contains a template.psd1 that declares its parameters, conditions, sections, and layers. The engine processes any conforming manifest without special-casing. The Module template's configuration is decoupled from Anvil's source code. Parameter definitions, defaults, validation rules, file conditions, and CI layer declarations now live in template.psd1 rather than being spread across New-AnvilModule, Invoke-InteractivePrompt, and Assert-ValidConfiguration. New-AnvilModule gains a -Template parameter for scaffolding from custom templates. Users can point it at any directory containing a template.psd1 and the engine will prompt for parameters, validate input, apply conditions, and produce the output — no Anvil source changes needed. The built-in Module template is now an instance of the same system. Template engine changes: - Invoke-TemplateEngine supports IncludeWhen/ExcludeWhen file conditions and conditional content sections via <%#section%> markers - Module template configuration moved to template.psd1 manifest - Token replacement renamed from ModuleName to Name throughout templates - File/license/docs exclusion handled by manifest conditions instead of post-processing deletes - CI provider layering driven by manifest Layers declaration - Docs task conditionally included via template sections - Get-AnvilTemplate reads manifest metadata and discovers layers from manifest declarations rather than scanning for a CI directory - .gitattributes added to template for consistent line endings - Git init no longer stages and commits automatically New private functions: - Test-ManifestCondition, Test-FileCondition (condition evaluation) - Resolve-TemplateSections (conditional content blocks) - Format-TokenValue, Resolve-AutoToken (token formatting pipeline) - Invoke-ManifestPrompt, Assert-ManifestConfiguration (manifest-driven prompt and validation, replacing Invoke-InteractivePrompt and Assert-ValidConfiguration) - Read-TemplateManifest, Assert-TemplateManifest (manifest loading and schema validation) - Convert-PromptResult, Resolve-DefaultFrom, Read-PromptUri (helpers) New public functions: - Invoke-AnvilBuild (wrapper around InvokeBuild, resolves project root) Removed: - Invoke-InteractivePrompt, Assert-ValidConfiguration, Copy-CITemplates - getting-started/ directory no longer ships with scaffolded projects Documentation: - Consolidated docs and readme to flow better - Rewrote scaffolded project README - Added template-authoring.md guide - Updated all user-facing references to use Invoke-AnvilBuild - Added CompatiblePSEditions to module manifest template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the hardcoded parameter, prompt, and validation logic with a manifest-driven system.
New-AnvilModulegains a-Templateparameter for scaffolding from custom templates. Users can point it at any directory containing a valid template.psd1 and the engine will prompt for parameters, validate input, apply conditions, and produce the output. The built-in nodule template is now an instance of the same system.The scaffold template configuration has been (mostly) decoupled from Anvil's source code as a result. The template directory contains
template.psd1which declares the template parameters, conditions, sections, and layers.Template engine changes:
New private functions:
New public functions:
Removed:
Documentation: