dev: update neko/index.js only when rusty stuff are updated

This commit is contained in:
naskya 2024-01-22 01:34:26 +09:00
parent e1b2b2a10d
commit 7d5e062a21
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -9,13 +9,17 @@ RUST_DIR := packages/backend/native-utils
CARGO_TOMLS := $(RUST_DIR)/Cargo.toml
CARGO_TOMLS += $(RUST_DIR)/migration/Cargo.toml
RUSTY_STUFF := $(foreach dir, $(RUST_DIR)/src, $(wildcard $(dir)/*))
RUSTY_STUFF += $(foreach dir, $(RUST_DIR)/migration/src, $(wildcard $(dir)/*))
RUSTY_STUFF += $(CARGO_TOMLS)
.PHONY: build
build: build-image
.PHONY: pre-commit
pre-commit: shellcheck pnpm-lock.yaml $(RUST_DIR)/Cargo.lock regenerate-entities update-index-js rust-lint
pre-commit: shellcheck pnpm-lock.yaml $(RUST_DIR)/Cargo.lock regenerate-entities neko/index.js rust-lint
pnpm-lock.yaml: pnpm-workspace.yaml $(PACKAGE_JSONS)
@ -64,8 +68,7 @@ regenerate-entities:
$(RUST_DIR)/src/model/entity/sea_orm_active_enums.rs
.PHONY: update-index-js
update-index-js:
neko/index.js: $(RUSTY_STUFF)
pnpm --filter='native-utils' run build:debug
[ -f $(RUST_DIR)/built/index.js ]
pnpm run format