Remove fs-extra#1476
Conversation
One file left because it depends on other packages.
🦋 Changeset detectedLatest commit: 4b54c84 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 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 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #1476 +/- ##
=======================================
Coverage ? 81.01%
=======================================
Files ? 54
Lines ? 2239
Branches ? 657
=======================================
Hits ? 1814
Misses ? 421
Partials ? 4 ☔ View full report in Codecov by Sentry. |
|
|
||
| afterEach(() => { | ||
| console.error = consoleError; | ||
| jest.restoreAllMocks(); |
There was a problem hiding this comment.
Some tests were failing without this when run as a suite, but passed individually. Not sure why.
There was a problem hiding this comment.
hm, interesting - i'll take a look into this before landing htis
| let pathExists = await access(changesetPath) | ||
| .then(() => true) | ||
| .catch(() => false); |
There was a problem hiding this comment.
Same here, could be a common utility function somewhere. This implementation is also what fs-extra.pathExists is doing under the hood, so we might need to credit the author here? Not sure since even Node documentation suggests using access for asynchronous existence checks.
2d760a3 to
2b1d818
Compare
This is needed due to a conflict with Node types that was fixed in 2.3.4. Also dedupes the dependency, so overall a net positive. See: https://github.com/enquirer/enquirer/blob/master/CHANGELOG.md#234---2020-01-13
|
This looks great to me too. I don't know what others think, but I usually prefer For the access/then/catch pattern, I wonder if it's also fine to simply use |
I'm fine with changing to default imports as my preference for named imports is very shallow, as in I can't even quite put my finger on why I prefer them. I'm gonna hold off on making the change for now though, in case someone with a stronger opinion pops in! 😄 As for |
|
i softly prefer dotted access to those but it's harder to set up autoimports for that than for named exports so 🤷 |
|
@ziebam could you add a changeset to this PR? |
I initially branched off off $ packages/cli/bin.js
🦋 error Error: Failed to find where HEAD diverged from next. Does next exist?
🦋 error at getDivergedCommit (/home/pralky/dev/changesets/packages/git/src/index.ts:51:11)
🦋 error at getChangedFilesSince (/home/pralky/dev/changesets/packages/git/src/index.ts:196:22)
🦋 error at getChangedPackagesSinceRef (/home/pralky/dev/changesets/packages/git/src/index.ts:258:24)
🦋 error at getVersionableChangedPackages (/home/pralky/dev/changesets/packages/cli/src/utils/versionablePackages.ts:15:27)
🦋 error at add (/home/pralky/dev/changesets/packages/cli/src/commands/add/index.ts:47:7)
🦋 error at run (/home/pralky/dev/changesets/packages/cli/src/run.ts:72:5)Should I temporarily change the |
|
Hm, it might be worth investigating why this happens because it's not a good experience for the users. I'll try to repro it later using this branch. To recheck a thing - do you have a
I'd use patch since it's not a significant change and we want it to be listed in the patch section of changes in the final v3 release |
I thought I had (I pulled the refs earlier), but I had to actually checkout |
|
I'm glad that you have resolved the issue. I think this could be improved in the tool though - likely we don't consult the remote at all in this kind of a situation, the local branch could also be outdated. It might be worth rechecking how Changesets behave in cases like this. |
Indeed. Should I file an issue for that or would you prefer to have it in the v3 discussion? Related: pushed the changeset and changed the named imports to default ones per your and @bluwy's suggestions. |
Let's keep it in that v3 discussion for now. |
bluwy
left a comment
There was a problem hiding this comment.
Looks great! I think the fs.access thing is probably worth revisiting, but we could do that later.
Part of the v3 cleanup: #1473.
fs-extrais effectively unnecessary in modern Node versions, and can be replaced with the native functionality.