Compare commits

..

10 Commits

Author SHA1 Message Date
Lucien Greathouse
42107e0715 Update changes again, one day we'll release 0.4.0 2018-03-27 00:57:20 -07:00
Lucien Greathouse
ed183e0805 Update CHANGES, 0.4.0 2018-03-27 00:55:52 -07:00
Lucien Greathouse
116be16392 Improve error message when a partition target doesn't exist.
Closes #46
2018-03-27 00:50:44 -07:00
Lucien Greathouse
2c188738e6 Document JSON syncing and fix README typos 2018-02-21 23:48:37 -08:00
Lucien Greathouse
ebffba9589 Add bi-directional syncing note from Quenty 2018-02-04 08:55:19 -08:00
Lucien Greathouse
ab644c3dfa Update model.json example 2018-02-04 07:31:33 -08:00
Lucien Greathouse
c6cdd8a815 Change test project to test another edge case 2018-02-04 07:26:30 -08:00
Lucien Greathouse
d99df59d9b 'Wildcard' type in DefaultPlugin, change to PascalCase in API 2018-02-04 07:10:59 -08:00
Lucien Greathouse
c5f8247543 Add support for Bool and Number primitive types. 2018-02-03 23:16:29 -08:00
Lucien Greathouse
72557c9d23 Hip logo, totally not riffing on Babel 2018-01-29 15:57:10 -08:00
9 changed files with 66 additions and 33 deletions

View File

@@ -1,10 +1,15 @@
# Rojo Change Log
## Current Master (0.4.0)
* Began protocol version 1, which shifts more responsibility onto the server
## Current Master
*No changes*
## 0.4.0
* Protocol version 1, which shifts more responsibility onto the server
* 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 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.
* Improved error messages in some cases ([#46](https://github.com/LPGhatguy/rojo/issues/46))
## 0.3.2
* Fixed `rojo serve` failing to correctly construct an absolute root path when passed as an argument

View File

@@ -36,4 +36,14 @@ The plan is to have several built-in plugins that can be rearranged/configured i
* User passes a binary name (like `moonc`) that modifies file contents
## Roblox Studio Plugin
With the protocol version 1 change, the Roblox Studio plugin got a lot simpler. Notably, the plugin doesn't need to be aware of anything about the filesystem's semantics, which is super handy.
With the protocol version 1 change, the Roblox Studio plugin got a lot simpler. Notably, the plugin doesn't need to be aware of anything about the filesystem's semantics, which is super handy.
## Bi-directional syncing
Quenty laid out a good way to handle bi-directional syncing.
When receiving a change from the plugin:
1. Hash the new contents of the file, store it in a map from routes to hashes
2. Write the new file contents to the filesystem
3. Later down the line, receive a change event from the filesystem watcher
4. When receiving a change, if the item is in the hash map, read it and hash those contents
5. If the hash matches the last noted hash, discard the change, else continue as normal

View File

@@ -1,17 +1,22 @@
<h1 align="center">Rojo</h1>
<div align="center">
<img src="assets/rojo-logo.png" alt="Rojo" height="150" />
</div>
<div>&nbsp;</div>
<div align="center">
<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" />
</a>
</div>
<div>&nbsp;</div>
<hr />
Rojo is a flexible multi-tool designed for creating robust Roblox projects. It's in early development, but is still useful for many projects.
**Rojo** is a flexible multi-tool designed for creating robust Roblox projects. It's in early development, but is still useful for many projects.
It's designed for power users who want to use the **best tools available** for building games, libraries, and plugins.
This is the main Rojo repository, containing the binary server component. For the source for the Roblox plugin, [see the rojo-plugin repository](https://github.com/LPGhatguy/rojo-plugin).
This is the main Rojo repository, containing the binary and project server component. For the source for the Roblox plugin, [see the rojo-plugin repository](https://github.com/LPGhatguy/rojo-plugin).
The master branches of both respositories should always pass all tests and be functional, but are not suitable for production use!
@@ -21,10 +26,11 @@ Rojo has a number of desirable features *right now*:
* Work on scripts from the filesystem, in your favorite editor
* Version your place, library, or plugin using Git or another VCS
* Sync JSON-format models from the filesystem into your game
Soon, Rojo will be able to:
Later this year, Rojo will be able to:
* Sync Roblox objects (including models) bi-directionally between the filesystem and Roblox Studio
* Sync rbxmx-format Roblox models bi-directionally between the filesystem and Roblox Studio
* Create installation scripts for libraries to be used in standalone places
* Similar to [rbxpacker](https://github.com/LPGhatguy/rbxpacker), another one of my projects
* Add strongly-versioned dependencies to your project
@@ -98,7 +104,7 @@ For example, if you want to map your `src` directory to an object named `My Cool
The `path` parameter is relative to the project file.
The `target` starts at `game` and crawls down the tree. If any objects don't exist along the way, they'll be created as `Folder` instances.
The `target` parameter is a path to a Roblox object to link the partition to. It starts at `game` and crawls down the tree. If any objects don't exist along the way, they'll be created as `Folder` instances.
Run `rojo serve` in the directory containing this project, then press the "Sync In" or "Toggle Polling" buttons in the Roblox Studio plugin to move code into your game.
@@ -112,6 +118,7 @@ Creation of Roblox instances follows a simple set of rules. The first rule that
| `*.server.lua` | `Script` | `Source` will contain the file's contents |
| `*.client.lua` | `LocalScript` | `Source` will contain the file's contents |
| `*.lua` | `ModuleScript` | `Source` will contain the file's contents |
| `*.model.json` | *Varies* | See [this file](test-project/src/hello.model.json) for an example model |
| `*` | `StringValue` | `Value` will contain the file's contents |
Any folders on the filesystem will turn into `Folder` objects unless they contain a file named `init.lua`, `init.server.lua`, or `init.client.lua`. Following the convention of Lua, those objects will instead be whatever the `init` file would turn into.

BIN
assets/rojo-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -48,7 +48,7 @@ impl Plugin for DefaultPlugin {
TransformFileResult::Value(Some(RbxInstance {
name: vfs_item.name().clone(),
class_name: "Folder".to_string(),
class_name: "*".to_string(),
children: rbx_children,
properties: HashMap::new(),
route: Some(vfs_item.route().to_vec()),

View File

@@ -2,7 +2,7 @@ use std::collections::HashMap;
/// Represents data about a Roblox instance
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[serde(rename_all = "PascalCase")]
pub struct RbxInstance {
pub name: String,
pub class_name: String,
@@ -15,12 +15,20 @@ pub struct RbxInstance {
/// Any kind value that can be used by Roblox
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", tag = "type")]
#[serde(rename_all = "PascalCase", tag = "Type")]
pub enum RbxValue {
#[serde(rename_all = "PascalCase")]
String {
value: String,
},
#[serde(rename_all = "PascalCase")]
Bool {
value: bool,
},
#[serde(rename_all = "PascalCase")]
Number {
value: f64,
},
// TODO: Other primitives
// TODO: Compound types like Vector3
}

View File

@@ -78,11 +78,14 @@ impl VfsWatcher {
let (tx, rx) = mpsc::channel();
let mut watcher: RecommendedWatcher = Watcher::new(tx, Duration::from_secs(1))
.expect("Unable to create watcher!");
.expect("Unable to create watcher! This is a bug in Rojo.");
watcher
.watch(&root_path, RecursiveMode::Recursive)
.expect("Unable to watch path!");
match watcher.watch(&root_path, RecursiveMode::Recursive) {
Ok(_) => (),
Err(_) => {
panic!("Unable to watch partition {}, with path {}! Make sure that it's a file or directory.", partition_name, root_path.display());
},
}
watchers.push(watcher);

View File

@@ -4,7 +4,7 @@
"partitions": {
"src": {
"path": "src",
"target": "ReplicatedStorage.TestProject"
"target": "ReplicatedFirst"
}
}
}

View File

@@ -1,24 +1,24 @@
{
"name": "hello",
"className": "Model",
"children": [
"Name": "hello",
"ClassName": "Model",
"Children": [
{
"name": "Some Part",
"className": "Part",
"children": [],
"properties": {}
"Name": "Some Part",
"ClassName": "Part",
"Children": [],
"Properties": {}
},
{
"name": "Some StringValue",
"className": "StringValue",
"children": [],
"properties": {
"Name": "Some StringValue",
"ClassName": "StringValue",
"Children": [],
"Properties": {
"Value": {
"type": "string",
"value": "Hello, world!"
"Type": "String",
"Value": "Hello, world!"
}
}
}
],
"properties": {}
"Properties": {}
}