Skip to content

Commit e4548cc

Browse files
Initial commit
0 parents  commit e4548cc

Some content is hidden

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

60 files changed

+6604
-0
lines changed

.commitlintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.eslintrc.cjs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
module.exports = {
3+
parser: "@typescript-eslint/parser",
4+
parserOptions: {
5+
project: "tsconfig.json",
6+
tsconfigRootDir: __dirname,
7+
sourceType: "module",
8+
},
9+
plugins: ["@typescript-eslint/eslint-plugin"],
10+
extends: ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
11+
root: true,
12+
env: {
13+
node: true,
14+
jest: true,
15+
},
16+
ignorePatterns: [".eslintrc.cjs"],
17+
rules: {
18+
"@typescript-eslint/explicit-function-return-type": "error",
19+
"@typescript-eslint/explicit-module-boundary-types": "error",
20+
"@typescript-eslint/no-misused-promises": "error",
21+
"@typescript-eslint/no-floating-promises": "error",
22+
"@typescript-eslint/no-explicit-any": "error",
23+
"@typescript-eslint/no-unsafe-assignment": "warn",
24+
"@typescript-eslint/no-unsafe-argument": "warn",
25+
"@typescript-eslint/no-unsafe-member-access": "error",
26+
"@typescript-eslint/no-unsafe-return": "error",
27+
"@typescript-eslint/no-unused-vars": [
28+
"error",
29+
{ argsIgnorePattern: "_+", ignoreRestSiblings: true },
30+
],
31+
"@typescript-eslint/prefer-as-const": "warn",
32+
},
33+
};

.github/actions/setup/action.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Setup environment"
2+
description: "Prepare repository and all dependencies"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Use pnpm
8+
uses: pnpm/action-setup@v4
9+
with:
10+
run_install: false
11+
12+
- name: Use Node
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
cache: "pnpm"
17+
18+
- name: Use foundry
19+
uses: foundry-rs/foundry-toolchain@v1
20+
with:
21+
version: nightly

.github/pull_request_template.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 🤖 Linear
2+
3+
Closes lin-XXX
4+
5+
## Description
6+
7+
8+
## Checklist before requesting a review
9+
10+
- [ ] I have conducted a self-review of my code.
11+
- [ ] I have conducted a QA.
12+
- [ ] If it is a core feature, I have included comprehensive tests.

.github/workflows/build.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
name: Run Build
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check out github repository
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 1
16+
17+
- name: Setup environment
18+
uses: ./.github/actions/setup
19+
20+
- name: Install dependencies
21+
run: pnpm install --frozen-lockfile
22+
23+
- name: Run Build
24+
run: pnpm build
25+
26+
- name: Check types
27+
run: pnpm check-types

.github/workflows/lint.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Lint
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
commitlint:
8+
name: Lint Commit Messages
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
- uses: wagoid/commitlint-github-action@v5
15+
with:
16+
commitDepth: 1
17+
18+
lint:
19+
name: Run Linters
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Setup environment
26+
uses: ./.github/actions/setup
27+
28+
- name: Install dependencies
29+
run: pnpm install --frozen-lockfile
30+
31+
- name: Run Prettier
32+
run: pnpm format
33+
34+
- name: Run Linter
35+
run: pnpm lint

.github/workflows/main-workflow.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Main Workflow
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
branches:
7+
- dev
8+
- main
9+
10+
concurrency:
11+
group: ${{github.workflow}}-${{github.ref}}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/build.yml
17+
18+
lint:
19+
uses: ./.github/workflows/lint.yml
20+
needs: build
21+
22+
test:
23+
uses: ./.github/workflows/test.yml
24+
needs: lint
25+
26+
test-integration:
27+
uses: ./.github/workflows/test-integration.yml
28+
needs: lint
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
unit:
8+
name: Integration tests
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out github repository
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 1
15+
16+
- name: Setup environment
17+
uses: ./.github/actions/setup
18+
19+
- name: Install dependencies
20+
run: pnpm install --frozen-lockfile
21+
22+
- name: Run integration tests
23+
run: pnpm test:integration

.github/workflows/test.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
unit:
8+
name: Unit tests
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out github repository
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 1
15+
16+
- name: Setup environment
17+
uses: ./.github/actions/setup
18+
19+
- name: Install dependencies
20+
run: pnpm install --frozen-lockfile
21+
22+
- name: Run tests with coverage
23+
run: pnpm test:cov

.gitignore

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# See https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored for more about ignoring yarn files.
2+
.pnp.*
3+
.yarn/*
4+
!.yarn/patches
5+
!.yarn/plugins
6+
!.yarn/releases
7+
!.yarn/sdks
8+
!.yarn/versions
9+
10+
*.tsbuildinfo
11+
12+
# Dependencies
13+
node_modules
14+
15+
# Local env files
16+
.env
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
22+
# Build Outputs
23+
out/
24+
build
25+
dist
26+
cache
27+
28+
# Debug
29+
npm-debug.log*
30+
yarn-debug.log*
31+
yarn-error.log*
32+
33+
# Misc
34+
.DS_Store
35+
*.pem
36+
37+
coverage
38+
39+
# Turbo
40+
.turbo
41+
42+
# Foundry
43+
contracts/out
44+
contracts/cache
45+
46+
# Temporary files
47+
.tmp
48+
49+
# IDEA
50+
.idea
51+
52+
# vscode
53+
.vscode
54+
55+
# Coverage
56+
lcov.info

.husky/commit-msg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no-install commitlint --edit $1

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint-staged && pnpm check-types

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-exact=true

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20

.prettierrc

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"arrowParens": "always",
3+
"printWidth": 100,
4+
"singleQuote": false,
5+
"semi": true,
6+
"trailingComma": "all",
7+
"tabWidth": 4,
8+
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
9+
"importOrder": [
10+
"<TYPES>",
11+
"<THIRD_PARTY_MODULES>",
12+
"",
13+
"<TYPES>^[.|..|~]",
14+
"^~/",
15+
"^[../]",
16+
"^[./]"
17+
],
18+
"importOrderParserPlugins": ["typescript", "decorators-legacy"],
19+
"importOrderTypeScriptVersion": "5.4.5"
20+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Wonderland
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)