11/* eslint-disable @nx/enforce-module-boundaries */
22import { createProjectGraphAsync } from '@nx/devkit' ;
3- import type {
4- CategoryConfig ,
5- CoreConfig ,
6- PluginUrls ,
7- } from './packages/models/src/index.js' ;
8- import axePlugin , { axeCategories } from './packages/plugin-axe/src/index.js' ;
3+ import type { CoreConfig , PluginUrls } from './packages/models/src/index.js' ;
4+ import axePlugin , { axeGroupRefs } from './packages/plugin-axe/src/index.js' ;
95import coveragePlugin , {
106 type CoveragePluginConfig ,
117 getNxCoveragePaths ,
@@ -16,8 +12,7 @@ import eslintPlugin, {
1612import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js' ;
1713import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js' ;
1814import {
19- lighthouseCategories ,
20- lighthouseGroupRef ,
15+ lighthouseGroupRefs ,
2116 lighthousePlugin ,
2217} from './packages/plugin-lighthouse/src/index.js' ;
2318import typescriptPlugin , {
@@ -195,38 +190,43 @@ export async function configureLighthousePlugin(
195190 urls : PluginUrls ,
196191) : Promise < CoreConfig > {
197192 const lhPlugin = await lighthousePlugin ( urls ) ;
198- const lhCategories : CategoryConfig [ ] = [
199- {
200- slug : 'performance' ,
201- title : 'Performance' ,
202- refs : [ lighthouseGroupRef ( 'performance' ) ] ,
203- } ,
204- {
205- slug : 'a11y' ,
206- title : 'Accessibility' ,
207- refs : [ lighthouseGroupRef ( 'accessibility' ) ] ,
208- } ,
209- {
210- slug : 'best-practices' ,
211- title : 'Best Practices' ,
212- refs : [ lighthouseGroupRef ( 'best-practices' ) ] ,
213- } ,
214- {
215- slug : 'seo' ,
216- title : 'SEO' ,
217- refs : [ lighthouseGroupRef ( 'seo' ) ] ,
218- } ,
219- ] ;
220193 return {
221194 plugins : [ lhPlugin ] ,
222- categories : lighthouseCategories ( lhPlugin , lhCategories ) ,
195+ categories : [
196+ {
197+ slug : 'performance' ,
198+ title : 'Performance' ,
199+ refs : lighthouseGroupRefs ( lhPlugin , 'performance' ) ,
200+ } ,
201+ {
202+ slug : 'a11y' ,
203+ title : 'Accessibility' ,
204+ refs : lighthouseGroupRefs ( lhPlugin , 'accessibility' ) ,
205+ } ,
206+ {
207+ slug : 'best-practices' ,
208+ title : 'Best Practices' ,
209+ refs : lighthouseGroupRefs ( lhPlugin , 'best-practices' ) ,
210+ } ,
211+ {
212+ slug : 'seo' ,
213+ title : 'SEO' ,
214+ refs : lighthouseGroupRefs ( lhPlugin , 'seo' ) ,
215+ } ,
216+ ] ,
223217 } ;
224218}
225219
226220export function configureAxePlugin ( urls : PluginUrls ) : CoreConfig {
227221 const axe = axePlugin ( urls ) ;
228222 return {
229223 plugins : [ axe ] ,
230- categories : axeCategories ( axe ) ,
224+ categories : [
225+ {
226+ slug : 'axe-a11y' ,
227+ title : 'Axe Accessibility' ,
228+ refs : axeGroupRefs ( axe ) ,
229+ } ,
230+ ] ,
231231 } ;
232232}
0 commit comments