Skip to content

Commit 301ea78

Browse files
authored
Merge pull request #403 from casper-ecosystem/feat-3.0-scratch
Feat 3.0 scratch
2 parents e74c611 + ef9c656 commit 301ea78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+10527
-12191
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

.eslintrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ module.exports = {
1717
// If you don't want to extend any rules, you don't need an `extends` attribute.
1818
extends: ['plugin:@typescript-eslint/recommended'],
1919
parserOptions: {
20-
project: ['./tsconfig.json'] // Specify it only for TypeScript files
20+
tsconfigRootDir: __dirname,
21+
project: ['./tsconfig.eslint.json']
2122
},
2223
rules: {
2324
'@typescript-eslint/ban-ts-comment': 'off',

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.yarn/releases/** binary
2+
/.yarn/plugins/** binary

.github/workflows/ci-casper-client-sdk.yml

+28-10
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
28-
node-version: [16.x, 18.x]
29-
os: [ubuntu-20.04, ubuntu-22.04]
28+
node-version: [18.x]
29+
os: [ubuntu-22.04]
3030
runs-on: ${{ matrix.os }}
3131
env:
3232
FAUCET_PRIV_KEY: 'MC4CAQAwBQYDK2VwBCIEII8ULlk1CJ12ZQ+bScjBt/IxMAZNggClWqK56D1/7CbI' #ci/test-assets/secret-key.pem
@@ -47,52 +47,70 @@ jobs:
4747
uses: actions/setup-node@5b949b50c3461bbcd5a540b150c368278160234a #v3.4.0
4848
with:
4949
node-version: ${{ matrix.node-version }}
50-
cache: 'npm'
50+
cache: 'yarn'
51+
52+
# https://github.com/dtinth/setup-github-actions-caching-for-turbo
53+
- name: Setup Turbo cache server
54+
uses: dtinth/setup-github-actions-caching-for-turbo@e26dc6b0473cc072107f6cb4f6e69d33ac2fc386 # v1.1.0
5155

5256
- name: Install
53-
run: npm install
57+
run: yarn install
5458

5559
- name: Audits
56-
run: npm audit --omit=dev
60+
run: yarn npm audit --environment production
5761

5862
- name: Lints
59-
run: npm run lint:ci
63+
run: yarn lint:ci
6064

6165
- name: Unit Test
62-
run: npm run test:unit
66+
run: yarn test
67+
68+
- name: Generate coverage report
69+
run: yarn test:coverage
70+
71+
- name: Upload coverage reports to Codecov
72+
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
73+
env:
74+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6375

6476
- name: Test docs build
65-
run: npm run docs:build
77+
run: yarn docs:build
6678

6779
- name: Test build
68-
run: npm run build
80+
run: yarn build
6981

7082
# test mainnet
7183
- name: Get the mainnet version
84+
if: ${{ false }}
7285
id: get-mainnet-version
7386
run: echo "MAINNET_VERSION=$(curl -s -X POST --data-raw '${{ env.VERSION_QUERY }}' -H "Content-Type:application/json" ${{ env.MAINNET_NODE_URL }} | jq -r .result.build_version | cut -d "-" -f 1)" >> "$GITHUB_ENV"
7487

7588
- name: Test RPC - mainnet ${{ env.MAINNET_VERSION }}
89+
if: ${{ false }}
7690
run: npx casper-node-launcher-js node v${{ env.MAINNET_VERSION }} --daemon && npm run test:e2e && npx casper-node-launcher-js stop
7791

7892
# test testnet
7993
- name: Get the testnet version
94+
if: ${{ false }}
8095
id: get-testnet-version
8196
run: echo "TESTNET_VERSION=$(curl -s -X POST --data-raw '${{ env.VERSION_QUERY }}' -H "Content-Type:application/json" ${{ env.TESTNET_NODE_URL }} | jq -r .result.build_version | cut -d "-" -f 1)" >> "$GITHUB_ENV"
8297

8398
- name: Test RPC - testnet ${{ env.TESTNET_VERSION }}
99+
if: ${{ false }}
84100
run: npx casper-node-launcher-js node v${{ env.TESTNET_VERSION }} --daemon && npm run test:e2e && npx casper-node-launcher-js stop
85101

86102
- name: Get Latest Casper-Node Tag Version
103+
if: ${{ false }}
87104
run: |
88105
echo "CASPER_TAG_VERSION=$(curl -s ${{ env.GH_API_URL }} | jq -r '.[].name' | grep 'v*' | sort -V | sed 's/_$//' | tail -n1)" >> $GITHUB_ENV
89106
env:
90107
GH_API_URL: 'https://api.github.com/repos/casper-network/casper-node/tags'
91108

92109
- name: Test RPC - Casper Node - ${{ env.CASPER_TAG_VERSION }}
93110
# Runs action if the latest version is different from mainnet and testnet
94-
if: ${{ env.CASPER_TAG_VERSION }} != v${{ env.MAINNET_VERSION }} && ${{ env.CASPER_TAG_VERSION }} != v${{ env.TESTNET_VERSION }}
111+
if: ${{ false }} # && ${{ env.CASPER_TAG_VERSION }} != v${{ env.MAINNET_VERSION }} && ${{ env.CASPER_TAG_VERSION }} != v${{ env.TESTNET_VERSION }}
95112
run: npx casper-node-launcher-js node ${{ env.CASPER_TAG_VERSION }} --daemon && npm run test:e2e && npx casper-node-launcher-js stop
96113

97114
- name: Test RPC - Casper Node - DEV
115+
if: ${{ false }}
98116
run: npx casper-node-launcher-js node dev --daemon && npm run test:e2e && npx casper-node-launcher-js stop

.gitignore

+13-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@ node_modules
22

33
# Output
44
/docs/
5-
/dist/
5+
dist/
6+
.turbo
67

78
.eslintcache
89
.nyc_output
10+
coverage
911

1012
.DS_Store
1113

12-
.env
14+
.env
15+
16+
# Yarn
17+
.pnp.*
18+
.yarn/*
19+
!.yarn/patches
20+
!.yarn/plugins
21+
!.yarn/releases
22+
!.yarn/sdks
23+
!.yarn/versions

.yarn/releases/yarn-4.0.1.cjs

+893
Large diffs are not rendered by default.

.yarnrc.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
compressionLevel: mixed
2+
3+
enableGlobalCache: false
4+
5+
nodeLinker: node-modules
6+
7+
yarnPath: .yarn/releases/yarn-4.0.1.cjs

codecov.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 80%
6+
threshold: 1%
7+
patch:
8+
default:
9+
target: auto
10+
threshold: 5%
11+
12+
component_management:
13+
default_rules: # default rules that will be inherited by all components
14+
statuses:
15+
- type: project
16+
target: 80%
17+
- type: patch
18+
target: 80%
19+
20+
individual_components:
21+
- component_id: '@casper-js-sdk/types'
22+
paths:
23+
- /packages/types/src/
24+
- component_id: '@casper-js-sdk/keys'
25+
paths:
26+
- /packages/keys/src/
27+
28+
comment:
29+
layout: 'header, diff, flags, components'
30+
behavior: 'default'
31+
require_changes: false
32+
require_base: no
33+
require_head: no

karma.conf.js

-31
This file was deleted.

0 commit comments

Comments
 (0)