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

feat: switch to v4 #802

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 0 additions & 18 deletions .env

This file was deleted.

7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
AVAX_PUBLIC_URL="https://api.avax-test.network"

PRIVATE_KEY=...
C_CHAIN_ADDRESS=0x...
X_CHAIN_ADDRESS=X-fuji...
P_CHAIN_ADDRESS=P-fuji...
CORETH_ADDRESS=C-fuji...
6 changes: 1 addition & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
/**/*.js
/typings/*
/tests/*
/examples/*
/web/*
dist
34 changes: 34 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parser: '@typescript-eslint/parser',
settings: {},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
// TODO: Why does uncommenting this remove the type imports?
// project: ['./tsconfig.json'],
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'error',
// Uncomment prefer-readonly and parserOptions.project to apply the rule.
// TODO: Uncomment both permanently after fixing the type import issue.
// '@typescript-eslint/prefer-readonly': 'error',
},
};
16 changes: 0 additions & 16 deletions .eslintrc.js

This file was deleted.

9 changes: 6 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
version: 2
updates:
- package-ecosystem: "npm"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "weekly"
target-branch: "development"
interval: weekly
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
31 changes: 18 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
name: CI
name: PR checks

on:
push:
branches:
- master
pull_request:

env:
CI: true

jobs:
Test:
Lint-build-test:
name: Lint, build and test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile
- run: yarn test
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint:check
- name: Typecheck
run: yarn typecheck
- name: Test
run: yarn test
- name: Build
run: yarn build
27 changes: 13 additions & 14 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [development]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [development]
branches: [master]
schedule:
- cron: "39 22 * * 5"
- cron: '22 1 * * 6'

jobs:
analyze:
Expand All @@ -32,32 +32,31 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
queries: security-extended

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# https://git.io/JvXDl
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
Expand All @@ -68,4 +67,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
30 changes: 0 additions & 30 deletions .github/workflows/njsscan-analysis.yml

This file was deleted.

19 changes: 8 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Push to release branch

name: Release
on:
push:
branches:
Expand All @@ -9,24 +8,22 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: Create .npmrc
run: echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' >> .npmrc
node-version: 20.x
- name: Install dependencies
run: yarn install
run: yarn
- name: Build library
run: yarn build
run: yarn build:prod
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BRANCH: release
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: yarn run semantic-release
Loading
Loading