Skip to content

Comments

feat(create-app): add custom template support via GitHub template sources#641

Open
derrick-nuby wants to merge 5 commits intodhis2:masterfrom
derrick-nuby:feat/create-app-custom-template-via-git
Open

feat(create-app): add custom template support via GitHub template sources#641
derrick-nuby wants to merge 5 commits intodhis2:masterfrom
derrick-nuby:feat/create-app-custom-template-via-git

Conversation

@derrick-nuby
Copy link

@derrick-nuby derrick-nuby commented Feb 12, 2026

Summary

This PR adds support for using a GitHub repository as a template source in @dhis2/create-app.
In addition to built-in templates (basic, react-router), users can now scaffold from public GitHub template repositories using shorthand or URL formats, with optional branch targeting.

What Changed

  1. Added template source parsing and detection for GitHub specifiers.
  2. Added external template source resolver for remote GitHub templates cloned into a temporary directory.
  3. Updated create flow to keep built-in template resolution in index.js, and use external resolver + cleanup in finally for Git templates.
  4. Added interactive flow option for Custom template from Git.
  5. Updated create-app docs and command docs with usage examples.

Supported Template Formats

  1. owner/repo
  2. owner/repo#ref
  3. https://github.com/owner/repo
  4. https://github.com/owner/repo#ref

Validation

Executed local and smoke tests for:

  1. Existing built-in template flow (regression-safe behavior).
  2. GitHub URL template source.
  3. GitHub URL with branch ref.
  4. Shorthand owner/repo#ref.

Notes

  1. Scope intentionally focuses on GitHub and public repositories.
  2. Private repo auth UX and non-GitHub hosts are out of scope for this PR.
  3. I did not include tests as this repo doesn't have a test suite, but I manually verified all scenarios and flows.

Copy link
Contributor

@kabaros kabaros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this @derrick-nuby ! I left some comments here .. let me know if it's not clear, or you disagree

Thanks again for the great code, and taking initiative in adding this feature 🙏🏿

@sonarqubecloud
Copy link

@derrick-nuby derrick-nuby requested a review from kabaros February 23, 2026 15:08
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.

2 participants