Skip to content

Conversation

pulpdrew
Copy link
Contributor

@pulpdrew pulpdrew commented Sep 9, 2025

Summary

This PR updates the structure of our tsconfigs so that IDEs (namely, VSCode) can successfully typecheck test files (which were previously excluded by the default tsconfig files in each package.

The new structure is as follows:

  • Each package has a tsconfig.json. This is where the bulk of the configuration is, and is the file read by VSCode. It includes both source and test files.
    • The api and common-utils tsconfig.json each extend from the same tsonfig.base.json in the root directory, since they had quite a bit of shared configuration. The app package's tsconfig is sufficiently different that sharing a config between app and api was less helpful.
  • Each package has a tsconfig.build.json file. This extends the tsconfig.json and excludes test files. This file is used during builds (next build for the app package and tsc for the api package)
    • The common utils package is built using tsup, which does not run typechecking, so there is no need for a tsconfig.build.json in the common utils package. The tsconfig.json in the common utils package is used for linting, and both source and test files will be linted.

Testing

IDE errors on test files are gone:
Screenshot 2025-09-10 at 2 07 17 PM

The image builds locally using make build-local:
Screenshot 2025-09-10 at 2 06 04 PM

That image runs locally:
Screenshot 2025-09-10 at 2 06 28 PM
Screenshot 2025-09-10 at 2 05 21 PM

Copy link

changeset-bot bot commented Sep 9, 2025

🦋 Changeset detected

Latest commit: fe3b9b1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/common-utils Patch
@hyperdx/api Patch
@hyperdx/app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview Comment Sep 10, 2025 8:07pm

Copy link
Contributor

github-actions bot commented Sep 9, 2025

Stably Runner - Test Suite - 'Smoke Test'

Test Suite Run Result: 🟢 Success (4/4 tests passed) [dashboard]


This comment was generated from stably-runner-action

@teeohhem teeohhem requested review from a team and brandon-pereira and removed request for a team September 10, 2025 02:40
@@ -0,0 +1,33 @@
{
"compilerOptions": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible for us to share the tsconfig base across api and app using this config, or are they fairly diverged?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The api and common-utils configs had a lot of overlap, so I created a tsconfig.base to share between them (great idea!). There was a lot less overlap between app and the others though, so I didn't think it would be worth it to create a base config that all three packages could share

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, should I try it locally? It looks good to me from my scan of the changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, if you could confirm the IDE type issues are gone for you locally as well, that would be great!

@pulpdrew pulpdrew marked this pull request as ready for review September 10, 2025 18:52
@pulpdrew pulpdrew requested review from a team and SpencerTorres and removed request for a team September 10, 2025 18:52
@wrn14897
Copy link
Member

wrn14897 commented Sep 10, 2025

Change looks good! Good improvement. Please commit the changeset

@pulpdrew
Copy link
Contributor Author

Change looks good! Good improvement. Please commit the changeset

@wrn14897 Thanks, added the changeset

Copy link
Contributor

@brandon-pereira brandon-pereira left a comment

Choose a reason for hiding this comment

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

Fixed for me locally, nice work!

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.

3 participants