Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repository Initialization #1

Merged
merged 11 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const fs = require("node:fs")

Check warning on line 1 in .commitlintrc.js

View workflow job for this annotation

GitHub Actions / style

File ignored by default.
const path = require("node:path")

const packages = fs.readdirSync(path.resolve(__dirname, "packages"))
const apps = fs.readdirSync(path.resolve(__dirname, "apps"))

module.exports = {
extends: ["@commitlint/config-conventional"],
prompt: {
scopes: [...packages, ...apps],
markBreakingChangeMode: true,
allowCustomIssuePrefix: false,
allowEmptyIssuePrefix: false,
issuePrefixes: [
{
value: "re",
name: "re: ISSUES related"
}
]
}
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
indent_size = 4

[*.md]
trim_trailing_whitespace = false
37 changes: 37 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# dependencies
node_modules
package-lock.json
yarn.lock
.yarn

# testing
coverage
coverage.json

# hardhat
artifacts
cache
typechain-types

# foundry
cache_forge
out
docs

# production
dist
build
/docs

# Docusaurus cache and generated files
.docusaurus
.cache-loader

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
38 changes: 38 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"root": true,
"env": {
"es6": true
},
"extends": ["airbnb", "airbnb-typescript/base", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./tsconfig.json", "./packages/**/tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"rules": {
"react/require-default-props": "off",
"react/jsx-props-no-spreading": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [1, { "extensions": [".tsx"] }],
"import/prefer-default-export": "off",
"import/extensions": "off",
"no-underscore-dangle": "off",
"import/no-extraneous-dependencies": "off",
"no-bitwise": "off",
"no-await-in-loop": "off",
"no-restricted-syntax": "off",
"no-console": ["warn", { "allow": ["info", "warn", "error"] }],
"@typescript-eslint/lines-between-class-members": "off",
"no-param-reassign": "off"
},
"overrides": [
{
"files": ["./scripts/*"],
"rules": {
"no-console": "off"
}
}
]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sol linguist-language=Solidity
96 changes: 96 additions & 0 deletions .github/workflows/pull-requests.yml
0xjei marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: pull-requests

on:
pull_request:

jobs:
style:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: Install dependencies
run: yarn

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files_yaml: |
contracts:
- packages/contracts/**/*.{js,json,ts,sol}
docs:
- apps/docs/**/*
to_format:
- '**/*.{cjs,js,json,jsx,md,mdx,sol,ts,tsx,yaml,yml}'
to_lint:
- '**/*.{cjs,js,jsx,ts,tsx}'

- if: steps.changed-files.outputs.contracts_any_changed == 'true'
name: Compile and lint contracts
run: |
yarn compile:contracts
yarn workspace excubiae-contracts lint

- if: steps.changed-files.outputs.docs_any_changed == 'true'
name: Build and format docs
run: |
yarn workspace excubiae-docs build
yarn workspace excubiae-docs format

- if: steps.changed-files.outputs.libraries_any_changed == 'true'
0xjei marked this conversation as resolved.
Show resolved Hide resolved
name: Build packages
run: yarn build:packages

- if: steps.changed-files.outputs.to_format_any_changed == 'true'
name: Format
run: yarn run prettier --check --ignore-unknown --no-error-on-unmatched-pattern ${{ steps.changed-files.outputs.to_format_all_changed_files }}

- if: steps.changed-files.outputs.to_lint_any_changed == 'true'
name: Run Eslint
run: yarn run eslint ${{ steps.changed-files.outputs.to_lint_all_changed_files }} --ext .cjs,.js,.jsx,.ts,.tsx

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: Install dependencies
run: yarn

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files_yaml: |
contracts:
- packages/contracts/**/*.{js,json,ts,sol}
libraries:
- packages/**/*.{js,json,ts}
- '!packages/{circuits,contracts}/**/*'

- if: steps.changed-files.outputs.contracts_any_changed == 'true'
name: Build and Test contracts
run: |
yarn compile:contracts
yarn test:contracts
93 changes: 93 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# IDE
.vscode
.idea

# Testing
coverage
coverage.json
*.lcov

# Dependency directories
node_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm
.DS_Store

# Output of 'npm pack'
*.tgz

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# Production
build
dist
/docs

# Docusaurus cache and generated files
.docusaurus
.cache-loader

# Hardhat
artifacts
cache
typechain-types

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# asdf
.tool-versions

# direnv
.envrc
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 @@
npx lint-staged
3 changes: 3 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if [ "$NO_HOOK" != "1" ]; then
exec < /dev/tty && npx czg --hook || true
fi
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"**/*.{js,ts,jsx,tsx,md,json,sol,yaml,yml}": "prettier --write --no-error-on-unmatched-pattern",
"**/*.{js,ts,jsx,tsx}": "eslint"
}
43 changes: 43 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# dependencies
node_modules
package-lock.json
yarn.lock
.yarn

# testing
coverage
coverage.json

# hardhat
artifacts
cache
typechain-types

# foundry
cache_forge
out
docs

# production
dist
build
/docs

# github
.github/ISSUE_TEMPLATE

# Docusaurus cache and generated files
.docusaurus
.cache-loader

# mdx file
*.mdx

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"arrowParens": "always",
"trailingComma": "none",
"plugins": ["prettier-plugin-solidity"]
}
Loading
Loading