Skip to content

Commit 451cfde

Browse files
authored
Modernize to v4.0.0 (#9)
* chore: replace eslint/prettier/jest with biome and vitest Update all dependencies to latest versions. Replace ESLint + Prettier with Biome for faster linting/formatting. Migrate tests from Jest to Vitest for native TS6 support. * chore: migrate to Tailwind CSS 4 Replace PostCSS plugin with @tailwindcss/vite. Remove tailwind.config.js and postcss.config.js. Use CSS-first config with @import and @custom-variant for class-based dark mode. * chore: remove dead code Remove unused preferences.tsx entry point (main.tsx handles routing), unused preferences.html, and unused useInit hook. * fix: resolve bugs and clean up code Rust: - Fix infinite recursion in config write on filesystem error - Remove unnecessary Arc<Mutex> wrapper on WebviewWindow in live download - Fix live stream relative segment URL construction (use base_url like VOD) - Replace .expect() with let _ on window.emit to prevent panics - Use app_handle.exit() instead of std::process::exit() - Fix get_tauri_conf() return type (Config instead of Option<Config>) - Remove unused _download_path params from internal download functions - Replace pub_struct! macro with direct derive - Remove duplicate form_confirm command TypeScript: - Fix showQualities set to true after fetch error - Fix silent swallowing of non-Error exceptions - Remove duplicate theme logic (ThemeProvider.tsx + useForm.ts) - Consolidate theme application in ConfigProvider * test: add tests for auth, playlist parsing, config and translations TypeScript: - Add getAuthHeaders tests (headers structure) - Add getAuthVariables tests (LIVE/VOD/CLIP variable generation) - Add getPlaylist tests (M3U8 parsing, chunked→Original mapping, errors) Rust: - Add AppConf tests (defaults, language lowercase, amend, serialization) - Add translations tests (all languages implement trait, expected values) * chore: update Rust deps and replace deprecated shell opener Run cargo update to latest compatible versions. Replace deprecated tauri-plugin-shell open() with tauri-plugin-opener for URL handling. * feat: bump version to 4.0.0 and fix dark mode in preferences Bump version to 4.0.0 across package.json, Cargo.toml and tauri.conf.json. Add missing dark theme overrides for preferences page (inactive tabs, backgrounds, labels, selects, borders). * fix: improve dark mode and preferences UX - Add close button to preferences window - Only ask to restart when language changes (not on every save) - Close preferences window after saving when no restart needed - Fix dark mode text colors (labels, inputs, selects) with !important to override Tailwind 4 layer specificity - Add "close" translation to all 5 locales * fix: correct translations across all locales - French: "Lumière" → "Clair" (theme light, not physical light) - German: "Klare" → "Löschen", "Licht" → "Hell", "Qualitäten erhalten" → "Qualitäten abrufen", less formal phrasing throughout - Italian: "Luce" → "Chiaro", "Scaricamenti" → "Download", "Cartella di scaricamento" → "Cartella di download" - English: "Deutsch" → "German" in language list for consistency - Spanish: add missing "downloadAnother" key * feat: Tailwind dark: classes, Portuguese locale, no-restart preferences Dark mode: - Replace manual CSS overrides with Tailwind dark: variant classes - Remove dark-theme.css overrides (keep only base styles) - All components now use dark: classes directly in JSX Preferences: - Remove restart requirement entirely - Add rebuild_menu Tauri command to update native menu on language change - Preferences now save and close without prompting New language: - Add Portuguese (pt) locale for frontend and Rust menu * fix: dark mode, preferences UX, open folder, and stale qualities Dark mode: - Fix @custom-variant syntax for Tailwind 4 (&:where(.dark, .dark *)) - Add color-scheme: dark for native form controls Preferences: - Save no longer closes window, shows checkmark feedback - Close button now works (added permissions for preferences window) - Emit preferences-updated event so main window refreshes live Downloads: - Replace shell open with opener plugin revealItemInDir for folders - Reset qualities when URL changes to prevent stale downloads * docs: update README for v4 Update technologies (Vitest, Biome, Preact, Vite, Tailwind 4), add prerequisites section, list features, add test/build commands, fix Tauri URL. * chore: fix linting, a11y, and update CI workflows - Fix Biome config (v1.x compatible with mixed Rust/TS projects) - Auto-fix formatting (trailing commas, import sorting, quote style) - Use import type where applicable - Replace forEach with for...of in manifest building - Fix a11y: tabs use button elements, spinner uses output element - Add key prop to playlist options - Add button type to close/save buttons - Update frontend CI: ESLint/Prettier → Biome, add Vitest - Update backend CI: add Tauri 2 system deps, add cargo test - Update release CI: use Tauri 2 deps for Ubuntu * chore: upgrade to Biome 2.x with Tailwind CSS support Upgrade Biome from 1.x to 2.4.9. Enable tailwindDirectives CSS parser for @custom-variant support. Use biome ci in CI workflow. Fix import ordering for Biome 2.x. * style: apply rustfmt formatting * chore: add npm run check script for full validation Runs biome ci, vitest, rustfmt check, clippy, and cargo test in one command. * chore: update GitHub Actions to latest versions - actions/checkout v4 → v6 - actions/cache v4 → v5 - actions/setup-node v4 → v6 * chore: update release workflow to Ubuntu 24.04 LTS * fix: align CI Linux deps with Tauri 2 docs Use official Tauri 2 prerequisites: add libxdo-dev and libssl-dev, remove legacy deps (libsoup-3.0-dev, libjavascriptcoregtk-4.1-dev, patchelf) that are pulled transitively by libwebkit2gtk-4.1-dev.
1 parent cde61a1 commit 451cfde

62 files changed

Lines changed: 19393 additions & 10127 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/backend_checks.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818

1919
- name: Cache Cargo Registry
20-
uses: actions/cache@v4
20+
uses: actions/cache@v5
2121
with:
2222
path: |
2323
~/.cargo/registry
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
sudo apt-get update
30-
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1 libayatana-appindicator3-dev
30+
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
3131
3232
- name: Install Rust toolchain
3333
uses: dtolnay/rust-toolchain@stable
@@ -44,6 +44,11 @@ jobs:
4444
cd src-tauri
4545
cargo clippy -- -D warnings
4646
47+
- name: Run tests
48+
run: |
49+
cd src-tauri
50+
cargo test
51+
4752
- name: Cargo Build
4853
run: |
4954
cd src-tauri

.github/workflows/frontend_checks.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@ name: Frontend Checks
33
on: [push, pull_request]
44

55
jobs:
6-
lint-and-format:
6+
lint-and-test:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v6
1111

1212
- name: Set up Node.js
13-
uses: actions/setup-node@v4
13+
uses: actions/setup-node@v6
1414
with:
15-
node-version: '20'
15+
node-version: '22'
1616

1717
- name: Install dependencies
1818
run: npm install
1919

20-
- name: Run ESLint
21-
run: npm run lint
22-
23-
- name: Check Prettier
24-
run: npm run prettier-check
20+
- name: Run Biome
21+
run: npx biome ci src
2522

23+
- name: Run tests
24+
run: npx vitest run

.github/workflows/release.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches:
66
- master
77

8-
# This is the example from the readme.
9-
# On each push to the `release` branch it will create or update a GitHub release, build your app, and upload the artifacts to the release.
10-
118
jobs:
129
publish-tauri:
1310
permissions:
@@ -20,17 +17,17 @@ jobs:
2017
args: "--target aarch64-apple-darwin"
2118
- platform: "macos-latest"
2219
args: "--target x86_64-apple-darwin"
23-
- platform: "ubuntu-22.04"
20+
- platform: "ubuntu-24.04"
2421
args: ""
2522
- platform: "windows-latest"
2623
args: ""
2724

2825
runs-on: ${{ matrix.platform }}
2926
steps:
30-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@v6
3128

3229
- name: setup node
33-
uses: actions/setup-node@v4
30+
uses: actions/setup-node@v6
3431
with:
3532
node-version: lts/*
3633

@@ -40,10 +37,10 @@ jobs:
4037
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
4138

4239
- name: install dependencies (ubuntu only)
43-
if: matrix.platform == 'ubuntu-22.04'
40+
if: matrix.platform == 'ubuntu-24.04'
4441
run: |
4542
sudo apt-get update
46-
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
43+
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
4744
4845
- name: install frontend dependencies
4946
run: npm install
@@ -57,4 +54,4 @@ jobs:
5754
releaseBody: "See the assets to download this version and install."
5855
releaseDraft: false
5956
prerelease: false
60-
args: ${{ matrix.args }}
57+
args: ${{ matrix.args }}

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,61 @@
44
## About
55
Twitch Downloader is a free utility made to download Twitch content (streams, videos, highlights, clips).
66

7-
## Features:
7+
## Features
88

9+
- Download live streams, VODs, highlights, and clips
10+
- Quality selector for each content type
11+
- Dark and light theme
12+
- 6 languages: English, Spanish, Portuguese, French, German, Italian
13+
- Configurable download folder
14+
- Open file in file manager after download
15+
- Cross-platform (Linux, macOS, Windows)
916

10-
Twitch Downloader is a versatile tool that offers a range of features to enhance your Twitch content downloading experience. It comes with a user-friendly GUI, making it easy for anyone to use. You can download live streams, VODs, highlights, and clips with just a few clicks. The application also supports multi-language, allowing users from different regions to use it with ease. User preferences are another highlight of Twitch Downloader, enabling you to customize the application according to your needs. Whether you're a streamer wanting to archive your streams or a viewer looking to save your favorite moments, Twitch Downloader is the tool for you.
17+
## Prerequisites
18+
19+
- [Node.js](https://nodejs.org/) (v18+)
20+
- [Rust](https://www.rust-lang.org/tools/install)
21+
- System dependencies for Tauri: see [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/)
1122

1223
## How to execute
1324

14-
### GUI
25+
### Development
1526

1627
```
1728
npm install
1829
npm run tauri dev
1930
```
2031

21-
It will open a new window with the GUI. Enter the URL of the stream, video, highlight or clip you want to download. Then, select the folder, file name and click on Get Qualities button. Then, select the quality you want to download and click on Download button.
32+
### Build for production
33+
34+
```
35+
npm run tauri build
36+
```
37+
38+
It will open a new window with the GUI. Enter the URL of the stream, video, highlight or clip you want to download. Then, select the folder, file name and click on Get Qualities button. Select the quality you want to download and click on Download.
2239

2340
![How to use the GUI](public/how-to-use.gif)
2441

42+
## Tests
43+
44+
```
45+
npm test
46+
```
47+
2548
## Donate
2649
If you want to support the project, you can buy me a coffee. Thanks!
2750

2851
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/sergioalmela)
2952

3053
## Technologies used
31-
- [![Node.js](https://img.shields.io/badge/Node.js-339933?style=for-the-badge&logo=Node.js&logoColor=white)](https://nodejs.org/en/)
32-
- [![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge&logo=TypeScript&logoColor=white)](https://www.typescriptlang.org/)
33-
- [![Jest](https://img.shields.io/badge/Jest-C21325?style=for-the-badge&logo=Jest&logoColor=white)](https://jestjs.io/)
34-
- [![Tauri](https://img.shields.io/badge/Tauri-421C87?style=for-the-badge&logo=Tauri&logoColor=white)](https://tauri.studio/)
54+
- [![Tauri](https://img.shields.io/badge/Tauri_2-421C87?style=for-the-badge&logo=Tauri&logoColor=white)](https://tauri.app/)
3555
- [![Rust](https://img.shields.io/badge/Rust-000000?style=for-the-badge&logo=Rust&logoColor=white)](https://www.rust-lang.org/)
56+
- [![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge&logo=TypeScript&logoColor=white)](https://www.typescriptlang.org/)
57+
- [![Preact](https://img.shields.io/badge/Preact-673AB8?style=for-the-badge&logo=Preact&logoColor=white)](https://preactjs.com/)
58+
- [![Vite](https://img.shields.io/badge/Vite-646CFF?style=for-the-badge&logo=Vite&logoColor=white)](https://vite.dev/)
59+
- [![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS_4-06B6D4?style=for-the-badge&logo=TailwindCSS&logoColor=white)](https://tailwindcss.com/)
60+
- [![Vitest](https://img.shields.io/badge/Vitest-6E9F18?style=for-the-badge&logo=Vitest&logoColor=white)](https://vitest.dev/)
61+
- [![Biome](https://img.shields.io/badge/Biome-60A5FA?style=for-the-badge&logo=Biome&logoColor=white)](https://biomejs.dev/)
3662

3763
## Issues
3864

@@ -53,4 +79,4 @@ Before posting an issue, be sure to include (if applicable):
5379

5480
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
5581

56-
Any contribution to the localization of the app is welcome. You can find the localization files in the ```src/locales``` folder. You can use the ```en.json``` file as example.
82+
Any contribution to the localization of the app is welcome. You can find the localization files in the `src/locales` folder. You can use the `en.json` file as example.

biome.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.4.9/schema.json",
3+
"files": {
4+
"ignoreUnknown": true,
5+
"includes": ["src/**"]
6+
},
7+
"formatter": {
8+
"indentStyle": "space",
9+
"indentWidth": 2
10+
},
11+
"linter": {
12+
"rules": {
13+
"recommended": true
14+
}
15+
},
16+
"css": {
17+
"parser": {
18+
"cssModules": false,
19+
"tailwindDirectives": true
20+
}
21+
},
22+
"javascript": {
23+
"formatter": {
24+
"quoteStyle": "single",
25+
"semicolons": "asNeeded"
26+
}
27+
},
28+
"assist": {
29+
"actions": {
30+
"source": {
31+
"organizeImports": "on"
32+
}
33+
}
34+
}
35+
}

eslint.config.cjs

Lines changed: 0 additions & 24 deletions
This file was deleted.

jest.config.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)