Skip to content

Commit d988600

Browse files
Copilothotlong
andcommitted
Fix import paths for storybook datasource
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 590834a commit d988600

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.storybook/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ const config: StorybookConfig = {
2121
return mergeConfig(config, {
2222
resolve: {
2323
alias: {
24+
// Alias for .storybook directory to allow imports from stories
25+
'@storybook-config': path.resolve(__dirname, '.'),
2426
// Alias components package to source to avoid circular dependency during build
2527
'@object-ui/core': path.resolve(__dirname, '../packages/core/src/index.ts'),
2628
'@object-ui/react': path.resolve(__dirname, '../packages/react/src/index.ts'),
2729
'@object-ui/components': path.resolve(__dirname, '../packages/components/src/index.ts'),
2830
'@object-ui/fields': path.resolve(__dirname, '../packages/fields/src/index.tsx'),
2931
'@object-ui/layout': path.resolve(__dirname, '../packages/layout/src/index.ts'),
32+
'@object-ui/data-objectstack': path.resolve(__dirname, '../packages/data-objectstack/src/index.ts'),
3033
// Alias example packages for Storybook to resolve them from workspace
3134
'@object-ui/example-crm': path.resolve(__dirname, '../examples/crm/src/index.ts'),
3235
// Alias plugin packages for Storybook to resolve them from workspace

packages/components/src/stories-json/object-form.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Meta, StoryObj } from '@storybook/react';
22
import { SchemaRenderer, SchemaRendererProvider } from '@object-ui/react';
33
import type { BaseSchema } from '@object-ui/types';
4-
import { createStorybookDataSource } from '../../../.storybook/datasource';
4+
import { createStorybookDataSource } from '@storybook-config/datasource';
55

66
const meta = {
77
title: 'Views/Object Form',

packages/components/src/stories-json/object-grid.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Meta, StoryObj } from '@storybook/react';
22
import { SchemaRenderer, SchemaRendererProvider } from '@object-ui/react';
33
import type { BaseSchema } from '@object-ui/types';
4-
import { createStorybookDataSource } from '../../../.storybook/datasource';
4+
import { createStorybookDataSource } from '@storybook-config/datasource';
55

66
const meta = {
77
title: 'Views/Object Grid',

0 commit comments

Comments
 (0)