From ea79e331fad09d7188f00cd7ec850b76c979691c Mon Sep 17 00:00:00 2001 From: sudacode Date: Sat, 6 Jun 2026 01:18:44 -0700 Subject: [PATCH] build: make deps initializes submodules before installing JS deps - Add `submodules` target that runs `git submodule update --init --recursive` - `deps` now depends on `submodules` so fresh checkouts work out of the box - Update docs to replace manual install steps with `make deps` - Fix Windows build-from-source steps to include stats and submodule init --- Makefile | 11 +++++++---- changes/setup-make-deps.md | 4 ++++ docs-site/development.md | 11 +++-------- docs-site/installation.md | 12 ++++++------ 4 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 changes/setup-make-deps.md diff --git a/Makefile b/Makefile index 49028a55..dfb5ccfc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help deps build build-launcher install build-linux build-macos build-macos-unsigned clean install-linux install-macos install-windows uninstall uninstall-linux uninstall-macos uninstall-windows print-dirs pretty lint ensure-bun generate-config generate-example-config dev-start dev-start-macos dev-watch dev-watch-macos dev-toggle dev-stop docs-test docs-build docs-build-versioned docs-dev +.PHONY: help submodules deps build build-launcher install build-linux build-macos build-macos-unsigned clean install-linux install-macos install-windows uninstall uninstall-linux uninstall-macos uninstall-windows print-dirs pretty lint ensure-bun generate-config generate-example-config dev-start dev-start-macos dev-watch dev-watch-macos dev-toggle dev-stop docs-test docs-build docs-build-versioned docs-dev APP_NAME := subminer THEME_SOURCE := assets/themes/subminer.rasi @@ -72,7 +72,8 @@ help: " generate-config Generate ~/.config/SubMiner/config.jsonc from centralized defaults" \ "" \ "Other targets:" \ - " deps Install JS dependencies (root + stats + texthooker-ui)" \ + " submodules Initialize/update git submodules" \ + " deps Initialize submodules and install JS dependencies (root + stats + texthooker-ui)" \ " uninstall-linux Remove Linux install artifacts" \ " uninstall-macos Remove macOS install artifacts" \ " uninstall-windows Remove Windows mpv plugin artifacts" \ @@ -105,8 +106,10 @@ print-dirs: "MACOS_APP_SRC=$(MACOS_APP_SRC)" \ "MACOS_ZIP_SRC=$(MACOS_ZIP_SRC)" -deps: - @$(MAKE) --no-print-directory ensure-bun +submodules: + @git submodule update --init --recursive + +deps: submodules ensure-bun @bun install @cd stats && bun install --frozen-lockfile @cd vendor/texthooker-ui && bun install --frozen-lockfile diff --git a/changes/setup-make-deps.md b/changes/setup-make-deps.md new file mode 100644 index 00000000..9a6372b8 --- /dev/null +++ b/changes/setup-make-deps.md @@ -0,0 +1,4 @@ +type: fixed +area: build + +- Updated `make deps` so a fresh source checkout initializes submodules before installing root, stats, and texthooker-ui dependencies. diff --git a/docs-site/development.md b/docs-site/development.md index ae4bb4b2..1433c6ac 100644 --- a/docs-site/development.md +++ b/docs-site/development.md @@ -11,15 +11,10 @@ For internal architecture/workflow guidance, use `docs/README.md` at the repo ro ```bash git clone --recurse-submodules https://github.com/ksyasuda/SubMiner.git cd SubMiner -# if you cloned without --recurse-submodules: -git submodule update --init --recursive - -bun install -(cd stats && bun install --frozen-lockfile) -(cd vendor/texthooker-ui && bun install --frozen-lockfile) +make deps ``` -`make deps` is still available as a convenience wrapper around the same dependency install flow. +`make deps` initializes submodules and installs root, `stats/`, and `vendor/texthooker-ui` dependencies. The Yomitan submodule installs its own dependencies on demand during `bun run build`. ## Building @@ -216,7 +211,7 @@ Run `make help` for a full list of targets. Key ones: | `make build` | Build platform package for detected OS | | `make build-launcher` | Generate Bun launcher wrapper at `dist/launcher/subminer` | | `make install` | Install platform artifacts (wrapper, theme, AppImage/app bundle) | -| `make deps` | Install JS dependencies (root + stats + texthooker-ui) | +| `make deps` | Init submodules and install root/stats/texthooker-ui deps | | `make pretty` | Run scoped Prettier formatting for maintained source/config files | | `make generate-config` | Generate default config from centralized registry | | `make build-linux` | Convenience wrapper for Linux packaging | diff --git a/docs-site/installation.md b/docs-site/installation.md index 8b93f8c6..a1f64405 100644 --- a/docs-site/installation.md +++ b/docs-site/installation.md @@ -185,7 +185,7 @@ Make sure `mpv.exe` is on your `PATH`, or set `mpv.executablePath` in the config ```bash git clone --recurse-submodules https://github.com/ksyasuda/SubMiner.git cd SubMiner -bun install +make deps bun run build # Optional: build AppImage @@ -202,7 +202,7 @@ Bundled Yomitan is built during `bun run build`. ```bash git clone --recurse-submodules https://github.com/ksyasuda/SubMiner.git cd SubMiner -git submodule update --init --recursive +make deps make build-macos ``` @@ -216,14 +216,14 @@ The built app will be in the `release` directory (`.dmg` and `.zip`). For unsign ```powershell git clone https://github.com/ksyasuda/SubMiner.git cd SubMiner +git submodule update --init --recursive bun install - -# Windows requires building texthooker-ui manually before the main build -Set-Location vendor/texthooker-ui +Set-Location stats +bun install --frozen-lockfile +Set-Location ../vendor/texthooker-ui bun install --frozen-lockfile bun run build Set-Location ../.. - bun run build:win ```