Skip to content

Commit 4e22829

Browse files
committed
Initial commit
0 parents  commit 4e22829

18 files changed

+6583
-0
lines changed

.envrc.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export CONVENTIONAL_GITHUB_RELEASER_TOKEN=xxxxxxx

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docs/
2+
examples/

.eslintrc.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
extends:
2+
- standard
3+
- plugin:@typescript-eslint/recommended
4+
plugins:
5+
- "@typescript-eslint"
6+
7+
parser: "@typescript-eslint/parser"
8+
env:
9+
es6: true
10+
node: true
11+
parserOptions:
12+
sourceType: 'module'
13+
ecmaFeatures:
14+
ts: true
15+
globals:
16+
describe: false
17+
it: false
18+
beforeEach: false
19+
afterEach: false
20+
beforeAll: false
21+
afterAll: false
22+
jasmine: false
23+
expect: false
24+
rules:
25+
"@typescript-eslint/explicit-function-return-type": off

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
.DS_Store
3+
.envrc
4+
coverage/
5+
.idea/
6+
dist/
7+
examples/
8+
.rpt2_cache/

.huskyrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const tasks = arr => arr.join(' && ')
2+
module.exports = {
3+
'hooks': {
4+
'pre-commit': tasks([
5+
"lint-staged",
6+
]),
7+
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
8+
}
9+
}

.npmignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
tests/
2+
docs/
3+
.eslint*
4+
.gitignore
5+
.travis.yml
6+
node_modules/
7+
.DS_Store
8+
.envrc
9+
coverage/
10+
__tests__/
11+
libs/
12+
.idea/
13+
examples/
14+
.rpt2_cache/
15+
.huskyrc*
16+
commitlint.config.js
17+
.envrc*
18+
ogp_*.png

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: node_js
2+
nodejs:
3+
- 8
4+
- 10
5+
script:
6+
- npx @commitlint/travis-clid
7+
- yarn run lint
8+
- yarn run test -- --ci
9+
- yarn run build

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Hidetaka Okamoto
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# TypeScript Package template
2+
3+
GitHub Template repository to create a npm package by using TypeScript.
4+
5+
## Badges
6+
7+
[![NPM](https://nodei.co/npm/MY_REPO_NAME.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/MY_REPO_NAME/)
8+
[![npm version](https://badge.fury.io/js/MY_REPO_NAME.svg)](https://badge.fury.io/js/MY_REPO_NAME)
9+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10+
[![Maintainability](https://api.codeclimate.com/v1/badges/c17851759423ce151b9e/maintainability)](https://codeclimate.com/github/hideokamoto/MY_REPO_NAME/maintainability)
11+
[![Test Coverage](https://api.codeclimate.com/v1/badges/c17851759423ce151b9e/test_coverage)](https://codeclimate.com/github/hideokamoto/MY_REPO_NAME/test_coverage)
12+
[![Build Status](https://travis-ci.org/hideokamoto/MY_REPO_NAME.svg?branch=master)](https://travis-ci.org/hideokamoto/MY_REPO_NAME)
13+
14+
15+
## OGP
16+
17+
```bash
18+
// both
19+
$ yarn run create:ogp
20+
21+
// dark
22+
$ yarn run create:ogp:dark
23+
24+
// light
25+
$ yarn run create:ogp:light
26+
```
27+
![image](./ogp_dark.png)
28+
![image](./ogp_light.png)
29+
30+
## Prepare
31+
32+
```
33+
$ git clone YOUR_REPO_URI
34+
$ cd YOUR_REPO_URI
35+
36+
// Put your GitHub Personal Access Token
37+
$ mv .envrc.example .envrc
38+
$ vim .envrc
39+
export CONVENTIONAL_GITHUB_RELEASER_TOKEN=PUT_YOUR_GITHUB_ACCESS_TOKEN
40+
41+
// Install
42+
$ yarn
43+
or
44+
$ npm install
45+
```
46+
47+
### GitHub Personal Access Token Scope
48+
49+
If the project is private -> `repo`
50+
If the project is public -> `public_repo`
51+
52+
## Commit message rule
53+
54+
The repository runs commitlint.
55+
We have to follow "Conventional Commit" to make a commit message.
56+
57+
https://www.conventionalcommits.org/en/v1.0.0-beta.4/
58+
59+
```bash
60+
$ git commit -m "<type>[optional scope]: <description>
61+
62+
[optional body]
63+
64+
[optional footer]"
65+
```
66+
67+
## Contribution
68+
69+
```bash
70+
// clone
71+
$ git clone [email protected]:hideokamoto/MY_REPO_NAME.git
72+
$ cd MY_REPO_NAME
73+
74+
// setup
75+
$ yarn
76+
77+
// Unit test
78+
$ yarn test
79+
or
80+
$ yarn run test:watch
81+
82+
// Lint
83+
$ yarn run lint
84+
or
85+
$ yarn run lint --fix
86+
87+
// Build
88+
$ yarn run build
89+
90+
// Rebuild docs
91+
$ yarn run doc
92+
```

__tests__/index.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
import func from '../libs/index'
3+
4+
describe('dummy', () => {
5+
it('test', () => {
6+
expect(func('John')).toEqual('Hello John !')
7+
})
8+
})

0 commit comments

Comments
 (0)