-
Notifications
You must be signed in to change notification settings - Fork 77
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
Publish non-global version of definitions #215
Comments
This project is primarily intended for players to use in the game. In that context, there are some assumptions built in. Like the game providing everything in global without having to import it from any particular module. At the same time, your use case for typing out-of-game tools also sounds useful. And I can see the limitations about not being able to "put the genie back into the bottle" with oversharing in global. This might need a bit of thinking about. From glancing at the linked thread, it's difficult to draw conclusions from 2016 PRs that don't resolve in merges, and vague references to "best practices". I don't see a Granted, assuming _ is lodash is far less global pollution than this package is making, but it's the same functionality. Explicitly packaging a second module package seems like a possible solution but also as a rather large hammer. Will need to do a bit more research and testing. |
Yeah, definitely a bit of an unusual use case that I've got, and I agree that the issue I linked isn't especially helpful. I'll do some more investigating and let you know if I come up with anything. |
If you install |
I have occasion to use some of the Screeps type definitions outside of the Screeps environment. (I'm making a server-side implementation of RoomVisual for visualizing test results and want to make sure the interfaces match.) However, installing
@types/screeps
imports all of the definitions everywhere in my project, which is a recipe for confusion when most of the objects aren't available in my environment. From what I understand of DefinitelyTyped/DefinitelyTyped#5045 (comment), it sounds like the way to make this work is to have two packages, one to declare everything and the other to export it all into the global namespace.I've proved this to work conceptually in wolfgang42@45c0ee2, but that was done by hacking up the build scripts and TBH I'm not really sure of the correct way to structure this. So I'm opening this issue to start the discussion; further thoughts are appreciated.
The text was updated successfully, but these errors were encountered: