blake-mealey / mantle

An infrastructure-as-code and deployment tool for Roblox.
https://mantledeploy.vercel.app/
MIT License
85 stars 11 forks source link

Add code generator for assets like tarmac #178

Open jcphlux opened 1 year ago

jcphlux commented 1 year ago

What type of feature request is this?

Describe your problem While migrating from using Tarmac to Mantle the feature I miss is the code generator that would create an assets.lua file for simple referencing my assets in code.

Another reason this would be useful is when using remote state is can be difficult to get the asset ids.

Describe the solution you'd like Might be as easy as reusing Tarmac code to generate the file. The source on how Tormac did this is here. codegen.rs

Add 2 setting to configure this option.

codegen = true
codegen-path = "src/ReplicatedStorage/Modules/assets.lua"

The output could look like this. Mimicking the path structure.

return {
    Image= {
        <asset_name>= "rbxassetid://<asset__id>",
        <asset_name>= "rbxassetid://<asset__id>",
    },
    Sound = {
        <asset_name>= "rbxassetid://<asset__id>",
    },
}