Skip to content
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

Improve install of templates from places other than npm registry #18973

Closed
3 tasks done
piranna opened this issue Apr 22, 2018 · 10 comments
Closed
3 tasks done

Improve install of templates from places other than npm registry #18973

piranna opened this issue Apr 22, 2018 · 10 comments
Labels
Bug Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.

Comments

@piranna
Copy link

piranna commented Apr 22, 2018

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

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;
}
, not processing the template name correctly. Problems I've found in this code snippet are:

  • 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 removed
  • templateName can't be different of the package name at the template package.json file, correct name should be extracted once the template is installed
  • when installed from npm, installPackage is just a concatenation of the string react-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 generated templateName

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.

@react-native-bot react-native-bot added the Platform: Linux Building on Linux. label Apr 22, 2018
piranna added a commit to piranna/react-native that referenced this issue Apr 22, 2018
Add support for templates published as scoped packages. Partially fixes facebook#18973.
@stale
Copy link

stale bot commented Jul 21, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 21, 2018
@piranna
Copy link
Author

piranna commented Jul 21, 2018

This issue still needs community's attention. Can someone review it?

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 21, 2018
@scally-grab
Copy link

Came here to +1 this issue. Template install from NPM works fine, from git repos is worse, and from the local filesystem seems nearly nonfunctional for me.

@stale
Copy link

stale bot commented Nov 13, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 13, 2018
@piranna
Copy link
Author

piranna commented Nov 14, 2018

Yes, it still happens.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 14, 2018
@piranna
Copy link
Author

piranna commented Dec 21, 2018

Still happening with React Native 0.57.8.

@grabbou
Copy link
Contributor

grabbou commented Mar 11, 2019

@piranna, would you be open to move this to CLI repository and work together with us to improve this support? We are working on init right now and templates support is on our radar. Our team doesn't check this repository actively and issues like this can skip from our attention.

@piranna
Copy link
Author

piranna commented Mar 11, 2019

Hi @grabbou, where's the CLI repository? How can I be able to move this?

@grabbou
Copy link
Contributor

grabbou commented Mar 11, 2019

It's here -> https://github.com/react-native-community/react-native-cli/

I am afraid you just need to reopen issues there, close the ones here and (optionally), submit a PR again.

@rickhanlonii
Copy link
Member

Closing as this should be filed in the CLI as noted above 👌

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Linux Building on Linux. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants