( tree: Tree, configuration: PluginConfiguration, pluginConfig?: Record<string, unknown>, )
| 63 | } |
| 64 | |
| 65 | export function registerPluginInWorkspace( |
| 66 | tree: Tree, |
| 67 | configuration: PluginConfiguration, |
| 68 | pluginConfig?: Record<string, unknown>, |
| 69 | ) { |
| 70 | const normalizedPluginConfiguration = |
| 71 | typeof configuration === 'string' |
| 72 | ? { |
| 73 | plugin: configuration, |
| 74 | } |
| 75 | : configuration; |
| 76 | |
| 77 | const pluginName = |
| 78 | typeof configuration === 'string' ? configuration : configuration.plugin; |
| 79 | |
| 80 | updateJson(tree, 'nx.json', (json: NxJsonConfiguration) => ({ |
| 81 | ...json, |
| 82 | plugins: [...(json.plugins ?? []), normalizedPluginConfiguration], |
| 83 | ...(pluginConfig |
| 84 | ? { |
| 85 | pluginsConfig: { |
| 86 | ...json.pluginsConfig, |
| 87 | [pluginName]: pluginConfig, |
| 88 | }, |
| 89 | } |
| 90 | : {}), |
| 91 | })); |
| 92 | } |
| 93 | |
| 94 | export async function nxShowProjectJson<T extends ProjectConfiguration>( |
| 95 | cwd: string, |
no outgoing calls
no test coverage detected