Some options on improving teal-types dx #1071
Replies: 2 comments 5 replies
-
|
So, one of the other things I was thinking about was where to install the |
Beta Was this translation helpful? Give feedback.
-
|
We should consider versioning of types provided externally from the actual package. If the types are defined external from the source, which is the case for Option 1 and 3, then there is potential for the source Lua/C code to drift from the type definitions. This matters most in the case of major version bumps. Option 3, a types rock, solves this because you can just ship a new rock with a new version, and even maintain rocks for all versions. IMO for Option 1 to work, it needs to essentially become Option 3. That is: if we keep a teal-types repo, ideally it can be a single repo that vends out a rock for each major version of each library it provides types for. This feels like the best of both worlds -- easy to maintain single repo for community owned Teal types, but integration with LuaRocks because we literally ship rocks for each MV of each library. If we can get to this outcome, then all LuaRocks would need really is a way to place Teal types somewhere Cyan can find them and work with them. It also is probably better to flip the relationship around -- maybe Cyan should get LuaRocks integration and be able to find and hook up Teal types based on the rock tree than the other way around (basically option 4). This seems like a cleaner relationship since Cyan already understands tlconfig and source_dir semantics, and we don't need to teach LuaRocks about it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Improving teal-type's DX
I've been thinking a little about teal-type's DX, and have some time to possibly work on it. I feel like there are a a lot of different ways to tackle this, these are just the couple I came up with. All the commands and the how could be changed, and likely other better ways are out there. I'm just putting my ideas out there. This is sort've in relation to what @mtdowling brought up in #947
Keeping a few things in mind is key:
The LuaRocks options
1. Check teal-types when someone does a LuaRocks install
luarocks install lua-cjson2. Create "shadow" teal-ified rock that also install the .d.tl files
luarocks install teal-lua-cjsonteal-[original rock name].d.tlfile in the install stepteal-version always gets the latest installed version?3. Create just a "type" file rock
luarocks install lua-cjson-typesVery similar to above, but doesn't worry about the dependency syncing aspect. Just installs the teal type
The cyan options
4. Add a new options to cyan for installing LuaRocks
cyan add lua-cjsonand/orcyan install lua-cjsonadd, it could update the dependencies in the local rockspec file. Otherwise just install it (similar touv addvsuv pip install)5. Add an option to just get the type information
cyan get-type lua-cjsonFinal Thoughts
Rankings (subjective, based on my understandings)
luarocks install lua-cjsonluarocks install teal-lua-cjsonluarocks install lua-cjson-typescyan add lua-cjsoncyan get-type lua-cjsonDX rankings:
Beta Was this translation helpful? Give feedback.
All reactions