Skip to content

Commit

Permalink
chore: enforcing semver
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueSCar committed Aug 18, 2024
1 parent 641e088 commit 4399a7d
Show file tree
Hide file tree
Showing 8 changed files with 2,976 additions and 36 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release
on:
push:
branches:
- main

permissions:
contents: read # for checkout

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: npm clean-install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn
3 changes: 3 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"branches": ["main"]
}
9 changes: 9 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { UserConfig } from '@commitlint/types';

const Configuration: UserConfig = {

extends: ['@commitlint/config-conventional'],
formatter: '@commitlint/format',
};

export default Configuration;
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"name": "cfb-api",
"version": "3.0.0",
"version": "5.0.0",
"repository": {
"type": "git",
"url": "https://github.com/CFBD/cfb-api-v2.git"
},
"private": true,
"main": "src/app.ts",
"scripts": {
"build": "tsoa spec-and-routes && tsc --skipLibCheck",
Expand All @@ -12,7 +17,8 @@
"lint:fix": "eslint --ignore-path .gitignore . --fix",
"prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml,ts}\"",
"prettier-check:updated": "pipe-git-updated --base=main --ext=css --ext=html --ext=js --ext=ts --ext=json --ext=md --ext=yaml --ext=yml -ext=js --ext=mdx -- prettier -c",
"prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml,ts,md,mdx,tsx,jsx,vue,}\" -c"
"prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml,ts,md,mdx,tsx,jsx,vue,}\" -c",
"prepare": "husky"
},
"keywords": [
"football",
Expand Down Expand Up @@ -43,6 +49,8 @@
"tsoa": "^6.2.1"
},
"devDependencies": {
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@types/bluebird": "^3.5.42",
"@types/body-parser": "^1.19.5",
"@types/cookie-parser": "^1.4.7",
Expand All @@ -59,10 +67,12 @@
"concurrently": "^8.2.2",
"eslint": "^9.2.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.1.4",
"joi": "^17.13.1",
"kysely-codegen": "^0.15.0",
"nodemon": "^3.1.0",
"prettier": "^3.2.5",
"semantic-release": "^24.1.0",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.4.5"
Expand Down
2 changes: 1 addition & 1 deletion src/config/middleware/quotas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export const checkCallQuotas = async (
res: Response,
next: NextFunction,
) => {
// @ts-ignore
if (
req.user &&
!ignoredPaths.includes(req.path) &&
// @ts-ignore
req.user.remainingCalls <= 0
) {
res.status(429).send({
Expand Down
Loading

0 comments on commit 4399a7d

Please sign in to comment.