-
Notifications
You must be signed in to change notification settings - Fork 376
Typescript support for react-core #884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e5a0521
[Work in Progess - Do Not Merge] Initial work for typescript support …
dlabaj d1dec50
Updated with Babel 7 for react-core
dlabaj d2d13df
Removed tsc for building typescript in favor of babel 7
dlabaj 67c4427
Yarn.lock update
dlabaj c52d1ae
Updated babel to use interface to props plugin
dlabaj e67fe1c
Updated build:typescript to call tsc
dlabaj f3ead7d
Updates for typescript build.
dlabaj 5512fd1
Reverted Button to JavaScript.
dlabaj 6ef59c1
reverted avatar
dlabaj b8f181d
Start of update Avatar to typescript
dlabaj f2aaf86
ts docgen changes
jschuler c575c4f
Avatar updates
dlabaj 7e28b3a
Added ts-jest
dlabaj 50657c4
Typescript updates
dlabaj eabd0dd
Update to fix
dlabaj d25c8fa
Merge
dlabaj bac0d4c
Added missing Avatar tsx snap
dlabaj c248b68
Added back proptypes to make tsc happy when running unit tests
dlabaj df2d16c
Updated to remove package-lock.json and extra @types
dlabaj 08c4068
Update package.json
dlabaj d7d8ab2
Merge branch 'master' into typescript
dlabaj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| node_modules | ||
| dist | ||
| tsc_out | ||
| .out | ||
| /.changelog | ||
| .DS_Store | ||
|
|
||
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,48 @@ | ||
| const babelENV = process.env.BABEL_ENV || 'development'; | ||
| const modules = babelENV !== 'production:esm' ? 'commonjs' : false; | ||
|
|
||
| module.exports = { | ||
| presets: [['@babel/env', { modules }], '@babel/preset-typescript', '@babel/react'], | ||
| ignore: (() => { | ||
| const ignore = ['src/**/__snapshots__']; | ||
| ignore.push('src/**/*.d.ts'); | ||
| if (babelENV.includes('production')) { | ||
| ignore.push('test.js', '__mocks__'); | ||
| } | ||
| return ignore; | ||
| })(), | ||
| env: { | ||
| 'production:esm': { | ||
| plugins: [ | ||
| 'babel-plugin-typescript-to-proptypes', | ||
| '@babel/plugin-proposal-export-default-from', | ||
| '@babel/proposal-class-properties', | ||
| '@babel/proposal-object-rest-spread', | ||
| [ | ||
| '@patternfly/react-styles/babel', | ||
| { | ||
| srcDir: './src', | ||
| outDir: './dist/esm', | ||
| useModules: true | ||
| } | ||
| ] | ||
| ] | ||
| }, | ||
| 'production:cjs': { | ||
| plugins: [ | ||
| 'babel-plugin-typescript-to-proptypes', | ||
| '@babel/plugin-proposal-export-default-from', | ||
| '@babel/proposal-class-properties', | ||
| '@babel/proposal-object-rest-spread', | ||
| [ | ||
| '@patternfly/react-styles/babel', | ||
| { | ||
| srcDir: './src', | ||
| outDir: './dist/js', | ||
| useModules: false | ||
| } | ||
| ] | ||
| ] | ||
| } | ||
| } | ||
| }; |
This file contains hidden or 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
9 changes: 0 additions & 9 deletions
9
packages/patternfly-4/react-core/src/components/Avatar/Avatar.d.ts
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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.
1 change: 0 additions & 1 deletion
1
packages/patternfly-4/react-core/src/components/Avatar/index.d.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 contains hidden or 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,21 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "allowSyntheticDefaultImports": true, | ||
| "esModuleInterop": true, | ||
| "baseUrl": ".", | ||
| "moduleResolution": "node", | ||
| "skipLibCheck": true, | ||
| "sourceMap": true, // allow sourcemap support | ||
| "lib": ["es6", "dom"], | ||
| "noEmit": true, | ||
| "module": "commonjs", // specify module code generation | ||
| "jsx": "react", // use typescript to transpile jsx to js | ||
| "target": "es5", // specify ECMAScript target version | ||
| "allowJs": true, // allow a partial TypeScript and JavaScript codebase | ||
| "paths": { | ||
| "*": ["dist/esm/*"] | ||
| } | ||
| }, | ||
| "include": ["./src/**/*"], | ||
| "exclude": ["./src/**/*.d.ts"] | ||
| } |
This file contains hidden or 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,4 @@ | ||
| declare module '*.css' { | ||
| const styles: any; | ||
| export default styles; | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.