chore: dividir typecheck en core y web, con tsconfig.core.json y scripts

Co-authored-by: aider (openrouter/openai/gpt-5) <aider@aider.chat>
main
brobert 1 month ago
parent 11b599bb38
commit c3095153ca

@ -96,7 +96,7 @@ async function openDb(filename: string = 'tasks.db'): Promise<any> {
} else {
// En SSR Node: aplicar migraciones directamente con compat para .query
try {
const mod = await import('../../../../../src/db/migrations/index.ts');
const mod = await import('../../../../../src/db/migrations/index');
const list = (mod as any).migrations as any[];
const compat: any = instance;
if (typeof compat.query !== 'function') {

@ -8,7 +8,7 @@ export default defineConfig(({ mode }) => {
plugins: [sveltekit()],
resolve: {
// En desarrollo, alias para usar better-sqlite3 (Vite/HMR no entiende 'bun:sqlite')
alias: isDev ? { 'bun:sqlite': 'better-sqlite3' } : {}
alias: isDev ? [{ find: 'bun:sqlite', replacement: 'better-sqlite3' }] : []
},
ssr: {
// En dev, externalizar better-sqlite3 (CJS nativo) para que se cargue vía require;

@ -3,6 +3,10 @@
"module": "index.ts",
"type": "module",
"private": true,
"scripts": {
"typecheck:web": "cd apps/web && bunx svelte-kit sync && bunx tsc --noEmit --pretty false",
"typecheck:core": "bunx tsc -p tsconfig.core.json --noEmit --pretty false"
},
"devDependencies": {
"@types/bun": "latest",
"bun-types": "^1.2.6"
@ -10,4 +14,4 @@
"peerDependencies": {
"typescript": "^5"
}
}
}

@ -0,0 +1,16 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"types": ["bun-types"],
"lib": ["esnext"]
},
"include": [
"src/**/*.ts",
"proxy.ts"
],
"exclude": [
"apps/web/**",
"tests/**",
"node_modules/**"
]
}
Loading…
Cancel
Save