refactor(launcher): complete split into modular launcher/ directory

- Split 4,028-line monolithic subminer script into 10 focused modules
- launcher/types.ts: shared types and constants
- launcher/log.ts: logging infrastructure
- launcher/util.ts: pure utilities and child process runner
- launcher/config.ts: config loading and arg parsing
- launcher/jimaku.ts: Jimaku API client and media parsing
- launcher/picker.ts: rofi/fzf menu UI
- launcher/mpv.ts: mpv process management and IPC
- launcher/youtube.ts: YouTube subtitle generation pipeline
- launcher/jellyfin.ts: Jellyfin API and browsing
- launcher/main.ts: orchestration entrypoint
- Add build-launcher Makefile target using bun build
- subminer is now a build artifact produced by make build-launcher
- install-linux and install-macos depend on build-launcher
This commit is contained in:
2026-02-17 03:39:25 -08:00
parent ba94a33b46
commit e7a522a485
4 changed files with 319 additions and 2981 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: help deps build install build-linux build-macos build-macos-unsigned clean install-linux install-macos install-plugin uninstall uninstall-linux uninstall-macos print-dirs pretty ensure-pnpm generate-config generate-example-config docs-dev docs docs-preview dev-start dev-start-macos dev-toggle dev-stop
.PHONY: help deps build build-launcher install build-linux build-macos build-macos-unsigned clean install-linux install-macos install-plugin uninstall uninstall-linux uninstall-macos print-dirs pretty ensure-pnpm generate-config generate-example-config docs-dev docs docs-preview dev-start dev-start-macos dev-toggle dev-stop
APP_NAME := subminer
THEME_FILE := subminer.rasi
@@ -131,6 +131,12 @@ build-macos-unsigned: deps
@pnpm -C vendor/texthooker-ui build
@pnpm run build:mac:unsigned
build-launcher:
@printf '%s\n' "[INFO] Bundling launcher script"
@bun build ./launcher/main.ts --target=bun --packages=bundle --outfile=subminer
@sed -i '1s|^// @bun|#!/usr/bin/env bun\n// @bun|' subminer
@chmod +x subminer
clean:
@printf '%s\n' "[INFO] Removing build artifacts"
@rm -f release/SubMiner-*.AppImage
@@ -170,7 +176,7 @@ dev-stop: ensure-pnpm
@pnpm exec electron . --stop
install-linux:
install-linux: build-launcher
@printf '%s\n' "[INFO] Installing Linux wrapper/theme artifacts"
@install -d "$(BINDIR)"
@install -m 0755 "./$(APP_NAME)" "$(BINDIR)/$(APP_NAME)"
@@ -184,7 +190,7 @@ install-linux:
fi
@printf '%s\n' "Installed to:" " $(BINDIR)/subminer" " $(LINUX_DATA_DIR)/themes/$(THEME_FILE)"
install-macos:
install-macos: build-launcher
@printf '%s\n' "[INFO] Installing macOS wrapper/theme/app artifacts"
@install -d "$(BINDIR)"
@install -m 0755 "./$(APP_NAME)" "$(BINDIR)/$(APP_NAME)"