@typelex/cli#
Experimental CLI for typelex
Installation#
pnpm add -D @typelex/cli @typelex/emitter
Usage#
typelex compile xyz.statusphere.*
This command:
- Scans
lexicons/for all external lexicons (not matchingxyz.statusphere) - Generates
typelex/externals.tspwith@externalstubs - Compiles
typelex/main.tsptolexicons/(or custom output via--out)
Fixed paths:
- Entry point:
typelex/main.tsp - Externals:
typelex/externals.tsp
Example#
// 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
Integration#
{
"scripts": {
"build:lexicons": "typelex compile 'xyz.statusphere.*'",
"build:codegen": "lex gen-server --yes ./src lexicons/xyz/statusphere/*.json"
}
}
Options#
--out <directory>- Output directory for generated Lexicon files (default:./lexicons)--watch- Watch mode for continuous compilation
License#
MIT