diff options
| author | MohamedBassem <me@mbassem.com> | 2025-07-27 14:54:29 +0100 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2025-07-27 15:06:22 +0100 |
| commit | 77ae89b22238429cbbbb7851ece2826c91d4e21f (patch) | |
| tree | 92008321bc960b9e5b202d410d8a25c808dd2ffc | |
| parent | 8f1cb065d77c55dfb2e4d0df08a17160e7a8bc3f (diff) | |
| download | karakeep-77ae89b22238429cbbbb7851ece2826c91d4e21f.tar.zst | |
chore: More turbo fixes
28 files changed, 107 insertions, 57 deletions
diff --git a/.husky/pre-commit b/.husky/pre-commit index eb3cb0a2..6c02e59f 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,3 @@ -pnpm typecheck -pnpm format --check -pnpm lint +pnpm preflight pnpm exec sherif pnpm run --filter @karakeep/open-api check diff --git a/apps/browser-extension/package.json b/apps/browser-extension/package.json index 92bd3856..62a0f49e 100644 --- a/apps/browser-extension/package.json +++ b/apps/browser-extension/package.json @@ -1,13 +1,13 @@ { - "name": "browser-extension", + "name": "@karakeep/browser-extension", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "tsc && vite build", - "format": "prettier .", - "format:fix": "prettier . --write", + "format": "prettier . --cache --check", + "format:fix": "prettier . --cache --write", "lint": "oxlint .", "lint:fix": "oxlint . --fix", "preview": "vite preview", diff --git a/apps/browser-extension/tsconfig.json b/apps/browser-extension/tsconfig.json index ddc2d870..df1a9844 100644 --- a/apps/browser-extension/tsconfig.json +++ b/apps/browser-extension/tsconfig.json @@ -18,7 +18,8 @@ "strict": true, "noUnusedLocals": false, "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true + "noFallthroughCasesInSwitch": true, + "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, "include": ["src", "vite.config.ts"], "exclude": ["node_modules"] diff --git a/apps/cli/package.json b/apps/cli/package.json index f7aeeaa8..9edbec09 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -36,8 +36,8 @@ "run": "tsx src/index.ts", "lint": "oxlint .", "lint:fix": "oxlint . --fix", - "format": "prettier . --ignore-path ../../.prettierignore", - "format:fix": "prettier . --write --ignore-path ../../.prettierignore", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", "typecheck": "tsc --noEmit" }, "repository": { diff --git a/apps/landing/package.json b/apps/landing/package.json index 2ffa198b..3343a542 100644 --- a/apps/landing/package.json +++ b/apps/landing/package.json @@ -10,8 +10,8 @@ "preview": "vite preview", "lint": "oxlint .", "lint:fix": "oxlint . --fix", - "format": "prettier . --ignore-path ../../.prettierignore", - "format:fix": "prettier . --ignore-path ../../.prettierignore --write", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --ignore-path ../../.prettierignore --write", "typecheck": "tsc --noEmit" }, "dependencies": { diff --git a/apps/landing/tsconfig.json b/apps/landing/tsconfig.json index 0fb0017a..10775d56 100644 --- a/apps/landing/tsconfig.json +++ b/apps/landing/tsconfig.json @@ -5,7 +5,8 @@ "baseUrl": ".", "paths": { "@/*": ["./*"] - } + }, + "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "vite.config.ts"], "exclude": ["node_modules"] diff --git a/apps/mcp/package.json b/apps/mcp/package.json index 9eaa2feb..9e34146b 100644 --- a/apps/mcp/package.json +++ b/apps/mcp/package.json @@ -27,8 +27,8 @@ "run": "tsx src/index.ts", "lint": "oxlint .", "lint:fix": "oxlint . --fix", - "format": "prettier . --ignore-path ../../.prettierignore", - "format:fix": "prettier . --write --ignore-path ../../.prettierignore", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", "typecheck": "tsc --noEmit" }, "repository": { diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 3713202f..f66a64c4 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -9,8 +9,8 @@ "android": "expo run:android", "ios": "expo run:ios", "web": "expo start --web", - "format": "prettier .", - "format:fix": "prettier . --write", + "format": "prettier . --cache --check", + "format:fix": "prettier . --cache --write", "lint": "oxlint .", "lint:fix": "oxlint . --fix", "typecheck": "tsc --noEmit" diff --git a/apps/web/package.json b/apps/web/package.json index b5fb1a50..3721d3b2 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -13,8 +13,8 @@ "lint:fix": "oxlint . --fix", "test": "vitest", "typecheck": "tsc --noEmit", - "format": "prettier --check . --ignore-path ../../.gitignore", - "format:fix": "prettier --write . --ignore-path ../../.gitignore" + "format": "prettier --cache --check . --ignore-path ../../.gitignore", + "format:fix": "prettier --cache --write . --ignore-path ../../.gitignore" }, "dependencies": { "@auth/drizzle-adapter": "~1.5.0", diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index fb5492e4..308aeaad 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -10,7 +10,8 @@ ], "paths": { "@/*": ["./*"] - } + }, + "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules", ".next"] diff --git a/apps/workers/package.json b/apps/workers/package.json index 1b047950..aa30878a 100644 --- a/apps/workers/package.json +++ b/apps/workers/package.json @@ -61,8 +61,8 @@ "build:watch": "tsdown --watch", "lint": "oxlint .", "lint:fix": "oxlint . --fix", - "format": "prettier . --ignore-path ../../.prettierignore", - "format:fix": "prettier . --ignore-path ../../.prettierignore --write", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --ignore-path ../../.prettierignore --write", "typecheck": "tsc --noEmit" }, "prettier": "@karakeep/prettier-config" diff --git a/package.json b/package.json index 91c504e5..85054f55 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,13 @@ "workers": "pnpm --filter @karakeep/workers run start", "web": "pnpm --filter @karakeep/web run dev", "prepare": "husky", - "format": "turbo --no-daemon format --continue -- --cache-location node_modules/.cache/.prettiercache", - "format:fix": "turbo --no-daemon format --continue -- --write --cache-location node_modules/.cache/.prettiercache", - "lint": "turbo --no-daemon lint --continue --", - "lint:fix": "turbo --no-daemon lint --continue -- --fix", - "typecheck": "turbo --no-daemon typecheck" + "format": "turbo --no-daemon format --continue", + "format:fix": "turbo --no-daemon format:fix --continue", + "lint": "turbo --no-daemon lint --continue", + "lint:fix": "turbo --no-daemon lint:fix --continue", + "typecheck": "turbo --no-daemon typecheck", + "preflight": "turbo run --no-daemon typecheck lint format", + "preflight:fix": "turbo run --no-daemon typecheck lint:fix format:fix" }, "dependencies": { "husky": "^9.0.11" diff --git a/packages/api/package.json b/packages/api/package.json index a9c26ea7..63e96e74 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -6,8 +6,8 @@ "type": "module", "scripts": { "typecheck": "tsc --noEmit", - "format": "prettier . --ignore-path ../../.prettierignore", - "format:fix": "prettier . --write --ignore-path ../../.prettierignore", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", "lint": "oxlint .", "lint:fix": "oxlint . --fix", "test": "vitest" diff --git a/packages/db/drizzle.config.ts b/packages/db/drizzle.config.ts index f7e57e83..108a07f6 100644 --- a/packages/db/drizzle.config.ts +++ b/packages/db/drizzle.config.ts @@ -1,5 +1,7 @@ import "dotenv/config"; + import type { Config } from "drizzle-kit"; + import serverConfig from "@karakeep/shared/config"; const databaseURL = serverConfig.dataDir diff --git a/packages/db/drizzle.ts b/packages/db/drizzle.ts index d436b3c6..42078b1b 100644 --- a/packages/db/drizzle.ts +++ b/packages/db/drizzle.ts @@ -1,24 +1,26 @@ import "dotenv/config"; -import { drizzle } from "drizzle-orm/better-sqlite3"; + +import path from "path"; import Database from "better-sqlite3"; -import * as schema from "./schema"; +import { drizzle } from "drizzle-orm/better-sqlite3"; import { migrate } from "drizzle-orm/better-sqlite3/migrator"; -import path from "path"; + import serverConfig from "@karakeep/shared/config"; import dbConfig from "./drizzle.config"; +import * as schema from "./schema"; const sqlite = new Database(dbConfig.dbCredentials.url); if (serverConfig.database.walMode) { - sqlite.pragma('journal_mode = WAL'); - sqlite.pragma('synchronous = NORMAL'); + sqlite.pragma("journal_mode = WAL"); + sqlite.pragma("synchronous = NORMAL"); } else { - sqlite.pragma('journal_mode = DELETE'); + sqlite.pragma("journal_mode = DELETE"); } -sqlite.pragma('cache_size = -65536'); -sqlite.pragma('foreign_keys = ON'); -sqlite.pragma('temp_store = MEMORY'); +sqlite.pragma("cache_size = -65536"); +sqlite.pragma("foreign_keys = ON"); +sqlite.pragma("temp_store = MEMORY"); export const db = drizzle(sqlite, { schema }); export type DB = typeof db; diff --git a/packages/db/migrate.ts b/packages/db/migrate.ts index 62cb4128..69b4ae80 100644 --- a/packages/db/migrate.ts +++ b/packages/db/migrate.ts @@ -1,4 +1,5 @@ -import { db } from "./drizzle"; import { migrate } from "drizzle-orm/better-sqlite3/migrator"; +import { db } from "./drizzle"; + migrate(db, { migrationsFolder: "./drizzle" }); diff --git a/packages/db/package.json b/packages/db/package.json index ce05e305..9385bc43 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -9,7 +9,11 @@ "typecheck": "tsc --noEmit", "migrate": "tsx migrate.ts", "generate": "drizzle-kit generate", - "studio": "drizzle-kit studio" + "studio": "drizzle-kit studio", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", + "lint": "oxlint .", + "lint:fix": "oxlint . --fix" }, "dependencies": { "@auth/core": "^0.27.0", diff --git a/packages/db/schema.ts b/packages/db/schema.ts index 2d2ea1f6..fbd68133 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -40,7 +40,9 @@ export const users = sqliteTable("user", { role: text("role", { enum: ["admin", "user"] }).default("user"), bookmarkQuota: integer("bookmarkQuota"), storageQuota: integer("storageQuota"), - browserCrawlingEnabled: integer("browserCrawlingEnabled", { mode: "boolean" }), + browserCrawlingEnabled: integer("browserCrawlingEnabled", { + mode: "boolean", + }), }); export const accounts = sqliteTable( diff --git a/packages/e2e_tests/package.json b/packages/e2e_tests/package.json index d0a61cd9..7532f5b0 100644 --- a/packages/e2e_tests/package.json +++ b/packages/e2e_tests/package.json @@ -6,8 +6,8 @@ "type": "module", "scripts": { "typecheck": "tsc --noEmit", - "format": "prettier . --ignore-path ../../.prettierignore", - "format:fix": "prettier . --write --ignore-path ../../.prettierignore", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", "lint": "oxlint .", "lint:fix": "oxlint . --fix", "test": "vitest run", diff --git a/packages/open-api/package.json b/packages/open-api/package.json index 5897b9e0..f122b13e 100644 --- a/packages/open-api/package.json +++ b/packages/open-api/package.json @@ -18,8 +18,8 @@ "typecheck": "tsc --noEmit", "check": "tsx index.ts check", "generate": "tsx index.ts", - "format": "prettier . --ignore-path ../../.prettierignore", - "format:fix": "prettier . --write --ignore-path ../../.prettierignore", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", "lint": "oxlint .", "lint:fix": "oxlint . --fix" }, diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 9b9c42be..9862ff50 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -31,8 +31,8 @@ "run": "tsx src/index.ts", "lint": "oxlint .", "lint:fix": "oxlint . --fix", - "format": "prettier . --ignore-path ../../.prettierignore", - "format:fix": "prettier . --write --ignore-path ../../.prettierignore", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", "typecheck": "tsc --noEmit" }, "repository": { diff --git a/packages/shared-react/package.json b/packages/shared-react/package.json index bd2c71b6..7b3df535 100644 --- a/packages/shared-react/package.json +++ b/packages/shared-react/package.json @@ -26,8 +26,10 @@ }, "scripts": { "typecheck": "tsc --noEmit", - "format": "prettier . --ignore-path ../../.prettierignore", - "lint": "oxlint ." + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", + "lint": "oxlint .", + "lint:fix": "oxlint . --fix" }, "prettier": "@karakeep/prettier-config" } diff --git a/packages/shared/package.json b/packages/shared/package.json index f2b91c06..70859911 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -29,8 +29,8 @@ }, "scripts": { "typecheck": "tsc --noEmit", - "format": "prettier . --ignore-path ../../.prettierignore", - "format:fix": "prettier . --write --ignore-path ../../.prettierignore", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", "lint": "oxlint .", "lint:fix": "oxlint . --fix", "test": "vitest" diff --git a/packages/trpc/package.json b/packages/trpc/package.json index 15bf925d..8054e7c5 100644 --- a/packages/trpc/package.json +++ b/packages/trpc/package.json @@ -6,8 +6,8 @@ "type": "module", "scripts": { "typecheck": "tsc --noEmit", - "format": "prettier . --ignore-path ../../.prettierignore", - "format:fix": "prettier . --write --ignore-path ../../.prettierignore", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", "lint": "oxlint .", "lint:fix": "oxlint . --fix", "test": "vitest" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4e6e2eb2..550025ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -960,9 +960,18 @@ importers: '@karakeep/trpc': specifier: workspace:* version: link:../trpc + '@trpc/server': + specifier: ^11.4.3 + version: 11.4.3(typescript@5.8.3) + drizzle-orm: + specifier: ^0.44.2 + version: 0.44.2(@opentelemetry/api@1.9.0)(@types/better-sqlite3@7.6.13)(better-sqlite3@11.3.0)(gel@2.1.0) hono: specifier: ^4.7.10 version: 4.7.11 + prom-client: + specifier: ^15.1.3 + version: 15.1.3 rss: specifier: ^1.2.2 version: 1.2.2 @@ -1046,9 +1055,15 @@ importers: '@karakeep/trpc': specifier: workspace:^0.1.0 version: link:../trpc + '@trpc/client': + specifier: ^11.4.3 + version: 11.4.3(@trpc/server@11.4.3(typescript@5.8.3))(typescript@5.8.3) superjson: specifier: ^2.2.1 version: 2.2.1 + zod: + specifier: ^3.24.2 + version: 3.24.2 devDependencies: '@karakeep/prettier-config': specifier: workspace:^0.1.0 @@ -1167,6 +1182,9 @@ importers: '@types/nodemailer': specifier: ^6.4.17 version: 6.4.17 + vite-tsconfig-paths: + specifier: ^4.3.1 + version: 4.3.2(typescript@5.8.3)(vite@7.0.6(@types/node@22.15.30)(jiti@2.4.2)(lightningcss@1.30.1)(sass@1.89.1)(terser@5.41.0)(tsx@4.20.3)(yaml@2.8.0)) vitest: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.12)(@types/node@22.15.30)(happy-dom@17.4.9)(jiti@2.4.2)(jsdom@26.1.0)(lightningcss@1.30.1)(sass@1.89.1)(terser@5.41.0)(tsx@4.20.3)(yaml@2.8.0) @@ -1222,6 +1240,9 @@ importers: drizzle-orm: specifier: ^0.44.2 version: 0.44.2(@opentelemetry/api@1.9.0)(@types/better-sqlite3@7.6.13)(better-sqlite3@11.3.0)(gel@2.1.0) + liteque: + specifier: ^0.5.0 + version: 0.5.0(@opentelemetry/api@1.9.0)(@types/better-sqlite3@7.6.13)(@types/react@19.1.8)(better-sqlite3@11.3.0)(react@18.3.1) nodemailer: specifier: ^7.0.4 version: 7.0.4 diff --git a/tooling/prettier/package.json b/tooling/prettier/package.json index f3332e50..2ce8e7bd 100644 --- a/tooling/prettier/package.json +++ b/tooling/prettier/package.json @@ -8,7 +8,8 @@ }, "scripts": { "clean": "rm -rf .turbo node_modules", - "format": "prettier --check . --ignore-path ../../.gitignore", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", "typecheck": "tsc --noEmit" }, "dependencies": { diff --git a/tooling/tailwind/package.json b/tooling/tailwind/package.json index 91a8c342..6f92c214 100644 --- a/tooling/tailwind/package.json +++ b/tooling/tailwind/package.json @@ -11,8 +11,8 @@ "license": "MIT", "scripts": { "clean": "rm -rf .turbo node_modules", - "format": "prettier .", - "format:fix": "prettier . --write", + "format": "prettier . --cache --ignore-path ../../.prettierignore --check", + "format:fix": "prettier . --cache --write --ignore-path ../../.prettierignore", "lint": "oxlint .", "lint:fix": "oxlint . --fix", "typecheck": "tsc --noEmit" @@ -19,7 +19,8 @@ "next-env.d.ts", ".expo/**", ".output/**", - ".vercel/output/**" + ".vercel/output/**", + "dist/**" ] }, "dev": { @@ -28,7 +29,13 @@ }, "format": { "outputs": [ - "node_modules/.cache/.prettiercache" + "node_modules/.cache/prettier/.prettier-cache" + ], + "outputLogs": "new-only" + }, + "format:fix": { + "outputs": [ + "node_modules/.cache/prettier/.prettier-cache" ], "outputLogs": "new-only" }, @@ -37,6 +44,11 @@ "^topo" ] }, + "lint:fix": { + "dependsOn": [ + "^topo" + ] + }, "typecheck": { "dependsOn": [ "^topo" |
