Skip to content

Commit

Permalink
ci: publish ABIs, types, compiled tasks and scripts (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev authored Feb 21, 2025
1 parent 32d34c7 commit b23f770
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ typechain-types
# Hardhat files
cache
artifacts
abi
abi

dist
package
4 changes: 2 additions & 2 deletions contracts/nft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"typechain": "^8.1.0",
"typescript": ">=4.5.0"
},
"packageManager": "[email protected]+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72",
"packageManager": "[email protected]",
"dependencies": {
"@coral-xyz/anchor": "0.30.0",
"@openzeppelin/contracts": "^5.1.0",
Expand All @@ -65,4 +65,4 @@
"@zetachain/protocol-contracts": "11.0.0-rc3",
"validator": "^13.12.0"
}
}
}
2 changes: 1 addition & 1 deletion contracts/nft/scripts/localnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
set -x
set -o pipefail

if [ "$1" = "start" ]; then npx hardhat localnet --exit-on-error & sleep 10; fi
if [ "$1" = "start" ]; then npx hardhat localnet --exit-on-error & sleep 25; fi

function balance() {
local ZETACHAIN=$(cast call "$CONTRACT_ZETACHAIN" "balanceOf(address)(uint256)" "$SENDER")
Expand Down
2 changes: 1 addition & 1 deletion contracts/nft/tasks/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const main = async (args: any, hre: HardhatRuntimeEnvironment) => {
);
} else {
console.log(`🚀 Successfully deployed "${args.name}" contract on ${network}.
📜 Contract address: ${contract.target}
📜 Contract address: ${contract.address}
`);
}
};
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"typechain": "^8.1.0",
"typescript": ">=4.5.0"
},
"packageManager": "[email protected]+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72",
"packageManager": "[email protected]",
"dependencies": {
"@coral-xyz/anchor": "0.30.0",
"@solana-developers/helpers": "^2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/scripts/localnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
set -x
set -o pipefail

if [ "$1" = "start" ]; then npx hardhat localnet --exit-on-error & sleep 10; fi
if [ "$1" = "start" ]; then npx hardhat localnet --exit-on-error & sleep 25; fi

function balance() {
echo -e "\n🖼️ Balance"
Expand Down
27 changes: 26 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,30 @@
"scripts": {
"build": "sh scripts/build.sh"
},
"packageManager": "[email protected]+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
"exports": {
"./tasks/nft": {
"import": "./dist/nft/tasks/index.js",
"require": "./dist/nft/tasks/index.js",
"types": "./dist/nft/tasks/index.d.ts"
},
"./tasks/token": {
"import": "./dist/token/tasks/index.js",
"require": "./dist/token/tasks/index.js",
"types": "./dist/token/tasks/index.d.ts"
}
},
"files": [
"dist",
"abi",
"contracts/nft/contracts",
"contracts/nft/typechain-types",
"contracts/nft/scripts",
"contracts/token/contracts",
"contracts/token/typechain-types",
"contracts/token/scripts"
],
"packageManager": "[email protected]",
"devDependencies": {
"typescript": "^5.7.3"
}
}
2 changes: 2 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
rm -rf abi && mkdir -p abi/contracts
rm -rf typescript-types && mkdir typescript-types

tsc

for dir in ./contracts/*/; do
subdir=$(echo $dir | cut -d'/' -f2)

Expand Down
19 changes: 19 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"target": "es2020",
"resolveJsonModule": true,
"outDir": "./dist",
"skipLibCheck": true,
"sourceMap": false,
"strict": true
},
"include": ["contracts/nft/tasks", "contracts/token/tasks"],
"exclude": ["./typechain-types"]
}
9 changes: 9 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@
# yarn lockfile v1


typescript@^5.7.3:
version "5.7.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e"
integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==

validator@^13.12.0:
version "13.12.0"
resolved "https://registry.yarnpkg.com/validator/-/validator-13.12.0.tgz#7d78e76ba85504da3fee4fd1922b385914d4b35f"
integrity sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==

0 comments on commit b23f770

Please sign in to comment.