diff --git a/.github/matchers/tsc-absolute.json b/.github/matchers/tsc-absolute.json new file mode 100644 index 0000000000..aa36217b41 --- /dev/null +++ b/.github/matchers/tsc-absolute.json @@ -0,0 +1,18 @@ +{ + "problemMatcher": [ + { + "owner": "tsc-absolute", + "pattern": [ + { + "regexp": "(?:^|\\s)([^\\s].*)[\\(:](\\d+)[,:](\\d+)(?:\\):\\s+|\\s+-\\s+)(error|warning|info)\\s+(TS\\d+)\\s*:\\s*(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "code": 5, + "message": 6 + } + ] + } + ] +} diff --git a/.github/workflows/check-types.yml b/.github/workflows/check-types.yml index ec165d261b..1628003b6c 100644 --- a/.github/workflows/check-types.yml +++ b/.github/workflows/check-types.yml @@ -10,8 +10,10 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/actions/dangerous-git-checkout - uses: ./.github/actions/yarn-install - - name: Show info run: node -e "console.log(require('v8').getHeapStatistics())" - - - run: yarn type-check + - name: Configure TSC problem matcher + run: | + echo "::remove-matcher owner=tsc::" + echo "::add-matcher::.github/matchers/tsc-absolute.json" + - run: yarn type-check:ci diff --git a/apps/docs/package.json b/apps/docs/package.json index db0193d055..19b87989d3 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -11,7 +11,8 @@ "lint:fix": "eslint . --ext .ts,.js,.tsx,.jsx --fix", "lint:report": "eslint . --format json --output-file ../../lint-results/docs.json", "start": "PORT=4000 next start", - "type-check": "tsc --pretty --noEmit" + "type-check": "tsc --pretty --noEmit", + "type-check:ci": "tsc-absolute --pretty --noEmit" }, "author": "Cal.com, Inc.", "license": "MIT", diff --git a/apps/web/package.json b/apps/web/package.json index 0f9ae44fd3..c81914821b 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -11,6 +11,7 @@ "dx": "yarn dev", "test-codegen": "yarn playwright codegen http://localhost:3000", "type-check": "tsc --pretty --noEmit", + "type-check:ci": "tsc-absolute --pretty --noEmit", "build": "next build", "start": "next start", "lint": "eslint . --ignore-path .gitignore", diff --git a/package.json b/package.json index 24d5dbb158..6284c3bd83 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "test-playwright": "yarn playwright test --config=playwright.config.ts", "test": "jest", "type-check": "turbo run type-check", + "type-check:ci": "turbo run type-check:ci --log-prefix=none", "web": "yarn workspace @calcom/web" }, "devDependencies": { @@ -88,6 +89,7 @@ "lint-staged": "^12.5.0", "prettier": "^2.8.6", "ts-jest": "^28.0.8", + "tsc-absolute": "^1.0.0", "typescript": "^4.9.4" }, "dependencies": { diff --git a/packages/app-store/package.json b/packages/app-store/package.json index 5b34186878..bc34fa030d 100644 --- a/packages/app-store/package.json +++ b/packages/app-store/package.json @@ -8,6 +8,7 @@ ], "scripts": { "type-check": "tsc --pretty --noEmit", + "type-check:ci": "tsc-absolute --pretty --noEmit", "lint": "eslint . --ext .ts,.js,.tsx,.jsx", "lint:fix": "eslint . --ext .ts,.js,.tsx,.jsx --fix", "lint:report": "eslint . --format json --output-file ../../lint-results/app-store.json" diff --git a/packages/embeds/embed-core/package.json b/packages/embeds/embed-core/package.json index 847c001da0..948bd273b9 100644 --- a/packages/embeds/embed-core/package.json +++ b/packages/embeds/embed-core/package.json @@ -23,6 +23,7 @@ "dev": "yarn tailwind && run-p 'tailwind --watch' 'buildWatchAndServer'", "dev-real": "vite dev --port 3100", "type-check": "tsc --pretty --noEmit", + "type-check:ci": "tsc-absolute --pretty --noEmit", "lint": "eslint --ext .ts,.js src", "lint:fix": "eslint --ext .ts,.js src --fix", "embed-tests": "yarn playwright test --config=playwright/config/playwright.config.ts", diff --git a/packages/embeds/embed-react/package.json b/packages/embeds/embed-react/package.json index 5e26c924b2..0c5c240917 100644 --- a/packages/embeds/embed-react/package.json +++ b/packages/embeds/embed-react/package.json @@ -15,6 +15,7 @@ "preview": "vite preview", "prepare": "NEXT_PUBLIC_EMBED_LIB_URL='https://app.cal.com/embed/embed.js' NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build", "type-check": "tsc --pretty --noEmit", + "type-check:ci": "tsc-absolute --pretty --noEmit", "lint": "eslint --ext .ts,.js,.tsx,.jsx ./src", "embed-tests": "yarn playwright test --config=./playwright/config/playwright.config.ts", "embed-tests-quick": "QUICK=true yarn embed-tests", diff --git a/packages/embeds/embed-snippet/package.json b/packages/embeds/embed-snippet/package.json index 02ba2531c4..57096b0199 100644 --- a/packages/embeds/embed-snippet/package.json +++ b/packages/embeds/embed-snippet/package.json @@ -14,6 +14,7 @@ "scripts": { "build": "vite build && tsc --emitDeclarationOnly --declarationDir dist", "type-check": "tsc --pretty --noEmit", + "type-check:ci": "tsc-absolute --pretty --noEmit", "lint": "eslint --ext .ts,.js src", "prepare": "NEXT_PUBLIC_EMBED_LIB_URL='https://app.cal.com/embed/embed.js' NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com' yarn build", "publish-prod:patch": "yarn publish --access public --patch", diff --git a/packages/ui/package.json b/packages/ui/package.json index 0c0db24515..d23f0c8637 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -12,6 +12,7 @@ "scripts": { "lint": "eslint .", "type-check": "tsc --pretty --noEmit", + "type-check:ci": "tsc-absolute --pretty --noEmit", "lint:fix": "eslint . --fix", "lint:report": "eslint . --format json --output-file ../../lint-results/ui.json" }, diff --git a/turbo.json b/turbo.json index 935c872aba..32a84e2e42 100644 --- a/turbo.json +++ b/turbo.json @@ -128,6 +128,9 @@ "type-check": { "cache": false }, + "type-check:ci": { + "cache": false + }, "@calcom/prisma#db-reset": { "cache": false, "outputs": ["dist/**", "build/**"] diff --git a/yarn.lock b/yarn.lock index e2ca01c027..529e02f735 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16620,6 +16620,7 @@ __metadata: lint-staged: ^12.5.0 prettier: ^2.8.6 ts-jest: ^28.0.8 + tsc-absolute: ^1.0.0 turbo: ^1.8.3 typescript: ^4.9.4 languageName: unknown @@ -31905,6 +31906,13 @@ __metadata: languageName: node linkType: hard +"process-wrapper@npm:^1.0.0": + version: 1.0.0 + resolution: "process-wrapper@npm:1.0.0" + checksum: 442371ccb9b2a2104cc5cdfb6e14a993f726ec3a9540d6a757c964ed2593ffc40c7fa1d0f66eecee6b07e0c107a25c74708d97cc8b9fc7dc3920e769c05ba29b + languageName: node + linkType: hard + "process@npm:^0.11.10": version: 0.11.10 resolution: "process@npm:0.11.10" @@ -37403,6 +37411,19 @@ __metadata: languageName: node linkType: hard +"tsc-absolute@npm:^1.0.0": + version: 1.0.0 + resolution: "tsc-absolute@npm:1.0.0" + dependencies: + process-wrapper: ^1.0.0 + peerDependencies: + typescript: ">=4.6" + bin: + tsc-absolute: dist/index.js + checksum: fe8308f7addddce83012bc1451f7009ae37771b08a9972370b7a46eb63e3dc919783ea3894c06101459335fdb275eda8de300498894e55d460408991f97f5409 + languageName: node + linkType: hard + "tsconfig-paths-webpack-plugin@npm:^4.0.0": version: 4.0.0 resolution: "tsconfig-paths-webpack-plugin@npm:4.0.0"