Skip to content

Commit

Permalink
Merge branch 'next' into ts-migration/babel-typescript
Browse files Browse the repository at this point in the history
# Conflicts:
#	.babelrc.js
#	app/angular/src/client/preview/render.js
#	package.json
#	yarn.lock
  • Loading branch information
ndelangen committed Mar 2, 2019
2 parents 2da70f6 + b9cce09 commit d351d87
Show file tree
Hide file tree
Showing 1,012 changed files with 85,281 additions and 37,244 deletions.
25 changes: 21 additions & 4 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ module.exports = {
'@babel/preset-flow',
],
plugins: [
'babel-plugin-emotion',
'babel-plugin-macros',
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-syntax-dynamic-import',
['@babel/plugin-proposal-object-rest-spread', { loose: true, useBuiltIns: true }],
'babel-plugin-macros',
['babel-plugin-emotion', { sourceMap: true, autoLabel: true }],
],
env: {
test: {
Expand All @@ -24,6 +25,23 @@ module.exports = {
test: './examples/vue-kitchen-sink',
presets: ['babel-preset-vue'],
},
{
test: './lib',
presets: [
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage' }],
'@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',
],
},
{
test: [
'./lib/core/src/server',
Expand All @@ -33,7 +51,6 @@ module.exports = {
'./addons/storysource/src/loader',
'./app/**/src/server/**',
'./app/**/src/bin/**',
'./dangerfile.js',
],
presets: [
[
Expand Down
19 changes: 8 additions & 11 deletions dangerfile.js → .ci/danger/dangerfile.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { fail, danger } from 'danger';
import { flatten, intersection, isEmpty } from 'lodash';
import { execSync } from 'child_process';

const pkg = require('./package.json'); // eslint-disable-line import/newline-after-import
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 = {
Expand All @@ -20,18 +24,11 @@ const checkRequiredLabels = labels => {
branchVersion === Versions.PATCH ? 'feature request' : [],
]);

const requiredLabels = flatten([
prLogConfig.skipLabels || [],
(prLogConfig.validLabels || []).map(keyVal => keyVal[0]),
]);
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' : ''
}.`
);
fail(`PR is marked with ${blockingLabels.map(label => `"${label}"`).join(', ')} label${blockingLabels.length > 1 ? 's' : ''}.`);
}

const foundLabels = intersection(requiredLabels, labels);
Expand Down
16 changes: 13 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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 @@ -109,9 +114,9 @@ jobs:
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
Expand All @@ -126,6 +131,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
63 changes: 12 additions & 51 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const error = 2;
const warn = 1;
const ignore = 0;

module.exports = {
root: true,
extends: [
Expand All @@ -11,37 +10,18 @@ module.exports = {
'prettier',
'prettier/react',
],
plugins: ['prettier', 'jest', 'import', 'react', 'jsx-a11y', 'json'],
plugins: ['prettier', 'jest', 'import', 'react', 'jsx-a11y', 'json', 'html'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 8,
sourceType: 'module',
},
env: {
es6: true,
node: true,
'jest/globals': true,
},
parserOptions: { ecmaVersion: 8, sourceType: 'module' },
env: { es6: true, node: true, 'jest/globals': true },
settings: {
'import/core-modules': ['enzyme'],
'import/ignore': ['node_modules\\/(?!@storybook)'],
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
},
},
'import/resolver': { node: { extensions: ['.js', '.ts'] } },
'html/html-extensions': ['.html'],
},
rules: {
'prettier/prettier': [
warn,
{
printWidth: 100,
tabWidth: 2,
bracketSpacing: true,
trailingComma: 'es5',
singleQuote: true,
},
],
'prettier/prettier': [warn],
'no-debugger': process.env.NODE_ENV === 'production' ? error : ignore,
'class-methods-use-this': ignore,
'import/extensions': [
Expand Down Expand Up @@ -91,6 +71,7 @@ module.exports = {
allowBind: true,
},
],
'jsx-a11y/accessible-emoji': ignore,
'jsx-a11y/label-has-associated-control': [
warn,
{
Expand All @@ -101,46 +82,26 @@ module.exports = {
},
],
'react/no-unescaped-entities': ignore,
'jsx-a11y/label-has-for': [
error,
{
required: {
some: ['nesting', 'id'],
},
},
],
'jsx-a11y/label-has-for': [error, { required: { some: ['nesting', 'id'] } }],
'jsx-a11y/anchor-is-valid': [
error,
{
components: ['RoutedLink', 'MenuLink', 'LinkTo', 'Link'],
components: ['A', 'LinkTo', 'Link'],
specialLink: ['overrideParams', 'kind', 'story', 'to'],
},
],
'no-underscore-dangle': [
error,
{
allow: ['__STORYBOOK_CLIENT_API__', '__STORYBOOK_ADDONS_CHANNEL__'],
},
{ allow: ['__STORYBOOK_CLIENT_API__', '__STORYBOOK_ADDONS_CHANNEL__'] },
],
},
overrides: [
{
files: ['**/__tests__/**', '**/*.test.js/**'],
files: ['**/__tests__/**', '**/*.test.js', '**/*.stories.js', '**/storyshots/**/stories/**'],
rules: {
'import/no-extraneous-dependencies': ignore,
},
},
{
files: ['**/react-native*/**', '**/REACT_NATIVE*/**', '**/crna*/**'],
rules: {
'jsx-a11y/accessible-emoji': ignore,
},
},
{
files: '**/.storybook/config.js',
rules: {
'global-require': ignore,
},
},
{ files: '**/.storybook/config.js', rules: { 'global-require': ignore } },
],
};
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

/examples/angular-cli/ @igor-dv @alterx
/examples/cra-kitchen-sink/ @ndelangen @UsulPro @hypnosphi
/examples/cra-ts-kitchen-sink/ @mucsi96
/examples/official-storybook/ @hypnosphi @danielduan @UsulPro
/examples/polymer-cli/ @naipath @igor-dv
/examples/vue-kitchen-sink/ @igor-dv @alexandrebodin
Expand Down
15 changes: 15 additions & 0 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
workflow "Dangerfile JS Pull" {
on = "pull_request"
resolves = "Danger JS"
}

workflow "Dangerfile JS Label" {
on = "label"
resolves = "Danger JS"
}

action "Danger JS" {
uses = "danger/danger-js@master"
secrets = ["GITHUB_TOKEN"]
args = "--dangerfile .ci/danger/dangerfile.ts"
}
8 changes: 1 addition & 7 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ HMR
Redux
storybook-ui
react-komposer
redux
serializable
params
- addons/actions/node_modules/@storybook/addons/README.md
README.md
storybooks.js.org
- addons/actions/node_modules/asap/README.md
YuzuJS
setImmediate
Malte
Expand All @@ -78,15 +76,11 @@ Katić
Domenic
Kowal
Zakas
- addons/actions/node_modules/balanced-match/README.md
Gruber
julian
juliangruber.com
- addons/actions/node_modules/brace-expansion/README.md
Schlueter
- addons/links/README.md
linkTo
- lib/ui/README.md
setOptions
setStories
onStory
1 change: 0 additions & 1 deletion .teamcity/OpenSourceProjects_Storybook/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ object Project : Project({
buildType(OpenSourceProjects_Storybook_Bootstrap)
buildType(OpenSourceProjects_Storybook_CliTestLatestCra)
buildType(OpenSourceProjects_Storybook_Examples)
buildType(OpenSourceProjects_Storybook_Danger)
buildType(OpenSourceProjects_Storybook_NativeSmokeTests)
buildType(OpenSourceProjects_Storybook_Docs)
buildType(OpenSourceProjects_Storybook_Build_2)
Expand Down

This file was deleted.

Loading

0 comments on commit d351d87

Please sign in to comment.