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

Aberta
#694 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
rust, typescript, vite
Domínio
build-system, tooling

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Rust
Estrelas
245
Forks
26
Merge médio
1d 42min
PRs com merge (30d)
83

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de voidzero-dev/oxc-angular-compiler

Todas as issues de voidzero-dev/oxc-angular-compiler

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.