dts: declarations from vite-plugin-dts, tsc and tsdown's .d.cts are not augmented

Offen
#694 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
rust, typescript, vite

Rechercherichtung

Start by reading the dts plugin implementation around generateBundle and compare it with the writeBundle behavior described for vite-plugin-dts and the separate tsdown CJS declaration pass. Reproduce the Vite and tsdown cases using the versions and outputs listed in the issue, then determine which proposed integration point can cover declarations written outside the bundle. Done means generated .d.ts and .d.cts files receive the required augmentation in these cases.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Found while reviewing #683 (the README now says this; this issue tracks support).

The dts plugin only sees declarations that are in the bundle at generateBundle. These are written outside it, so libraries built with them still ship plain classes and consumers fail with NG2012, as in #681:

generator why it is missed
vite-plugin-dts 5.x (unplugin-dts) writes .d.ts with fs.writeFile in writeBundle, after generateBundle
tsc writes files itself
tsdown format: 'cjs' / dual builds .d.cts in a separate pass that leaves out user plugins; only .d.mts is augmented

Checked with Vite 8.3.6 lib mode + vite-plugin-dts 5.1.2 (0 ɵ members in every .d.ts), and tsdown 0.23.7 esm+cjs (.d.mts augmented, .d.cts plain).

Possible directions: a writeBundle / closeBundle pass that rewrites .d.ts files on disk in the output dir, an exported helper users can call from tsdown's build:done hook, or an upstream hook in tsdown's cjs dts pass.

Vorherrschende Sprache
Rust
Sterne
245
Forks
26
Ø Merge
1 T. 42 Min.
Gemergte PRs (30 T.)
83

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus voidzero-dev/oxc-angular-compiler

Alle Issues in voidzero-dev/oxc-angular-compiler

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.