Skip to content

refactor(cli): hoist fs and path requires to top of bin/confluence.js#179

Merged
pchuri merged 1 commit into
mainfrom
chore/hoist-fs-path-requires
May 10, 2026
Merged

refactor(cli): hoist fs and path requires to top of bin/confluence.js#179
pchuri merged 1 commit into
mainfrom
chore/hoist-fs-path-requires

Conversation

@pchuri
Copy link
Copy Markdown
Owner

@pchuri pchuri commented May 10, 2026

Summary

  • Move const fs = require('fs'); and const path = require('path'); to the top of bin/confluence.js alongside the other module imports.
  • Remove 16 inline re-declarations scattered across 13 command action handlers.
  • No behavior change: Node already caches require results, so the inline declarations were redundant — this is purely a readability/maintainability cleanup.

Test plan

  • npm run lint — passes
  • npm test — 669 tests across 15 suites pass
  • No remaining inline const fs|path = require(...) matches in bin/confluence.js

The fs and path modules were being re-required inline inside 13 command
action handlers, adding noise to each handler body. Hoist a single
require for each module to the top of the file alongside the other
top-level imports. No behavior change — Node caches require results,
so the inline declarations were already no-ops on subsequent calls.
@pchuri pchuri self-assigned this May 10, 2026
@pchuri pchuri merged commit 367c033 into main May 10, 2026
6 checks passed
@pchuri pchuri deleted the chore/hoist-fs-path-requires branch May 10, 2026 03:50
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

1 participant