@@ -4,7 +4,9 @@ import { isConfigurationOutput } from './types.js';
4
4
import type { ConfiguredPlugin , GraphqlCodegenTypes , PresetNames } from './types.js' ;
5
5
import type { IsPluginEnabledCallback , GenericPluginCallback } from '../../types/plugins.js' ;
6
6
7
- export const NAME = 'Graphql Codegen' ;
7
+ // https://the-guild.dev/graphql/codegen/docs/config-reference/codegen-config
8
+
9
+ export const NAME = 'GraphQL Codegen' ;
8
10
9
11
/** @public */
10
12
export const ENABLERS = [ / ^ @ g r a p h q l - c o d e g e n \/ / ] ;
@@ -20,8 +22,6 @@ const findPluginDependencies: GenericPluginCallback = async (configFilePath, opt
20
22
21
23
if ( isProduction ) return [ ] ;
22
24
23
- // load configuration file from `configFilePath` (or grab `manifest` for package.json)
24
- // load(FAKE_PATH) will return `undefined`
25
25
const localConfig : GraphqlCodegenTypes | undefined = configFilePath . endsWith ( 'package.json' )
26
26
? manifest [ PACKAGE_JSON_PATH ]
27
27
: await load ( configFilePath ) ;
@@ -39,13 +39,11 @@ const findPluginDependencies: GenericPluginCallback = async (configFilePath, opt
39
39
40
40
const flatPlugins = generateSet
41
41
. filter ( ( config ) : config is ConfiguredPlugin => ! isConfigurationOutput ( config ) )
42
- . map ( item => Object . keys ( item ) )
43
- . flat ( )
42
+ . flatMap ( item => Object . keys ( item ) )
44
43
. map ( plugin => `@graphql-codegen/${ plugin } ` ) ;
45
44
46
45
const nestedPlugins = configurationOutput
47
- . map ( configOutput => ( configOutput . plugins ? configOutput . plugins : [ ] ) )
48
- . flat ( )
46
+ . flatMap ( configOutput => ( configOutput . plugins ? configOutput . plugins : [ ] ) )
49
47
. map ( plugin => `@graphql-codegen/${ plugin } ` ) ;
50
48
51
49
return [ ...presets , ...flatPlugins , ...nestedPlugins ] ;
0 commit comments