diff --git a/.bazelrc b/.bazelrc index d4ee261..783943c 100644 --- a/.bazelrc +++ b/.bazelrc @@ -7,9 +7,9 @@ build --incompatible_merge_fixed_and_default_shell_env # Allow network for pnpm/npm fetching (until cached) # But standard build should be sandboxed -# build --sandbox_default_allow_network=false +build --sandbox_default_allow_network=false # Linting configuration -build:lint --aspects=//tools/lint:linters.bzl%ktlint +build:lint --aspects=@//tools/lint:linters.bzl%ktlint build:lint --output_groups=rules_lint_report build:lint --@aspect_rules_lint//lint:fail_on_violation diff --git a/.editorconfig b/.editorconfig index 5554823..95b77e4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,4 +9,4 @@ trim_trailing_whitespace = true insert_final_newline = true [*.kt] -indent_size = 4 +indent_size = 2 diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 00b0ed2..677ad7b 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 # Important: fetch all history for diffing - name: Run Cassandra AI Review - uses: menny/cassandra@main + uses: menny/cassandra@c31e5c67624ca33ee7094b567e4d14a96639fe8b with: provider: 'google' model_id: 'gemini-3-flash-preview' @@ -25,5 +25,3 @@ jobs: base: ${{ github.event.pull_request.base.sha }} # The head branch/commit (defaults to HEAD) head: ${{ github.event.pull_request.head.sha }} - # The GitHub token to use for review comments - reviewer_github_token: ${{ secrets.REVIEWER_GITHUB_TOKEN }} diff --git a/.prettierignore b/.prettierignore index bfe6eb1..7ecbf3e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,6 @@ node_modules bazel-* dist + +CLAUDE.md +GEMINI.md diff --git a/AGENTS.md b/AGENTS.md index 5106753..53b6493 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -32,6 +32,9 @@ _Read the specific DESIGN docs for deep implementation details._ 1. **Analyze & Plan:** Briefly outline your intended changes and identify the affected Bazel targets. 2. **Idempotency:** Ensure any Kotlin worker you write can safely crash and be retried by Cloud Tasks without data corruption. 3. **Build Files:** Always update `BUILD.bazel` when modifying dependencies or adding new files. -4. **Testing:** Write or update tests (`Jest` for frontend, `JUnit5` for backend). -5. **Formatting & Linting (CRITICAL):** Do NOT waste output tokens trying to manually adhere to perfect code formatting or linting rules. This repository uses automated tools (`Prettier`, `ESLint`, `Ktlint`). Write logically sound code and explicitly instruct the user to run the respective Bazel format/lint targets to clean up the syntax. -6. **Pre-Commit Check:** `bazel run //:format` MUST be invoked before any commit to ensure repository consistency. +4. **Testing:** Write or update tests (**Node.js native runner** for frontend, `JUnit5` for backend). Every test MUST have a corresponding Bazel target (`js_test` or `kt_jvm_test`). +5. **Dependency Pinning:** After adding dependencies, you MUST update lockfiles: + - **Maven:** `REPIN=1 bazel run @maven//:pin` + - **npm:** `pnpm install --lockfile-only` +6. **Formatting & Linting (CRITICAL):** Do NOT waste output tokens trying to manually adhere to perfect code formatting or linting rules. This repository uses automated tools (`Prettier`, `ESLint`, `Ktlint`). Write logically sound code and explicitly instruct the user to run the respective Bazel format/lint targets to clean up the syntax. +7. **Pre-Commit Check:** `bazel run //:format` and `bazel test //...` MUST be invoked before any commit to ensure repository consistency. diff --git a/BUILD.bazel b/BUILD.bazel index cb89274..d341b47 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,54 +1,29 @@ -load("@aspect_rules_js//js:defs.bzl", "js_library") load("@bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin") load("@npm_rulesjs//:defs.bzl", "npm_link_all_packages") -load("@npm_rulesjs//:eslint/package_json.bzl", eslint_bin = "bin") -load("@npm_rulesjs//:prettier/package_json.bzl", prettier_bin = "bin") package(default_visibility = ["//visibility:public"]) npm_link_all_packages(name = "node_modules") -exports_files([ - ".editorconfig", - ".prettierrc", - ".prettierignore", - "eslint.config.mjs", - "package.json", -]) - -js_library( - name = "eslint_config", - srcs = ["eslint.config.mjs"], -) - -js_library( - name = "prettier_config", - srcs = [ - ".prettierignore", - ".prettierrc", - ], +# copy_to_bin targets to expose configuration files to the output tree +copy_to_bin( + name = "editorconfig_bin", + srcs = [".editorconfig"], ) -prettier_bin.prettier_binary( - name = "prettier", - data = [":prettier_config"], - env = {"BAZEL_BINDIR": "."}, +copy_to_bin( + name = "eslint_config_bin", + srcs = ["eslint.config.mjs"], ) -eslint_bin.eslint_binary( - name = "eslint", - data = [ - ":eslint_config", - "//:node_modules/@eslint/js", - "//:node_modules/typescript-eslint", - ], - env = {"BAZEL_BINDIR": "."}, - fixed_args = ["--no-error-on-unmatched-pattern"], +copy_to_bin( + name = "prettier_config_bin", + srcs = [".prettierrc"], ) -alias( - name = "ktlint_jar_alias", - actual = "@ktlint_jar//jar", +copy_to_bin( + name = "prettier_ignore_bin", + srcs = [".prettierignore"], ) alias( diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index f0264f0..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -Read Agent guidelines from @AGENTS.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 0000000..47dc3e3 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/GEMINI.md b/GEMINI.md deleted file mode 100644 index f0264f0..0000000 --- a/GEMINI.md +++ /dev/null @@ -1 +0,0 @@ -Read Agent guidelines from @AGENTS.md diff --git a/GEMINI.md b/GEMINI.md new file mode 120000 index 0000000..47dc3e3 --- /dev/null +++ b/GEMINI.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/MODULE.bazel b/MODULE.bazel index 9d0e23a..251bffd 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -7,9 +7,23 @@ module( bazel_dep(name = "bazel_skylib", version = "1.8.2") bazel_dep(name = "bazel_lib", version = "3.2.2") bazel_dep(name = "rules_java", version = "9.3.0") +bazel_dep(name = "rules_shell", version = "0.7.1") # Kotlin bazel_dep(name = "rules_kotlin", version = "2.3.20") +bazel_dep(name = "rules_jvm_external", version = "6.10") + +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") +maven.install( + artifacts = [ + "org.junit.jupiter:junit-jupiter-api:5.10.2", + "org.junit.jupiter:junit-jupiter-engine:5.10.2", + "org.junit.platform:junit-platform-launcher:1.10.2", + "org.junit.platform:junit-platform-console:1.10.2", + ], + lock_file = "@@//:maven_install.json", +) +use_repo(maven, "maven") # JavaScript / TypeScript bazel_dep(name = "aspect_rules_js", version = "3.0.3") @@ -17,9 +31,9 @@ bazel_dep(name = "aspect_rules_ts", version = "3.8.7") bazel_dep(name = "rules_nodejs", version = "6.7.3") # Linting -bazel_dep(name = "aspect_rules_lint", version = "2.3.0") +bazel_dep(name = "aspect_rules_lint", version = "2.5.0") -bazel_dep(name = "buildifier_prebuilt", version = "8.2.1.1", dev_dependency = True) +bazel_dep(name = "buildifier_prebuilt", version = "8.5.1", dev_dependency = True) # Node.js toolchain setup node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True) @@ -53,3 +67,7 @@ http_jar( lint = use_extension("@aspect_rules_lint//lint:extensions.bzl", "tools") lint.ktlint(name = "com_github_pinterest_ktlint") use_repo(lint, "com_github_pinterest_ktlint") + +format_tools = use_extension("@aspect_rules_lint//format:extensions.bzl", "tools") +format_tools.ktfmt() +use_repo(format_tools, "ktfmt") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 1f375ee..c228a29 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -17,8 +17,6 @@ "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/source.json": "cea3901d7e299da7320700abbaafe57a65d039f10d0d7ea601c4a66938ea4b0c", "https://bcr.bazel.build/modules/abseil-py/2.1.0/MODULE.bazel": "5ebe5bf853769c65707e5c28f216798f7a4b1042015e6a36e6d03094d94bec8a", "https://bcr.bazel.build/modules/abseil-py/2.1.0/source.json": "0e8fc4f088ce07099c1cd6594c20c7ddbb48b4b3c0849b7d94ba94be88ff042b", - "https://bcr.bazel.build/modules/ape/1.0.1/MODULE.bazel": "37411cfd13bfc28cd264674d660a3ecb3b5b35b9dbe4c0b2be098683641b3fee", - "https://bcr.bazel.build/modules/ape/1.0.1/source.json": "96bc5909d1e3ccc4203272815ef874dbfd99651e240c05049f12193d16c1110b", "https://bcr.bazel.build/modules/apple_support/1.11.1/MODULE.bazel": "1843d7cd8a58369a444fc6000e7304425fba600ff641592161d9f15b179fb896", "https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel": "a0556fefca0b1bb2de8567b8827518f94db6a6e7e7d632b4c48dc5f865bc7c85", "https://bcr.bazel.build/modules/apple_support/1.23.1/MODULE.bazel": "53763fed456a968cf919b3240427cf3a9d5481ec5466abc9d5dc51bc70087442", @@ -42,8 +40,8 @@ "https://bcr.bazel.build/modules/aspect_rules_js/3.0.3/MODULE.bazel": "28a30e8fc33bf64a67835d64d124f6e05a7d59648dcb27b110fb3502f761e503", "https://bcr.bazel.build/modules/aspect_rules_js/3.0.3/source.json": "bb8fff9a304452e1042af9522ad1d54d6f1d1fdf71c5127deadb6fd156654193", "https://bcr.bazel.build/modules/aspect_rules_lint/0.12.0/MODULE.bazel": "e767c5dbfeb254ec03275a7701b5cfde2c4d2873676804bc7cb27ddff3728fed", - "https://bcr.bazel.build/modules/aspect_rules_lint/2.3.0/MODULE.bazel": "4d36bce3c1347bb4fed5906877dce0e683cb207f4032711aff32334003bcf835", - "https://bcr.bazel.build/modules/aspect_rules_lint/2.3.0/source.json": "07c6e7333ac089e2428a02d68deb5f90e3947aa9b9ac22c26b9e8b0083122926", + "https://bcr.bazel.build/modules/aspect_rules_lint/2.5.0/MODULE.bazel": "24f49acb3b8375fa138ba6ab53bcf517ae92529770a04ab04d47c958ff47b63e", + "https://bcr.bazel.build/modules/aspect_rules_lint/2.5.0/source.json": "8beadb1db5fa4b5e36769a5247c200a877fbc9f397dc10b5aa33e76099483070", "https://bcr.bazel.build/modules/aspect_rules_ts/3.8.7/MODULE.bazel": "830f8a53bb9f1139c24006a90ddc0230481326d69fa847eb00daf8eaae118724", "https://bcr.bazel.build/modules/aspect_rules_ts/3.8.7/source.json": "95549d64e28f3e4e3648cc037cefdac01ec3b0f58fced2409c286784e82ad0f0", "https://bcr.bazel.build/modules/aspect_tools_telemetry/0.2.8/MODULE.bazel": "aa975a83e72bcaac62ee61ab12b788ea324a1d05c4aab28aadb202f647881679", @@ -74,7 +72,6 @@ "https://bcr.bazel.build/modules/bazel_features/1.41.0/source.json": "8fd525b31b0883c47e0593443cdd10219b94a7556b3195fc02d75c86c66cfe30", "https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b", "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", - "https://bcr.bazel.build/modules/bazel_lib/3.0.0-beta.1/MODULE.bazel": "407729e232f611c3270005b016b437005daa7b1505826798ea584169a476e878", "https://bcr.bazel.build/modules/bazel_lib/3.0.0-rc.0/MODULE.bazel": "d6e00979a98ac14ada5e31c8794708b41434d461e7e7ca39b59b765e6d233b18", "https://bcr.bazel.build/modules/bazel_lib/3.0.0/MODULE.bazel": "22b70b80ac89ad3f3772526cd9feee2fa412c2b01933fea7ed13238a448d370d", "https://bcr.bazel.build/modules/bazel_lib/3.1.0/MODULE.bazel": "6809765c14e3c766a9b9286c7b0ec56ed87a73326e48fe01749f0c0fdcfe3287", @@ -94,17 +91,20 @@ "https://bcr.bazel.build/modules/bazel_skylib/1.8.1/MODULE.bazel": "88ade7293becda963e0e3ea33e7d54d3425127e0a326e0d17da085a5f1f03ff6", "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/source.json": "34a3c8bcf233b835eb74be9d628899bb32999d3e0eadef1947a0a562a2b16ffb", + "https://bcr.bazel.build/modules/bazel_worker_api/0.0.1/MODULE.bazel": "02a13b77321773b2042e70ee5e4c5e099c8ddee4cf2da9cd420442c36938d4bd", + "https://bcr.bazel.build/modules/bazel_worker_api/0.0.4/MODULE.bazel": "460aa12d01231a80cce03c548287b433b321d205b0028ae596728c35e5ee442e", "https://bcr.bazel.build/modules/bazel_worker_api/0.0.8/MODULE.bazel": "396c1ef53835aafe3d42ce6619080531ee770648303731f16cfaa33fa056bf0c", "https://bcr.bazel.build/modules/bazel_worker_api/0.0.8/source.json": "abaf8ac9d2ab2f47bda9af4c0c080ff7907378888e1f4bc62a0539dd13ba61e8", + "https://bcr.bazel.build/modules/bazel_worker_java/0.0.4/MODULE.bazel": "82494a01018bb7ef06d4a17ec4cd7a758721f10eb8b6c820a818e70d669500db", "https://bcr.bazel.build/modules/bazel_worker_java/0.0.8/MODULE.bazel": "e76479eae70bd4e8f5f4c2dfc5d03ab971cfb18750246c7b3f3454c5c2ee6629", "https://bcr.bazel.build/modules/bazel_worker_java/0.0.8/source.json": "9395c4679444bc47bf7e51a710366a4480aa371c6f6bed01868e2fabcf11acec", "https://bcr.bazel.build/modules/buildifier_prebuilt/6.4.0/MODULE.bazel": "37389c6b5a40c59410b4226d3bb54b08637f393d66e2fa57925c6fcf68e64bf4", - "https://bcr.bazel.build/modules/buildifier_prebuilt/8.2.1.1/MODULE.bazel": "2e2e306add04b7c7cd21e73c9293dcbd7528a08a84338e919036f402eb6b1e2e", - "https://bcr.bazel.build/modules/buildifier_prebuilt/8.2.1.1/source.json": "4c86fd3a384a09613c2213fb1f71562d6d70471977e6e81173e6625fd6ce53bc", + "https://bcr.bazel.build/modules/buildifier_prebuilt/8.5.1/MODULE.bazel": "77f2a1958d1d07376dd3ce3ae16540f2c1b01921c1fd21930827271260e75a66", + "https://bcr.bazel.build/modules/buildifier_prebuilt/8.5.1/source.json": "ae9f3d9dc7bec033976cf47165a78788bebad2b5c272241063ae31bad8664fd4", "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", - "https://bcr.bazel.build/modules/download_utils/1.0.1/MODULE.bazel": "f1d0afade59e37de978506d6bbf08d7fe5f94964e86944aaf58efcead827b41b", - "https://bcr.bazel.build/modules/download_utils/1.0.1/source.json": "05ddc5a3b1f7d8f3e5e0fd1617479e1cf72d63d59ab2b1f0463557a14fc6be0a", + "https://bcr.bazel.build/modules/diff.bzl/0.5.1/MODULE.bazel": "bad8dd444e512b6fcbcd969d6385cd6bc093d4c12e5640fb1f0ace2282f99ef9", + "https://bcr.bazel.build/modules/diff.bzl/0.5.1/source.json": "64571044143273ff8adb322c0f7acefca36f9589ff37a743e3cac9c35ce6b010", "https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/MODULE.bazel": "cdf8cbe5ee750db04b78878c9633cc76e80dcf4416cbe982ac3a9222f80713c8", "https://bcr.bazel.build/modules/gawk/5.3.2.bcr.1/source.json": "fa7b512dfcb5eafd90ce3959cf42a2a6fe96144ebbb4b3b3928054895f2afac2", "https://bcr.bazel.build/modules/gazelle/0.27.0/MODULE.bazel": "3446abd608295de6d90b4a8a118ed64a9ce11dcb3dda2dc3290a22056bd20996", @@ -113,6 +113,7 @@ "https://bcr.bazel.build/modules/gazelle/0.33.0/MODULE.bazel": "a13a0f279b462b784fb8dd52a4074526c4a2afe70e114c7d09066097a46b3350", "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel": "abdd8ce4d70978933209db92e436deb3a8b737859e9354fb5fd11fb5c2004c8a", "https://bcr.bazel.build/modules/gazelle/0.36.0/MODULE.bazel": "e375d5d6e9a6ca59b0cb38b0540bc9a05b6aa926d322f2de268ad267a2ee74c0", + "https://bcr.bazel.build/modules/gazelle/0.40.0/MODULE.bazel": "42ba5378ebe845fca43989a53186ab436d956db498acde790685fe0e8f9c6146", "https://bcr.bazel.build/modules/gazelle/0.47.0/MODULE.bazel": "b61bb007c4efad134aa30ee7f4a8e2a39b22aa5685f005edaa022fbd1de43ebc", "https://bcr.bazel.build/modules/gazelle/0.47.0/source.json": "aeb2e5df14b7fb298625d75d08b9c65bdb0b56014c5eb89da9e5dd0572280ae6", "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", @@ -135,7 +136,9 @@ "https://bcr.bazel.build/modules/package_metadata/0.0.2/MODULE.bazel": "fb8d25550742674d63d7b250063d4580ca530499f045d70748b1b142081ebb92", "https://bcr.bazel.build/modules/package_metadata/0.0.3/MODULE.bazel": "77890552ecea9e284b5424c9de827a58099348763a4359e975c359a83d4faa83", "https://bcr.bazel.build/modules/package_metadata/0.0.5/MODULE.bazel": "ef4f9439e3270fdd6b9fd4dbc3d2f29d13888e44c529a1b243f7a31dfbc2e8e4", - "https://bcr.bazel.build/modules/package_metadata/0.0.5/source.json": "2326db2f6592578177751c3e1f74786b79382cd6008834c9d01ec865b9126a85", + "https://bcr.bazel.build/modules/package_metadata/0.0.6/MODULE.bazel": "341dab6f417197494517d54c8e557c0baee1de7aec83543a4fbefe57900acb7e", + "https://bcr.bazel.build/modules/package_metadata/0.0.7/MODULE.bazel": "7adb03933fc8401f495800cf4eafcff0edc6da0ff55c7db223ef69d19f689486", + "https://bcr.bazel.build/modules/package_metadata/0.0.7/source.json": "50639625e937b56115012674c797cca7a05a96b4878c87d803c13dc2b31de8a0", "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", "https://bcr.bazel.build/modules/platforms/0.0.11/MODULE.bazel": "0daefc49732e227caa8bfa834d65dc52e8cc18a2faf80df25e8caea151a9413f", "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", @@ -172,6 +175,7 @@ "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/source.json": "2ff292be6ef3340325ce8a045ecc326e92cbfab47c7cbab4bd85d28971b97ac4", "https://bcr.bazel.build/modules/re2/2024-07-02/MODULE.bazel": "0eadc4395959969297cbcf31a249ff457f2f1d456228c67719480205aa306daa", "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8", + "https://bcr.bazel.build/modules/rules_android/0.6.6/MODULE.bazel": "b0fb569752aab65ab1a9db0a8f6cfaf5aa1754965e17e95dcf0e4d88e192a68d", "https://bcr.bazel.build/modules/rules_android/0.7.1/MODULE.bazel": "a806fc382a774252f228a40e3b11b9fcc6276f8778c7fb33e9f72937c6258363", "https://bcr.bazel.build/modules/rules_android/0.7.1/source.json": "151440aed3f0f73a00d4ed5cec5d31f63a6fef9b95d8fab1eb1810150fa525f2", "https://bcr.bazel.build/modules/rules_apple/3.16.0/MODULE.bazel": "0d1caf0b8375942ce98ea944be754a18874041e4e0459401d925577624d3a54a", @@ -199,8 +203,6 @@ "https://bcr.bazel.build/modules/rules_cc/0.2.16/source.json": "d03d5cde49376d87e14ec14b666c56075e5e3926930327fd5d0484a1ff2ac1cc", "https://bcr.bazel.build/modules/rules_cc/0.2.4/MODULE.bazel": "1ff1223dfd24f3ecf8f028446d4a27608aa43c3f41e346d22838a4223980b8cc", "https://bcr.bazel.build/modules/rules_cc/0.2.8/MODULE.bazel": "f1df20f0bf22c28192a794f29b501ee2018fa37a3862a1a2132ae2940a23a642", - "https://bcr.bazel.build/modules/rules_diff/1.0.0/MODULE.bazel": "1739509d8db9a6cd7d3584822340d3dfe1f9f27e62462fbca60aa061d88741b2", - "https://bcr.bazel.build/modules/rules_diff/1.0.0/source.json": "fc3824aed007b4db160ffb994036c6e558550857b6634a8e9ccee3e74c659312", "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", "https://bcr.bazel.build/modules/rules_go/0.33.0/MODULE.bazel": "a2b11b64cd24bf94f57454f53288a5dacfe6cb86453eee7761b7637728c1910c", @@ -209,6 +211,8 @@ "https://bcr.bazel.build/modules/rules_go/0.41.0/MODULE.bazel": "55861d8e8bb0e62cbd2896f60ff303f62ffcb0eddb74ecb0e5c0cbe36fc292c8", "https://bcr.bazel.build/modules/rules_go/0.42.0/MODULE.bazel": "8cfa875b9aa8c6fce2b2e5925e73c1388173ea3c32a0db4d2b4804b453c14270", "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel": "3477df8bdcc49e698b9d25f734c4f3a9f5931ff34ee48a2c662be168f5f2d3fd", + "https://bcr.bazel.build/modules/rules_go/0.50.1/MODULE.bazel": "b91a308dc5782bb0a8021ad4330c81fea5bda77f96b9e4c117b9b9c8f6665ee0", + "https://bcr.bazel.build/modules/rules_go/0.51.0-rc2/MODULE.bazel": "edfc3a9cea7bedb0eaaff37b0d7817c1a4bf72b3c615580b0ffcee6c52690fd4", "https://bcr.bazel.build/modules/rules_go/0.53.0/MODULE.bazel": "a4ed760d3ac0dbc0d7b967631a9a3fd9100d28f7d9fcf214b4df87d4bfff5f9a", "https://bcr.bazel.build/modules/rules_go/0.59.0/MODULE.bazel": "b7e43e7414a3139a7547d1b4909b29085fbe5182b6c58cbe1ed4c6272815aeae", "https://bcr.bazel.build/modules/rules_go/0.59.0/source.json": "1df17bb7865cfc029492c30163cee891d0dd8658ea0d5bfdf252c4b6db5c1ef6", @@ -226,6 +230,7 @@ "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", "https://bcr.bazel.build/modules/rules_java/7.4.0/MODULE.bazel": "a592852f8a3dd539e82ee6542013bf2cadfc4c6946be8941e189d224500a8934", "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/8.13.0/MODULE.bazel": "0444ebf737d144cf2bb2ccb368e7f1cce735264285f2a3711785827c1686625e", "https://bcr.bazel.build/modules/rules_java/8.14.0/MODULE.bazel": "717717ed40cc69994596a45aec6ea78135ea434b8402fb91b009b9151dd65615", "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", @@ -239,14 +244,17 @@ "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", "https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d", "https://bcr.bazel.build/modules/rules_jvm_external/6.1/MODULE.bazel": "75b5fec090dbd46cf9b7d8ea08cf84a0472d92ba3585b476f44c326eda8059c4", + "https://bcr.bazel.build/modules/rules_jvm_external/6.10/MODULE.bazel": "33e636ca6bc9ee0fa090a38aa33c631ded2d8cf6fead4124181d1b35dc474f7c", + "https://bcr.bazel.build/modules/rules_jvm_external/6.10/source.json": "c191249787625db72616a3fb3cc2786ab57355a2e3b615402b8b3b66b0f995b7", "https://bcr.bazel.build/modules/rules_jvm_external/6.2/MODULE.bazel": "36a6e52487a855f33cb960724eb56547fa87e2c98a0474c3acad94339d7f8e99", "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.6/MODULE.bazel": "153042249c7060536dc95b6bb9f9bb8063b8a0b0cb7acdb381bddbc2374aed55", "https://bcr.bazel.build/modules/rules_jvm_external/6.7/MODULE.bazel": "e717beabc4d091ecb2c803c2d341b88590e9116b8bf7947915eeb33aab4f96dd", "https://bcr.bazel.build/modules/rules_jvm_external/6.9/MODULE.bazel": "07c5db05527db7744a54fcffd653e1550d40e0540207a7f7e6d0a4de5bef8274", - "https://bcr.bazel.build/modules/rules_jvm_external/6.9/source.json": "b12970214f3cc144b26610caeb101fa622d910f1ab3d98f0bae1058edbd00bd4", "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", "https://bcr.bazel.build/modules/rules_kotlin/1.9.5/MODULE.bazel": "043a16a572f610558ec2030db3ff0c9938574e7dd9f58bded1bb07c0192ef025", "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/2.1.3/MODULE.bazel": "ce7def6d576aa8d3a9c6d10e13b4d157296229674371f67dbf788dae0afae3d5", "https://bcr.bazel.build/modules/rules_kotlin/2.3.20/MODULE.bazel": "3443d53d275e14fecfebd0b491f01d06ea3883c04a1b3336e7ae9d5ec9066bef", "https://bcr.bazel.build/modules/rules_kotlin/2.3.20/source.json": "5a5553cffea43f2c5156c8ad0de4a14ad95413ceb39cd4d08f50e2aea86927e8", "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", @@ -259,7 +267,6 @@ "https://bcr.bazel.build/modules/rules_multitool/0.11.0/source.json": "0b86574a1eaff37c33aafaff095ea16d6ac846beb94ffc74c4fcf626f8f80681", "https://bcr.bazel.build/modules/rules_nodejs/5.8.2/MODULE.bazel": "6bc03c8f37f69401b888023bf511cb6ee4781433b0cb56236b2e55a21e3a026a", "https://bcr.bazel.build/modules/rules_nodejs/6.2.0/MODULE.bazel": "ec27907f55eb34705adb4e8257952162a2d4c3ed0f0b3b4c3c1aad1fac7be35e", - "https://bcr.bazel.build/modules/rules_nodejs/6.5.2/MODULE.bazel": "7f9ea68a0ce6d82905ce9f74e76ab8a8b4531ed4c747018c9d76424ad0b3370d", "https://bcr.bazel.build/modules/rules_nodejs/6.7.3/MODULE.bazel": "c22a48b2a0dbf05a9dc5f83837bbc24c226c1f6e618de3c3a610044c9f336056", "https://bcr.bazel.build/modules/rules_nodejs/6.7.3/source.json": "a3f966f4415a8a6545e560ee5449eac95cc633f96429d08e87c87775c72f5e09", "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", @@ -281,6 +288,7 @@ "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", "https://bcr.bazel.build/modules/rules_python/0.33.2/MODULE.bazel": "3e036c4ad8d804a4dad897d333d8dce200d943df4827cb849840055be8d2e937", + "https://bcr.bazel.build/modules/rules_python/0.37.1/MODULE.bazel": "3faeb2d9fa0a81f8980643ee33f212308f4d93eea4b9ce6f36d0b742e71e9500", "https://bcr.bazel.build/modules/rules_python/0.37.2/MODULE.bazel": "b5ffde91410745750b6c13be1c5dc4555ef5bc50562af4a89fd77807fdde626a", "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", "https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7", @@ -292,12 +300,14 @@ "https://bcr.bazel.build/modules/rules_robolectric/4.14.1.2/source.json": "37c10335f2361c337c5c1f34ed36d2da70534c23088062b33a8bdaab68aa9dea", "https://bcr.bazel.build/modules/rules_rust/0.67.0/MODULE.bazel": "87c3816c4321352dcfd9e9e26b58e84efc5b21351ae3ef8fb5d0d57bde7237f5", "https://bcr.bazel.build/modules/rules_rust/0.67.0/source.json": "a8ef4d3be30eb98e060cad9e5875a55b603195487f76e01b619b51a1df4641cc", + "https://bcr.bazel.build/modules/rules_shell/0.1.2/MODULE.bazel": "66e4ca3ce084b04af0b9ff05ff14cab4e5df7503973818bb91cbc6cda08d32fc", "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b", "https://bcr.bazel.build/modules/rules_shell/0.4.1/MODULE.bazel": "00e501db01bbf4e3e1dd1595959092c2fadf2087b2852d3f553b5370f5633592", "https://bcr.bazel.build/modules/rules_shell/0.5.0/MODULE.bazel": "8c8447370594d45539f66858b602b0bb2cb2d3401a4ebb9ad25830c59c0f366d", "https://bcr.bazel.build/modules/rules_shell/0.6.1/MODULE.bazel": "72e76b0eea4e81611ef5452aa82b3da34caca0c8b7b5c0c9584338aa93bae26b", - "https://bcr.bazel.build/modules/rules_shell/0.6.1/source.json": "20ec05cd5e592055e214b2da8ccb283c7f2a421ea0dc2acbf1aa792e11c03d0c", + "https://bcr.bazel.build/modules/rules_shell/0.7.1/MODULE.bazel": "257dd8d667371de804918dfceb86f6ddd2e1b5e025f5d9322878d4a73dc8aa58", + "https://bcr.bazel.build/modules/rules_shell/0.7.1/source.json": "9e6c3ea5766b584f60a44dd36520c4be16a12bb173aad238e018f73083e8feb6", "https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca", "https://bcr.bazel.build/modules/rules_swift/2.1.1/MODULE.bazel": "494900a80f944fc7aa61500c2073d9729dff0b764f0e89b824eb746959bc1046", "https://bcr.bazel.build/modules/rules_swift/2.1.1/source.json": "40fc69dfaac64deddbb75bd99cdac55f4427d9ca0afbe408576a65428427a186", @@ -317,8 +327,6 @@ "https://bcr.bazel.build/modules/tar.bzl/0.5.1/MODULE.bazel": "7c2eb3dcfc53b0f3d6f9acdfd911ca803eaf92aadf54f8ca6e4c1f3aee288351", "https://bcr.bazel.build/modules/tar.bzl/0.6.0/MODULE.bazel": "a3584b4edcfafcabd9b0ef9819808f05b372957bbdff41601429d5fd0aac2e7c", "https://bcr.bazel.build/modules/tar.bzl/0.6.0/source.json": "4a620381df075a16cb3a7ed57bd1d05f7480222394c64a20fa51bdb636fda658", - "https://bcr.bazel.build/modules/toolchain_utils/1.0.2/MODULE.bazel": "9b8be503a4fcfd3b8b952525bff0869177a5234d5c35dc3e566b9f5ca2f755a1", - "https://bcr.bazel.build/modules/toolchain_utils/1.0.2/source.json": "88769ec576dddacafd8cca4631812cf8eead89f10a29d9405d9f7a553de6bf87", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", "https://bcr.bazel.build/modules/upb/0.0.0-20230516-61a97ef/MODULE.bazel": "c0df5e35ad55e264160417fd0875932ee3c9dda63d9fccace35ac62f45e1b6f9", "https://bcr.bazel.build/modules/yq.bzl/0.1.1/MODULE.bazel": "9039681f9bcb8958ee2c87ffc74bdafba9f4369096a2b5634b88abc0eaefa072", @@ -334,7 +342,7 @@ "moduleExtensions": { "@@aspect_rules_lint+//lint:extensions.bzl%tools": { "general": { - "bzlTransitiveDigest": "3oDILPaQPkFpGw0WcW6YDK9iq7H8RKFdquNtPsB+Te4=", + "bzlTransitiveDigest": "njrJJRhpHoCXpo8CGPaepznaZ/fn6ng86VBTPpjpjH0=", "usagesDigest": "nM60524MpOxi7RcxvopFlQtdl2CLI6bkves54H+3R50=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -393,7 +401,7 @@ "bzlTransitiveDigest": "GbfZLeEI0W26fAQ89dUljyLGSAkzkr3CkF+VDQ0IFlI=", "usagesDigest": "gdo/5PCM/GAF5/1eW2yqbAPulcW2ZdHeN/hqW2p+xfA=", "recordedFileInputs": { - "@@//package.json": "cda943df05c7872322b15f85a55ee9c719f604b04e665b5abd58e25b7d56dcb4" + "@@//package.json": "555c5598c320efb743d1fb1fc7730c271315aebd421d15541cce8d80490d0ed0" }, "recordedDirentsInputs": {}, "envVariables": {}, @@ -427,7 +435,7 @@ "@@aspect_tools_telemetry+//:extension.bzl%telemetry": { "general": { "bzlTransitiveDigest": "cl5A2O84vDL6Tt+Qga8FCj1DUDGqn+e7ly5rZ+4xvcc=", - "usagesDigest": "jCgBgNx/vqMUKTeSNyouAYCFiCaQShmjrov23XZuKHk=", + "usagesDigest": "i7q2Ku50DGWlSjVNd125JOkQZ66EpthZjfouCVuQa9I=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -438,7 +446,7 @@ "deps": { "aspect_rules_js": "3.0.3", "aspect_rules_ts": "3.8.7", - "aspect_rules_lint": "2.3.0", + "aspect_rules_lint": "2.5.0", "aspect_tools_telemetry": "0.3.3" } } @@ -502,7 +510,7 @@ "@@rules_multitool+//multitool:extension.bzl%multitool": { "general": { "bzlTransitiveDigest": "p+TzWOIGcR0b2j4MeEMj7X0cbYhYoRzVAzax4xZ+0lc=", - "usagesDigest": "TEO2RWqEoh/9V+zpKsbi7shFJAjSqnD+BofsgRbgoT0=", + "usagesDigest": "ECQSWUVv2JRfJfCWkmbKt64n7RT16pbFJ8df4qZA9Y0=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, diff --git a/backend/BUILD.bazel b/backend/BUILD.bazel index 1bb84a3..e95b2d7 100644 --- a/backend/BUILD.bazel +++ b/backend/BUILD.bazel @@ -1,7 +1,23 @@ -load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library") +load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test") kt_jvm_library( name = "backend", - srcs = glob(["*.kt"]), + srcs = ["Main.kt"], visibility = ["//visibility:public"], ) + +kt_jvm_test( + name = "backend_test", + srcs = ["MainTest.kt"], + args = [ + "--select-package", + "septima", + ], + main_class = "org.junit.platform.console.ConsoleLauncher", + deps = [ + "@maven//:org_junit_jupiter_junit_jupiter_api", + "@maven//:org_junit_jupiter_junit_jupiter_engine", + "@maven//:org_junit_platform_junit_platform_console", + "@maven//:org_junit_platform_junit_platform_launcher", + ], +) diff --git a/backend/Main.kt b/backend/Main.kt index 2334354..ed18323 100644 --- a/backend/Main.kt +++ b/backend/Main.kt @@ -1,3 +1,3 @@ fun main() { - println("hello") + println("hello") } diff --git a/backend/MainTest.kt b/backend/MainTest.kt new file mode 100644 index 0000000..60fa116 --- /dev/null +++ b/backend/MainTest.kt @@ -0,0 +1,11 @@ +package septima + +import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Test + +class MainTest { + @Test + fun testAlwaysPasses() { + assertTrue(true) + } +} diff --git a/frontend/BUILD.bazel b/frontend/BUILD.bazel index cc3d7ec..2afcad7 100644 --- a/frontend/BUILD.bazel +++ b/frontend/BUILD.bazel @@ -1,10 +1,29 @@ +load("@aspect_rules_js//js:defs.bzl", "js_test") load("@aspect_rules_ts//ts:defs.bzl", "ts_project") ts_project( name = "frontend", - srcs = glob(["*.ts"]), + srcs = glob( + ["*.ts"], + exclude = ["*.test.ts"], + ), declaration = True, transpiler = "tsc", tsconfig = "tsconfig.json", visibility = ["//visibility:public"], ) + +ts_project( + name = "tests_lib", + srcs = ["index.test.ts"], + declaration = True, + transpiler = "tsc", + tsconfig = "tsconfig.json", + deps = ["//:node_modules/@types/node"], +) + +js_test( + name = "test", + data = [":tests_lib"], + entry_point = "index.test.js", +) diff --git a/frontend/index.test.ts b/frontend/index.test.ts new file mode 100644 index 0000000..16ba7c1 --- /dev/null +++ b/frontend/index.test.ts @@ -0,0 +1,6 @@ +import test from 'node:test'; +import assert from 'node:assert'; + +test('Simple Test', () => { + assert.strictEqual(true, true); +}); diff --git a/maven_install.json b/maven_install.json new file mode 100644 index 0000000..5983121 --- /dev/null +++ b/maven_install.json @@ -0,0 +1,367 @@ +{ + "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", + "__INPUT_ARTIFACTS_HASH": { + "com.google.code.findbugs:jsr305": 495355163, + "com.google.code.gson:gson": 597770368, + "com.google.errorprone:error_prone_annotations": -1035138750, + "com.google.guava:guava": 1943808618, + "com.google.j2objc:j2objc-annotations": 2003271689, + "org.junit.jupiter:junit-jupiter-api": -796146926, + "org.junit.jupiter:junit-jupiter-engine": 75851894, + "org.junit.platform:junit-platform-console": -1668891741, + "org.junit.platform:junit-platform-launcher": -314669620, + "repositories": -1949687017 + }, + "__RESOLVED_ARTIFACTS_HASH": { + "com.google.code.findbugs:jsr305": 870839855, + "com.google.code.gson:gson": -1575757252, + "com.google.errorprone:error_prone_annotations": 833623751, + "com.google.guava:failureaccess": -1890754729, + "com.google.guava:guava": -163533230, + "com.google.guava:listenablefuture": 1079558157, + "com.google.j2objc:j2objc-annotations": 248818742, + "org.apiguardian:apiguardian-api": 1279798469, + "org.checkerframework:checker-qual": -1533199059, + "org.junit.jupiter:junit-jupiter-api": -1942402024, + "org.junit.jupiter:junit-jupiter-engine": -1893674907, + "org.junit.platform:junit-platform-commons": -117595075, + "org.junit.platform:junit-platform-console": 443827606, + "org.junit.platform:junit-platform-engine": -140710484, + "org.junit.platform:junit-platform-launcher": -1960497987, + "org.junit.platform:junit-platform-reporting": 1599148999, + "org.opentest4j:opentest4j": -1711174392 + }, + "conflict_resolution": { + "com.google.errorprone:error_prone_annotations:2.5.1": "com.google.errorprone:error_prone_annotations:2.18.0" + }, + "artifacts": { + "com.google.code.findbugs:jsr305": { + "shasums": { + "jar": "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7" + }, + "version": "3.0.2" + }, + "com.google.code.gson:gson": { + "shasums": { + "jar": "d3999291855de495c94c743761b8ab5176cfeabe281a5ab0d8e8d45326fd703e" + }, + "version": "2.8.9" + }, + "com.google.errorprone:error_prone_annotations": { + "shasums": { + "jar": "9e6814cb71816988a4fd1b07a993a8f21bb7058d522c162b1de849e19bea54ae" + }, + "version": "2.18.0" + }, + "com.google.guava:failureaccess": { + "shasums": { + "jar": "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26" + }, + "version": "1.0.1" + }, + "com.google.guava:guava": { + "shasums": { + "jar": "bd7fa227591fb8509677d0d1122cf95158f3b8a9f45653f58281d879f6dc48c5" + }, + "version": "32.0.1-jre" + }, + "com.google.guava:listenablefuture": { + "shasums": { + "jar": "b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99" + }, + "version": "9999.0-empty-to-avoid-conflict-with-guava" + }, + "com.google.j2objc:j2objc-annotations": { + "shasums": { + "jar": "f02a95fa1a5e95edb3ed859fd0fb7df709d121a35290eff8b74dce2ab7f4d6ed" + }, + "version": "2.8" + }, + "org.apiguardian:apiguardian-api": { + "shasums": { + "jar": "b509448ac506d607319f182537f0b35d71007582ec741832a1f111e5b5b70b38" + }, + "version": "1.1.2" + }, + "org.checkerframework:checker-qual": { + "shasums": { + "jar": "e316255bbfcd9fe50d165314b85abb2b33cb2a66a93c491db648e498a82c2de1" + }, + "version": "3.33.0" + }, + "org.junit.jupiter:junit-jupiter-api": { + "shasums": { + "jar": "afff77c186cd317275803872fa5133aa801fd6ac40bd91c78a6cf8009b4b17cc" + }, + "version": "5.10.2" + }, + "org.junit.jupiter:junit-jupiter-engine": { + "shasums": { + "jar": "b6df35da750a546ae932376f11b3c0df841f0c90c7cb2944cd39adb432886e4b" + }, + "version": "5.10.2" + }, + "org.junit.platform:junit-platform-commons": { + "shasums": { + "jar": "b56a5ec000a479df4973b18bba24c98fe0db8faa14c8907d3ef451d8c71fd8ae" + }, + "version": "1.10.2" + }, + "org.junit.platform:junit-platform-console": { + "shasums": { + "jar": "6648e0b08f3249bfdf9577241a187025060654b4b7c32e21cb4fa0e3957beab1" + }, + "version": "1.10.2" + }, + "org.junit.platform:junit-platform-engine": { + "shasums": { + "jar": "905cba9b4998ccc29d1239085a7fb1fe0e28024d7526152356d810edec0a49a3" + }, + "version": "1.10.2" + }, + "org.junit.platform:junit-platform-launcher": { + "shasums": { + "jar": "aed4f42fb90ada9b347c231f13656fc09121ba20dab6dc646a6bd9d4da31e4aa" + }, + "version": "1.10.2" + }, + "org.junit.platform:junit-platform-reporting": { + "shasums": { + "jar": "ea8f781f69b2205f5b70947eaa2182db5e7436e4abc9deae0277324ab258312d" + }, + "version": "1.10.2" + }, + "org.opentest4j:opentest4j": { + "shasums": { + "jar": "48e2df636cab6563ced64dcdff8abb2355627cb236ef0bf37598682ddf742f1b" + }, + "version": "1.3.0" + } + }, + "dependencies": { + "com.google.guava:guava": [ + "com.google.code.findbugs:jsr305", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:failureaccess", + "com.google.guava:listenablefuture", + "com.google.j2objc:j2objc-annotations", + "org.checkerframework:checker-qual" + ], + "org.junit.jupiter:junit-jupiter-api": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-commons", + "org.opentest4j:opentest4j" + ], + "org.junit.jupiter:junit-jupiter-engine": [ + "org.apiguardian:apiguardian-api", + "org.junit.jupiter:junit-jupiter-api", + "org.junit.platform:junit-platform-engine" + ], + "org.junit.platform:junit-platform-commons": [ + "org.apiguardian:apiguardian-api" + ], + "org.junit.platform:junit-platform-console": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-reporting" + ], + "org.junit.platform:junit-platform-engine": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-commons", + "org.opentest4j:opentest4j" + ], + "org.junit.platform:junit-platform-launcher": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-engine" + ], + "org.junit.platform:junit-platform-reporting": [ + "org.apiguardian:apiguardian-api", + "org.junit.platform:junit-platform-launcher" + ] + }, + "packages": { + "com.google.code.findbugs:jsr305": [ + "javax.annotation", + "javax.annotation.concurrent", + "javax.annotation.meta" + ], + "com.google.code.gson:gson": [ + "com.google.gson", + "com.google.gson.annotations", + "com.google.gson.internal", + "com.google.gson.internal.bind", + "com.google.gson.internal.bind.util", + "com.google.gson.internal.reflect", + "com.google.gson.internal.sql", + "com.google.gson.reflect", + "com.google.gson.stream" + ], + "com.google.errorprone:error_prone_annotations": [ + "com.google.errorprone.annotations", + "com.google.errorprone.annotations.concurrent" + ], + "com.google.guava:failureaccess": [ + "com.google.common.util.concurrent.internal" + ], + "com.google.guava:guava": [ + "com.google.common.annotations", + "com.google.common.base", + "com.google.common.base.internal", + "com.google.common.cache", + "com.google.common.collect", + "com.google.common.escape", + "com.google.common.eventbus", + "com.google.common.graph", + "com.google.common.hash", + "com.google.common.html", + "com.google.common.io", + "com.google.common.math", + "com.google.common.net", + "com.google.common.primitives", + "com.google.common.reflect", + "com.google.common.util.concurrent", + "com.google.common.xml", + "com.google.thirdparty.publicsuffix" + ], + "com.google.j2objc:j2objc-annotations": ["com.google.j2objc.annotations"], + "org.apiguardian:apiguardian-api": ["org.apiguardian.api"], + "org.checkerframework:checker-qual": [ + "org.checkerframework.checker.builder.qual", + "org.checkerframework.checker.calledmethods.qual", + "org.checkerframework.checker.compilermsgs.qual", + "org.checkerframework.checker.fenum.qual", + "org.checkerframework.checker.formatter.qual", + "org.checkerframework.checker.guieffect.qual", + "org.checkerframework.checker.i18n.qual", + "org.checkerframework.checker.i18nformatter.qual", + "org.checkerframework.checker.index.qual", + "org.checkerframework.checker.initialization.qual", + "org.checkerframework.checker.interning.qual", + "org.checkerframework.checker.lock.qual", + "org.checkerframework.checker.mustcall.qual", + "org.checkerframework.checker.nullness.qual", + "org.checkerframework.checker.optional.qual", + "org.checkerframework.checker.propkey.qual", + "org.checkerframework.checker.regex.qual", + "org.checkerframework.checker.signature.qual", + "org.checkerframework.checker.signedness.qual", + "org.checkerframework.checker.tainting.qual", + "org.checkerframework.checker.units.qual", + "org.checkerframework.common.aliasing.qual", + "org.checkerframework.common.initializedfields.qual", + "org.checkerframework.common.reflection.qual", + "org.checkerframework.common.returnsreceiver.qual", + "org.checkerframework.common.subtyping.qual", + "org.checkerframework.common.util.report.qual", + "org.checkerframework.common.value.qual", + "org.checkerframework.dataflow.qual", + "org.checkerframework.framework.qual" + ], + "org.junit.jupiter:junit-jupiter-api": [ + "org.junit.jupiter.api", + "org.junit.jupiter.api.condition", + "org.junit.jupiter.api.extension", + "org.junit.jupiter.api.extension.support", + "org.junit.jupiter.api.function", + "org.junit.jupiter.api.io", + "org.junit.jupiter.api.parallel" + ], + "org.junit.jupiter:junit-jupiter-engine": [ + "org.junit.jupiter.engine", + "org.junit.jupiter.engine.config", + "org.junit.jupiter.engine.descriptor", + "org.junit.jupiter.engine.discovery", + "org.junit.jupiter.engine.discovery.predicates", + "org.junit.jupiter.engine.execution", + "org.junit.jupiter.engine.extension", + "org.junit.jupiter.engine.support" + ], + "org.junit.platform:junit-platform-commons": [ + "org.junit.platform.commons", + "org.junit.platform.commons.annotation", + "org.junit.platform.commons.function", + "org.junit.platform.commons.logging", + "org.junit.platform.commons.support", + "org.junit.platform.commons.util" + ], + "org.junit.platform:junit-platform-console": [ + "org.junit.platform.console", + "org.junit.platform.console.options", + "org.junit.platform.console.shadow.picocli", + "org.junit.platform.console.tasks" + ], + "org.junit.platform:junit-platform-engine": [ + "org.junit.platform.engine", + "org.junit.platform.engine.discovery", + "org.junit.platform.engine.reporting", + "org.junit.platform.engine.support.config", + "org.junit.platform.engine.support.descriptor", + "org.junit.platform.engine.support.discovery", + "org.junit.platform.engine.support.filter", + "org.junit.platform.engine.support.hierarchical", + "org.junit.platform.engine.support.store" + ], + "org.junit.platform:junit-platform-launcher": [ + "org.junit.platform.launcher", + "org.junit.platform.launcher.core", + "org.junit.platform.launcher.listeners", + "org.junit.platform.launcher.listeners.discovery", + "org.junit.platform.launcher.listeners.session", + "org.junit.platform.launcher.tagexpression" + ], + "org.junit.platform:junit-platform-reporting": [ + "org.junit.platform.reporting.legacy", + "org.junit.platform.reporting.legacy.xml", + "org.junit.platform.reporting.open.xml", + "org.junit.platform.reporting.shadow.org.opentest4j.reporting.events.api", + "org.junit.platform.reporting.shadow.org.opentest4j.reporting.events.core", + "org.junit.platform.reporting.shadow.org.opentest4j.reporting.events.java", + "org.junit.platform.reporting.shadow.org.opentest4j.reporting.events.root", + "org.junit.platform.reporting.shadow.org.opentest4j.reporting.schema" + ], + "org.opentest4j:opentest4j": ["org.opentest4j"] + }, + "repositories": { + "https://repo1.maven.org/maven2/": [ + "com.google.code.findbugs:jsr305", + "com.google.code.gson:gson", + "com.google.errorprone:error_prone_annotations", + "com.google.guava:failureaccess", + "com.google.guava:guava", + "com.google.guava:listenablefuture", + "com.google.j2objc:j2objc-annotations", + "org.apiguardian:apiguardian-api", + "org.checkerframework:checker-qual", + "org.junit.jupiter:junit-jupiter-api", + "org.junit.jupiter:junit-jupiter-engine", + "org.junit.platform:junit-platform-commons", + "org.junit.platform:junit-platform-console", + "org.junit.platform:junit-platform-engine", + "org.junit.platform:junit-platform-launcher", + "org.junit.platform:junit-platform-reporting", + "org.opentest4j:opentest4j" + ] + }, + "services": { + "org.junit.jupiter:junit-jupiter-engine": { + "org.junit.platform.engine.TestEngine": [ + "org.junit.jupiter.engine.JupiterTestEngine" + ] + }, + "org.junit.platform:junit-platform-console": { + "java.util.spi.ToolProvider": [ + "org.junit.platform.console.ConsoleLauncherToolProvider" + ] + }, + "org.junit.platform:junit-platform-launcher": { + "org.junit.platform.launcher.TestExecutionListener": [ + "org.junit.platform.launcher.listeners.UniqueIdTrackingListener" + ] + }, + "org.junit.platform:junit-platform-reporting": { + "org.junit.platform.launcher.TestExecutionListener": [ + "org.junit.platform.reporting.open.xml.OpenTestReportGeneratingListener" + ] + } + }, + "version": "3" +} diff --git a/package.json b/package.json index d265e28..e7868b8 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "@typescript-eslint/eslint-plugin": "^7.2.0", "@typescript-eslint/parser": "^7.2.0", "@eslint/js": "^9.0.0", - "typescript-eslint": "^7.2.0" + "typescript-eslint": "^7.18.0", + "@types/node": "^22.0.0" }, "pnpm": { "onlyBuiltDependencies": [] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aab11b7..9c735a1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: '@eslint/js': specifier: ^9.0.0 version: 9.39.4 + '@types/node': + specifier: ^22.0.0 + version: 22.19.17 '@typescript-eslint/eslint-plugin': specifier: ^7.2.0 version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.39.4)(typescript@5.4.2))(eslint@9.39.4)(typescript@5.4.2) @@ -27,7 +30,7 @@ importers: specifier: 5.4.2 version: 5.4.2 typescript-eslint: - specifier: ^7.2.0 + specifier: ^7.18.0 version: 7.18.0(eslint@9.39.4)(typescript@5.4.2) packages: @@ -104,6 +107,9 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==, tarball: https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz} + '@types/node@22.19.17': + resolution: {integrity: sha512-wGdMcf+vPYM6jikpS/qhg6WiqSV/OhG+jeeHT/KlVqxYfD40iYJf9/AE1uQxVWFvU7MipKRkRv8NSHiCGgPr8Q==, tarball: https://registry.npmjs.org/@types/node/-/node-22.19.17.tgz} + '@typescript-eslint/eslint-plugin@7.18.0': resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==, tarball: https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz} engines: {node: ^18.18.0 || >=20.0.0} @@ -529,6 +535,9 @@ packages: engines: {node: '>=14.17'} hasBin: true + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==, tarball: https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz} + uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==, tarball: https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz} @@ -620,6 +629,10 @@ snapshots: '@types/json-schema@7.0.15': {} + '@types/node@22.19.17': + dependencies: + undici-types: 6.21.0 + '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.39.4)(typescript@5.4.2))(eslint@9.39.4)(typescript@5.4.2)': dependencies: '@eslint-community/regexpp': 4.12.2 @@ -1046,6 +1059,8 @@ snapshots: typescript@5.4.2: {} + undici-types@6.21.0: {} + uri-js@4.4.1: dependencies: punycode: 2.3.1 diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel new file mode 100644 index 0000000..f52b4b6 --- /dev/null +++ b/tools/BUILD.bazel @@ -0,0 +1,37 @@ +load("@npm_rulesjs//:eslint/package_json.bzl", eslint_bin = "bin") +load("@npm_rulesjs//:prettier/package_json.bzl", prettier_bin = "bin") +load("@rules_shell//shell:sh_binary.bzl", "sh_binary") + +package(default_visibility = ["//visibility:public"]) + +prettier_bin.prettier_binary( + name = "prettier", + args = [ + "--config=$(rootpath //:prettier_config_bin)", + "--ignore-path=$(rootpath //:prettier_ignore_bin)", + "--ignore-unknown", + ], + data = [ + "//:prettier_config_bin", + "//:prettier_ignore_bin", + ], + env = {"BAZEL_BINDIR": "."}, +) + +sh_binary( + name = "prettier_filter_links", + srcs = ["prettier_filter_links.sh"], + data = [":prettier"], + env = {"PRETTIER_BIN": "$(rootpath :prettier)"}, +) + +eslint_bin.eslint_binary( + name = "eslint", + data = [ + "//:node_modules/@eslint/js", + "//:node_modules/typescript-eslint", + "//:prettier_config_bin", + ], + env = {"BAZEL_BINDIR": "."}, + fixed_args = ["--no-error-on-unmatched-pattern"], +) diff --git a/tools/format/BUILD.bazel b/tools/format/BUILD.bazel index 65c602d..657e799 100644 --- a/tools/format/BUILD.bazel +++ b/tools/format/BUILD.bazel @@ -2,11 +2,17 @@ load("@aspect_rules_lint//format:defs.bzl", "format_multirun") package(default_visibility = ["//visibility:public"]) +java_binary( + name = "ktfmt", + main_class = "com.facebook.ktfmt.cli.Main", + runtime_deps = ["@ktfmt//jar"], +) + format_multirun( name = "format", - javascript = "//:prettier", - kotlin = "//tools/lint:ktlint_sh_binary", - markdown = "//:prettier", + javascript = "//tools:prettier_filter_links", + kotlin = ":ktfmt", + markdown = "//tools:prettier_filter_links", starlark = "@buildifier_prebuilt//:buildifier", - yaml = "//:prettier", + yaml = "//tools:prettier_filter_links", ) diff --git a/tools/format/ktlint_wrapper.sh b/tools/format/ktlint_wrapper.sh deleted file mode 100755 index f065014..0000000 --- a/tools/format/ktlint_wrapper.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# tools/format/ktlint_wrapper.sh - -# The first argument is the path to the ktlint binary -KTLINT="$1" -shift - -# Make KTLINT path absolute before we cd -if [[ "$KTLINT" != /* ]]; then - KTLINT="$PWD/$KTLINT" -fi - -# Filter args -args=() -has_check=0 -for arg in "$@"; do - if [[ "$arg" == "--set-exit-if-changed" ]] || [[ "$arg" == "--dry-run" ]]; then - has_check=1 - continue - fi - if [[ "$arg" == node_modules/* ]] || [[ "$arg" == bazel-* ]]; then - continue - fi - args+=("$arg") -done - -if [ ${#args[@]} -eq 0 ]; then - exit 0 -fi - -# Try to find the workspace root -ROOT="$PWD" -while [[ "$ROOT" != "/" && ! -f "$ROOT/.bazelversion" ]]; do - ROOT="$(dirname "$ROOT")" -done - -if [[ -f "$ROOT/.bazelversion" ]]; then - cd "$ROOT" -fi - -if [ $has_check -eq 1 ]; then - exec java -jar "$KTLINT" "${args[@]}" -else - # Use -F for formatting - exec java -jar "$KTLINT" -F "${args[@]}" -fi diff --git a/tools/format/oxfmt_wrapper.sh b/tools/format/oxfmt_wrapper.sh deleted file mode 100755 index bf16474..0000000 --- a/tools/format/oxfmt_wrapper.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# tools/format/oxfmt_wrapper.sh - -# The first argument is the path to the oxfmt binary -OXFMT="$1" -shift - -# Filter out node_modules and other unwanted dirs from remaining arguments -args=() -has_check=0 -for arg in "$@"; do - if [[ "$arg" == "--check" ]]; then - has_check=1 - continue - fi - if [[ "$arg" == node_modules/* ]] || [[ "$arg" == bazel-* ]]; then - continue - fi - args+=("$arg") -done - -# If no args left (or only --check was present), just exit successfully -if [ ${#args[@]} -eq 0 ]; then - exit 0 -fi - -if [ $has_check -eq 1 ]; then - "$OXFMT" --check "${args[@]}" -else - "$OXFMT" --write "${args[@]}" -fi diff --git a/tools/format/prettier_wrapper.sh b/tools/format/prettier_wrapper.sh deleted file mode 100644 index fbecc97..0000000 --- a/tools/format/prettier_wrapper.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -export BAZEL_BINDIR=. -exec "$@" diff --git a/tools/lint/BUILD.bazel b/tools/lint/BUILD.bazel index e091ddb..3c6a497 100644 --- a/tools/lint/BUILD.bazel +++ b/tools/lint/BUILD.bazel @@ -3,16 +3,12 @@ load("@npm_rulesjs//:prettier/package_json.bzl", prettier_bin = "bin") package(default_visibility = ["//visibility:public"]) -exports_files([ - "baseline.xml", - "ktlint_run.sh", - "eslint_run.sh", -]) +exports_files(["baseline.xml"]) eslint_bin.eslint_binary( name = "eslint", data = [ - "//:eslint_config", + "//:eslint_config_bin", "//:node_modules/@eslint/js", "//:node_modules/typescript-eslint", ], @@ -22,12 +18,6 @@ eslint_bin.eslint_binary( prettier_bin.prettier_binary( name = "prettier", - data = ["//:prettier_config"], + data = ["//:prettier_config_bin"], env = {"BAZEL_BINDIR": "."}, ) - -sh_binary( - name = "ktlint_sh_binary", - srcs = ["ktlint_run.sh"], - data = ["@ktlint_jar//jar"], -) diff --git a/tools/lint/eslint_run.sh b/tools/lint/eslint_run.sh deleted file mode 100755 index 6646d21..0000000 --- a/tools/lint/eslint_run.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# tools/lint/eslint_run.sh - -# Find eslint binary -ESLINT=$(find . -name "eslint" | grep "eslint_" | head -n 1) - -if [[ ! -f "$ESLINT" ]]; then - ESLINT=$(find . -name "eslint.bash" | head -n 1) -fi - -if [[ ! -f "$ESLINT" ]]; then - echo >&2 "ERROR: eslint binary not found" - exit 1 -fi - -# Try to find the workspace root -ROOT="$PWD" -while [[ "$ROOT" != "/" && ! -f "$ROOT/.bazelversion" ]]; do - ROOT="$(dirname "$ROOT")" -done - -if [[ -f "$ROOT/.bazelversion" ]]; then - cd "$ROOT" -fi - -# Set BAZEL_BINDIR for js_binary -export BAZEL_BINDIR=. - -# Check if files exist -for arg in "$@"; do - if [[ "$arg" != -* ]]; then - if [[ ! -f "$arg" ]]; then - echo >&2 "DEBUG: File not found: $arg (PWD=$PWD)" - fi - fi -done - -# Run eslint -exec "$ESLINT" "$@" diff --git a/tools/lint/ktlint_run.sh b/tools/lint/ktlint_run.sh deleted file mode 100755 index ae12dd3..0000000 --- a/tools/lint/ktlint_run.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# tools/lint/ktlint_run.sh - -# The aspect passes the jar via --ruleset if we use ruleset_jar attribute -# We use this to find the jar in the sandbox -JAR="" -args=() -for arg in "$@"; do - if [[ "$arg" == --ruleset=* ]]; then - JAR="${arg#--ruleset=}" - # Don't pass --ruleset to ktlint if it's the main jar! - continue - fi - args+=("$arg") -done - -if [[ ! -f "$JAR" ]]; then - # Fallback: search for it - JAR=$(find . -name "downloaded.jar" | grep ktlint_jar | head -n 1) -fi - -if [[ ! -f "$JAR" ]]; then - echo >&2 "ERROR: ktlint jar not found" - exit 1 -fi - -exec java -jar "$JAR" "${args[@]}" diff --git a/tools/lint/linters.bzl b/tools/lint/linters.bzl index 853795a..5efec5e 100644 --- a/tools/lint/linters.bzl +++ b/tools/lint/linters.bzl @@ -1,17 +1,23 @@ +load("@aspect_rules_lint//lint:buildifier.bzl", "lint_buildifier_aspect") +load("@aspect_rules_lint//lint:eslint.bzl", "lint_eslint_aspect") load("@aspect_rules_lint//lint:ktlint.bzl", "lint_ktlint_aspect") -# load("@aspect_rules_lint//lint:eslint.bzl", "lint_eslint_aspect") +load("@aspect_rules_lint//lint:lint_test.bzl", "lint_test") ktlint = lint_ktlint_aspect( - binary = Label("//tools/lint:ktlint_sh_binary"), - editorconfig = Label("//:.editorconfig"), - baseline_file = Label("//tools/lint:baseline.xml"), - ruleset_jar = Label("//:ktlint_jar_alias"), + binary = Label("@com_github_pinterest_ktlint//file"), + editorconfig = "@@//:.editorconfig", + baseline_file = "@@//tools/lint:baseline.xml", ) -# eslint = lint_eslint_aspect( -# binary = Label("//tools/lint:eslint"), -# configs = [ -# Label("//:eslint.config.mjs"), -# Label("//:package.json"), -# ], -# ) +ktlint_test = lint_test(aspect = ktlint) + +eslint = lint_eslint_aspect( + binary = "@@//tools:eslint", + configs = ["@@//:eslint_config_bin"], +) + +buildifier = lint_buildifier_aspect( + binary = Label("@buildifier_prebuilt//:buildifier"), +) + +buildifier_test = lint_test(aspect = buildifier) diff --git a/tools/prettier_filter_links.sh b/tools/prettier_filter_links.sh new file mode 100755 index 0000000..a4c4931 --- /dev/null +++ b/tools/prettier_filter_links.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Filter out symbolic links from the arguments +args=() +for arg in "$@"; do + if [[ -L "$arg" ]]; then + continue + fi + args+=("$arg") +done + +if [ ${#args[@]} -eq 0 ]; then + exit 0 +fi + +# Run the real prettier binary +if [[ -z ${PRETTIER_BIN} ]]; then + PRETTIER_BIN="$RUNFILES_DIR/_main/tools/prettier_/prettier" +fi + +exec "${PRETTIER_BIN}" "${args[@]}"