Skip to content

feat: inline fs.ts types to remove node:fs dependency#1198

Merged
streamich merged 4 commits intomasterfrom
copilot/fix-1197
Sep 24, 2025
Merged

feat: inline fs.ts types to remove node:fs dependency#1198
streamich merged 4 commits intomasterfrom
copilot/fix-1197

Conversation

Copy link
Contributor

Copilot AI commented Sep 24, 2025

This PR inlines the type definitions from node:fs in the src/vendor/node/fs.ts file to eliminate the implicit dependency warning from tslint.

Changes

The file previously imported types directly from Node.js:

export type { PathLike, symlink } from 'node:fs';

This has been replaced with inlined type definitions:

// Inlined types from node:fs to avoid implicit dependencies
export type PathLike = string | Buffer | URL;

// tslint:disable-next-line:no-namespace
export namespace symlink {
  export type Type = "dir" | "file" | "junction";
}

Benefits

  • ✅ Removes the no-implicit-dependencies tslint error for node:fs
  • ✅ Maintains full backward compatibility with existing code
  • ✅ Preserves exact type definitions from Node.js
  • ✅ No breaking changes to the public API

Verification

  • All 891 tests continue to pass
  • TypeScript compilation succeeds without errors
  • The inlined types match Node.js fs module definitions exactly
  • Existing usage patterns like symlink.Type continue to work

The change is minimal and surgical, affecting only the type definitions while maintaining the same functionality and type safety.

Fixes #1197.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Copilot AI changed the title [WIP] Inline src/vendor/node/fs.ts file feat: inline fs.ts types to remove node:fs dependency Sep 24, 2025
Copilot AI requested a review from streamich September 24, 2025 10:07
@streamich streamich marked this pull request as ready for review September 24, 2025 10:11
@streamich streamich merged commit 514ba38 into master Sep 24, 2025
12 checks passed
@streamich streamich deleted the copilot/fix-1197 branch September 24, 2025 10:20
@github-actions
Copy link
Contributor

🎉 This PR is included in version 4.45.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inline src/vendor/node/fs.ts file

2 participants