Skip to content

Commit dc24ca6

Browse files
committed
docs: update readme
1 parent 78b9c88 commit dc24ca6

File tree

1 file changed

+63
-125
lines changed

1 file changed

+63
-125
lines changed

README.md

Lines changed: 63 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -16,148 +16,86 @@ pubm
1616
</h1>
1717

1818
<p align="center">
19-
publish manager for multiple registry (jsr, npm and private registries)
19+
**One‑command publishing for workspaces to *multiple* registries (npm · jsr · private).**
20+
Safe by default, CI‑friendly by design, and extensible through plugins.
2021
<p>
2122

2223
<p align="center">
2324
<img src="https://github.com/syi0808/pubm/blob/main/docs/demo.gif" width="100%">
2425
</p>
2526

26-
## Features
27+
## Features at a Glance
2728

28-
- Publish package to npm and jsr at once
29-
- Private registry support (Soon)
30-
- Customize (Soon)
31-
- GitHub release draft format
32-
- Adjust tasks (Add, Remove, Sorting tasks)
29+
- **Atomic multi‑registry publish** – npm & jsr run concurrently; plug‑in more registries with a few lines of code.
30+
- **Monorepo aware** – detects workspaces (pnpm/yarn/npm) and publishes each package in the correct order.
31+
- **Smart 2FA handling** – OTP prompt when interactive, provenance publish when headless.
32+
- **Rigid safety guards** – branch & work‑tree checks, remote divergence, registry ping, login & permission validation.
33+
- **Preview & rollback** – inspect the full task‑graph with `--preview`; automatic rollback on failure.
34+
- **Pluggable pipeline** – customise steps via `pubm.config.(c)js`.
3335

34-
## Prerequisites
36+
---
3537

36-
- Node.js 18 or later
37-
- npm 9 or later
38-
- Git 2.11 or later
39-
- jsr
38+
## 🆚 pubm vs. np
4039

41-
## Install
40+
| Capability | **pubm** | **np** |
41+
|------------|---------|-------|
42+
| **Multi‑registry** (npm *and* jsr) | ✅ Built‑in | ❌ npm‑only |
43+
| **Workspaces / monorepo** | ✅ Road‑map & design | ❌ Not supported |
44+
| **Interactive‑first, CI‑friendly (prompts auto‑off in CI/non‑TTY)** | ✅ Prompts auto‑disabled when `stdin` ≠ TTY or CI env detected | ⚠️ Local interactive focus |
45+
| **Plugin architecture** |`Registry` & task plugins ||
46+
| **2FA in CI** | ✅ Provenance publish with `NODE_AUTH_TOKEN` | ❌ Error if 2FA enforced |
47+
| **Windows & Bun support** | 🕓 Planned ||
48+
49+
<sub>See [`np`](https://github.com/sindresorhus/np) for the original local‑only flow.</sub>
50+
51+
---
52+
53+
## ⚡ Quick Start
4254

4355
```bash
4456
npm i -g pubm
57+
58+
pubm patch --preview
4559
```
4660

47-
## Usage
61+
---
4862

49-
```bash
50-
Usage:
51-
$ pubm [version]
52-
53-
Version can be:
54-
major | premajor | minor | preminor | patch | prepatch | prerelease | 1.2.3
55-
56-
Options:
57-
--test-script <script> The npm script to run tests before publishing (default: test)
58-
--build-script <script> The npm script to run build before publishing (default: build)
59-
-p, --preview Show tasks without actually executing publish
60-
-b, --branch <name> Name of the release branch (default: main)
61-
-a, --any-branch Show tasks without actually executing publish
62-
--no-pre-check Skip prerequisites check task
63-
--no-condition-check Skip required conditions check task
64-
--no-tests Skip running tests before publishing
65-
--no-build Skip build before publishing
66-
--no-publish Skip publishing task
67-
--no-release-draft Skip creating a GitHub release draft
68-
--publish-only Run only publish task for latest tag
69-
-t, --tag <name> Publish under a specific dist-tag (default: latest)
70-
-c, --contents <path> Subdirectory to publish
71-
--no-save-token Do not save jsr tokens (request the token each time)
72-
--registry <...registries> Target registries for publish
73-
registry can be npm | jsr | https://url.for.private-registries (default: npm,jsr)
74-
-h, --help Display this message
75-
-v, --version Display version number
76-
```
63+
## 🔑 Core CLI Options
64+
65+
| Flag | Purpose |
66+
|------|---------|
67+
| `<version>` | `patch | minor | major | pre… | 1.2.3` – defaults to "ask" |
68+
| `-p, --preview` | Dry‑run: show tasks, no side‑effects |
69+
| `--registry <list>` | Comma‑separated targets, e.g. `npm,jsr,https://registry.example.com` |
70+
| `--branch <name>` / `--any-branch` | Release branch guard control |
71+
| `--no-pre-check` / `--no-condition-check` | Skip guard stages |
72+
73+
👉 **Full option list:** see `pubm --help` or the [CLI reference](./docs/cli.md).
74+
75+
---
76+
77+
## 🛠 Workflow Overview
78+
79+
1. **Notify new version**
80+
2. **Prerequisite checks** – branch, work‑tree, commits, existing tag.
81+
3. **Required condition checks** – registry ping, login & permission, engine versions.
82+
4. **Test & build** *(optional)*
83+
5. **Version bump & tag** (SemVer)
84+
6. **Concurrent publish** – npm (OTP/provenance), jsr, plugins.
85+
7. **Git push & GitHub release draft**
86+
87+
All steps are [Listr2](https://github.com/cenk1cenk2/listr2) tasks with auto‑rollback on failure.
88+
89+
---
90+
91+
## 🗺 Road‑map (2025)
92+
93+
| Version | Focus |
94+
|---------|-------|
95+
| **0.6.0** | Workspace engine & registry plugin API |
96+
| **1.0.0** | Stable API, community plugins, extended docs |
7797

78-
## Config for publish
79-
80-
You can have either package.json or jsr.json.
81-
82-
### Configuration file (Soon)
83-
84-
`pubm.js` or `pubm.mjs`
85-
86-
87-
## Tasks
88-
89-
<details>
90-
<summary>
91-
pubm tasks
92-
</summary>
93-
94-
- Notify new version
95-
- Checking required information
96-
- Select SemVer increment or specify new version
97-
- Select the tag for this pre-release version in npm: (if version is prerelease)
98-
- checking for the existence of either package.json or jsr.json
99-
- Prerequisite checks = skip-pre (for deployment reliability)
100-
- Checking if remote history is clean...
101-
- Checking if the local working tree is clean...
102-
- Checking if commits exist since the last release...
103-
- Verifying current branch is a release branch...
104-
- Checking git tag existence...
105-
- Required conditions checks (concurrently) = skip-required (for pubm tasks)
106-
- Verifying if npm CLI and jsr CLI are installed...
107-
- Ping registries...
108-
- Checking if test and build scripts exist...
109-
- Checking git version...
110-
- Checking available registries for publishing...
111-
- in jsr permission check token exist and ask token
112-
- if first time -> Checking package name availability...
113-
- if scoped package and scope reserved contact message
114-
- Running tests...
115-
- Building the project...
116-
- Bumping version...
117-
- Publishing... (concurrently)
118-
- npm
119-
- Running npm publish...
120-
- Verifying two-factor authentication...
121-
- jsr
122-
- Running jsr publish...
123-
- Pushing tags to GitHub...
124-
- Creating release draft on GitHub...
125-
</details>
126-
127-
<details>
128-
<summary>
129-
np tasks
130-
</summary>
131-
132-
- Show New files and New dependencies
133-
- Check commits exist since last release
134-
- Check package name availabliity
135-
- Input SemVer version
136-
- Input tag (if version is prerelease)
137-
- Check hasn't been published scoped package
138-
- Prerequisite tasks
139-
- Ping npm registry
140-
- Check package manager version
141-
- Verify user is authenticated
142-
- Check git version
143-
- Check git remote
144-
- Validate version
145-
- Check for prerelease vesion
146-
- if not private and is prerelease version and tag option not exist -> throw error should set tag
147-
- Check git tag existence
148-
- Git tasks
149-
- Check current branch is release branch
150-
- Check local working tree is clean
151-
- Check remote history is clean
152-
- Cleanup
153-
- Install dependencies
154-
- Tests
155-
- Bumping version
156-
- Publish package
157-
- two-factor authentication
158-
- Push tags
159-
- Release draft
160-
</details>
98+
---
16199

162100
## FAQ
163101

0 commit comments

Comments
 (0)