Skip to content

Commit

Permalink
chore: migrate brui into buie (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
priyajeet authored Jan 25, 2019
1 parent 9110abc commit 52edfb4
Show file tree
Hide file tree
Showing 1,967 changed files with 148,631 additions and 99 deletions.
49 changes: 37 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,47 @@ module.exports = {
rules: {
camelcase: 'off',
'class-methods-use-this': 'off',
'flowtype/sort-keys': 'off', //fixme
'consistent-return': 'off', // fixme
'flowtype/sort-keys': 'off', // fixme
'jsx-a11y/anchor-is-valid': 'off', // fixme
'jsx-a11y/click-events-have-key-events': 'off', // fixme
'jsx-a11y/label-has-associated-control': 'off',
'no-shadow': 'off', //fixme
'react/default-props-match-prop-types': 'off', //fixme
'react/destructuring-assignment': 'off', //fixme
'jsx-a11y/label-has-for': 'off', // fixme
'jsx-a11y/no-noninteractive-tabindex': 'off', // fixme
'jsx-a11y/no-static-element-interactions': 'off', // fixme
'jsx-a11y/no-onchange': 'off', // fixme
'import/no-extraneous-dependencies': 'off', // fixme
'import/prefer-default-export': 'off', // fixme
'no-plusplus': 'off',
'no-restricted-globals': 'off', // fixme
'no-shadow': 'off', // fixme
'no-underscore-dangle': 'off', // fixme
'no-unused-vars': 'off', // fixme
'one-var': 'off', // fixme
'prefer-destructuring': 'off', // fixme
'prefer-promise-reject-errors': 'off', // fixme
'react/button-has-type': 'off', // fixme
'react/default-props-match-prop-types': 'off', // fixme
'react/destructuring-assignment': 'off', // fixme
'react/display-name': 'off',
'react/jsx-sort-props': 'off', //fixme
'react/sort-comp': 'off', //fixme
'react/no-unused-prop-types': 'off', //fixme
'react/no-access-state-in-setstate': 'off', //fixme
'react/forbid-prop-types': 'off', // fixme
'react/jsx-sort-props': 'off', // fixme
'react/jsx-no-bind': 'off', // fixme
'react/sort-comp': 'off', // fixme
'react/no-unused-prop-types': 'off', // fixme
'react/no-access-state-in-setstate': 'off', // fixme
'react/no-array-index-key': 'off', // fixme
'react/no-this-in-sfc': 'off',
'react/no-unused-state': 'off', //fixme
'react/no-unused-state': 'off', // fixme
'react/prefer-stateless-function': 'off', // fixme
},
settings: {
'import/resolver': {
'babel-module': {}
}
}
'babel-module': {},
},
},
globals: {
shallow: true,
mount: true,
},
};
6 changes: 6 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.*/node_modules/draft-js*
.*/node_modules/findup*
.*/node_modules/config-chain*
.*/__tests__/.*

[untyped]
.*/node_modules/box-react-ui/*
Expand All @@ -23,6 +24,9 @@
[libs]

[options]
esproposal.export_star_as=enable
module.file_ext=.js
module.file_ext=.scss
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=./src
module.name_mapper.extension='scss' -> '<PROJECT_ROOT>/flow/SCSSFlowStub.js.flow'
Expand All @@ -35,5 +39,7 @@ module.name_mapper='react-virtualized/dist/es/AutoSizer' -> '<PROJECT_ROOT>/flow
module.name_mapper='react-virtualized/dist/es/CellMeasurer' -> '<PROJECT_ROOT>/flow/ReactVirtualizedStub.js.flow'
module.name_mapper='draft-js' -> '<PROJECT_ROOT>/flow/DraftJSFlowStub.js.flow'
module.name_mapper='draft-js/EditorState' -> '<PROJECT_ROOT>/flow/DraftJSFlowStub.js.flow'
module.name_mapper='draft-js/CompositeDecorator' -> '<PROJECT_ROOT>/flow/DraftJSFlowStub.js.flow'
module.name_mapper='draft-js/Modifier' -> '<PROJECT_ROOT>/flow/DraftJSFlowStub.js.flow'
module.name_mapper='react-measure' -> '<PROJECT_ROOT>/flow/ReactMeasure.js.flow'
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cache:
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
- export PATH=$HOME/.yarn/bin:$PATH
- export TZ=America/Los_Angeles
jobs:
include:
- name: "Commit Lint"
Expand All @@ -17,8 +18,10 @@ jobs:
script: npm-run-all clean build:i18n lint
- name: "Flow Types"
script: npm-run-all clean build:i18n && yarn flow
- name: "Tests"
script: yarn test && yarn test:e2e
- name: "Unit Tests"
script: yarn test
- name: "E2E Tests"
script: yarn test:e2e
- name: "Build Babel"
script: npm-run-all clean build:i18n build:ci:es
- name: "Build Webpack"
Expand Down
6 changes: 5 additions & 1 deletion conf/jest/enzyme-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
import 'core-js/es6/map';
import 'core-js/es6/set';
import 'raf/polyfill';
import Enzyme from 'enzyme';
import Enzyme, { mount, shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

Enzyme.configure({ adapter: new Adapter() });

// make Enzyme functions available in all test files without importing
global.shallow = shallow;
global.mount = mount;
65 changes: 40 additions & 25 deletions conf/prepush.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,70 @@
# translation properties file
PROPERTIES="i18n/en-US.properties"

# Styling variables
red=$"\e[1;31m"
green=$"\e[1;32m"
blue=$"\e[1;34m"
end=$"\e[0m\n"

# commit updated translations if any
check_and_commit_updated_translations() {
if ! git diff --quiet HEAD $PROPERTIES; then
echo "--------------------------------------------------------"
echo "Committing updated translations"
echo "--------------------------------------------------------"
printf "${red}--------------------------------------------------------${end}"
printf "${red}Committing updated translations${end}"
printf "${red}--------------------------------------------------------${end}"
git add $PROPERTIES || exit 1
git commit --amend --no-edit --no-verify || exit 1
echo "--------------------------------------------------------"
echo "Amended commit with translations, please push again with --no-verify"
echo "--------------------------------------------------------"
printf "${red}--------------------------------------------------------${end}"
printf "${red}Amended commit with translations, please push again with --no-verify${end}"
printf "${red}--------------------------------------------------------${end}"
exit 1
else
printf "${green}--------------------------------------------------------${end}"
printf "${green}en-US.properties is already up to date${end}"
printf "${green}--------------------------------------------------------${end}"
fi
}

# lint, test, and build assets to update translations
prepush() {
echo "--------------------------------------------------------"
echo "Build bundles"
echo "--------------------------------------------------------"
printf "${blue}-------------------------------------------------------------${end}"
printf "${blue}Building bundles${end}"
printf "${blue}-------------------------------------------------------------${end}"
yarn build:i18n || exit 1

echo "--------------------------------------------------------"
echo "Linting"
echo "--------------------------------------------------------"
printf "${blue}-------------------------------------------------------------${end}"
printf "${blue}Linting${end}"
printf "${blue}-------------------------------------------------------------${end}"
yarn lint || exit 1

echo "--------------------------------------------------------"
echo "Checking flow types"
echo "--------------------------------------------------------"
printf "${blue}-------------------------------------------------------------${end}"
printf "${blue}Checking flow types${end}"
printf "${blue}-------------------------------------------------------------${end}"
yarn flow check || exit 1

echo "--------------------------------------------------------"
echo "Testing"
echo "--------------------------------------------------------"
printf "${blue}-------------------------------------------------------------${end}"
printf "${blue}Testing${end}"
printf "${blue}-------------------------------------------------------------${end}"
yarn test || exit 1

echo "--------------------------------------------------------"
echo "Building"
echo "--------------------------------------------------------"
yarn build:dev:dist || exit 1
printf "${blue}-------------------------------------------------------------${end}"
printf "${blue}Building all sources, this will update i18n/json${end}"
printf "${blue}-------------------------------------------------------------${end}"
yarn build:prod:es || exit 1

printf "${blue}-------------------------------------------------------------${end}"
printf "${blue}Building bundles again, this will update en-US.properties${end}"
printf "${blue}-------------------------------------------------------------${end}"
yarn build:i18n || exit 1

check_and_commit_updated_translations
}

# Execute this script
if ! prepush; then
echo "----------------------------------------------------"
echo "Error: failure in prepush script"
echo "----------------------------------------------------"
printf "${red}---------------------------------------------------------${end}"
printf "${red}Error: failure in prepush script${end}"
printf "${red}---------------------------------------------------------${end}"
exit 1
fi
Loading

0 comments on commit 52edfb4

Please sign in to comment.