From fcb13eeda90406af323daa264471583bc55b3c3c Mon Sep 17 00:00:00 2001 From: Matt Sutkowski Date: Thu, 23 Sep 2021 15:09:29 -0700 Subject: [PATCH] chore: fix delay input, reorg exports, add utils, fix example (#4) --- example/constants.ts | 1 + example/index.tsx | 2 + example/mockServiceWorker.js | 338 ++++++++++++++++++++ example/mocks/browser.ts | 6 +- example/package.json | 6 +- example/yarn.lock | 80 ++++- src/{index.tsx => component/MSWToolbar.tsx} | 39 ++- src/{hooks.tsx => component/hooks.ts} | 0 src/{ => component}/styles.module.css | 0 src/helpers/index.ts | 1 + src/helpers/settings.ts | 33 ++ src/index.ts | 5 + src/types.ts | 3 + src/utils.ts | 3 - src/utils/index.ts | 32 ++ 15 files changed, 521 insertions(+), 28 deletions(-) create mode 100644 example/constants.ts create mode 100644 example/mockServiceWorker.js rename src/{index.tsx => component/MSWToolbar.tsx} (85%) rename src/{hooks.tsx => component/hooks.ts} (100%) rename src/{ => component}/styles.module.css (100%) create mode 100644 src/helpers/index.ts create mode 100644 src/helpers/settings.ts create mode 100644 src/index.ts create mode 100644 src/types.ts delete mode 100644 src/utils.ts create mode 100644 src/utils/index.ts diff --git a/example/constants.ts b/example/constants.ts new file mode 100644 index 0000000..c7852db --- /dev/null +++ b/example/constants.ts @@ -0,0 +1 @@ +export const APP_NAME = 'exampleApp'; diff --git a/example/index.tsx b/example/index.tsx index eee1c2a..22c0d04 100644 --- a/example/index.tsx +++ b/example/index.tsx @@ -4,6 +4,7 @@ import * as ReactDOM from 'react-dom'; import { MSWToolbar } from '../.'; import { Button, ChakraProvider, HStack } from '@chakra-ui/react'; import type { SetupWorkerApi } from 'msw'; +import { APP_NAME } from './constants'; const isDev = process.env.NODE_ENV === 'development'; @@ -32,6 +33,7 @@ const App = () => { } + prefix={APP_NAME} >