Skip to content

Commit

Permalink
Merge pull request #38 from api3dao/phase21
Browse files Browse the repository at this point in the history
Merge phase 2.1 to main
  • Loading branch information
bbenligiray authored Mar 23, 2024
2 parents 21fffbe + c65cf03 commit 5cef3f2
Show file tree
Hide file tree
Showing 320 changed files with 119,706 additions and 5,609 deletions.
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
25 changes: 14 additions & 11 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
node_modules
dist
.env
coverage
coverage.json
typechain
typechain-types
dist

# Hardhat files
cache
artifacts
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json

gas_report

# Contract directories after prepack
/v0.6
/v0.7
/v0.8
contracts/vendor
25 changes: 17 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
module.exports = {
env: {
es6: true,
mocha: true,
node: true,
},
extends: ['./node_modules/@api3/commons/dist/eslint/universal'],
parserOptions: {
ecmaVersion: 11,
sourceType: 'module',
project: ['./tsconfig.json'],
},
rules: {
camelcase: 'off',

'functional/no-try-statements': 'off',

'lodash/prefer-constant': 'off',

'unicorn/filename-case': 'off',
'unicorn/prefer-export-from': 'off',
'unicorn/prefer-object-from-entries': 'off',
'unicorn/prefer-ternary': 'off',

'@typescript-eslint/max-params': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
},
extends: 'eslint:recommended',
};
39 changes: 39 additions & 0 deletions .github/workflows/continuous-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Continuous build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Clone @api3/contracts
uses: actions/checkout@v4

- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'

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

- name: Build
run: pnpm build

- name: Lint
run: pnpm lint

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

on:
push:
branches:
- production

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Ensure main is present for the commit message preparation
run: |
git checkout main
git checkout production
- name: Prepare for the commit message
run: |
echo "NEW_VERSION=$(pnpm changeset status --output=release.json > /dev/null && jq -r '.releases[0].newVersion' release.json && rm release.json)" >> "$GITHUB_ENV"
- name: Publish
id: changesets
uses: changesets/action@v1
with:
version: pnpm changeset:version
publish: pnpm changeset publish
title: 'Release v${{ env.NEW_VERSION }}'
commit: 'Release v${{ env.NEW_VERSION }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create PR to merge production to main
if: steps.changesets.outputs.published == 'true'
run: gh pr create -B main -H production --title 'Merge production to main' --reviewer bbenligiray
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 12 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
node_modules
dist
.env
coverage
coverage.json
typechain
typechain-types
dist

# Hardhat files
cache
artifacts
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json

# Contract directories after prepack
/v0.6
/v0.7
/v0.8
gas_report
25 changes: 14 additions & 11 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
node_modules
dist
.env
coverage
coverage.json
typechain
typechain-types
dist

# Hardhat files
cache
artifacts
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json

gas_report

# Contract directories after prepack
/v0.6
/v0.7
/v0.8
contracts/vendor
9 changes: 8 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ module.exports = {
singleQuote: true,
trailingComma: 'es5',
useTabs: false,
plugins: ['prettier-plugin-solidity'],
overrides: [
{
files: '*.md',
options: {
parser: 'markdown',
},
},
{
files: '*.sol',
options: {
compiler: '0.8.17',
parser: 'solidity-parse',
printWidth: 80,
tabWidth: 4,
useTabs: false,
Expand Down
3 changes: 3 additions & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
skipFiles: ['mock', 'test', 'vendor'],
};
7 changes: 6 additions & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"rules": {
"compiler-version": "off",
"func-visibility": ["warn", { "ignoreConstructors": true }],
"no-global-import": "off"
"not-rely-on-time": "off",
"no-empty-blocks": "off",
"no-global-import": "off",
"func-name-mixedcase": "off",
"immutable-vars-naming": "off",
"gas-custom-errors": "off"
}
}
19 changes: 19 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
node_modules
.env
dist

# Hardhat files
/cache
/artifacts

# TypeChain files
/typechain
/typechain-types

# solidity-coverage files
/coverage
/coverage.json

gas_report

contracts/vendor
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 API3 Foundation

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 5cef3f2

Please sign in to comment.