summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-08-03 18:58:44 +0200
committerFlorian Dold <florian@dold.me>2023-08-03 18:58:44 +0200
commit0b5d0cdc71b8a6828a0ebae051c911225b354154 (patch)
tree3571ac16cb311ff081848214b5aa5b90475467a7
parent3d7df63c59f95dc14cf94f83fa0d5d2cc69ac11c (diff)
downloadwallet-core-0b5d0cdc71b8a6828a0ebae051c911225b354154.tar.gz
wallet-core-0b5d0cdc71b8a6828a0ebae051c911225b354154.tar.bz2
wallet-core-0b5d0cdc71b8a6828a0ebae051c911225b354154.zip
fix version substitution
-rw-r--r--packages/taler-wallet-core/package.json2
-rw-r--r--packages/taler-wallet-core/src/versions.ts8
-rw-r--r--packages/taler-wallet-core/src/wallet.ts4
3 files changed, 11 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/package.json b/packages/taler-wallet-core/package.json
index 90ef6a453..25e7c2eb2 100644
--- 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
index eedaf68f6..f0f747e22 100644
--- 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
index 4a83db856..aab414e94 100644
--- 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,