refactor: Detach tsconfigs for Jest from the build#3301
Merged
Conversation
Let it have its own small area in the corner of the room but don't allow it close to the main playground. ;) But seriously, this is an attempt to satisfy eslint's project service and keep build and tests separated.
We'll address it separately as some of them cause trouble.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the TypeScript configuration structure across the monorepo to streamline the build and test processes. The main goal is to detach Jest configuration from the build pipeline by consolidating tsconfig.node.json files into main tsconfig.json files and ensuring Jest configs explicitly disable code emission.
Key changes:
- Renamed
tsconfig.node.jsontotsconfig.jsonin each package, making it the primary configuration entry point - Added explicit
noEmit,declaration:false,composite:false, andincremental:falsesettings to roottsconfig.jest.jsonto prevent accidental code emission - Simplified build scripts to
tsc -band check scripts totsc -p tsconfig.jest.jsonacross all packages - Created dedicated
test/tsconfig.jsonfiles that extend from parenttsconfig.jest.jsonfor proper test file resolution - Updated TypeScript project references to point to package directories instead of specific config files
- Removed
referencesfields fromtsconfig.jest.jsonfiles as they are no longer needed for the check-only workflow
Reviewed changes
Copilot reviewed 62 out of 63 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.jest.json | Added compiler options to properly disable emission (noEmit, declaration, composite, incremental, sourceMap) |
| packages/*/tsconfig.node.json | Removed - merged into main tsconfig.json |
| packages/*/tsconfig.json | Consolidated from tsconfig.node.json, updated references to use directory paths instead of explicit config file paths |
| packages/*/tsconfig.jest.json | Removed references field, updated include paths |
| packages/*/test/tsconfig.json | Added new configs extending parent jest config for test directories |
| packages/*/package.json | Simplified build to tsc -b and check to tsc -p tsconfig.jest.json |
| packages/sdk/webpack-karma.config.ts | Changed from namespace import to default import for webpack config |
| packages/trackerless-network/tsconfig.karma.json | Removed "generated" from include array |
| packages/cdn-location/tsconfig.data-generation.json | Removed - replaced with data-generation/tsconfig.json |
| packages/dht/scripts/postbuild.sh | Removed explicit -P tsconfig.node.json flag from ts-node command |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Dec 15, 2025
juslesan
approved these changes
Dec 16, 2025
Contributor
Author
|
I'll merge this in and let's see how it behaves! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors TypeScript configuration across several packages to simplify project structure and build scripts. It removes redundant or legacy
tsconfig.node.jsonand related files, consolidates configuration into maintsconfig.jsonfiles, and updates references and build scripts accordingly. The changes aim to reduce duplication, streamline TypeScript project references, and make the build and test processes more maintainable.Note
In essence, this PR
build–tsc -bacross the board.check–tsc -p tsconfig.jest.jsontsconfig.jsonfiles.💡
test/dirs have their owntsconfig.jsonfiles that satisfy eslint's project service resolver.tsconfig.node.jsontotsconfig.jsonmaking it the main entrypoint of each package.referencesfield fromtsconfig.jest.jsonfiles as these produce a lot of unnecessary noise and we don't "build" through these.tsconfig.jest.jsondisable emitting properly – we *don't* reference jest tsconfigs anymore!💡 Although tsc does not complain, previously this behaviour was against the rules of
compositetsconfig setup – makes it hard to predict what the outcome is (will it emit, or it won't?).It also covers a lot of what the following PRs offer:
dhtpackage #3271geoip-locationpackage #3272nodepackage #3273proto-rpcpackage #3274sdkpackage #3275test-utilspackage #3276trackerless-networkpackage #3277Changes
TypeScript configuration consolidation:
Removed
tsconfig.node.jsonand related files from multiple packages (autocertifier-server,cdn-location,cli-tools), consolidating configuration into maintsconfig.jsonfiles and updating theirextends,include, andreferencesfields for clarity and maintainability. [1] [2] [3] [4] [5] [6] [7] [8]Updated
tsconfig.jest.jsonfiles to directly include relevant source, test, and config files, and removed obsolete project references. [1] [2] [3]Build and check script simplification:
Simplified
checkandbuildscripts inpackage.jsonfiles to use the consolidated TypeScript configs, removing redundant or chained TypeScript invocations. [1] [2] [3] [4]Updated shell scripts and build commands to no longer rely on removed config files.
Test configuration improvements:
test/tsconfig.jsonfiles in several packages to ensure test files are properly included and configured for TypeScript and Jest. [1] [2]Overall, these changes make the TypeScript setup across packages more consistent, easier to understand, and less error-prone.