From 0bdfaa5686d861491f4b056780218e813f183076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Wed, 10 Jul 2024 17:00:43 +0200 Subject: [PATCH] Make sure that `typecheck` is executed on CI (#623) * Make sure that `typecheck` is executed on CI * break types on purpose * Revert "break types on purpose" This reverts commit b61676767ab1e2e5902dfb73027f814f3897ceed. * add turbo to all packages * add .tsbuildinfo to typecheck outputs --- Earthfile | 5 +++++ package.json | 2 +- packages/cypress/package.json | 1 + packages/jest/package.json | 1 + packages/node/package.json | 3 +-- packages/playwright/package.json | 1 + packages/puppeteer/package.json | 1 + packages/replayio/package.json | 1 + packages/shared/package.json | 1 + packages/sourcemap-upload-webpack-plugin/package.json | 1 + packages/sourcemap-upload/package.json | 1 + packages/test-utils/package.json | 1 + turbo.json | 7 ++++++- yarn.lock | 9 +++++++++ 14 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Earthfile b/Earthfile index 7315f8a5..534e6fad 100644 --- a/Earthfile +++ b/Earthfile @@ -7,6 +7,10 @@ build: COPY . . RUN yarn --immutable && yarn run build +typecheck: + FROM +build + RUN yarn run typecheck + lint: FROM +build RUN yarn run lint @@ -62,6 +66,7 @@ e2e: BUILD +flake ci: + BUILD +typecheck BUILD +lint BUILD +test BUILD +e2e diff --git a/package.json b/package.json index 4171a324..d417d44b 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "watch": "turbo watch build --filter=\"./packages/*\"", "test": "yarn run test:unit", "test:unit": "yarn workspaces foreach --all --exclude=. --exclude=examples/create-react-app-typescript --exclude=packages/cypress/example --topological run test", - "typecheck": "yarn workspaces foreach --all run typecheck", + "typecheck": "turbo run typecheck --filter=\"./packages/*\"", "lint": "prettier --check .", "changeset": "changeset", "release": "yarn workspaces foreach --no-private --all --topological npm publish --tolerate-republish --access public && changeset tag", diff --git a/packages/cypress/package.json b/packages/cypress/package.json index e382fa7d..99038257 100644 --- a/packages/cypress/package.json +++ b/packages/cypress/package.json @@ -44,6 +44,7 @@ "@types/uuid": "^9.0.1", "@types/ws": "^8.5.10", "cypress": "^13.11.0", + "turbo": "^2.0.5", "typescript": "^5.5.2" }, "dependencies": { diff --git a/packages/jest/package.json b/packages/jest/package.json index 1a631346..65f2d56e 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -42,6 +42,7 @@ "@replayio/test-utils": "workspace:^", "@types/node": "^20.11.27", "@types/stack-utils": "^2.0.3", + "turbo": "^2.0.5", "typescript": "^5.5.2" }, "dependencies": { diff --git a/packages/node/package.json b/packages/node/package.json index 5b4a0edb..2c0ac40c 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -6,8 +6,7 @@ "replay-node": "bin/replay-node" }, "scripts": { - "test": "echo \"Error: no test specified\"", - "typecheck": "echo \"Error: no typecheck specified\"" + "test": "echo \"Error: no test specified\"" }, "repository": { "type": "git", diff --git a/packages/playwright/package.json b/packages/playwright/package.json index bd18008e..366d640a 100644 --- a/packages/playwright/package.json +++ b/packages/playwright/package.json @@ -31,6 +31,7 @@ "@types/stack-utils": "^2.0.3", "@types/uuid": "^8.3.4", "@types/ws": "^8.5.10", + "turbo": "^2.0.5", "typescript": "^5.5.2" }, "repository": { diff --git a/packages/puppeteer/package.json b/packages/puppeteer/package.json index d2a7c310..48b814a1 100644 --- a/packages/puppeteer/package.json +++ b/packages/puppeteer/package.json @@ -25,6 +25,7 @@ "@replayio/test-utils": "workspace:^", "@types/node": "^20.11.27", "@types/stack-utils": "^2.0.3", + "turbo": "^2.0.5", "typescript": "^5.5.2" }, "repository": { diff --git a/packages/replayio/package.json b/packages/replayio/package.json index 39f83d14..30bbd630 100644 --- a/packages/replayio/package.json +++ b/packages/replayio/package.json @@ -76,6 +76,7 @@ "jest": "^28.1.3", "prettier": "^2.7.1", "ts-jest": "^28.0.6", + "turbo": "^2.0.5", "typescript": "^5.5.2" }, "@replay-cli/pkg-build": { diff --git a/packages/shared/package.json b/packages/shared/package.json index 48bc2f17..a82c2801 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -36,6 +36,7 @@ "@types/jest": "^28.1.5", "@types/stack-utils": "^2.0.3", "jest": "^28.1.3", + "turbo": "^2.0.5", "typescript": "^5.5.2" }, "@replay-cli/pkg-build": { diff --git a/packages/sourcemap-upload-webpack-plugin/package.json b/packages/sourcemap-upload-webpack-plugin/package.json index 9a0c3790..fd2e8cdd 100644 --- a/packages/sourcemap-upload-webpack-plugin/package.json +++ b/packages/sourcemap-upload-webpack-plugin/package.json @@ -47,6 +47,7 @@ "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^3.4.0", "prettier": "^2.2.1", + "turbo": "^2.0.5", "typescript": "^5.5.2", "webpack": "^5.90.3" }, diff --git a/packages/sourcemap-upload/package.json b/packages/sourcemap-upload/package.json index 43265fde..833ce5ac 100644 --- a/packages/sourcemap-upload/package.json +++ b/packages/sourcemap-upload/package.json @@ -47,6 +47,7 @@ "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^3.4.0", "prettier": "^2.2.1", + "turbo": "^2.0.5", "typescript": "^5.5.2" }, "dependencies": { diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 7bd48d9b..ddc16973 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -54,6 +54,7 @@ "@types/debug": "^4.1.7", "@types/node-fetch": "^2.6.2", "@types/stack-utils": "^2.0.3", + "turbo": "^2.0.5", "typescript": "^5.5.2" }, "@replay-cli/pkg-build": { diff --git a/turbo.json b/turbo.json index c22271db..d5c5368c 100644 --- a/turbo.json +++ b/turbo.json @@ -4,7 +4,12 @@ "build": { "dependsOn": ["^build"], "inputs": ["$TURBO_DEFAULT$", "src/**", "tsconfig.json"], - "outputs": ["dist/**", ".tsbuildinfo"] + "outputs": ["dist/**"] + }, + "typecheck": { + "dependsOn": ["^build"], + "inputs": ["$TURBO_DEFAULT$", "src/**", "tsconfig.json"], + "outputs": [".tsbuildinfo"] } }, "globalDependencies": ["tsconfig.json"] diff --git a/yarn.lock b/yarn.lock index 96c0634e..4b01faf9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3458,6 +3458,7 @@ __metadata: strip-ansi: "npm:^6.0.1" superstruct: "npm:^1.0.4" table: "npm:^6.8.2" + turbo: "npm:^2.0.5" typescript: "npm:^5.5.2" undici: "npm:^5.28.4" winston: "npm:^3.13.0" @@ -3517,6 +3518,7 @@ __metadata: stack-utils: "npm:^2.0.6" superstruct: "npm:^1.0.4" terminate: "npm:^2.6.1" + turbo: "npm:^2.0.5" txml: "npm:^3.2.5" typescript: "npm:^5.5.2" undici: "npm:^5.28.4" @@ -3557,6 +3559,7 @@ __metadata: sha-1: "npm:^1.0.0" stack-utils: "npm:^2.0.6" superstruct: "npm:^1.0.4" + turbo: "npm:^2.0.5" typescript: "npm:^5.5.2" undici: "npm:^5.28.4" uuid: "npm:^8.3.2" @@ -3602,6 +3605,7 @@ __metadata: sha-1: "npm:^1.0.0" stack-utils: "npm:^2.0.6" superstruct: "npm:^1.0.4" + turbo: "npm:^2.0.5" typescript: "npm:^5.5.2" undici: "npm:^5.28.4" uuid: "npm:^8.3.2" @@ -3649,6 +3653,7 @@ __metadata: sha-1: "npm:^1.0.0" stack-utils: "npm:^2.0.6" superstruct: "npm:^1.0.4" + turbo: "npm:^2.0.5" typescript: "npm:^5.5.2" undici: "npm:^5.28.4" uuid: "npm:^8.3.2" @@ -3706,6 +3711,7 @@ __metadata: eslint-config-prettier: "npm:^8.3.0" eslint-plugin-prettier: "npm:^3.4.0" prettier: "npm:^2.2.1" + turbo: "npm:^2.0.5" typescript: "npm:^5.5.2" webpack: "npm:^5.90.3" peerDependencies: @@ -3737,6 +3743,7 @@ __metadata: p-map: "npm:^4.0.0" prettier: "npm:^2.2.1" string.prototype.matchall: "npm:^4.0.5" + turbo: "npm:^2.0.5" typescript: "npm:^5.5.2" languageName: unknown linkType: soft @@ -3763,6 +3770,7 @@ __metadata: sha-1: "npm:^1.0.0" stack-utils: "npm:^2.0.6" superstruct: "npm:^1.0.4" + turbo: "npm:^2.0.5" typescript: "npm:^5.5.2" undici: "npm:^5.28.4" uuid: "npm:^8.3.2" @@ -15752,6 +15760,7 @@ __metadata: superstruct: "npm:^1.0.4" table: "npm:^6.8.2" ts-jest: "npm:^28.0.6" + turbo: "npm:^2.0.5" typescript: "npm:^5.5.2" undici: "npm:^5.28.4" uuid: "npm:^8.3.2"