Return the new offset from File.seek - #7076
Conversation
🦋 Changeset detectedLatest commit: 8ec9170 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This PR changes the public FileSystem.File.seek contract so it returns the new cursor offset as a branded Size, aligning the type signature with what the Node/Bun shared and Deno implementations were already computing.
packages/effect/src/FileSystem.ts: updatedFile.seekreturn type fromEffect.Effect<void>toEffect.Effect<Size>and updated the example implementation.packages/platform-node-shared/src/NodeFileSystem.ts:FileImpl.seeknow returnsFileSystem.Size(this.position).packages/platform-deno/src/DenoFileSystem.ts:FileImpl.seeknow returnsFileSystem.Size(this.position)..changeset/fresh-files-seek.md: added minor changeset entries foreffect,@effect/platform-node-shared, and@effect/platform-deno.
Validation run: pnpm check, pnpm lint, pnpm --filter @effect/platform-node-shared test --run, and pnpm doctest --run packages/effect/src/FileSystem.ts all pass.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|

Summary
File.seekto return the new offset as a brandedSizeFileexample implementation for the new return typeNode and Bun use the shared Node file-system implementation. The browser package does not provide a file-system implementation.
Validation
pnpm checkpnpm lintpnpm vitest run --project @effect/platform-node-shared(106 tests)deno task test --run --project @effect/platform-deno(197 passed, 11 skipped)pnpm doctest packages/effect/src/FileSystem.ts(16 tests)Closes EFF-475