pubm 0.0.5 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -126
- package/bin/cli.js +958 -315
- package/dist/index.cjs +999 -83
- package/dist/index.d.cts +180 -2
- package/dist/index.d.ts +180 -2
- package/dist/index.js +980 -82
- package/package.json +92 -84
package/README.md
CHANGED
|
@@ -2,153 +2,87 @@
|
|
|
2
2
|
<img src="https://github.com/syi0808/pubm/blob/main/docs/logo.svg" height="150">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/pubm">
|
|
7
|
+
<img src="https://img.shields.io/npm/v/pubm" alt="npm version" />
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://jsr.io/@pubm/pubm">
|
|
10
|
+
<img src="https://jsr.io/badges/@pubm/pubm/score" alt="jsr version" />
|
|
11
|
+
</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
5
14
|
<h1 align="center">
|
|
6
15
|
pubm
|
|
7
16
|
</h1>
|
|
8
17
|
|
|
9
18
|
<p align="center">
|
|
10
|
-
|
|
19
|
+
<strong>One‑command publishing for workspaces to *multiple* registries (npm · jsr · private).</strong><br/>
|
|
20
|
+
Safe by default, CI‑friendly by design, and extensible through plugins.
|
|
11
21
|
<p>
|
|
12
22
|
|
|
13
23
|
<p align="center">
|
|
14
24
|
<img src="https://github.com/syi0808/pubm/blob/main/docs/demo.gif" width="100%">
|
|
15
25
|
</p>
|
|
16
26
|
|
|
17
|
-
## Features
|
|
27
|
+
## ✨ Features at a Glance
|
|
28
|
+
|
|
29
|
+
- **Atomic multi‑registry publish** – npm & jsr run concurrently; plug‑in more registries with a few lines of code.
|
|
30
|
+
- **Monorepo aware** (Soon) – 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`.
|
|
18
35
|
|
|
19
|
-
|
|
20
|
-
- Private registry support (Soon)
|
|
21
|
-
- Customize (Soon)
|
|
22
|
-
- GitHub release draft format
|
|
23
|
-
- Adjust tasks (Add, Remove, Sorting tasks)
|
|
36
|
+
---
|
|
24
37
|
|
|
25
|
-
##
|
|
38
|
+
## 🆚 pubm vs. np
|
|
26
39
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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 | ✅ |
|
|
31
48
|
|
|
32
|
-
|
|
49
|
+
<sub>See [`np`](https://github.com/sindresorhus/np) for the original local‑only flow.</sub>
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## ⚡ Quick Start
|
|
33
54
|
|
|
34
55
|
```bash
|
|
35
56
|
npm i -g pubm
|
|
57
|
+
|
|
58
|
+
pubm patch --preview
|
|
36
59
|
```
|
|
37
60
|
|
|
38
|
-
|
|
61
|
+
---
|
|
39
62
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-c, --contents <path> Subdirectory to publish
|
|
62
|
-
--no-save-token Do not save jsr tokens (request the token each time)
|
|
63
|
-
--registry <...registries> Target registries for publish
|
|
64
|
-
registry can be npm | jsr | https://url.for.private-registries (default: npm,jsr)
|
|
65
|
-
-h, --help Display this message
|
|
66
|
-
-v, --version Display version number
|
|
67
|
-
```
|
|
63
|
+
## 🔑 Core CLI Options
|
|
64
|
+
|
|
65
|
+
| Flag | Purpose |
|
|
66
|
+
|------|---------|
|
|
67
|
+
| `-p, --preview` | Dry‑run: show tasks, no side‑effects |
|
|
68
|
+
| `--registry <list>` | Comma‑separated targets, e.g. `npm,jsr,https://registry.example.com` |
|
|
69
|
+
| `--branch <name>` / `--any-branch` | Release branch guard control |
|
|
70
|
+
| `--no-pre-check` / `--no-condition-check` | Skip guard stages |
|
|
71
|
+
|
|
72
|
+
👉 **Full option list:** see `pubm --help` or the [CLI reference](./docs/cli.md).
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 🛠 Workflow Overview
|
|
77
|
+
|
|
78
|
+
1. **Prerequisite checks** – branch, work‑tree, commits, existing tag.
|
|
79
|
+
2. **Required condition checks** – registry ping, login & permission, engine versions.
|
|
80
|
+
3. **Test & build** *(optional)*
|
|
81
|
+
4. **Version bump & tag** (SemVer)
|
|
82
|
+
5. **Concurrent publish** – npm (OTP/provenance), jsr, plugins.
|
|
83
|
+
6. **Git push & GitHub release draft**
|
|
68
84
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
You can have either package.json or jsr.json.
|
|
72
|
-
|
|
73
|
-
### Configuration file (Soon)
|
|
74
|
-
|
|
75
|
-
`pubm.js` or `pubm.mjs`
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
## Tasks
|
|
79
|
-
|
|
80
|
-
<details>
|
|
81
|
-
<summary>
|
|
82
|
-
pubm tasks
|
|
83
|
-
</summary>
|
|
84
|
-
|
|
85
|
-
- Notify new version
|
|
86
|
-
- Checking required information
|
|
87
|
-
- Select SemVer increment or specify new version
|
|
88
|
-
- Select the tag for this pre-release version in npm: (if version is prerelease)
|
|
89
|
-
- checking for the existence of either package.json or jsr.json
|
|
90
|
-
- Prerequisite checks = skip-pre (for deployment reliability)
|
|
91
|
-
- Checking if remote history is clean...
|
|
92
|
-
- Checking if the local working tree is clean...
|
|
93
|
-
- Checking if commits exist since the last release...
|
|
94
|
-
- Verifying current branch is a release branch...
|
|
95
|
-
- Checking git tag existence...
|
|
96
|
-
- Required conditions checks (concurrently) = skip-required (for pubm tasks)
|
|
97
|
-
- Verifying if npm CLI and jsr CLI are installed...
|
|
98
|
-
- Ping registries...
|
|
99
|
-
- Checking if test and build scripts exist...
|
|
100
|
-
- Checking git version...
|
|
101
|
-
- Checking available registries for publishing...
|
|
102
|
-
- in jsr permission check token exist and ask token
|
|
103
|
-
- if first time -> Checking package name availability...
|
|
104
|
-
- if scoped package and scope reserved contact message
|
|
105
|
-
- Running tests...
|
|
106
|
-
- Building the project...
|
|
107
|
-
- Bumping version...
|
|
108
|
-
- Publishing... (concurrently)
|
|
109
|
-
- npm
|
|
110
|
-
- Running npm publish...
|
|
111
|
-
- Verifying two-factor authentication...
|
|
112
|
-
- jsr
|
|
113
|
-
- Running jsr publish...
|
|
114
|
-
- Pushing tags to GitHub...
|
|
115
|
-
- Creating release draft on GitHub...
|
|
116
|
-
</details>
|
|
117
|
-
|
|
118
|
-
<details>
|
|
119
|
-
<summary>
|
|
120
|
-
np tasks
|
|
121
|
-
</summary>
|
|
122
|
-
|
|
123
|
-
- Show New files and New dependencies
|
|
124
|
-
- Check commits exist since last release
|
|
125
|
-
- Check package name availabliity
|
|
126
|
-
- Input SemVer version
|
|
127
|
-
- Input tag (if version is prerelease)
|
|
128
|
-
- Check hasn't been published scoped package
|
|
129
|
-
- Prerequisite tasks
|
|
130
|
-
- Ping npm registry
|
|
131
|
-
- Check package manager version
|
|
132
|
-
- Verify user is authenticated
|
|
133
|
-
- Check git version
|
|
134
|
-
- Check git remote
|
|
135
|
-
- Validate version
|
|
136
|
-
- Check for prerelease vesion
|
|
137
|
-
- if not private and is prerelease version and tag option not exist -> throw error should set tag
|
|
138
|
-
- Check git tag existence
|
|
139
|
-
- Git tasks
|
|
140
|
-
- Check current branch is release branch
|
|
141
|
-
- Check local working tree is clean
|
|
142
|
-
- Check remote history is clean
|
|
143
|
-
- Cleanup
|
|
144
|
-
- Install dependencies
|
|
145
|
-
- Tests
|
|
146
|
-
- Bumping version
|
|
147
|
-
- Publish package
|
|
148
|
-
- two-factor authentication
|
|
149
|
-
- Push tags
|
|
150
|
-
- Release draft
|
|
151
|
-
</details>
|
|
85
|
+
---
|
|
152
86
|
|
|
153
87
|
## FAQ
|
|
154
88
|
|
|
@@ -160,4 +94,4 @@ The only way to access jsr’s certified environment is through a direct API req
|
|
|
160
94
|
|
|
161
95
|
The jsr token is encrypted and stored using various layers of information. As long as you have control over the local machine where pubm was run, it is highly unlikely the token can be compromised.
|
|
162
96
|
|
|
163
|
-
If you prefer not to save tokens, you can use the `--no-save-token` option, which will request the token each time.
|
|
97
|
+
If you prefer not to save tokens, you can use the `--no-save-token` option, which will request the token each time.
|