Skip to content

Commit

Permalink
Merge 1a42663 into b67a983
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjei authored Apr 20, 2023
2 parents b67a983 + 1a42663 commit 3f0b269
Show file tree
Hide file tree
Showing 201 changed files with 43,900 additions and 3,754 deletions.
2 changes: 1 addition & 1 deletion .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
"extends": ["@commitlint/config-conventional"]
}
8 changes: 6 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#root = true
root = true

[*]
indent_style = space
Expand All @@ -7,7 +7,11 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
indent_size = 2
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
continuation_indent_size = 2
6 changes: 5 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ yarn-debug.log*
yarn-error.log*

# build
dist/
dist/
build/

# gen types
*.d.ts
82 changes: 28 additions & 54 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,30 @@
{
"root": true,
"env": {
"es6": true
},
"extends": [
"airbnb",
"airbnb/hooks",
"airbnb-typescript",
"plugin:jest/recommended",
"plugin:jest/style",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./tsconfig.json", "./cli/**/tsconfig.json"]
},
"plugins": ["@typescript-eslint", "jest"],
"rules": {
"no-console": [
"warn",
{
"allow": ["info", "warn", "error"]
}
],
"no-restricted-syntax": "off",
"no-underscore-dangle": "off",
"no-param-reassign": "off",
"no-await-in-loop": "off",
"import/no-cycle": "off",
"import/extensions": "off",
"no-bitwise": "off",
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "warn",
"class-methods-use-this": "warn",
"import/no-extraneous-dependencies": "off",
"import/no-relative-packages": "off",
"@typescript-eslint/no-loop-func": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/lines-between-class-members": "off",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "PascalCase", "UPPER_CASE", "snake_case"],
"leadingUnderscore": "allow"
}
]
}
"root": true,
"env": {
"es6": true
},
"extends": ["airbnb-base", "airbnb-typescript/base", "plugin:jest/recommended", "plugin:jest/style", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./tsconfig.json", "./packages/*/tsconfig.json"]
},
"plugins": ["@typescript-eslint", "jest"],
"rules": {
"no-underscore-dangle": "off",
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "warn",
"consistent-return": "warn",
"no-bitwise": "off",
"no-await-in-loop": "off",
"no-restricted-syntax": "off",
"no-console": ["warn", { "allow": ["info", "warn", "error", "log"] }],
"@typescript-eslint/lines-between-class-members": "off",
"no-plusplus": "off",
"@typescript-eslint/no-unused-expressions": "warn",
"no-param-reassign": "off",
"jest/expect-expect": "off",
"no-promise-executor-return": "warn"
}
}
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Bug report
about: Report a bug in p0tion

---

# Prerequisites

Please answer the following questions for yourself before submitting an issue.

- [ ] I am running the latest version
- [ ] I checked the documentation and found no answer
- [ ] I checked to make sure that this issue has not already been filed

# Expected Behavior

Please describe the behavior you are expecting

# Current Behavior

What is the current behavior?

# Failure Information

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

## Steps to Reproduce

Please provide detailed steps for reproducing the issue.

1. step 1
2. step 2
3. you get it...

## Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

* Firmware Version:
* Operating System:
* SDK version:
* Toolchain version:

## Failure Logs

Please include any relevant log snippets or files here.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature request
about: Suggest an idea for p0tion

---

# Prerequisites

Please answer the following question for yourself before submitting a feature request.

- [ ] I checked to make sure that this request has not already been filed

# Motivation

Is your feature request related to a specific problem? Is it just a crazy idea? Tell us about it!

# Details

Please describe your feature request in detail.

Make sure that you have reviewed [p0tion's Contributor Guidelines](https://github.com/quadratic-funding/mpc-phase2-suite/blob/dev/CONTRIBUTING.md)
28 changes: 28 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Pull Request
about: Open a PR for p0tion

---

# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

- [ ] Test A
- [ ] Test B

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] I reviewed the [code of conduct](https://github.com/quadratic-funding/mpc-phase2-suite/blob/dev/CODE_OF_CONDUCT.md) and [contributors' guide](https://github.com/quadratic-funding/mpc-phase2-suite/blob/dev/CONTRIBUTING.md)
25 changes: 25 additions & 0 deletions .github/workflows/auto-reject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Automatically close pull requests created from a forked repository
# if the target branch is either "dev" or "main".
name: Validate PR

on:
pull_request_target:

jobs:
validate-pr:
runs-on: ubuntu-22.04

steps:
- name: Check target branch
run: |
if [ ${{ github.event.pull_request.head.repo.fork }} == true ] &&
[ ${{ github.base_ref }} == 'dev' ] ||
[ ${{ github.base_ref }} == 'main' ]; then
echo -e "Hello and thank you for considering contributing to our project! Please note that we do not allow pull requests directly from forks to the dev or main branches of the upstream repository.\n\nIf you would like to contribute changes that target those branches, please create a new branch with a different name in your forked repository and submit a pull request from there. This will help us keep our branches organized and maintain a clean history of contributions.\n\nIf you have any questions or need assistance with this process, please don't hesitate to reach out to us. We appreciate your contributions and look forward to working with you!" > comment
export comment=$(cat comment)
gh pr close ${{ github.event.pull_request.number }} --comment "$comment" --repo ${{ github.repository }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 0 additions & 22 deletions .github/workflows/deploy.yaml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
tags: ["*"]

jobs:
draft-release:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Draft Release
run: |
gh release create ${GITHUB_REF##*/} --title "${GITHUB_REF##*/}" --draft --generate-notes --prerelease
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"

- name: Initialize Project
run: |
yarn install --immutable
yarn add --dev lerna
yarn build
env:
NODE_OPTIONS: "--max_old_space_size=4096"

- name: Publish NPM
run: |
# Workaround to not include changes by adding lerna
git reset --hard HEAD
npx lerna publish from-git --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Loading

0 comments on commit 3f0b269

Please sign in to comment.