Skip to content

Commit

Permalink
Update to support Ink 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Demedes committed Jul 27, 2020
1 parent 998414a commit 9238b17
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ module.exports = () => {
'meow',
'ink',
'react',
'prop-types',
'import-jsx'
]);

Expand All @@ -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',
Expand Down
9 changes: 7 additions & 2 deletions template/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"bin": "cli.js",
"engines": {
"node": ">=8"
"node": ">=10"
},
"scripts": {
"test": "xo && ava"
Expand All @@ -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"
}
}
}
15 changes: 3 additions & 12 deletions template/ui.js
Original file line number Diff line number Diff line change
@@ -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'}) => (
<Text>
Hello, <Color green>{name}</Color>
Hello, <Text color="green">{name}</Text>
</Text>
);

App.propTypes = {
name: PropTypes.string
};

App.defaultProps = {
name: 'Stranger'
};

module.exports = App;

0 comments on commit 9238b17

Please sign in to comment.