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: Support fs-extra and graceful-fs #296

Merged
merged 9 commits into from
Jul 13, 2022
Merged

feat: Support fs-extra and graceful-fs #296

merged 9 commits into from
Jul 13, 2022

Conversation

kachkaev
Copy link
Contributor

@kachkaev kachkaev commented Jun 11, 2022

src/analyze.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #296 (297cf38) into main (2a749dc) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #296      +/-   ##
==========================================
+ Coverage   80.44%   80.45%   +0.01%     
==========================================
  Files          13       13              
  Lines        1488     1489       +1     
  Branches      555      555              
==========================================
+ Hits         1197     1198       +1     
  Misses        121      121              
  Partials      170      170              
Impacted Files Coverage Δ
src/analyze.ts 86.01% <100.00%> (+0.03%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@kachkaev kachkaev changed the title Add broken test case for fs-extra Supportfs-extra and graceful-fs Jul 13, 2022
@kachkaev kachkaev marked this pull request as ready for review July 13, 2022 21:43
@kachkaev kachkaev requested a review from ijjk as a code owner July 13, 2022 21:43
@kachkaev kachkaev changed the title Supportfs-extra and graceful-fs Support fs-extra and graceful-fs Jul 13, 2022
@kachkaev kachkaev changed the title Support fs-extra and graceful-fs feat: Support fs-extra and graceful-fs Jul 13, 2022
src/analyze.ts Show resolved Hide resolved
@styfle
Copy link
Member

styfle commented Jul 13, 2022

Hmm, I think this is not really testing the correct code.

I realized that __dirname already triggers asset emission today. For example, this works:

const asset1 = __dirname + "/asset1.txt";
const asset2 = __dirname + "/asset2.json";

@kachkaev
Copy link
Contributor Author

It might need to be a variation of:

const fs = require("fs-extra");

console.log(fs.readFileSync(`${process.cwd()}/asset1.txt`));
console.log(fs.readJsonSync(process.cwd() + "/asset2.json"));

I need to wrap up for today, but I can take another look later!

@kachkaev
Copy link
Contributor Author

Side thought: we might also want to support fs/promises.

Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

Looks great!

I confirmed this fails with the current version and this PR fixes it 🎉

@styfle styfle enabled auto-merge (squash) July 13, 2022 22:28
@styfle styfle merged commit 11c6888 into vercel:main Jul 13, 2022
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.

Treat fs-extra as an alias to fs / node:fs
2 participants