Caution
WLPM IS DEPRECATED - USE IMP
A modern solution for Warcraft 3 map development!
Brings package management and es6-like Lua modules to your map project.
WLPM consists of a Package Manager and a Module Manager with it's own Lua part of code.
We introduce a new way of working with dependencies - WLPM Module Manager📡
- Works with maps in a map-as-directory mode
- Own package config format in JSON
- Install packages with dependencies from Github and Bitbucket
- Install Lua files directly from Github, Bitbucket or custom hosts in config
- File and directory watcher (war3map.lua, sources, config)
- Dependency version resolution
- Include custom user directories as advanced sources
- Right dependency order in the target file
- ES6-like imports and exports in the Lua script
- Really fast target builder on-the-go (C# watcher)
WLPM for any Windows (legacy)
WLPM for macOS (planned, waiting for Warcraft 3 fixes)
- Install WLPM
- Save your map as a directory (Save as... menu item)
- Open any terminal window (press Win+R and enter "cmd")
- enter
cd <your map directory>
- then enter
wlpm
- it shows all applicable commands
To initialize your package enter wlpm update
. It will create wlpm-package.json and .wlpm directory with the dependencies. If you use git (mercurial/svn/...) add .wlpm to your ignore file (.gitignore).
To add new dependency enter wlpm install <package> <version>
wlpm install https://github.com/Indaxia/wlpm-wc3-demo-hello
We don't recommend to use "any" version in public projects. Some scammers or stolen accs may update the code and make it malicious.
wlpm install https://github.com/Indaxia/wlpm-wc3-demo-hello 1.1
Use wlpm watch
to let watcher notify PM and MM if something changed and perform download new packages and/or rebuild modules.
To get help about module management refer the MM documents.
You can include files directly (Big Integer in the example):
wlpm install https://raw.githubusercontent.com/DeBos99/lua-bigint/master/bigint.lua * file
If you don't want to use MM on the client (Lua) side you can disable it by adding a new option to your wlpm-package.json:
"insertModuleLoader": false
With this option MM just includes code of the dependencies without the MM
It's possible execute a terminal command when the building process finishes:
"afterBuild": "echo \"hello world\""
It works for root projects only.
If you want to publish your package folow these steps:
- Create a git repository at Github or Bitbucket
- Create wlpm-package.json in the repository root
- Add the "dependencies" and "sources" parameters. Refer the full config example below.
- (optional) add git tag to the repository
- Now this is a WLPM package!
{
"title": "WLPM - Demo Map Package", // (optional) your package or root project title
"author": "ScorpioT1000 / [email protected]", // (optional) author information
"license": "MIT", // (optional) source code license
"dependencies": { // list of packages and files required by your source code
// github repository from a master branch
"https://github.com/123/456": "*",
// github repository from the release tagged as "1.1.1"
"https://github.com/123/456": "1.1.1",
// bitbucket repository from the release tagged as "1.0.0" in an object format
"https://bitbucket.org/123/789": { "type": "package", "version": "1.0.0" },
// inserts a file directly from the repository
"https://github.com/123/456/blob/master/somefile.lua": {
"type": "file",
"topOrder": true // omit this option or set to false to insert the file after repositories' sources
}
},
// (optional for root project) where your sources are stored. It's important for the package, but can be omitted for root project (it watches "target")
"sources": [
"src"
],
// (optional) where to store compiled lua build. It works for root project only.
"target": "war3map.lua",
// (optional) execute this command after build, e.g. "echo \"Hello!\""
"afterBuild": "",
// (optional) set this to false if you want to replace built-in module manager by your own
"insertModuleLoader": true,
// (optional) allow more hosts for direct file dependency (allows github.com and bitbucket.org by default). It works for root project only.
"allowHosts": []
// (optional) set custom file extensions when building "sources"
"sourceExtensions": "*.lua"
}
- It doesn't support partial version placeholders like
1.*
because it doesn't use package registry - It performs full re-download on any config requirement change (planned to fix in the future)
- No VSCode integration yet, but it's planned
- Execution of after-build custom scripts is not implemented yet
You are free to fork and build your own modifications! My requirement is that any "author" fields in C# code are allowed to be supplemented only(!).
dotnet publish -c Release --self-contained --runtime win10-x64 /property:Version=VERSION_HERE
dotnet publish -c Release --self-contained --runtime win-x86 /property:Version=VERSION_HERE
ScorpioT1000 © 2019