diff --git a/.github/MAINTAINERS.md b/.github/MAINTAINERS.md index 5db11fafd..e42f9f8bb 100644 --- a/.github/MAINTAINERS.md +++ b/.github/MAINTAINERS.md @@ -88,7 +88,7 @@ npm run lint -- --fix **Frontend type errors:** ```bash cd frontend -npx tsc --noEmit +npm run typecheck # Fix the errors shown ``` diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d66edca4b..b7074d23e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -276,9 +276,13 @@ jobs: working-directory: frontend run: npm ci + # `tsc -b`, not `tsc --noEmit`: the root tsconfig only holds project + # references, so plain `tsc` checks zero files. Kept out of `npm run + # build` because every installer runs that on the user's machine, and + # the type check alone needs ~1 GB of Node heap (#3181). - name: Run TypeScript check working-directory: frontend - run: npx tsc --noEmit + run: npm run typecheck frontend-tests: name: Frontend Tests diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6724d777f..f5b248823 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,7 +58,7 @@ repos: files: ^backend/app/ - id: frontend-typecheck name: TypeScript type check - entry: bash -c 'cd frontend && npx tsc --noEmit' + entry: bash -c 'cd frontend && npm run typecheck' language: system pass_filenames: false files: ^frontend/src/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c1e6340a..5519f74f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to Bambuddy will be documented in this file. +## [1.2.5.7] - Unreleased + +### Fixed +- **Installing or updating no longer runs out of memory on 2 GB machines (#3181, reported by @PhilippeP62)** — Every installer and updater builds the frontend with `npm run build`, which also ran the TypeScript type check. That check alone needs about 1 GB of Node memory, the whole default allowance on a 2 GB machine such as the standard Proxmox LXC or a 2 GB Raspberry Pi, so the build crashed with "JavaScript heap out of memory". On the Proxmox helper script that left the install without its database and nobody could sign in; Bambuddy's own update script rolled back but could never finish an update. The build now only bundles the frontend, and the type check runs on its own in development and CI (`npm run typecheck`). That also fixes CI's type-check job and the pre-commit hook, which ran `tsc --noEmit` against a config that lists no files and so had been passing without checking anything. + ## [1.2.5.6] - 2026-09-24 ### Added diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2045e3180..c93895748 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -206,7 +206,7 @@ cd frontend npm run lint # Type check -npx tsc --noEmit +npm run typecheck ``` ### Pre-commit Hooks diff --git a/frontend/package.json b/frontend/package.json index 6481b3ac0..a97f04547 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,7 +5,8 @@ "type": "module", "scripts": { "dev": "vite", - "build": "tsc -b && vite build && npm run check:baseline", + "build": "vite build && npm run check:baseline", + "typecheck": "tsc -b", "lint": "eslint .", "preview": "vite preview", "test": "vitest", diff --git a/test_frontend.sh b/test_frontend.sh index 3a7d85e67..8c5d15305 100755 --- a/test_frontend.sh +++ b/test_frontend.sh @@ -1,7 +1,7 @@ #!/bin/sh cd frontend -npx tsc +npm run typecheck npm run lint npm run test:run cd ..