mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 12:45:05 +00:00
Implement support for turning .json files into Lua modules (#308)
* Stub implementation * Flesh out feature and add tests. Other snapshots currently failing. * Blacklist .meta.json in JSON handler * Write to correct property (Source) instead of Value * Update changelog
This commit is contained in:
committed by
GitHub
parent
62e51b7535
commit
4bf73c7a8a
@@ -0,0 +1,23 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="ModuleScript" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">json_as_lua</string>
|
||||
<string name="Source">return {
|
||||
["1invalidident"] = "nice",
|
||||
array = {1, 2, 3},
|
||||
["false"] = false,
|
||||
float = 1234.5452,
|
||||
int = 1234,
|
||||
null = nil,
|
||||
object = {
|
||||
hello = "world",
|
||||
},
|
||||
["true"] = true,
|
||||
}</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
6
rojo-test/build-tests/json_as_lua/default.project.json
Normal file
6
rojo-test/build-tests/json_as_lua/default.project.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "json_as_lua",
|
||||
"tree": {
|
||||
"$path": "make-me-a-script.json"
|
||||
}
|
||||
}
|
||||
12
rojo-test/build-tests/json_as_lua/make-me-a-script.json
Normal file
12
rojo-test/build-tests/json_as_lua/make-me-a-script.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"array": [1, 2, 3],
|
||||
"object": {
|
||||
"hello": "world"
|
||||
},
|
||||
"true": true,
|
||||
"false": false,
|
||||
"null": null,
|
||||
"int": 1234,
|
||||
"float": 1234.5452,
|
||||
"1invalidident": "nice"
|
||||
}
|
||||
@@ -31,6 +31,7 @@ gen_build_tests! {
|
||||
init_meta_class_name,
|
||||
init_meta_properties,
|
||||
init_with_children,
|
||||
json_as_lua,
|
||||
json_model_in_folder,
|
||||
json_model_legacy_name,
|
||||
module_in_folder,
|
||||
|
||||
Reference in New Issue
Block a user