# @leancodepl/contractsgenerator-typescript-schema

Latest version **1.1.3** (published 2025-10-13) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @leancodepl/contractsgenerator-typescript-schema
pnpm add @leancodepl/contractsgenerator-typescript-schema
yarn add @leancodepl/contractsgenerator-typescript-schema
bun add @leancodepl/contractsgenerator-typescript-schema
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2025-10-13 |
| First published | 2023-11-13 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 565.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Maintainers | konowrockis, leancode-npm |

## Links

- npm: https://www.npmjs.com/package/@leancodepl/contractsgenerator-typescript-schema
- Repository: https://github.com/leancodepl/contractsgenerator-typescript
- Homepage: https://github.com/leancodepl/contractsgenerator-typescript#readme
- Issues: https://github.com/leancodepl/contractsgenerator-typescript/issues
- npm.io page: https://npm.io/package/@leancodepl/contractsgenerator-typescript-schema

## Dependencies (4)

- [long](https://npm.io/package/long.md) 5.3.2
- [lodash](https://npm.io/package/lodash.md) ^4.0.0
- [protobufjs](https://npm.io/package/protobufjs.md) ^7.3.2
- [@leancodepl/utils](https://npm.io/package/@leancodepl/utils.md) >=7.2.3

## Recent versions

- 1.1.3 (latest) — 2025-10-13
- 1.1.0-alpha.7 (alpha) — 2024-12-19
- 1.1.1 — 2025-10-02
- 1.1.0 — 2025-06-23
- 1.1.0-alpha.6 — 2024-11-26
- 1.1.0-alpha.5 — 2024-10-07
- 1.1.0-alpha.4 — 2024-08-19
- 1.1.0-alpha.3 — 2024-08-14
- 1.1.0-alpha.2 — 2024-01-16
- 1.1.0-alpha.1 — 2023-12-08
- 1.1.0-alpha.0 — 2023-12-01
- 1.0.0-alpha.2 — 2023-11-15
- 1.0.0-alpha.1 — 2023-11-13
- 1.0.0-alpha.0 — 2023-11-13

## README

# LeanCode TypeScript Contracts Generator

## Packages

- [Contracts Generator](packages/generator) - utility for generating contracts/client/schema from backend contracts
  and client

## Available plugins

- [contracts](plugins/contracts/) - type generation
- [client](plugins/client/) - api factory generation; requires `contracts` to also be used
- [raw](plugins/raw) - prepend/append text to generated file;

## Development

### Local publish

To test your changes to the codebase you can publish all packages to local registry
([Verdaccio](https://verdaccio.org/)) and then pull those packages to your project. To start local registry run

```
npx nx run local-registry
```

this will override your default registry in npm config. To publish all packages to local registry run

```
npx nx run local-publish --ver={VERSION_IN_#.#.#_OR_#.#.#-PREFIX.#} --tag={TAG}
```

### Protobuf

Server and clients communicate using protobuf. Specific `.proto` contract file is being copied from the server
repository to [`libs/schema/src/lib/protocol/contracts.proto`](libs/schema/src/lib/protocol/contracts.proto). This is
important to note that when contracts file is updated on the backend side then updating process is entirely manual.
After you copy new `contracts.proto` file the
[`libs/schema/src/lib/protocol/index.js`](libs/schema/src/lib/protocol/index.js) and
[`libs/schema/src/lib/protocol/index.d.ts`](libs/schema/src/lib/protocol/index.d.ts) need to be updated. Those files are
automatically generated by running `npx nx run schema:proto`.

---
_Source: https://npm.io/package/@leancodepl/contractsgenerator-typescript-schema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
