Skip to content

Commit 44ab46c

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

File tree

1 file changed

+74
-124
lines changed

1 file changed

+74
-124
lines changed

README.md

Lines changed: 74 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -23,141 +23,91 @@ publish manager for multiple registry (jsr, npm and private registries)
2323
<img src="https://github.com/syi0808/pubm/blob/main/docs/demo.gif" width="100%">
2424
</p>
2525

26-
## Features
26+
<!-- Badges -->
27+
[![npm version](https://img.shields.io/npm/v/pubm?color=brightgreen)](https://www.npmjs.com/package/pubm)
28+
[![CI](https://github.com/syi0808/pubm/actions/workflows/ci.yml/badge.svg)](https://github.com/syi0808/pubm/actions/workflows/ci.yml)
29+
[![jsr](https://img.shields.io/badge/jsr-supported-blueviolet)](https://jsr.io)
2730

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)
31+
# pubm
3332

34-
## Prerequisites
33+
> **One‑command publishing for workspaces to *multiple* registries (npm · jsr · private).**
34+
> Safe by default, CI‑friendly by design, and extensible through plugins.
3535
36-
- Node.js 18 or later
37-
- npm 9 or later
38-
- Git 2.11 or later
39-
- jsr
36+
---
4037

41-
## Install
38+
## ✨ Features at a Glance
39+
40+
- **Atomic multi‑registry publish** – npm & jsr run concurrently; plug‑in more registries with a few lines of code.
41+
- **Monorepo aware** – detects workspaces (pnpm/yarn/npm) and publishes each package in the correct order.
42+
- **Smart 2FA handling** – OTP prompt when interactive, provenance publish when headless.
43+
- **Rigid safety guards** – branch & work‑tree checks, remote divergence, registry ping, login & permission validation.
44+
- **Preview & rollback** – inspect the full task‑graph with `--preview`; automatic rollback on failure.
45+
- **Pluggable pipeline** – customise steps via `pubm.config.(c)js`.
46+
47+
---
48+
49+
## 🆚 pubm vs. np
50+
51+
| Capability | **pubm** | **np** |
52+
|------------|---------|-------|
53+
| **Multi‑registry** (npm *and* jsr) | ✅ Built‑in | ❌ npm‑only |
54+
| **Workspaces / monorepo** | ✅ Road‑map & design | ❌ Not supported |
55+
| **Interactive‑first, CI‑friendly (prompts auto‑off in CI/non‑TTY)** | ✅ Prompts auto‑disabled when `stdin` ≠ TTY or CI env detected | ⚠️ Local interactive focus |
56+
| **Plugin architecture** |`Registry` & task plugins ||
57+
| **2FA in CI** | ✅ Provenance publish with `NODE_AUTH_TOKEN` | ❌ Error if 2FA enforced |
58+
| **Windows & Bun support** | 🕓 Planned ||
59+
60+
<sub>See [`np`](https://github.com/sindresorhus/np) for the original local‑only flow.</sub>
61+
62+
---
63+
64+
## ⚡ Quick Start
4265

4366
```bash
4467
npm i -g pubm
68+
69+
pubm patch --preview
4570
```
4671

47-
## Usage
72+
---
4873

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-
```
74+
## 🔑 Core CLI Options
75+
76+
| Flag | Purpose |
77+
|------|---------|
78+
| `<version>` | `patch | minor | major | pre… | 1.2.3` – defaults to "ask" |
79+
| `-p, --preview` | Dry‑run: show tasks, no side‑effects |
80+
| `--registry <list>` | Comma‑separated targets, e.g. `npm,jsr,https://registry.example.com` |
81+
| `--otp <code>` | Provide OTP upfront (local only) |
82+
| `--branch <name>` / `--any-branch` | Release branch guard control |
83+
| `--no-pre-check` / `--no-condition-check` | Skip guard stages |
84+
85+
👉 **Full option list:** see `pubm --help` or the [CLI reference](./docs/cli.md).
86+
87+
---
88+
89+
## 🛠 Workflow Overview
90+
91+
1. **Notify new version**
92+
2. **Prerequisite checks** – branch, work‑tree, commits, existing tag.
93+
3. **Required condition checks** – registry ping, login & permission, engine versions.
94+
4. **Test & build** *(optional)*
95+
5. **Version bump & tag** (SemVer)
96+
6. **Concurrent publish** – npm (OTP/provenance), jsr, plugins.
97+
7. **Git push & GitHub release draft**
98+
99+
All steps are [Listr2](https://github.com/cenk1cenk2/listr2) tasks with auto‑rollback on failure.
100+
101+
---
102+
103+
## 🗺 Road‑map (2025)
104+
105+
| Version | Focus |
106+
|---------|-------|
107+
| **0.6.0** | Workspace engine & registry plugin API |
108+
| **1.0.0** | Stable API, community plugins, extended docs |
77109

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>
110+
---
161111

162112
## FAQ
163113

0 commit comments

Comments
 (0)