chore: add Makefile (#53)

* chore: update license

* chore: add Makefile
This commit is contained in:
Medcl 2024-12-20 16:30:36 +08:00 committed by GitHub
parent 34f2f3bcce
commit 0926005632
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 43 additions and 1 deletions

View File

@ -13,3 +13,45 @@ 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)

View File

@ -5,7 +5,7 @@
"title": "INFINI Console",
"description": "Pursuing Excellence, Infinite Possibilities!",
"author": "INFINI.LTD",
"license": "INFINI-EULA",
"license": "AGPL-3.0-or-later",
"official_website": "https://infinilabs.com",
"dependencies": {
"@ant-design/charts": "1.4.2",