Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trimming of filenames #405

Merged
merged 2 commits into from
Dec 11, 2021
Merged

Conversation

ecraig12345
Copy link
Contributor

After #392, trimming filenames no longer works properly on types coming from node_modules in a monorepo, where commands may be run from a particular package but dependencies are installed at the repo root (see #404 for more details).

This PR restores the previous behavior of returning the path starting from the first common root folder between the filename and process.cwd(), in a way that should be reliable across platforms regardless of how paths are formatted.

Fixes #404

@pvasek
Copy link
Collaborator

pvasek commented Dec 11, 2021

Obviously, it didn't come to my mind that I could break something with my "fix" #392.

Thanks for your PR we have all these use cases covered now. It's surprising for me to see all that we need to handle and it's great to have it "documented" in this way.

@pvasek pvasek merged commit 8b25549 into styleguidist:master Dec 11, 2021
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.

trimFileName no longer works in a monorepo
2 participants