Skip to content

Commit

Permalink
Add CircleCI support to 15-stable (#8778)
Browse files Browse the repository at this point in the history
* devDependencies: add core-js and es6-symbol polyfill for tests

* Update Flow and fix issues (#8006)

* Add npm v4.0.0 support (#8082)

* Add support for node v7 (#8135)

* Upgrade ESLint and dependencies, fix new lint errors, switch Travis to Yarn (#8309)

* Update ESLint to 3.10.2

Also pull in fbjs for extending properly, per @zpao. This also disables consistent-return, which has about 80 failing cases in React currently. If we'd like to turn this back on, we should do it separately and fix all the call sites properly (rather than just adding 'return undefined;' everywhere, which adds no value.

Fixes to all existing lint errors plus an update for yarn.lock to follow.

* Update yarn.lock after the eslint update.

* Fix all new eslint failures

Unfortunately I had to add three eslint-disable-next-line instances. All have explanations inline.

* Switch Travis to use yarn instead of npm

* Update all Jest packages to 17.x (#8327)

* Update all Jest packages to 17.x, cache babel-jest transforms

* Remove the caching

Looking at the other builds it doesn't seem to actually be that necessary.  The bottleneck is executors, not build time.

* Remove unnecessary package, fix fiber test runner

* Regenerate yarn lockfile

* Update Flow to 0.37.0 (#8608)

Nothing really changes.

* Update to Jest 18 (#8621)

* mockImpl -> mockImplementation

D4329549

* Fixed linting errors

* circle.yml and circleci scripts

* Update Flow and fix issues (#8006)

* Fixed flow errors

* Updated shrinkwrap

* Removed unnecessary change

* Added jest --runInBand flag

* Removed ReactDOMFiber changes
  • Loading branch information
jackjocross authored and gaearon committed Jan 23, 2017
1 parent ef96e59 commit 688490d
Show file tree
Hide file tree
Showing 46 changed files with 752 additions and 1,490 deletions.
28 changes: 5 additions & 23 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,50 @@ const WARNING = 1;
const ERROR = 2;

module.exports = {
parser: 'babel-eslint',

extends: './node_modules/fbjs-scripts/eslint/.eslintrc.js',
extends: 'fbjs',

plugins: [
'react',
'react-internal',
],

ecmaFeatures: {
modules: false
},

// We're stricter than the default config, mostly. We'll override a few rules
// and then enable some React specific ones.
rules: {
'accessor-pairs': OFF,
'brace-style': [ERROR, '1tbs'],
'comma-dangle': [ERROR, 'always-multiline'],
'consistent-return': ERROR,
'consistent-return': OFF,
'dot-location': [ERROR, 'property'],
'dot-notation': ERROR,
'eol-last': ERROR,
'eqeqeq': [ERROR, 'allow-null'],
'indent': [ERROR, 2, {SwitchCase: 1}],
'jsx-quotes': [ERROR, 'prefer-double'],
'keyword-spacing': [ERROR, {after: true, before: true}],
'no-bitwise': OFF,
'no-inner-declarations': [ERROR, 'functions'],
'no-multi-spaces': ERROR,
'no-restricted-syntax': [ERROR, 'WithStatement'],
'no-shadow': ERROR,
'no-unused-expressions': ERROR,
'no-unused-vars': [ERROR, {args: 'none'}],
'quotes': [ERROR, 'single', 'avoid-escape'],
'space-after-keywords': ERROR,
'quotes': [ERROR, 'single', {avoidEscape: true, allowTemplateLiterals: true }],
'space-before-blocks': ERROR,
'space-before-function-paren': [ERROR, {anonymous: 'never', named: 'never'}],
'space-before-keywords': ERROR,
'strict': [ERROR, 'global'],

// React & JSX
// Our transforms set this automatically
'react/display-name': OFF,
'react/jsx-boolean-value': [ERROR, 'always'],
'react/jsx-no-undef': ERROR,
// We don't care to do this
'react/jsx-sort-prop-types': OFF,
'react/jsx-sort-props': OFF,
'react/jsx-uses-react': ERROR,
'react/jsx-uses-vars': ERROR,
// It's easier to test some things this way
'react/no-did-mount-set-state': OFF,
'react/no-did-update-set-state': OFF,
// We define multiple components in test files
'react/no-multi-comp': OFF,
'react/no-unknown-property': OFF,
'react/no-is-mounted': OFF,
// This isn't useful in our test code
'react/prop-types': OFF,
'react/react-in-jsx-scope': ERROR,
'react/self-closing-comp': ERROR,
// We don't care to do this
'react/sort-comp': OFF,
'react/wrap-multilines': [ERROR, {declaration: false, assignment: false}],

// CUSTOM RULES
Expand Down
10 changes: 6 additions & 4 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
<PROJECT_ROOT>/.*/__tests__/.*

# Ignore Docs
<PROJECT_ROOT>/docs/.*
<PROJECT_ROOT>/.*/docs/.*

[include]

[libs]
./node_modules/fbjs/flow/lib
./node_modules/fbjs/flow/lib/dev.js
./flow

[options]
Expand All @@ -28,10 +29,11 @@ suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_type=$FlowExpectedError

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-1]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-1]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*www[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[version]
^0.31.0
^0.37.0

42 changes: 42 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
general:
branches:
ignore:
- gh-pages

machine:
timezone: America/Los_Angeles
node:
version: 6
ruby:
version: 2.2.3
environment:
TRAVIS_REPO_SLUG: facebook/react

dependencies:
pre:
# This is equivalent to $TRAVIS_COMMIT_RANGE
# Need to figure out how to bail early if this is a "docs only" build
- echo $CIRCLE_COMPARE_URL | cut -d/ -f7
override:
- bundle install --gemfile=docs/Gemfile --deployment --path=vendor/bundle --jobs=3 --retry=3
- npm install
- scripts/circleci/set_up_github_keys.sh
post:
# - npm ls --depth=0
cache_directories:
- docs/vendor/bundle
- .grunt # Show size comparisons between builds
- ~/react-gh-pages # docs checkout

test:
override:
- ./scripts/circleci/test_entry_point.sh:
parallel: true

deployment:
staging:
branch: /.*/
commands:
- ./scripts/circleci/upload_build.sh
- ./scripts/circleci/build_gh_pages.sh
3 changes: 2 additions & 1 deletion grunt/tasks/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ function run(done, coverage) {
grunt.log.writeln('running jest');

var args = [
path.join('node_modules', 'jest', 'bin', 'jest'),
path.join('node_modules', 'jest-cli', 'bin', 'jest'),
'--runInBand',
];
if (coverage) {
args.push('--coverage');
Expand Down
Loading

0 comments on commit 688490d

Please sign in to comment.