Skip to content

Commit 058b454

Browse files
authored
refactor: update sdk reference (#29)
* refactor: update sdk reference * fix: update type
1 parent ffb1cda commit 058b454

15 files changed

Lines changed: 160 additions & 203 deletions

File tree

samples/bun-worker/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ await run(async (absurd) => {
1616
await ctx.step("init", async () => {
1717
console.log("init step");
1818
ctx.emitEvent("progress", { message: "Initialization complete" });
19+
return {};
1920
});
2021

2122
await ctx.sleepFor("back off 15s", 15);
2223

2324
await ctx.step("process", async () => {
2425
console.log("process step");
2526
ctx.emitEvent("progress", { message: "Processing complete" });
27+
return {};
2628
});
2729

2830
const name = params.name || "world";

sdks/bun-worker/bun.lock

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

sdks/bun-worker/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@absurd-sqlite/bun-worker",
3-
"version": "0.2.2-alpha.2",
3+
"version": "0.3.0-alpha.0",
44
"description": "Bun worker utilities for Absurd-SQLite",
55
"type": "module",
66
"main": "dist/index.js",
@@ -39,14 +39,13 @@
3939
"homepage": "https://github.com/b4fun/absurd-sqlite#readme",
4040
"dependencies": {
4141
"@absurd-sqlite/sdk": "next",
42-
"absurd-sdk": "https://github.com/bcho/absurd/releases/download/sdks%2Ftypescript%2Fv0.0.7/typescript-sdk-v0.0.7.tgz",
4342
"cac": "^6.7.14"
4443
},
4544
"devDependencies": {
46-
"bun-types": "^1.3.5",
45+
"bun-types": "^1.3.6",
4746
"typescript": "^5.9.3"
4847
},
4948
"engines": {
5049
"bun": ">=1.1.0"
5150
}
52-
}
51+
}

sdks/bun-worker/src/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
import { Absurd, type WorkerOptions } from "absurd-sdk";
21
import { Database } from "bun:sqlite";
3-
import type { AbsurdClient } from "@absurd-sqlite/sdk";
2+
import {
3+
Absurd,
4+
type AbsurdClient,
5+
type WorkerOptions,
6+
} from "@absurd-sqlite/sdk";
47
import { cac } from "cac";
58

69
import { BunSqliteConnection } from "./sqlite";
710

811
export type { AbsurdClient } from "@absurd-sqlite/sdk";
9-
export type { WorkerOptions } from "absurd-sdk";
12+
export type { WorkerOptions } from "@absurd-sqlite/sdk";
1013

1114
export {
1215
downloadExtension,
@@ -101,12 +104,10 @@ export default async function run(setupFunction: SetupFunction): Promise<void> {
101104
}
102105

103106
const db = new Database(dbPath);
104-
(db as unknown as { loadExtension(path: string): void }).loadExtension(
105-
extensionPath
106-
);
107+
db.loadExtension(extensionPath);
107108

108109
const conn = new BunSqliteConnection(db);
109-
const absurd = new Absurd({ db: conn });
110+
const absurd = new Absurd(conn);
110111

111112
await setupFunction(absurd);
112113

0 commit comments

Comments
 (0)