-
Notifications
You must be signed in to change notification settings - Fork 918
Support versioned/tagged shorthand templates #483
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
Support versioned/tagged shorthand templates #483
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Can you also please add a test case to templateName.test.js
?
); | ||
const nameTagArray = templateName.split('@'); | ||
const name = nameTagArray[0]; | ||
const tag = nameTagArray[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's assign a default value here, so we can avoid branching:
const tag = nameTagArray[1]; | |
const tag = nameTagArray[1] || 'latest'; |
const name = nameTagArray[0]; | ||
const tag = nameTagArray[1]; | ||
const reactNativeTemplatePackage = `react-native-template-${name}`; | ||
var response; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var response; | |
const response = await fetch( | |
`https://registry.yarnpkg.com/${reactNativeTemplatePackage}/${tag}`, | |
); |
Let's hold off with this a bit. I have some issues with the "shorthand" approach in general, and ideally I'd like to either kill it or provide different flag for it. Check the following scenario: When passing
Both scenarios are bad and we can't really go with that in new |
Thanks for your help @Taym95, it's greatly appreciated and even though the PR is closed, your work is valuable to me and should help improve this workflow. |
I really appreciate all of your effort, thanks 🤘 |
I tried to fix #475