Skip to content

Commit cc0ba57

Browse files
committed
chore: Modernise tooling
- Replace Yarn with PNPM - Use semantic-release as a dependency - Unify CI/CD - Pin Node.js & PNPM versions - Drop running CI on pre-push
1 parent c17354c commit cc0ba57

File tree

8 files changed

+7220
-4793
lines changed

8 files changed

+7220
-4793
lines changed

Diff for: .github/workflows/ci-cd.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [opened, reopened]
7+
8+
env:
9+
FORCE_COLOR: 3 # Diplay chalk colors
10+
11+
jobs:
12+
ci:
13+
# Watch out! When changing the job name,
14+
# update the required checks in GitHub
15+
# branch protection settings for `next`.
16+
name: CI
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
20+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
21+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
22+
with:
23+
node-version-file: .node-version
24+
cache: pnpm
25+
- name: Install dependencies
26+
run: pnpm install
27+
- name: Run integration tests
28+
run: pnpm run ci
29+
- uses: 47ng/actions-slack-notify@main
30+
name: Notify on Slack
31+
if: always()
32+
continue-on-error: true
33+
with:
34+
status: ${{ job.status }}
35+
env:
36+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
37+
38+
cd:
39+
name: Deployment
40+
runs-on: ubuntu-latest
41+
needs: [ci]
42+
if: ${{ github.ref_name == 'main' || github.ref_name == 'beta' }}
43+
steps:
44+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
45+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
46+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
47+
with:
48+
node-version-file: .node-version
49+
cache: pnpm
50+
- name: Install dependencies
51+
run: pnpm install --ignore-scripts --frozen-lockfile
52+
- name: Build package
53+
run: pnpm build
54+
- name: Semantic Release
55+
run: ./node_modules/.bin/semantic-release
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Diff for: .husky/commit-msg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn commitlint --edit $1
4+
pnpm commitlint --edit $1

Diff for: .husky/pre-push

-4
This file was deleted.

Diff for: .node-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.15.1

Diff for: .releaserc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"branches": [
3+
"+([0-9])?(.{+([0-9]),x}).x",
4+
"main",
5+
"next",
6+
"next-major",
7+
{
8+
"name": "beta",
9+
"prerelease": true
10+
},
11+
{
12+
"name": "alpha",
13+
"prerelease": true
14+
}
15+
]
16+
}

Diff for: package.json

+18-16
Original file line numberDiff line numberDiff line change
@@ -40,41 +40,43 @@
4040
"test:coverage:merge": "nyc merge ./coverage ./coverage/coverage-final.json",
4141
"test:coverage:report": "nyc report -t ./coverage --r html -r lcov -r clover",
4242
"ci": "run-s build test",
43-
"prepare": "husky install",
43+
"prepare": "husky",
4444
"premigrate": "run-s build generate",
4545
"migrate": "ts-node ./src/tests/migrate.ts"
4646
},
4747
"dependencies": {
4848
"@47ng/cloak": "^1.1.0",
49-
"@prisma/generator-helper": "^5.9.1",
50-
"debug": "^4.3.4",
51-
"immer": "^10.0.3",
49+
"@prisma/generator-helper": "^5.17.0",
50+
"debug": "^4.3.5",
51+
"immer": "^10.1.1",
5252
"object-path": "^0.11.8",
53-
"zod": "^3.22.4"
53+
"zod": "^3.23.8"
5454
},
5555
"peerDependencies": {
5656
"@prisma/client": ">= 4.7"
5757
},
5858
"devDependencies": {
59-
"@commitlint/config-conventional": "^17.8.1",
60-
"@prisma/client": "5.9.1",
61-
"@prisma/internals": "^5.9.1",
59+
"@commitlint/config-conventional": "^19.2.2",
60+
"@prisma/client": "5.17.0",
61+
"@prisma/internals": "^5.17.0",
6262
"@types/debug": "^4.1.12",
6363
"@types/jest": "^29.5.12",
64-
"@types/node": "^20.11.16",
64+
"@types/node": "^20.14.11",
6565
"@types/object-path": "^0.11.4",
66-
"commitlint": "^17.8.1",
67-
"husky": "^9.0.10",
68-
"jest": "^29",
66+
"commitlint": "^19.3.0",
67+
"husky": "^9.1.0",
68+
"jest": "^29.7.0",
6969
"npm-run-all": "^4.1.5",
70-
"nyc": "^15.1.0",
71-
"prisma": "^5.9.1",
70+
"nyc": "^17.0.0",
71+
"prisma": "^5.17.0",
72+
"semantic-release": "^24.0.0",
7273
"sqlite": "^5.1.1",
7374
"sqlite3": "^5.1.7",
74-
"ts-jest": "^29.1.2",
75+
"ts-jest": "^29.2.2",
7576
"ts-node": "^10.9.2",
76-
"typescript": "^5.3.3"
77+
"typescript": "^5.5.3"
7778
},
79+
"packageManager": "[email protected]",
7880
"jest": {
7981
"verbose": true,
8082
"preset": "ts-jest/presets/js-with-ts",

0 commit comments

Comments
 (0)