Skip to content

Conversation

@derrick-nuby
Copy link

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, including optional branch and subdirectory targeting.

What Changed

  1. Added template source parsing and detection for GitHub specifiers.
  2. Added template source resolver that supports:
    • built-in templates
    • remote GitHub templates cloned into a temporary directory
  3. Updated create flow to use templateSource and ensure resolver cleanup in finally.
  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. owner/repo#ref:subdir
  4. https://github.com/owner/repo
  5. https://github.com/owner/repo#ref:subdir

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. GitHub URL with branch + subdirectory.
  5. 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.

@sonarqubecloud
Copy link

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