Use TypeScript project references for incremental builds (#7180)

* [AI] Fix duplicate typechecking by consolidating into lage

Previously `yarn typecheck` ran:
1. `tsc -b` (type-checks all packages via project references)
2. `tsc -p tsconfig.root.json --noEmit` (checks root bin/*.ts)
3. `lage typecheck` (runs `tsc --noEmit` per package - duplicate!)

Now it runs:
1. `tsc -p tsconfig.root.json --noEmit` (checks root bin/*.ts)
2. `lage typecheck` (handles everything via dependency ordering)

Changes:
- Remove `tsc -b` from root typecheck script
- Add `dependsOn: ["^typecheck"]` to lage config for correct ordering
- Change per-package typecheck from `tsc --noEmit` to `tsc -b` so
  declarations are emitted for dependent packages

https://claude.ai/code/session_01P7mtAHphD6f1FsnQRwWBaW

* Add release notes for PR #7180

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Matiss Janis Aboltins
2026-03-12 21:54:29 +00:00
committed by GitHub
parent 6b996c11d8
commit e968213977
11 changed files with 16 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ module.exports = {
pipeline: { pipeline: {
typecheck: { typecheck: {
type: 'npmScript', type: 'npmScript',
dependsOn: ['^typecheck'],
}, },
test: { test: {
type: 'npmScript', type: 'npmScript',

View File

@@ -57,7 +57,7 @@
"lint": "oxfmt --check . && oxlint --type-aware --quiet", "lint": "oxfmt --check . && oxlint --type-aware --quiet",
"lint:fix": "oxfmt . && oxlint --fix --type-aware --quiet", "lint:fix": "oxfmt . && oxlint --fix --type-aware --quiet",
"install:server": "yarn workspaces focus @actual-app/sync-server --production", "install:server": "yarn workspaces focus @actual-app/sync-server --production",
"typecheck": "tsc -b && tsc -p tsconfig.root.json --noEmit && lage typecheck", "typecheck": "tsc -p tsconfig.root.json --noEmit && lage typecheck",
"jq": "./node_modules/node-jq/bin/jq", "jq": "./node_modules/node-jq/bin/jq",
"prepare": "husky" "prepare": "husky"
}, },

View File

@@ -12,7 +12,7 @@
"scripts": { "scripts": {
"build": "yarn workspace loot-core exec tsc && vite build && node scripts/inline-loot-core-types.mjs", "build": "yarn workspace loot-core exec tsc && vite build && node scripts/inline-loot-core-types.mjs",
"test": "vitest --run", "test": "vitest --run",
"typecheck": "tsc --noEmit && tsc-strict" "typecheck": "tsc -b && tsc-strict"
}, },
"dependencies": { "dependencies": {
"@actual-app/crdt": "workspace:^", "@actual-app/crdt": "workspace:^",

View File

@@ -40,7 +40,7 @@
"test:web": "ENV=web vitest --run -c vitest.web.config.ts", "test:web": "ENV=web vitest --run -c vitest.web.config.ts",
"start:storybook": "storybook dev -p 6006", "start:storybook": "storybook dev -p 6006",
"build:storybook": "storybook build", "build:storybook": "storybook build",
"typecheck": "tsc --noEmit" "typecheck": "tsc -b"
}, },
"dependencies": { "dependencies": {
"@emotion/css": "^11.13.5", "@emotion/css": "^11.13.5",

View File

@@ -13,7 +13,7 @@
"proto:generate": "./bin/generate-proto", "proto:generate": "./bin/generate-proto",
"build": "rm -rf dist && yarn run build:node", "build": "rm -rf dist && yarn run build:node",
"test": "vitest --run", "test": "vitest --run",
"typecheck": "tsc --noEmit" "typecheck": "tsc -b"
}, },
"dependencies": { "dependencies": {
"google-protobuf": "^3.21.4", "google-protobuf": "^3.21.4",

View File

@@ -16,7 +16,7 @@
"e2e": "npx playwright test --browser=chromium", "e2e": "npx playwright test --browser=chromium",
"vrt": "cross-env VRT=true npx playwright test --browser=chromium", "vrt": "cross-env VRT=true npx playwright test --browser=chromium",
"playwright": "playwright", "playwright": "playwright",
"typecheck": "tsc --noEmit && tsc-strict" "typecheck": "tsc -b && tsc-strict"
}, },
"devDependencies": { "devDependencies": {
"@actual-app/components": "workspace:*", "@actual-app/components": "workspace:*",

View File

@@ -9,7 +9,7 @@
"update-client": "bin/update-client", "update-client": "bin/update-client",
"build": "yarn build:dist && electron-builder", "build": "yarn build:dist && electron-builder",
"build:dist": "tsc && yarn copy-static-assets", "build:dist": "tsc && yarn copy-static-assets",
"typecheck": "tsc --noEmit && tsc-strict", "typecheck": "tsc -b && tsc-strict",
"copy-static-assets": "copyfiles --exclude 'build/**/*' **/*.html icons/**/* build/desktop-electron", "copy-static-assets": "copyfiles --exclude 'build/**/*' **/*.html icons/**/* build/desktop-electron",
"watch": "yarn build:dist && cross-env ACTUAL_DOCUMENT_DIR=\"../../data\" ACTUAL_DATA_DIR=\"../../data\" electron .", "watch": "yarn build:dist && cross-env ACTUAL_DOCUMENT_DIR=\"../../data\" ACTUAL_DATA_DIR=\"../../data\" electron .",
"e2e": "npx playwright test" "e2e": "npx playwright test"

View File

@@ -61,7 +61,7 @@
"test": "npm-run-all -cp 'test:*'", "test": "npm-run-all -cp 'test:*'",
"test:node": "ENV=node vitest --run", "test:node": "ENV=node vitest --run",
"test:web": "ENV=web vitest --run -c vitest.web.config.ts", "test:web": "ENV=web vitest --run -c vitest.web.config.ts",
"typecheck": "tsc --noEmit && tsc-strict" "typecheck": "tsc -b && tsc-strict"
}, },
"dependencies": { "dependencies": {
"@jlongster/sql.js": "^1.6.7", "@jlongster/sql.js": "^1.6.7",

View File

@@ -9,7 +9,7 @@
"build": "cross-env NODE_ENV=production ./bin/build-service-worker", "build": "cross-env NODE_ENV=production ./bin/build-service-worker",
"build-dev": "cross-env NODE_ENV=development ./bin/build-service-worker", "build-dev": "cross-env NODE_ENV=development ./bin/build-service-worker",
"watch": "cross-env NODE_ENV=development ./bin/build-service-worker --watch", "watch": "cross-env NODE_ENV=development ./bin/build-service-worker --watch",
"typecheck": "tsc --noEmit && tsc-strict" "typecheck": "tsc -b && tsc-strict"
}, },
"dependencies": { "dependencies": {
"workbox-precaching": "^7.4.0" "workbox-precaching": "^7.4.0"

View File

@@ -16,7 +16,7 @@
"start": "yarn build && node build/app", "start": "yarn build && node build/app",
"start-monitor": "nodemon --exec 'yarn build && node build/app' --ignore './build/**/*' --ext 'ts,js' build/app", "start-monitor": "nodemon --exec 'yarn build && node build/app' --ignore './build/**/*' --ext 'ts,js' build/app",
"build": "tsc && yarn add-import-extensions && yarn copy-static-assets", "build": "tsc && yarn add-import-extensions && yarn copy-static-assets",
"typecheck": "tsc --noEmit && tsc-strict", "typecheck": "tsc -b && tsc-strict",
"add-import-extensions": "node bin/add-import-extensions.mjs", "add-import-extensions": "node bin/add-import-extensions.mjs",
"copy-static-assets": "rm -rf build/src/sql && cp -r src/sql build/src/sql", "copy-static-assets": "rm -rf build/src/sql && cp -r src/sql build/src/sql",
"test": "NODE_ENV=test NODE_OPTIONS='--experimental-vm-modules --import ./register-loader.mjs --trace-warnings' vitest --run", "test": "NODE_ENV=test NODE_OPTIONS='--experimental-vm-modules --import ./register-loader.mjs --trace-warnings' vitest --run",

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MatissJanis]
---
Refactor TypeScript build process to use project references for improved incremental builds.