Skip to content

Conversation

@bartvandenende-wm
Copy link
Contributor

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

@bih
Copy link
Collaborator

bih commented Jun 5, 2025

Merging in #140.

@bih bih closed this Jun 5, 2025
bih added a commit that referenced this pull request Jun 5, 2025
bih added a commit that referenced this pull request Jun 5, 2025
* feat: add support for monorepos with symlink folders

* edit_uri: fix edit URL for nested site_name

fixes #127 and adds regression test for nested site_name in included project

* Avoid replacing dots for underscores

Resolves #123

* feat: removed restrictions on using directories outside root

* chore: fmt

* chore: bump dependencies

* docs: mention fixtures in readme

* fix: bump to 1.1.1

* docs: mention #129 in changelog

* docs: mention #108

* docs: add #122

* docs: add #128

---------

Co-authored-by: Bart van den Ende <[email protected]>
Co-authored-by: Duncan Macleod <[email protected]>
Co-authored-by: Fokko Driesprong <[email protected]>
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

2 participants