Skip to content

Commit e97dbf5

Browse files
committed
Standardize project configuration
- Standardize README badges (CI, Node.js, License) and remove redundant license section - Fix 8 stale file references in CLAUDE.md - Standardize Dependabot config with grouping, labels, assignees - Add Dependabot auto-merge workflow for patch/minor updates - Add claudelint to CI pipeline, install config and SessionStart hook - Add .claudelint-cache/ to .gitignore
1 parent ba9c733 commit e97dbf5

File tree

10 files changed

+116
-41
lines changed

10 files changed

+116
-41
lines changed

.claude/hooks/hooks.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"hooks": [
6+
{
7+
"type": "command",
8+
"command": "npx claudelint check-all --format json"
9+
}
10+
]
11+
}
12+
]
13+
}
14+
}

.claudelintignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Dependencies
2+
node_modules/
3+
vendor/
4+
5+
# Build outputs
6+
dist/
7+
build/
8+
9+
# Testing
10+
coverage/
11+
*.log

.claudelintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "claudelint:recommended"
3+
}

.github/dependabot.yml

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,56 @@
11
version: 2
22
updates:
3-
# Enable version updates for npm
43
- package-ecosystem: "npm"
54
directory: "/"
65
schedule:
76
interval: "weekly"
87
day: "monday"
8+
time: "06:00"
9+
timezone: "America/New_York"
910
open-pull-requests-limit: 10
10-
groups:
11-
# Group all TypeScript ESLint packages together
12-
typescript-eslint:
13-
patterns:
14-
- "@typescript-eslint/*"
15-
# Group all Jest/testing packages together
16-
jest:
17-
patterns:
18-
- "jest"
19-
- "@types/jest"
20-
- "ts-jest"
21-
# Group Puppeteer packages together
22-
puppeteer:
23-
patterns:
24-
- "puppeteer*"
25-
# Group ESLint packages together
26-
eslint:
27-
patterns:
28-
- "eslint*"
29-
exclude-patterns:
30-
- "@typescript-eslint/*"
31-
# Automatically merge patch and minor updates for dev dependencies
11+
commit-message:
12+
prefix: "deps"
13+
prefix-development: "deps-dev"
14+
include: "scope"
3215
labels:
3316
- "dependencies"
34-
- "automated"
17+
- "npm"
18+
assignees:
19+
- "pdugan20"
20+
reviewers:
21+
- "pdugan20"
22+
groups:
23+
dev-dependencies:
24+
dependency-type: "development"
25+
update-types:
26+
- "minor"
27+
- "patch"
28+
production-dependencies:
29+
dependency-type: "production"
30+
update-types:
31+
- "minor"
32+
- "patch"
3533

36-
# Enable version updates for GitHub Actions
3734
- package-ecosystem: "github-actions"
3835
directory: "/"
3936
schedule:
4037
interval: "weekly"
4138
day: "monday"
39+
time: "06:00"
40+
timezone: "America/New_York"
41+
open-pull-requests-limit: 5
42+
commit-message:
43+
prefix: "ci"
4244
labels:
45+
- "dependencies"
4346
- "github-actions"
44-
- "automated"
47+
assignees:
48+
- "pdugan20"
49+
reviewers:
50+
- "pdugan20"
51+
groups:
52+
github-actions:
53+
patterns: ["*"]
54+
update-types:
55+
- "minor"
56+
- "patch"

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
flags: unittests
4444
name: codecov-umbrella
4545

46+
- name: Lint Claude Code config
47+
run: npx claudelint
48+
4649
- name: Build
4750
run: npm run build
4851

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Dependabot Auto-Merge
2+
3+
on: pull_request
4+
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
9+
jobs:
10+
auto-merge:
11+
runs-on: ubuntu-latest
12+
if: github.event.pull_request.user.login == 'dependabot[bot]'
13+
steps:
14+
- name: Fetch Dependabot metadata
15+
id: metadata
16+
uses: dependabot/fetch-metadata@v2
17+
with:
18+
github-token: "${{ secrets.GITHUB_TOKEN }}"
19+
20+
- name: Approve PR
21+
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
22+
run: gh pr review --approve "$PR_URL"
23+
env:
24+
PR_URL: ${{ github.event.pull_request.html_url }}
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Enable auto-merge
28+
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
29+
run: gh pr merge --auto --squash "$PR_URL"
30+
env:
31+
PR_URL: ${{ github.event.pull_request.html_url }}
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ Thumbs.db
4848
# Testing
4949
coverage/
5050
.nyc_output/
51+
.claudelint-cache/

CLAUDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ npm run extension:lint # Lint with warnings-as-errors
4646
- `src/commands/list.ts` - List downloaded books
4747
- `src/commands/tag.ts` - Tag MP3 files with metadata
4848
- `src/commands/merge.ts` - Merge chapters into M4B audiobook
49-
- `src/metadata/embedder.ts` - ID3 tag embedding
49+
- `src/services/metadata-service.ts` - ID3 tag embedding
5050
- `src/services/merge-service.ts` - M4B audiobook merging with FFmpeg
51-
- `src/utils/books.ts` - Book discovery and status checking
51+
- `src/services/book-service.ts` - Book discovery and status checking
5252
- `src/utils/logger.ts` - Logging utilities
5353

5454
**Chrome Extension (TypeScript Source):**
@@ -106,7 +106,7 @@ npm run extension:lint # Lint with warnings-as-errors
106106
- Saves metadata.json alongside MP3 files
107107

108108
2. **CLI Tags (Optional):**
109-
- CLI auto-discovers books in `~/Downloads/libby-downloads/`
109+
- CLI auto-discovers books in ~/Downloads/libby-downloads/
110110
- Reads metadata.json from book folders
111111
- Embeds ID3 tags into MP3 files (title, author, narrator, cover art)
112112
- Shows book status (tagged/untagged)
@@ -174,11 +174,11 @@ export const DEBUG_MODE = true; // Set to false for production
174174

175175
**Test structure:** `src/__tests__/`
176176

177-
- `__tests__/mocks/` - Chrome API mocks
178-
- `__tests__/shared/` - Shared utility tests (validators, logger, errors)
179-
- `__tests__/background/` - Background service tests (download-service, download-tracker)
180-
- `__tests__/types/` - Type definition tests
181-
- `utils/__tests__/` - CLI utility tests
177+
- `src/__tests__/mocks/` - Chrome API mocks
178+
- `src/__tests__/shared/` - Shared utility tests (validators, logger, errors)
179+
- `src/__tests__/background/` - Background service tests (download-service, download-tracker)
180+
- `src/__tests__/types/` - Type definition tests
181+
- `src/utils/__tests__/` - CLI utility tests
182182

183183
**Test environment:** Jest with jsdom (for browser-like environment)
184184

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Libby Downloader
22

3-
[![CI](https://github.com/pdugan20/libby-downloader/actions/workflows/ci.yml/badge.svg)](https://github.com/pdugan20/libby-downloader/actions/workflows/ci.yml)
4-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5-
[![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org/)
3+
[![CI](https://github.com/pdugan20/libby-downloader/workflows/CI/badge.svg)](https://github.com/pdugan20/libby-downloader/actions)
4+
[![Node.js](https://img.shields.io/node/v/next?logo=node.js)](https://nodejs.org)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66

77
Download audiobooks from Libby to your computer for offline listening.
88

@@ -206,6 +206,3 @@ This tool is provided for **educational purposes only**. Users are responsible f
206206
- Complying with their library's terms of service
207207
- Respecting copyright and licensing agreements
208208

209-
## License
210-
211-
MIT - See [LICENSE](LICENSE)

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
"check-all": "npm run typecheck && npm run lint && npm run format:check && npm run test",
2727
"prepare": "husky",
2828
"extension:lint": "web-ext lint --source-dir=chrome-extension --warnings-as-errors",
29-
"extension:validate": "node scripts/validate-extension.js"
29+
"extension:validate": "node scripts/validate-extension.js",
30+
"lint:claude": "claudelint check-all",
31+
"lint:claude:fix": "claudelint format --fix"
3032
},
3133
"keywords": [
3234
"libby",

0 commit comments

Comments
 (0)