Skip to content
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

Merged
merged 19 commits into from
Mar 1, 2019
Merged

Feature/storybook5 #113

merged 19 commits into from
Mar 1, 2019

Conversation

zoltanbedi
Copy link
Contributor

@zoltanbedi zoltanbedi commented Feb 18, 2019

Storybook upgrade ➡ v5

Things I changed in this pr:

  • removed tslint.autosave from .vscode\settings.json (with the new tslint plugin this setting is not working. Also the precommit hook will fix tslint settings if any)
  • Storybook related stuff
    • removed unused dependencies
      • @date-io/date-fns
      • react-redux
      • @storybook/addon-jest
      • @types/memory-fs
      • babel-core
      • babel-runtime
      • date-fns
      • html-loader
      • markdown-loader
      • moment
      • raw-loader
      • storybook-addon-material-ui
      • ts-loader
      • url-loader
    • 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 js & jsx to pre commit check to run prettier on them
  • 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:

@codecov
Copy link

codecov bot commented Feb 18, 2019

Codecov Report

Merging #113 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3d7443...2cb2a20. Read the comment docs.

@zoltanbedi zoltanbedi marked this pull request as ready for review February 20, 2019 13:03
Copy link
Contributor

@kultsar kultsar left a 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)

image

@zoltanbedi zoltanbedi merged commit 9569b0b into develop Mar 1, 2019
@zoltanbedi zoltanbedi deleted the feature/storybook5 branch March 1, 2019 08:02
if (!module.built || module.external || !module.rawRequest) {
return
}
if (/\/src.+.tsx/.test(module.request)) {
Copy link

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);
              }
            });

Copy link
Contributor Author

@zoltanbedi zoltanbedi Mar 14, 2019

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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants