@@ -10,7 +10,9 @@ import { dirname } from 'node:path';
10
10
11
11
import { assertProjectExists } from './shared' ;
12
12
13
- interface TypeCheckPluginOptions { }
13
+ interface TypeCheckPluginOptions {
14
+ targetName ?: string ;
15
+ }
14
16
15
17
const typescriptConfigGlob = '**/tsconfig.json' ;
16
18
@@ -19,7 +21,7 @@ export const createNodesV2: CreateNodesV2<TypeCheckPluginOptions> = [
19
21
( configFiles , options , context ) => {
20
22
return createNodesFromFiles (
21
23
( configFile , options , context ) => {
22
- return createNodesInternal ( configFile , options ?? { } , context ) ;
24
+ return createNodesInternal ( configFile , options , context ) ;
23
25
} ,
24
26
configFiles ,
25
27
options ,
@@ -30,9 +32,16 @@ export const createNodesV2: CreateNodesV2<TypeCheckPluginOptions> = [
30
32
31
33
// ===================================================================================================================
32
34
35
+ function normalizeOptions ( options : TypeCheckPluginOptions | undefined ) : Required < TypeCheckPluginOptions > {
36
+ options ??= { } ;
37
+ options . targetName ??= 'type-check' ;
38
+
39
+ return options as Required < TypeCheckPluginOptions > ;
40
+ }
41
+
33
42
function createNodesInternal (
34
43
configFilePath : string ,
35
- options : TypeCheckPluginOptions ,
44
+ options : TypeCheckPluginOptions | undefined ,
36
45
context : CreateNodesContextV2 ,
37
46
) : CreateNodesResult {
38
47
const projectRoot = dirname ( configFilePath ) ;
@@ -41,6 +50,8 @@ function createNodesInternal(
41
50
return { } ;
42
51
}
43
52
53
+ const normalizedOptions = normalizeOptions ( options ) ;
54
+
44
55
const targetConfig : TargetConfiguration = {
45
56
executor : '@fluentui/workspace-plugin:type-check' ,
46
57
cache : true ,
@@ -55,7 +66,7 @@ function createNodesInternal(
55
66
projects : {
56
67
[ projectRoot ] : {
57
68
targets : {
58
- 'type-check' : targetConfig ,
69
+ [ normalizedOptions . targetName ] : targetConfig ,
59
70
} ,
60
71
} ,
61
72
} ,
0 commit comments