Add dynamic stories

This commit is contained in:
dominik-zeglen 2019-09-02 15:20:36 +02:00
parent 17cba3b6fa
commit 7290087680
4 changed files with 30 additions and 32 deletions

View file

@ -37,7 +37,8 @@ module.exports = api => {
extractFromFormatMessageCall: true,
messagesDir: "build/locale/"
}
]
],
"macros"
];
return {

50
package-lock.json generated
View file

@ -9409,8 +9409,7 @@
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"optional": true
"bundled": true
},
"aproba": {
"version": "1.2.0",
@ -9428,13 +9427,11 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"optional": true
"bundled": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -9447,18 +9444,15 @@
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"optional": true
"bundled": true
},
"core-util-is": {
"version": "1.0.2",
@ -9561,8 +9555,7 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true,
"optional": true
"bundled": true
},
"ini": {
"version": "1.3.5",
@ -9572,7 +9565,6 @@
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -9585,20 +9577,17 @@
"minimatch": {
"version": "3.0.4",
"bundled": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"optional": true
"bundled": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -9615,7 +9604,6 @@
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -9688,8 +9676,7 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"optional": true
"bundled": true
},
"object-assign": {
"version": "4.1.1",
@ -9699,7 +9686,6 @@
"once": {
"version": "1.4.0",
"bundled": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -9775,8 +9761,7 @@
},
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"optional": true
"bundled": true
},
"safer-buffer": {
"version": "2.1.2",
@ -9806,7 +9791,6 @@
"string-width": {
"version": "1.0.2",
"bundled": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -9824,7 +9808,6 @@
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -9863,13 +9846,11 @@
},
"wrappy": {
"version": "1.0.2",
"bundled": true,
"optional": true
"bundled": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"optional": true
"bundled": true
}
}
},
@ -16962,6 +16943,15 @@
"tough-cookie": "^2.3.3"
}
},
"require-context.macro": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/require-context.macro/-/require-context.macro-1.1.1.tgz",
"integrity": "sha512-l1XH5HruDyG+Iwo5pz39EGbOFVtoYQt8cl7mJ6KJFWzARNJnpb+XUui+jBQUGlJ8SJOdx+QDh784e8b42PxLXA==",
"dev": true,
"requires": {
"@types/webpack-env": "^1.14.0"
}
},
"require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",

View file

@ -120,6 +120,7 @@
"react-intl-po": "^2.2.2",
"react-test-renderer": "^16.8.6",
"regenerator-runtime": "^0.11.1",
"require-context.macro": "^1.1.1",
"rimraf": "^2.7.0",
"testcafe": "^1.3.3",
"ts-jest": "^23.10.5",

View file

@ -1,7 +1,13 @@
/* eslint-disable */
const { configure } = require("@storybook/react");
import requireContext from "require-context.macro";
import { configure } from "@storybook/react";
const req = requireContext("../", true, /.stories.tsx$/);
function loadStories() {
// Story autodiscovery
req.keys().forEach(filename => req(filename));
// Components
require("./stories/components/ActionDialog");
require("./stories/components/AddressEdit");