( pluginId: PluginId, plugins: readonly LoadedPlugin[], )
| 242 | * @returns Names of plugins that will break if `pluginId` goes away |
| 243 | */ |
| 244 | export function findReverseDependents( |
| 245 | pluginId: PluginId, |
| 246 | plugins: readonly LoadedPlugin[], |
| 247 | ): string[] { |
| 248 | const { name: targetName } = parsePluginIdentifier(pluginId) |
| 249 | return plugins |
| 250 | .filter( |
| 251 | p => |
| 252 | p.enabled && |
| 253 | p.source !== pluginId && |
| 254 | (p.manifest.dependencies ?? []).some(d => { |
| 255 | const qualified = qualifyDependency(d, p.source) |
| 256 | // Bare dep (from @inline plugin): match by name only |
| 257 | return parsePluginIdentifier(qualified).marketplace |
| 258 | ? qualified === pluginId |
| 259 | : qualified === targetName |
| 260 | }), |
| 261 | ) |
| 262 | .map(p => p.name) |
| 263 | } |
| 264 | |
| 265 | /** |
| 266 | * Build the set of plugin IDs currently enabled at a given settings scope. |
no test coverage detected