Skip to content

Releases: lune-org/lune

0.2.1

04 Feb 04:06
22ca94c
Compare
Choose a tag to compare

Added

  • Added support for string interpolation syntax (update to Luau 0.561)

  • Added network server functionality using net.serve

    Example usage:

    net.serve(8080, function(request)
        print(`Got a {request.method} request at {request.path}!`)
    
        local data = net.jsonDecode(request.body)
    
        -- For simple text responses with a 200 status
        return "OK"
    
        -- For anything else
        return {
            status = 203,
            headers = { ["Content-Type"] = "application/json" },
            body = net.jsonEncode({
                message = "echo",
                data = data,
            })
        }
    end)

Changed

  • Improved type definitions file for Selene, now including constants like process.env + tags such as readonly and mustuse wherever applicable

Fixed

  • Fixed type definitions file for Selene not including all API members and parameters
  • Fixed process.exit exiting at the first yield instead of exiting instantly as it should

0.2.0

28 Jan 05:03
242035c
Compare
Choose a tag to compare

Added

  • Added full documentation for all global APIs provided by Lune! This includes over 200 lines of pure documentation about behavior & error cases for all of the current 35 constants & functions. Check the README to find out how to enable documentation in your editor.

  • Added a third argument options for process.spawn:

    • cwd - The current working directory for the process
    • env - Extra environment variables to give to the process
    • shell - Whether to run in a shell or not - set to true to run using the default shell, or a string to run using a specific shell
    • stdio - How to treat output and error streams from the child process - set to "inherit" to pass output and error streams to the current process
  • Added process.cwd, the path to the current working directory in which the Lune script is running

0.1.3

25 Jan 21:27
ee5b67b
Compare
Choose a tag to compare

Added

  • Added a --list subcommand to list scripts found in the lune or .lune directory.

0.1.2

25 Jan 02:17
8b7990b
Compare
Choose a tag to compare

Added

  • Added automatic publishing of the Lune library to crates.io

Fixed

  • Fixed scripts that terminate instantly sometimes hanging

Version 0.1.1

24 Jan 21:03
530d01f
Compare
Choose a tag to compare

Fixed

  • Fixed errors containing ./ and / or ../ in the middle of file paths
  • Potential fix for spawned processes that yield erroring with "attempt to yield across metamethod/c-call boundary"

Version 0.1.0

24 Jan 18:03
3c0e270
Compare
Choose a tag to compare

This is the initial stable release for Lune! 🌙

All of the current APIs should work as expected, and there are no known major bugs.

Added

  • task now supports passing arguments in task.spawn / task.delay / task.defer
  • require now uses paths relative to the file instead of being relative to the current directory, which is consistent with almost all other languages but not original Lua / Luau - this is a breaking change but will allow for proper packaging of third-party modules and more in the future.
    • NOTE: If you still want to use the default Lua behavior instead of relative paths, set the environment variable LUAU_PWD_REQUIRE to true

Changed

  • Improved error message when an invalid file path is passed to require
  • Much improved error formatting and stack traces

Fixed

  • Fixed downloading of type definitions making json files instead of the proper format
  • Process termination will now always make sure all lua state is cleaned up before exiting, in all cases

Version 0.0.6

24 Jan 01:46
76f2107
Compare
Choose a tag to compare
Version 0.0.6 Pre-release
Pre-release

Added

  • Initial implementation of Roblox's task library, with some caveats:

    • Minimum wait / delay time is currently set to 10ms, subject to change
    • It is not yet possible to pass arguments to tasks created using spawn / delay / defer
    • Timings for defer are flaky and deferred tasks are not (yet) guaranteed to run after spawned tasks

    With all that said, everything else should be stable!

    • Mixing and matching the coroutine library with task works in all cases
    • process.exit() will stop all spawned / delayed / deferred threads and exit the process
    • Lune is guaranteed to keep running until there are no longer any waiting threads

    If any of the abovementioned things do not work as expected, it is a bug, please file an issue!

Fixed

  • Potential fix for spawned processes that yield erroring with "attempt to yield across metamethod/c-call boundary"

Version 0.0.5

23 Jan 02:56
7469909
Compare
Choose a tag to compare
Version 0.0.5 Pre-release
Pre-release

Added

  • Added full test suites for all Lune globals to ensure correct behavior
  • Added library version of Lune that can be used from other Rust projects

Changed

  • Large internal changes to allow for implementing the task library.
  • Improved general formatting of errors to make them more readable & glanceable
  • Improved output formatting of non-primitive types
  • Improved output formatting of empty tables

Fixed

  • Fixed double stack trace for certain kinds of errors

Version 0.0.4

21 Jan 02:28
2565e02
Compare
Choose a tag to compare
Version 0.0.4 Pre-release
Pre-release

Added

  • Added process.args for inspecting values given to Lune when running (read only)
  • Added process.env which is a plain table where you can get & set environment variables

Changed

  • Improved error formatting & added proper file name to stack traces

Removed

  • Removed ... for process arguments, use process.args instead
  • Removed individual functions for getting & setting environment variables, use process.env instead

Version 0.0.3

20 Jan 03:32
b6822e6
Compare
Choose a tag to compare
Version 0.0.3 Pre-release
Pre-release

Added

  • Added networking functions under net

    Example usage:

    local apiResult = net.request({
    	url = "https://jsonplaceholder.typicode.com/posts/1",
    	method = "PATCH",
    	headers = {
    		["Content-Type"] = "application/json",
    	},
    	body = net.jsonEncode({
    		title = "foo",
    		body = "bar",
    	}),
    })
    
    local apiResponse = net.jsonDecode(apiResult.body)
    assert(apiResponse.title == "foo", "Invalid json response")
    assert(apiResponse.body == "bar", "Invalid json response")
  • Added console logging & coloring functions under console

    This piece of code:

    local tab = { Integer = 1234, Hello = { "World" } }
    console.log(tab)

    Will print the following formatted text to the console, with syntax highlighting:

    {
        Integer = 1234,
        Hello = {
            "World",
        }
    }

    Additional utility functions exist with the same behavior but that also print out a colored
    tag together with any data given to them: console.info, console.warn, console.error -
    These print out prefix tags [INFO], [WARN], [ERROR] in blue, orange, and red, respectively.

Changed

  • The json api is now part of net
    • json.encode becomes net.jsonEncode
    • json.decode become net.jsonDecode

Fixed

  • Fixed JSON decode not working properly