Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Lint
run: bun run lint

- name: Format check
run: bun run format:check

- name: Type check
run: bun run typecheck

- name: Build all platforms
run: |
bun run build:linux
bun run build:linux-arm
bun run build:macos
bun run build:macos-arm
bun run build:windows

- name: Upload release assets
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
files: |
dist/switch-craft-linux
dist/switch-craft-linux-arm64
dist/switch-craft-macos
dist/switch-craft-macos-arm64
dist/switch-craft-win.exe
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.idea
node_modules/
dist/
*.tsbuildinfo
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 2,
"printWidth": 100
}
74 changes: 74 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributing

## Development

```bash
# Install dependencies
bun install

# Build
bun run build

# Build local binary
bun run build:local

# Lint
bun run lint

# Format
bun run format
```

## Generating the Demo GIF

The demo GIF is created using [VHS](https://github.com/charmbracelet/vhs), a terminal recording tool.

### Prerequisites

1. Install VHS:
```bash
go install github.com/charmbracelet/vhs@latest
```

2. Install ttyd with nerd font support (for icons):
```bash
# Install dependencies
sudo apt-get install build-essential cmake git libjson-c-dev libwebsockets-dev

# Clone and build ttyd-nerd-font
git clone https://github.com/metorm/ttyd-nerd-font.git
cd ttyd-nerd-font && mkdir build && cd build
cmake .. && make
sudo make install
```

3. Install ffmpeg:
```bash
sudo apt install ffmpeg
```

### Recording the Demo

1. Build the project first:
```bash
bun run build:local
```

2. Run VHS with the tape file:
```bash
vhs demo.tape
```

This generates `img/demo.gif` from the instructions in `demo.tape`.

### Customizing the Demo

Edit `demo.tape` to change the recording. The tape file uses a test config (`config.example.json`) so your personal projects aren't shown.

Key VHS commands:
- `Type "text"` - Types text
- `Enter` - Press enter
- `Down` / `Up` - Arrow keys
- `Ctrl+o` - Ctrl+O keypress
- `Sleep 500ms` - Pause recording
- `Hide` / `Show` - Hide/show commands from recording
Loading