@@ -2582,10 +2582,18 @@ <h2 id="cross-collector-dependencies">Cross-Collector Dependencies<a class="head
25822582knowing the root cause. PSScriptBuilder emits a build warning when it detects this situation.</ p >
25832583< div class ="admonition tip ">
25842584< p class ="admonition-title "> Avoid cross-collector dependencies when possible</ p >
2585- < p > The simplest way to avoid this problem is to keep related components within a single
2586- collector. If a base class and all its derived classes — and the functions that use them —
2587- are collected by the same collector, PSScriptBuilder handles the ordering automatically
2588- with no template constraints.</ p >
2585+ < p > The simplest way to avoid this problem is to consolidate related components into a single
2586+ collector. Instead of splitting base classes and derived classes across two class collectors,
2587+ use one collector that contains all of them — PSScriptBuilder will order them automatically.
2588+ The same applies to functions: if interdependent functions share a single function collector,
2589+ no cross-collector ordering is required.</ p >
2590+ < p > When components of < strong > different types</ strong > depend on each other — for example, a function that
2591+ uses a class — consolidation is not possible, since classes and functions require separate
2592+ collectors. In this case, ensure that the class collector placeholder appears < strong > before</ strong > the
2593+ function collector placeholder in the template.</ p >
2594+ < p > Note that this only applies to < strong > Free Mode</ strong > :
2595+ in Ordered and Hybrid Mode, the < code > {{ORDERED_COMPONENTS}}</ code > placeholder (or your configured key)
2596+ handles the global ordering automatically.</ p >
25892597</ div >
25902598< h2 id ="topological-sort "> Topological Sort< a class ="headerlink " href ="#topological-sort " title ="Permanent link "> ¶</ a > </ h2 >
25912599< p > The sort uses < strong > Kahn's algorithm</ strong > and gives the following guarantees:</ p >
0 commit comments