Socket
Book a DemoInstallSign in
Socket

@typelex/cli

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typelex/cli

Experimental CLI for typelex

latest
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

@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 matching xyz.statusphere)
  • Generates typelex/externals.tsp with @external stubs
  • Compiles typelex/main.tsp to lexicons/ (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

Keywords

typespec

FAQs

Package last updated on 14 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts