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 01/13] 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 7f87b944510..44294282c3f 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 02/13] 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 58bb894667f..58b3d1eb782 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 25f1121e8e3..40517df9589 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 0956d19371e..39cf8ce767f 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 3d788de9532..f7464e7cdfd 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 c2bbcd48aa5..0bf175b7ee8 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": { From 95280f9742683f958e8f90deb64af57255302392 Mon Sep 17 00:00:00 2001 From: Rohit Bhetal <96344296+Rohit-Bhetal@users.noreply.github.com> Date: Tue, 19 Nov 2024 20:23:28 +0530 Subject: [PATCH 03/13] Add type:check to turbo tasks and update root package.json lint script --- package.json | 4 ++-- turbo.json | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 38e9db8e87c..08896e5d79f 100644 --- a/package.json +++ b/package.json @@ -39,12 +39,12 @@ "clinic:doctor": "clinic doctor --autocannon [ / ] -- node packages/${npm_config_package_name}/dist/profile.js", "clinic:heap": "clinic heapprofiler --autocannon [ / ] -- node packages/${npm_config_package_name}/dist/profile.js", "test:integration": "vitest --run --config vitest.node.config.mts $(scripts/tests-find.sh --integration)", - "lint": "run-s type:check-tests lint:check prettier:check", + "lint": "run-s type:check-tests lint:check prettier:check type:check", "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", - "type:check-tests": "tsc -p tsconfig.test.json", + "type:check-tests": "turbo run type:check", "prettier:check": "prettier --check packages --check apps/docs-snippets", "prettier:format": "prettier --write packages --check apps/docs-snippets", "verify:package-exports": "tsx ./scripts/verify-package-exports", diff --git a/turbo.json b/turbo.json index 020ea07d937..0ec6a16078d 100644 --- a/turbo.json +++ b/turbo.json @@ -1,6 +1,9 @@ { "$schema": "https://turborepo.org/schema.json", "tasks": { + "type:check": { + "outputLogs": "errors-only" + }, "preinstall": { "outputLogs": "new-only" }, From 1c47dafadbf2afc6e6afd1637932b5bee6b86fdf Mon Sep 17 00:00:00 2001 From: Rohit Bhetal <96344296+Rohit-Bhetal@users.noreply.github.com> Date: Tue, 19 Nov 2024 20:30:07 +0530 Subject: [PATCH 04/13] Add type:check to turbo tasks and update root package.json lint script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 08896e5d79f..369e4129e69 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "lint:fix": "pnpm lint:check --fix", "lint:md-links": "tsx ./scripts/lint-md-links", "lint:package-jsons": "tsx ./scripts/lint-package-jsons", - "type:check-tests": "turbo run type:check", + "type:check": "turbo run type:check", "prettier:check": "prettier --check packages --check apps/docs-snippets", "prettier:format": "prettier --write packages --check apps/docs-snippets", "verify:package-exports": "tsx ./scripts/verify-package-exports", From 4253ec3a075b75c96447d02228e4dfe8c45ba2c2 Mon Sep 17 00:00:00 2001 From: Rohit Bhetal <96344296+Rohit-Bhetal@users.noreply.github.com> Date: Tue, 19 Nov 2024 20:43:57 +0530 Subject: [PATCH 05/13] chore: add changeset for type checking updates --- .changeset/polite-seas-taste.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/polite-seas-taste.md diff --git a/.changeset/polite-seas-taste.md b/.changeset/polite-seas-taste.md new file mode 100644 index 00000000000..75e04576aec --- /dev/null +++ b/.changeset/polite-seas-taste.md @@ -0,0 +1,5 @@ +--- +"fuels": major +--- + +Move type-checking to a dedicated lint script across the project to improve development speed and reduce redundant checks From 8045137a466757b8f2ab1c88fc4748368135e84c Mon Sep 17 00:00:00 2001 From: Rohit Bhetal Date: Wed, 20 Nov 2024 13:57:00 +0530 Subject: [PATCH 06/13] Update packages/create-fuels/package.json Co-authored-by: Peter Smith --- packages/create-fuels/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-fuels/package.json b/packages/create-fuels/package.json index dc3940fb129..78783fa6b25 100644 --- a/packages/create-fuels/package.json +++ b/packages/create-fuels/package.json @@ -17,7 +17,7 @@ "scripts": { "build": "run-s build:source", "build:source": "tsup", - "lint": "tsc --noEmit", + "type:check": "tsc --noEmit", "prepublishOnly": "tsx ./scripts/prepublish.ts" }, "dependencies": { From 15497ad486c8da711ac951fdd07744c12c78f3cd Mon Sep 17 00:00:00 2001 From: Rohit Bhetal Date: Wed, 20 Nov 2024 13:57:14 +0530 Subject: [PATCH 07/13] Update .changeset/polite-seas-taste.md Co-authored-by: Peter Smith --- .changeset/polite-seas-taste.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/polite-seas-taste.md b/.changeset/polite-seas-taste.md index 75e04576aec..3e001a5ede0 100644 --- a/.changeset/polite-seas-taste.md +++ b/.changeset/polite-seas-taste.md @@ -2,4 +2,4 @@ "fuels": major --- -Move type-checking to a dedicated lint script across the project to improve development speed and reduce redundant checks +chore: move type:check to lint hook From 341a40e47e4339aa08a32ba99477095ae069d4b4 Mon Sep 17 00:00:00 2001 From: Rohit Bhetal Date: Wed, 20 Nov 2024 13:57:24 +0530 Subject: [PATCH 08/13] Update packages/fuel-gauge/package.json Co-authored-by: Peter Smith --- packages/fuel-gauge/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fuel-gauge/package.json b/packages/fuel-gauge/package.json index 0bf175b7ee8..1c1226118b3 100644 --- a/packages/fuel-gauge/package.json +++ b/packages/fuel-gauge/package.json @@ -8,7 +8,7 @@ "pretest": "run-s build:forc build:process-predicates", "build:forc": "pnpm fuels build", "build:process-predicates": "tsx ./scripts/process-predicates.ts", - "lint": "tsc --noEmit" + "type:check": "tsc --noEmit" }, "license": "Apache-2.0", "dependencies": { From 70abc8aa481527214202648624e2964a70e65b90 Mon Sep 17 00:00:00 2001 From: Rohit Bhetal Date: Wed, 20 Nov 2024 13:57:35 +0530 Subject: [PATCH 09/13] Update packages/fuels/package.json Co-authored-by: Peter Smith --- packages/fuels/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fuels/package.json b/packages/fuels/package.json index 635c0faca43..3684af0eb31 100644 --- a/packages/fuels/package.json +++ b/packages/fuels/package.json @@ -58,7 +58,7 @@ "build:minified": "pnpm uglifyjs --compress --mangle --output dist/browser.min.mjs -- dist/browser.mjs", "postbuild": "run-s type:declarations", "type:declarations": "tsc --emitDeclarationOnly -p tsconfig.dts.json", - "lint": "tsc --noEmit", + "type:check": "tsc --noEmit", "prepublishOnly": "cp ../../README.md ./README.md" }, "license": "Apache-2.0", From 4c2f2a223f153eb6bb905f7ddab6c0fa203b2823 Mon Sep 17 00:00:00 2001 From: Rohit Bhetal Date: Wed, 20 Nov 2024 13:57:45 +0530 Subject: [PATCH 10/13] Update internal/benchmarks/package.json Co-authored-by: Peter Smith --- internal/benchmarks/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/benchmarks/package.json b/internal/benchmarks/package.json index 0cf210a8aba..f7531e44bb1 100644 --- a/internal/benchmarks/package.json +++ b/internal/benchmarks/package.json @@ -5,7 +5,7 @@ "dist" ], "scripts": { - "lint": "tsc --noEmit", + "type:check": "tsc --noEmit", "pretest": "run-s build:forc ", "build:forc": "pnpm fuels build" }, From e5280a04c6ddd2e50686e0dc47c9242ee1f31ce2 Mon Sep 17 00:00:00 2001 From: Rohit Bhetal Date: Wed, 20 Nov 2024 13:58:12 +0530 Subject: [PATCH 11/13] Update package.json Co-authored-by: Peter Smith --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 369e4129e69..0f9a9653192 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "lint:md-links": "tsx ./scripts/lint-md-links", "lint:package-jsons": "tsx ./scripts/lint-package-jsons", "type:check": "turbo run type:check", + "type:check-tests": "tsc -p tsconfig.test.json", "prettier:check": "prettier --check packages --check apps/docs-snippets", "prettier:format": "prettier --write packages --check apps/docs-snippets", "verify:package-exports": "tsx ./scripts/verify-package-exports", From 8d283380484bba6b5730b210146d011d3ddcca42 Mon Sep 17 00:00:00 2001 From: Rohit Bhetal Date: Wed, 20 Nov 2024 13:58:26 +0530 Subject: [PATCH 12/13] Update .changeset/polite-seas-taste.md Co-authored-by: Peter Smith --- .changeset/polite-seas-taste.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.changeset/polite-seas-taste.md b/.changeset/polite-seas-taste.md index 3e001a5ede0..b7ea3220336 100644 --- a/.changeset/polite-seas-taste.md +++ b/.changeset/polite-seas-taste.md @@ -1,5 +1,4 @@ --- -"fuels": major --- chore: move type:check to lint hook From 214151a490f301951b32c7ffaa5de4dee9d6dbb9 Mon Sep 17 00:00:00 2001 From: Rohit Bhetal Date: Wed, 20 Nov 2024 13:58:39 +0530 Subject: [PATCH 13/13] Update apps/docs-snippets/package.json Co-authored-by: Peter Smith --- apps/docs-snippets/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs-snippets/package.json b/apps/docs-snippets/package.json index 58b3d1eb782..330369511da 100644 --- a/apps/docs-snippets/package.json +++ b/apps/docs-snippets/package.json @@ -5,7 +5,7 @@ "private": true, "scripts": { "pretest": "./scripts/pretest.sh", - "lint": "tsc --noEmit" + "type:check": "tsc --noEmit" }, "devDependencies": { "@fuel-ts/account": "workspace:*",