CRA --template not picking up github url from a nested folder.
See original GitHub issueDescribe the bug
I am trying to init a create-react-app
with a github url
npx create-react-app my-app --use-npm --template git+ssh://git@github.com/<orgname>/<repo>.git/<folder-name>/react-scripts/cra-template-javascript
The issue is my github repo has multiple templates, I can run them locally like
npx create-react-app my-app --use-npm --template file:/Users/adeelimran/Desktop/adeel/repos/sandbox/adeel_imran/react-scripts/cra-template-typescript
But I can run it via the github link, because the project folder is under a nested github folder.
Did you try recovering your dependencies?
This issue does not have dependencies.
Which terms did you search for in User Guide?
https://create-react-app.dev/docs/custom-templates
Environment
Environment Info:
current version of create-react-app: 3.4.1
running from /Users/adeelimran/.npm/_npx/45395/lib/node_modules/create-react-app
System:
OS: macOS 10.15.5
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 14.4.0 - ~/.nvm/versions/node/v14.4.0/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.14.5 - ~/.nvm/versions/node/v14.4.0/bin/npm
Browsers:
Chrome: 83.0.4103.106
Firefox: 64.0.2
Safari: 13.1.1
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
(Write your steps here:)
- Create a github repo
- Inside that repo create some nested folders
- In one of the templates add the content as is from here https://github.com/facebook/create-react-app/tree/master/packages/cra-template
- On executing
npx create-react-app my-app --use-npm --template git+ssh://git@github.com/<username>/<repo-name>.git/folder1/fodler2/cra-template-javascript
- It should find this folder & init a CRA project using the given template
Expected behavior
(Write what you thought would happen.)
It should create the project reading from the github url.
Actual behavior
(Write what happened. Please add screenshots!)
![Screenshot 2020-06-24 at 15 28 27](https://user-images.githubusercontent.com/16651811/85565509-7de37c00-b62f-11ea-8513-2311ce4cdb53.png)
Reproducible demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
GIT: with CRA app in your rootfolder, how can I push to git ...
You need first to remove the gitlink (special entry recording the tree SHA1 of the nested git repository for the client folder)
Read more >Git - Submodules - Git SCM
We'll walk through developing a simple project that has been split up into a main project and a few sub-projects. Let's start by...
Read more >File Structure - React
One common way to structure projects is to locate CSS, JS, and tests together inside folders grouped by feature or route. ... The...
Read more >jsconfig.json Reference - Visual Studio Code
json? The presence of jsconfig.json file in a directory indicates that the directory is the root of a JavaScript Project. The jsconfig.
Read more >How to Deploy a Routed React App to GitHub Pages
When we build projects, we want to showcase them online. Instead of buying a domain and taking the time to configure it, it's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t know how common this use case is but this is probably something we can make work.
If you’d like to submit a PR adding this feature that would be great. I just put up a PR that affects this same code here: https://github.com/facebook/create-react-app/pull/9412. You would need to make some additional changes in the
getTemplateInstallPackage
function.