ts-libs is an internal Ledger monorepo that hosts reusable TypeScript libraries extracted from ledger-live and other Ledger stacks. These guidelines apply to contributors and agents. Please read fully before opening a pull request.
Important
The primary activity here is migrating libraries from ledger-live — not creating new ones from scratch. PRs that introduce libraries unrelated to the Ledger ecosystem or that duplicate packages already handled in ledger-live will be closed without extensive review.
- Create your branch from
develop. - Run
mise installto get the correct toolchain (node, pnpm, gitleaks, hk…). - Run
pnpm installto install dependencies. - Git hooks activate automatically after
mise install(pre-commit: format check + secret scan).
| Prefix | When to use |
|---|---|
feat/ |
Migrating a new library from ledger-live |
bugfix/ |
Fixing a bug in an existing library |
support/ |
Refactors, tests, CI, tooling improvements |
chore/ |
Maintenance, config, dependency updates |
We follow Conventional Commits. Format:
<type>(<scope>): <description>
Scope is the library name or area: logs, devices, ci, deps, etc.
Always rebase on develop before opening a PR. On a draft branch, prefer amend + git push --force-with-lease origin <branch> over accumulating fix commits.
Open your PR as a Draft and pass all automated checks before making it Ready for Review.
flowchart LR
S0[Create draft<br>pull request] --> S1[Pass all<br>automated checks]
S1 --> S2[Open pull request:<br>Ready for review]
S2 --> S3[Pass review<br>by code-owners]
Before marking your PR ready for review, ensure all of the following pass:
- format —
pnpm format - knip —
pnpm knip(no unused files or exports) - lint —
pnpm lint - typecheck —
pnpm typecheck - tests —
pnpm test - Copilot — request a Copilot review, address or explicitly dismiss every comment, and resolve all threads.
- Click "Ready for review" to convert from Draft — this automatically requests the relevant code owners via
CODEOWNERS. - When a reviewer leaves feedback and you push a fix, re-request their review (GitHub "Re-request" button).
We use changesets for versioning. Run:
pnpm changelogA changeset is required for any change to a library's public API or behaviour. It is not required for tooling, CI, or documentation-only changes.
Note
On Changesets v3 there is no longer a confirmation prompt at the end of changeset add — the file is written immediately. To change your mind, edit or delete the generated .changeset/*.md file.
You can also skip the prompts entirely:
pnpm changeset add --minor @ledgerhq/logs -m "Add LocalTracer.withUpdatedContext"--major, --minor and --patch accept comma-separated package names.
Releases are automated. You do not run changeset version or changeset publish by hand.
flowchart LR
S0[Merge PR<br>with a changeset] --> S1[Bot opens<br>version pull request]
S1 --> S2[Approve & merge<br>version pull request]
S2 --> S3[Open & merge<br>develop into main]
S3 --> S4[Published to JFrog<br>+ tag + GitHub release]
- Merging any PR carrying a changeset into
developmakes the release bot open or update achore(release): version packagespull request on thechangeset-release/developbranch. It applies every pending changeset — bumping versions and writingCHANGELOG.mdentries. - That PR is the release gate. Review the versions and changelogs, then approve and merge it like any other PR.
- Open a pull request from
developintomainand merge it. That push tomainpublishes the packages to JFrog, pushes git tags and creates GitHub releases.
Merge those two in that order. Merging develop into main while the version pull request is still open fails the release with an "unconsumed changesets" error rather than publishing unversioned packages.
To cut a release, merge the version pull request and then promote. To hold one back, leave the version pull request open — it keeps updating itself as more changesets land.
Note
For the machinery behind this — what each workflow does, which registries and credentials it uses, and what to do when a release fails — see docs/RELEASE.md.
Use the /import-lib-from-live skill. It handles discovery, dependency audit, file copy, config patching, and build verification. Once imported, set the library status in its README (see below).
Every library README must carry a status block immediately after the title:
| Status | Alert | Meaning |
|---|---|---|
STABLE |
[!NOTE] |
Production-ready, actively maintained, semver guaranteed |
DEPRECATED |
[!WARNING] |
Superseded — migration path documented in the block |
UNSTABLE |
[!CAUTION] |
API not stable, breaking changes possible without a major bump |
Example for a deprecated library:
> [!WARNING]
> **Status: DEPRECATED**
> Use [`@ledgerhq/replacement`](link) instead.
