Skip to content

Commit

Permalink
storybook integration
Browse files Browse the repository at this point in the history
  • Loading branch information
IcculusC committed Oct 28, 2018
1 parent 1a467a2 commit 1e768a5
Show file tree
Hide file tree
Showing 28 changed files with 3,856 additions and 245 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"value":{"success":true,"data":{"latest":{"version":"3.4.11","info":{"plain":"If you see this message in your terminal, please open a GitHub issue"}}},"time":1540694115528},"type":"Object"}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ dist/
nbproject
.idea
.node_history

.cache
1 change: 1 addition & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@storybook/addon-storysource/register";
9 changes: 9 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { configure } from "@storybook/react";

function loadStories() {
require("../stories/HexEngine.js");
require("../stories/Hexagon.js");
// You can require as many stories as you need.
}

configure(loadStories, module);
15 changes: 15 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
module: {
rules: [
{
test: /stories\/(.*)\.js$/,
loaders: [require.resolve("@storybook/addon-storysource/loader")],
enforce: "pre"
},
{
test: /stories\/(.*)\.css$/,
use: [{ loader: "style-loader" }, { loader: "css-loader" }]
}
]
}
};
Binary file added docs/favicon.ico
Binary file not shown.
60 changes: 60 additions & 0 deletions docs/iframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!doctype html><html><head><meta charset="utf-8"><title>Storybook</title><base target="_parent"><style>:not(.sb-show-main) > .sb-main,
:not(.sb-show-nopreview) > .sb-nopreview,
:not(.sb-show-errordisplay) > .sb-errordisplay {
display: none;
}

.sb-wrapper {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
padding: 20px;
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", Roboto, "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
-webkit-font-smoothing: antialiased;
}

.sb-heading {
font-size: 20px;
font-weight: 600;
letter-spacing: 0.2px;
margin: 10px 0;
}

.sb-nopreview {
display: flex;
align-content: center;
justify-content: center;
}

.sb-nopreview_main {
margin: auto;
padding: 30px;
border-radius: 10px;
background: rgba(0,0,0,0.03);
}

.sb-nopreview_heading {
text-align: center;
}

.sb-errordisplay {
background-color: rgb(187, 49, 49);
color: #FFF;
}

.sb-errordisplay_code {
font-size: 14px;
width: 100vw;
overflow: auto;
}</style><script>try {
if (window.parent !== window) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
} catch (e) {
console.warn('unable to connect to parent frame for connecting dev tools');
}</script></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></div></div><div class="sb-errordisplay sb-wrapper"><div id="error-message" class="sb-heading"></div><pre class="sb-errordisplay_code">
<code id="error-stack"></code>
</pre></div><div id="root"></div><script src="static/runtime~iframe.36305751f78a2d599ec4.bundle.js"></script><script src="static/vendors~iframe.7d7f162474e240b3d9f3.bundle.js"></script><script src="static/iframe.46f8c42406195633851e.bundle.js"></script></body></html>
14 changes: 14 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html><html><head><meta charset="utf-8"><title>Storybook</title><style>html, body {
overflow: hidden;
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}</style><script>try {
if (window.parent !== window) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
} catch (e) {
console.warn('unable to connect to parent frame for connecting dev tools');
}</script></head><body><div id="root"></div><script src="static/runtime~manager.9ffd8dd7b8642e4235e2.bundle.js"></script><script src="static/manager.47864dbeb9f5aa493dca.bundle.js"></script></body></html>
2 changes: 2 additions & 0 deletions docs/static/iframe.46f8c42406195633851e.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/static/iframe.46f8c42406195633851e.bundle.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 106 additions & 0 deletions docs/static/manager.47864dbeb9f5aa493dca.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/static/manager.47864dbeb9f5aa493dca.bundle.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/static/runtime~iframe.36305751f78a2d599ec4.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/static/runtime~manager.9ffd8dd7b8642e4235e2.bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions docs/static/vendors~iframe.7d7f162474e240b3d9f3.bundle.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion husky.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
hooks: {
"pre-commit": "yarn test && yarn lint"
"pre-commit": "yarn test && yarn lint",
"pre-push": "yarn storybook:build"
}
};
12 changes: 11 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,15 @@ module.exports = {
"^.+\\.js$": "<rootDir>/node_modules/babel-jest"
},
transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$"],
moduleFileExtensions: ["js"]
moduleFileExtensions: ["js"],
reporters: [
"default",
[
"./node_modules/jest-html-reporter",
{
outputPath: "./test/report.html",
pageTitle: "React Hex Engine"
}
]
]
};
Loading

0 comments on commit 1e768a5

Please sign in to comment.