Skip to content

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

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

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

Conversation

@trivikr

Copy link
Copy Markdown
Contributor

🔗 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

vercelBot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentApr 4, 2026 9:38am
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewApr 4, 2026 9:38am
npmx-lunariaIgnoredIgnoredApr 4, 2026 9:38am

Request Review

@codecov

codecovBot commented Apr 3, 2026

Copy link
Copy Markdown

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

coderabbitaiBot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

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 nameStatusExplanation
Description check✅ PassedThe 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.

@ghostdevvghostdevv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ghostdevvghostdevv changed the title chore(cli): use mkdtempDisposable for package init cleanuprefactor(cli)!: use mkdtempDisposable and require node >=24.4Apr 4, 2026
@ghostdevv

Copy link
Copy Markdown
Member

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 queueApr 4, 2026
Merged via the queue into npmx-dev:main with commit 8a36727Apr 4, 2026
20 of 21 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Apr 4, 2026
@trivikr
trivikr deleted the mkdtempDisposable branch April 5, 2026 03:52
Sign up for freeto 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

@trivikr@ghostdevv