Skip to content

chore: migrate to typescript 6 - #102

Open
SomeBody16 wants to merge 4 commits into
mainfrom
chore/typescript-6
Open

chore: migrate to typescript 6#102
SomeBody16 wants to merge 4 commits into
mainfrom
chore/typescript-6

Conversation

@SomeBody16

@SomeBody16 SomeBody16 commented Jul 26, 2026

Copy link
Copy Markdown

Description

Migrates the project to TypeScript 6.0.3 while keeping production runtime behavior unchanged. Supporting tools that consume TypeScript syntax, types, or compiler APIs were upgraded, while broader source and module-resolution cleanup is deferred to a follow-up PR.

Changes by file

package.json

  • Updated typescript from 5.5 to 6.0.3.
  • Updated API Extractor and API Documenter to versions that can parse the TypeScript 6 configuration.
  • Upgraded Jest, ts-jest, Jest types, and the jsdom environment as one compatible Jest 29 toolchain.
  • Upgraded ESLint, typescript-eslint, Airbnb, import, and Jest lint packages to versions that support TypeScript 6.
  • Replaced karma-typescript and karma-typescript-es6-transform with karma-esbuild, esbuild, and Istanbul instrumentation.
  • Added --local to docs:extract because the documentation workflow regenerates its API report on each run.

Rollup and unrelated dependencies remain unchanged because the existing production build works with TypeScript 6.

yarn.lock

Regenerated with Yarn 1.22.22 to lock TypeScript 6.0.3 and the compatible Jest, ESLint, API documentation, esbuild, and Karma dependency graphs.

tsconfig.json

Added ignoreDeprecations: "6.0" to preserve the existing moduleResolution: "node" and baseUrl behavior.

Switching directly to moduleResolution: "bundler" exposed declaration-resolution failures in existing Webex dependencies whose exports maps do not expose their type files. Modern module resolution and removal of baseUrl are deferred to a follow-up PR to keep this migration focused.

jest.config.js

Changed the configuration JSDoc type from a ts-jest internal type to Jest's public Config type. The old internal type path is not part of the ts-jest 29 public API.

The existing ts-jest preset and test behavior remain unchanged.

.eslintrc.js

  • Disabled Jest rules newly introduced by the upgraded jest/all preset that would otherwise require unrelated test-style rewrites.
  • Disabled jest/unbound-method because it requires type-aware ESLint parser services, which this repository does not currently configure.
  • Explicitly allowed unused catch bindings to preserve the previous lint behavior.

These compatibility exceptions allow the parser and plugins to support TypeScript 6 without expanding this PR into a lint-policy cleanup.

karma.conf.js

  • Replaced the TypeScript compiler-based Karma framework, preprocessor, and reporter with karma-esbuild.
  • Limited preprocessing to the existing integration-test entry pattern.
  • Retained the existing Mocha, Chai, browser launcher, Sauce Labs, JUnit, and coverage configuration.
  • Added Istanbul instrumentation for imported production TypeScript files.
  • Preserved the ES2015 browser target and single-bundle behavior.

This was required because karma-typescript produced CommonJS output under TypeScript 6 that failed in Chrome with exports is not defined.

src/peer-connection.spec.ts

Replaced MockedObjectDeep imported from ts-jest with the repository's existing MaybeMockedDeep type.

ts-jest 29 no longer exports the old type, and using the local helper removes coupling to ts-jest internals without changing mock behavior.

src/peer-connection-utils.spec.ts

Updated the fake RTCSessionDescription so its toJSON() method returns a valid RTCSessionDescriptionInit.

TypeScript 6's DOM declarations reject the previous undefined return value. This change only corrects the test stub contract.

Deferred follow-up

  • Adopt modern bundler module resolution.
  • Remove the deprecated baseUrl configuration.
  • Update affected dependency export maps or versions.
  • Revisit newly available Jest lint rules.
  • Clean up existing TSDoc warnings.

Validation

  • yarn install --frozen-lockfile
  • yarn tsc --version reports 6.0.3
  • yarn transpile:validate
  • yarn test:lint
  • yarn test:prettier
  • yarn test:unit --runInBand (8 suites, 134 tests)
  • yarn test:coverage --runInBand (8 suites, 134 tests)
  • yarn build
  • yarn docs
  • yarn test:integration:chrome (5 tests)

The build generated the ESM, CommonJS, UMD, minified UMD, and declaration outputs successfully. Chrome integration coverage remained mapped to the production TypeScript source files.

API Extractor still reports the repository's existing TSDoc warnings. Its latest release also advises that its bundled TypeScript 5.9 engine is older than the project compiler. Both warnings are non-fatal.

This change implements...

  • A new feature
  • A bug fix
  • Other (please specify): TypeScript 6 and supporting toolchain migration

Is this a breaking change?

  • Yes
  • No

I certify that...

  • All relevant unit and integration tests have passed and/or have been updated according to this change.

Generative AI (GAI) Usage Disclosure

Reference: Cisco GAI Coding Guidelines

  • Cisco approved GAI tool/IDE was used for coding - eg: VSCode, Cursor, Windsurf, Codex, Claude code
  • No GAI - Code was written entirely manually without GAI assistance

If a GAI tool/IDE was used then select the category that best describes GAI usage in this PR:

  • Manual Draft with GAI Refinement - I/we created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code) (Default)
  • GAI Draft with Manual Customization - GAI tool was used to create a draft that I/we subsequently customized or modified.
  • GAI Generated Code - Code was generated entirely by GAI

Additional GAI Usage Details (Optional):

GitHub Copilot was used to draft and validate the TypeScript and supporting toolchain migration.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6425fe53f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tsconfig.json Outdated
@SomeBody16 SomeBody16 changed the title chore: typescript 6 chore: migrate to typescript 6 Jul 26, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 442c5893eb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread package.json Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 826cae4abb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread karma.conf.js Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9fdd3c7ed

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread package.json
"@commitlint/config-conventional": "^12.1.4",
"@microsoft/api-documenter": "^7.13.33",
"@microsoft/api-extractor": "^7.18.4",
"@microsoft/api-documenter": "^7.30.10",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep API Documenter compatible with Node 18.18

On Node 18.18.x, which the package still advertises via engines.node, a Yarn 1 install remains blocked because this API Documenter upgrade locks @rushstack/node-core-library@5.23.3, whose engine range starts at Node 18.20.3. The minimatch override from the earlier fix does not address this fresh lockfile dependency, so either retain a Documenter graph compatible with 18.18 or raise the declared Node minimum.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants