Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
repo-creatooor[bot] authored Sep 25, 2024
0 parents commit e4548cc
Show file tree
Hide file tree
Showing 60 changed files with 6,604 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
33 changes: 33 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
sourceType: "module",
},
plugins: ["@typescript-eslint/eslint-plugin"],
extends: ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: [".eslintrc.cjs"],
rules: {
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-member-access": "error",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "_+", ignoreRestSiblings: true },
],
"@typescript-eslint/prefer-as-const": "warn",
},
};
21 changes: 21 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Setup environment"
description: "Prepare repository and all dependencies"

runs:
using: "composite"
steps:
- name: Use pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Use Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Use foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 🤖 Linear

Closes lin-XXX

## Description


## Checklist before requesting a review

- [ ] I have conducted a self-review of my code.
- [ ] I have conducted a QA.
- [ ] If it is a core feature, I have included comprehensive tests.
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build

on:
workflow_call:

jobs:
build:
name: Run Build
runs-on: ubuntu-latest

steps:
- name: Check out github repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup environment
uses: ./.github/actions/setup

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

- name: Run Build
run: pnpm build

- name: Check types
run: pnpm check-types
35 changes: 35 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint

on:
workflow_call:

jobs:
commitlint:
name: Lint Commit Messages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
with:
commitDepth: 1

lint:
name: Run Linters
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup

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

- name: Run Prettier
run: pnpm format

- name: Run Linter
run: pnpm lint
28 changes: 28 additions & 0 deletions .github/workflows/main-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Main Workflow

on:
pull_request:
types: [opened, synchronize]
branches:
- dev
- main

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

jobs:
build:
uses: ./.github/workflows/build.yml

lint:
uses: ./.github/workflows/lint.yml
needs: build

test:
uses: ./.github/workflows/test.yml
needs: lint

test-integration:
uses: ./.github/workflows/test-integration.yml
needs: lint
23 changes: 23 additions & 0 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Tests

on:
workflow_call:

jobs:
unit:
name: Integration tests
runs-on: ubuntu-latest
steps:
- name: Check out github repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup environment
uses: ./.github/actions/setup

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

- name: Run integration tests
run: pnpm test:integration
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Tests

on:
workflow_call:

jobs:
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Check out github repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup environment
uses: ./.github/actions/setup

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

- name: Run tests with coverage
run: pnpm test:cov
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# See https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored for more about ignoring yarn files.
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

*.tsbuildinfo

# Dependencies
node_modules

# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Build Outputs
out/
build
dist
cache

# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Misc
.DS_Store
*.pem

coverage

# Turbo
.turbo

# Foundry
contracts/out
contracts/cache

# Temporary files
.tmp

# IDEA
.idea

# vscode
.vscode

# Coverage
lcov.info
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged && pnpm check-types
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
20 changes: 20 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"arrowParens": "always",
"printWidth": 100,
"singleQuote": false,
"semi": true,
"trailingComma": "all",
"tabWidth": 4,
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
"importOrder": [
"<TYPES>",
"<THIRD_PARTY_MODULES>",
"",
"<TYPES>^[.|..|~]",
"^~/",
"^[../]",
"^[./]"
],
"importOrderParserPlugins": ["typescript", "decorators-legacy"],
"importOrderTypeScriptVersion": "5.4.5"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Wonderland

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit e4548cc

Please sign in to comment.