Update tooling & dependencies for Lune 0.8.0

This commit is contained in:
Filip Tibell 2024-01-14 19:07:03 +01:00
parent 0acad58f57
commit c60e92c446
No known key found for this signature in database
9 changed files with 24 additions and 22 deletions

View file

@ -6,13 +6,13 @@ install-dev-tools:
# Extract documentation from the main repository using moonwave # Extract documentation from the main repository using moonwave
extract-documentation COMMIT="": extract-documentation COMMIT="":
lune download "{{COMMIT}}" lune run download "{{COMMIT}}"
lune extract lune run extract
lune generate lune run generate
# Re-generates documentation from the main repository using moonwave # Re-generates documentation from the main repository using moonwave
generate-documentation: generate-documentation:
lune generate lune run generate
# Builds and generates a static site directory # Builds and generates a static site directory
build: build:

View file

@ -1,5 +1,5 @@
[tools] [tools]
just = "readysetplay/just@1.8.0" just = "readysetplay/just@1.8.0"
luau-lsp = "JohnnyMorganz/luau-lsp@1.22.0" luau-lsp = "JohnnyMorganz/luau-lsp@1.27.0"
lune = "filiptibell/lune@0.7.4" lune = "filiptibell/lune@0.8.0"
stylua = "JohnnyMorganz/StyLua@0.18.0" stylua = "JohnnyMorganz/StyLua@0.19.1"

View file

@ -2,9 +2,9 @@
local fs = require("@lune/fs") local fs = require("@lune/fs")
local net = require("@lune/net") local net = require("@lune/net")
local serde = require("@lune/serde")
local process = require("@lune/process") local process = require("@lune/process")
local roblox = require("@lune/roblox") local roblox = require("@lune/roblox")
local serde = require("@lune/serde")
export type LuneDataModel = roblox.DataModel export type LuneDataModel = roblox.DataModel
export type LuneInstance = roblox.Instance export type LuneInstance = roblox.Instance
@ -140,13 +140,15 @@ local function uploadAssetId(assetId: number, contents: string)
}) })
local csrfToken = csrfResponse.headers["x-csrf-token"] local csrfToken = csrfResponse.headers["x-csrf-token"]
if csrfToken == nil then error('Failed to fetch CSRF token.') end if csrfToken == nil then
error("Failed to fetch CSRF token.")
end
-- 3. Upload the asset to Roblox -- 3. Upload the asset to Roblox
local uploadHeaders = { local uploadHeaders = {
["User-Agent"] = "Roblox/WinInet", ["User-Agent"] = "Roblox/WinInet",
["Content-Type"] = "application/octet-stream", ["Content-Type"] = "application/octet-stream",
['X-CSRF-Token'] = csrfToken, ["X-CSRF-Token"] = csrfToken,
Accept = "application/json", Accept = "application/json",
Cookie = cookie, Cookie = cookie,
} }

View file

@ -21,7 +21,7 @@ print("Hello, " .. name .. "!")
Now you can place this script in your current directory, and run it using Lune: Now you can place this script in your current directory, and run it using Lune:
```sh copy filename="Bash" ```sh copy filename="Bash"
lune hello lune run hello
``` ```
You can also prompt for more than just text. Let's extend the above script and ask the person You can also prompt for more than just text. Let's extend the above script and ask the person
@ -86,7 +86,7 @@ print("")
Just like before, you can place this script in your current directory, and run it using Lune: Just like before, you can place this script in your current directory, and run it using Lune:
```sh copy filename="Bash" ```sh copy filename="Bash"
lune guessing-game lune run guessing-game
``` ```
</details> </details>

View file

@ -3,7 +3,7 @@
Arguments can be passed to Lune scripts directly from the command line when running them: Arguments can be passed to Lune scripts directly from the command line when running them:
```sh copy filename="Bash" ```sh copy filename="Bash"
lune script-name arg1 arg2 "argument three" lune run script-name arg1 arg2 "argument three"
``` ```
These arguments will then be available in your script using the These arguments will then be available in your script using the

View file

@ -30,7 +30,7 @@ end
Now you can place this script in your current directory, and run it using Lune: Now you can place this script in your current directory, and run it using Lune:
```sh copy filename="Bash" ```sh copy filename="Bash"
lune googler lune run googler
``` ```
## Sending JSON Requests ## Sending JSON Requests
@ -87,7 +87,7 @@ Running the above script Lune should now send a request to the placeholder API,
response was correct, and print it out: response was correct, and print it out:
```sh copy filename="Bash" ```sh copy filename="Bash"
lune json-api lune run json-api
``` ```
--- ---
@ -118,7 +118,7 @@ print("Listening on port 8080 🚀")
Just like before, you can place this script in your current directory, and run it using Lune: Just like before, you can place this script in your current directory, and run it using Lune:
```sh copy filename="Bash" ```sh copy filename="Bash"
lune network-server lune run network-server
``` ```
Now, when you visit [`http://localhost:8080/`](http://localhost:8080/) you should see the response Now, when you visit [`http://localhost:8080/`](http://localhost:8080/) you should see the response

View file

@ -5,7 +5,7 @@
When you've written a script file, for example `script-name.luau`, you can run it as such: When you've written a script file, for example `script-name.luau`, you can run it as such:
```sh copy ```sh copy
lune script-name lune run script-name
``` ```
This will look for the file `script-name.luau`**_<sup>[1]</sup>_** in a few locations: This will look for the file `script-name.luau`**_<sup>[1]</sup>_** in a few locations:
@ -19,7 +19,7 @@ This will look for the file `script-name.luau`**_<sup>[1]</sup>_** in a few loca
## Listing Scripts ## Listing Scripts
```sh copy ```sh copy
lune --list lune list
``` ```
Lists all scripts found in `lune` or `.lune` directories, including any top-level description Lists all scripts found in `lune` or `.lune` directories, including any top-level description
@ -29,14 +29,14 @@ lua-style comment arrow (`-->`).
## Advanced Usage ## Advanced Usage
```sh copy ```sh copy
lune - lune run -
``` ```
Runs a script passed to Lune using stdin. Useful for running scripts piped to Lune from external Runs a script passed to Lune using stdin. Useful for running scripts piped to Lune from external
sources. Example: sources. Example:
```sh copy ```sh copy
echo "print 'Hello, terminal!'" | lune - echo "print 'Hello, terminal!'" | lune run -
``` ```
--- ---

View file

@ -22,7 +22,7 @@ Run the following command in your terminal to generate Luau type definitions for
version of Lune: version of Lune:
```sh ```sh
lune --setup lune setup
``` ```
### Step 2 ### Step 2

View file

@ -341,7 +341,7 @@ without the luau file extension. Everything should work the same way it did when
Remodel, now running in Lune 🚀 Remodel, now running in Lune 🚀
```sh copy ```sh copy
lune example lune run example
``` ```
</Steps> </Steps>