Skip to content

Commit

Permalink
Automatic Library Updates (#553)
Browse files Browse the repository at this point in the history
* Use lodash as dependency instead of sub-packages

* Reset yarn lock

* chore(deps-dev): Bump @types/react from 16.9.48 to 16.9.49 (#558)

* chore(deps-dev): Bump enzyme-adapter-react-16 from 1.15.3 to 1.15.4 (#559)

* chore(deps-dev): Bump @types/jest from 26.0.10 to 26.0.12 (#560)

* Build on prepublish only

* Reset yarn lock

* chore(deps-dev): Bump @types/enzyme from 3.10.5 to 3.10.6 (#561)

* chore(deps-dev): Bump husky from 4.2.5 to 4.3.0 (#562)

* chore(deps-dev): Bump auto-changelog from 2.2.0 to 2.2.1 (#567)

* chore(deps-dev): Bump enzyme-adapter-react-16 from 1.15.4 to 1.15.5 (#568)

* chore(deps-dev): Bump prettier from 2.1.1 to 2.1.2 (#569)

* chore(deps-dev): Bump @types/jest from 26.0.13 to 26.0.14 (#571)

* chore(deps-dev): Bump @types/enzyme from 3.10.6 to 3.10.7 (#573)

* chore(deps-dev): Bump tsdx from 0.13.3 to 0.14.0 (#572)

* chore(deps-dev): Bump tsdx from 0.14.0 to 0.14.1 (#574)

* chore(deps-dev): Bump @types/enzyme from 3.10.7 to 3.10.8 (#577)

* chore(deps-dev): Bump @types/react-dom from 16.9.8 to 16.9.9 (#580)

* chore(deps-dev): Bump @types/jest from 26.0.14 to 26.0.15 (#582)

* chore(deps-dev): Bump tslib from 2.0.1 to 2.0.3 (#575)

* chore(deps-dev): Bump @types/react from 16.9.49 to 16.9.55 (#581)

* chore(deps-dev): Bump np from 5.2.1 to 7.0.0 (#576)

* chore(deps-dev): Bump react from 16.13.1 to 16.14.0 (#579)

* chore(deps-dev): Bump react-dom from 16.13.1 to 16.14.0 (#584)

* chore(deps-dev): Bump @types/react from 16.9.55 to 17.0.0 (#585)

* chore(deps-dev): Bump prettier from 2.1.2 to 2.2.1 (#587)

* chore(deps-dev): Bump @types/react-dom from 16.9.9 to 17.0.0 (#588)

* chore(deps): [Security] Bump ini from 1.3.5 to 1.3.7 (#589)

* chore(deps-dev): Bump eslint-plugin-prettier from 3.1.4 to 3.3.0 (#593)

* chore(deps-dev): Bump husky from 4.3.0 to 4.3.6 (#594)

* chore(deps-dev): Bump @types/jest from 26.0.15 to 26.0.19 (#595)

* chore(deps-dev): Bump np from 7.0.0 to 7.2.0 (#598)

* Reset yarn.lock

* Prettier changes

* chore(deps-dev): Bump typescript from 3.9.7 to 4.1.3 (#601)

* Bump react and react-dom, revert np

* Revert "Bump react and react-dom, revert np"

This reverts commit a6c336d.

* Revert np

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
  • Loading branch information
rkuykendall and dependabot-preview[bot] committed Jan 22, 2021
1 parent be68616 commit 06a2f87
Show file tree
Hide file tree
Showing 9 changed files with 2,279 additions and 2,154 deletions.
5 changes: 3 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ With the `preventExternalInvalidation` the input will not be invalidated though
`updateInputsWithError()` or an `invalidate` callback is called.

### <a id="formElement">formElement</a>
By default Formsy render the form with the HTML `form` element.
If you want to override this behaviour, you can pass the element to render in the `formElement` props

By default Formsy render the form with the HTML `form` element. If you want to override this behaviour, you can pass the
element to render in the `formElement` props

```jsx
<Formsy formElement="div">
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ A form input builder and validator for React.
| [Quick Start](#quick-start) | [API](/API.md) | [1.x API](https://github.com/formsy/formsy-react/blob/v1.x/API.md) |
| --------------------------- | -------------- | ------------------------------------------------------------------ |


## Background

[christianalfoni](https://github.com/christianalfoni/) wrote an article on forms and validation with React,
Expand Down Expand Up @@ -41,8 +40,8 @@ if you're looking for old issues.

- [twisty/formsy-react-components](https://github.com/twisty/formsy-react-components) - Bootstrap components for a
Formsy-React form.
- [zabute/formsy-semantic-ui-react](https://github.com/zabute/formsy-semantic-ui-react) - Semantic-Ui-React components for a
Formsy-React form.
- [zabute/formsy-semantic-ui-react](https://github.com/zabute/formsy-semantic-ui-react) - Semantic-Ui-React components
for a Formsy-React form.

## 1.x to 2.x Upgrade Guide

Expand Down
2 changes: 1 addition & 1 deletion __tests__/Element.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('Element', () => {
mount(
<Formsy action="/users">
<Input name="foo" value="" />
<Input name="foo" value="" required />
<Input name="foo" value="" required />
<Input name="foo" value="foo" required="isLength:3" />
</Formsy>,
);
Expand Down
18 changes: 7 additions & 11 deletions __tests__/Formsy.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1083,16 +1083,12 @@ describe('onSubmit/onValidSubmit/onInvalidSubmit', () => {

describe('<Formsy /> can render any tag or element with the props as', () => {
it('as div', () => {
const form = mount(
<Formsy formElement="div" />
);
expect(form.find('div').length).toBe(1)
})
const form = mount(<Formsy formElement="div" />);
expect(form.find('div').length).toBe(1);
});
it('as CustumElement', () => {
const CustomElement = ({ children }) => <div>{children}</div>;
const form = mount(
<Formsy formElement={CustomElement} />
);
expect(form.find(CustomElement).length).toBe(1)
})
})
const form = mount(<Formsy formElement={CustomElement} />);
expect(form.find(CustomElement).length).toBe(1);
});
});
23 changes: 10 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,32 @@
],
"types": "dist/index.d.ts",
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test --passWithNoTests",
"lint": "tsdx lint",
"prepare": "tsdx build",
"build:clean": "rm -r dist/* || true",
"changelog": "auto-changelog",
"deploy": "np",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,md}\"",
"lint": "tsdx lint",
"prepublishOnly": "tsdx build",
"preversion": "npm run lint",
"start": "tsdx watch",
"test": "tsdx test --passWithNoTests",
"version": "npm run build && git add dist && npm run changelog && git add CHANGELOG.md"
},
"dependencies": {
"lodash.get": "^4.4.2",
"lodash.has": "^4.5.2",
"lodash.isplainobject": "^4.0.6",
"lodash.set": "^4.3.2",
"lodash": "^4.17.20",
"prop-types": "^15.7.2"
},
"devDependencies": {
"@types/enzyme": "^3.10.3",
"@types/jest": "^26.0.0",
"@types/jest": "^26.0.13",
"@types/lodash.get": "^4.4.6",
"@types/lodash.has": "^4.5.6",
"@types/lodash.isplainobject": "^4.0.6",
"@types/lodash.set": "^4.3.6",
"@types/prop-types": "^15.7.1",
"@types/react": "^16.9.43",
"@types/react-dom": "^16.9.8",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"auto-changelog": "^2.0.0",
"coveralls": "^3.0.9",
"enzyme": "^3.10.0",
Expand All @@ -66,9 +63,9 @@
"prettier": "^2.0.2",
"react": "^16.2.0 || ^16.0.0",
"react-dom": "^16.2.0 || ^16.0.0",
"tsdx": "^0.13.2",
"tsdx": "^0.14.0",
"tslib": "^2.0.0",
"typescript": "^3.9.7"
"typescript": "^4.1.3"
},
"peerDependencies": {
"react": "^16.0.0 || ^17.0.0",
Expand Down
4 changes: 1 addition & 3 deletions src/Formsy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */
import get from 'lodash.get';
import has from 'lodash.has';
import set from 'lodash.set';
import { get, has, set } from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';
import FormsyContext from './FormsyContext';
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import isPlainObject from 'lodash.isplainobject';
import { isPlainObject } from 'lodash';

import { ValidationError, Validations, Values } from './interfaces';

Expand Down
3 changes: 2 additions & 1 deletion src/withFormsy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ function getDisplayName(component: WrappedComponentClass) {
export default function withFormsy<T, V>(
WrappedComponent: React.ComponentType<T & PassDownProps<V>>,
): React.ComponentType<Omit<T & WrapperProps<V>, keyof InjectedProps<V>>> {
class WithFormsyWrapper extends React.Component<T & WrapperProps<V> & FormsyContextInterface, WrapperState<V>>
class WithFormsyWrapper
extends React.Component<T & WrapperProps<V> & FormsyContextInterface, WrapperState<V>>
implements WrapperInstanceMethods<V> {
public validations?: Validations<V>;

Expand Down
Loading

0 comments on commit 06a2f87

Please sign in to comment.