-
Notifications
You must be signed in to change notification settings - Fork 902
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
build: use template from react-native #84
Conversation
We will need to update path here: https://github.com/react-native-community/react-native-cli/blob/master/packages/local-cli/upgrade/upgrade.js#L143 too. |
I was unable to get it up & running locally, so let's go through it once again, when the above is resolved too. |
destPath, | ||
newProjectName | ||
const templatePath = path.resolve( | ||
process.cwd(), |
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.
I think this needs to be destPath
(the project directory, passed from init()
) instead of the current working directory (which could be any dir where the command to create a project was run).
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.
actually we could just use require.resolve('react-native/template')
instead, since we are in context of node_modules
, right?
Note that destPath
is still passed on line 32. The diff might be confusing, but we are only changing the "path.resolve(__dirname, '../templates/HelloWorld')," part.
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.
Yeah, require.resolve
should work I think.
Remove
templates
fromreact-native-cli
and use template fromreact-native
repo.Tests:
Used https://github.com/verdaccio/verdaccio to create local distributions of
react-native
andreact-native-local-cli
and initialized project using those packages