From 20de3346420f1032b6ba69850415a4e3df241c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Louren=C3=A7o?= Date: Wed, 2 Sep 2026 10:03:48 -0300 Subject: [PATCH] feat(turbo): add type-check script to packages --- .github/workflows/test-ui.yml | 2 +- apps/docs/css.modules.d.ts | 5 +++++ apps/docs/package.json | 2 +- apps/docs/tsconfig.json | 5 +++++ package.json | 2 +- packages/typescript-config/base.json | 2 +- packages/ui/package.json | 3 ++- packages/ui/tsconfig.json | 3 ++- turbo.json | 3 ++- 9 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-ui.yml b/.github/workflows/test-ui.yml index 2116f568..0bdebdf8 100644 --- a/.github/workflows/test-ui.yml +++ b/.github/workflows/test-ui.yml @@ -76,7 +76,7 @@ jobs: run: pnpm build - name: Type check - run: pnpm run type-check + run: pnpm type-check - name: Run tests run: pnpm test diff --git a/apps/docs/css.modules.d.ts b/apps/docs/css.modules.d.ts index 5b5c1c7a..aef5a58c 100644 --- a/apps/docs/css.modules.d.ts +++ b/apps/docs/css.modules.d.ts @@ -2,3 +2,8 @@ declare module '*.module.css' { const classes: { readonly [key: string]: string }; export default classes; } + +declare module '*.module.scss' { + const classes: { readonly [key: string]: string }; + export default classes; +} diff --git a/apps/docs/package.json b/apps/docs/package.json index 70aefb7f..28a976ee 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -11,7 +11,7 @@ "clean": "rm -rf .turbo && rm -rf node_modules", "chromatic": "pnpm dlx chromatic --exit-zero-on-changes --config-file 'chromatic.config.json'", "test": "VITEST_CHROMIUM_GC_DISK_THRESHOLD_GB=100000 vitest run", - "test-storybook": "vitest --project=storybook" + "type-check": "tsgo --noEmit" }, "dependencies": { "@radix-ui/react-tabs": "^1.1.19", diff --git a/apps/docs/tsconfig.json b/apps/docs/tsconfig.json index 233f000b..769e1b50 100644 --- a/apps/docs/tsconfig.json +++ b/apps/docs/tsconfig.json @@ -1,5 +1,10 @@ { "extends": "@repo/typescript-config/react-library.json", + "compilerOptions": { + "paths": { + "@signozhq/ui": ["../../packages/ui/src/index.ts"] + } + }, "include": ["."], "exclude": ["dist", "build", "node_modules"] } diff --git a/package.json b/package.json index 41202af0..218224e3 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "turbo run build", "publint": "turbo run publint", "dev": "turbo run dev", - "type-check": "tsgo --noEmit -p tsconfig.json", + "type-check": "turbo run type-check", "lint": "oxlint", "lint:fix": "oxlint --fix", "clean": "turbo run clean && rm -rf node_modules", diff --git a/packages/typescript-config/base.json b/packages/typescript-config/base.json index 1d9c4f4f..999b057a 100644 --- a/packages/typescript-config/base.json +++ b/packages/typescript-config/base.json @@ -18,7 +18,7 @@ "preserveWatchOutput": true, "skipLibCheck": true, "strict": true, - "lib": ["dom", "ES2018"], + "lib": ["dom", "ES2022"], "target": "es2018" }, "exclude": ["node_modules"] diff --git a/packages/ui/package.json b/packages/ui/package.json index bd3196a8..a032e452 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -410,7 +410,8 @@ "test": "vitest run", "test:run": "vitest run", "tokens": "node scripts/extract-css-tokens.mjs", - "tokens:check": "node scripts/extract-css-tokens.mjs --check" + "tokens:check": "node scripts/extract-css-tokens.mjs --check", + "type-check": "tsgo --noEmit" }, "dependencies": { "@chenglou/pretext": "^0.0.8", diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index 5bcc144a..cd2e1151 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -7,7 +7,8 @@ "node_modules", "src/**/*.test.ts", "src/**/*.test.tsx", - "src/**/*.test-utils.tsx" + "src/**/*.test-utils.tsx", + "src/__tests__" ], "compilerOptions": { "rootDir": "src", diff --git a/turbo.json b/turbo.json index 03ef5121..e1fec636 100644 --- a/turbo.json +++ b/turbo.json @@ -28,6 +28,7 @@ // The Playwright container image points browsers at /ms-playwright; strict // env mode would otherwise hide it and Playwright would look under $HOME. "passThroughEnv": ["PLAYWRIGHT_BROWSERS_PATH"] - } + }, + "type-check": {} } }