implement permission-set types#84
Conversation
Adds support for permission-set lexicons with `lx.permissionSet()` and permission entry builders: - `lx.repoPermission()` - `lx.rpcPermission()` - `lx.blobPermission()` - `lx.accountPermission()` - `lx.identityPermission()` Collections and endpoints accept both lexicon schema objects and plain NSID strings.
Allows easy grouping of translations with their default, for clarity.
tylersayshi
left a comment
There was a problem hiding this comment.
overall looks good! thanks for taking this on 😺
and I'm not worried about lib.ts getting large - I don't expect it to grow much further and am in general in favor of having that single large file with the implementation.
|
Thank you for the detailed review! I thoroughly agree — so much of the benefit of your package is great document in-IDE! I'll make the improvements and update shortly |
This type function lets us carry the JSDoc across from the options to entry definitions, and simplifies our maintenance too 💪
|
Hey @tylersayshi; I've addressed the points you made, though I'm struggling with maintaining both the key ordering in the snaps as you requested and ensuring the tests pass. If you have any advice I'm all ears! |
|
hey! sorry there was a setting blocking the CI from running (these should run automatically going forward, i changeed the setting). Pretty much everything looks good now, just some tests that need to get fixed. One last thing i'd like this PR to add to is the benchmark test: https://github.com/tylersayshi/prototypey/blob/main/packages/prototypey/core/tests/infer.bench.ts it's ok (and expected) if more instantiations are caused by this change, but if the number goes up significantly, i'll like to look into the type inference implementation closer. |
|
Sure thing @tylersayshi — the test failures are just the ordering issues, so I'll fix those now & work on the benchmarks. |
|
So I've added some benchmarks, and run the existing ones — I think this is only adding a small increase in instantiations. I'm not familiar with this analysis in Typescript, so I had to ask Claude to help out here, but here are it's results:
What do you think? |
tylersayshi
left a comment
There was a problem hiding this comment.
yep, the benchmarks look good 👍 thanks for building this!
Hey @tylersayshi I had a crack at implementing #82!
I kept everything in
lib.tsto fit with your current layout, but it's starting to get a bit large, so let me know if you'd like things broken out.I've also added a helper function for fields which have companion
*:langfields, so translations can be grouped with their default!Becomes:
{ "title": "The default", "title:lang": { "es": "El predeterminado", "ja": "デフォルト", } }Fixes #82