11/* eslint-disable @nx/enforce-module-boundaries */
22import { createProjectGraphAsync } from '@nx/devkit' ;
33import type { CoreConfig , PluginUrls } from './packages/models/src/index.js' ;
4+ import axePlugin , {
5+ type AxePluginOptions ,
6+ axeGroupRefs ,
7+ } from './packages/plugin-axe/src/index.js' ;
8+ import coveragePlugin , {
9+ type CoveragePluginConfig ,
10+ getNxCoveragePaths ,
11+ } from './packages/plugin-coverage/src/index.js' ;
12+ import eslintPlugin , {
13+ eslintConfigFromAllNxProjects ,
14+ } from './packages/plugin-eslint/src/index.js' ;
15+ import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js' ;
16+ import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js' ;
17+ import {
18+ lighthouseGroupRefs ,
19+ lighthousePlugin ,
20+ } from './packages/plugin-lighthouse/src/index.js' ;
21+ import typescriptPlugin , {
22+ getCategories ,
23+ tsconfigFromAllNxProjects ,
24+ } from './packages/plugin-typescript/src/index.js' ;
425
526export function configureUpload ( projectName : string = 'workspace' ) : CoreConfig {
627 return {
@@ -19,10 +40,6 @@ export function configureUpload(projectName: string = 'workspace'): CoreConfig {
1940export async function configureEslintPlugin (
2041 projectName ?: string ,
2142) : Promise < CoreConfig > {
22- const { default : eslintPlugin , eslintConfigFromAllNxProjects } = await import (
23- './packages/plugin-eslint/src/index.js'
24- ) ;
25-
2643 return {
2744 plugins : [
2845 projectName
@@ -65,12 +82,8 @@ export async function configureEslintPlugin(
6582export async function configureCoveragePlugin (
6683 projectName ?: string ,
6784) : Promise < CoreConfig > {
68- const { default : coveragePlugin , getNxCoveragePaths } = await import (
69- './packages/plugin-coverage/src/index.js'
70- ) ;
71-
7285 const targets = [ 'unit-test' , 'int-test' ] ;
73- const config = projectName
86+ const config : CoveragePluginConfig = projectName
7487 ? // We do not need to run a coverageToolCommand. This is handled over the Nx task graph.
7588 {
7689 reports : Object . keys (
@@ -105,10 +118,6 @@ export async function configureCoveragePlugin(
105118}
106119
107120export async function configureJsPackagesPlugin ( ) : Promise < CoreConfig > {
108- const { default : jsPackagesPlugin } = await import (
109- './packages/plugin-js-packages/src/index.js'
110- ) ;
111-
112121 return {
113122 plugins : [ await jsPackagesPlugin ( ) ] ,
114123 categories : [
@@ -145,26 +154,21 @@ export async function configureJsPackagesPlugin(): Promise<CoreConfig> {
145154export async function configureTypescriptPlugin (
146155 projectName ?: string ,
147156) : Promise < CoreConfig > {
148- const { default : typescriptPlugin , getCategories } = await import (
149- './packages/plugin-typescript/src/index.js'
150- ) ;
151-
152157 const tsconfig = projectName
153158 ? `packages/${ projectName } /tsconfig.lib.json`
154- : 'tsconfig.code-pushup.json' ;
159+ : await tsconfigFromAllNxProjects ( {
160+ exclude : [
161+ 'test-fixtures' , // Intentionally incomplete tsconfigs
162+ 'models' , // Uses ts-patch transformer plugin
163+ ] ,
164+ } ) ;
155165 return {
156166 plugins : [ typescriptPlugin ( { tsconfig } ) ] ,
157167 categories : getCategories ( ) ,
158168 } ;
159169}
160170
161- export async function configureJsDocsPlugin (
162- projectName ?: string ,
163- ) : Promise < CoreConfig > {
164- const { default : jsDocsPlugin } = await import (
165- './packages/plugin-jsdocs/src/index.js'
166- ) ;
167-
171+ export function configureJsDocsPlugin ( projectName ?: string ) : CoreConfig {
168172 const patterns : string [ ] = [
169173 `packages/${ projectName ?? '*' } /src/**/*.ts` ,
170174 `!**/node_modules` ,
@@ -196,10 +200,6 @@ export async function configureJsDocsPlugin(
196200export async function configureLighthousePlugin (
197201 urls : PluginUrls ,
198202) : Promise < CoreConfig > {
199- const { lighthousePlugin, lighthouseGroupRefs } = await import (
200- './packages/plugin-lighthouse/src/index.js'
201- ) ;
202-
203203 const lhPlugin = await lighthousePlugin ( urls ) ;
204204 return {
205205 plugins : [ lhPlugin ] ,
@@ -228,14 +228,10 @@ export async function configureLighthousePlugin(
228228 } ;
229229}
230230
231- export async function configureAxePlugin (
231+ export function configureAxePlugin (
232232 urls : PluginUrls ,
233233 options ?: AxePluginOptions ,
234- ) : Promise < CoreConfig > {
235- const { default : axePlugin , axeGroupRefs } = await import (
236- './packages/plugin-axe/src/index.js'
237- ) ;
238-
234+ ) : CoreConfig {
239235 const axe = axePlugin ( urls , options ) ;
240236 return {
241237 plugins : [ axe ] ,
0 commit comments