Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

turbo type-check command and GHA (#11658)

Anthony Shew1281a9b9cef2
diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml
new file mode 100644
index 00000000000..15fb3d390c6
--- /dev/null
+++ b/.github/workflows/typecheck.yml
@@ -0,0 +1,35 @@
+name: Check code with TypeScript
+
+on:
+ pull_request:
+ branches:
+ - 'master'
+
+# Cancel old builds on new commit for same workflow + branch/PR
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ typecheck:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [18.x]
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: 'npm'
+
+ - name: Install deps
+ run: npm ci
+
+ - name: Run TypeScript type check
+ run: npx turbo run typecheck
diff --git a/apps/docs/package.json b/apps/docs/package.json
index 43deec3bf45..4bbdfd0c662 100644
--- a/apps/docs/package.json
+++ b/apps/docs/package.json
@@ -9,6 +9,7 @@
"build:analyze": "ANALYZE=true next build",
"start": "next start",
"lint": "next lint",
+ "typecheck": "tsc --noEmit",
"test": "jest",
"build:sitemap": "node ./internals/generate-sitemap.mjs",
"embeddings": "tsx scripts/search/generate-embeddings.ts",
diff --git a/apps/www/package.json b/apps/www/package.json
index b9663d3d341..9be47d90ba1 100644
--- a/apps/www/package.json
+++ b/apps/www/package.json
@@ -8,7 +8,7 @@
"build": "next build",
"export": "next export",
"start": "next start",
- "typecheck": "tsc",
+ "typecheck": "tsc --noEmit",
"prettier": "prettier --write \"./{pages,components,lib,stores,styles,tests}/**/*.{ts,tsx,md,js,jsx,json}\"",
"postbuild": "node ./internals/generate-sitemap.mjs"
},
diff --git a/package.json b/package.json
index b86d225b5cc..c4e452a53f2 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
"dev:docs": "turbo run dev --filter=docs --parallel",
"dev:www": "turbo run dev --filter=www --parallel",
"lint": "turbo run lint",
+ "typecheck": "turbo --continue typecheck",
"format": "prettier --write \"{apps,studio}/**/*.{js,jsx,ts,tsx,css,md,mdx,json}\"",
"docker:dev": "cd docker && docker compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up --renew-anon-volumes",
"docker:up": "cd docker && docker compose up",
diff --git a/packages/common/package.json b/packages/common/package.json
index 4aebee4dc4b..35ca8940b94 100644
--- a/packages/common/package.json
+++ b/packages/common/package.json
@@ -4,6 +4,9 @@
"main": "./index.tsx",
"types": "./index.tsx",
"license": "MIT",
+ "scripts": {
+ "typecheck_CURRENTLY_IGNORED": "tsc --noEmit"
+ },
"dependencies": {
"@headlessui/react": "^1.7.14",
"@supabase/gotrue-js": "^2.54.0",
diff --git a/packages/ui/package.json b/packages/ui/package.json
index c12edcaf4e4..89996a142c8 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -7,6 +7,7 @@
"sideEffects": false,
"scripts": {
"build:icons": "node --experimental-modules internals/populate-icons.js",
+ "typecheck_CURRENTLY_IGNORED": "tsc --noEmit",
"build-tokens": "node internals/tokens/build-tokens.js",
"copy-tokens": "node internals/tokens/copy-tokens.js",
"cleanse-css-for-tailwind": "node internals/tokens/cleanse-css-for-tailwind.js",
diff --git a/studio/package.json b/studio/package.json
index 9b325070017..c623bdcd41d 100644
--- a/studio/package.json
+++ b/studio/package.json
@@ -10,6 +10,7 @@
"test": "jest",
"lint": "next lint",
"deploy:staging": "VERCEL_ORG_ID=team_E6KJ1W561hMTjon1QSwOh0WO VERCEL_PROJECT_ID=QmcmhbiAtCMFTAHCuGgQscNbke4TzgWULECctNcKmxWCoT vercel --prod -A .vercel/staging.json",
+ "typecheck": "tsc --noEmit",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"prettier:check": "prettier --check .",
diff --git a/turbo.json b/turbo.json
index d7f75fdfa8e..91a5d7a34f6 100644
--- a/turbo.json
+++ b/turbo.json
@@ -1,4 +1,5 @@
{
+ "$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
@@ -51,6 +52,9 @@
},
"test": {
"cache": false
+ },
+ "typecheck": {
+ "outputs": ["**/node_modules/.cache/tsbuildinfo.json"]
}
}
}