Skip to content

fix!: split root-level paths correctly#2485

Merged
tatomyr merged 2 commits intomainfrom
fix/split-root-level-paths
Jan 2, 2026
Merged

fix!: split root-level paths correctly#2485
tatomyr merged 2 commits intomainfrom
fix/split-root-level-paths

Conversation

@tatomyr
Copy link
Collaborator

@tatomyr tatomyr commented Dec 31, 2025

What/Why/How?

Fixed the split command to properly handle root-level paths.
Previously, the root path / was converted to an empty string as a filename, leading to incorrect file structure and broken links.
Now, it correctly maps to the specified path separator.

Reference

Opened as a replacement for #1638

Fixes #1634

Testing

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

@changeset-bot
Copy link

changeset-bot bot commented Dec 31, 2025

🦋 Changeset detected

Latest commit: a3e5405

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

This PR includes changesets to release 3 packages
Name Type
@redocly/cli Patch
@redocly/openapi-core Patch
@redocly/respect-core 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
Contributor

github-actions bot commented Dec 31, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.58% (🎯 78%) 6190 / 7877
🔵 Statements 78% (🎯 78%) 6396 / 8199
🔵 Functions 81.95% (🎯 81%) 1263 / 1541
🔵 Branches 70.41% (🎯 70%) 4246 / 6030
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/cli/src/utils/miscellaneous.ts 61.21% 55.46% 78.04% 60.49% 60, 125, 182-232, 258-259, 269-270, 285, 289, 292, 298, 302-305, 313-346, 357, 382, 391, 399-437, 527, 536
Generated in workflow #8255 for commit a3e5405 by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Dec 31, 2025

CLI Version Mean Time ± Std Dev (s) Relative Performance (Lower is Faster)
cli-latest 3.368s ± 0.066s ▓ 1.00x (Fastest)
cli-next 3.407s ± 0.028s ▓ 1.01x

Comment on lines +129 to +132
.replaceAll('~1', '/')
.replaceAll('~0', '~')
.replace(/^\//, '')
.replace(/\//g, pathSeparator);
.replaceAll('/', pathSeparator);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No behaviour changes here, simply improving readability.

@tatomyr tatomyr marked this pull request as ready for review December 31, 2025 13:17
@tatomyr tatomyr requested review from a team as code owners December 31, 2025 13:17
@tatomyr tatomyr requested a review from RomanHotsiy December 31, 2025 13:18
@tatomyr tatomyr merged commit 367355a into main Jan 2, 2026
43 checks passed
@tatomyr tatomyr deleted the fix/split-root-level-paths branch January 2, 2026 08:23
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.

root level paths / are not split correctly

3 participants

Comments