Converting repos to snacks

Is there documentation available on converting repos/etc to snacks?

IE:

Interested in what the URL structure would be for converting Gists, etc.

Git import to snack expects a git repo containing a valid expo project targeting a currently supported SDK. The url is just whatever you would use to clone the repository locally.

Right, but if i wanted to manually create the URL, it seems it’s not the “exact” URL structure persay.

IE, this wouldn’t work (exact url):

This does

Seems to be a format that requires the first / after repo name, to be replaced with :. Additionally, a Gist doesn’t work with either format. So it seems limited to repos only.

From your question it seems like maybe you are not using the git import option here image

My understanding is gists are just regular git repos https://help.github.com/en/articles/forking-and-cloning-gists
so I would expect it to function if you can get package.json, app.json, etc into a gist. Not sure that has been tried before though so YMMV.

Gotcha. Was more looking for documentation on how the imports work under the hood (IE: manually recreating the link I sent). Had an idea for programmatically embedding snacks that could have benefited from knowing a bit more. May have to go back to the drawing board though :crazy_face:

Sure. The import dialog just dispatches a request to another service that does the heavy lifting (something like https://snackager.expo.io/git?branch=master&repo=GIT_REPO_URL&subpath=PATH_INSIDE_REPO_TO_EXPO_APP_ROOT)

The service doesn’t do much beyond:
1 fetching the code
2 basic validation the project looks like an expo project (has an app.json, uses a version we still supprt, has an App.js, etc)
3 converting the project to a form snack can run (see in snack-sdk https://github.com/expo/snack-sdk/blob/master/src/types.js)

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.