Compare commits

..

9 Commits

Author SHA1 Message Date
Lucien Greathouse
fb7bfa928a Release 0.4.11 2018-06-10 15:54:57 -07:00
Lucien Greathouse
100d69262c Update CHANGES 2018-06-10 15:52:42 -07:00
Lucien Greathouse
5e01658846 Remove straggling debug message 2018-06-10 15:50:30 -07:00
Lucien Greathouse
ccec93aee8 Untangle route terminology a bit 2018-06-10 15:50:03 -07:00
Lucien Greathouse
a089d82023 Fix incorrect route being assigned to init.lua and init.model.json files 2018-06-10 15:44:56 -07:00
Lucien Greathouse
82ba583fa0 Fix incorrect synchronization for Plugin:_pull that would make polling flaky 2018-06-10 15:13:49 -07:00
Lucien Greathouse
1b82044d7d Defensively insert existing instances into RouteMap 2018-06-10 15:03:36 -07:00
Lucien Greathouse
0d49a2e0af Mention VS Code extension in getting started guide 2018-06-02 01:04:31 -07:00
Lucien Greathouse
1343d3a2a9 Pick up rest of changes for 0.4.10, oops 2018-06-02 00:50:35 -07:00
10 changed files with 53 additions and 32 deletions

View File

@@ -1,6 +1,15 @@
# Rojo Change Log
## Current master
* *No changes*
## 0.4.11 (June 10, 2018)
* Defensively insert existing instances into RouteMap; should fix most duplication cases when syncing into existing trees.
* Fixed incorrect synchronization from `Plugin:_pull` that would cause polling to create issues
* Fixed incorrect file routes being assigned to `init.lua` and `init.model.json` files
* Untangled route handling-internals slightly
## 0.4.10 (June 2, 2018)
* Added support for `init.model.json` files, which enable versioning `Tool` instances (among other things) with Rojo. ([#66](https://github.com/LPGhatguy/rojo/issues/66))
* Fixed obscure error when syncing into an invalid service.
* Fixed multiple sync processes occurring when a server ID mismatch is detected.

View File

@@ -8,7 +8,7 @@
<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>
<img src="https://img.shields.io/badge/latest_version-0.4.9-brightgreen.svg" alt="Current server version" />
<img src="https://img.shields.io/badge/latest_version-0.4.11-brightgreen.svg" alt="Current server version" />
<a href="https://lpghatguy.github.io/rojo">
<img src="https://img.shields.io/badge/documentation-website-brightgreen.svg" alt="Rojo Documentation" />
</a>

View File

@@ -20,4 +20,7 @@ To install the plugin, either:
* Install the plugin from the [Roblox plugin page](https://www.roblox.com/library/1211549683/Rojo).
* This gives you less control over what version you install -- you will always have the latest version.
* Or, download the latest release from [the GitHub releases section](https://github.com/LPGhatguy/rojo/releases) and install it into your Roblox plugins folder
* You can open this folder by clicking the "Plugins Folder" button from the Plugins toolbar in Roblox Studio
* You can open this folder by clicking the "Plugins Folder" button from the Plugins toolbar in Roblox Studio
## Visual Studio Code Extension
If you use Visual Studio Code on Windows, you can install [Evaera's unofficial Rojo extension](https://marketplace.visualstudio.com/items?itemName=evaera.vscode-rojo), which will install both halves of Rojo for you. It even has a nifty UI to add partitions and start/stop the Rojo server!

View File

@@ -1,6 +1,6 @@
return {
pollingRate = 0.2,
version = {0, 4, 9},
version = {0, 4, 11},
expectedServerVersionString = "0.4.x",
protocolVersion = 1,
icons = {

View File

@@ -169,38 +169,34 @@ function Plugin:stopPolling()
return Promise.resolve(true)
end
function Plugin:_pull(api, project, routes)
return api:read(routes)
function Plugin:_pull(api, project, fileRoutes)
return api:read(fileRoutes)
:andThen(function(items)
for index = 1, #routes do
local itemRoute = routes[index]
local partitionName = itemRoute[1]
for index = 1, #fileRoutes do
local fileRoute = fileRoutes[index]
local partitionName = fileRoute[1]
local partition = project.partitions[partitionName]
local item = items[index]
local partitionRoute = collectMatch(partition.target, "[^.]+")
local partitionTargetRbxRoute = collectMatch(partition.target, "[^.]+")
-- If the item route's length was 1, we need to rename the instance to
-- line up with the partition's root object name.
--
-- This is a HACK!
if #itemRoute == 1 then
if item then
local objectName = partition.target:match("[^.]+$")
item.Name = objectName
end
if item ~= nil and #fileRoute == 1 then
local objectName = partition.target:match("[^.]+$")
item.Name = objectName
end
local fullRoute = {}
for _, piece in ipairs(partitionRoute) do
table.insert(fullRoute, piece)
local itemRbxRoute = {}
for _, piece in ipairs(partitionTargetRbxRoute) do
table.insert(itemRbxRoute, piece)
end
for i = 2, #itemRoute do
table.insert(fullRoute, itemRoute[i])
for i = 2, #fileRoute do
table.insert(itemRbxRoute, fileRoute[i])
end
self._reconciler:reconcileRoute(fullRoute, item, itemRoute)
self._reconciler:reconcileRoute(itemRbxRoute, item, fileRoute)
end
end)
end
@@ -283,15 +279,20 @@ function Plugin:syncIn()
return Promise.reject(info)
end
local routes = {}
local fileRoutes = {}
for name in pairs(info.project.partitions) do
table.insert(routes, {name})
table.insert(fileRoutes, {name})
end
self:_pull(api, info.project, routes)
local pullSuccess, pullResult = self:_pull(api, info.project, fileRoutes):await()
self._syncInProgress = false
if not pullSuccess then
return Promise.reject(pullResult)
end
print("Rojo: Sync successful!")
end)
:catch(function(err)

View File

@@ -190,18 +190,24 @@ function Reconciler:reconcile(rbx, item)
return self:_reify(item)
end
-- It's possible that the instance we're associating with this item hasn't
-- been inserted into the RouteMap yet.
if item.Route ~= nil then
self._routeMap:insert(item.Route, rbx)
end
applyProperties(rbx, item.Properties)
self:_reconcileChildren(rbx, item)
return rbx
end
function Reconciler:reconcileRoute(route, item, itemRoute)
function Reconciler:reconcileRoute(rbxRoute, item, fileRoute)
local parent
local rbx = game
for i = 1, #route do
local piece = route[i]
for i = 1, #rbxRoute do
local piece = rbxRoute[i]
local child = rbx:FindFirstChild(piece)
@@ -217,7 +223,7 @@ function Reconciler:reconcileRoute(route, item, itemRoute)
end
-- We don't want to create a folder if we're reaching our target item!
if child == nil and i ~= #route then
if child == nil and i ~= #rbxRoute then
child = Instance.new("Folder")
child.Parent = rbx
child.Name = piece
@@ -229,7 +235,7 @@ function Reconciler:reconcileRoute(route, item, itemRoute)
-- Let's check the route map!
if rbx == nil then
rbx = self._routeMap:get(itemRoute)
rbx = self._routeMap:get(fileRoute)
end
rbx = self:reconcile(rbx, item)

2
server/Cargo.lock generated
View File

@@ -636,7 +636,7 @@ dependencies = [
[[package]]
name = "rojo"
version = "0.4.10"
version = "0.4.11"
dependencies = [
"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)",

View File

@@ -1,6 +1,6 @@
[package]
name = "rojo"
version = "0.4.10"
version = "0.4.11"
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
description = "A tool to create robust Roblox projects"
license = "MIT"

View File

@@ -59,6 +59,7 @@ impl Plugin for JsonModelPlugin {
rbx_item.name.clear();
rbx_item.name.push_str(vfs_item.name());
rbx_item.route = Some(vfs_item.route().to_vec());
for (child_name, child_item) in children {
if child_name == init_item.name() {

View File

@@ -79,6 +79,7 @@ impl Plugin for ScriptPlugin {
rbx_item.name.clear();
rbx_item.name.push_str(vfs_item.name());
rbx_item.route = Some(vfs_item.route().to_vec());
for (child_name, child_item) in children {
if child_name == init_item.name() {