mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 20:55:50 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cafb547894 | ||
|
|
35543c2790 | ||
|
|
88efdb5ba4 | ||
|
|
eeff7cfd92 | ||
|
|
f66cbe0049 | ||
|
|
d0c6f2a470 | ||
|
|
34d5de9f2c | ||
|
|
16676ebfa1 |
12
.gitmodules
vendored
Normal file
12
.gitmodules
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
[submodule "modules/Roact"]
|
||||
path = modules/Roact
|
||||
url = https://github.com/Roblox/Roact.git
|
||||
[submodule "modules/Rodux"]
|
||||
path = modules/Rodux
|
||||
url = https://github.com/Roblox/Rodux.git
|
||||
[submodule "modules/RoactRodux"]
|
||||
path = modules/RoactRodux
|
||||
url = https://github.com/Roblox/RoactRodux.git
|
||||
[submodule "modules/TestEZ"]
|
||||
path = modules/TestEZ
|
||||
url = https://github.com/Roblox/TestEZ.git
|
||||
@@ -3,6 +3,11 @@
|
||||
## Current Master
|
||||
* *No changes*
|
||||
|
||||
## 0.2.3
|
||||
* Plugin only release
|
||||
* Tightened `init` file rules to only match script files
|
||||
* Previously, Rojo would sometimes pick up the wrong file when syncing
|
||||
|
||||
## 0.2.2
|
||||
* Plugin only release
|
||||
* Fixed broken reconciliation behavior with `init` files
|
||||
|
||||
@@ -110,27 +110,28 @@ Creation of Roblox instances follows a simple set of rules. The first rule that
|
||||
| `*.lua` | `ModuleScript` | `Source` will contain the file's contents |
|
||||
| `*` | `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` with any extension. Following the convention of Lua, those objects will instead be whatever the `init` file would turn into.
|
||||
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.
|
||||
|
||||
For example, this file tree:
|
||||
|
||||
* my-game
|
||||
* init.lua
|
||||
* init.client.lua
|
||||
* foo.lua
|
||||
|
||||
Will turn into this tree in Roblox:
|
||||
|
||||
* `my-game` (`ModuleScript` with source from `my-game/init.lua`)
|
||||
* `my-game` (`LocalScript` with source from `my-game/init.client.lua`)
|
||||
* `foo` (`ModuleScript` with source from `my-game/foo.lua`)
|
||||
|
||||
## Inspiration
|
||||
There are lots of other tools that sync scripts into Roblox, or otherwise work to improve the development flow outside of Roblox Studio.
|
||||
|
||||
Here are a few, if you're looking for alternatives or supplements to Rojo:
|
||||
* [rbxmk by Anaminus](https://github.com/anaminus/rbxmk)
|
||||
* [Studio Bridge by Vocksel](https://github.com/vocksel/studio-bridge)
|
||||
* [RbxRefresh by Osyris](https://github.com/osyrisrblx/RbxRefresh)
|
||||
* [RbxSync by evaera](https://github.com/evaera/RbxSync)
|
||||
* [CodeSync](https://github.com/MemoryPenguin/CodeSync) and [rbx-exteditor](https://github.com/MemoryPenguin/rbx-exteditor) by [MemoryPenguin](https://github.com/MemoryPenguin)
|
||||
* [rbxmk by Anaminus](https://github.com/anaminus/rbxmk)
|
||||
|
||||
I also have a couple tools that Rojo intends to replace:
|
||||
* [rbxfs](https://github.com/LPGhatguy/rbxfs), which has been deprecated by Rojo
|
||||
|
||||
1
modules/Roact
Submodule
1
modules/Roact
Submodule
Submodule modules/Roact added at 7cce62b130
1
modules/RoactRodux
Submodule
1
modules/RoactRodux
Submodule
Submodule modules/RoactRodux added at 43c4f347fe
1
modules/Rodux
Submodule
1
modules/Rodux
Submodule
Submodule modules/Rodux added at 6c573259ab
1
modules/TestEZ
Submodule
1
modules/TestEZ
Submodule
Submodule modules/TestEZ added at 9945f562e5
@@ -51,6 +51,6 @@ files["**/*.server.lua"] = {
|
||||
std = "+plugin",
|
||||
}
|
||||
|
||||
files["**/*-spec.lua"] = {
|
||||
files["**/*.spec.lua"] = {
|
||||
std = "+testez",
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
return {
|
||||
pollingRate = 0.3,
|
||||
version = "0.2.2",
|
||||
version = "v0.2.3",
|
||||
dev = false,
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ local Config = require(script.Parent.Config)
|
||||
local function main()
|
||||
local pluginInstance = Plugin.new()
|
||||
|
||||
local toolbar = plugin:CreateToolbar("Rojo Plugin v" .. Config.version)
|
||||
local displayedVersion = Config.dev and "DEV" or Config.version
|
||||
|
||||
local toolbar = plugin:CreateToolbar("Rojo Plugin " .. displayedVersion)
|
||||
|
||||
toolbar:CreateButton("Test Connection", "Connect to Rojo Server", "")
|
||||
.Click:Connect(function()
|
||||
|
||||
@@ -19,7 +19,7 @@ Plugin.__index = Plugin
|
||||
|
||||
function Plugin.new()
|
||||
local address = "localhost"
|
||||
local port = 8000
|
||||
local port = Config.dev and 8001 or 8000
|
||||
|
||||
local remote = ("http://%s:%d"):format(address, port)
|
||||
|
||||
|
||||
@@ -1,13 +1,27 @@
|
||||
local Reconciler = {}
|
||||
|
||||
--[[
|
||||
The set of file names that should pass as init files
|
||||
These files usurp their parents.
|
||||
]]
|
||||
local initNames = {
|
||||
["init.lua"] = true,
|
||||
["init.server.lua"] = true,
|
||||
["init.client.lua"] = true,
|
||||
}
|
||||
|
||||
local function isInit(item, itemFileName)
|
||||
if item and item.type == "dir" then
|
||||
return
|
||||
end
|
||||
|
||||
return not not itemFileName:find("^init%.")
|
||||
return initNames[itemFileName] or false
|
||||
end
|
||||
|
||||
--[[
|
||||
Determines if the given VFS item has an init file. Yields information about
|
||||
the file.
|
||||
]]
|
||||
local function findInit(item)
|
||||
if item.type ~= "dir" then
|
||||
return nil, nil
|
||||
@@ -22,6 +36,12 @@ local function findInit(item)
|
||||
return nil, nil
|
||||
end
|
||||
|
||||
--[[
|
||||
Given a VFS item, returns a Name and ClassName for a corresponding Roblox
|
||||
instance.
|
||||
|
||||
Doesn't take into account init files.
|
||||
]]
|
||||
local function itemToName(item, fileName)
|
||||
if item and item.type == "dir" then
|
||||
return fileName, "Folder"
|
||||
@@ -40,6 +60,10 @@ local function itemToName(item, fileName)
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
Given a VFS item, assigns all relevant values (except Name!) to a Roblox
|
||||
instance.
|
||||
]]
|
||||
local function setValues(rbx, item, fileName)
|
||||
local _, className = itemToName(item, fileName)
|
||||
|
||||
@@ -79,6 +103,9 @@ function Reconciler._reifyShallow(item, fileName)
|
||||
end
|
||||
end
|
||||
|
||||
--[[
|
||||
Construct a new Roblox instance tree that corresponds to the given VFS item.
|
||||
]]
|
||||
function Reconciler._reify(item, fileName, parent)
|
||||
local rbx = Reconciler._reifyShallow(item, fileName)
|
||||
|
||||
|
||||
4
plugin/src/runTests.lua
Normal file
4
plugin/src/runTests.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return function()
|
||||
local TestEZ = require(script.Parent.Parent.TestEZ)
|
||||
TestEZ.TestBootstrap:run(script.Parent)
|
||||
end
|
||||
18
rojo.json
18
rojo.json
@@ -4,7 +4,23 @@
|
||||
"partitions": {
|
||||
"plugin": {
|
||||
"path": "plugin/src",
|
||||
"target": "ReplicatedStorage.Rojo Plugin"
|
||||
"target": "ReplicatedStorage.Rojo"
|
||||
},
|
||||
"modules/Roact": {
|
||||
"path": "modules/Roact/lib",
|
||||
"target": "ReplicatedStorage.Rojo.modules.Roact"
|
||||
},
|
||||
"modules/Rodux": {
|
||||
"path": "modules/Rodux/lib",
|
||||
"target": "ReplicatedStorage.Rojo.modules.Rodux"
|
||||
},
|
||||
"modules/RoactRodux": {
|
||||
"path": "modules/RoactRodux/lib",
|
||||
"target": "ReplicatedStorage.Rojo.modules.RoactRodux"
|
||||
},
|
||||
"modules/TestEZ": {
|
||||
"path": "modules/TestEZ/lib",
|
||||
"target": "ReplicatedStorage.TestEZ"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
-- meh/init.lua
|
||||
10
test-project/rojo.json
Normal file
10
test-project/rojo.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "test-project",
|
||||
"servePort": 8001,
|
||||
"partitions": {
|
||||
"src": {
|
||||
"path": "src",
|
||||
"target": "ReplicatedStorage.TestProject"
|
||||
}
|
||||
}
|
||||
}
|
||||
0
test-project/src/meh/init.lua
Normal file
0
test-project/src/meh/init.lua
Normal file
Reference in New Issue
Block a user