Skip to content

Commit d6d513c

Browse files
committed
🎉 initial commit
0 parents  commit d6d513c

15 files changed

+3156
-0
lines changed

Diff for: .circleci/config.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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: /.*/

Diff for: .editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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

Diff for: .gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*-debug.log
2+
*-error.log
3+
/.nyc_output
4+
/dist
5+
/lib
6+
/package-lock.json
7+
/tmp
8+
node_modules

Diff for: README.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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 -->

Diff for: bin/run

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
require('@oclif/command').run()
4+
.then(require('@oclif/command/flush'))
5+
.catch(require('@oclif/errors/handle'))

Diff for: bin/run.cmd

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
3+
node "%~dp0\run" %*

Diff for: package.json

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
}

Diff for: src/commands/hello.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
}

Diff for: src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {run} from '@oclif/command'

Diff for: test/commands/hello.test.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
})

Diff for: test/mocha.opts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--require ts-node/register
2+
--watch-extensions ts
3+
--recursive
4+
--reporter spec
5+
--timeout 5000

Diff for: test/tsconfig.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../tsconfig",
3+
"compilerOptions": {
4+
"noEmit": true
5+
},
6+
"references": [
7+
{"path": ".."}
8+
]
9+
}

Diff for: tsconfig.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
}

Diff for: tslint.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@oclif/tslint"
3+
}

0 commit comments

Comments
 (0)