Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@lidofinance/utils

lidofinance1.3kMIT1.3.2TypeScript support: included

Utils for Lido Finance projects. Part of Lido UI Components

lido, lidofinance, styled-components, component, react-component, react

readme

Utils

Utils for Lido Finance projects. Part of Lido UI Components

Install

yarn add @lidofinance/utils

Usage

import { LidoComponentProps } from '@lidofinance/utils'

export type ButtonProps = LidoComponentProps<
  'button',
  {
    size?: 'md' | 'lg'
    variant?: 'filled' | 'outlined'
  }
>

Check out our Storybook at https://ui.lido.fi

changelog

Releases

Overview

Release workflow is triggered automatically on pushes to main. It will:

  • Build all packages
  • Run tests
  • Release packages if they need releasing

Technical Setup

NPM token is stored as a repo secret and passed as an environment variable.

Yarn 3 is used with PNP resolution.

semantic-release is used to parse commit messages to determine how to bump package versions. It is ran on each package of Yarn workspaces. It reads versions in tags to find latest.

It is configured via .releaserc.js with a Conventional Commits preset (not Angular).

multi-semantic-release is used to release all packages at once, accounting for their in-repo dependencies.

CLI args in workflow:

  • deps.bump=satisfy
  • deps.release=inherit

With these settings, ui global package will follow version changes of each package inside it eg when hooks is upgraded from 1.0.0 -> 2.0.0 with a breaking change, ui will also be upgraded to a new major version.

Known Issues

We now have a lot of packages and our release method is not ideal - semantic-release tries to verify conditions of each package, leading to npm throttling whoami requests. We use a special @semantic-release/npm wrapper - @semrel-extra/npm, which has memoization for npm token verification. Now, we even have verify conditions disabled.

There are potential incompatibilities when dependencies of lido-ui and multi-semantic-release are not updated for some time. Node version of the release workflow may need to be tweaked in the future.