Skip to content

fix: (node:50743) [DEP0190] DeprecationWarning #1608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 28, 2025

Conversation

SutuSebastian
Copy link
Collaborator

@SutuSebastian SutuSebastian commented Jul 28, 2025

Error

(node:50743) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)

Changes

  • remove shell: true
  • fix Datepicker test

Result

Before

Screenshot 2025-07-28 at 11 38 57

After

No error.

Summary by CodeRabbit

  • Chores

    • Added a patch update addressing a Node.js deprecation warning.
    • Updated documentation to clarify command execution behavior.
  • Refactor

    • Improved command execution utility to allow flexible command running without forced shell usage.

@SutuSebastian SutuSebastian requested a review from rluders July 28, 2025 08:39
@SutuSebastian SutuSebastian self-assigned this Jul 28, 2025
@SutuSebastian SutuSebastian added the 🐛 bug Something isn't working label Jul 28, 2025
Copy link

changeset-bot bot commented Jul 28, 2025

🦋 Changeset detected

Latest commit: f9b359a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
flowbite-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 9:01am
flowbite-react-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 9:01am

Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Walkthrough

A new changeset file was added to document a patch update for the flowbite-react package, specifically addressing a Node.js deprecation warning. Separately, the execCommand utility function was updated to no longer force shell execution, giving callers more control over the shell option and updating its documentation. Additionally, a Datepicker test was refined to correctly identify and assert the disabled state of the appropriate date element when multiple elements share the same date text.

Changes

Cohort / File(s) Change Summary
Changeset Documentation
.changeset/plenty-apes-give.md
Added a changeset file documenting a patch update for flowbite-react to address a Node.js deprecation warning.
CLI Utility Update
packages/ui/src/cli/utils/exec-command.ts
Modified execCommand to remove forced shell execution, updated documentation to reflect this change.
Datepicker Test Refinement
packages/ui/src/components/Datepicker/Datepicker.test.tsx
Updated test to correctly identify the disabled date element among multiple matching elements before asserting its disabled state.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5-10 minutes

Suggested labels

confirmed

Suggested reviewers

  • rluders

Poem

A patch for warnings, a shell set free,
The rabbit hops in code with glee.
One file to note, one function refined,
Simpler commands, with options aligned.
With every hop, the code grows bright—
Review complete, all feels right! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f0841f and f9b359a.

📒 Files selected for processing (1)
  • packages/ui/src/components/Datepicker/Datepicker.test.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: SutuSebastian
PR: themesberg/flowbite-react#1566
File: packages/ui/src/cli/commands/setup-init.ts:41-0
Timestamp: 2025-07-21T18:57:15.352Z
Learning: In CLI tools that generate files, using setTimeout with a small delay (like 10ms) before fs.writeFile operations can be intentional debouncing to prevent race conditions with IDE formatting extensions (Prettier, ESLint auto-fix, etc.) that automatically format files upon creation/modification. This ensures the file is visible to the IDE and formatting completes before proceeding with subsequent operations.
packages/ui/src/components/Datepicker/Datepicker.test.tsx (1)

Learnt from: rluders
PR: #1314
File: packages/ui/src/components/Datepicker/helpers.ts:112-119
Timestamp: 2024-07-27T04:19:32.056Z
Learning: The getFormattedDate function in packages/ui/src/components/Datepicker/helpers.ts should use DateFNSFormat directly with the date and format string for proper localization support, mapping language codes to locale objects from date-fns/locale.

🔇 Additional comments (1)
packages/ui/src/components/Datepicker/Datepicker.test.tsx (1)

203-206: LGTM! Improved test robustness for disabled date verification.

This change makes the test more robust by correctly handling scenarios where multiple elements share the same date text. Instead of assuming the first element with the date text is the disabled one, the test now explicitly finds the element with the disabled attribute and verifies its state. This is particularly important in datepicker components where the same date might appear in different contexts (e.g., previous/next month preview dates).

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/node/deprecation-warning

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@SutuSebastian SutuSebastian merged commit e1b5bb1 into main Jul 28, 2025
8 checks passed
@SutuSebastian SutuSebastian deleted the fix/node/deprecation-warning branch July 28, 2025 09:02
@github-actions github-actions bot mentioned this pull request Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant