[TS/JS] New gen TS code gen (#6302)
authorBjörn Harrtell <bjornharrtell@users.noreply.github.com>
Tue, 19 Jan 2021 20:51:13 +0000 (21:51 +0100)
committerGitHub <noreply@github.com>
Tue, 19 Jan 2021 20:51:13 +0000 (12:51 -0800)
commit760c657551230c0c29d4c9a43fbf62602fe4b5a8
treef66f6ef768184610373a45e6ef436642413ed57b
parent75c859e98f360b07fa7168afcf1b3902c6a19540
[TS/JS] New gen TS code gen (#6302)

* TS/ES6 modules spike iteration 1

* Initial modularized dasherized output

* Remove obsoleted parts and namespace wrapping

* Use _flatbuffers_ prefix

* First part of imports logic

* Second part of imports logic

* Fix TS/JS code removal mixup

* Alias imported symbols if same name from different namespaces and some fixes

* Use star import for bare imports

* Fix messed up string concat

* var to const and remove not needed semi

* Remove some cases of ns prefixing

* Add missing space

* Cleanups

* Completed initial import tracking logic

* Compilable output

* Adjust TypeScriptTest and dependents to work

* Use local flatbuffers package for tests

* Refactor away use of any

* Remove obsolete imported_fileset and reexport_map

* Still need any and fix JavaScriptTest.sh

* Fix test runs out of the box

* Temp add generated files

* TypeScriptTest replaces JavaScriptTest and cleanups

* Also remove reference to JavaScriptTest in TestAll.sh

* Remove old generated ts/js files

* Remove use of --js in generate_code scripts

* idl_gen_js_ts to idl_gen_ts and removal of js gen

* Remove obsoleted options

* Fix obsolete ts test detection

* Tweak ts compilation be as strict as possible

* Remove jsdoc type annotation generation

* Generated test ts files

* Fix search and replace messup

* Regenerated ts test output

* Use CharToLower

* Use normal for loop

* Rework namespacedir

* Revert "Rework namespacedir"

This reverts commit 6f4eb0104ceeb86011bb076ebca901138c48e068.

* Revert "Use normal for loop"

This reverts commit 676b2135bfaa1853dfbb06c92b5c16a0d81bb13a.

* Revert "Use CharToLower"

This reverts commit 2d08648d0d72d0af201fad80d54cdc76412b35e9.

* Again do rework but correct

* Avoid runtime cast

* Fix test runs

* Also add npm install to get tsc

* Bump node test versions

* for range to std for loop

* Clang format

* Missed one clang format

* Move accessor to later

* Attempt to make windows version of TypeScriptTest

* Want to see the output

* Try to get newer node at appveyor

* Style changes
56 files changed:
appveyor.yml
docs/source/Compiler.md
docs/source/TypeScriptUsage.md
include/flatbuffers/code_generators.h
include/flatbuffers/idl.h
include/flatbuffers/util.h
package.json
src/code_generators.cpp
src/flatc.cpp
src/flatc_main.cpp
src/idl_gen_ts.cpp
src/idl_parser.cpp
tests/JavaScriptFlexBuffersTest.js
tests/JavaScriptTest.js
tests/JavaScriptTest.sh [deleted file]
tests/JavaScriptUnionVectorTest.js
tests/TestAll.sh
tests/TypeScriptTest.bat [new file with mode: 0755]
tests/TypeScriptTest.sh
tests/docker/languages/Dockerfile.testing.node.10_13_0 [deleted file]
tests/docker/languages/Dockerfile.testing.node.11_2_0 [deleted file]
tests/docker/languages/Dockerfile.testing.node.12_20_1 [new file with mode: 0644]
tests/docker/languages/Dockerfile.testing.node.14_15_4 [new file with mode: 0644]
tests/generate_code.bat
tests/generate_code.sh
tests/monster_test_grpc.d.ts [deleted file]
tests/monster_test_grpc.js [deleted file]
tests/optional_scalars_generated.js [deleted file]
tests/optional_scalars_generated.ts [deleted file]
tests/package.json [new file with mode: 0644]
tests/ts/attacker.ts [new file with mode: 0644]
tests/ts/book-reader.ts [new file with mode: 0644]
tests/ts/character.ts [new file with mode: 0644]
tests/ts/movie.ts [new file with mode: 0644]
tests/ts/my-game/example/ability.ts [new file with mode: 0644]
tests/ts/my-game/example/any-ambiguous-aliases.ts [new file with mode: 0644]
tests/ts/my-game/example/any-unique-aliases.ts [new file with mode: 0644]
tests/ts/my-game/example/any.ts [new file with mode: 0644]
tests/ts/my-game/example/color.ts [new file with mode: 0644]
tests/ts/my-game/example/monster.ts [new file with mode: 0644]
tests/ts/my-game/example/race.ts [new file with mode: 0644]
tests/ts/my-game/example/referrable.ts [new file with mode: 0644]
tests/ts/my-game/example/stat.ts [new file with mode: 0644]
tests/ts/my-game/example/test-simple-table-with-enum.ts [new file with mode: 0644]
tests/ts/my-game/example/test.ts [new file with mode: 0644]
tests/ts/my-game/example/type-aliases.ts [new file with mode: 0644]
tests/ts/my-game/example/vec3.ts [new file with mode: 0644]
tests/ts/my-game/example2/monster.ts [new file with mode: 0644]
tests/ts/my-game/in-parent-namespace.ts [new file with mode: 0644]
tests/ts/rapunzel.ts [new file with mode: 0644]
tests/tsconfig.json [new file with mode: 0644]
ts/builder.ts
ts/byte-buffer.ts
ts/flatbuffers.ts
ts/flexbuffers.ts
yarn.lock [deleted file]