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

Aperta
#694 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust, typescript, vite

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
245
Fork
26
Merge medio
1g 42m
PR unite (30g)
83

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di voidzero-dev/oxc-angular-compiler

Tutte le issue di voidzero-dev/oxc-angular-compiler

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.