Skip to content

Commit 56c93b5

Browse files
committed
feat: introduce new library for server-timing header
0 parents  commit 56c93b5

26 files changed

+22852
-0
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
.eslintrc.js
3+
.eslintcache

.eslintrc.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"project": "./tsconfig.json"
5+
},
6+
"plugins": [
7+
"@typescript-eslint"
8+
],
9+
"extends": [
10+
"eslint:recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
13+
"airbnb-base",
14+
"airbnb-typescript/base",
15+
"plugin:import/recommended",
16+
"plugin:import/typescript",
17+
"prettier",
18+
"plugin:prettier/recommended"
19+
],
20+
"rules": {
21+
"no-self-compare": "error",
22+
"no-void": [
23+
"error",
24+
{
25+
"allowAsStatement": true
26+
}
27+
],
28+
"@typescript-eslint/consistent-type-imports": [
29+
"error",
30+
{
31+
"disallowTypeAnnotations": false
32+
}
33+
],
34+
"import/order": [
35+
"error",
36+
{
37+
"groups": [
38+
"builtin",
39+
"external",
40+
"internal",
41+
"parent",
42+
"sibling",
43+
"index",
44+
"object",
45+
"type"
46+
]
47+
}
48+
],
49+
"import/prefer-default-export": "off"
50+
}
51+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- '**/*.md'
8+
- '**/*.yml'
9+
- '**/*.json'
10+
pull_request:
11+
branches: [ main ]
12+
paths-ignore:
13+
- '**/*.md'
14+
- '**/*.yml'
15+
- '**/*.json'
16+
schedule:
17+
- cron: '34 22 * * 0'
18+
19+
jobs:
20+
analyze:
21+
name: Analyze
22+
runs-on: ubuntu-latest
23+
permissions:
24+
actions: read
25+
contents: read
26+
security-events: write
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'javascript' ]
32+
33+
if: "!contains(github.event.head_commit.message, 'skip ci')"
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v2
37+
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v1
40+
with:
41+
languages: ${{ matrix.language }}
42+
43+
- name: Autobuild
44+
uses: github/codeql-action/autobuild@v1
45+
46+
- name: Perform CodeQL Analysis
47+
uses: github/codeql-action/analyze@v1

.github/workflows/pr.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Check PR
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
leaks:
7+
name: leaks
8+
runs-on: ubuntu-latest
9+
if: "!contains(github.event.head_commit.message, 'skip ci')"
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: '0'
15+
- name: Check code for leaks
16+
uses: zricethezav/gitleaks-action@master
17+
18+
lint:
19+
name: lint + typecheck
20+
runs-on: ubuntu-latest
21+
if: "!contains(github.event.head_commit.message, 'skip ci')"
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v2
25+
- name: Set up Node.js
26+
uses: actions/setup-node@v2
27+
with:
28+
node-version: 'lts/*'
29+
cache: 'npm'
30+
- name: Install dependencies
31+
run: npm ci
32+
- name: Check linting
33+
run: npm run lint
34+
- name: Check types
35+
run: npm run typecheck
36+
37+
language:
38+
name: language
39+
runs-on: ubuntu-latest
40+
if: "!contains(github.event.head_commit.message, 'skip ci')"
41+
steps:
42+
- name: Check language with Alex
43+
uses: brown-ccv/alex-recommends@v1.2.1
44+
with:
45+
GITHUB_TOKEN: ${{ secrets.OSLASH_BOT_GITHUB_TOKEN }}
46+
pr_only: true
47+
48+
test:
49+
name: test/${{ matrix.node }}
50+
strategy:
51+
matrix:
52+
node: [ '12', '14', '16' ]
53+
runs-on: ubuntu-latest
54+
if: "!contains(github.event.head_commit.message, 'skip ci')"
55+
steps:
56+
- name: Checkout code
57+
uses: actions/checkout@v2
58+
- name: Set up Node.js
59+
uses: actions/setup-node@v2
60+
with:
61+
node-version: ${{ matrix.node }}
62+
cache: 'npm'
63+
- name: Install dependencies
64+
run: npm ci
65+
- name: Run tests
66+
run: npm run test
67+
68+
coverage:
69+
name: code coverage
70+
runs-on: ubuntu-latest
71+
needs: [ test ]
72+
if: "!contains(github.event.head_commit.message, 'skip ci')"
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v2
76+
- name: Set up Node.js
77+
uses: actions/setup-node@v2
78+
with:
79+
node-version: 'lts/*'
80+
cache: 'npm'
81+
- name: Install dependencies
82+
run: npm ci
83+
- name: Run tests and collect coverage
84+
run: npm run coverage
85+
- name: Upload code coverage
86+
uses: codecov/codecov-action@v2
87+
with:
88+
token: ${{ secrets.CODECOV_TOKEN }}
89+
directory: coverage
90+
flags: unittests
91+
fail_ci_if_error: true
92+
verbose: true

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '!*'
9+
10+
jobs:
11+
pre-release:
12+
name: pre-release
13+
runs-on: ubuntu-latest
14+
if: "!contains(github.event.head_commit.message, 'skip release') && !contains(github.event.head_commit.message, 'skip ci')"
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: '0'
20+
- name: Check code for leaks
21+
uses: zricethezav/gitleaks-action@master
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: 'lts/*'
26+
cache: 'npm'
27+
- name: Install dependencies
28+
run: npm ci
29+
- name: Check linting
30+
run: npm run lint
31+
- name: Check types
32+
run: npm run typecheck
33+
- name: Run tests and collect coverage
34+
run: npm run coverage
35+
- name: Upload code coverage
36+
uses: codecov/codecov-action@v2
37+
with:
38+
token: ${{ secrets.CODECOV_TOKEN }}
39+
directory: coverage
40+
flags: unittests
41+
fail_ci_if_error: true
42+
verbose: true
43+
44+
release:
45+
name: release
46+
runs-on: ubuntu-latest
47+
needs: [ pre-release ]
48+
if: "!contains(github.event.head_commit.message, 'skip release') && !contains(github.event.head_commit.message, 'skip ci')"
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v2
52+
- name: Set up Node.js
53+
uses: actions/setup-node@v2
54+
with:
55+
node-version: 'lts/*'
56+
cache: 'npm'
57+
registry-url: 'https://registry.npmjs.org'
58+
- name: Install dependencies
59+
run: npm ci
60+
- name: Import OSlash bot's GPG key for signing commits
61+
id: import-gpg
62+
uses: crazy-max/ghaction-import-gpg@v4
63+
with:
64+
gpg_private_key: ${{ secrets.OSLASH_BOT_GPG_PRIVATE_KEY }}
65+
passphrase: ${{ secrets.OSLASH_BOT_GPG_PASSPHRASE }}
66+
git_config_global: true
67+
git_user_signingkey: true
68+
git_commit_gpgsign: true
69+
- name: Kick off release
70+
run: npm_config_yes=true npx semantic-release
71+
env:
72+
NPM_USERNAME: oslashbot
73+
NPM_EMAIL: ${{ steps.import-gpg.outputs.email }}
74+
NPM_TOKEN: ${{ secrets.OSLASH_BOT_NPM_TOKEN }}
75+
NODE_AUTH_TOKEN: ${{ secrets.OSLASH_BOT_NPM_TOKEN }}
76+
GITHUB_TOKEN: ${{ secrets.OSLASH_BOT_GITHUB_TOKEN }}
77+
GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }}
78+
GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }}
79+
GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }}
80+
GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }}

.gitignore

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

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://registry.npmjs.org/
2+
save-exact=true

.nycrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "@istanbuljs/nyc-config-typescript",
3+
"all": true,
4+
"cache": false,
5+
"clean": true,
6+
"include": [
7+
"src/**/*.ts"
8+
],
9+
"exclude": [
10+
"test/**/*"
11+
]
12+
}

.prettierrc.json

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

.releaserc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
"@semantic-release/commit-analyzer",
7+
"@semantic-release/release-notes-generator",
8+
[
9+
"@semantic-release/changelog",
10+
{
11+
"changelogFile": "CHANGELOG.md"
12+
}
13+
],
14+
"@semantic-release/npm",
15+
[
16+
"@semantic-release/git",
17+
{
18+
"assets": [
19+
"package.json",
20+
"package-lock.json",
21+
"CHANGELOG.md"
22+
],
23+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
24+
}
25+
],
26+
"@semantic-release/github"
27+
]
28+
}

0 commit comments

Comments
 (0)