Package-based project templates (multi-level --template)#112
Merged
Conversation
mcpp new --template now accepts a multi-level SPEC: a bare name resolves
the builtin registry first (frozen: bin; gui = transitional deprecation
alias), then falls through to a package template — pkg | pkg:tmpl |
pkg@ver | pkg@ver:tmpl. Packages opt in by shipping templates/<name>/
(template.toml metadata: description / default / post_message /
[template.inject] self features).
New mcpp.scaffold module: SPEC parsing, {{project.name}}/{{self.name}}/
{{self.version}} rendering (.in files; everything else verbatim; pure
data — no hooks/scripts), self-dependency injection (template's own
declaration wins), template listing. new --list-templates <pkg[@ver]>
prints a package's templates with the default marked. Fetch reuses the
dependency machinery (index lua -> semver latest -> install cache).
Builtin gui keeps working with a deprecation pointer; its pinned imgui
version bumps to current as a transitional stopgap (structural fix is
the package template itself: {{self.version}} cannot rot).
e2e 69 (hermetic: pre-seeded install cache + local index lua) covers
L0/L3 resolution, rendering, inject-vs-declared, listing, error paths,
gui deprecation.
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.
Implements the package-templates design v2 (T1–T5, T7): multi-level
--templateSPEC (bare name → builtin frozen registry → package default template;pkg:tmpl/pkg@ver/pkg@ver:tmpl),mcpp.scaffoldrender engine ({{project.name}}/{{self.name}}/{{self.version}}, pure-data, no scripts),[template.inject]features tie-in,--list-templates, gui deprecation alias. Hermetic e2e 69. Library-side templates (imgui) follow as T6.