Experimental CLI for typelex
pnpm add -D @typelex/cli @typelex/emitter
typelex compile xyz.statusphere.*
This command:
lexicons/ for all external lexicons (not matching xyz.statusphere)typelex/externals.tsp with @external stubstypelex/main.tsp to lexicons/ (or custom output via --out)Fixed paths:
typelex/main.tsptypelex/externals.tsp// typelex/main.tsp
import "@typelex/emitter";
import "./externals.tsp";
namespace xyz.statusphere.defs {
model StatusView {
@required uri: atUri;
@required status: string;
@required profile: app.bsky.actor.defs.ProfileView;
}
}
typelex compile 'xyz.statusphere.*'
The CLI scans lexicons/ for external types and auto-generates typelex/externals.tsp with stubs
{
"scripts": {
"build:lexicons": "typelex compile 'xyz.statusphere.*'",
"build:codegen": "lex gen-server --yes ./src lexicons/xyz/statusphere/*.json"
}
}
--out <directory> - Output directory for generated Lexicon files (default: ./lexicons)--watch - Watch mode for continuous compilationMIT