Update to stable rbx-dom libraries

This commit is contained in:
Lucien Greathouse
2021-06-29 01:20:09 -04:00
parent a3d8e50f26
commit 672d207961
36 changed files with 129 additions and 122 deletions

View File

@@ -3,6 +3,7 @@
## Unreleased Changes
* Added the `fmt-project` subcommand for formatting Rojo project files.
* Improved error output for many subcommands.
* Updated to stable versions of rbx-dom libraries.
## [7.0.0-alpha.4][7.0.0-alpha.4] (May 5, 2021)
* Added the `gameId` and `placeId` optional properties to project files.

24
Cargo.lock generated
View File

@@ -1823,9 +1823,9 @@ dependencies = [
[[package]]
name = "rbx_binary"
version = "0.6.0-alpha.5"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d7e87ab0f16f2a911b38d3761bf694743d1ea75638becd9ff355b462d33bbfa"
checksum = "7e0d35abcd708d9db72594ec79f0740233d90783afc20104706e0215881f4d79"
dependencies = [
"log",
"lz4",
@@ -1837,9 +1837,9 @@ dependencies = [
[[package]]
name = "rbx_dom_weak"
version = "2.0.0-alpha.1"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ffa16d4ae69867cbe305d740790900193147ce5a904fc583f88dbfc7de43a95"
checksum = "04a2953af06e505bfa8db053e658907a8450448d42920851aea0707f39bf58f7"
dependencies = [
"rbx_types",
"serde",
@@ -1847,9 +1847,9 @@ dependencies = [
[[package]]
name = "rbx_reflection"
version = "4.0.0-alpha.1"
version = "4.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c43632d239190aad5b9406a6f0df2233ae3b46489957dd6d11c4d6daa9046c5"
checksum = "7b25f6125c1e721194180ce2237218a346e553b85175f4caeb688fa8926cd687"
dependencies = [
"rbx_types",
"serde",
@@ -1857,9 +1857,9 @@ dependencies = [
[[package]]
name = "rbx_reflection_database"
version = "0.1.1+roblox-478"
version = "0.2.0+roblox-478"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "027b05433fe77e2608b95524d61bdd5db51ec93a80f20e0b2ef1bcf8a43894ca"
checksum = "9be227705c074a7741718a1b89a4970201634bf26fe48876a42b5fd0965d4f44"
dependencies = [
"lazy_static",
"rbx_reflection",
@@ -1869,9 +1869,9 @@ dependencies = [
[[package]]
name = "rbx_types"
version = "0.3.1"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ee26785b8236954e96d907ee0226a4c0761ebb5855ed115cc363979bd503331"
checksum = "3ca80f18e1d5c2f1c29835c4be0af0e94ed7459fbb1196ec7b2343ab9bf7db00"
dependencies = [
"base64 0.11.0",
"bitflags",
@@ -1883,9 +1883,9 @@ dependencies = [
[[package]]
name = "rbx_xml"
version = "0.12.0-alpha.4"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86e2277d678ea30609e6f383a8f34eabab7bb2f9d62144cbe400d179acea2d47"
checksum = "58e9a2ae17228c75672da28f9ddf896331eaf364c0aacf60bfacc17828a4cce2"
dependencies = [
"base64 0.11.0",
"log",

View File

@@ -54,11 +54,11 @@ memofs = { version = "0.1.2", path = "memofs" }
# rbx_reflection_database = { path = "../rbx-dom/rbx_reflection_database" }
# rbx_xml = { path = "../rbx-dom/rbx_xml" }
rbx_binary = "0.6.0-alpha.1"
rbx_dom_weak = "2.0.0-alpha.1"
rbx_reflection = "4.0.0-alpha.1"
rbx_reflection_database = "0.1.0"
rbx_xml = "0.12.0-alpha.1"
rbx_binary = "0.6.0"
rbx_dom_weak = "2.0.0"
rbx_reflection = "4.0.0"
rbx_reflection_database = "0.2.0"
rbx_xml = "0.12.0"
anyhow = "1.0.27"
backtrace = "0.3"

View File

@@ -1,6 +1,7 @@
---
source: tests/tests/serve.rs
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
---
instances:
id-2:
@@ -13,7 +14,7 @@ instances:
Parent: "00000000000000000000000000000000"
Properties:
Source:
Type: String
Value: "-- Edited contents"
String: "-- Edited contents"
messageCursor: 1
sessionId: id-1

View File

@@ -1,6 +1,7 @@
---
source: tests/tests/serve.rs
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
---
instances:
id-2:
@@ -13,7 +14,7 @@ instances:
Parent: "00000000000000000000000000000000"
Properties:
Source:
Type: String
Value: "-- Original contents"
String: "-- Original contents"
messageCursor: 0
sessionId: id-1

View File

@@ -1,6 +1,7 @@
---
source: tests/tests/serve.rs
expression: "subscribe_response.intern_and_redact(&mut redactions, ())"
---
messageCursor: 1
messages:
@@ -12,7 +13,7 @@ messages:
changedName: ~
changedProperties:
Source:
Type: String
Value: "-- Edited contents"
String: "-- Edited contents"
id: id-2
sessionId: id-1

View File

@@ -1,6 +1,7 @@
---
source: tests/tests/serve.rs
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
---
instances:
id-10:
@@ -13,8 +14,7 @@ instances:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #6"
String: "File #6"
id-11:
Children: []
ClassName: StringValue
@@ -25,8 +25,7 @@ instances:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #7"
String: "File #7"
id-12:
Children: []
ClassName: StringValue
@@ -37,8 +36,7 @@ instances:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #8"
String: "File #8"
id-13:
Children: []
ClassName: StringValue
@@ -49,8 +47,7 @@ instances:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #9"
String: "File #9"
id-2:
Children:
- id-3
@@ -90,8 +87,7 @@ instances:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #0"
String: "File #0"
id-5:
Children: []
ClassName: StringValue
@@ -102,8 +98,7 @@ instances:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #1"
String: "File #1"
id-6:
Children: []
ClassName: StringValue
@@ -114,8 +109,7 @@ instances:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #2"
String: "File #2"
id-7:
Children: []
ClassName: StringValue
@@ -126,8 +120,7 @@ instances:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #3"
String: "File #3"
id-8:
Children: []
ClassName: StringValue
@@ -138,8 +131,7 @@ instances:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #4"
String: "File #4"
id-9:
Children: []
ClassName: StringValue
@@ -150,7 +142,7 @@ instances:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #5"
String: "File #5"
messageCursor: 1
sessionId: id-1

View File

@@ -1,6 +1,7 @@
---
source: tests/tests/serve.rs
expression: "subscribe_response.intern_and_redact(&mut redactions, ())"
---
messageCursor: 1
messages:
@@ -15,8 +16,7 @@ messages:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #6"
String: "File #6"
id-11:
Children: []
ClassName: StringValue
@@ -27,8 +27,7 @@ messages:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #7"
String: "File #7"
id-12:
Children: []
ClassName: StringValue
@@ -39,8 +38,7 @@ messages:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #8"
String: "File #8"
id-13:
Children: []
ClassName: StringValue
@@ -51,8 +49,7 @@ messages:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #9"
String: "File #9"
id-3:
Children:
- id-4
@@ -82,8 +79,7 @@ messages:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #0"
String: "File #0"
id-5:
Children: []
ClassName: StringValue
@@ -94,8 +90,7 @@ messages:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #1"
String: "File #1"
id-6:
Children: []
ClassName: StringValue
@@ -106,8 +101,7 @@ messages:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #2"
String: "File #2"
id-7:
Children: []
ClassName: StringValue
@@ -118,8 +112,7 @@ messages:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #3"
String: "File #3"
id-8:
Children: []
ClassName: StringValue
@@ -130,8 +123,7 @@ messages:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #4"
String: "File #4"
id-9:
Children: []
ClassName: StringValue
@@ -142,8 +134,8 @@ messages:
Parent: id-3
Properties:
Value:
Type: String
Value: "File #5"
String: "File #5"
removed: []
updated: []
sessionId: id-1

View File

@@ -1,6 +1,7 @@
---
source: tests/tests/serve.rs
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
---
instances:
id-2:
@@ -23,7 +24,7 @@ instances:
Parent: id-2
Properties:
Value:
Type: String
Value: This file will be removed!
String: This file will be removed!
messageCursor: 0
sessionId: id-1

View File

@@ -1,6 +1,7 @@
---
source: tests/tests/serve.rs
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
---
instances:
id-2:
@@ -24,8 +25,7 @@ instances:
Parent: id-2
Properties:
Source:
Type: String
Value: "-- Hello, from bar!"
String: "-- Hello, from bar!"
id-4:
Children: []
ClassName: ModuleScript
@@ -36,7 +36,7 @@ instances:
Parent: id-2
Properties:
Source:
Type: String
Value: Updated foo!
String: Updated foo!
messageCursor: 1
sessionId: id-1

View File

@@ -1,6 +1,7 @@
---
source: tests/tests/serve.rs
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
---
instances:
id-2:
@@ -24,8 +25,7 @@ instances:
Parent: id-2
Properties:
Source:
Type: String
Value: "-- Hello, from bar!"
String: "-- Hello, from bar!"
id-4:
Children: []
ClassName: ModuleScript
@@ -36,7 +36,7 @@ instances:
Parent: id-2
Properties:
Source:
Type: String
Value: "-- Hello, from foo!"
String: "-- Hello, from foo!"
messageCursor: 0
sessionId: id-1

View File

@@ -1,6 +1,7 @@
---
source: tests/tests/serve.rs
expression: "subscribe_response.intern_and_redact(&mut redactions, ())"
---
messageCursor: 1
messages:
@@ -12,7 +13,7 @@ messages:
changedName: ~
changedProperties:
Source:
Type: String
Value: Updated foo!
String: Updated foo!
id: id-4
sessionId: id-1

View File

@@ -112,13 +112,13 @@ fn write_model(
match output_kind {
OutputKind::Rbxm => {
rbx_binary::to_writer_default(&mut file, tree.inner(), &[root_id])?;
rbx_binary::to_writer(&mut file, tree.inner(), &[root_id])?;
}
OutputKind::Rbxl => {
let root_instance = tree.get_instance(root_id).unwrap();
let top_level_ids = root_instance.children();
rbx_binary::to_writer_default(&mut file, tree.inner(), top_level_ids)?;
rbx_binary::to_writer(&mut file, tree.inner(), top_level_ids)?;
}
OutputKind::Rbxmx => {
// Model files include the root instance of the tree and all its

View File

@@ -73,7 +73,7 @@ fn install_plugin() -> anyhow::Result<()> {
let tree = session.tree();
let root_id = tree.get_root_id();
rbx_binary::to_writer_default(&mut file, tree.inner(), &[root_id])?;
rbx_binary::to_writer(&mut file, tree.inner(), &[root_id])?;
Ok(())
}

View File

@@ -53,7 +53,7 @@ impl UploadCommand {
let mut buffer = Vec::new();
log::trace!("Encoding binary model");
rbx_binary::to_writer_default(&mut buffer, tree.inner(), &encode_ids)?;
rbx_binary::to_writer(&mut buffer, tree.inner(), &encode_ids)?;
do_upload(buffer, self.asset_id, &cookie)
}
}

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot/tests/apply.rs
expression: applied_patch_value
---
removed: []
added: []
@@ -10,6 +11,6 @@ updated:
changed_class_name: ~
changed_properties:
Foo:
Type: String
Value: Value of Foo
String: Value of Foo
changed_metadata: ~

View File

@@ -1,16 +1,17 @@
---
source: src/snapshot/tests/apply.rs
expression: tree_view
---
id: id-1
name: ROOT
class_name: ROOT
properties:
Foo:
Type: String
Value: Value of Foo
String: Value of Foo
metadata:
ignore_unknown_instances: false
relevant_paths: []
context: {}
children: []

View File

@@ -1,16 +1,17 @@
---
source: src/snapshot/tests/apply.rs
expression: tree_view
---
id: id-1
name: ROOT
class_name: ROOT
properties:
Foo:
Type: String
Value: Should be removed
String: Should be removed
metadata:
ignore_unknown_instances: false
relevant_paths: []
context: {}
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot/tests/compute.rs
expression: patch_value
---
removed_instances: []
added_instances: []
@@ -10,6 +11,6 @@ updated_instances:
changed_class_name: ~
changed_properties:
PropertyName:
Type: String
Value: "Hello, world!"
String: "Hello, world!"
changed_metadata: ~

View File

@@ -360,8 +360,7 @@ mod test {
"$className": "StringValue",
"$properties": {
"Value": {
"Type": "String",
"Value": "Hello, world!"
"String": "Hello, world!"
}
}
}

View File

@@ -13,7 +13,7 @@ pub fn snapshot_rbxm(
path: &Path,
instance_name: &str,
) -> SnapshotInstanceResult {
let temp_tree = rbx_binary::from_reader_default(vfs.read(path)?.as_slice())
let temp_tree = rbx_binary::from_reader(vfs.read(path)?.as_slice())
.with_context(|| format!("Malformed rbxm file: {}", path.display()))?;
let root_instance = temp_tree.root();

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/csv.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: LocalizationTable
properties:
Contents:
Type: String
Value: "[{\"key\":\"Ack\",\"example\":\"An exclamation of despair\",\"source\":\"Ack!\",\"values\":{\"es\":\"¡Ay!\"}}]"
String: "[{\"key\":\"Ack\",\"example\":\"An exclamation of despair\",\"source\":\"Ack!\",\"values\":{\"es\":\"¡Ay!\"}}]"
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/csv.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: LocalizationTable
properties:
Contents:
Type: String
Value: "[{\"key\":\"Ack\",\"example\":\"An exclamation of despair\",\"source\":\"Ack!\",\"values\":{\"es\":\"¡Ay!\"}}]"
String: "[{\"key\":\"Ack\",\"example\":\"An exclamation of despair\",\"source\":\"Ack!\",\"values\":{\"es\":\"¡Ay!\"}}]"
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/json.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: ModuleScript
properties:
Source:
Type: String
Value: "return {\n\t[\"1invalidident\"] = \"nice\",\n\tarray = {1, 2, 3},\n\t[\"false\"] = false,\n\tfloat = 1234.5452,\n\tint = 1234,\n\tnull = nil,\n\tobject = {\n\t\thello = \"world\",\n\t},\n\t[\"true\"] = true,\n}"
String: "return {\n\t[\"1invalidident\"] = \"nice\",\n\tarray = {1, 2, 3},\n\t[\"false\"] = false,\n\tfloat = 1234.5452,\n\tint = 1234,\n\tnull = nil,\n\tobject = {\n\t\thello = \"world\",\n\t},\n\t[\"true\"] = true,\n}"
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/json_model.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -14,8 +15,7 @@ name: foo
class_name: IntValue
properties:
Value:
Type: Int64
Value: 5
Int64: 5
children:
- snapshot_id: ~
metadata:
@@ -26,3 +26,4 @@ children:
class_name: StringValue
properties: {}
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: LocalScript
properties:
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: ModuleScript
properties:
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: ModuleScript
properties:
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,9 +16,8 @@ name: bar
class_name: Script
properties:
Disabled:
Type: Bool
Value: true
Bool: true
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: Script
properties:
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/lua.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: Script
properties:
Source:
Type: String
Value: Hello there!
String: Hello there!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/project.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: path-property-override
class_name: StringValue
properties:
Value:
Type: String
Value: Changed
String: Changed
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/project.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -16,6 +17,6 @@ name: path-project
class_name: StringValue
properties:
Value:
Type: String
Value: "Hello, world!"
String: "Hello, world!"
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/project.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -14,6 +15,6 @@ name: resolved-properties
class_name: StringValue
properties:
Value:
Type: String
Value: "Hello, world!"
String: "Hello, world!"
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/project.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -14,6 +15,6 @@ name: unresolved-properties
class_name: StringValue
properties:
Value:
Type: String
Value: Hi!
String: Hi!
children: []

View File

@@ -1,6 +1,7 @@
---
source: src/snapshot_middleware/txt.rs
expression: instance_snapshot
---
snapshot_id: ~
metadata:
@@ -15,6 +16,6 @@ name: foo
class_name: StringValue
properties:
Value:
Type: String
Value: Hello there!
String: Hello there!
children: []