Skip to content

Commit

Permalink
feat: SDK without contracts
Browse files Browse the repository at this point in the history
This squashes the history of the repo into a single commit so it can be
exported as a patch to a new repo.
  • Loading branch information
cpb8010 committed Nov 27, 2024
1 parent 4411671 commit 155697d
Show file tree
Hide file tree
Showing 450 changed files with 52,957 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = double

[*.md]
trim_trailing_whitespace = false
max_line_length = 80
indent_size = 2
26 changes: 26 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"targets": {
"zksync-auth-server-staging": {
"hosting": {
"zksync-auth-server-staging": [
"zksync-auth-server-staging"
]
}
},
"stake-demo-app": {
"hosting": {
"stake-demo-app": [
"stake-demo-app"
]
}
},
"nft-quest-testnet": {
"hosting": {
"nft-quest-testnet": [
"nft-quest-testnet"
]
}
}
},
"etags": {}
}
60 changes: 60 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Bug report
description: File a bug report to help us improve
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! Please fill out as much as you can, the more details the better we can help to resolve the issue.
- type: dropdown
id: project
attributes:
label: 🧰 Project
description: Which project is this bug related to?
options:
- Contracts
- Auth Server
- SDK
- Examples
default: 0
validations:
required: true
- type: textarea
id: description
attributes:
label: 📝 Description
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: steps
attributes:
label: 🔄 Reproduction steps
description: Steps to reproduce the behavior.
- type: textarea
id: expected
attributes:
label: 🤔 Expected behavior
description: What did you expect to happen.
- type: textarea
id: actual
attributes:
label: 😯 Actual behavior
description: What actually happened.
- type: textarea
id: environment
attributes:
label: 🖥 Environment
description: Please provide relevant details about the environment you experienced the bug in.
- type: textarea
id: additional
attributes:
label: 📋 Additional context
description: Add any other context about the problem here. If applicable, add screenshots to help explain.
- type: textarea
id: logs
attributes:
label: 📎 Logs
description: If applicable, add logs to help explain the problem.
render: shell
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Feature request
description: Suggest an idea for this project
title: "[Request]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request! Please fill out as much as you can, the more details the better we can help to implement the feature.
- type: textarea
id: description
attributes:
label: 📝 Description
description: A clear and concise description of what the feature is.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: 🤔 Rationale
description: Why do you think this feature is important and how will it benefit the project?
- type: textarea
id: additional
attributes:
label: 📋 Additional context
description: Add any other context or information about the feature request here.
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Description



## Additional context
147 changes: 147 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: CI

on:
pull_request:
workflow_dispatch:

jobs:
e2e-demo-app:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

# Start node
- name: Era Test Node Action
uses: dutterbutter/era-test-node-action@36ffd2eefd46dc16e7e2a8e1715124400ec0a3ba # v1

# Setup pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Use Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: lts/Iron
cache: 'pnpm'

# Install dependencies for repo
- name: Install dependencies
run: pnpm install -r --frozen-lockfile

# Build SDK
- name: Build SDK
run: pnpm nx build sdk

# Deploy contracts
- name: Deploy contracts
run: pnpm nx deploy contracts

# Run E2E tests
- name: Install Playwright Chromium Browser
run: pnpm exec playwright install chromium
working-directory: examples/demo-app
- name: Run e2e tests
run: pnpm nx e2e demo-app
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: demo-app-playwright-report
path: examples/demo-app/playwright-report/
retention-days: 3


e2e-nft-quest:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

# Start node
- name: Era Test Node Action
uses: dutterbutter/era-test-node-action@36ffd2eefd46dc16e7e2a8e1715124400ec0a3ba # v1

# Setup pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Use Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: lts/Iron
cache: 'pnpm'

# Install dependencies for repo
- name: Install dependencies
run: pnpm install -r --frozen-lockfile

# Build SDK
- name: Build SDK
run: pnpm nx build sdk

# Deploy contracts
- name: Deploy contracts
run: pnpm nx deploy contracts

# Deploy nft-quest-contracts
- name: Deploy NFT contracts
run: pnpm nx deploy:local nft-quest-contracts

# Run E2E tests
- name: Install Playwright Chromium Browser
run: pnpm exec playwright install chromium
working-directory: examples/nft-quest
- name: Run e2e tests
run: pnpm nx e2e nft-quest
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: nft-quest-playwright-report
path: examples/nft-quest/playwright-report/
retention-days: 3


contracts:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

# Start node
- name: Era Test Node Action
uses: dutterbutter/era-test-node-action@36ffd2eefd46dc16e7e2a8e1715124400ec0a3ba # v1

# Setup pnpm
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Use Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: lts/Iron
cache: 'pnpm'

# Install dependencies for repo
- name: Install dependencies
run: pnpm install -r --frozen-lockfile

# Build contracts and generate types
- name: Build contracts
run: pnpm nx build contracts

# Run contract tests
- name: Run contract test
run: pnpm nx test contracts

46 changes: 46 additions & 0 deletions .github/workflows/deploy-auth-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Deploy Auth Server Testnet"
on:
push:
branches: [ "main" ]
paths:
- "packages/auth-server/**"
- "packages/sdk/**"
workflow_dispatch:

env:
HUSKY: 0
CI: true

jobs:
build_and_preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/Iron
cache: 'pnpm'

- name: Install dependencies
run: pnpm install -r --frozen-lockfile

- name: Build apps
env:
NUXT_PUBLIC_DEFAULT_CHAIN_ID: 300
run: pnpm nx build auth-server

- name: Deploy firebase hosting
uses: matter-labs/action-hosting-deploy@main
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_AUTH_SERVER_STAGING }}"
projectId: zksync-auth-server-staging
target: zksync-auth-server-staging
channelId: live
44 changes: 44 additions & 0 deletions .github/workflows/deploy-nft-quest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Deploy NFT Quest Testnet"
on:
push:
branches: [ "main" ]
paths:
- "examples/nft-quest/**"
- "packages/sdk/**"
workflow_dispatch:

env:
HUSKY: 0
CI: true

jobs:
build_and_preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.11.0

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/Iron
cache: 'pnpm'

- name: Install dependencies
run: pnpm install -r --frozen-lockfile

- name: Build apps
run: pnpm nx build nft-quest

- name: Deploy firebase hosting
uses: matter-labs/action-hosting-deploy@main
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: "${{ secrets.FIREBASE_NFT_QUEST_TESTNET }}"
projectId: nft-quest-testnet
target: nft-quest-testnet
channelId: live
Loading

0 comments on commit 155697d

Please sign in to comment.