[TS/JS] Entry point per namespace and reworked 1.x compatible single file build (#7510)

* [TS/JS] Entry point per namespace

* Fix handling of outputpath and array_test

* Attempt to fix generate_code

* Fix cwd for ts in generate_code

* Attempt to fixup bazel and some docs

* Add --ts-flat-files to bazel build to get bundle

* Move to DEFAULT_FLATC_TS_ARGS

* Attempt to add esbuild

* Attempt to use npm instead

* Remove futile attempt to add esbuild

* Attempt to as bazel esbuild

* Shuffle

* Upgrade bazel deps

* Revert failed attempts to get bazel working

* Ignore flatc tests for now

* Add esbuild dependency

* `package.json` Include esbuild

* `WORKSPACE` Add fetching esbuild binary

* Update WORKSPACE

* Unfreeze Lockfile

* Update WORKSPACE

* Update BUILD.bazel

* Rework to suggest instead of running external bundler

* Add esbuild generation to test script

* Prelim bundle test

* Run test JavaScriptTest from flatbuffers 1.x

* Deps upgrade

* Clang format fix

* Revert bazel changes

* Fix newline

* Generate with type declarations

* Handle "empty" root namespace

* Adjust tests for typescript_keywords.ts

* Separate test procedure for old node resolution module output

* Fix rel path for root level re-exports

* Bazel support for esbuild-based flatc

Unfortunately, we lose typing information because the new esbuild method
of generating single files does not generate type information.

The method used here is a bit hack-ish because it relies on parsing the
console output of flatc to figure out what to do.

* Try to fix bazel build for when node isn't present on host

* Auto formatting fixes

* Fix missing generated code

Co-authored-by: Derek Bailey <derekbailey@google.com>
Co-authored-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
252 files changed
tree: d91b74372601c7f4990f221b5722094021fdf729
  1. .bazelci/
  2. .github/
  3. android/
  4. bazel/
  5. benchmarks/
  6. CMake/
  7. conan/
  8. dart/
  9. docs/
  10. examples/
  11. go/
  12. grpc/
  13. include/
  14. java/
  15. js/
  16. kotlin/
  17. lobster/
  18. lua/
  19. mjs/
  20. net/
  21. nim/
  22. php/
  23. python/
  24. reflection/
  25. rust/
  26. samples/
  27. scripts/
  28. snap/
  29. src/
  30. swift/
  31. tests/
  32. ts/
  33. .clang-format
  34. .clang-tidy
  35. .editorconfig
  36. .eslintrc.js
  37. .gitattributes
  38. .gitignore
  39. BUILD.bazel
  40. build_defs.bzl
  41. CHANGELOG.md
  42. CMakeLists.txt
  43. composer.json
  44. conanfile.py
  45. CONTRIBUTING.md
  46. FlatBuffers.podspec
  47. Formatters.md
  48. LICENSE.txt
  49. package.json
  50. Package.swift
  51. Package@swift-5.5.swift
  52. readme.md
  53. SECURITY.md
  54. swift.swiftformat
  55. tsconfig.json
  56. tsconfig.mjs.json
  57. typescript.bzl
  58. WORKSPACE
  59. yarn.lock
readme.md

logo FlatBuffers

Build status BuildKite status Fuzzing Status OpenSSF Scorecard Join the chat at https://gitter.im/google/flatbuffers Discord Chat Twitter Follow Twitter Follow

FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.

Go to our landing page to browse our documentation.

Supported operating systems

  • Windows
  • macOS
  • Linux
  • Android
  • And any others with a recent C++ compiler (C++ 11 and newer)

Supported programming languages

Code generation and runtime libraries for many popular languages.

  1. C
  2. C++ - snapcraft.io
  3. C# - nuget.org
  4. Dart - pub.dev
  5. Go - go.dev
  6. Java - Maven
  7. JavaScript - NPM
  8. Kotlin
  9. Lobster
  10. Lua
  11. PHP
  12. Python - PyPi
  13. Rust - crates.io
  14. Swift - swiftpackageindex
  15. TypeScript - NPM
  16. Nim

Versioning

FlatBuffers does not follow traditional Semver versioning (see rationale) but rather uses a format of the date of the release.

Contribution

To contribute to this project, see CONTRIBUTING.

Community

Security

Please see our Security Policy for reporting vulnerabilities.

Licensing

Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.