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

Upgrade example to SB7 #24

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
module.exports = {
stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-links', { name: '@storybook/addon-essentials' }],
framework: '@storybook/react',
core: { builder: 'webpack5' },
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
framework: {
name: '@storybook/react-webpack5',
options: {},
},
core: {},
webpackFinal: async (config) => {
const rules = (config.module.rules || []).filter(
(rule) => !rule.test?.toString().endsWith('\\.mdx$/')
Expand All @@ -11,7 +14,6 @@ module.exports = {
// 2a. Load `.stories.mdx` / `.story.mdx` files as CSF and generate
// the docs page from the markdown
test: /\.(stories|story)\.mdx$/,

use: [
{
// Need to add babel-loader as dependency: `yarn add -D babel-loader`
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,34 @@
"build": "tsup",
"start": "yarn build && yarn storybook -- --no-manager-cache --quiet\"",
"release": "yarn build && auto shipit",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"prettier": "prettier",
"prepare": "husky install"
},
"dependencies": {
"loader-utils": "^2.0.0"
},
"devDependencies": {
"@babel/traverse": "^7.12.11",
"@babel/generator": "^7.12.11",
"@babel/parser": "^7.12.11",
"@babel/types": "^7.14.8",
"@mdx-js/mdx": "^2.0.0",
"estree-to-babel": "^4.9.0",
"hast-util-to-estree": "^2.0.2",
"lodash": "^4.17.21",
"js-string-escape": "^1.0.1",
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/generator": "^7.12.11",
"@babel/parser": "^7.12.11",
"@babel/preset-env": "^7.12.1",
"@babel/preset-react": "^7.12.5",
"@babel/preset-typescript": "^7.13.0",
"@babel/template": "^7.14.5",
"@babel/traverse": "^7.12.11",
"@babel/types": "^7.14.8",
"@jest/types": "^27.0.6",
"@storybook/addon-actions": "^6.5.0-alpha.36",
"@storybook/addon-essentials": "^6.5.0-alpha.36",
"@storybook/addon-interactions": "^6.5.0-alpha.36",
"@storybook/addon-links": "^6.5.0-alpha.36",
"@storybook/builder-webpack5": "^6.5.0-alpha.36",
"@storybook/manager-webpack5": "^6.5.0-alpha.36",
"@storybook/react": "^6.5.0-alpha.36",
"@storybook/testing-library": "^0.0.9",
"@mdx-js/mdx": "^2.0.0",
"@storybook/addon-actions": "next",
"@storybook/addon-essentials": "next",
"@storybook/addon-interactions": "next",
"@storybook/addon-links": "next",
"@storybook/react": "next",
"@storybook/react-webpack5": "next",
"@storybook/testing-library": "^0.0.14-next.0",
"@testing-library/dom": "^8.1.0",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
Expand All @@ -66,19 +61,24 @@
"babel-jest": "^27.0.6",
"babel-loader": "^8.1.0",
"concurrently": "^7.0.0",
"estree-to-babel": "^4.9.0",
"hast-util-to-estree": "^2.0.2",
"husky": ">=6",
"jest": "^27.0.6",
"jest-environment-jsdom": "^27.0.6",
"js-string-escape": "^1.0.1",
"lint-staged": ">=10",
"lodash": "^4.17.21",
"prettier": "^2.3.1",
"prompts": "^2.4.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rimraf": "^3.0.2",
"storybook": "next",
"ts-dedent": "^2.2.0",
"ts-jest": "^27.0.4",
"typescript": "^4.2.4",
"tsup": "^6.2.2"
"tsup": "^6.2.2",
"typescript": "^4.2.4"
},
"lint-staged": {
"*.{ts,js,css,md}": "prettier --write"
Expand Down
6 changes: 4 additions & 2 deletions stories/Introduction.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import StackAlt from './assets/stackalt.svg';

<Meta title="Example/Introduction" />

<style>{`
<style>
{`
.subheading {
--mediumdark: '#999999';
font-weight: 900;
Expand Down Expand Up @@ -98,7 +99,8 @@ import StackAlt from './assets/stackalt.svg';
font-size: 12px;
display: inline-block;
}
`}</style>
`}
</style>

# Welcome to Storybook

Expand Down
Loading