Skip to content

Refactor validators to use shared IO helpers for file access#17

Merged
willwade merged 2 commits into
mainfrom
codex/refactor-validator-code-for-environment-compatibility
Jan 19, 2026
Merged

Refactor validators to use shared IO helpers for file access#17
willwade merged 2 commits into
mainfrom
codex/refactor-validator-code-for-environment-compatibility

Conversation

@willwade
Copy link
Copy Markdown
Collaborator

Motivation

  • Remove direct fs/path usage in validators to avoid React/browser warnings and to follow the repository's environment-agnostic IO conventions.
  • Use the existing IO helpers and zip adapter approach so validation remains functional in both Node and browser runtimes.

Description

  • Replaced direct fs/path imports and readFileSync/statSync/path.basename calls in multiple validators with readBinaryFromInput, getFs, getBasename, and getPath from src/utils/io.
  • Updated the following validators to use the IO helpers: dotValidator, obfsetValidator, astericsValidator, applePanelsValidator, snapValidator, opmlValidator, excelValidator, and touchChatValidator.
  • Updated the validation entrypoint validateFileOrBuffer in src/validation/index.ts to use getBasename, readBinaryFromInput, and getFs for consistent name resolution and file reads when a path is provided.
  • Preserved existing behavior and validator logic while making file access conditional on the shared IO layer so browser builds won't import Node fs/path at module load time.

Testing

  • No automated tests were run as part of this change.

Codex Task

@codecov-commenter
Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@willwade willwade marked this pull request as ready for review January 19, 2026 11:50
@willwade willwade merged commit 37dcb16 into main Jan 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants