Skip to content

Commit 3e9c0f9

Browse files
authored
chore(kysely-tailordb): remove "numUpdatedOrDeletedRows" and set up CI for the package (#31)
1 parent 3615426 commit 3e9c0f9

7 files changed

Lines changed: 210 additions & 22 deletions

File tree

.github/workflows/lint-workflow.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
name: Lint GitHub Actions workflows
2-
on:
3-
pull_request:
4-
paths:
5-
- .github/**
62

7-
permissions:
8-
contents: read
9-
10-
defaults:
11-
run:
12-
shell: bash
3+
on: workflow_call
134

145
jobs:
156
actionlint:
7+
timeout-minutes: 10
168
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
1712
steps:
1813
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1914

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test packages/kysely-tailordb
2+
3+
on: workflow_call
4+
5+
jobs:
6+
test:
7+
timeout-minutes: 10
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
steps:
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
16+
with:
17+
node-version-file: packages/kysely-tailordb/package.json
18+
registry-url: https://registry.npmjs.org
19+
20+
- name: Setup pnpm
21+
run: |
22+
npm i -g corepack@latest
23+
corepack enable
24+
25+
- name: Install deps
26+
working-directory: packages/kysely-tailordb
27+
run: |
28+
pnpm install
29+
30+
- name: Lint
31+
working-directory: packages/kysely-tailordb
32+
run: |
33+
pnpm run check
34+
35+
- name: Run type-check
36+
working-directory: packages/kysely-tailordb
37+
run: |
38+
pnpm run type-check
39+
40+
- name: Build
41+
working-directory: packages/kysely-tailordb
42+
run: |
43+
pnpm run build

.github/workflows/test.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Test
2+
3+
on: pull_request
4+
5+
permissions: {}
6+
7+
jobs:
8+
path-filter:
9+
timeout-minutes: 10
10+
outputs:
11+
action: ${{ steps.changes.outputs.action }}
12+
renovate: ${{ steps.changes.outputs.renovate }}
13+
kysely-tailordb: ${{ steps.changes.outputs.kysely-tailordb }}
14+
types: ${{ steps.changes.outputs.types }}
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
pull-requests: read
19+
20+
steps:
21+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
22+
id: changes
23+
with:
24+
filters: |
25+
action:
26+
- .github/workflows/*
27+
renovate:
28+
- renovate.json
29+
kysely-tailordb:
30+
- packages/kysely-tailordb/**
31+
types:
32+
- packages/types/**
33+
34+
status-check:
35+
timeout-minutes: 10
36+
runs-on: ubuntu-latest
37+
needs:
38+
- action
39+
- renovate
40+
- kysely-tailordb
41+
permissions: {}
42+
if: failure()
43+
steps:
44+
- run: exit 1
45+
46+
action:
47+
uses: ./.github/workflows/lint-workflow.yaml
48+
needs: path-filter
49+
if: needs.path-filter.outputs.action == 'true'
50+
permissions:
51+
contents: read
52+
53+
renovate:
54+
uses: ./.github/workflows/validate-renovate-config.yaml
55+
needs: path-filter
56+
if: needs.path-filter.outputs.renovate == 'true'
57+
permissions:
58+
contents: read
59+
60+
kysely-tailordb:
61+
uses: ./.github/workflows/test-function-kysely-tailordb.yaml
62+
needs: path-filter
63+
if: needs.path-filter.outputs.kysely-tailordb == 'true'
64+
permissions:
65+
contents: read
66+
pull-requests: write

.github/workflows/validate-renovate-config.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Validate Renovate config
22

3-
on:
4-
pull_request:
5-
paths:
6-
- renovate.json
3+
on: workflow_call
74

85
jobs:
96
validate:

packages/kysely-tailordb/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,23 @@
2323
"require": "./dist/index.cjs"
2424
},
2525
"types": "./dist/index.d.ts",
26-
"files": [
27-
"dist"
28-
],
26+
"files": ["dist"],
2927
"packageManager": "pnpm@10.8.1",
3028
"devDependencies": {
29+
"@biomejs/biome": "1.9.4",
3130
"@tailor-platform/function-types": "0.2.0",
3231
"@tsconfig/recommended": "1.0.8",
3332
"kysely": "0.28.1",
3433
"tsup": "8.4.0",
3534
"typescript": "5.8.3"
3635
},
3736
"peerDependencies": {
38-
"kysely": "0.28.1"
37+
"kysely": ">= 0.24.0 < 1"
3938
},
4039
"engines": {
4140
"node": "22.x"
4241
},
4342
"pnpm": {
44-
"onlyBuiltDependencies": [
45-
"esbuild"
46-
]
43+
"onlyBuiltDependencies": ["@biomejs/biome", "esbuild"]
4744
}
4845
}

packages/kysely-tailordb/pnpm-lock.yaml

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/kysely-tailordb/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ class TailordbConnection implements DatabaseConnection {
8484
const numAffectedRows = BigInt(result.rowCount);
8585
return {
8686
numAffectedRows,
87-
numUpdatedOrDeletedRows: numAffectedRows,
8887
rows,
8988
};
9089
}

0 commit comments

Comments
 (0)