Skip to content

Releases: lune-org/lune

0.8.5

01 Jun 20:20
cf513c6
Compare
Choose a tag to compare

Changed

  • Improved table pretty formatting when using print, warn, and stdio.format:

    • Keys are sorted numerically / alphabetically when possible.
    • Keys of different types are put in distinct sections for mixed tables.
    • Tables that are arrays no longer display their keys.
    • Empty tables are no longer spread across lines.

Fixed

  • Fixed formatted values in tables not being separated by newlines.
  • Fixed panicking (crashing) when using process.spawn with a program that does not exist.
  • Fixed instance:SetAttribute("name", nil) throwing an error and not removing the attribute.

0.8.4

12 May 18:48
95b81d6
Compare
Choose a tag to compare

Added

  • Added a builtin API for regular expressions.

    Example basic usage:

    local Regex = require("@lune/regex")
    
    local re = Regex.new("hello")
    
    if re:isMatch("hello, world!") then
    	print("Matched!")
    end
    
    local caps = re:captures("hello, world! hello, again!")
    
    print(#caps) -- 2
    print(caps:get(1)) -- "hello"
    print(caps:get(2)) -- "hello"
    print(caps:get(3)) -- nil

    Check out the documentation for more details.

  • Added support for buffers as arguments in builtin APIs (#148)

    This includes APIs such as fs.writeFile, serde.encode, and more.

  • Added support for cross-compilation of standalone binaries (#162)

    You can now compile standalone binaries for other platforms by passing
    an additional target argument to the build subcommand:

    lune build my-file.luau --output my-bin --target windows-x86_64

    Currently supported targets are the same as the ones included with each
    release of Lune on GitHub. Check releases for a full list of targets.

  • Added stdio.readToEnd() for reading the entire stdin passed to Lune

Changed

  • Split the repository into modular crates instead of a monolith. (#188)

    If you previously depended on Lune as a crate, nothing about it has changed for version 0.8.4, but now each individual sub-crate has also been published and is available for use:

    • lune (old)
    • lune-utils
    • lune-roblox
    • lune-std-* for every builtin library

    When depending on the main lune crate, each builtin library also has a feature flag that can be toggled in the format std-*.

    In general, this should mean that it is now much easier to make your own Lune builtin, publish your own flavor of a Lune CLI, or take advantage of all the work that has been done for Lune as a runtime when making your own Rust programs.

  • Changed the User-Agent header in net.request to be more descriptive (#186)

  • Updated to Luau version 0.622.

Fixed

  • Fixed not being able to decompress lz4 format in high compression mode
  • Fixed stack overflow for tables with circular keys (#183)
  • Fixed net.serve no longer accepting ipv6 addresses
  • Fixed headers in net.serve being raw bytes instead of strings

0.8.3

15 Apr 21:52
34fc23d
Compare
Choose a tag to compare

Fixed

  • Fixed require not throwing syntax errors (#168)
  • Fixed require caching not working correctly (#171)
  • Fixed case-sensitivity issue in require with aliases (#173)
  • Fixed itertools dependency being marked optional even though it is mandatory (#176)
  • Fixed test cases for the net built-in library on Windows (#177)

0.8.2

12 Mar 22:54
94ba331
Compare
Choose a tag to compare

Fixed

  • Fixed REPL panicking after the first evaluation / run.
  • Fixed globals reloading on each run in the REPL, causing unnecessary slowdowns.
  • Fixed net.serve requests no longer being plain tables in Lune 0.8.1, breaking usage of things such as table.clone.

0.8.1

11 Mar 18:41
a52dfc1
Compare
Choose a tag to compare

Added

  • Added the ability to specify an address in net.serve. (#142)

Changed

  • Update to Luau version 0.616.
  • Major performance improvements when using a large amount of threads / asynchronous Lune APIs. (#165)
  • Minor performance improvements and less overhead for net.serve and net.socket. (#165)

Fixed

  • Fixed fs.copy not working with empty dirs. (#155)
  • Fixed stack overflow when printing tables with cyclic references. (#158)
  • Fixed not being able to yield in net.serve handlers without blocking other requests. (#165)
  • Fixed various scheduler issues / panics. (#165)

0.8.0

14 Jan 16:17
1b25ed2
Compare
Choose a tag to compare

Breaking Changes

  • The Lune CLI now uses subcommands instead of flag options:

    • lune script_name arg1 arg2 arg3 -> lune run script_name arg1 arg2 arg3
    • lune --list -> lune list
    • lune --setup -> lune setup

    This unfortunately hurts ergonomics for quickly running scripts but is a necessary change to allow us to add more commands, such as the new build subcommand.

  • The createdAt, modifiedAt, and accessedAt properties returned from fs.metadata are now DateTime values instead of numbers.

  • The Lune struct has been renamed to Runtime in the Lune rust crate.

Added

  • Added support for compiling single Lune scripts into standalone executables! (#140)

    Example usage:

    -- my_cool_script.luau
    print("Hello, standalone!")
    > lune build my_cool_script.luau
    # Creates `my_cool_script.exe` (Windows) or `my_cool_script` (macOS / Linux)
    > ./my_cool_script.exe # Windows
    > ./my_cool_script # macOS / Linux
    > "Hello, standalone!"

    To compile scripts that use require and reference multiple files, a bundler such as darklua should preferrably be used. You may also distribute files alongside the standalone binary, they will still be able to be require-d. This limitation will be lifted in the future and Lune will automatically bundle any referenced scripts.

  • Added support for path aliases using .luaurc config files!

    For full documentation and reference, check out the official Luau RFC, but here's a quick example:

    // .luaurc
    {
      "aliases": {
        "modules": "./some/long/path/to/modules"
      }
    }
    -- ./some/long/path/to/modules/foo.luau
    return { World = "World!" }
    
    -- ./anywhere/you/want/my_script.luau
    local mod = require("@modules/foo")
    print("Hello, " .. mod.World)
  • Added support for multiple values for a single query, and multiple values for a single header, in net.request. This is a part of the HTTP specification that is not widely used but that may be useful in certain cases. To clarify:

    • Single values remain unchanged and will work exactly the same as before.

      -- https://example.com/?foo=bar&baz=qux
      local net = require("@lune/net")
      net.request({
          url = "example.com",
          query = {
              foo = "bar",
              baz = "qux",
          }
      })
    • Multiple values on a single query / header are represented as an ordered array of strings.

      -- https://example.com/?foo=first&foo=second&foo=third&bar=baz
      local net = require("@lune/net")
      net.request({
          url = "example.com",
          query = {
              foo = { "first", "second", "third" },
              bar = "baz",
          }
      })

Changed

  • Update to Luau version 0.606.

Fixed

  • Fixed the print and warn global functions yielding the thread, preventing them from being used in places such as the callback to table.sort.
  • Fixed the overwrite option for fs.move not correctly removing existing files / directories. (#133)

0.7.11

29 Oct 20:51
507d88e
Compare
Choose a tag to compare

Changed

  • Update to Luau version 0.601.

Fixed

  • Fixed roblox.getAuthCookie not being compatible with the latest cookie format by upgrading rbx_cookie.

0.7.10

25 Oct 09:34
779a11c
Compare
Choose a tag to compare

Added

  • Added the GetDebugId instance method to the roblox built-in. This will return the internal id used by the instance, and as the name implies, it should be primarily used for debugging purposes and cases where you need a globally unique identifier for an instance. It is guaranteed to be a 32-digit hexadecimal string.

Fixed

  • Fixed issues with SecurityCapabilities on instances in the roblox built-in by upgrading rbx-dom.

0.7.9

21 Oct 09:58
56949aa
Compare
Choose a tag to compare

Added

  • Added implementProperty and implementMethod to the roblox built-in library to fill in missing functionality that Lune does not aim to implement itself.

    Example usage:

    local roblox = require("@lune/roblox")
    
    local part = roblox.Instance.new("Part")
    
    roblox.implementMethod("BasePart", "TestMethod", function(_, ...)
        print("Tried to call TestMethod with", ...)
    end)
    
    part:TestMethod("Hello", "world!")

Changed

  • Update to Luau version 0.599.
  • Stdio options when using process.spawn can now be set with more granularity, allowing stderr & stdout to be disabled individually and completely to improve performance when they are not being used.

0.7.8

06 Oct 03:05
02d812f
Compare
Choose a tag to compare

Added

  • Added a new datetime built-in library for handling date & time values, parsing, formatting, and more. (#94)

    Example usage:

    local DateTime = require("@lune/datetime")
    
    -- Creates a DateTime for the current exact moment in time
    local now = DateTime.now()
    
    -- Formats the current moment in time as an ISO 8601 string
    print(now:toIsoDate())
    
    -- Formats the current moment in time, using the local
    -- time, the French locale, and the specified time string
    print(now:formatLocalTime("%A, %d %B %Y", "fr"))
    
    -- Returns a specific moment in time as a DateTime instance
    local someDayInTheFuture = DateTime.fromLocalTime({
        year = 3033,
        month = 8,
        day = 26,
        hour = 16,
        minute = 56,
        second = 28,
        millisecond = 892,
    })
    
    -- Extracts the current local date & time as separate values (same values as above table)
    print(now:toLocalTime())
    
    -- Returns a DateTime instance from a given float, where the whole
    -- denotes the seconds and the fraction denotes the milliseconds
    -- Note that the fraction for millis here is completely optional
    DateTime.fromUnixTimestamp(871978212313.321)
    
    -- Extracts the current universal (UTC) date & time as separate values
    print(now:toUniversalTime())
  • Added support for passing stdin in process.spawn (#106)

  • Added support for setting a custom environment in load options for luau.load, not subject to getfenv / setfenv deoptimizations

  • Added Terrain:GetMaterialColor and Terrain:SetMaterialColor (#93)

  • Added support for a variable number of arguments for CFrame methods (#85)

Changed

  • Update to Luau version 0.596.
  • Update to rbx-dom database version 0.596.
  • process.spawn now uses powershell instead of /bin/bash as the shell on Windows, with shell = true.
  • CFrame and Vector3 values are now rounded to the nearest 2 ^ 16 decimal place to reduce floating point errors and diff noise. Note that this does not affect intermediate calculations done in lua, and only happens when a property value is set on an Instance.

Fixed

  • Fixed the process built-in library not loading correctly when using Lune in REPL mode.
  • Fixed list subcommand not listing global scripts without a local .lune / lune directory present.
  • Fixed net.serve stopping when the returned ServeHandle is garbage collected.
  • Fixed missing trailing newline when using the warn global.
  • Fixed constructor for CFrame in the roblox built-in library not parsing the 12-arg overload correctly. (#102)
  • Fixed various functions for CFrame in the roblox built-in library being incorrect, specifically row-column ordering and some flipped signs. (#103)
  • Fixed cross-service Instance references disappearing when using the roblox built-in library (#117)