Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g. 0.1.0)"
description: "Release version (e.g. 1.2.0 or 1.2.0-beta.1)"
required: true
type: string
prerelease:
description: "Mark as pre-release (beta)"
required: false
type: boolean
default: false

permissions:
contents: write
Expand Down Expand Up @@ -62,7 +67,12 @@ jobs:
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx electron-builder --mac --arm64 --publish always
run: |
if [ "${{ github.event.inputs.prerelease }}" = "true" ]; then
npx electron-builder --mac --arm64 --publish always -c.publish.releaseType=prerelease
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify this flag syntax works — electron-builder docs should confirm if -c.publish.releaseType=prerelease or --config.publish.releaseType=prerelease is correct

else
npx electron-builder --mac --arm64 --publish always
fi
Comment on lines +70 to +75
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verify -c.publish.releaseType=prerelease syntax with electron-builder docs - might need --config.publish.releaseType=prerelease instead


- name: Add release notes
env:
Expand All @@ -72,3 +82,9 @@ jobs:
-f tag_name="v${{ github.event.inputs.version }}" \
--jq '.body')
gh release edit "v${{ github.event.inputs.version }}" --notes "$NOTES"

- name: Mark as pre-release
if: ${{ github.event.inputs.prerelease == 'true' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release edit "v${{ github.event.inputs.version }}" --prerelease
11 changes: 10 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,18 @@ export const useStore = create<StoreState>((set, get) => ({
- **Framework**: Vitest with `globals: true`
- **Database tests**: Create temp SQLite file in `os.tmpdir()`, clean up in `afterEach`
- **Mock paths**: `vi.mock('../paths', () => ({ getDataDir: () => '' }))`
- **Test file location**: `src/main/__tests__/`
- **Test file location**: `src/main/__tests__/`, `src/renderer/__tests__/`
- **Run**: `npm run test` (rebuilds native modules before/after)

### Test Requirements

Follow **test-driven development (TDD)**: write a failing test first, then implement the feature to make it pass. Tests are mandatory for all code changes. Always run `npm run test` after making changes.

- **Data flow defaults**: When a DB query can return `undefined`/`null` for a field that the UI consumes, test that the hydration layer provides a sensible default. The UI should never receive `undefined` for a field it conditionally renders on.
- **Event-driven UI state**: When backend events drive UI state changes (e.g., `INDEXING_PROGRESS` → badge states), test the full state machine: every event type must be covered, including transitions between states and the final/reset state.
- **Conditional rendering**: When UI elements render conditionally (e.g., `{value && <Component />}`), ensure tests verify that the condition is met for all expected cases — not just the happy path. A missing default value that makes a field `undefined` will silently hide UI elements.
- **Renderer logic tests**: Extract non-trivial derivation logic (state machines, computed props) into pure functions and test them in `src/renderer/__tests__/`. This avoids needing a DOM environment while still catching logic bugs.

### Adding a New DB Domain

1. Create `src/main/db/<domain>.ts` with query/mutation functions
Expand Down
4 changes: 4 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ asarUnpack:
- "**/node_modules/better-sqlite3/**"
- "**/node_modules/bindings/**"
- "**/node_modules/file-uri-to-path/**"
- "**/node_modules/onnxruntime-node/**"
- "**/node_modules/onnxruntime-common/**"
- "**/node_modules/@huggingface/transformers/**"
- "**/dist/main/main/services/embedding-worker.js"
icon: resources/icon.icns
publish:
provider: github
Expand Down
Loading
Loading