Skip to content

Commit

Permalink
implement typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
anselmpaul committed Dec 8, 2020
1 parent 7b26345 commit adf33cd
Show file tree
Hide file tree
Showing 17 changed files with 13,995 additions and 5,716 deletions.
8 changes: 5 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
"@babel/preset-react",
"@babel/typescript"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
"@babel/plugin-proposal-class-properties",
"emotion"
]
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ lib
umd
npm-debug.log
dist
.idea
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src
.idea
1 change: 1 addition & 0 deletions .storybook/presets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = ['@storybook/preset-typescript'];
4 changes: 2 additions & 2 deletions .storybook/stories/LoadingOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import styled from 'styled-components'
import LoadingOverlay from '../../src/LoadingOverlay.js'
import LoadingOverlay from '../../src/LoadingOverlay.tsx'

const wrapped = (
<div style={{padding: '20px', background: '#FFF'}}>
Expand Down Expand Up @@ -147,4 +147,4 @@ storiesOf('LoadingOverlay', module)
{wrapped}
</StyledLoader>
)
})
})
7 changes: 7 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require('path');
// your app's webpack.config.js
const custom = require('../webpack.config.js');

module.exports = async ({ config, mode }) => {
return { ...config, module: { ...config.module, rules: custom.module.rules } };
};
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [v0.3.0] - 2020-01-04

- implemented typescript

## [v0.2.2] - 2016-11-13

### Reverted breaking changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ jest.useFakeTimers()

afterEach(cleanup)

class DelayedInactive extends Component {
constructor (props) {
class DelayedInactive extends Component<any, {active: boolean}> {
timer: any;

constructor (props: any) {
super(props)
this.state = { active: true }
}
Expand Down
10 changes: 10 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

module.exports = {
'testMatch': [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/?(*.)+(spec|test).+(ts|tsx|js)'
],
'transform': {
'^.+\\.(ts|tsx)$': 'ts-jest'
}
}
Loading

0 comments on commit adf33cd

Please sign in to comment.