Skip to content

Commit a35d7b3

Browse files
dahliaclaude
andcommitted
Add SQLite-based repository implementation for BotKit
- Add @fedify/botkit-sqlite package with SqliteRepository class - Implement full Repository interface using node:sqlite module - Add comprehensive test suite with try-finally cleanup patterns - Support both in-memory and file-based SQLite databases - Enable WAL mode and foreign key constraints for data integrity - Add documentation in README.md and docs/concepts/repository.md - Configure workspace with proper build and test setup Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3a9b826 commit a35d7b3

File tree

18 files changed

+1432
-338
lines changed

18 files changed

+1432
-338
lines changed

.github/workflows/main.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: main
22
on:
33
push:
4-
branches: "*"
5-
tags: "*"
4+
branches:
5+
- "main"
6+
- "*.*-maintenance"
7+
tags:
8+
- "*.*.*"
69
pull_request:
710

811
jobs:
@@ -70,17 +73,12 @@ jobs:
7073
'.version = .version + "-dev." + $build + "+" + $commit' \
7174
packages/botkit/deno.json > deno.json.tmp
7275
mv deno.json.tmp packages/botkit/deno.json
73-
jq \
74-
--arg build "$GITHUB_RUN_NUMBER" \
75-
--arg commit "${GITHUB_SHA::8}" \
76-
'.version = .version + "-dev." + $build + "+" + $commit' \
77-
packages/botkit/package.json > package.json.tmp
78-
mv package.json.tmp packages/botkit/package.json
76+
deno task check-versions --fix
7977
- if: github.ref_type == 'tag'
8078
run: |
8179
set -euo pipefail
8280
[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]
83-
[[ "$(jq -r .version package.json)" = "$GITHUB_REF_NAME" ]]
81+
deno task check-versions
8482
- run: |
8583
set -euo pipefail
8684
pnpm config set //registry.npmjs.org/:_authToken "$NPM_AUTH_TOKEN"
@@ -113,7 +111,6 @@ jobs:
113111
body_path: ${{ steps.extract-changelog.outputs.output-file }}
114112
name: BotKit ${{ github.ref_name }}
115113
generate_release_notes: false
116-
files: fedify-botkit-*.tgz
117114

118115
publish-docs:
119116
if: github.event_name == 'push'
@@ -147,4 +144,4 @@ jobs:
147144
- id: deploy
148145
uses: actions/deploy-pages@v4
149146

150-
# cSpell: ignore denoland submark softprops
147+
# cSpell: ignore denoland submark softprops pipefail npmjs

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ To be released.
99
- BotKit now supports Node.js alongside of Deno. The minimum required
1010
version of Node.js is 22.0.0.
1111

12+
### @fedify/botkit
13+
1214
- BotKit now supports publishing polls. [[#7], [#8]]
1315

1416
- Added `Poll` interface.
@@ -38,6 +40,12 @@ To be released.
3840
[#7]: https://github.com/fedify-dev/botkit/issues/7
3941
[#8]: https://github.com/fedify-dev/botkit/pull/8
4042

43+
### @fedify/botkit-sqlite
44+
45+
- Added `SqliteRepository` class that implements a SQLite-based repository
46+
for BotKit.
47+
- Added `SqliteRepositoryOptions` interface.
48+
4149

4250
Version 0.2.1
4351
-------------

deno.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@
88
"temporal"
99
],
1010
"imports": {
11-
"@fedify/fedify": "jsr:@fedify/fedify@1.8.2",
11+
"@fedify/fedify": "jsr:@fedify/fedify@^1.8.3",
12+
"@logtape/logtape": "jsr:@logtape/logtape@^1.0.0",
13+
"@std/fs": "jsr:@std/fs@^1.0.19",
14+
"@std/path": "jsr:@std/path@^1.1.1",
1215
"hono": "jsr:@hono/hono@^4.8.2",
16+
"tsdown": "npm:tsdown@^0.12.8",
1317
"x-forwarded-fetch": "jsr:@hongminhee/x-forwarded-fetch@^0.2.0"
1418
},
1519
"nodeModulesDir": "none",
1620
"exclude": [
1721
".github",
1822
"docs",
1923
"dist",
20-
"junit.xml"
24+
"junit.xml",
25+
"package.json"
2126
],
2227
"fmt": {
2328
"exclude": [
@@ -27,9 +32,15 @@
2732
]
2833
},
2934
"tasks": {
30-
"check": "deno check && deno lint && deno fmt --check && deno publish --dry-run --allow-dirty && deno run scripts/check_versions.ts",
35+
"check": {
36+
"dependencies": [
37+
"check-versions"
38+
],
39+
"command": "deno check && deno lint && deno fmt --check && deno publish --dry-run --allow-dirty"
40+
},
41+
"check-versions": "deno run --allow-read --allow-write scripts/check_versions.ts",
3142
"install": "deno cache packages/*/src/*.ts",
32-
"test": "deno test --allow-env=NODE_V8_COVERAGE,JEST_WORKER_ID --allow-net=hollo.social --parallel",
43+
"test": "deno test --allow-read --allow-write --allow-env --allow-net=hollo.social --parallel",
3344
"test:node": "pnpm install && pnpm run -r test",
3445
"test-all": {
3546
"dependencies": [

0 commit comments

Comments
 (0)