Skip to content

chore: use node.fs in scripts#953

Open
huang-julien wants to merge 2 commits intomainfrom
chore/windows_issue
Open

chore: use node.fs in scripts#953
huang-julien wants to merge 2 commits intomainfrom
chore/windows_issue

Conversation

@huang-julien
Copy link
Member

🔗 Linked issue

📚 Description

I'm just a windows user 🥹, cp doesn't exists

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 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: 8cb4355d-3e87-4913-ae4e-f15a2a48ea2b

📥 Commits

Reviewing files that changed from the base of the PR and between f0beb96 and fcc903a.

📒 Files selected for processing (2)
  • packages/devtools/package.json
  • packages/devtools/scripts/copy-client.mjs
✅ Files skipped from review due to trivial changes (1)
  • packages/devtools/scripts/copy-client.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/devtools/package.json

📝 Walkthrough

Walkthrough

The build:client script in packages/devtools/package.json was changed to run nuxi generate client && node scripts/copy-client.mjs instead of using a shell cp -r command. A new file packages/devtools/scripts/copy-client.mjs was added; it imports cpSync from Node's fs module and copies client/.output/public into dist/client recursively.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: use node.fs in scripts' accurately describes the main change: replacing shell commands with Node's fs module in build scripts.
Description check ✅ Passed The description is related to the changeset, explaining the Windows compatibility issue with the cp command and the motivation for using Node's fs API instead.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 chore/windows_issue
📝 Coding Plan
  • Generate coding plan for human review comments

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
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/package.json`:
- Line 36: The npm script "build:client" uses node -e
"require('fs').cpSync('client/.output/public','dist/client',{recursive:true})"
which copies into dist/client without removing prior contents; update the script
to remove/clear the destination first (e.g., call
require('fs').rmSync('dist/client',{recursive:true,force:true}) or equivalent)
before invoking cpSync so stale files are removed and the output is
deterministic; ensure the removal runs only for that path and still preserves
error/exit behavior of the script.
🪄 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: 5a096cff-7c20-4e37-9096-12692935842b

📥 Commits

Reviewing files that changed from the base of the PR and between f82457d and f0beb96.

📒 Files selected for processing (1)
  • packages/devtools/package.json

@antfu
Copy link
Member

antfu commented Mar 18, 2026

Should we write a script for that? I am worried this would be hard to maintain over time

@huang-julien
Copy link
Member Author

sure :)

@huang-julien huang-julien marked this pull request as draft March 19, 2026 14:01
@huang-julien huang-julien marked this pull request as ready for review March 19, 2026 14:01
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 19, 2026

Deploying nuxt-devtools with  Cloudflare Pages  Cloudflare Pages

Latest commit: fcc903a
Status:🚫  Build failed.

View logs

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