Skip to content

Fixed tsconfig.json to include "types" field for better type checking…#1048

Open
Edictor96 wants to merge 4 commits into
vicharanashala:mainfrom
Edictor96:main
Open

Fixed tsconfig.json to include "types" field for better type checking…#1048
Edictor96 wants to merge 4 commits into
vicharanashala:mainfrom
Edictor96:main

Conversation

@Edictor96

Copy link
Copy Markdown

This pull request makes a minor update to the TypeScript configuration by adding the ignoreDeprecations option to the tsconfig.json file, which helps suppress deprecation warnings for features deprecated up to TypeScript 6.0.… and editor support.

Edictor96 and others added 3 commits June 22, 2026 15:40
+
+## Summary
+
+This change fixes backend `tsconfig.json` so TypeScript can correctly resolve the
+internal module aliases used across the backend source code and generate portable
+source maps.
+
+## Changes
+
+- Updated `compilerOptions.sourceRoot` from a machine-specific path to `/`.
+  - Before: `D:/vibe/backend/src`
+  - After: `/`
+  - This avoids embedding a developer-specific Windows path in generated source
+    maps and keeps build output portable across machines and environments.
+
+- Added missing path alias for anomalies:
+  - `#anomalies/*` -> `./modules/anomalies/*`
+  - This matches imports that reference the anomalies module through the backend
+    alias system.
+
+- Added missing path alias for GenAI:
+  - `#genAI/*` -> `./modules/genAI/*`
+  - This keeps TypeScript resolution aligned with the backend package import
+    alias for the generated AI module.
+
+- Added the singular setting module alias:
+  - `#setting/*` -> `./modules/setting/*`
+  - The actual source folder is `src/modules/setting`, and backend code/package
+    imports use the singular `#setting` alias.
+
+- Corrected the plural settings alias:
+  - `#settings/*` now points to `./modules/setting/*`
+  - The previous path targeted `./modules/settings/*`, but that folder does not
+    exist. Keeping the plural alias mapped to the real singular folder preserves
+    compatibility for any code still importing `#settings/*`.
+
+## Dependency and alias relationship
+
+The backend uses package-style internal aliases such as `#root`, `#shared`,
+`#courses`, and `#setting` in source imports. TypeScript needs matching
+`compilerOptions.paths` entries so the compiler can resolve those imports during
+type checking and builds.
+
+The relevant dependency relationship is:
+
+- Source imports depend on aliases such as `#setting/*`, `#genAI/*`, and
+  `#anomalies/*`.
+- `tsconfig.json` maps those aliases to real source folders under `src/`.
+- `package.json` maps the same aliases to compiled output under `build/`.
+
+Keeping `tsconfig.json` and `package.json` aligned prevents TypeScript compile
+errors while preserving the runtime import behavior after compilation.
+
+## Express compiler config change
+
+The compiler config includes:
+
+```json
+"types": ["node", "express"]
+```
+
+This explicitly loads Node and Express type declarations into the backend
+compiler context. The Express entry matters because the backend uses Express
+types and middleware-related declarations throughout the server setup. Including
+`express` here makes those ambient/request-response types available during
+compilation, assuming `@types/express` is installed as declared in
+`backend/package.json`.
+
+## Result
+
+The backend TypeScript configuration now reflects the actual source directory
+layout and the aliases used by the backend codebase.
@github-actions github-actions Bot added the docs Improvements or additions to documentation label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant