From 1ba6d90216f601072b7278fad2caaa32e0da6632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Thu, 14 Mar 2024 16:55:19 -0300 Subject: [PATCH] chore: ensure types are built with yarn build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- packages/contracts/package.json | 2 +- packages/contracts/scripts/build | 18 ++++++++++++++++-- packages/contracts/scripts/prepack | 20 -------------------- 3 files changed, 17 insertions(+), 23 deletions(-) delete mode 100755 packages/contracts/scripts/prepack diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 4a254c1b3..cf3df87a6 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -81,7 +81,7 @@ "yargs": "^17.0.0" }, "scripts": { - "prepack": "scripts/prepack", + "prepack": "SKIP_LOAD=true scripts/build", "build": "SKIP_LOAD=true scripts/build", "clean": "rm -rf build/ cache/ dist/", "compile": "hardhat compile", diff --git a/packages/contracts/scripts/build b/packages/contracts/scripts/build index df72b9f62..bc0e54391 100755 --- a/packages/contracts/scripts/build +++ b/packages/contracts/scripts/build @@ -1,6 +1,20 @@ #!/bin/bash +TYPECHAIN_DIR=dist/types + set -eo pipefail +set +o noglob + +# Build contracts +yarn clean +yarn build + +# Refresh distribution folder +rm -rf dist && mkdir -p ${TYPECHAIN_DIR} +cp -R build/abis/ dist/abis +cp -R build/types/ ${TYPECHAIN_DIR} -# Build -yarn compile +# Build and create TS declarations +pushd ${TYPECHAIN_DIR} +ls *.ts **/*.ts | xargs tsc --esModuleInterop +popd diff --git a/packages/contracts/scripts/prepack b/packages/contracts/scripts/prepack deleted file mode 100755 index bc0e54391..000000000 --- a/packages/contracts/scripts/prepack +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -TYPECHAIN_DIR=dist/types - -set -eo pipefail -set +o noglob - -# Build contracts -yarn clean -yarn build - -# Refresh distribution folder -rm -rf dist && mkdir -p ${TYPECHAIN_DIR} -cp -R build/abis/ dist/abis -cp -R build/types/ ${TYPECHAIN_DIR} - -# Build and create TS declarations -pushd ${TYPECHAIN_DIR} -ls *.ts **/*.ts | xargs tsc --esModuleInterop -popd