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 v7 #2866

Merged
merged 40 commits into from
May 23, 2023
Merged

⬆️ Storybook v7 #2866

merged 40 commits into from
May 23, 2023

Conversation

oddvernes
Copy link
Collaborator

@oddvernes oddvernes commented May 5, 2023

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)

@oddvernes oddvernes force-pushed the OOVE/2514-storybook7 branch from 2a27f54 to 5d0b4fd Compare May 8, 2023 14:06
@oddvernes oddvernes force-pushed the OOVE/2514-storybook7 branch from 29360e8 to 52e24cc Compare May 11, 2023 10:11
@oddvernes oddvernes marked this pull request as ready for review May 15, 2023 12:16
@nilsml nilsml self-requested a review May 19, 2023 11:22
Copy link
Contributor

@nilsml nilsml left a 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)

@oddvernes
Copy link
Collaborator Author

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

@oddvernes
Copy link
Collaborator Author

Try again now @nilsml

Copy link
Contributor

@nilsml nilsml left a 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.

@oddvernes oddvernes merged commit 11cb451 into develop May 23, 2023
@oddvernes oddvernes deleted the OOVE/2514-storybook7 branch May 23, 2023 07:07
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.

⬆️ Upgrade storybook 7.0 (previously mdx 2)
2 participants