Thank you for your interest in contributing to Coder Desktop! Below are the guidelines to help you get started.
Before opening the project in Xcode, you need to generate the Xcode project files.
We use XcodeGen to handle this
process, and the project generation is integrated into the Makefile
.
To ensure a consistent and reliable development environment, we recommend using
Nix with Flake support. All the tools required for
development are defined in the flake.nix
file.
Note: Nix is the only supported development environment for this project. While setups outside of Nix may work, we do not support custom tool installations or address issues related to missing path setups or other tooling installation problems. Using Nix ensures consistency across development environments and avoids these potential issues.
If you don’t already have Nix installed, you can:
-
Use the Determinate Systems installer for a simple setup.
-
Alternatively, use the official installer and enable Flake support by adding the following to your Nix configuration:
experimental-features = nix-command flakes
This project does not support non-Flake versions of Nix.
Run the following command to enter the development environment with all necessary tools:
nix develop
As an optional recommendation, you can use direnv
to
automatically load and unload the Nix development environment when you navigate
to the project directory. After installing direnv
, enable it for this project by:
-
Adding the following line to your
.envrc
file in the project directory:use flake
-
Allowing the
.envrc
file by running:direnv allow
With direnv
, the development environment will automatically be set up whenever
you enter the project directory. This step is optional but can significantly
streamline your workflow.
Once your development environment is set up, generate the Xcode project files by running:
make
This will use XcodeGen to create the required Xcode project files.
The configuration for the project is defined in Coder-Desktop/project.yml
.
Here are some useful make
commands for working with the project:
make fmt
: Format Swift files using SwiftFormat.make lint
: Lint Swift files using SwiftLint.make test
: Run all tests usingxcodebuild
.make clean
: Clean the Xcode project.make proto
: Generate Swift files from protobufs.make help
: Display all availablemake
commands with descriptions.
For continuous development, you can also use:
make watch-gen
This command watches for changes to Coder-Desktop/project.yml
and regenerates
the Xcode project file as needed.
To maintain code quality, ensure you run the following before submitting any changes:
-
Format Swift files:
make fmt
-
Lint Swift files:
make lint
-
Run tests:
make test
-
Fork the repository and create your feature branch:
git checkout -b feature/your-feature-name
-
Make your changes and commit them with clear messages.
-
Push your branch to your forked repository:
git push origin feature/your-feature-name
-
Open a pull request to the main repository.
Thank you for contributing! If you have any questions or need further assistance, feel free to open an issue.