Skip to content

Commit

Permalink
Merge pull request #1 from storybooks/next
Browse files Browse the repository at this point in the history
Update to latest
  • Loading branch information
Stephanemw authored May 20, 2019
2 parents 33ed8d9 + a08f44e commit 9db00b3
Show file tree
Hide file tree
Showing 1,730 changed files with 130,444 additions and 52,039 deletions.
53 changes: 0 additions & 53 deletions .babelrc

This file was deleted.

102 changes: 102 additions & 0 deletions .babelrc.js
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,
},
},
],
};
45 changes: 45 additions & 0 deletions .ci/danger/dangerfile.ts
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));
}
84 changes: 79 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ jobs:
- addons
- app
- lib
chromatic:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Run chromatic on the pre-built storybook
command: yarn chromatic -- -d ./storybook-static
examples:
<<: *defaults
steps:
Expand All @@ -54,6 +63,11 @@ jobs:
command: |
cd examples/cra-kitchen-sink
yarn build-storybook
- run:
name: Build react typescript kitchen-sink
command: |
cd examples/cra-ts-kitchen-sink
yarn build-storybook
- run:
name: Build vue kitchen-sink
command: |
Expand Down Expand Up @@ -99,17 +113,35 @@ jobs:
command: |
cd examples/riot-kitchen-sink
yarn build-storybook
- run:
name: Build preact kitchen-sink
command: |
cd examples/preact-kitchen-sink
yarn build-storybook
- run:
name: Build cra react15
command: |
cd examples/cra-react15
yarn build-storybook
- run:
name: Build official-storybook
command: |
cd examples/official-storybook
yarn build-storybook
- run:
name: Run image snapshots
command: yarn test --image
# - run:
# name: Run image snapshots
# command: yarn test --image
- store_artifacts:
path: examples/official-storybook/image-snapshots/__image_snapshots__
destination: official_storybook_image_snapshots
- persist_to_workspace:
root: .
paths:
- node_modules
- examples
- addons
- app
- lib
smoke-tests:
<<: *defaults
steps:
Expand All @@ -121,6 +153,11 @@ jobs:
command: |
cd examples/cra-kitchen-sink
yarn storybook --smoke-test --quiet
- run:
name: Run react typescript kitchen-sink (smoke test)
command: |
cd examples/cra-ts-kitchen-sink
yarn storybook --smoke-test --quiet
- run:
name: Run vue kitchen-sink (smoke test)
command: |
Expand Down Expand Up @@ -166,6 +203,16 @@ jobs:
command: |
cd examples/riot-kitchen-sink
yarn storybook --smoke-test --quiet
- run:
name: Run preact kitchen-sink (smoke test)
command: |
cd examples/preact-kitchen-sink
yarn storybook --smoke-test --quiet
- run:
name: Run cra reac15 (smoke test)
command: |
cd examples/cra-react15
yarn storybook --smoke-test --quiet
native-smoke-tests:
<<: *defaults
steps:
Expand All @@ -174,12 +221,35 @@ jobs:
at: .
- run:
name: Bootstrap
command: yarn bootstrap --reactnativeapp
command: yarn bootstrap --core
- run:
name: Run React-Native-App example
command: |
cd examples-native/crna-kitchen-sink
yarn storybook --smoke-test
- run:
name: Publish React-Native-App example
command: |
./scripts/crna-publish.js
frontpage:
<<: *defaults
steps:
- checkout
- restore_cache:
name: Restore core dependencies cache
keys:
- core-dependencies-v3-{{ checksum "yarn.lock" }}
- run:
name: Install dependencies
command: yarn install
- run:
name: Trigger build
command: ./scripts/build-frontpage.js
- save_cache:
name: Cache core dependencies
key: core-dependencies-v3-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
docs:
<<: *defaults
steps:
Expand Down Expand Up @@ -225,7 +295,7 @@ jobs:
at: .
- run:
name: Test
command: yarn test --coverage --runInBand --core
command: yarn test --coverage --w2 --core
- persist_to_workspace:
root: .
paths:
Expand Down Expand Up @@ -268,6 +338,7 @@ workflows:
jobs:
- build
- docs
- frontpage
- lint:
requires:
- docs
Expand All @@ -293,3 +364,6 @@ workflows:
- cli-test-latest-cra:
requires:
- build
- chromatic:
requires:
- examples
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
dist
lib/**/dll
build
coverage
node_modules
docs/public
storybook-static
built-storybooks
lib/cli/test
scripts/storage
*.bundle.js
*.js.map

Expand All @@ -15,3 +17,8 @@ lib/cli/test
!.eslintrc-markdown.js
!.jest.config.js
!.storybook

REACT_NATIVE
examples-native
react-native
ondevice-*
Loading

0 comments on commit 9db00b3

Please sign in to comment.