Closed
Description
- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
When trying to install a project template from other place than published as a npm
package (github forks, local filesystem, local tarfile, http server...) I can't be able to do it due to several problems. Debuging them, I get to the conclussion the problem is at
react-native/local-cli/generator/templates.js
Lines 112 to 120 in 26684cf
- lack of support to download a git project subpath (seems a problem in
npm
not supporting mono-repos) templateName
gets not cleaned, file extension should be removedtemplateName
can't be different of the package name at the templatepackage.json
file, correct name should be extracted once the template is installed- when installed from
npm
,installPackage
is just a concatenation of the stringreact-native-template-
and the provided template name, not allowing to use scoped packages as templates. Provided template should be checked and splitted, and the scoped prefixed to the generatedtemplateName
Environment
Environment:
OS: Linux 4.13
Node: 9.11.1
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
Xcode: N/A
Android Studio: 3.1 AI-173.4697961
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.2 => 0.55.2
Steps to Reproduce
Try to init a React Native project using a template from a git mono-repo, or from a local filesystem folder, or from a tarfile on the local filesystem or a web server, or from a scoped npm
package.
Expected Behavior
All the provided methods should be able to correctly install the provided template.
Actual Behavior
All of them fails.