Skip to content

Commit

Permalink
feat: improved release process, fixed a circular-dep, re-released
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybuidl committed Jun 1, 2023
1 parent 43ace2d commit 4aa0fce
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 200 deletions.
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,23 @@ veascan-subgraph-inbox/generated/*
veascan-subgraph-inbox/build/*
validator-subgraph-inbox/generated/*
validator-subgraph-inbox/build/*

# Hardhat files
cache
artifacts
coverage.json

## Hardhat typechain bindings/types
typechain
typechain/**
typechain-types
typechain-types/**

# Hardhat deploy files
contracts/deployments/localhost
contracts/deployments/hardhat
contracts/deployments/*/solcInputs/

# POA solidity flattener output
out/

181 changes: 0 additions & 181 deletions contracts/.gitignore

This file was deleted.

6 changes: 4 additions & 2 deletions contracts/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.env*
scripts
deploy
tsconfig.json
.env*
hardhat.config.ts
test
hardhat.config.*
20 changes: 14 additions & 6 deletions contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "@kleros/vea-contracts",
"version": "0.3.0",
"version": "0.3.2",
"description": "Smart contracts for Vea",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/kleros/vea.git"
Expand Down Expand Up @@ -47,7 +50,7 @@
"release:patch": "yarn version patch && yarn npm publish",
"release:minor": "yarn version minor && yarn npm publish",
"release:major": "yarn version major && yarn npm publish",
"prepublish": "ls -la dist/ >foo && yarn tsc || echo"
"prepublish": "./scripts/prepublish.sh"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
Expand Down Expand Up @@ -86,12 +89,17 @@
"@openzeppelin/contracts": "^4.8.3"
},
"files": [
"dist",
"src",
"deployments",
"typechain-types",
"!src/test/**/*",
"!typechain-types/test/**/*",
"!typechain-types/factories/test/**/*"
"!hardhat.config.*",
"!src/test",
"!typechain-types/test",
"!typechain-types/factories/test",
"!test",
"!deploy",
"!deployments/localhost",
"!deployments/hardhat",
"!deployments/**/solcInputs"
]
}
12 changes: 12 additions & 0 deletions contracts/scripts/prepublish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# Remove the mock contracts from the typechain types
sed -n -i '' '/test/!p' $SCRIPT_DIR/../typechain-types/index.ts
sed -n -i '' '/test/!p' $SCRIPT_DIR/../typechain-types/factories/index.ts
rm -rf \
$SCRIPT_DIR/../typechain-types/test/ \
$SCRIPT_DIR/../typechain-types/factories/test/

yarn tsc -p $SCRIPT_DIR/../tsconfig.publish.json
7 changes: 6 additions & 1 deletion contracts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"declaration": true,
"sourceMap": true,
"noImplicitAny": false,
"resolveJsonModule": true
"resolveJsonModule": true,
"skipLibCheck": true
},
"include": [
"./src",
Expand All @@ -17,6 +18,10 @@
"./typechain-types",
"./deploy"
],
"exclude": [
"node_modules",
"dist"
],
"files": [
"./hardhat.config.ts"
]
Expand Down
21 changes: 21 additions & 0 deletions contracts/tsconfig.publish.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "es2021",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "typechain-types",
"declaration": true,
"sourceMap": true,
"noImplicitAny": false,
"resolveJsonModule": true,
"skipLibCheck": true
},
"include": [
"./typechain-types"
],
"exclude": [
"node_modules",
"dist"
]
}
8 changes: 4 additions & 4 deletions vea-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "@kleros/vea-sdk",
"version": "0.3.0",
"version": "0.3.2",
"description": "SDK for the development of cross-chain apps on Vea",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"repository": {
"type": "git",
Expand Down Expand Up @@ -32,10 +33,10 @@
"release:minor": "yarn version minor && yarn npm publish",
"release:major": "yarn version major && yarn npm publish",
"clean": "rm -rf dist",
"prepublish": "yarn tsc || echo"
"prepublish": "yarn tsc"
},
"dependencies": {
"@kleros/vea-contracts": "workspace:^0.3.0",
"@kleros/vea-contracts": "workspace:^0.3.2",
"@logtail/pino": "^0.4.0",
"@typechain/ethers-v5": "^10.2.0",
"dotenv": "^16.0.3",
Expand All @@ -52,7 +53,6 @@
},
"files": [
"dist",
"src",
"examples"
]
}
5 changes: 1 addition & 4 deletions vea-sdk/src/utils/envVar.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import dotenv from "dotenv";
import logger from "./logger";

dotenv.config();

function envVar(key: string): string {
const value = process.env[key];
if (value === undefined) {
const error = new Error(`Environment variable ${key} is undefined`);
logger.error(error);
throw error;
throw new Error(`Environment variable ${key} is undefined`);
}
return value;
}
Expand Down
1 change: 1 addition & 0 deletions vea-sdk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"sourceMap": true,
"noImplicitAny": false,
"resolveJsonModule": true,
"skipLibCheck": true,
"paths": {
"@kleros/vea-contracts": [
"../contracts"
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3357,7 +3357,7 @@ __metadata:
languageName: node
linkType: hard

"@kleros/vea-contracts@workspace:^, @kleros/vea-contracts@workspace:^0.3.0, @kleros/vea-contracts@workspace:contracts":
"@kleros/vea-contracts@workspace:^, @kleros/vea-contracts@workspace:^0.3.2, @kleros/vea-contracts@workspace:contracts":
version: 0.0.0-use.local
resolution: "@kleros/vea-contracts@workspace:contracts"
dependencies:
Expand Down Expand Up @@ -3425,7 +3425,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@kleros/vea-sdk@workspace:vea-sdk"
dependencies:
"@kleros/vea-contracts": "workspace:^0.3.0"
"@kleros/vea-contracts": "workspace:^0.3.2"
"@logtail/pino": ^0.4.0
"@typechain/ethers-v5": ^10.2.0
dotenv: ^16.0.3
Expand Down

0 comments on commit 4aa0fce

Please sign in to comment.