Skip to content

Commit 0dc6bf3

Browse files
committed
docs: Root README was updated
1 parent 1502122 commit 0dc6bf3

File tree

2 files changed

+143
-15
lines changed

2 files changed

+143
-15
lines changed

README.md

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[🌐 Translations](./docs/INDEX.md#readme)[📜 Code of Conduct](./CODE_OF_CONDUCT.md)
44

5-
Tools for analyzing git history and creating new releases according to [conventional commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
5+
Monorepo with tools for analyzing git history and creating releases according to the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
66

77
[![Tests Status](https://github.com/modulify/conventional/actions/workflows/tests.yml/badge.svg)](https://github.com/modulify/conventional/actions)
88
[![codecov](https://codecov.io/gh/modulify/conventional/branch/main/graph/badge.svg)](https://codecov.io/gh/modulify/conventional)
@@ -12,8 +12,47 @@ Tools for analyzing git history and creating new releases according to [conventi
1212
- [`@modulify/conventional-git`](./packages/conventional-git) — Thin wrapper over git with conventional-commit parsing and semantic tag helpers.
1313
- [`@modulify/conventional-bump`](./packages/conventional-bump) — Semantic-release helper that recommends the next version (major/minor/patch).
1414
- [`@modulify/conventional-changelog`](./packages/conventional-changelog) — Generate a changelog from your git history using Nunjucks templates.
15+
- [`@modulify/conventional-release`](./packages/conventional-release) — Library-first release orchestration package with a config-driven CLI.
1516

16-
## Usage example
17+
## High-level release flow
18+
19+
```ts
20+
import { run } from '@modulify/conventional-release'
21+
22+
const result = await run()
23+
24+
if (!result.changed) {
25+
console.log('No changes since last release')
26+
} else {
27+
for (const slice of result.slices) {
28+
if (!slice.changed) continue
29+
console.log(slice.id, slice.nextVersion, slice.tag)
30+
}
31+
}
32+
```
33+
34+
The `@modulify/conventional-release` package combines:
35+
- version recommendation from `@modulify/conventional-bump`
36+
- changelog writing from `@modulify/conventional-changelog`
37+
- manifest updates
38+
- release commit and tag creation
39+
40+
It also ships the `conventional-release` binary, so a consumer project can use:
41+
42+
```json
43+
{
44+
"scripts": {
45+
"release": "conventional-release",
46+
"release:dry": "conventional-release --dry"
47+
}
48+
}
49+
```
50+
51+
See the package README for the full API and CLI reference: [`@modulify/conventional-release`](./packages/conventional-release/README.md)
52+
53+
## Low-level composition
54+
55+
If you want to build your own release flow, the lower-level packages can still be used directly:
1756

1857
```ts
1958
import { Client } from '@modulify/conventional-git'
@@ -24,20 +63,45 @@ import semver from 'semver'
2463
const git = new Client()
2564
const advisor = new ReleaseAdvisor({ git })
2665

27-
// 1. Get current version and recommend next one
2866
const currentVersion = await git.version() ?? '0.0.0'
2967
const recommendation = await advisor.advise({
3068
preMajor: semver.lt(currentVersion, '1.0.0')
3169
})
3270

3371
if (recommendation) {
3472
const nextVersion = semver.inc(currentVersion, recommendation.type)
35-
36-
// 2. Generate and write changelog
3773
const write = createWrite({ git, file: 'CHANGELOG.md' })
38-
await write(nextVersion)
3974

40-
// 3. You can now update package.json, commit and tag
75+
await write(nextVersion)
4176
console.log(`Next release: ${nextVersion}`)
4277
}
4378
```
79+
80+
## Why this exists
81+
82+
The project did not start as an abstract experiment. It grew out of a practical need to work with deeply nested workspace trees, including repositories with two or three levels of nesting, where most release tools on the market still assume a flat or near-flat monorepo layout.
83+
84+
## Repository development
85+
86+
Local setup:
87+
88+
```bash
89+
make .yarnrc.yml
90+
yarn install
91+
```
92+
93+
Useful commands:
94+
95+
```bash
96+
make test
97+
make test-coverage
98+
make build
99+
make typecheck
100+
make eslint
101+
```
102+
103+
Release preview for this repository:
104+
105+
```bash
106+
yarn release:dry
107+
```

docs/ru/README.md

Lines changed: 72 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Conventional commits toolkit
22

3-
[🌐 Translations](../../docs/INDEX.md#readme)
3+
[🌐 Translations](../../docs/INDEX.md#readme)[📜 Code of Conduct](../../CODE_OF_CONDUCT.md)
44

5-
Набор инструментов для анализа истории git и создания новых релизов в соответствии со [спецификацией conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).
5+
Монорепозиторий с инструментами для анализа истории git и создания релизов в соответствии со [спецификацией Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
66

77
[![Tests Status](https://github.com/modulify/conventional/actions/workflows/tests.yml/badge.svg)](https://github.com/modulify/conventional/actions)
88
[![codecov](https://codecov.io/gh/modulify/conventional/branch/main/graph/badge.svg)](https://codecov.io/gh/modulify/conventional)
@@ -12,8 +12,47 @@
1212
- [`@modulify/conventional-git`](../../packages/conventional-git) — Тонкая обертка над git с парсингом conventional-коммитов и помощниками для семантических тегов.
1313
- [`@modulify/conventional-bump`](../../packages/conventional-bump) — Помощник для семантических релизов, который рекомендует следующую версию (major/minor/patch).
1414
- [`@modulify/conventional-changelog`](../../packages/conventional-changelog) — Генерация чейнджлога из истории git с использованием шаблонов Nunjucks.
15+
- [`@modulify/conventional-release`](../../packages/conventional-release) — Library-first пакет для оркестрации релизов с конфигурируемым CLI.
1516

16-
## Пример использования
17+
## Высокоуровневый release flow
18+
19+
```ts
20+
import { run } from '@modulify/conventional-release'
21+
22+
const result = await run()
23+
24+
if (!result.changed) {
25+
console.log('Нет изменений с прошлого релиза')
26+
} else {
27+
for (const slice of result.slices) {
28+
if (!slice.changed) continue
29+
console.log(slice.id, slice.nextVersion, slice.tag)
30+
}
31+
}
32+
```
33+
34+
Пакет `@modulify/conventional-release` объединяет:
35+
- рекомендации по версии из `@modulify/conventional-bump`
36+
- запись changelog из `@modulify/conventional-changelog`
37+
- обновление манифестов пакетов
38+
- создание release-коммита и тегов
39+
40+
Он также поставляет бинарник `conventional-release`, поэтому в потребляющем проекте можно использовать:
41+
42+
```json
43+
{
44+
"scripts": {
45+
"release": "conventional-release",
46+
"release:dry": "conventional-release --dry"
47+
}
48+
}
49+
```
50+
51+
Полное описание API и CLI находится в README пакета: [`@modulify/conventional-release`](../../packages/conventional-release/README.md)
52+
53+
## Низкоуровневая композиция
54+
55+
Если нужен собственный release flow, низкоуровневые пакеты по-прежнему можно использовать напрямую:
1756

1857
```ts
1958
import { Client } from '@modulify/conventional-git'
@@ -24,20 +63,45 @@ import semver from 'semver'
2463
const git = new Client()
2564
const advisor = new ReleaseAdvisor({ git })
2665

27-
// 1. Получение текущей версии и рекомендации следующей
2866
const currentVersion = await git.version() ?? '0.0.0'
2967
const recommendation = await advisor.advise({
3068
preMajor: semver.lt(currentVersion, '1.0.0')
3169
})
3270

3371
if (recommendation) {
3472
const nextVersion = semver.inc(currentVersion, recommendation.type)
35-
36-
// 2. Генерация и запись чейнджлога
3773
const write = createWrite({ git, file: 'CHANGELOG.md' })
38-
await write(nextVersion)
3974

40-
// 3. Теперь вы можете обновить package.json, закомитить и создать тег
75+
await write(nextVersion)
4176
console.log(`Следующий релиз: ${nextVersion}`)
4277
}
4378
```
79+
80+
## Почему проект появился
81+
82+
Проект возник не как абстрактный эксперимент, а из практической потребности работать с глубоко вложенными деревьями workspaces, включая репозитории с двумя или тремя уровнями вложенности, тогда как большинство release-инструментов на рынке до сих пор предполагают плоскую или почти плоскую монорепу.
83+
84+
## Разработка репозитория
85+
86+
Локальная подготовка:
87+
88+
```bash
89+
make .yarnrc.yml
90+
yarn install
91+
```
92+
93+
Полезные команды:
94+
95+
```bash
96+
make test
97+
make test-coverage
98+
make build
99+
make typecheck
100+
make eslint
101+
```
102+
103+
Предпросмотр релиза для этого репозитория:
104+
105+
```bash
106+
yarn release:dry
107+
```

0 commit comments

Comments
 (0)