From 7f6deffa9e2484b8a7a41e6959d9f75ba48f42fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20R=C3=B6diger?= Date: Sun, 29 Mar 2026 16:11:18 +0200 Subject: [PATCH 1/7] ci: add CI and npm publish workflows CI runs lint, format check, tests, and build on PRs and pushes to main. Publish workflow triggers on v* tags and publishes to npm with provenance. --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ .github/workflows/publish.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..69f624c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - run: npm ci + - run: npm run lint + - run: npm run format:check + - run: npm test + - run: npm run build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7e71b18 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Publish to npm + +on: + push: + tags: + - "v*" + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + registry-url: https://registry.npmjs.org + + - run: npm ci + - run: npm run lint + - run: npm run format:check + - run: npm test + - run: npm run build + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 87f1f2713510308efd5923c172b90f2030a529e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20R=C3=B6diger?= Date: Sun, 29 Mar 2026 16:12:54 +0200 Subject: [PATCH 2/7] 0.1.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8acef5a..9526b9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "crucible-cli", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "crucible-cli", - "version": "0.1.0", + "version": "0.1.1", "license": "MIT", "dependencies": { "@azure/identity": "^4.6.0", diff --git a/package.json b/package.json index 8b672bd..b37aa7a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crucible-cli", - "version": "0.1.0", + "version": "0.1.1", "description": "The kubectl of Azure Service Bus — CLI for message operations, DLQ management, and namespace monitoring", "type": "module", "bin": { From de3c87c0645172d557eeb866ce8dcbd6c91bfa83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20R=C3=B6diger?= Date: Mon, 30 Mar 2026 11:47:24 +0200 Subject: [PATCH 3/7] fix: read version from package.json instead of hardcoding --- src/cli.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cli.ts b/src/cli.ts index e1ad89b..0f47df9 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,4 +1,8 @@ +import { createRequire } from "node:module"; import { Command } from "commander"; + +const require = createRequire(import.meta.url); +const { version } = require("../package.json") as { version: string }; import { configCommand } from "./commands/config.js"; import { loginCommand } from "./commands/login.js"; import { statusCommand } from "./commands/status.js"; @@ -25,7 +29,7 @@ program .description( "The kubectl of Azure Service Bus — message operations, DLQ management, and namespace monitoring" ) - .version("0.1.0"); + .version(version); // --- Phase 1: Foundation --- program.addCommand(configCommand); From 948afa3845473778bcfe8ea17ea5be7635ffb184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20R=C3=B6diger?= Date: Mon, 30 Mar 2026 11:47:28 +0200 Subject: [PATCH 4/7] 0.1.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9526b9e..b132b2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "crucible-cli", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "crucible-cli", - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", "dependencies": { "@azure/identity": "^4.6.0", diff --git a/package.json b/package.json index b37aa7a..96d5e77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crucible-cli", - "version": "0.1.1", + "version": "0.1.2", "description": "The kubectl of Azure Service Bus — CLI for message operations, DLQ management, and namespace monitoring", "type": "module", "bin": { From 68a9cbae63ef39445d5fab4d66cb20858a5a732b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20R=C3=B6diger?= Date: Mon, 30 Mar 2026 11:56:05 +0200 Subject: [PATCH 5/7] fix: correct bin path and repository URL in package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 96d5e77..1ea70eb 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "The kubectl of Azure Service Bus — CLI for message operations, DLQ management, and namespace monitoring", "type": "module", "bin": { - "crucible": "./dist/cli.js" + "crucible": "dist/cli.js" }, "files": [ "dist", @@ -35,7 +35,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/broediger/crucible-cli.git" + "url": "git+https://github.com/broediger/crucible-cli.git" }, "homepage": "https://github.com/broediger/crucible-cli", "bugs": { From 9ddc0b71dca009480b70f312ff856fe7fa9ba868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20R=C3=B6diger?= Date: Mon, 13 Apr 2026 14:43:19 +0200 Subject: [PATCH 6/7] fix: handle AggregateError in global error handler Azure SDK wraps retry failures in an AggregateError with an empty message, causing the CLI to print "Error:" with no details. Extract and deduplicate inner error messages instead. --- src/cli.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli.ts b/src/cli.ts index 0f47df9..fbd1ede 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -60,7 +60,13 @@ program.addCommand(costsCommand); // --- Global error handler --- // Exit codes: 0 = success, 1 = error, 2 = warning/threshold (set by commands like diff) process.on("unhandledRejection", (err: unknown) => { - const msg = err instanceof Error ? err.message : String(err); + let msg: string; + if (err instanceof AggregateError && err.errors.length > 0) { + const unique = [...new Set(err.errors.map((e: Error) => e.message))]; + msg = unique.join("\n"); + } else { + msg = err instanceof Error ? err.message : String(err); + } console.error(`Error: ${msg}`); process.exit(1); }); From 6c4844be0e2f47fb2a3a197cb95837cfda7d4b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20R=C3=B6diger?= Date: Mon, 13 Apr 2026 14:45:00 +0200 Subject: [PATCH 7/7] 0.1.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b132b2f..bb5cf77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "crucible-cli", - "version": "0.1.2", + "version": "0.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "crucible-cli", - "version": "0.1.2", + "version": "0.1.3", "license": "MIT", "dependencies": { "@azure/identity": "^4.6.0", diff --git a/package.json b/package.json index 1ea70eb..86af8c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "crucible-cli", - "version": "0.1.2", + "version": "0.1.3", "description": "The kubectl of Azure Service Bus — CLI for message operations, DLQ management, and namespace monitoring", "type": "module", "bin": {