2018-02-01 23:08:53 +00:00
# Development Environment Setup
2017-05-04 02:57:57 +00:00
## Setup
2018-11-21 16:30:48 +00:00
Refer to the specific instructions for each platform:
2017-05-04 02:57:57 +00:00
2018-11-21 14:43:43 +00:00
- [macOS ](./setup-macos.md )
- [Windows ](./setup-windows.md )
- [Linux ](./setup-linux.md )
2018-11-21 16:30:48 +00:00
Experimental support for building Desktop is also available for these platforms:
- [ARM64 ](./building-arm64.md )
2018-03-28 17:30:01 +00:00
2018-03-15 06:26:03 +00:00
## Verification
2018-12-14 18:08:19 +00:00
Verify you have these commands available in your shell and that the found
2018-03-15 06:26:03 +00:00
versions look similar to the below output:
2017-05-04 02:57:57 +00:00
2017-10-19 23:45:04 +00:00
```shellsession
2017-10-20 00:08:59 +00:00
$ node -v
2022-09-29 20:52:37 +00:00
v16.13.0
2017-05-04 02:57:57 +00:00
2017-10-20 00:08:59 +00:00
$ yarn -v
2022-09-29 20:52:37 +00:00
1.21.1
2017-05-04 02:57:57 +00:00
2017-10-20 00:08:59 +00:00
$ python --version
2022-09-29 20:52:37 +00:00
Python 3.9.x
2017-05-04 02:57:57 +00:00
```
2018-03-15 06:26:03 +00:00
There are also [additional resources ](tooling.md ) to configure your favorite
editor to work nicely with the GitHub Desktop repository.
2017-05-04 02:57:57 +00:00
## Building Desktop
2019-04-18 15:15:40 +00:00
First, create a fork of `desktop/desktop` and then clone the repository to your local machine. You'll need to be inside the repository in order to build the application locally.
2019-04-17 20:34:10 +00:00
The typical workflow to get up running is as follows:
2017-05-04 02:57:57 +00:00
2017-09-26 00:22:11 +00:00
* Run `yarn` to get all required dependencies on your machine.
2017-10-10 00:21:43 +00:00
* Run `yarn build:dev` to create a development build of the app.
* Run `yarn start` to launch the application. Changes will be compiled in the
2018-04-17 16:14:43 +00:00
background. The app can then be reloaded to see the changes (< kbd > Ctrl/Command+Alt+R< / kbd > ).
2018-03-15 06:26:03 +00:00
2018-02-01 23:08:53 +00:00
**Optional Tip**: On macOS and Linux, you can use `screen` to avoid filling your terminal with logging output:
2017-11-09 00:16:13 +00:00
```shellsession
2017-11-10 01:05:59 +00:00
$ screen -S "desktop" yarn start # -S sets the name of the session; you can pick anything
2017-11-09 00:16:13 +00:00
$ # Your screen clears and shows logs. Press Ctrl+A then D to exit.
[detached]
$ screen -R "desktop" # to reopen the session, read the logs, and exit (Ctrl+C)
[screen is terminating]
```
2017-05-04 02:57:57 +00:00
2018-02-01 23:08:53 +00:00
If you've made changes in the `main-process` folder you need to run `yarn
build:dev` to rebuild the package, and then `yarn start` for these changes to be
reflected in the running app.
2017-05-04 02:57:57 +00:00
2020-12-14 19:08:53 +00:00
If you are using GitHub Enterprise with your development build of GitHub Desktop, you will need to follow a few extra steps to [authenticate properly ](github-enterprise-auth-from-dev-build.md ).
2019-10-05 01:21:23 +00:00
2017-05-04 02:57:57 +00:00
If you're still encountering issues with building, refer to our
2018-02-01 23:08:53 +00:00
[troubleshooting ](troubleshooting.md ) guide for more common
problems.
2017-05-04 02:57:57 +00:00
## Running tests
2018-02-01 23:08:53 +00:00
- `yarn test` - Runs all unit and integration tests
2019-09-05 21:57:14 +00:00
- `yarn test:unit` - Runs all unit tests
- Add `<file>` or `<pattern>` argument to only run tests in the specified file or files matching a pattern
- Add `-t <regex>` to only match tests whose name matches a regex
- For more information on these and other arguments, see [Jest CLI options ](https://jestjs.io/docs/en/23.x/cli )
2017-05-04 02:57:57 +00:00
## Debugging
Electron ships with Chrome Dev Tools to assist with debugging, profiling and
other measurement tools.
2018-04-28 02:48:46 +00:00
1. Run the command `yarn start` to launch the app
2017-05-04 02:57:57 +00:00
2. Under the **View** menu, select **Toggle Developer Tools**
When running the app in development mode,
[React Dev Tools ](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en )
should automatically install itself on first start when in development mode.
An additional extension, [Devtron ](http://electron.atom.io/devtron/ ), is also
2018-02-01 23:08:53 +00:00
included but is disabled by default. To enable Devtron, select the Console
tab in Chrome Developer Tools and run this command:
2017-05-04 02:57:57 +00:00
```js
require('devtron').install()
```
## The Next Steps
You're almost there! Here's a couple of things we recommend you read next:
2018-04-20 15:48:18 +00:00
- [Help Wanted ](../../.github/CONTRIBUTING.md#help-wanted ) - we've marked some
tasks in the backlog that are ideal for external contributors
- [Notes for Contributors ](../process/notes-for-contributors.md ) - some notes
for new contributors getting started