Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(remix-dev): Prioritize remix templates in CLI create #2733

Merged
merged 6 commits into from
Apr 12, 2022

Conversation

chaance
Copy link
Collaborator

@chaance chaance commented Apr 11, 2022

We've received a few issues where folks would step through the interactive CLI, select one of our templates and end up with an unexpected result, largely because we always prioritize local files when detecting the input type.

Since local files are likely going to be used less frequently than our built-in stacks and templates, this PR checks for those options first and ensures that those inputs are not matched to local files/directories to avoid conflicts. If a local file or forked repo is desired, the user can pass the full path/URL accordingly.

Closes: #2491

  • Docs
  • Tests

// 4. examples/<template> will use an example folder in the Remix repo
if (/^examples?\/[\w-]+$/.test(template)) {
return "example";
}

// 5. If the string contains no slashes, spaces, or special chars, we assume
// it is one of our remix-run/remix/templates.
if (/^[\w-]+$/.test(template)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't need to do this check since we are verifying our templates statically. I think this is better anyway since we don't have too many and they're easy to verify without fetching.

@mcansh mcansh changed the title fix: Prioritize remix templates in CLI create fix(remix-dev): Prioritize remix templates in CLI create Apr 12, 2022
@chaance chaance merged commit a04f3d1 into dev Apr 12, 2022
@chaance chaance deleted the chance/cli-templates-fix branch April 12, 2022 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create-remix templates don't work if a local folder of the same name as the template exists
2 participants