Skip to content

Commit 68c61d8

Browse files
committed
feat: add handling for team join event
1 parent 6c9429b commit 68c61d8

28 files changed

+17181
-2
lines changed

.commitlintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
[
8+
'feat',
9+
'fix',
10+
'docs',
11+
'style',
12+
'refactor',
13+
'perf',
14+
'test',
15+
'build',
16+
'ci',
17+
'chore',
18+
'revert'
19+
]
20+
]
21+
}
22+
};

.eslintrc.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'prettier'
7+
],
8+
plugins: ['@typescript-eslint'],
9+
env: {
10+
node: true,
11+
jest: true
12+
},
13+
rules: {
14+
'@typescript-eslint/explicit-function-return-type': 'off',
15+
'@typescript-eslint/no-explicit-any': 'warn',
16+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }]
17+
}
18+
};

.github/workflows/ci-cd.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Run linter
32+
run: npm run lint
33+
34+
- name: Run tests
35+
run: npm test
36+
37+
- name: Build
38+
run: npm run build
39+
40+
release:
41+
needs: test
42+
runs-on: ubuntu-latest
43+
if: github.ref == 'refs/heads/main'
44+
45+
steps:
46+
- uses: actions/checkout@v3
47+
with:
48+
fetch-depth: 0
49+
persist-credentials: false
50+
51+
- name: Setup Node.js
52+
uses: actions/setup-node@v3
53+
with:
54+
node-version: '18.x'
55+
56+
- name: Install dependencies
57+
run: npm ci
58+
59+
- name: Release
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
run: npx semantic-release
63+
64+
deploy:
65+
needs: release
66+
runs-on: ubuntu-latest
67+
if: github.ref == 'refs/heads/main'
68+
69+
steps:
70+
- uses: actions/checkout@v3
71+
72+
- name: Deploy to Heroku
73+
uses: akhileshns/[email protected]
74+
with:
75+
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
76+
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
77+
heroku_email: ${{ secrets.HEROKU_EMAIL }}
78+
branch: main

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,12 @@ dist
128128
.yarn/build-state.yml
129129
.yarn/install-state.gz
130130
.pnp.*
131+
132+
# Node modules
133+
node_modules/
134+
dist/
135+
.env
136+
.env.*
137+
*.log
138+
.DS_Store
139+
coverage/

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit $1

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run lint
5+
npm test

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"tabWidth": 2
7+
}

.releaserc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
branches: ['main'],
3+
plugins: [
4+
['@semantic-release/commit-analyzer', {
5+
preset: 'conventionalcommits',
6+
releaseRules: [
7+
{type: 'docs', scope: 'README', release: 'patch'},
8+
{type: 'refactor', release: 'patch'},
9+
{type: 'style', release: 'patch'},
10+
{type: 'perf', release: 'patch'},
11+
{type: 'chore', release: false}
12+
]
13+
}],
14+
'@semantic-release/release-notes-generator',
15+
['@semantic-release/changelog', {
16+
changelogFile: 'CHANGELOG.md'
17+
}],
18+
['@semantic-release/git', {
19+
assets: ['package.json', 'CHANGELOG.md'],
20+
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
21+
}],
22+
'@semantic-release/github'
23+
]
24+
};

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: npm start

0 commit comments

Comments
 (0)