This repository is a Lerna monorepo that publishes several packages to npm:
@dfx.swiss/core@dfx.swiss/react@dfx.swiss/react-components@dfx.swiss/bip322-multisig
The packages are consumed as pinned npm dependencies by other DFX.swiss apps (e.g.
DFXswiss/app), so breaking changes ripple downstream through those version
pins. Keep public APIs stable where possible and flag breaking changes explicitly.
npm installDependencies across the workspace are managed with npm workspaces + Lerna. CI runs on
Node 16.x (see .github/workflows/pr.yaml); @dfx.swiss/bip322-multisig additionally
declares engines.node >= 18.
Commands run across all packages via Lerna (the same tasks CI uses; locally they always cover every package):
npx lerna run lint # ESLint
npx lerna run format:check # Prettier (verify only)
npx lerna run build # tsc -b per package
npx lerna run test # Jest (packages that define a test script)Per-package scripts are also available from within a package directory
(packages/<name>):
npm run build # tsc -b ./tsconfig.build.json
npm run lint # eslint src
npm run lint:fix # eslint src --fix
npm run format # prettier --write src
npm run format:check # prettier --check src
npm run test # jest (core and bip322-multisig only)
npm run clean # remove dist/ and build infoThe same Lerna tasks used by CI can be run across all packages locally. In CI,
develop PRs run those tasks only for packages changed since the merge base
(--since). Apply the ci:full label to force a full run; adding or removing
any label retriggers the workflow. PRs into main, workflow_dispatch, paths
containing characters outside A-Za-z0-9._/-, infrastructure
(lerna.json, root package.json / package-lock.json, root tsconfig*.json,
.eslintrc.json, .prettierrc, .github/workflows/), and any deleted file
under packages/ also trigger a full run.
- TypeScript everywhere; each package builds with
tsc -b ./tsconfig.build.json. - Prettier (
.prettierrc): single quotes, trailing commas (all), print width 120. - ESLint (
.eslintrc.json): the project-specific rules are set to error — e.g.no-console(outside tests/stories) and unused vars (prefix intentionally unused ones with_). Rules inherited at warn level from the shared configs do not fail lint or CI — still, do not introduce new ESLint warnings. - Format and lint before committing:
npm run formatandnpm run lint:fix.
Tests use Jest with ts-jest. Test files live under src/__tests__/ and match
*.test.ts (see packages/core/src/__tests__/). Only @dfx.swiss/core and
@dfx.swiss/bip322-multisig currently define a test script; add or extend tests when
you change or add functionality in those packages.
-
Branch off
develop; open pull requests againstdevelop. Themainbranch is the released state, updated only through automaticdevelop -> mainrelease PRs. -
CI rejects a pull request into
mainunless its head is this repository'sdevelop(check nameMain only from develop). -
Branch names are prefixed by type, e.g.
feat/…,fix/…,chore/…,docs/…(existing history also usesfeature/…). -
Commit messages follow Conventional Commits, imperative mood, optionally scoped by package or area, e.g.:
feat(core): add Monitoring user rolefix(bip322-multisig): use @noble/curves v1 for CommonJS compatibilitychore: promote ESLint warnings to errors
This is not just convention: releases are produced with
lerna version --conventional-commits, so the commit type (feat,fix,BREAKING CHANGE, …) directly determines the version bump. Usefeat!:or aBREAKING CHANGE:footer for breaking changes. -
Keep PRs small and focused. Describe what changed and why; note any breaking change for downstream consumers.
Versioning and publishing are fully automated by the publish workflow
(.github/workflows/publish.yaml) using Lerna, and packages are versioned
independently (lerna.json: "version": "independent").
Feature PRs must touch source only. Do not manually edit in a feature PR:
versionfields in anypackage.jsonCHANGELOG.mdfilespackage-lock.jsonversion pins
When changes land on develop, a separate Publish commit (authored by the release
workflow) bumps the affected package versions, updates the per-package CHANGELOG.md
and syncs package-lock.json, then publishes beta versions to npm. Pushing to main
graduates them to stable. (Reference: PR #181 changed only src/ files; the following
Publish commit performed all version and changelog updates.)