@polytric/openws-sdkgen
v0.0.13
Published
OpenWS SDK generator CLI
Maintainers
Readme
OpenWS SDK Generator
@polytric/openws-sdkgen is the OpenWS SDK generator CLI. It takes an OpenWS spec JSON file and produces SDK source code for a target language/environment.
The generator is pipeline-driven:
- Parse CLI arguments
- Load the OpenWS spec
- Build an intermediate representation
- Execute a build plan for the selected language/environment
Install
pnpm add -g @polytric/openws-sdkgenUsage
openws-sdkgen \
--spec ./openws-spec.json \
--out ./generated \
--project MyCompany \
--network core \
--hostRole server \
--language csharp \
--environment unityThe CLI exposes the following options:
--spec(string): Path to the OpenWS spec JSON file.--out(string): Output directory for generated code.--project(string): Project/namespace prefix for generated code.--network(string): Network name to generate.--hostRole(string): Participant role name that represents the host side.--language(string): Target language (csharp,javascript, ortypescript).--environment(string|array): Target environment (unity,node,browser).
Current targets
The generator is wired for:
- C# (Unity) with
newtonsoftserialization templates. - JavaScript (Node/browser) packages.
- TypeScript (Node/browser) packages with declaration output.
Generated JavaScript and TypeScript packages include a tsup build config and a
prepublishOnly build script. The published package exports ESM (dist/*.js) and
CJS (dist/*.cjs) entry points for the root SDK, network metadata, roles, SDK
adaptors, and payload models.
Additional targets are configured through build plans in tooling/sdkgen/src/plans and can be expanded as needed.
License
Apache-2.0
