# Build Cleanup & Release Packaging Implementation Plan > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. **Goal:** Eliminate all build warnings/errors across frontend and backend, fix the failing test, and implement a release build script that produces a distributable `GUI Video Clipper.app`. **Architecture:** Direct fixes to existing files — no new components or modules except `scripts/build-release.sh`. TypeScript config fixes, Svelte a11y attribute additions, Rust `#[allow]` annotations, one test assertion update, and a new shell script. **Tech Stack:** Svelte 5, TypeScript, Vite/Vitest, Rust/Cargo, Tauri v2, Bash ## Global Constraints - macOS is the only target platform - All changes must result in zero warnings from `npm run check`, `cargo build`, and `npm test` - Preserve existing runtime behavior — these are lint/warning fixes, not behavioral changes - Follow existing code patterns and styles in each file --- ### Task 1: TypeScript Error Fixes **Files:** - Modify: `tsconfig.json` - Modify: `vite.config.ts:1` (import line only) - Test: `npm run check` (svelte-check) **Interfaces:** - Consumes: nothing - Produces: Clean `npm run check` (0 errors for T1–T4; a11y warnings will still be present until Task 2) - [ ] **Step 1: Install `@types/node`** Run: ```bash npm install -D @types/node ``` Expected: Package added to `devDependencies` in `package.json`. - [ ] **Step 2: Add `"types": ["node"]` to `tsconfig.json`** Edit `tsconfig.json` — add `"types": ["node"]` inside `compilerOptions`: ```json { "compilerOptions": { "allowJs": true, "checkJs": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, "skipLibCheck": true, "sourceMap": true, "strict": true, "moduleResolution": "bundler", "module": "ESNext", "target": "ESNext", "isolatedModules": true, "types": ["node"], "paths": { "$lib/*": ["./src/lib/*"] } }, "include": ["src/**/*.ts", "src/**/*.svelte", "tests/**/*.ts", "vite.config.ts"] } ``` - [ ] **Step 3: Change `defineConfig` import in `vite.config.ts`** Change line 4 from: ```typescript import { defineConfig } from 'vite'; ``` to: ```typescript import { defineConfig } from 'vitest/config'; ``` This re-export extends `UserConfigExport` with vitest's `test` property. - [ ] **Step 4: Verify TS errors are resolved** Run: ```bash npm run check 2>&1 | grep -E "^(Error|.*Error:)" ``` Expected: No lines matching "Error" — only a11y warnings remain. - [ ] **Step 5: Commit** ```bash git add tsconfig.json vite.config.ts package.json package-lock.json git commit -m "fix: resolve TypeScript errors in vite.config.ts - Install @types/node for node:path, node:process, node:url - Import defineConfig from vitest/config for test config type - Add types: [\"node\"] to tsconfig.json" ``` --- ### Task 2: Svelte A11y Warning Fixes **Files:** - Modify: `src/lib/components/CaptionSettingsPanel.svelte:48-209` (label associations) - Modify: `src/lib/components/ClipList.svelte:46` (tabindex + keydown) - Modify: `src/lib/components/PreferencesPanel.svelte:60-61` (tabindex + keydown) - Modify: `src/lib/components/ExportDialog.svelte:139-140` (tabindex + keydown) - Modify: `src/lib/components/AboutDialog.svelte:15-16` (tabindex + keydown) - Modify: `src/lib/components/VideoPlayer.svelte:187-197` (track element) - Modify: `src/App.svelte:188-193` (resize handle keyboard support) - Test: `npm run check` (svelte-check) **Interfaces:** - Consumes: Task 1 completed (TS errors resolved) - Produces: Zero a11y warnings from `npm run check` and `npm run build` - [ ] **Step 1: Fix CaptionSettingsPanel labels (9 warnings)** The labels at lines 48, 61, 74, 90, 108, 120, 165, 195, and 209 are not associated with their controls. Fix each by adding `id` attributes to controls and `for` attributes to labels. Use unique IDs prefixed with `caption-`. **Line 48 — Font label + select:** Change: ```svelte Font Size {settings.fontSize}px update({ fontSize: parseInt((e.target as HTMLInputElement).value, 10) })} /> ``` Remove the standalone `` that was a sibling below the closing ``. **Line 74 — Text Color label:** Change: ```svelte
Text Color
Dimmed Text
``` Remove the standalone `` below. **Line 120 — Dimmed Color label:** Change: ```svelte
Dimmed Color
BG Opacity {Math.round(settings.backgroundOpacity * 100)}% update({ backgroundOpacity: parseInt((e.target as HTMLInputElement).value, 10) / 100 })} /> ``` Remove the standalone `` below. **Line 195 — Shadow Depth label + range:** Wrap input inside label: ```svelte ``` Remove the standalone `` below. **Line 209 — Position label:** Same as Dimmed Text — heading for radio group: ```svelte