Skip to content
Merged
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
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add a shebang line for better portability.

The pre-commit hook script is missing a shebang line. While Husky may handle this automatically in some cases, including an explicit shebang ensures the script executes correctly across different environments.

🔧 Proposed fix to add shebang
+#!/bin/sh
 npx lint-staged
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
npx lint-staged
#!/bin/sh
npx lint-staged
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.husky/pre-commit at line 1, Add a shebang as the very first line of the
pre-commit script so the shell is explicit (e.g. use /usr/bin/env bash), keeping
the existing npx lint-staged invocation intact; ensure the pre-commit script
remains executable (chmod +x) after the change so Husky and other environments
run it reliably.

4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
83 changes: 0 additions & 83 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,96 +16,13 @@ If you discover a security vulnerability, please follow our [Security Policy](SE

1. Clone the repository
2. Install dependencies: `npm run install:all`
3. Seed demo data: `node scripts/seed-streams.js --reset`
4. Run the development environment: `npm run dev`

### Seeding Demo Data

To populate your local database with deterministic demo streams:

```bash
# Seed 10 default streams
node scripts/seed-streams.js

# Seed custom number of streams
node scripts/seed-streams.js --count 20

# Reset database and seed
node scripts/seed-streams.js --reset

# Combine options
node scripts/seed-streams.js --reset --count 15
```

The seed script creates streams across all statuses (scheduled, active, paused, completed, canceled) with deterministic data, ensuring consistent results on every run when the database is empty.

## Testing

### Backend Tests

All backend tests use [Vitest](https://vitest.dev/) and live alongside source files as `*.test.ts`.

**Run all tests once** (CI mode):

```bash
cd backend
npm test -- --run
```

**Watch mode** (re-runs affected tests on every save — recommended during development):

```bash
cd backend
npm test
```

**Run a single file in watch mode:**

```bash
cd backend
npm test -- src/services/streamStore.test.ts
```

**Coverage report** (requires `@vitest/coverage-v8`, already in devDependencies):

```bash
cd backend
npm test -- --run --coverage
```

Coverage output is written to `backend/coverage/`. Open `coverage/index.html` in a browser for the full line-by-line report.

**Coverage for a specific file:**

```bash
cd backend
npm test -- --run --coverage --coverage.include='src/services/streamStore.ts'
```

### Frontend Tests

Frontend tests also use Vitest with `happy-dom` and React Testing Library.

**Run all tests once:**

```bash
cd frontend
npm test -- --run
```

**Watch mode:**

```bash
cd frontend
npm test
```

**Coverage report:**

```bash
cd frontend
npm test -- --run --coverage
```

### Contract Tests

Expand Down
38 changes: 38 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default [
{
ignores: [
'backend/dist/**',
'frontend/dist/**',
'frontend/coverage/**',
'node_modules/**',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.es2024,
...globals.node,
},
},
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
},
},
];
Loading
Loading