-
Notifications
You must be signed in to change notification settings - Fork 68
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 v7 #2866
⬆️ Storybook v7 #2866
Conversation
2a27f54
to
5d0b4fd
Compare
29360e8
to
52e24cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Truly a big PR!!
I tried starting the Storybook both on my regular Codespace and also on a brand new Codespace set up only for this PR. I was unable to build and start the Storybook.
Failing with messages like:
ERR! Error: Failed to resolve entry for package "@equinor/eds-tokens". The package may have incorrect main/module/exports specified in its package.json.
ERR! at packageEntryFailure (file:///workspaces/design-system/packages/eds-core-react/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-934dbc7c.js:23384:11)
This is similar to the error messages I got that made me have to drop commonjs build in core-react/lab-react/utils. Looks like we have to do it for tokens as well. Curious why this error only pops up for codespaces and not local build |
Try again now @nilsml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't possibly go through all the code changes, but from what I've seen it looks good. I can also confirm that it runs on my machine. I think we should merge to develop so that we can test it with GH actions.
resolves #2514
I had to remove the cjs output from the build and use "exports" field (+ type: "module") in package.json (instead of main and module) to make this work. if this is an issue we can possibly as an alternative keep cjs and change file extensions on the module outputs to .mjs
I switched to vite from webpack5 as the storybook builder as a result of the problems above (thats when the error message got informative enough to realize what was wrong)
I used automigrate to csf3 in labs but core-react is still csf2. It is a lot of work currently to fix the csf3 autogenerated code (the render function in StoryObj is an arrow function not recognized as a react function so hooks in the story make it fail. Have to move all functions out of object, or change from arrow to named function)