Skip to content

refactor(deps): gazelle migration phase 1 — inline thin wrappers#6197

Merged
longlho merged 1 commit intomainfrom
chore/gazelle-migration-phase1
Mar 28, 2026
Merged

refactor(deps): gazelle migration phase 1 — inline thin wrappers#6197
longlho merged 1 commit intomainfrom
chore/gazelle-migration-phase1

Conversation

@longlho
Copy link
Copy Markdown
Member

@longlho longlho commented Mar 28, 2026

Summary

Gazelle migration phase 1: inline thin Bazel macro wrappers so ts_project targets can eventually be made visible to gazelle for automatic dependency management.

Changes

1. Replace ts_binary with js_binary (22 calls across 9 files)

ts_binary was a thin wrapper that just added --experimental-transform-types to node_options. Now inlined directly:

-load("//tools:index.bzl", "ts_binary")
+load("@aspect_rules_js//js:defs.bzl", "js_binary")

-ts_binary(
+js_binary(
     name = "benchmark",
     entry_point = "benchmark.ts",
+    node_options = ["--experimental-transform-types"],
 )

2. Remove package_json_test (28 files)

Dead code — the actual test body was commented out. Only created a copy_to_bin(name = "package") target that nothing depended on.

3. Update migration doc + CLAUDE.md

  • Mark phase 1 as done in knowledge-base/migrations/001-gazelle-migration.md
  • Add knowledge-base update reminder to CLAUDE.md

What's NOT changed

  • tools/index.bzl is untouched — macros remain available for reference
  • ts_compile, ts_compile_node, vitest, generate_src_file macros are untouched (phases 2-3)

Test plan

  • pnpm t — all 495 tests pass
  • All lefthook pre-commit hooks pass
  • CI passes

🤖 Generated with Claude Code

Replace all ts_binary() calls with js_binary() + --experimental-transform-types
directly in BUILD.bazel files (22 calls across 9 files). Remove all
package_json_test() calls which were dead code (28 files).

This is the first step toward making ts_project targets visible to gazelle
for automatic dep management. See knowledge-base/migrations/001-gazelle-migration.md.

Also add knowledge-base update reminder to CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@longlho longlho enabled auto-merge (squash) March 28, 2026 14:02
@longlho longlho merged commit c178c87 into main Mar 28, 2026
6 checks passed
@longlho longlho deleted the chore/gazelle-migration-phase1 branch March 28, 2026 14:04
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant