Skip to content

Conversation

@Esemesek
Copy link
Member

@Esemesek Esemesek commented Jan 11, 2019

Remove templates from react-native-cli and use template from react-native repo.

Tests:
Used https://github.com/verdaccio/verdaccio to create local distributions of react-native and react-native-local-cli and initialized project using those packages

@Esemesek Esemesek requested a review from grabbou January 11, 2019 19:50
@grabbou
Copy link
Member

grabbou commented Jan 14, 2019

@grabbou
Copy link
Member

grabbou commented Jan 14, 2019

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(),
Copy link
Contributor

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).

Copy link
Member

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.

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants