Skip to content

Commit

Permalink
chore: Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed May 22, 2023
1 parent 15fba7e commit 887c79d
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 24 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ jobs:
unzip aptos-cli-1.0.4-Ubuntu-22.04-x86_64.zip
chmod +x aptos
cp aptos /usr/local/bin
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Checkout code
uses: actions/checkout@v3
- name: Cache node_modules
uses: actions/cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "2.0.0-alpha.7",
"version": "2.0.0-alpha.12",
"packages": [
"packages/*"
]
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "axelar-local-dev",
"private": true,
"workspaces": [
"packages/*"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"publish": "lerna publish from-package --yes --dist-tag alpha",
"bootstrap": "lerna bootstrap",
Expand Down
10 changes: 8 additions & 2 deletions packages/axelar-local-dev-aptos/__tests__/utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { findNodeModulesPath } from '..';
import path from 'path';

describe('utils', () => {
it('should be able to find node_modules path', () => {
it('should be able to find base `node_modules` path when the current dir is deep inside the node_modules folder', () => {
const dir = findNodeModulesPath(path.join(__dirname, '..', '..', '..', '/node_modules/@axelar-network/axelar-local-dev/dist'));
expect(dir.endsWith('node_modules')).toBeTruthy();
});

it('should be able to find base `node_modules` path when the current dir is deeper, but it does not inside the node_modules folder', () => {
const path = findNodeModulesPath(__dirname);
expect(path).toContain('node_modules');
expect(path.endsWith('node_modules')).toBeTruthy();
});
});
5 changes: 2 additions & 3 deletions packages/axelar-local-dev-aptos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axelar-network/axelar-local-dev-aptos",
"version": "2.0.0-alpha.7",
"version": "2.0.0-alpha.12",
"main": "dist/index.js",
"files": [
"dist/",
Expand All @@ -15,12 +15,11 @@
"build-contract": "hardhat compile",
"build": "run-s clean build-ts build-contract build-aptos",
"clean": "rm -rf src/types dist artifacts",
"prepare": "run-s build",
"prettier": "prettier --write 'src/**/*.ts'"
},
"dependencies": {
"@axelar-network/axelar-cgp-aptos": "^1.0.5",
"@axelar-network/axelar-local-dev": "2.0.0-alpha.7",
"@axelar-network/axelar-local-dev": "2.0.0-alpha.12",
"aptos": "1.3.16"
},
"author": "",
Expand Down
1 change: 0 additions & 1 deletion packages/axelar-local-dev-aptos/src/AptosNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export class AptosNetwork extends AptosClient {
deployAxelarFrameworkModules() {
const nodeModulesPath = findNodeModulesPath(__dirname);
const modulePath = path.join(nodeModulesPath, '@axelar-network/axelar-cgp-aptos/aptos/modules/axelar/build/AxelarFramework');

return this.deploy(modulePath, ['axelar_gas_service.mv', 'address_utils.mv', 'gateway.mv'], '0x1234');
}

Expand Down
2 changes: 1 addition & 1 deletion packages/axelar-local-dev-aptos/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getAptosLogID = (chain: string, event: any) => {

export const findNodeModulesPath = (currentDir: string) => {
let pathfinder: string = currentDir;
while (!pathfinder.includes('node_modules')) {
while (!pathfinder.endsWith('node_modules')) {
pathfinder = path.join(pathfinder, '..');
const dirs = fs.readdirSync(pathfinder);
if (dirs.indexOf('node_modules') > -1) {
Expand Down
5 changes: 2 additions & 3 deletions packages/axelar-local-dev-near/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axelar-network/axelar-local-dev-near",
"version": "2.0.0-alpha.7",
"version": "2.0.0-alpha.12",
"description": "",
"main": "dist/index.js",
"files": [
Expand All @@ -16,13 +16,12 @@
"build-contract": "rm -rf artifacts && hardhat clean && hardhat compile",
"copy-near-wasm": "cp ../../node_modules/@axelar-network/axelar-cgp-near/dist/axelar_cgp_near.wasm src/contracts/ && mkdir -p dist/contracts && cp -r src/contracts/axelar_cgp_near.wasm dist/contracts",
"build": "run-s build-near build-contract build-ts copy-near-wasm",
"prepare": "run-s build",
"lint": "solhint 'src/contracts/**/*.sol' && eslint 'test/**/*.js'",
"prettier": "prettier --write 'src/contracts/**/*.sol' 'test/**/*.js' 'src/**/*.ts'"
},
"dependencies": {
"@axelar-network/axelar-cgp-near": "^1.0.0",
"@axelar-network/axelar-local-dev": "2.0.0-alpha.7"
"@axelar-network/axelar-local-dev": "2.0.0-alpha.12"
},
"author": "",
"license": "ISC"
Expand Down
4 changes: 2 additions & 2 deletions packages/axelar-local-dev/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/axelar-local-dev/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axelar-network/axelar-local-dev",
"version": "2.0.0-alpha.7",
"version": "2.0.0-alpha.12",
"description": "",
"main": "dist/index.js",
"files": [
Expand All @@ -15,7 +15,6 @@
"build-ts": "rm -rf dist && tsc",
"build-contract": "rm -rf src/artifacts artifacts && hardhat clean && hardhat compile && mv artifacts src/artifacts",
"build": "run-s build-contract build-ts",
"prepare": "run-s build",
"lint": "solhint 'src/contracts/**/*.sol' && eslint 'test/**/*.js'",
"prettier": "prettier --write 'src/contracts/**/*.sol' 'test/**/*.js' 'src/**/*.ts'"
},
Expand Down

0 comments on commit 887c79d

Please sign in to comment.