Skip to content

Commit eb573b2

Browse files
authored
chore(makefile): auto-install frontend deps after make init (#1)
1 parent afd1c11 commit eb573b2

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ include hack/makefiles/image.mk
2222
include hack/makefiles/test.mk
2323
include hack/makefiles/i18n.mk
2424

25-
# Initialize the backend database with schema and required seed data.
25+
# Initialize the backend database with schema and required seed data,
26+
# then install frontend dependencies so the workspace is ready to use.
2627
# The backend dispatches by database.default.link, for example MySQL or SQLite.
27-
# 初始化后端数据库表结构和系统必需的种子数据。
28+
# 初始化后端数据库表结构和系统必需的种子数据,
29+
# 并安装前端依赖,使工作区进入可用状态。
2830
# 后端会按 database.default.link 自动分发到 MySQL 或 SQLite 等方言。
29-
## init: Initialize the database with DDL and seed data only
31+
## init: Initialize the database and install frontend deps
3032
.PHONY: init
3133
init:
3234
@if [ "$(confirm)" != "init" ]; then \
@@ -36,6 +38,13 @@ init:
3638
exit 1; \
3739
fi
3840
@cd $(BACKEND_DIR) && $(MAKE) init confirm=$(confirm) $(if $(rebuild),rebuild=$(rebuild),)
41+
@echo ""
42+
@echo "→ Installing frontend dependencies in $(FRONTEND_DIR)..."
43+
@if ! command -v pnpm >/dev/null 2>&1; then \
44+
echo "✗ pnpm is not installed. Please install pnpm first: https://pnpm.io/installation"; \
45+
exit 1; \
46+
fi
47+
@cd $(FRONTEND_DIR) && pnpm install
3948

4049
# Load optional mock data for local demos and development verification.
4150
# Mock loading uses the same database.default.link dialect and requires init first.

0 commit comments

Comments
 (0)