-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Closed
Labels
BugPlatform: LinuxBuilding on Linux.Building on Linux.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
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
| if (template.includes('://')) { | |
| // URL, e.g. git://, file:// | |
| installPackage = template; | |
| templateName = template.substr(template.lastIndexOf('/') + 1); | |
| } else { | |
| // e.g 'demo' | |
| installPackage = 'react-native-template-' + template; | |
| templateName = installPackage; | |
| } |
- lack of support to download a git project subpath (seems a problem in
npmnot supporting mono-repos) templateNamegets not cleaned, file extension should be removedtemplateNamecan't be different of the package name at the templatepackage.jsonfile, correct name should be extracted once the template is installed- when installed from
npm,installPackageis 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugPlatform: LinuxBuilding on Linux.Building on Linux.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.