Skip to content

chore: migrate to the typescript v6#2689

Open
AlbinaBlazhko17 wants to merge 25 commits intomainfrom
chore/upgrade-version-of-ts-to-v6
Open

chore: migrate to the typescript v6#2689
AlbinaBlazhko17 wants to merge 25 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

Second part of #2618

Testing

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
Broad TypeScript/ESM module-resolution changes and dependency upgrades can cause build or runtime import/typing regressions across packages, though the changes are mostly mechanical and covered by tests.

Overview
Migrates the monorepo to TypeScript 6 by updating typescript to 6.0.2 and switching the compiler to module/moduleResolution: nodenext with a newer es2023 target and updated paths mapping.

Updates runtime/tooling dependencies used for schema validation (@redocly/ajv 8.18.1, better-ajv-errors 2.0.3) and removes the CLI’s abort-controller dependency in favor of the built-in AbortController. A wide set of imports were adjusted for NodeNext/ESM correctness (explicit .js extensions, JSON import assertions, outdent named import), and some AJV instantiations were loosened with as any casts to satisfy updated typings.

Reviewed by Cursor Bugbot for commit 25ec1cc. 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: 25ec1cc

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.04% (🎯 79%) 7100 / 8870
🔵 Statements 79.45% (🎯 78%) 7379 / 9287
🔵 Functions 83.45% (🎯 82%) 1428 / 1711
🔵 Branches 71.53% (🎯 70%) 4802 / 6713
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.78% 95% 100% 95.65% 87, 279, 352-357, 428-429, 441-442
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, 131
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 #9550 for commit 25ec1cc 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 3.442s ± 0.026s ▓ 1.02x
cli-next 3.359s ± 0.030s ▓ 1.00x (Fastest)

@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
@AlbinaBlazhko17 AlbinaBlazhko17 added no changeset needed and removed snapshot Create experimental release PR 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 the snapshot Create experimental release PR label Mar 30, 2026
@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.

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 3 potential issues.

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 ed5bfa0. Configure here.

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.

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.

3 participants