Skip to content

fix(devtools-kit): pass cwd to execa#960

Merged
antfu merged 3 commits into
mainfrom
fix/startsubprocess_cwd
Mar 23, 2026
Merged

fix(devtools-kit): pass cwd to execa#960
antfu merged 3 commits into
mainfrom
fix/startsubprocess_cwd

Conversation

@huang-julien
Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

Ran into some issues when starting devtools in local mode.
Seems like execa gets cwd from nodeOptions now

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 21, 2026

Deploying nuxt-devtools with  Cloudflare Pages  Cloudflare Pages

Latest commit: bf3acde
Status: ✅  Deploy successful!
Preview URL: https://fa4ef608.nuxt-devtools.pages.dev
Branch Preview URL: https://fix-startsubprocess-cwd.nuxt-devtools.pages.dev

View logs

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 21, 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: 99ef004b-040b-4964-acb1-a93dc1e91d79

📥 Commits

Reviewing files that changed from the base of the PR and between d8df20b and bf3acde.

📒 Files selected for processing (1)
  • packages/devtools-kit/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/devtools-kit/src/index.ts

📝 Walkthrough

Walkthrough

The startSubprocess() implementation in packages/devtools-kit/src/index.ts was modified so the spawned process working directory is set from execaOptions.cwd when present; if execaOptions.cwd is absent it falls back to execaOptions.nodeOptions?.cwd. This change only affects the nodeOptions.cwd value passed into the subprocess execution call and does not alter subprocess lifecycle, environment merging, or hook wiring.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: passing cwd to execa in the devtools-kit package, which matches the implementation.
Description check ✅ Passed The description is related to the changeset, explaining the motivation (devtools issues in local mode) and the fix (passing cwd to execa).

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/startsubprocess_cwd

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

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/devtools-kit/src/index.ts`:
- Around line 51-54: The nodeOptions object assignment currently overwrites any
existing execaOptions.nodeOptions.cwd with execaOptions.cwd even when
execaOptions.cwd is undefined; change the cwd assignment in the nodeOptions
block so it uses execaOptions.cwd only when it is defined and otherwise
preserves execaOptions.nodeOptions.cwd (i.e., use a nullish-coalescing style
fallback for cwd), leaving the rest of the nodeOptions spread untouched (refer
to the nodeOptions object in packages/devtools-kit/src/index.ts).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 342a7d6c-3e35-4337-8919-b839d6772776

📥 Commits

Reviewing files that changed from the base of the PR and between ce21c44 and d8df20b.

📒 Files selected for processing (1)
  • packages/devtools-kit/src/index.ts

Comment thread packages/devtools-kit/src/index.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@antfu antfu merged commit 64958ad into main Mar 23, 2026
5 checks passed
@antfu antfu deleted the fix/startsubprocess_cwd branch March 23, 2026 02:21
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