taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 0b5d0cdc71b8a6828a0ebae051c911225b354154
parent 3d7df63c59f95dc14cf94f83fa0d5d2cc69ac11c
Author: Florian Dold <florian@dold.me>
Date:   Thu,  3 Aug 2023 18:58:44 +0200

fix version substitution

Diffstat:
Mpackages/taler-wallet-core/package.json | 2+-
Mpackages/taler-wallet-core/src/versions.ts | 8++++++++
Mpackages/taler-wallet-core/src/wallet.ts | 4++--
3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/packages/taler-wallet-core/package.json b/packages/taler-wallet-core/package.json @@ -12,7 +12,7 @@ "author": "Florian Dold", "license": "GPL-3.0", "scripts": { - "compile": "jq '{version}' package.json > src/version.json && tsc --build", + "compile": "tsc --build", "pretty": "prettier --write src", "test": "tsc && ava", "coverage": "tsc && c8 --src src --all ava", diff --git a/packages/taler-wallet-core/src/versions.ts b/packages/taler-wallet-core/src/versions.ts @@ -34,3 +34,11 @@ export const WALLET_MERCHANT_PROTOCOL_VERSION = "2:0:1"; * Uses libtool's current:revision:age versioning. */ export const WALLET_BANK_INTEGRATION_PROTOCOL_VERSION = "0:0:0"; + +/** + * Semver of the wallet-core implementation. + * Will be replaced with the value from package.json in a + * post-compilation step (inside lib/). + */ +export const WALLET_CORE_IMPLEMENTATION_VERSION = + "__WALLET_CORE_IMPLEMENTATION_VERSION__"; diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts @@ -300,6 +300,7 @@ import { import { TimerAPI, TimerGroup } from "./util/timer.js"; import { WALLET_BANK_INTEGRATION_PROTOCOL_VERSION, + WALLET_CORE_IMPLEMENTATION_VERSION, WALLET_EXCHANGE_PROTOCOL_VERSION, WALLET_MERCHANT_PROTOCOL_VERSION, } from "./versions.js"; @@ -310,7 +311,6 @@ import { WalletCoreApiClient, WalletCoreResponseType, } from "./wallet-api-types.js"; -import versionInfo from "./version.json"; const logger = new Logger("wallet.ts"); @@ -1587,7 +1587,7 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( export function getVersion(ws: InternalWalletState): WalletCoreVersion { const result: WalletCoreVersion = { hash: undefined, - version: versionInfo.version, + version: WALLET_CORE_IMPLEMENTATION_VERSION, exchange: WALLET_EXCHANGE_PROTOCOL_VERSION, merchant: WALLET_MERCHANT_PROTOCOL_VERSION, bank: WALLET_BANK_INTEGRATION_PROTOCOL_VERSION,