TypeScript support (#4232)

* Eclipse ignore

* TypeScript support

* Prefixing enums

* Test results

* Merged JS and TS generators

* Fixed AppVeyor build problems

* Fixed more AppVeyor build problems

* Fixed more AppVeyor build problems

* Changed TS flag to options struct

* Storing options by value

* Removed unneeded const

* Re-export support for unions

* Uint support

* Casting bools to numbers for mutation

* TS shell tests

* Reverted generates js test file to original version

* Backing up js tests and properly generating test data
This commit is contained in:
Kamil Rojewski
2017-04-10 19:01:13 +02:00
committed by Wouter van Oortmerssen
parent adc50051e0
commit 28e7dbd3d3
13 changed files with 2672 additions and 104 deletions

View File

@@ -103,6 +103,8 @@ std::string FlatCompiler::GetUsageString(const char* program_name) const {
" PATH \n"
" --include-prefix Prefix this path to any generated include statements.\n"
" PATH\n"
" --no-fb-import Don't include flatbuffers import statement for TypeScript.\n"
" --no-ts-reexport Don't re-export imported dependencies for TypeScript.\n"
"FILEs may be schemas, or JSON files (conforming to preceding schema)\n"
"FILEs after the -- must be binary flatbuffer format files.\n"
"Output files are named using the base file name of the input,\n"
@@ -216,6 +218,10 @@ int FlatCompiler::Compile(int argc, const char** argv) {
grpc_enabled = true;
} else if(arg == "--bfbs-comments") {
opts.binary_schema_comments = true;
} else if(arg == "--no-fb-import") {
opts.skip_flatbuffers_import = true;
} else if(arg == "--no-ts-reexport") {
opts.reexport_ts_modules = false;
} else {
for (size_t i = 0; i < params_.num_generators; ++i) {
if (arg == params_.generators[i].generator_opt_long ||