Skip to content

chore: migrate to the typescript v6#2689

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

chore: migrate to the typescript v6#2689
AlbinaBlazhko17 wants to merge 23 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
Moderate risk because it changes TypeScript compiler settings (nodenext, new paths, loosened strict) and updates runtime-adjacent dependencies (@redocly/ajv, better-ajv-errors) that can affect schema validation behavior and module resolution.

Overview
Migrates the monorepo to TypeScript 6 and updates compiler settings to module/moduleResolution: nodenext, newer target/lib, and new paths mapping.

Updates validation/tooling dependencies (bumps @redocly/ajv to 8.18.1, upgrades better-ajv-errors to 2.0.3) and adjusts Ajv usage/types via as any casts to accommodate the upgrade.

Cleans up ESM import compatibility across packages (explicit .js specifiers, updated type re-exports, JSON import assertions) and removes the abort-controller dependency in the CLI.

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

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 79.9% (🎯 79%) 6696 / 8380
🔵 Statements 79.33% (🎯 79%) 6932 / 8738
🔵 Functions 82.96% (🎯 82%) 1359 / 1638
🔵 Branches 71.58% (🎯 71%) 4557 / 6366
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 #9379 for commit 742b682 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.600s ± 0.024s ▓▓▓ 1.10x
cli-next 3.286s ± 0.019s ▓ 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.

@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
"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

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.

"@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.

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