Skip to content

Package-based project templates (multi-level --template)#112

Merged
Sunrisepeak merged 1 commit into
mainfrom
feat/package-templates
Jun 4, 2026
Merged

Package-based project templates (multi-level --template)#112
Sunrisepeak merged 1 commit into
mainfrom
feat/package-templates

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Implements the package-templates design v2 (T1–T5, T7): multi-level --template SPEC (bare name → builtin frozen registry → package default template; pkg:tmpl / pkg@ver / pkg@ver:tmpl), mcpp.scaffold render 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.

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.
@Sunrisepeak Sunrisepeak merged commit e3da66c into main Jun 4, 2026
3 checks passed
@Sunrisepeak Sunrisepeak deleted the feat/package-templates branch June 4, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant