An experimental TypeSpec syntax for Lexicon

[New feature] Externals #2

closed
opened by danabra.mov targeting main from external

A step towards https://tangled.org/@danabra.mov/typelex/issues/5.

This adds support for Externals, which are namespaces with @external decorator.

@external
namespace com.atproto.label.defs {
  model Label { }
}

@external
namespace app.bsky.graph.defs {
  model StarterPackViewBasic { }
  model ListViewBasic { }
}

They do NOT get emitted as JSON. They only exist to represent external Lexicons for which you have only JSON.

Models inside @external namespaces must be empty. However, they're allowed to be @tokens which we need to know to disambiguate unions and knownValues. (In the future, it's possible we won't rely on knowing that, but for now we do.)

I've converted the playground to use externals properly. I will convert tests in a follow-up.

0
by danabra.mov 0 comments
expand 5 commits
add @external decorator
add test for @external
document @external
replacing bundling with externals in playground
enforce empty @externals
1
by danabra.mov 0 comments
expand 5 commits
add @external decorator
add test for @external
document @external
replacing bundling with externals in playground
enforce empty @externals
closed without merging
sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/sh.tangled.repo.pull/3m2siinlkdr22