fix: migrate tooling to bun and accept file path targets

This commit is contained in:
2026-02-17 20:39:06 -08:00
parent a531527e1f
commit 846b075206
20 changed files with 1620 additions and 5735 deletions

View File

@@ -37,7 +37,7 @@ SubMiner.AppImage --generate-config --backup-overwrite
- `--generate-config` writes a default JSONC config template.
- If the target file exists, SubMiner prompts to create a timestamped backup and overwrite.
- In non-interactive shells, use `--backup-overwrite` to explicitly back up and overwrite.
- `pnpm run generate:config-example` regenerates both repository `config.example.jsonc` and docs-served `/config.example.jsonc` from the same centralized defaults.
- `bun run generate:config-example` regenerates both repository `config.example.jsonc` and docs-served `/config.example.jsonc` from the same centralized defaults.
- `make generate-config` builds and runs the same default-config generator via local Electron.
Invalid config values are handled with warn-and-fallback behavior: SubMiner logs the bad key/value and continues with the default for that option.

View File

@@ -3,8 +3,7 @@
## Prerequisites
- [Node.js](https://nodejs.org/) (LTS)
- [pnpm](https://pnpm.io/)
- [Bun](https://bun.sh) (for the `subminer` wrapper script)
- [Bun](https://bun.sh)
## Setup
@@ -13,15 +12,15 @@ git clone https://github.com/ksyasuda/SubMiner.git
cd SubMiner
make deps
# or manually:
pnpm install
pnpm -C vendor/texthooker-ui install
bun install
bun --cwd vendor/texthooker-ui install
```
## Building
```bash
# TypeScript compile (fast, for development)
pnpm run build
bun run build
# Full platform build (includes texthooker-ui + AppImage/DMG)
make build
@@ -35,16 +34,16 @@ make build-macos-unsigned # macOS DMG + ZIP (unsigned)
## Running Locally
```bash
pnpm run dev # builds + launches with --start --dev
bun run dev # builds + launches with --start --dev
electron . --start --dev --log-level debug # equivalent Electron launch with verbose logging
```
## Testing
```bash
pnpm run test:config # Config schema and validation tests (build + run)
pnpm run test:core # Core service tests (~67 tests) (build + run)
pnpm run test:subtitle # Subtitle pipeline tests (build + run)
bun run test:config # Config schema and validation tests (build + run)
bun run test:core # Core service tests (~67 tests) (build + run)
bun run test:subtitle # Subtitle pipeline tests (build + run)
```
All legacy test commands build first, then run via Node's built-in test runner (`node --test`).
@@ -52,11 +51,11 @@ All legacy test commands build first, then run via Node's built-in test runner (
For faster iteration while editing test code:
```bash
pnpm run build # one-time compile
pnpm run test:config:dist # no rebuild
pnpm run test:core:dist # no rebuild
pnpm run test:subtitle:dist # no rebuild
pnpm run test:fast # run all tests without rebuild (assumes build is already current)
bun run build # one-time compile
bun run test:config:dist # no rebuild
bun run test:core:dist # no rebuild
bun run test:subtitle:dist # no rebuild
bun run test:fast # run all tests without rebuild (assumes build is already current)
```
## Config Generation
@@ -67,7 +66,7 @@ make generate-config
# Regenerate the repo's config.example.jsonc from centralized defaults
make generate-example-config
# or: pnpm run generate:config-example
# or: bun run generate:config-example
```
## Documentation Site

View File

@@ -82,9 +82,9 @@ brew install mpv mecab mecab-ipadic
```bash
git clone https://github.com/ksyasuda/SubMiner.git
cd SubMiner
pnpm install
cd vendor/texthooker-ui && pnpm install && pnpm build && cd ../..
pnpm run build:mac
bun install
cd vendor/texthooker-ui && bun install && bun run build && cd ../..
bun run build:mac
```
The built app will be available in the `release` directory (`.dmg` and `.zip`).
@@ -92,7 +92,7 @@ The built app will be available in the `release` directory (`.dmg` and `.zip`).
For unsigned local builds:
```bash
pnpm run build:mac:unsigned
bun run build:mac:unsigned
```
### Accessibility Permission

View File

@@ -58,4 +58,4 @@ Practical guidance:
- Keep the JLPT bundle inside `vendor/yomitan-jlpt-vocab` to avoid network lookups.
- Measure bundle size with:
- `du -sh vendor/yomitan-jlpt-vocab`
- If the JLPT source is updated, re-run `pnpm run build:appimage` / packaging and confirm startup logs do not report missing banks.
- If the JLPT source is updated, re-run `bun run build:appimage` / packaging and confirm startup logs do not report missing banks.

View File

@@ -46,26 +46,6 @@
"level": "info"
},
// Immersion Tracking
// Persist mined subtitle/session telemetry for analytics.
// ==========================================
"immersionTracking": {
"enabled": true,
"dbPath": "",
"batchSize": 25,
"flushIntervalMs": 500,
"queueCap": 1000,
"payloadCapBytes": 256,
"maintenanceIntervalMs": 86400000,
"retention": {
"eventsDays": 7,
"telemetryDays": 30,
"dailyRollupsDays": 365,
"monthlyRollupsDays": 1825,
"vacuumIntervalDays": 7
}
},
// ==========================================
// AnkiConnect Integration
// Automatic Anki updates and media generation options.
@@ -314,5 +294,28 @@
"aac"
],
"transcodeVideoCodec": "h264"
},
// ==========================================
// Immersion Tracking
// Enable/disable immersion tracking.
// Set dbPath to override the default sqlite database location.
// Policy tuning is available for queue, flush, and retention values.
// ==========================================
"immersionTracking": {
"enabled": true,
"dbPath": "",
"batchSize": 25,
"flushIntervalMs": 500,
"queueCap": 1000,
"payloadCapBytes": 256,
"maintenanceIntervalMs": 86400000,
"retention": {
"eventsDays": 7,
"telemetryDays": 30,
"dailyRollupsDays": 365,
"monthlyRollupsDays": 1825,
"vacuumIntervalDays": 7
}
}
}