forked from rojo-rbx/rojo
Compare commits
23 Commits
667683d3b3
...
v0.5.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
937c3713dd | ||
|
|
f3ba1b1f16 | ||
|
|
1c9905f6e2 | ||
|
|
e5d16e768e | ||
|
|
61dd407126 | ||
|
|
a34eeb163a | ||
|
|
1a78e9178a | ||
|
|
1659cf7a01 | ||
|
|
78d97e162c | ||
|
|
5d0aa1193f | ||
|
|
126040a87b | ||
|
|
2c408f4047 | ||
|
|
b53cda787a | ||
|
|
7b4455ed51 | ||
|
|
5b57025b0b | ||
|
|
ece454e6dd | ||
|
|
afa480b07d | ||
|
|
c9b695d533 | ||
|
|
71c77a09a6 | ||
|
|
d309a1359c | ||
|
|
b0bb486d9a | ||
|
|
2c7c3348cf | ||
|
|
4caac5e6cb |
30
.github/workflows/ci.yml
vendored
Normal file
30
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: CI
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust_version: [stable, "1.40.0"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Setup Rust toolchain
|
||||
run: rustup default ${{ matrix.rust_version }}
|
||||
|
||||
- name: Build
|
||||
run: cargo build --locked --verbose
|
||||
|
||||
- name: Run tests
|
||||
run: cargo test --locked --verbose
|
||||
|
||||
- name: Build (All Features)
|
||||
run: cargo build --locked --verbose --all-features
|
||||
|
||||
- name: Run tests (All Features)
|
||||
run: cargo test --locked --verbose --all-features
|
||||
60
.github/workflows/release.yml
vendored
Normal file
60
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["*"]
|
||||
|
||||
jobs:
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Build release binary
|
||||
run: cargo build --verbose --locked --release
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: rojo-win64
|
||||
path: target/release/rojo.exe
|
||||
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Install Rust
|
||||
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
|
||||
- name: Build release binary
|
||||
run: |
|
||||
source $HOME/.cargo/env
|
||||
cargo build --verbose --locked --release
|
||||
env:
|
||||
OPENSSL_STATIC: 1
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: rojo-macos
|
||||
path: target/release/rojo
|
||||
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Build
|
||||
run: cargo build --locked --verbose --release
|
||||
env:
|
||||
OPENSSL_STATIC: 1
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: rojo-linux
|
||||
path: target/release/rojo
|
||||
42
CHANGELOG.md
42
CHANGELOG.md
@@ -2,6 +2,48 @@
|
||||
|
||||
## Unreleased Changes
|
||||
|
||||
## [0.5.4](https://github.com/rojo-rbx/rojo/releases/tag/v0.5.4) (February 26, 2020)
|
||||
This is a general maintenance release for the Rojo 0.5.x release series.
|
||||
|
||||
* Updated reflection database and other dependencies.
|
||||
* First stable release with binaries for macOS and Linux.
|
||||
|
||||
## [0.6.0 Alpha 1](https://github.com/rojo-rbx/rojo/releases/tag/v0.6.0-alpha.1) (January 22, 2020)
|
||||
|
||||
### General
|
||||
* Added support for nested project files. ([#95](https://github.com/rojo-rbx/rojo/issues/95))
|
||||
* Added project file hot-reloading. ([#10](https://github.com/rojo-rbx/rojo/issues/10)])
|
||||
* Fixed Rojo dropping Ref properties ([#142](https://github.com/rojo-rbx/rojo/issues/142))
|
||||
* This means that properties like `PrimaryPart` now work!
|
||||
* Improved live sync protocol to reduce round-trips and improve syncing consistency.
|
||||
* Improved support for binary model files and places.
|
||||
|
||||
### Command Line
|
||||
* Added `--verbose`/`-v` flag, which can be specified multiple times to increase verbosity.
|
||||
* Added support for automatically finding Roblox Studio's auth cookie for `rojo upload` on Windows.
|
||||
* Added support for building, serving and uploading sources that aren't Rojo projects.
|
||||
* Improved feedback from `rojo serve`.
|
||||
* Removed support for legacy `roblox-project.json` projects, deprecated in an early Rojo 0.5.0 alpha.
|
||||
* Rojo no longer traverses directories upwards looking for project files.
|
||||
* Though undocumented, Rojo 0.5.x will search for a project file contained in any ancestor folders. This feature was removed to better support other 0.6.x features.
|
||||
|
||||
### Roblox Studio Plugin
|
||||
* Added "connecting" state to improve experience when live syncing.
|
||||
* Added "error" state to show errors in a place that isn't the output panel.
|
||||
* Improved diagnostics for when the Rojo plugin cannot create an instance.
|
||||
|
||||
## [0.5.3](https://github.com/rojo-rbx/rojo/releases/tag/v0.5.3) (October 15, 2019)
|
||||
* Fixed an issue where Rojo would throw an error when encountering recently-added instance classes.
|
||||
|
||||
## [0.5.2](https://github.com/rojo-rbx/rojo/releases/tag/v0.5.2) (October 14, 2019)
|
||||
* Fixed an issue where `LocalizationTable` instances would have their column order randomized. ([#173](https://github.com/rojo-rbx/rojo/issues/173))
|
||||
|
||||
## [0.5.1](https://github.com/rojo-rbx/rojo/releases/tag/v0.5.1) (October 4, 2019)
|
||||
* Fixed an issue where Rojo would drop changes if they happened too quickly ([#252](https://github.com/rojo-rbx/rojo/issues/252))
|
||||
* Improved diagnostics for when the Rojo plugin cannot create an instance.
|
||||
* Updated dependencies
|
||||
* This brings Rojo's reflection database from client release 395 to client release 404.
|
||||
|
||||
## [0.5.0](https://github.com/rojo-rbx/rojo/releases/tag/v0.5.0) (August 27, 2019)
|
||||
* Changed `.model.json` naming, which may require projects to migrate ambiguous cases:
|
||||
* The file name now takes precedence over the `Name` field in the model, like Rojo 0.4.x.
|
||||
|
||||
2070
Cargo.lock
generated
2070
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -26,12 +26,14 @@ The Rojo CLI must be run from the command line, like Terminal.app on MacOS or `c
|
||||
### Installing from Cargo
|
||||
If you have Rust installed, the easiest way to get Rojo is with Cargo!
|
||||
|
||||
To install the latest 0.5.0 alpha, use:
|
||||
To install the latest 0.5.x release, use:
|
||||
|
||||
```sh
|
||||
cargo install rojo --version 0.5.0-alpha.13
|
||||
cargo install rojo
|
||||
```
|
||||
|
||||
If you're upgrading from a previous version of Rojo, you may need to pass `--force` to tell Cargo to overwrite your existing version.
|
||||
|
||||
## Installing the Plugin
|
||||
|
||||
### Installing from GitHub
|
||||
@@ -43,4 +45,4 @@ Download the attached `rbxm` file and put it into your Roblox Studio plugins fol
|
||||
{: align="center" }
|
||||
|
||||
### Installing from Roblox.com
|
||||
Visit [Rojo's Roblox.com Plugin page](https://www.roblox.com/library/1997686364/Rojo-0-5-0-alpha-3) in Roblox Studio and press **Install**.
|
||||
Visit [Rojo's Roblox.com Plugin page](https://www.roblox.com/library/1997686364) in Roblox Studio and press **Install**.
|
||||
@@ -60,4 +60,4 @@ Unknown files are now ignored in Rojo instead of being converted to `StringValue
|
||||
## Migrating `init.model.json` files
|
||||
In Rojo 0.4.x, it's possible to create a file named `init.model.json` that lets you describe a model that becomes the container for all of the other files in the folder, just like `init.lua`.
|
||||
|
||||
In Rojo 0.5.x, this feature has been replaced with `init.meta.json` files. See [Sync Details](../reference/sync-details) for more information about these new files.
|
||||
In Rojo 0.5.x, this feature has been replaced with `init.meta.json` files. See [Sync Details](../../reference/sync-details) for more information about these new files.
|
||||
|
||||
7
docs/help.md
Normal file
7
docs/help.md
Normal file
@@ -0,0 +1,7 @@
|
||||
Rojo is a fairly complex tool to adopt, but there's a community willing to help!
|
||||
|
||||
The [Roblox Open Source Community Discord](https://discord.gg/wH5ncNS) currently hosts a Rojo support channel, **#rojo**, that is a great place to get help as problems come up.
|
||||
|
||||
If you find anything that looks like a bug or have ideas for how to improve Rojo, feel free to file an issue on [Rojo's GitHub issue tracker](https://github.com/rojo-rbx/rojo/issues).
|
||||
|
||||
Rojo's primary maintainer is also available on Twitter, [@LPGhatguy](https://twitter.com/LPGhatguy).
|
||||
@@ -1,11 +1,11 @@
|
||||
This is the documentation home for Rojo 0.5.x.
|
||||
This is the documentation home for **Rojo 0.5.x**.
|
||||
|
||||
Available versions of these docs:
|
||||
|
||||
* [Latest version (currently 0.5.x)](https://rojo.space/docs/latest)
|
||||
* [Latest version from `master` branch](https://rojo.space/docs/latest)
|
||||
* [0.5.x](https://rojo.space/docs/0.5.x)
|
||||
* [0.4.x](https://rojo.space/docs/0.4.x)
|
||||
|
||||
**Rojo** is a flexible multi-tool designed for creating robust Roblox projects.
|
||||
**Rojo** is a tool designed to enable Roblox developers to use professional-grade software engineering tools.
|
||||
|
||||
This documentation is a continual work in progress. If you find any issues, please file an issue on [Rojo's issue tracker](https://github.com/rojo-rbx/rojo/issues)!
|
||||
@@ -116,10 +116,18 @@ Meta files can contain:
|
||||
### Meta Files to set Rojo metadata
|
||||
Sometimes it's useful to apply properties like `ignoreUnknownInstances` on instances that are defined on the filesystem instead of within the project itself.
|
||||
|
||||
If your project has `hello.txt` and there are instances underneath it that you want Rojo to ignore when live-syncing, you could create `hello.meta.json` with:
|
||||
|
||||
```json
|
||||
{
|
||||
"ignoreUnknownInstances": true
|
||||
}
|
||||
```
|
||||
|
||||
### Meta Files for Disabled Scripts
|
||||
Meta files can be used to set properties on `Script` instances, like `Disabled`.
|
||||
|
||||
If your project had `foo.server.lua` and you wanted to make sure it would be disabled, you could create a `foo.meta.json` next to it with:
|
||||
If your project has `foo.server.lua` and you want to make sure it would be disabled, you could create a `foo.meta.json` next to it with:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -140,7 +148,7 @@ If you wanted to represent a tool containing a script and a model for its handle
|
||||
0, 0, 0,
|
||||
1, 0, 0,
|
||||
0, 1, 0,
|
||||
0, 0, 1,
|
||||
0, 0, 1
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ theme:
|
||||
nav:
|
||||
- Home: index.md
|
||||
- Why Rojo?: why-rojo.md
|
||||
- Get Help with Rojo: help.md
|
||||
- Guide:
|
||||
- Installation: guide/installation.md
|
||||
- Creating a Game with Rojo: guide/new-game.md
|
||||
|
||||
Submodule plugin/modules/rbx-dom updated: 6739c42beb...5bca08fec3
@@ -131,13 +131,15 @@ function ApiContext:read(ids)
|
||||
return Promise.reject("Server changed ID")
|
||||
end
|
||||
|
||||
self.messageCursor = body.messageCursor
|
||||
|
||||
return body
|
||||
end)
|
||||
end
|
||||
|
||||
function ApiContext:retrieveMessages()
|
||||
function ApiContext:retrieveMessages(initialCursor)
|
||||
if initialCursor ~= nil then
|
||||
self.messageCursor = initialCursor
|
||||
end
|
||||
|
||||
local url = ("%s/api/subscribe/%s"):format(self.baseUrl, self.messageCursor)
|
||||
|
||||
local function sendRequest()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
return {
|
||||
codename = "Epiphany",
|
||||
version = {0, 5, 0},
|
||||
version = {0, 5, 4},
|
||||
expectedServerVersionString = "0.5.0 or newer",
|
||||
protocolVersion = 2,
|
||||
defaultHost = "localhost",
|
||||
|
||||
@@ -50,6 +50,8 @@ function Reconciler:reconcile(virtualInstancesById, id, instance)
|
||||
-- If an instance changes ClassName, we assume it's very different. That's
|
||||
-- not always the case!
|
||||
if virtualInstance.ClassName ~= instance.ClassName then
|
||||
Logging.trace("Switching to reify for %s because ClassName is different", instance:GetFullName())
|
||||
|
||||
-- TODO: Preserve existing children instead?
|
||||
local parent = instance.Parent
|
||||
self.instanceMap:destroyId(id)
|
||||
@@ -93,6 +95,12 @@ function Reconciler:reconcile(virtualInstancesById, id, instance)
|
||||
unvisitedExistingChildren[existingChildInstance] = nil
|
||||
self:reconcile(virtualInstancesById, childId, existingChildInstance)
|
||||
else
|
||||
Logging.trace(
|
||||
"Switching to reify for %s.%s because it does not exist",
|
||||
instance:GetFullName(),
|
||||
virtualInstancesById[childId].Name
|
||||
)
|
||||
|
||||
self:__reify(virtualInstancesById, childId, instance)
|
||||
end
|
||||
end
|
||||
@@ -148,7 +156,13 @@ function Reconciler:__reify(virtualInstancesById, id, parent)
|
||||
|
||||
local virtualInstance = virtualInstancesById[id]
|
||||
|
||||
local instance = Instance.new(virtualInstance.ClassName)
|
||||
local ok, instance = pcall(function()
|
||||
return Instance.new(virtualInstance.ClassName)
|
||||
end)
|
||||
|
||||
if not ok then
|
||||
error(("Couldn't create an Instance of type %q, a child of %s"):format(virtualInstance.ClassName, parent:GetFullName()))
|
||||
end
|
||||
|
||||
for key, value in pairs(virtualInstance.Properties) do
|
||||
setCanonicalProperty(instance, key, rojoValueToRobloxValue(value))
|
||||
|
||||
@@ -33,7 +33,7 @@ function Session.new(config)
|
||||
end
|
||||
|
||||
self.reconciler:reconcile(response.instances, api.rootInstanceId, game)
|
||||
return self:__processMessages()
|
||||
return self:__processMessages(response.messageCursor)
|
||||
end)
|
||||
:catch(function(message)
|
||||
self.disconnected = true
|
||||
@@ -43,12 +43,12 @@ function Session.new(config)
|
||||
return not self.disconnected, setmetatable(self, Session)
|
||||
end
|
||||
|
||||
function Session:__processMessages()
|
||||
function Session:__processMessages(initialCursor)
|
||||
if self.disconnected then
|
||||
return Promise.resolve()
|
||||
end
|
||||
|
||||
return self.api:retrieveMessages()
|
||||
return self.api:retrieveMessages(initialCursor)
|
||||
:andThen(function(messages)
|
||||
local promise = Promise.resolve(nil)
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "init_meta_class_name",
|
||||
"tree": {
|
||||
"$path": "should-be-a-model"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"className": "Model"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"className": "Lighting",
|
||||
"properties": {
|
||||
"Technology": "Voxel"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "init_meta_properties",
|
||||
"tree": {
|
||||
"$path": "Lighting"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "script_meta_disabled",
|
||||
"tree": {
|
||||
"$path": "folder"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"properties": {
|
||||
"Disabled": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
-- This script should be marked 'Disabled'
|
||||
@@ -1,8 +1,4 @@
|
||||
use std::{
|
||||
fs,
|
||||
path::Path,
|
||||
process::Command,
|
||||
};
|
||||
use std::{fs, path::Path, process::Command};
|
||||
|
||||
use insta::assert_snapshot_matches;
|
||||
use tempfile::tempdir;
|
||||
@@ -27,12 +23,15 @@ gen_build_tests! {
|
||||
csv_bug_147,
|
||||
csv_in_folder,
|
||||
gitkeep,
|
||||
init_meta_class_name,
|
||||
init_meta_properties,
|
||||
json_model_in_folder,
|
||||
json_model_legacy_name,
|
||||
module_in_folder,
|
||||
module_init,
|
||||
rbxm_in_folder,
|
||||
rbxmx_in_folder,
|
||||
script_meta_disabled,
|
||||
server_in_folder,
|
||||
server_init,
|
||||
txt_in_folder,
|
||||
@@ -55,7 +54,10 @@ fn run_build_test(test_name: &str) {
|
||||
|
||||
let status = Command::new(exe_path)
|
||||
.args(&[
|
||||
"build", input_path.to_str().unwrap(), "-o", output_path.to_str().unwrap(),
|
||||
"build",
|
||||
input_path.to_str().unwrap(),
|
||||
"-o",
|
||||
output_path.to_str().unwrap(),
|
||||
])
|
||||
.env("RUST_LOG", "error")
|
||||
.current_dir(working_dir)
|
||||
@@ -64,8 +66,7 @@ fn run_build_test(test_name: &str) {
|
||||
|
||||
assert!(status.success(), "Rojo did not exit successfully");
|
||||
|
||||
let contents = fs::read_to_string(&output_path)
|
||||
.expect("Couldn't read output file");
|
||||
let contents = fs::read_to_string(&output_path).expect("Couldn't read output file");
|
||||
|
||||
assert_snapshot_matches!(test_name, contents);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Model" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">init_meta_class_name</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Lighting" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">init_meta_properties</string>
|
||||
<token name="Technology">1</token>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
created: "2019-08-10T07:45:07.961823500Z"
|
||||
creator: insta@0.10.0
|
||||
created: "2020-02-27T02:00:43.519025Z"
|
||||
creator: insta@0.10.1
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
@@ -27,12 +27,14 @@ expression: contents
|
||||
<R22>1</R22>
|
||||
</CoordinateFrame>
|
||||
<Ref name="PrimaryPart">null</Ref>
|
||||
<BinaryString name="Tags"><![CDATA[]]></BinaryString>
|
||||
<BinaryString name="Tags">
|
||||
</BinaryString>
|
||||
</Properties>
|
||||
<Item class="StringValue" referent="2">
|
||||
<Properties>
|
||||
<string name="Name">Cool StringValue</string>
|
||||
<BinaryString name="Tags"><![CDATA[]]></BinaryString>
|
||||
<BinaryString name="Tags">
|
||||
</BinaryString>
|
||||
<string name="Value">Did you know that BaseValue.Changed is different than Instance.Changed?</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">script_meta_disabled</string>
|
||||
</Properties>
|
||||
<Item class="Script" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">hello</string>
|
||||
<bool name="Disabled">true</bool>
|
||||
<string name="Source">-- This script should be marked 'Disabled'</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rojo"
|
||||
version = "0.5.0"
|
||||
version = "0.5.4"
|
||||
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
|
||||
description = "Enables professional-grade development tools for Roblox developers"
|
||||
license = "MIT"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
collections::HashMap,
|
||||
collections::{BTreeMap, HashMap},
|
||||
fmt,
|
||||
path::{Path, PathBuf},
|
||||
str,
|
||||
@@ -631,7 +631,8 @@ fn snapshot_csv_file<'source>(
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
source: Option<&'a str>,
|
||||
|
||||
values: HashMap<&'a str, &'a str>,
|
||||
// We use a BTreeMap here to get deterministic output order.
|
||||
values: BTreeMap<&'a str, &'a str>,
|
||||
}
|
||||
|
||||
let instance_name = file.path
|
||||
|
||||
@@ -73,7 +73,7 @@ impl InterfaceService {
|
||||
<h2 class="subtitle">
|
||||
"Version " { self.server_version }
|
||||
</h2>
|
||||
<a class="docs" href="https://lpghatguy.github.io/rojo">
|
||||
<a class="docs" href="https://rojo.space/docs">
|
||||
"Rojo Documentation"
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user