Skip to content

Commit

Permalink
Merge SDK + Hardhat + Deploy packages (#643)
Browse files Browse the repository at this point in the history
- Merge hardhat package into SDK
- Merge deploy package into SDK
- Reorganize SDK consts and utils
- Rename TestCoreDeploy -> TestCoreDeployer
- Rename some file names to their class names
- Remove runtime dependencies on Chai and Yargs
- Replace Axios dep with cross-fetch
- Setup type shorthand for Address type in SDK
- Update infra package
- Fix deploy's hardhat tests
- Fix incorrect test in AbacusCoreChecker
- Colocate tests into SDK src
- Add instructions for publishing
- Bump version to 0.3.1 and publish
  • Loading branch information
jmrossy authored Jul 5, 2022
1 parent 0644e4b commit 86f280e
Show file tree
Hide file tree
Showing 100 changed files with 802 additions and 956 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ jobs:
run: yarn workspace @abacus-network/sdk run test
- name: infra
run: yarn workspace @abacus-network/infra run test
- name: hardhat
run: yarn workspace @abacus-network/hardhat run test

test-sol:
env:
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/plugins ./.yarn/plugins
COPY .yarn/releases ./.yarn/releases
COPY typescript/utils/package.json ./typescript/utils/
COPY typescript/hardhat/package.json ./typescript/hardhat/
COPY typescript/sdk/package.json ./typescript/sdk/
COPY typescript/deploy/package.json ./typescript/deploy/
COPY typescript/infra/package.json ./typescript/infra/
COPY solidity/core/package.json ./solidity/core/
COPY solidity/app/package.json ./solidity/app/
Expand Down
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ This monorepo uses [Yarn Workspaces](https://yarnpkg.com/features/workspaces). I
yarn build
```

- Running prettier

```bash
yarn prettier
```

If you are using [VSCode](https://code.visualstudio.com/), you can launch the [multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) with `code mono.code-workspace`, install the recommended workspace extensions, and use the editor settings.

### Rust
Expand All @@ -53,7 +47,7 @@ cd rust
./release.sh <image_tag>
```

## Deploy Procedure
#### Deploy Procedure

The contract addresses of each deploy can be found in `rust/config`. The latest
deploy will be at `rust/config/[latest timestamp]` with bridge contracts within
Expand All @@ -68,3 +62,29 @@ messages will not be relayed between chains).

Off-chain agents are **not** automatically re-deployed when new contract deploys
are merged. Auto-redeploys will be implemented at some future date.

### Publishing Packages

Packages can be versioned and published all at once with commands from the root.

First, increment the version to the desired value:

```bash
# An example of a prerelease version
yarn version:prepare 0.5.0-beta0
# Or for a release which increments the minor version
yarn version:prepare minor
```

Next, ensure packages are cleaned and rebuilt:

```bash
yarn clean && yarn build
```

Finally, publish the packages to NPM

```bash
# Note: If you have not yet logged in, first run yarn npm login
yarn publish:all --otp YOUR_OTP_HERE
```
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
"private": true,
"scripts": {
"build": "yarn workspaces foreach --verbose --parallel --topological run build",
"publish": "yarn workspaces foreach --no-private --verbose --topological npm publish --access public",
"clean": "yarn workspaces foreach --verbose --parallel run clean",
"postinstall": "husky install",
"prettier": "yarn workspaces foreach --verbose --parallel run prettier",
"lint-ts": "eslint . --ext .ts",
"test": "yarn workspaces foreach --verbose --parallel run test"
"test": "yarn workspaces foreach --verbose --parallel run test",
"version:check": "yarn version check --interactive",
"version:prepare": "yarn workspaces foreach --no-private --verbose --topological version --immediate",
"publish:all": "yarn workspaces foreach --no-private --verbose --topological npm publish --access public"
},
"workspaces": [
"solidity/*",
Expand Down
8 changes: 4 additions & 4 deletions solidity/app/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@abacus-network/app",
"description": "Solidity contracts for Abacus apps",
"version": "0.2.3",
"version": "0.3.1",
"dependencies": {
"@abacus-network/core": "^0.2.3",
"@abacus-network/utils": "^0.2.3",
"@abacus-network/core": "0.3.1",
"@abacus-network/utils": "0.3.1",
"@openzeppelin/contracts-upgradeable": "^4.5.0"
},
"devDependencies": {
Expand Down Expand Up @@ -45,7 +45,7 @@
"repository": "https://github.com/abacus-network/abacus-monorepo",
"scripts": {
"build": "hardhat compile && tsc",
"clean": "hardhat clean",
"clean": "hardhat clean && rm -rf ./dist ./cache",
"coverage": "hardhat coverage",
"prettier": "prettier --write ./contracts ./test",
"test": "hardhat test"
Expand Down
6 changes: 3 additions & 3 deletions solidity/core/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@abacus-network/core",
"description": "Core solidity contracts for Abacus",
"version": "0.2.3",
"version": "0.3.1",
"dependencies": {
"@abacus-network/utils": "^0.2.3",
"@abacus-network/utils": "0.3.1",
"@openzeppelin/contracts": "^4.6.0",
"@openzeppelin/contracts-upgradeable": "^4.6.0",
"@summa-tx/memview-sol": "^2.0.0"
Expand Down Expand Up @@ -45,7 +45,7 @@
"repository": "https://github.com/abacus-network/abacus-monorepo",
"scripts": {
"build": "hardhat compile && tsc",
"clean": "hardhat clean",
"clean": "hardhat clean && rm -rf ./dist ./cache",
"coverage": "hardhat coverage",
"prettier": "prettier --write ./contracts ./interfaces ./test",
"test": "hardhat test"
Expand Down
3 changes: 0 additions & 3 deletions typescript/deploy/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions typescript/deploy/.prettierignore

This file was deleted.

42 changes: 0 additions & 42 deletions typescript/deploy/package.json

This file was deleted.

21 changes: 0 additions & 21 deletions typescript/deploy/src/index.ts

This file was deleted.

3 changes: 0 additions & 3 deletions typescript/deploy/src/router/index.ts

This file was deleted.

42 changes: 0 additions & 42 deletions typescript/deploy/src/utils.ts

This file was deleted.

3 changes: 0 additions & 3 deletions typescript/deploy/src/verify/index.ts

This file was deleted.

15 changes: 0 additions & 15 deletions typescript/deploy/tsconfig.json

This file was deleted.

2 changes: 0 additions & 2 deletions typescript/hardhat/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions typescript/hardhat/.prettierrc

This file was deleted.

40 changes: 0 additions & 40 deletions typescript/hardhat/index.ts

This file was deleted.

45 changes: 0 additions & 45 deletions typescript/hardhat/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions typescript/hardhat/tsconfig.json

This file was deleted.

3 changes: 1 addition & 2 deletions typescript/infra/config/environments/dev/core.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { CoreConfig } from '@abacus-network/deploy';
import { ChainMap } from '@abacus-network/sdk';
import { ChainMap, CoreConfig } from '@abacus-network/sdk';

import { DevChains } from './chains';

Expand Down
3 changes: 1 addition & 2 deletions typescript/infra/config/environments/mainnet/core.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { CoreConfig } from '@abacus-network/deploy';
import { ChainMap } from '@abacus-network/sdk';
import { ChainMap, CoreConfig } from '@abacus-network/sdk';

import { MainnetChains } from './chains';

Expand Down
3 changes: 1 addition & 2 deletions typescript/infra/config/environments/test/core.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { CoreConfig } from '@abacus-network/deploy';
import { ChainMap } from '@abacus-network/sdk';
import { ChainMap, CoreConfig } from '@abacus-network/sdk';

import { TestChains } from './chains';

Expand Down
Loading

0 comments on commit 86f280e

Please sign in to comment.