Repository navigation
Conversation
The entry point exports Seaport and nothing else, so that is the whole
surface a consumer gets without a deep import:
require("@opensea/seaport-js") -> [ 'Seaport' ]
Both order examples in the README are written with ItemType.ERC721, and no
example imports it because there is nowhere to import it from. Copying
either one leaves ItemType undefined. fulfillOrder's doc comment has the
same problem: "We expose a helper to get this: getMaximumSizeForOrder", and
that helper is not exported either.
Export the two the documentation already promises, and add the import line
the README examples were missing. Adding to the entry point breaks nothing;
Seaport keeps resolving exactly as it did.
The second example also reached for a bare parseEther while the first uses
ethers.parseEther, so it now matches its neighbour.
Left alone deliberately: the rest of the constants and the input types are
still deep-import only. Widening the public surface further is a call worth
making on purpose rather than as a side effect of a docs fix.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #983 +/- ##
==========================================
+ Coverage 98.27% 98.94% +0.66%
==========================================
Files 35 51 +16
Lines 14526 18451 +3925
Branches 660 980 +320
==========================================
+ Hits 14276 18256 +3980
+ Misses 245 188 -57
- Partials 5 7 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks. Documentation that references a symbol nobody can import is worse than no documentation, so this is worth having. I agree with where you stopped. Widening the public surface past what the docs already claim is a deliberate decision rather than something to do as a side effect, and holding the line at exactly the two symbols the README and the fulfillOrder doc comment already promise makes the change easy to accept. If you do want to open the rest of the constants and input types, that is worth its own issue first. Catching the bare parseEther in the second example while you were in there was a nice touch. This has landed in #985 with seven other contributions from the same day. Closing in favour of that one. |
Problem
The entry point exports
Seaportand nothing else, so that is the whole surface a consumer gets without a deep import:Both order examples in the README are written with
ItemType.ERC721, and neither imports it — because there is nowhere to import it from. Copy either example andItemTypeis undefined.fulfillOrder's doc comment has the same gap:That helper is not exported either.
Fix
Export the two the documentation already promises, and add the import line the README examples were missing. Adding to the entry point breaks nothing —
Seaportresolves exactly as before.While in those two code blocks: the second reached for a bare
parseEtherwhere the first usesethers.parseEther, so it now matches its neighbour.I stopped there on purpose. The rest of the constants and the input types are still deep-import only, and widening the public surface past what the docs already claim felt like a call to make deliberately rather than as a side effect of this. Happy to extend it if you'd rather the whole surface came out.
Test
test/public-exports.spec.tsasserts the entry point carries the client,ItemType, andgetMaximumSizeForOrder. Two of the three go red against the currentsrc/index.ts.Building and requiring
lib/index.jsafterwards givesItemType, Seaport, getMaximumSizeForOrder.