Skip to content

refactor(constants): dedupe and prune centralized path constants - #1869

Merged
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issue-1864-prune-path-constants
Jun 15, 2026
Merged

refactor(constants): dedupe and prune centralized path constants#1869
dyoshikawa merged 1 commit into
mainfrom
resolve-scrap-issue-1864-prune-path-constants

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Background

Follow-ups from PR #1856, which centralized per-tool path literals into src/constants/*-paths.ts modules. Review surfaced non-blocking DRY / dead-code / completeness items, captured in #1864. This PR resolves them.

Changes

  • Dedupe the Antigravity CLI permissions constants (item 1). antigravity-paths.ts is now the single source of truth for ANTIGRAVITY_CLI_PERMISSIONS_SUBDIR / _DIR_PATH / _FILE_NAME. antigravity-cli-paths.ts re-exports them (the subdir under the ANTIGRAVITY_CLI_GLOBAL_SUBDIR name its skill consumer uses) instead of redefining identical literals.
  • Remove genuinely dead exported path constants (items 2 & 3). Verified with knip + grep that no consumer imports them: the unused ANTIGRAVITY_*_PATH / ANTIGRAVITY_RULE_FILE_* / ANTIGRAVITY_COMMANDS_DIR_PATH family, the dead antigravity-ide config/skills/mcp/hooks constants, and the leftover *_RULES_DIR_PATH / *_STEERING_DIR_PATH / *_MEMORIES_DIR_PATH / *_INSTRUCTIONS_DIR_PATH constants (cursor, kilo, roo, augmentcode, kiro, copilot, etc.). After this change, pnpm knip reports zero dead exports in src/constants/*-paths.ts.
  • Un-export internal building blocks. WINDSURF_SUBDIR, PI_AGENT_DIR, and TAKT_FACETS_DIR_PATH are used only to build other constants in their own file, so they drop export and stay module-private rather than appearing as unused public exports.
  • Add a regression test (item 4). src/constants/paths.test.ts pins key centralized constants to their expected path strings and asserts the deduped Antigravity CLI constants resolve identically through both modules.

This is a pure refactor: tsgo --noEmit is clean and the full suite passes via pnpm cicheck. No runtime behavior changes (the removed constants had no consumers; the deduped ones keep byte-for-byte values, locked in by the new test). knip is intentionally not wired into CI here — the repo still has many intentional unused exports (frontmatter schemas, processor target lists) that would need triage first; that remains an optional future step noted in the issue.

Closes #1864

Follow-ups from PR #1856.

- Dedupe the Antigravity CLI permissions constants. `antigravity-paths.ts` is now
  the single source of truth for `ANTIGRAVITY_CLI_PERMISSIONS_SUBDIR` /
  `_DIR_PATH` / `_FILE_NAME`; `antigravity-cli-paths.ts` re-exports them (the
  subdir under the `ANTIGRAVITY_CLI_GLOBAL_SUBDIR` name its skill consumer uses)
  instead of redefining identical literals.
- Remove genuinely dead exported path constants that no consumer imports (verified
  with knip + grep): the unused `ANTIGRAVITY_*_PATH` / `ANTIGRAVITY_RULE_FILE_*` /
  `ANTIGRAVITY_COMMANDS_DIR_PATH` family, the dead `antigravity-ide` config/skills/
  mcp/hooks constants, and the unused `*_RULES_DIR_PATH` / `*_STEERING_DIR_PATH` /
  `*_MEMORIES_DIR_PATH` / `*_INSTRUCTIONS_DIR_PATH` constants left over from the
  centralization (cursor, kilo, roo, augmentcode, kiro, copilot, etc.).
- Drop `export` from constants used only as internal building blocks
  (`WINDSURF_SUBDIR`, `PI_AGENT_DIR`, `TAKT_FACETS_DIR_PATH`) so they stay private
  rather than appearing as unused public exports.
- Add `src/constants/paths.test.ts` pinning key centralized constants to their
  expected path strings, including that the deduped Antigravity CLI constants
  resolve identically through both modules.

Closes #1864
@dyoshikawa
dyoshikawa merged commit 52d8a37 into main Jun 15, 2026
9 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

@dyoshikawa
dyoshikawa deleted the resolve-scrap-issue-1864-prune-path-constants branch June 15, 2026 09:21
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.

Follow-ups from PR #1856: dedupe and prune centralized path constants

2 participants