leo-sdk-template
v1.1.5
Published
A template generator for creating TypeScript SDK projects
Downloads
30
Maintainers
Readme
Getting Started
Installation
Install the leo-sdk-template globally:
npm install -g leo-sdk-templateQuick Start
Create a new SDK project:
leo-sdk my-awesome-sdkFollow the interactive prompts to configure your project, or use the --defaults flag for quick setup:
leo-sdk my-awesome-sdk --defaultsCommand Options
--defaults- Use default values for all prompts-v, --version- Print the installedleo-sdkversion--with-examples- Copy example assets when the template provides them (current templates omit these by default)--with-ci- Copy GitHub Actions workflows when available in the template--org <org>- Set organization name--author <author>- Set author name--template <type>- Choose betweents-lib(default) andreact-lib
Project Structure
The generated project adapts to the selected template. Below are highlights for each option.
ts-lib
- Minimal class-based SDK scaffold exposing a
createClienthelper for quick customization. - Includes
build,prepare, andreleasescripts so you can publish immediately. - Uses plain TypeScript compilation for a fast, dependency-light workflow.
react-lib
- Provides a tiny
SdkSectioncomponent that demonstrates how to ship JSX from your SDK. - Ships with the same
build/prepare/releasescripts to streamline publishing. - Keeps dependencies lean by compiling JSX with TypeScript only.
Next Steps
Navigate to your project:
cd my-awesome-sdkInstall dependencies:
npm installBuild the scaffold:
npm run buildPublish when ready:
npm run release
Development Workflow
- For
ts-lib: extendsrc/index.tswith your SDK surface and adjust options as needed. - For
react-lib: build outsrc/index.tswith additional components or hooks to expose to consumers. - Keep documentation and CI workflows aligned with your release process.
Customization
The template provides a solid foundation, but you can customize it:
- Tune TypeScript options via
tsconfig.jsonto target your consumers. - Layer in linting, testing, or documentation scripts as your SDK grows.
- Add CI or examples by creating the expected folders before re-running the generator.
