Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .luaurc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"aliases": {
"lune": "~/.lune/.typedefs/0.8.0/",
"lune": "~/.lune/.typedefs/0.8.6/",
"plugin": "plugin/src",
"server": "server/src"
}
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"**/build/**"
],
"luau-lsp.require.directoryAliases": {
"@lune/": "~/.lune/.typedefs/0.8.0/",
"@lune/": "~/.lune/.typedefs/0.8.6/",
"@root/": "plugin/src",
"@pkg/": "plugin/Packages",
"@plugin/": "plugin/src",
Expand Down
12 changes: 6 additions & 6 deletions foreman.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tools]
darklua = { source = "seaofvoices/darklua", version = "0.12.1" }
darklua = { source = "seaofvoices/darklua", version = "0.13.1" }
luau-lsp = { source = "JohnnyMorganz/luau-lsp", version = "1.32.0" }
lune = { source = "lune-org/lune", version = "0.8.0" }
rojo = { source = "rojo-rbx/rojo", version = "7.2.1" }
lune = { source = "lune-org/lune", version = "0.8.6" }
rojo = { source = "rojo-rbx/rojo", version = "7.4.1" }
run-in-roblox = { source = "rojo-rbx/run-in-roblox", version = "0.3.0" }
selene = { source = "kampfkarren/selene", version = "0.25.0" }
stylua = { source = "JohnnyMorganz/StyLua", version = "0.17.1" }
selene = { source = "Kampfkarren/selene", version = "0.27.1" }
stylua = { source = "JohnnyMorganz/StyLua", version = "0.20.0" }
tarmac = { source = "Roblox/tarmac", version = "0.7.0" }
wally = { source = "UpliftGames/wally", version = "0.3.2" }
wally-package-types = { source = "JohnnyMorganz/wally-package-types", version = "1.2.1" }
wally-package-types = { source = "JohnnyMorganz/wally-package-types", version = "1.3.2" }
1 change: 1 addition & 0 deletions plugin/.luaurc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"languageMode": "strict",
"aliases": {
"pkg": "Packages",
"root": "src"
Expand Down
4 changes: 3 additions & 1 deletion plugin/src/applyTheme.luau
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ local function applyTheme(theme: types.ExtensionTheme, studio: Studio): string?
end

local success, result = pcall(function()
studio[name] = Color3.fromHex(color)
-- Casting to `any` to clear dynamic property access warning
-- since we're already in a pcall
(studio :: any)[name] = Color3.fromHex(color)
end)

if not success then
Expand Down
8 changes: 4 additions & 4 deletions plugin/src/components/App.luau
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export type Props = {
}

local function App(_props: Props)
local view, setView = useState("Home" :: View)
local extension, setExtension = useState(nil :: PublishedExtension?)
local searchTerm, setSearchTerm = useState(nil :: string?)
local view: View, setView = useState("Home" :: View)
local extension: PublishedExtension?, setExtension = useState(nil :: PublishedExtension?)
local searchTerm: string?, setSearchTerm = useState(nil :: string?)

local onBack = useCallback(function()
setExtension(nil)
Expand All @@ -42,7 +42,7 @@ local function App(_props: Props)
})
else nil,

ThemeDetails = if view == "ThemeDetails"
ThemeDetails = if view == "ThemeDetails" and extension
then React.createElement(ThemeDetailsWrapper, {
extension = extension,
onBack = onBack,
Expand Down
7 changes: 5 additions & 2 deletions plugin/src/components/ExtensionsList.luau
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local ACTION_BUTTON_WIDTH = 120
local PADDING = UDim.new(0, 8)

local function ExtensionsList(props: Props)
local children = {
local children: { [string]: React.Node } = {
Layout = React.createElement("UIListLayout", {
Padding = PADDING,
SortOrder = Enum.SortOrder.LayoutOrder,
Expand All @@ -31,6 +31,9 @@ local function ExtensionsList(props: Props)
for i, extension in props.extensions do
local isEven = i % 2 == 0
local latestVersion = if extension.versions then extension.versions[1] else nil
local extensionName = if latestVersion
then `{extension.displayName} v{latestVersion.version}`
else extension.displayName

children[extension.extensionName] = React.createElement("Frame", {
LayoutOrder = i,
Expand Down Expand Up @@ -68,7 +71,7 @@ local function ExtensionsList(props: Props)
LayoutOrder = getLayoutOrder(),
AutomaticSize = Enum.AutomaticSize.XY,
BackgroundTransparency = 1,
Text = `{extension.displayName} v{latestVersion.version}`,
Text = extensionName,
TextSize = 16,
Font = Enum.Font.GothamMedium,
TextXAlignment = Enum.TextXAlignment.Left,
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/components/Home.luau
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type Props = {
local function Home(props: Props)
local isLoading: boolean = useMemo(function()
return #props.extensions == 0 and not props.err
end, { props.extensions, props.err })
end, { props.extensions, props.err } :: { unknown })

local onSearch = useCallback(function(rbx: TextBox, enterPressed: boolean)
if enterPressed and rbx.Text ~= "" then
Expand Down
5 changes: 4 additions & 1 deletion plugin/src/components/Home.story.luau
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ return {
version = "1.2.3",
},
},
},
} :: any,
},
onViewExtension = print,
onSearch = print,
})
end,
},
Expand All @@ -33,6 +34,7 @@ return {
return React.createElement(Home, {
extensions = {},
onViewExtension = print,
onSearch = print,
})
end,
},
Expand All @@ -44,6 +46,7 @@ return {
extensions = {},
err = "Network error occurred",
onViewExtension = print,
onSearch = print,
})
end,
},
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/components/HomeWrapper.luau
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type Props = {
local function HomeWrapper(props: Props)
local page, setPage = useState(1)
local extensions, setExtensions = useState({} :: { PublishedExtension })
local err, setErr = useState(nil :: string?)
local err: string?, setErr = useState(nil :: string?)

local onFetchMore = useCallback(function()
setPage(function(prev)
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/components/LoadingSpinner.luau
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ local function LoadingSpinner(providedProps: Props)
Image = "rbxasset://textures/DarkThemeLoadingCircle.png",
Size = UDim2.fromScale(1, 1),
BackgroundTransparency = 1,
Rotation = clock:map(function(n)
Rotation = clock:map(function(n: number)
return n * (props.speed * SPEED_MULTIPLIER)
end),
}),
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/components/ThemeDetails.luau
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local function ThemeDetails(providedProps: Props)
local props: InternalProps = Sift.Dictionary.join(defaultProps, providedProps)

local latestVersion = if props.extension.versions then props.extension.versions[1] else nil
local themeVariants = {
local themeVariants: { [string]: React.Node } = {
Layout = React.createElement("UIListLayout", {
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = PADDING,
Expand Down
3 changes: 1 addition & 2 deletions plugin/src/components/ThemeDetails.story.luau
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ return {
version = "1.2.2",
},
},
},
} :: any,
themes = themesSnapshot,
onBack = function()
print("go back")
end,
studio = {},
})
end,
}
2 changes: 1 addition & 1 deletion plugin/src/components/ThemeDetailsWrapper.luau
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type Props = {
onBack: () -> (),
}

local function ThemeDetailsWrapper(props: Props)
local function ThemeDetailsWrapper(props: Props): React.Node
local err, setErr = useState(nil :: string?)
local themes, setThemes = useState(nil :: { types.ExtensionTheme }?)

Expand Down
2 changes: 1 addition & 1 deletion plugin/src/components/ThemeDetailsWrapper.story.luau
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ return {
version = "1.2.2",
},
},
},
} :: any,
onBack = function()
print("go back")
end,
Expand Down
26 changes: 13 additions & 13 deletions plugin/src/components/ThemeLabel.luau
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type Props = {
local function ThemeLabel(props: Props)
local previewedColors = useMemo(function()
local colors = getThemeColors(props.theme)
local elements = {}
local elements: { [string]: React.Node } = {}
local count = 0

for _, colorCode in colors.found do
Expand All @@ -42,18 +42,18 @@ local function ThemeLabel(props: Props)
end
end

for i = 1, NUM_PREVIEW_COLORS do
local color = colors.found[i]

if color then
elements[tostring(color)] = React.createElement("Frame", {
LayoutOrder = i,
BackgroundColor3 = color,
Size = UDim2.fromOffset(32, 32),
BorderSizePixel = 0,
})
end
end
-- for i = 1, NUM_PREVIEW_COLORS do
-- local color = colors.found[i]

-- if color then
-- elements[tostring(color)] = React.createElement("Frame", {
-- LayoutOrder = i,
-- BackgroundColor3 = color,
-- Size = UDim2.fromOffset(32, 32),
-- BorderSizePixel = 0,
-- })
-- end
-- end

return elements
end, { props.theme })
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/components/ViewportTrigger.luau
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type Props = {
}

local function ViewportTrigger(props: Props)
local ref: { current: Frame? } = useRef()
local ref: { current: Frame? } = useRef(nil)
local screen = useScreen(ref.current)
local position: Vector2, setPosition = useState(Vector2.zero)

Expand All @@ -45,7 +45,7 @@ local function ViewportTrigger(props: Props)
end
end
return false
end, { position, screen })
end, { position, screen } :: { unknown })

local wasInBounds = usePrevious(isInBounds)

Expand Down
2 changes: 1 addition & 1 deletion plugin/src/components/stories.luau
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local getLayoutOrder = require("./getLayoutOrder")

type Story = {
name: string?,
story: (...any) -> Story,
story: (...any) -> React.Node,
}

local PADDING = 16
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/components/useCombinedSize.luau
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local useMemo = React.useMemo
local useState = React.useState

type SizeMap = {
[string]: number,
[string]: Vector2,
}

local function useCombinedSize()
Expand Down
Loading