@@ -23,8 +23,8 @@ type Options struct {
23
23
TSImportRootAliases string
24
24
// FetchModuleDirectory is the parameter for directory where fetch module will live
25
25
FetchModuleDirectory string
26
- // FetchModuleFileName is the file name for the individual fetch module
27
- FetchModuleFileName string
26
+ // FetchModuleFilename is the file name for the individual fetch module
27
+ FetchModuleFilename string
28
28
// UseProtoNames will generate field names the same as defined in the proto
29
29
UseProtoNames bool
30
30
// UseStaticClasses will cause the generator to generate a static class in the form ServiceName.MethodName, which is
@@ -41,6 +41,8 @@ type Options struct {
41
41
// Registry analyze generation request, spits out the data the the rendering process
42
42
// it also holds the information about all the types
43
43
type Registry struct {
44
+ Options
45
+
44
46
// Types stores the type information keyed by the fully qualified name of a type
45
47
Types map [string ]* TypeInformation
46
48
@@ -53,27 +55,6 @@ type Registry struct {
53
55
// TSImportRootAliases if not empty will substitutes the common import root when writing the import into the js file
54
56
TSImportRootAliases []string
55
57
56
- // FetchModuleDirectory is the directory to place fetch module file
57
- FetchModuleDirectory string
58
-
59
- // FetchModuleFilename is the filename for the fetch module
60
- FetchModuleFilename string
61
-
62
- // UseProtoNames will cause the generator to generate field name the same as defined in the proto
63
- UseProtoNames bool
64
-
65
- // UseStaticClasses will cause the generator to generate a static class in the form ServiceName.MethodName, which is
66
- // the legacy behavior for this generator. If set to false, the generator will generate a client class with methods
67
- // as well as static methods exported for each service method.
68
- UseStaticClasses bool
69
-
70
- // EmitUnpopulated mirrors the grpc gateway protojson configuration of the same name and allows
71
- // clients to differentiate between zero values and optional values that aren't set.
72
- EmitUnpopulated bool
73
-
74
- // EnableStylingCheck enables both eslint and tsc check for the generated code
75
- EnableStylingCheck bool
76
-
77
58
// TSPackages stores the package name keyed by the TS file name
78
59
TSPackages map [string ]string
79
60
}
@@ -88,19 +69,14 @@ func NewRegistry(opts Options) (*Registry, error) {
88
69
}
89
70
90
71
log .Debugf ("found fetch module directory %s" , opts .FetchModuleDirectory )
91
- log .Debugf ("found fetch module name %s" , opts .FetchModuleFileName )
72
+ log .Debugf ("found fetch module name %s" , opts .FetchModuleFilename )
92
73
93
74
return & Registry {
94
- Types : make (map [string ]* TypeInformation ),
95
- TSImportRoots : tsImportRoots ,
96
- TSImportRootAliases : tsImportRootAliases ,
97
- FetchModuleDirectory : opts .FetchModuleDirectory ,
98
- FetchModuleFilename : opts .FetchModuleFileName ,
99
- TSPackages : make (map [string ]string ),
100
- UseProtoNames : opts .UseProtoNames ,
101
- UseStaticClasses : opts .UseStaticClasses ,
102
- EmitUnpopulated : opts .EmitUnpopulated ,
103
- EnableStylingCheck : opts .EnableStylingCheck ,
75
+ Options : opts ,
76
+ Types : make (map [string ]* TypeInformation ),
77
+ TSPackages : make (map [string ]string ),
78
+ TSImportRoots : tsImportRoots ,
79
+ TSImportRootAliases : tsImportRootAliases ,
104
80
}, nil
105
81
}
106
82
0 commit comments