1
- use crate :: util:: { is_reducer_invokable, iter_reducers, iter_tables, iter_types, iter_unique_cols} ;
1
+ use crate :: util:: {
2
+ is_reducer_invokable, iter_reducers, iter_tables, iter_types, iter_unique_cols,
3
+ print_auto_generated_version_comment,
4
+ } ;
2
5
use crate :: { indent_scope, OutputFile } ;
3
6
4
7
use super :: util:: { collect_case, print_auto_generated_file_comment, type_ref_name} ;
@@ -33,7 +36,7 @@ impl Lang for TypeScript {
33
36
let mut output = CodeIndenter :: new ( String :: new ( ) , INDENT ) ;
34
37
let out = & mut output;
35
38
36
- print_file_header ( out) ;
39
+ print_file_header ( out, false ) ;
37
40
gen_and_print_imports ( module, out, & product. elements , & [ typ. ty ] , None ) ;
38
41
writeln ! ( out) ;
39
42
define_body_for_product ( module, out, & type_name, & product. elements ) ;
@@ -48,7 +51,7 @@ impl Lang for TypeScript {
48
51
let mut output = CodeIndenter :: new ( String :: new ( ) , INDENT ) ;
49
52
let out = & mut output;
50
53
51
- print_file_header ( out) ;
54
+ print_file_header ( out, false ) ;
52
55
// Note that the current type is not included in dont_import below.
53
56
gen_and_print_imports ( module, out, variants, & [ ] , Some ( "Type" ) ) ;
54
57
writeln ! ( out) ;
@@ -64,7 +67,7 @@ impl Lang for TypeScript {
64
67
let mut output = CodeIndenter :: new ( String :: new ( ) , INDENT ) ;
65
68
let out = & mut output;
66
69
67
- print_file_header ( out) ;
70
+ print_file_header ( out, false ) ;
68
71
gen_and_print_imports ( module, out, variants, & [ typ. ty ] , None ) ;
69
72
writeln ! (
70
73
out,
@@ -113,7 +116,7 @@ impl Lang for TypeScript {
113
116
let mut output = CodeIndenter :: new ( String :: new ( ) , INDENT ) ;
114
117
let out = & mut output;
115
118
116
- print_file_header ( out) ;
119
+ print_file_header ( out, false ) ;
117
120
118
121
let type_ref = table. product_type_ref ;
119
122
let row_type = type_ref_name ( module, type_ref) ;
@@ -280,7 +283,7 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type})
280
283
let mut output = CodeIndenter :: new ( String :: new ( ) , INDENT ) ;
281
284
let out = & mut output;
282
285
283
- print_file_header ( out) ;
286
+ print_file_header ( out, false ) ;
284
287
285
288
out. newline ( ) ;
286
289
@@ -307,7 +310,7 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type})
307
310
let mut output = CodeIndenter :: new ( String :: new ( ) , INDENT ) ;
308
311
let out = & mut output;
309
312
310
- print_file_header ( out) ;
313
+ print_file_header ( out, true ) ;
311
314
312
315
out. newline ( ) ;
313
316
@@ -697,8 +700,11 @@ fn print_spacetimedb_imports(out: &mut Indenter) {
697
700
writeln ! ( out, "}} from \" @clockworklabs/spacetimedb-sdk\" ;" ) ;
698
701
}
699
702
700
- fn print_file_header ( output : & mut Indenter ) {
703
+ fn print_file_header ( output : & mut Indenter , include_version : bool ) {
701
704
print_auto_generated_file_comment ( output) ;
705
+ if include_version {
706
+ print_auto_generated_version_comment ( output) ;
707
+ }
702
708
print_lint_suppression ( output) ;
703
709
print_spacetimedb_imports ( output) ;
704
710
}
0 commit comments