Skip to content

Commit

Permalink
fix(ReactComponentLibrary): Make Formik a peer dependency
Browse files Browse the repository at this point in the history
Formik is currently required by the `FormikGroup` and `FormikGroupE` components, and so should be a peer dependency.
  • Loading branch information
jpveooys committed Dec 15, 2021
1 parent e0edd6a commit f9df7ab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ Please refer to the [component demo pages](https://design-system.digital.mod.uk/

### Installation

To install and save to your projects package.json dependencies, run:
To install and save to your project's package.json dependencies, run:

```
# with npm
npm install @defencedigital/fonts @defencedigital/react-component-library
npm install @defencedigital/fonts @defencedigital/react-component-library styled-components formik
# ...or with yarn
yarn add @defencedigital/fonts @defencedigital/react-component-library
yarn add @defencedigital/fonts @defencedigital/react-component-library styled-components formik
```

Note: As of `2.16.0` the [`styled-components`](https://github.com/styled-components/styled-components) package is now a required [peerDependency](https://nodejs.org/en/blog/npm/peer-dependencies/).
Note: [`styled-components`](https://styled-components.com/) and [`formik`](https://formik.org/) are required [peer dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/) and are installed with the above commands.

### Quick start

Expand Down
1 change: 1 addition & 0 deletions packages/cra-template-defencedigital/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@testing-library/jest-dom": "^5.5.0",
"@testing-library/react": "^10.0.4",
"@testing-library/user-event": "^10.1.0",
"formik": "^2.2.9",
"jest-canvas-mock": "^2.3.0",
"typescript": "^3.8.0",
"@graphql-codegen/cli": "^1.8.3",
Expand Down
10 changes: 6 additions & 4 deletions packages/react-component-library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ A collection of React components written for Defence Digital web applications.

The Defence Digital React Component Library is available as an [NPM package](https://www.npmjs.com/package/@defencedigital/react-component-library).

```
To install it, run the relevant command for your package manager:

```shell
// npm
npm install @defencedigital/fonts @defencedigital/react-component-library
npm install @defencedigital/fonts @defencedigital/react-component-library styled-components formik

// yarn
yarn add @defencedigital/fonts @defencedigital/react-component-library
yarn add @defencedigital/fonts @defencedigital/react-component-library styled-components formik
```

NOTE: As of `2.16.0` the [`styled-components`](https://github.com/styled-components/styled-components) package is now a required [peerDependency](https://nodejs.org/en/blog/npm/peer-dependencies/).
Note: [`styled-components`](https://styled-components.com/) and [`formik`](https://formik.org/) are required [peer dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/) and are installed with the above commands.

## Usage

Expand Down
1 change: 1 addition & 0 deletions packages/react-component-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
"styled-theming": "^2.2.0"
},
"peerDependencies": {
"formik": "^2 || ^3",
"styled-components": ">= 5"
}
}

0 comments on commit f9df7ab

Please sign in to comment.