Implement Syncback to support converting Roblox files to a Rojo project (#937)

This is a very large commit.
Consider checking the linked PR for more information.
This commit is contained in:
Micah
2025-11-19 09:21:33 -08:00
committed by GitHub
parent 071b6e7e23
commit 9b5a07191b
239 changed files with 5325 additions and 225 deletions

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing OnlyOneCopy/child_of_one.luau
Writing ReplicatedStorage/child_replicated_storage.luau

View File

@@ -0,0 +1,7 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/csv.csv
Writing src/csv_init/init.csv
Writing src/csv_init

View File

@@ -0,0 +1,5 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing container.model.json

View File

@@ -0,0 +1,7 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/int_value.model.json
Writing src/subfolder/string_value.txt
Writing src/subfolder

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/non-init.luau
Writing src/init-file

View File

@@ -0,0 +1,73 @@
---
source: tests/rojo_test/syncback_util.rs
expression: src/Message.rbxm
---
num_types: 1
num_instances: 1
chunks:
- Inst:
type_id: 0
type_name: Message
object_format: 0
referents:
- 0
- Prop:
type_id: 0
prop_name: AttributesSerialize
prop_type: String
values:
- ""
- Prop:
type_id: 0
prop_name: Capabilities
prop_type: SecurityCapabilities
values:
- 0
- Prop:
type_id: 0
prop_name: HistoryId
prop_type: UniqueId
values:
- "00000000000000000000000000000000"
- Prop:
type_id: 0
prop_name: Name
prop_type: String
values:
- Message
- Prop:
type_id: 0
prop_name: DefinesCapabilities
prop_type: Bool
values:
- false
- Prop:
type_id: 0
prop_name: SourceAssetId
prop_type: Int64
values:
- -1
- Prop:
type_id: 0
prop_name: Tags
prop_type: String
values:
- ""
- Prop:
type_id: 0
prop_name: Text
prop_type: String
values:
- This message should be written to the disk.
- Prop:
type_id: 0
prop_name: UniqueId
prop_type: UniqueId
values:
- 2030b7775c30713f085b9d4800005a8b
- Prnt:
version: 0
links:
- - 0
- -1
- End

View File

@@ -0,0 +1,5 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/Message.rbxm

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/IncludeMe/.gitkeep
Writing src/IncludeMe

View File

@@ -0,0 +1,5 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---

View File

@@ -0,0 +1,8 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/dir_with_meta/init.meta.json
Writing src/model_json.model.json
Writing src/project_json.project.json
Writing src/dir_with_meta

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing nested.project.json
Writing string_value.txt

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/modules/ClientModule.luau
Writing src/modules/ServerModule.luau

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/init.luau
Writing src

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing attribute_mismatch.luau
Writing property_mismatch.project.json

View File

@@ -0,0 +1,73 @@
---
source: tests/rojo_test/syncback_util.rs
expression: src/ChildWithDuplicates.rbxm
---
num_types: 1
num_instances: 3
chunks:
- Inst:
type_id: 0
type_name: Folder
object_format: 0
referents:
- 0
- 1
- 2
- Prop:
type_id: 0
prop_name: AttributesSerialize
prop_type: String
values:
- ""
- ""
- ""
- Prop:
type_id: 0
prop_name: Capabilities
prop_type: SecurityCapabilities
values:
- 0
- 0
- 0
- Prop:
type_id: 0
prop_name: Name
prop_type: String
values:
- DuplicateChild
- DuplicateChild
- ChildWithDuplicates
- Prop:
type_id: 0
prop_name: DefinesCapabilities
prop_type: Bool
values:
- false
- false
- false
- Prop:
type_id: 0
prop_name: SourceAssetId
prop_type: Int64
values:
- -1
- -1
- -1
- Prop:
type_id: 0
prop_name: Tags
prop_type: String
values:
- ""
- ""
- ""
- Prnt:
version: 0
links:
- - 0
- 2
- - 1
- 2
- - 2
- -1
- End

View File

@@ -0,0 +1,9 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/ChildWithDuplicates.rbxm
Writing src/ChildWithoutDuplicates/Child/.gitkeep
Writing src/ChildWithoutDuplicates
Writing src/ChildWithoutDuplicates/Child
Removing src/ChildWithDuplicates

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/pointer.model.json
Writing src/target.model.json

View File

@@ -0,0 +1,7 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/pointer.model.json
Writing src/target.meta.json
Writing src/target.txt

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/Pointer_2.model.json
Writing src/Target_2.model.json

View File

@@ -0,0 +1,5 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---

View File

@@ -0,0 +1,55 @@
---
source: tests/rojo_test/syncback_util.rs
expression: src/rbxm.rbxm
---
num_types: 1
num_instances: 1
chunks:
- Inst:
type_id: 0
type_name: Folder
object_format: 0
referents:
- 0
- Prop:
type_id: 0
prop_name: AttributesSerialize
prop_type: String
values:
- ""
- Prop:
type_id: 0
prop_name: Capabilities
prop_type: SecurityCapabilities
values:
- 0
- Prop:
type_id: 0
prop_name: Name
prop_type: String
values:
- rbxm
- Prop:
type_id: 0
prop_name: DefinesCapabilities
prop_type: Bool
values:
- false
- Prop:
type_id: 0
prop_name: SourceAssetId
prop_type: Int64
values:
- -1
- Prop:
type_id: 0
prop_name: Tags
prop_type: String
values:
- rbxmx
- Prnt:
version: 0
links:
- - 0
- -1
- End

View File

@@ -0,0 +1,8 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing default.project.json
Writing src/model_json.model.json
Writing src/rbxm.rbxm
Writing src/rbxmx.rbxmx

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing default.project.json
Writing string_value.txt

View File

@@ -0,0 +1,6 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing src/module.modulescript
Writing src/text.text

View File

@@ -0,0 +1,5 @@
---
source: tests/rojo_test/syncback_util.rs
expression: "String::from_utf8_lossy(&output.stdout)"
---
Writing default.project.json

View File

@@ -0,0 +1,5 @@
---
source: tests/tests/syncback.rs
expression: OnlyOneCopy/child_of_one.luau
---
-- this should be in OnlyOneCopy/child_of_one

View File

@@ -0,0 +1,5 @@
---
source: tests/tests/syncback.rs
expression: ReplicatedStorage/child_replicated_storage.luau
---
-- -- this should be in child_replicated_storage

View File

@@ -0,0 +1,6 @@
---
source: tests/tests/syncback.rs
expression: src/csv.csv
---
Key,Source,Context,Example,es
Ack,Ack!,,An exclamation of despair,¡Ay!

View File

@@ -0,0 +1,6 @@
---
source: tests/tests/syncback.rs
expression: src/csv_init/init.csv
---
Key,Source,Context,Example,en
Rojo,Rojo,,Rojo is a really cool program,Red

View File

@@ -0,0 +1,25 @@
---
source: tests/tests/syncback.rs
expression: container.model.json
---
{
"className": "Folder",
"children": [
{
"name": "value_1",
"className": "ObjectValue",
"attributes": {
"Rojo_Id": "value_1",
"Rojo_Target_Value": "value_1"
}
},
{
"name": "value_2",
"className": "ObjectValue",
"attributes": {
"Rojo_Id": "72bc28150ada2e6206442ee300004084",
"Rojo_Target_Value": "72bc28150ada2e6206442ee300004084"
}
}
]
}

View File

@@ -0,0 +1,10 @@
---
source: tests/tests/syncback.rs
expression: src/int_value.model.json
---
{
"className": "IntValue",
"properties": {
"Value": 1337.0
}
}

View File

@@ -0,0 +1,5 @@
---
source: tests/tests/syncback.rs
expression: src/subfolder/string_value.txt
---
This memorial dedicated to Club Penguin.

View File

@@ -0,0 +1,5 @@
---
source: tests/tests/syncback.rs
expression: src/init-file/init.luau
---
-- This file SHOULD NOT be updated

View File

@@ -0,0 +1,6 @@
---
source: tests/tests/syncback.rs
expression: src/non-init.luau
---
-- This module SHOULD be updated
-- This text is new.

View File

@@ -0,0 +1,12 @@
---
source: tests/tests/syncback.rs
expression: src/dir_with_meta/init.meta.json
---
{
"properties": {
"Tags": [
"This tag on dir_with_meta"
]
},
"className": "Configuration"
}

View File

@@ -0,0 +1,10 @@
---
source: tests/tests/syncback.rs
expression: src/model_json.model.json
---
{
"className": "StringValue",
"properties": {
"Value": "This text is model_json"
}
}

View File

@@ -0,0 +1,17 @@
---
source: tests/tests/syncback.rs
expression: src/project_json.project.json
---
{
"name": "project_json",
"tree": {
"$className": "Color3Value",
"$properties": {
"Value": [
1337.0,
-1337.0,
1337.0
]
}
}
}

View File

@@ -0,0 +1,19 @@
---
source: tests/tests/syncback.rs
expression: nested.project.json
---
{
"name": "Nested",
"tree": {
"$className": "Configuration",
"BoolValue": {
"$className": "BoolValue",
"$properties": {
"Value": true
}
},
"StringValue": {
"$path": "string_value.txt"
}
}
}

View File

@@ -0,0 +1,5 @@
---
source: tests/tests/syncback.rs
expression: string_value.txt
---
Nested project string value :-)

View File

@@ -0,0 +1,5 @@
---
source: tests/tests/syncback.rs
expression: src/modules/ClientModule.luau
---
-- Client module

View File

@@ -0,0 +1,5 @@
---
source: tests/tests/syncback.rs
expression: src/modules/ServerModule.luau
---
-- Server module

View File

@@ -0,0 +1,5 @@
---
source: tests/tests/syncback.rs
expression: src/init.luau
---
-- Project init script

View File

@@ -0,0 +1,5 @@
---
source: tests/tests/syncback.rs
expression: attribute_mismatch.luau
---
-- This script is a part of project_reserialize

View File

@@ -0,0 +1,15 @@
---
source: tests/tests/syncback.rs
expression: property_mismatch.project.json
---
{
"name": "property_mismatch",
"tree": {
"$className": "BrickColorValue",
"$properties": {
"Value": {
"BrickColor": 345
}
}
}
}

View File

@@ -0,0 +1,10 @@
---
source: tests/tests/syncback.rs
expression: src/pointer.model.json
---
{
"className": "ObjectValue",
"attributes": {
"Rojo_Target_Value": "test referent id"
}
}

View File

@@ -0,0 +1,10 @@
---
source: tests/tests/syncback.rs
expression: src/target.model.json
---
{
"className": "Folder",
"attributes": {
"Rojo_Id": "test referent id"
}
}

View File

@@ -0,0 +1,10 @@
---
source: tests/tests/syncback.rs
expression: src/pointer.model.json
---
{
"className": "ObjectValue",
"attributes": {
"Rojo_Target_Value": "62e89c49e4f800c20629c71b00003fc0"
}
}

View File

@@ -0,0 +1,9 @@
---
source: tests/tests/syncback.rs
expression: src/target.meta.json
---
{
"attributes": {
"Rojo_Id": "62e89c49e4f800c20629c71b00003fc0"
}
}

View File

@@ -0,0 +1,5 @@
---
source: tests/tests/syncback.rs
expression: src/target.txt
---
This is a target.

View File

@@ -0,0 +1,11 @@
---
source: tests/tests/syncback.rs
assertion_line: 28
expression: src/Pointer_2.model.json
---
{
"className": "ObjectValue",
"attributes": {
"Rojo_Target_Value": "0bd3e9e11879191708a2bc4a00000c20"
}
}

View File

@@ -0,0 +1,11 @@
---
source: tests/tests/syncback.rs
assertion_line: 28
expression: src/Target_2.model.json
---
{
"className": "Folder",
"attributes": {
"Rojo_Id": "0bd3e9e11879191708a2bc4a00000c20"
}
}

View File

@@ -0,0 +1,16 @@
---
source: tests/tests/syncback.rs
expression: default.project.json
---
{
"name": "respect_old_middleware",
"tree": {
"project_node": {
"$className": "BoolValue",
"$properties": {
"Value": true
}
},
"$path": "src"
}
}

View File

@@ -0,0 +1,10 @@
---
source: tests/tests/syncback.rs
expression: src/model_json.model.json
---
{
"className": "StringValue",
"properties": {
"Value": "This should be a .model.json file"
}
}

View File

@@ -0,0 +1,16 @@
---
source: tests/tests/syncback.rs
expression: src/rbxmx.rbxmx
---
<roblox version="4">
<Item class="Folder" referent="0">
<Properties>
<string name="Name">rbxmx</string>
<BinaryString name="AttributesSerialize"></BinaryString>
<SecurityCapabilities name="Capabilities">0</SecurityCapabilities>
<bool name="DefinesCapabilities">false</bool>
<int64 name="SourceAssetId">-1</int64>
<BinaryString name="Tags">cmJ4bXg=</BinaryString>
</Properties>
</Item>
</roblox>

View File

@@ -0,0 +1,22 @@
---
source: tests/tests/syncback.rs
expression: default.project.json
---
{
"name": "string_value_project",
"tree": {
"$className": "Folder",
"inside_project_file": {
"$className": "StringValue",
"$properties": {
"Value": "imgettingverytiredofwritingthesetests2"
}
},
"on_file_system": {
"$attributes": {
"imgettingverytiredofwritingthesetests": "person299 was ahead of his time"
},
"$path": "string_value.txt"
}
}
}

View File

@@ -0,0 +1,6 @@
---
source: tests/tests/syncback.rs
expression: src/module.modulescript
---
-- This should be a in the file 'module.modulescript'. It should be updated to have a second line.
-- This is the second line in 'module.modulescript'.

View File

@@ -0,0 +1,6 @@
---
source: tests/tests/syncback.rs
expression: src/text.text
---
-- This should be a in the file 'text.text'. It should be updated to have a second line.
-- This is the second line in 'text.text'.

View File

@@ -0,0 +1,18 @@
---
source: tests/tests/syncback.rs
expression: default.project.json
---
{
"name": "unscriptable_properties",
"tree": {
"$className": "BinaryStringValue",
"$properties": {
"Value": {
"BinaryString": "Rojo/is/cool"
}
}
},
"syncbackRules": {
"syncUnscriptable": true
}
}

View File

@@ -0,0 +1,12 @@
{
"name": "child_but_not",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"$path": "ReplicatedStorage",
"OnlyOneCopy": {
"$path": "OnlyOneCopy"
}
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,6 @@
{
"name": "csv",
"tree": {
"$path": "src"
}
}

View File

@@ -0,0 +1,2 @@
Key,Source,Context,Example,en
,,,,
1 Key Source Context Example en
2

Binary file not shown.

View File

@@ -0,0 +1,13 @@
{
"className": "Folder",
"children": [
{
"name": "value_1",
"className": "ObjectValue"
},
{
"name": "value_2",
"className": "ObjectValue"
}
]
}

View File

@@ -0,0 +1,11 @@
{
"name": "duplicate_rojo_id",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"container": {
"$path": "container.model.json"
}
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,11 @@
{
"name": "ignore_paths_adding",
"tree": {
"$path": "src"
},
"syncbackRules": {
"ignorePaths": [
"src/*.rbxm"
]
}
}

View File

@@ -0,0 +1,11 @@
{
"name": "ignore_paths_init",
"tree": {
"$path": "src"
},
"syncbackRules": {
"ignorePaths": [
"**/init-file/*.luau"
]
}
}

View File

@@ -0,0 +1 @@
-- This file SHOULD NOT be updated

View File

@@ -0,0 +1 @@
-- This module SHOULD be updated

Binary file not shown.

View File

@@ -0,0 +1,14 @@
{
"name": "ignore_paths_removing",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"$path": "src"
}
},
"syncbackRules": {
"ignorePaths": [
"*.luau"
]
}
}

View File

@@ -0,0 +1 @@
-- This script is not in the input place file.

View File

@@ -0,0 +1,14 @@
{
"name": "ignore_trees_adding",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"$path": "src"
}
},
"syncbackRules": {
"ignoreTrees": [
"ReplicatedStorage/IgnoreMe"
]
}
}

View File

@@ -0,0 +1,14 @@
{
"name": "ignore_trees_removing",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"$path": "src"
}
},
"syncbackRules": {
"ignoreTrees": [
"ReplicatedStorage/KeepMe"
]
}
}

View File

@@ -0,0 +1,6 @@
{
"name": "json_middleware",
"tree": {
"$path": "src"
}
}

View File

@@ -0,0 +1,3 @@
{
"className": "Configuration"
}

View File

@@ -0,0 +1,3 @@
{
"className": "StringValue"
}

View File

@@ -0,0 +1,6 @@
{
"name": "project_json",
"tree": {
"$className": "Color3Value"
}
}

Binary file not shown.

View File

@@ -0,0 +1,11 @@
{
"name": "nested_projects",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"Nested": {
"$path": "nested.project.json"
}
}
}
}

View File

@@ -0,0 +1,15 @@
{
"name": "Nested",
"tree": {
"$className": "Configuration",
"BoolValue": {
"$className": "BoolValue",
"$properties": {
"Value": true
}
},
"StringValue": {
"$path": "string_value.txt"
}
}
}

View File

@@ -0,0 +1 @@
effective cover predict pawn south

View File

@@ -0,0 +1,11 @@
{
"name": "nested_projects",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"Nested": {
"$path": "nested.project.json"
}
}
}
}

View File

@@ -0,0 +1,12 @@
{
"name": "Nested",
"tree": {
"$className": "Configuration",
"StringValue": {
"$path": "string_value.txt"
},
"BoolValue": {
"$className": "BoolValue"
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,9 @@
{
"name": "client_only",
"tree": {
"$path": "src/modules"
},
"globIgnorePaths": [
"**Server**"
]
}

View File

@@ -0,0 +1,16 @@
{
"name": "nested_projects_but_weird",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"modules": {
"$path": "client-only.project.json"
}
},
"ServerStorage": {
"modules": {
"$path": "server-only.project.json"
}
}
}
}

View File

@@ -0,0 +1,9 @@
{
"name": "server_only",
"tree": {
"$path": "src/modules"
},
"globIgnorePaths": [
"**Client**"
]
}

Some files were not shown because too many files have changed in this diff Show More