-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Milestone
Description
Summary
PublicGitHubRepositorySource is fully implemented in @microsoft/spfx-template-api but is never exposed in the CLI. The create command only accepts --local-template for specifying template sources. Users need a way to point the CLI at custom public GitHub repos containing SPFx templates.
Requirements
Flag
| Flag | Type | Required | Description |
|---|---|---|---|
--remote-source URL |
string (repeatable) | No | Public GitHub repo URL to use as an additional template source |
Behavior
- Accepts URLs like
https://github.com/owner/repoorhttps://github.com/owner/repo.git - Can be specified multiple times to add multiple remote sources
- Templates from remote sources are merged with the default source and any local sources
- Applies to both
createandlist-templatescommands
Existing infrastructure
PublicGitHubRepositorySourceinapi/spfx-template-api/src/repositories/handles:- URL parsing (owner/repo extraction)
- ZIP download from
codeload.github.com - In-memory extraction and template parsing
- Branch specification (defaults to
main)
SPFxTemplateRepositoryManager.addSource()already supports multiple sources
Implementation notes
- Add
--remote-sourceas aCommandLineStringListParameterin bothCreateActionandListTemplatesAction - For each URL, create a
PublicGitHubRepositorySourceand add to the manager - Consider whether branch should be specifiable (e.g.,
URL#branchsyntax or separate flag)
Acceptance criteria
-
--remote-source URLflag accepted oncreatecommand -
--remote-source URLflag accepted onlist-templatescommand - Multiple
--remote-sourceflags can be combined - Templates from remote sources are discoverable and usable for scaffolding
- Clear error message on invalid GitHub URLs
Reactions are currently unavailable