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

feat: add support for monorepos with symlink folders #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bartvandenende-wm
Copy link

@bartvandenende-wm bartvandenende-wm commented Jan 8, 2024

Summary

Fixes #121

Details

This PR adds support for mono-repos that uses symlinks to link 'package dependencies'.

The current behaviour of mkdocs-monorepo-plugin is to resolve the !include and *includes folders to the absolute path by using the resolve() path method. The side-effect is though that this method also resolves symlinks, which causes compatibility issues with mono-repos that utilise symlinks to link package dependencies. For example pnpm typescript / javascript mono-repos.

By switching the path .resolve() method to .absolute() the nav paths are still resolved to absolute folders in 'local' context without resolving the symlinks.

How it was tested

Manual tested using the folder structure as outlined in #121

Impact

This is a small breaking change in the folder resolve behaviour, nav paths are still resolved absolute with the exception that links are not resolved to the final target anymore.

Based on the current plugin setup I expect the impact to be limited. The current plugin version now blocks compilation (given L175) if that final path resolves to a folder outside of the project directory. So I expect in practise a limited number of projects would be using symlinks today. If needed this could be put behind a plugin feature flag though.

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.

[feature] Support for mono-repo that use symlinks
1 participant