mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 20:55:50 +00:00
Compare commits
10 Commits
v0.4.0-pre
...
v0.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42107e0715 | ||
|
|
ed183e0805 | ||
|
|
116be16392 | ||
|
|
2c188738e6 | ||
|
|
ebffba9589 | ||
|
|
ab644c3dfa | ||
|
|
c6cdd8a815 | ||
|
|
d99df59d9b | ||
|
|
c5f8247543 | ||
|
|
72557c9d23 |
@@ -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
|
||||
|
||||
12
DESIGN.md
12
DESIGN.md
@@ -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
|
||||
21
README.md
21
README.md
@@ -1,17 +1,22 @@
|
||||
<h1 align="center">Rojo</h1>
|
||||
<div align="center">
|
||||
<img src="assets/rojo-logo.png" alt="Rojo" height="150" />
|
||||
</div>
|
||||
|
||||
<div> </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> </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
BIN
assets/rojo-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
@@ -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()),
|
||||
|
||||
14
src/rbx.rs
14
src/rbx.rs
@@ -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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"partitions": {
|
||||
"src": {
|
||||
"path": "src",
|
||||
"target": "ReplicatedStorage.TestProject"
|
||||
"target": "ReplicatedFirst"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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": {}
|
||||
}
|
||||
Reference in New Issue
Block a user