Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 5, 2025

TypeScript files in test/ directories (outside src/) were not being type-checked because they weren't included in package tsconfig.json files, and tsup only type-checks files in its build entries.

Changes

tsconfig.json updates

Updated tsconfig.json for packages with test/ directories:

  • packages/blobs - Added "test" to include
  • packages/dev - Added "test" to include
  • packages/functions/prod - Added "test" to include, excluded "test/types" (contains tsd type-testing files with intentional errors)

package.json updates

Added explicit type-checking scripts to ensure test files are type-checked independently of tsup:

  • packages/blobs - Added "test:ci:types": "tsc --noEmit" script that runs as part of test:ci:*
  • packages/dev - Added "test:types": "tsc --noEmit" and "test:vitest": "vitest run" scripts, updated test commands to run both
  • packages/functions/prod - Added "test:ci:types": "tsc --noEmit" script that runs as part of test:ci:*

Notes

  • Packages with src/test/ (cache, dev-utils) already covered by "src" include
  • Packages vite-plugin-tanstack-start and nuxt-module already included test directories
  • Type-checking now runs via explicit tsc --noEmit commands as part of the test suite, not relying on tsup's build process
Original prompt

Issue Title: Fix lack of type-checking of test/ directories
Issue Description: Some of the netlify/primitives packages have .ts files outside their src/ directories, but not all of these have a tsconfig.json + tsup.config.ts configuration that includes these paths (e.g. test/) — thus they are not type-checked.
Fixes https://linear.app/netlify/issue/FRB-1870/fix-lack-of-type-checking-of-test-directories

Comment by User db2967f5-c49c-428b-ae14-6c61855027c1:
netlify/primitives

Comment by User c8ba5c18-8b2b-41c2-8484-9ca4ad793475:
📋 I wasn't able to determine which GitHub repository to work in.

Please tell me which repository this work should be done in using the format owner/repository-name (e.g., github/copilot), then I'll automatically start working on it!

Comment by User :
This thread is for an agent session with githubcopilot.

Comment by User e186620e-0ca5-4c3e-8da4-8665bb797a9b:
Cloud Agent requires at least $2 remaining until your hard limit. Please increase your hard limit or enable usage-based pricing.

Try again or contact Cursor support at hi@cursor.com.

Request ID: serverGenReqId_c3cfeb85-6326-4e5b-b42e-97bccd387a20

Comment by User :
This thread is for an agent session with cursor.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix lack of type-checking for test directories in netlify packages Fix type-checking of test/ directories Nov 5, 2025
Copilot AI requested a review from serhalp November 5, 2025 16:35
Copilot finished work on behalf of serhalp November 5, 2025 16:35
Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

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

@copilot I don't believe this is sufficient, is it? because we're using tsup only, anything that isn't built/touched by a tsup entry doesn't get type-checked by anything. find an idiomatic way to solve this if you can.

Co-authored-by: serhalp <1377702+serhalp@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 5, 2025

@copilot I don't believe this is sufficient, is it? because we're using tsup only, anything that isn't built/touched by a tsup entry doesn't get type-checked by anything. find an idiomatic way to solv...

You're right. I've added explicit tsc --noEmit type-checking scripts to the test suites for the three affected packages (blobs, dev, functions/prod). The test files are now type-checked independently of tsup's build process. See commit 0bc670a.

Copilot AI requested a review from serhalp November 5, 2025 17:05
Copilot finished work on behalf of serhalp November 5, 2025 17:05
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