Skip to content

fix: replace deprecated fs.F_OK with fs.constants.F_OK#1820

Merged
breautek merged 1 commit intoapache:masterfrom
stephan-kutzner:master
Jul 8, 2025
Merged

fix: replace deprecated fs.F_OK with fs.constants.F_OK#1820
breautek merged 1 commit intoapache:masterfrom
stephan-kutzner:master

Conversation

@stephan-kutzner
Copy link
Contributor

Motivation and Context

This change resolves the Node.js deprecation warning DEP0176:

fs.F_OK is deprecated, use fs.constants.F_OK instead

The warning appears when building projects with recent versions of Node.js (v20.8.0+).
No open issue was found for this warning at the time of writing.

Description

Replaced usage of the deprecated fs.F_OK with fs.constants.F_OK in cordova-android/lib/builders/ProjectBuilder.js.

This change aligns with the Node.js recommendation since v6.3.0.

Testing

  • Verified that the build still completes successfully without functional issues.
  • Confirmed that the DEP0176 deprecation warning is no longer emitted during build.
  • npm test

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

This addresses the warning DEP0176 introduces in Node.js v20.8.0
@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.24%. Comparing base (60d2842) to head (aa63c15).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1820   +/-   ##
=======================================
  Coverage   72.24%   72.24%           
=======================================
  Files          23       23           
  Lines        1841     1841           
=======================================
  Hits         1330     1330           
  Misses        511      511           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@breautek breautek added this to the 15.0.0 milestone Jul 8, 2025
Copy link
Contributor

@breautek breautek left a comment

Choose a reason for hiding this comment

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

fs.constants.F_OK is available since NodeJS 6, and we require a much later version of NodeJS anyway, so 👍 to moving off the old deprecated constant.

@breautek breautek merged commit b792326 into apache:master Jul 8, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants