refactor(constants): dedupe and prune centralized path constants - #1869
Merged
Conversation
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
Owner
Author
|
@dyoshikawa Thank you! |
Merged
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.
Background
Follow-ups from PR #1856, which centralized per-tool path literals into
src/constants/*-paths.tsmodules. Review surfaced non-blocking DRY / dead-code / completeness items, captured in #1864. This PR resolves them.Changes
antigravity-paths.tsis now the single source of truth forANTIGRAVITY_CLI_PERMISSIONS_SUBDIR/_DIR_PATH/_FILE_NAME.antigravity-cli-paths.tsre-exports them (the subdir under theANTIGRAVITY_CLI_GLOBAL_SUBDIRname its skill consumer uses) instead of redefining identical literals.knip+grepthat no consumer imports them: the unusedANTIGRAVITY_*_PATH/ANTIGRAVITY_RULE_FILE_*/ANTIGRAVITY_COMMANDS_DIR_PATHfamily, the deadantigravity-ideconfig/skills/mcp/hooks constants, and the leftover*_RULES_DIR_PATH/*_STEERING_DIR_PATH/*_MEMORIES_DIR_PATH/*_INSTRUCTIONS_DIR_PATHconstants (cursor, kilo, roo, augmentcode, kiro, copilot, etc.). After this change,pnpm knipreports zero dead exports insrc/constants/*-paths.ts.WINDSURF_SUBDIR,PI_AGENT_DIR, andTAKT_FACETS_DIR_PATHare used only to build other constants in their own file, so they dropexportand stay module-private rather than appearing as unused public exports.src/constants/paths.test.tspins 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 --noEmitis clean and the full suite passes viapnpm 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).knipis 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