@workos/oagen-emitters
v0.12.3
Published
WorkOS' oagen emitters
Keywords
Readme
oagen-emitters
Language emitters, extractors, and smoke runners for oagen. This package is a plugin library -- it provides SDK generation capabilities but does not own the consumer config. The canonical generation config lives in the spec-consuming project (e.g. https://github.com/workos/openapi-spec/oagen.config.ts`).
Plugin export
The primary export for consumers is the workosEmittersPlugin bundle:
import { workosEmittersPlugin } from "@workos/oagen-emitters";
const config: OagenConfig = {
...workosEmittersPlugin,
// consumer-owned spec policy goes here
docUrl: "https://workos.com/docs",
operationHints,
mountRules,
modelHints,
};The plugin bundle registers all emitters, extractors, and smoke runners provided by this package.
Development
npm install
npm test # run emitter unit tests
npm run typecheck # verify types
npm run build # build dist/ outputUsing a local oagen checkout
npm run oagen:use:local # build and link ../oagen
npm run oagen:build:local # rebuild ../oagen after changes
npm run oagen:use:published # switch back to published package
npm run git:push -- <args> # push with published oagen, then restore local linkEmitter development
Each emitter lives in src/<lang>/ and implements the Emitter interface from @workos/oagen. Extractors live in src/compat/extractors/<lang>.ts. Smoke runners live in smoke/sdk-<lang>.ts.
When building or changing an emitter:
- Implement or update the emitter code in
src/<lang>/ - Implement or update the extractor in
src/compat/extractors/if needed - Implement or update the smoke runner in
smoke/if needed - Export the emitter through
src/plugin.tsandsrc/index.ts - Run
npm testandnpm run typecheck - Switch to the consumer project (e.g.
openapi-spec) and run the real end-to-end flow
Adding a new language
Use the oagen skills:
claude --plugin-dir node_modules/@workos/oagen
/oagen:generate-sdk <language>This orchestrates: emitter scaffolding, extractor, compat verification, smoke tests, and integration.
