-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Describe the bug
After scaffolding a project with create-o2s-app, Storybook fails to start because .storybook/main.ts contains resolve aliases and optimizeDeps entries pointing to local packages/framework/ paths that no longer exist.
The packages/framework directory is always removed during scaffolding (listed in ALWAYS_REMOVE_DIRS in constants.ts), but the Storybook config still references:
- Resolve aliases (lines 91-92):
'@o2s/framework/sdk': path.resolve(__dirname, '../packages/framework/src/sdk.ts')'@o2s/framework/modules': path.resolve(__dirname, '../packages/framework/src/index.ts')
- optimizeDeps.include (lines 75-76):
'@o2s/framework/modules''@o2s/framework/sdk'
To Reproduce
- Run
npx create-o2s-appand select the "custom" template (or any template) - Complete the wizard
- After scaffolding, try to run Storybook with
npm run storybook - Storybook fails because it cannot resolve the framework paths
Expected behavior
Storybook should start correctly after scaffolding. The CLI should include a transform that removes or updates the @o2s/framework references in .storybook/main.ts when the framework package is not present locally.
Proposed solution
Add a new transform (e.g., transform-storybook-config.ts) in packages/cli/create-o2s-app/src/scaffold/ that:
- Removes the
@o2s/framework/sdkand@o2s/framework/modulesentries fromresolve.alias - Removes the corresponding entries from
optimizeDeps.include - Follows the same regex-based pattern used by existing transforms (e.g.,
transform-app-module.ts)
This transform should run as part of the scaffold pipeline in scaffold/index.ts.
Additional context
All existing transforms are in packages/cli/create-o2s-app/src/scaffold/ and follow a consistent regex-based line filtering pattern. The new transform should follow the same conventions.
This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting
/reward 100 (replace 100 with the amount).🕵️♂️ If someone starts working on this issue to earn the rewards, they can comment
/try to let everyone know!🙌 And when they open the PR, they can comment
/claim #836 either in the PR description or in a PR's comment.🪙 Also, everyone can tip any user commenting
/tip 20 @michnowak (replace 20 with the amount, and @michnowak with the user to tip).📖 If you want to learn more, check out our documentation.
Branch: fix/storybook-broken-framework-aliases-836
Metadata
Metadata
Assignees
Labels
Type
Projects
Status