Skip to content

chore(deps): upgrade TypeScript from 5.9 to 6.0#667

Merged
carlos-alm merged 1 commit intomainfrom
chore/typescript-6
Mar 28, 2026
Merged

chore(deps): upgrade TypeScript from 5.9 to 6.0#667
carlos-alm merged 1 commit intomainfrom
chore/typescript-6

Conversation

@carlos-alm
Copy link
Copy Markdown
Contributor

Summary

  • Upgrade typescript devDependency from ^5.9.3 to ^6.0.2
  • Remove unused baseUrl and paths from tsconfig.json — zero imports in the codebase reference path aliases (all 849+ imports use relative paths with .js extensions), so these were dead config
  • This fixes the TS5101 error (baseUrl deprecated in TS 6.x) that blocked Dependabot PR chore(deps-dev): bump typescript from 5.9.3 to 6.0.2 #663

Test plan

  • npx tsc --noEmit passes with zero errors
  • npm run build produces dist/ successfully
  • npm run lint passes (no new warnings)
  • npm test — 2129/2129 tests pass
  • npx codegraph --help works
  • CI passes on this PR

Closes #663

Remove unused baseUrl and paths from tsconfig.json (zero imports
reference them) which TS 6.x deprecates (TS5101). Bump typescript
devDependency to ^6.0.2.
@claude
Copy link
Copy Markdown

claude bot commented Mar 28, 2026

Claude finished @carlos-alm's task —— View job


TypeScript 6.0 Upgrade Review

Root Cause Analysis

Problem Being Solved: Fixing TS5101 error where baseUrl is deprecated in TypeScript 6.x, blocking Dependabot PR #663

Why This Approach: The PR removes baseUrl and paths from tsconfig.json, claiming they were unused. However, investigation shows the codebase has 300+ relative imports using ../../ patterns across 129 files, indicating the path aliases were configured but never adopted.

Risk Assessment: Low risk. While the path aliases could improve code maintainability, their removal doesn't break functionality since the codebase already uses relative imports throughout.

Backlog Compliance

  • Zero-dep: ✓ — No new runtime dependencies added
  • Foundation-aligned: ✓ — Maintains local-first TypeScript toolchain, no cloud dependencies
  • Problem-fit: 3/5 — Enables dependency updates but doesn't directly address AI navigation issues
  • Breaking: No — Purely internal TypeScript configuration change
  • Tier: 1 (zero-dep ✓ + foundation-aligned ✓)

Critical Concerns

Missing Opportunity for Code Quality

The removed path aliases (#shared/*, #infrastructure/*, etc.) would significantly improve code readability by replacing 300+ instances of ../../ imports. Examples from the codebase:

// Current: src/cli/commands/audit.ts:1-4
import { collectFile } from '../../db/query-builder.js';
import { EVERY_SYMBOL_KIND } from '../../domain/queries.js';
import { audit } from '../../presentation/audit.js';
import { explain } from '../../presentation/queries-cli.js';

// Could be (with path aliases):
import { collectFile } from '#db/query-builder.js';
import { EVERY_SYMBOL_KIND } from '#domain/queries.js';
import { audit } from '#presentation/audit.js';
import { explain } from '#presentation/queries-cli.js';

Alternative Solutions

Instead of removing the aliases entirely, consider:

  1. Update for TS 6.x compatibility: Replace deprecated baseUrl with modern paths configuration
  2. Gradual migration: Keep aliases and migrate imports over time
  3. Current approach: Accept the missed opportunity for cleaner imports

Final Recommendation

  • Rating: ⭐⭐⭐☆☆ (3/5)
  • Action: APPROVE WITH CONDITIONS
  • Reasoning:
    • ✅ Solves the immediate TS5101 blocking issue
    • ✅ No functional regressions or test changes
    • ✅ Maintains strict TypeScript configuration
    • ⚠️ Missed opportunity to improve 300+ import statements
    • ⚠️ Could have modernized config instead of removing features

Conditions for approval:

  1. Consider filing a follow-up issue to restore path aliases with TS 6.x-compatible configuration
  2. The 300+ relative imports represent technical debt that path aliases could address

The PR successfully unblocks TypeScript 6.0 adoption without breaking changes, making it acceptable despite the missed modernization opportunity.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 28, 2026

Greptile Summary

This PR upgrades TypeScript from 5.9.3 to 6.0.2 and removes the now-deprecated baseUrl/paths config from tsconfig.json, resolving the TS5101 error that blocked the Dependabot PR.

  • TypeScript bump (package.json, package-lock.json): Straightforward devDependency upgrade to ^6.0.2. The lockfile reflects the new resolved version (6.0.2) and no runtime dependency changes were introduced.
  • tsconfig.json cleanup: baseUrl: \"./src\" and all nine paths aliases (#shared/*, #infrastructure/*, #db/*, etc.) are removed. Verified correct — a full grep of src/ for every alias prefix returned zero actual import statements (all 44 hits were JavaScript private class fields this.#db and a CSS selector #graph, not TypeScript path-alias imports).
  • Lockfile correction (package-lock.json): @modelcontextprotocol/sdk was removed from the root package's dependencies section. It now correctly appears under optionalDependencies, matching its placement in package.json. This was an existing inconsistency in the old lockfile that got corrected during the npm install run.

Confidence Score: 5/5

Safe to merge — minimal, well-scoped changes with zero production-code modifications.

All changes are in build tooling (devDependency bump, lockfile, tsconfig). No source code was modified. The tsconfig cleanup is confirmed safe (no path-alias imports anywhere in src/). The lockfile correction for @modelcontextprotocol/sdk is an accurate reflection of package.json. No P0 or P1 issues found.

No files require special attention.

Important Files Changed

Filename Overview
package.json TypeScript devDependency bumped from ^5.9.3 to ^6.0.2; all other runtime/optional dependencies unchanged.
tsconfig.json Removed dead baseUrl and paths entries that caused TS5101 in TypeScript 6.x; confirmed no path-alias imports exist in the codebase (all 44 grep hits were private class fields and CSS selectors, not import statements).
package-lock.json TypeScript resolved entry updated from 5.9.3 to 6.0.2; @modelcontextprotocol/sdk correctly moved from root dependencies to optionalDependencies in the lockfile, matching its placement in package.json.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[npm install typescript@6.0.2] --> B[tsc resolves modules]
    B --> C{baseUrl / paths present?}
    C -- "Old config (TS 5.x)" --> D[TS5101 warning/error in TS 6.x]
    C -- "Removed in this PR" --> E[Clean compile — no TS5101]
    E --> F{Any imports used #shared/* aliases?}
    F -- "0 found in src/" --> G[All imports already used relative .js paths]
    G --> H[npm run build passes]
    G --> I[npm test: 2129/2129 pass]
Loading

Reviews (1): Last reviewed commit: "chore(deps): upgrade TypeScript from 5.9..." | Re-trigger Greptile

@carlos-alm
Copy link
Copy Markdown
Contributor Author

Addressed Claude's review feedback:

  • Path alias restoration: Created follow-up: restore path aliases with TS 6.x-compatible configuration #668 to track restoring path aliases with TS 6.x-compatible configuration and gradually migrating the 300+ relative imports. This is genuinely out of scope for a TypeScript version bump PR — it's an independent code quality improvement that touches 129+ files and warrants its own PR.

The PR itself is clean: zero source code changes, CI is fully green (all 2129 tests pass, lint clean, type check clean), and both reviewers confirmed no path-alias imports exist in the codebase.

@carlos-alm carlos-alm merged commit 9890c69 into main Mar 28, 2026
16 checks passed
@carlos-alm carlos-alm deleted the chore/typescript-6 branch March 28, 2026 21:50
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2026
@carlos-alm
Copy link
Copy Markdown
Contributor Author

@greptileai

@carlos-alm
Copy link
Copy Markdown
Contributor Author

@claude

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant