Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/FuelLabs/fuels-ts into np…
Browse files Browse the repository at this point in the history
…/feat/abi-refactor
  • Loading branch information
petertonysmith94 committed Sep 16, 2024
2 parents c3a9b6f + 53c137c commit 09cddf0
Show file tree
Hide file tree
Showing 139 changed files with 8,541 additions and 5,155 deletions.
6 changes: 0 additions & 6 deletions .changeset/afraid-starfishes-joke.md

This file was deleted.

4 changes: 0 additions & 4 deletions .changeset/ninety-geese-report.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/orange-hornets-help.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/silent-bees-give.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/spicy-games-repeat.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tasty-geckos-train.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/warm-snails-cough.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wet-sheep-call.md

This file was deleted.

4 changes: 0 additions & 4 deletions .changeset/wild-bulldogs-cheer.md

This file was deleted.

4 changes: 0 additions & 4 deletions .changeset/witty-masks-hide.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/witty-terms-swim.md

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Benchmarks
on:
pull_request:
push:
branches:
- master

jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: CI Setup
uses: ./.github/actions/test-setup

- name: Pretest
run: pnpm pretest

- name: Run Node benchmarks
uses: CodSpeedHQ/action@v3
with:
run: pnpm bench:node
token: ${{ secrets.CODSPEED_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ lib-cov
*.pid
*.gz
*.swp
*.0x/*

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand Down Expand Up @@ -144,6 +145,10 @@ Forc.lock
**/out/release
**/test-predicate-*/index.ts

## Ignore perf test files
*clinic*
.clinic/*

# Ignore typegen test files
**/test/typegen

Expand Down
1 change: 1 addition & 0 deletions .knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"apps/create-fuels-counter-guide/**"
],
"ignoreDependencies": [
"autocannon",
"bun",
"@/sway-api/*",
"@fuel-ts/*",
Expand Down
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,28 @@ pnpm test:filter packages/my-desired-package/src/my.test.ts
pnpm test -- --coverage --my-other-flag
```

# Benchmarking

We currently use `vitest` 's [bench utility](https://vitest.dev/api/#bench) to run benchmarks. You can run them in both the browser and node environments.

```sh
pnpm bench:node
```

```sh
# run benchmarks for a specific package
pnpm bench:node packages/my-desired-package
```

# Profiling

We currently use [`clinic`](https://clinicjs.org/) to profile and debug our tooling. For instance you can run clinic's flame command to create a flamegraph for a specific package:

```sh
# creates a flamegraph for a specific package
npm_config_package_name=account pnpm clinic:flame // runs flame against the account package
```

### CI Test

During the CI process an automated end-to-end (e2e) test is executed. This test is crucial as it simulates real-world scenarios on the current test-net, ensuring that the changeset maintains the expected functionality and stability.
Expand Down
28 changes: 14 additions & 14 deletions apps/create-fuels-counter-guide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@
"dependencies": {
"@fuels/connectors": "^0.27.1",
"@fuels/react": "^0.27.1",
"@tanstack/react-query": "^5.52.1",
"@tanstack/react-router": "^1.48.1",
"@wagmi/connectors": "^5.1.8",
"@tanstack/react-query": "^5.55.4",
"@tanstack/react-router": "^1.56.5",
"fuels": "workspace:*",
"@wagmi/connectors": "^5.1.9",
"@wagmi/core": "^2.13.4",
"dotenv": "^16.4.5",
"fuels": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hot-toast": "^2.4.1",
"react-use": "^17.5.1"
},
"devDependencies": {
"@eslint/js": "^9.9.1",
"@playwright/test": "^1.46.1",
"@tanstack/router-plugin": "^1.47.0",
"@types/node": "^22.2.0",
"@eslint/js": "^9.10.0",
"@tanstack/router-plugin": "^1.56.4",
"@types/node": "^22.5.4",
"@playwright/test": "^1.47.0",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3",
"@vitejs/plugin-react-swc": "^3.5.0",
"@vitejs/plugin-react-swc": "^3.7.0",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.11",
"globals": "^15.9.0",
"postcss": "^8",
"postcss": "^8.4.45",
"tailwindcss": "^3.4.10",
"typescript": "~5.4.5",
"typescript-eslint": "^8.0.0",
"vite": "^5.4.2",
"vitest": "^1.6.0"
"typescript": "~5.6.2",
"typescript-eslint": "^8.5.0",
"vite": "^5.4.3",
"vitest": "^2.0.5"
}
}
6 changes: 3 additions & 3 deletions apps/demo-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
},
"dependencies": {
"@fuels/vm-asm": "0.56.0",
"@types/node": "^22.2.0",
"@types/node": "^22.5.4",
"@types/react-dom": "^18.3",
"@types/react": "^18.3.5",
"fuels": "workspace:*",
"next": "14.2.7",
"next": "14.2.9",
"react-dom": "^18.3.1",
"react": "^18.3.1",
"typescript": "~5.4.5"
"typescript": "~5.6.2"
}
}
4 changes: 2 additions & 2 deletions apps/demo-react-cra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"dependencies": {
"@fuels/vm-asm": "0.56.0",
"@testing-library/react": "^16.0.1",
"@types/node": "^22.2.0",
"@types/node": "^22.5.4",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3",
"eslint-config-react-app": "^7.0.1",
"fuels": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
"typescript": "~5.4.5",
"typescript": "~5.6.2",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions apps/demo-react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"devDependencies": {
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.11",
"typescript": "~5.4.5",
"vite": "^5.4.2"
"typescript": "~5.6.2",
"vite": "^5.4.3"
}
}
12 changes: 6 additions & 6 deletions apps/demo-wallet-sdk-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
"dependencies": {
"@fuels/connectors": "^0.27.1",
"@fuels/react": "^0.27.1",
"@tanstack/react-query": "^5.52.1",
"@tanstack/react-query": "^5.55.4",
"fuels": "workspace:*",
"next": "14.2.7",
"next": "14.2.9",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^22.2.0",
"@types/node": "^22.5.4",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3",
"eslint": "^8.57.0",
"eslint-config-next": "14.2.7",
"postcss": "^8",
"eslint-config-next": "14.2.9",
"postcss": "^8.4.45",
"postcss-load-config": "^6.0.1",
"tailwindcss": "^3.4.10",
"typescript": "~5.4.5"
"typescript": "~5.6.2"
}
}
2 changes: 1 addition & 1 deletion apps/docs-snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@fuel-ts/utils": "workspace:*",
"ethers": "^6.13.2",
"fuels": "workspace:*",
"vitest": "^1.6.0"
"vitest": "^2.0.5"
},
"keywords": [],
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"typedoc-plugin-merge-modules": "^6.0.0",
"vitepress-plugin-search": "1.0.4-alpha.22",
"vitepress": "1.3.4",
"vue": "^3.4.38"
"vue": "^3.5.3"
}
}
2 changes: 2 additions & 0 deletions apps/docs/src/guide/wallets/connectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ It requires a single argument:

- `network` ([`Network`](../../api/Account/index.md#network))

You call this method with either the `providerUrl` or `chainId` to select the network.

It will return a promise that resolves to `true` if the network is successfully selected; otherwise, it will return `false`.

It should throw an error if the network is not available or the network does _not_ exist.
Expand Down
1 change: 1 addition & 0 deletions internal/benchmarks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/fixtures/forc-projects/**/index.ts
15 changes: 15 additions & 0 deletions internal/benchmarks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# @internal/benchmarks

## 1.0.1

### Patch Changes

- Updated dependencies [a9f31ca]
- [email protected]

## 1.0.1

### Patch Changes

- Updated dependencies [a9f31ca]
- [email protected]
1 change: 1 addition & 0 deletions internal/benchmarks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A package for running benchmarks.
9 changes: 9 additions & 0 deletions internal/benchmarks/fuels.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createConfig } from 'fuels';

export default createConfig({
workspace: './test/fixtures/forc-projects',
output: './test/typegen',
forcBuildFlags: ['--release'],
forcPath: 'fuels-forc',
fuelCorePath: 'fuels-core',
});
17 changes: 17 additions & 0 deletions internal/benchmarks/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"private": true,
"name": "@internal/benchmarks",
"files": [
"dist"
],
"scripts": {
"type:check": "tsc --noEmit",
"pretest": "run-s build:forc type:check",
"build:forc": "pnpm fuels build"
},
"license": "Apache-2.0",
"dependencies": {
"fuels": "workspace:*"
},
"version": "1.0.1"
}
Loading

0 comments on commit 09cddf0

Please sign in to comment.