Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
docs: improve documentation DX (#472)
Browse files Browse the repository at this point in the history
* docs: improve documentation DX

* fix: make sure first load page is Introduction
  • Loading branch information
baptisteArno authored Sep 12, 2022
1 parent ec7b808 commit e1a4c20
Show file tree
Hide file tree
Showing 18 changed files with 1,171 additions and 1,484 deletions.
18 changes: 5 additions & 13 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-ignore
const path = require('path')

module.exports = {
Expand All @@ -11,7 +10,11 @@ module.exports = {
typescript: {
reactDocgen: 'react-docgen-typescript',
},
stories: ['../src/**/__stories__/*.stories.tsx', '../src/__stories__/**'],
stories: [
'../src/__stories__/Introduction.stories.mdx',
'../src/**/__stories__/*.stories.tsx',
'../src/__stories__/**',
],
addons: [
'@storybook/addon-docs',
'@storybook/addon-links',
Expand All @@ -35,17 +38,6 @@ module.exports = {
}
}

// if (config.module?.rules) {
// config.module.rules.push({
// test: /\.(png)$/,
// use: [
// {
// loader: 'file-loader',
// },
// ],
// })
// }

return config
},
}
10 changes: 7 additions & 3 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import React from 'react'
import { css, ThemeProvider, Global, Theme } from '@emotion/react'

const STORY_SORT = {
order: ['Introduction', 'Components', 'Labs'],
order: [
'Introduction',
'Components',
['Form', 'Fields', 'SubmitErrorAlert', 'Submit'],
],
}

const ENV_PARAMETERS = {
Expand All @@ -15,9 +19,9 @@ const ENV_PARAMETERS = {
disable: true,
},
},
viewMode: 'canvas',
viewMode: 'docs',
previewTabs: {
'storybook/docs/panel': { index: 1 },
canvas: { hidden: true },
},
viewport: {
viewports: {},
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@
"@semantic-release/github": "8.0.6",
"@semantic-release/npm": "9.0.1",
"@semantic-release/release-notes-generator": "10.0.3",
"@storybook/addon-actions": "6.4.22",
"@storybook/addon-docs": "6.4.22",
"@storybook/addon-essentials": "6.4.22",
"@storybook/addon-links": "6.4.22",
"@storybook/addons": "6.4.22",
"@storybook/builder-webpack5": "6.4.22",
"@storybook/manager-webpack5": "6.4.22",
"@storybook/react": "6.4.22",
"@storybook/theming": "6.4.22",
"@storybook/addon-actions": "6.5.10",
"@storybook/addon-docs": "6.5.10",
"@storybook/addon-essentials": "6.5.10",
"@storybook/addon-links": "6.5.10",
"@storybook/addons": "6.5.10",
"@storybook/builder-webpack5": "6.5.10",
"@storybook/manager-webpack5": "6.5.10",
"@storybook/react": "6.5.10",
"@storybook/theming": "6.5.10",
"@testing-library/dom": "8.17.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "13.3.0",
Expand Down
Loading

0 comments on commit e1a4c20

Please sign in to comment.