File tree 15 files changed +3156
-0
lines changed
15 files changed +3156
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ version : 2
3
+ jobs :
4
+ node-latest : &test
5
+ docker :
6
+ - image : node:latest
7
+ working_directory : ~/cli
8
+ steps :
9
+ - checkout
10
+ - restore_cache : &restore_cache
11
+ keys :
12
+ - v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
13
+ - v1-npm-{{checksum ".circleci/config.yml"}}
14
+ - run :
15
+ name : Install dependencies
16
+ command : yarn
17
+ - run : ./bin/run --version
18
+ - run : ./bin/run --help
19
+ - run :
20
+ name : Testing
21
+ command : yarn test
22
+ node-8 :
23
+ << : *test
24
+ docker :
25
+ - image : node:8
26
+ node-10 :
27
+ << : *test
28
+ docker :
29
+ - image : node:10
30
+ cache :
31
+ << : *test
32
+ steps :
33
+ - checkout
34
+ - run :
35
+ name : Install dependencies
36
+ command : yarn
37
+ - save_cache :
38
+ key : v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
39
+ paths :
40
+ - ~/cli/node_modules
41
+ - /usr/local/share/.cache/yarn
42
+ - /usr/local/share/.config/yarn
43
+
44
+ workflows :
45
+ version : 2
46
+ " gitmoji-c " :
47
+ jobs :
48
+ - node-latest
49
+ - node-8
50
+ - node-10
51
+ - cache :
52
+ filters :
53
+ tags :
54
+ only : /^v.*/
55
+ branches :
56
+ ignore : /.*/
Original file line number Diff line number Diff line change
1
+ root = true
2
+
3
+ [* ]
4
+ indent_style = space
5
+ indent_size = 2
6
+ charset = utf-8
7
+ trim_trailing_whitespace = true
8
+ insert_final_newline = true
9
+
10
+ [* .md ]
11
+ trim_trailing_whitespace = false
Original file line number Diff line number Diff line change
1
+ * -debug.log
2
+ * -error.log
3
+ /.nyc_output
4
+ /dist
5
+ /lib
6
+ /package-lock.json
7
+ /tmp
8
+ node_modules
Original file line number Diff line number Diff line change
1
+ gitmoji-c
2
+ =========
3
+
4
+ gitmoji cli tool.
5
+
6
+ [ ![ oclif] ( https://img.shields.io/badge/cli-oclif-brightgreen.svg )] ( https://oclif.io )
7
+ [ ![ Version] ( https://img.shields.io/npm/v/gitmoji-c.svg )] ( https://npmjs.org/package/gitmoji-c )
8
+ [ ![ CircleCI] ( https://circleci.com/gh/nitaking/gitmoji-c/tree/master.svg?style=shield )] ( https://circleci.com/gh/nitaking/gitmoji-c/tree/master )
9
+ [ ![ Downloads/week] ( https://img.shields.io/npm/dw/gitmoji-c.svg )] ( https://npmjs.org/package/gitmoji-c )
10
+ [ ![ License] ( https://img.shields.io/npm/l/gitmoji-c.svg )] ( https://github.com/nitaking/gitmoji-c/blob/master/package.json )
11
+
12
+ <!-- toc -->
13
+ * [ Usage] ( #usage )
14
+ * [ Commands] ( #commands )
15
+ <!-- tocstop -->
16
+ # Usage
17
+ <!-- usage -->
18
+ ``` sh-session
19
+ $ npm install -g gitmoji-c
20
+ $ gitmoji COMMAND
21
+ running command...
22
+ $ gitmoji (-v| --version| version)
23
+ gitmoji-c/0.0.0 darwin-x64 node-v10.16.0
24
+ $ gitmoji --help [COMMAND]
25
+ USAGE
26
+ $ gitmoji COMMAND
27
+ ...
28
+ ```
29
+ <!-- usagestop -->
30
+ # Commands
31
+ <!-- commands -->
32
+ * [ ` gitmoji hello [FILE] ` ] ( #gitmoji-hello-file )
33
+ * [ ` gitmoji help [COMMAND] ` ] ( #gitmoji-help-command )
34
+
35
+ ## ` gitmoji hello [FILE] `
36
+
37
+ describe the command here
38
+
39
+ ```
40
+ USAGE
41
+ $ gitmoji hello [FILE]
42
+
43
+ OPTIONS
44
+ -f, --force
45
+ -h, --help show CLI help
46
+ -n, --name=name name to print
47
+
48
+ EXAMPLE
49
+ $ gitmoji hello
50
+ hello world from ./src/hello.ts!
51
+ ```
52
+
53
+ _ See code: [ src/commands/hello.ts] ( https://github.com/nitaking/gitmoji-c/blob/v0.0.0/src/commands/hello.ts ) _
54
+
55
+ ## ` gitmoji help [COMMAND] `
56
+
57
+ display help for gitmoji
58
+
59
+ ```
60
+ USAGE
61
+ $ gitmoji help [COMMAND]
62
+
63
+ ARGUMENTS
64
+ COMMAND command to show help for
65
+
66
+ OPTIONS
67
+ --all see all commands in CLI
68
+ ```
69
+
70
+ _ See code: [ @oclif/plugin-help ] ( https://github.com/oclif/plugin-help/blob/v2.2.0/src/commands/help.ts ) _
71
+ <!-- commandsstop -->
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+
3
+ require ( '@oclif/command' ) . run ( )
4
+ . then ( require ( '@oclif/command/flush' ) )
5
+ . catch ( require ( '@oclif/errors/handle' ) )
Original file line number Diff line number Diff line change
1
+ @ echo off
2
+
3
+ node " %~dp0 \run" %*
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " gitmoji-c" ,
3
+ "description" : " gitmoji cli tool." ,
4
+ "version" : " 0.0.0" ,
5
+ "author" : " nitaking @nitaking" ,
6
+ "bin" : {
7
+ "gitmoji" : " ./bin/run"
8
+ },
9
+ "bugs" : " https://github.com/nitaking/gitmoji-c/issues" ,
10
+ "dependencies" : {
11
+ "@oclif/command" : " ^1" ,
12
+ "@oclif/config" : " ^1" ,
13
+ "@oclif/plugin-help" : " ^2" ,
14
+ "tslib" : " ^1"
15
+ },
16
+ "devDependencies" : {
17
+ "@oclif/dev-cli" : " ^1" ,
18
+ "@oclif/test" : " ^1" ,
19
+ "@oclif/tslint" : " ^3" ,
20
+ "@types/chai" : " ^4" ,
21
+ "@types/mocha" : " ^5" ,
22
+ "@types/node" : " ^10" ,
23
+ "chai" : " ^4" ,
24
+ "globby" : " ^8" ,
25
+ "mocha" : " ^5" ,
26
+ "nyc" : " ^13" ,
27
+ "ts-node" : " ^8" ,
28
+ "tslint" : " ^5" ,
29
+ "typescript" : " ^3.3"
30
+ },
31
+ "engines" : {
32
+ "node" : " >=8.0.0"
33
+ },
34
+ "files" : [
35
+ " /bin" ,
36
+ " /lib" ,
37
+ " /npm-shrinkwrap.json" ,
38
+ " /oclif.manifest.json"
39
+ ],
40
+ "homepage" : " https://github.com/nitaking/gitmoji-c" ,
41
+ "keywords" : [
42
+ " oclif"
43
+ ],
44
+ "license" : " MIT" ,
45
+ "main" : " lib/index.js" ,
46
+ "oclif" : {
47
+ "commands" : " ./lib/commands" ,
48
+ "bin" : " gitmoji" ,
49
+ "plugins" : [
50
+ " @oclif/plugin-help"
51
+ ]
52
+ },
53
+ "repository" : " nitaking/gitmoji-c" ,
54
+ "scripts" : {
55
+ "postpack" : " rm -f oclif.manifest.json" ,
56
+ "posttest" : " tslint -p test -t stylish" ,
57
+ "prepack" : " rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme" ,
58
+ "test" : " nyc --extension .ts mocha --forbid-only \" test/**/*.test.ts\" " ,
59
+ "version" : " oclif-dev readme && git add README.md"
60
+ },
61
+ "types" : " lib/index.d.ts"
62
+ }
Original file line number Diff line number Diff line change
1
+ import { Command , flags } from '@oclif/command'
2
+
3
+ export default class Hello extends Command {
4
+ static description = 'describe the command here'
5
+
6
+ static examples = [
7
+ `$ gitmoji hello
8
+ hello world from ./src/hello.ts!
9
+ ` ,
10
+ ]
11
+
12
+ static flags = {
13
+ help : flags . help ( { char : 'h' } ) ,
14
+ // flag with a value (-n, --name=VALUE)
15
+ name : flags . string ( { char : 'n' , description : 'name to print' } ) ,
16
+ // flag with no value (-f, --force)
17
+ force : flags . boolean ( { char : 'f' } ) ,
18
+ }
19
+
20
+ static args = [ { name : 'file' } ]
21
+
22
+ async run ( ) {
23
+ const { args, flags} = this . parse ( Hello )
24
+
25
+ const name = flags . name || 'world'
26
+ this . log ( `hello ${ name } from ./src/commands/hello.ts` )
27
+ if ( args . file && flags . force ) {
28
+ this . log ( `you input --force and --file: ${ args . file } ` )
29
+ }
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ export { run } from '@oclif/command'
Original file line number Diff line number Diff line change
1
+ import { expect , test } from '@oclif/test'
2
+
3
+ describe ( 'hello' , ( ) => {
4
+ test
5
+ . stdout ( )
6
+ . command ( [ 'hello' ] )
7
+ . it ( 'runs hello' , ctx => {
8
+ expect ( ctx . stdout ) . to . contain ( 'hello world' )
9
+ } )
10
+
11
+ test
12
+ . stdout ( )
13
+ . command ( [ 'hello' , '--name' , 'jeff' ] )
14
+ . it ( 'runs hello --name jeff' , ctx => {
15
+ expect ( ctx . stdout ) . to . contain ( 'hello jeff' )
16
+ } )
17
+ } )
Original file line number Diff line number Diff line change
1
+ --require ts-node/register
2
+ --watch-extensions ts
3
+ --recursive
4
+ --reporter spec
5
+ --timeout 5000
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ../tsconfig" ,
3
+ "compilerOptions" : {
4
+ "noEmit" : true
5
+ },
6
+ "references" : [
7
+ {"path" : " .." }
8
+ ]
9
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "declaration" : true ,
4
+ "importHelpers" : true ,
5
+ "module" : " commonjs" ,
6
+ "outDir" : " lib" ,
7
+ "rootDir" : " src" ,
8
+ "strict" : true ,
9
+ "target" : " es2017" ,
10
+ "composite" : true
11
+ },
12
+ "include" : [
13
+ " src/**/*"
14
+ ]
15
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " @oclif/tslint"
3
+ }
You can’t perform that action at this time.
0 commit comments