@bluestep-systems/b6p-cli 0.6.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,40 @@ 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
+
8
42
  ## [0.6.0] — 2026-08-21
9
43
 
10
44
  ### Changed (breaking, user-visible)
package/dist/cli.js CHANGED
@@ -648,7 +648,7 @@ try {
648
648
  Write-Output '[]'
649
649
  }
650
650
  exit 0
651
- `;var UD=Jv(require("fs")),zRe=Jv(require("os")),JD=Jv(require("path")),Fbt="ts-libs.json",VRe="lib.d.ts";function qRe(){let oe=Mbt();if(oe?.isSea()){let O=Lbt(oe);return O?[O]:[]}let C=JD.join(__dirname,"lib");return UD.existsSync(JD.join(C,VRe))?[C]:[]}function Mbt(){try{return require("node:sea")}catch{return}}function Lbt(oe){try{let C=JSON.parse(oe.getAsset(Fbt,"utf8")),O=JD.join(zRe.tmpdir(),"b6p-ts-libs","0.6.0");UD.mkdirSync(O,{recursive:!0});for(let[H,se]of Object.entries(C)){if(JD.basename(H)!==H||!H.startsWith("lib.")||!H.endsWith(".d.ts"))continue;let Je=JD.join(O,H);UD.existsSync(Je)||UD.writeFileSync(Je,se)}return UD.existsSync(JD.join(O,VRe))?O:void 0}catch{return}}function ew(oe){return MI.resolve(process.cwd(),oe)}async function ES(oe,C="Working\u2026"){let O=new iZ({autoYes:oe.yes,json:oe.json}),H=new sZ({verbose:oe.verbose}),se=new aZ({quiet:oe.quiet||oe.json}),Je=new oZ(C,{enabled:!oe.json&&!oe.quiet&&process.stderr.isTTY===!0});O.setActivityPauser(Je),H.setActivityPauser(Je),se.setActivityPauser(Je);let bt=new GRe.SharedFilePersistence(void 0,new cZ);await Rbt(bt);let ar=new $Re.B6PCore({fs:new rZ,persistence:bt,prompt:O,logger:H,progress:se,typescriptLibDirs:qRe()});return Je.start(),{core:ar,prompt:O,spinner:Je}}async function Rbt(oe){let C=MI.join(HRe.homedir(),".b6p"),O=MI.join(C,"secrets.json"),H=MI.join(C,"state");await oe.seedIfMissing({publicEntries:async()=>{let se=[];try{let bt=await qB.readdir(H);for(let ar of bt){if(!ar.endsWith(".json"))continue;let Qr=MI.join(H,ar);try{let nn=await qB.readFile(Qr,"utf-8"),zn=JSON.parse(nn);se.push({size:nn.length,data:zn})}catch{}}}catch{}se.sort((bt,ar)=>bt.size-ar.size);let Je={};for(let bt of se)Object.assign(Je,bt.data);return Je},secretEntries:async()=>{try{let se=await qB.readFile(O,"utf-8");return JSON.parse(se)}catch{return{}}}})}var Wp=new sLe("b6p").description("BlueStep B6P script management CLI").version("0.6.0").option("--yes","Skip confirmation prompts").option("--json","Machine-readable JSON output").option("--verbose","Verbose logging").option("--quiet","Suppress progress output");Wp.command("push [target-url]").description("Push a script to a WebDAV target").option("--file <path>","Derive target from local file metadata").option("--root <path>","Script root folder").option("--snapshot","Push as snapshot").option("--message <text>","Commit message for snapshot history (implies --snapshot)").action(async(oe,C)=>{let O=Wp.opts(),{core:H,prompt:se,spinner:Je}=await ES(O),bt=C.snapshot||C.message!==void 0;try{let ar=C.file?await H.script.pushCurrent({filePath:ew(C.file),snapshot:bt,message:C.message}):await H.script.push({targetUrl:oe,rootPath:ew(C.root||"."),snapshot:bt,message:C.message});O.json&&process.stdout.write(JSON.stringify(ar??{cancelled:!0},null,2)+`
651
+ `;var UD=Jv(require("fs")),zRe=Jv(require("os")),JD=Jv(require("path")),Fbt="ts-libs.json",VRe="lib.d.ts";function qRe(){let oe=Mbt();if(oe?.isSea()){let O=Lbt(oe);return O?[O]:[]}let C=JD.join(__dirname,"lib");return UD.existsSync(JD.join(C,VRe))?[C]:[]}function Mbt(){try{return require("node:sea")}catch{return}}function Lbt(oe){try{let C=JSON.parse(oe.getAsset(Fbt,"utf8")),O=JD.join(zRe.tmpdir(),"b6p-ts-libs","0.6.1");UD.mkdirSync(O,{recursive:!0});for(let[H,se]of Object.entries(C)){if(JD.basename(H)!==H||!H.startsWith("lib.")||!H.endsWith(".d.ts"))continue;let Je=JD.join(O,H);UD.existsSync(Je)||UD.writeFileSync(Je,se)}return UD.existsSync(JD.join(O,VRe))?O:void 0}catch{return}}function ew(oe){return MI.resolve(process.cwd(),oe)}async function ES(oe,C="Working\u2026"){let O=new iZ({autoYes:oe.yes,json:oe.json}),H=new sZ({verbose:oe.verbose}),se=new aZ({quiet:oe.quiet||oe.json}),Je=new oZ(C,{enabled:!oe.json&&!oe.quiet&&process.stderr.isTTY===!0});O.setActivityPauser(Je),H.setActivityPauser(Je),se.setActivityPauser(Je);let bt=new GRe.SharedFilePersistence(void 0,new cZ);await Rbt(bt);let ar=new $Re.B6PCore({fs:new rZ,persistence:bt,prompt:O,logger:H,progress:se,typescriptLibDirs:qRe()});return Je.start(),{core:ar,prompt:O,spinner:Je}}async function Rbt(oe){let C=MI.join(HRe.homedir(),".b6p"),O=MI.join(C,"secrets.json"),H=MI.join(C,"state");await oe.seedIfMissing({publicEntries:async()=>{let se=[];try{let bt=await qB.readdir(H);for(let ar of bt){if(!ar.endsWith(".json"))continue;let Qr=MI.join(H,ar);try{let nn=await qB.readFile(Qr,"utf-8"),zn=JSON.parse(nn);se.push({size:nn.length,data:zn})}catch{}}}catch{}se.sort((bt,ar)=>bt.size-ar.size);let Je={};for(let bt of se)Object.assign(Je,bt.data);return Je},secretEntries:async()=>{try{let se=await qB.readFile(O,"utf-8");return JSON.parse(se)}catch{return{}}}})}var Wp=new sLe("b6p").description("BlueStep B6P script management CLI").version("0.6.1").option("--yes","Skip confirmation prompts").option("--json","Machine-readable JSON output").option("--verbose","Verbose logging").option("--quiet","Suppress progress output");Wp.command("push [target-url]").description("Push a script to a WebDAV target").option("--file <path>","Derive target from local file metadata").option("--root <path>","Script root folder").option("--snapshot","Push as snapshot").option("--message <text>","Commit message for snapshot history (implies --snapshot)").action(async(oe,C)=>{let O=Wp.opts(),{core:H,prompt:se,spinner:Je}=await ES(O),bt=C.snapshot||C.message!==void 0;try{let ar=C.file?await H.script.pushCurrent({filePath:ew(C.file),snapshot:bt,message:C.message}):await H.script.push({targetUrl:oe,rootPath:ew(C.root||"."),snapshot:bt,message:C.message});O.json&&process.stdout.write(JSON.stringify(ar??{cancelled:!0},null,2)+`
652
652
  `),ar&&(!ar.pushed||!ar.historyRecorded)&&(process.exitCode=1)}finally{Je.stop(),se.close()}});Wp.command("pull [formula-url]").description("Pull a script from a WebDAV location").option("--file <path>","Derive source from local file metadata").option("--workspace <path>","Target workspace folder (default: cwd)").action(async(oe,C)=>{let O=Wp.opts(),{core:H,prompt:se,spinner:Je}=await ES(O);try{let bt;if(oe)bt=await H.script.pull({formulaUrl:oe,workspacePath:ew(C.workspace||".")});else{let ar=ew(C.file??"."),Qr=C.workspace?ew(C.workspace):H.script.deriveWorkspacePath(ar)??process.cwd();bt=await H.script.pullCurrent({filePath:ar,workspacePath:Qr})}O.json&&process.stdout.write(JSON.stringify(bt??{cancelled:!0},null,2)+`
653
653
  `)}finally{Je.stop(),se.close()}});Wp.command("audit").description("Compare local script against server state").option("--file <path>","File within the script to audit (default: cwd)").option("--pull","Pull if differences are detected").option("--workspace <path>","Workspace folder (default: cwd)").action(async oe=>{let C=Wp.opts(),{core:O,prompt:H,spinner:se}=await ES(C);try{let Je=ew(oe.file??"."),bt=oe.workspace?ew(oe.workspace):O.script.deriveWorkspacePath(Je)??process.cwd();if(oe.pull)await O.script.auditPull({filePath:Je,workspacePath:bt});else{let ar=await O.script.audit({filePath:Je,workspacePath:bt});C.json&&process.stdout.write(JSON.stringify(ar,null,2)+`
654
654
  `)}}finally{se.stop(),H.close()}});Wp.command("deploy <config-file>").description("Quick deploy from a config file to multiple targets").action(async oe=>{let C=Wp.opts(),{core:O,prompt:H,spinner:se}=await ES(C);try{await O.script.deploy({configPath:ew(oe)})}finally{se.stop(),H.close()}});var XRe=Wp.command("auth").description("Manage credentials");XRe.command("set").description("Set or update credentials").action(async()=>{let oe=Wp.opts(),{core:C,prompt:O,spinner:H}=await ES(oe);try{await C.updateCredentials()}finally{H.stop(),O.close()}});XRe.command("clear").description("Clear stored credentials").action(async()=>{let oe=Wp.opts(),{core:C,prompt:O,spinner:H}=await ES(oe);try{await C.auth.clear()}finally{H.stop(),O.close()}});Wp.command("sessions").description("Manage sessions").command("clear").description("Clear all active sessions").action(async()=>{let oe=Wp.opts(),{core:C,prompt:O,spinner:H}=await ES(oe);try{await C.sessionManager.clearAll()}finally{H.stop(),O.close()}});var QRe=Wp.command("config").description("Manage configuration");QRe.command("set <key> <value>").description("Set a configuration value").action(async(oe,C)=>{let O=Wp.opts(),{core:H,prompt:se,spinner:Je}=await ES(O);try{let bt;try{bt=JSON.parse(C)}catch{bt=C}await H.setConfig(oe,bt)}finally{Je.stop(),se.close()}});QRe.command("reset").description("Reset all settings to defaults").action(async()=>{let oe=Wp.opts(),{core:C,prompt:O,spinner:H}=await ES(oe);try{await C.clearSettings()}finally{H.stop(),O.close()}});Wp.command("report").description("Report current state").action(async()=>{let oe=Wp.opts(),{core:C,prompt:O,spinner:H}=await ES(oe);try{let se=await C.report();oe.json&&process.stdout.write(JSON.stringify(se,null,2)+`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluestep-systems/b6p-cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Command-line interface for BlueStep B6P script management",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/Bluestep-Systems/b6p-cli#readme",
@@ -42,6 +42,6 @@
42
42
  "commander": "^14.0.3",
43
43
  "esbuild": "^0.27.4",
44
44
  "prettier": "^3.9.6",
45
- "typescript": "^7.0.2"
45
+ "typescript": "5.9.2"
46
46
  }
47
47
  }