-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into darklua
- Loading branch information
Showing
117 changed files
with
149 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.luau linguist-language=Lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
echo "Lint file extensions" | ||
files=$(find src example -iname "*.lua") | ||
if [[ -n "$files" ]]; then | ||
echo "Error: one or more files are using the '.lua' extension. Please update these to '.luau' and try again" | ||
echo "$files" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
rojo build tests.project.json -o tests.rbxl | ||
run-in-roblox --place tests.rbxl --script tests/init.server.lua | ||
run-in-roblox --place tests.rbxl --script tests/init.server.luau | ||
rm tests.rbxl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
local flipbook = script:FindFirstAncestor("flipbook") | ||
|
||
local types = require(flipbook.Explorer.types) | ||
|
||
local getTreeDescendants = require(script.Parent.getTreeDescendants) | ||
|
||
local function filterComponentTreeNode(node: types.ComponentTreeNode, filter: string): boolean | ||
if node.icon == "story" then | ||
if not node.name:lower():match(filter:lower()) then | ||
return true | ||
end | ||
|
||
return false | ||
end | ||
|
||
local isEmpty = true | ||
for _, descendant in getTreeDescendants(node) do | ||
if descendant.name:lower():match(filter:lower()) then | ||
isEmpty = false | ||
break | ||
end | ||
end | ||
|
||
return isEmpty | ||
end | ||
|
||
return filterComponentTreeNode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
local flipbook = script:FindFirstAncestor("flipbook") | ||
|
||
local types = require(flipbook.Explorer.types) | ||
|
||
return function() | ||
local filterComponentTreeNode = require(script.Parent.filterComponentTreeNode) | ||
|
||
it("should return true when the query does not match the story name", function() | ||
local target: types.ComponentTreeNode = { | ||
children = {}, | ||
name = "test", | ||
icon = "story", | ||
} | ||
local query = "other" | ||
|
||
local result = filterComponentTreeNode(target, query) | ||
expect(result).to.equal(true) | ||
end) | ||
|
||
it("should return false the query matches the story name", function() | ||
local target: types.ComponentTreeNode = { | ||
children = {}, | ||
name = "test", | ||
icon = "story", | ||
} | ||
local query = "tes" | ||
|
||
local result = filterComponentTreeNode(target, query) | ||
expect(result).to.equal(false) | ||
end) | ||
|
||
it("should return true when the filter does not match any of node in tree", function() | ||
local target: types.ComponentTreeNode = { | ||
children = { | ||
{ | ||
children = {}, | ||
name = "test", | ||
icon = "story", | ||
}, | ||
{ | ||
children = {}, | ||
name = "folder", | ||
icon = "folder", | ||
}, | ||
}, | ||
name = "storybook", | ||
icon = "storybook", | ||
} | ||
local query = "other" | ||
|
||
local result = filterComponentTreeNode(target, query) | ||
expect(result).to.equal(true) | ||
end) | ||
|
||
it("should return false when a filter match at least one of nodes in tree", function() | ||
local target: types.ComponentTreeNode = { | ||
children = { | ||
{ | ||
children = {}, | ||
name = "test", | ||
icon = "story", | ||
}, | ||
{ | ||
children = {}, | ||
name = "folder", | ||
icon = "folder", | ||
}, | ||
}, | ||
name = "storybook", | ||
icon = "storybook", | ||
} | ||
local query = "tes" | ||
|
||
local result = filterComponentTreeNode(target, query) | ||
expect(result).to.equal(false) | ||
end) | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.