Skip to content

Commit ec1b84f

Browse files
authored
feat: bumped all dependencies (#34)
* feat: bumped all dependencies * Create ci.yml * fix: GitHub Actions * fix: removed Travis CI
1 parent 611454f commit ec1b84f

16 files changed

+2752
-1939
lines changed

.babelrc

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
22
"presets": [
3-
["env", {
4-
"debug": true,
3+
["@babel/preset-env", {
54
"targets": {
65
"browsers": "last 4 version, > 1%, not ie <= 8"
76
}
87
}],
9-
"react"
8+
"@babel/preset-react"
109
],
1110
"plugins": [
1211
"add-module-exports"

.github/workflows/ci.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Node.js CI
2+
on:
3+
push:
4+
branches: [ master ]
5+
pull_request:
6+
branches: [ master ]
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Use Node.js
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 12.x
16+
- run: yarn install --frozen-lockfile
17+
- run: yarn build
18+
- run: yarn test
19+
env:
20+
CI: "true"

.travis.yml

-8
This file was deleted.

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# prop-types-extra [![Travis][build-badge]][build] [![npm][npm-badge]][npm]
1+
# prop-types-extra [![GitHub Actions][build-badge]][build] [![npm][npm-badge]][npm]
22

33
Additional [PropTypes](https://facebook.github.io/react/docs/reusable-components.html#prop-validation) for [React](https://facebook.github.io/react/).
44

@@ -109,8 +109,8 @@ If the `id` prop above is not specified, the validator will fail with:
109109

110110
>The prop \`id\` is required to make \`MyComponent\` accessible for users of assistive technologies such as screen readers.
111111
112-
[build-badge]: https://travis-ci.com/react-bootstrap/prop-types-extra.svg?branch=master
113-
[build]: https://travis-ci.org/react-bootstrap/prop-types-extra
112+
[build-badge]: https://github.com/react-bootstrap/prop-types-extra/workflows/Node.js%20CI/badge.svg
113+
[build]: https://github.com/react-bootstrap/prop-types-extra/actions
114114

115115
[npm-badge]: https://img.shields.io/npm/v/prop-types-extra.svg
116116
[npm]: https://www.npmjs.org/package/prop-types-extra

package.json

+14-13
Original file line numberDiff line numberDiff line change
@@ -34,36 +34,37 @@
3434
"<rootDir>/test"
3535
],
3636
"testRegex": "test\\.js",
37-
"setupTestFrameworkScriptFile": "./test/test-setup.js"
37+
"setupFilesAfterEnv": ["./test/test-setup.js"]
3838
},
3939
"peerDependencies": {
40-
"react": ">=0.14.0"
40+
"react": ">=16.13.1"
4141
},
4242
"devDependencies": {
43-
"babel-cli": "^6.26.0",
43+
"@babel/cli": "^7.8.4",
44+
"@babel/core": "^7.9.0",
45+
"@babel/preset-env": "^7.9.0",
46+
"@babel/preset-react": "^7.9.4",
4447
"babel-eslint": "^10.1.0",
45-
"babel-jest": "^20.0.3",
46-
"babel-plugin-add-module-exports": "^0.3.3",
47-
"babel-preset-env": "^1.7.0",
48-
"babel-preset-react": "^6.24.1",
48+
"babel-jest": "^25.2.4",
49+
"babel-plugin-add-module-exports": "^1.0.2",
4950
"chai": "^4.2.0",
5051
"dirty-chai": "^2.0.1",
5152
"eslint": "^6.8.0",
52-
"eslint-config-airbnb": "^9.0.1",
53-
"eslint-config-airbnb-base": "^3.0.1",
54-
"eslint-plugin-import": "^2.20.1",
53+
"eslint-config-airbnb": "^18.1.0",
54+
"eslint-config-airbnb-base": "^14.1.0",
55+
"eslint-plugin-import": "^2.20.2",
5556
"eslint-plugin-jsx-a11y": "^6.2.3",
5657
"eslint-plugin-mocha": "^6.3.0",
5758
"eslint-plugin-react": "^7.19.0",
58-
"jest": "^20.0.4",
59+
"jest": "^25.2.4",
5960
"prop-types": "^15.7.2",
6061
"react": "^16.13.1",
6162
"release-script": "^1.0.2",
6263
"sinon": "^9.0.1",
6364
"sinon-chai": "^3.5.0"
6465
},
6566
"dependencies": {
66-
"react-is": "^16.3.2",
67-
"warning": "^4.0.0"
67+
"react-is": "^16.13.1",
68+
"warning": "^4.0.3"
6869
}
6970
}

src/all.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default function all(...validators) {
44
function allPropTypes(...args) {
55
let error = null;
66

7-
validators.forEach(validator => {
7+
validators.forEach((validator) => {
88
if (error != null) {
99
return;
1010
}

src/componentOrElement.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ function validate(props, propName, componentName, location, propFullName) {
88

99
if (React.isValidElement(propValue)) {
1010
return new Error(
11-
`Invalid ${location} \`${propFullName}\` of type ReactElement ` +
12-
`supplied to \`${componentName}\`, expected a ReactComponent or a ` +
13-
'DOMElement. You can usually obtain a ReactComponent or DOMElement ' +
14-
'from a ReactElement by attaching a ref to it.'
11+
`Invalid ${location} \`${propFullName}\` of type ReactElement `
12+
+ `supplied to \`${componentName}\`, expected a ReactComponent or a `
13+
+ 'DOMElement. You can usually obtain a ReactComponent or DOMElement '
14+
+ 'from a ReactElement by attaching a ref to it.',
1515
);
1616
}
1717

1818
if (
19-
(propType !== 'object' || typeof propValue.render !== 'function') &&
20-
propValue.nodeType !== 1
19+
(propType !== 'object' || typeof propValue.render !== 'function')
20+
&& propValue.nodeType !== 1
2121
) {
2222
return new Error(
23-
`Invalid ${location} \`${propFullName}\` of value \`${propValue}\` ` +
24-
`supplied to \`${componentName}\`, expected a ReactComponent or a ` +
25-
'DOMElement.'
23+
`Invalid ${location} \`${propFullName}\` of value \`${propValue}\` `
24+
+ `supplied to \`${componentName}\`, expected a ReactComponent or a `
25+
+ 'DOMElement.',
2626
);
2727
}
2828

src/deprecated.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ export default function deprecated(validator, reason) {
1313
const messageKey = `${componentName}.${propName}`;
1414

1515
warning(warned[messageKey],
16-
`The ${location} \`${propFullNameSafe}\` of ` +
17-
`\`${componentNameSafe}\` is deprecated. ${reason}.`
18-
);
16+
`The ${location} \`${propFullNameSafe}\` of `
17+
+ `\`${componentNameSafe}\` is deprecated. ${reason}.`);
1918

2019
warned[messageKey] = true;
2120
}
2221

2322
return validator(
24-
props, propName, componentName, location, propFullName, ...args
23+
props, propName, componentName, location, propFullName, ...args,
2524
);
2625
};
2726
}

src/elementType.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ function elementType(props, propName, componentName, location, propFullName) {
99

1010
if (React.isValidElement(propValue)) {
1111
return new Error(
12-
`Invalid ${location} \`${propFullName}\` of type ReactElement ` +
13-
`supplied to \`${componentName}\`,expected an element type (a string ` +
14-
', component class, or function component).'
12+
`Invalid ${location} \`${propFullName}\` of type ReactElement `
13+
+ `supplied to \`${componentName}\`,expected an element type (a string `
14+
+ ', component class, or function component).',
1515
);
1616
}
1717

1818
if (!isValidElementType(propValue)) {
1919
return new Error(
20-
`Invalid ${location} \`${propFullName}\` of value \`${propValue}\` ` +
21-
`supplied to \`${componentName}\`, expected an element type (a string ` +
22-
', component class, or function component).'
20+
`Invalid ${location} \`${propFullName}\` of value \`${propValue}\` `
21+
+ `supplied to \`${componentName}\`, expected an element type (a string `
22+
+ ', component class, or function component).',
2323
);
2424
}
2525

src/isRequiredForA11y.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ export default function isRequiredForA11y(validator) {
77

88
if (props[propName] == null) {
99
return new Error(
10-
`The ${location} \`${propFullNameSafe}\` is required to make ` +
11-
`\`${componentNameSafe}\` accessible for users of assistive ` +
12-
'technologies such as screen readers.'
10+
`The ${location} \`${propFullNameSafe}\` is required to make `
11+
+ `\`${componentNameSafe}\` accessible for users of assistive `
12+
+ 'technologies such as screen readers.',
1313
);
1414
}
1515

1616
return validator(
17-
props, propName, componentName, location, propFullName, ...args
17+
props, propName, componentName, location, propFullName, ...args,
1818
);
1919
};
2020
}

src/utils/createChainableTypeChecker.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export default function createChainableTypeChecker(validate) {
2525
if (props[propName] == null) {
2626
if (isRequired) {
2727
return new Error(
28-
`Required ${location} \`${propFullNameSafe}\` was not specified ` +
29-
`in \`${componentNameSafe}\`.`
28+
`Required ${location} \`${propFullNameSafe}\` was not specified `
29+
+ `in \`${componentNameSafe}\`.`,
3030
);
3131
}
3232

@@ -39,7 +39,7 @@ export default function createChainableTypeChecker(validate) {
3939
componentNameSafe,
4040
location,
4141
propFullNameSafe,
42-
...args
42+
...args,
4343
);
4444
}
4545

test/all.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('all', () => {
3131
const validatorSpy = validate(validators, 'foo');
3232
expect(validatorSpy).to.have.been.calledOnce.and.to.have.returned(null);
3333

34-
validators.forEach(validator => {
34+
validators.forEach((validator) => {
3535
expect(validator).to.have.been.calledOnce();
3636
});
3737

test/deprecated.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { getValidationKey, runValidator, shouldWarn } from './helpers';
99

1010
function validate(value, validationKey) {
1111
const validatorSpy = sinon.spy(
12-
deprecated(PropTypes.string, 'error 1')
12+
deprecated(PropTypes.string, 'error 1'),
1313
);
1414
runValidator(validatorSpy, value, validationKey);
1515

test/describeChainableValidator.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { shouldWarn, runValidator } from './helpers';
22

33
export default function describeChainableValidator(validator) {
44
describe('chainable validator', () => {
5-
[null, undefined].forEach(value => {
5+
[null, undefined].forEach((value) => {
66
it(`should succeed on ${value} when not required`, () => {
77
runValidator(validator, value);
88
});

test/test-setup.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ global.sinon = sinon;
1515

1616
beforeEach(() => {
1717
/* eslint-disable no-console */
18-
sinon.stub(console, 'error').callsFake(msg => {
18+
sinon.stub(console, 'error').callsFake((msg) => {
1919
let expected = false;
2020

21-
console.error.expected.forEach(about => {
21+
console.error.expected.forEach((about) => {
2222
if (msg.indexOf(about) !== -1) {
2323
console.error.warned[about] = true;
2424
expected = true;

0 commit comments

Comments
 (0)