Skip to content

refactor(utils): replace custom expandTilde with untildify package - #50

Open
tupe12334 wants to merge 2 commits into
mainfrom
claude/replace-expand-tilde-untildify-20260224
Open

tupe12334 wants to merge 2 commits into
mainfrom
claude/replace-expand-tilde-untildify-20260224

Conversation

@tupe12334

Copy link
Copy Markdown
Member

Summary

Closes #179

Replaces the hand-rolled expandTilde() helper inside resolve-project-path.ts with the untildify npm package (v6).

  • Removes ~17 lines of custom tilde-expansion code in favour of a focused, well-tested library
  • Improves cross-platform reliability (correct behaviour on Windows, Linux, and macOS)
  • Handles edge cases such as ~username paths on Unix systems that the custom implementation did not cover
  • Keeps the public API of resolveProjectPath unchanged

Changes

  • src/utils/resolve-project-path.ts - removed custom expandTilde function; imported and used untildify directly
  • package.json - added untildify ^6.0.0 as a production dependency
  • pnpm-lock.yaml - lockfile updated by pnpm add untildify

Test plan

  • Verify centy commands that accept a --project flag with a ~/... path still resolve correctly
  • Verify paths without a tilde are unaffected
  • Run existing test suite: pnpm test

🤖 Generated with Claude Code

tupe12334 and others added 2 commits February 24, 2026 03:47
Replace the custom tilde expansion implementation in resolveProjectPath
with the well-maintained untildify npm package (v6).

- Removes custom code in favour of a focused, tested library
- Improves cross-platform reliability (Windows, Linux, macOS)
- Handles edge cases such as ~user paths on Unix systems
- Simplifies the resolve-project-path module

Closes #179

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts:
#	package.json
#	pnpm-lock.yaml
#	src/utils/resolve-project-path.ts
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