This directory contains the source-to-build system for assembling LuminariGUI.xml from modular source fragments, plus the package manager for creating distributable .mpackage files.
Mudlet requires a single XML package file, but development and maintenance benefit from modular source files. This build system:
- Extracts the monolithic
LuminariGUI.xmlinto manageable source fragments - Assembles source fragments back into the final
LuminariGUI.xml - Validates both fragments and final output
- Packages the XML into distributable
.mpackagefiles with full release workflow
theGUI/
├── build.py # Build/extract script
├── package.py # Package manager and release workflow
├── build.yaml # Build manifest (fragment list, version)
├── skeleton.xml # Package structure template
├── README.md # This file
└── src/ # Source fragments
├── triggers/ # Trigger definitions
├── aliases/ # Alias definitions
├── scripts/ # Script definitions
└── keys/ # Key binding definitions
cd theGUI
python build.py --extractThis creates source fragments from the existing LuminariGUI.xml.
python build.pyAssembles source fragments into ../LuminariGUI.xml.
python build.py --validateValidates all fragments and the assembly without writing output.
| Command | Description |
|---|---|
python build.py |
Build the package |
python build.py --validate |
Validate only, don't write |
python build.py --extract |
Split existing XML into fragments |
python build.py --diff |
Show what would change |
python build.py --stats |
Show line counts and statistics |
python build.py --clean |
Remove generated output file |
python build.py --watch |
Watch files and rebuild on changes |
After building the XML, use package.py to create distributable .mpackage files.
| Command | Description |
|---|---|
python package.py create |
Create release package (runs build & tests) |
python package.py create --dev |
Create dev package with timestamp |
python package.py create --skip-build |
Package existing XML without rebuilding |
python package.py release |
Full release workflow (build, test, branch, tag) |
python package.py release --dry-run |
Preview release without changes |
python package.py release --push |
Release and push to remote |
python package.py list |
List existing packages |
python package.py clean |
Remove old dev packages |
# Build XML and create package for testing
python build.py && python package.py create --dev
# Full release
python package.py release --pushpackage:
name: "LuminariGUI"
version: "2.0.4.015"
output:
file: "../LuminariGUI.xml"
encoding: "UTF-8"
options:
embed_markers: false # Add source file comments in output
validate_fragments: true # Validate each fragment's XML
validate_output: true # Validate final assembled XML
triggers:
- src/triggers/00_yatcoconfig.xml
- src/triggers/01_gui.xml
aliases:
- src/aliases/00_toggles.xml
- src/aliases/01_yatco.xml
scripts:
- src/scripts/00_msdpmapper.xml
- src/scripts/01_gui.xml
# ... more fragments
keys:
- src/keys/00_movement.xml- Edit the appropriate source fragment in
src/ - Validate:
python build.py --validate - Build:
python build.py - Test in Mudlet
- Commit both source and output
- Create a new fragment file (e.g.,
src/scripts/04_new_feature.xml) - Add it to
build.yamlin the appropriate section - Build and test
For active development:
python build.py --watchAutomatically rebuilds when source files change.
Each fragment must be valid XML that can be injected into the skeleton structure.
<ScriptGroup isActive="yes" isFolder="yes">
<name>MyFeature</name>
<packageName></packageName>
<script></script>
<eventHandlerList />
<Script isActive="yes" isFolder="no">
<name>MyScript</name>
<packageName></packageName>
<script>-- Lua code here
function myFunction()
-- implementation
end
</script>
<eventHandlerList />
</Script>
</ScriptGroup><TriggerGroup isActive="yes" isFolder="yes">
<name>MyTriggers</name>
<!-- trigger properties -->
<Trigger isActive="yes">
<name>MyTrigger</name>
<script>-- trigger script</script>
<!-- more properties -->
</Trigger>
</TriggerGroup>NN_descriptive_name.xml
NN = Two-digit ordering number (00-99)
00-09: Core/initialization
10-19: Major subsystems
20-29: Secondary systems
30+: Extensions/utilities
descriptive_name = lowercase_with_underscores
- Source fragments (
src/) are the source of truth - Both source and output (
LuminariGUI.xml) are tracked in git - Users can download
LuminariGUI.xmldirectly without building
ERROR: Malformed XML in src/scripts/01_gui.xml
Line 45: Unclosed tag <Script>
Check the fragment file for XML syntax errors.
Use python build.py --diff to see what would change.
WARNING: Fragment not found: src/scripts/missing.xml
Either create the file or remove it from build.yaml.
- Python 3.8+
- Optional: PyYAML (
pip install pyyaml) for faster config parsing