Skip to content

chore: migrate to the typescript v6#2689

Merged
vadyvas merged 19 commits intomainfrom
chore/upgrade-version-of-ts-to-v6
Apr 29, 2026
Merged

chore: migrate to the typescript v6#2689
vadyvas merged 19 commits intomainfrom
chore/upgrade-version-of-ts-to-v6

Conversation

@AlbinaBlazhko17
Copy link
Copy Markdown
Contributor

@AlbinaBlazhko17 AlbinaBlazhko17 commented Mar 24, 2026

What/Why/How?

Upgraded typescript version to v6:

  • Changed module, moduleResolution to nodenext
  • Migrated baseUrl and paths
  • Updated imports
  • Removed dependency abort-controller
  • Upgraded version of better-ajv-errors from v1 to v2.

Reference

Testing

Other products => https://github.com/Redocly/redocly/pull/22780
e2e => https://github.com/Redocly/redocly/actions/runs/23543471148/job/68536960227?pr=21909

Screenshots (optional)

Check yourself

  • Code changed? - Tested with Redoc/Realm/Reunite (internal)
  • All new/updated code is covered by tests
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

Note

Medium Risk
Toolchain-level upgrade (TS6 + NodeNext) touches build/typecheck behavior and ESM import resolution across packages, with some any casts around Ajv that could mask typing regressions.

Overview
Upgrades the monorepo to TypeScript 6.0.2 and switches compiler settings to module/moduleResolution: nodenext with a higher target/lib, plus updated paths mapping in tsconfig.json.

Adjusts code to match NodeNext/ESM requirements: fixes type-only and internal imports to include .js entrypoints, updates tests to use import ... with { type: 'json' }, changes outdent to named imports, and refactors a few modules to avoid TS6 typing friction (e.g., Ajv instantiation cast to any, Source private fields moved to # syntax).

Bumps validation dependencies used across packages (@redocly/ajv to 8.18.1, better-ajv-errors to 2.0.3) and adds changesets for the resulting patch releases.

Reviewed by Cursor Bugbot for commit b9e4eba. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 24, 2026

🦋 Changeset detected

Latest commit: b9e4eba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/respect-core Patch
@redocly/openapi-core Patch
@redocly/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 24, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 80.08% (🎯 80%) 7130 / 8903
🔵 Statements 79.49% (🎯 79%) 7408 / 9319
🔵 Functions 83.47% (🎯 83%) 1430 / 1713
🔵 Branches 71.67% (🎯 71%) 4829 / 6737
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/cli/src/commands/respect/index.ts 48.93% 37.5% 75% 46.66% 57, 62-63, 82-87, 97, 101, 105, 110-112, 126-136, 141-150, 155-158
packages/core/src/resolve.ts 95.26% 94.53% 100% 95.12% 88, 275, 353-358, 450-458
packages/core/src/config/group-assertion-rules.ts 88.88% 83.33% 100% 88% 20, 37, 65
packages/core/src/errors/yaml-parse-error.ts 100% 50% 100% 100%
packages/core/src/rules/ajv.ts 93.87% 91.66% 88.88% 97.77% 51, 132
packages/core/src/types/json-schema-adapter.ts 85.41% 81.81% 100% 84.61% 27, 45, 49, 53, 57-59, 81, 85, 103, 111-113, 117-119, 164, 168, 172, 176-178
packages/core/src/utils/oas-has-component.ts 100% 100% 100% 100%
packages/core/src/utils/read-file-from-url.ts 100% 75% 100% 100%
packages/respect-core/src/modules/context-parser/get-security-parameters.ts 100% 100% 100% 100%
packages/respect-core/src/modules/flow-runner/inputs/map-input-values-to-schema.ts 100% 100% 100% 100%
packages/respect-core/src/modules/flow-runner/schema/schema-checker.ts 98.38% 86.53% 100% 98.27% 193
Generated in workflow #9681 for commit b9e4eba by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 24, 2026

CLI Version Mean Time ± Std Dev (s) Relative Performance (Lower is Faster)
cli-latest 1.614s ± 0.023s ▓ 1.00x (Fastest)
cli-next 1.641s ± 0.046s ▓ 1.02x

@AlbinaBlazhko17 AlbinaBlazhko17 added the snapshot Create experimental release PR label Mar 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1774371282 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1774371282
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1774371282
# or
npm install @redocly/respect-core@0.0.0-snapshot.1774371282

⚠️ Note: This is a development build and may contain unstable features.

Comment thread packages/cli/src/__tests__/fetch-with-timeout.test.ts Outdated
@AlbinaBlazhko17 AlbinaBlazhko17 added no changeset needed and removed snapshot Create experimental release PR no changeset needed labels Mar 26, 2026
@AlbinaBlazhko17 AlbinaBlazhko17 marked this pull request as ready for review March 26, 2026 11:06
@AlbinaBlazhko17 AlbinaBlazhko17 requested review from a team as code owners March 26, 2026 11:06
Comment thread packages/core/package.json Outdated
"require": "./lib/bundle/bundle-oas.js",
"types": "./lib/bundle/bundle-oas.d.ts"
},
"./lib/config/types.js": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not in favour of adding additional export endpoint. It's better to maintain a single one (plus one for bundle-oas). If needed, it's better to reexport the property from the index file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, will do it

Comment thread tsconfig.json Outdated
"sourceMap": true,
"module": "ESNext",
"module": "nodenext",
"target": "ES2021",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's also try bumping the target (not necessarily in this PR though).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For sure, let me do it.

Comment thread .changeset/little-jars-look.md Outdated
"@redocly/openapi-core": patch
---

Added export for `./lib/config/types.js` to avoid errors in import.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, i thought we have package.json in lib/ folder, but we don't. I will change this changeset to export new type.

@AlbinaBlazhko17 AlbinaBlazhko17 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Mar 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1774861593 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1774861593
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1774861593
# or
npm install @redocly/respect-core@0.0.0-snapshot.1774861593

⚠️ Note: This is a development build and may contain unstable features.

Comment thread packages/cli/package.json
Comment thread packages/cli/package.json
Comment thread package-lock.json
@AlbinaBlazhko17 AlbinaBlazhko17 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1776870885 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1776870885
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1776870885
# or
npm install @redocly/respect-core@0.0.0-snapshot.1776870885

⚠️ Note: This is a development build and may contain unstable features.

Comment thread .changeset/cuddly-clouds-knock.md
@AlbinaBlazhko17 AlbinaBlazhko17 self-assigned this Apr 24, 2026
@vadyvas vadyvas force-pushed the chore/upgrade-version-of-ts-to-v6 branch from 393ef19 to 06e95eb Compare April 28, 2026 15:29
@vadyvas vadyvas force-pushed the chore/upgrade-version-of-ts-to-v6 branch from 451f14f to b9e4eba Compare April 29, 2026 09:59
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b9e4eba. Configure here.

Comment thread packages/core/src/rules/ajv.ts
@vadyvas vadyvas merged commit ca7ad82 into main Apr 29, 2026
45 checks passed
@vadyvas vadyvas deleted the chore/upgrade-version-of-ts-to-v6 branch April 29, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot Create experimental release PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants