Skip to content

refactor(cli)!: use mkdtempDisposable and require node >=24.4#2365

Merged
ghostdevv merged 3 commits intonpmx-dev:mainfrom
trivikr:mkdtempDisposable
Apr 4, 2026
Merged

refactor(cli)!: use mkdtempDisposable and require node >=24.4#2365
ghostdevv merged 3 commits intonpmx-dev:mainfrom
trivikr:mkdtempDisposable

Conversation

@trivikr
Copy link
Copy Markdown
Contributor

@trivikr trivikr commented Apr 3, 2026

🔗 Linked issue

N/A

🧭 Context

The connector’s packageInit() flow created a temporary directory with mkdtemp() and then manually removed it in a finally block. Since this codebase now runs on Node.js 24.x, we can use the built-in disposable temp directory API instead of managing that cleanup ourselves.

📚 Description

This PR updates the CLI package init flow to use fs.promises.mkdtempDisposable() with await using in packageInit().

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 4, 2026 9:38am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Apr 4, 2026 9:38am
npmx-lunaria Ignored Ignored Apr 4, 2026 9:38am

Request Review

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3cdcba7c-77aa-4dcd-91a0-8c11feae7446

📥 Commits

Reviewing files that changed from the base of the PR and between d962373 and 71a1acf.

📒 Files selected for processing (1)
  • cli/package.json
✅ Files skipped from review due to trivial changes (1)
  • cli/package.json

📝 Walkthrough

Walkthrough

The packageInit function in cli/src/npm-client.ts was refactored to use mkdtempDisposable and await using for temporary directory management, replacing the manual try/finally cleanup and switching filesystem operations and npm cwd to tempDir.path. Imports were adjusted accordingly. Additionally, cli/package.json tightened its Node.js engine requirement from >=24 to >=24.4.0.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description is directly related to the changeset, explaining the context and rationale for using mkdtempDisposable instead of manual cleanup.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@ghostdevv ghostdevv left a comment

Choose a reason for hiding this comment

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

@ghostdevv ghostdevv changed the title chore(cli): use mkdtempDisposable for package init cleanup refactor(cli)!: use mkdtempDisposable and require node >=24.4 Apr 4, 2026
@ghostdevv
Copy link
Copy Markdown
Contributor

I updated the engines field, I think we can get away with this since we're in pre-release :p

@ghostdevv ghostdevv enabled auto-merge April 4, 2026 09:37
@ghostdevv ghostdevv added this pull request to the merge queue Apr 4, 2026
Merged via the queue into npmx-dev:main with commit 8a36727 Apr 4, 2026
20 of 21 checks passed
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.

2 participants