Skip to content

Commit 5891bd1

Browse files
zackjones11Zack JonesNikolai Lopin
authored
docs: migrate from docz to storybook (#312)
Docz is not supported anymore. We decided to migrate to a stable solution Co-authored-by: Zack Jones <[email protected]> Co-authored-by: Nikolai Lopin <[email protected]>
1 parent c9f7f6f commit 5891bd1

33 files changed

+37267
-55270
lines changed

.eslintignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
node_modules/
33

44
# generated files
5-
.docz/
5+
storybook-static/
66
lib/
77

88
# other
@@ -12,4 +12,3 @@ assets/
1212
fixtures/
1313

1414
src/icons/
15-
src/gatsby-theme-docz

.eslintrc.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ module.exports = {
88
'plugin:jest/recommended',
99
'plugin:promise/recommended',
1010
'plugin:unicorn/recommended',
11-
'prettier'
11+
'prettier',
12+
'plugin:storybook/recommended',
13+
'plugin:storybook/recommended'
1214
],
1315
env: {
1416
node: true,
@@ -21,11 +23,8 @@ module.exports = {
2123
rules: {
2224
// conflicts with stylelint rule
2325
'unicorn/numeric-separators-style': 'off',
24-
2526
'unicorn/no-useless-undefined': 'off',
26-
2727
'@typescript-eslint/no-unsafe-return': 'off',
28-
2928
'@typescript-eslint/no-unsafe-assignment': 'off',
3029
'react/require-default-props': 'off',
3130
// Often used for this library
@@ -35,7 +34,7 @@ module.exports = {
3534
'no-prototype-builtins': 'off',
3635
// https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html
3736
'import/prefer-default-export': 'off',
38-
'import/no-default-export': 'error',
37+
'import/no-default-export': 'off',
3938
// Too restrictive: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
4039
'react/destructuring-assignment': 'off',
4140
// No jsx extension: https://github.com/facebook/create-react-app/issues/87#issuecomment-234627904
@@ -47,14 +46,21 @@ module.exports = {
4746
'@typescript-eslint/explicit-function-return-type': 'off',
4847
'@typescript-eslint/no-use-before-define': [
4948
'error',
50-
{ functions: false, classes: true, variables: true, typedefs: true }
49+
{
50+
functions: false,
51+
classes: true,
52+
variables: true,
53+
typedefs: true
54+
}
5155
],
5256
// Common abbreviations are known and readable
5357
'unicorn/prevent-abbreviations': 'off',
5458
// Airbnb prefers forEach
5559
'unicorn/no-array-for-each': 'off',
5660
// It's not accurate in the monorepo style
57-
'import/no-extraneous-dependencies': 'off'
61+
'import/no-extraneous-dependencies': 'off',
62+
// Storybook Template.bind returns any type
63+
'@typescript-eslint/no-unsafe-member-access': 'off'
5864
},
5965
overrides: [
6066
{

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
run: npm run build:documentation
2323
- uses: actions/upload-artifact@v3
2424
with:
25-
name: docz-dist
26-
path: .docz/dist
25+
name: storybook-dist
26+
path: storybook-static
2727

2828
deploy:
2929
if: github.ref == 'refs/heads/main'
@@ -32,7 +32,7 @@ jobs:
3232
steps:
3333
- uses: actions/download-artifact@v3
3434
with:
35-
name: docz-dist
35+
name: storybook-dist
3636
path: public
3737
- name: Deploy
3838
uses: peaceiris/actions-gh-pages@v3

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ coverage/
88
junit.xml
99

1010
# project files
11-
.docz/
11+
storybook-static/
1212
*.tgz
1313
.npmrc
1414
node_modules/

.storybook/main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
stories: ['../src/stories/**/*.stories.@(ts|tsx)'],
3+
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions'],
4+
framework: '@storybook/react'
5+
};

.storybook/preview.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export const parameters = {
2+
actions: { argTypesRegex: '^on[A-Z].*' },
3+
viewMode: 'docs',
4+
controls: {
5+
matchers: {
6+
color: /(background|color)$/i,
7+
date: /Date$/
8+
}
9+
}
10+
};

CONTRIBUTING.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,18 @@ If an unreviewed ticket reports a bug, try and reproduce it. If you can reproduc
104104

105105
Our documentation is great but it can always be improved. Did you find a typo? Do you think that something should be clarified? Go ahead and suggest a documentation patch!
106106

107-
We use [Docz](https://www.docz.site) to run our documentation site at [wave.free-now.com](https://wave.free-now.com/).
107+
We use [Storybook](https://storybook.js.org) to run our documentation site at [wave.free-now.com](https://wave.free-now.com/).
108108

109109
To add a new component to our documentation site:
110110

111-
1. Create a new file with the `.md` extension for your component in `/components/[component]/docs`.
112-
2. Add the markdown header for the page name, route and parent menu
113-
3. Include a brief description, examples as well as the the `Playground` and `Props` components of [Docz].
111+
1. Create a new file with the `.stories.tsx` prefix for your component in `/src/stories`.
112+
2. Include a brief description and examples. Props should be configurable via Storybook
113+
114+
To learn more how to add stories go to [Storybook docs](https://storybook.js.org/docs/react/writing-stories/introduction)
114115

115116
### Reporting pains and use cases
116117

117-
Speak outloud for us to understand your pains is valuable, challenge current approaches and help us to understand how to do better. Make sure to verify that the topic hasn't being touched yet on the issues poll otherwise open a new one and let's start the conversation
118+
Speak out loud for us to understand your pains is valuable, challenge current approaches and help us to understand how to do better. Make sure to verify that the topic hasn't being touched yet on the issues poll otherwise open a new one and let's start the conversation
118119

119120
### Take from the backlog
120121

doczrc.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

gatsby-config.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)