Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

chore(295): add support for mdx stories #298

Closed
wants to merge 4 commits into from
Closed

Conversation

jimmynotjim
Copy link
Contributor

@jimmynotjim jimmynotjim commented Apr 13, 2021

Adds support for the newer mdx story format

Screen Shot 2021-04-19 at 2 53 12 PM

Adds support for the newer mdx story format
@codecov
Copy link

codecov bot commented Apr 13, 2021

Codecov Report

Merging #298 (0eab699) into master (712b2d6) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #298   +/-   ##
=======================================
  Coverage   47.31%   47.31%           
=======================================
  Files         143      143           
  Lines        2012     2012           
  Branches      362      362           
=======================================
  Hits          952      952           
  Misses       1010     1010           
  Partials       50       50           
Impacted Files Coverage Δ
packages/pixeloven-storybook/config/src/main.ts 100.00% <ø> (ø)
...ges/pixeloven-webpack/config/src/helpers/shared.ts 34.21% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 712b2d6...0eab699. Read the comment docs.

@twilliams15
Copy link
Collaborator

Saw this PR and wanted to see if we can get "controls" (or "essentials") added while we're at it?

Might need to update main.js to take advantage after installing

Also I'd like to help test this out, but can't figure out how to point to the commit, updating the package.json to use
"@pixeloven/cli-addon-storybook": "pixeloven/pixeloven#mdx-stories"
didn't work for me, how do I do it?

"@storybook/react": "6.1.20",
"@storybook/theming": "6.1.20",
"@storybook/addon-actions": "6.2.7",
"@storybook/addon-backgrounds": "6.2.7",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shoot, should have removed the old addons and added essentials here

"@storybook/theming": "6.1.20",
"@storybook/addon-a11y": "6.2.7",
"@storybook/addon-docs": "6.2.7",
"@storybook/addon-essentials": "6.2.7",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This replaces a bunch of individual addons

],
stories: [process.cwd() + "/**/*.stories.[tj]s[x]"],
stories: [process.cwd() + "/**/*.stories.@(js|ts|jsx|tsx|mdx)"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new recommended format from storybook

@@ -340,7 +340,7 @@ export function getSetup(options: Options) {
"@src": resolveSourceRoot(),
},
extensions: [".js", ".json", ".jsx", ".mjs", ".ts", ".tsx"],
modules: [resolveSourceRoot(), "node_modules"],
modules: [resolveSourceRoot(), "node_modules", "stories"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotta resolve stories, I'm not 100% sure why, just following instructions.

@jimmynotjim
Copy link
Contributor Author

@twilliams15 ok things should be good to go. Instructions for testing

  • yarn install if you never have, this will install Lerna
  • yarn all:bootstrap this will install all other package stuff
  • yarn all:compile && yarn all:linker this will build the packages and symlink them
  • cd packages/examples/component-library && yarn start:storythis will start storybook in the example package, go to the url printed in consol

@@ -29,6 +29,7 @@
"@pixeloven/cli": "^7.0.0-alpha.0",
"@pixeloven/cli-addon-storybook": "^7.0.0-alpha.1",
"@pixeloven/cli-core": "^7.0.0-alpha.0",
"@storybook/addon-docs": "6.2.7",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jimmynotjim This was one of the reason I had the common library so we can wrap dependencies like this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants