From 67eb7981de568449433a6400c8e5812c458532eb Mon Sep 17 00:00:00 2001 From: Raymond Ng Date: Tue, 12 May 2026 13:26:47 -0700 Subject: [PATCH 1/4] bump lute to v1.0.0 --- foreman-release.toml | 2 +- foreman.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/foreman-release.toml b/foreman-release.toml index 132e9de..e61c62f 100644 --- a/foreman-release.toml +++ b/foreman-release.toml @@ -1,2 +1,2 @@ [tools] -lute = { source = "luau-lang/lute", version = "=0.1.0-nightly.20260303" } +lute = { source = "luau-lang/lute", version = "=1.0.0" } diff --git a/foreman.toml b/foreman.toml index 00983fb..ad13034 100644 --- a/foreman.toml +++ b/foreman.toml @@ -1,4 +1,4 @@ [tools] -lute = { source = "luau-lang/lute", version = "=0.1.0-nightly.20260303" } +lute = { source = "luau-lang/lute", version = "=1.0.0" } stylua = { source = "JohnnyMorganz/StyLua", version = "2.0.1" } rojo = { source = "rojo-rbx/rojo", version = "7.3.0" } From 871e99cf4efdfea25ec703f8422f4e7afe547325 Mon Sep 17 00:00:00 2001 From: Raymond Ng Date: Tue, 12 May 2026 13:40:23 -0700 Subject: [PATCH 2/4] fix casing in the new std library methods --- .luaurc | 6 +++--- scripts/build.luau | 2 +- src/commands/run.luau | 2 +- src/core/ocaleSdk.luau | 26 +++++++++++++------------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.luaurc b/.luaurc index 91767e4..35866cb 100644 --- a/.luaurc +++ b/.luaurc @@ -1,9 +1,9 @@ { "languageMode": "strict", "aliases": { - "std": "~/.lute/typedefs/0.1.0/std", - "lint": "~/.lute/typedefs/0.1.0/lint", - "lute": "~/.lute/typedefs/0.1.0/lute", + "std": "~/.lute/typedefs/1.0.0/std", + "lint": "~/.lute/typedefs/1.0.0/lint", + "lute": "~/.lute/typedefs/1.0.0/lute", "batteries": "./src/batteries" } } diff --git a/scripts/build.luau b/scripts/build.luau index 0994d4d..97052a5 100644 --- a/scripts/build.luau +++ b/scripts/build.luau @@ -11,7 +11,7 @@ log.setLevel("debug") local runProcess = require("../src/util/runProcess") if not fs.exists("build") then - fs.createdirectory("build") + fs.createDirectory("build") end local output_path = "build/rocale-cli" diff --git a/src/commands/run.luau b/src/commands/run.luau index 9e27afd..815e7a9 100644 --- a/src/commands/run.luau +++ b/src/commands/run.luau @@ -185,7 +185,7 @@ return function(...) if enableBinaryOutput and completedTask.binaryOutputUri then local binaryOutput = ocaleSdk.getBinaryOutput(completedTask.binaryOutputUri) assert(binaryOutputPath, "Binary output path should be a valid file path") - fs.writestringtofile(binaryOutputPath, binaryOutput) + fs.writeStringToFile(binaryOutputPath, binaryOutput) log.info(`{richterm.green("✓", log.noColor())} Binary output saved to '{binaryOutputPath}'`) end diff --git a/src/core/ocaleSdk.luau b/src/core/ocaleSdk.luau index 16adc56..32159d7 100644 --- a/src/core/ocaleSdk.luau +++ b/src/core/ocaleSdk.luau @@ -1,4 +1,4 @@ -local net = require("@lute/net") +local client = require("@lute/net/client") local json = require("@std/json") local fs = require("@std/fs") local task = require("@lute/task") @@ -10,9 +10,9 @@ local OcaleSDK = {} export type BinaryInputResponse = { path: string, size: number, uploadUri: string } function OcaleSDK.createBinaryInput(apiKey: string, universeId: number, filePath: string): BinaryInputResponse - local fileSize = #fs.readfiletostring(filePath) + local fileSize = #fs.readFileToString(filePath) - local response = net.request( + local response = client.request( `https://apis.roblox.com/cloud/v2/universes/{universeId}/luau-execution-session-task-binary-inputs`, { method = "POST", @@ -25,10 +25,10 @@ function OcaleSDK.createBinaryInput(apiKey: string, universeId: number, filePath end function OcaleSDK.uploadBinaryFile(uploadUri: string, filePath: string) - local response = net.request(uploadUri, { + local response = client.request(uploadUri, { method = "PUT", headers = { ["content-type"] = "application/octet-stream" }, - body = fs.readfiletostring(filePath), + body = fs.readFileToString(filePath), }) log.fatalif(not response.ok, `{response.status} - {response.body}`) end @@ -44,14 +44,14 @@ function OcaleSDK.uploadPlaceFile(filePath: string, placeInfo: PlaceInfo, apiKey local url = `https://apis.roblox.com/universes/v1/{placeInfo.universeId}/places/{placeInfo.placeId}/versions?versionType=Saved` log.debug(`Request URL: {url}`) - local response = net.request(url, { + local response = client.request(url, { method = "POST", headers = { ["x-api-key"] = apiKey, ["content-type"] = "application/xml", ["Accept"] = "application/json", }, - body = fs.readfiletostring(filePath), + body = fs.readFileToString(filePath), }) log.fatalif(not response.ok, `{response.status} - {response.body}`) log.debug(`Response body: {log.pretty(response.body)}`) @@ -98,7 +98,7 @@ function OcaleSDK.createTask( ): TaskResponse log.info(`{richterm.blue("→", log.noColor())} Creating the OCALE task...`) local url = getCreateTaskPath(placeInfo) - local entryScript = fs.readfiletostring(scriptPath) + local entryScript = fs.readFileToString(scriptPath) -- inject globals at the top of the entry script if luaGlobals and next(luaGlobals) then @@ -112,7 +112,7 @@ function OcaleSDK.createTask( entryScript = assignGlobals .. entryScript end - local req: net.Metadata = { + local req: client.Metadata = { method = "POST", headers = { ["x-api-key"] = apiKey, ["content-type"] = "application/json" }, body = json.serialize({ @@ -124,7 +124,7 @@ function OcaleSDK.createTask( } log.debug(`Request URL: {url}`) - local response = net.request(url, req) + local response = client.request(url, req) log.fatalif(not response.ok, `{response.status} - {response.body}`) local taskResponse = json.deserialize(response.body) :: TaskResponse log.debug(`Task path: {taskResponse.path}`) @@ -164,7 +164,7 @@ function OcaleSDK.pollTaskCompletion( while timeRemaining > 0 do timeRemaining = timeRemaining - interval - local response = net.request(`https://apis.roblox.com/cloud/v2/{taskPath}`, { + local response = client.request(`https://apis.roblox.com/cloud/v2/{taskPath}`, { method = "GET", headers = { ["x-api-key"] = apiKey }, }) @@ -196,7 +196,7 @@ end function OcaleSDK.getBinaryOutput(binaryOutputUri: string): string log.debug(`Binary output URI: {binaryOutputUri}`) - local response = net.request(binaryOutputUri, { + local response = client.request(binaryOutputUri, { method = "GET", }) log.fatalif(not response.ok, `{response.status} - {response.body}`) @@ -204,7 +204,7 @@ function OcaleSDK.getBinaryOutput(binaryOutputUri: string): string end function OcaleSDK.getTaskLogs(apiKey: string, taskPath: string): { string } - local response = net.request(`https://apis.roblox.com/cloud/v2/{taskPath}/logs`, { + local response = client.request(`https://apis.roblox.com/cloud/v2/{taskPath}/logs`, { method = "GET", headers = { ["x-api-key"] = apiKey }, }) From 4860801ce3702475639172c3bb275f899fb05ef6 Mon Sep 17 00:00:00 2001 From: Raymond Ng Date: Tue, 12 May 2026 13:52:54 -0700 Subject: [PATCH 3/4] fix content type in upload --- scripts/test.luau | 2 +- src/core/ocaleSdk.luau | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/test.luau b/scripts/test.luau index bfc0602..2d3b2b2 100644 --- a/scripts/test.luau +++ b/scripts/test.luau @@ -24,7 +24,7 @@ runProcess({ "--verbose", }) -local testOutput = fs.readfiletostring("build/testOutput.txt") +local testOutput = fs.readFileToString("build/testOutput.txt") fs.remove("build/testOutput.txt") assert(testOutput == "hello world!", `Expected binary output to be "hello world!"`) diff --git a/src/core/ocaleSdk.luau b/src/core/ocaleSdk.luau index 32159d7..60512c1 100644 --- a/src/core/ocaleSdk.luau +++ b/src/core/ocaleSdk.luau @@ -44,11 +44,13 @@ function OcaleSDK.uploadPlaceFile(filePath: string, placeInfo: PlaceInfo, apiKey local url = `https://apis.roblox.com/universes/v1/{placeInfo.universeId}/places/{placeInfo.placeId}/versions?versionType=Saved` log.debug(`Request URL: {url}`) + local isBinary = string.match(filePath, "%.rbxl$") ~= nil + local contentType = if isBinary then "application/octet-stream" else "application/xml" local response = client.request(url, { method = "POST", headers = { ["x-api-key"] = apiKey, - ["content-type"] = "application/xml", + ["content-type"] = contentType, ["Accept"] = "application/json", }, body = fs.readFileToString(filePath), From 7d007340c4111f2fe80ad842cc7db6506ff49be9 Mon Sep 17 00:00:00 2001 From: Raymond Ng Date: Tue, 12 May 2026 13:54:39 -0700 Subject: [PATCH 4/4] flip the rbxlx check --- src/core/ocaleSdk.luau | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ocaleSdk.luau b/src/core/ocaleSdk.luau index 60512c1..a15d5e9 100644 --- a/src/core/ocaleSdk.luau +++ b/src/core/ocaleSdk.luau @@ -44,8 +44,8 @@ function OcaleSDK.uploadPlaceFile(filePath: string, placeInfo: PlaceInfo, apiKey local url = `https://apis.roblox.com/universes/v1/{placeInfo.universeId}/places/{placeInfo.placeId}/versions?versionType=Saved` log.debug(`Request URL: {url}`) - local isBinary = string.match(filePath, "%.rbxl$") ~= nil - local contentType = if isBinary then "application/octet-stream" else "application/xml" + local isXml = string.match(filePath, "%.rbxlx$") ~= nil + local contentType = if isXml then "application/xml" else "application/octet-stream" local response = client.request(url, { method = "POST", headers = {