Skip to content

Commit

Permalink
Automatic Library Updates (#416)
Browse files Browse the repository at this point in the history
* chore(deps-dev): Bump @babel/core from 7.8.4 to 7.8.6 (#404)

* chore(deps-dev): Bump @types/react from 16.9.19 to 16.9.23 (#406)

* chore(deps-dev): Bump @types/jest from 25.1.2 to 25.1.3 (#407)

* chore(deps-dev): Bump rollup from 1.31.1 to 1.32.0 (#408)

* chore(deps-dev): Bump sinon from 8.1.1 to 9.0.0 (#409)

* chore(deps-dev): Bump react-dom from 16.12.0 to 16.13.0 (#410)

* chore(deps-dev): Bump @typescript-eslint/eslint-plugin (#411)

* chore(deps-dev): Bump @babel/preset-env from 7.8.4 to 7.8.6 (#405)

* chore(deps-dev): Bump babel-eslint from 10.0.3 to 10.1.0 (#414)

* chore(deps-dev): Bump react from 16.12.0 to 16.13.0 (#412)

* chore(deps-dev): Bump typescript from 3.7.5 to 3.8.3 (#415)

* chore(deps-dev): Bump np from 5.2.1 to 6.2.0 (#413)

* Revert "chore(deps-dev): Bump np from 5.2.1 to 6.2.0 (#413)"

This reverts commit 7b53d66.

* chore(deps-dev): Bump @typescript-eslint/parser from 2.19.2 to 2.21.0 (#418)

* chore(deps-dev): Bump @types/react from 16.9.19 to 16.9.23 (#417)

* chore(deps): [Security] Bump acorn from 6.4.0 to 6.4.1 (#422)

Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. **This update includes a security fix.**
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](acornjs/acorn@6.4.0...6.4.1)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* chore(deps-dev): Bump eslint-plugin-import from 2.20.1 to 2.20.2 (#424)

* chore(deps-dev): Bump babel-jest from 25.1.0 to 25.2.4 (#425)

* chore(deps-dev): Bump @babel/preset-typescript from 7.8.3 to 7.9.0 (#426)

* chore(deps-dev): Bump rollup-plugin-babel from 4.3.3 to 4.4.0 (#427)

* chore(deps-dev): Bump prettier from 1.19.1 to 2.0.2 (#428)

* chore(deps-dev): Bump @types/react-dom from 16.9.5 to 16.9.6 (#430)

* chore(deps-dev): Bump @typescript-eslint/parser from 2.21.0 to 2.26.0 (#429)

* chore(deps-dev): Bump babel-loader from 8.0.6 to 8.1.0 (#431)

* chore(deps-dev): Bump @typescript-eslint/eslint-plugin (#432)

* chore(deps-dev): Bump @babel/preset-env from 7.8.6 to 7.9.0 (#433)

* chore(deps-dev): Bump @types/jest from 25.1.3 to 25.1.4 (#434)

* chore(deps-dev): Bump sinon from 9.0.0 to 9.0.1 (#436)

* chore(deps-dev): Bump rollup from 1.32.0 to 1.32.1 (#437)

* chore(deps-dev): Bump @types/react from 16.9.23 to 16.9.31 (#435)

* chore(deps-dev): Bump @babel/preset-react from 7.8.3 to 7.9.4 (#438)

* chore(deps-dev): Bump @types/react from 16.9.31 to 16.9.34 (#439)

* chore(deps-dev): Bump @rollup/plugin-node-resolve from 7.1.1 to 7.1.3 (#441)

* chore(deps-dev): Bump sinon from 9.0.1 to 9.0.2 (#442)

* chore(deps-dev): Bump @types/jest from 25.1.4 to 25.2.1 (#443)

* chore(deps-dev): Bump @types/react-dom from 16.9.6 to 16.9.7 (#444)

* chore(deps-dev): Bump @typescript-eslint/eslint-plugin (#446)

* chore(deps-dev): Bump eslint-plugin-react from 7.18.3 to 7.19.0 (#447)

* chore(deps-dev): Bump coveralls from 3.0.9 to 3.1.0 (#448)

* chore(deps-dev): Bump eslint-config-prettier from 6.10.0 to 6.11.0 (#450)

* chore(deps-dev): Bump @babel/core from 7.8.6 to 7.9.6 (#451)

* chore(deps-dev): Bump babel-jest from 25.2.4 to 25.5.1 (#452)

* chore(deps-dev): Bump @rollup/plugin-commonjs from 11.0.2 to 11.1.0 (#445)

* chore(deps-dev): Bump @typescript-eslint/parser from 2.26.0 to 2.30.0 (#454)

* chore(deps-dev): Bump eslint-plugin-prettier from 3.1.2 to 3.1.3 (#449)

* chore(deps-dev): Bump react from 16.13.0 to 16.13.1 (#440)

* chore(deps-dev): Bump @babel/preset-env from 7.9.0 to 7.9.6 (#453)

* chore(deps-dev): Bump babel-jest from 25.5.1 to 26.0.1 (#457)

* chore(deps-dev): Bump @babel/node from 7.8.4 to 7.8.7 (#461)

* chore(deps-dev): Bump husky from 4.2.3 to 4.2.5 (#462)

* chore(deps-dev): Bump react-dom from 16.13.0 to 16.13.1 (#465)

* chore(deps-dev): Bump eslint-config-airbnb from 18.0.1 to 18.1.0 (#466)

* chore(deps-dev): Bump @typescript-eslint/parser from 2.30.0 to 2.31.0 (#464)

* chore(deps-dev): Bump @typescript-eslint/eslint-plugin (#460)

* chore(deps-dev): Bump rollup from 1.32.1 to 2.7.6 (#463)

* chore(deps-dev): Bump auto-changelog from 1.16.2 to 2.0.0 (#459)

* chore(deps-dev): Bump prettier from 2.0.2 to 2.0.5 (#467)

* chore(deps-dev): Bump jest from 25.1.0 to 26.0.1 (#458)

* Reset yarn.lock

* Run format

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
  • Loading branch information
rkuykendall and dependabot-preview[bot] authored May 5, 2020
1 parent 63df277 commit 6e38f70
Show file tree
Hide file tree
Showing 12 changed files with 1,810 additions and 1,392 deletions.
28 changes: 14 additions & 14 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ external validator.
```jsx
class Form extends React.Component {
state = { validationErrors: {} };
validateForm = values => {
validateForm = (values) => {
if (!values.foo) {
this.setState({
validationErrors: {
Expand Down Expand Up @@ -305,7 +305,7 @@ class MyInput extends React.Component {
render() {
return (
<div>
<input value={this.props.value} onChange={e => this.props.setValue(e.target.value)} />
<input value={this.props.value} onChange={(e) => this.props.setValue(e.target.value)} />
</div>
);
}
Expand Down Expand Up @@ -337,7 +337,7 @@ class MyForm extends React.Component {
<Formsy>
<MyInput
name="search"
innerRef={c => {
innerRef={(c) => {
this.searchInput = c;
}}
/>
Expand Down Expand Up @@ -446,7 +446,7 @@ Gets the current value of the form input component.

```jsx
class MyInput extends React.Component {
changeValue = event => {
changeValue = (event) => {
this.props.setValue(event.currentTarget.value);
};
render() {
Expand All @@ -466,7 +466,7 @@ useful in cases where you want to only validate on blur / change / etc.

```jsx
class MyInput extends React.Component {
changeValue = event => {
changeValue = (event) => {
this.props.setValue(event.currentTarget.value);
};
render() {
Expand All @@ -486,7 +486,7 @@ Resets to empty value. This will run a **setState()** on the component and do a

```jsx
class MyInput extends React.Component {
changeValue = event => {
changeValue = (event) => {
this.props.setValue(event.currentTarget.value);
};
render() {
Expand All @@ -512,7 +512,7 @@ will be an empty array.

```jsx
class MyInput extends React.Component {
changeValue = event => {
changeValue = (event) => {
this.props.setValue(event.currentTarget.value);
};
render() {
Expand Down Expand Up @@ -561,7 +561,7 @@ class MyForm extends React.Component {

```jsx
class MyInput extends React.Component {
changeValue = event => {
changeValue = (event) => {
this.props.setValue(event.currentTarget.value);
};
render() {
Expand All @@ -584,7 +584,7 @@ True if the required property has been passed.

```jsx
class MyInput extends React.Component {
changeValue = event => {
changeValue = (event) => {
this.props.setValue(event.currentTarget.value);
};
render() {
Expand All @@ -606,7 +606,7 @@ value is empty and the required prop has been passed.

```jsx
class MyInput extends React.Component {
changeValue = event => {
changeValue = (event) => {
this.props.setValue(event.currentTarget.value);
};
render() {
Expand All @@ -628,7 +628,7 @@ component value and it is invalid or if a server error is received.

```jsx
class MyInput extends React.Component {
changeValue = event => {
changeValue = (event) => {
this.props.setValue(event.currentTarget.value);
};
render() {
Expand Down Expand Up @@ -730,7 +730,7 @@ MyInput.propTypes = {
An example:

```jsx
addValidationRule('isFruit', function(values, value) {
addValidationRule('isFruit', function (values, value) {
return ['apple', 'orange', 'pear'].indexOf(value) >= 0;
});
```
Expand All @@ -742,7 +742,7 @@ addValidationRule('isFruit', function(values, value) {
Another example:

```jsx
addValidationRule('isIn', function(values, value, array) {
addValidationRule('isIn', function (values, value, array) {
return array.indexOf(value) >= 0;
});
```
Expand All @@ -756,7 +756,7 @@ addValidationRule('isIn', function(values, value, array) {
Cross input validation:

```jsx
addValidationRule('isMoreThan', function(values, value, otherField) {
addValidationRule('isMoreThan', function (values, value, otherField) {
// The this context points to an object containing the values
// {childAge: "", parentAge: "5"}
// otherField argument is from the validations rule ("childAge")
Expand Down
4 changes: 2 additions & 2 deletions __test_utils__/TestInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { PassDownProps } from '../src/Wrapper';
export type FormsyInputProps = React.HTMLProps<HTMLInputElement> & PassDownProps<string>;

class TestInput extends React.Component<FormsyInputProps> {
updateValue = event => {
updateValue = (event) => {
this.props.setValue(event.target[this.props.type === 'checkbox' ? 'checked' : 'value']);
};

Expand All @@ -17,7 +17,7 @@ class TestInput extends React.Component<FormsyInputProps> {
}

export function InputFactory(methods) {
Object.keys(methods).forEach(method => {
Object.keys(methods).forEach((method) => {
if (Object.prototype.hasOwnProperty.call(methods, method)) {
TestInput.prototype[method] = methods[method];
}
Expand Down
2 changes: 1 addition & 1 deletion __test_utils__/immediate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function(fn) {
export default function (fn) {
setTimeout(fn, 0);
}
2 changes: 1 addition & 1 deletion __tests__/Element-spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Element', () => {
it('withFormsy: should only set the value and not validate when calling setValue(val, false)', () => {
const Input = withFormsy(
class NoValidateInput extends React.Component<FormsyInputProps> {
updateValue = event => {
updateValue = (event) => {
this.props.setValue(event.target.value, false);
};

Expand Down
14 changes: 7 additions & 7 deletions __tests__/Formsy-spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Setting up a form', () => {
<Formsy>
<TestInputHoc
name="name"
innerRef={c => {
innerRef={(c) => {
this.inputRef = c;
}}
/>
Expand Down Expand Up @@ -49,7 +49,7 @@ describe('Setting up a form', () => {
function TestForm() {
return (
<Formsy
onSubmit={formModel => {
onSubmit={(formModel) => {
model = formModel;
}}
>
Expand All @@ -71,7 +71,7 @@ describe('Setting up a form', () => {

const form = mount(
<DynamicInputForm
onSubmit={formModel => {
onSubmit={(formModel) => {
model = formModel;
}}
inputName="test"
Expand All @@ -89,7 +89,7 @@ describe('Setting up a form', () => {

const form = mount(
<DynamicInputForm
onSubmit={formModel => {
onSubmit={(formModel) => {
model = formModel;
}}
inputName="test"
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('Setting up a form', () => {
const { inputValue } = this.state;
return (
<Formsy
onSubmit={formModel => {
onSubmit={(formModel) => {
model = formModel;
}}
>
Expand Down Expand Up @@ -150,7 +150,7 @@ describe('Setting up a form', () => {

describe('mapModel', () => {
it('should honor mapModel transformations', () => {
const mapping = jest.fn(model => ({
const mapping = jest.fn((model) => ({
...model,
testChange: true,
}));
Expand Down Expand Up @@ -451,7 +451,7 @@ describe('Update a form', () => {
};
}

onChange = values => {
onChange = (values) => {
this.setState(values.foo ? { validationErrors: {} } : { validationErrors: { foo: 'bar' } });
};

Expand Down
4 changes: 2 additions & 2 deletions __tests__/Utils-spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ const VALUES = [

describe('Utils', () => {
// For each function in types
Object.keys(TYPES).forEach(isFn => {
Object.keys(TYPES).forEach((isFn) => {
// Create a test for that functiojn
it(isFn, () => {
// For each value in values
VALUES.forEach(value => {
VALUES.forEach((value) => {
// Make sure that if it is in that types TYPES array, it returns true
expect(utils[isFn](value)).toBe(TYPES[isFn].includes(value));
});
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Validation-spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getFormInstance, getWrapperInstance } from '../__test_utils__/getInput'
class MyTest extends React.Component<{ type?: string } & PassDownProps<string>> {
public static defaultProps = { type: 'text' };

handleChange = event => {
handleChange = (event) => {
const { setValue } = this.props;
setValue(event.target.value);
};
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@
"@types/react-dom": "^16.9.5",
"@typescript-eslint/eslint-plugin": "^2.14.0",
"@typescript-eslint/parser": "^2.14.0",
"auto-changelog": "^1.14.1",
"auto-changelog": "^2.0.0",
"babel-eslint": "^10.0.2",
"babel-jest": "^25.1.0",
"babel-jest": "^26.0.1",
"babel-loader": "^8.0.6",
"babelrc-rollup": "^3.0.0",
"coveralls": "^3.0.9",
Expand All @@ -106,16 +106,16 @@
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"husky": "^4.2.1",
"jest": "^25.1.0",
"jest": "^26.0.1",
"np": "^5.0.0",
"prettier": "^1.18.2",
"prettier": "^2.0.2",
"pretty-quick": "^2.0.0",
"react": "^16.2.0 || ^16.0.0",
"react-dom": "^16.2.0 || ^16.0.0",
"rollup": "^1.19.2",
"rollup": "^2.7.6",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-peer-deps-external": "^2.2.0",
"sinon": "^8.0.2",
"sinon": "^9.0.0",
"typescript": "^3.5.3"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/Wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const convertValidationsToObject = <V>(validations: false | Validations<V>): Val
let args: string[] = validation.split(':');
const validateMethod: string = args.shift();

args = args.map(arg => {
args = args.map((arg) => {
try {
return JSON.parse(arg);
} catch (e) {
Expand Down Expand Up @@ -111,7 +111,7 @@ function getDisplayName(component: WrappedComponentClass) {
return component.displayName || component.name || (utils.isString(component) ? component : 'Component');
}

export default function<T, V>(
export default function <T, V>(
WrappedComponent: React.ComponentType<T & PassDownProps<V>>,
): React.ComponentType<Omit<T & WrapperProps<V>, keyof InjectedProps<V>>> {
return class extends React.Component<T & WrapperProps<V>, WrapperState<V>> implements WrapperInstanceMethods<V> {
Expand Down Expand Up @@ -166,7 +166,7 @@ export default function<T, V>(

public shouldComponentUpdate(nextProps, nextState, nextContext) {
const { props, state, context } = this;
const isChanged = (a: object, b: object): boolean => Object.keys(a).some(k => a[k] !== b[k]);
const isChanged = (a: object, b: object): boolean => Object.keys(a).some((k) => a[k] !== b[k]);
const isPropsChanged = isChanged(props, nextProps);
const isStateChanged = isChanged(state, nextState);
const isFormsyContextChanged = isChanged(context, nextContext);
Expand Down
Loading

0 comments on commit 6e38f70

Please sign in to comment.