Skip to content

Commit

Permalink
chore: nexus refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Sep 17, 2024
1 parent 808aa5d commit d4505f0
Show file tree
Hide file tree
Showing 182 changed files with 14,857 additions and 5,822 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
Expand Down
11 changes: 7 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
PRIVATE_KEY=
BUNDLER_URL=https://bundler.biconomy.io/api/v2/80001/nJPK7B3ru.dd7f7861-190d-41bd-af80-6877f74b8f44
PAYMASTER_URL=https://paymaster.biconomy.io/api/v1/80001/-2BFRwRlJ.8afbc010-edcf-46b3-8713-77639655f2dd
CHAIN_ID=80001
E2E_PRIVATE_KEY_ONE=
CHAIN_ID=84532
RPC_URL=
BUNDLER_URL=
BICONOMY_SDK_DEBUG=false
RUN_PLAYGROUND=false
PAYMASTER_URL=
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/2_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ body:
attributes:
label: Package Version
description: What version of the SDK are you using?
placeholder: 0.1.0
placeholder: 4.1.0
validations:
required: true

Expand Down Expand Up @@ -56,7 +56,7 @@ body:
attributes:
label: Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
description: |
This makes investigating issues and helping you out significantly easier! For most issues, you will likely get asked to provide one so why not add one now :)
[Please provide by forking this project](https://stackblitz.com/~/github.com/bcnmy/sdk-examples) and making relevant changes to the boilerplate. This makes investigating issues and helping you out significantly easier! For most issues, you will likely get asked to provide one so why not add one now :)
validations:
required: false

Expand All @@ -68,4 +68,4 @@ body:
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
required: false
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/4_security_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ labels: ["security", "triage needed"]
body:
- type: markdown
attributes:
value: "Security is our top priority. If you've discovered a potential security issue that is **critical or high** in nature and could affect our deployed contracts, **please do not report it here.** Instead, email us directly at [email protected] for a confidential review. For all other security-related inquiries that do not pose an immediate risk to our deployed contracts, please proceed."
value: "Security is our top priority. If you've discovered a potential security issue please proceed."
- type: checkboxes
attributes:
label: Security Level Acknowledgement
options:
- label: "I understand this issue will be public. It is NOT critical or high risk and does not endanger deployed contracts."
- label: "I understand this issue will be public. It is NOT critical or high risk and does not endanger deployed contracts. If it is please email: [email protected]"
required: true
- type: input
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/6_build_deployment_issue.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 🛠 Build & Deployment Issues
description: Report issues related to building or deploying smart contracts
description: Report issues
title: "[BUILD/DEPLOY] "
labels: ["bug", "help wanted"]
body:
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Pull Request for Smart Contract Improvement
## Pull Request for SDK Improvement

**Describe your changes:**

Expand Down
3 changes: 3 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ runs:
- name: Set up Bun
uses: oven-sh/setup-bun@v1

- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
shell: bash
run: bun install --frozen-lockfile
Expand Down
6 changes: 5 additions & 1 deletion .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ runs:
- name: Set up Bun
uses: oven-sh/setup-bun@v1

- name: Set up foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
shell: bash
run: bun install --frozen-lockfile
run: |
bun install --frozen-lockfile
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: build
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build
uses: ./.github/actions/build
uses: ./.github/actions/build
31 changes: 18 additions & 13 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
name: coverage
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
workflow_dispatch:
push:
branches:
- main
- develop
jobs:
coverage:
name: coverage
permissions: write-all
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4


- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Run the tests
run: bun run test:ci
run: bun run test --coverage
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
BUNDLER_URL: ${{ secrets.BUNDLER_URL }}
PAYMASTER_URL: ${{ secrets.PAYMASTER_URL }}
CHAIN_ID: ${{ secrets.CHAIN_ID }}
E2E_PRIVATE_KEY_ONE: ${{ secrets.E2E_PRIVATE_KEY_ONE }}
BUNDLER_URL: https://api.pimlico.io/v2/84532/rpc?apikey=pim_im13GpaqtMDSiJFhXMxcVn
CHAIN_ID: 84532
CI: true

- name: report coverage
uses: davelosert/vitest-coverage-report-action@v2
uses: davelosert/vitest-coverage-report-action@v2
with:
json-summary-path : ./coverage/coverage-summary.json
json-final-path: './coverage/coverage-final.json'
vite-config-path: ./tests/vitest.config.ts
json-summary-path: ./coverage/coverage-summary.json
json-final-path: "./coverage/coverage-final.json"
vite-config-path: ./test/vitest.config.ts
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
slug: bcnmy/sdk
slug: bcnmy/biconomy-client-sdk
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "gh-runner"

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Set remote url
run: git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/bcnmy/sdk.git
run: git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/bcnmy/biconomy-client-sdk.git

- name: Run the tests
run: bun run docs:deploy

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: playground
on:
workflow_dispatch:
jobs:
playground:
name: playground
permissions: write-all
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-playground
cancel-in-progress: true
steps:
- uses: actions/setup-node@v4
with:
node-version: 22

- uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Run the playground
run: bun run test -t=playground
env:
E2E_PRIVATE_KEY_ONE: ${{ secrets.E2E_PRIVATE_KEY_ONE }}
BUNDLER_URL: https://api.pimlico.io/v2/84532/rpc?apikey=pim_im13GpaqtMDSiJFhXMxcVn
CHAIN_ID: 84532
RUN_PLAYGROUND: true
CI: true
16 changes: 0 additions & 16 deletions .github/workflows/pr-lint.yml

This file was deleted.

16 changes: 13 additions & 3 deletions .github/workflows/size-report.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: size report
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

Expand All @@ -16,13 +17,22 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Set up Bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
uses: ./.github/actions/install-dependencies
shell: bash
run: |
bun install --frozen-lockfile
- name: Report bundle size
uses: andresz1/size-limit-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
package_manager: bun
package_manager: bun
30 changes: 30 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: unit-tests
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
unit-tests:
name: unit-tests
permissions: write-all
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-unit-tests
cancel-in-progress: true
steps:
- uses: actions/setup-node@v4
with:
node-version: 22

- uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Run the tests
run: bun run test
env:
E2E_PRIVATE_KEY_ONE: ${{ secrets.E2E_PRIVATE_KEY_ONE }}
BUNDLER_URL: https://api.pimlico.io/v2/84532/rpc?apikey=pim_im13GpaqtMDSiJFhXMxcVn
CHAIN_ID: 84532
CI: true
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ _.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

coverage
lib-cov

# Coverage directory used by tools like istanbul
Expand Down Expand Up @@ -175,4 +175,6 @@ dist
# Finder (MacOS) folder config
.DS_Store

docs
docs

sessionStorageData
24 changes: 11 additions & 13 deletions .size-limit.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,28 @@
{
"name": "core (esm)",
"path": "./dist/_esm/index.js",
"limit": "10 kB",
"import": "*"
"limit": "25 kB",
"import": "*",
"ignore": ["node:fs", "fs"]
},
{
"name": "core (cjs)",
"path": "./dist/_cjs/index.js",
"limit": "25 kB"
},
{
"name": "smartAccount (tree-shaking)",
"path": "./dist/_esm/index.js",
"limit": "5 kB",
"import": "{ signerToSmartAccount }"
"limit": "25 kB",
"ignore": ["node:fs", "fs"]
},
{
"name": "bundler (tree-shaking)",
"path": "./dist/_esm/bundler/index.js",
"limit": "5 kB",
"import": "{ createBundlerClient }"
"limit": "15 kB",
"import": "{ createBundler }",
"ignore": ["node:fs", "fs"]
},
{
"name": "paymaster (tree-shaking)",
"path": "./dist/_esm/paymaster/index.js",
"limit": "5 kB",
"import": "{ createPaymasterClient }"
"limit": "15 kB",
"import": "{ toPaymaster }",
"ignore": ["node:fs", "fs"]
}
]
Loading

0 comments on commit d4505f0

Please sign in to comment.