flatbuffers/tests
Philipp Schrader 7106d86685
Remove npm/rules_js dependency for C++ only use cases (#7990)
When flatbuffers is being used from a project that has no use for
JavaScript, users encounter an error similar to the following:

    ERROR: Skipping '@com_github_google_flatbuffers//:flatbuffers': error loading package '@com_github_google_flatbuffers//': Unable to find package for @npm//:defs.bzl: The repository '@npm' could not be resolved: Repository '@npm' is not defined.
    WARNING: Target pattern parsing failed.
    ERROR: error loading package '@com_github_google_flatbuffers//': Unable to find package for @npm//:defs.bzl: The repository '@npm' could not be resolved: Repository '@npm' is not defined.
    INFO: Elapsed time: 0.023s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (0 packages loaded)
        currently loading: @com_github_google_flatbuffers//

That's not ideal. Users that only care about C++ for example
shouldn't be forced to deal with rules_js and friends.

This patch attempts to fix that by moving the rules_js-specific things
into the `ts` and `tests/ts` directories. This should allow
non-JavaScript projects to ignore rules_js and friends completely.

Here I basically followed the `rules_foo` example from rules_js:
https://github.com/aspect-build/rules_js/tree/main/e2e/rules_foo

The idea is that flatbuffers has its own npm dependencies regardless
of what other projects may have. This means we should not force the
user to import flatbuffers's npm dependencies. The new
`ts/repositories.bzl` file is used by dependents to import
flatbuffers's dependencies. They can still import their own
dependencies. This cleanup allowed me to move all
JavaScript-specific stuff from the top-level directory into
subdirectories.

There should be no changes in this patch in terms of functionality.
It's just a refactor of the rules_js call sites. Users will have to
add a call to the function in `ts/repositories.bzl` in their own
`WORKSPACE` file. They can use
`tests/ts/bazel_repository_test/WORKSPACE` as an example.

Co-authored-by: Derek Bailey <derekbailey@google.com>
2024-04-18 05:06:06 +00:00
..
64bit FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
annotated_binary Fixed vtable duplication for binary annotator (#7809) 2023-02-02 10:39:39 -08:00
arrays_test [Rust] Add the Allocator trait for the builder API (#8106) 2023-10-07 15:28:52 -04:00
bazel_repository_test_dir Remove npm/rules_js dependency for C++ only use cases (#7990) 2024-04-18 05:06:06 +00:00
cpp17 FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
DictionaryLookup FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
docker
evolution_test FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
FlatBuffers.Benchmarks
FlatBuffers.Test Target .NET Standard 2.1, .NET 6, .NET 8 only (#8184) 2023-12-19 14:43:55 -08:00
flatc [Kotlin] Control the generation of reflection with --reflect-names (#7775) 2023-01-10 10:03:39 -08:00
fuzzer Rename GenerateText 2023-05-11 18:14:27 -07:00
include_test
include_test1 [Rust] Add the Allocator trait for the builder API (#8106) 2023-10-07 15:28:52 -04:00
include_test2 [Rust] Add the Allocator trait for the builder API (#8106) 2023-10-07 15:28:52 -04:00
key_field FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
keyword_test [Rust] Add the Allocator trait for the builder API (#8106) 2023-10-07 15:28:52 -04:00
KeywordTest FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
minified_enums
monster_test [Rust] Add the Allocator trait for the builder API (#8106) 2023-10-07 15:28:52 -04:00
monster_test_serialize [Rust] Add the Allocator trait for the builder API (#8106) 2023-10-07 15:28:52 -04:00
monster_test_suffix FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
more_defaults [Rust] Add the Allocator trait for the builder API (#8106) 2023-10-07 15:28:52 -04:00
MyGame FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
name_clash_test
namespace_test FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
nested_namespace_test FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
nim
optional_scalars FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
order
private_annotation_test [Rust] Add the Allocator trait for the builder API (#8106) 2023-10-07 15:28:52 -04:00
prototest Parsing from proto should keep field ID. (fixes #7645) (#7655) 2023-02-01 11:17:35 -08:00
rust_namer_test [Rust] Add the Allocator trait for the builder API (#8106) 2023-10-07 15:28:52 -04:00
rust_no_std_compilation_test
rust_serialize_test
rust_usage_test fix(rust): fixed rust namer isses, resolve #7865 and ##7782 (#7964) 2023-05-17 19:54:49 +02:00
swift FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
ts Remove npm/rules_js dependency for C++ only use cases (#7990) 2024-04-18 05:06:06 +00:00
type_field_collsion FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
union_value_collsion FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
union_vector FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
.gitignore remove and auto-generate alignment_test_generated.h 2023-05-12 16:26:21 -07:00
Abc.nim FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
alignment_test.cpp Fix misalignment of small structs in a Vector (C++) (#7883) 2023-09-28 22:53:50 -07:00
alignment_test.fbs Fix misalignment of small structs in a Vector (C++) (#7883) 2023-09-28 22:53:50 -07:00
alignment_test.h
alignment_test.json Fix misalignment of small structs in a Vector (C++) (#7883) 2023-09-28 22:53:50 -07:00
alignment_test_after_fix.afb Fix misalignment of small structs in a Vector (C++) (#7883) 2023-09-28 22:53:50 -07:00
alignment_test_after_fix.bin Fix misalignment of small structs in a Vector (C++) (#7883) 2023-09-28 22:53:50 -07:00
alignment_test_before_fix.afb Fix misalignment of small structs in a Vector (C++) (#7883) 2023-09-28 22:53:50 -07:00
alignment_test_before_fix.bin Fix misalignment of small structs in a Vector (C++) (#7883) 2023-09-28 22:53:50 -07:00
arrays_test.bfbs
arrays_test.fbs
arrays_test.golden
arrays_test.schema.json
bazel_repository_test_template.sh Remove npm/rules_js dependency for C++ only use cases (#7990) 2024-04-18 05:06:06 +00:00
BUILD.bazel Remove npm/rules_js dependency for C++ only use cases (#7990) 2024-04-18 05:06:06 +00:00
DartTest.sh
defs.bzl Remove npm/rules_js dependency for C++ only use cases (#7990) 2024-04-18 05:06:06 +00:00
dictionary_lookup.fbs
evolution_test.cpp feat(C++): Support underlying_type for union (#7954) 2023-05-14 21:22:38 -07:00
evolution_test.h
flexbuffers_test.cpp FlexBuffers: JSON output supports indentation 2023-06-14 18:12:55 -07:00
flexbuffers_test.h
fuzz_test.cpp Rename GenerateText 2023-05-11 18:14:27 -07:00
fuzz_test.h
go_test.go Support file_identifier in Go (#7904) 2023-04-26 05:15:09 +00:00
gold_flexbuffer_example.bin
GoTest.sh
include_build_test.cc
include_test1_generated.dart
include_test2_my_game.other_name_space_generated.dart
included_test.fbs
includer_test.fbs
is_quiet_nan.h
javatest.bin
json_test.cpp Rename GenerateText 2023-05-11 18:14:27 -07:00
json_test.h Make JSON supporting advanced union features (#7869) 2023-04-26 05:37:06 +00:00
key_field_test.cpp run scripts/clang-format-all.sh 2023-05-11 12:23:49 -07:00
key_field_test.h [C++] Enable using struct and array of struct as key (#7741) 2023-01-24 16:37:13 -08:00
keyword_test.fbs
KotlinTest.kt
KotlinTest.sh Add Kotlin multiplatform support (#7969) 2023-05-26 11:00:33 -07:00
LobsterTest.bat Lobster namespace change 2023-09-17 10:21:58 -07:00
lobstertest.lobster corrected a typo (#8063) 2023-09-29 07:40:02 -07:00
LuaTest.bat
luatest.lua
LuaTest.sh
monster_extra.fbs
monster_extra_generated.h FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
monster_extra_my_game_generated.dart
monster_test.afb Fixed vtable duplication for binary annotator (#7809) 2023-02-02 10:39:39 -08:00
monster_test.bfbs
monster_test.cpp Fix handling non null-terminated string_views in LookupByKey (#8203) 2024-03-25 10:39:51 -07:00
monster_test.fbs
monster_test.grpc.fb.cc
monster_test.grpc.fb.h
monster_test.h
monster_test.schema.json
monster_test_bfbs_generated.h don't emit flatbuffers include in bfbs generated output (#7968) 2023-05-17 21:13:16 -07:00
monster_test_generated.grpc.fb.cc
monster_test_generated.grpc.fb.h
monster_test_generated.h FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
monster_test_generated.lobster Lobster namespace change 2023-09-17 10:21:58 -07:00
monster_test_generated.py Fix python tests (#7960) 2023-05-17 13:10:51 -07:00
monster_test_generated.ts
monster_test_my_game.example2_generated.dart
monster_test_my_game.example_generated.dart
monster_test_my_game_generated.dart
monsterdata_extra.json
monsterdata_go_wire.mon.sp Support file_identifier in Go (#7904) 2023-04-26 05:15:09 +00:00
monsterdata_python_wire.mon
monsterdata_test.afb Fixed vtable duplication for binary annotator (#7809) 2023-02-02 10:39:39 -08:00
monsterdata_test.golden
monsterdata_test.json
monsterdata_test.mon
more_defaults.fbs
MoreDefaults.nim FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
MutatingBool.fbs
nan_inf_test.fbs
native_inline_table_test.fbs
native_inline_table_test_generated.h FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
native_type_test.fbs
native_type_test_generated.h FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
native_type_test_impl.cpp
native_type_test_impl.h
nested_union_test.fbs
optional_scalars.fbs
optional_scalars.json
optional_scalars_defaults.json
optional_scalars_generated.h FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
optional_scalars_generated.lobster Lobster namespace change 2023-09-17 10:21:58 -07:00
optional_scalars_generated.ts
optional_scalars_test.cpp run scripts/clang-format-all.sh 2023-05-11 12:23:49 -07:00
optional_scalars_test.h
parser_test.cpp feat: Support union underlying type for TS/JS (#7961) 2023-05-15 13:18:49 -07:00
parser_test.h
phpTest.php
phpUnionVectorTest.php
phpUnionVectorTest.sh
Pizza.go
private_annotation_test.fbs
Property.nim FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
proto_test.cpp Rename GenerateText 2023-05-11 18:14:27 -07:00
proto_test.h Parsing from proto should keep field ID. (fixes #7645) (#7655) 2023-02-01 11:17:35 -08:00
py_flexbuffers_test.py Fix Python host-endianness dependencies (#7773) 2023-01-10 10:20:08 -08:00
py_test.py Add Clear() for python Builder (#8186) 2023-12-17 22:18:11 -08:00
PythonTest.sh Add Clear() for python Builder (#8186) 2023-12-17 22:18:11 -08:00
reflection_test.cpp various fixes (#7986) 2023-05-31 11:52:05 -07:00
reflection_test.h
required_strings.fbs [TS]: builder, Fix requiredField(). Verity that the field is present in the vtable (#7739) (#7752) 2023-01-10 10:43:17 -08:00
rust_namer_test.fbs fix(rust): fixed rust namer isses, resolve #7865 and ##7782 (#7964) 2023-05-17 19:54:49 +02:00
RustTest.bat chore: add rust windows test to CI, fix RustTest.bat (#7963) 2023-05-16 16:06:41 -07:00
RustTest.sh
TableA.lua FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
TableA.nim FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
TableAT.java
test.cpp Fix CI builds (#8161) 2023-11-18 00:19:03 -08:00
test.fbs Optionally generate Python type annotations (#7858) 2023-04-28 09:38:29 -07:00
test_assert.cpp
test_assert.h moved function to namespace (#8068) 2023-09-29 07:50:06 -07:00
test_builder.cpp run scripts/clang-format-all.sh 2023-05-11 12:23:49 -07:00
test_builder.h FlatBuffers 64 for C++ (#7935) 2023-05-09 09:16:30 -07:00
TestAll.sh [TS] Allows object API to set 0 for a null-default scalar. (#7864) 2023-09-12 19:58:55 +02:00
TestMutatingBool.nim FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
type_field_collsion.fbs
unicode_test.json
unicode_test.mon
union_underlying_type_test.fbs feat(C++): Support underlying_type for union (#7954) 2023-05-14 21:22:38 -07:00
union_underlying_type_test_generated.h FlatBuffers Version v24.3.25 2024-03-26 05:18:07 +00:00
union_value_collision.fbs [CS] Naming collision if field has same name as table and used as key (#7842) 2023-03-02 21:42:27 -08:00
util_test.cpp ToCamelCase() when kLowerCamel now converts first char to lower. (#7838) 2023-03-15 01:09:24 +00:00
util_test.h
vector_has_test.fbs