Compare commits

...
Author SHA1 Message Date
poli0981andClaude Opus 5.5 52fc677ce5 refactor(ui): take refs as a prop instead of forwardRef
React 19 passes `ref` to function components as an ordinary prop, and the
React team has said forwardRef will be deprecated in a future release.
Button, IconButton, Input, Select and Textarea become plain function
components whose props extend ComponentProps<"button" | "input" | …>,
which already carries `ref`; each passes it on (Button to both Slot.Root
and <button>; IconButton through its props to Button). Their displayName
lines go too: the function names show in DevTools.

IconButton and RigEditor import the ReactNode type instead of reaching for
the global `React` namespace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:03:13 +07:00
poli0981 e3d86ea6cd Merge pull request #210 from poli0981/chore/deps-2026-10-22b
chore(deps): fold the newer Dependabot bumps; fix the @vitest/mocker alerts
2026-10-22 15:03:04 +07:00
poli0981andClaude Opus 5.5 1e3e20c6d4 chore(deps): fold the newer Dependabot bumps; fix the @vitest/mocker alerts
- vitest + @vitest/coverage-v8 4.1.12: @vitest/mocker 4.1.12 fixes alerts
  #44 and #45 (manual-mock code injection, Windows redirect traversal).
  Dependabot's security update could not land on its own: vitest 4.1.11
  pins @vitest/mocker 4.1.11.
- i18n: i18next 26.4.5
- tauri: @tauri-apps/api 2.12.4, plugin-opener 2.7.2, cli 2.12.3
- ui: lucide-react 1.57.0, radix-ui 1.8.1
- lint-and-format: typescript-eslint 8.71.2
- build-tooling: postcss 8.5.30
- actions: setup-java 6.1.0, zizmor-action 0.7.1
- THIRD_PARTY_NOTICES regenerated

Supersedes #197 #198 #199 #206 #207 #208.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:01:16 +07:00
poli0981 4019c2151e Merge pull request #209 from poli0981/chore/typescript-7
chore(typescript): move to TypeScript 7 with an ES2025 target
2026-10-22 15:01:08 +07:00
poli0981andClaude Opus 5.5 ad523ea0fb chore(typescript): move to TypeScript 7 with an ES2025 target
TypeScript 7.0 is the native compiler and ships no JavaScript API, which
typescript-eslint still needs. Install both, as Microsoft documents it:
- "@typescript/native": "npm:typescript@^7.0.2" gives `tsc` = 7.0
- "typescript": "npm:@typescript/typescript6@^6.0.2" gives the 6.0 API
  that typescript-eslint loads (its peer range stops below 6.1), and `tsc6`
CI fails if `tsc` ever resolves to TypeScript 6 (@typescript/old, pulled in
by the 6.0 package, ships a `tsc` too).

tsconfig.json (src):
- target ES2025: the newest year TypeScript 7.0, esbuild and Vite all know
- lib ES2022 + DOM: the browser floor (Vite's baseline-widely-available,
  Chrome 111 / Safari 16.4 / Firefox 114), because nothing polyfills
- baseUrl removed (gone in 7.0; paths were already relative), DOM.Iterable
  dropped (merged into DOM), `types: []` spelled out, erasableSyntaxOnly and
  verbatimModuleSyntax on (both clean)
tsconfig.check.json: lib ES2025 for tests, scripts, worker and build plugins.

Platform floor: the Tauri build no longer lowers to es2020; it shares the
web build's baseline (the stylesheet already needed Chromium 99+ /
Safari 15.4+). macOS minimumSystemVersion is 11.0 (the build is arm64).

Also: eslint.config.js uses ESLint's defineConfig (tseslint.config is
deprecated); THIRD_PARTY_NOTICES names the real package behind an npm
alias, sorted with a shared code-unit comparator (src/utils/sort.ts);
Dependabot groups typescript + @typescript/*; a test's typed-array
annotation follows TypeScript 7's lib.dom.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:48:21 +07:00
poli0981 706a9c89a2 Merge pull request #205 from poli0981/chore/node-26
chore(node): move the toolchain to Node 26
2026-10-22 14:47:28 +07:00
poli0981andClaude Opus 5.5 3c53fd4fe5 chore(node): move the toolchain to Node 26
- .node-version 22 -> 26 (CI, the release workflows and Workers Builds
  read it; Workers Builds also has NODE_VERSION=26 set)
- package.json engines: node >=26
- vitest: run workers with --no-experimental-webstorage. Node 25+ defines
  a global `localStorage` that is undefined without --localstorage-file;
  zustand's persist only falls back to memory when reading the storage
  throws, so every store `set` crashed on undefined.setItem (39 tests in
  4 files). Without Web Storage the stores fall back as they did on 22.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:43:32 +07:00
poli0981 eb96954d21 Merge pull request #204 from poli0981/chore/deps-2026-10-22
chore(deps): fold the open Dependabot bumps; fix the vite launch-editor alerts
2026-10-22 14:43:19 +07:00
poli0981andClaude Opus 5.5 701b661a0d chore(deps): fold the open Dependabot bumps; fix the vite launch-editor alerts
- i18n: i18next 26.4.4
- tauri: @tauri-apps/api 2.12.3, plugin-opener 2.7.1, cli 2.12.2
  (crates stay on 2.12)
- ui: lucide-react 1.55.0, radix-ui 1.8.0
- lint-and-format: eslint 10.12.0, knip 6.41.0, prettier 3.9.10,
  typescript-eslint 8.71.1
- build-tooling: @vitejs/plugin-react 6.1.2, marked 18.1.1,
  postcss 8.5.29, vite 8.3.4 (alerts #41-#43: launch-editor, fixed in 8.3.3)
- actions: setup-node 7.1.0, rust-toolchain 683b588, upload-artifact 7.0.2,
  scorecard 2.5.0
- THIRD_PARTY_NOTICES regenerated

Supersedes #197 #198 #199 #200 #201 #202 #203.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:40:53 +07:00
poli0981andClaude Opus 5.5 9901ed844b chore(deps): fold the open Dependabot bumps into one update; fix sharp and source-map-js alerts (#196)
- ui: lucide-react 1.52.0, motion 13.5.1, radix-ui 1.7.0
- tauri: @tauri-apps/api + cli 2.12.1 (crates stay on 2.12)
- i18n: react-i18next 17.0.16
- wrangler 4.149.0, which brings sharp 0.35.5 (alert #40) and
  shares the top-level esbuild instead of nesting its own
- source-map-js 1.2.2 (alert #39)
- THIRD_PARTY_NOTICES regenerated

Supersedes #190 #191 #192 #193 #194.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:34:06 +07:00
26 changed files with 1702 additions and 1700 deletions

No files matched your search

+8 -2
View File
@@ -66,6 +66,12 @@ updates:
]
cloudflare:
patterns: ["wrangler", "@cloudflare/*"]
# TypeScript 7 (`tsc`) and the TypeScript 6 API that typescript-eslint
# still needs, installed side by side as npm aliases (see package.json).
# Dependabot may not resolve `npm:` aliases — if no PR shows up for a new
# 7.x, bump both by hand.
typescript:
patterns: ["typescript", "@typescript/*"]
lint-and-format:
patterns: ["eslint*", "@eslint/*", "typescript-eslint", "prettier*", "knip"]
build-tooling:
@@ -89,8 +95,8 @@ updates:
patterns: ["@types/*"]
ignore:
# Majors land in their own planned release because each one needs a real
# migration (TypeScript 7, Vitest 5 and lucide-react 1 are the current
# examples). Dependabot handles minor + patch.
# migration (Vitest 5 is the current example). Dependabot handles minor +
# patch.
- dependency-name: "*"
update-types: ["version-update:semver-major"]
+8 -1
View File
@@ -31,11 +31,18 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
cache: npm
- run: npm ci
# `tsc` must be TypeScript 7 (@typescript/native). The `typescript` alias
# (@typescript/typescript6, the API typescript-eslint loads) pulls in
# TypeScript 6 as @typescript/old, which ships a `tsc` too — npm links the
# first one by path order. Fail loudly if that ever flips, instead of
# silently type-checking with 6.
- name: TypeScript 7 is the `tsc` on PATH
run: ./node_modules/.bin/tsc --version | grep -q '^Version 7\.'
# --- correctness ------------------------------------------------------
# `typecheck` covers src/ (what Vite builds); `typecheck:all` adds tests/,
+5 -5
View File
@@ -23,7 +23,7 @@ jobs:
with:
ref: ${{ github.event.inputs.tag || github.ref }}
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
# Release artifacts are built from a clean install: a cache written
@@ -56,14 +56,14 @@ jobs:
persist-credentials: false
# No dependency caches in a release job (see release-desktop.yml).
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
# Release artifacts are built from a clean install: a cache written
# by any other workflow must not be able to feed into them.
package-manager-cache: false
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: temurin
java-version: "17"
@@ -74,7 +74,7 @@ jobs:
run: sdkmanager "ndk;27.3.13750724"
# A master commit, not the regenerated `stable` branch — see rust.yml.
- uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: stable
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
@@ -112,7 +112,7 @@ jobs:
# Keep the APK regardless of whether the release upload works, so a
# broken upload never costs a 20-minute rebuild.
- name: Upload APK as workflow artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ytdescgen-android-apk
path: src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk
+3 -3
View File
@@ -27,7 +27,7 @@ jobs:
with:
ref: ${{ github.event.inputs.tag || github.ref }}
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
# Release artifacts are built from a clean install: a cache written
@@ -93,14 +93,14 @@ jobs:
persist-credentials: false
# No dependency caches in a release job: a poisoned cache entry written
# by any other workflow would otherwise flow straight into the binaries.
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
# Release artifacts are built from a clean install: a cache written
# by any other workflow must not be able to feed into them.
package-manager-cache: false
# A master commit, not the regenerated `stable` branch — see rust.yml.
- uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: stable
targets: ${{ matrix.target }}
+2 -2
View File
@@ -39,7 +39,7 @@ jobs:
# Pinned to a commit on master, with the toolchain passed explicitly: the
# action's `stable` branch is regenerated from master, which orphans any
# SHA pinned there (zizmor: impostor-commit). Master keeps its history.
- uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: stable
components: rustfmt, clippy
@@ -48,7 +48,7 @@ jobs:
workspaces: src-tauri
# tauri::generate_context!() embeds the frontend at compile time, so
# clippy and the tests need a built dist/.
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
cache: npm
+2 -2
View File
@@ -48,7 +48,7 @@ jobs:
with:
args: -color
- name: zizmor
uses: zizmorcore/zizmor-action@cc914d7f3750a2d13d75c7f184a1060aa0e9d482 # v0.6.4
uses: zizmorcore/zizmor-action@85b2b9fb8e3325e7a23d7d0a9d7ba5ae0f999e3e # v0.7.1
with:
# Report in the log and fail the job; no SARIF upload, so findings
# are fixed in the PR instead of piling up as code-scanning alerts.
@@ -69,7 +69,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
- uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
with:
results_file: scorecard.json
results_format: json
+1 -1
View File
@@ -1 +1 @@
22
26
+21 -20
View File
@@ -14,18 +14,18 @@ Bundled into the web app and the desktop / Android apps.
| --- | --- | --- | --- |
| `@fontsource-variable/inter` | 5.3.0 | OFL-1.1 | <https://github.com/fontsource/font-files> |
| `@fontsource-variable/jetbrains-mono` | 5.3.0 | OFL-1.1 | <https://github.com/fontsource/font-files> |
| `@tauri-apps/api` | 2.12.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `@tauri-apps/plugin-opener` | 2.7.0 | MIT OR Apache-2.0 | <https://github.com/tauri-apps/plugins-workspace> |
| `@tauri-apps/api` | 2.12.4 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `@tauri-apps/plugin-opener` | 2.7.2 | MIT OR Apache-2.0 | <https://github.com/tauri-apps/plugins-workspace> |
| `clsx` | 2.1.1 | MIT | <https://github.com/lukeed/clsx> |
| `cmdk` | 1.1.1 | MIT | <https://github.com/pacocoursey/cmdk> |
| `i18next` | 26.4.2 | MIT | <https://github.com/i18next/i18next> |
| `i18next` | 26.4.5 | MIT | <https://github.com/i18next/i18next> |
| `i18next-resources-to-backend` | 1.2.3 | MIT | <https://github.com/i18next/i18next-resources-to-backend> |
| `lucide-react` | 1.49.0 | ISC | <https://github.com/lucide-icons/lucide> |
| `motion` | 13.4.6 | MIT | <https://github.com/motiondivision/motion> |
| `radix-ui` | 1.6.7 | MIT | <https://github.com/radix-ui/primitives> |
| `lucide-react` | 1.57.0 | ISC | <https://github.com/lucide-icons/lucide> |
| `motion` | 13.5.1 | MIT | <https://github.com/motiondivision/motion> |
| `radix-ui` | 1.8.1 | MIT | <https://github.com/radix-ui/primitives> |
| `react` | 19.3.0 | MIT | <https://github.com/react/react> |
| `react-dom` | 19.3.0 | MIT | <https://github.com/react/react> |
| `react-i18next` | 17.0.15 | MIT | <https://github.com/i18next/react-i18next> |
| `react-i18next` | 17.0.16 | MIT | <https://github.com/i18next/react-i18next> |
| `react-router-dom` | 7.18.4 | MIT | <https://github.com/remix-run/react-router> |
| `simple-icons` | 16.33.0 | CC0-1.0 | <https://simpleicons.org> |
| `sonner` | 2.0.8 | MIT | <https://github.com/emilkowalski/sonner> |
@@ -40,29 +40,30 @@ Used to build, test and check YTDescGen. Not shipped to users.
| `@eslint/js` | 10.0.1 | MIT | <https://github.com/eslint/eslint> |
| `@resvg/resvg-js` | 2.6.2 | MPL-2.0 | — |
| `@tailwindcss/postcss` | 4.3.3 | MIT | <https://github.com/tailwindlabs/tailwindcss> |
| `@tauri-apps/cli` | 2.12.0 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `@tauri-apps/cli` | 2.12.3 | Apache-2.0 OR MIT | <https://github.com/tauri-apps/tauri> |
| `@testing-library/jest-dom` | 7.0.1 | MIT | <https://github.com/testing-library/jest-dom> |
| `@testing-library/react` | 16.3.3 | MIT | <https://github.com/testing-library/react-testing-library> |
| `@types/node` | 26.6.3 | MIT | <https://github.com/DefinitelyTyped/DefinitelyTyped> |
| `@types/react` | 19.3.0 | MIT | <https://github.com/DefinitelyTyped/DefinitelyTyped> |
| `@types/react-dom` | 19.3.0 | MIT | <https://github.com/DefinitelyTyped/DefinitelyTyped> |
| `@vitejs/plugin-react` | 6.1.1 | MIT | <https://github.com/vitejs/vite-plugin-react> |
| `@vitest/coverage-v8` | 4.1.11 | MIT | <https://github.com/vitest-dev/vitest> |
| `@typescript/typescript6` | 6.0.2 | Apache-2.0 | <https://github.com/microsoft/TypeScript> |
| `@vitejs/plugin-react` | 6.1.2 | MIT | <https://github.com/vitejs/vite-plugin-react> |
| `@vitest/coverage-v8` | 4.1.12 | MIT | <https://github.com/vitest-dev/vitest> |
| `autoprefixer` | 10.6.1 | MIT | <https://github.com/postcss/autoprefixer> |
| `eslint` | 10.11.0 | MIT | <https://github.com/eslint/eslint> |
| `eslint` | 10.12.0 | MIT | <https://github.com/eslint/eslint> |
| `eslint-plugin-react-hooks` | 7.1.1 | MIT | <https://github.com/facebook/react> |
| `knip` | 6.38.0 | ISC | <https://github.com/webpro-nl/knip> |
| `marked` | 18.0.14 | MIT | <https://github.com/markedjs/marked> |
| `postcss` | 8.5.28 | MIT | <https://github.com/postcss/postcss> |
| `prettier` | 3.9.9 | MIT | <https://github.com/prettier/prettier> |
| `knip` | 6.41.0 | ISC | <https://github.com/webpro-nl/knip> |
| `marked` | 18.1.1 | MIT | <https://github.com/markedjs/marked> |
| `postcss` | 8.5.30 | MIT | <https://github.com/postcss/postcss> |
| `prettier` | 3.9.10 | MIT | <https://github.com/prettier/prettier> |
| `prettier-plugin-tailwindcss` | 0.8.1 | MIT | <https://github.com/tailwindlabs/prettier-plugin-tailwindcss> |
| `tailwindcss` | 4.3.3 | MIT | <https://github.com/tailwindlabs/tailwindcss> |
| `tsx` | 4.23.15 | MIT | <https://github.com/privatenumber/tsx> |
| `typescript` | 5.9.3 | Apache-2.0 | <https://github.com/microsoft/TypeScript> |
| `typescript-eslint` | 8.71.0 | MIT | <https://github.com/typescript-eslint/typescript-eslint> |
| `vite` | 8.3.1 | MIT | <https://github.com/vitejs/vite> |
| `vitest` | 4.1.11 | MIT | <https://github.com/vitest-dev/vitest> |
| `wrangler` | 4.144.0 | MIT OR Apache-2.0 | <https://github.com/cloudflare/workers-sdk> |
| `typescript` | 7.0.2 | Apache-2.0 | <https://github.com/microsoft/TypeScript> |
| `typescript-eslint` | 8.71.2 | MIT | <https://github.com/typescript-eslint/typescript-eslint> |
| `vite` | 8.3.4 | MIT | <https://github.com/vitejs/vite> |
| `vitest` | 4.1.12 | MIT | <https://github.com/vitest-dev/vitest> |
| `wrangler` | 4.149.0 | MIT OR Apache-2.0 | <https://github.com/cloudflare/workers-sdk> |
## Desktop and Android shell (Rust crates)
+2 -1
View File
@@ -1,8 +1,9 @@
import js from "@eslint/js";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";
import reactHooks from "eslint-plugin-react-hooks";
export default tseslint.config(
export default defineConfig(
js.configs.recommended,
...tseslint.configs.strict,
{
+1413 -1496
View File
File diff suppressed because it is too large. Load diff
+24 -20
View File
@@ -4,6 +4,9 @@
"private": true,
"license": "Apache-2.0",
"type": "module",
"engines": {
"node": ">=26"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
@@ -37,18 +40,18 @@
"dependencies": {
"@fontsource-variable/inter": "^5.3.0",
"@fontsource-variable/jetbrains-mono": "^5.3.0",
"@tauri-apps/api": "^2.12.0",
"@tauri-apps/plugin-opener": "^2.7.0",
"@tauri-apps/api": "^2.12.4",
"@tauri-apps/plugin-opener": "^2.7.2",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"i18next": "^26.4.2",
"i18next": "^26.4.5",
"i18next-resources-to-backend": "^1.2.3",
"lucide-react": "^1.49.0",
"motion": "^13.4.6",
"radix-ui": "^1.6.7",
"lucide-react": "^1.57.0",
"motion": "^13.5.1",
"radix-ui": "^1.8.1",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"react-i18next": "^17.0.15",
"react-i18next": "^17.0.16",
"react-router-dom": "^7.18.4",
"simple-icons": "^16.33.0",
"sonner": "^2.0.8",
@@ -58,28 +61,29 @@
"@eslint/js": "^10.0.1",
"@resvg/resvg-js": "2.6.2",
"@tailwindcss/postcss": "^4.3.3",
"@tauri-apps/cli": "2.12.0",
"@tauri-apps/cli": "2.12.3",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.3",
"@types/node": "^26.6.3",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.1",
"@vitest/coverage-v8": "^4.1.11",
"@typescript/native": "npm:typescript@^7.0.2",
"@vitejs/plugin-react": "^6.1.2",
"@vitest/coverage-v8": "^4.1.12",
"autoprefixer": "^10.6.1",
"eslint": "^10.11.0",
"eslint": "^10.12.0",
"eslint-plugin-react-hooks": "^7.1.1",
"knip": "^6.38.0",
"marked": "18.0.14",
"postcss": "^8.5.28",
"prettier": "^3.9.9",
"knip": "^6.41.0",
"marked": "18.1.1",
"postcss": "^8.5.30",
"prettier": "^3.9.10",
"prettier-plugin-tailwindcss": "^0.8.1",
"tailwindcss": "^4.3.3",
"tsx": "^4.23.15",
"typescript": "^5.9.3",
"typescript-eslint": "^8.71.0",
"vite": "^8.3.1",
"vitest": "^4.1.11",
"wrangler": "4.144.0"
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-eslint": "^8.71.2",
"vite": "^8.3.4",
"vitest": "^4.1.12",
"wrangler": "4.149.0"
}
}
+17 -10
View File
@@ -14,6 +14,7 @@
*/
import { readFileSync, writeFileSync } from "fs";
import { resolve } from "path";
import { compareCodeUnits } from "../../src/utils/sort.ts";
const ROOT = resolve(import.meta.dirname, "../..");
const NOTICES = resolve(ROOT, "THIRD_PARTY_NOTICES.md");
@@ -43,6 +44,7 @@ export function licenseAllowed(expression: string): boolean {
}
interface PackageJson {
name?: string;
version?: string;
license?: string;
homepage?: string;
@@ -74,16 +76,21 @@ interface Row {
url: string;
}
function npmRows(names: string[]): Row[] {
return names.sort().map((name) => {
const pkg = readJson<PackageJson>(resolve(ROOT, "node_modules", name, "package.json"));
return {
name,
version: pkg.version ?? "?",
license: pkg.license ?? "UNKNOWN",
url: projectUrl(pkg),
};
});
function npmRows(keys: string[]): Row[] {
return keys
.map((key) => {
const pkg = readJson<PackageJson>(resolve(ROOT, "node_modules", key, "package.json"));
return {
// An npm alias installs under its key: `"typescript":
// "npm:@typescript/typescript6@…"` puts @typescript/typescript6 in
// node_modules/typescript. Name the package that is really there.
name: pkg.name ?? key,
version: pkg.version ?? "?",
license: pkg.license ?? "UNKNOWN",
url: projectUrl(pkg),
};
})
.sort((a, b) => compareCodeUnits(a.name, b.name));
}
/**
+3
View File
@@ -42,6 +42,9 @@
"android": {
"minSdkVersion": 30
},
"macOS": {
"minimumSystemVersion": "11.0"
},
"windows": {
"webviewInstallMode": {
"type": "downloadBootstrapper"
+2 -2
View File
@@ -1,4 +1,4 @@
import { lazy, Suspense, useId, useState } from "react";
import { lazy, Suspense, useId, useState, type ReactNode } from "react";
import { useTranslation } from "react-i18next";
import { AlertTriangle, ChevronsUpDown } from "lucide-react";
import clsx from "clsx";
@@ -230,7 +230,7 @@ export function RigEditor() {
// before it, so cascading option lists, dynamic labels and hidden-when
// predicates line up.
const previousValues: string[] = [];
const renderedParts: React.ReactNode[] = [];
const renderedParts: ReactNode[] = [];
composite.parts.forEach((part, index) => {
const stored = partValues[index] ?? "";
if (!part.hiddenWhen?.(previousValues)) {
+34 -39
View File
@@ -1,4 +1,4 @@
import { forwardRef, type ButtonHTMLAttributes } from "react";
import type { ComponentProps } from "react";
import { Slot } from "radix-ui";
import clsx from "clsx";
import { Spinner } from "@components/icons/animated";
@@ -6,7 +6,8 @@ import { Spinner } from "@components/icons/animated";
export type ButtonVariant = "primary" | "brand" | "secondary" | "outline" | "ghost" | "danger";
export type ButtonSize = "sm" | "md" | "lg" | "icon" | "icon-sm";
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
/** `ref` is an ordinary prop in React 19 — it comes with `ComponentProps<"button">`. */
export interface ButtonProps extends ComponentProps<"button"> {
variant?: ButtonVariant;
size?: ButtonSize;
/** Shows a spinner, disables the button and keeps its width. */
@@ -42,43 +43,37 @@ export const buttonClasses = (variant: ButtonVariant = "primary", size: ButtonSi
SIZES[size],
);
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
(
{
variant = "primary",
size = "md",
loading = false,
asChild = false,
className,
children,
disabled,
type,
...props
},
ref,
) => {
if (asChild) {
return (
<Slot.Root ref={ref} className={clsx(buttonClasses(variant, size), className)} {...props}>
{children}
</Slot.Root>
);
}
export function Button({
variant = "primary",
size = "md",
loading = false,
asChild = false,
className,
children,
disabled,
type,
ref,
...props
}: ButtonProps) {
if (asChild) {
return (
<button
ref={ref}
// A button inside a <form> defaults to submit — make every other one explicit.
type={type ?? "button"}
disabled={disabled || loading}
aria-busy={loading || undefined}
className={clsx(buttonClasses(variant, size), className)}
{...props}
>
{loading && <Spinner />}
<Slot.Root ref={ref} className={clsx(buttonClasses(variant, size), className)} {...props}>
{children}
</button>
</Slot.Root>
);
},
);
Button.displayName = "Button";
}
return (
<button
ref={ref}
// A button inside a <form> defaults to submit — make every other one explicit.
type={type ?? "button"}
disabled={disabled || loading}
aria-busy={loading || undefined}
className={clsx(buttonClasses(variant, size), className)}
{...props}
>
{loading && <Spinner />}
{children}
</button>
);
}
+19 -13
View File
@@ -1,29 +1,35 @@
import { forwardRef } from "react";
import type { ReactNode } from "react";
import { Button, type ButtonProps } from "./Button";
import { Tooltip } from "./Tooltip";
interface IconButtonProps extends Omit<ButtonProps, "size" | "children" | "aria-label"> {
/** Accessible name AND tooltip text — an icon-only control needs both. */
label: string;
children: React.ReactNode;
children: ReactNode;
size?: "icon" | "icon-sm";
/** Hide the hover tooltip (the name stays for screen readers). */
noTooltip?: boolean;
tooltipSide?: "top" | "right" | "bottom" | "left";
}
/** A square, icon-only button that cannot be rendered without a name. */
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
(
{ label, children, variant = "ghost", size = "icon", noTooltip, tooltipSide, ...props },
ref,
) => (
/**
* A square, icon-only button that cannot be rendered without a name. A `ref`
* reaches the button through `props`.
*/
export function IconButton({
label,
children,
variant = "ghost",
size = "icon",
noTooltip,
tooltipSide,
...props
}: IconButtonProps) {
return (
<Tooltip content={label} disabled={noTooltip} side={tooltipSide}>
<Button ref={ref} variant={variant} size={size} aria-label={label} {...props}>
<Button variant={variant} size={size} aria-label={label} {...props}>
{children}
</Button>
</Tooltip>
),
);
IconButton.displayName = "IconButton";
);
}
+40 -33
View File
@@ -1,8 +1,8 @@
import { forwardRef, type InputHTMLAttributes, type ReactNode } from "react";
import type { ComponentProps, ReactNode } from "react";
import clsx from "clsx";
import { Field, controlClasses } from "./Field";
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
interface InputProps extends ComponentProps<"input"> {
label?: string;
error?: boolean;
/** Inline error message shown below the input (also forces the red border). */
@@ -15,35 +15,42 @@ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
leading?: ReactNode;
}
export const Input = forwardRef<HTMLInputElement, InputProps>(
({ label, error, errorText, helpText, labelExtra, leading, className, id, ...props }, ref) => {
const isError = Boolean(error) || Boolean(errorText);
return (
<Field label={label} error={errorText} help={helpText} labelExtra={labelExtra} id={id}>
{(control) => (
<div className="relative">
{leading && (
<span className="text-text-muted pointer-events-none absolute inset-y-0 left-3 flex items-center [&_svg]:size-4">
{leading}
</span>
export function Input({
label,
error,
errorText,
helpText,
labelExtra,
leading,
className,
id,
ref,
...props
}: InputProps) {
const isError = Boolean(error) || Boolean(errorText);
return (
<Field label={label} error={errorText} help={helpText} labelExtra={labelExtra} id={id}>
{(control) => (
<div className="relative">
{leading && (
<span className="text-text-muted pointer-events-none absolute inset-y-0 left-3 flex items-center [&_svg]:size-4">
{leading}
</span>
)}
<input
ref={ref}
{...control}
aria-invalid={isError || undefined}
className={clsx(
controlClasses(isError),
"h-control text-base sm:text-sm",
leading ? "pl-9" : undefined,
className,
)}
<input
ref={ref}
{...control}
aria-invalid={isError || undefined}
className={clsx(
controlClasses(isError),
"h-control text-base sm:text-sm",
leading ? "pl-9" : undefined,
className,
)}
{...props}
/>
</div>
)}
</Field>
);
},
);
Input.displayName = "Input";
{...props}
/>
</div>
)}
</Field>
);
}
+17 -8
View File
@@ -1,4 +1,4 @@
import { forwardRef, type SelectHTMLAttributes } from "react";
import type { ComponentProps } from "react";
import { ChevronsUpDown } from "lucide-react";
import clsx from "clsx";
import { Field, controlClasses } from "./Field";
@@ -8,7 +8,7 @@ interface SelectOption {
label: string;
}
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "onChange"> {
interface SelectProps extends Omit<ComponentProps<"select">, "onChange"> {
label?: string;
options: readonly SelectOption[];
onChange: (value: string) => void;
@@ -21,8 +21,19 @@ interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "onC
* Android and iOS, type-ahead, and full keyboard support for free — and it
* now matches the other controls' height (it used to be ~6px shorter).
*/
export const Select = forwardRef<HTMLSelectElement, SelectProps>(
({ label, options, value, onChange, helpText, errorText, className, id, ...props }, ref) => (
export function Select({
label,
options,
value,
onChange,
helpText,
errorText,
className,
id,
ref,
...props
}: SelectProps) {
return (
<Field label={label} help={helpText} error={errorText} id={id}>
{(control) => (
// `className` sizes the control box (e.g. max-w-40), so the chevron
@@ -52,7 +63,5 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(
</div>
)}
</Field>
),
);
Select.displayName = "Select";
);
}
+32 -26
View File
@@ -1,8 +1,8 @@
import { forwardRef, type ReactNode, type TextareaHTMLAttributes } from "react";
import type { ComponentProps, ReactNode } from "react";
import clsx from "clsx";
import { Field, controlClasses } from "./Field";
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
interface TextareaProps extends ComponentProps<"textarea"> {
label?: string;
error?: boolean;
errorText?: string;
@@ -10,27 +10,33 @@ interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
labelExtra?: ReactNode;
}
export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
({ label, error, errorText, helpText, labelExtra, className, id, ...props }, ref) => {
const isError = Boolean(error) || Boolean(errorText);
return (
<Field label={label} error={errorText} help={helpText} labelExtra={labelExtra} id={id}>
{(control) => (
<textarea
ref={ref}
{...control}
aria-invalid={isError || undefined}
className={clsx(
controlClasses(isError),
"min-h-24 resize-y py-2 text-base leading-relaxed sm:text-sm",
className,
)}
{...props}
/>
)}
</Field>
);
},
);
Textarea.displayName = "Textarea";
export function Textarea({
label,
error,
errorText,
helpText,
labelExtra,
className,
id,
ref,
...props
}: TextareaProps) {
const isError = Boolean(error) || Boolean(errorText);
return (
<Field label={label} error={errorText} help={helpText} labelExtra={labelExtra} id={id}>
{(control) => (
<textarea
ref={ref}
{...control}
aria-invalid={isError || undefined}
className={clsx(
controlClasses(isError),
"min-h-24 resize-y py-2 text-base leading-relaxed sm:text-sm",
className,
)}
{...props}
/>
)}
</Field>
);
}
+9
View File
@@ -0,0 +1,9 @@
/**
* UTF-16 code-unit order — exactly what a bare `.sort()` does on strings,
* spelled out as a comparator. Unlike `localeCompare` it never depends on the
* runtime's locale, so generated files sort the same on every machine.
*/
export function compareCodeUnits(a: string, b: string): number {
if (a === b) return 0;
return a < b ? -1 : 1;
}
+4 -3
View File
@@ -1,9 +1,10 @@
/// <reference types="vite/client" />
/**
* File System Access API — `showSaveFilePicker` is not in TypeScript 5.9's
* `lib.dom`, but `FileSystemFileHandle` and `FileSystemWritableFileStream` are,
* so only the `Window` method needs declaring.
* File System Access API — `showSaveFilePicker` is not in TypeScript's
* `lib.dom` (checked with 7.0), but `FileSystemFileHandle` and
* `FileSystemWritableFileStream` are, so only the `Window` method needs
* declaring.
*
* Optional on purpose: it is absent in Firefox, Safari and the Android WebView,
* and `src/utils/file-ops.ts` feature-detects it before use.
+1 -1
View File
@@ -18,7 +18,7 @@ describe("generateId", () => {
// black-screened the app at boot before the fallback existed.
const real = globalThis.crypto;
vi.stubGlobal("crypto", {
getRandomValues: (a: Uint8Array) => real.getRandomValues(a),
getRandomValues: (a: Uint8Array<ArrayBuffer>) => real.getRandomValues(a),
});
expect(generateId()).toMatch(V4);
});
+6 -1
View File
@@ -12,7 +12,12 @@
// the global scope; without this they are undeclared identifiers here.
// `node` covers the `fs`/`path`/`process` use in scripts/ — the app bundle
// never sees these, which is why the base config leaves them out.
"types": ["vitest/globals", "node"]
"types": ["vitest/globals", "node"],
// tests/, scripts/ and build-plugins/ run on Node 26 and worker/ on
// workerd, so they may use the newer built-ins the app's browser floor
// keeps out of tsconfig.json. src/ is still held to that floor by
// `npm run typecheck`.
"lib": ["ES2025", "DOM"]
},
"include": ["src", "tests", "scripts", "worker", "build-plugins"]
}
+15 -3
View File
@@ -1,12 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
// The newest ECMAScript year that TypeScript 7.0, esbuild (tsx, wrangler)
// and Vite all understand. ES2026 arrives with TypeScript 7.1.
"target": "ES2025",
// `lib` is the runtime floor, not the syntax target. Vite lowers syntax but
// never polyfills, so a built-in typed here must exist in every engine the
// app supports: Vite's `baseline-widely-available` — Chrome 111, Safari
// 16.4, Firefox 114 (ES2023's copy-array methods need Firefox 115). Raise it
// when that floor moves. Code that runs on Node or workerd gets the newer
// lib in tsconfig.check.json.
"lib": ["ES2022", "DOM"],
// TypeScript 6+ no longer loads every installed @types package. The app
// needs none: `vite/client` comes in through src/vite-env.d.ts.
"types": [],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"erasableSyntaxOnly": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
@@ -17,7 +30,6 @@
"noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@config/*": ["./src/config/*"],
+7 -8
View File
@@ -40,14 +40,13 @@ export default defineConfig({
watch: { ignored: ["**/src-tauri/**", "**/.wrangler/**"] },
},
build: {
// Tauri ships the *system* WebView. On Android that can be an old, frozen
// Chromium (e.g. some emulator system images sit at ~91 until the user
// updates Android System WebView), which chokes on Vite's modern default
// target and renders a blank/black screen. Downlevel the bundle for Tauri
// builds so it runs on those older WebViews; the web build keeps Vite's
// modern default. Desktop WebViews are evergreen, so a lower
// target is a harmless no-op there.
target: isTauri ? "es2020" : undefined,
// No `target`: the web and Tauri builds share Vite's default,
// `baseline-widely-available` (Chrome 111, Safari 16.4, Firefox 114), which
// is also the floor tsconfig.json's `lib` holds the app to. Tauri builds
// used to be lowered to es2020 for frozen ~91 Android System WebViews, but
// the stylesheet's cascade layers already need Chromium 99+ / Safari 15.4+,
// so such a WebView rendered the app unstyled either way.
//
// Never inline assets as data: URIs — the Tauri CSP only allows 'self'
// for images and fonts, so an inlined icon would silently fail there.
assetsInlineLimit: 0,
+7
View File
@@ -20,6 +20,13 @@ export default defineConfig({
},
test: {
globals: true,
// Node 25+ defines a global `localStorage` that is `undefined` unless
// `--localstorage-file` is given. zustand's persist only falls back to
// memory when reading the storage *throws*, so every store `set` then
// crashes on `undefined.setItem`. Without Web Storage the global is gone
// and the stores fall back the way they always did on Node 22. The flag is
// accepted by Node 22 too.
execArgv: ["--no-experimental-webstorage"],
// `.tsx` was absent until v0.35.0, so any component test written here
// would have been collected by nobody and passed silently. Note that the
// default environment is node — a test that renders needs an explicit