- Fixed an issue (for the umptienth time) related to incorrect handling of backwards slashes in Ceres.
- Ceres no longer writes out object data files if there were no object data modifications. This means it doesn't create blank object data files anymore, and it also won't touch your existing object data if you do not modify it in Ceres.
- Fixed an issue with
map:addDir
anddir
mapmode. - Fixed an issue with
fs.watchFile
not working correctly. - Fixed an issue with script arguments not being passed to
ceres exec
. - Upstreamed fix from
ceres-mpq
for crashes caused by empty files in MPQs. - Removed some old unused functionality from Ceres.
- Slightly improved error reporting in certain cases.
- Attempted to fix an issue where sometimes field types in the OE API would not resolve correctly, causing some fields (such as
weapsOn
) to not work correctly.
fs.watchFile
no longer blocks. instead, Ceres spins up an event loop after the build script finishes where it processes file watchers started byfs.watchFile
. The event loop will terminate if a WC3 instance launched by Ceres has exited. If WC3 wasn't started, then the event loop will continue running indefenitely until manually terminated.- The object API now has
getObject
,setObject
,getField
andsetField
methods for object storages and objects. They function identically to their indexing counterparts, and are meant for usage in TypeScript where the type system cannot correctly express the types returned from indexing operations in all cases. -launch
is now automatically appended to WC3 arguments when running via Ceres.- Files added via
map:addFileString
,map:addFileDisk
, andmap:addDir
can now be read back viamap:readFile
. Previously,map:readFile
would only return files that already existed in the map mpq/dir.
- Fixed a small bug where Ceres would not quit after building, even when no Live Reload was enabled.
- Removed all unstable feature gates and dependencies. Ceres now compiles on stable Rust.
ceres.catch
andceres.wrapCatch
were renamed toceres.safeCall
andceres.wrapSafeCall
to avoid clashing with thecatch
operator in TS- Ceres no longer suppresses default
main
andconfig
functions if their respective modules returned a non-false result. Instead, if you want to suppress defaultmain
andconfig
behaviour, you can callceres.suppressDefaultMain()
, andceres.suppressDefaultConfig()
. This was a particular pain point for TS users with amain.ts
module. mpq.new
was renamed tompq.create
to avoid clashing with thenew
operator in TS- Replaced
ceres.layout.srcDirectory
andceres.layout.libDireclctory
with one array -ceres.layout.srcDirectories
, allowing you to specify any number of source directories to instruct Ceres to look in. This is useful for TypeScript projects that can have a pure-Lua directory, a compiled TS directory, and external dependencies innode_modules
.
- When invoking
ceres run
, Ceres will now wait for WC3 to exit before shutting down. This is useful in VS Code on certain platforms, where previously a finished VS Code task runningceres run
would make WC3 exit immediately. - Added a
fs.copyFile
function. - Added a
map:addDir
method tomap
objects, allowing you quickly import an entire directory into the map. - Pulled in upstream bugfixes from
ceres-mpq
related to path separator issues - Added a Ceres-specific unit field called
siid
to the Object API, which returns the unit's editor name, which is used by natives likeCreateUnitByName
The documentation for Ceres has been updated. There are now template repositories for Lua and TypeScript, as well as a TypeScript library which provides idiomatic wrappers over JASS natives and useful utilities such as File I/O and Live Reload.
Check the readme for more information.
Significant breaking changes in this release!
- Changed the way the generated map script works. Now all code
require
d throughmain.lua
will run through themain
function, permitting full safe access to all natives. Previously, you'd have to tip-toe around which WC3 systems were initialized at script-load time and which weren't. Now you can simply call those functions in the script body, without the need for hooks or any other tricks. - As a consequence, it is no longer possible to add/replace code in the
config
function throughmain.lua
. If you still want to run code in theconfig
section of the map script, create aconfig.lua
file. The contents of this file will be executed in WC3'sconfig
section. - The same applies to init-time loading. If you want to run some code before either
config
ormain
execute, create a file calledinit.lua
. - If you want to suppress the default behaviour of
main
orconfig
(e.g. if you are doing all map initialization and player setup yourself), thenreturn true
in the respective files. Otherwise, your code will run before the default actions. - As a consequence, Ceres hooks
main::after
,main::before
,config::after
, andconfig::before
no longer exist. Ceres will throw an error if you try to add a hook with either of those names.
- The default map script template now has preliminary support for live-reloading. Please note that this is an unfinished feature. However, the script will automatically detect if it has been run a second time, and fire the
reload::before
andreload::after
hooks when it does so, as well as reloading all the modules within itself. - Ceres now loads individual modules as a string rather than as a function, which allows WC3 to correctly report errors as located inside the offending module, rather than simply reporting them as being inside
war3map.lua
. - Added a new function
fs.watchFile(path, callback)
, which will executecallback
with a file's new contents when the said file changes. This can be used to communicate with WC3 by creating Preloader files from inside WC3 and loading a response file inside WC3. This will be used by live reload. - Modules can now be specified as optional, i.e.
require('mymodule', true)
. Ceres will simply ignore it if the module does not exist.
- Fixed a bug where certain unit fields were incorrectly parsed in the metadata, causing them to throw errors upon access attempts.
- Fixed a bug in the Lua parser failing to parse
elseif
clauses sometimes.
- Fixed a bug with script-only compilation
- Made some adjustments to the default build script and header file
- Bumped the version of
ceres-mpq
to 0.1.6, fixing some bugs in the MPQ implementation
- Build scripts (as well as compiletime macros) can now manipulate object data of the map
- Default English WC3 data is provided for introspection purposes
The default build script sets a global variable currentMap
which exposes the map
object of the currently processed map.
Inside compiletime()
expressions you can now access this variable, and edit objects via an intuitive table-like syntax. For example:
compiletime(function()
local customFootman = currentMap.objects.unit['hfoo']:clone()
customFootman.Name = "A Custom Footman"
currentMap.objects.unit['x000'] = customFootman
end)
- Various bugs have been fixed with the build pipeline
- Fixed various issues which broke Ceres
- Fixed a bug where the Lua compiler would ignore
libDirectory
Initial release of the Lua-centric rewrite.