Skip to content

Commit 318ca5c

Browse files
authored
chore: Modernise tooling (#117)
1 parent 59f8668 commit 318ca5c

35 files changed

Lines changed: 5291 additions & 5098 deletions

.github/workflows/cd.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/ci-cd.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- beta
8+
- next
9+
pull_request:
10+
types: [opened, reopened, synchronize]
11+
12+
env:
13+
FORCE_COLOR: 3 # Display chalk colors
14+
15+
jobs:
16+
ci:
17+
name: CI
18+
runs-on: ubuntu-24.04-arm
19+
steps:
20+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
21+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
22+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
23+
with:
24+
node-version-file: .node-version
25+
cache: pnpm
26+
- name: Install dependencies
27+
run: pnpm install
28+
- name: Run integration tests
29+
run: pnpm run ci
30+
- uses: 47ng/actions-slack-notify@main
31+
name: Notify on Slack
32+
if: always()
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-24.04-arm
41+
permissions:
42+
contents: write # to be able to publish a GitHub release
43+
issues: write # to be able to comment on released issues
44+
pull-requests: write # to be able to comment on released pull requests
45+
id-token: write # to enable use of OIDC for NPM provenance / trusted publishing
46+
needs: [ci]
47+
if: ${{ github.ref_name == 'main' || github.ref_name == 'beta' }}
48+
steps:
49+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
50+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
51+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
52+
with:
53+
node-version-file: .node-version
54+
cache: pnpm
55+
- name: Install dependencies
56+
run: pnpm install --ignore-scripts --frozen-lockfile
57+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
58+
run: npm audit signatures
59+
- name: Build package
60+
run: pnpm build
61+
- name: Semantic Release
62+
run: ./node_modules/.bin/semantic-release
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/pkg.pr.new.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,21 @@ jobs:
1515
contains(github.event.pull_request.labels.*.name, 'deploy:preview')
1616
runs-on: ubuntu-24.04-arm
1717
steps:
18-
- id: yarn-cache
19-
name: Get Yarn cache path
20-
run: echo "::set-output name=dir::$(yarn cache dir)"
21-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
22-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
18+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
19+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
20+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
2321
with:
24-
node-version: lts/*
25-
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809
26-
name: Load Yarn cache
27-
with:
28-
path: ${{ steps.yarn-cache.outputs.dir }}
29-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
30-
restore-keys: |
31-
${{ runner.os }}-yarn-
32-
- run: yarn install --ignore-scripts
33-
name: Install dependencies
34-
- run: yarn build
35-
name: Build package
22+
node-version-file: .node-version
23+
cache: pnpm
24+
- name: Install dependencies
25+
run: pnpm install --ignore-scripts --frozen-lockfile
26+
- name: Build package
27+
run: pnpm build
3628
- name: Set package version
3729
run: |
3830
npm pkg set version=0.0.0-preview.${{ github.event.pull_request.head.sha }}
3931
echo "::notice title=Install (PR)::npm i https://pkg.pr.new/prisma-field-encryption@${{ github.event.pull_request.number }}"
4032
echo "::notice title=Install (SHA)::npm i https://pkg.pr.new/prisma-field-encryption@${{ github.event.pull_request.head.sha }}"
4133
echo "::notice title=Version::0.0.0-preview.${{ github.event.pull_request.head.sha }}"
4234
- name: Publish to pkg.pr.new
43-
run: npx pkg-pr-new publish --compact --no-template
35+
run: pnpx pkg-pr-new publish --compact --no-template --packageManager=pnpm --pnpm

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
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

.husky/pre-push

Lines changed: 0 additions & 4 deletions
This file was deleted.

.node-version

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

.npmignore

Lines changed: 0 additions & 12 deletions
This file was deleted.

.releaserc

Lines changed: 16 additions & 0 deletions
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+
}

CONTRIBUTING.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
## Getting Started
44

55
1. Fork the repository & clone your fork
6-
2. Install dependencies with `yarn install` _(uses Yarn v1)_
7-
3. Build the sources with `yarn build`
6+
2. Install dependencies with `pnpm install`
7+
3. Build the sources with `pnpm build`
88

99
## Running tests
1010

11-
1. Run `yarn test` to run all tests. This includes:
11+
1. Run `pnpm test` to run all tests. This includes:
1212

13-
- Unit tests (`yarn test:unit`)
14-
- Typechecking (`yarn test:types`)
15-
- Integration tests (`yarn test:integration`)
13+
- Typechecking (`pnpm test:types`)
14+
- Runtime tests (`pnpm test:runtime`) - runs both unit and integration tests
1615

1716
The [integration test suite](./src/tests/integration.test.ts) runs against a local SQLite database.
1817
It is copied from `./prisma/db.test.sqlite` to `./prisma/db.integration.sqlite` before each test runs.

0 commit comments

Comments
 (0)