From 5e5b3efc7837c9264fa7053993fc53a8ef36364f Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:32:12 +0100 Subject: [PATCH] fix(sourcemap_generator): support no default.project.json init.luau packages --- lune/rojo/sourcemap_generator.luau | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lune/rojo/sourcemap_generator.luau b/lune/rojo/sourcemap_generator.luau index 1ab4a7c..67ee112 100644 --- a/lune/rojo/sourcemap_generator.luau +++ b/lune/rojo/sourcemap_generator.luau @@ -1,11 +1,15 @@ local fs = require("@lune/fs") local process = require("@lune/process") +local serde = require("@lune/serde") local stdio = require("@lune/stdio") local package_directory = process.args[1] if fs.isFile(package_directory .. "/default.project.json") then process.spawn("rojo", { "sourcemap", package_directory }, { cwd = process.cwd, stdio = "forward" }) +elseif fs.isFile(package_directory .. "/init.luau") then + local sourcemap = { filePaths = { "init.luau" } } + stdio.write(serde.encode("json", sourcemap, false)) else -- use stderr to avoid this being parsed as the output of the sourcemap command stdio.ewrite("no default.project.json found in " .. package_directory)