fix(cli): normalize path separators to forward slashes on Windows#11813
Closed
thesandlord wants to merge 2 commits intomainfrom
Closed
fix(cli): normalize path separators to forward slashes on Windows#11813thesandlord wants to merge 2 commits intomainfrom
thesandlord wants to merge 2 commits intomainfrom
Conversation
On Windows, path functions like path.resolve, path.dirname, and path.join return paths with backslashes. This caused issues with fern generate --docs where image paths were being resolved to Windows absolute paths like C:\Users\devon\... which then appeared in the generated HTML/markdown. This fix ensures that all path manipulation functions in @fern-api/fs-utils normalize their output to use forward slashes for cross-platform consistency. This fixes the issue where images fail to load in local dev and deploy previews on Windows machines. Co-Authored-By: Sandeep Dinesh <sandeep@buildwithfern.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Enable generate-docs-test-windows job to run on PRs (not just main) - Add test image to Windows fixture to verify image path resolution - Tests both markdown and HTML img tag syntax Co-Authored-By: Sandeep Dinesh <sandeep@buildwithfern.com>
Contributor
|
This PR is stale because it has been open 25 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Contributor
|
This PR is stale because it has been open 25 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Contributor
|
This PR was closed because it has been inactive for 5 days after being marked stale. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refs: https://buildwithfern.slack.com/archives/C09MPC09FUL/p1769461601587929
Fixes an issue where
fern generate --docson Windows machines produces image paths with Windows absolute paths (e.g.,C:\Users\devon\...) that appear in generated HTML/markdown, causing images to fail to load in both local dev and deploy previews.Changes Made
dirname(),join(), andresolve()functions in@fern-api/fs-utilsto normalize their output to use forward slashesgenerate-docs-test-windowsCI job to run on PRs (previously only ran on main branch)The fix applies
convertToOsPath()(which converts\to/) to the output of these path manipulation functions, matching the existing behavior ofAbsoluteFilePath.of()andRelativeFilePath.of().Testing
generate-docs-test-windows) will now run on this PR to validate the fixHuman Review Checklist
Link to Devin run: https://app.devin.ai/sessions/e3e7f08157a04186931595d467a1e519
Requested by: @thesandlord (Sandeep Dinesh)