diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/index.js b/index.js index 837ebf3..6919fe8 100644 --- a/index.js +++ b/index.js @@ -58,7 +58,6 @@ module.exports = () => { 'meow', 'ink', 'react', - 'prop-types', 'import-jsx' ]); @@ -67,8 +66,10 @@ module.exports = () => { '--save-dev', 'xo', 'ava', + '@ava/babel', 'ink-testing-library', 'chalk', + '@babel/preset-env', '@babel/preset-react', '@babel/register', 'eslint-config-xo-react', diff --git a/template/_package.json b/template/_package.json index 3bfbab1..56973cf 100644 --- a/template/_package.json +++ b/template/_package.json @@ -4,7 +4,7 @@ "license": "MIT", "bin": "cli.js", "engines": { - "node": ">=8" + "node": ">=10" }, "scripts": { "test": "xo && ava" @@ -16,16 +16,21 @@ "dependencies": {}, "devDependencies": {}, "ava": { + "babel": true, "require": [ "@babel/register" ] }, "babel": { "presets": [ + "@babel/preset-env", "@babel/preset-react" ] }, "xo": { - "extends": "xo-react" + "extends": "xo-react", + "rules": { + "react/prop-types": "off" + } } } diff --git a/template/ui.js b/template/ui.js index 1016aef..779c5be 100644 --- a/template/ui.js +++ b/template/ui.js @@ -1,20 +1,11 @@ 'use strict'; const React = require('react'); -const PropTypes = require('prop-types'); -const {Text, Color} = require('ink'); +const {Text} = require('ink'); -const App = ({name}) => ( +const App = ({name = 'Stranger'}) => ( - Hello, {name} + Hello, {name} ); -App.propTypes = { - name: PropTypes.string -}; - -App.defaultProps = { - name: 'Stranger' -}; - module.exports = App;