mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 19:50:02 +00:00
Optional omission of Typescript entrypoint (#8057)
This commit is contained in:
@@ -706,6 +706,7 @@ struct IDLOptions {
|
|||||||
bool keep_proto_id;
|
bool keep_proto_id;
|
||||||
bool python_no_type_prefix_suffix;
|
bool python_no_type_prefix_suffix;
|
||||||
bool python_typing;
|
bool python_typing;
|
||||||
|
bool ts_omit_entrypoint;
|
||||||
ProtoIdGapAction proto_id_gap_action;
|
ProtoIdGapAction proto_id_gap_action;
|
||||||
|
|
||||||
// Possible options for the more general generator below.
|
// Possible options for the more general generator below.
|
||||||
@@ -818,6 +819,7 @@ struct IDLOptions {
|
|||||||
keep_proto_id(false),
|
keep_proto_id(false),
|
||||||
python_no_type_prefix_suffix(false),
|
python_no_type_prefix_suffix(false),
|
||||||
python_typing(false),
|
python_typing(false),
|
||||||
|
ts_omit_entrypoint(false),
|
||||||
proto_id_gap_action(ProtoIdGapAction::WARNING),
|
proto_id_gap_action(ProtoIdGapAction::WARNING),
|
||||||
mini_reflect(IDLOptions::kNone),
|
mini_reflect(IDLOptions::kNone),
|
||||||
require_explicit_ids(false),
|
require_explicit_ids(false),
|
||||||
|
|||||||
@@ -253,6 +253,8 @@ const static FlatCOption flatc_options[] = {
|
|||||||
{ "", "python-no-type-prefix-suffix", "",
|
{ "", "python-no-type-prefix-suffix", "",
|
||||||
"Skip emission of Python functions that are prefixed with typenames" },
|
"Skip emission of Python functions that are prefixed with typenames" },
|
||||||
{ "", "python-typing", "", "Generate Python type annotations" },
|
{ "", "python-typing", "", "Generate Python type annotations" },
|
||||||
|
{ "", "ts-omit-entrypoint", "",
|
||||||
|
"Omit emission of namespace entrypoint file" },
|
||||||
{ "", "file-names-only", "",
|
{ "", "file-names-only", "",
|
||||||
"Print out generated file names without writing to the files" },
|
"Print out generated file names without writing to the files" },
|
||||||
};
|
};
|
||||||
@@ -659,6 +661,8 @@ FlatCOptions FlatCompiler::ParseFromCommandLineArguments(int argc,
|
|||||||
opts.python_no_type_prefix_suffix = true;
|
opts.python_no_type_prefix_suffix = true;
|
||||||
} else if (arg == "--python-typing") {
|
} else if (arg == "--python-typing") {
|
||||||
opts.python_typing = true;
|
opts.python_typing = true;
|
||||||
|
} else if (arg == "--ts-omit-entrypoint") {
|
||||||
|
opts.ts_omit_entrypoint = true;
|
||||||
} else if (arg == "--annotate-sparse-vectors") {
|
} else if (arg == "--annotate-sparse-vectors") {
|
||||||
options.annotate_include_vector_contents = false;
|
options.annotate_include_vector_contents = false;
|
||||||
} else if (arg == "--annotate") {
|
} else if (arg == "--annotate") {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class TsGenerator : public BaseGenerator {
|
|||||||
bool generate() {
|
bool generate() {
|
||||||
generateEnums();
|
generateEnums();
|
||||||
generateStructs();
|
generateStructs();
|
||||||
generateEntry();
|
if (!parser_.opts.ts_omit_entrypoint) { generateEntry(); }
|
||||||
if (!generateBundle()) return false;
|
if (!generateBundle()) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user