mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-06 05:27:24 +00:00
[TS] Add single-file ts codegen & bazel rule for typescript (#7161)
The headline here is adding a flatbuffer_ts_library rule for generating typescript code in bazel. This entails some non-trivial other changes, but ideally none are user-visible. In particular: * Added a --ts-flat-file flag that generates a single *_generated.ts file instead of separate files for each typescript type. This makes bazel much happier. * Import the bazel rules_nodejs stuff needed to support building typescript in bazel * Move flatbuffers.ts to index.ts because I wasn't sure how to make bazel comprehend the "main" attribute of the package.json. Happy to take another stab at figuring that out if really needed. * Fix another couple keyword escaping spots in typescript...
This commit is contained in:
@@ -601,6 +601,7 @@ struct IDLOptions {
|
||||
bool json_nested_flatbuffers;
|
||||
bool json_nested_flexbuffers;
|
||||
bool json_nested_legacy_flatbuffers;
|
||||
bool ts_flat_file;
|
||||
|
||||
// Possible options for the more general generator below.
|
||||
enum Language {
|
||||
@@ -698,6 +699,7 @@ struct IDLOptions {
|
||||
json_nested_flatbuffers(true),
|
||||
json_nested_flexbuffers(true),
|
||||
json_nested_legacy_flatbuffers(false),
|
||||
ts_flat_file(false),
|
||||
mini_reflect(IDLOptions::kNone),
|
||||
require_explicit_ids(false),
|
||||
rust_serialize(false),
|
||||
|
||||
Reference in New Issue
Block a user