-
-
Notifications
You must be signed in to change notification settings - Fork 31
fix(types): package.json exports field; export utility types
#107
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
Conversation
|
Draft for now, I get an error about not configuring a default export... |
Ensure all utility types are exported. Prefer `export declare const Chess: {...}; export default Chess` to `export = Chess`.
|
I see, it's that plus the legacy I exported all of the types, so that anyone can use the util types with This is working for me locally. We can apparently do it even more simply with: But I would leave it the way it's submitted here in case you ever want to add module paths like Really great job with the library btw, let me know if you need any changes to this PR and I'll get them in quickly. |
|
Damn hahahah this has been a real game of whack-a-mole, I just saw #96. It came back only because the I imagine this worked when it was merged but TS has updated to respect This PR basically just re-adds the types to I guess explicitly defining the |
exports compatible typesexports field; export utility types
|
@ctjlewis Thank you! Dope PR... I merged, made a tiny adjustment to the package.json and updated dependencies. It's now released as v1.5.1 in npm. I also added you to the contributors list. Cheers! |
|
Also, not sure if it's useful or not for your use case, but I recently put out a Go port of the algebraic parsing component of this library in Go (https://github.com/brozeph/chess - |
TS throws and wants us to set the types in the
exportsfield.That issue was closed but this is still an issue on latest version.
Btw, this mostly happens because the
exportsfield is defined and so it's being used for module resolution - if it were empty, this error would actually go away and it would fall back to usingpackage.json > types. But since we're using the (correct, modern)exportsfield, we have to setexports > . > typestochess.d.ts.