File tree 3 files changed +5
-2
lines changed
3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { EOL } from 'node:os';
3
3
// biome-ignore lint/nursery/noRestrictedImports: script
4
4
import path from 'node:path' ;
5
5
6
+ const HEADER = '// This file is generated (no need to edit)' ;
6
7
const cc = str => str . toLowerCase ( ) . replace ( / [ ^ a - z A - Z 0 - 9 ] + ( .) / g, ( _m , char ) => char . toUpperCase ( ) ) ;
7
8
8
9
const pluginsDir = path . resolve ( 'src/plugins' ) ;
@@ -19,11 +20,11 @@ const typeDefinition = `export type PluginName = ${pluginNames.map(name => `'${n
19
20
20
21
const values = `export const pluginNames = [${ pluginNames . map ( name => `'${ name } '` ) . join ( ',' ) } ] as const;` ;
21
22
22
- fs . writeFileSync ( outputFileTypes , typeDefinition + EOL + EOL + values ) ;
23
+ fs . writeFileSync ( outputFileTypes , HEADER + EOL + typeDefinition + EOL + EOL + values ) ;
23
24
24
25
const imports = pluginNames . map ( name => `import { default as ${ cc ( name ) } } from './${ name } /index.js';` ) . join ( EOL ) ;
25
26
const pluginsObj = `export const Plugins = {${ pluginNames
26
27
. map ( name => ( name === cc ( name ) ? `${ name } ,` : `'${ name } ': ${ cc ( name ) } ,` ) )
27
28
. join ( EOL ) } };`;
28
29
29
- fs . writeFileSync ( outputFilePlugins , imports + EOL + EOL + pluginsObj ) ;
30
+ fs . writeFileSync ( outputFilePlugins , HEADER + EOL + imports + EOL + EOL + pluginsObj ) ;
Original file line number Diff line number Diff line change
1
+ // This file is generated (no need to edit)
1
2
import { default as angular } from './angular/index.js' ;
2
3
import { default as astro } from './astro/index.js' ;
3
4
import { default as ava } from './ava/index.js' ;
Original file line number Diff line number Diff line change
1
+ // This file is generated (no need to edit)
1
2
export type PluginName =
2
3
| 'angular'
3
4
| 'astro'
You can’t perform that action at this time.
0 commit comments