mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 20:55:50 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d6e3e66ce | ||
|
|
7e4d451765 | ||
|
|
804bbc93b7 | ||
|
|
e7fe4ac3ec | ||
|
|
40c41b4400 | ||
|
|
0936c7c97d | ||
|
|
9ac537d38f | ||
|
|
fcfd55ff76 | ||
|
|
c2495ed57f | ||
|
|
6ad763fc01 |
23
CHANGES.md
23
CHANGES.md
@@ -3,6 +3,13 @@
|
|||||||
## Current master
|
## Current master
|
||||||
* *No changes*
|
* *No changes*
|
||||||
|
|
||||||
|
## 0.4.9 (May 26, 2018)
|
||||||
|
* Fixed warning when renaming or removing files that would sometimes corrupt the instance cache ([#72](https://github.com/LPGhatguy/rojo/pull/72))
|
||||||
|
* JSON models are no longer as strict -- `Children` and `Properties` are now optional.
|
||||||
|
|
||||||
|
## 0.4.8 (May 26, 2018)
|
||||||
|
* Hotfix to prevent errors from being thrown when objects managed by Rojo are deleted
|
||||||
|
|
||||||
## 0.4.7 (May 25, 2018)
|
## 0.4.7 (May 25, 2018)
|
||||||
* Added icons to the Rojo plugin, made by [@Vorlias](https://github.com/Vorlias)! ([#70](https://github.com/LPGhatguy/rojo/pull/70))
|
* Added icons to the Rojo plugin, made by [@Vorlias](https://github.com/Vorlias)! ([#70](https://github.com/LPGhatguy/rojo/pull/70))
|
||||||
* Server will now issue a warning if no partitions are specified in `rojo serve` ([#40](https://github.com/LPGhatguy/rojo/issues/40))
|
* Server will now issue a warning if no partitions are specified in `rojo serve` ([#40](https://github.com/LPGhatguy/rojo/issues/40))
|
||||||
@@ -29,11 +36,11 @@
|
|||||||
## 0.4.3 (April 7, 2018)
|
## 0.4.3 (April 7, 2018)
|
||||||
* Plugin now automatically selects `HttpService` if it determines that HTTP isn't enabled ([#58](https://github.com/LPGhatguy/rojo/pull/58))
|
* Plugin now automatically selects `HttpService` if it determines that HTTP isn't enabled ([#58](https://github.com/LPGhatguy/rojo/pull/58))
|
||||||
* Plugin now has much more robust handling and will wipe all state when the server changes.
|
* Plugin now has much more robust handling and will wipe all state when the server changes.
|
||||||
* This should fix issues that would otherwise be solved by restarting Roblox Studio.
|
* This should fix issues that would otherwise be solved by restarting Roblox Studio.
|
||||||
|
|
||||||
## 0.4.2 (April 4, 2018)
|
## 0.4.2 (April 4, 2018)
|
||||||
* Fixed final case of duplicated instance insertion, caused by reconciled instances not being inserted into `RouteMap`.
|
* Fixed final case of duplicated instance insertion, caused by reconciled instances not being inserted into `RouteMap`.
|
||||||
* The reconciler is still not a perfect solution, especially if script instances get moved around without being destroyed. I don't think this can be fixed before a big refactor.
|
* The reconciler is still not a perfect solution, especially if script instances get moved around without being destroyed. I don't think this can be fixed before a big refactor.
|
||||||
|
|
||||||
## 0.4.1 (April 1, 2018)
|
## 0.4.1 (April 1, 2018)
|
||||||
* Merged plugin repository into main Rojo repository for easier tracking.
|
* Merged plugin repository into main Rojo repository for easier tracking.
|
||||||
@@ -41,9 +48,9 @@
|
|||||||
|
|
||||||
## 0.4.0 (March 27, 2018)
|
## 0.4.0 (March 27, 2018)
|
||||||
* Protocol version 1, which shifts more responsibility onto the server
|
* Protocol version 1, which shifts more responsibility onto the server
|
||||||
* This is a **major breaking** change!
|
* This is a **major breaking** change!
|
||||||
* The server now has a content of 'filter plugins', which transform data at various stages in the pipeline
|
* The server now has a content of 'filter plugins', which transform data at various stages in the pipeline
|
||||||
* The server now exposes Roblox instance objects instead of file contents, which lines up with how `rojo pack` will work, and paves the way for more robust syncing.
|
* The server now exposes Roblox instance objects instead of file contents, which lines up with how `rojo pack` will work, and paves the way for more robust syncing.
|
||||||
* Added `*.model.json` files, which let you embed small Roblox objects into your Rojo tree.
|
* Added `*.model.json` files, which let you embed small Roblox objects into your Rojo tree.
|
||||||
* Improved error messages in some cases ([#46](https://github.com/LPGhatguy/rojo/issues/46))
|
* Improved error messages in some cases ([#46](https://github.com/LPGhatguy/rojo/issues/46))
|
||||||
|
|
||||||
@@ -53,18 +60,18 @@
|
|||||||
|
|
||||||
## 0.3.1 (December 14, 2017)
|
## 0.3.1 (December 14, 2017)
|
||||||
* Improved error reporting when invalid JSON is found in a `rojo.json` project
|
* Improved error reporting when invalid JSON is found in a `rojo.json` project
|
||||||
* These messages are passed on from Serde
|
* These messages are passed on from Serde
|
||||||
|
|
||||||
## 0.3.0 (December 12, 2017)
|
## 0.3.0 (December 12, 2017)
|
||||||
* Factored out the plugin into a separate repository
|
* Factored out the plugin into a separate repository
|
||||||
* Fixed server when using a file as a partition
|
* Fixed server when using a file as a partition
|
||||||
* Previously, trailing slashes were put on the end of a partition even if the read request was an empty string. This broke file reading on Windows when a partition pointed to a file instead of a directory!
|
* Previously, trailing slashes were put on the end of a partition even if the read request was an empty string. This broke file reading on Windows when a partition pointed to a file instead of a directory!
|
||||||
* Started running automatic tests on Travis CI (#9)
|
* Started running automatic tests on Travis CI (#9)
|
||||||
|
|
||||||
## 0.2.3 (December 4, 2017)
|
## 0.2.3 (December 4, 2017)
|
||||||
* Plugin only release
|
* Plugin only release
|
||||||
* Tightened `init` file rules to only match script files
|
* Tightened `init` file rules to only match script files
|
||||||
* Previously, Rojo would sometimes pick up the wrong file when syncing
|
* Previously, Rojo would sometimes pick up the wrong file when syncing
|
||||||
|
|
||||||
## 0.2.2 (December 1, 2017)
|
## 0.2.2 (December 1, 2017)
|
||||||
* Plugin only release
|
* Plugin only release
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<a href="https://travis-ci.org/LPGhatguy/rojo">
|
<a href="https://travis-ci.org/LPGhatguy/rojo">
|
||||||
<img src="https://api.travis-ci.org/LPGhatguy/rojo.svg?branch=master" alt="Travis-CI Build Status" />
|
<img src="https://api.travis-ci.org/LPGhatguy/rojo.svg?branch=master" alt="Travis-CI Build Status" />
|
||||||
</a>
|
</a>
|
||||||
<img src="https://img.shields.io/badge/latest_version-0.4.7-brightgreen.svg" alt="Current server version" />
|
<img src="https://img.shields.io/badge/latest_version-0.4.9-brightgreen.svg" alt="Current server version" />
|
||||||
<a href="https://lpghatguy.github.io/rojo">
|
<a href="https://lpghatguy.github.io/rojo">
|
||||||
<img src="https://img.shields.io/badge/documentation-website-brightgreen.svg" alt="Rojo Documentation" />
|
<img src="https://img.shields.io/badge/documentation-website-brightgreen.svg" alt="Rojo Documentation" />
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -26,13 +26,16 @@ Will turn into these instances in Roblox:
|
|||||||

|

|
||||||
|
|
||||||
## Models
|
## Models
|
||||||
Rojo supports a JSON model format for representing simple models. It's designed for instance types like `BindableEvent` or `*Value` objects, and is not suitable for larger models.
|
Rojo supports a JSON model format for representing simple models. It's designed for instance types like `BindableEvent` or `Value` objects, and is not suitable for larger models.
|
||||||
|
|
||||||
|
Rojo JSON models are stored in `.model.json` files.
|
||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
In the future, Rojo will support `.rbxmx` models. See [issue #7](https://github.com/LPGhatguy/rojo/issues/7) for more details and updates on this feature.
|
In the future, Rojo will support `.rbxmx` models. See [issue #7](https://github.com/LPGhatguy/rojo/issues/7) for more details and updates on this feature.
|
||||||
|
|
||||||
JSON model files are strict, with every property being required. They look like this:
|
JSON model files are fairly strict; any syntax errors will cause the model to fail to sync! They look like this:
|
||||||
|
|
||||||
|
`hello.model.json`
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"Name": "hello",
|
"Name": "hello",
|
||||||
@@ -40,14 +43,11 @@ JSON model files are strict, with every property being required. They look like
|
|||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
"Name": "Some Part",
|
"Name": "Some Part",
|
||||||
"ClassName": "Part",
|
"ClassName": "Part"
|
||||||
"Children": [],
|
|
||||||
"Properties": {}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "Some StringValue",
|
"Name": "Some StringValue",
|
||||||
"ClassName": "StringValue",
|
"ClassName": "StringValue",
|
||||||
"Children": [],
|
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"Value": {
|
"Value": {
|
||||||
"Type": "String",
|
"Type": "String",
|
||||||
@@ -55,7 +55,6 @@ JSON model files are strict, with every property being required. They look like
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"Properties": {}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
pollingRate = 0.2,
|
pollingRate = 0.2,
|
||||||
version = {0, 4, 7},
|
version = {0, 4, 9},
|
||||||
expectedServerVersionString = "0.4.x",
|
expectedServerVersionString = "0.4.x",
|
||||||
protocolVersion = 1,
|
protocolVersion = 1,
|
||||||
icons = {
|
icons = {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ function RouteMap:removeByRoute(route)
|
|||||||
local rbx = self._map[hashedRoute]
|
local rbx = self._map[hashedRoute]
|
||||||
|
|
||||||
if rbx ~= nil then
|
if rbx ~= nil then
|
||||||
self:_removeInternal(hashedRoute, rbx)
|
self:_removeInternal(rbx, hashedRoute)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ function RouteMap:removeByRbx(rbx)
|
|||||||
local hashedRoute = self._reverseMap[rbx]
|
local hashedRoute = self._reverseMap[rbx]
|
||||||
|
|
||||||
if hashedRoute ~= nil then
|
if hashedRoute ~= nil then
|
||||||
self:_removeInternal(hashedRoute, rbx)
|
self:_removeInternal(rbx, hashedRoute)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ function RouteMap:_removeInternal(rbx, hashedRoute)
|
|||||||
self._connectionsByRbx[rbx]:Disconnect()
|
self._connectionsByRbx[rbx]:Disconnect()
|
||||||
self._connectionsByRbx[rbx] = nil
|
self._connectionsByRbx[rbx] = nil
|
||||||
|
|
||||||
self:removeRbxDescendants(rbx)
|
self:_removeRbxDescendants(rbx)
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
|
|||||||
2
server/Cargo.lock
generated
2
server/Cargo.lock
generated
@@ -636,7 +636,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rojo"
|
name = "rojo"
|
||||||
version = "0.4.7"
|
version = "0.4.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rojo"
|
name = "rojo"
|
||||||
version = "0.4.7"
|
version = "0.4.9"
|
||||||
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
|
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
|
||||||
description = "A tool to create robust Roblox projects"
|
description = "A tool to create robust Roblox projects"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -9,13 +9,6 @@ pub enum TransformFileResult {
|
|||||||
// TODO: Error case
|
// TODO: Error case
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum RbxChangeResult {
|
|
||||||
Write(Option<VfsItem>),
|
|
||||||
Pass,
|
|
||||||
|
|
||||||
// TODO: Error case
|
|
||||||
}
|
|
||||||
|
|
||||||
pub enum FileChangeResult {
|
pub enum FileChangeResult {
|
||||||
MarkChanged(Option<Vec<Route>>),
|
MarkChanged(Option<Vec<Route>>),
|
||||||
Pass,
|
Pass,
|
||||||
@@ -26,10 +19,6 @@ pub trait Plugin {
|
|||||||
/// into a Roblox instance.
|
/// into a Roblox instance.
|
||||||
fn transform_file(&self, plugins: &PluginChain, vfs_item: &VfsItem) -> TransformFileResult;
|
fn transform_file(&self, plugins: &PluginChain, vfs_item: &VfsItem) -> TransformFileResult;
|
||||||
|
|
||||||
/// Invoked when a Roblox Instance change is reported by the Roblox Studio
|
|
||||||
/// plugin and needs to be turned into a file to save.
|
|
||||||
fn handle_rbx_change(&self, route: &Route, rbx_item: &RbxInstance) -> RbxChangeResult;
|
|
||||||
|
|
||||||
/// Invoked when a file changes on the filesystem. The result defines what
|
/// Invoked when a file changes on the filesystem. The result defines what
|
||||||
/// routes are marked as needing to be refreshed.
|
/// routes are marked as needing to be refreshed.
|
||||||
fn handle_file_change(&self, route: &Route) -> FileChangeResult;
|
fn handle_file_change(&self, route: &Route) -> FileChangeResult;
|
||||||
@@ -58,17 +47,6 @@ impl PluginChain {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_rbx_change(&self, route: &Route, rbx_item: &RbxInstance) -> Option<VfsItem> {
|
|
||||||
for plugin in &self.plugins {
|
|
||||||
match plugin.handle_rbx_change(route, rbx_item) {
|
|
||||||
RbxChangeResult::Write(vfs_item) => return vfs_item,
|
|
||||||
RbxChangeResult::Pass => {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
None
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn handle_file_change(&self, route: &Route) -> Option<Vec<Route>> {
|
pub fn handle_file_change(&self, route: &Route) -> Option<Vec<Route>> {
|
||||||
for plugin in &self.plugins {
|
for plugin in &self.plugins {
|
||||||
match plugin.handle_file_change(route) {
|
match plugin.handle_file_change(route) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use core::Route;
|
use core::Route;
|
||||||
use plugin::{Plugin, PluginChain, TransformFileResult, RbxChangeResult, FileChangeResult};
|
use plugin::{Plugin, PluginChain, TransformFileResult, FileChangeResult};
|
||||||
use rbx::{RbxInstance, RbxValue};
|
use rbx::{RbxInstance, RbxValue};
|
||||||
use vfs::VfsItem;
|
use vfs::VfsItem;
|
||||||
|
|
||||||
@@ -60,8 +60,4 @@ impl Plugin for DefaultPlugin {
|
|||||||
fn handle_file_change(&self, route: &Route) -> FileChangeResult {
|
fn handle_file_change(&self, route: &Route) -> FileChangeResult {
|
||||||
FileChangeResult::MarkChanged(Some(vec![route.clone()]))
|
FileChangeResult::MarkChanged(Some(vec![route.clone()]))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_rbx_change(&self, _route: &Route, _rbx_item: &RbxInstance) -> RbxChangeResult {
|
|
||||||
RbxChangeResult::Pass
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use regex::Regex;
|
|||||||
use serde_json;
|
use serde_json;
|
||||||
|
|
||||||
use core::Route;
|
use core::Route;
|
||||||
use plugin::{Plugin, PluginChain, TransformFileResult, RbxChangeResult, FileChangeResult};
|
use plugin::{Plugin, PluginChain, TransformFileResult, FileChangeResult};
|
||||||
use rbx::RbxInstance;
|
use rbx::RbxInstance;
|
||||||
use vfs::VfsItem;
|
use vfs::VfsItem;
|
||||||
|
|
||||||
@@ -48,8 +48,4 @@ impl Plugin for JsonModelPlugin {
|
|||||||
fn handle_file_change(&self, _route: &Route) -> FileChangeResult {
|
fn handle_file_change(&self, _route: &Route) -> FileChangeResult {
|
||||||
FileChangeResult::Pass
|
FileChangeResult::Pass
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_rbx_change(&self, _route: &Route, _rbx_item: &RbxInstance) -> RbxChangeResult {
|
|
||||||
RbxChangeResult::Pass
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::collections::HashMap;
|
|||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
use core::Route;
|
use core::Route;
|
||||||
use plugin::{Plugin, PluginChain, TransformFileResult, RbxChangeResult, FileChangeResult};
|
use plugin::{Plugin, PluginChain, TransformFileResult, FileChangeResult};
|
||||||
use rbx::{RbxInstance, RbxValue};
|
use rbx::{RbxInstance, RbxValue};
|
||||||
use vfs::VfsItem;
|
use vfs::VfsItem;
|
||||||
|
|
||||||
@@ -117,8 +117,4 @@ impl Plugin for ScriptPlugin {
|
|||||||
FileChangeResult::Pass
|
FileChangeResult::Pass
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_rbx_change(&self, _route: &Route, _rbx_item: &RbxInstance) -> RbxChangeResult {
|
|
||||||
RbxChangeResult::Pass
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ use std::collections::HashMap;
|
|||||||
pub struct RbxInstance {
|
pub struct RbxInstance {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub class_name: String,
|
pub class_name: String,
|
||||||
|
|
||||||
|
#[serde(default = "Vec::new")]
|
||||||
pub children: Vec<RbxInstance>,
|
pub children: Vec<RbxInstance>,
|
||||||
|
|
||||||
|
#[serde(default = "HashMap::new")]
|
||||||
pub properties: HashMap<String, RbxValue>,
|
pub properties: HashMap<String, RbxValue>,
|
||||||
|
|
||||||
/// The route that this instance was generated from, if there was one.
|
/// The route that this instance was generated from, if there was one.
|
||||||
|
|||||||
@@ -4,14 +4,11 @@
|
|||||||
"Children": [
|
"Children": [
|
||||||
{
|
{
|
||||||
"Name": "Some Part",
|
"Name": "Some Part",
|
||||||
"ClassName": "Part",
|
"ClassName": "Part"
|
||||||
"Children": [],
|
|
||||||
"Properties": {}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "Some StringValue",
|
"Name": "Some StringValue",
|
||||||
"ClassName": "StringValue",
|
"ClassName": "StringValue",
|
||||||
"Children": [],
|
|
||||||
"Properties": {
|
"Properties": {
|
||||||
"Value": {
|
"Value": {
|
||||||
"Type": "String",
|
"Type": "String",
|
||||||
@@ -19,6 +16,5 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"Properties": {}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user