From 62b5607f6af3a12c85879de8ba3e70b9d51f2bbc Mon Sep 17 00:00:00 2001 From: Rohit Bhetal <96344296+Rohit-Bhetal@users.noreply.github.com> Date: Mon, 11 Nov 2024 18:32:00 +0530 Subject: [PATCH 1/2] refactor: move type:check to lint hook - Removed type:check from pretest, build, and postbuild scripts - Added type checking to lint command - Improves development speed by reducing redundant type checks Fixes #3248 --- packages/fuels/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fuels/package.json b/packages/fuels/package.json index 7f87b94451..44294282c3 100644 --- a/packages/fuels/package.json +++ b/packages/fuels/package.json @@ -56,9 +56,9 @@ "build:package": "tsup", "build:browser": "pnpm vite build", "build:minified": "pnpm uglifyjs --compress --mangle --output dist/browser.min.mjs -- dist/browser.mjs", - "postbuild": "run-s type:declarations type:check", + "postbuild": "run-s type:declarations", "type:declarations": "tsc --emitDeclarationOnly -p tsconfig.dts.json", - "type:check": "tsc --noEmit", + "lint": "tsc --noEmit", "prepublishOnly": "cp ../../README.md ./README.md" }, "license": "Apache-2.0", From 4d67d8f93a636c074a8ff9f383c7901f6de53c78 Mon Sep 17 00:00:00 2001 From: Rohit Bhetal <96344296+Rohit-Bhetal@users.noreply.github.com> Date: Mon, 11 Nov 2024 20:15:58 +0530 Subject: [PATCH 2/2] refactor: move type:check to lint hook- Removed type:check from pretest, build, and postbuild scripts- Added type checking to lint command- Improves development speed by reducing redundant type checksFixes #3248 --- apps/docs-snippets/package.json | 3 ++- apps/docs-snippets/scripts/pretest.sh | 3 --- internal/benchmarks/package.json | 4 ++-- packages/create-fuels/package.json | 4 ++-- packages/fuel-gauge/package.json | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/docs-snippets/package.json b/apps/docs-snippets/package.json index 58bb894667..58b3d1eb78 100644 --- a/apps/docs-snippets/package.json +++ b/apps/docs-snippets/package.json @@ -4,7 +4,8 @@ "description": "", "private": true, "scripts": { - "pretest": "./scripts/pretest.sh" + "pretest": "./scripts/pretest.sh", + "lint": "tsc --noEmit" }, "devDependencies": { "@fuel-ts/account": "workspace:*", diff --git a/apps/docs-snippets/scripts/pretest.sh b/apps/docs-snippets/scripts/pretest.sh index 25f1121e8e..40517df958 100755 --- a/apps/docs-snippets/scripts/pretest.sh +++ b/apps/docs-snippets/scripts/pretest.sh @@ -9,6 +9,3 @@ pnpm fuels build # Deploys projects (needed for loader bytecode) pnpm fuels deploy - -# Checks for type errors -pnpm tsc --noEmit \ No newline at end of file diff --git a/internal/benchmarks/package.json b/internal/benchmarks/package.json index 0956d19371..39cf8ce767 100644 --- a/internal/benchmarks/package.json +++ b/internal/benchmarks/package.json @@ -5,8 +5,8 @@ "dist" ], "scripts": { - "type:check": "tsc --noEmit", - "pretest": "run-s build:forc type:check", + "lint": "tsc --noEmit", + "pretest": "run-s build:forc ", "build:forc": "pnpm fuels build" }, "license": "Apache-2.0", diff --git a/packages/create-fuels/package.json b/packages/create-fuels/package.json index 3d788de953..f7464e7cdf 100644 --- a/packages/create-fuels/package.json +++ b/packages/create-fuels/package.json @@ -15,9 +15,9 @@ }, "license": "Apache-2.0", "scripts": { - "build": "run-s build:source type:check", + "build": "run-s build:source", "build:source": "tsup", - "type:check": "tsc --noEmit", + "lint": "tsc --noEmit", "prepublishOnly": "tsx ./scripts/prepublish.ts" }, "dependencies": { diff --git a/packages/fuel-gauge/package.json b/packages/fuel-gauge/package.json index c2bbcd48aa..0bf175b7ee 100644 --- a/packages/fuel-gauge/package.json +++ b/packages/fuel-gauge/package.json @@ -5,10 +5,10 @@ "description": "", "author": "Fuel Labs (https://fuel.network/)", "scripts": { - "pretest": "run-s build:forc build:process-predicates type:check", + "pretest": "run-s build:forc build:process-predicates", "build:forc": "pnpm fuels build", "build:process-predicates": "tsx ./scripts/process-predicates.ts", - "type:check": "tsc --noEmit" + "lint": "tsc --noEmit" }, "license": "Apache-2.0", "dependencies": {