@bluestep-systems/b6p-cli 0.4.0 → 0.6.1

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 CHANGED
@@ -5,6 +5,133 @@ 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.6.1] — 2026-08-21
9
+
10
+ ### Changed
11
+
12
+ - **Rolled back the TypeScript 7 type-checker: `typescript` is now pinned to exactly `5.9.2`, the
13
+ same version `b6p-core` bundles to transpile pushes.** No CLI behaviour changes — no command, flag,
14
+ argument or output is affected. The source did not change either; it type-checks clean on 5.9.2,
15
+ 6.0.0-beta and 7.0.2 alike, so this is a toolchain change only.
16
+
17
+ **Why.** `b6p-core` compiles TypeScript *at runtime* — `b6p push --snapshot` transpiles a
18
+ component's `draft/scripts/*.ts` in-process — and TypeScript 7 cannot do that. Its `typescript`
19
+ entry point is only a version stub, the classic API (`createProgram`, `transpileModule`) is gone,
20
+ and its replacement drives a per-platform native Go binary over JSON-RPC, which cannot be inlined
21
+ into this package's single `dist/cli.js` or embedded in its Node SEA binaries. TypeScript 7 also
22
+ ships no `lib.*.d.ts` at all, while the transpiler needs real lib files on disk.
23
+
24
+ Type-checking with 7 while core compiled with 5.9 therefore meant two TypeScripts permanently, an
25
+ un-dedupable nested copy under `node_modules/@bluestep-systems/b6p-core/`, and a lib-copying step
26
+ that had to resolve the compiler from core's directory to stay correct. Pinning both to the same
27
+ exact version collapses all of that: npm now dedupes to one copy, and `dist/lib/` carries 99
28
+ `lib.*.d.ts` matching the 5.9.2 the bundle embeds.
29
+
30
+ The decision, the alternatives (including why not the 6.0 beta — there is no stable 6.x) and the
31
+ condition for moving forward again are recorded in
32
+ [docs/adr/0002-typescript-version-strategy.md](docs/adr/0002-typescript-version-strategy.md).
33
+
34
+ The scaffolding from the TS 7 migration is **kept on purpose**: `types: ["node"]`, `copy-ts-libs`
35
+ resolving from core's directory, and the lib-set invariant test all stay. They cost nothing on 5.9
36
+ and are what a future upgrade needs.
37
+
38
+ ### Added
39
+
40
+ - ADR 0002 documenting the TypeScript version strategy and the trigger to revisit it.
41
+
42
+ ## [0.6.0] — 2026-08-21
43
+
44
+ ### Changed (breaking, user-visible)
45
+
46
+ - **Authentication now uses an access token instead of a username and password.** This comes from
47
+ `b6p-core` 0.5.0 replacing basic auth with bearer auth, and **there is no migration path by
48
+ construction** — a token cannot be derived from a stored username and password. On first use
49
+ after upgrading you will be asked for an access token; run `b6p auth set` to store one up front.
50
+ `b6p auth clear` also purges the obsolete stored credentials.
51
+
52
+ ### Fixed
53
+
54
+ - **A prompt that cannot be answered no longer exits `0` having done nothing.** `readline`'s
55
+ `question()` promise never settles once stdin has ended, so the event loop drained and the process
56
+ exited **successfully** from a command that did nothing. Combined with the auth change above, the
57
+ first non-interactive run after upgrading would have printed `Enter your access token:` and exited
58
+ `0` without pulling anything. `CliPrompt` now detects end-of-input and fails with an actionable
59
+ message (exit `1`), and remembers that stdin is spent so a later prompt reports the same thing
60
+ rather than readline's internal `readline was closed`. That second half is
61
+ [ClickUp 86bb8f6v0](https://app.clickup.com/t/86bb8f6v0): a push reaching a *second* "upstairs file
62
+ changed" prompt with one piped answer died on that internal error mid-push.
63
+
64
+ An answer that *is* available always wins: piped input ends in the same turn its bytes arrive, so
65
+ the end-of-input check is deferred one macrotask — `echo Sync | b6p ...` still works. Covered by
66
+ `test/CliPrompt.test.ts`, whose cases fail (hang, then time out) against the old implementation.
67
+
68
+ The rest come from bumping `@bluestep-systems/b6p-core` `^0.5.0` → `^0.6.0`, which carries two
69
+ fixes reported through the feedback pipeline plus a safety change. All three are core-side
70
+ behaviour changes; the CLI's role is to surface them.
71
+
72
+ - **`b6p pull` no longer overwrites a locally-edited file it has previously synced** (ClickUp
73
+ 86bbdr4r0). A file whose content differs from both the platform copy and the last-synced hash is
74
+ kept, and every kept file is listed in one warning at the end of the pull. Downloads are also
75
+ atomic now, so an interrupted pull can no longer leave a truncated file behind — and the ETag
76
+ integrity check runs before the write rather than after it.
77
+ - **`b6p push --snapshot` no longer prints "Snapshot complete!" when the snapshot history was not
78
+ recorded** (ClickUp 86bbed9wu). The history mutation is retried when the platform rejects it with
79
+ the post-upload "version mismatch" (which is what made the *second* consecutive snapshot push to a
80
+ component lose its restore point); if it still fails, the push says so explicitly.
81
+ - **`b6p audit --pull` no longer authorizes overwrites non-interactively.** Its "Sync?" confirmation
82
+ now defaults to *Cancel*, so `--yes` declines rather than overwriting locally-edited files, and a
83
+ real confirmation only force-overwrites the files it actually listed. To take the platform copy
84
+ non-interactively, delete the file and pull.
85
+
86
+ ### Added
87
+
88
+ - **`--json` output for `push` and `pull`,** and a non-zero exit code for a push that did not do what
89
+ was asked. `push` emits core's `PushResult` (`{ pushed, historyRecorded }`) and exits `1` when
90
+ `pushed` is false (bad `--root`, empty draft — previously a typo could mark a CI deploy green) or
91
+ when a snapshot shipped without its history entry. `pull` emits `PullResult`
92
+ (`{ keptLocalPaths }`), which is reporting only: keeping a locally-edited file is the guard working
93
+ as designed, so it stays exit `0` rather than failing every pull in a tree with local edits.
94
+
95
+ ## [0.5.0] — 2026-08-12
96
+
97
+ ### Changed
98
+
99
+ - **Breaking (internal API only — no user-visible CLI change).** Bumped `@bluestep-systems/b6p-core`
100
+ `^0.4.0` → `^0.5.0` and migrated to its reshaped surface. Every command, flag, argument, and output
101
+ format is unchanged; this release is a re-addressing of the same operations.
102
+ - Script-tree operations moved off `B6PCore` onto a `ScriptService` reached as `core.script`:
103
+ `push`, `pushCurrent`, `pull`, `pullCurrent`, `audit`, `auditPull`, `deploy`, `deriveWorkspacePath`
104
+ and `getSetupUrl` are now `core.script.*`. Signatures are byte-identical. Account-level operations
105
+ (`updateCredentials`, `report`, `setConfig`, `checkForUpdates`) stay on `core`.
106
+ - Core's provider interfaces dropped their Hungarian `I` prefix: `IFileSystem` → `FileSystem`,
107
+ `IPersistence` → `Persistence`, `IPrompt` → `Prompt`, `ILogger` → `Logger`, `IProgress` → `Progress`,
108
+ `ILockDiagnoser` → `LockDiagnoser`. The five providers in [src/providers/](src/providers/) and
109
+ `WindowsRestartManagerLockDiagnoser` were updated to match.
110
+ - Upgraded the type-checker to **TypeScript 7** (`^5.9.2` → `^7.0.2`), and set `types: ["node"]`
111
+ explicitly in `tsconfig.json` — TS 7 no longer pulls every `node_modules/@types` package into global
112
+ scope, so `process`, `__dirname` and the `node:` builtins must be requested by name.
113
+ - Bumped `prettier` → `^3.9.6` and `@types/node` → `^22.20.1`.
114
+
115
+ ### Fixed
116
+
117
+ - `esbuild.js`'s `copy-ts-libs` plugin now resolves `typescript` **from b6p-core's directory** instead of
118
+ the repo root, so the `lib.*.d.ts` shipped to `dist/lib/` always match the compiler that reads them.
119
+ Core pins `typescript` at exactly `5.9.2` as a runtime dependency (its `ScriptTranspiler` compiles
120
+ snapshot pushes) and npm cannot dedupe that against this package's TS 7, so the bundled compiler and
121
+ the root `tsc` are deliberately different majors. Without this change the TypeScript 7 upgrade would
122
+ have broken the build outright: TS 7 ships **no** `lib.*.d.ts` files at all (the Go port embeds them),
123
+ so the old root-resolved lookup would have found zero libs and thrown `copy-ts-libs: no lib.*.d.ts
124
+ found`. `scripts/build-sea.mjs` reads `dist/lib/` and inherits the fix.
125
+
126
+ ### Removed
127
+
128
+ - **ESLint and `typescript-eslint`**, along with `eslint.config.mjs`, the `npm run lint` script, and the
129
+ lint steps in [ci.yml](.github/workflows/ci.yml) / [publish.yml](.github/workflows/publish.yml).
130
+ `typescript-eslint` 8.67 (current stable) declares `typescript: ">=4.8.4 <6.1.0"`, so it cannot run
131
+ against TypeScript 7. `npm run check-types`, `npm run format-check` and `npm test` are now the static
132
+ gates. Note that the project's no-`any` rule is consequently no longer machine-enforced — see
133
+ [AGENTS.md](AGENTS.md). Linting should be restored when `typescript-eslint` supports TS 7.
134
+
8
135
  ## [0.4.0] — 2026-07-23
9
136
 
10
137
  ### Added
package/README.md CHANGED
@@ -90,7 +90,6 @@ metadata — pass `--file <path>` instead of re-typing the URL.
90
90
  ```bash
91
91
  npm install
92
92
  npm run check-types # tsc --noEmit
93
- npm run lint # eslint
94
93
  npm run compile # esbuild → dist/cli.js (self-contained bundle)
95
94
  npm run watch # esbuild --watch
96
95
  npm run format # prettier --write