Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook build breaks if Spright depends on Nimble #2528

Open
jattasNI opened this issue Jan 30, 2025 · 2 comments · May be fixed by #2567
Open

Storybook build breaks if Spright depends on Nimble #2528

jattasNI opened this issue Jan 30, 2025 · 2 comments · May be fixed by #2567
Assignees

Comments

@jattasNI
Copy link
Contributor

jattasNI commented Jan 30, 2025

🧹 Tech Debt

While developing the chat components I hit build issues in Storybook caused by a dependency I introduced from spright-components to nimble-components. For the chat components I worked around it by eliminating the dependency but that's not a viable long term strategy.

The problem is caused by the different ways that the storybook package and the spright-components package import content from nimble-components. All the storybook imports are relative paths to source (to keep turbosnap working) but all the components imports are package imports @ni/nimble-components (to ensure correct package dependencies in the build output). This results in 2 copies of nimble-components classes being pulled in to the storybook build, which leads to type conflicts.

@rajsite thought we might be able to use tsconfig type mappings similar to what we do in SystemLinkShared. We would apply this to storybook's config to map package paths to the corresponding relative paths. We should try this out and see if we can get the build and turbosnap working together.

@jattasNI jattasNI added tech debt triage New issue that needs to be reviewed labels Jan 30, 2025
@m-akinc m-akinc removed the triage New issue that needs to be reviewed label Jan 30, 2025
@m-akinc m-akinc assigned m-akinc and jattasNI and unassigned m-akinc Jan 30, 2025
@rajsite
Copy link
Member

rajsite commented Mar 21, 2025

Found an existing chromatic issue where folks are having issues with monorepos and a description of the approach I was thinking of at stand-up is more spelled out (relying on package imports/exports and conditions). We might need to switch over to package entry points to even try it but guessing will hit issues as well.

@rajsite
Copy link
Member

rajsite commented Mar 24, 2025

The tsconfig-paths-webpack-plugin may be useful for expressing paths in the tsconfig and having Webpack build be aware of it. Based on discussion from the exisiting chromatic monorepo issue.

@rajsite rajsite linked a pull request Mar 26, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

3 participants