Compare commits

..

11 Commits

Author SHA1 Message Date
Lucien Greathouse
75542dacb3 Release Rojo 7.0.0-rc.3 2021-10-19 17:12:28 -04:00
Lucien Greathouse
07abfbde43 Release Rojo 7.0.0-rc.2 2021-10-19 17:07:14 -04:00
Kenneth Loeffler
96112fe118 Add ambiguous value resolution StringArray -> Tags (#484)
* Add ambiguous value resolution StringArray -> Tags

* Remove funny autocompleted reference
2021-10-19 16:46:31 -04:00
Kenneth Loeffler
9d0b313261 Add ChangeBatcher to plugin for two-way sync (#478)
* Implement ChangeBatcher

* Use ChangeBatcher for two-way sync

* Pause updates during patch application

* I can English good

* Break after encountering a nil Parent change

This prevents __flush from erroring out when an instance's Parent is
changed to nil and it has other property changes in the same batch.

* Update rbx_dom_lua

* Don't connect changed listeners in a running game

 #468 made me realize how bad of an idea this is in general...

* Update TestEZ and fix sibling Ref reification test

* Add ChangeBatcher tests

* Test instance unpausing by breaking functionality out to __cycle

* Break up the module a bit and improve tests

* Shuffle requires around and edit comment

* Break out more stuff, rename createChangePatch -> createPatchSet

* Make ChangeBatcher responsible for unpausing all paused instances

This somewhat improves the situation (of course, it would preferrable
to not have to hack around this problem with Source at all). It also
sets us up nicely if we come across any other properties that do
anything similar.

* Remove old reference to pausedBatchInstances

* Use RenderStepped instead of Heartbeat and trash multi-frame pauses

I probably should have done this in the first place...

ChangeBatcher still needs to unpause instances, but we don't need to
hold pauses for any longer than one cycle.

* Remove useless branch

* if not next(x) -> if next(x) == nil

* Add InstanceMap:unpauseAllInstances, use it in ChangeBatcher

* Move IsRunning check to InstanceMap:__maybeFireInstanceChanged
2021-10-18 18:18:51 -04:00
Wiktor Rudnicki
277ddfa9be Themes colors modification (#482)
* Modified colors of themes

Colors match Roblox Studio theme.

* Change cases of colors

Colors' hexes have correct cases now.
2021-10-15 13:27:47 -04:00
Lucien Greathouse
5d88bdb256 Upgrade dependencies in lockfile 2021-10-15 13:24:40 -04:00
Lucien Greathouse
8d29b43155 Upgrade dependencies 2021-10-11 17:40:14 -04:00
Lucien Greathouse
cc071a6415 Move entrypoint from src/bin.rs to src/main.rs 2021-09-14 20:42:38 -04:00
Lucien Greathouse
8954def25c Move responsibility for extracting names from paths lower 2021-08-24 17:59:53 -04:00
Lucien Greathouse
d484098781 Get rid of confusing 'SnapshotInstanceResult' type alias 2021-08-24 17:15:47 -04:00
Lucien Greathouse
9f06cbf3a0 Update contributing guide 2021-08-23 16:11:56 -04:00
40 changed files with 3603 additions and 919 deletions

View File

@@ -2,7 +2,24 @@
## Unreleased Changes
## [7.0.0-rc.1][7.0.0-rc.1] (August 23, 2021)
## [7.0.0-rc.3] - October 19, 2021
This is the last release candidate for Rojo 7. In an effort to get Rojo 7 out the door, we'll be freezing features from here on out, something we should've done a couple months ago.
Expect to see Rojo 7 stable soon!
* Added support for writing `Tags` in project files, model files, and meta files. ([#484])
* Adjusted Studio plugin colors to match Roblox Studio palette. ([#482])
* Improved experimental two-way sync feature by batching changes. ([#478])
[#482]: https://github.com/rojo-rbx/rojo/pull/482
[#484]: https://github.com/rojo-rbx/rojo/pull/484
[#478]: https://github.com/rojo-rbx/rojo/pull/478
[7.0.0-rc.3]: https://github.com/rojo-rbx/rojo/releases/tag/v7.0.0-rc.3
## 7.0.0-rc.2 - October 19, 2021
(Botched release due to Git mishap, oops!)
## [7.0.0-rc.1] - August 23, 2021
In Rojo 6 and previous Rojo 7 alphas, an explicit Vector3 property would be written like this:
```json
@@ -45,9 +62,9 @@ The shorthand property format that most users use is not impacted. For reference
* Added the `fmt-project` subcommand for formatting Rojo project files.
* Improved error output for many subcommands.
* Updated to stable versions of rbx-dom libraries.
* Updated async infrastructure, which should fix a handful of bugs. ([#459][#459])
* Fixed syncing refs in the Roblox Studio plugin ([#462][#462], [#466][#466])
* Added support for long paths on Windows. ([#464][#464])
* Updated async infrastructure, which should fix a handful of bugs. ([#459])
* Fixed syncing refs in the Roblox Studio plugin ([#462], [#466])
* Added support for long paths on Windows. ([#464])
[#459]: https://github.com/rojo-rbx/rojo/pull/459
[#462]: https://github.com/rojo-rbx/rojo/pull/462

View File

@@ -34,16 +34,17 @@ The Rojo release process is pretty manual right now. If you need to do it, here'
1. Bump server version in [`Cargo.toml`](Cargo.toml)
2. Bump plugin version in [`plugin/src/Config.lua`](plugin/src/Config.lua)
3. Run `cargo test` to update `Cargo.lock` and double-check tests
3. Run `cargo test` to update `Cargo.lock` and run tests
4. Update [`CHANGELOG.md`](CHANGELOG.md)
5. Commit!
* `git add . && git commit -m "Release vX.Y.Z"`
6. Tag the commit with the version from `Cargo.toml` prepended with a v, like `v0.4.13`
6. Tag the commit
* `git tag vX.Y.Z`
7. Publish the CLI
* `cargo publish`
8. Publish the Plugin
* `rojo publish plugin --asset_id 6415005344`
* `rojo build plugin -o Rojo.rbxm`
* `cargo run -- upload plugin --asset_id 6415005344`
* `cargo run -- build plugin --output Rojo.rbxm`
9. Push commits and tags
* `git push && git push --tags`
10. Copy GitHub release content from previous release

361
Cargo.lock generated
View File

@@ -46,9 +46,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.43"
version = "1.0.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf"
checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1"
[[package]]
name = "arrayref"
@@ -168,9 +168,9 @@ dependencies = [
[[package]]
name = "bstr"
version = "0.2.16"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279"
checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
dependencies = [
"lazy_static",
"memchr",
@@ -180,9 +180,9 @@ dependencies = [
[[package]]
name = "bumpalo"
version = "3.7.0"
version = "3.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631"
checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538"
[[package]]
name = "byte-tools"
@@ -209,9 +209,9 @@ dependencies = [
[[package]]
name = "bytes"
version = "1.0.1"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040"
checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
[[package]]
name = "cast"
@@ -224,9 +224,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.0.69"
version = "1.0.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd"
[[package]]
name = "cfg-if"
@@ -313,9 +313,9 @@ dependencies = [
[[package]]
name = "core-foundation"
version = "0.9.1"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62"
checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3"
dependencies = [
"core-foundation-sys",
"libc",
@@ -323,9 +323,9 @@ dependencies = [
[[package]]
name = "core-foundation-sys"
version = "0.8.2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b"
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
[[package]]
name = "crc32fast"
@@ -498,11 +498,11 @@ dependencies = [
[[package]]
name = "ctor"
version = "0.1.20"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d"
checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa"
dependencies = [
"quote 1.0.9",
"quote 1.0.10",
"syn",
]
@@ -556,13 +556,13 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]]
name = "embed-resource"
version = "1.6.3"
version = "1.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45de30eb317b4cd3882ee16623cb3004e5fb99a8f4cd40097cadf61efbc54adc"
checksum = "254a67531cc22d81bf92a24358a1dfa3d3b30f8d326fed8c5780eb6f2e5c784f"
dependencies = [
"cc",
"vswhom",
"winreg 0.9.0",
"winreg 0.10.1",
]
[[package]]
@@ -609,8 +609,8 @@ version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
dependencies = [
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"syn",
"synstructure",
]
@@ -635,9 +635,9 @@ dependencies = [
[[package]]
name = "flate2"
version = "1.0.20"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0"
checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f"
dependencies = [
"cfg-if 1.0.0",
"crc32fast",
@@ -731,9 +731,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678"
[[package]]
name = "futures"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b"
checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca"
dependencies = [
"futures-channel",
"futures-core",
@@ -746,9 +746,9 @@ dependencies = [
[[package]]
name = "futures-channel"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74ed2411805f6e4e3d9bc904c95d5d423b89b3b25dc0250aa74729de20629ff9"
checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888"
dependencies = [
"futures-core",
"futures-sink",
@@ -756,9 +756,9 @@ dependencies = [
[[package]]
name = "futures-core"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99"
checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d"
[[package]]
name = "futures-cpupool"
@@ -772,9 +772,9 @@ dependencies = [
[[package]]
name = "futures-executor"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d0d535a57b87e1ae31437b892713aee90cd2d7b0ee48727cd11fc72ef54761c"
checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c"
dependencies = [
"futures-core",
"futures-task",
@@ -783,40 +783,40 @@ dependencies = [
[[package]]
name = "futures-io"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b0e06c393068f3a6ef246c75cdca793d6a46347e75286933e5e75fd2fd11582"
checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377"
[[package]]
name = "futures-macro"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57"
checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb"
dependencies = [
"autocfg 1.0.1",
"proc-macro-hack",
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"syn",
]
[[package]]
name = "futures-sink"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0f30aaa67363d119812743aa5f33c201a7a66329f97d1a887022971feea4b53"
checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11"
[[package]]
name = "futures-task"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe54a98670017f3be909561f6ad13e810d9a51f3f061b902062ca3da80799f2"
checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99"
[[package]]
name = "futures-util"
version = "0.3.16"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67eb846bfd58e44a8481a00049e82c43e0ccb5d61f8dc071057cb19249dd4d78"
checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481"
dependencies = [
"autocfg 1.0.1",
"futures-channel",
@@ -861,7 +861,7 @@ checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
dependencies = [
"cfg-if 1.0.0",
"libc",
"wasi 0.10.2+wasi-snapshot-preview1",
"wasi 0.10.0+wasi-snapshot-preview1",
]
[[package]]
@@ -903,9 +903,9 @@ dependencies = [
[[package]]
name = "half"
version = "1.7.1"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3"
checksum = "ac5956d4e63858efaec57e0d6c1c2f6a41e1487f830314a324ccd7e2223a7ca0"
[[package]]
name = "hashbrown"
@@ -950,11 +950,11 @@ dependencies = [
[[package]]
name = "http"
version = "0.2.4"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11"
checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b"
dependencies = [
"bytes 1.0.1",
"bytes 1.1.0",
"fnv",
"itoa",
]
@@ -977,8 +977,8 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5"
dependencies = [
"bytes 1.0.1",
"http 0.2.4",
"bytes 1.1.0",
"http 0.2.5",
"pin-project-lite",
]
@@ -1032,22 +1032,22 @@ dependencies = [
[[package]]
name = "hyper"
version = "0.14.11"
version = "0.14.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b61cf2d1aebcf6e6352c97b81dc2244ca29194be1b276f5d8ad5c6330fffb11"
checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593"
dependencies = [
"bytes 1.0.1",
"bytes 1.1.0",
"futures-channel",
"futures-core",
"futures-util",
"http 0.2.4",
"http 0.2.5",
"http-body 0.4.3",
"httparse",
"httpdate",
"itoa",
"pin-project-lite",
"socket2",
"tokio 1.10.0",
"tokio 1.12.0",
"tower-service",
"tracing",
"want 0.3.0",
@@ -1120,9 +1120,9 @@ dependencies = [
[[package]]
name = "insta"
version = "1.7.2"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58019516c1403ac45b106c9fc4e8fcbd77a78e98b014c619d1506338902ccfa4"
checksum = "15226a375927344c78d39dc6b49e2d5562a5b0705e26a589093c6792e52eed8e"
dependencies = [
"console",
"lazy_static",
@@ -1167,9 +1167,9 @@ checksum = "8b23360e99b8717f20aaa4598f5a6541efbe30630039fbc7706cf954a87947ae"
[[package]]
name = "js-sys"
version = "0.3.53"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4bf49d50e2961077d9c99f4b7997d770a1114f087c3c2e0069b36c13fc2979d"
checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84"
dependencies = [
"wasm-bindgen",
]
@@ -1198,9 +1198,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
version = "0.2.100"
version = "0.2.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1fa8cddc8fbbee11227ef194b5317ed014b8acbf15139bd716a18ad3fe99ec5"
checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6"
[[package]]
name = "linked-hash-map"
@@ -1466,9 +1466,9 @@ dependencies = [
[[package]]
name = "object"
version = "0.26.1"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee2766204889d09937d00bfbb7fec56bb2a199e2ade963cab19185d8a6104c7c"
checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2"
dependencies = [
"memchr",
]
@@ -1523,9 +1523,9 @@ checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a"
[[package]]
name = "openssl-sys"
version = "0.9.66"
version = "0.9.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1996d2d305e561b70d1ee0c53f1542833f4e1ac6ce9a6708b6ff2738ca67dc82"
checksum = "69df2d8dfc6ce3aaf44b40dec6f487d5a886516cf6879c49e98e0710f310a058"
dependencies = [
"autocfg 1.0.1",
"cc",
@@ -1614,8 +1614,8 @@ checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55"
dependencies = [
"pest",
"pest_meta",
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"syn",
]
@@ -1644,9 +1644,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pkg-config"
version = "0.3.19"
version = "0.3.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb"
[[package]]
name = "plotters"
@@ -1678,9 +1678,9 @@ dependencies = [
[[package]]
name = "ppv-lite86"
version = "0.2.10"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741"
[[package]]
name = "pretty_assertions"
@@ -1701,8 +1701,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"syn",
"version_check",
]
@@ -1713,8 +1713,8 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"version_check",
]
@@ -1741,9 +1741,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.28"
version = "1.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70"
dependencies = [
"unicode-xid 0.2.2",
]
@@ -1769,11 +1769,11 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.9"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
dependencies = [
"proc-macro2 1.0.28",
"proc-macro2 1.0.30",
]
[[package]]
@@ -1990,9 +1990,9 @@ dependencies = [
[[package]]
name = "rbx_binary"
version = "0.6.2"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ef5d412170f7cd73437fbc51bd0c2d976a19226b1ca4e0dd4654b9de456ce69"
checksum = "68f424adb7a0a24ab4bd153be141035f1404ae40affed902fd2721b42cca7f86"
dependencies = [
"log",
"lz4",
@@ -2004,9 +2004,9 @@ dependencies = [
[[package]]
name = "rbx_dom_weak"
version = "2.2.0"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d65a8c420268f17400dd7b1edb259086fe5922b794c1d78027ca605afe38c1e5"
checksum = "6f7f524fb18f30d7065c82c4e87f747705679329810207e96169c6d4ec922d1f"
dependencies = [
"rbx_types",
"serde",
@@ -2014,9 +2014,9 @@ dependencies = [
[[package]]
name = "rbx_reflection"
version = "4.1.0"
version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5348f0072bca81d514808002a6464cb842128b48c36e2e8b07cd6d490eb12c82"
checksum = "a8915748c8a3b2a92540e4e35e99ebd548df2d62b0a6cf38ae5d0081f0e611d5"
dependencies = [
"rbx_types",
"serde",
@@ -2024,9 +2024,9 @@ dependencies = [
[[package]]
name = "rbx_reflection_database"
version = "0.2.1+roblox-484"
version = "0.2.2+roblox-498"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d82fd952a01a86f1e6e182e1bc5f31bead251b37c4200f3ac3ff0d5e0a49d5d7"
checksum = "e4e459dc87be8464122ad3bb722a562ddae8e811bb4a6b7809eaa1fac220cf30"
dependencies = [
"lazy_static",
"rbx_reflection",
@@ -2036,9 +2036,9 @@ dependencies = [
[[package]]
name = "rbx_types"
version = "1.2.0"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c42ae2a0d18070ac3139c6a3b7228fe3342559b9520f4da2faa13e2eefb2d59"
checksum = "d637383aa560cb675b7ea7a7778b945dab065ccc7c158f77b5455e27efadc6df"
dependencies = [
"base64 0.11.0",
"bitflags",
@@ -2046,13 +2046,14 @@ dependencies = [
"lazy_static",
"rand 0.7.3",
"serde",
"thiserror",
]
[[package]]
name = "rbx_xml"
version = "0.12.2"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88c71b41834dbf565b040399b011b1d6b006df78692fa3469d5defa985be9cbc"
checksum = "67387cd246cdec9251dd2451672541499ae6ce0a47c768b3ea9ee0a1becda9dd"
dependencies = [
"base64 0.11.0",
"log",
@@ -2188,9 +2189,9 @@ dependencies = [
[[package]]
name = "rlua"
version = "0.17.0"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25fa5b2c667bae0b6218361e96d365e414fe4a0fa80f476b9631aa2dea2c6881"
checksum = "93397b9792dc237cab7554ab4c4128b8aa5fc9ec25892cfd82c92286055313d0"
dependencies = [
"bitflags",
"bstr",
@@ -2233,7 +2234,7 @@ dependencies = [
[[package]]
name = "rojo"
version = "7.0.0-rc.1"
version = "7.0.0-rc.3"
dependencies = [
"anyhow",
"backtrace",
@@ -2244,10 +2245,10 @@ dependencies = [
"embed-resource",
"env_logger",
"fs-err",
"futures 0.3.16",
"futures 0.3.17",
"globset",
"humantime",
"hyper 0.14.11",
"hyper 0.14.13",
"insta",
"jod-thread",
"lazy_static",
@@ -2276,7 +2277,7 @@ dependencies = [
"tempfile",
"termcolor",
"thiserror",
"tokio 1.10.0",
"tokio 1.12.0",
"uuid 0.8.2",
"walkdir",
"winreg 0.9.0",
@@ -2292,9 +2293,9 @@ dependencies = [
[[package]]
name = "rustc-demangle"
version = "0.1.20"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49"
checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
[[package]]
name = "rustc_version"
@@ -2347,9 +2348,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "security-framework"
version = "2.3.1"
version = "2.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467"
checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87"
dependencies = [
"bitflags",
"core-foundation",
@@ -2360,9 +2361,9 @@ dependencies = [
[[package]]
name = "security-framework-sys"
version = "2.3.0"
version = "2.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e4effb91b4b8b6fb7732e670b6cee160278ff8e6bf485c7805d9e319d76e284"
checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e"
dependencies = [
"core-foundation-sys",
"libc",
@@ -2391,9 +2392,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]]
name = "serde"
version = "1.0.128"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1056a0db1978e9dbf0f6e4fca677f6f9143dc1c19de346f22cac23e422196834"
checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
dependencies = [
"serde_derive",
]
@@ -2410,20 +2411,20 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.128"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13af2fbb8b60a8950d6c72a56d2095c28870367cc8e10c55e9745bac4995a2c4"
checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
dependencies = [
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"syn",
]
[[package]]
name = "serde_json"
version = "1.0.66"
version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127"
checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8"
dependencies = [
"itoa",
"ryu",
@@ -2444,9 +2445,9 @@ dependencies = [
[[package]]
name = "serde_yaml"
version = "0.8.19"
version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6375dbd828ed6964c3748e4ef6d18e7a175d408ffe184bca01698d0c73f915a9"
checksum = "d8c608a35705a5d3cdc9fbe403147647ff34b921f8e833e49306df898f9b20af"
dependencies = [
"dtoa",
"indexmap",
@@ -2474,9 +2475,9 @@ checksum = "1ad1d488a557b235fc46dae55512ffbfc429d2482b08b4d9435ab07384ca8aec"
[[package]]
name = "slab"
version = "0.4.4"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590"
checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5"
[[package]]
name = "smallvec"
@@ -2498,9 +2499,9 @@ dependencies = [
[[package]]
name = "socket2"
version = "0.4.1"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "765f090f0e423d2b55843402a07915add955e7d60657db13707a159727326cad"
checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516"
dependencies = [
"libc",
"winapi 0.3.9",
@@ -2523,9 +2524,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]]
name = "structopt"
version = "0.3.22"
version = "0.3.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69b041cdcb67226aca307e6e7be44c8806423d83e018bd662360a93dabce4d71"
checksum = "bf9d950ef167e25e0bdb073cf1d68e9ad2795ac826f2f3f59647817cf23c0bfa"
dependencies = [
"clap",
"lazy_static",
@@ -2534,14 +2535,14 @@ dependencies = [
[[package]]
name = "structopt-derive"
version = "0.4.15"
version = "0.4.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7813934aecf5f51a54775e00068c237de98489463968231a51746bbbc03f9c10"
checksum = "134d838a2c9943ac3125cf6df165eda53493451b719f3255b2a26b85f772d0ba"
dependencies = [
"heck",
"proc-macro-error",
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"syn",
]
@@ -2553,23 +2554,23 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
[[package]]
name = "syn"
version = "1.0.75"
version = "1.0.80"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7f58f7e8eaa0009c5fec437aabf511bd9933e4b2d7407bd05273c01a8906ea7"
checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194"
dependencies = [
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"unicode-xid 0.2.2",
]
[[package]]
name = "synstructure"
version = "0.12.5"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa"
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
dependencies = [
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"syn",
"unicode-xid 0.2.2",
]
@@ -2618,31 +2619,32 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.26"
version = "1.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2"
checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.26"
version = "1.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745"
checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
dependencies = [
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"syn",
]
[[package]]
name = "time"
version = "0.1.43"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
dependencies = [
"libc",
"wasi 0.10.0+wasi-snapshot-preview1",
"winapi 0.3.9",
]
@@ -2658,9 +2660,9 @@ dependencies = [
[[package]]
name = "tinyvec"
version = "1.3.1"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338"
checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7"
dependencies = [
"tinyvec_macros",
]
@@ -2692,9 +2694,9 @@ dependencies = [
[[package]]
name = "tokio"
version = "1.10.0"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01cf844b23c6131f624accf65ce0e4e9956a8bb329400ea5bcc26ae3a5c20b0b"
checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc"
dependencies = [
"autocfg 1.0.1",
"libc",
@@ -2826,9 +2828,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
[[package]]
name = "tracing"
version = "0.1.26"
version = "0.1.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105"
dependencies = [
"cfg-if 1.0.0",
"pin-project-lite",
@@ -2837,9 +2839,9 @@ dependencies = [
[[package]]
name = "tracing-core"
version = "0.1.19"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ca517f43f0fb96e0c3072ed5c275fe5eece87e8cb52f4a77b69226d3b1c9df8"
checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4"
dependencies = [
"lazy_static",
]
@@ -2861,9 +2863,9 @@ dependencies = [
[[package]]
name = "typenum"
version = "1.13.0"
version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06"
checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec"
[[package]]
name = "ucd-trie"
@@ -2882,9 +2884,9 @@ dependencies = [
[[package]]
name = "unicode-bidi"
version = "0.3.6"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085"
checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f"
[[package]]
name = "unicode-normalization"
@@ -2903,9 +2905,9 @@ checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
[[package]]
name = "unicode-width"
version = "0.1.8"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]]
name = "unicode-xid"
@@ -3039,15 +3041,15 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
[[package]]
name = "wasi"
version = "0.10.2+wasi-snapshot-preview1"
version = "0.10.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]]
name = "wasm-bindgen"
version = "0.2.76"
version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce9b1b516211d33767048e5d47fa2a381ed8b76fc48d2ce4aa39877f9f183e0"
checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce"
dependencies = [
"cfg-if 1.0.0",
"wasm-bindgen-macro",
@@ -3055,37 +3057,37 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.76"
version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfe8dc78e2326ba5f845f4b5bf548401604fa20b1dd1d365fb73b6c1d6364041"
checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b"
dependencies = [
"bumpalo",
"lazy_static",
"log",
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.76"
version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44468aa53335841d9d6b6c023eaab07c0cd4bddbcfdee3e2bb1e8d2cb8069fef"
checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9"
dependencies = [
"quote 1.0.9",
"quote 1.0.10",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.76"
version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0195807922713af1e67dc66132c7328206ed9766af3858164fb583eedc25fbad"
checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
dependencies = [
"proc-macro2 1.0.28",
"quote 1.0.9",
"proc-macro2 1.0.30",
"quote 1.0.10",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
@@ -3093,15 +3095,15 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.76"
version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acdb075a845574a1fa5f09fd77e43f7747599301ea3417a9fbffdeedfc1f4a29"
checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc"
[[package]]
name = "web-sys"
version = "0.3.53"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "224b2f6b67919060055ef1a67807367c2066ed520c3862cc013d26cf893a783c"
checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -3168,6 +3170,15 @@ dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "winreg"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "ws2_32-sys"
version = "0.2.1"

View File

@@ -1,6 +1,6 @@
[package]
name = "rojo"
version = "7.0.0-rc.1"
version = "7.0.0-rc.3"
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
description = "Enables professional-grade development tools for Roblox developers"
license = "MPL-2.0"
@@ -37,10 +37,6 @@ members = [
name = "librojo"
path = "src/lib.rs"
[[bin]]
name = "rojo"
path = "src/bin.rs"
[[bench]]
name = "build"
harness = false
@@ -55,41 +51,41 @@ memofs = { version = "0.2.0", path = "memofs" }
# rbx_reflection_database = { path = "../rbx-dom/rbx_reflection_database" }
# rbx_xml = { path = "../rbx-dom/rbx_xml" }
rbx_binary = "0.6.1"
rbx_dom_weak = "2.1.0"
rbx_reflection = "4.1.0"
rbx_reflection_database = "0.2.1"
rbx_xml = "0.12.1"
rbx_binary = "0.6.4"
rbx_dom_weak = "2.3.0"
rbx_reflection = "4.2.0"
rbx_reflection_database = "0.2.2"
rbx_xml = "0.12.3"
anyhow = "1.0.27"
backtrace = "0.3"
bincode = "1.2.1"
anyhow = "1.0.44"
backtrace = "0.3.61"
bincode = "1.3.3"
crossbeam-channel = "0.5.1"
csv = "1.1.1"
csv = "1.1.6"
env_logger = "0.9.0"
fs-err = "2.2.0"
futures = "0.3.16"
globset = "0.4.4"
fs-err = "2.6.0"
futures = "0.3.17"
globset = "0.4.8"
humantime = "2.1.0"
hyper = { version = "0.14.11", features = ["server", "tcp", "http1"] }
jod-thread = "0.1.0"
hyper = { version = "0.14.13", features = ["server", "tcp", "http1"] }
jod-thread = "0.1.2"
lazy_static = "1.4.0"
log = "0.4.8"
maplit = "1.0.1"
notify = "4.0.14"
log = "0.4.14"
maplit = "1.0.2"
notify = "4.0.17"
opener = "0.5.0"
regex = "1.3.1"
reqwest = "0.9.20"
regex = "1.5.4"
reqwest = "0.9.24"
ritz = "0.1.0"
rlua = "0.17.0"
rlua = "0.17.1"
roblox_install = "1.0.0"
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
structopt = "0.3.5"
termcolor = "1.0.5"
thiserror = "1.0.11"
tokio = { version = "1.9.0", features = ["rt", "rt-multi-thread"] }
uuid = { version = "0.8.1", features = ["v4", "serde"] }
serde = { version = "1.0.130", features = ["derive", "rc"] }
serde_json = "1.0.68"
structopt = "0.3.23"
termcolor = "1.1.2"
thiserror = "1.0.30"
tokio = { version = "1.12.0", features = ["rt", "rt-multi-thread"] }
uuid = { version = "0.8.2", features = ["v4", "serde"] }
[target.'cfg(windows)'.dependencies]
winreg = "0.9.0"
@@ -97,20 +93,20 @@ winreg = "0.9.0"
[build-dependencies]
memofs = { version = "0.2.0", path = "memofs" }
embed-resource = "1.6"
anyhow = "1.0.27"
bincode = "1.2.1"
fs-err = "2.3.0"
maplit = "1.0.1"
embed-resource = "1.6.4"
anyhow = "1.0.44"
bincode = "1.3.3"
fs-err = "2.6.0"
maplit = "1.0.2"
[dev-dependencies]
rojo-insta-ext = { path = "rojo-insta-ext" }
criterion = "0.3"
insta = { version = "1.3.0", features = ["redactions"] }
lazy_static = "1.2"
criterion = "0.3.5"
insta = { version = "1.8.0", features = ["redactions"] }
lazy_static = "1.4.0"
paste = "1.0.5"
pretty_assertions = "0.7.2"
serde_yaml = "0.8.9"
tempfile = "3.0"
walkdir = "2.1"
serde_yaml = "0.8.21"
tempfile = "3.2.0"
walkdir = "2.3.2"

View File

@@ -388,6 +388,11 @@ types = {
end,
},
Tags = {
fromPod = identity,
toPod = identity,
},
Vector2 = {
fromPod = unpackDecoder(Vector2.new),

View File

@@ -20,7 +20,21 @@ local function set(container, key, value)
end
function PropertyDescriptor.fromRaw(data, className, propertyName)
local key, value = next(data.DataType)
return setmetatable({
-- The meanings of the key and value in DataType differ when the type of
-- the property is Enum. When the property is of type Enum, the key is
-- the name of the type:
--
-- { Enum = "<name of enum>" }
--
-- When the property is not of type Enum, the value is the name of the
-- type:
--
-- { Value = "<data type>" }
dataType = key == "Enum" and key or value,
scriptability = data.Scriptability,
className = className,
name = propertyName,
@@ -77,4 +91,4 @@ function PropertyDescriptor:write(instance, value)
end
end
return PropertyDescriptor
return PropertyDescriptor

View File

@@ -251,6 +251,16 @@
},
"ty": "String"
},
"Tags": {
"value": {
"Tags": [
"foo",
"con'fusion?!",
"bar"
]
},
"ty": "Tags"
},
"UDim": {
"value": {
"UDim": [

View File

@@ -6,12 +6,10 @@ local CollectionService = game:GetService("CollectionService")
return {
Instance = {
Tags = {
read = function(instance, key)
local tagList = CollectionService:GetTags(instance)
return true, table.concat(tagList, "\0")
read = function(instance)
return true, CollectionService:GetTags(instance)
end,
write = function(instance, key, value)
write = function(instance, _, value)
local existingTags = CollectionService:GetTags(instance)
local unseenTags = {}
@@ -19,8 +17,7 @@ return {
unseenTags[tag] = true
end
local tagList = string.split(value, "\0")
for _, tag in ipairs(tagList) do
for _, tag in ipairs(value) do
unseenTags[tag] = nil
CollectionService:AddTag(instance, tag)
end
@@ -44,4 +41,4 @@ return {
end,
},
},
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -34,7 +34,7 @@ end
local BRAND_COLOR = hexColor(0xE13835)
local lightTheme = strict("LightTheme", {
BackgroundColor = hexColor(0xF0F0F0),
BackgroundColor = hexColor(0xFFFFFF),
Button = {
Solid = {
ActionFillColor = hexColor(0xFFFFFF),
@@ -67,7 +67,7 @@ local lightTheme = strict("LightTheme", {
BackgroundColor = BRAND_COLOR,
},
Inactive = {
IconColor = hexColor(0xCACACA),
IconColor = hexColor(0xEEEEEE),
BorderColor = hexColor(0xAFAFAF),
},
},
@@ -77,11 +77,11 @@ local lightTheme = strict("LightTheme", {
},
BorderedContainer = {
BorderColor = hexColor(0xCBCBCB),
BackgroundColor = hexColor(0xE0E0E0),
BackgroundColor = hexColor(0xEEEEEE),
},
Spinner = {
ForegroundColor = BRAND_COLOR,
BackgroundColor = hexColor(0xE0E0E0),
BackgroundColor = hexColor(0xEEEEEE),
},
ConnectionDetails = {
ProjectNameColor = hexColor(0x00000),
@@ -108,7 +108,7 @@ local lightTheme = strict("LightTheme", {
})
local darkTheme = strict("DarkTheme", {
BackgroundColor = hexColor(0x272727),
BackgroundColor = hexColor(0x2E2E2E),
Button = {
Solid = {
ActionFillColor = hexColor(0xFFFFFF),
@@ -147,15 +147,15 @@ local darkTheme = strict("DarkTheme", {
},
AddressEntry = {
TextColor = hexColor(0xFFFFFF),
PlaceholderColor = hexColor(0x717171)
PlaceholderColor = hexColor(0x8B8B8B)
},
BorderedContainer = {
BorderColor = hexColor(0x535353),
BackgroundColor = hexColor(0x323232),
BackgroundColor = hexColor(0x2B2B2B),
},
Spinner = {
ForegroundColor = BRAND_COLOR,
BackgroundColor = hexColor(0x323232),
BackgroundColor = hexColor(0x2B2B2B),
},
ConnectionDetails = {
ProjectNameColor = hexColor(0xFFFFFF),
@@ -236,4 +236,4 @@ return {
StudioProvider = StudioProvider,
Consumer = Context.Consumer,
with = with,
}
}

View File

@@ -0,0 +1,40 @@
--[[
Take an InstanceMap and a dictionary mapping instances to sets of property
names. Populate a patch with the encoded values of all the given properties
on all the given instances (or, if any changes set Parent to nil, removals
of instances) and return the patch.
]]
local Log = require(script.Parent.Parent.Parent.Log)
local PatchSet = require(script.Parent.Parent.PatchSet)
local encodePatchUpdate = require(script.Parent.encodePatchUpdate)
return function(instanceMap, propertyChanges)
local patch = PatchSet.newEmpty()
for instance, properties in pairs(propertyChanges) do
local instanceId = instanceMap.fromInstances[instance]
if instanceId == nil then
Log.warn("Ignoring change for instance {:?} as it is unknown to Rojo", instance)
continue
end
if properties.Parent then
if instance.Parent == nil then
table.insert(patch.removed, instanceId)
else
Log.warn("Cannot sync non-nil Parent property changes yet")
end
else
local update = encodePatchUpdate(instance, instanceId, properties)
table.insert(patch.updated, update)
end
propertyChanges[instance] = nil
end
return patch
end

View File

@@ -0,0 +1,74 @@
return function()
local PatchSet = require(script.Parent.Parent.PatchSet)
local InstanceMap = require(script.Parent.Parent.InstanceMap)
local createPatchSet = require(script.Parent.createPatchSet)
it("should return a patch", function()
local patch = createPatchSet(InstanceMap.new(), {})
assert(PatchSet.validate(patch))
end)
it("should contain updates for every instance with property changes", function()
local instanceMap = InstanceMap.new()
local part1 = Instance.new("Part")
instanceMap:insert("PART_1", part1)
local part2 = Instance.new("Part")
instanceMap:insert("PART_2", part2)
local changes = {
[part1] = {
Position = true,
Size = true,
Color = true,
},
[part2] = {
CFrame = true,
Velocity = true,
Transparency = true,
},
}
local patch = createPatchSet(instanceMap, changes)
expect(#patch.updated).to.equal(2)
end)
it("should not contain any updates for removed instances", function()
local instanceMap = InstanceMap.new()
local part1 = Instance.new("Part")
instanceMap:insert("PART_1", part1)
local changes = {
[part1] = {
Parent = true,
Position = true,
Size = true,
},
}
local patch = createPatchSet(instanceMap, changes)
expect(#patch.removed).to.equal(1)
expect(#patch.updated).to.equal(0)
end)
it("should remove instances from the property change table", function()
local instanceMap = InstanceMap.new()
local part1 = Instance.new("Part")
instanceMap:insert("PART_1", part1)
local changes = {
[part1] = {},
}
createPatchSet(instanceMap, changes)
expect(next(changes)).to.equal(nil)
end)
end

View File

@@ -0,0 +1,39 @@
local Log = require(script.Parent.Parent.Parent.Log)
local RbxDom = require(script.Parent.Parent.Parent.RbxDom)
local encodeProperty = require(script.Parent.encodeProperty)
return function(instance, instanceId, properties)
local update = {
id = instanceId,
changedProperties = {},
}
for propertyName in pairs(properties) do
if propertyName == "Name" then
update.changedName = instance.Name
else
local descriptor = RbxDom.findCanonicalPropertyDescriptor(instance.ClassName, propertyName)
if not descriptor then
Log.debug("Could not sync back property {:?}.{}", instance, propertyName)
continue
end
local encodeSuccess, encodeResult = encodeProperty(instance, propertyName, descriptor)
if not encodeSuccess then
Log.debug("Could not sync back property {:?}.{}: {}", instance, propertyName, encodeResult)
continue
end
update.changedProperties[propertyName] = encodeResult
end
end
if next(update.changedProperties) == nil and update.changedName == nil then
return nil
end
return update
end

View File

@@ -0,0 +1,62 @@
return function()
local encodePatchUpdate = require(script.Parent.encodePatchUpdate)
it("should return an update when there are property changes", function()
local part = Instance.new("Part")
local properties = {
CFrame = true,
Color = true,
}
local update = encodePatchUpdate(part, "PART", properties)
expect(update.id).to.equal("PART")
expect(update.changedProperties.CFrame).to.be.ok()
expect(update.changedProperties.Color).to.be.ok()
end)
it("should return nil when there are no property changes", function()
local part = Instance.new("Part")
local properties = {
NonExistentProperty = true,
}
local update = encodePatchUpdate(part, "PART", properties)
expect(update).to.equal(nil)
end)
it("should set changedName in the update when the instance's Name changes", function()
local part = Instance.new("Part")
local properties = {
Name = true,
}
part.Name = "We'reGettingToTheCoolPart"
local update = encodePatchUpdate(part, "PART", properties)
expect(update.changedName).to.equal("We'reGettingToTheCoolPart")
end)
it("should correctly encode property values", function()
local part = Instance.new("Part")
local properties = {
Position = true,
Color = true,
}
part.Position = Vector3.new(0, 100, 0)
part.Color = Color3.new(0.8, 0.2, 0.9)
local update = encodePatchUpdate(part, "PART", properties)
local position = update.changedProperties.Position
local color = update.changedProperties.Color
expect(position.Vector3[1]).to.equal(0)
expect(position.Vector3[2]).to.equal(100)
expect(position.Vector3[3]).to.equal(0)
expect(color.Color3[1]).to.be.near(0.8, 0.01)
expect(color.Color3[2]).to.be.near(0.2, 0.01)
expect(color.Color3[3]).to.be.near(0.9, 0.01)
end)
end

View File

@@ -0,0 +1,21 @@
local Log = require(script.Parent.Parent.Parent.Log)
local RbxDom = require(script.Parent.Parent.Parent.RbxDom)
return function(instance, propertyName, propertyDescriptor)
local readSuccess, readResult = propertyDescriptor:read(instance)
if not readSuccess then
Log.warn("Could not sync back property {:?}.{}: {}", instance, propertyName, readResult)
return false, nil
end
local dataType = propertyDescriptor.dataType
local encodeSuccess, encodeResult = RbxDom.EncodedValue.encode(readResult, dataType)
if not encodeSuccess then
Log.warn("Could not sync back property {:?}.{}: {}", instance, propertyName, encodeResult)
return false, nil
end
return true, encodeResult
end

View File

@@ -0,0 +1,81 @@
--[[
The ChangeBatcher is responsible for collecting and dispatching changes made
to tracked instances during two-way sync.
]]
local RunService = game:GetService("RunService")
local PatchSet = require(script.Parent.PatchSet)
local createPatchSet = require(script.createPatchSet)
local ChangeBatcher = {}
ChangeBatcher.__index = ChangeBatcher
local BATCH_INTERVAL = 0.2
function ChangeBatcher.new(instanceMap, onChangesFlushed)
local self
local renderSteppedConnection = RunService.RenderStepped:Connect(function(dt)
self:__cycle(dt)
end)
self = setmetatable({
__accumulator = 0,
__renderSteppedConnection = renderSteppedConnection,
__instanceMap = instanceMap,
__onChangesFlushed = onChangesFlushed,
__pendingPropertyChanges = {},
}, ChangeBatcher)
return self
end
function ChangeBatcher:stop()
self.__renderSteppedConnection:Disconnect()
self.__pendingPropertyChanges = {}
end
function ChangeBatcher:add(instance, propertyName)
local properties = self.__pendingPropertyChanges[instance]
if not properties then
properties = {}
self.__pendingPropertyChanges[instance] = properties
end
properties[propertyName] = true
end
function ChangeBatcher:__cycle(dt)
self.__accumulator += dt
if self.__accumulator >= BATCH_INTERVAL then
self.__accumulator -= BATCH_INTERVAL
local patch = self:__flush()
if patch then
self.__onChangesFlushed(patch)
end
end
self.__instanceMap:unpauseAllInstances()
end
function ChangeBatcher:__flush()
if next(self.__pendingPropertyChanges) == nil then
return nil
end
local patch = createPatchSet(self.__instanceMap, self.__pendingPropertyChanges)
if PatchSet.isEmpty(patch) then
return nil
end
return patch
end
return ChangeBatcher

View File

@@ -0,0 +1,101 @@
return function()
local ChangeBatcher = require(script.Parent)
local InstanceMap = require(script.Parent.Parent.InstanceMap)
local PatchSet = require(script.Parent.Parent.PatchSet)
local noop = function() end
describe("new", function()
it("should create a new ChangeBatcher", function()
local instanceMap = InstanceMap.new()
local changeBatcher = ChangeBatcher.new(instanceMap, noop)
expect(changeBatcher.__pendingPropertyChanges).to.be.a("table")
expect(next(changeBatcher.__pendingPropertyChanges)).to.equal(nil)
expect(changeBatcher.__onChangesFlushed).to.equal(noop)
expect(changeBatcher.__instanceMap).to.equal(instanceMap)
expect(typeof(changeBatcher.__renderSteppedConnection)).to.equal("RBXScriptConnection")
end)
end)
describe("stop", function()
it("should disconnect the RenderStepped connection", function()
local changeBatcher = ChangeBatcher.new(InstanceMap.new(), noop)
changeBatcher:stop()
expect(changeBatcher.__renderSteppedConnection.Connected).to.equal(false)
end)
end)
describe("add", function()
it("should add property changes to be considered for the current batch", function()
local instanceMap = InstanceMap.new()
local changeBatcher = ChangeBatcher.new(instanceMap, noop)
local part = Instance.new("Part")
instanceMap:insert("PART", part)
changeBatcher:add(part, "Name")
local properties = changeBatcher.__pendingPropertyChanges[part]
expect(properties).to.be.a("table")
expect(properties.Name).to.be.ok()
changeBatcher:add(part, "Position")
expect(properties.Position).to.be.ok()
end)
end)
describe("__cycle", function()
it("should immediately unpause any paused instances after each cycle", function()
local instanceMap = InstanceMap.new()
local changeBatcher = ChangeBatcher.new(instanceMap, noop)
local part = Instance.new("Part")
instanceMap.pausedUpdateInstances[part] = true
changeBatcher:__cycle(0)
expect(instanceMap.pausedUpdateInstances[part]).to.equal(nil)
end)
end)
describe("__flush", function()
it("should return nil when there are no changes to process", function()
local changeBatcher = ChangeBatcher.new(InstanceMap.new(), noop)
expect(changeBatcher:__flush()).to.equal(nil)
end)
it("should return a patch when there are changes to process and the resulting patch is non-empty", function()
local instanceMap = InstanceMap.new()
local changeBatcher = ChangeBatcher.new(instanceMap, noop)
local part = Instance.new("Part")
instanceMap:insert("PART", part)
changeBatcher.__pendingPropertyChanges[part] = {
Position = true,
Name = true,
}
local patch = changeBatcher:__flush()
assert(PatchSet.validate(patch))
end)
it("should return nil when there are changes to process and the resulting patch is empty", function()
local instanceMap = InstanceMap.new()
local changeBatcher = ChangeBatcher.new(instanceMap, noop)
local part = Instance.new("Part")
instanceMap:insert("PART", part)
changeBatcher.__pendingPropertyChanges[part] = {
NonExistentProperty = true,
}
expect(changeBatcher:__flush()).to.equal(nil)
end)
end)
end

View File

@@ -5,7 +5,7 @@ local isDevBuild = script.Parent.Parent:FindFirstChild("ROJO_DEV_BUILD") ~= nil
return strict("Config", {
isDevBuild = isDevBuild,
codename = "Epiphany",
version = {7, 0, 0, "-rc.1"},
version = {7, 0, 0, "-rc.3"},
expectedServerVersionString = "7.0 or newer",
protocolVersion = 4,
defaultHost = "localhost",

View File

@@ -1,3 +1,5 @@
local RunService = game:GetService("RunService")
local Log = require(script.Parent.Parent.Log)
--[[
@@ -135,29 +137,31 @@ function InstanceMap:destroyId(id)
end
--[[
Pause updates for an instance momentarily and invoke a callback.
If the callback throws an error, InstanceMap will still be kept in a
consistent state.
Pause updates for an instance.
]]
function InstanceMap:pauseInstance(instance, callback)
function InstanceMap:pauseInstance(instance)
local id = self.fromInstances[instance]
-- If we don't know about this instance, ignore it and do not invoke the
-- callback.
-- If we don't know about this instance, ignore it.
if id == nil then
return
end
self.pausedUpdateInstances[instance] = true
local success, result = xpcall(callback, debug.traceback)
self.pausedUpdateInstances[instance] = false
end
if success then
return result
else
error(result, 2)
end
--[[
Unpause updates for an instance.
]]
function InstanceMap:unpauseInstance(instance)
self.pausedUpdateInstances[instance] = nil
end
--[[
Unpause updates for all instances.
]]
function InstanceMap:unpauseAllInstances()
table.clear(self.pausedUpdateInstances)
end
function InstanceMap:__connectSignals(instance)
@@ -200,6 +204,12 @@ function InstanceMap:__maybeFireInstanceChanged(instance, propertyName)
return
end
if RunService:IsRunning() then
-- We probably don't want to pick up property changes to save to the
-- filesystem in a running game.
return
end
self.onInstanceChanged(instance, propertyName)
end
@@ -222,4 +232,4 @@ function InstanceMap:__disconnectSignals(instance)
end
end
return InstanceMap
return InstanceMap

View File

@@ -77,6 +77,10 @@ local function applyPatch(instanceMap, patch)
continue
end
-- Pause updates on this instance to avoid picking up our changes when
-- two-way sync is enabled.
instanceMap:pauseInstance(instance)
-- Track any part of this update that could not be applied.
local unappliedUpdate = {
id = update.id,
@@ -197,4 +201,4 @@ local function applyPatch(instanceMap, patch)
return unappliedPatch
end
return applyPatch
return applyPatch

View File

@@ -255,7 +255,7 @@ return function()
Name = "Child A",
Properties = {
Value = {
Ref = "Child B",
Ref = "CHILD_B",
},
},
Children = {},
@@ -287,7 +287,7 @@ return function()
-- constructed as part of a recursive call before the parent has totally
-- finished. Given deferred refs, this should not fail, but it is a good
-- case to test.
it("should apply properties containing refs to later siblings correctly", function()
it("should apply properties containing refs to later children correctly", function()
local virtualInstances = {
ROOT = {
ClassName = "ObjectValue",
@@ -344,4 +344,4 @@ return function()
expect(update.id).to.equal("ROOT")
expect(update.changedProperties.Value).to.equal(virtualInstances["ROOT"].Properties.Value)
end)
end
end

View File

@@ -5,6 +5,7 @@ local Log = require(script.Parent.Parent.Log)
local Fmt = require(script.Parent.Parent.Fmt)
local t = require(script.Parent.Parent.t)
local ChangeBatcher = require(script.Parent.ChangeBatcher)
local InstanceMap = require(script.Parent.InstanceMap)
local PatchSet = require(script.Parent.PatchSet)
local Reconciler = require(script.Parent.Reconciler)
@@ -56,10 +57,19 @@ function ServeSession.new(options)
-- Declare self ahead of time to capture it in a closure
local self
local function onInstanceChanged(instance, propertyName)
self:__onInstanceChanged(instance, propertyName)
if not self.__twoWaySync then
return
end
self.__changeBatcher:add(instance, propertyName)
end
local function onChangesFlushed(patch)
self.__apiContext:write(patch)
end
local instanceMap = InstanceMap.new(onInstanceChanged)
local changeBatcher = ChangeBatcher.new(instanceMap, onChangesFlushed)
local reconciler = Reconciler.new(instanceMap)
local connections = {}
@@ -82,6 +92,7 @@ function ServeSession.new(options)
__twoWaySync = options.twoWaySync,
__reconciler = reconciler,
__instanceMap = instanceMap,
__changeBatcher = changeBatcher,
__statusChangedCallback = nil,
__connections = connections,
}
@@ -179,55 +190,6 @@ function ServeSession:__onActiveScriptChanged(activeScript)
self.__apiContext:open(scriptId)
end
function ServeSession:__onInstanceChanged(instance, propertyName)
if not self.__twoWaySync then
return
end
local instanceId = self.__instanceMap.fromInstances[instance]
if instanceId == nil then
Log.warn("Ignoring change for instance {:?} as it is unknown to Rojo", instance)
return
end
local remove = nil
local update = {
id = instanceId,
changedProperties = {},
}
if propertyName == "Name" then
update.changedName = instance.Name
elseif propertyName == "Parent" then
if instance.Parent == nil then
update = nil
remove = instanceId
else
Log.warn("Cannot sync non-nil Parent property changes yet")
return
end
else
local success, encoded = self.__reconciler:encodeApiValue(instance[propertyName])
if not success then
Log.warn("Could not sync back property {:?}.{}", instance, propertyName)
return
end
update.changedProperties[propertyName] = encoded
end
local patch = {
removed = {remove},
added = {},
updated = {update},
}
self.__apiContext:write(patch)
end
function ServeSession:__initialSync(rootInstanceId)
return self.__apiContext:read({ rootInstanceId })
:andThen(function(readResponseBody)
@@ -290,6 +252,7 @@ function ServeSession:__stopInternal(err)
self:__setStatus(Status.Disconnected, err)
self.__apiContext:disconnect()
self.__instanceMap:stop()
self.__changeBatcher:stop()
for _, connection in ipairs(self.__connections) do
connection:Disconnect()
@@ -305,4 +268,4 @@ function ServeSession:__setStatus(status, detail)
end
end
return ServeSession
return ServeSession

View File

@@ -9,7 +9,7 @@
},
"TestEZ": {
"$path": "modules/testez/lib"
"$path": "modules/testez"
}
},
@@ -25,4 +25,4 @@
}
}
}
}
}

View File

@@ -1,6 +1,7 @@
---
source: tests/tests/build.rs
expression: contents
---
<roblox version="4">
<Item class="Folder" referent="0">
@@ -25,14 +26,12 @@ expression: contents
<R22>1</R22>
</CoordinateFrame>
<Ref name="PrimaryPart">null</Ref>
<BinaryString name="Tags">
</BinaryString>
<BinaryString name="Tags"></BinaryString>
</Properties>
<Item class="StringValue" referent="2">
<Properties>
<string name="Name">Cool StringValue</string>
<BinaryString name="Tags">
</BinaryString>
<BinaryString name="Tags"></BinaryString>
<string name="Value">Did you know that BaseValue.Changed is different than Instance.Changed?</string>
</Properties>
</Item>

View File

@@ -1,27 +1,25 @@
---
source: tests/tests/build.rs
expression: contents
---
<roblox version="4">
<Item class="Folder" referent="0">
<Properties>
<string name="Name">rbxmx_ref</string>
<BinaryString name="Tags">
</BinaryString>
<BinaryString name="Tags"></BinaryString>
</Properties>
<Item class="StringValue" referent="1">
<Properties>
<string name="Name">Target</string>
<BinaryString name="Tags">
</BinaryString>
<BinaryString name="Tags"></BinaryString>
<string name="Value">Pointed to by ObjectValue</string>
</Properties>
</Item>
<Item class="ObjectValue" referent="2">
<Properties>
<string name="Name">Pointer</string>
<BinaryString name="Tags">
</BinaryString>
<BinaryString name="Tags"></BinaryString>
<Ref name="Value">1</Ref>
</Properties>
</Item>

View File

@@ -1,7 +1,7 @@
use std::borrow::Borrow;
use anyhow::format_err;
use rbx_dom_weak::types::{Color3, Content, Enum, Variant, VariantType, Vector2, Vector3};
use rbx_dom_weak::types::{Color3, Content, Enum, Tags, Variant, VariantType, Vector2, Vector3};
use rbx_reflection::{DataType, PropertyDescriptor};
use serde::{Deserialize, Serialize};
@@ -32,6 +32,7 @@ impl UnresolvedValue {
pub enum AmbiguousValue {
Bool(bool),
String(String),
StringArray(Vec<String>),
Number(f64),
Array2([f64; 2]),
Array3([f64; 3]),
@@ -93,6 +94,9 @@ impl AmbiguousValue {
(VariantType::Int64, AmbiguousValue::Number(value)) => Ok((value as i64).into()),
(VariantType::String, AmbiguousValue::String(value)) => Ok(value.into()),
(VariantType::Tags, AmbiguousValue::StringArray(value)) => {
Ok(Tags::from(value).into())
}
(VariantType::Content, AmbiguousValue::String(value)) => {
Ok(Content::from(value).into())
}
@@ -129,6 +133,7 @@ impl AmbiguousValue {
match self {
AmbiguousValue::Bool(_) => "a bool",
AmbiguousValue::String(_) => "a string",
AmbiguousValue::StringArray(_) => "an array of strings",
AmbiguousValue::Number(_) => "a number",
AmbiguousValue::Array2(_) => "an array of two numbers",
AmbiguousValue::Array3(_) => "an array of three numbers",

View File

@@ -7,15 +7,16 @@ use serde::Serialize;
use crate::snapshot::{InstanceContext, InstanceMetadata, InstanceSnapshot};
use super::{meta_file::AdjacentMetadata, middleware::SnapshotInstanceResult};
use super::{meta_file::AdjacentMetadata, util::PathExt};
pub fn snapshot_csv(
_context: &InstanceContext,
vfs: &Vfs,
path: &Path,
instance_name: &str,
) -> SnapshotInstanceResult {
let meta_path = path.with_file_name(format!("{}.meta.json", instance_name));
) -> anyhow::Result<Option<InstanceSnapshot>> {
let name = path.file_name_trim_end(".csv")?;
let meta_path = path.with_file_name(format!("{}.meta.json", name));
let contents = vfs.read(path)?;
let table_contents = convert_localization_csv(&contents).with_context(|| {
@@ -26,7 +27,7 @@ pub fn snapshot_csv(
})?;
let mut snapshot = InstanceSnapshot::new()
.name(instance_name)
.name(name)
.class_name("LocalizationTable")
.properties(hashmap! {
"Contents".to_owned() => table_contents.into(),
@@ -143,14 +144,10 @@ Ack,Ack!,,An exclamation of despair,¡Ay!"#,
let mut vfs = Vfs::new(imfs);
let instance_snapshot = snapshot_csv(
&InstanceContext::default(),
&mut vfs,
Path::new("/foo.csv"),
"foo",
)
.unwrap()
.unwrap();
let instance_snapshot =
snapshot_csv(&InstanceContext::default(), &mut vfs, Path::new("/foo.csv"))
.unwrap()
.unwrap();
insta::assert_yaml_snapshot!(instance_snapshot);
}
@@ -175,14 +172,10 @@ Ack,Ack!,,An exclamation of despair,¡Ay!"#,
let mut vfs = Vfs::new(imfs);
let instance_snapshot = snapshot_csv(
&InstanceContext::default(),
&mut vfs,
Path::new("/foo.csv"),
"foo",
)
.unwrap()
.unwrap();
let instance_snapshot =
snapshot_csv(&InstanceContext::default(), &mut vfs, Path::new("/foo.csv"))
.unwrap()
.unwrap();
insta::assert_yaml_snapshot!(instance_snapshot);
}

View File

@@ -4,9 +4,13 @@ use memofs::{DirEntry, IoResultExt, Vfs};
use crate::snapshot::{InstanceContext, InstanceMetadata, InstanceSnapshot};
use super::{meta_file::DirectoryMetadata, middleware::SnapshotInstanceResult, snapshot_from_vfs};
use super::{meta_file::DirectoryMetadata, snapshot_from_vfs};
pub fn snapshot_dir(context: &InstanceContext, vfs: &Vfs, path: &Path) -> SnapshotInstanceResult {
pub fn snapshot_dir(
context: &InstanceContext,
vfs: &Vfs,
path: &Path,
) -> anyhow::Result<Option<InstanceSnapshot>> {
let passes_filter_rules = |child: &DirEntry| {
context
.path_ignore_rules

View File

@@ -9,14 +9,14 @@ use crate::{
snapshot::{InstanceContext, InstanceMetadata, InstanceSnapshot},
};
use super::{meta_file::AdjacentMetadata, middleware::SnapshotInstanceResult};
use super::{meta_file::AdjacentMetadata, util::PathExt};
pub fn snapshot_json(
context: &InstanceContext,
vfs: &Vfs,
path: &Path,
instance_name: &str,
) -> SnapshotInstanceResult {
) -> anyhow::Result<Option<InstanceSnapshot>> {
let name = path.file_name_trim_end(".json")?;
let contents = vfs.read(path)?;
let value: serde_json::Value = serde_json::from_slice(&contents)
@@ -28,10 +28,10 @@ pub fn snapshot_json(
"Source".to_owned() => as_lua.into(),
};
let meta_path = path.with_file_name(format!("{}.meta.json", instance_name));
let meta_path = path.with_file_name(format!("{}.meta.json", name));
let mut snapshot = InstanceSnapshot::new()
.name(instance_name)
.name(name)
.class_name("ModuleScript")
.properties(properties)
.metadata(
@@ -107,7 +107,6 @@ mod test {
&InstanceContext::default(),
&mut vfs,
Path::new("/foo.json"),
"foo",
)
.unwrap()
.unwrap();

View File

@@ -9,14 +9,15 @@ use crate::{
snapshot::{InstanceContext, InstanceSnapshot},
};
use super::middleware::SnapshotInstanceResult;
use super::util::PathExt;
pub fn snapshot_json_model(
context: &InstanceContext,
vfs: &Vfs,
path: &Path,
instance_name: &str,
) -> SnapshotInstanceResult {
) -> anyhow::Result<Option<InstanceSnapshot>> {
let name = path.file_name_trim_end(".model.json")?;
let contents = vfs.read(path)?;
let contents_str = str::from_utf8(&contents)
.with_context(|| format!("File was not valid UTF-8: {}", path.display()))?;
@@ -30,7 +31,7 @@ pub fn snapshot_json_model(
let mut snapshot = instance
.core
.into_snapshot(instance_name.to_owned())
.into_snapshot(name.to_owned())
.with_context(|| format!("Could not load JSON model: {}", path.display()))?;
snapshot.metadata = snapshot
@@ -135,7 +136,6 @@ mod test {
&InstanceContext::default(),
&mut vfs,
Path::new("/foo.model.json"),
"foo",
)
.unwrap()
.unwrap();

View File

@@ -6,13 +6,14 @@ use memofs::{IoResultExt, Vfs};
use crate::snapshot::{InstanceContext, InstanceMetadata, InstanceSnapshot};
use super::{
dir::snapshot_dir, meta_file::AdjacentMetadata, middleware::SnapshotInstanceResult,
util::match_trailing,
};
use super::{dir::snapshot_dir, meta_file::AdjacentMetadata, util::match_trailing};
/// Core routine for turning Lua files into snapshots.
pub fn snapshot_lua(context: &InstanceContext, vfs: &Vfs, path: &Path) -> SnapshotInstanceResult {
pub fn snapshot_lua(
context: &InstanceContext,
vfs: &Vfs,
path: &Path,
) -> anyhow::Result<Option<InstanceSnapshot>> {
let file_name = path.file_name().unwrap().to_string_lossy();
let (class_name, instance_name) = if let Some(name) = match_trailing(&file_name, ".server.lua")
@@ -63,7 +64,7 @@ pub fn snapshot_lua_init(
context: &InstanceContext,
vfs: &Vfs,
init_path: &Path,
) -> SnapshotInstanceResult {
) -> anyhow::Result<Option<InstanceSnapshot>> {
let folder_path = init_path.parent().unwrap();
let dir_snapshot = snapshot_dir(context, vfs, folder_path)?.unwrap();

View File

@@ -1,3 +0,0 @@
use crate::snapshot::InstanceSnapshot;
pub type SnapshotInstanceResult = anyhow::Result<Option<InstanceSnapshot>>;

View File

@@ -11,7 +11,6 @@ mod json;
mod json_model;
mod lua;
mod meta_file;
mod middleware;
mod project;
mod rbxm;
mod rbxmx;
@@ -22,7 +21,7 @@ use std::path::Path;
use memofs::{IoResultExt, Vfs};
use crate::snapshot::InstanceContext;
use crate::snapshot::{InstanceContext, InstanceSnapshot};
use self::{
csv::snapshot_csv,
@@ -30,12 +29,11 @@ use self::{
json::snapshot_json,
json_model::snapshot_json_model,
lua::{snapshot_lua, snapshot_lua_init},
middleware::SnapshotInstanceResult,
project::snapshot_project,
rbxm::snapshot_rbxm,
rbxmx::snapshot_rbxmx,
txt::snapshot_txt,
util::match_file_name,
util::PathExt,
};
pub use self::project::snapshot_project_node;
@@ -46,7 +44,7 @@ pub fn snapshot_from_vfs(
context: &InstanceContext,
vfs: &Vfs,
path: &Path,
) -> SnapshotInstanceResult {
) -> anyhow::Result<Option<InstanceSnapshot>> {
let meta = match vfs.metadata(path).with_not_found()? {
Some(meta) => meta,
None => return Ok(None),
@@ -75,7 +73,7 @@ pub fn snapshot_from_vfs(
snapshot_dir(context, vfs, path)
} else {
if let Some(name) = match_file_name(path, ".lua") {
if let Ok(name) = path.file_name_trim_end(".lua") {
match name {
// init scripts are handled elsewhere and should not turn into
// their own children.
@@ -83,23 +81,23 @@ pub fn snapshot_from_vfs(
_ => return snapshot_lua(context, vfs, path),
}
} else if let Some(_name) = match_file_name(path, ".project.json") {
} else if path.file_name_ends_with(".project.json") {
return snapshot_project(context, vfs, path);
} else if let Some(name) = match_file_name(path, ".model.json") {
return snapshot_json_model(context, vfs, path, name);
} else if let Some(_name) = match_file_name(path, ".meta.json") {
} else if path.file_name_ends_with(".model.json") {
return snapshot_json_model(context, vfs, path);
} else if path.file_name_ends_with(".meta.json") {
// .meta.json files do not turn into their own instances.
return Ok(None);
} else if let Some(name) = match_file_name(path, ".json") {
return snapshot_json(context, vfs, path, name);
} else if let Some(name) = match_file_name(path, ".csv") {
return snapshot_csv(context, vfs, path, name);
} else if let Some(name) = match_file_name(path, ".txt") {
return snapshot_txt(context, vfs, path, name);
} else if let Some(name) = match_file_name(path, ".rbxmx") {
return snapshot_rbxmx(context, vfs, path, name);
} else if let Some(name) = match_file_name(path, ".rbxm") {
return snapshot_rbxm(context, vfs, path, name);
} else if path.file_name_ends_with(".json") {
return snapshot_json(context, vfs, path);
} else if path.file_name_ends_with(".csv") {
return snapshot_csv(context, vfs, path);
} else if path.file_name_ends_with(".txt") {
return snapshot_txt(context, vfs, path);
} else if path.file_name_ends_with(".rbxmx") {
return snapshot_rbxmx(context, vfs, path);
} else if path.file_name_ends_with(".rbxm") {
return snapshot_rbxm(context, vfs, path);
}
Ok(None)

View File

@@ -11,13 +11,13 @@ use crate::{
},
};
use super::{middleware::SnapshotInstanceResult, snapshot_from_vfs};
use super::snapshot_from_vfs;
pub fn snapshot_project(
context: &InstanceContext,
vfs: &Vfs,
path: &Path,
) -> SnapshotInstanceResult {
) -> anyhow::Result<Option<InstanceSnapshot>> {
let project = Project::load_from_slice(&vfs.read(path)?, path)
.with_context(|| format!("File was not a valid Rojo project: {}", path.display()))?;
@@ -63,7 +63,7 @@ pub fn snapshot_project_node(
node: &ProjectNode,
vfs: &Vfs,
parent_class: Option<&str>,
) -> SnapshotInstanceResult {
) -> anyhow::Result<Option<InstanceSnapshot>> {
let project_folder = project_path.parent().unwrap();
let class_name_from_project = node

View File

@@ -5,14 +5,15 @@ use memofs::Vfs;
use crate::snapshot::{InstanceContext, InstanceMetadata, InstanceSnapshot};
use super::middleware::SnapshotInstanceResult;
use super::util::PathExt;
pub fn snapshot_rbxm(
context: &InstanceContext,
vfs: &Vfs,
path: &Path,
instance_name: &str,
) -> SnapshotInstanceResult {
) -> anyhow::Result<Option<InstanceSnapshot>> {
let name = path.file_name_trim_end(".rbxm")?;
let temp_tree = rbx_binary::from_reader(vfs.read(path)?.as_slice())
.with_context(|| format!("Malformed rbxm file: {}", path.display()))?;
@@ -21,7 +22,7 @@ pub fn snapshot_rbxm(
if children.len() == 1 {
let snapshot = InstanceSnapshot::from_tree(&temp_tree, children[0])
.name(instance_name)
.name(name)
.metadata(
InstanceMetadata::new()
.instigating_source(path)
@@ -60,7 +61,6 @@ mod test {
&InstanceContext::default(),
&mut vfs,
Path::new("/foo.rbxm"),
"foo",
)
.unwrap()
.unwrap();

View File

@@ -5,14 +5,15 @@ use memofs::Vfs;
use crate::snapshot::{InstanceContext, InstanceMetadata, InstanceSnapshot};
use super::middleware::SnapshotInstanceResult;
use super::util::PathExt;
pub fn snapshot_rbxmx(
context: &InstanceContext,
vfs: &Vfs,
path: &Path,
instance_name: &str,
) -> SnapshotInstanceResult {
) -> anyhow::Result<Option<InstanceSnapshot>> {
let name = path.file_name_trim_end(".rbxmx")?;
let options = rbx_xml::DecodeOptions::new()
.property_behavior(rbx_xml::DecodePropertyBehavior::ReadUnknown);
@@ -24,7 +25,7 @@ pub fn snapshot_rbxmx(
if children.len() == 1 {
let snapshot = InstanceSnapshot::from_tree(&temp_tree, children[0])
.name(instance_name)
.name(name)
.metadata(
InstanceMetadata::new()
.instigating_source(path)
@@ -73,7 +74,6 @@ mod test {
&InstanceContext::default(),
&mut vfs,
Path::new("/foo.rbxmx"),
"foo",
)
.unwrap()
.unwrap();

View File

@@ -6,14 +6,15 @@ use memofs::{IoResultExt, Vfs};
use crate::snapshot::{InstanceContext, InstanceMetadata, InstanceSnapshot};
use super::{meta_file::AdjacentMetadata, middleware::SnapshotInstanceResult};
use super::{meta_file::AdjacentMetadata, util::PathExt};
pub fn snapshot_txt(
context: &InstanceContext,
vfs: &Vfs,
path: &Path,
instance_name: &str,
) -> SnapshotInstanceResult {
) -> anyhow::Result<Option<InstanceSnapshot>> {
let name = path.file_name_trim_end(".txt")?;
let contents = vfs.read(path)?;
let contents_str = str::from_utf8(&contents)
.with_context(|| format!("File was not valid UTF-8: {}", path.display()))?
@@ -23,10 +24,10 @@ pub fn snapshot_txt(
"Value".to_owned() => contents_str.into(),
};
let meta_path = path.with_file_name(format!("{}.meta.json", instance_name));
let meta_path = path.with_file_name(format!("{}.meta.json", name));
let mut snapshot = InstanceSnapshot::new()
.name(instance_name)
.name(name)
.class_name("StringValue")
.properties(properties)
.metadata(
@@ -58,14 +59,10 @@ mod test {
let mut vfs = Vfs::new(imfs.clone());
let instance_snapshot = snapshot_txt(
&InstanceContext::default(),
&mut vfs,
Path::new("/foo.txt"),
"foo",
)
.unwrap()
.unwrap();
let instance_snapshot =
snapshot_txt(&InstanceContext::default(), &mut vfs, Path::new("/foo.txt"))
.unwrap()
.unwrap();
insta::assert_yaml_snapshot!(instance_snapshot);
}

View File

@@ -1,5 +1,7 @@
use std::path::Path;
use anyhow::Context;
/// If the given string ends up with the given suffix, returns the portion of
/// the string before the suffix.
pub fn match_trailing<'a>(input: &'a str, suffix: &str) -> Option<&'a str> {
@@ -11,10 +13,31 @@ pub fn match_trailing<'a>(input: &'a str, suffix: &str) -> Option<&'a str> {
}
}
/// If the given path has a file name, and that file name ends with the given
/// suffix, returns the portion of the file name before the given suffix.
pub fn match_file_name<'a>(path: &'a Path, suffix: &str) -> Option<&'a str> {
let file_name = path.file_name()?.to_str()?;
match_trailing(&file_name, suffix)
pub trait PathExt {
fn file_name_ends_with(&self, suffix: &str) -> bool;
fn file_name_trim_end<'a>(&'a self, suffix: &str) -> anyhow::Result<&'a str>;
}
impl<P> PathExt for P
where
P: AsRef<Path>,
{
fn file_name_ends_with(&self, suffix: &str) -> bool {
self.as_ref()
.file_name()
.and_then(|name| name.to_str())
.map(|name| name.ends_with(suffix))
.unwrap_or(false)
}
fn file_name_trim_end<'a>(&'a self, suffix: &str) -> anyhow::Result<&'a str> {
let path = self.as_ref();
let file_name = path
.file_name()
.and_then(|name| name.to_str())
.with_context(|| format!("Path did not have a file name: {}", path.display()))?;
match_trailing(&file_name, suffix)
.with_context(|| format!("Path did not end in {}: {}", suffix, path.display()))
}
}