Skip to content

Fix storyshots with new babel config#1721

Merged
shilman merged 2 commits intostorybookjs:masterfrom
satazor:patch-1
Aug 23, 2017
Merged

Fix storyshots with new babel config#1721
shilman merged 2 commits intostorybookjs:masterfrom
satazor:patch-1

Conversation

@satazor
Copy link
Copy Markdown
Contributor

@satazor satazor commented Aug 23, 2017

Issue: #1720

What I did

Set modules to 'commonjs' when NODE_ENV === 'test'.

How to test

Simply test against the storyshot demos.

@satazor
Copy link
Copy Markdown
Contributor Author

satazor commented Aug 23, 2017

//cc @ndelangen @shilman

It turns out there was one more issue regarding storyshots on the newest releases.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 23, 2017

Codecov Report

Merging #1721 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1721   +/-   ##
=======================================
  Coverage   21.18%   21.18%           
=======================================
  Files         252      252           
  Lines        5694     5694           
  Branches      684      692    +8     
=======================================
  Hits         1206     1206           
+ Misses       3965     3941   -24     
- Partials      523      547   +24
Impacted Files Coverage Δ
app/vue/src/server/config/babel.js 0% <ø> (-100%) ⬇️
app/react-native/src/server/config/babel.js 0% <ø> (ø) ⬆️
app/react/src/server/config/babel.js 100% <ø> (+100%) ⬆️
app/vue/src/server/babel_config.js 0% <0%> (-83.88%) ⬇️
app/react/src/server/utils.js 0% <0%> (-32.15%) ⬇️
lib/ui/src/modules/ui/configs/init_panels.js 25% <0%> (ø) ⬆️
addons/storyshots/src/storybook-channel-mock.js 0% <0%> (ø) ⬆️
lib/ui/src/modules/ui/routes.js 0% <0%> (ø) ⬆️
addons/knobs/src/react/WrapStory.js 12% <0%> (ø) ⬆️
... and 19 more

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 658e359...c5fc849. Read the comment docs.

Comment thread app/react/src/server/config/babel.js Outdated
browsers: ['last 2 versions', 'safari >= 7'],
},
modules: false,
modules: process.env.NODE_ENV === 'test' ? undefined : false,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if we should do undefined here or commonjs. the default for this is commonjs but I'm worried it might change in future versions and break support.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change it. Anyways, if they change the default it will be a major bump.

Want me to set to commonjs?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah let's do commonjs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! Also did the same for vue and react-native

Copy link
Copy Markdown
Member

@danielduan danielduan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on crna-kitchen-sink and cra-kitchen-sink

We don't have storyshots set up for vue-kitchen-sink yet.

@shilman shilman merged commit f4f223e into storybookjs:master Aug 23, 2017
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.

3 participants