@fusionkit/plane 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sqlite-store.js +7 -1
- package/package.json +2 -2
package/dist/sqlite-store.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { mkdirSync } from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
import { dirname } from "node:path";
|
|
3
|
-
import { DatabaseSync } from "node:sqlite";
|
|
4
4
|
import { sha256Hex } from "@fusionkit/protocol";
|
|
5
5
|
import { isPrincipalRole } from "./store.js";
|
|
6
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
6
7
|
const DEFAULT_BUSY_TIMEOUT_MS = 5_000;
|
|
7
8
|
export class SqliteStore {
|
|
8
9
|
db;
|
|
9
10
|
constructor(dbPath, options = {}) {
|
|
10
11
|
if (dbPath !== ":memory:")
|
|
11
12
|
mkdirSync(dirname(dbPath), { recursive: true });
|
|
13
|
+
// Lazy-load node:sqlite here (not as a top-level import) so that importing
|
|
14
|
+
// @fusionkit/plane — e.g. from the CLI's command registry — does not emit
|
|
15
|
+
// node:sqlite's ExperimentalWarning at startup for commands that never open a
|
|
16
|
+
// database. Documented exception to the no-inline-imports rule.
|
|
17
|
+
const { DatabaseSync } = nodeRequire("node:sqlite");
|
|
12
18
|
this.db = new DatabaseSync(dbPath);
|
|
13
19
|
this.db.exec(`PRAGMA journal_mode = ${options.journalMode ?? "WAL"}`);
|
|
14
20
|
this.db.exec("PRAGMA foreign_keys = ON");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusionkit/plane",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/velum-labs/handoffkit.git",
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"jose": "6.2.3",
|
|
30
30
|
"pino": "10.3.1",
|
|
31
31
|
"zod": "4.4.3",
|
|
32
|
-
"@fusionkit/protocol": "0.1.
|
|
32
|
+
"@fusionkit/protocol": "0.1.2"
|
|
33
33
|
}
|
|
34
34
|
}
|