@bluestep-systems/b6p-cli 0.8.2 → 0.9.0
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/CHANGELOG.md +39 -0
- package/README.md +105 -11
- package/dist/cli.js +430 -243
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,45 @@ All notable changes to `@bluestep-systems/b6p-cli` will be documented in this fi
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.9.0] — 2026-11-16
|
|
9
|
+
|
|
10
|
+
Depends on b6p-core 0.9.0, which moves scripts to git: a script's draft and snapshot are a git repository,
|
|
11
|
+
and its history is its git history. **Platform floor:** the platform's git publishing. Today's server works
|
|
12
|
+
through its `enableGitPublishing` switch (the first push, or `pull --enable-git`, turns a script over); the
|
|
13
|
+
release that moves script history to git makes it the only mode, and refuses WebDAV writes to a script's draft
|
|
14
|
+
and snapshot. 0.8.x clients stop working against a script once it is on git: update them to this version.
|
|
15
|
+
|
|
16
|
+
### Changed (breaking, user-visible)
|
|
17
|
+
|
|
18
|
+
- **`push --json` lost `historyRecorded` and gained `commitSha`, `publishedSha`, `publishError` and
|
|
19
|
+
`switchedToGit`.** Every other field is unchanged. `commitSha` is the draft commit after the push,
|
|
20
|
+
`publishedSha` the commit a snapshot published, `publishError` why a publish failed, `switchedToGit` that this
|
|
21
|
+
push moved the script from WebDAV to git. Anything that reads `historyRecorded` must read `publishedSha`
|
|
22
|
+
(snapshot) or `commitSha` instead; the new shape is in the README.
|
|
23
|
+
- **New exit-code rules.** `1` when `pushed` is false. On a snapshot, also `1` when `publishedSha` is `null`,
|
|
24
|
+
`publishError` is set, or `liveVerified` is `false` . Otherwise
|
|
25
|
+
`0`. A plain push is judged by `pushed` alone.
|
|
26
|
+
- A push that stops after switching a script to git (a declined overwrite, for instance) reports `switchedToGit: true`; the switch stands.
|
|
27
|
+
- **A push is a git commit and needs an author.** `--author "Name <email>"`, or `b6p config set author "Name
|
|
28
|
+
<email>"`, or (as before for git users) `git config user.name/user.email` or `GIT_AUTHOR_*` in the
|
|
29
|
+
environment. With none, the push exits `1` and says how to fix it.
|
|
30
|
+
- **Pulls and pushes work on the script's git draft.** `pull` clones it (or fast-forwards an existing clone);
|
|
31
|
+
there is no WebDAV draft or snapshot transfer any more. `audit` needs a pulled git working copy.
|
|
32
|
+
- **Switching a script from WebDAV to git is one-way,** and the CLI says so: a push prints it (`switchedToGit` in
|
|
33
|
+
`--json`), and `pull` asks first (`[Cancel]` first, so `--yes` declines).
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- `--fail-on-type-errors` on `push` and `deploy` (and `failOnTypeErrors` in deploy configs). Type errors in a script's own sources are now warnings that exit `0` by default (0.8 failed a snapshot on them); errors in `.d.ts` files never count; syntax and emit errors still exit `1`.
|
|
38
|
+
|
|
39
|
+
- Build manifest: a push that builds writes `<outDir>/.b6p-build.json` with the build output (a draft with no TypeScript source needs none), and the platform refuses to publish a draft whose sources changed since the build. The refusal (`BUILD_STALE`, `BUILD_MANIFEST_MISSING`, `BUILD_MANIFEST_INVALID`) exits `1`, lists the files, says to rebuild and push, and appears in `--json` as `publishRefusal`. `--externally-built` (push) and `externallyBuilt` (deploy config) mark a script a bundler builds.
|
|
40
|
+
|
|
41
|
+
- `--enable-git` on `pull` (with a URL, `--file` or the current folder) and `push`: switch a script still on WebDAV to git without asking. Without it the switch is asked about and `--yes` declines.
|
|
42
|
+
- Clear messages, each exiting `1` with nothing changed, for a declined switch, a wrong branch checked out, staged-only changes and symlinks that escape the draft folder.
|
|
43
|
+
- `b6p push --author` and `b6p deploy --author`; `author` and `message` in deploy config files.
|
|
44
|
+
- A push prints the draft and published commit SHAs.
|
|
45
|
+
- `deploy` exits `1` when no author resolves (checked before anything is pushed) or when any target failed, was not pushed, or had its publish refused, and prints a line per target with its commit and published SHAs (and a switch to git). Before, it printed "Deploy complete!" and exited `0` whatever happened.
|
|
46
|
+
|
|
8
47
|
## [0.8.2] — 2026-10-20
|
|
9
48
|
|
|
10
49
|
### Fixed
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Command-line interface for managing [BlueStep](https://www.bluestep.net/) B6P
|
|
4
4
|
scripts: pull components from the platform, push changes back, audit local vs.
|
|
5
|
-
server,
|
|
5
|
+
server, git history, and deploy across targets.
|
|
6
6
|
|
|
7
7
|
The CLI shares its core implementation
|
|
8
8
|
([`@bluestep-systems/b6p-core`](https://github.com/Bluestep-Systems/b6p-core)) with the
|
|
@@ -79,10 +79,12 @@ means the token expired or its account lost access, not that it is the wrong kin
|
|
|
79
79
|
|
|
80
80
|
| Command | Purpose |
|
|
81
81
|
|---|---|
|
|
82
|
-
| `b6p pull <webdav-url>` | Pull a script by URL |
|
|
82
|
+
| `b6p pull <webdav-url>` | Pull a script by URL (clones its git draft) |
|
|
83
|
+
| `b6p pull <webdav-url> --enable-git` | Same, and switch a script still on WebDAV to git without asking (one-way) |
|
|
83
84
|
| `b6p pull --file <path>` | Pull using metadata stored with a local file |
|
|
84
85
|
| `b6p push --file <path>` | Push local files to the platform |
|
|
85
|
-
| `b6p push --file <path> --snapshot --message "…"` |
|
|
86
|
+
| `b6p push --file <path> --snapshot --message "…"` | Commit the draft with a message and publish it |
|
|
87
|
+
| `b6p push --file <path> --author "Jane Doe <jane@example.com>"` | Push as a given commit author |
|
|
86
88
|
| `b6p push --file <path> --overwrite <file>` | Push, overwriting a file that changed on the platform |
|
|
87
89
|
| `b6p audit --file <path>` | Diff local vs. server |
|
|
88
90
|
| `b6p audit --file <path> --pull` | Audit and pull if differences found |
|
|
@@ -119,15 +121,107 @@ question, in order (`printf 'Overwrite all\nYes\n' | b6p push --file <path>`, or
|
|
|
119
121
|
in PowerShell, `'Overwrite all', 'Yes' | b6p push --file <path>`). The commands the CLI prints are
|
|
120
122
|
written for your shell: POSIX, or PowerShell on Windows outside Git Bash.
|
|
121
123
|
|
|
122
|
-
|
|
123
|
-
nothing was uploaded, an overwrite was not confirmed, an upload was refused, or, on a snapshot, a
|
|
124
|
-
live copy is still wrong after one re-send, the history entry wasn't recorded, or type-check
|
|
125
|
-
diagnostics were reported.
|
|
124
|
+
### Git, authors and switching
|
|
126
125
|
|
|
127
|
-
|
|
128
|
-
`
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
A script's draft and its published snapshot are a git repository on the platform; a push commits your
|
|
127
|
+
`draft/` folder to it, and `--snapshot` (or `--message`, which implies it) also publishes that
|
|
128
|
+
commit. Its history is its git history. Requires a platform with git publishing for scripts (today's
|
|
129
|
+
server: its `enableGitPublishing` switch); a script still on WebDAV is switched
|
|
130
|
+
to git by its first push or by `b6p pull --enable-git`. **The switch is one-way**: afterwards the
|
|
131
|
+
script's draft and snapshot refuse WebDAV writes. The CLI says so when it happens
|
|
132
|
+
(`switchedToGit`).
|
|
133
|
+
|
|
134
|
+
Every commit needs an author. In order, the first complete one is used: `--author "Name <email>"`;
|
|
135
|
+
for `deploy`, the config file's `author`; the stored default (`b6p config set author "Name <email>"`);
|
|
136
|
+
`git config user.name` and `user.email` for the script folder; then `GIT_AUTHOR_NAME` and
|
|
137
|
+
`GIT_AUTHOR_EMAIL` (or the `GIT_COMMITTER_*` pair) in the environment. With none of them the push
|
|
138
|
+
stops with exit `1` and prints those fixes; nothing is ever committed as nobody.
|
|
139
|
+
|
|
140
|
+
`b6p pull` and `b6p push` without `--enable-git` ask before switching a WebDAV script (`[Cancel]` first),
|
|
141
|
+
and `--yes` declines, so an unattended run never switches anything and exits `1` (push) with nothing changed.
|
|
142
|
+
`--enable-git` works with a URL or with `--file`/the current folder.
|
|
143
|
+
|
|
144
|
+
Refusals that change nothing and exit `1`: a declined switch, a draft folder with a branch other than
|
|
145
|
+
`draft` checked out (push), staged-only changes that a pull would discard, and symbolic links that
|
|
146
|
+
would let a pull write outside the draft folder. Each message says how to fix it.
|
|
147
|
+
|
|
148
|
+
### Exit codes
|
|
149
|
+
|
|
150
|
+
| Result | Exit |
|
|
151
|
+
|---|---|
|
|
152
|
+
| Pushed; kept platform-only files, a switch to git, or a read-back that could not run (`liveVerified: null`) are still fine | `0` |
|
|
153
|
+
| The user cancelled at the target-URL prompt | `0` |
|
|
154
|
+
| Nothing was pushed (`pushed: false`): bad `--root`, empty draft, an overwrite not confirmed, no commit author, an upload refused | `1` |
|
|
155
|
+
| Snapshot, and `publishedSha` is `null` (nothing was published) | `1` |
|
|
156
|
+
| Snapshot, and `publishError` is set (the platform refused or failed the publish; the draft is still pushed) | `1` |
|
|
157
|
+
| Snapshot, and `liveVerified` is `false` (the published branch reads back at another commit) | `1` |
|
|
158
|
+
| `--fail-on-type-errors` (or `failOnTypeErrors: true` in a deploy config), and the build reported type errors in the script's own sources (`typeCheckDiagnostics > 0`) | `1` |
|
|
159
|
+
|
|
160
|
+
A plain push (no `--snapshot`) is judged by `pushed` alone. Type errors are **warnings by default**: they
|
|
161
|
+
are printed, counted in `--json` (`typeCheckDiagnostics`) and the exit code stays `0`, because the platform
|
|
162
|
+
runs the emitted JavaScript and valid JS often comes from imperfect TypeScript. Errors located in a `.d.ts`
|
|
163
|
+
(the generated platform declarations) never count. Syntax and emit errors always stop the push with exit
|
|
164
|
+
`1`. Add `--fail-on-type-errors` to push, snapshot or deploy to make type errors fail instead.
|
|
165
|
+
|
|
166
|
+
### `--json`
|
|
167
|
+
|
|
168
|
+
`--json` prints one object on stdout, the same shape for every outcome (agents parse it):
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"pushed": true,
|
|
173
|
+
"commitSha": "3f2a…40 hex characters",
|
|
174
|
+
"publishedSha": "9c1b…40 hex characters",
|
|
175
|
+
"publishError": null,
|
|
176
|
+
"publishRefusal": null,
|
|
177
|
+
"switchedToGit": false,
|
|
178
|
+
"typeCheckDiagnostics": 0,
|
|
179
|
+
"typeCheckErrors": [],
|
|
180
|
+
"liveVerified": true,
|
|
181
|
+
"liveMismatches": [],
|
|
182
|
+
"keptPlatformOnly": [],
|
|
183
|
+
"declinedOverwrites": []
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
- `commitSha`: the draft branch's head after the push (the commit this push made, or the one already
|
|
188
|
+
there); `null` when `pushed` is false.
|
|
189
|
+
- `publishedSha`: the commit the platform published; `null` on a plain push, an aborted push or a
|
|
190
|
+
failed publish.
|
|
191
|
+
- `publishError`: why the publish failed, else `null`.
|
|
192
|
+
- `publishRefusal`: `{ "reason", "withheld" }`, straight from the platform, when it refused the publish. For
|
|
193
|
+
a build that is missing, unreadable or older than its sources (`BUILD_MANIFEST_MISSING`,
|
|
194
|
+
`BUILD_MANIFEST_INVALID`, `BUILD_STALE`) `withheld` lists the stale files or the manifest's path: rebuild
|
|
195
|
+
and push. The draft is pushed, the published script unchanged, and the exit code is `1`. Else `null`.
|
|
196
|
+
- `typeCheckDiagnostics` / `typeCheckErrors`: the count and the list (`{ file, line, column, code, message }`) of
|
|
197
|
+
type errors in the script's own sources; `.d.ts` diagnostics are never included. Warnings unless
|
|
198
|
+
`--fail-on-type-errors`.
|
|
199
|
+
- `switchedToGit`: this push moved the script from WebDAV to git.
|
|
200
|
+
- `historyRecorded` is gone (0.9.0): history is the git history, so `commitSha` and `publishedSha`
|
|
201
|
+
replace it.
|
|
202
|
+
- A declined overwrite prints `pushed: false` with the files in `declinedOverwrites`; a missing
|
|
203
|
+
author prints `pushed: false` too (the reason is on stderr); a cancelled target-URL prompt prints
|
|
204
|
+
`{ "cancelled": true }`. Questions, warnings and next steps go to stderr.
|
|
205
|
+
|
|
206
|
+
### Deploy
|
|
207
|
+
|
|
208
|
+
`b6p deploy <config.json>` pushes the source draft to each target:
|
|
209
|
+
|
|
210
|
+
```json
|
|
211
|
+
{
|
|
212
|
+
"sourceRootPath": "./my-script",
|
|
213
|
+
"targets": [{ "url": "https://…/files/123/draft/", "snapshot": true }],
|
|
214
|
+
"author": { "name": "Jane Doe", "email": "jane@example.com" },
|
|
215
|
+
"message": "Deploy from CI",
|
|
216
|
+
"externallyBuilt": false,
|
|
217
|
+
"failOnTypeErrors": false
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
`externallyBuilt: true` is for scripts a bundler outside b6p builds (no build manifest is written and the
|
|
222
|
+
platform skips its stale-build check); `b6p push --externally-built` is the same for a push. `author` (an object, or `"Jane Doe <jane@example.com>"`) and `message` are optional and apply to every
|
|
223
|
+
target; `b6p deploy --author "…"` overrides the file's author. `deploy` exits `1` if no author resolves
|
|
224
|
+
(nothing is pushed then) or if any target failed or its publish was refused.
|
|
131
225
|
|
|
132
226
|
## WebDAV URL format
|
|
133
227
|
|