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

CRA --template not picking up github url from a nested folder. #9211

Open
adeelibr opened this issue Jun 24, 2020 · 5 comments
Open

CRA --template not picking up github url from a nested folder. #9211

adeelibr opened this issue Jun 24, 2020 · 5 comments
Milestone

Comments

@adeelibr
Copy link
Contributor

adeelibr commented Jun 24, 2020

Describe 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:)

  1. Create a github repo
  2. Inside that repo create some nested folders
  3. In one of the templates add the content as is from here https://github.com/facebook/create-react-app/tree/master/packages/cra-template
  4. 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
  5. 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

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

@stale
Copy link

stale bot commented Jul 25, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jul 25, 2020
@stale
Copy link

stale bot commented Aug 1, 2020

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

@stale stale bot closed this as completed Aug 1, 2020
@iansu iansu reopened this Aug 1, 2020
@stale stale bot removed the stale label Aug 1, 2020
@iansu iansu removed the needs triage label Aug 1, 2020
@iansu
Copy link
Contributor

iansu commented Aug 1, 2020

I don't know how common this use case is but this is probably something we can make work.

@iansu iansu added this to the 4.1 milestone Aug 1, 2020
@adeelibr
Copy link
Contributor Author

adeelibr commented Aug 3, 2020

@iansu is there any way that I can help out with this issue? :)

@iansu
Copy link
Contributor

iansu commented Aug 4, 2020

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: #9412. You would need to make some additional changes in the getTemplateInstallPackage function.

@raix raix modified the milestones: 5.1, 5.x Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants