-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from storybooks/next
Update to latest
- Loading branch information
Showing
1,730 changed files
with
130,444 additions
and
52,039 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
const withTests = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ shippedProposals: true, useBuiltIns: 'usage', corejs: '3', targets: { node: 'current' } }, | ||
], | ||
], | ||
plugins: [ | ||
'babel-plugin-require-context-hook', | ||
'babel-plugin-dynamic-import-node', | ||
'@babel/plugin-transform-runtime', | ||
], | ||
}; | ||
|
||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage', corejs: '3' }], | ||
'@babel/preset-typescript', | ||
'@babel/preset-react', | ||
'@babel/preset-flow', | ||
], | ||
plugins: [ | ||
[ | ||
'@babel/plugin-proposal-decorators', | ||
{ | ||
legacy: true, | ||
}, | ||
], | ||
['@babel/plugin-proposal-class-properties', { loose: true }], | ||
'@babel/plugin-proposal-export-default-from', | ||
'@babel/plugin-syntax-dynamic-import', | ||
['@babel/plugin-proposal-object-rest-spread', { loose: true, useBuiltIns: true }], | ||
'babel-plugin-macros', | ||
['emotion', { sourceMap: true, autoLabel: true }], | ||
], | ||
env: { | ||
test: withTests, | ||
}, | ||
overrides: [ | ||
{ | ||
test: './examples/vue-kitchen-sink', | ||
presets: ['babel-preset-vue'], | ||
env: { | ||
test: withTests, | ||
}, | ||
}, | ||
{ | ||
test: './lib', | ||
presets: [ | ||
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage', corejs: '3' }], | ||
'@babel/preset-react', | ||
], | ||
plugins: [ | ||
['@babel/plugin-proposal-object-rest-spread', { loose: true, useBuiltIns: true }], | ||
'@babel/plugin-proposal-export-default-from', | ||
'@babel/plugin-syntax-dynamic-import', | ||
['@babel/plugin-proposal-class-properties', { loose: true }], | ||
'babel-plugin-macros', | ||
['emotion', { sourceMap: true, autoLabel: true }], | ||
'@babel/plugin-transform-react-constant-elements', | ||
'babel-plugin-add-react-displayname', | ||
], | ||
env: { | ||
test: withTests, | ||
}, | ||
}, | ||
{ | ||
test: [ | ||
'./lib/core/src/server', | ||
'./lib/node-logger', | ||
'./lib/codemod', | ||
'./addons/storyshots', | ||
'./addons/storysource/src/loader', | ||
'./app/**/src/server/**', | ||
'./app/**/src/bin/**', | ||
], | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
shippedProposals: true, | ||
useBuiltIns: 'usage', | ||
targets: { | ||
node: '8.11', | ||
}, | ||
corejs: '3', | ||
}, | ||
], | ||
], | ||
plugins: [ | ||
'emotion', | ||
'babel-plugin-macros', | ||
['@babel/plugin-proposal-class-properties', { loose: true }], | ||
'@babel/plugin-proposal-object-rest-spread', | ||
'@babel/plugin-proposal-export-default-from', | ||
], | ||
env: { | ||
test: withTests, | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { fail, danger } from 'danger'; | ||
import { execSync } from 'child_process'; | ||
|
||
execSync('npm install lodash'); | ||
|
||
const { flatten, intersection, isEmpty } = require('lodash'); | ||
|
||
const pkg = require('../../package.json'); // eslint-disable-line import/newline-after-import | ||
const prLogConfig = pkg['pr-log']; | ||
|
||
const Versions = { | ||
PATCH: 'PATCH', | ||
MINOR: 'MINOR', | ||
MAJOR: 'MAJOR', | ||
}; | ||
|
||
const branchVersion = Versions.MINOR; | ||
|
||
const checkRequiredLabels = labels => { | ||
const forbiddenLabels = flatten([ | ||
'do not merge', | ||
'in progress', | ||
branchVersion !== Versions.MAJOR ? 'BREAKING CHANGE' : [], | ||
branchVersion === Versions.PATCH ? 'feature request' : [], | ||
]); | ||
|
||
const requiredLabels = flatten([prLogConfig.skipLabels || [], (prLogConfig.validLabels || []).map(keyVal => keyVal[0])]); | ||
|
||
const blockingLabels = intersection(forbiddenLabels, labels); | ||
if (!isEmpty(blockingLabels)) { | ||
fail(`PR is marked with ${blockingLabels.map(label => `"${label}"`).join(', ')} label${blockingLabels.length > 1 ? 's' : ''}.`); | ||
} | ||
|
||
const foundLabels = intersection(requiredLabels, labels); | ||
if (isEmpty(foundLabels)) { | ||
fail(`PR is not labeled with one of: ${JSON.stringify(requiredLabels)}`); | ||
} else if (foundLabels.length > 1) { | ||
fail(`Please choose only one of these labels: ${JSON.stringify(foundLabels)}`); | ||
} | ||
}; | ||
|
||
if (prLogConfig) { | ||
const { labels } = danger.github.issue; | ||
checkRequiredLabels(labels.map(l => l.name)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.