Codesandbox-client: Improve import from GitHub url validation

Created on 31 Dec 2017  ·  10Comments  ·  Source: codesandbox/codesandbox-client

There are a few improvements that could be made to the import from GitHub page. I will attempt to make these changes and submit a PR.

  • The page should accept hum4n01d/hogwash-client, github.com/hum4n01d/hogwash-client, and https://github.com/hum4n01d/hogwash-client as valid GitHub repo urls
  • The validator should check for github.com/username/repo rather than just github.com

Right now, it won't accept hum4n01d/hogwash-client as it doesn't contain github.com.

If I put the github link without https:// this happens:

screen shot 2017-12-31 at 1 56 19 pm

When I click Open Sandbox, it sends me to https://codesandbox.io/s/github.com/hum4n01d/hogwash-client which is invalid.

❕ Help Wanted 🔰 Beginner Friendly 🤔 Improvement

Most helpful comment

Yes, we could definitely use better parsing!

All 10 comments

Yes, we could definitely use better parsing!

@Hum4n01d
This would be great, as I have been trying (but unable) to import https://github.com/cantyjeffrey/react-boilerplate and have tried the following combinations with no such luck:

  • https://github.com/cantyjeffrey/react-boilerplate.git
  • https://github.com/cantyjeffrey/react-boilerplate
  • github.com/cantyjeffrey/react-boilerplate
  • cantyjeffrey/react-boilerplate

Am I missing something obvious as to why I can't import this repository?

screen shot 2018-01-05 at 12 30 15 pm

cc: @CompuIves

@cantyjeffrey I’ve had the same problem, though I don’t think it’s related to this issue :)

I agree. I tried uploading via CLI and think that the culprit is the fact that it’s an ejected CRA repo, which puts dependencies over the 40 dependency limit. Just a guess.

CLI threw error, but for GH import it’s a generic error message.

Also not working with branches with /

https://github.com/mrzvdesign/aviasales-demo-frontend/tree/feat%2Fmain-page

imported as
https://codesandbox.io/s/github/mrzvdesign/aviasales-demo-frontend/tree/feat%2Fmain-page
or with manually replaced to /
https://codesandbox.io/s/github/mrzvdesign/aviasales-demo-frontend/tree/feat/main-page

leads to

An error occured when fetching the sandbox:
has invalid format

Found the issue @evgenyrodionov 😄. There was a file with a different unicode character than 'c', but it looked like 'c'. I changed the file validation to make it work. Should work now.

Just took a look at your sandbox @cantyjeffrey, the project will work if you put all dependencies that are used for building are put in devDependencies in package.json. We will autodetect used dependencies in the future 😄

I'll close this one now since the initial GitHub URL converter issues are fixes. For any new issues we can open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Haroenv picture Haroenv  ·  3Comments

CompuIves picture CompuIves  ·  3Comments

andreplaranja picture andreplaranja  ·  3Comments

MarcelloTheArcane picture MarcelloTheArcane  ·  3Comments

yazaabed picture yazaabed  ·  3Comments