Skip to content

Commit

Permalink
chore: ensure types are built with yarn build
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Migone <[email protected]>
  • Loading branch information
tmigone committed Mar 14, 2024
1 parent 33b5790 commit 1ba6d90
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 16 additions & 2 deletions packages/contracts/scripts/build
Original file line number Diff line number Diff line change
@@ -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
20 changes: 0 additions & 20 deletions packages/contracts/scripts/prepack

This file was deleted.

0 comments on commit 1ba6d90

Please sign in to comment.