Skip to content

refactor: cache getVersion() and add JSDoc to display utilities#79

Open
KernelCode wants to merge 1 commit intomainfrom
auto-improve-1772701292
Open

refactor: cache getVersion() and add JSDoc to display utilities#79
KernelCode wants to merge 1 commit intomainfrom
auto-improve-1772701292

Conversation

@KernelCode
Copy link
Owner

Summary

  • Cache getVersion(): Previously read package.json from disk on every call. Since the version cannot change at runtime, the result is now cached after the first read — avoiding repeated synchronous I/O.
  • Add JSDoc to all undocumented functions: getLocalIp(), showLogo(), showStartupCheck(), showStartupComplete(), showSuccess(), showError(), createSpinner(), and showCharacterGallery() now have proper JSDoc with parameter types and return descriptions.

Test plan

  • Syntax validated with node -c
  • Verify startup screen still renders correctly (npm start)
  • Confirm getVersion() returns the correct version on first and subsequent calls

🤖 Generated with Claude Code

getVersion() was reading package.json from disk on every call even
though the version cannot change at runtime. Cache the result after
the first read. Also add JSDoc comments to all previously
undocumented exported functions for better IDE support and
maintainability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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