Skip to content
Closed
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
12 changes: 8 additions & 4 deletions examples/with-storybook/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ module.exports = {
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'storybook-addon-next',
'@storybook/addon-styling',
],
framework: '@storybook/react',
core: {
builder: 'webpack5',
framework: {
name: '@storybook/nextjs',
options: {},
},
staticDirs: ['../public'],
docs: {
autodocs: true,
},
}
2 changes: 1 addition & 1 deletion examples/with-storybook/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example app with Storybook

This example shows a default set up of Storybook using [storybook-addon-next](https://github.com/RyanClementsHax/storybook-addon-next). Included in this example are stories that demonstrate the ability to use Next.js features in Storybook.
This example shows a default set up of Storybook. Included in this example are stories that demonstrate the ability to use Next.js features in Storybook. As of v7.0, Storybook has built-in Next.js support, so no addon is needed. If you want to customize the default configuration, refer to the [recipes](https://storybook.js.org/recipes/next#next).

### TypeScript

Expand Down
18 changes: 8 additions & 10 deletions examples/with-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"storybook": "start-storybook -p 6006 -s public",
"build-storybook": "build-storybook -s public",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"serve-storybook": "serve storybook-static"
},
"dependencies": {
Expand All @@ -16,15 +16,13 @@
},
"devDependencies": {
"@babel/core": "^7.16.7",
"@storybook/addon-actions": "^6.4.9",
"@storybook/addon-essentials": "^6.4.9",
"@storybook/addon-links": "^6.4.9",
"@storybook/builder-webpack5": "^6.4.9",
"@storybook/manager-webpack5": "^6.4.9",
"@storybook/react": "^6.4.9",
"babel-loader": "^8.2.3",
"@storybook/addon-actions": "^7.0.12",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we make sure these are on latest?

"@storybook/addon-essentials": "^7.0.12",
"@storybook/addon-links": "^7.0.12",
"@storybook/addon-styling": "^1.0.8",
"@storybook/nextjs": "^7.0.12",
"serve": "13.0.2",
"storybook-addon-next": "1.3.1",
"storybook": "^7.0.12",
"typescript": "4.5.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default {
component: AbsoluteImports,
}

export const AbsoluteImportsPage = () => <AbsoluteImports />
export const AbsoluteImportsPage = {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default {
component: CssModules,
}

export const CssModulesPage = () => <CssModules />
export const CssModulesPage = {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default {
component: GlobalStyleImports,
}

export const GlobalStyleImportsPage = () => <GlobalStyleImports />
export const GlobalStyleImportsPage = {}
2 changes: 1 addition & 1 deletion examples/with-storybook/stories/pages/home.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default {
component: Home,
}

export const HomePage = () => <Home />
export const HomePage = {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default {
component: NextjsImages,
}

export const NextjsImagesPage = () => <NextjsImages />
export const NextjsImagesPage = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these all removed?

12 changes: 7 additions & 5 deletions examples/with-storybook/stories/pages/nextjsRouting.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ export default {
component: NextjsRouting,
}

export const NextjsRoutingPage = () => <NextjsRouting />

NextjsRoutingPage.parameters = {
nextRouter: {
route: 'this-is-a-story-override',
export const NextjsRoutingPage = {
parameters: {
nextjs: {
router: {
route: 'this-is-a-story-override',
},
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default {
component: ScssModules,
}

export const ScssModulesPage = () => <ScssModules />
export const ScssModulesPage = {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default {
component: StyledJsx,
}

export const StyledJsxPage = () => <StyledJsx />
export const StyledJsxPage = {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default {
component: Typescript,
}

export const TypescriptPage = () => <Typescript />
export const TypescriptPage = {}