- Fork this repository to your own GitHub account and then clone it to your local device. (
git remote add upstream git@github.com:expo/snack.git
😉) - Make sure you have the following packages globally installed on your system:
- Install the Node packages (
yarn install
) - chalet is used to run local services on the
expo.test
domain.- Update
~/.chalet/conf.json
to use{ "tld": "test" }
- Configure your system or browser to use the
.test
domain - Restart or refresh your network settings to apply the chalet changes
- Update
- Run
yarn build
in the root directory to prepare the installation.
Run yarn start
from the root to start the Snack development services.
Some services like the Expo API server and the Expo website are hosted elsewhere and are proxied. The proxies log all incoming requests and auto-redirect to locally running instances when possible.
To view the website, open http://snack.expo.test or http://localhost:3011.
All contributors can test package bundling and run the tests. It is currently only possible for Expo developers to run the full Snackager server, which requires access to API keys. We are working on making this possible for external contributors.
By default, the latest runtime that was deployed to staging is used. To start the runtime in development, see Runtime development.
Testing is done using Jest, the delightful JavaScript Testing Framework.
- Create a test for your feature in the appropriate
src/__tests__
directory (if the file doesn't exist already, create it with the*-test.ts
or*-test.tsx
extension). - Run the test with
yarn test
and ensure it completes successfully. Use mocks when possible to reduce dependencies on online services and to speed up the test.
If this is your first time committing to a large public repo, you could look through this neat tutorial: "How to Write a Git Commit Message"
Commit messages are formatted like so: [website] Title
. Examples:
[docs] Fix typo in xxx
[runtime] Add support for SDK 40
[sdk] Add test-case for custom transports
[snackager] Improve logging for git imports
[website] Update loading icon
To help keep CI green, please make sure of the following:
- Run
yarn lint --fix
to fix the formatting of the code. Ensure thatyarn lint
succeeds without errors or warnings. - Run
yarn test
to ensure all existing tests pass for that package, along with any new tests you would've written. - Run
yarn build
to ensure the build runs correctly and without errors or warnings. - Run
yarn doc
to update any auto-generated docs (when applicable). Commit any changed docs. - All
console.log
s or commented out code blocks are removed! :]
Hungry for more, check out these great guides: