Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK [WIP] #542

Merged
merged 109 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
921d524
add sdk router
trajan0x Feb 6, 2023
039aae7
lint fix
trajan0x Feb 6, 2023
3351029
Merge branch 'master' into feat/sdk
trajan0x Feb 6, 2023
a4c476c
Merge branch 'master' into feat/sdk
trajan0x Feb 7, 2023
f914fa1
ci first pass
trajan0x Feb 7, 2023
36e6004
Fix ci
trajan0x Feb 7, 2023
fdc7f25
kill install state
trajan0x Feb 7, 2023
9f72840
remove lockfile
trajan0x Feb 7, 2023
bc58c8d
add sarif scanning
trajan0x Feb 7, 2023
351ee60
cache node_modules
trajan0x Feb 7, 2023
48dfa4a
fix lerna/lerna#2910
trajan0x Feb 7, 2023
b761d5e
fix lerna command
trajan0x Feb 7, 2023
cd1f3ea
switch to immutable
trajan0x Feb 7, 2023
5bfdd95
package update
trajan0x Feb 7, 2023
ee64e75
cleanup
trajan0x Feb 7, 2023
9db8dd8
fix linter
trajan0x Feb 7, 2023
939f465
cleanup
trajan0x Feb 7, 2023
5d1ced0
cache
trajan0x Feb 7, 2023
7d7dfea
fix space
trajan0x Feb 7, 2023
341a8ae
cleanup
trajan0x Feb 7, 2023
41f9bc3
remove lerna
trajan0x Feb 7, 2023
6380304
add coverage aggregator
trajan0x Feb 7, 2023
d93f6cf
lock updates
trajan0x Feb 7, 2023
c9cafc9
fix workflow
trajan0x Feb 7, 2023
cde9f35
move to ci coverage
trajan0x Feb 7, 2023
7d5324a
prettier fix
trajan0x Feb 7, 2023
7ebc130
add prettier
trajan0x Feb 7, 2023
7cd5004
lcov
trajan0x Feb 7, 2023
64f14ed
skip test coverage for lerna
trajan0x Feb 7, 2023
db7d160
use xml reporter
trajan0x Feb 7, 2023
a989fe3
fix lcov?
trajan0x Feb 7, 2023
8b22e76
fix coverage
trajan0x Feb 7, 2023
2781b93
update foundry coverage
trajan0x Feb 7, 2023
7d1a589
fix codecov
trajan0x Feb 7, 2023
9082d60
Merge branch 'master' of https://github.com/synapsecns/sanguine
trajan0x Feb 7, 2023
1ae9e95
Merge branch 'master' into feat/sdk
trajan0x Feb 7, 2023
83afc12
typedoc
trajan0x Feb 8, 2023
4b851db
Merge branch 'master' into feat/sdk
trajan0x Feb 11, 2023
65e8acd
Merge branch 'master' into feat/sdk
trajan0x Feb 11, 2023
765e86a
build slither in coverage aggregator
trajan0x Feb 11, 2023
96ae7a8
Merge branch 'master' into feat/sdk
trajan0x Feb 11, 2023
561a8e2
Merge branch 'master' into feat/sdk
trajan0x Feb 12, 2023
5079779
fix package docs
trajan0x Feb 13, 2023
4bffba8
update yarn version for docasaurus
trajan0x Feb 13, 2023
d84ec43
doc scaffolding
trajan0x Feb 13, 2023
3df64b8
fix types
trajan0x Feb 13, 2023
366540e
docs
trajan0x Feb 14, 2023
f08e0b0
update sdk branches
trajan0x Feb 15, 2023
591f0b2
always run
trajan0x Feb 15, 2023
6bfa71b
bump cache version
trajan0x Feb 15, 2023
7c099ac
fix fetch depth
trajan0x Feb 15, 2023
984eeb9
Publish
trajan0x Feb 15, 2023
c19e5fb
yaml publish fixes
trajan0x Feb 15, 2023
022d165
rm ds-test
trajan0x Feb 15, 2023
8e7f796
Publish
trajan0x Feb 15, 2023
7628245
upterm
trajan0x Feb 15, 2023
1c980f2
Merge branch 'feat/sdk' of https://github.com/synapsecns/sanguine int…
trajan0x Feb 15, 2023
2ae07a0
[ci skip] update lockfile
trajan0x Feb 15, 2023
d801f7f
fix install process
trajan0x Feb 15, 2023
e08ef99
Publish
trajan0x Feb 15, 2023
1a6d900
Rewrite tasks
trajan0x Feb 15, 2023
d2527fc
Merge branch 'feat/sdk' of https://github.com/synapsecns/sanguine int…
trajan0x Feb 15, 2023
d0d7798
Publish
trajan0x Feb 15, 2023
d0755c3
use github registry
trajan0x Feb 15, 2023
1afc798
Merge branch 'feat/sdk' of https://github.com/synapsecns/sanguine int…
trajan0x Feb 15, 2023
67665d0
Publish
trajan0x Feb 15, 2023
d561b19
update router
trajan0x Feb 15, 2023
9e34571
Merge branch 'feat/sdk' of https://github.com/synapsecns/sanguine int…
trajan0x Feb 15, 2023
e4be456
Publish
trajan0x Feb 15, 2023
ce9710e
republish packages
trajan0x Feb 15, 2023
f0b15cd
bump versions
trajan0x Feb 15, 2023
aee2490
Publish
trajan0x Feb 15, 2023
747ab85
github fixes
trajan0x Feb 15, 2023
4389efd
Merge branch 'feat/sdk' of https://github.com/synapsecns/sanguine int…
trajan0x Feb 15, 2023
a2848dd
Publish
trajan0x Feb 15, 2023
c0e615d
always auth
trajan0x Feb 15, 2023
2d17c99
Merge branch 'feat/sdk' of https://github.com/synapsecns/sanguine int…
trajan0x Feb 15, 2023
972f933
Publish
trajan0x Feb 15, 2023
92ea5aa
fix lerna/lerna#2788
trajan0x Feb 15, 2023
c6c825c
bump sdk-router version
trajan0x Feb 15, 2023
4943e82
Publish
trajan0x Feb 15, 2023
5f155f6
fix access config
trajan0x Feb 15, 2023
5d4f277
Merge branch 'feat/sdk' of https://github.com/synapsecns/sanguine int…
trajan0x Feb 15, 2023
60f35ef
Publish
trajan0x Feb 15, 2023
30f43cb
delete docs
trajan0x Feb 15, 2023
e46182e
Merge branch 'feat/sdk' of https://github.com/synapsecns/sanguine int…
trajan0x Feb 15, 2023
d6152eb
remove legacy workflow
trajan0x Feb 15, 2023
6b5bc76
rename docs
trajan0x Feb 15, 2023
3a44fa7
add docs projct id
trajan0x Feb 15, 2023
b0495b7
update checkout
trajan0x Feb 28, 2023
8fb2c62
remove explorer deploy
trajan0x Feb 28, 2023
ad71a94
fix docs yaml
trajan0x Feb 28, 2023
bca3d61
fix test coverage
trajan0x Feb 28, 2023
61f875d
cleanup forge-std
trajan0x Feb 28, 2023
4cee351
add nvmrc copy
trajan0x Feb 28, 2023
e145762
setup nvmrc
trajan0x Feb 28, 2023
8b37cbe
Extend timeout
trajan0x Feb 28, 2023
9992233
[ci skip] quote fix
trajan0x Feb 28, 2023
821b529
git changes action
trajan0x Feb 28, 2023
55be9f5
detector updates
trajan0x Feb 28, 2023
f5959f1
Revert "detector updates"
trajan0x Feb 28, 2023
5053e8d
fix git patch resolution
trajan0x Feb 28, 2023
d09580d
update sdk
trajan0x Feb 28, 2023
9250ffc
retry it
trajan0x Mar 2, 2023
25b875d
cleanup
trajan0x Mar 2, 2023
1b5bdc1
Merge branch 'master' into feat/sdk
trajan0x Mar 7, 2023
e2cb21f
fix git-change-action
trajan0x Mar 7, 2023
fb67252
add sdk tests
trajan0x Mar 7, 2023
6fe1c12
fix linting issues
trajan0x Mar 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ module.exports = {
browser: true,
es6: true,
},
ignorePatterns: ['dist', 'coverage', 'packages/contracts-core/hardhat'],
ignorePatterns: ['dist', 'coverage'],
extends: ['plugin:prettier/recommended'],
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
es6: true,
ecmaVersion: 6,
sourceType: 'module',
requireConfigFile: false,
},
plugins: [
'eslint-plugin-import',
Expand All @@ -25,7 +26,7 @@ module.exports = {
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
project: './packages/**/tsconfig.json',
sourceType: 'module',
allowAutomaticSingleRunInference: true,
},
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,20 @@ jobs:
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvmrc

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
cache: 'yarn'


- name: Initialize Yarn cache
uses: actions/cache@v2
id: yarn-cache
- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install Node Dependencies
run: yarn install --frozen-lockfile --check-files
run: yarn install --immutable

- name: Changeset Status
run: npx changeset status
35 changes: 35 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Vercel Preview Deployment
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
VERCEL_TOKEN: '${{ secrets.VERCEL_TOKEN }}'
VERCEL_ORG_ID: '${{ secrets.VERCEL_ORG_ID }}'
VERCEL_PROJECT_ID: '${{ secrets.DOCS_VERCEL_PROJECT_ID }}'
WORKING_DIRECTORY: 'packages/docs'
NODE_ENV: 'production'
on:
push:
branches-ignore:
- master
jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvmrc

- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v3
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
cache: 'yarn'

- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
20 changes: 7 additions & 13 deletions .github/workflows/foundry-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,21 @@ jobs:
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvmrc

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
cache: 'yarn'


- name: Initialize Yarn cache
uses: actions/cache@v2
id: yarn-cache
- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Installing dependencies
working-directory: ./packages/contracts-core
run: yarn install --frozen-lockfile --check-files
run: yarn install --immutable

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand Down
62 changes: 20 additions & 42 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ jobs:
with:
include_deps: true
github_token: ${{ secrets.WORKFLOW_PAT }}
timeout: '10m'

- uses: docker://ghcr.io/synapsecns/sanguine/git-changes-action:latest
id: filter_go_nodeps
with:
include_deps: false
github_token: ${{ secrets.WORKFLOW_PAT }}
timeout: '10m'

- name: Check For Solidity Changes
id: filter_solidity
Expand Down Expand Up @@ -103,7 +105,7 @@ jobs:
run: docker run -p 8045:8545 -d -v /tmp/keys/:/tmp/keys/ --name rinkeby --restart always trufflesuite/ganache-cli ganache-cli --accounts 10 --account_keys_path /tmp/keys/rinkeby --chainId 4 # --fork https://rinkeby-light.eth.linkpool.io (no need to actually fork)

- name: Go modules cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
# see https://github.com/mvdan/github-actions-golang
path: |
Expand Down Expand Up @@ -185,7 +187,7 @@ jobs:
go-version: ${{ matrix.go-version }}

- name: Go modules cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
# see https://github.com/mvdan/github-actions-golang
path: |
Expand Down Expand Up @@ -311,42 +313,31 @@ jobs:
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvmrc

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
cache: 'yarn'

- name: Initialize Yarn cache
uses: actions/cache@v2
id: yarn-cache
- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install Node Dependencies
run: yarn install --frozen-lockfile --check-files

- name: Install dependencies
run: |
npx lerna bootstrap
run: yarn install --immutable

# Generate flattened files
- name: Run flattener
run: npx lerna exec npm run build:go
run: npx lerna exec npm run build:go --parallel

# Setup Go
- uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Go modules cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
# see https://github.com/mvdan/github-actions-golang
path: |
Expand Down Expand Up @@ -428,36 +419,23 @@ jobs:
id: nvmrc
if: ${{ contains(matrix.package, 'agents') }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
if: ${{ contains(matrix.package, 'agents') }}

- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v2
uses: actions/setup-node@v3
if: ${{ contains(matrix.package, 'agents') }}
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
if: ${{ contains(matrix.package, 'agents') }}
cache: 'yarn'

- name: Initialize Yarn cache
uses: actions/cache@v2
id: yarn-cache
if: ${{ contains(matrix.package, 'agents') }}
- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install Node Dependencies
run: yarn install --frozen-lockfile --check-files
run: yarn install --immutable
if: ${{ contains(matrix.package, 'agents') }}

- name: Install dependencies
if: ${{ contains(matrix.package, 'agents') }}
run: |
npx lerna bootstrap

# Generate flattened files
- name: Run flattener
run: npx lerna exec npm run build:go
Expand All @@ -469,7 +447,7 @@ jobs:
go-version: 1.20.x

- name: Go modules cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
# see https://github.com/mvdan/github-actions-golang
path: |
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/lerna.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish Lerna
on:
pull_request:
types: [closed]
paths:
- 'packages/**'
branches:
- development
- main

jobs:
publish:
# TODO: remove true at the end
if: github.event.pull_request.merged == true || true
runs-on: ubuntu-latest

steps:
- name: 'Checkout'
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'

- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvmrc

- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v3
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
cache: 'yarn'

- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Install Node Dependencies
run: yarn install --immutable --immutable-cache --check-cache

- name: Authenticate with private NPM package
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
echo "always-auth=true" >> ~/.npmrc


- name: 'Version and publish' # Interesting step
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# we're not authed with any repository yet so this shouldn't do anything
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"

if [ ${{ github.base_ref }} = development ]; then
npx lerna version --conventional-commits --conventional-prerelease --preid beta --yes
else
npx lerna version --conventional-commits --conventional-graduate --yes
fi

npx lerna publish from-git --yes --no-verify-access
Loading