Examples
Runnable examples live in the repository under examples/. CI runs lombok-ts generate and tsc --noEmit on plain-ts and nestjs after every build; commonjs-serverless is typechecked on every PR.
plain-ts
Path: examples/plain-ts
Legacy backend with codegen and runtime decorators:
@Data,@Builder,@ToString,@NonNullonUser@Singleton,@MemoizeonUserService
git clone https://github.com/A-Dev-Kit/lombok-typescript.git
cd lombok-typescript
pnpm install && pnpm build
cd examples/plain-ts
node ../../dist/cli/index.js generate
pnpm exec tsc --noEmitcommonjs-serverless
Path: examples/commonjs-serverless
Minimal CommonJS consumer (module: commonjs, moduleResolution: nodenext) importing @Data / @Builder from /legacy. Mirrors Serverless Framework projects that have not migrated to ESM.
cd examples/commonjs-serverless
pnpm typecheckSee CommonJS and Serverless for tsconfig requirements and troubleshooting.
nestjs
Path: examples/nestjs
Shows interoperability with @nestjs/common and the built-in lombok-typescript/nestjs entry point:
LombokModule.forRoot()inAppModule@Injectable()+@Singleton+@LogNestonAppService@Factoryregistry withcreateFromFactory@Memoizeon service methods@Validate+ class-validator onCreateUserDto
cd examples/nestjs
node ../../dist/cli/index.js generate
pnpm exec tsc --noEmit
pnpm startWhat to try
- Add a field to a
@Dataclass, rungenerate, and inspect.lombok/. - Toggle
backend: 'stage3'inlombok.config.ts(with matching tsconfig) to compare backends. - Read Architecture for how
applyAllGeneratedwires codegen output.
Historical previews
The older docs/example/ markdown files are superseded by this site and the examples/ apps. They may describe future-phase decorators not yet implemented.