Skip to content

Conversation

@mondoreale
Copy link
Contributor

@mondoreale mondoreale commented Dec 15, 2025

This pull request refactors TypeScript configuration across multiple packages to improve handling of generated code and project references, and updates some package scripts for consistency. It also includes minor code improvements for clarity and correctness.

Note

Previously, noImplicitOverride was explicitly set to false across the app. This was not a design choice, but a workaround: the auto-generated protobuf types were incompatible with noImplicitOverride, and there was no proper isolation at the tsconfig level to scope that limitation. As a result, stricter typing guarantees were relaxed globally.

Changes in this PR are the remaining step towards bringing the restriction back, making the types stricter again.

Changes

TypeScript configuration improvements:

  • Introduced separate tsconfig.generated.json files in several packages (such as autocertifier-client, dht, proto-rpc, and sdk) to isolate generated code and manage its compilation independently. These are now referenced in the main and test TypeScript configs. [1] [2] [3]
  • Updated tsconfig.json and tsconfig.jest.json files to remove noImplicitOverride: false (now set only in generated configs), exclude generated directories from main source includes, and add references to the new generated configs. [1] [2] [3] [4] [5] [6] [7] [8]

Project reference and dependency cleanup:

  • Reordered and clarified project references in several tsconfig.json files to ensure correct dependency resolution and build order. [1] [2] [3] [4] [5]

Package script updates:

  • Changed the check script in several package.json files to use tsc -b (build mode) instead of tsc -p, aligning with project references and improving type checking. [1] [2] [3] [4]

Minor code improvements:

  • Added override keyword to overridden methods in test and implementation files for better type safety and clarity. [1] [2] [3] [4]

@mondoreale mondoreale requested a review from Copilot December 15, 2025 23:17
@github-actions github-actions bot added network Related to Network Package dht Related to DHT package proto-rpc sdk labels Dec 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors TypeScript configuration across multiple packages to enable stricter type checking by setting noImplicitOverride to true for non-generated code. The refactoring isolates auto-generated protobuf code into separate configuration files with relaxed type checking, while enforcing stricter typing in hand-written source code.

Key changes:

  • Introduced tsconfig.generated.json files in 5 packages (autocertifier-client, dht, proto-rpc, sdk, trackerless-network) to isolate generated code with noImplicitOverride: false
  • Removed noImplicitOverride: false from main tsconfig.json and tsconfig.jest.json files to enable stricter override checking
  • Updated build scripts to use tsc -b for proper project reference support

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/trackerless-network/tsconfig.json Removed noImplicitOverride: false, excluded generated code, added reference to tsconfig.generated.json
packages/trackerless-network/tsconfig.jest.json Removed compiler options override, added reference to tsconfig.generated.json
packages/trackerless-network/tsconfig.generated.json New file isolating generated code with relaxed type checking
packages/trackerless-network/package.json Updated check script to use tsc -b for project references
packages/sdk/tsconfig.json Removed noImplicitOverride: false, excluded src/generated, added reference to tsconfig.generated.json
packages/sdk/tsconfig.jest.json Removed noImplicitOverride: false, excluded src/generated, added reference to tsconfig.generated.json
packages/sdk/tsconfig.generated.json New file isolating generated code with relaxed type checking
packages/sdk/src/identity/EthereumKeyPairIdentity.ts Added override keyword to getTransactionSigner method
packages/sdk/package.json Updated check script to use tsc -b for project references
packages/proto-rpc/tsconfig.json Removed noImplicitOverride: false, excluded generated from include, added reference to tsconfig.generated.json
packages/proto-rpc/tsconfig.jest.json Removed compiler options override, added reference to tsconfig.generated.json
packages/proto-rpc/tsconfig.generated.json New file isolating generated code with relaxed type checking
packages/proto-rpc/package.json Updated check script to use tsc -b for project references
packages/dht/tsconfig.json Removed noImplicitOverride: false, excluded generated code, added reference to tsconfig.generated.json
packages/dht/tsconfig.jest.json Removed compiler options override, added reference to tsconfig.generated.json
packages/dht/tsconfig.generated.json New file isolating generated code with relaxed type checking
packages/dht/test/utils/utils.ts Added override keyword to stop methods in anonymous classes
packages/dht/test/unit/PeerManager.test.ts Added override keyword to ping method in anonymous class
packages/dht/package.json Updated check script to use tsc -b for project references
packages/autocertifier-client/tsconfig.json Removed noImplicitOverride: false, excluded generated from include, added reference to tsconfig.generated.json
packages/autocertifier-client/tsconfig.generated.json New file isolating generated code with relaxed type checking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mondoreale mondoreale force-pushed the clean-libs-in-sdks-tsconfigs branch from 330c33c to b3f9c28 Compare December 16, 2025 14:17
Base automatically changed from clean-libs-in-sdks-tsconfigs to main December 16, 2025 15:17
@mondoreale mondoreale force-pushed the enable-noImplicitOverride-on-remaining-packages branch from 4b49512 to 9f31c91 Compare December 16, 2025 15:47
@github-actions github-actions bot added the cli-tools Related to CLI Tools Package label Dec 16, 2025
@mondoreale mondoreale requested a review from Copilot December 16, 2025 16:13
@mondoreale mondoreale marked this pull request as ready for review December 16, 2025 16:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

cli-tools Related to CLI Tools Package dht Related to DHT package network Related to Network Package proto-rpc sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants