-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add declaration file for json.lua #1
Conversation
I've been slow to merge this because I've been thinking about how to organize modules here:
I'm wondering if we should be using busted for testing the type declarations. The busted tests end up being more verbose than the type definitions themselves. Plus, this kind of unit tests don't really verify that the types match what the Lua modules actually do, and they mostly re-state what's being said in the
|
Yeah, that would be good enough for this library.
I agree, this approach is not so great, but I figured it was better than nothing. I considered adding tests because some libraries can be pretty hard to type, and I wanted to make sure that every kind of function call in these libraries worked as intended. At least, these tests could be replaced by a simple In some cases, I guess we could verify that the types match what the Lua modules actually do, but that wouldn't be very practical. We'd have to download tons of libraries and programs each time we run the tests from scratch :) |
I was just about to merge this (with the Busted tests removed), but I noticed another small issue to settle first: naming. To avoid conflicts, I think we should go with the package directories as used in the root manifest repository of LuaRocks — @pdesaulniers Sounds good? PS: I added a comment at the json.lua repo: rxi/json.lua#13 (comment) |
@hishamhm Yes, that makes sense. |
Cool! Merged manually! We can address CI for |
Here's a very simple declaration file for json.lua, just in case you needed an example :)
An old version of the library can be found on LuaRocks.
TODO:
Add proper tests for the declaration file using busted(ideally, we should also be able to runbusted
at the root of the project to test all the declarations in the repo)luarocks install @types/rxi-json-lua
or something similar (not sure if LuaRocks would allow that name...)