11/* eslint-disable @nx/enforce-module-boundaries */
2- import { z } from 'zod' ;
32import type {
43 CategoryConfig ,
54 CoreConfig ,
@@ -9,12 +8,10 @@ import coveragePlugin, {
98} from './packages/plugin-coverage/src/index.js' ;
109import eslintPlugin , {
1110 eslintConfigFromAllNxProjects ,
12- eslintConfigFromNxProject ,
1311} from './packages/plugin-eslint/src/index.js' ;
1412import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js' ;
15- import jsDocsPlugin , {
16- JsDocsPluginConfig ,
17- } from './packages/plugin-jsdocs/src/index.js' ;
13+ import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js' ;
14+ import type { JsDocsPluginTransformedConfig } from './packages/plugin-jsdocs/src/lib/config.js' ;
1815import {
1916 PLUGIN_SLUG ,
2017 groups ,
@@ -137,7 +134,7 @@ export const eslintCategories: CategoryConfig[] = [
137134] ;
138135
139136export function getJsDocsCategories (
140- config : JsDocsPluginConfig ,
137+ config : JsDocsPluginTransformedConfig ,
141138) : CategoryConfig [ ] {
142139 return [
143140 {
@@ -186,7 +183,7 @@ export const lighthouseCoreConfig = async (
186183} ;
187184
188185export const jsDocsCoreConfig = (
189- config : JsDocsPluginConfig | string [ ] ,
186+ config : JsDocsPluginTransformedConfig | string [ ] ,
190187) : CoreConfig => ( {
191188 plugins : [
192189 jsDocsPlugin ( Array . isArray ( config ) ? { patterns : config } : config ) ,
@@ -200,11 +197,12 @@ export const eslintCoreConfigNx = async (
200197 projectName ?: string ,
201198) : Promise < CoreConfig > => ( {
202199 plugins : [
203- await eslintPlugin (
204- await ( projectName
205- ? eslintConfigFromNxProject ( projectName )
206- : eslintConfigFromAllNxProjects ( ) ) ,
207- ) ,
200+ projectName
201+ ? await eslintPlugin ( {
202+ eslintrc : `packages/${ projectName } /eslint.config.js` ,
203+ patterns : [ '.' ] ,
204+ } )
205+ : await eslintPlugin ( await eslintConfigFromAllNxProjects ( ) ) ,
208206 ] ,
209207 categories : eslintCategories ,
210208} ) ;
@@ -219,9 +217,6 @@ export const typescriptPluginConfig = async (
219217export const coverageCoreConfigNx = async (
220218 projectName ?: string ,
221219) : Promise < CoreConfig > => {
222- if ( projectName ) {
223- throw new Error ( 'coverageCoreConfigNx for single projects not implemented' ) ;
224- }
225220 const targetNames = [ 'unit-test' , 'int-test' ] ;
226221 const targetArgs = [
227222 '-t' ,
@@ -234,13 +229,18 @@ export const coverageCoreConfigNx = async (
234229 await coveragePlugin ( {
235230 coverageToolCommand : {
236231 command : 'npx' ,
237- args : [
238- 'nx' ,
239- projectName ? `run --project ${ projectName } ` : 'run-many' ,
240- ...targetArgs ,
241- ] ,
232+ args : projectName
233+ ? [ 'nx' , 'run-many' , '-p' , projectName , ...targetArgs ]
234+ : [ 'nx' , 'run-many' , ...targetArgs ] ,
242235 } ,
243- reports : await getNxCoveragePaths ( targetNames ) ,
236+ reports : projectName
237+ ? [
238+ {
239+ pathToProject : `packages/${ projectName } ` ,
240+ resultsPath : `packages/${ projectName } /coverage/lcov.info` ,
241+ } ,
242+ ]
243+ : await getNxCoveragePaths ( targetNames ) ,
244244 } ) ,
245245 ] ,
246246 categories : coverageCategories ,
0 commit comments