Skip to content

Commit 6be5e27

Browse files
Merge pull request transitive-bullshit#129 from danielsogl/refactor/typescript
refactor(typescript): update react deps
2 parents c151962 + 04c3e11 commit 6be5e27

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed

template/typescript/.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
# See https://help.github.com/ignore-files/ for more about ignoring files.
22

3+
# IDE Stuff
4+
/.idea
5+
/.vscode
6+
37
# dependencies
48
node_modules
59

10+
# testing
11+
/coverage
12+
613
# builds
714
build
815
dist

template/typescript/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ npm install --save {{name}}
1313
## Usage
1414

1515
```tsx
16-
import * as React from 'react'
16+
import React, { Component } from 'react'
1717

1818
import MyComponent from '{{name}}'
1919

20-
class Example extends React.Component {
20+
class Example extends Component {
2121
render () {
2222
return (
2323
<MyComponent />

template/typescript/package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"npm": ">=5"
1414
},
1515
"scripts": {
16-
"test": "cross-env CI=1 react-scripts-ts test --env=jsdom",
17-
"test:watch": "react-scripts-ts test --env=jsdom",
16+
"test": "cross-env CI=1 react-scripts test --env=jsdom",
17+
"test:watch": "react-scripts test --env=jsdom",
1818
"build": "rollup -c",
1919
"start": "rollup -c -w",
2020
"prepare": "{{manager}} run build",
@@ -23,7 +23,6 @@
2323
},
2424
"dependencies": {},
2525
"peerDependencies": {
26-
"prop-types": "^15.5.4",
2726
"react": "^15.0.0 || ^16.0.0",
2827
"react-dom": "^15.0.0 || ^16.0.0"
2928
},
@@ -32,13 +31,13 @@
3231
"@babel/runtime": "^7.0.0",
3332
"@svgr/rollup": "^2.4.1",
3433
"@types/jest": "^23.1.5",
35-
"@types/react": "^16.3.13",
36-
"@types/react-dom": "^16.0.5",
34+
"@types/react": "^16.8.0",
35+
"@types/react-dom": "^16.8.0",
3736
"cross-env": "^5.1.4",
3837
"gh-pages": "^1.2.0",
39-
"react": "^16.4.1",
40-
"react-dom": "^16.4.1",
41-
"react-scripts-ts": "^2.16.0",
38+
"react": "^16.8.0",
39+
"react-dom": "^16.8.0",
40+
"react-scripts": "^2.1.0",
4241
"rollup": "^0.62.0",
4342
"rollup-plugin-babel": "^4.0.1",
4443
"rollup-plugin-commonjs": "^9.1.3",
@@ -47,7 +46,7 @@
4746
"rollup-plugin-postcss": "^1.6.2",
4847
"rollup-plugin-typescript2": "^0.17.0",
4948
"rollup-plugin-url": "^1.4.0",
50-
"typescript": "^2.8.3"
49+
"typescript": "^3.3.0"
5150
},
5251
"files": [
5352
"dist"

template/typescript/src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* @class ExampleComponent
33
*/
44

5-
import * as React from 'react'
5+
import React, { Component } from 'react'
66

77
import styles from './styles.css'
88

99
export type Props = { text: string }
1010

11-
export default class ExampleComponent extends React.Component<Props> {
11+
export default class ExampleComponent extends Component<Props> {
1212
render() {
1313
const {
1414
text

template/typescript/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"strictNullChecks": true,
1717
"suppressImplicitAnyIndexErrors": true,
1818
"noUnusedLocals": true,
19-
"noUnusedParameters": true
19+
"noUnusedParameters": true,
20+
"allowSyntheticDefaultImports": true
2021
},
2122
"include": ["src"],
2223
"exclude": ["node_modules", "build", "dist", "example", "rollup.config.js"]

0 commit comments

Comments
 (0)