Releases: Scythe-Technology/zune
0.5.4
What's Changed
- Fixes
mem.copywriting out of bounds in a337bee - Fixes
fs.writeFileon Windows not overwriting larger files in 1fe0acc - Fixes unaligned vector reading/writing in
mem.toVector2andmem.toVector3in f4d4c79 - Fixes luau types & type name typo in 076cdb6
- Updated type docs in 076cdb6
Full Changelog: v0.5.3...v0.5.4
0.5.3
What's Changed
- Fixes invalid TOML encoding for inline tables in #121
- Fixes encoding nested arrays for TOML in #121
- Fixes encoding array values for TOML in #121
- Added tilde expression aliases support for home directory in #122
- Fixes deadlock with scheduler multi-threaded synchronization in #123
- Fixes lua stack overflow from zune API in #123
- Fixes crashes from early resuming threads on some async API in #123
Full Changelog: v0.5.2...v0.5.3
0.5.2
What's Changed
- Fixed struct generation for C functions using an
FFIStructtype in #115 - Fixed FileHandle
readSync/writeSyncmethods erroring on windows in #116 - Fixed FileHandle
seekFromEndmethod not accepting negative number in #116 - Upgraded to Luau
0.700in #116
Full Changelog: v0.5.1...v0.5.2
0.5.1
0.5.0
Release Notes
New Contributors
- @Mark-Marks made their first contribution in #24
- @TechHog8984 made their first contribution in #51
Full Changelog: v0.4.2...v0.5.0
0.4.2
Added
-
Added async support to require. You can now do yields in required modules.
-
Added custom error logging, enabled with
runtime.debug.detailedErrorinzune.toml.Example:
error: Zune example.luau:1 | 1 | error("Zune") | ^^^^^^^^^^^^^
-
Added
useColorandshowRecursiveTabletoresolvers.formatterinzune.tomlfor configurable output when usingprintandwarn. -
Added
readAsyncmethod to stdin in@zcore/stdio. -
Added
json5, null preservation & pretty print forjsonin@zcore/serde. More InfoExample:
local serde = require("@zcore/serde") local json = [[ { "key": null } ]] -- Json5 and Json are very similar, just Json5 has a different decoder. -- serde.json.Values & serde.json.Indents are both the same for Json5, usable for in either one. local decoded = serde.json5.decode(json, { preserveNull = true -- Preserve null values as 'serde.json.Values.Null' }) print(serde.json5.encode(decoded, { prettyIndent = serde.json5.Indents.TwoSpaces -- Pretty print with 2 spaces }))
-
Added
@zcore/ffifor FFI support. More InfoCurrently this is marked as experimental and may change in the future. Api may change.
To enable this, you need to setexperimental.ffitotrueinzune.toml.It is also likely this might not work on all platforms.
Example:
local ffi = require("@zcore/ffi") local lib = ffi.dlopen(`libsample.{ffi.suffix}`, { add = { returns = ffi.types.i32, args = {ffi.types.i32, ffi.types.i32}, }, }) print(lib.add(1, 2))
Changed
- Updated
luauto0.647. - Backend formatted print/warn can now call/read
__tostringmetamethods on userdata. - Scheduler consumes less CPU.
- Zune for linux build now targets
gnuinstead ofmusl, riscv64 will stay asmusl.
Fixed
- Fixed
error.TlsBadRecordMacerror with websockets in@zcore/netwhen usingtls. - Fixed client websocket data sent unmasked in
@zcore/net. - Fixed websocket server not reading masked data properly in
@zcore/net.
0.4.1
Added
- Added flags to
newin regex. More Infoi- Case Insensitivem- Multiline
- Added zune configuration support as
zune.toml. - Added
initcommand to generate config files. - Added
luaucommand to display luau info. - Added partial tls support for
websocketto@zcore/net. - Added
readonlymethod toFileHandlein@zcore/fs.- Nil to get state, boolean to set state.
- Added adjustable response body size to
@zcore/netwhile using request. - Added profiler to
runcommand with--profileflag.- Frequency of profiling can be set with
--profile=...flag. - Default:
10000.
- Frequency of profiling can be set with
Changed
- Changed
capturesin regex to accept boolean instead of flags.- Boolean
trueis equivalent togflag.
- Boolean
- Errors in required modules should now display their path relative to the current working directory.
- Updated required or ranned luau files to use optimization level 1, instead of 2.
- Updated
testcommand to be likerun.- If the first argument is
-, it will read from stdin. - Fast search for file directly.
- If the first argument is
- Updated
luauto0.644. - Updated
helpcommand to display new commands. - Updated
stdinin@zcore/stdioto return nil if no data is available. - Updated
websocketin@zcore/netto properly return a boolean and an error string or userdata. - Updated
requestin@zcore/netto timeout if request takes too long.
Fixed
- Fixed
evalrequiring modules relative to the parent of the current working directory, instead of the current working directory. - Fixed
requirecasuing an error when requiring a module that returns nil. - Fixed
websocketsyielding forever. - Fixed threads under scheduler getting garbage collected.
- Fixed
setuppanic on windows.
0.4.0
Added
-
Added
watch,openFile, andcreateFileto@zcore/fs. More InfoExample:
local fs = require("@zcore/fs") local watcher = fs.watch("file.txt", function(filename, events) print(filename, events) end) local ok, file = fs.createFile("file.txt", { exclusive = true -- false by default }) assert(ok, file); file:close(); local ok, file = fs.openFile("file.txt", { mode = "r" -- "rw" by default }) assert(ok, file); file:close(); watcher:stop();
-
Added
evalcommand. Evaluates the first argument as luau code.Example:
zune --eval "print('Hello World!')" -- OR -- zune -e "print('Hello World!')"
-
Added stdin input to
runcommand if the first argument is-.Example:
echo "print('Hello World!')" | zune run -
-
Added
--globalsflag toreplto load all zune libraries as globals too. -
Added
warnglobal, similar to print but with a warning prefix. -
Added
randomandaesto@zcore/crypto. More InfoExample:
local crypto = require("@zcore/crypto") -- Random print(crypto.random.nextNumber()) -- 0.0 <= x < 1.0 print(crypto.random.nextNumber(-100, 100)) -- -100.0 <= x < 100.0 print(crypto.random.nextInteger(1, 10)) -- 1 <= x <= 10 print(crypto.random.nextBoolean()) -- true or false local buf = buffer.create(2) crypto.random.fill(buf, 0, 2) print(buffer.readi16(buf, 0))-- random 16-bit integer -- AES local message = "Hello World!" local key = "1234567890123456" -- 16 bytes local nonce = "123456789012" -- 12 bytes local encrypted = crypto.aes.aes128.encrypt(message, key, nonce) local decrypted = crypto.aes.aes128.decrypt(encrypted.cipher, encrypted.tag, key, nonce) print(decrypted) -- "Hello World!"
-
Added
getSizemethod toterminalin@zcore/stdio. More InfoExample:
local stdio = require("@zcore/stdio") if (stdio.terminal.isTTY) then local cols, rows = stdio.terminal:getSize() print(cols, rows) -- 80 24 end
-
Added
base64to@zcore/serde. More InfoExample:
local serde = require("@zcore/serde") local encoded = serde.base64.encode("Hello World!") local decoded = serde.base64.decode(encoded) print(decoded) -- "Hello World!"
-
Added
.luaurcsupport. Alias requires should work.Example:
{ "aliases": { "dev": "/path/to/dev", "globals": "/path/to/globals.luau" } }local module = require("@dev/module") local globals = require("@globals")
-
Added
capturesmethod toRegexin@zcore/regex. More InfoFlags
g- Globalm- Multiline
Example:
local regex = require("@zcore/regex") local pattern = regex.new("[A-Za-z!]+") print(pattern:captures("Hello World!", 'g')) -- {{RegexMatch}, {RegexMatch}}
-
Added
@zcore/datetime. More InfoExample:
local datetime = require("@zcore/datetime") print(datetime.now().unixTimestamp) -- Timestamp print(datetime.now():toIsoDate()) -- ISO Date
-
Added
onSignalto@zcore/process. More InfoExample:
local process = require("@zcore/process") process.onSignal("INT", function() print("Received SIGINT") end)
Changed
- Updated
luauto0.642. - Updated
@zcore/processto lock changing variables & allowed changingcwd.- Changing cwd would affect the global process cwd (even
fslibrary). - Supports Relative and Absolute paths.
../or/.- Relative paths are relative to the current working directory.
- Changing cwd would affect the global process cwd (even
- Updated
requirefunction to be able to require modules that return exactly 1 value, instead of only functions, tables, or nil.
Fixed
- Fixed
@zcore/netwith serve usingreuseAddressoption not working. - Fixed
REPLrequiring modules relative to the parent of the current working directory, instead of the current working directory.
0.3.0
Added
-
Added
stdin,stdout, andstderrto@zcore/stdio. More InfoExample:
local stdio = require("@zcore/stdio") stdio.stdin:read() -- read byte stdio.stdin:read(10) -- read 10 bytes stdio.stdout:write("Hello World!") stdio.stderr:write("Error!")
-
Added
terminalto@zcore/stdio. More InfoThis should allow you to write more interactive terminal applications.
note: If you have weird terminal output in windows, we recommend you to use
enableRawModeto enable windows consoleVirtual Terminal Processing.Example:
local stdio = require("@zcore/stdio") if (stdio.terminal.isTTY) then -- check if terminal is a TTY stdio.terminal.enableRawMode() -- enable raw mode stdio.stdin:read() -- read next input without waiting for newline stdio.terminal.restoreMode() -- return back to original mode before changes. end
-
Added
@zcore/regex. More InfoExample:
local regex = require("@zcore/regex") local pattern = regex.new("([A-Za-z\\s!])+") local match = pattern:match("Hello World!") print(match) --[[<table: 0x12345678> { [1] = <table: 0x2ccee88> { index = 0, string = "Hello World!", }, [2] = <table: 0x2ccee58> { index = 11, string = "!", }, }]]
Changed
-
Switched from build optimization from ReleaseSafe to ReleaseFast to improve performance.
Luau should be faster now.
-
REPL should now restore the terminal mode while executing lua code and return back to raw mode after execution.
-
Removed
readIn,writeOut, andwriteErrfunctions in@zcore/stdio.
0.2.1
Added
-
Added buffer support for
@net/serverbody response. If a buffer is returned, it will be sent as the response body, works with{ body = buffer, statusCode = 200 }.Example:
local net = require("@net/net") net.serve({ port = 8080, request = function(req) return buffer.fromstring("Hello World!") end })
-
Added buffer support for
@net/serdein compress/decompress. If a buffer is passed, it will return a new buffer.Example:
local serde = require("@net/serde") local compressed_buffer = serde.gzip.compress(buffer.fromstring("Zune")) print(compressed_buffer) -- <buffer: 0x12343567>
Changed
- Updated backend luau module.
Fixed
- Fixed Inaccurate luau types for
@zcore/net. - Fixed REPL not working after an error is thrown.