feat(genomic): add recursive boilerplate scanning #48
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 recursive boilerplate discovery to the genomic scaffolder, enabling proper filtering of directories that contain
.boilerplate.jsonfiles. This solves the issue where non-boilerplate directories (likescripts/) would appear as options when using--dir .to bypass.boilerplates.json.Key changes:
scanBoilerplatesRecursivefunction that recursively finds all directories with.boilerplate.jsonfindBoilerplateByPathfunction for matching user-provided paths against discovered boilerplates (exact match, then unambiguous basename match)scanBoilerplatesmethod toTemplateScaffolderclass for convenienceresolveFromPathto use recursive scanning as a fallback resolution strategyWith this change, when a user runs
pgpm init --dir ., only directories with.boilerplate.json(e.g.,default/module,default/workspace) will be available as options.Review & Testing Checklist for Human
pgpm init --dir .only showsdefault/moduleanddefault/workspace, notscripts/findBoilerplateByPath- returns null for ambiguous matches (e.g., if bothdefault/moduleandsupabase/moduleexist,modulereturns null)resolveFromPath. For large template repos, this could add latency. Consider if caching is needed.Test Plan
pgpm init --dir .and verify only valid boilerplates appearpgpm init module --dir .and verify it resolves todefault/modulepgpm init workspacestill works (uses.boilerplates.json)Notes
SKIP_DIRECTORIESlist is hardcoded but can be extended viaskipDirectoriesoption