Skip to content

Windows support: test and fix platform-specific issues #2

@codingstark-dev

Description

@codingstark-dev

Summary

BunKill is currently only tested on macOS. Windows has not been validated and has several known incompatibilities that need to be addressed.

Known Issues

1. Shell commands not available on Windows

  • src/scanner.ts:157-169getDirectorySize() spawns du -sk which is not available on Windows by default
  • src/scanner.ts:426-429deleteModules() spawns rm -rf which is not available on Windows (should use rd /s /q or fs.rm)

2. Path separator handling

  • src/scanner.ts:51isWithinRoot() uses hardcoded / separator
  • src/scanner.ts:55hasHiddenPathSegment() uses hardcoded /
  • src/scanner.ts:245fullPath.split("/node_modules") hardcoded separator
  • src/scanner.ts:328projectPath = nmPath.replace(/\/node_modules$/, "") hardcoded separator
  • Multiple other places use / instead of path.sep or path.join

3. Terminal UI

  • Raw mode handling (setRawMode) may behave differently on Windows
  • ANSI escape codes for cursor movement and colors may need Windows Terminal or ConPTY

Proposed Solutions

  1. Replace du -sk with a cross-platform size calculation (e.g., recursive Bun.file().stat() or use node:fs APIs)
  2. Replace rm -rf with fs.promises.rm(path, { recursive: true, force: true }) (available in Node/Bun)
  3. Use path.sep or path.join() consistently instead of hardcoded /
  4. Test on Windows Terminal and document minimum terminal requirements
  5. Add CI testing on Windows (GitHub Actions windows-latest)

Testing Needed

  • Run bunkill on Windows 10/11 with Windows Terminal
  • Run bunkill --dry-run and verify paths display correctly
  • Run bunkill --delete-all on a test directory and verify deletion works
  • Test interactive mode (arrow keys, space, enter, search)
  • Test --full-scan mode on Windows
  • Test with paths containing spaces and special characters

Acceptance Criteria

  • All shell commands replaced with cross-platform equivalents
  • Path handling uses platform-agnostic methods
  • Interactive UI works on Windows Terminal
  • CI pipeline includes Windows testing
  • README updated with Windows installation and usage instructions

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions