Skip to content

fix: upgrade typescript to v6 [POC]#2698

Draft
ssbarnea wants to merge 1 commit intomainfrom
chore/eslint
Draft

fix: upgrade typescript to v6 [POC]#2698
ssbarnea wants to merge 1 commit intomainfrom
chore/eslint

Conversation

@ssbarnea
Copy link
Copy Markdown
Member

@ssbarnea ssbarnea commented Mar 30, 2026

Upgrades TypeScript from v5.9.3 to v6.0.2 across the ansible-language-server and ansible-mcp-server packages, alongside necessary configuration adjustments for TypeScript v6 compatibility. Removes deprecated baseUrl compiler options and adds type declarations to match new requirements.

  • Updated typescript from ^5.9.3 to ^6.0.2 in both packages/ansible-language-server/package.json and packages/ansible-mcp-server/package.json
  • Updated @types/node from ^24.10.2 to ^25.5.0 in packages/ansible-mcp-server/package.json
  • Removed compilerOptions.baseUrl from packages/ansible-language-server/tsconfig.json (no longer supported in TypeScript v6)
  • Removed compilerOptions.baseUrl and added types: ["node", "vitest/globals"] to packages/ansible-mcp-server/tsconfig.json
  • Added # pragma: no cover comment to test/ui/utils/ui_utils.py for test coverage configuration

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades TypeScript tooling within the monorepo (notably the language server and MCP server workspaces), updating lockfile resolutions and adjusting related TypeScript configuration.

Changes:

  • Bump typescript to ^6.0.2 in @ansible/ansible-language-server and @ansible/ansible-mcp-server, and update yarn.lock accordingly.
  • Update @ansible/ansible-mcp-server to @types/node ^25.5.0 and add types entries to its tsconfig.json.
  • Mark a branch in the UI test helper vscode_run_command as uncovered (# pragma: no cover).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
yarn.lock Updates resolved versions for TypeScript 6 and Node typings (incl. new TypeScript entries).
test/ui/utils/ui_utils.py Adds coverage exclusion to a command-prefixing branch.
packages/ansible-mcp-server/tsconfig.json Removes baseUrl, adds explicit types (node, vitest/globals).
packages/ansible-mcp-server/package.json Upgrades typescript to ^6.0.2 and @types/node to ^25.5.0.
packages/ansible-language-server/tsconfig.json Removes baseUrl from compiler options.
packages/ansible-language-server/package.json Upgrades typescript to ^6.0.2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 46 to 48
"shell-quote": "^1.8.3",
"typescript": "^5.9.3",
"typescript": "^6.0.2",
"vitest": "^4.1.0",
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR title indicates a TypeScript v6 upgrade, but the repo root still depends on TypeScript ^5.9.3 (and root scripts use tsc -b). With only some workspaces moving to ^6.0.2, you may end up with multiple TypeScript versions in the monorepo and inconsistent compiler behavior depending on which scripts are run. Consider upgrading the root TypeScript dependency as well, or adjusting the PR title/scope to reflect that this is a partial upgrade.

Copilot uses AI. Check for mistakes.
"description": "Ansible Development Tools MCP server with linting, workspace access, and expert prompts",
"devDependencies": {
"@types/node": "^24.10.2",
"@types/node": "^25.5.0",
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@types/node is bumped to ^25.5.0 here while the repo’s development Node version is pinned to 24.14.1 (mise) and other workspaces/root still use @types/node ^24.x. This can let code typecheck against Node 25-only APIs even though the runtime target is Node 24, and it introduces inconsistent typings across the monorepo. Consider keeping @types/node on the same major as the repo’s supported Node (24.x), unless you’re also raising the Node engine/tooling versions accordingly.

Suggested change
"@types/node": "^25.5.0",
"@types/node": "^24.0.0",

Copilot uses AI. Check for mistakes.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

📝 Walkthrough

Walkthrough

TypeScript development dependencies upgraded across Ansible language server and MCP server packages from v5.9.3 to v6.0.2, with associated tsconfig.json adjustments including removal of baseUrl and addition of vitest/globals type references. Node types dependency also bumped to v25.5.0. A coverage pragma added to test utility file.

Changes

Cohort / File(s) Summary
TypeScript & Dev Dependencies
packages/ansible-language-server/package.json, packages/ansible-mcp-server/package.json
Updated TypeScript from ^5.9.3 to ^6.0.2 across both packages; also bumped @types/node from ^24.10.2 to ^25.5.0 in MCP server package.
TypeScript Compiler Configuration
packages/ansible-language-server/tsconfig.json, packages/ansible-mcp-server/tsconfig.json
Removed baseUrl: "." from both configs; added global type declarations ["node", "vitest/globals"] to MCP server tsconfig.
Test Coverage Pragma
test/ui/utils/ui_utils.py
Added # pragma: no cover inline comment to command normalization condition in vscode_run_command function.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 TypeScript hops to version six,
Config tweaks and type mix fixes,
Dependencies dance, coverage expands,
Our toolchain now stands on steadier lands!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title accurately reflects the main change: upgrading TypeScript from v5 to v6 across multiple package.json files, with corresponding tsconfig.json adjustments.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/eslint

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ansible-mcp-server/package.json`:
- Line 18: Update the project TypeScript configuration to explicitly pin
compiler options to pre-v6 behavior and avoid breaking defaults: open
tsconfig.json and set compilerOptions.target, compilerOptions.module,
compilerOptions.types (e.g., ["node"]), and compilerOptions.rootDir to values
your code expects; if you need a temporary suppression, add
compilerOptions.ignoreDeprecations: "6.0" while you fix source issues; then scan
code for strict-mode/type errors introduced by v6 (fix any incompatible
declarations, implicit any places, or changed module resolution impacts) so the
build succeeds with typescript ^6.0.2.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5b1e91ed-e85e-4850-a772-0047c47fe203

📥 Commits

Reviewing files that changed from the base of the PR and between d3525cf and 92c4518.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • packages/ansible-language-server/package.json
  • packages/ansible-language-server/tsconfig.json
  • packages/ansible-mcp-server/package.json
  • packages/ansible-mcp-server/tsconfig.json
  • test/ui/utils/ui_utils.py
💤 Files with no reviewable changes (1)
  • packages/ansible-language-server/tsconfig.json

"rimraf": "^6.1.3",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"typescript": "^6.0.2",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

What is the latest version of TypeScript as of March 2026? Does TypeScript v6.0.2 exist?

💡 Result:

The latest version of TypeScript as of March 2026 is 6.0.2, released on March 23, 2026. Yes, TypeScript v6.0.2 exists; it is the stable final release of the 6.0 series, following beta (6.0.0) and RC (6.0.1), serving as a transition to the upcoming TypeScript 7.0 (native Go-based compiler, not yet released).

Citations:


🌐 Web query:

What are the breaking changes in TypeScript v6 compared to TypeScript v5?

💡 Result:

TypeScript 6.0 introduces several breaking changes compared to TypeScript 5.x, primarily through new compiler option defaults, deprecations (to be removed in 7.0), and behavioral changes to align with modern JavaScript practices and prepare for the native Go-based TypeScript 7.0. Key breaking changes: 1. New compiler option defaults: - strict: true (was false) - target: es2025 (was ES3) - types: [] (was ["*"] including all @types packages) - rootDir: directory of tsconfig.json (was inferred from source files) 2. Deprecations (silenceable with "ignoreDeprecations": "6.0" in tsconfig.json, but will error in 7.0): - target es5 (minimum now es2015) - baseUrl - moduleResolution: node10, classic - module: AMD, UMD, System - outFile - downlevelIteration - alwaysStrict: false - import assertions (assert {...}, now use with) - Triple-slash references/directives - using module in place of namespace 3. Behavioral changes: - Stricter type inference for this-less methods and generic function calls (esp. in JSX) - Type ordering in .d.ts may differ (use --stableTypeOrdering flag) - lib dom now includes iterable/asynciterable (drop separate dom.iterable) - Assume "use strict" everywhere - noUncheckedSideEffectImports enabled by default - CLI options conflicting with tsconfig now error Migration steps: - Explicitly set types: e.g. ["node", "react"] if needed - Set rootDir: "./src" if sources are in subdir - Update target/module/moduleResolution to modern values - Use ts5to6 codemod for baseUrl/rootDir fixes - Address strict mode issues or set strict: false explicitly - Run with ignoreDeprecations: "6.0" temporarily if needed

Citations:


Address TypeScript v6 breaking changes in tsconfig.json and code.

TypeScript v6.0.2 has confirmed breaking changes from v5.x that may impact this codebase. The key changes are:

  • Compiler defaults changed: strict: true (was false), target: es2025 (was ES3), types: [] (was all @types)
  • Deprecations: target: es5, baseUrl, moduleResolution: node10, module: AMD/UMD/System, outFile
  • Behavioral: stricter type inference, assume "use strict" everywhere

Review the project's tsconfig.json and source code to ensure compatibility. If needed, explicitly set types, rootDir, target, and module to your project's requirements, or use ignoreDeprecations: "6.0" temporarily while addressing issues (this will error in TypeScript 7.0).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ansible-mcp-server/package.json` at line 18, Update the project
TypeScript configuration to explicitly pin compiler options to pre-v6 behavior
and avoid breaking defaults: open tsconfig.json and set compilerOptions.target,
compilerOptions.module, compilerOptions.types (e.g., ["node"]), and
compilerOptions.rootDir to values your code expects; if you need a temporary
suppression, add compilerOptions.ignoreDeprecations: "6.0" while you fix source
issues; then scan code for strict-mode/type errors introduced by v6 (fix any
incompatible declarations, implicit any places, or changed module resolution
impacts) so the build succeeds with typescript ^6.0.2.

@ssbarnea ssbarnea marked this pull request as draft March 30, 2026 13:45
auto-merge was automatically disabled March 30, 2026 13:45

Pull request was converted to draft

@ssbarnea ssbarnea changed the title fix: upgrade typescript to v6 fix: upgrade typescript to v6 [POC] Mar 30, 2026
@github-actions github-actions bot added fix and removed fix labels Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants