mirror of
https://github.com/civitai/civitai.git
synced 2026-09-20 22:08:18 +08:00
5cc887c97c
Convert the civitai-* base packages from eager singletons into app-agnostic factories with their own zod env schemas, and wire them into the main app via thin shims. Packages now import only external deps (+ @civitai/db-schema); the app injects behavior (loggers, Flipt resolver, slow-query sink) and owns HMR globals + the Next build guard. - Phase 0: pnpm-workspace.yaml, per-package package.json + index barrels, @civitai/* tsconfig paths, transpilePackages - axiom/redis/db/clickhouse: createX() factories reading package-owned env.ts (z.prettifyError); Partial<Config> overrides - db: createPrismaClients + config-driven getClient pool factory; kv-helpers.ts breaks the client<->db-helpers cycle; limitConcurrency vendored; pg singletons -> app shims - clickhouse: base client stays; Tracker (auth/session/schema-coupled) extracted to src/server/clickhouse/tracker.ts - telemetry: prom helpers stay; DB pool-gauge block -> src/server/prom/client.ts - prisma generate paths updated for the db-schema package; generated slim schema gitignored Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
64 lines
1.9 KiB
JSON
64 lines
1.9 KiB
JSON
{
|
|
"compilerOptions": {
|
|
"target": "ES2018",
|
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
// "types": ["offscreencanvas"],
|
|
"allowJs": true,
|
|
"skipLibCheck": true,
|
|
"strict": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"noEmit": true,
|
|
"esModuleInterop": true,
|
|
"allowSyntheticDefaultImports": true,
|
|
"module": "esnext",
|
|
"moduleResolution": "bundler",
|
|
"resolveJsonModule": true,
|
|
"isolatedModules": true,
|
|
"jsx": "preserve",
|
|
"incremental": true,
|
|
"noUncheckedIndexedAccess": false, // TODO swap to true
|
|
"baseUrl": "src",
|
|
"paths": {
|
|
"~/*": ["./*"],
|
|
"@civitai/db-schema": ["../packages/civitai-db-schema/src/index"],
|
|
"@civitai/db-schema/*": ["../packages/civitai-db-schema/src/*"],
|
|
"@civitai/db": ["../packages/civitai-db/src/index"],
|
|
"@civitai/db/*": ["../packages/civitai-db/src/*"],
|
|
"@civitai/redis": ["../packages/civitai-redis/src/index"],
|
|
"@civitai/redis/*": ["../packages/civitai-redis/src/*"],
|
|
"@civitai/clickhouse": ["../packages/civitai-clickhouse/src/index"],
|
|
"@civitai/clickhouse/*": ["../packages/civitai-clickhouse/src/*"],
|
|
"@civitai/axiom": ["../packages/civitai-axiom/src/index"],
|
|
"@civitai/axiom/*": ["../packages/civitai-axiom/src/*"],
|
|
"@civitai/telemetry": ["../packages/civitai-telemetry/src/index"],
|
|
"@civitai/telemetry/*": ["../packages/civitai-telemetry/src/*"]
|
|
},
|
|
"noErrorTruncation": true,
|
|
"plugins": [
|
|
{
|
|
"name": "next"
|
|
}
|
|
]
|
|
},
|
|
"include": [
|
|
// "next-env.d.ts",
|
|
// "**/*.ts",
|
|
// "**/*.tsx",
|
|
// "**/*.cjs",
|
|
// "**/*.mjs",
|
|
"scripts/local-dev/*.ts",
|
|
"src",
|
|
"packages/*/src",
|
|
"tests",
|
|
".next/types/**/*.ts"
|
|
],
|
|
"exclude": [
|
|
"node_modules",
|
|
"./node_modules",
|
|
"./node_modules/*",
|
|
"src/pages/api/dev-local/*.ts",
|
|
"scripts/local-dev/*.ts",
|
|
"src/**/__tests__/**"
|
|
]
|
|
}
|