Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ node_modules/

# Build output
dist/
src/assets/
src/web/assets/

# Editor / OS
.vscode/
.idea/
.DS_Store
.DS_Store

*.log
*.egg-info/
92 changes: 92 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
.PHONY: all build clean

all: build

TEMP_DIR = build

PYPROJECT = pyproject.toml


BUILD_DIR = modular_server_manager_web_client/
WEB_BUILD_DIR = $(BUILD_DIR)client

PYTHON_PATH = $(shell if [ -d env/bin ]; then echo "env/bin/"; elif [ -d env/Scripts ]; then echo "env/Scripts/"; else echo ""; fi)
PYTHON_LIB = $(shell find env/lib -type d -name "site-packages" | head -n 1; if [ -d env/Lib/site-packages ]; then echo "env/Lib/site-packages/"; fi)
PYTHON = $(PYTHON_PATH)python

EXECUTABLE_EXTENSION = $(shell if [ -d env/bin ]; then echo ""; elif [ -d env/Scripts ]; then echo ".exe"; else echo ""; fi)
APP_EXECUTABLE = $(PYTHON_PATH)modular-server-manager$(EXECUTABLE_EXTENSION)

INSTAL_PATH = $(PYTHON_LIB)/modular_server_manager_web_client

Copilot AI Jan 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable name contains a spelling error: "INSTAL_PATH" should be "INSTALL_PATH".

Copilot uses AI. Check for mistakes.

# if not defined, get the version from git
VERSION ?= $(shell $(PYTHON) get_version.py)

# if version is in the form of x.y.z-dev-aaaa or x.y.z-dev+aaaa, set it to x.y.z-dev
VERSION_STR = $(shell echo $(VERSION) | sed "s/-dev-[a-z0-9]*//; s/-dev+.*//")

WHEEL = modular_server_manager_web_client-$(VERSION_STR)-py3-none-any.whl
ARCHIVE = modular_server_manager_web_client-$(VERSION_STR).tar.gz

SRV_SRC_DIR = src/server/
SRV_SRC = $(shell find $(SRV_SRC_DIR) -type f -name "*.py") $(SRV_SRC_DIR)compatibility.json
SRV_DIST = $(patsubst $(SRV_SRC_DIR)%,$(BUILD_DIR)%,$(SRV_SRC))

WEB_SRC_DIR = src/web/
WEB_SRC = $(shell find $(WEB_SRC_DIR) -type f -name "*.html" -o -name "*.scss" -o -name "*.ts")
WEB_DIST = $(WEB_BUILD_DIR)/index.html $(WEB_BUILD_DIR)/assets/css/main.css $(WEB_BUILD_DIR)/assets/app.js


print-%:
@echo $* = $($*)

dist:
mkdir -p dist

dist/$(WHEEL): $(SRV_DIST) $(PYPROJECT) $(WEB_DIST) $(PYTHON_LIB)/build dist
mkdir -p $(TEMP_DIR)
$(PYTHON) build_package.py --outdir $(TEMP_DIR) --wheel --version $(VERSION_STR)
mkdir -p dist
mv $(TEMP_DIR)/*.whl dist/$(WHEEL)
rm -rf $(TEMP_DIR)
@echo "Building wheel package complete."

dist/$(ARCHIVE): $(SRV_DIST) $(PYPROJECT) $(WEB_DIST) $(PYTHON_LIB)/build dist
mkdir -p $(TEMP_DIR)
$(PYTHON) build_package.py --outdir $(TEMP_DIR) --sdist --version $(VERSION_STR)
mkdir -p dist
mv $(TEMP_DIR)/*.tar.gz dist/$(ARCHIVE)
rm -rf $(TEMP_DIR)
@echo "Building archive package complete."

$(WEB_DIST): $(WEB_SRC)
npm run build

$(BUILD_DIR)%: $(SRV_SRC_DIR)%
@mkdir -p $(@D)
@echo "Copying $< to $@"
@cp $< $@


$(INSTAL_PATH) : dist/$(WHEEL)
@echo "Installing package..."
@$(PYTHON) -m pip install --upgrade --force-reinstall dist/$(WHEEL)
@echo "Package installed."


build: dist/$(WHEEL) dist/$(ARCHIVE)

install: $(INSTAL_PATH)

start: install
@$(APP_EXECUTABLE) \
-c /var/minecraft/config.json \
--log-file server.trace.log:TRACE \
--log-file server.debug.log:DEBUG


clean:
rm -rf $(BUILD_DIR)
rm -rf dist
rm -rf $(PYTHON_LIB)/modular_server_manager_web_client
rm -rf $(PYTHON_LIB)/modular_server_manager_web_client-*.dist-info
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "web-client",
"version": "0.1.0",
"private": true,
"description": "Web client (TypeScript + SCSS + SCSS + HTML) — lightweight build using esbuild and sass",
"description": "Web modular_server_manager_web_client/client (TypeScript + SCSS + SCSS + HTML) — lightweight build using esbuild and sass",

Copilot AI Jan 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description contains a duplicated "SCSS" ("SCSS + SCSS") which should be corrected. Additionally, the path "Web modular_server_manager_web_client/client/client" appears malformed and unclear. This should describe the project purpose more clearly.

Suggested change
"description": "Web modular_server_manager_web_client/client (TypeScript + SCSS + SCSS + HTML) — lightweight build using esbuild and sass",
"description": "Web client for Modular Server Manager (TypeScript + SCSS + HTML) — lightweight build using esbuild and sass",

Copilot uses AI. Check for mistakes.
"scripts": {
"dev": "concurrently \"esbuild src/main.ts --bundle --outfile=src/assets/app.js --sourcemap --watch\" \"sass src/styles/main.scss src/assets/css/main.css --watch\" \"live-server src --port=3000 --open=./index.html\"",
"build": "rimraf dist && mkdir -p dist && sass src/styles/main.scss dist/assets/css/main.css --no-source-map && esbuild src/main.ts --bundle --minify --target=es2017 --outfile=dist/assets/app.js && cpy \"src/*.html\" dist/",
"clean": "rimraf dist src/assets",
"format": "prettier --write \"src/**/*.{ts,scss,html}\""
"dev": "concurrently \"esbuild src/web/main.ts --bundle --outfile=src/web/assets/app.js --sourcemap --watch\" \"sass src/web/styles/main.scss src/web/assets/css/main.css --watch\" \"live-server src/web --port=3000 --open=./index.html\"",
"build": "rimraf modular_server_manager_web_client/client && mkdir -p modular_server_manager_web_client/client && sass src/web/styles/main.scss modular_server_manager_web_client/client/assets/css/main.css --no-source-map && esbuild src/web/main.ts --bundle --minify --target=es2017 --outfile=modular_server_manager_web_client/client/assets/app.js && cpy \"src/web/*.html\" modular_server_manager_web_client/client/",
"clean": "rimraf modular_server_manager_web_client/client src/web/assets",
"format": "prettier --write \"src/web**/*.{ts,scss,html}\""

Copilot AI Jan 19, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The glob pattern is missing a forward slash. It should be "src/web//*.{ts,scss,html}" instead of "src/web/*.{ts,scss,html}". Without the slash, the pattern may not correctly match files in the src/web directory and its subdirectories.

Suggested change
"format": "prettier --write \"src/web**/*.{ts,scss,html}\""
"format": "prettier --write \"src/web/**/*.{ts,scss,html}\""

Copilot uses AI. Check for mistakes.
},
"devDependencies": {
"esbuild": "^0.19.0",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"resolveJsonModule": true,
"lib": ["ES2019", "DOM"]
},
"include": ["src/**/*"],
"include": ["src/web/**/*"],
"exclude": ["node_modules", "dist"]
}