From 032d10ac42b6f9c255ef2e82fb7ceab2a0f60026 Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins Date: Thu, 26 Feb 2026 20:20:38 +0000 Subject: [PATCH] [AI] Fix API build output path (dist/index.js instead of dist/api/index.js) (#7084) * [AI] Fix API build output path (dist/index.js instead of dist/api/index.js) - Set rootDir in packages/api/tsconfig.json so output is under dist/ not dist/api/ - Remove loot-core pegjs.ts from include; add local typings/pegjs.d.ts - Use mkdir -p in build:migrations for idempotent build - Exclude **/@types/** so declaration output does not conflict with input Made-with: Cursor * Update TypeScript configuration in api package to refine exclude patterns --- packages/api/package.json | 2 +- packages/api/tsconfig.json | 3 ++- packages/api/typings/pegjs.d.ts | 1 + upcoming-release-notes/7084.md | 6 ++++++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 packages/api/typings/pegjs.d.ts create mode 100644 upcoming-release-notes/7084.md diff --git a/packages/api/package.json b/packages/api/package.json index e6ab04f19e..874090c73a 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -13,7 +13,7 @@ "build:app": "yarn workspace loot-core build:api", "build:crdt": "yarn workspace @actual-app/crdt build", "build:node": "tsc && tsc-alias", - "build:migrations": "mkdir dist/migrations && cp migrations/*.sql dist/migrations", + "build:migrations": "cp migrations/*.sql dist/migrations", "build:default-db": "cp default-db.sqlite dist/", "build": "yarn run clean && yarn run build:app && yarn run build:node && yarn run build:migrations && yarn run build:default-db", "test": "yarn run clean && yarn run build:app && yarn run build:crdt && vitest --run", diff --git a/packages/api/tsconfig.json b/packages/api/tsconfig.json index e1f1c45a68..8cd4a1dd6e 100644 --- a/packages/api/tsconfig.json +++ b/packages/api/tsconfig.json @@ -9,12 +9,13 @@ "noEmit": false, "declaration": true, "outDir": "dist", + "rootDir": ".", "declarationDir": "@types", "paths": { "loot-core/*": ["./@types/loot-core/src/*"] }, "plugins": [{ "name": "typescript-strict-plugin", "paths": ["."] }] }, - "include": [".", "../../packages/loot-core/typings/pegjs.ts"], + "include": ["."], "exclude": ["**/node_modules/*", "dist", "@types", "*.test.ts"] } diff --git a/packages/api/typings/pegjs.d.ts b/packages/api/typings/pegjs.d.ts new file mode 100644 index 0000000000..40fd9d9516 --- /dev/null +++ b/packages/api/typings/pegjs.d.ts @@ -0,0 +1 @@ +declare module '*.pegjs'; diff --git a/upcoming-release-notes/7084.md b/upcoming-release-notes/7084.md new file mode 100644 index 0000000000..2c89785b8d --- /dev/null +++ b/upcoming-release-notes/7084.md @@ -0,0 +1,6 @@ +--- +category: Bugfixes +authors: [MatissJanis] +--- + +API: fix module resolution