refactor(deps): gazelle migration phases 2-3 — decompose ts_compile and vitest macros#6198
Merged
Conversation
Inline all ts_compile() and ts_compile_node() macro calls into explicit ts_project + js_library targets across 29 BUILD.bazel files. Each macro call expanded to 3 targets: - ts_project (typecheck only, tsgo transpiler, no_emit) - ts_project (transpile with oxc, emits JS + .d.ts) - js_library (bundles transpiled output + package.json) This makes ts_project targets visible at the BUILD file level, which is a prerequisite for gazelle to manage their deps automatically. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
longlho
added a commit
that referenced
this pull request
Mar 30, 2026
Revert the BUILD file changes from phases 1-3 of the gazelle migration: - Phase 1: inline ts_binary -> js_binary (#6197) - Phase 2: decompose ts_compile macros (#6198) - Phase 3+4: decompose vitest, enable gazelle JS (#6199) Keep gazelle scaffolding (aspect-gazelle setup, multitool, lefthook integration) and knowledge-base documentation. The migration approach of using map_kind + copy_to_bin caused conflicting actions between gazelle-managed srcs and copy_to_bin outputs. A different approach is needed. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2 tasks
longlho
added a commit
that referenced
this pull request
Mar 30, 2026
## Summary Revert the BUILD file changes from the gazelle migration (phases 1-3) while keeping the scaffolding and documentation. ### Reverted - Phase 1: `ts_binary` → `js_binary` inlining (#6197) - Phase 2: `ts_compile` macro decomposition (#6198) - Phase 3+4: `vitest` decomposition + gazelle JS enablement (#6199) ### Kept - Gazelle scaffolding: aspect-gazelle setup, multitool, lefthook integration (#6195) - Knowledge-base documentation (#6196) ### Why The `map_kind` + `copy_to_bin` approach caused conflicting actions — both `copy_to_bin(name = "srcs")` and gazelle's direct file lists produce the same output files through `ts_project`. A different approach is needed that either eliminates `copy_to_bin` or uses a custom gazelle extension. ## Test plan - [x] 495 tests pass - [ ] CI passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gazelle migration phases 2 and 3: decompose all custom macros (
ts_compile,ts_compile_node,vitest) into explicitts_project+js_library/vitest_runnertargets. This makes allts_projecttargets visible at the BUILD file level — the prerequisite for gazelle to managedepsby reading TypeScript imports.Phase 2: Decompose
ts_compile/ts_compile_nodeEach macro call expanded to 3 explicit targets:
ts_compilepackages (BASE_TSCONFIG) + 1 custom (BASE_NODE_TSCONFIG)ts_compile_nodepackages (ESNEXT_TSCONFIG)Phase 3: Decompose
vitestCreated
vitest_runnermacro intools/vitest.bzl(test runner + snapshots only, no ts_project). Inlinedts_projecttypecheck into BUILD files:TEST_TSCONFIG,VITEST_DEPS,VITEST_DOM_DEPSfromvitest.bzlvitestmacro kept as deprecated wrapper for backwards compatibilityWhat's NOT changed (Phase 4)
npm_package,esbuild,generate_src_file,generate_ide_tsconfig_json— packaging/codegen stays manualtools/index.bzl— old macros remain for referenceTest plan
pnpm t— all 495 tests pass🤖 Generated with Claude Code