Skip to content

fix(cli): remove @o2s/framework refs from .storybook/main.ts during scaffold#841

Open
ysdy823 wants to merge 2 commits intoo2sdev:mainfrom
ysdy823:fix/storybook-framework-aliases-cleanup-836
Open

fix(cli): remove @o2s/framework refs from .storybook/main.ts during scaffold#841
ysdy823 wants to merge 2 commits intoo2sdev:mainfrom
ysdy823:fix/storybook-framework-aliases-cleanup-836

Conversation

@ysdy823
Copy link
Copy Markdown

@ysdy823 ysdy823 commented Mar 27, 2026

Summary

Fixes #836

After scaffolding with create-o2s-app, Storybook fails because .storybook/main.ts still contains references to @o2s/framework/sdk and @o2s/framework/modules in both resolve.alias (lines 92-93) and optimizeDeps.include (lines 76-77), even though packages/framework/ is removed during scaffolding (listed in ALWAYS_REMOVE_DIRS).

Changes

  • New file: packages/cli/create-o2s-app/src/scaffold/transform-storybook-config.ts — a transform that filters out lines containing @o2s/framework/ references from .storybook/main.ts
  • Modified: packages/cli/create-o2s-app/src/scaffold/index.ts — added transformStorybookConfig to the Step 4 parallel transform batch

The transform follows the same regex-based line-filtering pattern used by existing transforms (e.g., transform-app-module.ts).

Test plan

  • Run npx create-o2s-app and scaffold a project
  • Verify .storybook/main.ts in the scaffolded project does not contain @o2s/framework references
  • Verify Storybook starts correctly with npm run storybook

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Project scaffolding now automatically updates Storybook configuration during creation, removing legacy framework-specific references to ensure a cleaner, compatible setup.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] CLI scaffold: Storybook fails due to broken @o2s/framework aliases in .storybook/main.ts

1 participant