-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
executable file
·57 lines (48 loc) · 1.43 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
SHELL=/bin/bash
# APP info
APP_NAME := console
APP_VERSION := 1.0.0_SNAPSHOT
APP_CONFIG := $(APP_NAME).yml
APP_EOLDate ?= "2025-12-31T10:10:10Z"
APP_STATIC_FOLDER := .public
APP_STATIC_PACKAGE := public
APP_UI_FOLDER := ui
APP_PLUGIN_FOLDER := plugin
# GO15VENDOREXPERIMENT="1" GO111MODULE=off easyjson -all domain.go
include ../framework/Makefile
NVM_VERSION=0.39.3
NODE_VERSION=16.20.2
NVM_INSTALL_URL=https://raw.githubusercontent.com/nvm-sh/nvm/v$(NVM_VERSION)/install.sh
# Initialize the web development environment
init-web-dev:
@if ! command -v nvm > /dev/null 2>&1; then \
echo "nvm not found. Installing..."; \
curl -o- $(NVM_INSTALL_URL) | bash; \
export NVM_DIR="$$(echo ~/.nvm)"; \
[ -s "$$NVM_DIR/nvm.sh" ] && \. "$$NVM_DIR/nvm.sh"; \
fi; \
export NVM_DIR="$$(echo ~/.nvm)"; \
[ -s "$$NVM_DIR/nvm.sh" ] && \. "$$NVM_DIR/nvm.sh"; \
nvm install $(NODE_VERSION); \
nvm use $(NODE_VERSION); \
echo "Using Node.js version: $$(node -v)"; \
(cd web && npm install)
# Clean node_modules
clean-web-dev:
@echo "Cleaning node_modules..."
@(cd web && rm -rf node_modules)
@echo "Done."
# Lint the code
web-lint:
@echo "Running lint..."
@(cd web && npx eslint . --ext .js,.jsx,.ts,.tsx)
@echo "Linting complete."
# Build the web app
build-web:
@echo "Building the web app..."
@(cd web && npm run build)
@echo "Build complete."
# Run the development server
dev-web:
@echo "Starting the development server..."
@(cd web && npm run dev)