Skip to content

Commit

Permalink
Merge pull request #4900 from storybooks/core/separate-manager-previe…
Browse files Browse the repository at this point in the history
…w-p6

REPLACE babel/runtime with core-js
  • Loading branch information
ndelangen authored Dec 4, 2018
2 parents 887aedc + baca9ba commit 3a06253
Show file tree
Hide file tree
Showing 92 changed files with 2,452 additions and 2,616 deletions.
15 changes: 7 additions & 8 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { shippedProposals: true }],
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage', modules: false }],
'@babel/preset-react',
'@babel/preset-flow',
],
Expand All @@ -10,22 +10,17 @@ module.exports = {
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-export-default-from',
[
'@babel/plugin-transform-runtime',
{
regenerator: true,
},
],
],
env: {
test: {
presets: [['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage' }]],
plugins: ['babel-plugin-require-context-hook', 'babel-plugin-dynamic-import-node'],
},
},
overrides: [
{
test: './examples/vue-kitchen-sink',
presets: [['@babel/preset-env', { shippedProposals: true }], 'babel-preset-vue'],
presets: ['babel-preset-vue'],
},
{
test: [
Expand All @@ -35,11 +30,15 @@ module.exports = {
'./addons/storyshots',
'./addons/storysource/src/loader',
'./app/**/src/server/**',
'./app/**/src/bin/**',
'./dangerfile.js',
],
presets: [
[
'@babel/preset-env',
{
shippedProposals: true,
useBuiltIns: 'usage',
targets: {
node: '8.11',
},
Expand Down
6 changes: 3 additions & 3 deletions addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"verify"
],
"homepage": "https://github.com/storybooks/storybook#readme",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand All @@ -40,5 +37,8 @@
"peerDependencies": {
"react": "*",
"react-dom": "*"
},
"publishConfig": {
"access": "public"
}
}
6 changes: 3 additions & 3 deletions addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"storybook"
],
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/actions",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand Down Expand Up @@ -39,5 +36,8 @@
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
}
6 changes: 3 additions & 3 deletions addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"storybook"
],
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/backgrounds",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand All @@ -37,5 +34,8 @@
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
}
6 changes: 3 additions & 3 deletions addons/centered/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"storybook"
],
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/centered",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand All @@ -26,5 +23,8 @@
},
"dependencies": {
"global": "^4.3.2"
},
"publishConfig": {
"access": "public"
}
}
6 changes: 3 additions & 3 deletions addons/cssresources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"storybook"
],
"homepage": "https://storybook.js.org",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand All @@ -38,5 +35,8 @@
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
}
6 changes: 3 additions & 3 deletions addons/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"storybook"
],
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/events",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand All @@ -37,5 +34,8 @@
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
}
6 changes: 3 additions & 3 deletions addons/google-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"addon",
"storybook"
],
"publishConfig": {
"access": "public"
},
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/google-analytics",
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
Expand All @@ -27,5 +24,8 @@
"@storybook/addons": "4.1.0-alpha.10",
"global": "^4.3.2",
"react-ga": "^2.5.3"
},
"publishConfig": {
"access": "public"
}
}
6 changes: 3 additions & 3 deletions addons/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"storybook"
],
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/graphql",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand All @@ -31,5 +28,8 @@
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
}
7 changes: 3 additions & 4 deletions addons/info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"storybook"
],
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/info",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand All @@ -28,7 +25,6 @@
"@storybook/addons": "4.1.0-alpha.10",
"@storybook/client-logger": "4.1.0-alpha.10",
"@storybook/components": "4.1.0-alpha.10",
"core-js": "2.5.7",
"global": "^4.3.2",
"marksy": "^6.1.0",
"nested-object-assign": "^1.0.1",
Expand All @@ -42,5 +38,8 @@
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
}
1 change: 0 additions & 1 deletion addons/info/src/components/PropTable.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import PropTypes from 'prop-types';
import React from 'react';
import 'core-js/fn/array/includes';

import { Table, Td, Th } from '@storybook/components';
import PropVal from './PropVal';
Expand Down
6 changes: 3 additions & 3 deletions addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"unit-testing"
],
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/jest",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand All @@ -40,5 +37,8 @@
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
}
30 changes: 14 additions & 16 deletions addons/jest/src/components/Result.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,22 @@ const Message = ({ msg }) => {
.join('')
.split(/\[22m/)
.reduce((acc, item) => acc.concat(item), [])
.map(
(item, li) =>
typeof item === 'string'
? item
.split(/\[32m(.*?)\[39m/)
// eslint-disable-next-line react/no-array-index-key
.map((i, index) => (index % 2 ? <Positive key={`p_${li}_${i}`}>{i}</Positive> : i))
: item
.map((item, li) =>
typeof item === 'string'
? item
.split(/\[32m(.*?)\[39m/)
// eslint-disable-next-line react/no-array-index-key
.map((i, index) => (index % 2 ? <Positive key={`p_${li}_${i}`}>{i}</Positive> : i))
: item
)
.reduce((acc, item) => acc.concat(item), [])
.map(
(item, li) =>
typeof item === 'string'
? item
.split(/\[31m(.*?)\[39m/)
// eslint-disable-next-line react/no-array-index-key
.map((i, index) => (index % 2 ? <Negative key={`n_${li}_${i}`}>{i}</Negative> : i))
: item
.map((item, li) =>
typeof item === 'string'
? item
.split(/\[31m(.*?)\[39m/)
// eslint-disable-next-line react/no-array-index-key
.map((i, index) => (index % 2 ? <Negative key={`n_${li}_${i}`}>{i}</Negative> : i))
: item
)
.reduce((acc, item) => acc.concat(item), [])
.reduce(createSubgroup, {
Expand Down
6 changes: 3 additions & 3 deletions addons/knobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"storybook"
],
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/knobs",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand Down Expand Up @@ -40,5 +37,8 @@
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
}
34 changes: 18 additions & 16 deletions addons/knobs/src/components/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,24 @@ export default class Panel extends PureComponent {

let knobsArray = Object.keys(knobs).filter(key => knobs[key].used);

knobsArray.filter(key => knobs[key].groupId).forEach(key => {
const knobKeyGroupId = knobs[key].groupId;
groupIds.push(knobKeyGroupId);
groups[knobKeyGroupId] = {
render: ({ active: groupActive, selected }) => (
<TabWrapper active={groupActive || selected === DEFAULT_GROUP_ID}>
<PropForm
knobs={knobsArray.filter(knob => knob.groupId === knobKeyGroupId)}
onFieldChange={this.handleChange}
onFieldClick={this.handleClick}
/>
</TabWrapper>
),
title: knobKeyGroupId,
};
});
knobsArray
.filter(key => knobs[key].groupId)
.forEach(key => {
const knobKeyGroupId = knobs[key].groupId;
groupIds.push(knobKeyGroupId);
groups[knobKeyGroupId] = {
render: ({ active: groupActive, selected }) => (
<TabWrapper active={groupActive || selected === DEFAULT_GROUP_ID}>
<PropForm
knobs={knobsArray.filter(knob => knob.groupId === knobKeyGroupId)}
onFieldChange={this.handleChange}
onFieldClick={this.handleClick}
/>
</TabWrapper>
),
title: knobKeyGroupId,
};
});

groups[DEFAULT_GROUP_ID] = {
render: () => null,
Expand Down
6 changes: 3 additions & 3 deletions addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"storybook"
],
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/links",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand All @@ -32,5 +29,8 @@
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
}
6 changes: 3 additions & 3 deletions addons/notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"storybook"
],
"homepage": "https://github.com/storybooks/storybook/tree/master/addons/notes",
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/storybooks/storybook/issues"
},
Expand All @@ -32,5 +29,8 @@
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
}
Loading

0 comments on commit 3a06253

Please sign in to comment.