Repository navigation
Emit plain .d.ts for libraries with outputExtensions (TS 7 nightly 20261014) - #41
Draft
NullVoxPopuli wants to merge 4 commits into
Draft
NullVoxPopuli wants to merge 4 commits into
NullVoxPopuli wants to merge 4 commits into
Conversation
TypeScript 7.1.0-dev.20261014.1 adds `outputExtensions` to content mapper entries (microsoft/TypeScript#64581, fixing #64053). The library example opts in, so counter.gts emits counter.d.ts and declarations/ matches dist/. - Bump the TypeScript 7 nightly to 7.1.0-dev.20261014.1. - Document "Publishing a library" in the README and point the migration guide at it. - Add a declaration-output-extensions fixture and test. The mapper's package.json does not set a default: apps would then need rewriteRelativeImportExtensions, which reports TS2877 for non-relative extension imports such as #app/components/counter.gts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🏎️ Benchmark Comparison
Full mitata output |
NullVoxPopuli
marked this pull request as ready for review
October 14, 2026 22:33
NullVoxPopuli
marked this pull request as draft
October 14, 2026 22:33
This nightly includes microsoft/TypeScript#64072 (the #64058 fix). It applies the JSDoc @extends type arguments to the call's return type, so over Component.extend(Evented), which returns a constructor that is not generic, the error changes to TS2508 and the signature is still lost. Update the upstream-differences snapshot and docs to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Important
Still blocked. Two upstream problems remain on
7.1.0-dev.20261015.1. See "Before this can continue" below.Libraries can now emit
counter.d.tsinstead ofcounter.d.gts.ts, sodeclarations/matchesdist/file for file. This uses the newoutputExtensionsoption from microsoft/TypeScript#64581, which fixes microsoft/TypeScript#64053.Changes
examples/cli-library-v2: setsoutputExtensions: { ".gts": ".js", ".gjs": ".js" }andrewriteRelativeImportExtensions: true. The emittedindex.d.tsnow saysfrom './components/counter.js', and the./*→./declarations/*.d.tsexport works for every module. I removed the README note saying it didn't.MIGRATING_FROM_TS6.mdlinks the #64053 item to it.declaration-output-extensionsfixture checks thatGreeting.d.tsis emitted andGreeting.d.gts.tsis not.7.1.0-dev.20260821.1to7.1.0-dev.20261014.1.Why the mapper's package.json doesn't set a default
typescript.contentMapper.outputExtensionscan go in the mapper's package.json, but I didn't add it:outputExtensionsrequiresrewriteRelativeImportExtensions. Without it, tsc reportsTS18120, even with--noEmit.TS2877. Their extension imports aren't relative (#app/...,cli-app/...), so they can't be rewritten."outputExtensions": {}, but libraries are the ones that emit.The other manifest fields don't help either:
compilerOptionsonly lists which options get forwarded to the mapper. It can't set them.Before this can continue
Now on
7.1.0-dev.20261015.1(second commit). Two problems remain.@extendsoverComponent.extend(Mixin)microsoft/TypeScript#64072 applies the tag's type arguments to the call's return type. Ember's
Component.extend(Evented)returns a constructor that is not generic.TS2508: No base constructor has the specified number of type arguments, and the signature is still lost.20261015.1fails.upstream-differencessnapshot and the docs match the new output. JSDoc @extends signature is lost for classic components with expression heritage (Component.extend(Mixin)) #12 stays open.Go-to-definition on a
.gtsimport specifiertest/lsp.js"go to definition from a .ts import into a .gts module" fails.[]. On20260821.1it returnedcounter.gtsat 0:0..tsfiles and lookups by name still work.20260821.1, first bad20260822.1.The
outputExtensionswork itself is done.Tracking: #23
🤖 Generated with Claude Code