fs-extra: Define missing fs.realpath.native#51155
fs-extra: Define missing fs.realpath.native#51155DanielRosenwasser merged 1 commit intoDefinitelyTyped:masterfrom
Conversation
|
@Andarist Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PR
Code ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 7 days. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 51155,
"author": "Andarist",
"headCommitOid": "04dff5135b2d7a2ed6415e86514ed28fb6306280",
"lastPushDate": "2021-02-21T13:33:07.000Z",
"lastActivityDate": "2021-02-21T15:55:19.000Z",
"maintainerBlessed": false,
"hasMergeConflict": false,
"isFirstContribution": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "fs-extra",
"kind": "edit",
"files": [
{
"path": "types/fs-extra/fs-extra-tests.ts",
"kind": "test"
},
{
"path": "types/fs-extra/index.d.ts",
"kind": "definition"
}
],
"owners": [
"alan-agius4",
"midknight41",
"shiftkey",
"mees-",
"jrockwood",
"sangdth",
"ffflorian",
"peterblazejewicz",
"NotWoods"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "peterblazejewicz",
"date": "2021-02-21T15:55:19.000Z",
"isMaintainer": false
},
{
"type": "stale",
"reviewer": "orta",
"date": "2021-02-18T16:30:12.000Z",
"abbrOid": "b12c36c"
}
],
"ciResult": "pass"
} |
|
🔔 @alan-agius4 @midknight41 @shiftkey @mees- @jrockwood @sangdth @ffflorian @peterblazejewicz @NotWoods — please review this PR in the next few days. Be sure to explicitly select |
|
@Andarist The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
d752926 to
b12c36c
Compare
types/fs-extra/tslint.json
Outdated
| "extends": "dtslint/dt.json" | ||
| "extends": "dtslint/dt.json", | ||
| "rules": { | ||
| "unified-signatures": false |
There was a problem hiding this comment.
as this project is related to @types/node I believe it's better for both to keep a similar shape rather than to optimize for unified-signatures
There was a problem hiding this comment.
Yes, that's correct, but it is also better to use inline exclusion, not general rule, so per-readme for DT:
https://github.com/DefinitelyTyped/DefinitelyTyped#linter-tslintjson
@types/nodes are just so complex, it would be unrealistic to exclude via inline comments,
also we could probably just do something like (without modifying tslint):
export namespace realpath {
const native: {
(path: PathLike, options?: fs.BaseEncodingOptions | BufferEncoding | null): Promise<string>;
(path: PathLike, options: fs.BaseEncodingOptions | string | undefined | null): Promise<string | Buffer>;
(path: PathLike, options: fs.BufferEncodingOption): Promise<Buffer>;
} & typeof fs.realpath.native;(the expected return types would be different and there is no inferred return type). There would be no need to retype fs version (dry)
There was a problem hiding this comment.
I think this feedback makes sense, punting on merging to give discussion a bit more time
There was a problem hiding this comment.
Adjusted as proposed 👍
|
👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings. Let’s review the numbers, shall we? Comparison details 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. |
|
Re-ping @alan-agius4, @midknight41, @shiftkey, @mees-, @jrockwood, @sangdth, @ffflorian, @peterblazejewicz, @NotWoods: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
b12c36c to
9d5b9d4
Compare
da0de6b to
d44e788
Compare
|
@Andarist The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
d44e788 to
04dff51
Compare
peterblazejewicz
left a comment
There was a problem hiding this comment.
LGTM!
@Andarist thx for adjusting the PR and accepting proposed changes to your original ideas. kudos
|
@orta Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
I just published |
|
Hey, FYI, some types are not recognized when using Here are the errors: Those are exposed here, in the most recent types for node (14?), but not here for node 12, nor here for node 13. Is there anything that I can do to fix those errors? |
@idan-at IMO we can extract those interfaces to inline version with |
|
You mean copy them from the node types? That can work, I guess. tho this can be problematic, for example if a bug will discover within those types - node types will be fixed, but not the inline ones. From my end - I think I'll just pin to a specific version until I migrate to node14. I think it's the easiest solution |
|
Node 12 is still LTS, so this needs to be fixed. Version has to be pinned to |
|
For reference, this is the issue for the compilebreak this causes in node 12: #51521 |
|
I just submitted a fix after this caused plenty of CI issues >_< #51677 |
Please fill in this template.
npm test <package to test>.If changing an existing definition:
Based on:
https://github.com/jprichardson/node-fs-extra/blob/1625838cdfc65a1bbf28ab5fa962a75805629b9c/lib/fs/index.js#L127-L129
and
DefinitelyTyped/types/node/fs.d.ts
Lines 797 to 804 in dcc9ee4
This exists since
fs-extra@8.1.0:jprichardson/node-fs-extra@fa661f3