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 2 months ago
parent 11b599bb38
commit c3095153ca

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

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

@ -3,6 +3,10 @@
"module": "index.ts", "module": "index.ts",
"type": "module", "type": "module",
"private": true, "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": { "devDependencies": {
"@types/bun": "latest", "@types/bun": "latest",
"bun-types": "^1.2.6" "bun-types": "^1.2.6"

@ -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