From c669d669699ddd58ddf03ae24459008a8ad1acb5 Mon Sep 17 00:00:00 2001 From: lonelyhentxi Date: Thu, 5 Jun 2025 02:44:23 +0800 Subject: [PATCH] fix: just dev-all support windows --- .vscode/settings.json | 89 +++++++++++----------- Cargo.lock | 158 ++------------------------------------- Cargo.toml | 1 - apps/dev-tui/Cargo.toml | 11 --- apps/dev-tui/src/main.rs | 26 ------- dev.kdl | 12 +-- justfile | 5 ++ package.json | 12 ++- pnpm-lock.yaml | 64 ++++++++++++++++ turbo.json | 36 +++++++++ 10 files changed, 171 insertions(+), 243 deletions(-) delete mode 100644 apps/dev-tui/Cargo.toml delete mode 100644 apps/dev-tui/src/main.rs create mode 100644 turbo.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 830d5c2..ed8bcfc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,46 +1,45 @@ { - "npm.packageManager": "pnpm", - "rust-analyzer.showUnlinkedFileNotification": false, - "[javascript]": { - "editor.defaultFormatter": "vscode.typescript-language-features", - "editor.formatOnSave": true - }, - "[json]": { - "editor.defaultFormatter": "biomejs.biome", - "editor.formatOnSave": true - }, - "[jsonc]": { - "editor.defaultFormatter": "biomejs.biome", - "editor.formatOnSave": true - }, - "[typescript]": { - "editor.defaultFormatter": "biomejs.biome", - "editor.formatOnSave": true - }, - "[typescriptreact]": { - "editor.defaultFormatter": "biomejs.biome", - "editor.formatOnSave": true - }, - "editor.codeActionsOnSave": { - "quickfix.biome": "explicit", - "source.organizeImports.biome": "explicit" - }, - "emmet.showExpandedAbbreviation": "never", - "prettier.enable": false, - "typescript.tsdk": "node_modules/typescript/lib", - "rust-analyzer.cargo.features": [ - "testcontainers", - "playground" - ], - "sqltools.connections": [ - { - "previewLimit": 50, - "server": "localhost", - "port": 5432, - "driver": "PostgreSQL", - "name": "konobangu-dev", - "database": "konobangu", - "username": "konobangu" - } - ] -} + "npm.packageManager": "pnpm", + "[javascript]": { + "editor.defaultFormatter": "vscode.typescript-language-features", + "editor.formatOnSave": true + }, + "[json]": { + "editor.defaultFormatter": "biomejs.biome", + "editor.formatOnSave": true + }, + "[jsonc]": { + "editor.defaultFormatter": "biomejs.biome", + "editor.formatOnSave": true + }, + "[typescript]": { + "editor.defaultFormatter": "biomejs.biome", + "editor.formatOnSave": true + }, + "[typescriptreact]": { + "editor.defaultFormatter": "biomejs.biome", + "editor.formatOnSave": true + }, + "editor.codeActionsOnSave": { + "quickfix.biome": "explicit", + "source.organizeImports.biome": "explicit" + }, + "emmet.showExpandedAbbreviation": "never", + "prettier.enable": false, + "typescript.tsdk": "node_modules/typescript/lib", + "rust-analyzer.showUnlinkedFileNotification": false, + "sqltools.connections": [ + { + "previewLimit": 50, + "server": "localhost", + "port": 5432, + "driver": "PostgreSQL", + "name": "konobangu-dev", + "database": "konobangu", + "username": "konobangu" + } + ], + "rust-analyzer.cargo.extraArgs": [ + "--all-features" + ] +} \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 134d402..9a0b9d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -932,21 +932,6 @@ dependencies = [ "walkdir", ] -[[package]] -name = "cassowary" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" - -[[package]] -name = "castaway" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" -dependencies = [ - "rustversion", -] - [[package]] name = "cc" version = "1.2.26" @@ -1168,20 +1153,6 @@ dependencies = [ "libc", ] -[[package]] -name = "compact_str" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32" -dependencies = [ - "castaway", - "cfg-if", - "itoa", - "rustversion", - "ryu", - "static_assertions", -] - [[package]] name = "concurrent-queue" version = "2.5.0" @@ -1400,22 +1371,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "crossterm" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" -dependencies = [ - "bitflags 2.9.1", - "crossterm_winapi", - "mio 1.0.4", - "parking_lot 0.12.4", - "rustix 0.38.44", - "signal-hook", - "signal-hook-mio", - "winapi", -] - [[package]] name = "crossterm_winapi" version = "0.9.1" @@ -1713,17 +1668,6 @@ version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abd57806937c9cc163efc8ea3910e00a62e2aeb0b8119f1793a978088f8f6b04" -[[package]] -name = "dev-tui" -version = "0.1.0" -dependencies = [ - "color-eyre", - "ratatui", - "serde", - "serde_json", - "tokio", -] - [[package]] name = "digest" version = "0.9.0" @@ -2407,7 +2351,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" dependencies = [ - "unicode-width 0.1.14", + "unicode-width", ] [[package]] @@ -3087,12 +3031,6 @@ dependencies = [ "serde", ] -[[package]] -name = "indoc" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd" - [[package]] name = "inherent" version = "1.0.12" @@ -3146,14 +3084,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fddf93031af70e75410a2511ec04d49e758ed2f26dad3404a934e0fb45cc12a" dependencies = [ "bitflags 2.9.1", - "crossterm 0.25.0", + "crossterm", "dyn-clone", "fuzzy-matcher", "fxhash", "newline-converter", "once_cell", "unicode-segmentation", - "unicode-width 0.1.14", + "unicode-width", ] [[package]] @@ -3172,19 +3110,6 @@ dependencies = [ "toml 0.5.11", ] -[[package]] -name = "instability" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf9fed6d91cfb734e7476a06bde8300a1b94e217e1b523b6f0cd1a01998c71d" -dependencies = [ - "darling", - "indoc", - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "instant" version = "0.1.13" @@ -3252,15 +3177,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.14.0" @@ -3769,12 +3685,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - [[package]] name = "linux-raw-sys" version = "0.9.4" @@ -3961,7 +3871,7 @@ dependencies = [ "miette-derive", "once_cell", "thiserror 1.0.69", - "unicode-width 0.1.14", + "unicode-width", ] [[package]] @@ -5248,27 +5158,6 @@ dependencies = [ "getrandom 0.3.3", ] -[[package]] -name = "ratatui" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" -dependencies = [ - "bitflags 2.9.1", - "cassowary", - "compact_str", - "crossterm 0.28.1", - "indoc", - "instability", - "itertools 0.13.0", - "lru", - "paste", - "strum", - "unicode-segmentation", - "unicode-truncate", - "unicode-width 0.2.0", -] - [[package]] name = "raw-cpuid" version = "11.5.0" @@ -5422,7 +5311,7 @@ checksum = "78c81d000a2c524133cc00d2f92f019d399e57906c3b7119271a2495354fe895" dependencies = [ "cfg-if", "libc", - "rustix 1.0.7", + "rustix", "windows 0.61.1", ] @@ -5781,19 +5670,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags 2.9.1", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - [[package]] name = "rustix" version = "1.0.7" @@ -5803,7 +5679,7 @@ dependencies = [ "bitflags 2.9.1", "errno", "libc", - "linux-raw-sys 0.9.4", + "linux-raw-sys", "windows-sys 0.59.0", ] @@ -6452,7 +6328,6 @@ checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", "mio 0.8.11", - "mio 1.0.4", "signal-hook", ] @@ -7026,7 +6901,7 @@ dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", - "rustix 1.0.7", + "rustix", "windows-sys 0.59.0", ] @@ -7742,29 +7617,12 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" -[[package]] -name = "unicode-truncate" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3644627a5af5fa321c95b9b235a72fd24cd29c648c2c379431e6628655627bf" -dependencies = [ - "itertools 0.13.0", - "unicode-segmentation", - "unicode-width 0.1.14", -] - [[package]] name = "unicode-width" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" -[[package]] -name = "unicode-width" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" - [[package]] name = "universal-hash" version = "0.5.1" @@ -8416,7 +8274,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" dependencies = [ "libc", - "rustix 1.0.7", + "rustix", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index eb862f5..ced6f74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,6 @@ members = [ "packages/fetch", "packages/downloader", "apps/recorder", - "apps/dev-tui", ] resolver = "2" diff --git a/apps/dev-tui/Cargo.toml b/apps/dev-tui/Cargo.toml deleted file mode 100644 index fa778e3..0000000 --- a/apps/dev-tui/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "dev-tui" -version = "0.1.0" -edition = "2024" - -[dependencies] -color-eyre = "0.6.5" -ratatui = "0.29" -tokio = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } diff --git a/apps/dev-tui/src/main.rs b/apps/dev-tui/src/main.rs deleted file mode 100644 index 2357695..0000000 --- a/apps/dev-tui/src/main.rs +++ /dev/null @@ -1,26 +0,0 @@ -use ratatui::{ DefaultTerminal, Frame, crossterm::{ event::{self, Event} } }; - -#[tokio::main] -async fn main() -> color_eyre::Result<()> { - color_eyre::install()?; - - let terminal = ratatui::init(); - let result = run(terminal); - - ratatui::restore(); - - result -} - -fn run(mut terminal: DefaultTerminal) -> color_eyre::Result<()> { - loop { - terminal.draw(render)?; - if matches!(event::read()?, Event::Key(_)) { - break Ok(()); - } - } -} - -fn render(frame: &mut Frame) { - frame.render_widget("hello world", frame.area()); -} \ No newline at end of file diff --git a/dev.kdl b/dev.kdl index 6fb685a..4b4ac83 100644 --- a/dev.kdl +++ b/dev.kdl @@ -21,13 +21,13 @@ layout { children } tab name="WebUI" { - pane command="pnpm" { - args "run" "--filter=webui" "dev" + pane command="just" { + args "dev-webui" } } tab name="Proxy" { - pane command="pnpm" { - args "run" "--filter=proxy" "dev" + pane command="just" { + args "dev-proxy" } } tab name="Recorder" { @@ -36,8 +36,8 @@ layout { } } tab name="Deps" { - pane command="docker" { - args "compose" "-f" "devdeps.compose.yaml" "up" + pane command="just" { + args "dev-deps" } } tab name="Codegen" { diff --git a/justfile b/justfile index 6732936..040c699 100644 --- a/justfile +++ b/justfile @@ -31,9 +31,14 @@ dev-deps-clean: dev-codegen: pnpm run --filter=webui codegen +[unix] dev-all: zellij --layout dev.kdl +[windows] +dev-all: + pnpm run dev-all + dev-codegen-wait: @until nc -z localhost 5001; do echo "Waiting for Recorder..."; sleep 1; done pnpm run --filter=webui codegen-watch diff --git a/package.json b/package.json index 57c7f3d..c33d874 100644 --- a/package.json +++ b/package.json @@ -3,15 +3,18 @@ "version": "0.0.0", "description": "Kono bangumi?", "license": "MIT", - "workspaces": [ - "packages/*", - "apps/*" - ], + "workspaces": ["packages/*", "apps/*"], "repository": { "type": "git", "url": "https://github.com/dumtruck/konobangu.git" }, "scripts": { + "dev-webui": "just dev-webui", + "dev-proxy": "just dev-proxy", + "dev-recorder": "just dev-recorder", + "dev-deps": "just dev-deps", + "dev-codegen-wait": "just dev-codegen-wait", + "dev-all": "turbo run //#dev-recorder //#dev-proxy //#dev-webui //#dev-deps //#dev-codegen-wait", "lint": "ultracite lint", "format": "ultracite format", "bump-deps": "npx --yes npm-check-updates --deep -u -x react-day-picker && pnpm install", @@ -27,6 +30,7 @@ "@biomejs/biome": "1.9.4", "@types/node": "^22.15.29", "tsx": "^4.19.4", + "turbo": "^2.5.4", "typescript": "^5.8.3", "ultracite": "^4.2.8" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9b516b1..ef46b9a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: tsx: specifier: ^4.19.4 version: 4.19.4 + turbo: + specifier: ^2.5.4 + version: 2.5.4 typescript: specifier: ^5.8.3 version: 5.8.3 @@ -6815,6 +6818,40 @@ packages: engines: {node: '>=18.0.0'} hasBin: true + turbo-darwin-64@2.5.4: + resolution: {integrity: sha512-ah6YnH2dErojhFooxEzmvsoZQTMImaruZhFPfMKPBq8sb+hALRdvBNLqfc8NWlZq576FkfRZ/MSi4SHvVFT9PQ==} + cpu: [x64] + os: [darwin] + + turbo-darwin-arm64@2.5.4: + resolution: {integrity: sha512-2+Nx6LAyuXw2MdXb7pxqle3MYignLvS7OwtsP9SgtSBaMlnNlxl9BovzqdYAgkUW3AsYiQMJ/wBRb7d+xemM5A==} + cpu: [arm64] + os: [darwin] + + turbo-linux-64@2.5.4: + resolution: {integrity: sha512-5May2kjWbc8w4XxswGAl74GZ5eM4Gr6IiroqdLhXeXyfvWEdm2mFYCSWOzz0/z5cAgqyGidF1jt1qzUR8hTmOA==} + cpu: [x64] + os: [linux] + + turbo-linux-arm64@2.5.4: + resolution: {integrity: sha512-/2yqFaS3TbfxV3P5yG2JUI79P7OUQKOUvAnx4MV9Bdz6jqHsHwc9WZPpO4QseQm+NvmgY6ICORnoVPODxGUiJg==} + cpu: [arm64] + os: [linux] + + turbo-windows-64@2.5.4: + resolution: {integrity: sha512-EQUO4SmaCDhO6zYohxIjJpOKRN3wlfU7jMAj3CgcyTPvQR/UFLEKAYHqJOnJtymbQmiiM/ihX6c6W6Uq0yC7mA==} + cpu: [x64] + os: [win32] + + turbo-windows-arm64@2.5.4: + resolution: {integrity: sha512-oQ8RrK1VS8lrxkLriotFq+PiF7iiGgkZtfLKF4DDKsmdbPo0O9R2mQxm7jHLuXraRCuIQDWMIw6dpcr7Iykf4A==} + cpu: [arm64] + os: [win32] + + turbo@2.5.4: + resolution: {integrity: sha512-kc8ZibdRcuWUG1pbYSBFWqmIjynlD8Lp7IB6U3vIzvOv9VG+6Sp8bzyeBWE3Oi8XV5KsQrznyRTBPvrf99E4mA==} + hasBin: true + tw-animate-css@1.3.4: resolution: {integrity: sha512-dd1Ht6/YQHcNbq0znIT6dG8uhO7Ce+VIIhZUhjsryXsMPJQz3bZg7Q2eNzLwipb25bRZslGb2myio5mScd1TFg==} @@ -14324,6 +14361,33 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + turbo-darwin-64@2.5.4: + optional: true + + turbo-darwin-arm64@2.5.4: + optional: true + + turbo-linux-64@2.5.4: + optional: true + + turbo-linux-arm64@2.5.4: + optional: true + + turbo-windows-64@2.5.4: + optional: true + + turbo-windows-arm64@2.5.4: + optional: true + + turbo@2.5.4: + optionalDependencies: + turbo-darwin-64: 2.5.4 + turbo-darwin-arm64: 2.5.4 + turbo-linux-64: 2.5.4 + turbo-linux-arm64: 2.5.4 + turbo-windows-64: 2.5.4 + turbo-windows-arm64: 2.5.4 + tw-animate-css@1.3.4: {} type-fest@0.21.3: {} diff --git a/turbo.json b/turbo.json new file mode 100644 index 0000000..472d4fd --- /dev/null +++ b/turbo.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://turborepo.com/schema.json", + "ui": "tui", + "tasks": { + "//#dev-webui": { + "cache": false, + "persistent": true, + "interactive": true, + "interruptible": true + }, + "//#dev-proxy": { + "cache": false, + "persistent": true, + "interactive": true, + "interruptible": true + }, + "//#dev-recorder": { + "cache": false, + "persistent": true, + "interactive": true, + "interruptible": true + }, + "//#dev-deps": { + "cache": false, + "persistent": true, + "interactive": true, + "interruptible": true + }, + "//#dev-codegen-wait": { + "cache": false, + "persistent": true, + "interactive": true, + "interruptible": true + } + } +}