mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 11:22:41 +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:
@@ -1,5 +1,5 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_test")
|
||||
load("//:build_defs.bzl", "flatbuffer_cc_library")
|
||||
load("//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_ts_library")
|
||||
|
||||
package(default_visibility = ["//visibility:private"])
|
||||
|
||||
@@ -190,3 +190,12 @@ flatbuffer_cc_library(
|
||||
"--cpp-ptr-type flatbuffers::unique_ptr",
|
||||
],
|
||||
)
|
||||
|
||||
flatbuffer_ts_library(
|
||||
name = "typescript_ts_fbs",
|
||||
srcs = ["typescript_keywords.fbs"],
|
||||
deps = [
|
||||
"//tests/test_dir:include_ts_fbs",
|
||||
"//tests/test_dir:typescript_transitive_ts_fbs",
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user