-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
228 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "%NAME%", | ||
"version": "0.0.0", | ||
"license": "MIT", | ||
"bin": "dist/cli.js", | ||
"engines": { | ||
"node": ">=10" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"start": "npm run build && dist/cli.js", | ||
"pretest": "npm run build", | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"dist/cli.js" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": {}, | ||
"ava": { | ||
"typescript": { | ||
"extensions": ["tsx"], | ||
"rewritePaths": { | ||
"source/": "dist/" | ||
} | ||
} | ||
}, | ||
"xo": { | ||
"extends": "xo-react", | ||
"rules": { | ||
"react/prop-types": "off" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# %NAME% | ||
|
||
> This readme is automatically generated by [create-ink-app](https://github.com/vadimdemedes/create-ink-app) | ||
|
||
## Install | ||
|
||
```bash | ||
$ npm install --global %NAME% | ||
``` | ||
|
||
|
||
## CLI | ||
|
||
``` | ||
$ %NAME% --help | ||
Usage | ||
$ %NAME% | ||
Options | ||
--name Your name | ||
Examples | ||
$ %NAME% --name=Jane | ||
Hello, Jane | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env node | ||
import React from 'react'; | ||
import {render} from 'ink'; | ||
import meow from 'meow'; | ||
import App from './ui'; | ||
|
||
const cli = meow(` | ||
Usage | ||
$ %NAME% | ||
Options | ||
--name Your name | ||
Examples | ||
$ %NAME% --name=Jane | ||
Hello, Jane | ||
`, { | ||
flags: { | ||
name: { | ||
type: 'string' | ||
} | ||
} | ||
}); | ||
|
||
render(<App name={cli.flags.name}/>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
import chalk from 'chalk'; | ||
import test from 'ava'; | ||
import {render} from 'ink-testing-library'; | ||
import App from './ui'; | ||
|
||
test('greet unknown user', t => { | ||
const {lastFrame} = render(<App/>); | ||
|
||
t.is(lastFrame(), chalk`Hello, {green Stranger}`); | ||
}); | ||
|
||
test('greet user with a name', t => { | ||
const {lastFrame} = render(<App name="Jane"/>); | ||
|
||
t.is(lastFrame(), chalk`Hello, {green Jane}`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React, {FC} from 'react'; | ||
import {Text} from 'ink'; | ||
|
||
const App: FC<{name?: string}> = ({name = 'Stranger'}) => ( | ||
<Text> | ||
Hello, <Text color="green">{name}</Text> | ||
</Text> | ||
); | ||
|
||
module.exports = App; | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "@sindresorhus/tsconfig", | ||
"compilerOptions": { | ||
"jsx": "react", | ||
"esModuleInterop": true, | ||
"outDir": "dist" | ||
}, | ||
"include": ["source"] | ||
} |