buildo / react-components

Collection of general React components used in buildo projects.
http://react-components.buildo.io/
MIT License
157 stars 21 forks source link

[Typo] convert the whole codebase to TypeScript #1034

Closed veej closed 7 years ago

veej commented 7 years ago

requirements

  1. Every file in src should be refactored in TS
  2. the declarations .d.ts should be automatically generated from the relative .tsx? file
  3. keep the @props and the export const Props to maintain compatibility for projects that are not in TS

specs

  1. pick a component in JS and open a sub-issue called [Typo] TheComponentYouPicked
  2. copy-paste the types from the .d.ts to the new .tsx? file a. don't copy the tcomb type export as it's now inferred from TS (export const Props: { [key: string]: Type<any> };) b. improve typings if you think they're not perfect but keep the same structure to avoid breaking changes (namespace, ..etc) b. remove @skinnable
  3. delete the .d.ts files
  4. if there are tests a. rename them in .tsx b. if they test getLocals fix them using enzyme as done here: https://github.com/buildo/react-components/pull/1047/files
  5. before asking for a review please: a. run npm test b. run npm start and check that you component's examples still work with no error in console

NOTE: If you have to add a @types/x dependency please add it without the ^ as @types doesn't follow semver

misc

{optional: other useful info}

sub-issues