Skip to content

Commit 1f80b94

Browse files
authored
feat: init
2 parents ada2928 + 71e6f35 commit 1f80b94

16 files changed

+5362
-0
lines changed

.eslintignore

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

.eslintrc.cjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* eslint-env node */
2+
3+
require('@geprog/eslint-config/patch/modern-module-resolution');
4+
5+
module.exports = {
6+
extends: ['@geprog', '@geprog/eslint-config/jest'],
7+
8+
env: {
9+
'shared-node-browser': true,
10+
},
11+
12+
parserOptions: {
13+
project: ['./tsconfig.eslint.json'],
14+
tsconfigRootDir: __dirname,
15+
extraFileExtensions: ['.cjs'],
16+
},
17+
};

.github/workflows/lint-pr.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Lint PR'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
runs-on: ubuntu-latest
13+
steps:
14+
# https://github.com/amannn/action-semantic-pull-request/releases
15+
- uses: amannn/action-semantic-pull-request@v3.4.0
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
name: Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: '14'
22+
23+
- name: Cache pnpm modules
24+
uses: actions/cache@v2
25+
with:
26+
path: ~/.pnpm-store
27+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
28+
restore-keys: |
29+
${{ runner.os }}-
30+
31+
- uses: pnpm/action-setup@v2.0.1
32+
with:
33+
version: 7
34+
run_install: true
35+
36+
- name: Build
37+
run: pnpm run build
38+
39+
- name: Release
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
43+
run: pnpm run release

.github/workflows/tests.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Tests
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
unit-tests:
12+
name: Unit tests
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v2
22+
with:
23+
node-version: '14'
24+
25+
- name: Cache pnpm modules
26+
uses: actions/cache@v2
27+
with:
28+
path: ~/.pnpm-store
29+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
30+
restore-keys: |
31+
${{ runner.os }}-
32+
33+
- uses: pnpm/action-setup@v2.0.1
34+
with:
35+
version: 7
36+
run_install: true
37+
38+
- name: Unit test
39+
run: pnpm run test --passWithNoTests
40+
41+
typecheck:
42+
name: Typecheck
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v2
47+
with:
48+
fetch-depth: 0
49+
50+
- name: Setup Node.js
51+
uses: actions/setup-node@v2
52+
with:
53+
node-version: '14'
54+
55+
- name: Cache pnpm modules
56+
uses: actions/cache@v2
57+
with:
58+
path: ~/.pnpm-store
59+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
60+
restore-keys: |
61+
${{ runner.os }}-
62+
63+
- uses: pnpm/action-setup@v2.0.1
64+
with:
65+
version: 7
66+
run_install: true
67+
68+
- name: Typecheck
69+
run: pnpm run typecheck
70+
71+
lint:
72+
name: Lint
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v2
77+
with:
78+
fetch-depth: 0
79+
80+
- name: Setup Node.js
81+
uses: actions/setup-node@v2
82+
with:
83+
node-version: '14'
84+
85+
- name: Cache pnpm modules
86+
uses: actions/cache@v2
87+
with:
88+
path: ~/.pnpm-store
89+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
90+
restore-keys: |
91+
${{ runner.os }}-
92+
93+
- uses: pnpm/action-setup@v2.0.1
94+
with:
95+
version: 7
96+
run_install: true
97+
98+
- name: Lint
99+
run: pnpm run lint
100+
101+
check-format:
102+
name: Check format
103+
runs-on: ubuntu-latest
104+
steps:
105+
- name: Checkout
106+
uses: actions/checkout@v2
107+
with:
108+
fetch-depth: 0
109+
110+
- name: Setup Node.js
111+
uses: actions/setup-node@v2
112+
with:
113+
node-version: '14'
114+
115+
- name: Cache pnpm modules
116+
uses: actions/cache@v2
117+
with:
118+
path: ~/.pnpm-store
119+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
120+
restore-keys: |
121+
${{ runner.os }}-
122+
123+
- uses: pnpm/action-setup@v2.0.1
124+
with:
125+
version: 7
126+
run_install: true
127+
128+
- name: Check format
129+
run: pnpm run lint:format

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
coverage/
4+
junit.xml
5+
*.tgz
6+
report.json

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
coverage/
3+
pnpm-lock.yaml
4+
report.json

.prettierrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
printWidth: 120,
6+
tabWidth: 2,
7+
endOfLine: 'lf',
8+
};

.releaserc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@geprog/semantic-release-config"
3+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# oauth-mock-server
2+
23
A mocked oauth server for development and e2e testing

package.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "@geprog/oauth-mock-server",
3+
"version": "0.0.0-semantic-release",
4+
"description": "A mocked oauth server for development and e2e testing",
5+
"homepage": "https://geprog.com",
6+
"repository": "github:geprog/oauth-mock-server",
7+
"license": "MIT",
8+
"exports": {
9+
".": {
10+
"import": "./dist/index.mjs",
11+
"require": "./dist/index.js"
12+
}
13+
},
14+
"main": "./dist/index.js",
15+
"module": "./dist/index.mjs",
16+
"types": "./dist/index.d.ts",
17+
"files": [
18+
"/dist"
19+
],
20+
"bin": {
21+
"oauth-mock-server": "./dist/index.js"
22+
},
23+
"scripts": {
24+
"build": "tsup src/index.ts --dts --format cjs,esm",
25+
"clean": "rm -rf dist/ node_modules/",
26+
"lint": "eslint --max-warnings 0 .",
27+
"lint:format": "prettier --check .",
28+
"start": "pnpm run build --watch",
29+
"test": "vitest run --coverage",
30+
"test:watch": "vitest",
31+
"typecheck": "tsc --noEmit",
32+
"release": "semantic-release"
33+
},
34+
"dependencies": {
35+
"@fastify/formbody": "7.0.1",
36+
"fastify": "4.1.0",
37+
"jsonwebtoken": "8.5.1",
38+
"tsx": "3.5.0"
39+
},
40+
"devDependencies": {
41+
"@geprog/eslint-config": "1.1.0",
42+
"@geprog/semantic-release-config": "1.0.0",
43+
"@types/jsonwebtoken": "8.5.8",
44+
"c8": "7.11.3",
45+
"eslint": "8.8.0",
46+
"prettier": "2.5.1",
47+
"semantic-release": "19.0.2",
48+
"tsup": "5.11.13",
49+
"typescript": "4.5.5",
50+
"vitest": "0.16.0"
51+
},
52+
"engines": {
53+
"pnpm": "7"
54+
},
55+
"publishConfig": {
56+
"access": "public"
57+
}
58+
}

0 commit comments

Comments
 (0)