2023-08-22 10:46:48 +03:00
# Development
2023-02-03 18:23:13 +03:00
2023-08-22 10:46:48 +03:00
## Prerequisites
2023-01-31 17:55:57 +03:00
2023-01-31 18:01:58 +03:00
[see here ](https://tauri.app/v1/guides/getting-started/prerequisites )
2023-02-03 18:23:13 +03:00
for the list of software required to build / develope the app.
2023-08-22 10:46:48 +03:00
## Setup
2023-01-31 17:55:57 +03:00
2023-04-18 13:42:44 +03:00
Then, make sure to install app dependencies:
2023-01-31 17:55:57 +03:00
2023-01-31 18:01:58 +03:00
```bash
$ pnpm install
```
2023-01-31 17:55:57 +03:00
2023-08-22 10:46:48 +03:00
## Develop
### Running the app
2023-02-03 18:23:13 +03:00
2023-04-18 13:42:44 +03:00
Now you should be able to run the app in development mode:
2023-01-31 18:01:58 +03:00
```bash
$ pnpm tauri dev
```
2023-02-03 12:36:51 +03:00
2023-08-22 10:46:48 +03:00
### Run Stories
2023-04-18 13:54:38 +03:00
2023-05-09 10:50:42 +03:00
Stories is our easy way to view our app components. Running the following command will launch in your default browser.
2023-04-18 13:54:38 +03:00
```bash
2023-05-09 10:50:42 +03:00
$ pnpm story:dev
2023-04-18 13:54:38 +03:00
```
2023-08-22 10:46:48 +03:00
### Lint & format
2023-04-18 13:54:38 +03:00
2023-08-22 10:46:48 +03:00
Frontend:
2023-04-18 13:54:38 +03:00
```bash
2023-08-22 10:46:48 +03:00
$ pnpm lint
2023-04-18 13:54:38 +03:00
$ pnpm format
```
2023-08-22 10:46:48 +03:00
Backend:
```bash
$ cd ./src-tauri
$ cargo clippy # see linting errors
$ cargo fmt # format code
```
## Debug
### Logs
App writes logs into:
1. stdout in development mode
2. [Logs ](https://tauri.app/v1/api/js/path/#platform-specific ) directory
### Tokio
We are also collecting tokio's runtime tracing information that could be viewed using [tokio-console ](https://github.com/tokio-rs/console#tokio-console-prototypes ):
- developlent:
```bash
$ tokio-console
```
- nightly:
```bash
$ tokio-console http://127.0.0.1:6668
```
- production:
```bash
2023-08-22 10:47:31 +03:00
$ tokio-console http://127.0.0.1:6667
2023-08-22 10:46:48 +03:00
```
## Build
2023-02-03 18:23:13 +03:00
2023-04-18 13:42:44 +03:00
To build the app in production mode, run:
2023-02-03 18:23:13 +03:00
```bash
2023-08-22 10:46:48 +03:00
$ pnpm tauri build --features devtools --config src-tauri/tauri.conf.nightly.json
2023-02-03 18:23:13 +03:00
```
2023-08-22 10:46:48 +03:00
This will make an asset similar to our nightly build.
2023-04-18 13:42:44 +03:00
## Icon generation
2023-04-13 14:39:03 +03:00
```bash
$ pnpm tauri icon path/to/icon.png
```
2023-08-22 10:46:48 +03:00
## Release
2023-02-03 12:36:51 +03:00
2023-02-17 16:21:41 +03:00
Building is done via [GitHub Action ](https://github.com/gitbutlerapp/gitbutler-client/actions/workflows/publish.yaml ).
2023-02-14 17:59:48 +03:00
Go to the link and select `Run workflow` from the desired branch.
2023-04-18 13:42:44 +03:00
### Versioning
2023-02-14 17:59:48 +03:00
2023-08-22 10:46:48 +03:00
When running the [release action ](https://github.com/gitbutlerapp/gitbutler-client/actions/workflows/publish.yaml ),
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` .
2023-02-17 16:21:41 +03:00
2023-08-22 10:46:48 +03:00
### Publishing
2023-02-17 16:21:41 +03:00
To publish a version that you've just build, use [Release Manager ](https://gitbutler.retool.com/apps/cb9cbed6-ae0a-11ed-918c-736c4335d3af/Release%20Manager ).