Skip to content

Commit 6b8a189

Browse files
committed
feat: initial commit
0 parents  commit 6b8a189

25 files changed

+12809
-0
lines changed

.commitlintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "extends": ["@commitlint/config-conventional"] }

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lib/**
2+
generated/**
3+
coverage/**

.eslintrc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"extends": [
3+
"airbnb-base",
4+
"plugin:@typescript-eslint/eslint-recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
7+
"plugin:prettier/recommended",
8+
"prettier/@typescript-eslint"
9+
],
10+
"parser": "@typescript-eslint/parser",
11+
"parserOptions": {
12+
"project": "./tsconfig.test.json"
13+
},
14+
"rules": {
15+
"import/extensions": [
16+
"error",
17+
"ignorePackages",
18+
{
19+
"js": "never",
20+
"ts": "never"
21+
}
22+
],
23+
"@typescript-eslint/camelcase": "off"
24+
},
25+
"settings": {
26+
"import/resolver": {
27+
"node": {
28+
"extensions": [".js", ".ts"]
29+
}
30+
}
31+
}
32+
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Continuous Integration
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
style:
7+
name: Style
8+
runs-on: ubuntu-18.04
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v1
12+
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: 12
17+
18+
- name: Get yarn cache
19+
id: yarn-cache
20+
run: echo "::set-output name=dir::$(yarn cache dir)"
21+
22+
- uses: actions/cache@v1
23+
with:
24+
path: ${{ steps.yarn-cache.outputs.dir }}
25+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-yarn-
28+
29+
- name: Install dependencies
30+
run: yarn install
31+
32+
- name: Build
33+
run: yarn build
34+
35+
- name: Lint commit messages
36+
run: yarn commitlint
37+
38+
- name: Lint files with eslint
39+
run: yarn lint
40+
41+
- name: Check formatting with prettier
42+
run: yarn prettier
43+
44+
test:
45+
name: Test
46+
runs-on: ubuntu-18.04
47+
strategy:
48+
matrix:
49+
node: [10, 12]
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v1
53+
54+
- name: Setup Node.js
55+
uses: actions/setup-node@v1
56+
with:
57+
node-version: ${{matrix.node}}
58+
59+
- name: Get yarn cache
60+
id: yarn-cache
61+
run: echo "::set-output name=dir::$(yarn cache dir)"
62+
63+
- uses: actions/cache@v1
64+
with:
65+
path: ${{ steps.yarn-cache.outputs.dir }}
66+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
67+
restore-keys: |
68+
${{ runner.os }}-yarn-
69+
70+
- name: Install dependencies
71+
run: yarn install
72+
73+
- name: Build
74+
run: yarn build
75+
76+
- name: Run tests
77+
run: yarn test
78+
79+
- name: Publish code coverage
80+
uses: paambaati/[email protected]
81+
env:
82+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
83+
84+
release:
85+
name: Release
86+
runs-on: ubuntu-18.04
87+
# Only release on master
88+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta'
89+
needs: [style, test]
90+
steps:
91+
- name: Checkout
92+
uses: actions/checkout@v1
93+
94+
- name: Setup Node.js
95+
uses: actions/setup-node@v1
96+
with:
97+
node-version: 12
98+
99+
- name: Get yarn cache
100+
id: yarn-cache
101+
run: echo "::set-output name=dir::$(yarn cache dir)"
102+
103+
- uses: actions/cache@v1
104+
with:
105+
path: ${{ steps.yarn-cache.outputs.dir }}
106+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
107+
restore-keys: |
108+
${{ runner.os }}-yarn-
109+
110+
- name: Install dependencies
111+
run: yarn install
112+
113+
- name: Build
114+
run: yarn build
115+
116+
- name: Release
117+
env:
118+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119+
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121+
NPM_CONFIG_REGISTRY: https://npm.pkg.github.com/
122+
GIT_AUTHOR_NAME: '@github-actions'
123+
GIT_AUTHOR_EMAIL: '[email protected]'
124+
GIT_COMMITTER_NAME: '@github-actions'
125+
GIT_COMMITTER_EMAIL: '[email protected]'
126+
run: yarn release

.gitignore

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
2+
# Created by https://www.gitignore.io/api/node,macos,visualstudiocode
3+
# Edit at https://www.gitignore.io/?templates=node,macos,visualstudiocode
4+
5+
### macOS ###
6+
# General
7+
.DS_Store
8+
.AppleDouble
9+
.LSOverride
10+
11+
# Icon must end with two \r
12+
Icon
13+
14+
# Thumbnails
15+
._*
16+
17+
# Files that might appear in the root of a volume
18+
.DocumentRevisions-V100
19+
.fseventsd
20+
.Spotlight-V100
21+
.TemporaryItems
22+
.Trashes
23+
.VolumeIcon.icns
24+
.com.apple.timemachine.donotpresent
25+
26+
# Directories potentially created on remote AFP share
27+
.AppleDB
28+
.AppleDesktop
29+
Network Trash Folder
30+
Temporary Items
31+
.apdisk
32+
33+
### Node ###
34+
# Logs
35+
logs
36+
*.log
37+
npm-debug.log*
38+
yarn-debug.log*
39+
yarn-error.log*
40+
lerna-debug.log*
41+
42+
# Diagnostic reports (https://nodejs.org/api/report.html)
43+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
44+
45+
# Runtime data
46+
pids
47+
*.pid
48+
*.seed
49+
*.pid.lock
50+
51+
# Directory for instrumented libs generated by jscoverage/JSCover
52+
lib-cov
53+
54+
# Coverage directory used by tools like istanbul
55+
coverage
56+
*.lcov
57+
58+
# nyc test coverage
59+
.nyc_output
60+
61+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
62+
.grunt
63+
64+
# Bower dependency directory (https://bower.io/)
65+
bower_components
66+
67+
# node-waf configuration
68+
.lock-wscript
69+
70+
# Compiled binary addons (https://nodejs.org/api/addons.html)
71+
build/Release
72+
73+
# Dependency directories
74+
node_modules/
75+
jspm_packages/
76+
77+
# TypeScript v1 declaration files
78+
typings/
79+
80+
# TypeScript cache
81+
*.tsbuildinfo
82+
83+
# Optional npm cache directory
84+
.npm
85+
86+
# Optional eslint cache
87+
.eslintcache
88+
89+
# Optional REPL history
90+
.node_repl_history
91+
92+
# Output of 'npm pack'
93+
*.tgz
94+
95+
# Yarn Integrity file
96+
.yarn-integrity
97+
98+
# dotenv environment variables file
99+
.env
100+
.env.test
101+
102+
# parcel-bundler cache (https://parceljs.org/)
103+
.cache
104+
105+
# next.js build output
106+
.next
107+
108+
# nuxt.js build output
109+
.nuxt
110+
111+
# react / gatsby
112+
public/
113+
114+
# vuepress build output
115+
.vuepress/dist
116+
117+
# Serverless directories
118+
.serverless/
119+
120+
# FuseBox cache
121+
.fusebox/
122+
123+
# DynamoDB Local files
124+
.dynamodb/
125+
126+
### VisualStudioCode ###
127+
.vscode/*
128+
!.vscode/settings.json
129+
!.vscode/tasks.json
130+
!.vscode/launch.json
131+
!.vscode/extensions.json
132+
133+
### VisualStudioCode Patch ###
134+
# Ignore all local history of files
135+
.history
136+
137+
# End of https://www.gitignore.io/api/node,macos,visualstudiocode
138+
139+
.stryker-tmp/
140+
reports/
141+
generated/
142+
lib/

.huskyrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "yarn types && lint-staged",
4+
"prepare-commit-msg": "if [[ -z $HUSKY_BYPASS ]]; then exec < /dev/tty && git cz --hook; fi",
5+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
6+
}
7+
}

.lintstagedrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"*.{js,ts}": [
3+
"eslint --fix",
4+
"git add"
5+
],
6+
"*.{md,scss,css,json,yml,yaml}": [
7+
"prettier --write",
8+
"git add"
9+
]
10+
}

.mocharc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"spec": "tests/**/*.spec.ts",
3+
"extension": ["js", "ts"],
4+
"require": [
5+
"ts-node/register",
6+
"source-map-support/register",
7+
"tests/setup.ts"
8+
],
9+
"recursive": true,
10+
"exit": true
11+
}

.nycrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "@istanbuljs/nyc-config-typescript",
3+
"extension": [
4+
".ts",
5+
".js"
6+
],
7+
"reporter": ["text", "lcovonly", "html"],
8+
"include": "src/**",
9+
"checkCoverage": true,
10+
"lines": 100,
11+
"statements": 100,
12+
"functions": 100,
13+
"branches": 100
14+
}

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.nyc_output
2+
coverage
3+
generated
4+
lib
5+
node_modules

0 commit comments

Comments
 (0)