Add ability to use arbitrary repositories as templates in @drupal-canvas/create CLI
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3563860. --> Reported by: [wotnak](https://www.drupal.org/user/3558113) Related to !432 !431 >>> <h3 id="overview">Overview</h3> <p>Currently, the <a href="https://git.drupalcode.org/project/canvas/-/tree/1.x/packages/create">@drupal-canvas/create</a> CLI introduced in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3558752" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3558752</a></span> only allows selecting templates from <a href="https://git.drupalcode.org/project/canvas/-/blob/1.x/packages/create/templates.json">a predefined list</a>. It should also allow using arbitrary repositories as templates, so it can be used with public templates not included as one of the recommended ones and with private templates.</p> <h3 id="proposed-resolution">Proposed resolution</h3> <p>Add support for custom repository URL to the existing <code>--template</code> CLI option. First, check if the provided value matches one of the predefined templates, if not and the value matches a repository URL shape, use it as a template.</p> <p>Add a new <code>--ref</code> option to allow for using non-default branches and tags when cloning template repository.</p> <h3 id="ui-changes">User interface changes</h3> <p>The existing <code>--template</code> option that accepts predefined templates will now also accept URLs for a custom template's git repository.</p> <p>New optional <code>--ref</code> CLI arg to provide different branch/tag to use when cloning template repo.</p>
issue