Skip to content

Commit 890f2b3

Browse files
authored
fix: unblock verify after common-v8 wave + biome normalization (#31)
* fix: unblock verify after upstream wave * chore: apply biome lint normalization * feat(bun): harden db worker protocol and tests * chore(test): add hybrid coverage pipeline for bun * chore(ci): add hybrid coverage summary and align bun 1.3.9 * fix: Enhance SQLite test robustness by adding explicit checks and implement error handling for `useEvolu` update operations.
1 parent e09ba46 commit 890f2b3

File tree

32 files changed

+497
-169
lines changed

32 files changed

+497
-169
lines changed

.github/workflows/ci.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,23 @@ jobs:
4040

4141
- name: Verify
4242
run: bun run verify
43+
44+
- name: Coverage summary
45+
if: always()
46+
run: |
47+
{
48+
echo "## Coverage Summary"
49+
echo
50+
51+
if [ -f coverage/coverage-summary.json ]; then
52+
node -e 'const fs=require("node:fs"); const total=JSON.parse(fs.readFileSync("coverage/coverage-summary.json","utf8")).total; console.log("- Vitest (v8): lines "+total.lines.pct+"% | statements "+total.statements.pct+"% | branches "+total.branches.pct+"% | functions "+total.functions.pct+"%");'
53+
else
54+
echo "- Vitest (v8): not available"
55+
fi
56+
57+
if [ -f coverage/bun/lcov.info ]; then
58+
node -e 'const fs=require("node:fs"); const txt=fs.readFileSync("coverage/bun/lcov.info","utf8"); let LF=0,LH=0,BRF=0,BRH=0,FNF=0,FNH=0; for (const line of txt.split(/\r?\n/)) { if (line.startsWith("LF:")) LF += Number(line.slice(3)); else if (line.startsWith("LH:")) LH += Number(line.slice(3)); else if (line.startsWith("BRF:")) BRF += Number(line.slice(4)); else if (line.startsWith("BRH:")) BRH += Number(line.slice(4)); else if (line.startsWith("FNF:")) FNF += Number(line.slice(4)); else if (line.startsWith("FNH:")) FNH += Number(line.slice(4)); } const pct=(h,f)=>f===0?"0.00":((h/f)*100).toFixed(2); console.log("- Bun test: lines "+pct(LH,LF)+"% ("+LH+"/"+LF+") | branches "+pct(BRH,BRF)+"% ("+BRH+"/"+BRF+") | functions "+pct(FNH,FNF)+"% ("+FNH+"/"+FNF+")");'
59+
else
60+
echo "- Bun test: not available"
61+
fi
62+
} >> "$GITHUB_STEP_SUMMARY"

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
| Aspect | Value |
1616
| ---------------- | ------------- |
17-
| Package Manager | Bun 1.3.8 |
17+
| Package Manager | Bun 1.3.9 |
1818
| Node.js | >=24.0.0 |
1919
| Linter/Formatter | Biome 2.3.14 |
2020
| Test Framework | Vitest |

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ To chat with other community members, you can join the [Evolu Discord](https://d
2929
Evolu monorepo uses [Bun](https://bun.sh).
3030

3131
> [!NOTE]
32-
> The Evolu monorepo is verified to run under **Bun 1.3.8** in combination with **Node.js >=24.0.0**. This compatibility is explicitly tested in CI.
32+
> The Evolu monorepo is verified to run under **Bun 1.3.9** in combination with **Node.js >=24.0.0**. This compatibility is explicitly tested in CI.
3333
3434
Install dependencies:
3535

@@ -96,4 +96,4 @@ Licensed under [MIT](./LICENSE).
9696
<div align="center">
9797
<a href="https://github.com/enterprises/ownCTRL"><img src="https://img.shields.io/badge/©️_2026-ownCTRL™-333?style=flat&labelColor=ddd" alt="© 2026 ownCTRL™"/></a>
9898
<a href="https://github.com/miccy"><img src="https://img.shields.io/badge/⚙️_Maintained_with_🩶_by-%40miccy-333?style=flat&labelColor=ddd" alt="Maintained by @miccy"/></a>
99-
</div>
99+
</div>

apps/web/src/app/(playgrounds)/playgrounds/minimal/EvoluMinimalExample.tsx

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,21 @@ const Todos: FC = () => {
154154
);
155155
};
156156

157-
// /**
158-
// * Subscribe to Evolu errors (database, network, sync issues). These should not
159-
// * happen in normal operation, so log them for debugging. Show users a friendly
160-
// * error message instead of technical details.
161-
// */
162-
// evolu.subscribeError(() => {
163-
// const error = evolu.getError();
164-
// if (!error) return;
157+
const TodoItem: FC<{
158+
row: TodosRow;
159+
}> = ({ row: { id, title, isCompleted } }) => {
160+
const { update } = useEvolu();
161+
162+
const handleToggleCompletedClick = () => {
163+
const result = update("todo", {
164+
id,
165+
isCompleted: Evolu.booleanToSqliteBoolean(!isCompleted),
166+
});
167+
168+
if (!result.ok) {
169+
alert(formatTypeError(result.error));
170+
}
171+
};
165172

166173
const handleRenameClick = () => {
167174
const newTitle = window.prompt("Edit todo", title);
@@ -174,11 +181,15 @@ const Todos: FC = () => {
174181
};
175182

176183
const handleDeleteClick = () => {
177-
update("todo", {
184+
const result = update("todo", {
178185
id,
179186
// Soft delete with isDeleted flag (CRDT-friendly, preserves sync history).
180187
isDeleted: Evolu.sqliteTrue,
181188
});
189+
190+
if (!result.ok) {
191+
alert(formatTypeError(result.error));
192+
}
182193
};
183194

184195
return (

bun.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"repository": "https://github.com/SQLoot/evolu-plan-b",
55
"author": "SQLoot",
66
"license": "MIT",
7-
"packageManager": "bun@1.3.8",
7+
"packageManager": "bun@1.3.9",
88
"workspaces": [
99
"apps/*",
1010
"packages/*",
@@ -17,7 +17,9 @@
1717
"build:web": "bun run build:docs && turbo --filter web build",
1818
"build:docs": "typedoc && bun --filter=web run fix:docs",
1919
"test": "vitest run",
20-
"test:coverage": "vitest run --coverage",
20+
"test:coverage": "bun run test:coverage:vitest && bun run test:coverage:bun",
21+
"test:coverage:vitest": "vitest run --coverage",
22+
"test:coverage:bun": "bun test ./packages/bun/test --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage/bun",
2123
"test:watch": "vitest",
2224
"start": "turbo start",
2325
"lint": "biome check",

packages/bun/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
],
2020
"scripts": {
2121
"build": "rimraf dist && tsc --build",
22-
"test": "bun test",
22+
"test": "bun test ./test",
23+
"test:coverage": "bun test ./test --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage",
2324
"clean": "rimraf .turbo node_modules dist"
2425
},
2526
"devDependencies": {
2627
"@evolu/common": "workspace:*",
2728
"@evolu/tsconfig": "workspace:*",
28-
"bun-types": "^1.3.8",
29+
"bun-types": "^1.3.9",
2930
"typescript": "^5.9.3"
3031
},
3132
"peerDependencies": {

0 commit comments

Comments
 (0)