Skip to content

Commit

Permalink
bring mdx-csf compiler into addon docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Dec 28, 2023
1 parent 67445aa commit 0433348
Show file tree
Hide file tree
Showing 12 changed files with 3,143 additions and 165 deletions.
14 changes: 0 additions & 14 deletions code/addons/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,6 @@ export default {
};
```

If using in conjunction with the [storyshots add-on](https://github.com/storybookjs/storybook/blob/next/code/addons/storyshots-core/README.md), you will need to
configure Jest to transform MDX stories into something Storyshots can understand:

Add the following to your Jest configuration:

```json
{
"transform": {
"^.+\\.[tj]sx?$": "babel-jest",
"^.+\\.mdx$": "@storybook/addon-docs/jest-transform-mdx"
}
}
```

### Be sure to check framework specific installation needs

- [React](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/react) (covered here)
Expand Down
22 changes: 0 additions & 22 deletions code/addons/docs/jest-transform-mdx.js

This file was deleted.

12 changes: 5 additions & 7 deletions code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"./angular": "./angular/index.js",
"./angular/index.js": "./angular/index.js",
"./web-components/index.js": "./web-components/index.js",
"./jest-transform-mdx": "./jest-transform-mdx.js",
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand All @@ -98,21 +97,22 @@
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@jest/transform": "^29.3.1",
"@babel/core": "^7.12.3",
"@mdx-js/mdx": "^3.0.0",
"@mdx-js/react": "^3.0.0",
"@storybook/blocks": "workspace:*",
"@storybook/client-logger": "workspace:*",
"@storybook/components": "workspace:*",
"@storybook/csf-plugin": "workspace:*",
"@storybook/csf-tools": "workspace:*",
"@storybook/global": "^5.0.0",
"@storybook/mdx2-csf": "^1.0.0",
"@storybook/node-logger": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/react-dom-shim": "workspace:*",
"@storybook/theming": "workspace:*",
"@storybook/types": "workspace:*",
"fs-extra": "^11.1.0",
"js-string-escape": "^1.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remark-external-links": "^8.0.0",
Expand All @@ -122,7 +122,8 @@
"devDependencies": {
"@rollup/pluginutils": "^5.0.2",
"typescript": "^5.3.2",
"vite": "^4.0.4"
"vite": "^4.0.4",
"vite-plugin-babel": "^1.2.0"
},
"publishConfig": {
"access": "public"
Expand All @@ -134,9 +135,6 @@
"./src/preview.ts",
"./src/blocks.ts",
"./src/shims/mdx-react-shim.ts"
],
"externals": [
"@storybook/mdx1-csf"
]
},
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17",
Expand Down
Loading

0 comments on commit 0433348

Please sign in to comment.