Skip to content

Commit a11e855

Browse files
authored
[ENG-2210][ENG-2200] synd-cli (#906)
* refactor directory structure for commands * synd-cli * move features to cli * gitignore * port features to cli * refactor * check token bridge command * update cmmds * updated args * handoff command * e2e cli * more e2e refactor * typecheck * update e2e * drop address * fix types * newOwnerAddress -> newOwner * updated naming * updated get clients * rm log * fix * updated helpers * command order * uniform getClients * register handoff command * updated abis * updated README * options from config file * accept options from --config file_path_to_options, check token bridge fix * format * updated options * ignore all except json.example * example config * init example config * only write required options, formatting * format * updated README * init for arb-owner call * updated types * update WF * add format to generate command * updated WF * publish * updated client getting * fix print & imports * pre-commit * fix git modules * rm empty line in pre-commit
1 parent 5c92fa3 commit a11e855

File tree

137 files changed

+11475
-9023
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+11475
-9023
lines changed

.github/workflows/contracts-check.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,31 @@ jobs:
7878
make -C shared create-contract-bindings
7979
git diff --quiet || (echo "Error: Rust contract bindings are out of date. Please run 'make -C shared create-contract-bindings' to update them." && exit 1)
8080
81-
- name: Check TypeScript ABI files for create-chain
81+
- name: Setup Bun
82+
uses: oven-sh/setup-bun@v2
83+
with:
84+
bun-version: latest
85+
86+
- name: Install synd-cli dependencies
87+
working-directory: "synd-cli"
88+
run: bun install
89+
90+
- name: Check TypeScript ABI files for synd-cli
8291
working-directory: "."
8392
run: |
84-
make -C create-chain generate-contract-abis
85-
git diff --exit-code create-chain/src/abi/synd/ || (
93+
make -C synd-cli generate-contract-abis
94+
git diff --exit-code synd-cli/src/abi/synd/ || (
8695
echo "❌ Error: TypeScript ABI files are out of date."
8796
echo ""
8897
echo "The committed ABI files don't match the ones generated from the contracts."
8998
echo "Please run the following command to regenerate them:"
9099
echo ""
91-
echo " cd create-chain && make generate-contract-abis"
100+
echo " cd synd-cli && make generate-contract-abis"
92101
echo ""
93102
echo "Then commit the updated files."
94103
echo ""
95104
echo "Files that differ:"
96-
git diff --name-only create-chain/src/abi/synd/
105+
git diff --name-only synd-cli/src/abi/synd/
97106
exit 1
98107
)
99108
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Publish synd-cli Binaries
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
tag_name:
9+
description: Release tag version (e.g., v1.2.3, v0.10.15-dev.1)
10+
required: true
11+
type: string
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
build:
18+
name: Build synd-cli executables
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Setup Bun
24+
uses: oven-sh/setup-bun@v2
25+
with:
26+
bun-version: latest
27+
28+
- name: Install dependencies
29+
run: |
30+
cd synd-cli
31+
bun install --frozen-lockfile
32+
33+
- name: Build Linux x64
34+
run: |
35+
cd synd-cli
36+
bun build --compile --minify --sourcemap --bytecode \
37+
--target=bun-linux-x64 \
38+
./src/cli/index.ts \
39+
--outfile synd-cli-linux-x64
40+
41+
- name: Build Linux ARM64
42+
run: |
43+
cd synd-cli
44+
bun build --compile --minify --sourcemap --bytecode \
45+
--target=bun-linux-arm64 \
46+
./src/cli/index.ts \
47+
--outfile synd-cli-linux-arm64
48+
49+
- name: Build macOS x64
50+
run: |
51+
cd synd-cli
52+
bun build --compile --minify --sourcemap --bytecode \
53+
--target=bun-darwin-x64 \
54+
./src/cli/index.ts \
55+
--outfile synd-cli-darwin-x64
56+
57+
- name: Build macOS ARM64
58+
run: |
59+
cd synd-cli
60+
bun build --compile --minify --sourcemap --bytecode \
61+
--target=bun-darwin-arm64 \
62+
./src/cli/index.ts \
63+
--outfile synd-cli-darwin-arm64
64+
65+
- name: Upload build artifacts
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: synd-cli-binaries
69+
path: |
70+
synd-cli/synd-cli-linux-x64
71+
synd-cli/synd-cli-linux-arm64
72+
synd-cli/synd-cli-darwin-x64
73+
synd-cli/synd-cli-darwin-arm64
74+
retention-days: 1
75+
76+
publish-release:
77+
name: Attach binaries to GitHub release
78+
permissions:
79+
contents: write
80+
needs: build
81+
runs-on: ubuntu-latest
82+
env:
83+
TAG_NAME: ${{ github.event.release.tag_name || inputs.tag_name }}
84+
steps:
85+
- name: Download build artifacts
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: synd-cli-binaries
89+
90+
- name: Rename artifacts with version
91+
run: |
92+
mv synd-cli/synd-cli-linux-x64 synd-cli-linux-x64-${{ env.TAG_NAME }}
93+
mv synd-cli/synd-cli-linux-arm64 synd-cli-linux-arm64-${{ env.TAG_NAME }}
94+
mv synd-cli/synd-cli-darwin-x64 synd-cli-darwin-x64-${{ env.TAG_NAME }}
95+
mv synd-cli/synd-cli-darwin-arm64 synd-cli-darwin-arm64-${{ env.TAG_NAME }}
96+
97+
- name: Attach binaries to release
98+
uses: softprops/action-gh-release@v1
99+
with:
100+
tag_name: ${{ env.TAG_NAME }}
101+
files: |
102+
synd-cli-linux-x64-${{ env.TAG_NAME }}
103+
synd-cli-linux-arm64-${{ env.TAG_NAME }}
104+
synd-cli-darwin-x64-${{ env.TAG_NAME }}
105+
synd-cli-darwin-arm64-${{ env.TAG_NAME }}
106+
107+
notify-failure:
108+
name: Notify on failure
109+
permissions: {}
110+
if: always() && (needs.build.result == 'failure' || needs.publish-release.result == 'failure')
111+
needs: [build, publish-release]
112+
runs-on: ubuntu-latest
113+
steps:
114+
- name: Notify Slack on Failure
115+
uses: rtCamp/action-slack-notify@v2
116+
with:
117+
status: failure
118+
webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
119+
color: danger
120+
message: ":x: `${{github.workflow}}` failed. View failure information here: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow>"
121+
title: "*${{github.workflow}}* failed"

.github/workflows/create-chain-typecheck.yaml renamed to .github/workflows/synd-cli.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Typecheck create-chain
1+
name: Typecheck synd-cli
22
permissions:
33
contents: read
44

@@ -16,11 +16,11 @@ concurrency:
1616
jobs:
1717
typecheck:
1818
if: github.event.pull_request.draft == false
19-
name: create-chain Typecheck
19+
name: synd-cli Typecheck
2020
runs-on: ubuntu-latest
2121
defaults:
2222
run:
23-
working-directory: "create-chain"
23+
working-directory: "synd-cli"
2424
steps:
2525
- uses: actions/checkout@v4
2626

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ run.sh
8787

8888
.ignore
8989

90-
create-chain/*.config.json
91-
!create-chain/*.config.json.example
92-
create-chain/node_modules
93-
create-chain/*.tsbuildinfo
90+
synd-cli/options/*
91+
!synd-cli/options/examples
92+
synd-cli/node_modules
93+
synd-cli/*.tsbuildinfo
94+
synd-cli/src/dev
95+
synd-cli/appchains

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,10 @@ repos:
6565
language: system
6666
types: [cargo]
6767
pass_filenames: false
68+
- id: synd-cli-biome-check
69+
name: synd-cli check
70+
entry: bash -c 'cd synd-cli && npx biome check --write --files-ignore-unknown=true --no-errors-on-unmatched'
71+
language: system
72+
types: [text]
73+
files: "^synd-cli/.*\\.(jsx?|tsx?|c(js|ts)|m(js|ts)|d\\.(ts|cts|mts)|jsonc?|css|svelte|vue|astro|graphql|gql)$"
74+
pass_filenames: false

create-chain/README.md

Lines changed: 0 additions & 109 deletions
This file was deleted.

create-chain/e2e.config.json.example

Lines changed: 0 additions & 7 deletions
This file was deleted.

create-chain/foundation.config.json.example

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)