The GitButler version control client, backed by Git, powered by Tauri/Rust/Svelte
Go to file
2023-12-28 14:53:29 +01:00
.cargo
.github update configuration to reflect new paths 2023-12-22 14:22:54 +01:00
.vscode 🔧 fix: update prettier configuration paths for gitbutler-ui 2023-12-22 20:51:21 +01:00
gitbutler-app add gitbutler-core package and move IDs to it 2023-12-28 14:53:29 +01:00
gitbutler-core add gitbutler-core package and move IDs to it 2023-12-28 14:53:29 +01:00
gitbutler-ui Prevent commit when no files selected 2023-12-23 17:27:54 +01:00
scripts update configuration to reflect new paths 2023-12-22 14:22:54 +01:00
.gitignore make the UI dev server run prior to debugging in vs code 2023-12-05 17:53:54 +01:00
Cargo.lock add gitbutler-core package and move IDs to it 2023-12-28 14:53:29 +01:00
Cargo.toml add gitbutler-core package and move IDs to it 2023-12-28 14:53:29 +01:00
package.json Bump @tauri-apps/cli from 1.5.1 to 1.5.6 2023-12-04 14:46:26 +00:00
pnpm-lock.yaml update configuration to reflect new paths 2023-12-22 14:22:54 +01:00
pnpm-workspace.yaml update configuration to reflect new paths 2023-12-22 14:22:54 +01:00
README.md update configuration to reflect new paths 2023-12-22 14:22:54 +01:00
rust-toolchain.toml add rust-toolchain.toml file 2023-12-11 11:09:19 +01:00

Development

Prerequisites

see here for the list of software required to build / develope the app.

Setup

Then, make sure to install app dependencies:

$ pnpm install

Run the app

Now you should be able to run the app in development mode:

$ pnpm tauri dev

By default it will not print debug logs to console. If you want debug logs, set LOG_LEVEL environment variable:

$ LOG_LEVEL=debug pnpm tauri dev

Lint & format

Javascript:

$ pnpm lint
$ pnpm format

Rust:

$ cargo clippy   # see linting errors
$ cargo fmt      # format code

Debug

Logs

App writes logs into:

  1. stdout in development mode
  2. Logs directory

Tokio

We are also collecting tokio's runtime tracing information that could be viewed using tokio-console:

  • developlent:
    $ tokio-console
    
  • nightly:
    $ tokio-console http://127.0.0.1:6668
    
  • production:
    $ tokio-console http://127.0.0.1:6667
    

Build

To build the app in production mode, run:

$ pnpm tauri build --features devtools --config gitbutler-app/tauri.conf.nightly.json

This will make an asset similar to our nightly build.

Building on Windows

Building on Windows is a bit of a tricky process. Here are some helpful tips.

File permissions

We use pnpm, which requires a relatively recent version of Node.js. Make sure that the latest stable version of Node.js is installed and on the PATH, and then npm i -g pnpm.

This often causes file permissions. First, the AppData folder may not be present. Be sure to create it if it isn't.

mkdir %APPDATA%\npm

Secondly, typically folders within Program Files are not writable. You'll need to fix the security permissions for the nodejs folder.

NOTE: Under specific circumstances, depending on your usage of Node.js, this may pose a security concern. Be sure to understand the implications of this before proceeding.

  1. Right click on the nodejs folder in Program Files.
  2. Click on Properties.
  3. Click on the Security tab.
  4. Click on Edit next to "change permissions".
  5. Click on Add.
  6. Type in the name of your user account, or type Everyone (case-sensitive). Click Check Names to verify (they will be underlined if correct).
  7. Make sure that Full Control is checked under Allow.
  8. Apply / click OK as needed to close the dialogs.

Perl

A Perl interpreter is required to be installed in order to configure the openssl-sys crate. We've used Strawberry Perl without issue. Make sure it's installed and perl is available on the PATH (it is by default after installation, just make sure to restart the terminal after installing).

Note that it might appear that the build has hung or frozen on the openssl-sys crate. It's not, it's just that Cargo can't report the status of a C/C++ build happening under the hood, and openssl is large. It'll take a while to compile.

Icon generation

$ pnpm tauri icon path/to/icon.png

Release

Building is done via GitHub Action. Go to the link and select Run workflow from the desired branch.

Versioning

When running the release action, you will have to choose one of major, minor, or patch release type. Action will generate a new version based on your input and current version found at https://app.gitbutler.com/releases.

Publishing

To publish a version that you've just build, use Release Manager.