2021-08-20 13:06:59 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
set -x
|
|
|
|
|
2021-08-23 21:51:49 +02:00
|
|
|
export DIST=build/node
|
|
|
|
export NODE_PATH=$DIST:vendor
|
2021-08-20 13:06:59 +02:00
|
|
|
|
|
|
|
function build_idb() {
|
2021-08-23 21:51:49 +02:00
|
|
|
rm -rf packages/idb-bridge/{node_modules,lib,dist,tsconfig.tsbuildinfo}
|
|
|
|
idb_dir=$DIST/@gnu-taler/idb-bridge
|
2021-08-20 13:06:59 +02:00
|
|
|
mkdir -p $idb_dir
|
|
|
|
esbuild --platform=node --bundle packages/idb-bridge/src/index.ts > $idb_dir/index.js
|
|
|
|
}
|
|
|
|
|
|
|
|
function build_taler_util() {
|
2021-08-23 21:51:49 +02:00
|
|
|
rm -rf packages/taler-util/{node_modules,lib,dist,tsconfig.tsbuildinfo}
|
|
|
|
taler_util_dir=$DIST/@gnu-taler/taler-util
|
2021-08-20 13:06:59 +02:00
|
|
|
mkdir -p $taler_util_dir
|
2021-08-20 13:54:30 +02:00
|
|
|
esbuild --platform=node --bundle packages/taler-util/src/index.ts > $taler_util_dir/index.js
|
2021-08-20 13:06:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function build_fflate() {
|
2021-08-23 21:51:49 +02:00
|
|
|
fflate_dir=$DIST/fflate
|
2021-08-20 13:06:59 +02:00
|
|
|
mkdir -p $fflate_dir
|
|
|
|
esbuild --platform=node --bundle vendor/fflate/src/index.ts > $fflate_dir/index.js
|
|
|
|
}
|
|
|
|
|
|
|
|
function build_ct() {
|
2021-08-23 21:51:49 +02:00
|
|
|
ct_dir=$DIST/cancellationtoken
|
2021-08-20 13:06:59 +02:00
|
|
|
mkdir -p $ct_dir
|
|
|
|
esbuild --target=es6 --platform=node --bundle vendor/cancellationtoken/src/index.ts > $ct_dir/index.js
|
|
|
|
}
|
|
|
|
|
|
|
|
function build_wallet_core() {
|
2021-08-23 21:51:49 +02:00
|
|
|
rm -rf packages/taler-wallet-core/{node_modules,lib,dist,tsconfig.tsbuildinfo}
|
|
|
|
taler_wallet_core_dir=$DIST/@gnu-taler/taler-wallet-core
|
2021-08-20 13:06:59 +02:00
|
|
|
|
|
|
|
mkdir -p $taler_wallet_core_dir
|
2021-08-23 21:51:49 +02:00
|
|
|
esbuild --platform=node --bundle --external:@gnu-taler/taler-util packages/taler-wallet-core/src/index.node.ts > $taler_wallet_core_dir/index.js
|
2021-08-20 13:06:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function build_wallet_embedded() {
|
2021-08-23 21:51:49 +02:00
|
|
|
rm -rf packages/taler-wallet-embedded/{node_modules,lib,dist,tsconfig.tsbuildinfo}
|
|
|
|
taler_wallet_embedded_dir=$DIST/@gnu-taler/taler-wallet-embedded
|
2021-08-20 13:06:59 +02:00
|
|
|
|
|
|
|
mkdir -p $taler_wallet_embedded_dir
|
|
|
|
esbuild --platform=node --bundle packages/taler-wallet-embedded/src/index.ts > $taler_wallet_embedded_dir/taler-wallet-embedded.js
|
|
|
|
}
|
|
|
|
|
|
|
|
function build_wallet_cli() {
|
2021-08-23 21:51:49 +02:00
|
|
|
rm -rf packages/taler-wallet-cli/{node_modules,lib,dist,tsconfig.tsbuildinfo}
|
|
|
|
taler_wallet_cli_dir=$DIST/@gnu-taler/taler-wallet-cli
|
2021-08-20 13:06:59 +02:00
|
|
|
mkdir -p $taler_wallet_cli_dir
|
|
|
|
|
|
|
|
esbuild --platform=node --bundle packages/taler-wallet-cli/src/index.ts > $taler_wallet_cli_dir/index.js
|
|
|
|
cp $taler_wallet_cli_dir/index.js $taler_wallet_cli_dir/taler-wallet-cli.js
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
build_idb
|
|
|
|
build_taler_util
|
|
|
|
build_fflate
|
|
|
|
build_wallet_core
|
|
|
|
build_wallet_embedded
|
|
|
|
build_ct
|
2021-08-23 21:51:49 +02:00
|
|
|
|
2021-08-20 13:06:59 +02:00
|
|
|
build_wallet_cli
|
2021-08-23 21:51:49 +02:00
|
|
|
|