-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/storybook5 #113
Feature/storybook5 #113
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #113 +/- ##
========================================
Coverage 85.79% 85.79%
========================================
Files 109 109
Lines 3203 3203
Branches 761 761
========================================
Hits 2748 2748
Misses 455 455 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DateTimePicker, new mode, TypeError (note: this is a bug in previous version of storybook as well)
e.split is not a function
at t.setValue (https://sn-react-component-docs.netlify.com/static/iframe.eaeab064f68f7f59dc8c.bundle.js:1:19211)
at new t (https://sn-react-component-docs.netlify.com/static/iframe.eaeab064f68f7f59dc8c.bundle.js:1:18999)
at Ko (https://sn-react-component-docs.netlify.com/static/vendors~iframe.a7ea2e5b105d0d0adbe3.bundle.js:93:54981)
at ei (https://sn-react-component-docs.netlify.com/static/vendors~iframe.a7ea2e5b105d0d0adbe3.bundle.js:93:60314)
at Ci (https://sn-react-component-docs.netlify.com/static/vendors~iframe.a7ea2e5b105d0d0adbe3.bundle.js:93:74350)
at Di (https://sn-react-component-docs.netlify.com/static/vendors~iframe.a7ea2e5b105d0d0adbe3.bundle.js:93:74696)
at ca (https://sn-react-component-docs.netlify.com/static/vendors~iframe.a7ea2e5b105d0d0adbe3.bundle.js:93:79364)
at ua (https://sn-react-component-docs.netlify.com/static/vendors~iframe.a7ea2e5b105d0d0adbe3.bundle.js:93:79018)
at Li (https://sn-react-component-docs.netlify.com/static/vendors~iframe.a7ea2e5b105d0d0adbe3.bundle.js:93:77530)
at ba (https://sn-react-component-docs.netlify.com/static/vendors~iframe.a7ea2e5b105d0d0adbe3.bundle.js:93:85978)
moved scripts closer to the top of the package.json file
…lient into feature/storybook5
if (!module.built || module.external || !module.rawRequest) { | ||
return | ||
} | ||
if (/\/src.+.tsx/.test(module.request)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regexp is not work on windows.
/\/src.+.tsx/.test(module.request)
windows separator is
this code work for me on windows
const ts = require("typescript");
+ const path = require("path");
class DocgenPlugin {
apply(compiler) {
+ const re = RegExp(`\\${path.sep}src.+\.tsx`);
compiler.hooks.compilation.tap("DocgenPlugin", compilation => {
compilation.hooks.seal.tap("DocgenPlugin", modules => {
const modulesToProcess = [];
compilation.modules.forEach(module => {
const { built, external, rawRequest, request } = module;
// Skip ignored / external modules
if (!module.built || module.external || !module.rawRequest) {
return;
}
- if (/\/src.+.tsx/.test(module.request)) {
+ if (re.test(module.request)) {
modulesToProcess.push(module);
}
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I've never realized that. I use wsl in windows for development and our builds are on a linux machine. Thanks for pointing that out 😄
Storybook upgrade ➡ v5
Things I changed in this pr:
removed unused dependencies
changed webpack.config.js to use ts-config-webpack-plugin, added a docgen plugin that generates proptables for typescript react components ( this reduced build time from 1.5 min to ~17 seconds)
withInfo added as a global decorator
removed muiTheme from stories
passed the notes as a parameter instead of
withMarkdownNotes()
added storybook packages to nohoist - without nohoist storybook 5 runs with theming related errors because of duplicate packages - see (5.0.0-rc4 - cannot read property 'secondary' of undefined storybookjs/storybook#5706)Needs to be done: