Skip to content

Commit

Permalink
Merge branch 'upgrade-biome' of github.com:immutable/ts-immutable-sdk…
Browse files Browse the repository at this point in the history
… into upgrade-biome
  • Loading branch information
glomotion committed Sep 26, 2024
2 parents 819e41e + 8fd8189 commit f5e6026
Show file tree
Hide file tree
Showing 169 changed files with 4,380 additions and 1,464 deletions.
9 changes: 0 additions & 9 deletions .github/actions/setup-tests/action.yaml

This file was deleted.

128 changes: 15 additions & 113 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,108 +21,28 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: setup
uses: ./.github/actions/setup

- name: Syncpack
run: yarn syncpack:check

detect:
name: Detect Node engine version change
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get Node engine version from package.json
id: get_package_json_node_engine_version
run: |
node_engine_major_version=$(jq -r '.engines.node' ./sdk/package.json | sed 's/^>=//' | cut -d. -f1)
echo "::set-output name=node_engine_major_version::$node_engine_major_version"
- name: Get Node.js version from .nvmrc
id: get_nvmrc_node_version
run: echo "::set-output name=nvmrc_node_version::$(head -n 1 .nvmrc | cut -d. -f1)"

- name: Check Node.js engine version change
run: |
package_version_major=$(echo "${{ steps.get_package_json_node_engine_version.outputs.node_engine_major_version }}")
nvmrc_version_major=$(echo "${{ steps.get_nvmrc_node_version.outputs.nvmrc_node_version }}")
if [ "$package_version_major" != "$nvmrc_version_major" ]; then
echo "Node.js engine version has changed"
exit 1
else
echo "Node.js engine version has not changed"
fi
build-sdk:
name: Build SDK
build-lint-test-typecheck-sdk:
name: Build, Lint, Test & Typecheck SDK
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Build
run: yarn nx affected --target=build --parallel=5

typecheck-sdk:
name: Typecheck SDK
runs-on: ubuntu-latest-4-cores
needs: build-sdk
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup

- name: Typecheck
run: yarn typecheck

test-sdk:
name: Test SDK
runs-on: ubuntu-latest-8-cores
needs: build-sdk
env:
NODE_OPTIONS: --max-old-space-size=14366
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup

- name: Test
run: yarn test --configuration=ci

- name: Upload SDK test coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverages
path: ./packages/**/coverage/*

lint-sdk:
name: Lint SDK
runs-on: ubuntu-latest-4-cores
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup

- name: Lint
run: yarn lint
- name: Build, Lint, Test & Typecheck
run: yarn nx affected -t build,lint,test,typecheck

build-lint-test-examples:
name: Build, Lint & Test Examples
Expand Down Expand Up @@ -152,11 +72,11 @@ jobs:
run: yarn test:examples


func-test-imx:
name: imx func tests
runs-on: ubuntu-latest-4-cores
needs: build-sdk
func-tests:
name: Functional tests
runs-on: ubuntu-latest-8-cores
env:
# imx envs
NETWORK: sepolia
TEST_ALCHEMY_API_KEY: ${{ secrets.TEST_ALCHEMY_API_KEY }}
PUBLIC_API_URL: "https://api.sandbox.x.immutable.com/v1"
Expand All @@ -170,26 +90,8 @@ jobs:
TEST_WALLET_BANKER_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_PRIVATE_KEY }}
TEST_WALLET_BANKER_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_STARK_PRIVATE_KEY }}
TEST_STARKEX_BATCH_SIZE: 500
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup

- name: Setup tests
uses: ./.github/actions/setup-tests

- name: test
run: yarn workspace @tests/func-tests-imx func-test:ci

func-test-zkevm:
name: zkevm func tests
runs-on: ubuntu-latest-8-cores
needs: build-sdk
env:
# zkevm envs
ZKEVM_ORDERBOOK_BANKER: ${{ secrets.ZKEVM_ORDERBOOK_BANKER }}
ZKEVM_ORDERBOOK_ERC721: "0xBE8B131f39825282Ace9eFf99C0Bb14972417b49"
ZKEVM_ORDERBOOK_ERC1155: "0x2efB9B7810B1d1520c0822aa20F1889ABd2c2146"
Expand All @@ -204,12 +106,12 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: setup
uses: ./.github/actions/setup

- name: Setup tests
uses: ./.github/actions/setup-tests
- name: Prepare tests
run: yarn prepare:tests

- name: test
run: yarn workspace @tests/func-tests-zkevm func-test:ci
- name: Run functional tests
run: FORCE_COLOR=1 yarn workspaces foreach -Apt --include='@tests/**' run func-test:ci
2 changes: 1 addition & 1 deletion build-dependents.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ try {

if (isDependent || changedProject === currentProject) {
// Rebuild the current project
const command = `nx run-many --target=d --projects=${currentProject} --parallel=5 --no-cloud`;
const command = `nx run-many --target=d --projects=${currentProject} --no-cloud`;

console.log(`Running command: ${command}`);
execSync(command, { stdio: 'inherit' });
Expand Down
2 changes: 1 addition & 1 deletion dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ fi

# Run nx commands with the selected or provided package name
echo "Running commands for package: $PACKAGE_NAME"
nx run $PACKAGE_NAME:d --parallel=5 --no-cloud
nx run $PACKAGE_NAME:d --no-cloud
nx watch --all -- node ./build-dependents.js \$NX_PROJECT_NAME $(echo $PACKAGE_NAME)
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default defineConfig({
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
workers: "80%",
reporter: "html",

use: {
Expand All @@ -280,7 +280,7 @@ export default defineConfig({
],

webServer: {
command: "yarn dev",
command: "yarn start",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
},
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/next-connect-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/react-dom": "^18.0.11",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
},
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/next-rainbow-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/react-dom": "^18.0.11",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
},
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/next-wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/react-dom": "^18.0.11",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
},
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/next-web3-modal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/react-dom": "^18.0.11",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
},
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/vite-connect-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vite": "^5.2.14",
"vite-plugin-node-polyfills": "^0.22.0"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/vite-rainbow-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vite": "^5.2.14",
"vite-plugin-node-polyfills": "^0.22.0"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/vite-wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vite": "^5.2.14",
"vite-plugin-node-polyfills": "^0.22.0"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/vite-web3-modal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vite": "^5.2.14",
"vite-plugin-node-polyfills": "^0.22.0"
},
Expand Down
2 changes: 2 additions & 0 deletions examples/orderbook/create-bid-with-nextjs/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEXT_PUBLIC_PUBLISHABLE_KEY=
NEXT_PUBLIC_CLIENT_ID=
6 changes: 6 additions & 0 deletions examples/orderbook/create-bid-with-nextjs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"root": true,
"extends": [
"next/core-web-vitals"
]
}
36 changes: 36 additions & 0 deletions examples/orderbook/create-bid-with-nextjs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
Loading

0 comments on commit f5e6026

Please sign in to comment.