-
-export enum ColorScheme {
- Light = 'light',
- Dark = 'dark',
- Auto = 'auto',
+ stylesheets: string[]
+ // addons: StoryAddonList
}
-export type StoryImportPaths = [string, string][]
-
export enum StoryAddon {
DarkMode = 'DarkMode',
FullScreen = 'FullScreen',
@@ -48,7 +30,7 @@ export type StoryAddonSettings = {
onClick?: () => void
}
-export type StoryAddonList = (StoryAddon | [StoryAddon, StoryAddonSettings] | StoryAddonSettings)[]
+// export type StoryAddonList = (StoryAddon | [StoryAddon, StoryAddonSettings] | StoryAddonSettings)[]
export type StoryComponent = React.FC
& {
args?: any
@@ -57,10 +39,10 @@ export type StoryComponent
= React.FC
& {
}
export type StoryMeta = {
- title?: string
- icon?: JSX.Element
- addons?: StoryAddonList
+ title?: React.ReactNode
+ icon?: React.ReactNode
priority?: number
+ // addons?: StoryAddonList
}
export type StoryModule
= {
@@ -70,5 +52,18 @@ export type StoryModule
= {
}
export type StoryModulesMapValue = { module: StoryModule; meta: StoryMeta }
-export type StoryImportGlob = Record
export type StoryModulesMap = Map
+
+export enum ElementIds {
+ MainGlobalStyles = 'stories_mainLayoutGlobalStyles',
+ SandboxGlobalStyles = 'stories_sandboxLayoutGlobalStyles',
+ Iframe = 'stories_Iframe',
+ Sidebar = 'stories_Sidebar',
+ StoryCanvas = 'stories_Canvas',
+}
+
+export enum ColorScheme {
+ Light = 'light',
+ Dark = 'dark',
+ Auto = 'auto',
+}
diff --git a/packages/storylite/src/types/storylite-user-config.d.ts b/packages/storylite/src/types/storylite-user-config.d.ts
deleted file mode 100644
index 6ab90ef..0000000
--- a/packages/storylite/src/types/storylite-user-config.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-declare module 'storylite-user-config' {
- import { StoryLiteUserConfig } from '@/types'
- const userConfig: StoryLiteUserConfig
- export default userConfig
-}
diff --git a/packages/storylite/src/types/storylite-user-stories.d.ts b/packages/storylite/src/types/storylite-user-stories.d.ts
deleted file mode 100644
index f32067d..0000000
--- a/packages/storylite/src/types/storylite-user-stories.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-declare module 'storylite-user-stories' {
- import { StoryModulesMap } from '@/types'
- const userStories: StoryModulesMap
- export default userStories
-}
diff --git a/packages/storylite/src/types/storylite-user-styles-sandbox.d.ts b/packages/storylite/src/types/storylite-user-styles-sandbox.d.ts
deleted file mode 100644
index 23d2ec4..0000000
--- a/packages/storylite/src/types/storylite-user-styles-sandbox.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare module 'storylite-user-styles-sandbox' {
- const userSandboxStyles: string
- export default userSandboxStyles
-}
diff --git a/packages/storylite/src/types/storylite-user-styles-ui.d.ts b/packages/storylite/src/types/storylite-user-styles-ui.d.ts
deleted file mode 100644
index 0df528a..0000000
--- a/packages/storylite/src/types/storylite-user-styles-ui.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare module 'storylite-user-styles-ui' {
- const userUiStyles: string
- export default userUiStyles
-}
diff --git a/packages/storylite/tsup.config.ts b/packages/storylite/tsup.config.ts
index 552c347..750f5cc 100644
--- a/packages/storylite/tsup.config.ts
+++ b/packages/storylite/tsup.config.ts
@@ -11,12 +11,36 @@ export default defineConfig([
target: 'es2020',
ignoreWatch: ['**/dist/**', '**/node_modules/**', '*.test.ts'],
clean: true,
- dts: true,
+ dts: {
+ compilerOptions: {
+ // Ensure ".d.ts" modules are generated
+ declaration: true,
+ // Skip ".js" generation
+ noEmit: false,
+ emitDeclarationOnly: true,
+ // Skip code generation when error occurs
+ noEmitOnError: true,
+ // Avoid extra work
+ checkJs: false,
+ declarationMap: false,
+ skipLibCheck: true,
+ // Ensure TS2742 errors are visible
+ preserveSymlinks: true,
+ // Ensure we can parse the latest code
+ target: 'ESNext',
+ types: ['node'],
+ },
+ },
sourcemap: true,
splitting: true,
minify: false,
skipNodeModulesBundle: true,
external: ['node_modules'],
- onSuccess: 'cp ../../README.md ./README.md && cp ../../LICENSE ./LICENSE',
+ onSuccess: [
+ 'sleep 2',
+ 'cp ../../README.md ./README.md',
+ 'cp ../../LICENSE ./LICENSE',
+ 'cp ./src/plugins/vite-plugin-storylite/virtual-modules.d.ts ./dist/virtual-modules.d.ts',
+ ].join(' && '),
},
])