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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ coverage/
/cypress/videos/
/cypress/screenshots/
test-results/
playwright-report/
eslint-report.json
.codeql-db*/

# Vite
Expand Down Expand Up @@ -278,5 +278,9 @@ listenarr.api/wwwroot/assets/
listenarr.api/wwwroot/index.html
listenarr.api/wwwroot/*.map
listenarr.api/wwwroot/assets/**
listenarr.api/wwwroot/large-logo.png
listenarr.api/wwwroot/stats.html
listenarr.api/wwwroot/fonts/.gitkeep
listenarr.api/wwwroot/fonts/README.md
listenarr.api/config/appsettings/appsettings.json
/listenarr.api/config
26 changes: 25 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
#!/usr/bin/env sh
set -e

# Some Windows Git clients launch hooks with a reduced PATH that omits Node.
if ! command -v node >/dev/null 2>&1 && [ -d "/c/Program Files/nodejs" ]; then
export PATH="/c/Program Files/nodejs:$PATH"
fi

echo "Running staged lint and format checks..."
npm run lint:staged
node scripts/lint-staged.mjs

echo "Checking layering rules and async void..."
VIOLATIONS=0
if git grep -n --no-color "listenarr.infrastructure" -- "listenarr.api/**/*.cs" ":(exclude)listenarr.api/Program.cs" || git grep -n --no-color "Listenarr.Infrastructure" -- "listenarr.api/**/*.cs" ":(exclude)listenarr.api/Program.cs"; then
echo "Layering violation: listenarr.api references listenarr.infrastructure." >&2
VIOLATIONS=$((VIOLATIONS + 1))
fi
if git grep -n --no-color "listenarr.infrastructure" -- "listenarr.application/**/*.cs" || git grep -n --no-color "Listenarr.Infrastructure" -- "listenarr.application/**/*.cs"; then
echo "Layering violation: listenarr.application references listenarr.infrastructure." >&2
VIOLATIONS=$((VIOLATIONS + 1))
fi
if git grep -n --no-color "async void" -- "listenarr.api/**/*.cs" "listenarr.application/**/*.cs" "listenarr.infrastructure/**/*.cs" "listenarr.domain/**/*.cs"; then
echo "async void found in production code — use async Task instead." >&2
VIOLATIONS=$((VIOLATIONS + 1))
fi
if [ "$VIOLATIONS" -gt 0 ]; then
echo "$VIOLATIONS enforcement check(s) failed." >&2
exit 1
fi
18 changes: 16 additions & 2 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#!/usr/bin/env sh
set -e

echo "Running test suite..."
npm test
# Some Windows Git clients launch hooks with a reduced PATH that omits Node.
if ! command -v node >/dev/null 2>&1 && [ -d "/c/Program Files/nodejs" ]; then
export PATH="/c/Program Files/nodejs:$PATH"
fi

echo "Syncing version..."
node scripts/sync-fe-version-from-csproj.mjs

echo "Checking backend format..."
dotnet format listenarr.slnx --no-restore --verify-no-changes --verbosity minimal

echo "Running frontend type check..."
(cd fe && node node_modules/vue-tsc/bin/vue-tsc.js --build tsconfig.app.json)

echo "Running frontend tests..."
(cd fe && node node_modules/vitest/vitest.mjs run)
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ This project follows a layered pattern: domain models in `listenarr.domain`, EF
**Testing:**
- Run backend tests: `dotnet test`
- Run frontend tests: `cd fe && npm run test:unit`
- Run frontend type checks: `cd fe && npm run type-check`
- Run the full frontend gate: `npm run verify:frontend`
- Ensure all tests pass before submitting PR

### Branching Model
Expand Down
2 changes: 1 addition & 1 deletion fe/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ coverage
/cypress/videos/
/cypress/screenshots/
test-results/
playwright-report/
eslint-report.json

# Editor directories and files
.vscode/*
Expand Down
2 changes: 1 addition & 1 deletion fe/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"tsconfig.json": "tsconfig.*.json, env.d.ts",
"vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*",
"vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*",
"package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .oxlint*, oxlint*, .prettier*, prettier*, .editorconfig"
},
"editor.codeActionsOnSave": {
Expand Down
16 changes: 15 additions & 1 deletion fe/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Listenarr Frontend (fe)

This template should help get you started developing with Vue 3 in Vite.
Listenarr's Vue 3/Vite frontend for audiobook search, library management,
settings, and activity workflows.

## Recommended IDE Setup

Expand Down Expand Up @@ -47,6 +48,19 @@ npm run build
npm run test:unit
```

This runs all configured Vitest projects: node-only specs, jsdom specs, and
smoke specs. Name specs `*.node.spec.ts` only when they intentionally run
without browser globals.

### Run the Frontend Verification Gate

```sh
npm run verify
```

This runs the frontend structure guard, ESLint, Vue handler checks, type checks,
and Vitest coverage.

### Run End-to-End Tests with [Cypress](https://www.cypress.io/)

```sh
Expand Down
2 changes: 1 addition & 1 deletion fe/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
baseUrl: 'http://localhost:5173',
baseUrl: 'http://localhost:4173',
},
})
Loading
Loading