Skip to content

Commit

Permalink
Upgrade dependencies (#500)
Browse files Browse the repository at this point in the history
* Update eslint, prettier

* Prettify files with new prettier

* Use .prettierrc

* Prettier should error, not warn

* Disable no-return-assign

This rule requires to write ref props in a too verbose way, we can safely disable it.

* Upgrade jest

* Remove react-hot-loader (not used)

* Remove unused file

* Use eslint-preset-env

* Update yarn.lock

* Use node:8.6 in circleci

* Remove option forwarding

* Install latest yarn

* Upgrade eslint-config for airbnb

* We don’t need to setup jsdom with latest jest

* Upgrade babel-core

* Update yarn.lock

* No need to upgrade yarn

* Upgrade transform-react-remove-prop-types and postcss-cli

* Do not use --pure-lockfile

* Fix issue with yarn cache

* Add command names

* Use cache on CircleCI
  • Loading branch information
gpbl authored Sep 30, 2017
1 parent 16d0b87 commit ca351dc
Show file tree
Hide file tree
Showing 21 changed files with 2,141 additions and 1,546 deletions.
17 changes: 11 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"presets": [
"react",
"es2015",
"stage-1"
"env"
],
"plugins": [
["transform-react-remove-prop-types", {
"mode": "wrap"
}]
"transform-export-extensions",
"transform-class-properties",
"transform-object-rest-spread",
[
"transform-react-remove-prop-types",
{
"mode": "wrap"
}
]
]
}
}
36 changes: 25 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defaults: &defaults
working_directory: /root/react-day-picker
docker:
- image: node:7.10.0
- image: node:8.6
environment:
TEST_REPORT_PATH: "reports"

Expand All @@ -13,16 +13,28 @@ jobs:
steps:
- checkout
- restore_cache:
key: cache-project-v2-{{ checksum "yarn.lock" }}
- run: yarn --pure-lockfile --cache-folder yarn-cache
key: cache-{{ checksum "yarn.lock" }}
paths:
- ~/react-day-picker/node_modules
- run:
name: Install dependencies
command: yarn install
- run:
name: Lint sources
command: yarn lint --format junit --output-file reports/eslint.xml
- run:
name: Lint TypeScript definition files
command: yarn dtslint
- run:
name: Run unit tests
command: yarn test --coverage --testResultsProcessor jest-junit-reporter
- run:
name: Uploade codevoverage data
command: yarn codecov
- save_cache:
key: cache-project-v2-{{ checksum "yarn.lock" }}
key: cache-{{ checksum "yarn.lock" }}
paths:
- ~/react-day-picker/yarn-cache
- run: yarn lint -- --format junit --output-file reports/eslint.xml
- run: yarn dtslint
- run: yarn test -- --coverage --testResultsProcessor jest-junit-reporter
- run: yarn codecov
- ~/react-day-picker/node_modules
- store_test_results:
path: ~/react-day-picker/reports
- persist_to_workspace:
Expand All @@ -37,8 +49,10 @@ jobs:
- attach_workspace:
at: /root/react-day-picker
- restore_cache:
key: cache-project-v2-{{ checksum "yarn.lock" }}
- run: yarn --cache-folder yarn-cache
key: cache-{{ checksum "yarn.lock" }}
paths:
- ~/react-day-picker/node_modules
- run: yarn
- run: yarn build

build-docs:
Expand Down
2 changes: 0 additions & 2 deletions .csslintrc

This file was deleted.

9 changes: 2 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@
"prettier/react"
],
"rules": {
"prettier/prettier": [
"warn",
{
"singleQuote": true,
"trailingComma": "es5"
}
],
"prettier/prettier": "error",
"no-console": [
"error",
{
Expand All @@ -25,6 +19,7 @@
]
}
],
"no-return-assign": 0,
"import/named": 2,
"react/jsx-filename-extension": 0,
"react/require-default-props": 0
Expand Down
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "es5"
}
76 changes: 39 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,43 +66,45 @@
},
"devDependencies": {
"@types/react": "15.0.30",
"autoprefixer": "^7.1.4",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.1.2",
"babel-plugin-transform-react-remove-prop-types": "^0.4.8",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
"cheerio": "^1.0.0-rc.2",
"codecov": "^2.3.0",
"dtslint": "^0.1.2",
"enzyme": "^2.9.1",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^15.0.2",
"eslint-config-prettier": "^2.3.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^5.0.3",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-react": "^7.1.0",
"gh-pages": "^1.0.0",
"husky": "^0.14.3",
"jest": "^20.0.4",
"jest-enzyme": "^3.6.1",
"jest-junit-reporter": "^1.1.0",
"jsdom": "^11.1.0",
"moment": "^2.18.1",
"null-loader": "^0.1.1",
"postcss-cli": "^4.1.0",
"prettier": "^1.7.1",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-hot-loader": "^3.0.0-beta.6",
"react-test-renderer": "^15.6.1",
"rimraf": "^2.6.2",
"typescript": "^2.5.3",
"webpack": "^3.6.0"
"autoprefixer": "7.1.4",
"babel-core": "6.26.0",
"babel-eslint": "8.0.1",
"babel-loader": "7.1.2",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-export-extensions": "6.22.0",
"babel-plugin-transform-object-rest-spread": "6.26.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.9",
"babel-preset-env": "1.6.0",
"babel-preset-react": "6.24.1",
"babel-preset-stage-1": "6.24.1",
"cheerio": "1.0.0-rc.2",
"codecov": "2.3.0",
"dtslint": "0.1.2",
"enzyme": "2.9.1",
"eslint": "4.8.0",
"eslint-config-airbnb": "15.1.0",
"eslint-config-airbnb-base": "12.0.1",
"eslint-config-prettier": "2.6.0",
"eslint-plugin-import": "2.7.0",
"eslint-plugin-jsx-a11y": "5.1.1",
"eslint-plugin-prettier": "2.3.1",
"eslint-plugin-react": "7.4.0",
"gh-pages": "1.0.0",
"husky": "0.14.3",
"jest": "21.2.1",
"jest-enzyme": "3.6.1",
"jest-junit-reporter": "1.1.0",
"jsdom": "11.1.0",
"moment": "2.18.1",
"null-loader": "0.1.1",
"postcss-cli": "4.1.1",
"prettier": "1.7.3",
"react": "15.6.1",
"react-dom": "15.6.1",
"react-test-renderer": "15.6.1",
"rimraf": "2.6.2",
"typescript": "2.5.3",
"webpack": "3.6.0"
},
"dependencies": {
"object-assign": "^4.1.1",
Expand Down
4 changes: 3 additions & 1 deletion test/DateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import * as DateUtils from '../src/DateUtils';
describe('DateUtils', () => {
it('should export all the functions', () => {
const imported = require('../src/DateUtils').default; // eslint-disable-line global-require
expect(Object.keys(DateUtils).length - 1).toEqual(Object.keys(imported).length);
expect(Object.keys(DateUtils).length - 1).toEqual(
Object.keys(imported).length
);
});

describe('addMonths', () => {
Expand Down
12 changes: 8 additions & 4 deletions test/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,20 @@ describe('Helpers', () => {

describe('isRangeOfDates', () => {
it('should detect a properly shaped object', () => {
expect(Helpers.isRangeOfDates({
expect(
Helpers.isRangeOfDates({
from: new Date(),
to: new Date(),
})).toBe(true);
})
).toBe(true);
});
it('should detect not properly shaped objects', () => {
expect(Helpers.isRangeOfDates({
expect(
Helpers.isRangeOfDates({
from: null,
to: new Date(),
})).toBe(false);
})
).toBe(false);
expect(Helpers.isRangeOfDates({ to: new Date() })).toBe(false);
expect(Helpers.isRangeOfDates({ from: new Date() })).toBe(false);
});
Expand Down
4 changes: 3 additions & 1 deletion test/LocaleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import * as LocaleUtils from '../src/LocaleUtils';
describe('LocaleUtils', () => {
it('should export all the functions', () => {
const imported = require('../src/LocaleUtils').default; // eslint-disable-line global-require
expect(Object.keys(LocaleUtils).length - 1).toEqual(Object.keys(imported).length);
expect(Object.keys(LocaleUtils).length - 1).toEqual(
Object.keys(imported).length
);
});

describe('formatMonthTitle', () => {
Expand Down
Loading

0 comments on commit ca351dc

Please sign in to comment.