Skip to content

Releases: Scythe-Technology/zune

0.5.4

02 Feb 05:43
076cdb6

Choose a tag to compare

What's Changed

  • Fixes mem.copy writing out of bounds in a337bee
  • Fixes fs.writeFile on Windows not overwriting larger files in 1fe0acc
  • Fixes unaligned vector reading/writing in mem.toVector2 and mem.toVector3 in 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

03 Jan 18:01
c05f7d0

Choose a tag to compare

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

04 Dec 18:06
da5f042

Choose a tag to compare

What's Changed

  • Fixed struct generation for C functions using an FFIStruct type in #115
  • Fixed FileHandle readSync/writeSync methods erroring on windows in #116
  • Fixed FileHandle seekFromEnd method not accepting negative number in #116
  • Upgraded to Luau 0.700 in #116

Full Changelog: v0.5.1...v0.5.2

0.5.1

15 Oct 17:12
3796a11

Choose a tag to compare

What's Changed

  • Fixed multi-threading deadlock after completion in #101
  • Fixed detailed error logs not previewing line up to EOF in #101
  • Fixed fs.watch error with absolute paths on windows in 3796a11
  • Upgraded to Luau 0.695 in #101

Full Changelog: v0.5.0...v0.5.1

0.5.0

29 Sep 04:30
5f34aef

Choose a tag to compare

Release Notes


New Contributors

Full Changelog: v0.4.2...v0.5.0

0.4.2

15 Oct 01:35

Choose a tag to compare

Added

  • Added async support to require. You can now do yields in required modules.

  • Added custom error logging, enabled with runtime.debug.detailedError in zune.toml.

    Example:

    error: Zune
    example.luau:1
      |
    1 | error("Zune")
      | ^^^^^^^^^^^^^
  • Added useColor and showRecursiveTable to resolvers.formatter in zune.toml for configurable output when using print and warn.

  • Added readAsync method to stdin in @zcore/stdio.

  • Added json5, null preservation & pretty print for json in @zcore/serde. More Info

    Example:

    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/ffi for FFI support. More Info

    Currently this is marked as experimental and may change in the future. Api may change.
    To enable this, you need to set experimental.ffi to true in zune.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 luau to 0.647.
  • Backend formatted print/warn can now call/read __tostring metamethods on userdata.
  • Scheduler consumes less CPU.
  • Zune for linux build now targets gnu instead of musl, riscv64 will stay as musl.

Fixed

  • Fixed error.TlsBadRecordMac error with websockets in @zcore/net when using tls.
  • Fixed client websocket data sent unmasked in @zcore/net.
  • Fixed websocket server not reading masked data properly in @zcore/net.

0.4.1

26 Sep 23:08

Choose a tag to compare

Added

  • Added flags to new in regex. More Info
    • i - Case Insensitive
    • m - Multiline
  • Added zune configuration support as zune.toml.
  • Added init command to generate config files.
  • Added luau command to display luau info.
  • Added partial tls support for websocket to @zcore/net.
  • Added readonly method to FileHandle in @zcore/fs.
    • Nil to get state, boolean to set state.
  • Added adjustable response body size to @zcore/net while using request.
  • Added profiler to run command with --profile flag.
    • Frequency of profiling can be set with --profile=... flag.
    • Default: 10000.

Changed

  • Changed captures in regex to accept boolean instead of flags.
    • Boolean true is equivalent to g flag.
  • 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 test command to be like run.
    • If the first argument is -, it will read from stdin.
    • Fast search for file directly.
  • Updated luau to 0.644.
  • Updated help command to display new commands.
  • Updated stdin in @zcore/stdio to return nil if no data is available.
  • Updated websocket in @zcore/net to properly return a boolean and an error string or userdata.
  • Updated request in @zcore/net to timeout if request takes too long.

Fixed

  • Fixed eval requiring modules relative to the parent of the current working directory, instead of the current working directory.
  • Fixed require casuing an error when requiring a module that returns nil.
  • Fixed websockets yielding forever.
  • Fixed threads under scheduler getting garbage collected.
  • Fixed setup panic on windows.

0.4.0

17 Sep 06:02

Choose a tag to compare

Added

  • Added watch, openFile, and createFile to @zcore/fs. More Info

    Example:

    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 eval command. Evaluates the first argument as luau code.

    Example:

    zune --eval "print('Hello World!')"
    -- OR --
    zune -e "print('Hello World!')"
  • Added stdin input to run command if the first argument is -.

    Example:

    echo "print('Hello World!')" | zune run -
  • Added --globals flag to repl to load all zune libraries as globals too.

  • Added warn global, similar to print but with a warning prefix.

  • Added random and aes to @zcore/crypto. More Info

    Example:

    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 getSize method to terminal in @zcore/stdio. More Info

    Example:

    local stdio = require("@zcore/stdio")
    
    if (stdio.terminal.isTTY) then
      local cols, rows = stdio.terminal:getSize()
      print(cols, rows) -- 80   24
    end
  • Added base64 to @zcore/serde. More Info

    Example:

    local serde = require("@zcore/serde")
    
    local encoded = serde.base64.encode("Hello World!")
    local decoded = serde.base64.decode(encoded)
    print(decoded) -- "Hello World!"
  • Added .luaurc support. 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 captures method to Regex in @zcore/regex. More Info

    Flags

    • g - Global
    • m - 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 Info

    Example:

    local datetime = require("@zcore/datetime")
    
    print(datetime.now().unixTimestamp) -- Timestamp
    print(datetime.now():toIsoDate()) -- ISO Date
  • Added onSignal to @zcore/process. More Info

    Example:

    local process = require("@zcore/process")
    
    process.onSignal("INT", function()
      print("Received SIGINT")
    end)

Changed

  • Updated luau to 0.642.
  • Updated @zcore/process to lock changing variables & allowed changing cwd.
    • Changing cwd would affect the global process cwd (even fs library).
    • Supports Relative and Absolute paths. ../ or /.
      • Relative paths are relative to the current working directory.
  • Updated require function to be able to require modules that return exactly 1 value, instead of only functions, tables, or nil.

Fixed

  • Fixed @zcore/net with serve using reuseAddress option not working.
  • Fixed REPL requiring modules relative to the parent of the current working directory, instead of the current working directory.

0.3.0

02 Sep 02:08

Choose a tag to compare

Added

  • Added stdin, stdout, and stderr to @zcore/stdio. More Info

    Example:

    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 terminal to @zcore/stdio. More Info

    This should allow you to write more interactive terminal applications.

    note: If you have weird terminal output in windows, we recommend you to use enableRawMode to enable windows console Virtual 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 Info

    Example:

    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, and writeErr functions in @zcore/stdio.

0.2.1

31 Aug 05:34

Choose a tag to compare

Added

  • Added buffer support for @net/server body 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/serde in 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.