pubm 0.0.5 → 0.1.3

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 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
- publish manager for multiple registry (jsr, npm and private registries)
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
- - Publish package to npm and jsr at once
20
- - Private registry support (Soon)
21
- - Customize (Soon)
22
- - GitHub release draft format
23
- - Adjust tasks (Add, Remove, Sorting tasks)
36
+ ---
24
37
 
25
- ## Prerequisites
38
+ ## 🆚 pubm vs. np
26
39
 
27
- - Node.js 18 or later
28
- - npm 9 or later
29
- - Git 2.11 or later
30
- - jsr
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
- ## Install
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
- ## Usage
61
+ ---
39
62
 
40
- ```bash
41
- Usage:
42
- $ pubm [version]
43
-
44
- Version can be:
45
- major | premajor | minor | preminor | patch | prepatch | prerelease | 1.2.3
46
-
47
- Options:
48
- --test-script <script> The npm script to run tests before publishing (default: test)
49
- --build-script <script> The npm script to run build before publishing (default: build)
50
- -p, --preview Show tasks without actually executing publish
51
- -b, --branch <name> Name of the release branch (default: main)
52
- -a, --any-branch Show tasks without actually executing publish
53
- --no-pre-check Skip prerequisites check task
54
- --no-condition-check Skip required conditions check task
55
- --no-tests Skip running tests before publishing
56
- --no-build Skip build before publishing
57
- --no-publish Skip publishing task
58
- --no-release-draft Skip creating a GitHub release draft
59
- --publish-only Run only publish task for latest tag
60
- -t, --tag <name> Publish under a specific dist-tag (default: latest)
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
- ## Config for publish
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.