From f5b784338011ed6065ee8b97761c97fa53335cb9 Mon Sep 17 00:00:00 2001 From: Marin Minnerly Date: Fri, 15 Nov 2024 16:29:49 -0800 Subject: [PATCH 1/2] Bump Storyteller to 0.4.3 --- src/Explorer/types.luau | 4 ++-- src/Panels/Sidebar.luau | 6 +++--- src/Storybook/createStoryNodes.luau | 6 +++--- src/Storybook/createStoryNodes.spec.luau | 2 +- wally.toml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Explorer/types.luau b/src/Explorer/types.luau index 9b49b05b..df60bf5c 100644 --- a/src/Explorer/types.luau +++ b/src/Explorer/types.luau @@ -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 diff --git a/src/Panels/Sidebar.luau b/src/Panels/Sidebar.luau index 6e8930d9..2a5db8a2 100644 --- a/src/Panels/Sidebar.luau +++ b/src/Panels/Sidebar.luau @@ -10,7 +10,7 @@ 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 @@ -18,8 +18,8 @@ local e = React.createElement type Props = { layoutOrder: number?, selectStory: (ModuleScript) -> (), - selectStorybook: (Storybook) -> (), - storybooks: { Storybook }, + selectStorybook: (LoadedStorybook) -> (), + storybooks: { LoadedStorybook }, } local function Sidebar(props: Props) diff --git a/src/Storybook/createStoryNodes.luau b/src/Storybook/createStoryNodes.luau index a4741ccb..042d6d41 100644 --- a/src/Storybook/createStoryNodes.luau +++ b/src/Storybook/createStoryNodes.luau @@ -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 @@ -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) @@ -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 diff --git a/src/Storybook/createStoryNodes.spec.luau b/src/Storybook/createStoryNodes.spec.luau index fd6f6092..66c3ca90 100644 --- a/src/Storybook/createStoryNodes.spec.luau +++ b/src/Storybook/createStoryNodes.spec.luau @@ -16,7 +16,7 @@ local mockStoryRoot = newFolder({ }), }) -local mockStorybook: Storyteller.Storybook = { +local mockStorybook: Storyteller.LoadedStorybook = { name = "MockStorybook", storyRoots = { mockStoryRoot }, } diff --git a/wally.toml b/wally.toml index 6e08dd51..901accb4 100644 --- a/wally.toml +++ b/wally.toml @@ -8,7 +8,7 @@ exclude = ["*"] [dependencies] ModuleLoader = "flipbook-labs/module-loader@0.6.2" -Storyteller = "flipbook-labs/storyteller@0.4.2" +Storyteller = "flipbook-labs/storyteller@0.4.3" React = "jsdotlua/react@17.0.2" ReactRoblox = "jsdotlua/react-roblox@17.0.2" ReactSpring = "chriscerie/react-spring@2.0.0" From 799b642b0c22bdb0f7012d6d34f49f98ab45dfab Mon Sep 17 00:00:00 2001 From: Marin Minnerly Date: Sat, 16 Nov 2024 09:01:14 -0800 Subject: [PATCH 2/2] Fix remaining type errors --- src/Navigation/Screen.luau | 4 ++-- src/Storybook/StoryCanvas.luau | 4 ++-- src/Storybook/StoryMeta.luau | 4 ++-- src/Storybook/StoryPreview.luau | 4 ++-- src/Storybook/StoryView.luau | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Navigation/Screen.luau b/src/Navigation/Screen.luau index 7dd39506..427d5e7c 100644 --- a/src/Navigation/Screen.luau +++ b/src/Navigation/Screen.luau @@ -10,12 +10,12 @@ local StoryCanvas = require("@root/Storybook/StoryCanvas") local useMemo = React.useMemo type ModuleLoader = ModuleLoader.ModuleLoader -type Storybook = Storyteller.Storybook +type LoadedStorybook = Storyteller.LoadedStorybook export type Props = { loader: ModuleLoader, story: ModuleScript?, - storybook: Storybook?, + storybook: LoadedStorybook?, } local function Screen(props: Props) diff --git a/src/Storybook/StoryCanvas.luau b/src/Storybook/StoryCanvas.luau index 389ccdbe..f796bd5d 100644 --- a/src/Storybook/StoryCanvas.luau +++ b/src/Storybook/StoryCanvas.luau @@ -9,12 +9,12 @@ local useTheme = require("@root/Common/useTheme") local e = React.createElement type ModuleLoader = ModuleLoader.ModuleLoader -type Storybook = Storyteller.Storybook +type LoadedStorybook = Storyteller.LoadedStorybook type Props = { story: ModuleScript, loader: ModuleLoader, - storybook: Storybook, + storybook: LoadedStorybook, layoutOrder: number?, } diff --git a/src/Storybook/StoryMeta.luau b/src/Storybook/StoryMeta.luau index ca611ce0..5054fa61 100644 --- a/src/Storybook/StoryMeta.luau +++ b/src/Storybook/StoryMeta.luau @@ -7,10 +7,10 @@ local MAX_SUMMARY_SIZE = 600 local e = React.createElement -type Story = Storyteller.Story +type LoadedStory = Storyteller.LoadedStory export type Props = { - story: Story, + story: LoadedStory, layoutOrder: number?, } diff --git a/src/Storybook/StoryPreview.luau b/src/Storybook/StoryPreview.luau index 56f7e282..2e3c3cbd 100644 --- a/src/Storybook/StoryPreview.luau +++ b/src/Storybook/StoryPreview.luau @@ -16,10 +16,10 @@ local defaultProps = { zoom = 0, } -type Story = Storyteller.Story +type LoadedStory = Storyteller.LoadedStory export type Props = { - story: Story, + story: LoadedStory, controls: { [string]: any }, isMountedInViewport: boolean?, diff --git a/src/Storybook/StoryView.luau b/src/Storybook/StoryView.luau index e24ea64d..0f29defb 100644 --- a/src/Storybook/StoryView.luau +++ b/src/Storybook/StoryView.luau @@ -21,12 +21,12 @@ local useZoom = require("@root/Common/useZoom") local e = React.createElement type ModuleLoader = ModuleLoader.ModuleLoader -type Storybook = Storyteller.Storybook +type LoadedStorybook = Storyteller.LoadedStorybook type Props = { loader: ModuleLoader, story: ModuleScript, - storybook: Storybook, + storybook: LoadedStorybook, } local function StoryView(props: Props)