You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,22 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
5
5
## Commands
6
6
7
7
```bash
8
-
npm run dev # start Electron app in development (hot reload)
9
-
npm run tsc # type-check without emitting
10
-
npm run lint # ESLint
11
-
npm run lint:fix # ESLint with auto-fix
12
-
npm run prettier:fix # format src/
13
-
npm run build # full production build (tsc + vite + electron-builder)
8
+
pnpm dev # start Electron app in development (hot reload)
9
+
pnpm tsc # type-check without emitting
10
+
pnpm lint # ESLint
11
+
pnpm lint:fix # ESLint with auto-fix
12
+
pnpm prettier:fix # format src/
13
+
pnpm build # full production build (tsc + vite + electron-builder)
14
+
pnpm tag patch # bump version, push main, and push release tag
14
15
```
15
16
16
-
There are no tests yet. After any change, `npm run tsc` is the fastest correctness check.
17
+
This project uses pnpm (`packageManager` is pinned in `package.json`). There are no tests yet. After any change, `pnpm tsc` is the fastest correctness check.
17
18
18
-
After `npm install`, the `postinstall` script runs `electron-rebuild -f -w better-sqlite3` automatically. If the app crashes on startup with a native module error, re-run `npm install` to rebuild.
19
+
After `pnpm install`, the `postinstall` script runs `electron-rebuild -f -w better-sqlite3` automatically. If the app crashes on startup with a native module error, re-run `pnpm install` to rebuild.
19
20
20
21
## Architecture
21
22
22
-
SampleByte is an Electron 33 + React 19 + TypeScript desktop app. The full vision and technical decisions are in `docs/ARCHITECTURE.md`. The product roadmap is in `docs/ROADMAP.md`. UI design system, color tokens, and macOS conventions are in `docs/DESIGN.md` — read it before touching any UI code.
23
+
SampleByte is an Electron 41 + React 19 + TypeScript desktop app. The full vision and technical decisions are in `docs/ARCHITECTURE.md`. The product roadmap is in `docs/ROADMAP.md`. UI design system, color tokens, and macOS conventions are in `docs/DESIGN.md` — read it before touching any UI code.
Copy file name to clipboardExpand all lines: docs/ARCHITECTURE.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,6 +141,14 @@ Analysis runs once when audio is loaded into the Chop view. Results are stored o
141
141
142
142
---
143
143
144
+
## Local Audio Files
145
+
146
+
Renderer code does not read native file paths directly through `file://`. Local audio is exposed through the privileged `local-file://` protocol registered in `electron/main/index.ts`, which streams files with CORS headers so WaveSurfer, `<audio>`, and `fetch`-based analysis can all load the same URL.
147
+
148
+
When a user drops a file, the renderer asks the preload bridge for the native path via `webUtils.getPathForFile(file)`. Build `local-file://` URLs with `toLocalFileUrl()` from `src/utils/index.ts`; do not concatenate raw paths by hand. The protocol handler accepts Chromium's host/path URL form and reconstructs the absolute path before forwarding to `net.fetch(pathToFileURL(...))`.
149
+
150
+
---
151
+
144
152
## Freesound Integration
145
153
146
154
Freesound has a public REST API with Creative Commons licensed audio. The API key is stored in the main process (never exposed to the renderer) and all requests are proxied through the `freesound:*` IPC handlers in `electron/main/ipc/freesound.ts`. Downloaded files are added to the library automatically.
0 commit comments