Skip to content

Commit

Permalink
Bump Storyteller to 0.4.3 and fix remaining analysis errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vocksel committed Nov 16, 2024
1 parent b561205 commit 742bdc6
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ type Controls = {
isDisabled: boolean,
}

type Props = Storyteller.StoryProps<Controls>
type Props = {
controls: typeof(controls),
}

local story: Storyteller.Story<any> = {
controls = controls,
Expand Down
2 changes: 1 addition & 1 deletion code-samples/wally.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Fusion = "elttob/[email protected]"
React = "jsdotlua/[email protected]"
ReactRoblox = "jsdotlua/[email protected]"
Roact = "roblox/[email protected]"
Storyteller = "flipbook-labs/[email protected].2"
Storyteller = "flipbook-labs/[email protected].3"
4 changes: 2 additions & 2 deletions src/Explorer/types.luau
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
local Storyteller = require("@pkg/Storyteller")

type Storybook = Storyteller.Storybook
type LoadedStorybook = Storyteller.LoadedStorybook

export type ComponentTreeNode = {
name: string,
children: { ComponentTreeNode },
icon: ("folder" | "story" | "storybook")?,
instance: Instance?,
storybook: Storybook?,
storybook: LoadedStorybook?,
}

return nil
6 changes: 3 additions & 3 deletions src/Panels/Sidebar.luau
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ local createStoryNodes = require("@root/Storybook/createStoryNodes")
local explorerTypes = require("@root/Explorer/types")
local useTheme = require("@root/Common/useTheme")

type Storybook = Storyteller.Storybook
type LoadedStorybook = Storyteller.LoadedStorybook
type ComponentTreeNode = explorerTypes.ComponentTreeNode

local e = React.createElement

type Props = {
layoutOrder: number?,
selectStory: (ModuleScript) -> (),
selectStorybook: (Storybook) -> (),
storybooks: { Storybook },
selectStorybook: (LoadedStorybook) -> (),
storybooks: { LoadedStorybook },
}

local function Sidebar(props: Props)
Expand Down
6 changes: 3 additions & 3 deletions src/Storybook/createStoryNodes.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local Storyteller = require("@pkg/Storyteller")

local explorerTypes = require("@root/Explorer/types")

type Storybook = Storyteller.Storybook
type LoadedStorybook = Storyteller.LoadedStorybook
type ComponentTreeNode = explorerTypes.ComponentTreeNode

local function hasStories(instance: Instance): boolean
Expand All @@ -14,7 +14,7 @@ local function hasStories(instance: Instance): boolean
return false
end

local function createChildNodes(parent: ComponentTreeNode, instance: Instance, storybook: Storybook)
local function createChildNodes(parent: ComponentTreeNode, instance: Instance, storybook: LoadedStorybook)
for _, child in ipairs(instance:GetChildren()) do
local isStory = Storyteller.isStoryModule(child)
local isContainer = hasStories(child)
Expand All @@ -38,7 +38,7 @@ local function createChildNodes(parent: ComponentTreeNode, instance: Instance, s
end
end

local function createStoryNodes(storybooks: { Storybook }): { ComponentTreeNode }
local function createStoryNodes(storybooks: { LoadedStorybook }): { ComponentTreeNode }
local nodes: { ComponentTreeNode } = {}

for _, storybook in ipairs(storybooks) do
Expand Down
2 changes: 1 addition & 1 deletion src/Storybook/createStoryNodes.spec.luau
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local mockStoryRoot = newFolder({
}),
})

local mockStorybook: Storyteller.Storybook = {
local mockStorybook: Storyteller.LoadedStorybook = {
name = "MockStorybook",
storyRoots = { mockStoryRoot },
}
Expand Down
2 changes: 1 addition & 1 deletion wally.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exclude = ["*"]

[dependencies]
ModuleLoader = "flipbook-labs/[email protected]"
Storyteller = "flipbook-labs/[email protected].2"
Storyteller = "flipbook-labs/[email protected].3"
React = "jsdotlua/[email protected]"
ReactRoblox = "jsdotlua/[email protected]"
ReactSpring = "chriscerie/[email protected]"
Expand Down

0 comments on commit 742bdc6

Please sign in to comment.