-
Notifications
You must be signed in to change notification settings - Fork 89
Fix test cases and docs #104
Conversation
Hey yeah Ryan wrote me. I think we can update the tests to use buffers explicitly as Ryan himself suggests. |
Thanks @s1na, I have updated the typedoc and test cases, please take a look and let me know if it looks good 🙂 |
|
||
# merkle-patricia-tree | ||
|
||
## Index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I see quite a few items here that I don't think should be public and documenting them might give the impression they are public. We're exporting them from the individual files so that other files can use, but ideally only the things re-exported in index.ts
should be considered public. I don't remember exactly if typedoc supported something like this, I remember I had struggled with this before..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, thanks. In ethereumjs-util
I discovered typedoc@next
has a library mode (TypeStrong/typedoc#639) that is quite neat. I gave it a try here with some additional exclude
params and seems like it's working well. I just pushed a commit if you would like to take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skimmed through. Looks good, thanks Ryan! It seems the private attributes of the classes are still documented even though you specifiec excludePrivate
(maybe we'll have to add a @private
or something typedoc can detect). But this can be done in future. I'm not even sure if we're excluding these private stuff in other libraries.
trie.checkpoint() | ||
trie.put('test', 'something', function () { | ||
trie.put('love', 'emotion', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love these test cases lol
'2386bfb0de9cf93902a110f5ab07b917ffc0b9ea599cb7f4f8bb6fd1123c866c': true | ||
d5f61e1ff2b918d1c2a2c4b1732a3c68bd7e3fd64f35019f2f084896d4546298: true, | ||
e64329dadee2fb8a113b4c88cfe973aeaa9b523d4dc8510b84ca23f9d5bfbd90: true, | ||
c916d458bfb5f27603c5bd93b00f022266712514a59cde749f19220daffc743f: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm not sure I like this linting rule, but doesn't matter..
"mdEngine": "github", | ||
"excludeNotExported": true | ||
"gitRevision": "master", | ||
"exclude": "src/**/!(secure|checkpointTrie|baseTrie).ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope they do add a feature to automatically detect public API so we don't have to exclude by file name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree, the library
mode is a great first step so hopefully we'll see more in the future in that direction.
👍 @s1na thanks for settling this out! |
This PR:
get
andput
to match its type definition (onlyBuffer
).next
to utilize library mode.