Skip to content

refactor(interactive): remove dead __dirname/__filename after wrapper retirement#430

Merged
umair-ably merged 1 commit into
mainfrom
chore/interactive-remove-dead-dirname
Jun 30, 2026
Merged

refactor(interactive): remove dead __dirname/__filename after wrapper retirement#430
umair-ably merged 1 commit into
mainfrom
chore/interactive-remove-dead-dirname

Conversation

@umair-ably

Copy link
Copy Markdown
Collaborator

Small follow-up to #419.

When the ably-interactive wrapper was retired, the __filename / __dirname constants it relied on in src/commands/interactive.ts were left behind, along with the now-unused fileURLToPath import. They were dead code.

This removes all three lines. path and fs are kept — they're still used for the oclif manifest lookup later in the file.

ESLint did not flag these (so main stays green), but they're genuine leftovers, so worth tidying.

Validation

  • pnpm prepare — build + manifest OK
  • pnpm exec eslint src/commands/interactive.ts — clean
  • pnpm test test/unit/commands/interactive.test.ts — 7 passed

🤖 Generated with Claude Code

… retirement

These were only consumed by the ably-interactive wrapper logic removed in
#419. With the wrapper gone, both constants and the fileURLToPath import are
unused.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cli-web-cli Ready Ready Preview, Comment Jun 30, 2026 3:58pm

Request Review

@claude-code-ably-assistant

Copy link
Copy Markdown

Walkthrough

Follow-up cleanup to PR #419, which retired the ably-interactive wrapper script. The wrapper previously relied on ESM-to-CJS polyfills (__filename / __dirname) defined in src/commands/interactive.ts; once the wrapper was gone, those three lines became dead code. This PR removes them along with the now-unused fileURLToPath import. No behavior changes.

Changes

Area Files Summary
Commands src/commands/interactive.ts Remove dead fileURLToPath import and unused __filename/__dirname constants left over from wrapper retirement

Review Notes

  • No behavioral changes — purely dead-code removal; path and fs imports are retained (still used for the oclif manifest lookup).
  • Tiny diff — 4 lines deleted, 0 added, 1 file touched; very low risk.
  • ESLint did not catch these (no no-unused-vars trigger since they were valid ESM idioms). Manual cleanup only.
  • No new dependencies, no migration considerations, no test changes needed (existing 7 unit tests still pass).

@claude-code-ably-assistant claude-code-ably-assistant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Removing dead __dirname/__filename code

This is a clean, minimal cleanup. The three removed lines (fileURLToPath import, __filename, __dirname) have no remaining references in the file, and the kept imports (path, fs) are still actively used at line 901–904 for the oclif manifest lookup.

No issues found. The change is correct and safe.

  • Dead code removed: confirmed via grep — zero remaining references to __dirname, __filename, or fileURLToPath in the file.
  • Live imports kept: path and fs are still used for path.join(this.config.root, ...) and fs.existsSync/fs.readFileSync.
  • Validation steps in the PR description (build, lint, unit tests) all reported clean.

LGTM.

@umair-ably umair-ably merged commit da842f2 into main Jun 30, 2026
12 checks passed
@umair-ably umair-ably deleted the chore/interactive-remove-dead-dirname branch June 30, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants