Skip to content

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

Merged
tupe12334 merged 4 commits into
mainfrom
claude/replace-expand-tilde-untildify-20260224
Oct 19, 2026
Merged

tupe12334 merged 4 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 4 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
untildify keeps the forward slash from the input, so compare normalized paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tupe12334
tupe12334 merged commit f176a9c into main Oct 19, 2026
10 checks passed
@tupe12334 tupe12334 mentioned this pull request Oct 19, 2026
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