File
Blob: tools/BUILD.bazel
| 1 | load("@aspect_rules_js//js:defs.bzl", "js_library", "js_test") |
| 2 | load("@aspect_rules_ts//ts:defs.bzl", "ts_config") |
| 3 | load("@bazel_skylib//rules:native_binary.bzl", "native_binary") |
| 4 | |
| 5 | exports_files( |
| 6 | [ |
| 7 | "base.eslint.config.mjs", |
| 8 | "base.tsconfig.json", |
| 9 | ], |
| 10 | visibility = ["//visibility:public"], |
| 11 | ) |
| 12 | |
| 13 | js_library( |
| 14 | name = "base-eslint", |
| 15 | srcs = [ |
| 16 | "base.eslint.config.mjs", |
| 17 | "custom-eslint-rules.mjs", |
| 18 | ], |
| 19 | visibility = ["//visibility:public"], |
| 20 | deps = [ |
| 21 | "//:node_modules/@eslint/js", |
| 22 | "//:node_modules/@types/node", |
| 23 | "//:node_modules/eslint", |
| 24 | "//:node_modules/typescript", |
| 25 | "//:node_modules/typescript-eslint", |
| 26 | ], |
| 27 | ) |
| 28 | |
| 29 | js_test( |
| 30 | name = "custom-eslint-rules-test", |
| 31 | size = "small", |
| 32 | data = [ |
| 33 | ":base-eslint", |
| 34 | ], |
| 35 | entry_point = "custom-eslint-rules.test.mjs", |
| 36 | tags = ["js-test"], |
| 37 | ) |
| 38 | |
| 39 | ts_config( |
| 40 | name = "base-tsconfig", |
| 41 | src = "base.tsconfig.json", |
| 42 | visibility = ["//visibility:public"], |
| 43 | ) |
| 44 | |
| 45 | native_binary( |
| 46 | name = "wasm-tools", |
| 47 | src = select( |
| 48 | { |
| 49 | "@bazel_tools//src/conditions:linux_x86_64": "@wasm_tools_linux_x64//:wasm-tools", |
| 50 | "@bazel_tools//src/conditions:linux_aarch64": "@wasm_tools_linux_arm64//:wasm-tools", |
| 51 | "@bazel_tools//src/conditions:darwin_arm64": "@wasm_tools_macos_arm64//:wasm-tools", |
| 52 | "@bazel_tools//src/conditions:darwin_x86_64": "@wasm_tools_macos_x64//:wasm-tools", |
| 53 | "@bazel_tools//src/conditions:windows_x64": "@wasm_tools_windows_x64//:wasm-tools.exe", |
| 54 | }, |
| 55 | ), |
| 56 | out = "wasm-tools", |
| 57 | visibility = ["//visibility:public"], |
| 58 | ) |
| 59 | |
| 60 | native_binary( |
| 61 | name = "clang-tidy", |
| 62 | src = select( |
| 63 | { |
| 64 | "@bazel_tools//src/conditions:linux_x86_64": "@clang_tidy_linux_amd64//file:downloaded", |
| 65 | "@bazel_tools//src/conditions:linux_aarch64": "@clang_tidy_linux_arm64//file:downloaded", |
| 66 | "@bazel_tools//src/conditions:darwin_arm64": "@clang_tidy_darwin_arm64//file:downloaded", |
| 67 | "@bazel_tools//src/conditions:windows_x64": "@clang_tidy_windows_amd64//file:downloaded", |
| 68 | }, |
| 69 | ), |
| 70 | out = "clang_tidy", |
| 71 | tags = ["manual"], |
| 72 | visibility = ["//visibility:public"], |
| 73 | ) |