Repository navigation
test(bundler-tests): typecheck packages under legacy module resolution - #7127
Merged
overbalance merged 1 commit intoSep 28, 2026
Merged
Conversation
overbalance
force-pushed
the
overbalance/add-legacy-ts-test
branch
from
September 27, 2026 21:58
8aaf03e to
294b216
Compare
Pull request dashboard statusMerged · refreshed 2026-09-28 17:21 UTC Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7127 +/- ##
=======================================
Coverage 94.77% 94.77%
=======================================
Files 384 384
Lines 13476 13476
Branches 3095 3095
=======================================
Hits 12772 12772
Misses 704 704 🚀 New features to boost your workflow:
|
overbalance
marked this pull request as ready for review
September 27, 2026 22:03
david-luna
approved these changes
Sep 28, 2026
david-luna
left a comment
Contributor
There was a problem hiding this comment.
LGTM. I wonder if the minimum TS version should be bumped.
Contributor
Author
|
@david-luna According to OTel docs it should be 5.2.2 to satisfy the two year commitment |
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.
Which problem is this PR solving?
Nothing in CI typechecks the published packages the way a TypeScript consumer on
"moduleResolution": "node"(node10) sees them. That mode ignoresexportsandimports, and is still the default for many CommonJS projects.The packages with platform-specific code are the ones at risk. Their public entry points re-export from an internal platform module. If that re-export stops resolving under node10, TypeScript types the symbols as
any. WithskipLibCheck: true, which is common in consumer projects, it does so without any error. Moving platform resolution topackage.json#imports(#platform) would cause exactly this regression, and nothing would catch it today.Short description of the changes
Adds
bundler-tests/node/typescript-legacy. It is atsc --noEmitproject withmoduleResolution: "node"and TypeScript~5.0.4, which is the documented minimum. It imports every public platform-specific export and asserts that none of them isany:@opentelemetry/core:SDK_INFOand the fourget*FromEnvhelpers@opentelemetry/resources:hostDetector,osDetector,processDetectorandserviceInstanceIdDetector@opentelemetry/sdk-trace:BatchSpanProcessorandRandomIdGenerator@opentelemetry/sdk-logs:BatchLogRecordProcessor@opentelemetry/instrumentation:InstrumentationBase@opentelemetry/exporter-zipkin:prepareSendThe tsconfig sets two options explicitly:
skipLibCheck: false, so that ananynested inside a type (for example a constructor's config parameter) still fails the build. The top-levelIsAnychecks do not catch that case.types: [], so that ambient@typesfrom the monorepo root stay out of the program. A real consumer would not have them.The project is discovered through
project.jsonand runs in the existingbundler-testsworkflow vianx run-many -t test:bundle, the same way as the webpack projects.Type of change
This is test-only. No package code changes.
How Has This Been Tested?
npm run compile, thennpm run test:bundleinbundler-tests/node/typescript-legacy. It passes onmain..d.ctsfiles still contained unresolvedfrom "#platform"re-exports. It fails with TS2307 in each package'sdist/index.d.ctsand TS2344 on every assertion.#platform, plus a localany. Both fail the check.Checklist: