From 47f4462d72ad3fddda10c4efa178176715caebe0 Mon Sep 17 00:00:00 2001 From: Hana Worku Date: Mon, 15 Jun 2020 14:17:05 -0500 Subject: [PATCH] Squashed commit of the following: commit 1054469393951e4179690585f7db5ba949f54d99 Author: Emily Mahanna <56279459+eamahanna@users.noreply.github.com> Date: Mon Jun 15 10:40:45 2020 -0800 feat(example app): add modals page example 204 (#250) * WIP Set up basic layout, router * Switch to react-router, add placeholder content * feat(example app): add modals example page * feat(example app): add redux for modals * hook up modals page * feat(example app): add hook modal * fix(modals page): fixes from PR review * fix(modals page): pr update * fix(modals page): remove comment * fix(modals page): add import back in Co-authored-by: Suzanne Rozier commit 832decc83ec38afefed86a25409a0a9ebce83423 Author: Suzanne Rozier Date: Mon Jun 15 13:00:03 2020 -0500 docs(example-app): Example app UI #202 (#237) * WIP Set up basic layout, router * Switch to react-router, add placeholder content * Add docs and commands for running the example app --- docs/contributing.md | 5 + example/README.md | 18 +++- example/package.json | 5 + example/src/App.css | 38 ------- example/src/App.test.tsx | 10 +- example/src/App.tsx | 106 ++++++++++++++++---- example/src/index.tsx | 14 ++- example/src/pages/Example.tsx | 24 +++++ example/src/pages/Home.tsx | 14 +++ example/src/pages/Modals.tsx | 98 ++++++++++++++++++ example/src/redux/actions.test.ts | 30 ++++++ example/src/redux/actions.tsx | 16 +++ example/src/redux/reducer.test.ts | 34 +++++++ example/src/redux/reducers.ts | 36 +++++++ example/src/redux/types.ts | 24 +++++ example/yarn.lock | 158 +++++++++++++++++++++++++++++- package.json | 4 +- 17 files changed, 563 insertions(+), 71 deletions(-) create mode 100644 example/src/pages/Example.tsx create mode 100644 example/src/pages/Home.tsx create mode 100644 example/src/pages/Modals.tsx create mode 100644 example/src/redux/actions.test.ts create mode 100644 example/src/redux/actions.tsx create mode 100644 example/src/redux/reducer.test.ts create mode 100644 example/src/redux/reducers.ts create mode 100644 example/src/redux/types.ts diff --git a/docs/contributing.md b/docs/contributing.md index 4183bafffb..2bf62f1a4e 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -33,6 +33,11 @@ These should all be run from within the project directory. - `yarn build` - Builds files from `/src` and outputs to `/lib` using webpack and UMD library target - `yarn build:watch` is also available +- `yarn example:install` + - Installs dependencies for the example app. This must be run prior to viewing/developing the example application (located in `/example`). + - Builds the library files from `/src` into `/lib`, and also runs `yarn install` in the `/example` directory +- `yarn example:start` + - After installing dependencies, use this to start the example app dev server, so you can view the example app and also add to it. ## Development diff --git a/example/README.md b/example/README.md index 39bf52789b..2a996bc0b7 100644 --- a/example/README.md +++ b/example/README.md @@ -2,13 +2,25 @@ This app is meant to demonstrate some of the features and components that make up the @trussworks/react-uswds library. It is just an example, and is currently not deployed or used anywhere other than for local development and testing. -_Note:_ Currently the `start, test, build` scripts are prepended with `SKIP_PREFLIGHT_CHECK=true` in `package.json`. This is to get around the issue that Create React App requires specific versions of certain libraries to run, and the ReactUSWDS library is using newer versions of those libraries (notably `babel-jest`). This was the fastest/easiest workaround for now. Relevant discussion at https://github.com/facebook/create-react-app/issues/6756. +## Pre-requisites + +Since this application points to the local version of @trussworks/react-uswds, the library must be built before starting the application. In the project root (up one level from this README), you can build the library and install example app dependencies with: + +``` +yarn example:install +``` + +Then you can start the example app dev server with: + +``` +yarn example:start +``` This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Available Scripts -In the project directory, you can run: +In this directory, you can run: ### `yarn start` @@ -33,6 +45,8 @@ Your app is ready to be deployed! See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. +_Note:_ Currently the `start, test, build` scripts are prepended with `SKIP_PREFLIGHT_CHECK=true` in `package.json`. This is to get around the issue that Create React App requires specific versions of certain libraries to run, and the ReactUSWDS library is using newer versions of those libraries (notably `babel-jest`). This was the fastest/easiest workaround for now. Relevant discussion at https://github.com/facebook/create-react-app/issues/6756. + ## Learn More You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). diff --git a/example/package.json b/example/package.json index 43955b38e4..3ff68c348f 100644 --- a/example/package.json +++ b/example/package.json @@ -11,9 +11,13 @@ "@types/node": "^12.0.0", "@types/react": "^16.9.0", "@types/react-dom": "^16.9.0", + "@types/react-redux": "^7.1.9", "react": "^16.13.1", "react-dom": "^16.13.1", + "react-redux": "^7.2.0", + "react-router-dom": "^5.2.0", "react-scripts": "3.4.1", + "redux": "^4.0.5", "typescript": "~3.7.2" }, "scripts": { @@ -37,6 +41,7 @@ ] }, "devDependencies": { + "@types/react-router-dom": "^5.1.5", "customize-cra": "^0.9.1", "react-app-rewired": "^2.1.6" }, diff --git a/example/src/App.css b/example/src/App.css index 74b5e05345..e69de29bb2 100644 --- a/example/src/App.css +++ b/example/src/App.css @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/example/src/App.test.tsx b/example/src/App.test.tsx index 4db7ebc25c..7877c9a9d7 100644 --- a/example/src/App.test.tsx +++ b/example/src/App.test.tsx @@ -2,8 +2,8 @@ import React from 'react'; import { render } from '@testing-library/react'; import App from './App'; -test('renders learn react link', () => { - const { getByText } = render(); - const linkElement = getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); +// TODO Add additional app testing +test('renders the app without error', () => { + const { getByText } = render() + expect(getByText('Modals')).toBeInTheDocument() +}) diff --git a/example/src/App.tsx b/example/src/App.tsx index 12c6755092..5512ef6bcc 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,29 +1,97 @@ -import React from 'react' +import React, { useState } from 'react' +import { + BrowserRouter as Router, + Switch, + Route, + NavLink, + Link, +} from 'react-router-dom' import '@trussworks/react-uswds/lib/uswds.css' -import { GovBanner } from '@trussworks/react-uswds' +import '@trussworks/react-uswds/lib/index.css' +import { + GovBanner, + Header, + Title, + NavMenuButton, + PrimaryNav, + GridContainer, +} from '@trussworks/react-uswds' + +import HomePage from './pages/Home' +import ExamplePage from './pages/Example' +import ModalsPage from './pages/Modals' -import logo from './logo.svg' import './App.css' -function App() { +/* Routes */ +const routes = { + HOME_PAGE: '/', + EXAMPLES_PAGE: '/examples', + MODALS_PAGE: '/modals', +} + +const App = () => { + const [mobileNavOpen, setMobileNavOpen] = useState(false) + const { HOME_PAGE, EXAMPLES_PAGE, MODALS_PAGE } = routes + + const toggleMobileNav = (): void => { + setMobileNavOpen((prevOpen) => !prevOpen) + } + + const navItems = [ + + Home + , + + Examples + , + + Modals + , + ] + return ( -
+ -
- logo -

- Edit src/App.tsx and save to reload. -

- - Learn React - -
-
+
+
+
+ + <Link to={HOME_PAGE}>Example Application</Link> + + +
+ + +
+
+ +
+ + + + + + + + + + + + + +
+ ) } diff --git a/example/src/index.tsx b/example/src/index.tsx index f5185c1ec7..47814d7430 100644 --- a/example/src/index.tsx +++ b/example/src/index.tsx @@ -3,11 +3,19 @@ import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import * as serviceWorker from './serviceWorker'; +import { createStore } from 'redux'; +import { Provider } from 'react-redux'; + +import { rootReducer } from './redux/reducers' + +const store = createStore(rootReducer) ReactDOM.render( - - - , + + + + + , document.getElementById('root') ); diff --git a/example/src/pages/Example.tsx b/example/src/pages/Example.tsx new file mode 100644 index 0000000000..0eae8345e3 --- /dev/null +++ b/example/src/pages/Example.tsx @@ -0,0 +1,24 @@ +import React from 'react' + +const ExamplePage = (): React.ReactElement => ( +
+

Examples

+ +

+ Right now there are no examples! Things that we could add include... +

+ +
    +
  • Modals
  • +
  • + Form libraries +
      +
    • Formik
    • +
    • React-hook-form
    • +
    +
  • +
+
+) + +export default ExamplePage diff --git a/example/src/pages/Home.tsx b/example/src/pages/Home.tsx new file mode 100644 index 0000000000..258ea6e0fd --- /dev/null +++ b/example/src/pages/Home.tsx @@ -0,0 +1,14 @@ +import React from 'react' + +const HomePage = (): React.ReactElement => ( +
+

ReactUSWDS Example App

+ +

+ This is an example application that can be used to demonstrate and test + ReactUSWDS functionality. +

+
+) + +export default HomePage diff --git a/example/src/pages/Modals.tsx b/example/src/pages/Modals.tsx new file mode 100644 index 0000000000..6a33f3823d --- /dev/null +++ b/example/src/pages/Modals.tsx @@ -0,0 +1,98 @@ +import React from 'react' +import { + Modal, + Button, + connectModal, + ConnectedModalProps, + useModal +} from '@trussworks/react-uswds' +import { connect, ConnectedProps } from 'react-redux' + +import { openModalAction, closeModalAction } from './../redux/actions' +import { AppState, ModalState } from './../redux/types' + + +interface TestModalProps extends ConnectedModalProps { + modalKey?: string + children: React.ReactNode +} + +const TestModal = ({ onClose, children }: TestModalProps): React.ReactElement => ( + Test Modal} + actions={ + <> + + + + }> + { children } + +) + +/** Example of Modal Component Using Redux */ +const ConnectedTestModal = connectModal(TestModal) + +const mapStateToProps = (state: AppState): ModalState => ({ + openModalKey: state.modalState.openModalKey, +}) + +const mapDispatchToProps = { + openModalAction: openModalAction, + closeModalAction: closeModalAction, +} + +const connector = connect(mapStateToProps, mapDispatchToProps) +/** End of Example of Modal Component Using Redux */ + +const ExamplePage = ({ + openModalKey, + openModalAction, + closeModalAction, +}: ConnectedProps): React.ReactElement => { + + /** Example of Modal Component Using Hooks */ + const { isOpen, openModal, closeModal } = useModal() + /** End of Example of Modal Component Using Hooks */ + + return ( +
+

Modals

+ +

+ This page provides examples of how modals may be used within an + application. +

+ +
+ + {/* Example of modal using redux for state management */} + closeModalAction('testModal')}> +

This is a modal that uses redux!

+
+
+
+ + {/* Example of modal using hooks for state management */} + +

This is a modal that uses hooks!

+
+
+
+ ) +} + +const ConnectedExamplePage = connector(ExamplePage) + +export default ConnectedExamplePage diff --git a/example/src/redux/actions.test.ts b/example/src/redux/actions.test.ts new file mode 100644 index 0000000000..3f86f57364 --- /dev/null +++ b/example/src/redux/actions.test.ts @@ -0,0 +1,30 @@ +import { + CLOSE_MODAL, + OPEN_MODAL, +} from './types' +import { + closeModalAction, + openModalAction, +} from './actions' + +describe('Modal actions', () => { + describe('closeModal Action', () => { + it('returns the CLOSE_MODAL action type', () => { + const expectedAction = { + type: CLOSE_MODAL, + payload: 'testkey' + } + expect(closeModalAction('testkey')).toEqual(expectedAction) + }) + }) + + describe('openModal Action', () => { + it('returns the OPEN_MODAL action type', () => { + const expectedAction = { + type: OPEN_MODAL, + payload: 'testkey' + } + expect(openModalAction('testkey')).toEqual(expectedAction) + }) + }) +}) diff --git a/example/src/redux/actions.tsx b/example/src/redux/actions.tsx new file mode 100644 index 0000000000..d6861b0919 --- /dev/null +++ b/example/src/redux/actions.tsx @@ -0,0 +1,16 @@ + +import { OPEN_MODAL, CLOSE_MODAL } from "./types"; + +export function openModalAction( modalKey: string) { + return { + type: OPEN_MODAL, + payload: modalKey + }; +} + +export function closeModalAction(modalKey: string) { + return { + type: CLOSE_MODAL, + payload: modalKey + }; +} diff --git a/example/src/redux/reducer.test.ts b/example/src/redux/reducer.test.ts new file mode 100644 index 0000000000..013a4f009f --- /dev/null +++ b/example/src/redux/reducer.test.ts @@ -0,0 +1,34 @@ +import { initialState, rootReducer } from './reducers' +import { OpenModalAction, CloseModalAction, AppState } from './types' + +describe('rootReducer', () => { + it('should set the openModalKey state', () => { + const openModalAction: OpenModalAction = { + type: 'OPEN_MODAL', + payload: 'testModal', + } + + const expectedState : AppState = { + modalState : { + openModalKey: 'testModal' + } + } + + expect(rootReducer(initialState, openModalAction)).toEqual(expectedState) + }) + + it('should set the openModalKey state', () => { + const closeModalAction: CloseModalAction = { + type: 'CLOSE_MODAL', + payload: 'testModal', + } + + const expectedState : AppState = { + modalState : { + openModalKey: '' + } + } + + expect(rootReducer(initialState, closeModalAction)).toEqual(expectedState) + }) +}) diff --git a/example/src/redux/reducers.ts b/example/src/redux/reducers.ts new file mode 100644 index 0000000000..44cb238879 --- /dev/null +++ b/example/src/redux/reducers.ts @@ -0,0 +1,36 @@ +import { + OPEN_MODAL, + CLOSE_MODAL, + ModalActionTypes, + AppState +} from "./types"; + +export const initialState: AppState = { + modalState : { + openModalKey: '' + } +}; + +export function rootReducer ( + state = initialState, + action: ModalActionTypes +): AppState { + switch (action.type) { + case OPEN_MODAL: + return { + ...state, + modalState: { + openModalKey: action.payload + } + } + case CLOSE_MODAL: + return { + ...state, + modalState: { + openModalKey: '' + } + } + default: + return state + } +} \ No newline at end of file diff --git a/example/src/redux/types.ts b/example/src/redux/types.ts new file mode 100644 index 0000000000..bd67c164d5 --- /dev/null +++ b/example/src/redux/types.ts @@ -0,0 +1,24 @@ +/** Modal Types */ +export interface ModalState { + // string is the key of the open modal. This only allows a single modal to be open in the app at any time. + openModalKey: string +} + +export const OPEN_MODAL = "OPEN_MODAL"; +export const CLOSE_MODAL = "CLOSE_MODAL"; + +export interface OpenModalAction { + type: typeof OPEN_MODAL; + payload: string; +} + +export interface CloseModalAction { + type: typeof CLOSE_MODAL; + payload: string; +} + +export type ModalActionTypes = OpenModalAction | CloseModalAction; + +export interface AppState { + modalState: ModalState +} \ No newline at end of file diff --git a/example/yarn.lock b/example/yarn.lock index a835671f0c..3ab8cc8f5f 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -970,7 +970,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@>=7.0.0": +"@babel/runtime@>=7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.5.5": version "7.10.2" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.10.2.tgz#d103f21f2602497d38348a32e008637d506db839" integrity sha512-6sF3uQw2ivImfVIl62RZ7MXhO2tap69WeWK57vAaimT6AZbE4FbqjdEJIN1UqoD6wI6B+1n9UiagafH1sxjOtg== @@ -1500,6 +1500,19 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/history@*": + version "4.7.6" + resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.6.tgz#ed8fc802c45b8e8f54419c2d054e55c9ea344356" + integrity sha512-GRTZLeLJ8ia00ZH8mxMO8t0aC9M1N9bN461Z2eaRurJo6Fpa+utgCwLzI4jQHcrdzuzp5WPN9jRwpsCQ1VhJ5w== + +"@types/hoist-non-react-statics@^3.3.0": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" + integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA== + dependencies: + "@types/react" "*" + hoist-non-react-statics "^3.3.0" + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" @@ -1574,6 +1587,33 @@ dependencies: "@types/react" "*" +"@types/react-redux@^7.1.9": + version "7.1.9" + resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.9.tgz#280c13565c9f13ceb727ec21e767abe0e9b4aec3" + integrity sha512-mpC0jqxhP4mhmOl3P4ipRsgTgbNofMRXJb08Ms6gekViLj61v1hOZEKWDCyWsdONr6EjEA6ZHXC446wdywDe0w== + dependencies: + "@types/hoist-non-react-statics" "^3.3.0" + "@types/react" "*" + hoist-non-react-statics "^3.3.0" + redux "^4.0.0" + +"@types/react-router-dom@^5.1.5": + version "5.1.5" + resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.1.5.tgz#7c334a2ea785dbad2b2dcdd83d2cf3d9973da090" + integrity sha512-ArBM4B1g3BWLGbaGvwBGO75GNFbLDUthrDojV2vHLih/Tq8M+tgvY1DSwkuNrPSwdp/GUL93WSEpTZs8nVyJLw== + dependencies: + "@types/history" "*" + "@types/react" "*" + "@types/react-router" "*" + +"@types/react-router@*": + version "5.1.7" + resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.7.tgz#e9d12ed7dcfc79187e4d36667745b69a5aa11556" + integrity sha512-2ouP76VQafKjtuc0ShpwUebhHwJo0G6rhahW9Pb8au3tQTjYXd2jta4wv6U2tGLR/I42yuG00+UXjNYY0dTzbg== + dependencies: + "@types/history" "*" + "@types/react" "*" + "@types/react@*", "@types/react@^16.9.0": version "16.9.35" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.35.tgz#a0830d172e8aadd9bd41709ba2281a3124bbd368" @@ -5174,6 +5214,18 @@ hex-color-regex@^1.1.0: resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e" integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ== +history@^4.9.0: + version "4.10.1" + resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3" + integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew== + dependencies: + "@babel/runtime" "^7.1.2" + loose-envify "^1.2.0" + resolve-pathname "^3.0.0" + tiny-invariant "^1.0.2" + tiny-warning "^1.0.0" + value-equal "^1.0.1" + hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -5183,6 +5235,13 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" +hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== + dependencies: + react-is "^16.7.0" + hosted-git-info@^2.1.4: version "2.8.8" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488" @@ -5872,6 +5931,11 @@ is-wsl@^2.1.1: resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.1.1.tgz#4a1c152d429df3d441669498e2486d3596ebaf1d" integrity sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog== +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= + isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -6771,7 +6835,7 @@ loglevel@^1.6.6: resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.7.tgz#b3e034233188c68b889f5b862415306f565e2c56" integrity sha512-cY2eLFrQSAfVPhCgH1s7JI73tMbg9YC3v3+ZHVW67sBS7UxWzNEk/ZBbSfLykBWHp33dqqtOv82gjhKEi81T/A== -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -6988,6 +7052,14 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.0.tgz#cfc45c37e9ec0d8f0a0ec3dd4ef7f7c3abe39256" integrity sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY= +mini-create-react-context@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.0.tgz#df60501c83151db69e28eac0ef08b4002efab040" + integrity sha512-b0TytUgFSbgFJGzJqXPKCFCBWigAjpjo+Fl7Vf7ZbKRDptszpppKxXH6DRXEABZ/gcEQczeb0iZ7JvL8e8jjCA== + dependencies: + "@babel/runtime" "^7.5.5" + tiny-warning "^1.0.3" + mini-css-extract-plugin@0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e" @@ -7772,6 +7844,13 @@ path-to-regexp@0.1.7: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= +path-to-regexp@^1.7.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" + integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA== + dependencies: + isarray "0.0.1" + path-type@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" @@ -8874,11 +8953,51 @@ react-error-overlay@^6.0.7: resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.7.tgz#1dcfb459ab671d53f660a991513cb2f0a0553108" integrity sha512-TAv1KJFh3RhqxNvhzxj6LeT5NWklP6rDr2a0jaTfsZ5wSZWHOGeqQyejUp3xxLfPt2UpyJEcVQB/zyPcmonNFA== -react-is@^16.12.0, react-is@^16.8.1, react-is@^16.8.4: +react-is@^16.12.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.9.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-redux@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.0.tgz#f970f62192b3981642fec46fd0db18a074fe879d" + integrity sha512-EvCAZYGfOLqwV7gh849xy9/pt55rJXPwmYvI4lilPM5rUT/1NxuuN59ipdBksRVSvz0KInbPnp4IfoXJXCqiDA== + dependencies: + "@babel/runtime" "^7.5.5" + hoist-non-react-statics "^3.3.0" + loose-envify "^1.4.0" + prop-types "^15.7.2" + react-is "^16.9.0" + +react-router-dom@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662" + integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA== + dependencies: + "@babel/runtime" "^7.1.2" + history "^4.9.0" + loose-envify "^1.3.1" + prop-types "^15.6.2" + react-router "5.2.0" + tiny-invariant "^1.0.2" + tiny-warning "^1.0.0" + +react-router@5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293" + integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw== + dependencies: + "@babel/runtime" "^7.1.2" + history "^4.9.0" + hoist-non-react-statics "^3.1.0" + loose-envify "^1.3.1" + mini-create-react-context "^0.4.0" + path-to-regexp "^1.7.0" + prop-types "^15.6.2" + react-is "^16.6.0" + tiny-invariant "^1.0.2" + tiny-warning "^1.0.0" + react-scripts@3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-3.4.1.tgz#f551298b5c71985cc491b9acf3c8e8c0ae3ada0a" @@ -9052,6 +9171,14 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" +redux@^4.0.0, redux@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.5.tgz#4db5de5816e17891de8a80c424232d06f051d93f" + integrity sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w== + dependencies: + loose-envify "^1.4.0" + symbol-observable "^1.2.0" + regenerate-unicode-properties@^8.2.0: version "8.2.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" @@ -9252,6 +9379,11 @@ resolve-id-refs@^0.1.0: resolved "https://registry.yarnpkg.com/resolve-id-refs/-/resolve-id-refs-0.1.0.tgz#3126624b887489da8fc0ae889632f8413ac6c3ec" integrity sha1-MSZiS4h0idqPwK6IljL4QTrGw+w= +resolve-pathname@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd" + integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng== + resolve-url-loader@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-3.1.1.tgz#28931895fa1eab9be0647d3b2958c100ae3c0bf0" @@ -10179,6 +10311,11 @@ svgo@^1.0.0, svgo@^1.2.2: unquote "~1.1.1" util.promisify "~1.0.0" +symbol-observable@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" + integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== + symbol-tree@^3.2.2: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -10299,6 +10436,16 @@ timsort@^0.3.0: resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= +tiny-invariant@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875" + integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw== + +tiny-warning@^1.0.0, tiny-warning@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" + integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== + tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -10666,6 +10813,11 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +value-equal@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c" + integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw== + vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" diff --git a/package.json b/package.json index 2846bf74e9..f005d4e821 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,9 @@ "release": "standard-version -t", "prepublishOnly": "yarn build", "happo": "happo", - "happo-ci": "happo-ci-circleci" + "happo-ci": "happo-ci-circleci", + "example:install": "yarn build && cd example/ && yarn", + "example:start": "cd example/ && yarn start" }, "repository": { "type": "git",