feat(create-gen-app): add inspect() method to TemplateScaffolder #34
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.
Summary
Adds an
inspect()method toTemplateScaffolderthat clones/caches a template and reads its.boilerplate.jsonconfiguration without scaffolding any files. This enables metadata-driven workflows where callers can read the template'stypefield before deciding how to handle scaffolding.New types exported:
InspectOptions: options for inspecting a template (template, branch, fromPath)InspectResult: result containing templateDir, resolvedTemplatePath, cacheUsed, cacheExpired, and the parsed.boilerplate.jsonconfigThe flow: clone/cache repo → resolve fromPath via
.boilerplates.json→ read.boilerplate.json→ return config (never callstemplatizer.process()).Review & Testing Checklist for Human
inspectRemote()duplicates cache/clone logic fromscaffoldFromRemote()(lines 189-235 vs 266-320). Verify they stay in sync and consider extracting shared logic.inspect()method has no dedicated tests. Consider if this is acceptable or if tests should be added before merge.inspect()reads from cache without network fetch. When cache is expired, it will re-clone before reading config.Test plan:
inspectTemplate()for metadata-drivenpgpm initpgpm init workspaceandpgpm init modulecorrectly read the template'stypefield and branch accordinglyNotes
This is part of a two-PR solution for metadata-driven CLI architecture:
inspect()method to create-gen-apppgpm initto single entry point using metadata-driven flowLink to Devin run: https://app.devin.ai/sessions/48555739db3d4f1b9e9edfa9ea1e559a
Requested by: Dan Lynch (@pyramation)