sync-ts

1.0.67 • Public • Published

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/.*'

Add tool as a pre-push hook using husky

// package.json
{
  "husky"{
    "hooks"{
      "pre-push""sync-ts",
    }
  }
}

Consume in CI

  1. Add script into npm scripts inside package.json
  2. Submit a PR and wait for build to run in CI
  3. 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"

Readme

Keywords

none

Package Sidebar

Install

npm i sync-ts

Weekly Downloads

3

Version

1.0.67

License

MIT

Unpacked Size

108 kB

Total Files

51

Last publish

Collaborators

  • arielh
  • falconci
  • yurynix
  • itai.benda
  • wix-ci
  • wix-ambassador
  • shahata
  • netanelgilad
  • wix-ci-publisher
  • wix-bi-publisher