forked from elastic/eui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce TypeScript support into the dev & build systems (elastic#1317)
* initial setup for TS in codebase * Running TypeScript in jest tests * use ts-jest 23.1.4 for json5 babelrc support * include typescript sources and declarations in output to lib * ts defs to proptypes * ts-to-proptype conversion interacting with react-docgen * Convert Array<> types to prop types * Refactor how required/optional types are passed * Array tests, understand object/shape types * Fixed bug in Array type support, added full support for union types * Understands intersections, unknown types resolve to PropTypes.any * Correctly resolving typescript type imports through files * Support typescript conversion to element and node prop types * Clean up some bugs * compile type declarations into types/ directory * iteration * iteration * property merging generated and written defs * updated yarn.lock * don't generate ts defs when linting * Default TS typechecking to not emit files * clean up and fix a lot of TS issues * better TS import resolving * point types at eui.d.ts * get passing tests * fixed ts issues * typescript support via babel * remove ts-jest * progress on the babel plugin * majority of babel ts->proptype plugin functioning * typescript defs to proptype babel plugin passing all test * babel plugin for ts->proptypes is working * small cleanup * small cleanup * fix test runner * update spacer test file to tsx * typescript -> proptypes now understands shorthand array type syntax * clean up ts->proptypes script * convert spacer example doc to tsx * ts build cleanup * don't need to ignore the types dir 3 times * dtsgenerator is not a distributed dependency * validate typescript code during build * small cleanup * support ts enums in proptype generation * PR feedback * Added more comments to the typescript->proptype babel plugin; fixed bug in importing files * Add support for 'keyof typeof [object expression]' * horizontal rule conversion to ts * Update src/components/horizontal_rule/horizontal_rule.tsx Co-Authored-By: snide <[email protected]> * feedback * feedback * Updated yeoman templates for typescript * Update docs code gen to point at @elastic/eui more often * Update yeoman generator for docs * don't require 'public' keyword on public class methods * changelog
- Loading branch information
1 parent
a3e7b4a
commit 5b2eb96
Showing
109 changed files
with
3,353 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
...ator-eui/component/templates/component.js → ...tor-eui/component/templates/component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React, { HTMLAttributes, SFC } from 'react'; | ||
import { CommonProps } from '../common'; | ||
import classNames from 'classnames'; | ||
|
||
export type <%= componentName %>Props = HTMLAttributes<HTMLDivElement> & CommonProps & { | ||
|
||
}; | ||
|
||
export const <%= componentName %>: React.SFC<<%= componentName %>Props> = ({ | ||
children, | ||
className, | ||
...rest | ||
}) => { | ||
const classes = classNames('<%= cssClassName %>', className); | ||
|
||
return ( | ||
<div | ||
className={classes} | ||
{...rest} | ||
> | ||
{children} | ||
</div> | ||
); | ||
}; |
2 changes: 1 addition & 1 deletion
2
generator-eui/component/templates/test.js → generator-eui/component/templates/test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.