Skip to content

Commit 160cb78

Browse files
committed
Merge remote-tracking branch 'origin/master' into auth
2 parents e8d8aa2 + 1d54053 commit 160cb78

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

.github/RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Publishing runs automatically when a **GitHub Release** is published (see [npm-p
2323

2424
## Stable release (e.g. `0.2.0`)
2525

26-
1. Merge `package.json` version **`0.2.0`** (no prerelease suffix) and sync CLI/MCP version strings in `src/` if you still duplicate them.
26+
1. Merge `package.json` version **`0.2.0`** (no prerelease suffix). The CLI reads this version at runtime from `src/version.ts` (no separate bump in `src/`).
2727
2. Tag and push:
2828

2929
```bash

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitrefill/cli",
3-
"version": "0.2.0-beta.0",
3+
"version": "0.2.0",
44
"description": "Bitrefill - browse, buy, and manage gift cards, mobile top-ups, and eSIMs",
55
"type": "module",
66
"bin": {

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { buildManifest } from './manifest.js';
3131
import { runInit } from './init.js';
3232
import { BASE_MCP_URL, IS_DEFAULT_BASE_MCP_URL } from './config.js';
3333

34-
const CLI_VERSION = '0.2.0-beta.0';
34+
import { VERSION } from './version.js';
3535

3636
/** Subcommands defined by the CLI; MCP tools with the same name are skipped. */
3737
const RESERVED_TOOL_NAMES = new Set([
@@ -218,7 +218,7 @@ async function createMcpClient(
218218
const connectOnce = async () => {
219219
const client = new Client({
220220
name: 'bitrefill-cli',
221-
version: CLI_VERSION,
221+
version: VERSION,
222222
});
223223
client.onerror = suppressNoise;
224224
const transport = new StreamableHTTPClientTransport(new URL(url), {
@@ -557,7 +557,7 @@ Privacy: https://www.bitrefill.com/privacy`;
557557
const program = new Command()
558558
.name('bitrefill')
559559
.description(description)
560-
.version(CLI_VERSION)
560+
.version(VERSION)
561561
.option(
562562
'--json',
563563
'Output raw JSON (TOON decoded); use with jq. Non-result messages go to stderr.'
@@ -591,7 +591,7 @@ Privacy: https://www.bitrefill.com/privacy`;
591591
tools,
592592
identity,
593593
mcpUrl: BASE_MCP_URL,
594-
cliVersion: CLI_VERSION,
594+
cliVersion: VERSION,
595595
}),
596596
});
597597
if (opts.output) {
@@ -612,7 +612,7 @@ Privacy: https://www.bitrefill.com/privacy`;
612612
tools,
613613
identity,
614614
mcpUrl: BASE_MCP_URL,
615-
cliVersion: CLI_VERSION,
615+
cliVersion: VERSION,
616616
});
617617
if (opts.output) {
618618
fs.writeFileSync(

src/version.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { readFileSync } from 'node:fs';
2+
3+
const pkg = JSON.parse(
4+
readFileSync(new URL('../package.json', import.meta.url), 'utf8')
5+
) as { version: string };
6+
7+
export const VERSION: string = pkg.version;

0 commit comments

Comments
 (0)