Skip to content

Commit 826ed96

Browse files
committed
Add typecheck script, fix Modal types
1 parent 17bf90c commit 826ed96

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,14 @@ To create a new component for `rari-components`:
9090

9191
## Troubleshooting
9292

93+
### Updates Not Reflected in Next.js App
94+
9395
Since we are using commit hashes to version this package rather than `package.json` versions, Next.js sometimes caches previous versions of the component library between builds.
9496

9597
If you install a new version of `rari-components` but your Next.js app does not seem to reflect the latest changes, try running `rm -rf .next` to clear the Next cache and then restart the app.
9698

9799
In production, a manual re-deploy on Vercel should force a build with no cache.
100+
101+
### Type Errors
102+
103+
Run `npm run typecheck` to typecheck `components/`.

components/Modal/Modal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type ModalProps<Ctx extends object> = Omit<ChakraModalProps, "children"> & {
6262
/**
6363
* A modal component based off of Chakra's `Modal`.
6464
*/
65-
function Modal<Ctx>({
65+
function Modal<Ctx extends object>({
6666
ctx,
6767
title,
6868
subtitle,

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"start": "npm run storybook",
88
"storybook": "start-storybook -p 6006",
9-
"build-storybook": "build-storybook"
9+
"build-storybook": "build-storybook",
10+
"typecheck": "npx tsc components/**/*.tsx --noEmit --skipLibCheck --jsx preserve --esModuleInterop"
1011
},
1112
"peerDependencies": {
1213
"@chakra-ui/icons": "1.x",

0 commit comments

Comments
 (0)