1- import Generator from "yeoman-generator" ;
2- import path from "path" ;
3- import { IWebpackCLI } from "webpack-cli" ;
1+ import type Generator from "yeoman-generator" ;
2+ import { type IWebpackCLI } from "webpack-cli" ;
43
54export type InitOptions = { template : string ; force ?: boolean } ;
65export type LoaderOptions = { template : string } ;
@@ -20,32 +19,3 @@ export type CustomGeneratorOptions<T extends BaseCustomGeneratorOptions> =
2019 cli : IWebpackCLI ;
2120 options : T ;
2221 } ;
23-
24- export class CustomGenerator <
25- T extends BaseCustomGeneratorOptions = BaseCustomGeneratorOptions ,
26- Z extends CustomGeneratorOptions < T > = CustomGeneratorOptions < T > ,
27- > extends Generator < Z > {
28- public cli : IWebpackCLI ;
29- public template : string ;
30- public dependencies : string [ ] ;
31- public force : boolean ;
32- public answers : Record < string , unknown > ;
33- public generationPath : string ;
34- public supportedTemplates : string [ ] ;
35- public packageManager : string | undefined ;
36-
37- public constructor ( args : string | string [ ] , opts : Z ) {
38- super ( args , opts ) ;
39-
40- this . cli = opts . cli ;
41- this . dependencies = [ ] ;
42- this . answers = { } ;
43- this . supportedTemplates = [ ] ;
44-
45- const { options } = opts ;
46-
47- this . template = options . template ;
48- this . force = typeof options . force !== "undefined" ? options . force : false ;
49- this . generationPath = path . resolve ( process . cwd ( ) , options . generationPath ) ;
50- }
51- }
0 commit comments