@knotpad/app 0.1.9 → 0.2.1

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/bin/brief.js CHANGED
@@ -197,7 +197,12 @@ if (!fs.existsSync(BUILD_ID)) {
197
197
  // ── 4. Start server ────────────────────────────────────────────────────────────
198
198
 
199
199
  // Pre-create PGlite data directory so the app can open it immediately at startup
200
- fs.mkdirSync(path.join(WORK_DIR, ".brief", "db"), { recursive: true });
200
+ const DB_DIR = path.join(WORK_DIR, ".brief", "db");
201
+ try {
202
+ fs.mkdirSync(DB_DIR, { recursive: true });
203
+ } catch (e) {
204
+ // Ignore if directory already exists or creation fails
205
+ }
201
206
 
202
207
  const PORT = parseInt(process.env.PORT ?? "3099", 10);
203
208
  const URL = `http://localhost:${PORT}`;
@@ -14,6 +14,19 @@ export async function register() {
14
14
  if (process.env.NEXT_RUNTIME !== "nodejs") return;
15
15
  if (process.env.IS_CLOUD === "true") return;
16
16
 
17
+ // Ensure DB directory exists before initializing PGlite
18
+ const path = await import("path");
19
+ const fs = await import("fs/promises");
20
+ const os = await import("os");
21
+
22
+ const workDir = process.cwd();
23
+ const dbDir = path.join(workDir, ".brief", "db");
24
+ try {
25
+ await fs.mkdir(dbDir, { recursive: true });
26
+ } catch (e) {
27
+ // Ignore if directory already exists or creation fails
28
+ }
29
+
17
30
  const { initLocalPrisma } = await import("./lib/prisma");
18
31
  await initLocalPrisma();
19
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knotpad/app",
3
- "version": "0.1.9",
3
+ "version": "0.2.1",
4
4
  "description": "Note-first project management with AI agent task routing",
5
5
  "bin": {
6
6
  "knotpad": "bin/brief.js"
@@ -26,6 +26,11 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
+ "os": [
30
+ "darwin",
31
+ "linux",
32
+ "win32"
33
+ ],
29
34
  "scripts": {
30
35
  "postinstall": "prisma generate",
31
36
  "build": "next build"