Skip to content

Commit

Permalink
Fix paths in bundle (#5)
Browse files Browse the repository at this point in the history
I discovered that when consuming the package that the
`FindFirstAncestor` paths break the way Wally sets up the instance tree
vocksel authored Mar 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 29c5369 commit 4c21273
Showing 10 changed files with 28 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Build artifacts
build/

# Rojo
*.rbxl*
*.rbxm*
8 changes: 8 additions & 0 deletions .justfile
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
set dotenv-load

project_dir := absolute_path("src")
build_dir := absolute_path("build")
packages_dir := absolute_path("Packages")
test_project := "test.project.json"

@@ -19,6 +20,13 @@ build:
build-example:
rojo build example/default.project.json -o MatterReplicationExample.rbxl

build-package:
rm -rf {{ build_dir }}
mkdir {{ build_dir }}
wally package --output package.tar
tar -xvf package.tar -C {{ build_dir }}
rm package.tar

lint:
selene {{ project_dir }}
stylua --check {{ project_dir }}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"luau-lsp.sourcemap.rojoProjectFile": "default.project.json",
"luau-lsp.sourcemap.rojoProjectFile": "test.project.json",
"luau-lsp.ignoreGlobs": [
"**/_Index/**",
"**/build/**"
],
"files.associations": {
"*.luau": "lua"
}
}
}
2 changes: 1 addition & 1 deletion default.project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "MatterReplication",
"name": "matter-replication",
"tree": {
"$path": "src"
}
4 changes: 2 additions & 2 deletions example/default.project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "MatterReplication Example",
"name": "matter-replication-example",
"emitLegacyScripts": false,
"tree": {
"$className": "DataModel",
@@ -12,4 +12,4 @@
}
}
}
}
}
4 changes: 1 addition & 3 deletions src/ServerEntity.luau
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
local Root = script:FindFirstAncestor("MatterReplication")

local Matter = require(Root.Parent.Matter)
local Matter = require(script.Parent.Parent.Matter)

export type Data = {
id: number,
12 changes: 5 additions & 7 deletions src/createReplicationSystem.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
local Root = script:FindFirstAncestor("MatterReplication")

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local Freeze = require(Root.Parent.Freeze)
local Matter = require(Root.Parent.Matter)
local MatterTypes = require(Root.MatterTypes)
local ServerEntity = require(Root.ServerEntity)
local Freeze = require(script.Parent.Parent.Freeze)
local Matter = require(script.Parent.Parent.Matter)
local MatterTypes = require(script.Parent.MatterTypes)
local ServerEntity = require(script.Parent.ServerEntity)

local componentReplicated = Root.componentReplicated
local componentReplicated = script.Parent.componentReplicated

type World = MatterTypes.World
type Component = MatterTypes.Component<any>
6 changes: 2 additions & 4 deletions src/resolveServerId.luau
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
local Root = script:FindFirstAncestor("MatterReplication")

local MatterTypes = require(Root.MatterTypes)
local ServerEntity = require(Root.ServerEntity)
local MatterTypes = require(script.Parent.MatterTypes)
local ServerEntity = require(script.Parent.ServerEntity)

type World = MatterTypes.World

4 changes: 2 additions & 2 deletions test.project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "MatterReplication",
"name": "matter-replication-test",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
@@ -8,4 +8,4 @@
}
}
}
}
}
2 changes: 2 additions & 0 deletions wally.toml
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@ name = "vocksel/matter-replication"
version = "0.1.0"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"
exclude = [ "*" ]
include = [ "src", "src/**", "default.project.json", "README.md", "LICENSE", ]

[dependencies]
Matter = "matter-ecs/[email protected]"

0 comments on commit 4c21273

Please sign in to comment.