Merge pull request #129 from danielsogl/refactor/typescript
refactor(typescript): update react deps
This commit is contained in:
parent
74929343a0
commit
97b2df677d
5 changed files with 21 additions and 14 deletions
|
@ -1,8 +1,15 @@
|
||||||
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# IDE Stuff
|
||||||
|
/.idea
|
||||||
|
/.vscode
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
node_modules
|
node_modules
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
# builds
|
# builds
|
||||||
build
|
build
|
||||||
dist
|
dist
|
||||||
|
|
|
@ -13,11 +13,11 @@ npm install --save {{name}}
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
import * as React from 'react'
|
import React, { Component } from 'react'
|
||||||
|
|
||||||
import MyComponent from '{{name}}'
|
import MyComponent from '{{name}}'
|
||||||
|
|
||||||
class Example extends React.Component {
|
class Example extends Component {
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<MyComponent />
|
<MyComponent />
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
"npm": ">=5"
|
"npm": ">=5"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "cross-env CI=1 react-scripts-ts test --env=jsdom",
|
"test": "cross-env CI=1 react-scripts test --env=jsdom",
|
||||||
"test:watch": "react-scripts-ts test --env=jsdom",
|
"test:watch": "react-scripts test --env=jsdom",
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
"start": "rollup -c -w",
|
"start": "rollup -c -w",
|
||||||
"prepare": "{{manager}} run build",
|
"prepare": "{{manager}} run build",
|
||||||
|
@ -23,7 +23,6 @@
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"prop-types": "^15.5.4",
|
|
||||||
"react": "^15.0.0 || ^16.0.0",
|
"react": "^15.0.0 || ^16.0.0",
|
||||||
"react-dom": "^15.0.0 || ^16.0.0"
|
"react-dom": "^15.0.0 || ^16.0.0"
|
||||||
},
|
},
|
||||||
|
@ -32,13 +31,13 @@
|
||||||
"@babel/runtime": "^7.0.0",
|
"@babel/runtime": "^7.0.0",
|
||||||
"@svgr/rollup": "^2.4.1",
|
"@svgr/rollup": "^2.4.1",
|
||||||
"@types/jest": "^23.1.5",
|
"@types/jest": "^23.1.5",
|
||||||
"@types/react": "^16.3.13",
|
"@types/react": "^16.8.0",
|
||||||
"@types/react-dom": "^16.0.5",
|
"@types/react-dom": "^16.8.0",
|
||||||
"cross-env": "^5.1.4",
|
"cross-env": "^5.1.4",
|
||||||
"gh-pages": "^1.2.0",
|
"gh-pages": "^1.2.0",
|
||||||
"react": "^16.4.1",
|
"react": "^16.8.0",
|
||||||
"react-dom": "^16.4.1",
|
"react-dom": "^16.8.0",
|
||||||
"react-scripts-ts": "^2.16.0",
|
"react-scripts": "^2.1.0",
|
||||||
"rollup": "^0.62.0",
|
"rollup": "^0.62.0",
|
||||||
"rollup-plugin-babel": "^4.0.1",
|
"rollup-plugin-babel": "^4.0.1",
|
||||||
"rollup-plugin-commonjs": "^9.1.3",
|
"rollup-plugin-commonjs": "^9.1.3",
|
||||||
|
@ -47,7 +46,7 @@
|
||||||
"rollup-plugin-postcss": "^1.6.2",
|
"rollup-plugin-postcss": "^1.6.2",
|
||||||
"rollup-plugin-typescript2": "^0.17.0",
|
"rollup-plugin-typescript2": "^0.17.0",
|
||||||
"rollup-plugin-url": "^1.4.0",
|
"rollup-plugin-url": "^1.4.0",
|
||||||
"typescript": "^2.8.3"
|
"typescript": "^3.3.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
* @class ExampleComponent
|
* @class ExampleComponent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as React from 'react'
|
import React, { Component } from 'react'
|
||||||
|
|
||||||
import styles from './styles.css'
|
import styles from './styles.css'
|
||||||
|
|
||||||
export type Props = { text: string }
|
export type Props = { text: string }
|
||||||
|
|
||||||
export default class ExampleComponent extends React.Component<Props> {
|
export default class ExampleComponent extends Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
text
|
text
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true
|
"noUnusedParameters": true,
|
||||||
|
"allowSyntheticDefaultImports": true
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"exclude": ["node_modules", "build", "dist", "example", "rollup.config.js"]
|
"exclude": ["node_modules", "build", "dist", "example", "rollup.config.js"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue