[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-wallet-webex] 04/04: index for node package
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-wallet-webex] 04/04: index for node package |
Date: |
Wed, 14 Aug 2019 18:50:08 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-webex.
commit 94357e226d27d028ca95bde5174aa0ed49041187
Author: Florian Dold <address@hidden>
AuthorDate: Wed Aug 14 18:49:56 2019 +0200
index for node package
---
package.json | 2 +-
src/headless/taler-wallet-cli.ts | 13 ++++++++-----
src/index.ts | 23 +++++++++++++++++++++++
tsconfig.json | 1 +
4 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index 33194f89..28711f70 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "taler-wallet",
"version": "0.0.1",
"description": "",
- "main": "wxwallet.js",
+ "main": "dist/node/index.js",
"repository": {
"type": "git",
"url": "git://git.taler.net/wallet.git"
diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts
index 435210fc..0c6c2ba9 100644
--- a/src/headless/taler-wallet-cli.ts
+++ b/src/headless/taler-wallet-cli.ts
@@ -231,7 +231,7 @@ class MerchantBackendConnection {
}
}
-async function main() {
+export async function main() {
const myNotifier = new ConsoleNotifier();
const myBadge = new ConsoleBadge();
@@ -349,7 +349,10 @@ async function main() {
myWallet.stop();
}
-main().catch(err => {
- console.error("Failed with exception:");
- console.error(err);
-});
+
+if (require.main === module) {
+ main().catch(err => {
+ console.error("Failed with exception:");
+ console.error(err);
+ });
+}
diff --git a/src/index.ts b/src/index.ts
new file mode 100644
index 00000000..bfd25c6a
--- /dev/null
+++ b/src/index.ts
@@ -0,0 +1,23 @@
+/*
+ This file is part of TALER
+ (C) 2019 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+ * Module entry point for the wallet when used as a node module.
+ */
+
+export { Wallet } from "./wallet";
+
+export { main as runIntegrationTest } from "./headless/taler-wallet-cli";
diff --git a/tsconfig.json b/tsconfig.json
index ad2b9019..3f29f420 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -45,6 +45,7 @@
"src/http.ts",
"src/i18n.tsx",
"src/i18n/strings.ts",
+ "src/index.ts",
"src/libtoolVersion-test.ts",
"src/libtoolVersion.ts",
"src/logging.ts",
--
To stop receiving notification emails like this one, please contact
address@hidden.