mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 13:31:37 +00:00
Merge branch 'master' into master
This commit is contained in:
26
WORKSPACE
26
WORKSPACE
@@ -79,9 +79,9 @@ grpc_extra_deps()
|
|||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "aspect_rules_js",
|
name = "aspect_rules_js",
|
||||||
sha256 = "124ed29fb0b3d0cba5b44f8f8e07897cf61b34e35e33b1f83d1a943dfd91b193",
|
sha256 = "bdbd6df52fc7963f55281fe0a140e21de8ec587ab711a8a2fff0715b6710a4f8",
|
||||||
strip_prefix = "rules_js-1.24.0",
|
strip_prefix = "rules_js-1.32.0",
|
||||||
url = "https://github.com/aspect-build/rules_js/releases/download/v1.24.0/rules_js-v1.24.0.tar.gz",
|
url = "https://github.com/aspect-build/rules_js/releases/download/v1.32.0/rules_js-v1.32.0.tar.gz",
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
|
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
|
||||||
@@ -94,9 +94,9 @@ pnpm_repository(name = "pnpm")
|
|||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "aspect_rules_ts",
|
name = "aspect_rules_ts",
|
||||||
sha256 = "8eb25d1fdafc0836f5778d33fb8eaac37c64176481d67872b54b0a05de5be5c0",
|
sha256 = "4c3f34fff9f96ffc9c26635d8235a32a23a6797324486c7d23c1dfa477e8b451",
|
||||||
strip_prefix = "rules_ts-1.3.3",
|
strip_prefix = "rules_ts-1.4.5",
|
||||||
url = "https://github.com/aspect-build/rules_ts/releases/download/v1.3.3/rules_ts-v1.3.3.tar.gz",
|
url = "https://github.com/aspect-build/rules_ts/releases/download/v1.4.5/rules_ts-v1.4.5.tar.gz",
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
|
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
|
||||||
@@ -132,25 +132,25 @@ npm_repositories()
|
|||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "aspect_rules_esbuild",
|
name = "aspect_rules_esbuild",
|
||||||
sha256 = "2ea31bd97181a315e048be693ddc2815fddda0f3a12ca7b7cc6e91e80f31bac7",
|
sha256 = "098e38e5ee868c14a6484ba263b79e57d48afacfc361ba30137c757a9c4716d6",
|
||||||
strip_prefix = "rules_esbuild-0.14.4",
|
strip_prefix = "rules_esbuild-0.15.0",
|
||||||
url = "https://github.com/aspect-build/rules_esbuild/releases/download/v0.14.4/rules_esbuild-v0.14.4.tar.gz",
|
url = "https://github.com/aspect-build/rules_esbuild/releases/download/v0.15.0/rules_esbuild-v0.15.0.tar.gz",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Register a toolchain containing esbuild npm package and native bindings
|
# Register a toolchain containing esbuild npm package and native bindings
|
||||||
load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_VERSION", "esbuild_register_toolchains")
|
load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains")
|
||||||
|
|
||||||
esbuild_register_toolchains(
|
esbuild_register_toolchains(
|
||||||
name = "esbuild",
|
name = "esbuild",
|
||||||
esbuild_version = LATEST_VERSION,
|
esbuild_version = LATEST_ESBUILD_VERSION,
|
||||||
)
|
)
|
||||||
|
|
||||||
http_file(
|
http_file(
|
||||||
name = "bazel_linux_x86_64",
|
name = "bazel_linux_x86_64",
|
||||||
downloaded_file_path = "bazel",
|
downloaded_file_path = "bazel",
|
||||||
executable = True,
|
executable = True,
|
||||||
sha256 = "e89747d63443e225b140d7d37ded952dacea73aaed896bca01ccd745827c6289",
|
sha256 = "e78fc3394deae5408d6f49a15c7b1e615901969ecf6e50d55ef899996b0b8458",
|
||||||
urls = [
|
urls = [
|
||||||
"https://github.com/bazelbuild/bazel/releases/download/6.1.2/bazel-6.1.2-linux-x86_64",
|
"https://github.com/bazelbuild/bazel/releases/download/6.3.2/bazel-6.3.2-linux-x86_64",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
load("@aspect_rules_js//js:defs.bzl", "js_test")
|
load("@aspect_rules_js//js:defs.bzl", "js_test")
|
||||||
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
|
|
||||||
load("@aspect_rules_js//npm:defs.bzl", "npm_link_package")
|
load("@aspect_rules_js//npm:defs.bzl", "npm_link_package")
|
||||||
|
load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
|
||||||
load("@npm//:defs.bzl", "npm_link_all_packages")
|
load("@npm//:defs.bzl", "npm_link_all_packages")
|
||||||
|
|
||||||
npm_link_all_packages(name = "node_modules")
|
npm_link_all_packages(name = "node_modules")
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
|
|
||||||
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
|
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
|
||||||
|
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
name = "distribution",
|
name = "distribution",
|
||||||
|
|||||||
Reference in New Issue
Block a user