Skip to content
Open
Show file tree
Hide file tree
Changes from all 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/
95 changes: 95 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
.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
Copy link

Copilot AI Jan 19, 2026

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_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): $(WEB_DIST) # $(SRV_DIST) $(PYPROJECT) $(PYTHON_LIB)/build dist
# mkdir -p $(TEMP_DIR)
# $(PYTHON) -m build --outdir $(TEMP_DIR) --wheel
# mkdir -p dist
# mv $(TEMP_DIR)/*.whl dist/$(WHEEL)
# rm -rf $(TEMP_DIR)
# @echo "Building wheel package complete."

# dist/$(ARCHIVE): $(WEB_DIST) # $(SRV_DIST) $(PYPROJECT) $(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."


web: $(WEB_DIST)


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
35 changes: 35 additions & 0 deletions modular_server_manager_web_client/client/assets/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions modular_server_manager_web_client/client/assets/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
* {
box-sizing: border-box;
}

html, body {
height: 100%;
margin: 0;
font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
background: linear-gradient(180deg, #0f172a 0%, rgb(6.9473684211, 10.6526315789, 19.4526315789) 100%);
color: #e6eef8;
}

#app {
max-width: 900px;
margin: 6rem auto;
padding: 2rem;
background: rgba(255, 255, 255, 0.03);
border-radius: 10px;
box-shadow: 0 6px 24px rgba(2, 6, 23, 0.6);
}

h1 {
margin: 0 0 0.5rem 0;
color: #60a5fa;
}

p {
color: #93c5fd;
}
18 changes: 18 additions & 0 deletions modular_server_manager_web_client/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Web Client — TypeScript + SCSS</title>
<link rel="stylesheet" href="assets/css/main.css" />
</head>
<body>
<div id="header">
</div>
<div id="app">
</div>

<!-- esbuild will produce assets/app.js during dev or build -->
<script type="module" src="assets/app.js"></script>
</body>
</html>
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",
Copy link

Copilot AI Jan 19, 2026

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/main.ts --bundle --outfile=src/assets/app.js --sourcemap --watch\" \"sass src/styles/main.scss src/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/styles/main.scss modular_server_manager_web_client/client/assets/css/main.css --no-source-map && esbuild src/main.ts --bundle --minify --target=es2017 --outfile=modular_server_manager_web_client/client/assets/app.js && cpy \"src/*.html\" modular_server_manager_web_client/client/",
"clean": "rimraf modular_server_manager_web_client/client src/assets",
"format": "prettier --write \"src/web**/*.{ts,scss,html}\""
Copy link

Copilot AI Jan 19, 2026

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"]
}