diff --git a/.github/workflows/pull-request-develop.yml b/.github/workflows/pull-request-develop.yml index 77ea12c2c..6f258119b 100644 --- a/.github/workflows/pull-request-develop.yml +++ b/.github/workflows/pull-request-develop.yml @@ -67,6 +67,26 @@ jobs: - name: "Check formatting" run: npx prettier ./packages --check + # type-checks all test folders (fast fail on compile errors) + typecheck: + runs-on: ubuntu-latest + needs: install + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 22.9.0 + cache: npm + + - name: "Install dependencies" + run: npm ci --workspaces --include-workspace-root + + - name: "Build" + run: npm run build + + - name: "Type-check tests" + run: npm run test:check + # tests all packages test: runs-on: ubuntu-latest diff --git a/package.json b/package.json index 41ced0d57..d423b74cf 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "lint:staged": "eslint", "format": "prettier --check \"packages/*/src/**/*.ts\" \"packages/*/test/**/*.ts\" \"packages/*/*.{cjs,json}\"", "format:write": "prettier --write \"packages/*/src/**/*.ts\" \"packages/*/test/**/*.ts\" \"packages/*/*.{cjs,json}\"", + "test:check": "npx lerna run test:check", "test": "npx lerna run test -- --passWithNoTests", "test:ci": "npx lerna run test --concurrency=1 -- --passWithNoTests --forceExit", "test:integration": "npx lerna run test:integration --concurrency=1 -- --passWithNoTests --forceExit", diff --git a/packages/api/package.json b/packages/api/package.json index 5ed16c570..862de0c71 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -10,6 +10,7 @@ "lint": "eslint ./src ./test", "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./test/**", + "test:check": "tsc --noEmit -p test/tsconfig.json", "test:watch": "npm run test:file -- ./test/** --watch" }, "main": "dist/index.js", diff --git a/packages/common/package.json b/packages/common/package.json index 2a3b8d49d..4a10c9135 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -10,6 +10,7 @@ "lint": "eslint ./src ./test", "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./test/**", + "test:check": "tsc --noEmit -p test/tsconfig.json", "test:watch": "npm run test:file -- ./test/** --watch" }, "main": "dist/index.js", diff --git a/packages/deployment/package.json b/packages/deployment/package.json index 360e6777e..17bd76f4c 100644 --- a/packages/deployment/package.json +++ b/packages/deployment/package.json @@ -11,6 +11,7 @@ "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./test/**", "test:watch": "npm run test:file -- ./test/** --watch", + "test:check": "tsc --noEmit -p test/tsconfig.json && tsc --noEmit -p test-integration/tsconfig.json", "test:integration": "npm run test:file -- ./test-integration/** --runInBand" }, "main": "dist/index.js", diff --git a/packages/indexer/package.json b/packages/indexer/package.json index 280fb3fdc..bf6d64283 100644 --- a/packages/indexer/package.json +++ b/packages/indexer/package.json @@ -11,6 +11,7 @@ "lint": "eslint ./src ./test", "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./src/** ./test/**", + "test:check": "tsc --noEmit -p test/tsconfig.json", "test:watch": "npm run test:file -- ./src/** ./test/** --watch", "prisma:generate": "prisma generate --schema=./prisma/schema.prisma", "prisma:migrate": "prisma migrate dev --schema=./prisma/schema.prisma" diff --git a/packages/library/package.json b/packages/library/package.json index c61439243..09b099a49 100644 --- a/packages/library/package.json +++ b/packages/library/package.json @@ -10,6 +10,7 @@ "lint": "eslint ./src ./test", "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./test/**", + "test:check": "tsc --noEmit -p test/tsconfig.json", "test:watch": "npm run test:file -- ./test/** --watch" }, "main": "dist/index.js", diff --git a/packages/module/package.json b/packages/module/package.json index d645791b6..f0027a940 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -10,6 +10,7 @@ "lint": "eslint ./src ./test", "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./test/**", + "test:check": "tsc --noEmit -p test/tsconfig.json", "test:watch": "npm run test:file -- ./test/** --watch" }, "main": "dist/index.js", diff --git a/packages/persistance/package.json b/packages/persistance/package.json index f32d864c9..b1ad7999d 100644 --- a/packages/persistance/package.json +++ b/packages/persistance/package.json @@ -12,6 +12,7 @@ "lint": "eslint ./src ./test ./test-integration", "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./test/**", + "test:check": "tsc --noEmit -p test/tsconfig.json && tsc --noEmit -p test-integration/tsconfig.json", "test:integration": "npm run test:file -- ./test-integration/** --runInBand", "test:watch": "npm run test:file -- ./test/** --watch" }, diff --git a/packages/processor/package.json b/packages/processor/package.json index 3d81e2add..c84b05819 100644 --- a/packages/processor/package.json +++ b/packages/processor/package.json @@ -16,6 +16,7 @@ "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "prisma:generate": "prisma generate --schema=./test/prisma/schema.prisma", "test": "npm run test:file -- ./src/** ./test/**", + "test:check": "tsc --noEmit -p test/tsconfig.json", "test:watch": "npm run test:file -- ./src/** ./test/** --watch" }, "publishConfig": { diff --git a/packages/protocol/package.json b/packages/protocol/package.json index fb63d3cce..65f53a8b8 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -10,6 +10,7 @@ "lint": "eslint ./src ./test", "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./test/**", + "test:check": "tsc --noEmit -p test/tsconfig.json", "test:watch": "npm run test:file -- ./test/** --watch" }, "main": "dist/index.js", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 63f2d9419..b25922a81 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -10,6 +10,7 @@ "lint": "eslint ./src ./test", "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./test/**", + "test:check": "tsc --noEmit -p test/tsconfig.json", "test:watch": "npm run test:file -- ./test/** --watch" }, "main": "dist/index.js", diff --git a/packages/sequencer/package.json b/packages/sequencer/package.json index 2fe6b483e..d8705b23e 100644 --- a/packages/sequencer/package.json +++ b/packages/sequencer/package.json @@ -11,6 +11,7 @@ "test:file": "node --experimental-vm-modules --experimental-wasm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./test/**", "test:watch": "npm run test:file -- ./test/** --watch", + "test:check": "tsc --noEmit -p test/tsconfig.json && tsc --noEmit -p test-integration/tsconfig.json && tsc --noEmit -p test-proven/tsconfig.json", "test:integration": "npm run test:file -- ./test-integration/** --runInBand", "start": "npm run build && node --experimental-vm-modules --experimental-wasm-modules --es-module-specifier-resolution=node ./dist/src/entry.js" }, diff --git a/packages/stack/package.json b/packages/stack/package.json index 742155463..f5a757ecf 100644 --- a/packages/stack/package.json +++ b/packages/stack/package.json @@ -11,6 +11,7 @@ "test:file": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js", "test": "npm run test:file -- ./test/**", "test:watch": "npm run test:file -- ./test/** --watch", + "test:check": "tsc --noEmit -p test/tsconfig.json && tsc --noEmit -p test-integration/tsconfig.json", "test:integration": "npm run test:file -- ./test-integration/** --runInBand", "graphql": "npm run build && node --experimental-vm-modules --experimental-wasm-modules --es-module-specifier-resolution=node ./dist/scripts/graphql/run-graphql.js", "start": "node --experimental-vm-modules --es-module-specifier-resolution=node ./dist/start.js"