From 27af0f6250e719f902dd48d5ada392eb5136daa3 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Mon, 15 Jan 2024 15:14:30 +0000 Subject: [PATCH 1/5] chore: `throw` on lint warnings (#1645) * chore: changeset * chore: add max warnings to eslint --- .changeset/rude-actors-appear.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .changeset/rude-actors-appear.md diff --git a/.changeset/rude-actors-appear.md b/.changeset/rude-actors-appear.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/rude-actors-appear.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/package.json b/package.json index 666e8ce59b8..3d0563b0b52 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "test:e2e": "jest --no-cache --runInBand packages/fuel-gauge/src/e2e-script.test.ts", "test:watch": "jest --no-cache --watchAll", "lint": "run-s lint:check prettier:check", - "lint:check": "eslint . --ext .ts", + "lint:check": "eslint . --ext .ts --max-warnings 0", "lint:fix": "pnpm lint:check --fix", "lint:md-links": "tsx ./scripts/lint-md-links", "lint:package-jsons": "tsx ./scripts/lint-package-jsons", From be38167992f9b9468d19177bc60d1884c36f986d Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Tue, 16 Jan 2024 12:47:15 +0000 Subject: [PATCH 2/5] chore: output `tsc` errors in build script (#1652) * chore: output build errors * chore: changeset --- .changeset/twenty-onions-enjoy.md | 2 ++ scripts/postbuild.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .changeset/twenty-onions-enjoy.md diff --git a/.changeset/twenty-onions-enjoy.md b/.changeset/twenty-onions-enjoy.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/twenty-onions-enjoy.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/scripts/postbuild.ts b/scripts/postbuild.ts index 1d99572f79f..ff4556d2779 100644 --- a/scripts/postbuild.ts +++ b/scripts/postbuild.ts @@ -8,9 +8,9 @@ import { join } from 'path'; */ try { if (existsSync(join(process.cwd(), 'tsconfig.dts.json'))) { - execSync('tsc --emitDeclarationOnly -p tsconfig.dts.json'); + execSync('tsc --emitDeclarationOnly -p tsconfig.dts.json', { stdio: 'inherit' }); } else if (existsSync(join(process.cwd(), 'tsconfig.json'))) { - execSync('tsc --emitDeclarationOnly -p tsconfig.json'); + execSync('tsc --emitDeclarationOnly -p tsconfig.json', { stdio: 'inherit' }); } } catch (err) { error(err.toString()); From cc2b2d1961bd4ccdfa3901ed5f25d1037fa6a8fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Torres?= <30977845+Torres-ssf@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:34:43 -0300 Subject: [PATCH 3/5] feat: export `getPredicateRoot` from `predicate` package (#1653) --- .changeset/plenty-seals-pay.md | 5 +++++ packages/predicate/src/index.ts | 1 + .../src/utils/getPredicateRoot.test.ts | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 .changeset/plenty-seals-pay.md create mode 100644 packages/predicate/src/utils/getPredicateRoot.test.ts diff --git a/.changeset/plenty-seals-pay.md b/.changeset/plenty-seals-pay.md new file mode 100644 index 00000000000..c32b93e804f --- /dev/null +++ b/.changeset/plenty-seals-pay.md @@ -0,0 +1,5 @@ +--- +"@fuel-ts/predicate": minor +--- + +exporting getPredicateRoot from the predicate package diff --git a/packages/predicate/src/index.ts b/packages/predicate/src/index.ts index b7ac93e61bd..4676e7c9ddf 100644 --- a/packages/predicate/src/index.ts +++ b/packages/predicate/src/index.ts @@ -1 +1,2 @@ export * from './predicate'; +export * from './utils/getPredicateRoot'; diff --git a/packages/predicate/src/utils/getPredicateRoot.test.ts b/packages/predicate/src/utils/getPredicateRoot.test.ts new file mode 100644 index 00000000000..e448adec374 --- /dev/null +++ b/packages/predicate/src/utils/getPredicateRoot.test.ts @@ -0,0 +1,18 @@ +import { getBytesCopy } from 'ethers'; + +import { getPredicateRoot } from './getPredicateRoot'; + +describe('getPredicateRoot', () => { + it('should return the correct predicate root', () => { + const predicateBytes = getBytesCopy( + '0x740000034700000000000000000000805dfcc00110fff3001aec5000910000207144000361491200764800026141120c74000007724c0002134924c05a492001764800026141124a74000001240000005c450000504900085c43f0001341044076400001740000055d43f005104103007244002028ed0440a1412ee0244000000a0000000000000038966262edb5997574be45f94c665aedb41a1663f5b0528e765f355086eebf960000000000000088' + ); + + const predicateRoot = getPredicateRoot(predicateBytes); + + const expectedPredicateRoot = + '0xd8fe10a7e398a8af7235e0a7d43388179d89c59d521dcf314e7ee407af8cddce'; + + expect(predicateRoot).toEqual(expectedPredicateRoot); + }); +}); From e2442924035c67db14c2eb7355b27d77c17d3ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Torres?= <30977845+Torres-ssf@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:00:11 -0300 Subject: [PATCH 4/5] chore: update typegen demo `.gitignore` (#1656) --- .changeset/happy-ducks-change.md | 2 ++ apps/demo-typegen/.gitignore | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .changeset/happy-ducks-change.md diff --git a/.changeset/happy-ducks-change.md b/.changeset/happy-ducks-change.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/happy-ducks-change.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/apps/demo-typegen/.gitignore b/apps/demo-typegen/.gitignore index a277caf4c5b..b351a919822 100644 --- a/apps/demo-typegen/.gitignore +++ b/apps/demo-typegen/.gitignore @@ -1,5 +1,5 @@ node_modules -src/generated-types +src/*-types # Forc **/out/debug/** From a29e08d427d1350efdef43460178d42b25335578 Mon Sep 17 00:00:00 2001 From: Daniel Bate Date: Thu, 18 Jan 2024 10:33:36 +0000 Subject: [PATCH 5/5] chore: implement turbo CI cache (#1649) * chore: changeset * chore: add turbo cache to CI --- .changeset/gold-pandas-double.md | 2 ++ .github/actions/ci-setup/action.yaml | 8 ++++++-- .github/actions/test-setup/action.yaml | 8 ++++++-- package.json | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .changeset/gold-pandas-double.md diff --git a/.changeset/gold-pandas-double.md b/.changeset/gold-pandas-double.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/gold-pandas-double.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/actions/ci-setup/action.yaml b/.github/actions/ci-setup/action.yaml index 01856b892a6..9343b93b1cc 100644 --- a/.github/actions/ci-setup/action.yaml +++ b/.github/actions/ci-setup/action.yaml @@ -14,8 +14,12 @@ runs: with: path: ~/.local/share/pnpm/store/v4 key: ${{ runner.os }}-node-${{ inputs.node-version }}-pnpm-${{ inputs.pnpm-version }}-lock-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm + + - name: Cache Build + uses: actions/cache@v3 + with: + path: .turbo + key: ${{ runner.os }}-turbo-${{ github.sha }} - name: Setup Node.js uses: actions/setup-node@v2 diff --git a/.github/actions/test-setup/action.yaml b/.github/actions/test-setup/action.yaml index bdee6781e1b..94cadf1e6ab 100644 --- a/.github/actions/test-setup/action.yaml +++ b/.github/actions/test-setup/action.yaml @@ -14,8 +14,12 @@ runs: with: path: ~/.local/share/pnpm/store/v4 key: ${{ runner.os }}-node-${{ inputs.node-version }}-pnpm-${{ inputs.pnpm-version }}-lock-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm + + - name: Cache Build + uses: actions/cache@v3 + with: + path: .turbo + key: ${{ runner.os }}-turbo-${{ github.sha }} - name: Setup Node.js uses: actions/setup-node@v2 diff --git a/package.json b/package.json index 3d0563b0b52..1b916ce63d6 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "scripts": { "dan": "tsx ./scripts/release-unpublish.ts", "dev": "nodemon --config nodemon.config.json -x 'pnpm build:packages'", - "build": "turbo run build", + "build": "turbo run build --cache-dir=.turbo", "build:packages": "turbo run build --filter=!docs", "ci:test": "./scripts/ci-test.sh", "pretest": "turbo run pretest",