How can I add documentation links to different packages without creating a circular dependency? #35879
Replies: 1 comment
|
Two different things get called "circular dependency" here and they have different fixes, so the first thing is figuring out which one is actually yelling at you: your build/bundler, or Nx's If it's the build: the culprit is import type { FormField } from "@workspace/form-field";Top-level Side note, your If it's the Nx lint instead: Nx counts type-only imports in its project graph too, and there's no flag to exclude them (that was #9083, closed keeping the behavior). Since the cycle is types-only and gone from the build output, I'd just |
Uh oh!
There was an error while loading. Please reload this page.
So here's the situation: I have a
Form(@workspace/form) and aFormField(@workspace/form-field) package and I want to cross-reference each in each other's documentation and inline hinting. My goal, ultimately, is to have inline documentation with links like so:I initially implemented this by installing the dependency as a dev dependency in the package which I wanted to add documentation for
However, this created a circular dependency if I want to cross-reference this documentation
I tried using a dynamic import, hoping it would work
This doesn't seem to have worked.
Does anyone know a way to solve this problem?
All reactions