Skip to content

Commit de7b69e

Browse files
author
Ryan Sites
authored
Feature/react peer dependency (#3)
* close * linting after upgrade to react 17 * update docs
1 parent 27ba8d5 commit de7b69e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+16795
-8567
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/*.js

.eslintrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": [
5+
"@typescript-eslint"
6+
],
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:@typescript-eslint/recommended"
11+
],
12+
"rules": {
13+
"@typescript-eslint/consistent-type-assertions": 0,
14+
"@typescript-eslint/no-explicit-any": 0,
15+
"no-mixed-spaces-and-tabs": 0
16+
}
17+
}

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ typings/
4848
# dotenv environment variables file
4949
.env
5050

51-
# VS Code
52-
.vscode
53-
5451
# OSX
5552
.DS_Store
5653

.storybook/main.js

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
module.exports = {
2-
stories: ['../stories/**/*.(tsx|mdx)'],
3-
addons: ['@storybook/addon-actions', '@storybook/addon-links', '@storybook/addon-docs'],
4-
webpackFinal: async config => {
5-
config.module.rules.push({
6-
test: /\.(ts|tsx)$/,
7-
use: [
8-
{
9-
loader: require.resolve('ts-loader'),
10-
},
11-
// Optional
12-
{
13-
loader: require.resolve('react-docgen-typescript-loader'),
14-
},
15-
],
16-
});
17-
config.resolve.extensions.push('.ts', '.tsx');
18-
return config;
19-
},
20-
};
21-
2+
"stories": [
3+
"../src/stories/*.@(tsx|mdx)"
4+
],
5+
"addons": [
6+
"@storybook/addon-essentials",
7+
"@storybook/preset-create-react-app"
8+
],
9+
typescript: {
10+
check: false,
11+
checkOptions: {},
12+
reactDocgen: 'react-docgen-typescript',
13+
reactDocgenTypescriptOptions: {
14+
shouldExtractLiteralValuesFromEnum: true,
15+
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
16+
},
17+
}
18+
}

.storybook/preview.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { CSSReset, ThemeProvider } from "@chakra-ui/core";
44
import '@storybook/addon-console';
55

66

7+
export const parameters = {
8+
controls: { expanded: false },
9+
};
10+
711
const AppProvider = ({ children }) => {
812
return (
913
<ThemeProvider>

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"samverschueren.linter-xo",
4+
"esbenp.prettier-vscode"
5+
]
6+
}

.vscode/settings.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"xo.enable": true,
3+
"xo.format.enable": true,
4+
"javascript.format.enable": false,
5+
"javascript.validate.enable": false,
6+
"prettier.tabWidth": 4,
7+
"prettier.singleQuote": true,
8+
"[json]": {
9+
"editor.formatOnSave": true,
10+
"editor.defaultFormatter": "esbenp.prettier-vscode"
11+
},
12+
"[javascript]": {
13+
"editor.formatOnSave": true,
14+
"editor.defaultFormatter": "samverschueren.linter-xo"
15+
},
16+
"[typescript]": {
17+
"editor.formatOnSave": true,
18+
"editor.defaultFormatter": "samverschueren.linter-xo"
19+
},
20+
"[typescriptreact]": {
21+
"editor.formatOnSave": true,
22+
"editor.defaultFormatter": "samverschueren.linter-xo"
23+
}
24+
}

docs-wrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react'
22
import {ThemeProvider} from '@chakra-ui/core'
33

44
const DocsWrapper = (props: any): JSX.Element => {
5-
return <ThemeProvider>{props.children}</ThemeProvider>
5+
return <ThemeProvider>{props.children}</ThemeProvider>
66
}
77

88
export default DocsWrapper

docs/_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/asset-manifest.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"files": {
3+
"main.js": "./main.1566dacf1a4a4329815e.bundle.js",
4+
"main.js.map": "./main.1566dacf1a4a4329815e.bundle.js.map",
5+
"runtime~main.js": "./runtime~main.1566dacf1a4a4329815e.bundle.js",
6+
"runtime~main.js.map": "./runtime~main.1566dacf1a4a4329815e.bundle.js.map",
7+
"vendors~main.js": "./vendors~main.1566dacf1a4a4329815e.bundle.js",
8+
"vendors~main.js.map": "./vendors~main.1566dacf1a4a4329815e.bundle.js.map",
9+
"iframe.html": "./iframe.html",
10+
"vendors~main.1566dacf1a4a4329815e.bundle.js.LICENSE.txt": "./vendors~main.1566dacf1a4a4329815e.bundle.js.LICENSE.txt"
11+
},
12+
"entrypoints": [
13+
"runtime~main.1566dacf1a4a4329815e.bundle.js",
14+
"vendors~main.1566dacf1a4a4329815e.bundle.js",
15+
"main.1566dacf1a4a4329815e.bundle.js"
16+
]
17+
}

docs/iframe.html

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,41 @@
44
display: none;
55
}
66

7+
.sb-show-main.sb-main-centered {
8+
margin: 0;
9+
display: flex;
10+
align-items: center;
11+
min-height: 100vh;
12+
}
13+
14+
.sb-show-main.sb-main-centered #root {
15+
box-sizing: border-box;
16+
margin: auto;
17+
padding: 1rem;
18+
max-height: 100%; /* Hack for centering correctly in IE11 */
19+
}
20+
21+
/* Vertical centering fix for IE11 */
22+
@media screen and (-ms-high-contrast: none), (-ms-high-contrast: active) {
23+
.sb-show-main.sb-main-centered:after {
24+
content: '';
25+
min-height: inherit;
26+
font-size: 0;
27+
}
28+
}
29+
30+
.sb-show-main.sb-main-fullscreen {
31+
margin: 0;
32+
padding: 0;
33+
display: block;
34+
}
35+
36+
.sb-show-main.sb-main-padded {
37+
margin: 0;
38+
padding: 1rem;
39+
display: block;
40+
}
41+
742
.sb-wrapper {
843
position: fixed;
944
top: 0;
@@ -68,7 +103,31 @@
68103
} catch (e) {
69104
// eslint-disable-next-line no-console
70105
console.warn('unable to connect to top frame for connecting dev tools');
71-
}</script><style>#root[hidden],
106+
}
107+
108+
window.onerror = function onerror(message, source, line, column, err) {
109+
if (window.CONFIG_TYPE !== 'DEVELOPMENT') return;
110+
// eslint-disable-next-line no-var, vars-on-top
111+
var xhr = new window.XMLHttpRequest();
112+
xhr.open('POST', '/runtime-error');
113+
xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
114+
xhr.send(
115+
JSON.stringify({
116+
/* eslint-disable object-shorthand */
117+
message: message,
118+
source: source,
119+
line: line,
120+
column: column,
121+
error: err && { message: err.message, name: err.name, stack: err.stack },
122+
origin: 'preview',
123+
/* eslint-enable object-shorthand */
124+
})
125+
);
126+
};</script><style>#root[hidden],
72127
#docs-root[hidden] {
73128
display: none !important;
74-
}</style></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script src="runtime~main.a0d100945b4ae350a012.bundle.js"></script><script src="vendors~main.a0d100945b4ae350a012.bundle.js"></script><script src="main.a0d100945b4ae350a012.bundle.js"></script></body></html>
129+
}</style></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script>window['LOGLEVEL'] = "info";
130+
131+
132+
133+
window['FRAMEWORK_OPTIONS'] = {};</script><script src="runtime~main.1566dacf1a4a4329815e.bundle.js"></script><script src="vendors~main.1566dacf1a4a4329815e.bundle.js"></script><script src="main.1566dacf1a4a4329815e.bundle.js"></script></body></html>

docs/index.html

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
width: 100%;
55
margin: 0;
66
padding: 0;
7+
}
8+
9+
* {
10+
box-sizing: border-box;
711
}</style><script>/* globals window */
812
/* eslint-disable no-underscore-dangle */
913
try {
@@ -13,7 +17,39 @@
1317
} catch (e) {
1418
// eslint-disable-next-line no-console
1519
console.warn('unable to connect to top frame for connecting dev tools');
16-
}</script><style>#root[hidden],
20+
}
21+
22+
window.onerror = function onerror(message, source, line, column, err) {
23+
if (window.CONFIG_TYPE !== 'DEVELOPMENT') return;
24+
// eslint-disable-next-line no-var, vars-on-top
25+
var xhr = new window.XMLHttpRequest();
26+
xhr.open('POST', '/runtime-error');
27+
xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
28+
xhr.send(
29+
JSON.stringify({
30+
/* eslint-disable object-shorthand */
31+
message: message,
32+
source: source,
33+
line: line,
34+
column: column,
35+
error: err && { message: err.message, name: err.name, stack: err.stack },
36+
origin: 'manager',
37+
/* eslint-enable object-shorthand */
38+
})
39+
);
40+
};</script><style>#root[hidden],
1741
#docs-root[hidden] {
1842
display: none !important;
19-
}</style></head><body><div id="root"></div><div id="docs-root"></div><script>window['DOCS_MODE'] = true;</script><script src="runtime~main.286b69a873d49f2f199c.bundle.js"></script><script src="vendors~main.67234067e261292dfce3.bundle.js"></script><script src="main.0cc2659f2ebb68b3fe59.bundle.js"></script></body></html>
43+
}</style></head><body><div id="root"></div><div id="docs-root"></div><script>window['CONFIG_TYPE'] = "PRODUCTION";
44+
45+
46+
47+
window['LOGLEVEL'] = "info";
48+
49+
50+
51+
52+
53+
54+
55+
window['DOCS_MODE'] = true;</script><script src="runtime~main.870e8ee0658e83d05c6b.bundle.js"></script><script src="vendors~main.0219844671cc5f2e559c.bundle.js"></script><script src="main.809e7be6a501880262a3.bundle.js"></script></body></html>

docs/main.0cc2659f2ebb68b3fe59.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/main.1566dacf1a4a4329815e.bundle.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/main.1566dacf1a4a4329815e.bundle.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/main.809e7be6a501880262a3.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/main.a0d100945b4ae350a012.bundle.js

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

docs/main.a0d100945b4ae350a012.bundle.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/runtime~main.a0d100945b4ae350a012.bundle.js renamed to docs/runtime~main.1566dacf1a4a4329815e.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/runtime~main.1566dacf1a4a4329815e.bundle.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/runtime~main.286b69a873d49f2f199c.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/runtime~main.870e8ee0658e83d05c6b.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/runtime~main.a0d100945b4ae350a012.bundle.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/sb_dll/storybook_ui-manifest.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/sb_dll/storybook_ui_dll.js

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

docs/vendors~main.0219844671cc5f2e559c.bundle.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)