Skip to content

feat(node): support for fs.opendir[Sync]#1521

Merged
Sam Gammon (sgammon) merged 1 commit intomainfrom
feat/fs-opendir
Jul 5, 2025
Merged

feat(node): support for fs.opendir[Sync]#1521
Sam Gammon (sgammon) merged 1 commit intomainfrom
feat/fs-opendir

Conversation

@sgammon
Copy link
Member

@sgammon Sam Gammon (sgammon) commented Jul 4, 2025

Ready for review Powered by Pull Request Badge

Summary

Adds support for node:fs methods opendir, opendirSync, and promises/opendir; such methods were blocked on implementation of the fs.Dir and fs.Dirent classes, which also were added.

Changelog

feat(node): implement `fs.Dir`
feat(node): implement `fs.Dirent`
feat(node): implement `fs.opendir`
feat(node): implement `fs.opendirSync`
feat(node): implement `fs/promises.opendir`
test(node): tests for `fs.opendir` and friends
test(node): test for `fs/promises.opendir`
chore: update detekt baseline

@sgammon Sam Gammon (sgammon) added this to the Release R18: Beta milestone Jul 4, 2025
@sgammon Sam Gammon (sgammon) self-assigned this Jul 4, 2025
@sgammon Sam Gammon (sgammon) added enhancement New feature or request lang:javascript Issues relating to JavaScript api:node Node API and stdlib labels Jul 4, 2025
@sgammon Sam Gammon (sgammon) moved this to Done in Elide Jul 4, 2025
@sgammon Sam Gammon (sgammon) moved this from Done to In Progress in Elide Jul 4, 2025
@codecov
Copy link

codecov bot commented Jul 4, 2025

Codecov Report

Attention: Patch coverage is 68.16143% with 71 lines in your changes missing coverage. Please review.

Project coverage is 40.41%. Comparing base (20351b4) to head (bbc5474).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...src/main/kotlin/elide/runtime/node/fs/Directory.kt 51.35% 35 Missing and 1 partial ⚠️
...ain/kotlin/elide/runtime/node/fs/NodeFilesystem.kt 76.00% 11 Missing and 7 partials ⚠️
...de/runtime/intrinsics/js/node/fs/OpenDirOptions.kt 40.00% 9 Missing ⚠️
...ain/kotlin/elide/runtime/node/fs/DirectoryEntry.kt 90.56% 4 Missing and 1 partial ⚠️
.../elide/runtime/intrinsics/js/node/FilesystemAPI.kt 50.00% 2 Missing ⚠️
...runtime/intrinsics/js/node/FilesystemPromiseAPI.kt 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1521      +/-   ##
==========================================
+ Coverage   40.18%   40.41%   +0.22%     
==========================================
  Files         701      704       +3     
  Lines       32850    33071     +221     
  Branches     4576     4599      +23     
==========================================
+ Hits        13201    13364     +163     
- Misses      18099    18148      +49     
- Partials     1550     1559       +9     
Flag Coverage Δ
jvm 40.41% <68.16%> (+0.22%) ⬆️
lib 40.41% <68.16%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...runtime/intrinsics/js/node/FilesystemPromiseAPI.kt 66.66% <50.00%> (+41.66%) ⬆️
.../elide/runtime/intrinsics/js/node/FilesystemAPI.kt 88.00% <50.00%> (-7.24%) ⬇️
...ain/kotlin/elide/runtime/node/fs/DirectoryEntry.kt 90.56% <90.56%> (ø)
...de/runtime/intrinsics/js/node/fs/OpenDirOptions.kt 40.00% <40.00%> (ø)
...ain/kotlin/elide/runtime/node/fs/NodeFilesystem.kt 71.55% <76.00%> (+3.20%) ⬆️
...src/main/kotlin/elide/runtime/node/fs/Directory.kt 51.35% <51.35%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20351b4...bbc5474. Read the comment docs.

🚀 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.

feat(node): implement `fs.Dir`
feat(node): implement `fs.Dirent`
feat(node): implement `fs.opendir`
feat(node): implement `fs.opendirSync`
feat(node): implement `fs/promises.opendir`
test(node): tests for `fs.opendir` and friends
test(node): test for `fs/promises.opendir`
chore: update `graalvm` api pins

Signed-off-by: Sam Gammon <sam@elide.dev>
@sgammon Sam Gammon (sgammon) merged commit b825520 into main Jul 5, 2025
18 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Elide Jul 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api:node Node API and stdlib enhancement New feature or request lang:javascript Issues relating to JavaScript

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants