sync-ts
A package for syncing prop types with Typescript types
Install
$ npm i -D
Test
$ npm run test
Run
$ npx sync-ts
Optional Flags
--sourceBranch: string - source branch to compare PR with. default: master
--excludePath: string - paths to exclude
--skip: boolean - optional escape hatch. default: false
Usage examples:
$ npx sync-ts $ npx sync-ts --sourceBranch='my-branch' $ npx sync-ts --sourceBranch='my-branch' --excludePath='src/.*/docs/.*' --excludePath='src/.*/examples/.*'
husky
Add tool as a pre-push hook using// package.json
Consume in CI
- Add script into npm scripts inside
package.json
- Submit a PR and wait for build to run in CI
- Review build log - in case where prop types and d.ts files are out of sync - build will break and all discrepancies will be logged inside build log.
Example: "prebuild": "if [ \"$agentType\" = \"pullrequest\" ]; then sync-ts; fi"