Skip to content

Commit

Permalink
chore(sdk): basic vite setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sammccord committed Jun 11, 2024
1 parent ec1118d commit 843068e
Show file tree
Hide file tree
Showing 18 changed files with 387 additions and 70 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @rabbitholegg/protocol-sdk
65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Bug Report
description: File a bug/issue
title: 'bug: <title>'
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! The more info you provide, the more we can help you. If you are a [Sponsor](https://github.com/sponsors/wagmi-dev?metadata_campaign=gh_issue), your issues are prioritized.
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true

- type: input
attributes:
label: Package Version
description: What version of questdk are you using?
placeholder: 0.1.0
validations:
required: true

- type: textarea
attributes:
label: Current Behavior
description: A concise description of what you're experiencing.
validations:
required: false

- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: false

- type: textarea
attributes:
label: Steps To Reproduce
description: Steps or code snippets to reproduce the behavior.
validations:
required: false

- type: input
attributes:
label: Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
description: |
Please provide a link via [rabbithole.gg](https://rabbithole.gg/) or a link to a minimal repository that can reproduce the problem you ran into.
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 :)
placeholder: https://rabbithole.gg/
validations:
required: false

- type: textarea
attributes:
label: Anything else?
description: |
Browser info? Screenshots? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Ask Question
url: https://github.com/rabbitholegg/questdk/discussions/new?category=q-a
about: Ask questions and discuss with other community members
- name: Request Feature
url: https://github.com/rabbitholegg/questdk/discussions/new?category=ideas
about: Requests features or brainstorm ideas for new functionality
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- bug
- not stale
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
41 changes: 41 additions & 0 deletions .github/workflows/forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run Forge Tests
on:
workflow_call:
workflow_dispatch:

env:
FOUNDRY_PROFILE: ci

jobs:
check:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3]
total-shards: [3]
fail-fast: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
working-directory: ./packages/evm
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
working-directory: ./packages/evm
env:
TEST_SIGNER_PRIVATE_KEY: ${{ secrets.TEST_SIGNER_PRIVATE_KEY }}
run: |
forge test -vvv
id: test
18 changes: 18 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Pull request
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
verify:
name: Verify
uses: ./.github/workflows/verify.yml
secrets: inherit
forge:
name: Forge
uses: ./.github/workflows/forge.yml
secrets: inherit
107 changes: 107 additions & 0 deletions .github/workflows/on-push-to-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Main
on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
name: Verify
uses: ./.github/workflows/verify.yml
secrets: inherit

changesets:
name: Changesets
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
scope: "@boostxyz"

- name: Install dependencies
uses: ./.github/actions/install-dependencies
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Version Pull Request
uses: changesets/action@v1
with:
version: pnpm changeset:version
commit: "chore: version package"
title: "chore: version package"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
name: Release
needs: verify
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Clone repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
scope: "@boostxyz"

- name: Install dependencies
uses: ./.github/actions/install-dependencies
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc

- name: Publish to NPM
uses: changesets/action@v1
with:
publish: pnpm publish-packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN }}

docs:
needs: check
name: Deploy Docs
runs-on: ubuntu-latest

permissions:
contents: write
pages: write
id-token: write

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Build Documentation (mdBook)
working-directory: ./packages/evm
run: forge doc --build

- name: Publish Documentation
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./packages/evm/docs/book
token: ${{ secrets.GITHUB_TOKEN }}
57 changes: 57 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Verify
on:
workflow_call:
workflow_dispatch:

jobs:
build:
name: Build
needs: lint
runs-on: ubuntu-latest
timeout-minutes: 15

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

- name: Install dependencies
uses: ./.github/actions/install-dependencies
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: pnpm build

# test:
# name: Test
# runs-on: ubuntu-latest
# strategy:
# matrix:
# shard: [1, 2, 3]
# total-shards: [3]
# transport-mode: ["http", "webSocket"]
# include:
# - batch-multicall: "false"
# - batch-multicall: "true"
# transport-mode: "http"

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

# - name: Install dependencies
# uses: ./.github/actions/install-dependencies
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Run tests
# uses: nick-fields/retry@v3
# with:
# timeout_minutes: 20
# max_attempts: 3
# command: pnpm test:ci -- --shard=${{ matrix.shard }}/${{ matrix.total-shards }}

# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v4.3.0
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
.turbo
dist
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint": "turbo lint",
"prepare": "lefthook install",
"postinstall": "git submodule update --init",
"format": "prettier --write \"**/*.{ts,tsx,md}\" && forge fmt packages/evm"
"format": "forge fmt packages/evm"
},
"devDependencies": {
"@biomejs/biome": "1.8.1",
Expand All @@ -22,6 +22,7 @@
"lefthook": "^1.6.15",
"prettier": "^3.2.5",
"turbo": "^2.0.0",
"typescript": "^5.3.3",
"vite": "^5.2.13"
},
"packageManager": "pnpm@8.15.8",
Expand Down
Loading

0 comments on commit 843068e

Please sign in to comment.