From f9df7ab6cfef4d13168077f3b794a67a8418c87c Mon Sep 17 00:00:00 2001 From: jpveooys <66470099+jpveooys@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:59:42 +0000 Subject: [PATCH] fix(ReactComponentLibrary): Make Formik a peer dependency Formik is currently required by the `FormikGroup` and `FormikGroupE` components, and so should be a peer dependency. --- README.md | 8 ++++---- packages/cra-template-defencedigital/template.json | 1 + packages/react-component-library/README.md | 10 ++++++---- packages/react-component-library/package.json | 1 + 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6035b45afa..059680cd5d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/packages/cra-template-defencedigital/template.json b/packages/cra-template-defencedigital/template.json index dddc264485..63a24e2389 100644 --- a/packages/cra-template-defencedigital/template.json +++ b/packages/cra-template-defencedigital/template.json @@ -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", diff --git a/packages/react-component-library/README.md b/packages/react-component-library/README.md index 5bd6bea8b6..c146ee2635 100755 --- a/packages/react-component-library/README.md +++ b/packages/react-component-library/README.md @@ -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 diff --git a/packages/react-component-library/package.json b/packages/react-component-library/package.json index bff7cf3a5f..2109977f71 100644 --- a/packages/react-component-library/package.json +++ b/packages/react-component-library/package.json @@ -193,6 +193,7 @@ "styled-theming": "^2.2.0" }, "peerDependencies": { + "formik": "^2 || ^3", "styled-components": ">= 5" } }