Skip to content

refactor(scripts): remove unused __dirname and fileURLToPath from deploy.mjs (Fixes #850) - #889

Closed
kleitonbernardino-lab wants to merge 1 commit into
MergeFi:mainfrom
kleitonbernardino-lab:fix/remove-unused-deploy-dirname-850
Closed

kleitonbernardino-lab wants to merge 1 commit into
MergeFi:mainfrom
kleitonbernardino-lab:fix/remove-unused-deploy-dirname-850

Conversation

@kleitonbernardino-lab

Copy link
Copy Markdown

Summary of Changes

In scripts/deploy.mjs, __dirname was computed on line 16 but never referenced anywhere in the file. WASM paths are resolved relative to the current working directory (path.resolve(process.cwd(), wasmPath) on line 32), leaving __dirname and its fileURLToPath import as dead code.

This PR cleans up the unused computation and import:

  • Removed import { fileURLToPath } from "node:url";
  • Removed unused const __dirname = path.dirname(fileURLToPath(import.meta.url));

Verification

Tests pass cleanly:

$ node --test scripts/deploy.test.mjs
▶ scripts/deploy.mjs CLI argument validation
  ✔ fails with exit code 1 when no arguments or env vars provided
  ✔ rejects a positional secret instead of treating it as credentials
✔ scripts/deploy.mjs CLI argument validation
ℹ tests 2
ℹ suites 1
ℹ pass 2
ℹ fail 0

Fixes #850.

…loy.mjs (Fixes MergeFi#850)

Signed-off-by: Kleiton Bernardino <kleiton.bernardino@gmail.com>
@vercel

vercel Bot commented Nov 11, 2026

Copy link
Copy Markdown

@kleitonbernardino-lab is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@chonilius chonilius closed this Nov 12, 2026
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.

scripts/deploy.mjs computes __dirname and never uses it

2 participants