Skip to content

Commit b83aa97

Browse files
committed
Port over original version
0 parents  commit b83aa97

21 files changed

Lines changed: 5636 additions & 0 deletions

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/**/*
2+
coverage/**/*
3+
dist/**/*
4+
.github/**/*

.eslintrc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaVersion": 2020,
5+
"sourceType": "module"
6+
},
7+
"extends": [
8+
"plugin:@typescript-eslint/recommended",
9+
"prettier/@typescript-eslint",
10+
"plugin:prettier/recommended"
11+
],
12+
"rules": {
13+
"strict": 2
14+
}
15+
}

.github/workflows/npm-publish.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Package Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out Git repository
12+
uses: actions/checkout@v2
13+
with:
14+
ref: ${{ github.event.release.target_commitish }}
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: 12
20+
21+
- name: Install dependencies
22+
run: yarn install
23+
24+
- name: Run unit tests
25+
run: yarn test
26+
27+
publish:
28+
needs: [test]
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Check out Git repository
32+
uses: actions/checkout@v2
33+
with:
34+
ref: ${{ github.event.release.target_commitish }}
35+
36+
- name: Set up Node.js
37+
uses: actions/setup-node@v1
38+
with:
39+
node-version: 12
40+
always-auth: true
41+
registry-url: 'https://registry.npmjs.org'
42+
43+
- name: Install dependencies
44+
run: yarn install
45+
46+
- name: Set bot git config name
47+
run: git config --global user.name "GitHub CD bot"
48+
49+
- name: Set bot git config email
50+
run: git config --global user.email "github-cd-bot@example.com"
51+
52+
- name: Create a new release version
53+
run: yarn version --new-version ${{ github.event.release.tag_name }}
54+
env:
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Build a prod version
58+
run: yarn build
59+
60+
- name: Publish to NPM
61+
run: yarn publish
62+
env:
63+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/open-pr.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: PR Validation
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited, synchronize]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out Git repository
12+
uses: actions/checkout@v2
13+
with:
14+
ref: ${{ github.event.release.target_commitish }}
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: 12
20+
21+
- name: Install dependencies
22+
run: yarn install
23+
24+
- name: Run eslint
25+
run: yarn eslint
26+
27+
- name: Run prettier
28+
run: yarn prettier -c .
29+
30+
test:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Check out Git repository
34+
uses: actions/checkout@v2
35+
with:
36+
ref: ${{ github.event.release.target_commitish }}
37+
38+
- name: Set up Node.js
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: 12
42+
43+
- name: Install dependencies
44+
run: yarn install
45+
46+
- name: Run unit tests
47+
uses: mattallty/jest-github-action@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
yarn-error.log
3+
npm-debug.*
4+
5+
dist
6+
7+
coverage
8+
9+
.vscode
10+
.DS_Store

.huskyrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "lint-staged"
4+
}
5+
}

.lintstagedrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"**/*.ts": ["eslint --fix"],
3+
"*": ["prettier --write"]
4+
}

.npmignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
tests
2+
coverage
3+
jest.config.ts
4+
5+
.github
6+
7+
*.md
8+
9+
.huskyrc.json
10+
.lintstagedrc.json
11+
.eslintignore
12+
.eslintrc.json
13+
.prettierignore
14+
.prettierrc.json
15+
16+
yarn-error.log
17+
18+
src

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
coverage
3+
.*ignore
4+
yarn*
5+
dist
6+
.github

.prettierrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"printWidth": 90
4+
}

0 commit comments

Comments
 (0)