Skip to content

chore: type-check spec files in demo and ai-studio - #153

Open
librowski wants to merge 1 commit into
mainfrom
chore/typecheck-app-specs
Open

librowski wants to merge 1 commit into
mainfrom
chore/typecheck-app-specs

Conversation

@librowski

Copy link
Copy Markdown
Collaborator

Summary

apps/demo and apps/ai-studio excluded src/**/*.spec.* and src/**/*.test.* from their tsconfig, so tsc --noEmit never type-checked tests and CI stayed green with type errors in them. Both exclusions come from the initial 2.0.0 import, before either app had a test. packages/sdk and packages/ui already type-check their specs.

Neither tsconfig emits anything (vite builds the apps), so the exclusion only removed a check.

Changes

  • apps/demo/tsconfig.json and apps/ai-studio/tsconfig.json: exclude keeps only dist.

Checks

  • pnpm -F @workflow-builder/demo typecheck and pnpm -F ai-studio typecheck pass with no code changes; both AI Studio test files import vitest explicitly.
  • A deliberate const probe: number = 'x' appended to detect-format.test.ts fails the AI Studio typecheck, so tests are now covered.
  • AI Studio tests: 16 passing.

Both app tsconfigs excluded spec and test files, so tsc never saw them
and CI passed with type errors in tests. The exclusion predates the
first tests in these apps; removing it needs no code changes.
@@ -9,5 +9,5 @@
"verbatimModuleSyntax": true,
"types": ["node", "vite/client", "vite-plugin-svgr/client"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since test.globals: true is on in both apps, could you add "vitest/globals" to types here and in apps/demo/tsconfig.json, like packages/sdk and packages/ui do? Otherwise a spec written in the ui style (describe without an import) passes vitest but fails the new typecheck with TS2593 and a confusing @types/jest hint. I checked: with it added, such a spec type-checks and the app stays green.

"types": ["node", "vite/client", "vite-plugin-svgr/client"]
},
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.spec.tsx", "src/**/*.test.tsx", "dist"]
"exclude": ["dist"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small accuracy note on the summary and the commit message: pr-check.yml never type-checks demo or ai-studio (its header comment says so), so CI was not the thing staying green. The guard this restores is the pre-commit tsc --noEmit from lint-staged and pnpm check. Worth rewording before the squash so git blame tells the right story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants