Skip to content
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

Feat: Add fs-extra #173

Merged
merged 5 commits into from
Nov 1, 2024
Merged

Feat: Add fs-extra #173

merged 5 commits into from
Nov 1, 2024

Conversation

walter-0
Copy link
Contributor

@walter-0 walter-0 commented Oct 16, 2024

Closes (#126)

Snippets to add:

  • emptyDir
  • emptyDirSync
  • ensureFile
  • ensureFileSync
  • ensureLink
  • ensureLinkSync
  • ensureSymlink
  • ensureSymlinkSync
  • outputFile
  • outputFileSync
  • outputJson
  • outputJsonSync
  • pathExists
  • readJson
  • readJsonSync
  • writeJson
  • writeJsonSync

docs/modules/fs-extra.md Outdated Show resolved Hide resolved
docs/modules/fs-extra.md Outdated Show resolved Hide resolved

### Equivalent Methods

- `ensureFile` -> `fs.exists` - deprecated since v1

Choose a reason for hiding this comment

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

Since fs.exists is deprecated, I think we should suggest either using the synchronous version (fs.existsSync) or inlining what fs-extra does (and Node docs recommend): fs.access().then(() => true).catch(() => false).

docs/modules/fs-extra.md Outdated Show resolved Hide resolved
docs/modules/fs-extra.md Outdated Show resolved Hide resolved
docs/modules/fs-extra.md Outdated Show resolved Hide resolved
docs/modules/fs-extra.md Outdated Show resolved Hide resolved
docs/modules/fs-extra.md Outdated Show resolved Hide resolved
docs/modules/fs-extra.md Outdated Show resolved Hide resolved
docs/modules/fs-extra.md Outdated Show resolved Hide resolved
@walter-0
Copy link
Contributor Author

walter-0 commented Oct 17, 2024

Hey @ziebam thanks a lot for the comments! My intent for this PR was mostly to get fs-extra merged in so that I can start making a codemod that covers everything (since additions to module-replacements-codemods require an entry in this repo first), and not as a complete migration guide. If this is ok as an initial, then more detail/snippets can be added to this doc so I can work on a codemod concurrently.

@43081j
Copy link
Contributor

43081j commented Oct 19, 2024

I'll have a full read through in the next day or so. But from a quick scan through it, I think we should do a few of the PR comments at least since they're about which method to prefer.

I don't think we need a migration guide, but we should at least mention the basic mappings (old to new/replacement)

docs/modules/fs-extra.md Outdated Show resolved Hide resolved
docs/modules/fs-extra.md Outdated Show resolved Hide resolved
@43081j 43081j merged commit 023b5dc into es-tooling:main Nov 1, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants